Plugin Directory

Changeset 3389341


Ignore:
Timestamp:
11/04/2025 05:52:44 AM (2 months ago)
Author:
Litonice13
Message:

Update to version 1.0.4 from GitHub

Location:
content-locker-for-elementor
Files:
4 added
2 deleted
20 edited
1 copied

Legend:

Unmodified
Added
Removed
  • content-locker-for-elementor/tags/1.0.4/Inc/Addon/Content_Locker.php

    r2957111 r3389341  
    4646    }
    4747
    48     protected function _register_controls() {
     48    protected function register_controls() {
    4949
    5050        /*
     
    11521152        ?>
    11531153            <div class="cle-restrict-content-fields">
    1154                 <form <?php echo esc_attr( $this->get_render_attribute_string( 'form_wrapper' ) ); ?>>
     1154                <form <?php echo $this->get_render_attribute_string( 'form_wrapper' ); ?>>
    11551155                    <div class="card-body">
    11561156
     
    11971197                'class'                     => [ 'cle-restrict-content-wrap'],
    11981198                'id'                        => 'cle-restrict-content-' . $this->get_id(),
    1199                 'data-restrict-type'        => $settings['cle_restrict_content_type']
     1199                'data-restrict-type'        => isset($settings['cle_restrict_content_type']) ? $settings['cle_restrict_content_type'] : 'user'
    12001200            ]
    12011201        ]);
    12021202    ?>
    12031203
    1204             <section <?php echo esc_attr( $this->get_render_attribute_string( 'wrapper' ) ); ?>>
     1204            <section <?php echo $this->get_render_attribute_string( 'wrapper' ); ?>>
    12051205
    12061206                <?php
     
    12251225
    12261226                        } else {
     1227                            // Ensure session is started for password validation
     1228                            if( session_status() == PHP_SESSION_NONE ) {
     1229                                session_start();
     1230                            }
    12271231
    12281232                            if( !empty($settings['cle_restrict_content_pass']) ) {
    12291233                                if( isset($_POST['cle_restrict_content_pass']) && ($settings['cle_restrict_content_pass'] === $_POST['cle_restrict_content_pass']) ) {
    1230                                     if( !session_status() ) { session_start(); }
    12311234                                    $_SESSION['cle_restrict_content_pass'] = true;
    1232                                    
    12331235                                    $this->cle_restrict_content();
     1236                                } else if( isset($_SESSION['cle_restrict_content_pass']) && $_SESSION['cle_restrict_content_pass'] === true ) {
     1237                                    // Already authenticated in this session
     1238                                    $this->cle_restrict_content();
     1239                                } else {
     1240                                    // Wrong password or not submitted yet
     1241                                    if( isset($_POST['cle_restrict_content_pass']) ) {
     1242                                        Helper::cle_warning_messaage( esc_html__('Incorrect password. Please try again.', 'content-locker-for-elementor') );
     1243                                    }
     1244                                    $this->cle_restrict_content_msg();
     1245                                    $this->cle_restrict_content_form();
    12341246                                }
    12351247                            } else {
    12361248                                Helper::cle_warning_messaage( esc_html__('Ops, You Forget to set password!', 'content-locker-for-elementor') );
    1237                             }
    1238 
    1239                             if( ! isset($_SESSION['cle_restrict_content_pass']) ) {                                 
    12401249                                $this->cle_restrict_content_msg();
    12411250                                $this->cle_restrict_content_form();
     
    12431252                        }
    12441253
    1245                     } elseif ( isset($settings['cle_restrict_content_type']) == 'math_captcha') {
     1254                    } elseif ( isset($settings['cle_restrict_content_type']) && $settings['cle_restrict_content_type'] == 'math_captcha') {
    12461255
    12471256                        // Math Captcha Content Locker
     
    12531262                            $cle_rc_answer_hd = isset($_POST['cle_rc_answer_hd']) ? esc_html( $_POST['cle_rc_answer_hd'] ) : "";
    12541263                            if( !empty($_POST['cle_rc_answer']) && ($_POST['cle_rc_answer'] === $cle_rc_answer_hd)) {
    1255                                 if( !session_status() ) { session_start(); }
     1264                                if( session_status() == PHP_SESSION_NONE ) { session_start(); }
    12561265                                $this->cle_restrict_content();
    12571266                            } else if ( ! isset( $_POST['cle_rc_answer'] ) || ! $_POST['cle_rc_answer'] ) {
  • content-locker-for-elementor/tags/1.0.4/Inc/Classes/Feedback.php

    r2957111 r3389341  
    5858    public function jltelcl_deactivation_survey(){
    5959        check_ajax_referer( 'jltelcl_deactivation_nonce' );
     60
     61        // Check if user has permission to deactivate plugins
     62        if ( ! current_user_can( 'deactivate_plugins' ) ) {
     63            wp_send_json_error( __( 'You do not have permission to perform this action', 'content-locker-for-elementor' ) );
     64        }
    6065
    6166        $deactivation_reason  = ! empty( $_POST['deactivation_reason'] ) ? sanitize_text_field( wp_unslash( $_POST['deactivation_reason'] ) ) : '';
  • content-locker-for-elementor/tags/1.0.4/Inc/Classes/Notifications/Notifications.php

    r2957111 r3389341  
    4848    public function notification_action() {
    4949        check_ajax_referer( 'jltelcl_notification_nonce' );
     50
     51        // Check if user has permission to manage options
     52        if ( ! current_user_can( 'manage_options' ) ) {
     53            wp_send_json_error( __( 'You do not have permission to perform this action', 'content-locker-for-elementor' ) );
     54        }
    5055
    5156        $action_type       = ! empty( $_REQUEST['action_type'] ) ? sanitize_key( $_REQUEST['action_type'] ) : '';
  • content-locker-for-elementor/tags/1.0.4/Inc/Classes/Notifications/Subscribe.php

    r2957111 r3389341  
    3434        public function jltelcl_subscribe() {
    3535            check_ajax_referer( 'jltelcl_subscribe_nonce' );
     36
     37            // Check if user has permission to manage options
     38            if ( ! current_user_can( 'manage_options' ) ) {
     39                wp_send_json_error( __( 'You do not have permission to perform this action', 'content-locker-for-elementor' ) );
     40            }
    3641
    3742            $name  = ! empty( $_POST['name'] ) ? sanitize_text_field( wp_unslash( $_POST['name'] ) ) : '';
  • content-locker-for-elementor/tags/1.0.4/Inc/Classes/Notifications/What_We_Collect.php

    r2977959 r3389341  
    3535        public function jltelcl_allow_collect() {
    3636            check_ajax_referer( 'jltelcl_allow_collect_nonce' );
     37
     38            // Check if user has permission to manage options
     39            if ( ! current_user_can( 'manage_options' ) ) {
     40                wp_send_json_error( __( 'You do not have permission to perform this action', 'content-locker-for-elementor' ) );
     41            }
    3742
    3843            $email = get_bloginfo( 'admin_email' );
  • content-locker-for-elementor/tags/1.0.4/Libs/Recommended.php

    r2957111 r3389341  
    4141
    4242            add_action( 'admin_menu', array( $this, 'admin_menu' ), $this->menu_order );
     43            // Only allow logged-in users with appropriate permissions
    4344            add_action( 'wp_ajax_jltelcl_recommended_upgrade_plugin', array( $this, 'jltelcl_recommended_upgrade_plugin' ) );
    4445            add_action( 'wp_ajax_jltelcl_recommended_activate_plugin', array( $this, 'jltelcl_recommended_activate_plugin' ) );
     46            // Remove nopriv actions to prevent unauthenticated access
     47            remove_action( 'wp_ajax_nopriv_jltelcl_recommended_upgrade_plugin', array( $this, 'jltelcl_recommended_upgrade_plugin' ) );
     48            remove_action( 'wp_ajax_nopriv_jltelcl_recommended_activate_plugin', array( $this, 'jltelcl_recommended_activate_plugin' ) );
    4549        }
    4650
     
    290294                        wp_send_json_error( array( 'mess' => __( 'Nonce is invalid', 'content-locker-for-elementor' ) ) );
    291295                    }
     296
     297                    // Check if user has permission to activate plugins
     298                    if ( ! current_user_can( 'activate_plugins' ) ) {
     299                        wp_send_json_error( array( 'mess' => __( 'You do not have permission to activate plugins', 'content-locker-for-elementor' ) ) );
     300                    }
    292301                    $file   = sanitize_text_field( wp_unslash( $_POST['file'] ) );
    293302                    $result = activate_plugin( $file );
     
    344353                    if ( ! wp_verify_nonce( $nonce, 'jltelcl_recommended_nonce' ) ) {
    345354                        wp_send_json_error( array( 'mess' => __( 'Nonce is invalid', 'content-locker-for-elementor' ) ) );
     355                    }
     356
     357                    // Check if user has permission to install and update plugins
     358                    if ( ! current_user_can( 'install_plugins' ) || ! current_user_can( 'update_plugins' ) ) {
     359                        wp_send_json_error( array( 'mess' => __( 'You do not have permission to install or update plugins', 'content-locker-for-elementor' ) ) );
    346360                    }
    347361                    $plugin   = sanitize_text_field( wp_unslash( $_POST['plugin'] ) );
  • content-locker-for-elementor/tags/1.0.4/content-locker-for-elementor.php

    r2977959 r3389341  
    44 * Plugin URI:  https://master-addons.com/restrict-content-for-elementor/
    55 * Description: Fast and Easy Elementor way to Restrict your Content. Content Locker for Elementor will give you full independncy over Contents like memebership websites.
    6  * Version:     1.0.3
     6 * Version:     1.0.4
    77 * Author:      Jewel Theme
    88 * Author URI:  https://jeweltheme.com
  • content-locker-for-elementor/tags/1.0.4/readme.txt

    r2977959 r3389341  
    44Tags: content locker, restrict content elementor, member, members, membership, memberships, member only, registration form, restricted access, limit access, read only,
    55Requires at least: 4.0
    6 Tested up to: 6.3.1
    7 Stable tag: trunk
     6Tested up to: 6.8
     7Stable tag: 1.0.4
    88Requires PHP: 5.6
    99License: GPLv3 or later
     
    116116
    117117
    118 
    119 == Changelog ==
    120 = 1.0.3 (12-10-2023) =
    121 * Updated: Blank Admin page issue fixed
    122 
    123 = 1.0.0 (18-02-2020)=
    124 * Initial Release
    125 
    126118== Upgrade Notice ==
  • content-locker-for-elementor/trunk/Inc/Addon/Content_Locker.php

    r2957111 r3389341  
    4646    }
    4747
    48     protected function _register_controls() {
     48    protected function register_controls() {
    4949
    5050        /*
     
    11521152        ?>
    11531153            <div class="cle-restrict-content-fields">
    1154                 <form <?php echo esc_attr( $this->get_render_attribute_string( 'form_wrapper' ) ); ?>>
     1154                <form <?php echo $this->get_render_attribute_string( 'form_wrapper' ); ?>>
    11551155                    <div class="card-body">
    11561156
     
    11971197                'class'                     => [ 'cle-restrict-content-wrap'],
    11981198                'id'                        => 'cle-restrict-content-' . $this->get_id(),
    1199                 'data-restrict-type'        => $settings['cle_restrict_content_type']
     1199                'data-restrict-type'        => isset($settings['cle_restrict_content_type']) ? $settings['cle_restrict_content_type'] : 'user'
    12001200            ]
    12011201        ]);
    12021202    ?>
    12031203
    1204             <section <?php echo esc_attr( $this->get_render_attribute_string( 'wrapper' ) ); ?>>
     1204            <section <?php echo $this->get_render_attribute_string( 'wrapper' ); ?>>
    12051205
    12061206                <?php
     
    12251225
    12261226                        } else {
     1227                            // Ensure session is started for password validation
     1228                            if( session_status() == PHP_SESSION_NONE ) {
     1229                                session_start();
     1230                            }
    12271231
    12281232                            if( !empty($settings['cle_restrict_content_pass']) ) {
    12291233                                if( isset($_POST['cle_restrict_content_pass']) && ($settings['cle_restrict_content_pass'] === $_POST['cle_restrict_content_pass']) ) {
    1230                                     if( !session_status() ) { session_start(); }
    12311234                                    $_SESSION['cle_restrict_content_pass'] = true;
    1232                                    
    12331235                                    $this->cle_restrict_content();
     1236                                } else if( isset($_SESSION['cle_restrict_content_pass']) && $_SESSION['cle_restrict_content_pass'] === true ) {
     1237                                    // Already authenticated in this session
     1238                                    $this->cle_restrict_content();
     1239                                } else {
     1240                                    // Wrong password or not submitted yet
     1241                                    if( isset($_POST['cle_restrict_content_pass']) ) {
     1242                                        Helper::cle_warning_messaage( esc_html__('Incorrect password. Please try again.', 'content-locker-for-elementor') );
     1243                                    }
     1244                                    $this->cle_restrict_content_msg();
     1245                                    $this->cle_restrict_content_form();
    12341246                                }
    12351247                            } else {
    12361248                                Helper::cle_warning_messaage( esc_html__('Ops, You Forget to set password!', 'content-locker-for-elementor') );
    1237                             }
    1238 
    1239                             if( ! isset($_SESSION['cle_restrict_content_pass']) ) {                                 
    12401249                                $this->cle_restrict_content_msg();
    12411250                                $this->cle_restrict_content_form();
     
    12431252                        }
    12441253
    1245                     } elseif ( isset($settings['cle_restrict_content_type']) == 'math_captcha') {
     1254                    } elseif ( isset($settings['cle_restrict_content_type']) && $settings['cle_restrict_content_type'] == 'math_captcha') {
    12461255
    12471256                        // Math Captcha Content Locker
     
    12531262                            $cle_rc_answer_hd = isset($_POST['cle_rc_answer_hd']) ? esc_html( $_POST['cle_rc_answer_hd'] ) : "";
    12541263                            if( !empty($_POST['cle_rc_answer']) && ($_POST['cle_rc_answer'] === $cle_rc_answer_hd)) {
    1255                                 if( !session_status() ) { session_start(); }
     1264                                if( session_status() == PHP_SESSION_NONE ) { session_start(); }
    12561265                                $this->cle_restrict_content();
    12571266                            } else if ( ! isset( $_POST['cle_rc_answer'] ) || ! $_POST['cle_rc_answer'] ) {
  • content-locker-for-elementor/trunk/Inc/Classes/Feedback.php

    r2957111 r3389341  
    5858    public function jltelcl_deactivation_survey(){
    5959        check_ajax_referer( 'jltelcl_deactivation_nonce' );
     60
     61        // Check if user has permission to deactivate plugins
     62        if ( ! current_user_can( 'deactivate_plugins' ) ) {
     63            wp_send_json_error( __( 'You do not have permission to perform this action', 'content-locker-for-elementor' ) );
     64        }
    6065
    6166        $deactivation_reason  = ! empty( $_POST['deactivation_reason'] ) ? sanitize_text_field( wp_unslash( $_POST['deactivation_reason'] ) ) : '';
  • content-locker-for-elementor/trunk/Inc/Classes/Notifications/Notifications.php

    r2957111 r3389341  
    4848    public function notification_action() {
    4949        check_ajax_referer( 'jltelcl_notification_nonce' );
     50
     51        // Check if user has permission to manage options
     52        if ( ! current_user_can( 'manage_options' ) ) {
     53            wp_send_json_error( __( 'You do not have permission to perform this action', 'content-locker-for-elementor' ) );
     54        }
    5055
    5156        $action_type       = ! empty( $_REQUEST['action_type'] ) ? sanitize_key( $_REQUEST['action_type'] ) : '';
  • content-locker-for-elementor/trunk/Inc/Classes/Notifications/Subscribe.php

    r2957111 r3389341  
    3434        public function jltelcl_subscribe() {
    3535            check_ajax_referer( 'jltelcl_subscribe_nonce' );
     36
     37            // Check if user has permission to manage options
     38            if ( ! current_user_can( 'manage_options' ) ) {
     39                wp_send_json_error( __( 'You do not have permission to perform this action', 'content-locker-for-elementor' ) );
     40            }
    3641
    3742            $name  = ! empty( $_POST['name'] ) ? sanitize_text_field( wp_unslash( $_POST['name'] ) ) : '';
  • content-locker-for-elementor/trunk/Inc/Classes/Notifications/What_We_Collect.php

    r2977959 r3389341  
    3535        public function jltelcl_allow_collect() {
    3636            check_ajax_referer( 'jltelcl_allow_collect_nonce' );
     37
     38            // Check if user has permission to manage options
     39            if ( ! current_user_can( 'manage_options' ) ) {
     40                wp_send_json_error( __( 'You do not have permission to perform this action', 'content-locker-for-elementor' ) );
     41            }
    3742
    3843            $email = get_bloginfo( 'admin_email' );
  • content-locker-for-elementor/trunk/Libs/Recommended.php

    r2957111 r3389341  
    4141
    4242            add_action( 'admin_menu', array( $this, 'admin_menu' ), $this->menu_order );
     43            // Only allow logged-in users with appropriate permissions
    4344            add_action( 'wp_ajax_jltelcl_recommended_upgrade_plugin', array( $this, 'jltelcl_recommended_upgrade_plugin' ) );
    4445            add_action( 'wp_ajax_jltelcl_recommended_activate_plugin', array( $this, 'jltelcl_recommended_activate_plugin' ) );
     46            // Remove nopriv actions to prevent unauthenticated access
     47            remove_action( 'wp_ajax_nopriv_jltelcl_recommended_upgrade_plugin', array( $this, 'jltelcl_recommended_upgrade_plugin' ) );
     48            remove_action( 'wp_ajax_nopriv_jltelcl_recommended_activate_plugin', array( $this, 'jltelcl_recommended_activate_plugin' ) );
    4549        }
    4650
     
    290294                        wp_send_json_error( array( 'mess' => __( 'Nonce is invalid', 'content-locker-for-elementor' ) ) );
    291295                    }
     296
     297                    // Check if user has permission to activate plugins
     298                    if ( ! current_user_can( 'activate_plugins' ) ) {
     299                        wp_send_json_error( array( 'mess' => __( 'You do not have permission to activate plugins', 'content-locker-for-elementor' ) ) );
     300                    }
    292301                    $file   = sanitize_text_field( wp_unslash( $_POST['file'] ) );
    293302                    $result = activate_plugin( $file );
     
    344353                    if ( ! wp_verify_nonce( $nonce, 'jltelcl_recommended_nonce' ) ) {
    345354                        wp_send_json_error( array( 'mess' => __( 'Nonce is invalid', 'content-locker-for-elementor' ) ) );
     355                    }
     356
     357                    // Check if user has permission to install and update plugins
     358                    if ( ! current_user_can( 'install_plugins' ) || ! current_user_can( 'update_plugins' ) ) {
     359                        wp_send_json_error( array( 'mess' => __( 'You do not have permission to install or update plugins', 'content-locker-for-elementor' ) ) );
    346360                    }
    347361                    $plugin   = sanitize_text_field( wp_unslash( $_POST['plugin'] ) );
  • content-locker-for-elementor/trunk/content-locker-for-elementor.php

    r2977959 r3389341  
    44 * Plugin URI:  https://master-addons.com/restrict-content-for-elementor/
    55 * Description: Fast and Easy Elementor way to Restrict your Content. Content Locker for Elementor will give you full independncy over Contents like memebership websites.
    6  * Version:     1.0.3
     6 * Version:     1.0.4
    77 * Author:      Jewel Theme
    88 * Author URI:  https://jeweltheme.com
  • content-locker-for-elementor/trunk/readme.txt

    r2977959 r3389341  
    44Tags: content locker, restrict content elementor, member, members, membership, memberships, member only, registration form, restricted access, limit access, read only,
    55Requires at least: 4.0
    6 Tested up to: 6.3.1
    7 Stable tag: trunk
     6Tested up to: 6.8
     7Stable tag: 1.0.4
    88Requires PHP: 5.6
    99License: GPLv3 or later
     
    116116
    117117
    118 
    119 == Changelog ==
    120 = 1.0.3 (12-10-2023) =
    121 * Updated: Blank Admin page issue fixed
    122 
    123 = 1.0.0 (18-02-2020)=
    124 * Initial Release
    125 
    126118== Upgrade Notice ==
Note: See TracChangeset for help on using the changeset viewer.