Changeset 3389341
- Timestamp:
- 11/04/2025 05:52:44 AM (2 months ago)
- Location:
- content-locker-for-elementor
- Files:
-
- 4 added
- 2 deleted
- 20 edited
- 1 copied
-
tags/1.0.4 (copied) (copied from content-locker-for-elementor/trunk)
-
tags/1.0.4/.gitattributes (added)
-
tags/1.0.4/Inc/Addon/Content_Locker.php (modified) (6 diffs)
-
tags/1.0.4/Inc/Classes/Feedback.php (modified) (1 diff)
-
tags/1.0.4/Inc/Classes/Notifications/Notifications.php (modified) (1 diff)
-
tags/1.0.4/Inc/Classes/Notifications/Subscribe.php (modified) (1 diff)
-
tags/1.0.4/Inc/Classes/Notifications/What_We_Collect.php (modified) (1 diff)
-
tags/1.0.4/Libs/Recommended.php (modified) (3 diffs)
-
tags/1.0.4/assets/images/dropdown.png (modified) (previous)
-
tags/1.0.4/assets/images/promo-image.png (modified) (previous)
-
tags/1.0.4/changelog.txt (added)
-
tags/1.0.4/content-locker-for-elementor.php (modified) (1 diff)
-
tags/1.0.4/readme.txt (modified) (2 diffs)
-
tags/1.0.4/vendor (deleted)
-
trunk/.gitattributes (added)
-
trunk/Inc/Addon/Content_Locker.php (modified) (6 diffs)
-
trunk/Inc/Classes/Feedback.php (modified) (1 diff)
-
trunk/Inc/Classes/Notifications/Notifications.php (modified) (1 diff)
-
trunk/Inc/Classes/Notifications/Subscribe.php (modified) (1 diff)
-
trunk/Inc/Classes/Notifications/What_We_Collect.php (modified) (1 diff)
-
trunk/Libs/Recommended.php (modified) (3 diffs)
-
trunk/assets/images/dropdown.png (modified) (previous)
-
trunk/assets/images/promo-image.png (modified) (previous)
-
trunk/changelog.txt (added)
-
trunk/content-locker-for-elementor.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/vendor (deleted)
Legend:
- Unmodified
- Added
- Removed
-
content-locker-for-elementor/tags/1.0.4/Inc/Addon/Content_Locker.php
r2957111 r3389341 46 46 } 47 47 48 protected function _register_controls() {48 protected function register_controls() { 49 49 50 50 /* … … 1152 1152 ?> 1153 1153 <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' ); ?>> 1155 1155 <div class="card-body"> 1156 1156 … … 1197 1197 'class' => [ 'cle-restrict-content-wrap'], 1198 1198 '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' 1200 1200 ] 1201 1201 ]); 1202 1202 ?> 1203 1203 1204 <section <?php echo esc_attr( $this->get_render_attribute_string( 'wrapper' )); ?>>1204 <section <?php echo $this->get_render_attribute_string( 'wrapper' ); ?>> 1205 1205 1206 1206 <?php … … 1225 1225 1226 1226 } else { 1227 // Ensure session is started for password validation 1228 if( session_status() == PHP_SESSION_NONE ) { 1229 session_start(); 1230 } 1227 1231 1228 1232 if( !empty($settings['cle_restrict_content_pass']) ) { 1229 1233 if( isset($_POST['cle_restrict_content_pass']) && ($settings['cle_restrict_content_pass'] === $_POST['cle_restrict_content_pass']) ) { 1230 if( !session_status() ) { session_start(); }1231 1234 $_SESSION['cle_restrict_content_pass'] = true; 1232 1233 1235 $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(); 1234 1246 } 1235 1247 } else { 1236 1248 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']) ) {1240 1249 $this->cle_restrict_content_msg(); 1241 1250 $this->cle_restrict_content_form(); … … 1243 1252 } 1244 1253 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') { 1246 1255 1247 1256 // Math Captcha Content Locker … … 1253 1262 $cle_rc_answer_hd = isset($_POST['cle_rc_answer_hd']) ? esc_html( $_POST['cle_rc_answer_hd'] ) : ""; 1254 1263 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(); } 1256 1265 $this->cle_restrict_content(); 1257 1266 } 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 58 58 public function jltelcl_deactivation_survey(){ 59 59 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 } 60 65 61 66 $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 48 48 public function notification_action() { 49 49 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 } 50 55 51 56 $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 34 34 public function jltelcl_subscribe() { 35 35 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 } 36 41 37 42 $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 35 35 public function jltelcl_allow_collect() { 36 36 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 } 37 42 38 43 $email = get_bloginfo( 'admin_email' ); -
content-locker-for-elementor/tags/1.0.4/Libs/Recommended.php
r2957111 r3389341 41 41 42 42 add_action( 'admin_menu', array( $this, 'admin_menu' ), $this->menu_order ); 43 // Only allow logged-in users with appropriate permissions 43 44 add_action( 'wp_ajax_jltelcl_recommended_upgrade_plugin', array( $this, 'jltelcl_recommended_upgrade_plugin' ) ); 44 45 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' ) ); 45 49 } 46 50 … … 290 294 wp_send_json_error( array( 'mess' => __( 'Nonce is invalid', 'content-locker-for-elementor' ) ) ); 291 295 } 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 } 292 301 $file = sanitize_text_field( wp_unslash( $_POST['file'] ) ); 293 302 $result = activate_plugin( $file ); … … 344 353 if ( ! wp_verify_nonce( $nonce, 'jltelcl_recommended_nonce' ) ) { 345 354 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' ) ) ); 346 360 } 347 361 $plugin = sanitize_text_field( wp_unslash( $_POST['plugin'] ) ); -
content-locker-for-elementor/tags/1.0.4/content-locker-for-elementor.php
r2977959 r3389341 4 4 * Plugin URI: https://master-addons.com/restrict-content-for-elementor/ 5 5 * 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. 36 * Version: 1.0.4 7 7 * Author: Jewel Theme 8 8 * Author URI: https://jeweltheme.com -
content-locker-for-elementor/tags/1.0.4/readme.txt
r2977959 r3389341 4 4 Tags: content locker, restrict content elementor, member, members, membership, memberships, member only, registration form, restricted access, limit access, read only, 5 5 Requires at least: 4.0 6 Tested up to: 6. 3.17 Stable tag: trunk6 Tested up to: 6.8 7 Stable tag: 1.0.4 8 8 Requires PHP: 5.6 9 9 License: GPLv3 or later … … 116 116 117 117 118 119 == Changelog ==120 = 1.0.3 (12-10-2023) =121 * Updated: Blank Admin page issue fixed122 123 = 1.0.0 (18-02-2020)=124 * Initial Release125 126 118 == Upgrade Notice == -
content-locker-for-elementor/trunk/Inc/Addon/Content_Locker.php
r2957111 r3389341 46 46 } 47 47 48 protected function _register_controls() {48 protected function register_controls() { 49 49 50 50 /* … … 1152 1152 ?> 1153 1153 <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' ); ?>> 1155 1155 <div class="card-body"> 1156 1156 … … 1197 1197 'class' => [ 'cle-restrict-content-wrap'], 1198 1198 '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' 1200 1200 ] 1201 1201 ]); 1202 1202 ?> 1203 1203 1204 <section <?php echo esc_attr( $this->get_render_attribute_string( 'wrapper' )); ?>>1204 <section <?php echo $this->get_render_attribute_string( 'wrapper' ); ?>> 1205 1205 1206 1206 <?php … … 1225 1225 1226 1226 } else { 1227 // Ensure session is started for password validation 1228 if( session_status() == PHP_SESSION_NONE ) { 1229 session_start(); 1230 } 1227 1231 1228 1232 if( !empty($settings['cle_restrict_content_pass']) ) { 1229 1233 if( isset($_POST['cle_restrict_content_pass']) && ($settings['cle_restrict_content_pass'] === $_POST['cle_restrict_content_pass']) ) { 1230 if( !session_status() ) { session_start(); }1231 1234 $_SESSION['cle_restrict_content_pass'] = true; 1232 1233 1235 $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(); 1234 1246 } 1235 1247 } else { 1236 1248 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']) ) {1240 1249 $this->cle_restrict_content_msg(); 1241 1250 $this->cle_restrict_content_form(); … … 1243 1252 } 1244 1253 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') { 1246 1255 1247 1256 // Math Captcha Content Locker … … 1253 1262 $cle_rc_answer_hd = isset($_POST['cle_rc_answer_hd']) ? esc_html( $_POST['cle_rc_answer_hd'] ) : ""; 1254 1263 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(); } 1256 1265 $this->cle_restrict_content(); 1257 1266 } else if ( ! isset( $_POST['cle_rc_answer'] ) || ! $_POST['cle_rc_answer'] ) { -
content-locker-for-elementor/trunk/Inc/Classes/Feedback.php
r2957111 r3389341 58 58 public function jltelcl_deactivation_survey(){ 59 59 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 } 60 65 61 66 $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 48 48 public function notification_action() { 49 49 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 } 50 55 51 56 $action_type = ! empty( $_REQUEST['action_type'] ) ? sanitize_key( $_REQUEST['action_type'] ) : ''; -
content-locker-for-elementor/trunk/Inc/Classes/Notifications/Subscribe.php
r2957111 r3389341 34 34 public function jltelcl_subscribe() { 35 35 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 } 36 41 37 42 $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 35 35 public function jltelcl_allow_collect() { 36 36 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 } 37 42 38 43 $email = get_bloginfo( 'admin_email' ); -
content-locker-for-elementor/trunk/Libs/Recommended.php
r2957111 r3389341 41 41 42 42 add_action( 'admin_menu', array( $this, 'admin_menu' ), $this->menu_order ); 43 // Only allow logged-in users with appropriate permissions 43 44 add_action( 'wp_ajax_jltelcl_recommended_upgrade_plugin', array( $this, 'jltelcl_recommended_upgrade_plugin' ) ); 44 45 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' ) ); 45 49 } 46 50 … … 290 294 wp_send_json_error( array( 'mess' => __( 'Nonce is invalid', 'content-locker-for-elementor' ) ) ); 291 295 } 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 } 292 301 $file = sanitize_text_field( wp_unslash( $_POST['file'] ) ); 293 302 $result = activate_plugin( $file ); … … 344 353 if ( ! wp_verify_nonce( $nonce, 'jltelcl_recommended_nonce' ) ) { 345 354 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' ) ) ); 346 360 } 347 361 $plugin = sanitize_text_field( wp_unslash( $_POST['plugin'] ) ); -
content-locker-for-elementor/trunk/content-locker-for-elementor.php
r2977959 r3389341 4 4 * Plugin URI: https://master-addons.com/restrict-content-for-elementor/ 5 5 * 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. 36 * Version: 1.0.4 7 7 * Author: Jewel Theme 8 8 * Author URI: https://jeweltheme.com -
content-locker-for-elementor/trunk/readme.txt
r2977959 r3389341 4 4 Tags: content locker, restrict content elementor, member, members, membership, memberships, member only, registration form, restricted access, limit access, read only, 5 5 Requires at least: 4.0 6 Tested up to: 6. 3.17 Stable tag: trunk6 Tested up to: 6.8 7 Stable tag: 1.0.4 8 8 Requires PHP: 5.6 9 9 License: GPLv3 or later … … 116 116 117 117 118 119 == Changelog ==120 = 1.0.3 (12-10-2023) =121 * Updated: Blank Admin page issue fixed122 123 = 1.0.0 (18-02-2020)=124 * Initial Release125 126 118 == Upgrade Notice ==
Note: See TracChangeset
for help on using the changeset viewer.