Changeset 2474203
- Timestamp:
- 02/13/2021 11:06:05 AM (5 years ago)
- Location:
- wp-private-content-plus
- Files:
-
- 54 edited
-
tags/3.2/admin/templates/admin-menu-visibility.php (modified) (2 diffs)
-
tags/3.2/admin/templates/global-page-restriction-settings.php (modified) (1 diff)
-
tags/3.2/admin/templates/global-post-restriction-settings.php (modified) (1 diff)
-
tags/3.2/admin/templates/menu-page-container.php (modified) (1 diff)
-
tags/3.2/admin/templates/password-global-settings.php (modified) (1 diff)
-
tags/3.2/admin/templates/restriction-permission-settings.php (modified) (1 diff)
-
tags/3.2/admin/templates/search-general-settings.php (modified) (1 diff)
-
tags/3.2/admin/templates/search-restrictions.php (modified) (1 diff)
-
tags/3.2/admin/templates/upme-member-list.php (modified) (1 diff)
-
tags/3.2/admin/templates/upme-member-profile.php (modified) (1 diff)
-
tags/3.2/admin/templates/upme-search.php (modified) (1 diff)
-
tags/3.2/classes/class-wppcp-admin-stats.php (modified) (9 diffs)
-
tags/3.2/classes/class-wppcp-ip-restrictions.php (modified) (2 diffs)
-
tags/3.2/classes/class-wppcp-posts.php (modified) (3 diffs)
-
tags/3.2/classes/class-wppcp-private-content.php (modified) (2 diffs)
-
tags/3.2/classes/class-wppcp-settings.php (modified) (45 diffs)
-
tags/3.2/classes/class-wppcp-site-lockdown.php (modified) (3 diffs)
-
tags/3.2/classes/class-wppcp-widgets.php (modified) (1 diff)
-
tags/3.2/classes/class-wppcp-woocommerce-tab-manager.php (modified) (1 diff)
-
tags/3.2/functions.php (modified) (3 diffs)
-
tags/3.2/readme.txt (modified) (1 diff)
-
tags/3.2/templates/global-password-form.php (modified) (1 diff)
-
tags/3.2/templates/manage-file-attachments.php (modified) (6 diffs)
-
tags/3.2/templates/plugin-help.php (modified) (1 diff)
-
tags/3.2/templates/post-page-restriction-meta.php (modified) (5 diffs)
-
tags/3.2/templates/private-user-page.php (modified) (1 diff)
-
tags/3.2/templates/woo-tabs-restriction-meta.php (modified) (2 diffs)
-
trunk/admin/templates/admin-menu-visibility.php (modified) (2 diffs)
-
trunk/admin/templates/global-page-restriction-settings.php (modified) (1 diff)
-
trunk/admin/templates/global-post-restriction-settings.php (modified) (1 diff)
-
trunk/admin/templates/menu-page-container.php (modified) (1 diff)
-
trunk/admin/templates/password-global-settings.php (modified) (1 diff)
-
trunk/admin/templates/restriction-permission-settings.php (modified) (1 diff)
-
trunk/admin/templates/search-general-settings.php (modified) (1 diff)
-
trunk/admin/templates/search-restrictions.php (modified) (1 diff)
-
trunk/admin/templates/upme-member-list.php (modified) (1 diff)
-
trunk/admin/templates/upme-member-profile.php (modified) (1 diff)
-
trunk/admin/templates/upme-search.php (modified) (1 diff)
-
trunk/classes/class-wppcp-admin-stats.php (modified) (9 diffs)
-
trunk/classes/class-wppcp-ip-restrictions.php (modified) (2 diffs)
-
trunk/classes/class-wppcp-posts.php (modified) (3 diffs)
-
trunk/classes/class-wppcp-private-content.php (modified) (2 diffs)
-
trunk/classes/class-wppcp-settings.php (modified) (45 diffs)
-
trunk/classes/class-wppcp-site-lockdown.php (modified) (3 diffs)
-
trunk/classes/class-wppcp-widgets.php (modified) (1 diff)
-
trunk/classes/class-wppcp-woocommerce-tab-manager.php (modified) (1 diff)
-
trunk/functions.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/templates/global-password-form.php (modified) (1 diff)
-
trunk/templates/manage-file-attachments.php (modified) (6 diffs)
-
trunk/templates/plugin-help.php (modified) (1 diff)
-
trunk/templates/post-page-restriction-meta.php (modified) (5 diffs)
-
trunk/templates/private-user-page.php (modified) (1 diff)
-
trunk/templates/woo-tabs-restriction-meta.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-private-content-plus/tags/3.2/admin/templates/admin-menu-visibility.php
r2473452 r2474203 5 5 $user_roles = $wppcp->roles_capability->wppcp_user_roles(); 6 6 7 $admin_menu_visibility = esc_html($admin_menu_visibility); 7 8 ?> 8 9 <table class="form-table wppcp-settings-list"> … … 26 27 if($role_key != 'administrator'){ 27 28 ?> 28 <input type="checkbox" <?php echo $checked_val; ?> class="wppcp_admin_menu_item_roles" id="wppcp_admin_menu_item_roles" name="wppcp_admin_menu_item_roles[]" value='<?php echo $role_key; ?>'><?php echo $role; ?><br/>29 <input type="checkbox" <?php echo $checked_val; ?> class="wppcp_admin_menu_item_roles" id="wppcp_admin_menu_item_roles" name="wppcp_admin_menu_item_roles[]" value='<?php echo $role_key; ?>'><?php echo esc_html($role); ?><br/> 29 30 <?php } ?> 30 31 <?php } ?> -
wp-private-content-plus/tags/3.2/admin/templates/global-page-restriction-settings.php
r2473452 r2474203 59 59 if($role_key != 'administrator'){ 60 60 ?> 61 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_global_page_restriction[all_page_user_roles][]" value='<?php echo $role_key; ?>'><?php echo $role; ?><br/>61 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_global_page_restriction[all_page_user_roles][]" value='<?php echo $role_key; ?>'><?php echo esc_html($role); ?><br/> 62 62 <?php } ?> 63 63 <?php } ?> -
wp-private-content-plus/tags/3.2/admin/templates/global-post-restriction-settings.php
r2473452 r2474203 59 59 if($role_key != 'administrator'){ 60 60 ?> 61 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_global_post_restriction[all_post_user_roles][]" value='<?php echo $role_key; ?>'><?php echo $role; ?><br/>61 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_global_post_restriction[all_post_user_roles][]" value='<?php echo $role_key; ?>'><?php echo esc_html($role); ?><br/> 62 62 <?php } ?> 63 63 <?php } ?> -
wp-private-content-plus/tags/3.2/admin/templates/menu-page-container.php
r2473452 r2474203 5 5 6 6 <div class="wrap"> 7 <?php echo $tabs; ?>8 <?php echo $tab_content; ?>7 <?php echo ($tabs); ?> 8 <?php echo ($tab_content); ?> 9 9 10 10 </div> -
wp-private-content-plus/tags/3.2/admin/templates/password-global-settings.php
r2473452 r2474203 3 3 extract($wppcp_password_settings_data); 4 4 5 $global_password_protect = esc_html($global_password_protect); 5 6 ?> 6 7 -
wp-private-content-plus/tags/3.2/admin/templates/restriction-permission-settings.php
r2473452 r2474203 22 22 if($role_key != 'administrator'){ 23 23 ?> 24 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_feature_restrictions[wppcp_feature_permission_roles][]" value='<?php echo $role_key; ?>'><?php echo $role; ?><br/>24 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_feature_restrictions[wppcp_feature_permission_roles][]" value='<?php echo $role_key; ?>'><?php echo esc_html($role); ?><br/> 25 25 <?php } ?> 26 26 <?php } ?> -
wp-private-content-plus/tags/3.2/admin/templates/search-general-settings.php
r2473452 r2474203 14 14 $message .= ' <a target="_blank" href="https://www.wpexpertdeveloper.com/site-advanced-search-restrictions/?ref=pro-search-settings" >'. 15 15 __('View More','wppcp'). '</a>'; 16 echo wp pcp_display_pro_info_box($message,'post_meta_boxes','wppcp_pro_info_search_restrictions');16 echo wp_kses_post(wppcp_display_pro_info_box($message,'post_meta_boxes','wppcp_pro_info_search_restrictions')); 17 17 } 18 18 ?> -
wp-private-content-plus/tags/3.2/admin/templates/search-restrictions.php
r2473452 r2474203 18 18 $message .= ' <a target="_blank" href="https://www.wpexpertdeveloper.com/site-advanced-search-restrictions/?ref=pro-search-res" >'. 19 19 __('View More','wppcp'). '</a>'; 20 echo wp pcp_display_pro_info_box($message,'post_meta_boxes','wppcp_pro_info_search_restrictions');20 echo wp_kses_post(wppcp_display_pro_info_box($message,'post_meta_boxes','wppcp_pro_info_search_restrictions')); 21 21 } 22 22 ?> -
wp-private-content-plus/tags/3.2/admin/templates/upme-member-list.php
r2473452 r2474203 46 46 if($role_key != 'administrator'){ 47 47 ?> 48 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_upme_member_list[upme_member_list_user_roles][]" value='<?php echo $role_key; ?>'><?php echo $role; ?><br/>48 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_upme_member_list[upme_member_list_user_roles][]" value='<?php echo $role_key; ?>'><?php echo esc_html($role); ?><br/> 49 49 <?php } ?> 50 50 <?php } ?> -
wp-private-content-plus/tags/3.2/admin/templates/upme-member-profile.php
r2473452 r2474203 46 46 if($role_key != 'administrator'){ 47 47 ?> 48 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_upme_member_profile[upme_member_profile_user_roles][]" value='<?php echo $role_key; ?>'><?php echo $role; ?><br/>48 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_upme_member_profile[upme_member_profile_user_roles][]" value='<?php echo $role_key; ?>'><?php echo esc_html($role); ?><br/> 49 49 <?php } ?> 50 50 <?php } ?> -
wp-private-content-plus/tags/3.2/admin/templates/upme-search.php
r2473452 r2474203 46 46 if($role_key != 'administrator'){ 47 47 ?> 48 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_upme_search[upme_search_user_roles][]" value='<?php echo $role_key; ?>'><?php echo $role; ?><br/>48 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_upme_search[upme_search_user_roles][]" value='<?php echo $role_key; ?>'><?php echo esc_html($role); ?><br/> 49 49 <?php } ?> 50 50 <?php } ?> -
wp-private-content-plus/tags/3.2/classes/class-wppcp-admin-stats.php
r2473452 r2474203 73 73 $individual_protection = array(); 74 74 if($results['single_data']['post_count'] > 0){ 75 $individual_protection[] = "<span>" . $results['single_data']['post_count'] . __(' Posts ','wppcp')."</span>" ;75 $individual_protection[] = "<span>" . (int) $results['single_data']['post_count'] . __(' Posts ','wppcp')."</span>" ; 76 76 } 77 77 if($results['single_data']['page_count'] > 0){ 78 $individual_protection[] = "<span>" . $results['single_data']['page_count'] . __(' Pages ','wppcp')."</span>" ;78 $individual_protection[] = "<span>" . (int) $results['single_data']['page_count'] . __(' Pages ','wppcp')."</span>" ; 79 79 } 80 80 if($results['single_data']['cpt_count'] > 0){ 81 $individual_protection[] = "<span>" . $results['single_data']['cpt_count'] . __(' Custom Post Types ','wppcp')."</span>" ;81 $individual_protection[] = "<span>" . (int) $results['single_data']['cpt_count'] . __(' Custom Post Types ','wppcp')."</span>" ; 82 82 } 83 83 … … 90 90 $global_protection = array(); 91 91 if($results['global_data']['restrict_all_posts_status'] == '1'){ 92 $global_protection[] = "<span>" . $results['global_data']['post_count'] . __(' Posts ','wppcp')."</span>" ;92 $global_protection[] = "<span>" . (int) $results['global_data']['post_count'] . __(' Posts ','wppcp')."</span>" ; 93 93 } 94 94 if($results['global_data']['restrict_all_pages_status'] == '1'){ 95 $global_protection[] = "<span>" . $results['global_data']['page_count'] . __(' Pages ','wppcp')."</span>" ;95 $global_protection[] = "<span>" . (int) $results['global_data']['page_count'] . __(' Pages ','wppcp')."</span>" ; 96 96 } 97 97 … … 103 103 $password_protection = ''; 104 104 if(isset($results['password_data']['status'])){ 105 $password_protection = "<span>" . $results['password_data']['post_count'] . __(' Posts ','wppcp')."</span>" . " - " .106 "<span>" . $results['password_data']['page_count'] . __(' Pages ','wppcp')."</span>" ." - " .107 "<span>" . $results['password_data']['cpt_count'] . __(' Custom Post Types ','wppcp')."</span>" ;105 $password_protection = "<span>" . (int) $results['password_data']['post_count'] . __(' Posts ','wppcp')."</span>" . " - " . 106 "<span>" . (int) $results['password_data']['page_count'] . __(' Pages ','wppcp')."</span>" ." - " . 107 "<span>" . (int) $results['password_data']['cpt_count'] . __(' Custom Post Types ','wppcp')."</span>" ; 108 108 $password_protection .= __(' are protected','wppcp'); 109 109 … … 112 112 $menu_protection = ''; 113 113 if($results['menu_data']['count'] > 0){ 114 $menu_protection = "<span>" . $results['menu_data']['count'] . __(' Menu Items ','wppcp')."</span>" ;114 $menu_protection = "<span>" . (int) $results['menu_data']['count'] . __(' Menu Items ','wppcp')."</span>" ; 115 115 $menu_protection .= __(' are protected','wppcp'); 116 116 … … 119 119 $widget_protection = ''; 120 120 if($results['widgets_data']['count'] > 0){ 121 $widget_protection = "<span>" . $results['widgets_data']['count'] . __(' Widgets ','wppcp')."</span>" ;121 $widget_protection = "<span>" . (int) $results['widgets_data']['count'] . __(' Widgets ','wppcp')."</span>" ; 122 122 $widget_protection .= __(' are protected','wppcp'); 123 123 … … 126 126 $shortcode_protection = ''; 127 127 if($results['shortcode_data']['count'] > 0){ 128 $shortcode_protection = "<span>" . $results['shortcode_data']['count'] . __(' Post/Page Content Blocks ','wppcp') ."</span>" ;128 $shortcode_protection = "<span>" . (int) $results['shortcode_data']['count'] . __(' Post/Page Content Blocks ','wppcp') ."</span>" ; 129 129 $shortcode_protection .= __(' are protected','wppcp'); 130 130 … … 133 133 $private_page_protection = ''; 134 134 if($results['private_page_data']['count'] > 0){ 135 $private_page_protection = "<span>" . $results['private_page_data']['count'].__(' Users ','wppcp') . "</span>" . __('have private page with protected content. ','wppcp') ."</span>" ;135 $private_page_protection = "<span>" . (int) $results['private_page_data']['count'].__(' Users ','wppcp') . "</span>" . __('have private page with protected content. ','wppcp') ."</span>" ; 136 136 137 137 } … … 139 139 $attachment_protection = array(); 140 140 if($results['attachment_data']['post_count'] > 0){ 141 $attachment_protection[] = "<span>" . $results['attachment_data']['post_count'] . __(' Post ','wppcp')."</span>" ;141 $attachment_protection[] = "<span>" . (int) $results['attachment_data']['post_count'] . __(' Post ','wppcp')."</span>" ; 142 142 } 143 143 if($results['attachment_data']['page_count'] > 0){ 144 $attachment_protection[] = "<span>" . $results['attachment_data']['page_count'] . __(' Page ','wppcp')."</span>" ;144 $attachment_protection[] = "<span>" . (int) $results['attachment_data']['page_count'] . __(' Page ','wppcp')."</span>" ; 145 145 } 146 146 if($results['attachment_data']['cpt_count'] > 0){ 147 $attachment_protection[] = "<span>" . $results['attachment_data']['cpt_count'] . __(' Custom Post Type ','wppcp')."</span>" ;147 $attachment_protection[] = "<span>" . (int) $results['attachment_data']['cpt_count'] . __(' Custom Post Type ','wppcp')."</span>" ; 148 148 } 149 149 … … 157 157 $search_protection = array(); 158 158 if($results['search_data']['blocked_posts'] > 0){ 159 $search_protection[] = "<span>" . $results['search_data']['blocked_posts'] . __(' Posts ','wppcp')."</span>" ;159 $search_protection[] = "<span>" . (int) $results['search_data']['blocked_posts'] . __(' Posts ','wppcp')."</span>" ; 160 160 } 161 161 if($results['search_data']['blocked_pages'] > 0){ 162 $search_protection[] = "<span>" . $results['search_data']['blocked_pages'] . __(' Pages ','wppcp')."</span>" ;162 $search_protection[] = "<span>" . (int) $results['search_data']['blocked_pages'] . __(' Pages ','wppcp')."</span>" ; 163 163 } 164 164 $search_protection = implode("-", $search_protection); -
wp-private-content-plus/tags/3.2/classes/class-wppcp-ip-restrictions.php
r2473452 r2474203 8 8 9 9 public function validate_ip_restrictions(){ 10 global $wppcp,$wp_query,$wppcp_cpt_id; ;10 global $wppcp,$wp_query,$wppcp_cpt_id; 11 11 $private_content_settings = get_option('wppcp_options'); 12 12 if(!isset($private_content_settings['general']['private_content_module_status'])){ … … 36 36 if($url != ''){ 37 37 $url = rtrim($url , '/'); 38 array_push($filtered_allowed_urls, $url);38 array_push($filtered_allowed_urls, esc_url($url)); 39 39 } 40 40 } -
wp-private-content-plus/tags/3.2/classes/class-wppcp-posts.php
r2473452 r2474203 20 20 $post_json_results = array(); 21 21 22 $query = "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.post_title like '%".$search_text."%' && $wpdb->posts.post_status='publish' && $wpdb->posts.post_type='page' order by $wpdb->posts.post_date desc limit 20"; 22 $query = $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.post_title like '%s' && $wpdb->posts.post_status='publish' && $wpdb->posts.post_type='page' order by $wpdb->posts.post_date desc limit 20", '%'.$search_text.'%' ); 23 24 // $query = "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.post_title like '%".$search_text."%' && $wpdb->posts.post_status='publish' && $wpdb->posts.post_type='page' order by $wpdb->posts.post_date desc limit 20"; 23 25 $result = $wpdb->get_results($query); 24 26 if($result){ … … 42 44 $post_json_results = array(); 43 45 44 $query = "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.post_title like '%".$search_text."%' && $wpdb->posts.post_status='publish' && $wpdb->posts.post_type='post' order by $wpdb->posts.post_date desc limit 20";46 $query = $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.post_title like '%s' && $wpdb->posts.post_status='publish' && $wpdb->posts.post_type='post' order by $wpdb->posts.post_date desc limit 20", '%'.$search_text.'%' ); 45 47 $result = $wpdb->get_results($query); 46 48 if($result){ … … 66 68 $post_json_results = array(); 67 69 68 $query = "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.post_title like '%".$search_text."%' && $wpdb->posts.post_status='publish' && $wpdb->posts.post_type='".$post_type."' order by $wpdb->posts.post_date desc limit 20"; 70 71 72 $query = $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.post_title like '%s' && $wpdb->posts.post_status='publish' && $wpdb->posts.post_type='%s' order by $wpdb->posts.post_date desc limit 20", '%'.$search_text.'%', $post_type ); 73 69 74 $result = $wpdb->get_results($query); 70 75 if($result){ -
wp-private-content-plus/tags/3.2/classes/class-wppcp-private-content.php
r2473452 r2474203 67 67 68 68 if($result){ 69 return stripslashes(do_shortcode($result[0]->content));69 return (stripslashes(do_shortcode($result[0]->content))); 70 70 }else{ 71 71 return stripslashes(get_option('wppcp_parivate_page_starter_content')); … … 1112 1112 if($type != 'none'){ 1113 1113 $users = isset($_POST['wppcp_bulk_private_page_upload_users']) ? (array) $_POST['wppcp_bulk_private_page_upload_users'] : array(); 1114 1115 $content = isset($_POST['wppcp_bulk_private_page_upload_content']) ? $_POST['wppcp_bulk_private_page_upload_content']: '';1114 1115 $content = isset($_POST['wppcp_bulk_private_page_upload_content']) ? wp_kses_post($_POST['wppcp_bulk_private_page_upload_content']) : ''; 1116 1116 1117 1117 foreach ($users as $key => $user_id) { -
wp-private-content-plus/tags/3.2/classes/class-wppcp-settings.php
r2473452 r2474203 549 549 550 550 $user_id = isset($_POST['wppcp_user_id']) ? (int) $_POST['wppcp_user_id'] : 0; 551 $private_content = isset($_POST['wppcp_private_page_content']) ? ( $_POST['wppcp_private_page_content']) : ''; 551 552 $private_content = isset($_POST['wppcp_private_page_content']) ? wp_kses_post( $_POST['wppcp_private_page_content']) : ''; 552 553 $updated_date = date("Y-m-d H:i:s"); 553 554 … … 601 602 global $wppcp; 602 603 604 $this->settings = array(); 603 605 if(isset($_POST['wppcp_general'])){ 604 606 foreach($_POST['wppcp_general'] as $k=>$v){ … … 609 611 case 'author_post_page_restrictions_status': 610 612 $v = sanitize_text_field($v); 613 $this->settings[$k] = $v; 611 614 break; 612 615 case 'post_page_redirect_url': 613 616 $v = esc_url_raw($v); 614 break; 615 616 } 617 $this->settings[$k] = $v; 617 $this->settings[$k] = $v; 618 break; 619 } 618 620 } 619 621 } … … 630 632 public function save_wppcp_section_information(){ 631 633 global $wppcp; 632 634 $this->settings = array(); 633 635 if(isset($_POST['wppcp_information'])){ 634 636 foreach($_POST['wppcp_information'] as $k=>$v){ … … 639 641 case 'pro_info_private_page': 640 642 $v = sanitize_text_field($v); 643 $this->settings[$k] = $v; 641 644 break; 642 645 643 646 } 644 $this->settings[$k] = $v;647 645 648 } 646 649 … … 670 673 global $wppcp; 671 674 675 $this->settings = array(); 672 676 if(isset($_POST['wppcp_global_post_restriction'])){ 673 677 foreach($_POST['wppcp_global_post_restriction'] as $k=>$v){ 674 678 switch ($k) { 675 679 case 'restrict_all_posts_status': 680 $v = sanitize_text_field($v); 681 $this->settings[$k] = $v; 682 break; 676 683 case 'all_post_visibility': 677 684 $v = sanitize_text_field($v); 685 if(in_array($v, array('all','guest','member','role'))){ 686 $this->settings[$k] = $v; 687 } 688 break; 689 case 'all_post_user_roles': 690 if(is_array($v)){ 691 $roles_arr = array(); 692 foreach ($v as $user_role_v) { 693 $roles_arr[] = sanitize_text_field($user_role_v); 694 } 695 $this->settings[$k] = $roles_arr; 696 } 697 678 698 break; 679 699 680 700 } 681 $this->settings[$k] = $v;701 682 702 } 683 703 … … 693 713 public function save_wppcp_section_global_page(){ 694 714 global $wppcp; 695 715 $this->settings = array(); 696 716 if(isset($_POST['wppcp_global_page_restriction'])){ 697 717 foreach($_POST['wppcp_global_page_restriction'] as $k=>$v){ 698 718 switch ($k) { 699 719 case 'restrict_all_pages_status': 720 $v = sanitize_text_field($v); 721 $this->settings[$k] = $v; 722 break; 700 723 case 'all_page_visibility': 701 724 $v = sanitize_text_field($v); 702 break; 725 if(in_array($v, array('all','guest','member','role'))){ 726 $this->settings[$k] = $v; 727 } 728 break; 729 case 'all_page_user_roles': 730 if(is_array($v)){ 731 $roles_arr = array(); 732 foreach ($v as $user_role_v) { 733 $roles_arr[] = sanitize_text_field($user_role_v); 734 } 735 $this->settings[$k] = $roles_arr; 736 } 703 737 704 738 } 705 $this->settings[$k] = $v;739 706 740 } 707 741 … … 738 772 739 773 } 740 741 /* Display private user page add content form */ 742 // public function private_user_page(){ 743 // global $wppcp,$wppcp_private_page_params,$wpdb; 744 745 // $wppcp_private_page_params = array(); 746 747 // $this->load_wppcp_select2_scripts_style(); 748 749 // $private_page_user = 0; 750 // if($_POST && isset($_POST['wppcp_private_page_user_load']) && ( current_user_can('manage_options') || current_user_can('wppcp_manage_options') ) ){ 751 // $private_page_user = isset($_POST['wppcp_private_page_user']) ? (int) ( $_POST['wppcp_private_page_user'] ) : 0; 752 // $user = get_user_by( 'id', $private_page_user ); 753 // $wppcp_private_page_params['display_name'] = $user->data->display_name; 754 // $wppcp_private_page_params['user_id'] = $private_page_user; 755 // } 756 757 758 759 // if($_POST && isset($_POST['wppcp_private_page_content_submit']) && ( current_user_can('manage_options') || current_user_can('wppcp_manage_options') ) ){ 760 761 // if (isset( $_POST['wppcp_private_page_nonce_field'] ) && wp_verify_nonce( $_POST['wppcp_private_page_nonce_field'], 'wppcp_private_page_nonce' ) ) { 762 763 // $user_id = isset($_POST['wppcp_user_id']) ? (int) $_POST['wppcp_user_id'] : 0; 764 // $private_content = isset($_POST['wppcp_private_page_content']) ? ( $_POST['wppcp_private_page_content']) : ''; 765 // $updated_date = date("Y-m-d H:i:s"); 766 767 // $sql = $wpdb->prepare( "SELECT content FROM " . $wpdb->prefix . WPPCP_PRIVATE_CONTENT_TABLE . " WHERE user_id = %d ", $user_id ); 768 // $result = $wpdb->get_results($sql); 769 // if($result){ 770 // $sql = $wpdb->prepare( "Update " . $wpdb->prefix . WPPCP_PRIVATE_CONTENT_TABLE ." set content=%s,updated_at=%s where user_id=%d ", $private_content,$updated_date, $user_id ); 771 // }else{ 772 // $sql = $wpdb->prepare( "Insert into " . $wpdb->prefix . WPPCP_PRIVATE_CONTENT_TABLE ."(user_id,content,type,updated_at) values(%d,%s,%s,%s)", $user_id, $private_content, 'ADMIN', $updated_date ); 773 // } 774 775 776 // if($wpdb->query($sql) === FALSE){ 777 // $wppcp_private_page_params['message'] = __('Private content update failed.','wppcp'); 778 // $wppcp_private_page_params['message_status'] = FALSE; 779 // }else{ 780 // $wppcp_private_page_params['message'] = __('Private content updated successfully.','wppcp'); 781 // $wppcp_private_page_params['message_status'] = TRUE; 782 // } 783 // } 784 // } 785 786 // $sql = $wpdb->prepare( "SELECT content FROM " . $wpdb->prefix . WPPCP_PRIVATE_CONTENT_TABLE . " WHERE user_id = %d ", $private_page_user ); 787 // $result = $wpdb->get_results($sql); 788 // if($result){ 789 // $wppcp_private_page_params['private_content'] = stripslashes($result[0]->content); 790 // }else{ 791 // $wppcp_private_page_params['private_content'] = ''; 792 // } 793 794 795 796 797 // ob_start(); 798 // $wppcp->template_loader->get_template_part('private-user-page'); 799 // $display = ob_get_clean(); 800 // echo $display; 801 // } 774 802 775 803 776 /* Load Select 2 library for settings section */ … … 873 846 public function save_wppcp_section_wppcp_permissions(){ 874 847 global $wppcp,$wp_roles; 875 848 $this->settings = array(); 876 849 if(isset($_POST['wppcp_feature_restrictions'])){ 877 850 … … 883 856 $v[$key] = sanitize_text_field($value); 884 857 } 885 886 break; 887 888 889 } 890 $this->settings[$k] = $v; 858 $this->settings[$k] = $v; 859 break; 860 } 891 861 } 892 862 … … 994 964 public function save_wppcp_section_security_ip(){ 995 965 global $wppcp; 996 966 $this->settings = array(); 997 967 if(isset($_POST['wppcp_security_ip'])){ 998 968 foreach($_POST['wppcp_security_ip'] as $k=>$v){ … … 1000 970 case 'restriction_status': 1001 971 $v = sanitize_text_field($v); 972 $this->settings[$k] = $v; 1002 973 break; 1003 974 case 'allowed_urls': 1004 975 case 'whitelisted': 1005 976 $v = sanitize_textarea_field($v); 977 $this->settings[$k] = $v; 1006 978 break; 1007 979 case 'redirect_url': 1008 980 $v = esc_url_raw($v); 981 $this->settings[$k] = $v; 1009 982 break; 1010 983 1011 984 } 1012 $this->settings[$k] = $v;985 1013 986 } 1014 987 … … 1024 997 public function save_wppcp_section_search_general(){ 1025 998 global $wppcp; 1026 999 $this->settings = array(); 1027 1000 if(isset($_POST['wppcp_search_general'])){ 1028 1001 foreach($_POST['wppcp_search_general'] as $k=>$v){ … … 1034 1007 $v[$key] = (int) ($post_id); 1035 1008 } 1036 1037 break; 1038 1039 } 1040 1041 $this->settings[$k] = $v; 1042 } 1043 1009 $this->settings[$k] = $v; 1010 break; 1011 1012 } 1013 } 1044 1014 } 1045 1015 … … 1052 1022 public function save_wppcp_section_search_restrictions(){ 1053 1023 global $wppcp; 1054 1024 $this->settings = array(); 1055 1025 if(isset($_POST['wppcp_search_restrictions'])){ 1056 1026 foreach($_POST['wppcp_search_restrictions'] as $k=>$v){ … … 1062 1032 $v[$key] = sanitize_text_field($post_types); 1063 1033 } 1064 1034 $this->settings[$k] = $v; 1065 1035 break; 1066 1036 1067 1037 } 1068 $this->settings[$k] = $v;1038 1069 1039 } 1070 1040 … … 1105 1075 public function save_wppcp_section_password_global(){ 1106 1076 global $wppcp; 1077 1078 $this->settings = array(); 1107 1079 1108 1080 if(isset($_POST['wppcp_password_global'])){ … … 1114 1086 1115 1087 $v = sanitize_text_field($v); 1088 $this->settings[$k] = $v; 1116 1089 break; 1117 1090 1118 1091 case 'password_form_message': 1119 1092 $v = wp_kses_post($v); 1093 $this->settings[$k] = $v; 1120 1094 break; 1121 1095 1122 1096 case 'allowed_urls': 1123 1097 $v = sanitize_textarea_field($v); 1098 $this->settings[$k] = $v; 1124 1099 break; 1125 1100 1126 1101 } 1127 $this->settings[$k] = $v;1102 1128 1103 } 1129 1104 … … 1251 1226 global $wppcp; 1252 1227 1228 $this->settings = array(); 1253 1229 if(isset($_POST['wppcp_upme_general'])){ 1254 1230 foreach($_POST['wppcp_upme_general'] as $k=>$v){ … … 1257 1233 case 'redirect_to_upme_login': 1258 1234 $v = sanitize_text_field($v); 1235 $this->settings[$k] = $v; 1259 1236 break; 1260 1237 1261 1238 } 1262 $this->settings[$k] = $v;1239 1263 1240 } 1264 1241 … … 1274 1251 public function save_wppcp_section_upme_search(){ 1275 1252 global $wppcp; 1276 1253 $this->settings = array(); 1277 1254 if(isset($_POST['wppcp_upme_search'])){ 1278 1255 foreach($_POST['wppcp_upme_search'] as $k=>$v){ … … 1280 1257 case 'upme_search_visibility': 1281 1258 $v = sanitize_text_field($v); 1259 $this->settings[$k] = $v; 1282 1260 break; 1283 1261 1284 1262 } 1285 $this->settings[$k] = $v;1263 1286 1264 } 1287 1265 … … 1298 1276 global $wppcp; 1299 1277 1278 $this->settings = array(); 1300 1279 if(isset($_POST['wppcp_upme_member_list'])){ 1301 1280 foreach($_POST['wppcp_upme_member_list'] as $k=>$v){ … … 1303 1282 case 'upme_member_list_visibility': 1304 1283 $v = sanitize_text_field($v); 1284 $this->settings[$k] = $v; 1305 1285 break; 1306 1286 1307 1287 } 1308 $this->settings[$k] = $v;1288 1309 1289 } 1310 1290 … … 1320 1300 public function save_wppcp_section_upme_member_profile(){ 1321 1301 global $wppcp; 1322 1302 $this->settings = array(); 1323 1303 if(isset($_POST['wppcp_upme_member_profile'])){ 1324 1304 foreach($_POST['wppcp_upme_member_profile'] as $k=>$v){ … … 1326 1306 case 'upme_member_profile_visibility': 1327 1307 $v = sanitize_text_field($v); 1308 $this->settings[$k] = $v; 1328 1309 break; 1329 1310 1330 1311 } 1331 $this->settings[$k] = $v;1312 1332 1313 } 1333 1314 … … 1360 1341 $individual_protection = array(); 1361 1342 if($results['single_data']['post_count'] > 0){ 1362 $individual_protection[] = "<span>" . $results['single_data']['post_count'] . __(' Posts ','wppcp')."</span>" ;1343 $individual_protection[] = "<span>" . (int) $results['single_data']['post_count'] . __(' Posts ','wppcp')."</span>" ; 1363 1344 } 1364 1345 if($results['single_data']['page_count'] > 0){ 1365 $individual_protection[] = "<span>" . $results['single_data']['page_count'] . __(' Pages ','wppcp')."</span>" ;1346 $individual_protection[] = "<span>" . (int) $results['single_data']['page_count'] . __(' Pages ','wppcp')."</span>" ; 1366 1347 } 1367 1348 if($results['single_data']['cpt_count'] > 0){ 1368 $individual_protection[] = "<span>" . $results['single_data']['cpt_count'] . __(' Custom Post Types ','wppcp')."</span>" ;1349 $individual_protection[] = "<span>" .(int) $results['single_data']['cpt_count'] . __(' Custom Post Types ','wppcp')."</span>" ; 1369 1350 } 1370 1351 … … 1377 1358 $global_protection = array(); 1378 1359 if($results['global_data']['restrict_all_posts_status'] == '1'){ 1379 $global_protection[] = "<span>" . $results['global_data']['post_count'] . __(' Posts ','wppcp')."</span>" ;1360 $global_protection[] = "<span>" .(int) $results['global_data']['post_count'] . __(' Posts ','wppcp')."</span>" ; 1380 1361 } 1381 1362 if($results['global_data']['restrict_all_pages_status'] == '1'){ 1382 $global_protection[] = "<span>" . $results['global_data']['page_count'] . __(' Pages ','wppcp')."</span>" ;1363 $global_protection[] = "<span>" .(int) $results['global_data']['page_count'] . __(' Pages ','wppcp')."</span>" ; 1383 1364 } 1384 1365 … … 1390 1371 $password_protection = ''; 1391 1372 if(isset($results['password_data']['status'])){ 1392 $password_protection = "<span>" . $results['password_data']['post_count'] . __(' Posts ','wppcp')."</span>" . " - " .1393 "<span>" . $results['password_data']['page_count'] . __(' Pages ','wppcp')."</span>" ." - " .1394 "<span>" . $results['password_data']['cpt_count'] . __(' Custom Post Types ','wppcp')."</span>" ;1373 $password_protection = "<span>" .(int) $results['password_data']['post_count'] . __(' Posts ','wppcp')."</span>" . " - " . 1374 "<span>" .(int) $results['password_data']['page_count'] . __(' Pages ','wppcp')."</span>" ." - " . 1375 "<span>" .(int) $results['password_data']['cpt_count'] . __(' Custom Post Types ','wppcp')."</span>" ; 1395 1376 $password_protection .= __(' are protected','wppcp'); 1396 1377 … … 1399 1380 $menu_protection = ''; 1400 1381 if($results['menu_data']['count'] > 0){ 1401 $menu_protection = "<span>" . $results['menu_data']['count'] . __(' Menu Items ','wppcp')."</span>" ;1382 $menu_protection = "<span>" .(int) $results['menu_data']['count'] . __(' Menu Items ','wppcp')."</span>" ; 1402 1383 $menu_protection .= __(' are protected','wppcp'); 1403 1384 … … 1406 1387 $widget_protection = ''; 1407 1388 if($results['widgets_data']['count'] > 0){ 1408 $widget_protection = "<span>" . $results['widgets_data']['count'] . __(' Widgets ','wppcp')."</span>" ;1389 $widget_protection = "<span>" .(int) $results['widgets_data']['count'] . __(' Widgets ','wppcp')."</span>" ; 1409 1390 $widget_protection .= __(' are protected','wppcp'); 1410 1391 … … 1413 1394 $shortcode_protection = ''; 1414 1395 if($results['shortcode_data']['count'] > 0){ 1415 $shortcode_protection = "<span>" . $results['shortcode_data']['count'] . __(' Post/Page Content Blocks ','wppcp') ."</span>" ;1396 $shortcode_protection = "<span>" .(int) $results['shortcode_data']['count'] . __(' Post/Page Content Blocks ','wppcp') ."</span>" ; 1416 1397 $shortcode_protection .= __(' are protected','wppcp'); 1417 1398 … … 1420 1401 $private_page_protection = ''; 1421 1402 if($results['private_page_data']['count'] > 0){ 1422 $private_page_protection = "<span>" . $results['private_page_data']['count'].__(' Users ','wppcp') . "</span>" . __('have private page with protected content. ','wppcp') ."</span>" ;1403 $private_page_protection = "<span>" .(int) $results['private_page_data']['count'].__(' Users ','wppcp') . "</span>" . __('have private page with protected content. ','wppcp') ."</span>" ; 1423 1404 1424 1405 } … … 1426 1407 $attachment_protection = array(); 1427 1408 if($results['attachment_data']['post_count'] > 0){ 1428 $attachment_protection[] = "<span>" . $results['attachment_data']['post_count'] . __(' Post ','wppcp')."</span>" ;1409 $attachment_protection[] = "<span>" .(int) $results['attachment_data']['post_count'] . __(' Post ','wppcp')."</span>" ; 1429 1410 } 1430 1411 if($results['attachment_data']['page_count'] > 0){ 1431 $attachment_protection[] = "<span>" . $results['attachment_data']['page_count'] . __(' Page ','wppcp')."</span>" ;1412 $attachment_protection[] = "<span>" .(int) $results['attachment_data']['page_count'] . __(' Page ','wppcp')."</span>" ; 1432 1413 } 1433 1414 if($results['attachment_data']['cpt_count'] > 0){ 1434 $attachment_protection[] = "<span>" . $results['attachment_data']['cpt_count'] . __(' Custom Post Type ','wppcp')."</span>" ;1415 $attachment_protection[] = "<span>" .(int) $results['attachment_data']['cpt_count'] . __(' Custom Post Type ','wppcp')."</span>" ; 1435 1416 } 1436 1417 … … 1444 1425 $search_protection = array(); 1445 1426 if($results['search_data']['blocked_posts'] > 0){ 1446 $search_protection[] = "<span>" . $results['search_data']['blocked_posts'] . __(' Posts ','wppcp')."</span>" ;1427 $search_protection[] = "<span>" .(int) $results['search_data']['blocked_posts'] . __(' Posts ','wppcp')."</span>" ; 1447 1428 } 1448 1429 if($results['search_data']['blocked_pages'] > 0){ 1449 $search_protection[] = "<span>" . $results['search_data']['blocked_pages'] . __(' Pages ','wppcp')."</span>" ;1430 $search_protection[] = "<span>" .(int) $results['search_data']['blocked_pages'] . __(' Pages ','wppcp')."</span>" ; 1450 1431 } 1451 1432 $search_protection = implode("-", $search_protection); … … 1460 1441 if($individual_protection != ''){ 1461 1442 $table .= "<tr><th>". __('Individual Post/Page Protection','wppcp'). "</th> 1462 <td>". $individual_protection."</td>1443 <td>".esc_html($individual_protection)."</td> 1463 1444 </tr>"; 1464 1445 $protection_count++; … … 1467 1448 if($global_protection != ''){ 1468 1449 $table .= "<tr><th>". __('Global Post/Page Protection','wppcp'). "</th> 1469 <td>". $global_protection. "</td>1450 <td>".esc_html($global_protection). "</td> 1470 1451 </tr>"; 1471 1452 $protection_count++; … … 1474 1455 if($password_protection != ''){ 1475 1456 $table .= "<tr><th>". __('Password Protection','wppcp'). "</th> 1476 <td>". $password_protection. "</td>1457 <td>".esc_html($password_protection). "</td> 1477 1458 </tr>"; 1478 1459 $protection_count++; … … 1481 1462 if($menu_protection != ''){ 1482 1463 $table .= "<tr><th>". __('Menu Protection','wppcp'). "</th> 1483 <td>". $menu_protection. "</td>1464 <td>".esc_html($menu_protection). "</td> 1484 1465 </tr>"; 1485 1466 $protection_count++; … … 1488 1469 if($widget_protection != ''){ 1489 1470 $table .= "<tr><th>". __('Widget Protection','wppcp'). "</th> 1490 <td>". $widget_protection. "</td>1471 <td>".esc_html($widget_protection). "</td> 1491 1472 </tr>"; 1492 1473 $protection_count++; … … 1495 1476 if($shortcode_protection != ''){ 1496 1477 $table .= "<tr><th>". __('Shortcode Protection','wppcp'). "</th> 1497 <td>". $shortcode_protection. "</td>1478 <td>".esc_html($shortcode_protection). "</td> 1498 1479 </tr>"; 1499 1480 $protection_count++; … … 1502 1483 if($attachment_protection != ''){ 1503 1484 $table .= "<tr><th>". __('Attachment Protection','wppcp'). "</th> 1504 <td>". $attachment_protection. "</td>1485 <td>".esc_html($attachment_protection). "</td> 1505 1486 </tr>"; 1506 1487 $protection_count++; … … 1509 1490 if($private_page_protection != ''){ 1510 1491 $table .= "<tr><th>". __('Private Page','wppcp'). "</th> 1511 <td>". $private_page_protection. "</td>1492 <td>".esc_html($private_page_protection). "</td> 1512 1493 </tr>"; 1513 1494 $protection_count++; … … 1516 1497 if($search_protection != ''){ 1517 1498 $table .= "<tr><th>". __('Search Protection','wppcp'). "</th> 1518 <td>". $search_protection. "</td>1499 <td>".esc_html($search_protection). "</td> 1519 1500 </tr>"; 1520 1501 $protection_count++; … … 1582 1563 </div> 1583 1564 <footer> 1584 <input id="wppcp_init_version" type="hidden" value="'. $wppcp_init_version.'" />1585 <input id="wppcp_init_date" type="hidden" value="'. $wppcp_init_date.'" />1565 <input id="wppcp_init_version" type="hidden" value="'.esc_html($wppcp_init_version).'" /> 1566 <input id="wppcp_init_date" type="hidden" value="'.esc_html($wppcp_init_date).'" /> 1586 1567 <input id="wppcp_init_admin_email" type="hidden" value="'.get_option('admin_email').'" /> 1587 1568 <input id="wppcp-deactivate-reasons-submit" class="wppcp-modal-btn wppcp-modal-btn-small" type="button" value="'.__('Submit & Deactivate','wppcp').'" /> -
wp-private-content-plus/tags/3.2/classes/class-wppcp-site-lockdown.php
r2473452 r2474203 75 75 public function save_settings($tab,$params){ 76 76 global $wppcp; 77 77 $this->settings = array(); 78 78 if(isset($_POST['wppcp_site_lockdown'])){ 79 79 80 foreach($_POST['wppcp_site_lockdown'] as $k=>$v){ 80 81 switch ($k) { 81 case 'allowed_posts': 82 case 'allowed_pages': 82 case 'lockdown_allowed_pages': 83 case 'lockdown_allowed_posts': 84 if(is_array($v)){ 85 $post_arr = array(); 86 foreach ($v as $post_ids) { 87 array_push($post_arr, (int) $post_ids); 88 } 89 $this->settings[$k] = $post_arr; 90 } 83 91 break; 84 92 case 'lockdown_status': 85 93 $v = sanitize_text_field($v); 94 $this->settings[$k] = $v; 86 95 break; 87 96 case 'allowed_urls': 88 97 $v = sanitize_textarea_field($v); 98 $this->settings[$k] = $v; 89 99 break; 90 100 case 'redirect_url': 91 101 $v = esc_url_raw($v); 102 $this->settings[$k] = $v; 92 103 break; 93 104 } 94 $this->settings[$k] = $v; 95 } 105 106 } 107 96 108 } 97 109 … … 179 191 if('wp-login' == $redirect_url){ 180 192 $url = add_query_arg( 'redirect_to', $current_page_url, wp_login_url() ); 181 wp_redirect( $url);193 wp_redirect(esc_url($url)); 182 194 183 195 }else{ … … 185 197 $url = add_query_arg( 'redirect_to', $current_page_url, ($redirect_url) ); 186 198 // echo $url;exit; 187 wp_redirect( $url);199 wp_redirect(esc_url($url)); 188 200 } 189 201 exit; -
wp-private-content-plus/tags/3.2/classes/class-wppcp-widgets.php
r2473452 r2474203 44 44 $checked = checked( true, in_array( $role, $visible_roles ) , false ); 45 45 46 $display .= '<input type="checkbox" name="'. $widget->get_field_name('wppcp_visibility_roles').'[]" id="'.$widget->get_field_id('wppcp_visibility_roles').'" '.$checked.' value="'.$role.'" />46 $display .= '<input type="checkbox" name="'. esc_html($widget->get_field_name('wppcp_visibility_roles')).'[]" id="'.esc_html($widget->get_field_id('wppcp_visibility_roles')).'" '.$checked.' value="'.esc_html($role).'" /> 47 47 <label for=""> 48 '. $name.'48 '.esc_html($name) .' 49 49 </label><br/>'; 50 50 -
wp-private-content-plus/tags/3.2/classes/class-wppcp-woocommerce-tab-manager.php
r2473452 r2474203 136 136 $post_id = str_replace("wppcp_woo_", "", $key); 137 137 $product_tab = get_post($post_id); 138 echo do_shortcode($product_tab->post_content);138 echo wp_kses_post(do_shortcode($product_tab->post_content)); 139 139 } 140 140 -
wp-private-content-plus/tags/3.2/functions.php
r2473452 r2474203 10 10 foreach ($query_comp as $param) { 11 11 $params = explode('=', $param); 12 $key = isset($params[0]) ? $params[0]: '';13 $value = isset($params[1]) ? $params[1]: '';12 $key = isset($params[0]) ? sanitize_text_field($params[0]) : ''; 13 $value = isset($params[1]) ? sanitize_text_field($params[1]) : ''; 14 14 $build_url = esc_url_raw(add_query_arg($key, $value, $build_url)); 15 15 } … … 114 114 $wppcp->template_loader->get_template_part('addons','feed'); 115 115 $display = ob_get_clean(); 116 echo $display;116 echo wp_kses_post($display); 117 117 } 118 118 … … 154 154 <?php 155 155 $display = ob_get_clean(); 156 return $display;156 return wp_kses_post($display); 157 157 } 158 158 -
wp-private-content-plus/tags/3.2/readme.txt
r2473452 r2474203 184 184 = 3.2 = 185 185 * Fix security issue related to group creation 186 * Improve security in all plugin files 186 187 187 188 = 3.1 = -
wp-private-content-plus/tags/3.2/templates/global-password-form.php
r2473452 r2474203 52 52 <div class="wppcp_panel_title"><?php echo esc_html($protected_form_header); ?></div> 53 53 <?php if($password_protect_error != ''){ ?> 54 <div class="wppcp_panel_error"><?php echo $password_protect_error; ?></div>54 <div class="wppcp_panel_error"><?php echo wp_kses_post($password_protect_error); ?></div> 55 55 <?php } ?> 56 56 -
wp-private-content-plus/tags/3.2/templates/manage-file-attachments.php
r2473452 r2474203 28 28 $message .= ' <a target="_blank" href="https://www.wpexpertdeveloper.com/restrict-pro-post-attachments-and-downloads/?ref=pro-attachments" >'. 29 29 __('View More','wppcp'). '</a>'; 30 echo wp pcp_display_pro_info_box($message,'post_meta_boxes_large','wppcp_pro_info_post_attachments');30 echo wp_kses_post(wppcp_display_pro_info_box($message,'post_meta_boxes_large','wppcp_pro_info_post_attachments')); 31 31 32 32 } … … 48 48 $attached_name = isset($attach_data['name']) ? $attach_data['name'] : ''; 49 49 $attached_desc = isset($attach_data['desc']) ? $attach_data['desc'] : ''; 50 $attached_visibility = isset($attach_data['visibility']) ? $attach_data['visibility']: 'all';51 $attached_download_permission = isset($attach_data['download_permission']) ? $attach_data['download_permission']: 'all';50 $attached_visibility = isset($attach_data['visibility']) ? esc_html($attach_data['visibility']) : 'all'; 51 $attached_download_permission = isset($attach_data['download_permission']) ? esc_html($attach_data['download_permission']) : 'all'; 52 52 $attached_mime = isset($attach_data['mime']) ? $attach_data['mime'] : ''; 53 53 … … 63 63 <div class='wppcp-attachments-panel-file-single'> 64 64 <div class='wppcp-attachments-panel-file-left'> 65 <img src="<?php echo esc_url($attach_image_url); ?>" data-attachment-id="<?php echo $attach_data['attach_id']; ?>" class='wppcp-attachment-preview' />65 <img src="<?php echo esc_url($attach_image_url); ?>" data-attachment-id="<?php echo (int) $attach_data['attach_id']; ?>" class='wppcp-attachment-preview' /> 66 66 <div class='wppcp-slider-images-panel-gallery-icons'><?php echo $image_icons; ?></div> 67 67 </div> … … 69 69 <div class='wppcp-attachments-panel-file-row'> 70 70 <div class='wppcp-attachments-panel-file-label'><?php _e('File Name','wppcp'); ?></div> 71 <div class='wppcp-attachments-panel-file-field'><input type='text' name='wppcp_attachments[<?php echo $attach_data['attach_id']; ?>][name]' value='<?php echo esc_html($attached_name); ?>' /></div>71 <div class='wppcp-attachments-panel-file-field'><input type='text' name='wppcp_attachments[<?php echo (int) $attach_data['attach_id']; ?>][name]' value='<?php echo esc_html($attached_name); ?>' /></div> 72 72 </div> 73 73 <div class='wppcp-attachments-panel-file-row'> 74 74 <div class='wppcp-attachments-panel-file-label'><?php _e('File Description','wppcp'); ?></div> 75 <div class='wppcp-attachments-panel-file-field'><textarea name='wppcp_attachments[<?php echo $attach_data['attach_id']; ?>][desc]' ><?php echo esc_html($attached_desc); ?></textarea></div>75 <div class='wppcp-attachments-panel-file-field'><textarea name='wppcp_attachments[<?php echo (int) $attach_data['attach_id']; ?>][desc]' ><?php echo esc_html($attached_desc); ?></textarea></div> 76 76 </div> 77 77 <div class='wppcp-attachments-panel-file-row'> 78 78 <div class='wppcp-attachments-panel-file-label'><?php _e('File Visibility','wppcp'); ?></div> 79 79 <div class='wppcp-attachments-panel-file-field'> 80 <select class='wppcp-attachments-panel-file-visibility' name='wppcp_attachments[<?php echo $attach_data['attach_id']; ?>][visibility]' >80 <select class='wppcp-attachments-panel-file-visibility' name='wppcp_attachments[<?php echo (int) $attach_data['attach_id']; ?>][visibility]' > 81 81 <option <?php echo selected($attached_visibility,'all'); ?> value="all"><?php _e('Everyone','wppcp'); ?></option> 82 82 <option <?php echo selected($attached_visibility,'guest'); ?> value="guest"><?php _e('Guests','wppcp'); ?></option> … … 88 88 <div class='wppcp-attachments-panel-file-label'><?php _e('Download Permission','wppcp'); ?></div> 89 89 <div class='wppcp-attachments-panel-file-field'> 90 <select class='wppcp-attachments-panel-file-download-permission' name='wppcp_attachments[<?php echo $attach_data['attach_id']; ?>][download_permission]' >90 <select class='wppcp-attachments-panel-file-download-permission' name='wppcp_attachments[<?php echo (int) $attach_data['attach_id']; ?>][download_permission]' > 91 91 <option <?php echo selected($attached_download_permission,'all'); ?> value="all"><?php _e('Everyone','wppcp'); ?></option> 92 92 <option <?php echo selected($attached_download_permission,'guest'); ?> value="guest"><?php _e('Guests','wppcp'); ?></option> … … 96 96 </div> 97 97 </div> 98 <input type="hidden" value="<?php echo esc_html($attached_mime); ?>" name="wppcp_attachments[<?php echo $attach_data['attach_id']; ?>][mime]" />98 <input type="hidden" value="<?php echo esc_html($attached_mime); ?>" name="wppcp_attachments[<?php echo (int) $attach_data['attach_id']; ?>][mime]" /> 99 99 </div> 100 100 -
wp-private-content-plus/tags/3.2/templates/plugin-help.php
r2473452 r2474203 12 12 <h1><?php echo esc_html($title); ?></h1> 13 13 <div class="about-text"> 14 <?php echo $desc; ?>14 <?php echo wp_kses_post($desc); ?> 15 15 </div> 16 16 -
wp-private-content-plus/tags/3.2/templates/post-page-restriction-meta.php
r2473452 r2474203 6 6 $post_type = $post->post_type; 7 7 8 $visibility = get_post_meta( $post->ID, '_wppcp_post_page_visibility', true);8 $visibility = esc_html(get_post_meta( $post->ID, '_wppcp_post_page_visibility', true )); 9 9 $redirection_url = get_post_meta( $post->ID, '_wppcp_post_page_redirection_url', true ); 10 10 … … 46 46 $message .= ' <a target="_blank" href="https://www.wpexpertdeveloper.com/global-custom-post-type-protection/?ref=pro-cpt" >'. 47 47 __('View More','wppcp'). '</a>'; 48 echo wppcp_display_pro_info_box($message,'post_meta_boxes','wppcp_pro_info_post_restrictions'); 48 49 echo wp_kses_post(wppcp_display_pro_info_box($message,'post_meta_boxes','wppcp_pro_info_post_restrictions')); 49 50 } 50 51 … … 53 54 $message .= sprintf(__('%sGo PRO%s and add users to user groups or membership levels. Protection rules can be applied on user groups or membership 54 55 levels instead of selecting users for each post/page','wppcp'), '<strong>','</strong>' ); 55 echo wp pcp_display_pro_info_box($message,'post_meta_boxes_large','wppcp_pro_info_post_restrictions');56 echo wp_kses_post(wppcp_display_pro_info_box($message,'post_meta_boxes_large','wppcp_pro_info_post_restrictions')); 56 57 } 57 58 ?> … … 85 86 if($role_key != 'administrator'){ 86 87 ?> 87 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_post_page_roles[]" value='<?php echo $role_key; ?>'><?php echo $role; ?><br/>88 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_post_page_roles[]" value='<?php echo $role_key; ?>'><?php echo esc_html($role); ?><br/> 88 89 <?php } ?> 89 90 <?php } ?> … … 101 102 $display_name = $user->data->display_name; 102 103 ?> 103 <option value='<?php echo $user_id; ?>' selected ><?php echo $display_name; ?></option>104 <option value='<?php echo $user_id; ?>' selected ><?php echo esc_html($display_name); ?></option> 104 105 <?php } ?> 105 106 </select> -
wp-private-content-plus/tags/3.2/templates/private-user-page.php
r2473452 r2474203 58 58 $message .= ' <a target="_blank" href="https://www.wpexpertdeveloper.com/private-page-dashboard-users/?ref=pro-private-page" >'. 59 59 __('View More','wppcp'). '</a>'; 60 echo wp pcp_display_pro_info_box($message,'post_meta_boxes','wppcp_pro_info_private_page');60 echo wp_kses_post(wppcp_display_pro_info_box($message,'post_meta_boxes','wppcp_pro_info_private_page')); 61 61 } 62 62 ?> -
wp-private-content-plus/tags/3.2/templates/woo-tabs-restriction-meta.php
r2473452 r2474203 6 6 $post_type = $post->post_type; 7 7 8 $visibility = get_post_meta( $post->ID, '_wppcp_woo_tabs_visibility', true);8 $visibility = esc_html(get_post_meta( $post->ID, '_wppcp_woo_tabs_visibility', true )); 9 9 $redirection_url = get_post_meta( $post->ID, '_wppcp_woo_tabs_redirection_url', true ); 10 10 … … 49 49 if($role_key != 'administrator'){ 50 50 ?> 51 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_woo_tabs_roles[]" value='<?php echo $role_key; ?>'><?php echo $role; ?><br/>51 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_woo_tabs_roles[]" value='<?php echo $role_key; ?>'><?php echo esc_html($role); ?><br/> 52 52 <?php } ?> 53 53 <?php } ?> -
wp-private-content-plus/trunk/admin/templates/admin-menu-visibility.php
r2145057 r2474203 5 5 $user_roles = $wppcp->roles_capability->wppcp_user_roles(); 6 6 7 $admin_menu_visibility = esc_html($admin_menu_visibility); 7 8 ?> 8 9 <table class="form-table wppcp-settings-list"> … … 26 27 if($role_key != 'administrator'){ 27 28 ?> 28 <input type="checkbox" <?php echo $checked_val; ?> class="wppcp_admin_menu_item_roles" id="wppcp_admin_menu_item_roles" name="wppcp_admin_menu_item_roles[]" value='<?php echo $role_key; ?>'><?php echo $role; ?><br/>29 <input type="checkbox" <?php echo $checked_val; ?> class="wppcp_admin_menu_item_roles" id="wppcp_admin_menu_item_roles" name="wppcp_admin_menu_item_roles[]" value='<?php echo $role_key; ?>'><?php echo esc_html($role); ?><br/> 29 30 <?php } ?> 30 31 <?php } ?> -
wp-private-content-plus/trunk/admin/templates/global-page-restriction-settings.php
r2145207 r2474203 59 59 if($role_key != 'administrator'){ 60 60 ?> 61 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_global_page_restriction[all_page_user_roles][]" value='<?php echo $role_key; ?>'><?php echo $role; ?><br/>61 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_global_page_restriction[all_page_user_roles][]" value='<?php echo $role_key; ?>'><?php echo esc_html($role); ?><br/> 62 62 <?php } ?> 63 63 <?php } ?> -
wp-private-content-plus/trunk/admin/templates/global-post-restriction-settings.php
r2145207 r2474203 59 59 if($role_key != 'administrator'){ 60 60 ?> 61 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_global_post_restriction[all_post_user_roles][]" value='<?php echo $role_key; ?>'><?php echo $role; ?><br/>61 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_global_post_restriction[all_post_user_roles][]" value='<?php echo $role_key; ?>'><?php echo esc_html($role); ?><br/> 62 62 <?php } ?> 63 63 <?php } ?> -
wp-private-content-plus/trunk/admin/templates/menu-page-container.php
r1307180 r2474203 5 5 6 6 <div class="wrap"> 7 <?php echo $tabs; ?>8 <?php echo $tab_content; ?>7 <?php echo ($tabs); ?> 8 <?php echo ($tab_content); ?> 9 9 10 10 </div> -
wp-private-content-plus/trunk/admin/templates/password-global-settings.php
r2145207 r2474203 3 3 extract($wppcp_password_settings_data); 4 4 5 $global_password_protect = esc_html($global_password_protect); 5 6 ?> 6 7 -
wp-private-content-plus/trunk/admin/templates/restriction-permission-settings.php
r2145057 r2474203 22 22 if($role_key != 'administrator'){ 23 23 ?> 24 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_feature_restrictions[wppcp_feature_permission_roles][]" value='<?php echo $role_key; ?>'><?php echo $role; ?><br/>24 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_feature_restrictions[wppcp_feature_permission_roles][]" value='<?php echo $role_key; ?>'><?php echo esc_html($role); ?><br/> 25 25 <?php } ?> 26 26 <?php } ?> -
wp-private-content-plus/trunk/admin/templates/search-general-settings.php
r2145207 r2474203 14 14 $message .= ' <a target="_blank" href="https://www.wpexpertdeveloper.com/site-advanced-search-restrictions/?ref=pro-search-settings" >'. 15 15 __('View More','wppcp'). '</a>'; 16 echo wp pcp_display_pro_info_box($message,'post_meta_boxes','wppcp_pro_info_search_restrictions');16 echo wp_kses_post(wppcp_display_pro_info_box($message,'post_meta_boxes','wppcp_pro_info_search_restrictions')); 17 17 } 18 18 ?> -
wp-private-content-plus/trunk/admin/templates/search-restrictions.php
r2145207 r2474203 18 18 $message .= ' <a target="_blank" href="https://www.wpexpertdeveloper.com/site-advanced-search-restrictions/?ref=pro-search-res" >'. 19 19 __('View More','wppcp'). '</a>'; 20 echo wp pcp_display_pro_info_box($message,'post_meta_boxes','wppcp_pro_info_search_restrictions');20 echo wp_kses_post(wppcp_display_pro_info_box($message,'post_meta_boxes','wppcp_pro_info_search_restrictions')); 21 21 } 22 22 ?> -
wp-private-content-plus/trunk/admin/templates/upme-member-list.php
r2145057 r2474203 46 46 if($role_key != 'administrator'){ 47 47 ?> 48 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_upme_member_list[upme_member_list_user_roles][]" value='<?php echo $role_key; ?>'><?php echo $role; ?><br/>48 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_upme_member_list[upme_member_list_user_roles][]" value='<?php echo $role_key; ?>'><?php echo esc_html($role); ?><br/> 49 49 <?php } ?> 50 50 <?php } ?> -
wp-private-content-plus/trunk/admin/templates/upme-member-profile.php
r2145057 r2474203 46 46 if($role_key != 'administrator'){ 47 47 ?> 48 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_upme_member_profile[upme_member_profile_user_roles][]" value='<?php echo $role_key; ?>'><?php echo $role; ?><br/>48 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_upme_member_profile[upme_member_profile_user_roles][]" value='<?php echo $role_key; ?>'><?php echo esc_html($role); ?><br/> 49 49 <?php } ?> 50 50 <?php } ?> -
wp-private-content-plus/trunk/admin/templates/upme-search.php
r2145057 r2474203 46 46 if($role_key != 'administrator'){ 47 47 ?> 48 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_upme_search[upme_search_user_roles][]" value='<?php echo $role_key; ?>'><?php echo $role; ?><br/>48 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_upme_search[upme_search_user_roles][]" value='<?php echo $role_key; ?>'><?php echo esc_html($role); ?><br/> 49 49 <?php } ?> 50 50 <?php } ?> -
wp-private-content-plus/trunk/classes/class-wppcp-admin-stats.php
r2162686 r2474203 73 73 $individual_protection = array(); 74 74 if($results['single_data']['post_count'] > 0){ 75 $individual_protection[] = "<span>" . $results['single_data']['post_count'] . __(' Posts ','wppcp')."</span>" ;75 $individual_protection[] = "<span>" . (int) $results['single_data']['post_count'] . __(' Posts ','wppcp')."</span>" ; 76 76 } 77 77 if($results['single_data']['page_count'] > 0){ 78 $individual_protection[] = "<span>" . $results['single_data']['page_count'] . __(' Pages ','wppcp')."</span>" ;78 $individual_protection[] = "<span>" . (int) $results['single_data']['page_count'] . __(' Pages ','wppcp')."</span>" ; 79 79 } 80 80 if($results['single_data']['cpt_count'] > 0){ 81 $individual_protection[] = "<span>" . $results['single_data']['cpt_count'] . __(' Custom Post Types ','wppcp')."</span>" ;81 $individual_protection[] = "<span>" . (int) $results['single_data']['cpt_count'] . __(' Custom Post Types ','wppcp')."</span>" ; 82 82 } 83 83 … … 90 90 $global_protection = array(); 91 91 if($results['global_data']['restrict_all_posts_status'] == '1'){ 92 $global_protection[] = "<span>" . $results['global_data']['post_count'] . __(' Posts ','wppcp')."</span>" ;92 $global_protection[] = "<span>" . (int) $results['global_data']['post_count'] . __(' Posts ','wppcp')."</span>" ; 93 93 } 94 94 if($results['global_data']['restrict_all_pages_status'] == '1'){ 95 $global_protection[] = "<span>" . $results['global_data']['page_count'] . __(' Pages ','wppcp')."</span>" ;95 $global_protection[] = "<span>" . (int) $results['global_data']['page_count'] . __(' Pages ','wppcp')."</span>" ; 96 96 } 97 97 … … 103 103 $password_protection = ''; 104 104 if(isset($results['password_data']['status'])){ 105 $password_protection = "<span>" . $results['password_data']['post_count'] . __(' Posts ','wppcp')."</span>" . " - " .106 "<span>" . $results['password_data']['page_count'] . __(' Pages ','wppcp')."</span>" ." - " .107 "<span>" . $results['password_data']['cpt_count'] . __(' Custom Post Types ','wppcp')."</span>" ;105 $password_protection = "<span>" . (int) $results['password_data']['post_count'] . __(' Posts ','wppcp')."</span>" . " - " . 106 "<span>" . (int) $results['password_data']['page_count'] . __(' Pages ','wppcp')."</span>" ." - " . 107 "<span>" . (int) $results['password_data']['cpt_count'] . __(' Custom Post Types ','wppcp')."</span>" ; 108 108 $password_protection .= __(' are protected','wppcp'); 109 109 … … 112 112 $menu_protection = ''; 113 113 if($results['menu_data']['count'] > 0){ 114 $menu_protection = "<span>" . $results['menu_data']['count'] . __(' Menu Items ','wppcp')."</span>" ;114 $menu_protection = "<span>" . (int) $results['menu_data']['count'] . __(' Menu Items ','wppcp')."</span>" ; 115 115 $menu_protection .= __(' are protected','wppcp'); 116 116 … … 119 119 $widget_protection = ''; 120 120 if($results['widgets_data']['count'] > 0){ 121 $widget_protection = "<span>" . $results['widgets_data']['count'] . __(' Widgets ','wppcp')."</span>" ;121 $widget_protection = "<span>" . (int) $results['widgets_data']['count'] . __(' Widgets ','wppcp')."</span>" ; 122 122 $widget_protection .= __(' are protected','wppcp'); 123 123 … … 126 126 $shortcode_protection = ''; 127 127 if($results['shortcode_data']['count'] > 0){ 128 $shortcode_protection = "<span>" . $results['shortcode_data']['count'] . __(' Post/Page Content Blocks ','wppcp') ."</span>" ;128 $shortcode_protection = "<span>" . (int) $results['shortcode_data']['count'] . __(' Post/Page Content Blocks ','wppcp') ."</span>" ; 129 129 $shortcode_protection .= __(' are protected','wppcp'); 130 130 … … 133 133 $private_page_protection = ''; 134 134 if($results['private_page_data']['count'] > 0){ 135 $private_page_protection = "<span>" . $results['private_page_data']['count'].__(' Users ','wppcp') . "</span>" . __('have private page with protected content. ','wppcp') ."</span>" ;135 $private_page_protection = "<span>" . (int) $results['private_page_data']['count'].__(' Users ','wppcp') . "</span>" . __('have private page with protected content. ','wppcp') ."</span>" ; 136 136 137 137 } … … 139 139 $attachment_protection = array(); 140 140 if($results['attachment_data']['post_count'] > 0){ 141 $attachment_protection[] = "<span>" . $results['attachment_data']['post_count'] . __(' Post ','wppcp')."</span>" ;141 $attachment_protection[] = "<span>" . (int) $results['attachment_data']['post_count'] . __(' Post ','wppcp')."</span>" ; 142 142 } 143 143 if($results['attachment_data']['page_count'] > 0){ 144 $attachment_protection[] = "<span>" . $results['attachment_data']['page_count'] . __(' Page ','wppcp')."</span>" ;144 $attachment_protection[] = "<span>" . (int) $results['attachment_data']['page_count'] . __(' Page ','wppcp')."</span>" ; 145 145 } 146 146 if($results['attachment_data']['cpt_count'] > 0){ 147 $attachment_protection[] = "<span>" . $results['attachment_data']['cpt_count'] . __(' Custom Post Type ','wppcp')."</span>" ;147 $attachment_protection[] = "<span>" . (int) $results['attachment_data']['cpt_count'] . __(' Custom Post Type ','wppcp')."</span>" ; 148 148 } 149 149 … … 157 157 $search_protection = array(); 158 158 if($results['search_data']['blocked_posts'] > 0){ 159 $search_protection[] = "<span>" . $results['search_data']['blocked_posts'] . __(' Posts ','wppcp')."</span>" ;159 $search_protection[] = "<span>" . (int) $results['search_data']['blocked_posts'] . __(' Posts ','wppcp')."</span>" ; 160 160 } 161 161 if($results['search_data']['blocked_pages'] > 0){ 162 $search_protection[] = "<span>" . $results['search_data']['blocked_pages'] . __(' Pages ','wppcp')."</span>" ;162 $search_protection[] = "<span>" . (int) $results['search_data']['blocked_pages'] . __(' Pages ','wppcp')."</span>" ; 163 163 } 164 164 $search_protection = implode("-", $search_protection); -
wp-private-content-plus/trunk/classes/class-wppcp-ip-restrictions.php
r2145057 r2474203 8 8 9 9 public function validate_ip_restrictions(){ 10 global $wppcp,$wp_query,$wppcp_cpt_id; ;10 global $wppcp,$wp_query,$wppcp_cpt_id; 11 11 $private_content_settings = get_option('wppcp_options'); 12 12 if(!isset($private_content_settings['general']['private_content_module_status'])){ … … 36 36 if($url != ''){ 37 37 $url = rtrim($url , '/'); 38 array_push($filtered_allowed_urls, $url);38 array_push($filtered_allowed_urls, esc_url($url)); 39 39 } 40 40 } -
wp-private-content-plus/trunk/classes/class-wppcp-posts.php
r2149488 r2474203 20 20 $post_json_results = array(); 21 21 22 $query = "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.post_title like '%".$search_text."%' && $wpdb->posts.post_status='publish' && $wpdb->posts.post_type='page' order by $wpdb->posts.post_date desc limit 20"; 22 $query = $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.post_title like '%s' && $wpdb->posts.post_status='publish' && $wpdb->posts.post_type='page' order by $wpdb->posts.post_date desc limit 20", '%'.$search_text.'%' ); 23 24 // $query = "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.post_title like '%".$search_text."%' && $wpdb->posts.post_status='publish' && $wpdb->posts.post_type='page' order by $wpdb->posts.post_date desc limit 20"; 23 25 $result = $wpdb->get_results($query); 24 26 if($result){ … … 42 44 $post_json_results = array(); 43 45 44 $query = "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.post_title like '%".$search_text."%' && $wpdb->posts.post_status='publish' && $wpdb->posts.post_type='post' order by $wpdb->posts.post_date desc limit 20";46 $query = $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.post_title like '%s' && $wpdb->posts.post_status='publish' && $wpdb->posts.post_type='post' order by $wpdb->posts.post_date desc limit 20", '%'.$search_text.'%' ); 45 47 $result = $wpdb->get_results($query); 46 48 if($result){ … … 66 68 $post_json_results = array(); 67 69 68 $query = "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.post_title like '%".$search_text."%' && $wpdb->posts.post_status='publish' && $wpdb->posts.post_type='".$post_type."' order by $wpdb->posts.post_date desc limit 20"; 70 71 72 $query = $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.post_title like '%s' && $wpdb->posts.post_status='publish' && $wpdb->posts.post_type='%s' order by $wpdb->posts.post_date desc limit 20", '%'.$search_text.'%', $post_type ); 73 69 74 $result = $wpdb->get_results($query); 70 75 if($result){ -
wp-private-content-plus/trunk/classes/class-wppcp-private-content.php
r2299063 r2474203 67 67 68 68 if($result){ 69 return stripslashes(do_shortcode($result[0]->content));69 return (stripslashes(do_shortcode($result[0]->content))); 70 70 }else{ 71 71 return stripslashes(get_option('wppcp_parivate_page_starter_content')); … … 1112 1112 if($type != 'none'){ 1113 1113 $users = isset($_POST['wppcp_bulk_private_page_upload_users']) ? (array) $_POST['wppcp_bulk_private_page_upload_users'] : array(); 1114 1115 $content = isset($_POST['wppcp_bulk_private_page_upload_content']) ? $_POST['wppcp_bulk_private_page_upload_content']: '';1114 1115 $content = isset($_POST['wppcp_bulk_private_page_upload_content']) ? wp_kses_post($_POST['wppcp_bulk_private_page_upload_content']) : ''; 1116 1116 1117 1117 foreach ($users as $key => $user_id) { -
wp-private-content-plus/trunk/classes/class-wppcp-settings.php
r2473452 r2474203 549 549 550 550 $user_id = isset($_POST['wppcp_user_id']) ? (int) $_POST['wppcp_user_id'] : 0; 551 $private_content = isset($_POST['wppcp_private_page_content']) ? ( $_POST['wppcp_private_page_content']) : ''; 551 552 $private_content = isset($_POST['wppcp_private_page_content']) ? wp_kses_post( $_POST['wppcp_private_page_content']) : ''; 552 553 $updated_date = date("Y-m-d H:i:s"); 553 554 … … 601 602 global $wppcp; 602 603 604 $this->settings = array(); 603 605 if(isset($_POST['wppcp_general'])){ 604 606 foreach($_POST['wppcp_general'] as $k=>$v){ … … 609 611 case 'author_post_page_restrictions_status': 610 612 $v = sanitize_text_field($v); 613 $this->settings[$k] = $v; 611 614 break; 612 615 case 'post_page_redirect_url': 613 616 $v = esc_url_raw($v); 614 break; 615 616 } 617 $this->settings[$k] = $v; 617 $this->settings[$k] = $v; 618 break; 619 } 618 620 } 619 621 } … … 630 632 public function save_wppcp_section_information(){ 631 633 global $wppcp; 632 634 $this->settings = array(); 633 635 if(isset($_POST['wppcp_information'])){ 634 636 foreach($_POST['wppcp_information'] as $k=>$v){ … … 639 641 case 'pro_info_private_page': 640 642 $v = sanitize_text_field($v); 643 $this->settings[$k] = $v; 641 644 break; 642 645 643 646 } 644 $this->settings[$k] = $v;647 645 648 } 646 649 … … 670 673 global $wppcp; 671 674 675 $this->settings = array(); 672 676 if(isset($_POST['wppcp_global_post_restriction'])){ 673 677 foreach($_POST['wppcp_global_post_restriction'] as $k=>$v){ 674 678 switch ($k) { 675 679 case 'restrict_all_posts_status': 680 $v = sanitize_text_field($v); 681 $this->settings[$k] = $v; 682 break; 676 683 case 'all_post_visibility': 677 684 $v = sanitize_text_field($v); 685 if(in_array($v, array('all','guest','member','role'))){ 686 $this->settings[$k] = $v; 687 } 688 break; 689 case 'all_post_user_roles': 690 if(is_array($v)){ 691 $roles_arr = array(); 692 foreach ($v as $user_role_v) { 693 $roles_arr[] = sanitize_text_field($user_role_v); 694 } 695 $this->settings[$k] = $roles_arr; 696 } 697 678 698 break; 679 699 680 700 } 681 $this->settings[$k] = $v;701 682 702 } 683 703 … … 693 713 public function save_wppcp_section_global_page(){ 694 714 global $wppcp; 695 715 $this->settings = array(); 696 716 if(isset($_POST['wppcp_global_page_restriction'])){ 697 717 foreach($_POST['wppcp_global_page_restriction'] as $k=>$v){ 698 718 switch ($k) { 699 719 case 'restrict_all_pages_status': 720 $v = sanitize_text_field($v); 721 $this->settings[$k] = $v; 722 break; 700 723 case 'all_page_visibility': 701 724 $v = sanitize_text_field($v); 702 break; 725 if(in_array($v, array('all','guest','member','role'))){ 726 $this->settings[$k] = $v; 727 } 728 break; 729 case 'all_page_user_roles': 730 if(is_array($v)){ 731 $roles_arr = array(); 732 foreach ($v as $user_role_v) { 733 $roles_arr[] = sanitize_text_field($user_role_v); 734 } 735 $this->settings[$k] = $roles_arr; 736 } 703 737 704 738 } 705 $this->settings[$k] = $v;739 706 740 } 707 741 … … 738 772 739 773 } 740 741 /* Display private user page add content form */ 742 // public function private_user_page(){ 743 // global $wppcp,$wppcp_private_page_params,$wpdb; 744 745 // $wppcp_private_page_params = array(); 746 747 // $this->load_wppcp_select2_scripts_style(); 748 749 // $private_page_user = 0; 750 // if($_POST && isset($_POST['wppcp_private_page_user_load']) && ( current_user_can('manage_options') || current_user_can('wppcp_manage_options') ) ){ 751 // $private_page_user = isset($_POST['wppcp_private_page_user']) ? (int) ( $_POST['wppcp_private_page_user'] ) : 0; 752 // $user = get_user_by( 'id', $private_page_user ); 753 // $wppcp_private_page_params['display_name'] = $user->data->display_name; 754 // $wppcp_private_page_params['user_id'] = $private_page_user; 755 // } 756 757 758 759 // if($_POST && isset($_POST['wppcp_private_page_content_submit']) && ( current_user_can('manage_options') || current_user_can('wppcp_manage_options') ) ){ 760 761 // if (isset( $_POST['wppcp_private_page_nonce_field'] ) && wp_verify_nonce( $_POST['wppcp_private_page_nonce_field'], 'wppcp_private_page_nonce' ) ) { 762 763 // $user_id = isset($_POST['wppcp_user_id']) ? (int) $_POST['wppcp_user_id'] : 0; 764 // $private_content = isset($_POST['wppcp_private_page_content']) ? ( $_POST['wppcp_private_page_content']) : ''; 765 // $updated_date = date("Y-m-d H:i:s"); 766 767 // $sql = $wpdb->prepare( "SELECT content FROM " . $wpdb->prefix . WPPCP_PRIVATE_CONTENT_TABLE . " WHERE user_id = %d ", $user_id ); 768 // $result = $wpdb->get_results($sql); 769 // if($result){ 770 // $sql = $wpdb->prepare( "Update " . $wpdb->prefix . WPPCP_PRIVATE_CONTENT_TABLE ." set content=%s,updated_at=%s where user_id=%d ", $private_content,$updated_date, $user_id ); 771 // }else{ 772 // $sql = $wpdb->prepare( "Insert into " . $wpdb->prefix . WPPCP_PRIVATE_CONTENT_TABLE ."(user_id,content,type,updated_at) values(%d,%s,%s,%s)", $user_id, $private_content, 'ADMIN', $updated_date ); 773 // } 774 775 776 // if($wpdb->query($sql) === FALSE){ 777 // $wppcp_private_page_params['message'] = __('Private content update failed.','wppcp'); 778 // $wppcp_private_page_params['message_status'] = FALSE; 779 // }else{ 780 // $wppcp_private_page_params['message'] = __('Private content updated successfully.','wppcp'); 781 // $wppcp_private_page_params['message_status'] = TRUE; 782 // } 783 // } 784 // } 785 786 // $sql = $wpdb->prepare( "SELECT content FROM " . $wpdb->prefix . WPPCP_PRIVATE_CONTENT_TABLE . " WHERE user_id = %d ", $private_page_user ); 787 // $result = $wpdb->get_results($sql); 788 // if($result){ 789 // $wppcp_private_page_params['private_content'] = stripslashes($result[0]->content); 790 // }else{ 791 // $wppcp_private_page_params['private_content'] = ''; 792 // } 793 794 795 796 797 // ob_start(); 798 // $wppcp->template_loader->get_template_part('private-user-page'); 799 // $display = ob_get_clean(); 800 // echo $display; 801 // } 774 802 775 803 776 /* Load Select 2 library for settings section */ … … 873 846 public function save_wppcp_section_wppcp_permissions(){ 874 847 global $wppcp,$wp_roles; 875 848 $this->settings = array(); 876 849 if(isset($_POST['wppcp_feature_restrictions'])){ 877 850 … … 883 856 $v[$key] = sanitize_text_field($value); 884 857 } 885 886 break; 887 888 889 } 890 $this->settings[$k] = $v; 858 $this->settings[$k] = $v; 859 break; 860 } 891 861 } 892 862 … … 994 964 public function save_wppcp_section_security_ip(){ 995 965 global $wppcp; 996 966 $this->settings = array(); 997 967 if(isset($_POST['wppcp_security_ip'])){ 998 968 foreach($_POST['wppcp_security_ip'] as $k=>$v){ … … 1000 970 case 'restriction_status': 1001 971 $v = sanitize_text_field($v); 972 $this->settings[$k] = $v; 1002 973 break; 1003 974 case 'allowed_urls': 1004 975 case 'whitelisted': 1005 976 $v = sanitize_textarea_field($v); 977 $this->settings[$k] = $v; 1006 978 break; 1007 979 case 'redirect_url': 1008 980 $v = esc_url_raw($v); 981 $this->settings[$k] = $v; 1009 982 break; 1010 983 1011 984 } 1012 $this->settings[$k] = $v;985 1013 986 } 1014 987 … … 1024 997 public function save_wppcp_section_search_general(){ 1025 998 global $wppcp; 1026 999 $this->settings = array(); 1027 1000 if(isset($_POST['wppcp_search_general'])){ 1028 1001 foreach($_POST['wppcp_search_general'] as $k=>$v){ … … 1034 1007 $v[$key] = (int) ($post_id); 1035 1008 } 1036 1037 break; 1038 1039 } 1040 1041 $this->settings[$k] = $v; 1042 } 1043 1009 $this->settings[$k] = $v; 1010 break; 1011 1012 } 1013 } 1044 1014 } 1045 1015 … … 1052 1022 public function save_wppcp_section_search_restrictions(){ 1053 1023 global $wppcp; 1054 1024 $this->settings = array(); 1055 1025 if(isset($_POST['wppcp_search_restrictions'])){ 1056 1026 foreach($_POST['wppcp_search_restrictions'] as $k=>$v){ … … 1062 1032 $v[$key] = sanitize_text_field($post_types); 1063 1033 } 1064 1034 $this->settings[$k] = $v; 1065 1035 break; 1066 1036 1067 1037 } 1068 $this->settings[$k] = $v;1038 1069 1039 } 1070 1040 … … 1105 1075 public function save_wppcp_section_password_global(){ 1106 1076 global $wppcp; 1077 1078 $this->settings = array(); 1107 1079 1108 1080 if(isset($_POST['wppcp_password_global'])){ … … 1114 1086 1115 1087 $v = sanitize_text_field($v); 1088 $this->settings[$k] = $v; 1116 1089 break; 1117 1090 1118 1091 case 'password_form_message': 1119 1092 $v = wp_kses_post($v); 1093 $this->settings[$k] = $v; 1120 1094 break; 1121 1095 1122 1096 case 'allowed_urls': 1123 1097 $v = sanitize_textarea_field($v); 1098 $this->settings[$k] = $v; 1124 1099 break; 1125 1100 1126 1101 } 1127 $this->settings[$k] = $v;1102 1128 1103 } 1129 1104 … … 1251 1226 global $wppcp; 1252 1227 1228 $this->settings = array(); 1253 1229 if(isset($_POST['wppcp_upme_general'])){ 1254 1230 foreach($_POST['wppcp_upme_general'] as $k=>$v){ … … 1257 1233 case 'redirect_to_upme_login': 1258 1234 $v = sanitize_text_field($v); 1235 $this->settings[$k] = $v; 1259 1236 break; 1260 1237 1261 1238 } 1262 $this->settings[$k] = $v;1239 1263 1240 } 1264 1241 … … 1274 1251 public function save_wppcp_section_upme_search(){ 1275 1252 global $wppcp; 1276 1253 $this->settings = array(); 1277 1254 if(isset($_POST['wppcp_upme_search'])){ 1278 1255 foreach($_POST['wppcp_upme_search'] as $k=>$v){ … … 1280 1257 case 'upme_search_visibility': 1281 1258 $v = sanitize_text_field($v); 1259 $this->settings[$k] = $v; 1282 1260 break; 1283 1261 1284 1262 } 1285 $this->settings[$k] = $v;1263 1286 1264 } 1287 1265 … … 1298 1276 global $wppcp; 1299 1277 1278 $this->settings = array(); 1300 1279 if(isset($_POST['wppcp_upme_member_list'])){ 1301 1280 foreach($_POST['wppcp_upme_member_list'] as $k=>$v){ … … 1303 1282 case 'upme_member_list_visibility': 1304 1283 $v = sanitize_text_field($v); 1284 $this->settings[$k] = $v; 1305 1285 break; 1306 1286 1307 1287 } 1308 $this->settings[$k] = $v;1288 1309 1289 } 1310 1290 … … 1320 1300 public function save_wppcp_section_upme_member_profile(){ 1321 1301 global $wppcp; 1322 1302 $this->settings = array(); 1323 1303 if(isset($_POST['wppcp_upme_member_profile'])){ 1324 1304 foreach($_POST['wppcp_upme_member_profile'] as $k=>$v){ … … 1326 1306 case 'upme_member_profile_visibility': 1327 1307 $v = sanitize_text_field($v); 1308 $this->settings[$k] = $v; 1328 1309 break; 1329 1310 1330 1311 } 1331 $this->settings[$k] = $v;1312 1332 1313 } 1333 1314 … … 1360 1341 $individual_protection = array(); 1361 1342 if($results['single_data']['post_count'] > 0){ 1362 $individual_protection[] = "<span>" . $results['single_data']['post_count'] . __(' Posts ','wppcp')."</span>" ;1343 $individual_protection[] = "<span>" . (int) $results['single_data']['post_count'] . __(' Posts ','wppcp')."</span>" ; 1363 1344 } 1364 1345 if($results['single_data']['page_count'] > 0){ 1365 $individual_protection[] = "<span>" . $results['single_data']['page_count'] . __(' Pages ','wppcp')."</span>" ;1346 $individual_protection[] = "<span>" . (int) $results['single_data']['page_count'] . __(' Pages ','wppcp')."</span>" ; 1366 1347 } 1367 1348 if($results['single_data']['cpt_count'] > 0){ 1368 $individual_protection[] = "<span>" . $results['single_data']['cpt_count'] . __(' Custom Post Types ','wppcp')."</span>" ;1349 $individual_protection[] = "<span>" .(int) $results['single_data']['cpt_count'] . __(' Custom Post Types ','wppcp')."</span>" ; 1369 1350 } 1370 1351 … … 1377 1358 $global_protection = array(); 1378 1359 if($results['global_data']['restrict_all_posts_status'] == '1'){ 1379 $global_protection[] = "<span>" . $results['global_data']['post_count'] . __(' Posts ','wppcp')."</span>" ;1360 $global_protection[] = "<span>" .(int) $results['global_data']['post_count'] . __(' Posts ','wppcp')."</span>" ; 1380 1361 } 1381 1362 if($results['global_data']['restrict_all_pages_status'] == '1'){ 1382 $global_protection[] = "<span>" . $results['global_data']['page_count'] . __(' Pages ','wppcp')."</span>" ;1363 $global_protection[] = "<span>" .(int) $results['global_data']['page_count'] . __(' Pages ','wppcp')."</span>" ; 1383 1364 } 1384 1365 … … 1390 1371 $password_protection = ''; 1391 1372 if(isset($results['password_data']['status'])){ 1392 $password_protection = "<span>" . $results['password_data']['post_count'] . __(' Posts ','wppcp')."</span>" . " - " .1393 "<span>" . $results['password_data']['page_count'] . __(' Pages ','wppcp')."</span>" ." - " .1394 "<span>" . $results['password_data']['cpt_count'] . __(' Custom Post Types ','wppcp')."</span>" ;1373 $password_protection = "<span>" .(int) $results['password_data']['post_count'] . __(' Posts ','wppcp')."</span>" . " - " . 1374 "<span>" .(int) $results['password_data']['page_count'] . __(' Pages ','wppcp')."</span>" ." - " . 1375 "<span>" .(int) $results['password_data']['cpt_count'] . __(' Custom Post Types ','wppcp')."</span>" ; 1395 1376 $password_protection .= __(' are protected','wppcp'); 1396 1377 … … 1399 1380 $menu_protection = ''; 1400 1381 if($results['menu_data']['count'] > 0){ 1401 $menu_protection = "<span>" . $results['menu_data']['count'] . __(' Menu Items ','wppcp')."</span>" ;1382 $menu_protection = "<span>" .(int) $results['menu_data']['count'] . __(' Menu Items ','wppcp')."</span>" ; 1402 1383 $menu_protection .= __(' are protected','wppcp'); 1403 1384 … … 1406 1387 $widget_protection = ''; 1407 1388 if($results['widgets_data']['count'] > 0){ 1408 $widget_protection = "<span>" . $results['widgets_data']['count'] . __(' Widgets ','wppcp')."</span>" ;1389 $widget_protection = "<span>" .(int) $results['widgets_data']['count'] . __(' Widgets ','wppcp')."</span>" ; 1409 1390 $widget_protection .= __(' are protected','wppcp'); 1410 1391 … … 1413 1394 $shortcode_protection = ''; 1414 1395 if($results['shortcode_data']['count'] > 0){ 1415 $shortcode_protection = "<span>" . $results['shortcode_data']['count'] . __(' Post/Page Content Blocks ','wppcp') ."</span>" ;1396 $shortcode_protection = "<span>" .(int) $results['shortcode_data']['count'] . __(' Post/Page Content Blocks ','wppcp') ."</span>" ; 1416 1397 $shortcode_protection .= __(' are protected','wppcp'); 1417 1398 … … 1420 1401 $private_page_protection = ''; 1421 1402 if($results['private_page_data']['count'] > 0){ 1422 $private_page_protection = "<span>" . $results['private_page_data']['count'].__(' Users ','wppcp') . "</span>" . __('have private page with protected content. ','wppcp') ."</span>" ;1403 $private_page_protection = "<span>" .(int) $results['private_page_data']['count'].__(' Users ','wppcp') . "</span>" . __('have private page with protected content. ','wppcp') ."</span>" ; 1423 1404 1424 1405 } … … 1426 1407 $attachment_protection = array(); 1427 1408 if($results['attachment_data']['post_count'] > 0){ 1428 $attachment_protection[] = "<span>" . $results['attachment_data']['post_count'] . __(' Post ','wppcp')."</span>" ;1409 $attachment_protection[] = "<span>" .(int) $results['attachment_data']['post_count'] . __(' Post ','wppcp')."</span>" ; 1429 1410 } 1430 1411 if($results['attachment_data']['page_count'] > 0){ 1431 $attachment_protection[] = "<span>" . $results['attachment_data']['page_count'] . __(' Page ','wppcp')."</span>" ;1412 $attachment_protection[] = "<span>" .(int) $results['attachment_data']['page_count'] . __(' Page ','wppcp')."</span>" ; 1432 1413 } 1433 1414 if($results['attachment_data']['cpt_count'] > 0){ 1434 $attachment_protection[] = "<span>" . $results['attachment_data']['cpt_count'] . __(' Custom Post Type ','wppcp')."</span>" ;1415 $attachment_protection[] = "<span>" .(int) $results['attachment_data']['cpt_count'] . __(' Custom Post Type ','wppcp')."</span>" ; 1435 1416 } 1436 1417 … … 1444 1425 $search_protection = array(); 1445 1426 if($results['search_data']['blocked_posts'] > 0){ 1446 $search_protection[] = "<span>" . $results['search_data']['blocked_posts'] . __(' Posts ','wppcp')."</span>" ;1427 $search_protection[] = "<span>" .(int) $results['search_data']['blocked_posts'] . __(' Posts ','wppcp')."</span>" ; 1447 1428 } 1448 1429 if($results['search_data']['blocked_pages'] > 0){ 1449 $search_protection[] = "<span>" . $results['search_data']['blocked_pages'] . __(' Pages ','wppcp')."</span>" ;1430 $search_protection[] = "<span>" .(int) $results['search_data']['blocked_pages'] . __(' Pages ','wppcp')."</span>" ; 1450 1431 } 1451 1432 $search_protection = implode("-", $search_protection); … … 1460 1441 if($individual_protection != ''){ 1461 1442 $table .= "<tr><th>". __('Individual Post/Page Protection','wppcp'). "</th> 1462 <td>". $individual_protection."</td>1443 <td>".esc_html($individual_protection)."</td> 1463 1444 </tr>"; 1464 1445 $protection_count++; … … 1467 1448 if($global_protection != ''){ 1468 1449 $table .= "<tr><th>". __('Global Post/Page Protection','wppcp'). "</th> 1469 <td>". $global_protection. "</td>1450 <td>".esc_html($global_protection). "</td> 1470 1451 </tr>"; 1471 1452 $protection_count++; … … 1474 1455 if($password_protection != ''){ 1475 1456 $table .= "<tr><th>". __('Password Protection','wppcp'). "</th> 1476 <td>". $password_protection. "</td>1457 <td>".esc_html($password_protection). "</td> 1477 1458 </tr>"; 1478 1459 $protection_count++; … … 1481 1462 if($menu_protection != ''){ 1482 1463 $table .= "<tr><th>". __('Menu Protection','wppcp'). "</th> 1483 <td>". $menu_protection. "</td>1464 <td>".esc_html($menu_protection). "</td> 1484 1465 </tr>"; 1485 1466 $protection_count++; … … 1488 1469 if($widget_protection != ''){ 1489 1470 $table .= "<tr><th>". __('Widget Protection','wppcp'). "</th> 1490 <td>". $widget_protection. "</td>1471 <td>".esc_html($widget_protection). "</td> 1491 1472 </tr>"; 1492 1473 $protection_count++; … … 1495 1476 if($shortcode_protection != ''){ 1496 1477 $table .= "<tr><th>". __('Shortcode Protection','wppcp'). "</th> 1497 <td>". $shortcode_protection. "</td>1478 <td>".esc_html($shortcode_protection). "</td> 1498 1479 </tr>"; 1499 1480 $protection_count++; … … 1502 1483 if($attachment_protection != ''){ 1503 1484 $table .= "<tr><th>". __('Attachment Protection','wppcp'). "</th> 1504 <td>". $attachment_protection. "</td>1485 <td>".esc_html($attachment_protection). "</td> 1505 1486 </tr>"; 1506 1487 $protection_count++; … … 1509 1490 if($private_page_protection != ''){ 1510 1491 $table .= "<tr><th>". __('Private Page','wppcp'). "</th> 1511 <td>". $private_page_protection. "</td>1492 <td>".esc_html($private_page_protection). "</td> 1512 1493 </tr>"; 1513 1494 $protection_count++; … … 1516 1497 if($search_protection != ''){ 1517 1498 $table .= "<tr><th>". __('Search Protection','wppcp'). "</th> 1518 <td>". $search_protection. "</td>1499 <td>".esc_html($search_protection). "</td> 1519 1500 </tr>"; 1520 1501 $protection_count++; … … 1582 1563 </div> 1583 1564 <footer> 1584 <input id="wppcp_init_version" type="hidden" value="'. $wppcp_init_version.'" />1585 <input id="wppcp_init_date" type="hidden" value="'. $wppcp_init_date.'" />1565 <input id="wppcp_init_version" type="hidden" value="'.esc_html($wppcp_init_version).'" /> 1566 <input id="wppcp_init_date" type="hidden" value="'.esc_html($wppcp_init_date).'" /> 1586 1567 <input id="wppcp_init_admin_email" type="hidden" value="'.get_option('admin_email').'" /> 1587 1568 <input id="wppcp-deactivate-reasons-submit" class="wppcp-modal-btn wppcp-modal-btn-small" type="button" value="'.__('Submit & Deactivate','wppcp').'" /> -
wp-private-content-plus/trunk/classes/class-wppcp-site-lockdown.php
r2388646 r2474203 75 75 public function save_settings($tab,$params){ 76 76 global $wppcp; 77 77 $this->settings = array(); 78 78 if(isset($_POST['wppcp_site_lockdown'])){ 79 79 80 foreach($_POST['wppcp_site_lockdown'] as $k=>$v){ 80 81 switch ($k) { 81 case 'allowed_posts': 82 case 'allowed_pages': 82 case 'lockdown_allowed_pages': 83 case 'lockdown_allowed_posts': 84 if(is_array($v)){ 85 $post_arr = array(); 86 foreach ($v as $post_ids) { 87 array_push($post_arr, (int) $post_ids); 88 } 89 $this->settings[$k] = $post_arr; 90 } 83 91 break; 84 92 case 'lockdown_status': 85 93 $v = sanitize_text_field($v); 94 $this->settings[$k] = $v; 86 95 break; 87 96 case 'allowed_urls': 88 97 $v = sanitize_textarea_field($v); 98 $this->settings[$k] = $v; 89 99 break; 90 100 case 'redirect_url': 91 101 $v = esc_url_raw($v); 102 $this->settings[$k] = $v; 92 103 break; 93 104 } 94 $this->settings[$k] = $v; 95 } 105 106 } 107 96 108 } 97 109 … … 179 191 if('wp-login' == $redirect_url){ 180 192 $url = add_query_arg( 'redirect_to', $current_page_url, wp_login_url() ); 181 wp_redirect( $url);193 wp_redirect(esc_url($url)); 182 194 183 195 }else{ … … 185 197 $url = add_query_arg( 'redirect_to', $current_page_url, ($redirect_url) ); 186 198 // echo $url;exit; 187 wp_redirect( $url);199 wp_redirect(esc_url($url)); 188 200 } 189 201 exit; -
wp-private-content-plus/trunk/classes/class-wppcp-widgets.php
r2149488 r2474203 44 44 $checked = checked( true, in_array( $role, $visible_roles ) , false ); 45 45 46 $display .= '<input type="checkbox" name="'. $widget->get_field_name('wppcp_visibility_roles').'[]" id="'.$widget->get_field_id('wppcp_visibility_roles').'" '.$checked.' value="'.$role.'" />46 $display .= '<input type="checkbox" name="'. esc_html($widget->get_field_name('wppcp_visibility_roles')).'[]" id="'.esc_html($widget->get_field_id('wppcp_visibility_roles')).'" '.$checked.' value="'.esc_html($role).'" /> 47 47 <label for=""> 48 '. $name.'48 '.esc_html($name) .' 49 49 </label><br/>'; 50 50 -
wp-private-content-plus/trunk/classes/class-wppcp-woocommerce-tab-manager.php
r2145057 r2474203 136 136 $post_id = str_replace("wppcp_woo_", "", $key); 137 137 $product_tab = get_post($post_id); 138 echo do_shortcode($product_tab->post_content);138 echo wp_kses_post(do_shortcode($product_tab->post_content)); 139 139 } 140 140 -
wp-private-content-plus/trunk/functions.php
r2145207 r2474203 10 10 foreach ($query_comp as $param) { 11 11 $params = explode('=', $param); 12 $key = isset($params[0]) ? $params[0]: '';13 $value = isset($params[1]) ? $params[1]: '';12 $key = isset($params[0]) ? sanitize_text_field($params[0]) : ''; 13 $value = isset($params[1]) ? sanitize_text_field($params[1]) : ''; 14 14 $build_url = esc_url_raw(add_query_arg($key, $value, $build_url)); 15 15 } … … 114 114 $wppcp->template_loader->get_template_part('addons','feed'); 115 115 $display = ob_get_clean(); 116 echo $display;116 echo wp_kses_post($display); 117 117 } 118 118 … … 154 154 <?php 155 155 $display = ob_get_clean(); 156 return $display;156 return wp_kses_post($display); 157 157 } 158 158 -
wp-private-content-plus/trunk/readme.txt
r2473452 r2474203 184 184 = 3.2 = 185 185 * Fix security issue related to group creation 186 * Improve security in all plugin files 186 187 187 188 = 3.1 = -
wp-private-content-plus/trunk/templates/global-password-form.php
r2145057 r2474203 52 52 <div class="wppcp_panel_title"><?php echo esc_html($protected_form_header); ?></div> 53 53 <?php if($password_protect_error != ''){ ?> 54 <div class="wppcp_panel_error"><?php echo $password_protect_error; ?></div>54 <div class="wppcp_panel_error"><?php echo wp_kses_post($password_protect_error); ?></div> 55 55 <?php } ?> 56 56 -
wp-private-content-plus/trunk/templates/manage-file-attachments.php
r2145207 r2474203 28 28 $message .= ' <a target="_blank" href="https://www.wpexpertdeveloper.com/restrict-pro-post-attachments-and-downloads/?ref=pro-attachments" >'. 29 29 __('View More','wppcp'). '</a>'; 30 echo wp pcp_display_pro_info_box($message,'post_meta_boxes_large','wppcp_pro_info_post_attachments');30 echo wp_kses_post(wppcp_display_pro_info_box($message,'post_meta_boxes_large','wppcp_pro_info_post_attachments')); 31 31 32 32 } … … 48 48 $attached_name = isset($attach_data['name']) ? $attach_data['name'] : ''; 49 49 $attached_desc = isset($attach_data['desc']) ? $attach_data['desc'] : ''; 50 $attached_visibility = isset($attach_data['visibility']) ? $attach_data['visibility']: 'all';51 $attached_download_permission = isset($attach_data['download_permission']) ? $attach_data['download_permission']: 'all';50 $attached_visibility = isset($attach_data['visibility']) ? esc_html($attach_data['visibility']) : 'all'; 51 $attached_download_permission = isset($attach_data['download_permission']) ? esc_html($attach_data['download_permission']) : 'all'; 52 52 $attached_mime = isset($attach_data['mime']) ? $attach_data['mime'] : ''; 53 53 … … 63 63 <div class='wppcp-attachments-panel-file-single'> 64 64 <div class='wppcp-attachments-panel-file-left'> 65 <img src="<?php echo esc_url($attach_image_url); ?>" data-attachment-id="<?php echo $attach_data['attach_id']; ?>" class='wppcp-attachment-preview' />65 <img src="<?php echo esc_url($attach_image_url); ?>" data-attachment-id="<?php echo (int) $attach_data['attach_id']; ?>" class='wppcp-attachment-preview' /> 66 66 <div class='wppcp-slider-images-panel-gallery-icons'><?php echo $image_icons; ?></div> 67 67 </div> … … 69 69 <div class='wppcp-attachments-panel-file-row'> 70 70 <div class='wppcp-attachments-panel-file-label'><?php _e('File Name','wppcp'); ?></div> 71 <div class='wppcp-attachments-panel-file-field'><input type='text' name='wppcp_attachments[<?php echo $attach_data['attach_id']; ?>][name]' value='<?php echo esc_html($attached_name); ?>' /></div>71 <div class='wppcp-attachments-panel-file-field'><input type='text' name='wppcp_attachments[<?php echo (int) $attach_data['attach_id']; ?>][name]' value='<?php echo esc_html($attached_name); ?>' /></div> 72 72 </div> 73 73 <div class='wppcp-attachments-panel-file-row'> 74 74 <div class='wppcp-attachments-panel-file-label'><?php _e('File Description','wppcp'); ?></div> 75 <div class='wppcp-attachments-panel-file-field'><textarea name='wppcp_attachments[<?php echo $attach_data['attach_id']; ?>][desc]' ><?php echo esc_html($attached_desc); ?></textarea></div>75 <div class='wppcp-attachments-panel-file-field'><textarea name='wppcp_attachments[<?php echo (int) $attach_data['attach_id']; ?>][desc]' ><?php echo esc_html($attached_desc); ?></textarea></div> 76 76 </div> 77 77 <div class='wppcp-attachments-panel-file-row'> 78 78 <div class='wppcp-attachments-panel-file-label'><?php _e('File Visibility','wppcp'); ?></div> 79 79 <div class='wppcp-attachments-panel-file-field'> 80 <select class='wppcp-attachments-panel-file-visibility' name='wppcp_attachments[<?php echo $attach_data['attach_id']; ?>][visibility]' >80 <select class='wppcp-attachments-panel-file-visibility' name='wppcp_attachments[<?php echo (int) $attach_data['attach_id']; ?>][visibility]' > 81 81 <option <?php echo selected($attached_visibility,'all'); ?> value="all"><?php _e('Everyone','wppcp'); ?></option> 82 82 <option <?php echo selected($attached_visibility,'guest'); ?> value="guest"><?php _e('Guests','wppcp'); ?></option> … … 88 88 <div class='wppcp-attachments-panel-file-label'><?php _e('Download Permission','wppcp'); ?></div> 89 89 <div class='wppcp-attachments-panel-file-field'> 90 <select class='wppcp-attachments-panel-file-download-permission' name='wppcp_attachments[<?php echo $attach_data['attach_id']; ?>][download_permission]' >90 <select class='wppcp-attachments-panel-file-download-permission' name='wppcp_attachments[<?php echo (int) $attach_data['attach_id']; ?>][download_permission]' > 91 91 <option <?php echo selected($attached_download_permission,'all'); ?> value="all"><?php _e('Everyone','wppcp'); ?></option> 92 92 <option <?php echo selected($attached_download_permission,'guest'); ?> value="guest"><?php _e('Guests','wppcp'); ?></option> … … 96 96 </div> 97 97 </div> 98 <input type="hidden" value="<?php echo esc_html($attached_mime); ?>" name="wppcp_attachments[<?php echo $attach_data['attach_id']; ?>][mime]" />98 <input type="hidden" value="<?php echo esc_html($attached_mime); ?>" name="wppcp_attachments[<?php echo (int) $attach_data['attach_id']; ?>][mime]" /> 99 99 </div> 100 100 -
wp-private-content-plus/trunk/templates/plugin-help.php
r2145207 r2474203 12 12 <h1><?php echo esc_html($title); ?></h1> 13 13 <div class="about-text"> 14 <?php echo $desc; ?>14 <?php echo wp_kses_post($desc); ?> 15 15 </div> 16 16 -
wp-private-content-plus/trunk/templates/post-page-restriction-meta.php
r2145207 r2474203 6 6 $post_type = $post->post_type; 7 7 8 $visibility = get_post_meta( $post->ID, '_wppcp_post_page_visibility', true);8 $visibility = esc_html(get_post_meta( $post->ID, '_wppcp_post_page_visibility', true )); 9 9 $redirection_url = get_post_meta( $post->ID, '_wppcp_post_page_redirection_url', true ); 10 10 … … 46 46 $message .= ' <a target="_blank" href="https://www.wpexpertdeveloper.com/global-custom-post-type-protection/?ref=pro-cpt" >'. 47 47 __('View More','wppcp'). '</a>'; 48 echo wppcp_display_pro_info_box($message,'post_meta_boxes','wppcp_pro_info_post_restrictions'); 48 49 echo wp_kses_post(wppcp_display_pro_info_box($message,'post_meta_boxes','wppcp_pro_info_post_restrictions')); 49 50 } 50 51 … … 53 54 $message .= sprintf(__('%sGo PRO%s and add users to user groups or membership levels. Protection rules can be applied on user groups or membership 54 55 levels instead of selecting users for each post/page','wppcp'), '<strong>','</strong>' ); 55 echo wp pcp_display_pro_info_box($message,'post_meta_boxes_large','wppcp_pro_info_post_restrictions');56 echo wp_kses_post(wppcp_display_pro_info_box($message,'post_meta_boxes_large','wppcp_pro_info_post_restrictions')); 56 57 } 57 58 ?> … … 85 86 if($role_key != 'administrator'){ 86 87 ?> 87 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_post_page_roles[]" value='<?php echo $role_key; ?>'><?php echo $role; ?><br/>88 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_post_page_roles[]" value='<?php echo $role_key; ?>'><?php echo esc_html($role); ?><br/> 88 89 <?php } ?> 89 90 <?php } ?> … … 101 102 $display_name = $user->data->display_name; 102 103 ?> 103 <option value='<?php echo $user_id; ?>' selected ><?php echo $display_name; ?></option>104 <option value='<?php echo $user_id; ?>' selected ><?php echo esc_html($display_name); ?></option> 104 105 <?php } ?> 105 106 </select> -
wp-private-content-plus/trunk/templates/private-user-page.php
r2145207 r2474203 58 58 $message .= ' <a target="_blank" href="https://www.wpexpertdeveloper.com/private-page-dashboard-users/?ref=pro-private-page" >'. 59 59 __('View More','wppcp'). '</a>'; 60 echo wp pcp_display_pro_info_box($message,'post_meta_boxes','wppcp_pro_info_private_page');60 echo wp_kses_post(wppcp_display_pro_info_box($message,'post_meta_boxes','wppcp_pro_info_private_page')); 61 61 } 62 62 ?> -
wp-private-content-plus/trunk/templates/woo-tabs-restriction-meta.php
r2145057 r2474203 6 6 $post_type = $post->post_type; 7 7 8 $visibility = get_post_meta( $post->ID, '_wppcp_woo_tabs_visibility', true);8 $visibility = esc_html(get_post_meta( $post->ID, '_wppcp_woo_tabs_visibility', true )); 9 9 $redirection_url = get_post_meta( $post->ID, '_wppcp_woo_tabs_redirection_url', true ); 10 10 … … 49 49 if($role_key != 'administrator'){ 50 50 ?> 51 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_woo_tabs_roles[]" value='<?php echo $role_key; ?>'><?php echo $role; ?><br/>51 <input type="checkbox" <?php echo $checked_val; ?> name="wppcp_woo_tabs_roles[]" value='<?php echo $role_key; ?>'><?php echo esc_html($role); ?><br/> 52 52 <?php } ?> 53 53 <?php } ?>
Note: See TracChangeset
for help on using the changeset viewer.