Plugin Directory

Changeset 3339876


Ignore:
Timestamp:
08/05/2025 08:38:39 PM (8 months ago)
Author:
creativform
Message:

8.8.7

  • Fixed fatal error caused by Elementor update (removed deprecated Typography class)
Location:
cf-geoplugin
Files:
503 added
7 edited

Legend:

Unmodified
Added
Removed
  • cf-geoplugin/trunk/CHANGELOG.txt

    r3310808 r3339876  
    11== Changelog ==
     2
     3= 8.8.7 =
     4* Fixed fatal error caused by Elementor update (removed deprecated Typography class)
    25
    36= 8.8.6 =
  • cf-geoplugin/trunk/cf-geoplugin.php

    r3310808 r3339876  
    99 * Plugin URI:        https://wpgeocontroller.com/
    1010 * Description:       Unlock the power of location-based functionality of WordPress – The ultimate all-in-one geolocation plugin for WordPress.
    11  * Version:           8.8.6
     11 * Version:           8.8.7
    1212 * Requires at least: 6.0
    1313 * Requires PHP:      7.0
  • cf-geoplugin/trunk/inc/plugins/elementor/elementor.php

    r3270891 r3339876  
    2828         * @verson    1.0.0
    2929         */
    30         private function __construct()
     30        public function __construct()
    3131        {
    3232            $this->add_action('plugins_loaded', 'init', 10, 0);
     
    111111
    112112                        if (class_exists($class_name, false)) {
    113                             // Let Elementor know about our widget
    114                             \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new $class_name());
    115                         }
     113                            $widgets_manager = \Elementor\Plugin::instance()->widgets_manager;
     114
     115                            if (method_exists($widgets_manager, 'register')) {
     116                                // Elementor 3.5+ uses register()
     117                                $widgets_manager->register(new $class_name());
     118                            } elseif (method_exists($widgets_manager, 'register_widget_type')) {
     119                                // Elementor < 3.5 uses register_widget_type()
     120                                $widgets_manager->register_widget_type(new $class_name());
     121                            }
     122                        }
    116123                    }
    117124                }
     
    127134            $controls = __DIR__ . '/controls';
    128135
    129             if (!file_exists($widgets)) {
    130                 return;
    131             }
     136            if (!file_exists($controls)) {
     137                return;
     138            }
    132139
    133140            $fileSystemIterator = new FilesystemIterator($controls);
     
    155162                        if (class_exists($class_name, false)) {
    156163                            // Let Elementor know about our widget
    157                             \Elementor\Plugin::$instance->controls_manager->register_control('control-type-', new $class_name());
     164                            $instance = new $class_name();
     165                            $id = method_exists($instance, 'get_type') ? $instance->get_type() : sanitize_title($class_name);
     166
     167                            \Elementor\Plugin::$instance->controls_manager->register_control($id, $instance);
    158168                        }
    159169                    }
  • cf-geoplugin/trunk/inc/plugins/elementor/widgets/cfgp-elementor-content-widget.php

    r3270891 r3339876  
    2626            return self::$slug;
    2727        }
     28       
     29        public function get_keywords()
     30        {
     31            return ['geo', 'location', 'content', 'cf-geoplugin'];
     32        }
     33       
     34        public function get_style_depends()
     35        {
     36            return ['cf-geoplugin-widget-style'];
     37        }
     38
     39        public function get_script_depends()
     40        {
     41            return ['cf-geoplugin-widget-script'];
     42        }
    2843
    2944        /**
     
    182197
    183198            $slug = self::$slug;
    184 
    185             $class = '{{WRAPPER}}';
    186 
     199           
    187200            /*
    188201             * STYLE
    189202             */
     203            $typography_get_type = \Elementor\Group_Control_Typography::get_type();
     204             
    190205            $class = '{{WRAPPER}} ' . ".{$slug}";
    191206            $this->start_controls_section(
     
    197212            );
    198213            $this->add_group_control(
    199                 \Elementor\Group_Control_Typography::get_type(),
     214                $typography_get_type,
    200215                [
    201216                    'name'   => 'typography',
     
    209224
    210225            $this->add_group_control(
    211                 \Elementor\Group_Control_Typography::get_type(),
     226                $typography_get_type,
    212227                [
    213228                    'name'   => 'typography_link',
     
    221236
    222237            $this->add_group_control(
    223                 \Elementor\Group_Control_Typography::get_type(),
     238                $typography_get_type,
    224239                [
    225240                    'name'   => 'typography_link_hover',
     
    253268            for ($h = 1; $h < 6; $h++) {
    254269                $this->add_group_control(
    255                     \Elementor\Group_Control_Typography::get_type(),
     270                    $typography_get_type,
    256271                    [
    257272                        'name'   => 'typography_header_' . $h,
     
    283298            $content = null;
    284299
    285             if ($settings['enable_default_content'] == 'yes') {
     300            if (!empty($settings['enable_default_content']) && $settings['enable_default_content'] === 'yes') {
    286301                $content = $settings['default_content'];
    287302            }
    288303
    289             foreach ($settings['list'] as $i => $fetch) {
    290                 if (CFGP_U::recursive_array_search($fetch['location'], CFGP_U::api(false, CFGP_Defaults::API_RETURN))) {
    291                     $content = $fetch['content'];
    292                     break;
    293                 }
    294             }
    295 
     304            if (!empty($settings['list']) && is_array($settings['list'])) {
     305                foreach ($settings['list'] as $i => $fetch) {
     306                    if (!empty($fetch['location']) && !empty($fetch['content']) && CFGP_U::recursive_array_search($fetch['location'], CFGP_U::api(false, CFGP_Defaults::API_RETURN))) {
     307                        $content = $fetch['content'];
     308                        break;
     309                    }
     310                }
     311            }
    296312            if (!$content) {
    297313                return;
  • cf-geoplugin/trunk/inc/plugins/elementor/widgets/cfgp-elementor-eu-widget.php

    r3270891 r3339876  
    2424            return self::$slug;
    2525        }
     26       
     27        public function get_keywords()
     28        {
     29            return ['eu', 'europe', 'geo', 'cf-geoplugin'];
     30        }
     31
     32        public function get_style_depends()
     33        {
     34            return ['cf-geoplugin-eu-widget'];
     35        }
    2636
    2737        /**
     
    145155                ]
    146156            );
    147             $this->add_group_control(
    148                 \Elementor\Core\Schemes\Typography::get_type(),
     157           
     158            $typography_get_type = \Elementor\Group_Control_Typography::get_type();
     159           
     160            $this->add_group_control(
     161                $typography_get_type,
    149162                [
    150163                    'name'   => 'content_typography',
     
    158171
    159172            $this->add_group_control(
    160                 \Elementor\Core\Schemes\Typography::get_type(),
     173                $typography_get_type,
    161174                [
    162175                    'name'   => 'content_typography_link',
     
    170183
    171184            $this->add_group_control(
    172                 \Elementor\Core\Schemes\Typography::get_type(),
     185                $typography_get_type,
    173186                [
    174187                    'name'   => 'content_typography_link_hover',
     
    221234
    222235                $this->add_group_control(
    223                     \Elementor\Core\Schemes\Typography::get_type(),
     236                    $typography_get_type,
    224237                    [
    225238                        'name'   => "heading_typography_{$i}",
     
    272285
    273286            $this->add_group_control(
    274                 \Elementor\Core\Schemes\Typography::get_type(),
     287                $typography_get_type,
    275288                [
    276289                    'name'   => 'content_typography_blockquote',
     
    329342
    330343            $show = false;
    331 
    332             if ($settings['eu_control'] && CFGP_U::api('in_eu') == 1) {
     344           
     345            $eu_control = !empty($settings['eu_control']);
     346
     347            if ($eu_control && CFGP_U::api('in_eu') == 1) {
    333348                $show = true;
    334349            }
    335350
    336             if (!$settings['eu_control'] && CFGP_U::api('in_eu') == 0) {
     351            if (!$eu_control && CFGP_U::api('in_eu') == 0) {
    337352                $show = true;
    338353            }
     
    358373         * @access private
    359374         */
    360         private function is_edit()
     375        private static function is_edit()
    361376        {
    362377            return \Elementor\Plugin::$instance->editor->is_edit_mode();
  • cf-geoplugin/trunk/inc/plugins/elementor/widgets/cfgp-elementor-vat-widget.php

    r3270891 r3339876  
    145145                ]
    146146            );
    147             $this->add_group_control(
    148                 \Elementor\Core\Schemes\Typography::get_type(),
     147           
     148            $typography_get_type = \Elementor\Group_Control_Typography::get_type();
     149           
     150            $this->add_group_control(
     151                $typography_get_type,
    149152                [
    150153                    'name'   => 'content_typography',
    151154                    'label'  => __('Typography', 'cf-geoplugin'),
    152155                    'global' => [
    153                         'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_TEXT,
     156                        'default' => class_exists('\Elementor\Core\Kits\Documents\Tabs\Global_Typography') ? \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_TEXT : 'default',
    154157                    ],
    155158                    'selector' => "{$class}, {$class} p",
     
    158161
    159162            $this->add_group_control(
    160                 \Elementor\Core\Schemes\Typography::get_type(),
     163                $typography_get_type,
    161164                [
    162165                    'name'   => 'content_typography_link',
    163166                    'label'  => __('Link typography', 'cf-geoplugin'),
    164167                    'global' => [
    165                         'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_TEXT,
     168                        'default' => class_exists('\Elementor\Core\Kits\Documents\Tabs\Global_Typography') ? \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_TEXT : 'default',
    166169                    ],
    167170                    'selector' => "{$class} a, {$class} a:active",
     
    170173
    171174            $this->add_group_control(
    172                 \Elementor\Core\Schemes\Typography::get_type(),
     175                $typography_get_type,
    173176                [
    174177                    'name'   => 'content_typography_link_hover',
    175178                    'label'  => __('Link hover typography', 'cf-geoplugin'),
    176179                    'global' => [
    177                         'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_TEXT,
     180                        'default' => class_exists('\Elementor\Core\Kits\Documents\Tabs\Global_Typography') ? \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_TEXT : 'default',
    178181                    ],
    179182                    'selector' => "{$class} a:hover, {$class} a:focus",
     
    221224
    222225                $this->add_group_control(
    223                     \Elementor\Core\Schemes\Typography::get_type(),
     226                    $typography_get_type,
    224227                    [
    225228                        'name'   => "heading_typography_{$i}",
    226229                        'label'  => __('Typography', 'cf-geoplugin'),
    227230                        'global' => [
    228                         'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_TEXT,
     231                        'default' => class_exists('\Elementor\Core\Kits\Documents\Tabs\Global_Typography') ? \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_TEXT : 'default',
    229232                    ],
    230233                        'selector' => "{$class} h{$i}",
     
    272275
    273276            $this->add_group_control(
    274                 \Elementor\Core\Schemes\Typography::get_type(),
     277                $typography_get_type,
    275278                [
    276279                    'name'   => 'content_typography_blockquote',
    277280                    'label'  => __('Typography', 'cf-geoplugin'),
    278281                    'global' => [
    279                         'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_TEXT,
     282                        'default' => class_exists('\Elementor\Core\Kits\Documents\Tabs\Global_Typography') ? \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_TEXT : 'default',
    280283                    ],
    281284                    'selector' => "{$class} blockquote",
  • cf-geoplugin/trunk/readme.txt

    r3310808 r3339876  
    66Tested up to: 6.8
    77Requires PHP: 7.0
    8 Stable tag: 8.8.6
     8Stable tag: 8.8.7
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    414414== Changelog ==
    415415
     416= 8.8.7 =
     417* Fixed fatal error caused by Elementor update (removed deprecated Typography class)
     418
    416419= 8.8.6 =
    417420* Fixed sidebar statistics in the WP Admin
     
    501504== Upgrade Notice ==
    502505
     506= 8.8.7 =
     507* Fixed fatal error caused by Elementor update (removed deprecated Typography class)
     508
    503509= 8.8.6 =
    504510* Fixed sidebar statistics in the WP Admin
     
    506512* Improved conditional logic of plugin
    507513* Improved performances
    508 
    509 = 8.8.5 =
    510 * Removed all PHP 5.6 specific syntax to support minimum PHP 7.4
    511 * Prepared and tested plugin compatibility for WordPress version 6.8
    512 * Brought codebase to PSR-12 coding standard
    513 * Refactored features and functionalities for faster execution and better maintainability
    514 * Modularized core logic for better structure and scalability
    515 * Optimized loading time by reducing unnecessary function calls
    516 * Improved type declarations and error handling for critical functions
    517 
    518 = 8.8.4 =
    519 * Removed PHP errors in regular versions
    520 * Removed obsolete code
    521 * Fixed cache problems
    522 
    523 = 8.8.3 =
    524 * Fixed problem with transients (must delete them after update)
    525 * Improved cache algorithms
    526 * Optimized PHP code
    527 
    528 = 8.8.2 =
    529 * License updates
    530 
    531 = 8.8.1 =
    532 * Fixed Woocommerce HPOS metabox order info
    533 * Improved IP filtering
    534 
    535 = 8.8.0 =
    536 * Fixed an issue with the Elementor builder
    537 * Fixed bugs with SEO module
    538 * Fixed bugs with IP address detection
    539 * Optimized PHP code
    540 
    541 = 8.7.11 =
    542 * Improved cache headers
    543 
    544 = 8.7.10 =
    545 * Fixed issue with Woocommerce checkout info
    546 
    547 = 8.7.9 =
    548 * Fixed issue with Woocommerce HPOS metabox
    549 
    550 = 8.7.8 =
    551 * Fixed WooCommerce bugs and improved performances
    552 
    553 = 8.7.7 =
    554 * Support for the WordPress version 6.7
    555 
    556 = 8.7.6 =
    557 * Fixing Geo Defender algo
    558 * Improved PHP algos and code optimization
    559 * Improved cookie control
    560 * Improved WooCommerce module
    561 
    562 = 8.7.5 =
    563 * Adding user permission to the GEO menus
    564 
    565 = 8.7.4 =
    566 * Fixing Missing Authorization to Authenticated (Subscriber+) Menu Creation/Deletion
    567 * Imorived WooCommerce geo pricing
    568514
    569515== Other Notes ==
Note: See TracChangeset for help on using the changeset viewer.