Changeset 3151072
- Timestamp:
- 09/12/2024 08:27:56 PM (17 months ago)
- Location:
- my-wp-brand
- Files:
-
- 9 added
- 4 edited
-
tags/1.1.3 (added)
-
tags/1.1.3/assets (added)
-
tags/1.1.3/assets/css (added)
-
tags/1.1.3/assets/css/style-my-wp-brand.css (added)
-
tags/1.1.3/assets/js (added)
-
tags/1.1.3/assets/js/style-my-wp-brand.js (added)
-
tags/1.1.3/mwb-side-menu.php (added)
-
tags/1.1.3/mwb.php (added)
-
tags/1.1.3/readme.txt (added)
-
trunk/assets/js/style-my-wp-brand.js (modified) (7 diffs)
-
trunk/mwb-side-menu.php (modified) (9 diffs)
-
trunk/mwb.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
my-wp-brand/trunk/assets/js/style-my-wp-brand.js
r2720748 r3151072 23 23 * Set login logo 24 24 * 25 *26 25 * @version 1.0.0 27 26 */ … … 44 43 /** 45 44 * @ajax mwb-plugin-form 45 * 46 * @version 1.0.0 47 * @version 1.1.3 Implemented a nonce value in the data object to enhance security. 46 48 */ 47 49 $("#mwb-plugins-form").submit((e) => { … … 62 64 action: 'mwb_plugins_form', 63 65 plugins: plugins_data, 66 nonce: mwb_ajax.nonce, 64 67 }, 65 68 success: (response) => { … … 72 75 /** 73 76 * @ajax mwb-style-form 77 * 78 * @version 1.0.0 79 * @version 1.1.3 Implemented a nonce value in the data object to enhance security. 74 80 */ 75 81 $("#mwb-style-form").submit((e) => { … … 82 88 data: { 83 89 action: 'mwb_style_ajax', 90 nonce: mwb_ajax.nonce, 84 91 hidden_admin_bar_logo: $("#show-admin-bar-logo").attr("src") ? $("#show-admin-bar-logo").attr("src") : '', 85 92 hidden_login_logo: $("#show-login-logo").attr("src") ? $("#show-login-logo").attr("src") : '', … … 94 101 /** 95 102 * @ajax mwb-author-form 103 * 104 * @version 1.0.0 105 * @version 1.1.3 Implemented a nonce value in the data object to enhance security. 96 106 */ 97 107 $("#mwb-author-form").submit((e) => { … … 104 114 data: { 105 115 action: 'mwb_author_form', 116 nonce: mwb_ajax.nonce, 106 117 wp_version_hide: document.getElementById("wp-version-hide").checked === true ? 'on' : 'off', 107 118 wp_admin_footer_text: $("#wp-admin-footer-text").val() ? $("#wp-admin-footer-text").val() : '', -
my-wp-brand/trunk/mwb-side-menu.php
r2720748 r3151072 30 30 * @var { $sub_menu_list } Admin all sub menu list. 31 31 */ 32 $menu_list = isset( $_POST['menu_list'] ) ? sanitize_text_field( json_encode( $_POST['menu_list'] ) ) : array();33 $sub_menu_list = isset( $_POST['sub_menu_list'] ) ? sanitize_text_field( json_encode( $_POST['sub_menu_list'] ) ) : array();32 $menu_list = isset( $_POST['menu_list'] ) ? sanitize_text_field( wp_json_encode( $_POST['menu_list'] ) ) : array(); 33 $sub_menu_list = isset( $_POST['sub_menu_list'] ) ? sanitize_text_field( wp_json_encode( $_POST['sub_menu_list'] ) ) : array(); 34 34 35 35 /** … … 108 108 $remove_side_array = $new_menu_list; 109 109 $remove_sub_side_array = $new_sub_menu_list; 110 $json_remove_side_array = json_encode( $remove_side_array );111 $json_remove_sub_side_array = json_encode( $remove_sub_side_array );110 $json_remove_side_array = wp_json_encode( $remove_side_array ); 111 $json_remove_sub_side_array = wp_json_encode( $remove_sub_side_array ); 112 112 113 113 /** 114 114 * @var { $top_menu_list } Admin all top menu list. 115 115 */ 116 $top_menu_list = isset( $_POST['top_menu_list'] ) ? sanitize_text_field( json_encode( $_POST['top_menu_list'] ) ) : array();116 $top_menu_list = isset( $_POST['top_menu_list'] ) ? sanitize_text_field( wp_json_encode( $_POST['top_menu_list'] ) ) : array(); 117 117 118 118 /** … … 148 148 149 149 $remove_top_array = $new_menu_list; 150 $json_remove_top_array = json_encode( $remove_top_array );150 $json_remove_top_array = wp_json_encode( $remove_top_array ); 151 151 152 152 /** … … 192 192 193 193 if( $_GET['message'] == 'save' ) { 194 echo $msg = '<div id="message" class="updated notice notice-success is-dismissible"><p>'. esc_html ( 'Your changes has been updated.') .'</p></div>';194 echo $msg = '<div id="message" class="updated notice notice-success is-dismissible"><p>'. esc_html__( 'Your changes has been updated.', MWB_TEXTDOMAIN ) .'</p></div>'; 195 195 } 196 196 197 197 if( $_GET['message'] == 'default' ) { 198 echo $msg = '<div id="message" class="updated notice notice-success is-dismissible"><p>'. esc_html ( 'Your default setting has been setup.') .'</p></div>';198 echo $msg = '<div id="message" class="updated notice notice-success is-dismissible"><p>'. esc_html__( 'Your default setting has been setup.', MWB_TEXTDOMAIN ) .'</p></div>'; 199 199 } 200 200 … … 302 302 <td class="primary_menu_seprator"> 303 303 <span class="dashicons-before <?php echo esc_attr( $row['6'] ); ?>"></span> 304 <span><?php echo esc_attr( strip_tags( $row['0'] ) ); ?></span>304 <span><?php echo esc_attr( wp_strip_all_tags( $row['0'] ) ); ?></span> 305 305 </td> 306 306 … … 333 333 <td> 334 334 <span class="dashicons dashicons-arrow-right-alt sub-icon"></span> 335 <span><?php echo esc_attr( strip_tags( $rows['0'] ) ); ?></span>335 <span><?php echo esc_attr( wp_strip_all_tags( $rows['0'] ) ); ?></span> 336 336 </td> 337 337 <?php foreach ( $roles as $role_key=>$role ) { ?> … … 421 421 <td> 422 422 <span id="wp-admin-bar-<?php echo esc_attr( $row->id ); ?>"></span> 423 <span># <?php echo esc_attr( strip_tags( $row->title ) ); ?></span>423 <span># <?php echo esc_attr( wp_strip_all_tags( $row->title ) ); ?></span> 424 424 </td> 425 425 <?php foreach ( $roles as $role_key => $role ) { ?> … … 444 444 <span id="wp-admin-bar-<?php echo esc_attr( $child_menu->id ); ?>"></span> 445 445 <span class="dashicons dashicons-arrow-right-alt sub-icon"></span> 446 <span> <?php echo esc_attr( strip_tags( $child_menu->title ) ); ?></span>446 <span> <?php echo esc_attr( wp_strip_all_tags( $child_menu->title ) ); ?></span> 447 447 </td> 448 448 <?php foreach ( $roles as $role_key=>$role ) { ?> … … 589 589 //this is the patch for the wordpress 4 or may be latetest version for the customize menu only 590 590 if( $pare_child[0] == 'themes.php' ) { 591 $parse_data = parse_url( $pare_child[1] );591 $parse_data = wp_parse_url( $pare_child[1] ); 592 592 if( $parse_data['path'] == 'customize.php' ) { 593 593 unset( $submenu['themes.php'][6] ); -
my-wp-brand/trunk/mwb.php
r3128281 r3151072 12 12 * Plugin URI: https://imw3.com/product/my-wp-brand 13 13 * Description: My Brand plugin is used to customize admin panel. 14 * Version: 1.1. 214 * Version: 1.1.3 15 15 * Author: imw3 16 16 * Author URI: https://imw3.com/ … … 36 36 /** 37 37 * Action hooks 38 * 38 39 * @version 1.0.0 40 * @version 1.1.3 Removed unnecessary wp_ajax_nopriv hooks 39 41 */ 40 42 add_action( 'admin_menu' , array( $this , 'mwb_manage_admin_menu' ) ); … … 44 46 add_action( 'wp_ajax_mwb_plugins_form' , array( $this , 'mwb_plugins_form' ) ); 45 47 add_action( 'login_enqueue_scripts' , array( $this , 'mwb_manage_login_form' ) ); 46 add_action( 'wp_ajax_nopriv_mwb_style_ajax' , array( $this , 'mwb_style_ajax' ) );47 add_action( 'wp_ajax_nopriv_mwb_author_form' , array( $this , 'mwb_author_form' ) );48 add_action( 'wp_ajax_nopriv_mwb_plugins_form' , array( $this , 'mwb_plugins_form' ) );49 48 add_action( 'admin_bar_menu' , array( $this , 'mwb_manage_admin_top_bar_menu' ) , 1 ); 50 49 add_action( 'admin_enqueue_scripts' , array( $this , 'mwb_enqueue_scripts_and_styles' ) ); … … 107 106 wp_enqueue_script('jquery'); 108 107 109 wp_localize_script( 'jquery', 'mwb_ajax', array( 'url' => admin_url( 'admin-ajax.php' ) ) ); 108 wp_localize_script( 'jquery', 'mwb_ajax', array( 109 'url' => admin_url( 'admin-ajax.php' ), 110 'nonce' => wp_create_nonce( 'ajax-nonce' ) 111 )); 110 112 111 113 } … … 544 546 * @ajax 545 547 * -> mwb plugins form 548 * 549 * @since 1.0.0 550 * @since 1.1.3 Added user capability verification and nonce verification. 546 551 */ 547 552 public function mwb_plugins_form(){ 548 553 554 if ( ! current_user_can( 'manage_options' ) ) { 555 exit; 556 } 557 558 if ( isset( $_POST['nonce'] ) && ! wp_verify_nonce( $_POST['nonce'] , 'ajax-nonce' ) ) { 559 die('The token has expired!'); 560 } 561 549 562 if ( empty( get_option( 'hide-plugins' ) ) ) { 550 563 add_option( 'hide-plugins' , array_map( 'sanitize_text_field', $_POST['plugins'] ) ); … … 562 575 * @ajax 563 576 * -> mwb style form 577 * 578 * @since 1.0.0 579 * @since 1.1.3 Added user capability verification and nonce verification. 564 580 */ 565 581 public function mwb_style_ajax() { 582 583 if ( ! current_user_can( 'manage_options' ) ) { 584 exit; 585 } 586 587 if ( isset( $_POST['nonce'] ) && ! wp_verify_nonce( $_POST['nonce'] , 'ajax-nonce' ) ) { 588 die('The token has expired!'); 589 } 566 590 567 591 /** … … 592 616 * @ajax 593 617 * -> mwb author form 618 * 619 * @since 1.0.0 620 * @since 1.1.3 Added user capability verification and nonce verification. 594 621 */ 595 622 public function mwb_author_form() { 623 624 if ( ! current_user_can( 'manage_options' ) ) { 625 exit; 626 } 627 628 if ( isset( $_POST['nonce'] ) && ! wp_verify_nonce( $_POST['nonce'] , 'ajax-nonce' ) ) { 629 die('The token has expired!'); 630 } 596 631 597 632 /** -
my-wp-brand/trunk/readme.txt
r3128281 r3151072 1 1 === My Wp Brand – Hide menu & Hide Plugin === 2 Contributors: imw3, riyazuddin, mohammadazad3 Tags: hide menu, hide plugin, hide version, admin menu, change logo, menu,2 Contributors: imw3, mohammadazad, riyazuddin 3 Tags: hide menu, hide plugin, hide version, admin menu, change logo, 4 4 Requires at least: 6.5 5 Tested up to: 6.6 5 Tested up to: 6.6.2 6 6 Requires PHP: 7.4 7 Stable tag: 1.1. 27 Stable tag: 1.1.3 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 54 54 == Installation == 55 55 56 1. Install via the built-in WordPress plugin installer. Or download and unzip my-wp-brand.zip inside the plugin ’s directory for your site (typically wp-content/plugins/)57 2. Activate the plugin through the ‘Plugins’admin menu in WordPress.58 3. Go to “Setting” -> “Wp Brand” and check or tick mark those plugin / menus that you want to hide from admin. (You can also use the “Settings” link in the plugin’s entry on the admin “Plugins”page).56 1. Install via the built-in WordPress plugin installer. Or download and unzip my-wp-brand.zip inside the plugin’s directory for your site (typically wp-content/plugins/) 57 2. Activate the plugin through the ‘Plugins’ admin menu in WordPress. 58 3. Go to “Setting†-> “Wp Brand†and check or tick mark those plugin / menus that you want to hide from admin. (You can also use the “Settings†link in the plugin’s entry on the admin “Plugins†page). 59 59 60 60 == Changelog == … … 74 74 * Fix Minor Bug. 75 75 * Compatible with WordPress 6.6 76 77 = 1.1.3 = 78 * Fixed broken access control vulnerability. 79 * Compatible with WordPress 6.6.2
Note: See TracChangeset
for help on using the changeset viewer.