Plugin Directory

Changeset 2700751


Ignore:
Timestamp:
03/28/2022 04:43:44 PM (4 years ago)
Author:
quentn
Message:

Make compatible for Elementor versions >= 3.5

Location:
quentn-wp/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • quentn-wp/trunk/includes/class-quentn-wp-elementor-integration.php

    r2640611 r2700751  
    174174                'label' => __( 'Flood Protection', 'quentn-wp' ),
    175175                'type' => Controls_Manager::NUMBER,
    176                 'description' => __( 'Enter the maximum form submissions per hour and unique IP-Adresses (default: 5, 0 to diable)', 'quentn-wp' ),
     176                'description' => __( 'Enter the maximum form submissions per hour and unique IP-Address (default: 5, 0 to diable)', 'quentn-wp' ),
    177177                'min' => 0,
    178178                'default' => 5,
  • quentn-wp/trunk/includes/class-quentn-wp-elementor.php

    r2640611 r2700751  
    1212     */
    1313    public function __construct() {
    14         add_action( 'plugins_loaded', array( $this, 'load_dependencies' ) );
    15         add_action( 'elementor/controls/controls_registered', array( $this, 'init_controls' ) );
     14        //As of Elementor 3.5, registering new controls hook and method is changed
     15        if ( version_compare( ELEMENTOR_VERSION, '3.5.0', '>=' ) ) {
     16           $action_name = 'register';
     17        } else {
     18            $action_name = 'controls_registered';
     19        }
     20        add_action( 'elementor/controls/'.$action_name, array( $this, 'init_controls' ) );
    1621        add_action( 'elementor_pro/init', array( $this, 'init_elementor' ) );
    1722    }
     
    3439
    3540    /**
    36      * Load Elementor Integration dependencies
    37      *
    38      * @since  1.0.6
    39      * @access public
    40      */
    41     public function load_dependencies() {
    42         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-quentn-wp-elementor-integration.php';
    43         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-quentn-wp-elementor-handler.php';
    44         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-quentn-wp-elementor-field-mapping.php';
    45     }
    46 
    47     /**
    4841     * Init Controls
    4942     *
     
    5346    public function init_controls()
    5447    {
    55         \Elementor\Plugin::$instance->controls_manager->register_control('qntn_fields_map', new \Quentn_Wp_Elementor_Field_Mapping());
     48        //As of Elementor 3.5, registering new controls hook and method is changed
     49        if ( version_compare( ELEMENTOR_VERSION, '3.5.0', '>=' ) ) {
     50            \Elementor\Plugin::$instance->controls_manager->register( new \Quentn_Wp_Elementor_Field_Mapping() );
     51        } else {
     52            \Elementor\Plugin::$instance->controls_manager->register_control( 'qntn_fields_map', new \Quentn_Wp_Elementor_Field_Mapping() );
     53        }
    5654    }
    5755
     
    6462    public function init_elementor()
    6563    {
     64        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-quentn-wp-elementor-integration.php';
     65        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-quentn-wp-elementor-handler.php';
     66        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-quentn-wp-elementor-field-mapping.php';
     67
    6668        $quentn_action = new \Quentn_Wp_Elementor_Integration;
    6769        // Register the action with form widget
  • quentn-wp/trunk/includes/class-quentn-wp.php

    r2681536 r2700751  
    7575            $this->version = QUENTN_WP_VERSION;
    7676        } else {
    77             $this->version = '1.2.1';
     77            $this->version = '1.2.2';
    7878        }
    7979        $this->plugin_name = 'quentn-wp';
     
    190190         * Add classes responsible to handle elementor integration
    191191         */
    192         if( defined('ELEMENTOR_VERSION' ) && defined('ELEMENTOR_PRO_VERSION' )  && ELEMENTOR_VERSION >= '2.0.0' ) {
    193            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-quentn-wp-elementor.php';
    194         }
     192        add_action('elementor_pro/init', function () {
     193            if( defined('ELEMENTOR_VERSION' ) && defined('ELEMENTOR_PRO_VERSION' )  && ELEMENTOR_VERSION >= '2.0.0' ) {
     194                //sometimes elementor pro plugin is active but not working because of compatibility with elementor free version
     195                if ( class_exists('ElementorPro\Modules\Forms\Classes\Integration_Base' ) ) {
     196                    require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-quentn-wp-elementor.php';
     197                }
     198            }
     199        }, 5);
    195200
    196201        $this->loader = new Quentn_Wp_Loader();
  • quentn-wp/trunk/languages/quentn-wp-de_DE.po

    r2411960 r2700751  
    547547
    548548#: includes/class-quentn-wp-elementor-integration.php:191
    549 msgid "Enter the maximum form submissions per hour and unique IP-Adresses (default: 5, 0 to diable)"
     549msgid "Enter the maximum form submissions per hour and unique IP-Address (default: 5, 0 to diable)"
    550550msgstr "Geben Sie die maximale Anzahl der Formular-Eintragungen pro Stunde und pro eindeutige IP-Adresse ein (Standard: 5, 0 bis deaktiviert)"
    551551
  • quentn-wp/trunk/languages/quentn-wp.pot

    r2411960 r2700751  
    553553
    554554#: includes/class-quentn-wp-elementor-integration.php:191
    555 msgid "Enter the maximum form submissions per hour and unique IP-Adresses (default: 5, 0 to diable)"
     555msgid "Enter the maximum form submissions per hour and unique IP-Address (default: 5, 0 to diable)"
    556556msgstr ""
    557557
  • quentn-wp/trunk/quentn-wp.php

    r2681536 r2700751  
    1717 * Plugin URI:        https://docs.quentn.com/de/beta-quentn-wordpress-plugin/installieren-und-verbinden
    1818 * Description:       This plugin allows you to restrict access to specific pages, create custom access links and create dynamic page countdowns. Optionally, you can connect your Quentn account to your WordPress installation to share contacts and manage access restrictions through Quentn.
    19  * Version:           1.2.1
     19 * Version:           1.2.2
    2020 * Author:            Quentn.com GmbH
    2121 * Author URI:        https://quentn.com/
     
    2424 * Text Domain:       quentn-wp
    2525 * Domain Path:       /languages
     26 * Elementor tested up to: 3.6.1
     27 * Elementor Pro tested up to: 3.6.4
    2628 */
    2729
     
    3537define( "TABLE_QUENTN_RESTRICTIONS", 'qntn_restrictions' );
    3638define( "TABLE_QUENTN_USER_DATA", 'qntn_user_data' );
    37 define( 'QUENTN_WP_VERSION', '1.2.1' );
     39define( 'QUENTN_WP_VERSION', '1.2.2' );
    3840
    3941/**
  • quentn-wp/trunk/readme.txt

    r2681536 r2700751  
    44Requires at least: 4.6.0
    55Tested up to: 5.8
    6 Stable tag: 1.2.1
     6Stable tag: 1.2.2
    77Requires PHP: 5.6.0
    88License: GPLv2 or later
     
    6666
    6767== Changelog ==
     68= 1.2.2 =
     69* Fix: Make compatible for Elementor versions >= 3.5
     70
    6871= 1.2.1 =
    6972* Fix: Error handling while getting password reset key.
     
    141144== Upgrade Notice ==
    142145
     146= 1.2.2 =
     147Thanks for using Quentn Plugin! Please update the plugin to make compatible for Elementor versions >= 3.5.
     148
    143149= 1.2.1 =
    144150Thanks for using Quentn Plugin! Please update the plugin to fix the error handling while getting password reset key.
Note: See TracChangeset for help on using the changeset viewer.