Plugin Directory

Changeset 3304286


Ignore:
Timestamp:
06/01/2025 01:48:26 PM (10 months ago)
Author:
kouroshweb
Message:

Updated to version 1.8.9.80

Location:
reality-shop-3d/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • reality-shop-3d/trunk/RealityShop3D.php

    r3303917 r3304286  
    44Plugin URI: https://en.kouroshweb.com/
    55Description: Reality shop is a free 3D WordPress plugin for Elementor and WooCommerce fully compatible, Lightweight and high-performance settings.
    6 Version: 1.8.9.79
     6Version: 1.8.9.80
    77Author: kouroshweb
    88Author URI: https://en.kouroshweb.com/
  • reality-shop-3d/trunk/assets/php/widgets/widget-glb-shortcode.php

    r3302854 r3304286  
    11<?php
    22if (!defined('ABSPATH')) {
    3     exit; // جلوگیری از دسترسی مستقیم
     3    exit;
    44}
    55
     
    2121        return ['reality_shop_3d'];
    2222    }
    23    
    24     // تنظیمات ویجت
     23
    2524    protected function _register_controls() {
    2625        $this->start_controls_section(
     
    3231        );
    3332
    34         // تنظیمات عرض و ارتفاع Canvas
    35         $this->add_control(
    36             'canvas_width',
     33        $this->add_control('canvas_width', [
     34            'label' => esc_html__('Canvas Width', 'reality-shop-3d'),
     35            'type' => \Elementor\Controls_Manager::NUMBER,
     36            'default' => 500,
     37        ]);
     38
     39        $this->add_control('canvas_height', [
     40            'label' => esc_html__('Canvas Height', 'reality-shop-3d'),
     41            'type' => \Elementor\Controls_Manager::NUMBER,
     42            'default' => 500,
     43        ]);
     44
     45        $this->add_control('slider_max', [
     46            'label' => esc_html__('Slider Max', 'reality-shop-3d'),
     47            'type' => \Elementor\Controls_Manager::NUMBER,
     48            'default' => 5,
     49        ]);
     50
     51        $this->add_control('custom_shortcode', [
     52            'label' => esc_html__('Custom Shortcode', 'reality-shop-3d'),
     53            'type' => \Elementor\Controls_Manager::TEXT,
     54            'default' => '',
     55        ]);
     56
     57        $this->add_control('background_color', [
     58            'label' => esc_html__('Background Color', 'reality-shop-3d'),
     59            'type' => \Elementor\Controls_Manager::COLOR,
     60            'default' => 'null',
     61        ]);
     62
     63        $this->add_control('background_null', [
     64            'label' => esc_html__('Remove Background', 'reality-shop-3d'),
     65            'type' => \Elementor\Controls_Manager::SWITCHER,
     66            'return_value' => 'yes',
     67        ]);
     68
     69        $this->add_control('zoom', [
     70            'label' => esc_html__('Enable zoom', 'reality-shop-3d'),
     71            'type' => \Elementor\Controls_Manager::SWITCHER,
     72            'return_value' => 'yes',
     73        ]);
     74
     75        $this->add_control('autoRotate', [
     76            'label' => esc_html__('Enable auto rotate', 'reality-shop-3d'),
     77            'type' => \Elementor\Controls_Manager::SWITCHER,
     78            'return_value' => 'yes',
     79        ]);
     80
     81        $this->add_control('fullScreen', [
     82            'label' => esc_html__('Enable full screen', 'reality-shop-3d'),
     83            'type' => \Elementor\Controls_Manager::SWITCHER,
     84            'return_value' => 'yes',
     85        ]);
     86
     87        $this->add_control('lazyLoad', [
     88            'label' => esc_html__('Enable lazy load', 'reality-shop-3d'),
     89            'type' => \Elementor\Controls_Manager::SWITCHER,
     90            'return_value' => 'yes',
     91        ]);
     92
     93        $open_modal = get_option('reality_shop_open_in_modal');
     94        if (!empty($open_modal)) {
     95            $this->add_control('open_in_modal_content', [
     96                'label' => esc_html__('Modal Content Message', 'reality-shop-3d'),
     97                'type' => \Elementor\Controls_Manager::TEXTAREA,
     98                'default' => 'Your 3D model will open in a modal.',
     99            ]);
     100        }
     101
     102        $this->end_controls_section();
     103
     104        // 🎨 تنظیمات استایل متن
     105        $this->start_controls_section(
     106            'style_section',
    37107            [
    38                 'label'       => esc_html__('Canvas Width', 'reality-shop-3d'),
    39                 'type'        => \Elementor\Controls_Manager::NUMBER,
    40                 'default'     => 500,
    41                 'description' => esc_html__('Width of the 3D canvas in pixels.', 'reality-shop-3d'),
     108                'label' => esc_html__('Text Style', 'reality-shop-3d'),
     109                'tab' => \Elementor\Controls_Manager::TAB_STYLE,
    42110            ]
    43111        );
    44112
    45         $this->add_control(
    46             'canvas_height',
     113        $this->add_control('text_color', [
     114            'label' => esc_html__('Text Color', 'reality-shop-3d'),
     115            'type' => \Elementor\Controls_Manager::COLOR,
     116            'selectors' => [
     117                '{{WRAPPER}} .rs3d-widget-text' => 'color: {{VALUE}};',
     118            ],
     119        ]);
     120
     121        $this->add_group_control(
     122            \Elementor\Group_Control_Typography::get_type(),
    47123            [
    48                 'label'       => esc_html__('Canvas Height', 'reality-shop-3d'),
    49                 'type'        => \Elementor\Controls_Manager::NUMBER,
    50                 'default'     => 500,
    51                 'description' => esc_html__('Height of the 3D canvas in pixels.', 'reality-shop-3d'),
     124                'name' => 'typography',
     125                'label' => esc_html__('Typography', 'reality-shop-3d'),
     126                'selector' => '{{WRAPPER}} .rs3d-widget-text',
    52127            ]
    53128        );
    54129
    55         // تنظیمات دیگر
    56         $this->add_control(
    57             'slider_max',
    58             [
    59                 'label'       => esc_html__('Slider Max', 'reality-shop-3d'),
    60                 'type'        => \Elementor\Controls_Manager::NUMBER,
    61                 'default'     => 5,
    62                 'description' => esc_html__('Maximum brightness value.', 'reality-shop-3d'),
    63             ]
    64         );
    65 
    66         $this->add_control(
    67             'custom_shortcode',
    68             [
    69                 'label'       => esc_html__('Custom Shortcode', 'reality-shop-3d'),
    70                 'type'        => \Elementor\Controls_Manager::TEXT,
    71                 'placeholder' => esc_html__('Enter a custom shortcode if needed', 'reality-shop-3d'),
    72                 'default'     => '',
    73                 'description' => esc_html__('Enter a custom shortcode here. If empty, the product\'s meta shortcode will be used.', 'reality-shop-3d'),
    74             ]
    75         );
    76 
    77         // رنگ پس‌زمینه
    78         $this->add_control(
    79             'background_color',
    80             [
    81                 'label'   => esc_html__('Background Color', 'reality-shop-3d'),
    82                 'type'    => \Elementor\Controls_Manager::COLOR,
    83                 'default' => 'null',
    84                 'description' => esc_html__('Select the background color for the 3D canvas.', 'reality-shop-3d'),
    85             ]
    86         );
    87 
    88         // حذف پس‌زمینه
    89         $this->add_control(
    90             'background_null',
    91             [
    92                 'label'   => esc_html__('Remove Background', 'reality-shop-3d'),
    93                 'type'    => \Elementor\Controls_Manager::SWITCHER,
    94                 'label_on' => esc_html__('Yes', 'reality-shop-3d'),
    95                 'label_off' => esc_html__('No', 'reality-shop-3d'),
    96                 'return_value' => 'yes',
    97                 'default' => '',
    98                 'description' => esc_html__('Enable to remove the background color.', 'reality-shop-3d'),
    99             ]
    100         );
    101 
    102         // فعال کردن Zoom
    103         $this->add_control(
    104             'zoom',
    105             [
    106                 'label'   => esc_html__('Enable zoom', 'reality-shop-3d'),
    107                 'type'    => \Elementor\Controls_Manager::SWITCHER,
    108                 'label_on' => esc_html__('Yes', 'reality-shop-3d'),
    109                 'label_off' => esc_html__('No', 'reality-shop-3d'),
    110                 'return_value' => 'yes',
    111                 'default' => '',
    112                 'description' => esc_html__('Enable to zoom.', 'reality-shop-3d'),
    113             ]
    114         );
    115 
    116         // فعال کردن Auto-Rotate
    117         $this->add_control(
    118             'autoRotate',
    119             [
    120                 'label'   => esc_html__('Enable auto rotate', 'reality-shop-3d'),
    121                 'type'    => \Elementor\Controls_Manager::SWITCHER,
    122                 'label_on' => esc_html__('Yes', 'reality-shop-3d'),
    123                 'label_off' => esc_html__('No', 'reality-shop-3d'),
    124                 'return_value' => 'yes',
    125                 'default' => '',
    126                 'description' => esc_html__('Enable to auto rotate.', 'reality-shop-3d'),
    127             ]
    128         );
    129 
    130         // فعال کردن Fullscreen
    131         $this->add_control(
    132             'fullScreen',
    133             [
    134                 'label'   => esc_html__('Enable full screen', 'reality-shop-3d'),
    135                 'type'    => \Elementor\Controls_Manager::SWITCHER,
    136                 'label_on' => esc_html__('Yes', 'reality-shop-3d'),
    137                 'label_off' => esc_html__('No', 'reality-shop-3d'),
    138                 'return_value' => 'yes',
    139                 'default' => '',
    140                 'description' => esc_html__('Enable to full screen.', 'reality-shop-3d'),
    141             ]
    142         );
    143 
    144         // فعال کردن Lazy Load
    145         $this->add_control(
    146             'lazyLoad',
    147             [
    148                 'label'   => esc_html__('Enable lazy load', 'reality-shop-3d'),
    149                 'type'    => \Elementor\Controls_Manager::SWITCHER,
    150                 'label_on' => esc_html__('Yes', 'reality-shop-3d'),
    151                 'label_off' => esc_html__('No', 'reality-shop-3d'),
    152                 'return_value' => 'yes',
    153                 'default' => '',
    154                 'description' => esc_html__('Enable to lazy load.', 'reality-shop-3d'),
    155             ]
    156         );
    157 
    158         // تنظیمات Modal
    159         $open_modal = get_option('reality_shop_open_in_modal');
    160         if (!empty($open_modal)) {
    161             $this->add_control(
    162                 'open_in_modal_content',
    163                 [
    164                     'label'       => esc_html__('Modal Content Message', 'reality-shop-3d'),
    165                     'type'        => \Elementor\Controls_Manager::TEXTAREA,
    166                     'default'     => 'Your 3D model will open in a modal.',
    167                     'description' => esc_html__('This message will be shown inside the modal.', 'reality-shop-3d'),
    168                 ]
    169             );
    170         }
    171 
    172130        $this->end_controls_section();
    173131    }
    174132
    175     // رندر ویجت
    176133    protected function render() {
    177134        global $post;
     
    203160        foreach ($shortcodes as $code) {
    204161            $file_url = '';
    205 
    206162            foreach ($files as $file) {
    207163                if ($file['id'] === $code) {
    208                     // بررسی به ترتیب اولویت: glb -> gltf -> usdz
    209                     if (!empty($file['glb']) && in_array('glb', $allowed_extensions)) {
    210                         $file_url = esc_url($file['glb']);
    211                     } elseif (!empty($file['gltf']) && in_array('gltf', $allowed_extensions)) {
    212                         $file_url = esc_url($file['gltf']);
    213                     } elseif (!empty($file['usdz']) && in_array('usdz', $allowed_extensions)) {
    214                         $file_url = esc_url($file['usdz']);
    215                     }
     164                    if (!empty($file['glb'])) $file_url = esc_url($file['glb']);
     165                    elseif (!empty($file['gltf'])) $file_url = esc_url($file['gltf']);
     166                    elseif (!empty($file['usdz'])) $file_url = esc_url($file['usdz']);
    216167                    break;
    217168                }
    218169            }
    219170
    220             // اگر فایل نداشت یا پسوند مجاز نبود، ردش کن
    221171            if (empty($file_url)) continue;
    222172
     
    224174            if (!in_array($file_extension, $allowed_extensions)) continue;
    225175
    226             // فقط یکبار اسکریپت‌ها لود بشن
    227176            if (!$rendered_any) {
    228177                wp_enqueue_style('bootstrap-css', 'https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css');
     
    248197                $modal_message = $settings['open_in_modal_content'] ?: 'Your 3D model will open in a modal.';
    249198                echo '
    250                 <p id="modalBtn" style="cursor: pointer;">
    251                     ' . esc_html($modal_message) . '
    252                 </p>
     199                <p id="modalBtn" class="rs3d-widget-text" style="cursor: pointer;">' . esc_html($modal_message) . '</p>
    253200                <div id="myModal" style="display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6);">
    254                     <div style="background-color: #ffffff; margin: 3% auto; padding: 20px; border: 2px solid #ffffff; width: ' . esc_attr($canvas_width + 70) . 'px; height: ' . esc_attr($canvas_height + 70) . 'px; border-radius: 20px; text-align: center; box-shadow: 0 0 20px rgba(224, 224, 224, 0.5); position: relative;">
    255                         <span id="closeBtn" style="color: #353535; position: absolute; top: 10px; right: 20px; font-size: 28px; font-weight: bold; cursor: pointer;">&times;</span>
     201                    <div style="background-color: #ffffff; margin: 3% auto; padding: 20px; border: 2px solid #ffffff; width: ' . esc_attr($canvas_width + 70) . 'px; height: ' . esc_attr($canvas_height + 70) . 'px; border-radius: 20px; text-align: center;">
     202                        <span id="closeBtn" class="rs3d-widget-text" style="color: #353535; position: absolute; top: 10px; right: 20px; font-size: 28px; font-weight: bold; cursor: pointer;">&times;</span>
    256203                        <div class="d-flex flex-column mt-4 ms-3">
    257204                            <canvas class="threeDWidgetCanvas" style="width: ' . esc_attr($canvas_width) . 'px; height: ' . esc_attr($canvas_height) . 'px;"></canvas>
  • reality-shop-3d/trunk/readme.txt

    r3303917 r3304286  
    66Requires at least: 5.5
    77Tested up to: 6.7
    8 Stable tag: 1.8.9.79
     8Stable tag: 1.8.9.80
    99Requires PHP: 7.4
    1010License: GPL-3.0+
Note: See TracChangeset for help on using the changeset viewer.