Changeset 3201393
- Timestamp:
- 12/03/2024 07:20:48 AM (16 months ago)
- Location:
- my-wp/trunk
- Files:
-
- 36 edited
-
controller/abstract.controller.toolbar.module.php (modified) (3 diffs)
-
controller/modules/mywp.controller.module.admin.comments.php (modified) (1 diff)
-
controller/modules/mywp.controller.module.admin.dashboard.php (modified) (3 diffs)
-
controller/modules/mywp.controller.module.admin.general.php (modified) (5 diffs)
-
controller/modules/mywp.controller.module.admin.post.edit.php (modified) (1 diff)
-
controller/modules/mywp.controller.module.admin.posts.php (modified) (8 diffs)
-
controller/modules/mywp.controller.module.admin.sidebar.php (modified) (4 diffs)
-
controller/modules/mywp.controller.module.admin.terms.php (modified) (1 diff)
-
controller/modules/mywp.controller.module.admin.uploads.php (modified) (1 diff)
-
controller/modules/mywp.controller.module.admin.users.php (modified) (1 diff)
-
controller/modules/mywp.controller.module.frontend.general.php (modified) (2 diffs)
-
controller/modules/mywp.controller.module.login.general.php (modified) (8 diffs)
-
core/class.helper.php (modified) (1 diff)
-
developer/modules/mywp.developer.module.core.environment.php (modified) (2 diffs)
-
mywp.php (modified) (3 diffs)
-
post-type/modules/mywp.post-type.module.admin.sidebar.php (modified) (6 diffs)
-
post-type/modules/mywp.post-type.module.admin.toolbar.php (modified) (6 diffs)
-
post-type/modules/mywp.post-type.module.front.toolbar.php (modified) (6 diffs)
-
post-type/modules/mywp.post-type.module.logger.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
setting/abstract.setting.columns.module.php (modified) (3 diffs)
-
setting/abstract.setting.toolbar.module.php (modified) (4 diffs)
-
setting/modules/mywp.setting.admin.comments.php (modified) (2 diffs)
-
setting/modules/mywp.setting.admin.dashboard.php (modified) (1 diff)
-
setting/modules/mywp.setting.admin.general.php (modified) (1 diff)
-
setting/modules/mywp.setting.admin.post-edit.php (modified) (1 diff)
-
setting/modules/mywp.setting.admin.posts.php (modified) (2 diffs)
-
setting/modules/mywp.setting.admin.sidebar.php (modified) (4 diffs)
-
setting/modules/mywp.setting.admin.terms.php (modified) (2 diffs)
-
setting/modules/mywp.setting.admin.uploads.php (modified) (2 diffs)
-
setting/modules/mywp.setting.admin.users.php (modified) (2 diffs)
-
setting/modules/mywp.setting.debug.crons.php (modified) (2 diffs)
-
setting/modules/mywp.setting.debug.datetime.php (modified) (1 diff)
-
setting/modules/mywp.setting.debug.transients.php (modified) (3 diffs)
-
setting/modules/mywp.setting.login.general.php (modified) (1 diff)
-
setting/modules/mywp.setting.update.bulk-post-meta.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
my-wp/trunk/controller/abstract.controller.toolbar.module.php
r2817427 r3201393 1108 1108 } elseif( $item_type === 'custom' ) { 1109 1109 1110 $item_meta['html'] = do_shortcode( $item->item_custom_html);1110 $item_meta['html'] = wp_kses_post( do_shortcode( $item->item_custom_html ) ); 1111 1111 1112 1112 } … … 1134 1134 } else { 1135 1135 1136 $title = sprintf( '<span class="%s">%s</span>' , esc_attr( $title_class ) , $item->item_link_title);1136 $title = sprintf( '<span class="%s">%s</span>' , esc_attr( $title_class ) , wp_kses_post( $item->item_link_title ) ); 1137 1137 1138 1138 } … … 1140 1140 if( empty( $node_group ) ) { 1141 1141 1142 $add_menu = array( 'id' => $node_id , 'title' => $title, 'parent' => $node_parent , 'href' => $item->item_link_url , 'meta' => $item_meta );1142 $add_menu = array( 'id' => $node_id , 'title' => wp_kses_post( $title ) , 'parent' => $node_parent , 'href' => $item->item_link_url , 'meta' => $item_meta ); 1143 1143 1144 1144 $wp_admin_bar->add_menu( $add_menu ); -
my-wp/trunk/controller/modules/mywp.controller.module.admin.comments.php
r3131405 r3201393 227 227 } 228 228 229 $wp_kses_allowed_html = wp_kses_allowed_html( 'post' ); 230 231 $wp_kses_allowed_html['input'] = array( 232 'type' => 1, 233 'class' => 1, 234 'id' => 1, 235 ); 236 229 237 $columns = array(); 230 238 231 239 foreach( $setting_data['list_columns'] as $column_id => $column_setting ) { 232 240 233 $columns[ $column_id ] = $column_setting['title'];241 $columns[ $column_id ] = wp_kses( $column_setting['title'] , $wp_kses_allowed_html ); 234 242 235 243 } -
my-wp/trunk/controller/modules/mywp.controller.module.admin.dashboard.php
r2890935 r3201393 159 159 foreach( $hide_meta_boxes as $meta_box_id ) { 160 160 161 printf( '.postbox#%s { height: 0; overflow: hidden; margin: 0; box-shadow: none; border: 0 none; }' , $meta_box_id);161 printf( '.postbox#%s { height: 0; overflow: hidden; margin: 0; box-shadow: none; border: 0 none; }' , esc_attr( $meta_box_id ) ); 162 162 163 163 } … … 169 169 foreach( $hide_meta_boxes as $meta_box_id ) { 170 170 171 printf( '$("#screen-options-wrap .metabox-prefs label[for=%s-hide]").css("display", "none");' , $meta_box_id);171 printf( '$("#screen-options-wrap .metabox-prefs label[for=%s-hide]").css("display", "none");' , esc_attr( $meta_box_id ) ); 172 172 173 173 } … … 349 349 } 350 350 351 $wp_meta_boxes['dashboard'][ $context ][ $priority ][ $meta_box_id ]['title'] = do_shortcode( $change_title_meta_boxes[ $meta_box_id ]);351 $wp_meta_boxes['dashboard'][ $context ][ $priority ][ $meta_box_id ]['title'] = wp_kses_post( do_shortcode( $change_title_meta_boxes[ $meta_box_id ] ) ); 352 352 353 353 } -
my-wp/trunk/controller/modules/mywp.controller.module.admin.general.php
r3013938 r3201393 111 111 add_action( 'admin_enqueue_scripts' , array( __CLASS__ , 'admin_enqueue_scripts' ) ); 112 112 113 add_action( 'admin_enqueue_scripts' , array( __CLASS__ , 'include_jc_css' ) );113 add_action( 'admin_enqueue_scripts' , array( __CLASS__ , 'include_jc_css' ) , 9999 ); 114 114 115 115 add_action( 'admin_print_styles' , array( __CLASS__ , 'hide_screen_tabs' ) ); … … 472 472 public static function custom_footer_text() { 473 473 474 global $wp_version;475 474 global $post; 476 475 … … 499 498 add_filter( 'mywp_controller_admin_general_custom_footer_text' , 'prepend_attachment' ); 500 499 501 if( version_compare( $wp_version, '5.7.0' , '>=' ) ) {500 if( version_compare( MywpHelper::get_wp_version() , '5.7.0' , '>=' ) ) { 502 501 503 502 add_filter( 'mywp_controller_admin_general_custom_footer_text' , 'wp_replace_insecure_home_url' ); … … 507 506 add_filter( 'mywp_controller_admin_general_custom_footer_text' , 'do_shortcode' , 11 ); 508 507 509 if( version_compare( $wp_version, '5.5.0' , '>=' ) ) {508 if( version_compare( MywpHelper::get_wp_version() , '5.5.0' , '>=' ) ) { 510 509 511 510 add_filter( 'mywp_controller_admin_general_custom_footer_text' , 'wp_filter_content_tags' , 12 ); … … 524 523 525 524 <div id="mywp-custom-footer-text"> 526 <?php echo $custom_footer_text; ?>525 <?php echo wp_kses_post( $custom_footer_text ); ?> 527 526 </div> 528 527 -
my-wp/trunk/controller/modules/mywp.controller.module.admin.post.edit.php
r2817427 r3201393 975 975 } 976 976 977 $wp_meta_boxes[ self::$post_type ][ $context ][ $priority ][ $meta_box_id ]['title'] = do_shortcode( $change_title_meta_boxes[ $meta_box_id ]);977 $wp_meta_boxes[ self::$post_type ][ $context ][ $priority ][ $meta_box_id ]['title'] = wp_kses_post( do_shortcode( $change_title_meta_boxes[ $meta_box_id ] ) ); 978 978 979 979 } -
my-wp/trunk/controller/modules/mywp.controller.module.admin.posts.php
r3131405 r3201393 499 499 } 500 500 501 $wp_kses_allowed_html = wp_kses_allowed_html( 'post' ); 502 503 $wp_kses_allowed_html['input'] = array( 504 'type' => 1, 505 'class' => 1, 506 'id' => 1, 507 ); 508 501 509 $columns = array(); 502 510 503 511 foreach( $setting_data['list_columns'] as $column_id => $column_setting ) { 504 512 505 $columns[ $column_id ] = do_shortcode( $column_setting['title']);513 $columns[ $column_id ] = wp_kses( do_shortcode( $column_setting['title'] ) , $wp_kses_allowed_html ); 506 514 507 515 } … … 545 553 } elseif( $column_id === 'mywp_column_slug' ) { 546 554 547 echo sanitize_title( $post->post_name );555 echo esc_html( $post->post_name ); 548 556 549 557 } elseif( $column_id === 'mywp_column_excerpt' ) { … … 969 977 } 970 978 971 private static function get_post_statuses( ) {979 private static function get_post_statuses( $post_type = false ) { 972 980 973 981 global $wp_post_statuses; … … 975 983 $post_statuses = array(); 976 984 985 $post_type = MywpHelper::sanitize_text( $post_type ); 986 987 if( empty( $post_type ) ) { 988 989 return $post_statuses; 990 991 } 992 977 993 foreach( $wp_post_statuses as $post_status => $wp_post_status ) { 978 994 979 /* 980 if( ! in_array( $post_status , array( 'draft' , 'publish' , 'trash' , 'private' ) ) ) { 995 if( in_array( $post_status , array( 'auto-draft' ) ) ) { 981 996 982 997 continue; 983 998 984 999 } 985 */986 1000 987 1001 $post_statuses[ $post_status ] = $wp_post_status->label; … … 989 1003 } 990 1004 1005 $post_statuses = apply_filters( 'mywp_controller_admin_posts_get_post_statuses' , $post_statuses , $post_type ); 1006 1007 $post_statuses = apply_filters( 'mywp_controller_admin_posts_get_post_statuses-' . $post_type , $post_statuses ); 1008 991 1009 return $post_statuses; 992 1010 … … 1031 1049 $post_status = MywpHelper::sanitize_text( $custom_search_filter_requests['mywp_custom_search_post_status'] ); 1032 1050 1033 $post_statuses = self::get_post_statuses( );1051 $post_statuses = self::get_post_statuses( self::$post_type ); 1034 1052 1035 1053 if( ! empty( $post_statuses[ $post_status ] ) ) { … … 1132 1150 'field' => 'term_id', 1133 1151 'terms' => $term_ids, 1134 'operator' => ' AND',1152 'operator' => 'IN', 1135 1153 ); 1136 1154 … … 1182 1200 ); 1183 1201 1184 $post_statuses = self::get_post_statuses( );1202 $post_statuses = self::get_post_statuses( self::$post_type ); 1185 1203 1186 1204 $custom_search_filter_fields['mywp_custom_search_post_status']['choices'] = $post_statuses; -
my-wp/trunk/controller/modules/mywp.controller.module.admin.sidebar.php
r3013938 r3201393 1003 1003 if( $item_type === 'custom' ) { 1004 1004 1005 echo do_shortcode( $item->item_custom_html);1005 echo wp_kses_post( do_shortcode( $item->item_custom_html ) ); 1006 1006 1007 1007 } elseif( $item_type === 'separator' ) { … … 1083 1083 } elseif( ! empty( $icon_class ) or ! empty( $icon_style ) or ! empty( $icon_id ) ) { 1084 1084 1085 printf( '<div class="wp-menu-image mywp-sidebar-item-icon %s" id="%s" style="%s">%s</div>' , esc_attr( $icon_class ) , esc_attr( $icon_id ) , $icon_style , $icon_title);1085 printf( '<div class="wp-menu-image mywp-sidebar-item-icon %s" id="%s" style="%s">%s</div>' , esc_attr( $icon_class ) , esc_attr( $icon_id ) , esc_attr( $icon_style ) , wp_kses_post( $icon_title ) ); 1086 1086 1087 1087 } else { … … 1091 1091 } 1092 1092 1093 printf( '<div class="wp-menu-name mywp-sidebar-name">%s</div>' , $item->item_link_title);1093 printf( '<div class="wp-menu-name mywp-sidebar-name">%s</div>' , wp_kses_post( $item->item_link_title ) ); 1094 1094 1095 1095 echo '</a>'; … … 1101 1101 echo '<ul class="wp-submenu wp-submenu-wrap mywp-sidebar-item-childs">'; 1102 1102 1103 printf( '<li class="wp-submenu-head" aria-hidden="true">%s</li>' , $item->item_link_title);1103 printf( '<li class="wp-submenu-head" aria-hidden="true">%s</li>' , wp_kses_post( $item->item_link_title ) ); 1104 1104 1105 1105 foreach( $child_items as $child_item ) { -
my-wp/trunk/controller/modules/mywp.controller.module.admin.terms.php
r3131405 r3201393 330 330 } 331 331 332 $wp_kses_allowed_html = wp_kses_allowed_html( 'post' ); 333 334 $wp_kses_allowed_html['input'] = array( 335 'type' => 1, 336 'class' => 1, 337 'id' => 1, 338 ); 339 332 340 $columns = array(); 333 341 334 342 foreach( $setting_data['list_columns'] as $column_id => $column_setting ) { 335 343 336 $columns[ $column_id ] = do_shortcode( $column_setting['title']);344 $columns[ $column_id ] = wp_kses( do_shortcode( $column_setting['title'] ) , $wp_kses_allowed_html ); 337 345 338 346 } -
my-wp/trunk/controller/modules/mywp.controller.module.admin.uploads.php
r3131405 r3201393 367 367 } 368 368 369 $wp_kses_allowed_html = wp_kses_allowed_html( 'post' ); 370 371 $wp_kses_allowed_html['input'] = array( 372 'type' => 1, 373 'class' => 1, 374 'id' => 1, 375 ); 376 369 377 $columns = array(); 370 378 371 379 foreach( $setting_data['list_columns'] as $column_id => $column_setting ) { 372 380 373 $columns[ $column_id ] = $column_setting['title'];381 $columns[ $column_id ] = wp_kses( $column_setting['title'] , $wp_kses_allowed_html ); 374 382 375 383 } -
my-wp/trunk/controller/modules/mywp.controller.module.admin.users.php
r3131405 r3201393 236 236 } 237 237 238 $wp_kses_allowed_html = wp_kses_allowed_html( 'post' ); 239 240 $wp_kses_allowed_html['input'] = array( 241 'type' => 1, 242 'class' => 1, 243 'id' => 1, 244 ); 245 238 246 $columns = array(); 239 247 240 248 foreach( $setting_data['list_columns'] as $column_id => $column_setting ) { 241 249 242 $columns[ $column_id ] = $column_setting['title'];250 $columns[ $column_id ] = wp_kses( $column_setting['title'] , $wp_kses_allowed_html ); 243 251 244 252 } -
my-wp/trunk/controller/modules/mywp.controller.module.frontend.general.php
r3013938 r3201393 103 103 add_action( 'wp_head' , array( __CLASS__ , 'wp_head' ) ); 104 104 105 add_action( 'wp_enqueue_scripts' , array( __CLASS__ , ' wp_enqueue_scripts' ));105 add_action( 'wp_enqueue_scripts' , array( __CLASS__ , 'include_jc_css' ) , 9999 ); 106 106 107 107 } … … 411 411 } 412 412 413 public static function wp_enqueue_scripts() {413 public static function include_jc_css() { 414 414 415 415 if( ! self::is_do_function( __FUNCTION__ ) ) { -
my-wp/trunk/controller/modules/mywp.controller.module.login.general.php
r3013938 r3201393 45 45 public static function mywp_wp_loaded() { 46 46 47 global $wp_version;48 49 47 if( is_admin() ) { 50 48 … … 59 57 } 60 58 61 add_action( 'login_enqueue_scripts' , array( __CLASS__ , 'include_css' ) );59 add_action( 'login_enqueue_scripts' , array( __CLASS__ , 'include_css' ) , 9999 ); 62 60 63 61 add_action( 'wp_print_scripts' , array( __CLASS__ , 'input_css' ) ); … … 69 67 add_filter( 'login_headerurl' , array( __CLASS__ , 'logo_link_url' ) ); 70 68 71 if( version_compare( $wp_version, '5.2.0' , '>=' ) ) {69 if( version_compare( MywpHelper::get_wp_version() , '5.2.0' , '>=' ) ) { 72 70 73 71 add_filter( 'login_headertext' , array( __CLASS__ , 'logo_title' ) ); … … 163 161 if( ! empty( $logo_image_path ) ) { 164 162 165 printf( '.login h1 a { background-image: url(%s); }' , esc_attr( $logo_image_path ) );163 printf( '.login h1 a, .login .wp-login-logo a { background-image: url(%s); }' , esc_attr( $logo_image_path ) ); 166 164 167 165 } … … 271 269 public static function custom_footer_text() { 272 270 273 global $wp_version;274 271 global $post; 275 272 … … 298 295 add_filter( 'mywp_controller_login_general_custom_footer_text' , 'prepend_attachment' ); 299 296 300 if( version_compare( $wp_version, '5.7.0' , '>=' ) ) {297 if( version_compare( MywpHelper::get_wp_version() , '5.7.0' , '>=' ) ) { 301 298 302 299 add_filter( 'mywp_controller_login_general_custom_footer_text' , 'wp_replace_insecure_home_url' ); … … 306 303 add_filter( 'mywp_controller_login_general_custom_footer_text' , 'do_shortcode' , 11 ); 307 304 308 if( version_compare( $wp_version, '5.5.0' , '>=' ) ) {305 if( version_compare( MywpHelper::get_wp_version() , '5.5.0' , '>=' ) ) { 309 306 310 307 add_filter( 'mywp_controller_login_general_custom_footer_text' , 'wp_filter_content_tags' , 12 ); … … 317 314 318 315 <div id="mywp-custom-footer-text"> 319 <?php echo $custom_footer_text; ?>316 <?php echo wp_kses_post( $custom_footer_text ); ?> 320 317 </div> 321 318 -
my-wp/trunk/core/class.helper.php
r3131405 r3201393 257 257 } 258 258 259 public static function get_gmt_offset_seconds() { 260 261 $gmt_offset = (float) get_option( 'gmt_offset' ); 262 263 $gmt_offset_seconds = (int) ( $gmt_offset * HOUR_IN_SECONDS ); 264 265 return $gmt_offset_seconds; 266 267 } 268 269 public static function get_wp_version() { 270 271 global $wp_version; 272 273 if( function_exists( 'wp_get_wp_version' ) ) { 274 275 $version = wp_get_wp_version(); 276 277 } else { 278 279 $version = $wp_version; 280 281 } 282 283 return $wp_version; 284 285 } 286 259 287 public static function sanitize_text( $value ) { 260 288 -
my-wp/trunk/developer/modules/mywp.developer.module.core.environment.php
r3131405 r3201393 30 30 protected static function get_debug_lists() { 31 31 32 global $wp_version;33 34 32 $debug_lists = array(); 35 33 … … 59 57 } 60 58 61 $debug_lists[' $wp_version'] = $wp_version;59 $debug_lists['wp_version'] = MywpHelper::get_wp_version(); 62 60 $debug_lists['is_multisite()'] = is_multisite(); 63 61 $debug_lists['PHP_VERSION'] = PHP_VERSION; -
my-wp/trunk/mywp.php
r3131405 r3201393 4 4 Plugin URI: https://mywpcustomize.com/ 5 5 Description: My WP is powerful admin and frontend customize and debug and extendable plugin. 6 Version: 1.24. 06 Version: 1.24.1 7 7 Author: gqevu6bsiz 8 8 Author URI: https://mywpcustomize.com/ … … 43 43 44 44 define( 'MYWP_NAME' , 'My WP' ); 45 define( 'MYWP_VERSION' , '1.24. 0' );45 define( 'MYWP_VERSION' , '1.24.1' ); 46 46 define( 'MYWP_PLUGIN_FILE' , __FILE__ ); 47 47 define( 'MYWP_PLUGIN_BASENAME' , plugin_basename( MYWP_PLUGIN_FILE ) ); … … 83 83 private static function do_action() { 84 84 85 global $wp_version; 86 87 $wp_compare = version_compare( $wp_version , MYWP_REQUIRED_WP_VERSION , '>=' ); 85 $wp_compare = version_compare( MywpHelper::get_wp_version() , MYWP_REQUIRED_WP_VERSION , '>=' ); 88 86 89 87 if( ! $wp_compare ) { -
my-wp/trunk/post-type/modules/mywp.post-type.module.admin.sidebar.php
r2641658 r3201393 95 95 if( $mywp_post->menu_order ) { 96 96 97 echo $mywp_post->menu_order;97 echo esc_html( $mywp_post->menu_order ); 98 98 99 99 } … … 103 103 if( $mywp_post->ID ) { 104 104 105 echo $mywp_post->ID;105 echo esc_html( $mywp_post->ID ); 106 106 107 107 } … … 111 111 if( $mywp_post->item_parent ) { 112 112 113 echo $mywp_post->item_parent;113 echo esc_html( $mywp_post->item_parent ); 114 114 115 115 } … … 119 119 if( $mywp_post->item_type ) { 120 120 121 echo $mywp_post->item_type;121 echo esc_html( $mywp_post->item_type ); 122 122 123 123 } … … 127 127 if( $mywp_post->item_link_title ) { 128 128 129 echo $mywp_post->item_link_title;129 echo esc_html( $mywp_post->item_link_title ); 130 130 131 131 } … … 133 133 } elseif( $column_name === 'info' ) { 134 134 135 printf( '<textarea class="large-text" readonly="readonly">%s</textarea>' , print_r( $mywp_post , true) );135 printf( '<textarea class="large-text" readonly="readonly">%s</textarea>' , esc_textarea( print_r( $mywp_post , true ) ) ); 136 136 137 137 } -
my-wp/trunk/post-type/modules/mywp.post-type.module.admin.toolbar.php
r2641658 r3201393 95 95 if( $mywp_post->menu_order ) { 96 96 97 echo $mywp_post->menu_order;97 echo esc_html( $mywp_post->menu_order ); 98 98 99 99 } … … 103 103 if( $mywp_post->ID ) { 104 104 105 echo $mywp_post->ID;105 echo esc_html( $mywp_post->ID ); 106 106 107 107 } … … 111 111 if( $mywp_post->item_parent ) { 112 112 113 echo $mywp_post->item_parent;113 echo esc_html( $mywp_post->item_parent ); 114 114 115 115 } … … 119 119 if( $mywp_post->item_type ) { 120 120 121 echo $mywp_post->item_type;121 echo esc_html( $mywp_post->item_type ); 122 122 123 123 } … … 127 127 if( $mywp_post->item_link_title ) { 128 128 129 echo $mywp_post->item_link_title;129 echo esc_html( $mywp_post->item_link_title ); 130 130 131 131 } … … 133 133 } elseif( $column_name === 'info' ) { 134 134 135 printf( '<textarea class="large-text" readonly="readonly">%s</textarea>' , print_r( $mywp_post , true) );135 printf( '<textarea class="large-text" readonly="readonly">%s</textarea>' , esc_textarea( print_r( $mywp_post , true ) ) ); 136 136 137 137 } -
my-wp/trunk/post-type/modules/mywp.post-type.module.front.toolbar.php
r2641658 r3201393 95 95 if( $mywp_post->menu_order ) { 96 96 97 echo $mywp_post->menu_order;97 echo esc_html( $mywp_post->menu_order ); 98 98 99 99 } … … 103 103 if( $mywp_post->ID ) { 104 104 105 echo $mywp_post->ID;105 echo esc_html( $mywp_post->ID ); 106 106 107 107 } … … 111 111 if( $mywp_post->item_parent ) { 112 112 113 echo $mywp_post->item_parent;113 echo esc_html( $mywp_post->item_parent ); 114 114 115 115 } … … 119 119 if( $mywp_post->item_type ) { 120 120 121 echo $mywp_post->item_type;121 echo esc_html( $mywp_post->item_type ); 122 122 123 123 } … … 133 133 } 134 134 135 echo $mywp_post->item_link_title;135 echo esc_html( $mywp_post->item_link_title ); 136 136 137 137 } … … 139 139 } elseif( $column_name === 'info' ) { 140 140 141 printf( '<textarea class="large-text" readonly="readonly">%s</textarea>' , print_r( $mywp_post , true) );141 printf( '<textarea class="large-text" readonly="readonly">%s</textarea>' , esc_textarea( print_r( $mywp_post , true ) ) ); 142 142 143 143 } -
my-wp/trunk/post-type/modules/mywp.post-type.module.logger.php
r2641658 r3201393 146 146 } elseif( $column_name === 'log' ) { 147 147 148 printf( '<textarea class="large-text" readonly="readonly">%s</textarea>' , print_r( $mywp_post->log , true) );148 printf( '<textarea class="large-text" readonly="readonly">%s</textarea>' , esc_textarea( print_r( $mywp_post->log , true ) ) ); 149 149 150 150 } -
my-wp/trunk/readme.txt
r3131405 r3201393 3 3 Tags: admin, frontend, debug, sidebar, toolbar 4 4 Requires at least: 4.7 5 Tested up to: 6. 65 Tested up to: 6.7 6 6 Requires PHP: 5.6 7 Stable tag: 1.24. 07 Stable tag: 1.24.1 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 93 93 == Changelog == 94 94 95 = 1.24.1 2024-12-03 = 96 * Updated: For WordPress 6.7. 97 * Changed: How to get the wp version and offset seconds. 98 * Changed: Late include the JS and CSS on admin and frontend and login. 99 * Fixed: Escape and sanitize the some values. 100 95 101 = 1.24.0 2024-08-06 = 96 102 * Added: Deprecated list columns on Posts, Comments, Users, Uploads, Terms. -
my-wp/trunk/setting/abstract.setting.columns.module.php
r3131405 r3201393 517 517 } 518 518 519 $wp_kses_allowed_html = wp_kses_allowed_html( 'post' ); 520 521 $wp_kses_allowed_html['input'] = array( 522 'type' => 1, 523 'class' => 1, 524 'id' => 1, 525 ); 526 519 527 ?> 520 528 … … 529 537 <?php if( ! empty( $column['title'] ) ) : ?> 530 538 531 <?php echo strip_shortcodes( $column['title']); ?>539 <?php echo wp_kses( strip_shortcodes( $column['title'] ) , $wp_kses_allowed_html ); ?> 532 540 533 541 <?php endif; ?> … … 539 547 <?php if( ! empty( $column['default_title'] ) ) : ?> 540 548 541 (<?php echo esc_ attr( $column['default_title'] ); ?>)549 (<?php echo esc_html( $column['default_title'] ); ?>) 542 550 543 551 <?php endif; ?> -
my-wp/trunk/setting/abstract.setting.toolbar.module.php
r3013938 r3201393 444 444 } elseif( in_array( $meta_key , array( 'item_link_title' , 'item_custom_html' , 'item_icon_title' ) ) ) { 445 445 446 $meta_value = wp_unslash( $meta_value);446 $meta_value = wp_unslash( wp_kses_post( $meta_value ) ); 447 447 448 448 } elseif( in_array( $meta_key , array( 'item_location' ) ) ) { … … 2765 2765 } elseif( $field_name === 'item_custom_html' ) { 2766 2766 2767 printf( '<textarea class="item_custom_html large-text" placeholder="%s">%s</textarea>' , esc_attr( '<div class="" style="">Custom HTML</div>...' ) , $value);2767 printf( '<textarea class="item_custom_html large-text" placeholder="%s">%s</textarea>' , esc_attr( '<div class="" style="">Custom HTML</div>...' ) , esc_textarea( wp_kses_post( $value ) ) ); 2768 2768 2769 2769 } elseif( $field_name === 'item_li_class' ) { … … 2789 2789 } 2790 2790 2791 printf( '<input type="text" class="item_link_title large-text" value="%s" placeholder="%s" />' , esc_attr( $value) , esc_attr( $default_title ) );2791 printf( '<input type="text" class="item_link_title large-text" value="%s" placeholder="%s" />' , esc_attr( wp_kses_post( $value ) ) , esc_attr( $default_title ) ); 2792 2792 2793 2793 } elseif( $field_name === 'item_link_attr' ) { … … 2814 2814 } elseif( $field_name === 'item_icon_title' ) { 2815 2815 2816 printf( '<input type="text" class="item_icon_title large-text" value="%s" placeholder="%s" />' , esc_attr( $value) , esc_attr( 'Icon Html' ) );2816 printf( '<input type="text" class="item_icon_title large-text" value="%s" placeholder="%s" />' , esc_attr( wp_kses_post( $value ) ) , esc_attr( 'Icon Html' ) ); 2817 2817 2818 2818 } elseif( $field_name === 'item_meta' ) { -
my-wp/trunk/setting/modules/mywp.setting.admin.comments.php
r3131405 r3201393 497 497 if( ! empty( $formatted_data['list_columns'] ) ) { 498 498 499 $wp_kses_allowed_html = wp_kses_allowed_html( 'post' ); 500 501 $wp_kses_allowed_html['input'] = array( 502 'type' => 1, 503 'class' => 1, 504 'id' => 1, 505 ); 506 499 507 foreach( $formatted_data['list_columns'] as $list_column_id => $list_column_setting ) { 500 508 … … 511 519 if( ! empty( $list_column_setting['title'] ) ) { 512 520 513 $new_list_column_setting['title'] = wp_unslash( $list_column_setting['title']);521 $new_list_column_setting['title'] = wp_unslash( wp_kses( $list_column_setting['title'] , $wp_kses_allowed_html ) ); 514 522 515 523 } -
my-wp/trunk/setting/modules/mywp.setting.admin.dashboard.php
r2890935 r3201393 120 120 if( ! empty( $meta_box_setting['title'] ) ) { 121 121 122 $new_meta_box_setting['title'] = wp_unslash( $meta_box_setting['title']);122 $new_meta_box_setting['title'] = wp_unslash( wp_kses_post( $meta_box_setting['title'] ) ); 123 123 124 124 } -
my-wp/trunk/setting/modules/mywp.setting.admin.general.php
r2655597 r3201393 308 308 if( ! empty( $formatted_data['custom_footer_text'] ) ) { 309 309 310 $new_formatted_data['custom_footer_text'] = wp_unslash( $formatted_data['custom_footer_text']);310 $new_formatted_data['custom_footer_text'] = wp_unslash( wp_kses_post( $formatted_data['custom_footer_text'] ) ); 311 311 312 312 } -
my-wp/trunk/setting/modules/mywp.setting.admin.post-edit.php
r3001445 r3201393 500 500 if( ! empty( $meta_box_setting['title'] ) ) { 501 501 502 $new_meta_box_setting['title'] = wp_unslash( $meta_box_setting['title']);502 $new_meta_box_setting['title'] = wp_unslash( wp_kses_post( $meta_box_setting['title'] ) ); 503 503 504 504 } -
my-wp/trunk/setting/modules/mywp.setting.admin.posts.php
r3131405 r3201393 829 829 if( ! empty( $formatted_data['list_columns'] ) ) { 830 830 831 $wp_kses_allowed_html = wp_kses_allowed_html( 'post' ); 832 833 $wp_kses_allowed_html['input'] = array( 834 'type' => 1, 835 'class' => 1, 836 'id' => 1, 837 ); 838 831 839 foreach( $formatted_data['list_columns'] as $list_column_id => $list_column_setting ) { 832 840 … … 843 851 if( ! empty( $list_column_setting['title'] ) ) { 844 852 845 $new_list_column_setting['title'] = wp_unslash( $list_column_setting['title']);853 $new_list_column_setting['title'] = wp_unslash( wp_kses( $list_column_setting['title'] , $wp_kses_allowed_html ) ); 846 854 847 855 } -
my-wp/trunk/setting/modules/mywp.setting.admin.sidebar.php
r3013938 r3201393 421 421 } elseif( in_array( $meta_key , array( 'item_link_title' , 'item_custom_html' , 'item_icon_title' ) ) ) { 422 422 423 $meta_value = wp_unslash( $meta_value);423 $meta_value = wp_unslash( wp_kses_post( $meta_value ) ); 424 424 425 425 } else { … … 2505 2505 } elseif( $field_name === 'item_custom_html' ) { 2506 2506 2507 printf( '<textarea class="item_custom_html large-text" placeholder="%s">%s</textarea>' , esc_attr( '<div class="" style="">Custom HTML</div>...' ) , $value);2507 printf( '<textarea class="item_custom_html large-text" placeholder="%s">%s</textarea>' , esc_attr( '<div class="" style="">Custom HTML</div>...' ) , esc_textarea( wp_kses_post( $value ) ) ); 2508 2508 2509 2509 } elseif( $field_name === 'item_li_class' ) { … … 2537 2537 } 2538 2538 2539 printf( '<input type="text" class="item_link_title large-text" value="%s" placeholder="%s" />' , esc_attr( $value) , esc_attr( $default_title ) );2539 printf( '<input type="text" class="item_link_title large-text" value="%s" placeholder="%s" />' , esc_attr( wp_kses_post( $value ) ) , esc_attr( $default_title ) ); 2540 2540 2541 2541 } elseif( $field_name === 'item_link_attr' ) { … … 2562 2562 } elseif( $field_name === 'item_icon_title' ) { 2563 2563 2564 printf( '<input type="text" class="item_icon_title large-text" value="%s" placeholder="%s" />' , esc_attr( $value) , esc_attr( 'Icon Html' ) );2564 printf( '<input type="text" class="item_icon_title large-text" value="%s" placeholder="%s" />' , esc_attr( wp_kses_post( $value ) ) , esc_attr( 'Icon Html' ) ); 2565 2565 2566 2566 } else { -
my-wp/trunk/setting/modules/mywp.setting.admin.terms.php
r3131405 r3201393 623 623 if( ! empty( $formatted_data['list_columns'] ) ) { 624 624 625 $wp_kses_allowed_html = wp_kses_allowed_html( 'post' ); 626 627 $wp_kses_allowed_html['input'] = array( 628 'type' => 1, 629 'class' => 1, 630 'id' => 1, 631 ); 632 625 633 foreach( $formatted_data['list_columns'] as $list_column_id => $list_column_setting ) { 626 634 … … 637 645 if( ! empty( $list_column_setting['title'] ) ) { 638 646 639 $new_list_column_setting['title'] = wp_unslash( $list_column_setting['title']);647 $new_list_column_setting['title'] = wp_unslash( wp_kses( $list_column_setting['title'] , $wp_kses_allowed_html ) ); 640 648 641 649 } -
my-wp/trunk/setting/modules/mywp.setting.admin.uploads.php
r3131405 r3201393 546 546 if( ! empty( $formatted_data['list_columns'] ) ) { 547 547 548 $wp_kses_allowed_html = wp_kses_allowed_html( 'post' ); 549 550 $wp_kses_allowed_html['input'] = array( 551 'type' => 1, 552 'class' => 1, 553 'id' => 1, 554 ); 555 548 556 foreach( $formatted_data['list_columns'] as $list_column_id => $list_column_setting ) { 549 557 … … 560 568 if( ! empty( $list_column_setting['title'] ) ) { 561 569 562 $new_list_column_setting['title'] = wp_unslash( $list_column_setting['title']);570 $new_list_column_setting['title'] = wp_unslash( wp_kses( $list_column_setting['title'] , $wp_kses_allowed_html ) ); 563 571 564 572 } -
my-wp/trunk/setting/modules/mywp.setting.admin.users.php
r3131405 r3201393 528 528 if( ! empty( $formatted_data['list_columns'] ) ) { 529 529 530 $wp_kses_allowed_html = wp_kses_allowed_html( 'post' ); 531 532 $wp_kses_allowed_html['input'] = array( 533 'type' => 1, 534 'class' => 1, 535 'id' => 1, 536 ); 537 530 538 foreach( $formatted_data['list_columns'] as $list_column_id => $list_column_setting ) { 531 539 … … 542 550 if( ! empty( $list_column_setting['title'] ) ) { 543 551 544 $new_list_column_setting['title'] = wp_unslash( $list_column_setting['title']);552 $new_list_column_setting['title'] = wp_unslash( wp_kses( $list_column_setting['title'] , $wp_kses_allowed_html ) ); 545 553 546 554 } -
my-wp/trunk/setting/modules/mywp.setting.debug.crons.php
r2655597 r3201393 50 50 51 51 $timezone_format = _x( 'Y-m-d H:i:s' , 'timezone date format' ); 52 $offset = get_option( 'gmt_offset' ) * HOUR_IN_SECONDS;53 52 $timezone = get_option( 'timezone_string' ); 54 53 … … 67 66 <tr> 68 67 <th> 69 <?php echo key( $cron); ?>68 <?php echo esc_html( key( $cron ) ); ?> 70 69 </th> 71 70 <td> 72 <p><?php echo date( $timezone_format , $timestamp + $offset); ?> (<?php echo $timezone; ?>)</p>71 <p><?php echo date( $timezone_format , $timestamp + MywpHelper::get_gmt_offset_seconds() ); ?> (<?php echo $timezone; ?>)</p> 73 72 <input type="text" readonly="readonly" class="large-text" value="<?php echo esc_attr( $timestamp ); ?>" /><br /> 74 73 <?php _e( 'RAW' ); ?>: <?php echo date( $timezone_format , $timestamp ); ?> (<?php _e( 'UTC' ); ?>) 75 74 </td> 76 75 <td> 77 <textarea readonly="readonly" class="large-text" style="height: 160px;"><?php print_r( $cron); ?></textarea>76 <textarea readonly="readonly" class="large-text" style="height: 160px;"><?php echo esc_textarea( print_r( $cron , true ) ); ?></textarea> 78 77 </td> 79 78 </tr> -
my-wp/trunk/setting/modules/mywp.setting.debug.datetime.php
r2641658 r3201393 74 74 <tr> 75 75 <th>date( "Y-m-d H:i:s" , time() + ( get_option( "gmt_offset" ) * HOUR_IN_SECONDS ) )</th> 76 <td><?php echo date( "Y-m-d H:i:s" , time() + ( get_option( "gmt_offset" ) * HOUR_IN_SECONDS) ); ?></td>76 <td><?php echo date( "Y-m-d H:i:s" , time() + MywpHelper::get_gmt_offset_seconds() ); ?></td> 77 77 </tr> 78 78 <tr> -
my-wp/trunk/setting/modules/mywp.setting.debug.transients.php
r2655597 r3201393 200 200 201 201 $timezone_format = _x( 'Y-m-d H:i:s' , 'timezone date format' ); 202 $offset = get_option( 'gmt_offset' ) * HOUR_IN_SECONDS;203 202 $timezone = get_option( 'timezone_string' ); 204 203 … … 232 231 <td> 233 232 <?php if( ! empty( $transient['timeout'] ) ) : ?> 234 <p><?php echo date( $timezone_format , $transient['timeout']['value'] + $offset); ?> (<?php echo $timezone; ?>)</p>233 <p><?php echo date( $timezone_format , $transient['timeout']['value'] + MywpHelper::get_gmt_offset_seconds() ); ?> (<?php echo $timezone; ?>)</p> 235 234 <input type="text" readonly="readonly" class="large-text" value="<?php echo esc_attr( $transient['timeout']['value'] ); ?>" /><br /> 236 235 <?php else : ?> … … 245 244 </td> 246 245 <td> 247 <textarea readonly="readonly" class="large-text" style="height: 160px;"><?php print_r( maybe_unserialize( $transient['value']) ); ?></textarea>246 <textarea readonly="readonly" class="large-text" style="height: 160px;"><?php echo esc_textarea( print_r( maybe_unserialize( $transient['value'] ) , true ) ); ?></textarea> 248 247 </td> 249 248 </tr> -
my-wp/trunk/setting/modules/mywp.setting.login.general.php
r2677466 r3201393 206 206 if( ! empty( $formatted_data['custom_footer_text'] ) ) { 207 207 208 $new_formatted_data['custom_footer_text'] = wp_unslash( $formatted_data['custom_footer_text']);208 $new_formatted_data['custom_footer_text'] = wp_unslash( wp_kses_post( $formatted_data['custom_footer_text'] ) ); 209 209 210 210 } -
my-wp/trunk/setting/modules/mywp.setting.update.bulk-post-meta.php
r3122381 r3201393 962 962 <input type="checkbox" class="update-bulk-post-meta-select-post-id" value="<?php echo esc_attr( $post_id ); ?>" /> 963 963 </th> 964 <td class="id"><?php echo $post_id; ?></td>965 <td class="type"><?php echo strip_tags( $post->post_type ); ?></td>966 <td class="status"><?php echo strip_tags( $post->post_status ); ?></td>967 <td class="title"><?php echo strip_tags( $post->post_title ); ?></td>968 <td class="metas"><textarea readonly class="large-text"><?php print_r( get_post_meta( $post_id) ); ?></textarea></td>964 <td class="id"><?php echo esc_html( $post_id ); ?></td> 965 <td class="type"><?php echo esc_html( $post->post_type ); ?></td> 966 <td class="status"><?php echo esc_html( $post->post_status ); ?></td> 967 <td class="title"><?php echo esc_html( $post->post_title ); ?></td> 968 <td class="metas"><textarea readonly class="large-text"><?php echo esc_textarea( print_r( get_post_meta( $post_id ) , true ) ); ?></textarea></td> 969 969 </tr> 970 970 … … 1020 1020 <td class="from-meta"> 1021 1021 <?php if( is_array( $from_meta_value ) or is_object( $from_meta_value ) ) : ?> 1022 <textarea class="large-text" readonly="readonly"><?php print_r( $from_meta_value); ?></textarea>1022 <textarea class="large-text" readonly="readonly"><?php echo esc_textarea( print_r( $from_meta_value , true ) ); ?></textarea> 1023 1023 <?php else : ?> 1024 1024 <?php echo esc_html( $from_meta_value ); ?> … … 1030 1030 <td class="to-meta"> 1031 1031 <?php if( is_array( $bulk_meta_value_unserialize ) or is_object( $bulk_meta_value_unserialize ) ) : ?> 1032 <textarea class="large-text" readonly="readonly"><?php print_r( $bulk_meta_value_unserialize); ?></textarea>1032 <textarea class="large-text" readonly="readonly"><?php echo esc_textarea( print_r( $bulk_meta_value_unserialize , true ) ); ?></textarea> 1033 1033 <?php else : ?> 1034 1034 <?php echo esc_html( $bulk_meta_value ); ?> … … 1045 1045 } 1046 1046 1047 1048 1047 } 1049 1048
Note: See TracChangeset
for help on using the changeset viewer.