Changeset 3035661
- Timestamp:
- 02/14/2024 12:58:35 PM (2 years ago)
- Location:
- wphelpkit
- Files:
-
- 16 edited
- 1 copied
-
tags/1.3 (copied) (copied from wphelpkit/trunk)
-
tags/1.3/README.txt (modified) (2 diffs)
-
tags/1.3/includes/class-wphelpkit-customizer.php (modified) (1 diff)
-
tags/1.3/includes/class-wphelpkit-settings.php (modified) (5 diffs)
-
tags/1.3/includes/data-model/class-wphelpkit-article.php (modified) (1 diff)
-
tags/1.3/includes/template-tags.php (modified) (5 diffs)
-
tags/1.3/templates/search-helpkit-article.php (modified) (3 diffs)
-
tags/1.3/templates/template-parts/article/content.php (modified) (1 diff)
-
tags/1.3/wphelpkit.php (modified) (3 diffs)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/includes/class-wphelpkit-customizer.php (modified) (1 diff)
-
trunk/includes/class-wphelpkit-settings.php (modified) (5 diffs)
-
trunk/includes/data-model/class-wphelpkit-article.php (modified) (1 diff)
-
trunk/includes/template-tags.php (modified) (5 diffs)
-
trunk/templates/search-helpkit-article.php (modified) (3 diffs)
-
trunk/templates/template-parts/article/content.php (modified) (1 diff)
-
trunk/wphelpkit.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wphelpkit/tags/1.3/README.txt
r3034118 r3035661 3 3 Contributors: wphelpkit 4 4 Tags: WPHelpKit, knowledge base, documentation, faqs, support, docs, help center, wiki 5 Stable tag: 1. 25 Stable tag: 1.3 6 6 Requires at least: 6.0 7 7 Tested up to: 6.4 … … 53 53 == Changelog == 54 54 55 = 1.3 = 56 * Fix: Address some issues requested by the WordPress team 57 55 58 = 1.2 = 56 59 * Fix: Address some issues requested by the WordPress team -
wphelpkit/tags/1.3/includes/class-wphelpkit-customizer.php
r3028651 r3035661 93 93 check_ajax_referer(self::$get_archive_page_permalink_action . '-nonce', 'nonce'); 94 94 95 echo get_post_type_archive_link(WPHelpKit_Article::$post_type);95 echo wp_kses_post(get_post_type_archive_link(WPHelpKit_Article::$post_type)); 96 96 97 97 exit; -
wphelpkit/tags/1.3/includes/class-wphelpkit-settings.php
r3034118 r3035661 540 540 541 541 add_settings_field( 542 'wphelpkit -hidden-permalink-field',542 'wphelpkit_permalink_custom_settings', 543 543 '', 544 array( $this, 'output_ hidden_text_settings_permalink_field' ),544 array( $this, 'output_wphelpkit_permalink_custom_settings' ), 545 545 'permalink', 546 'wphelpkit-slugs', 547 array( 'option' => 'wphelpkit_hidden_permalink_field' ) 546 'wphelpkit-slugs' 548 547 ); 549 548 … … 595 594 } 596 595 597 public function output_hidden_text_settings_permalink_field($args) 598 { 599 echo sprintf( 600 "<input type='hidden' name='%s' id='%s' value='' />", 601 esc_attr($args['option']), 602 esc_attr($args['option']) 603 ); 604 596 public function output_wphelpkit_permalink_custom_settings() 597 { 598 wp_nonce_field('wphelpkit_permalink_custom_settings_action', 'wphelpkit_permalink_custom_settings_nonce'); 605 599 return; 606 600 } … … 731 725 public function save_settings() 732 726 { 733 734 if ( !isset($_POST['wphelpkit_settings_nonce']) && !isset($_POST['wphelpkit_hidden_permalink_field']) ) { 727 if ( ! current_user_can('manage_options') ) { 728 return; 729 } 730 731 if 732 ( 733 ! ( isset($_POST['wphelpkit_settings_nonce']) && wp_verify_nonce($_POST['wphelpkit_settings_nonce'], 'wphelpkit_settings_action') ) && 734 ! ( isset($_POST['wphelpkit_permalink_custom_settings_nonce']) && wp_verify_nonce($_POST['wphelpkit_permalink_custom_settings_nonce'], 'wphelpkit_permalink_custom_settings_action') ) 735 ) 736 { 735 737 return; 736 738 } … … 740 742 $data = array_map( 'sanitize_text_field', $_POST[ self::$option_name ] ); 741 743 742 if ( isset($_POST['wphelpkit_settings_nonce'])) {744 if ( isset($_POST['wphelpkit_settings_nonce']) && wp_verify_nonce($_POST['wphelpkit_settings_nonce'], 'wphelpkit_settings_action') ) { 743 745 $data['search_in_category'] = $this->sanitize_checkbox_option($_POST[ self::$option_name ]['search_in_category'] || false); 744 746 $data['category_index_tree'] = $this->sanitize_checkbox_option($_POST[ self::$option_name ]['category_index_tree'] || false); … … 746 748 } 747 749 748 if ( isset($_POST['wphelpkit_hidden_permalink_field'])) {750 if ( isset($_POST['wphelpkit_permalink_custom_settings_nonce']) && wp_verify_nonce($_POST['wphelpkit_permalink_custom_settings_nonce'], 'wphelpkit_permalink_custom_settings_action') ) { 749 751 $product_base = isset( $data['article_permalink_structure'] ) ? $this->clean_permalink( wp_unslash( $data['article_permalink_structure'] ) ) : ''; 750 752 $data['article_permalink_structure'] = $this->sanitize_permalink_option( $product_base ); -
wphelpkit/tags/1.3/includes/data-model/class-wphelpkit-article.php
r3034118 r3035661 288 288 289 289 if ( in_array( $pagenow, array( 'post.php', 'post-new.php' ) ) && isset( $_GET['post'] ) ) { 290 $current_post = get_post( esc_attr( $_GET['post']) );290 $current_post = get_post( esc_attr( sanitize_text_field( $_GET['post'] ) ) ); 291 291 } elseif ( $post ) { 292 292 $current_post = $post; -
wphelpkit/tags/1.3/includes/template-tags.php
r3034118 r3035661 327 327 function wphelpkit_related_articles( $post = null ) 328 328 { 329 echo wp helpkit_get_related_articles( $post) ;329 echo wp_kses_post( wphelpkit_get_related_articles( $post ) ) ; 330 330 return; 331 331 } … … 370 370 $_attrs = trim( $_attrs ); 371 371 $shortcode = sprintf( '[%s %s]', WPHelpKit_Article::$article_archive_shortcode, $_attrs ); 372 return do_shortcode( $shortcode);372 return do_shortcode( wp_kses_post( $shortcode ) ); 373 373 } 374 374 … … 394 394 { 395 395 echo wphelpkit_get_archive( $attrs ) ; 396 //escaped in the function: return do_shortcode(wp_kses_post($shortcode)); 396 397 return; 397 398 } … … 474 475 $_attrs = trim( $_attrs ); 475 476 $shortcode = sprintf( '[%s %s]', WPHelpKit_Article_Tag::$tag_archive_shortcode, $_attrs ); 476 return do_shortcode( $shortcode);477 return do_shortcode( wp_kses_post( $shortcode ) ); 477 478 } 478 479 … … 512 513 { 513 514 echo wphelpkit_get_tag_archive( $attrs ) ; 514 } 515 //escaped in the function: return do_shortcode(wp_kses_post($shortcode)); 516 } -
wphelpkit/tags/1.3/templates/search-helpkit-article.php
r3034118 r3035661 25 25 </div> 26 26 <?php if (have_posts()) : ?> 27 <h1 class='page-title'><?php printf(esc_html__('Search Results for “%s”', 'wphelpkit'), '<span>' . get_search_query() . '</span>'); ?></h1>27 <h1 class='page-title'><?php printf(esc_html__('Search Results for “%s”', 'wphelpkit'), '<span>' . esc_attr( get_search_query() ) . '</span>'); ?></h1> 28 28 <?php else : ?> 29 29 <h1 class='page-title'><?php esc_html_e('Nothing Found', 'wphelpkit') ?></h1> … … 63 63 } 64 64 if( !empty($article_excerpt=get_the_excerpt(get_the_ID())) ) { 65 echo sprintf('<p class="wphelpkit-article-excerpt">%s</p>', wp_trim_words( $article_excerpt, 20));65 echo sprintf('<p class="wphelpkit-article-excerpt">%s</p>', wp_trim_words(wp_kses_post($article_excerpt), 20)); 66 66 } 67 67 ?> … … 72 72 </ul> 73 73 <?php 74 echo apply_filters( 'wphelpkit-search-pagination', get_the_posts_pagination());74 echo apply_filters( 'wphelpkit-search-pagination', wp_kses_post( get_the_posts_pagination() ) ); 75 75 else : ?> 76 76 <p><?php esc_html_e('Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'wphelpkit'); ?></p> -
wphelpkit/tags/1.3/templates/template-parts/article/content.php
r3034118 r3035661 116 116 ); 117 117 if ( $tags_list && !is_wp_error( $tags_list ) ) { 118 echo '<span class="wphelpkit-tags-links"><span class="wphelpkiticons wphelpkiticons-tag"></span><span class="screen-reader-text">' . esc_html__( 'Tags', 'wphelpkit' ) . '</span>' . $tags_list. '</span>' ;118 echo '<span class="wphelpkit-tags-links"><span class="wphelpkiticons wphelpkiticons-tag"></span><span class="screen-reader-text">' . esc_html__( 'Tags', 'wphelpkit' ) . '</span>' . wp_kses_post( $tags_list ) . '</span>' ; 119 119 } 120 120 edit_post_link( esc_html__( 'Edit', 'wphelpkit' ) . '<span class="screen-reader-text"> ' . get_the_title() . '</span>', '<span class="edit-link">', '</span>' ); -
wphelpkit/tags/1.3/wphelpkit.php
r3034118 r3035661 3 3 /* 4 4 * Plugin Name: WPHelpKit 5 * Description: Documentation and Knowledge Base — Publish, organize and manage Help Articles for your software product.6 * Version: 1. 25 * Description: Documentation and Knowledge Base — Organize, publish, and manage help articles for your SaaS or software product. 6 * Version: 1.3 7 7 * Author: WPHelpKit 8 8 * Plugin URI: https://wphelpkit.com … … 103 103 * @var string 104 104 */ 105 const VERSION = '1. 2' ;105 const VERSION = '1.3' ; 106 106 /** 107 107 * Transient name to set when we are activated. … … 164 164 add_action( 'init', array( $this, 'maybe_create_helpkit_page' ), PHP_INT_MAX ); 165 165 add_filter( 166 'block_categories ',166 'block_categories_all', 167 167 array( $this, 'block_categories' ), 168 168 10, -
wphelpkit/trunk/README.txt
r3034118 r3035661 3 3 Contributors: wphelpkit 4 4 Tags: WPHelpKit, knowledge base, documentation, faqs, support, docs, help center, wiki 5 Stable tag: 1. 25 Stable tag: 1.3 6 6 Requires at least: 6.0 7 7 Tested up to: 6.4 … … 53 53 == Changelog == 54 54 55 = 1.3 = 56 * Fix: Address some issues requested by the WordPress team 57 55 58 = 1.2 = 56 59 * Fix: Address some issues requested by the WordPress team -
wphelpkit/trunk/includes/class-wphelpkit-customizer.php
r3028651 r3035661 93 93 check_ajax_referer(self::$get_archive_page_permalink_action . '-nonce', 'nonce'); 94 94 95 echo get_post_type_archive_link(WPHelpKit_Article::$post_type);95 echo wp_kses_post(get_post_type_archive_link(WPHelpKit_Article::$post_type)); 96 96 97 97 exit; -
wphelpkit/trunk/includes/class-wphelpkit-settings.php
r3034118 r3035661 540 540 541 541 add_settings_field( 542 'wphelpkit -hidden-permalink-field',542 'wphelpkit_permalink_custom_settings', 543 543 '', 544 array( $this, 'output_ hidden_text_settings_permalink_field' ),544 array( $this, 'output_wphelpkit_permalink_custom_settings' ), 545 545 'permalink', 546 'wphelpkit-slugs', 547 array( 'option' => 'wphelpkit_hidden_permalink_field' ) 546 'wphelpkit-slugs' 548 547 ); 549 548 … … 595 594 } 596 595 597 public function output_hidden_text_settings_permalink_field($args) 598 { 599 echo sprintf( 600 "<input type='hidden' name='%s' id='%s' value='' />", 601 esc_attr($args['option']), 602 esc_attr($args['option']) 603 ); 604 596 public function output_wphelpkit_permalink_custom_settings() 597 { 598 wp_nonce_field('wphelpkit_permalink_custom_settings_action', 'wphelpkit_permalink_custom_settings_nonce'); 605 599 return; 606 600 } … … 731 725 public function save_settings() 732 726 { 733 734 if ( !isset($_POST['wphelpkit_settings_nonce']) && !isset($_POST['wphelpkit_hidden_permalink_field']) ) { 727 if ( ! current_user_can('manage_options') ) { 728 return; 729 } 730 731 if 732 ( 733 ! ( isset($_POST['wphelpkit_settings_nonce']) && wp_verify_nonce($_POST['wphelpkit_settings_nonce'], 'wphelpkit_settings_action') ) && 734 ! ( isset($_POST['wphelpkit_permalink_custom_settings_nonce']) && wp_verify_nonce($_POST['wphelpkit_permalink_custom_settings_nonce'], 'wphelpkit_permalink_custom_settings_action') ) 735 ) 736 { 735 737 return; 736 738 } … … 740 742 $data = array_map( 'sanitize_text_field', $_POST[ self::$option_name ] ); 741 743 742 if ( isset($_POST['wphelpkit_settings_nonce'])) {744 if ( isset($_POST['wphelpkit_settings_nonce']) && wp_verify_nonce($_POST['wphelpkit_settings_nonce'], 'wphelpkit_settings_action') ) { 743 745 $data['search_in_category'] = $this->sanitize_checkbox_option($_POST[ self::$option_name ]['search_in_category'] || false); 744 746 $data['category_index_tree'] = $this->sanitize_checkbox_option($_POST[ self::$option_name ]['category_index_tree'] || false); … … 746 748 } 747 749 748 if ( isset($_POST['wphelpkit_hidden_permalink_field'])) {750 if ( isset($_POST['wphelpkit_permalink_custom_settings_nonce']) && wp_verify_nonce($_POST['wphelpkit_permalink_custom_settings_nonce'], 'wphelpkit_permalink_custom_settings_action') ) { 749 751 $product_base = isset( $data['article_permalink_structure'] ) ? $this->clean_permalink( wp_unslash( $data['article_permalink_structure'] ) ) : ''; 750 752 $data['article_permalink_structure'] = $this->sanitize_permalink_option( $product_base ); -
wphelpkit/trunk/includes/data-model/class-wphelpkit-article.php
r3034118 r3035661 288 288 289 289 if ( in_array( $pagenow, array( 'post.php', 'post-new.php' ) ) && isset( $_GET['post'] ) ) { 290 $current_post = get_post( esc_attr( $_GET['post']) );290 $current_post = get_post( esc_attr( sanitize_text_field( $_GET['post'] ) ) ); 291 291 } elseif ( $post ) { 292 292 $current_post = $post; -
wphelpkit/trunk/includes/template-tags.php
r3034118 r3035661 327 327 function wphelpkit_related_articles( $post = null ) 328 328 { 329 echo wp helpkit_get_related_articles( $post) ;329 echo wp_kses_post( wphelpkit_get_related_articles( $post ) ) ; 330 330 return; 331 331 } … … 370 370 $_attrs = trim( $_attrs ); 371 371 $shortcode = sprintf( '[%s %s]', WPHelpKit_Article::$article_archive_shortcode, $_attrs ); 372 return do_shortcode( $shortcode);372 return do_shortcode( wp_kses_post( $shortcode ) ); 373 373 } 374 374 … … 394 394 { 395 395 echo wphelpkit_get_archive( $attrs ) ; 396 //escaped in the function: return do_shortcode(wp_kses_post($shortcode)); 396 397 return; 397 398 } … … 474 475 $_attrs = trim( $_attrs ); 475 476 $shortcode = sprintf( '[%s %s]', WPHelpKit_Article_Tag::$tag_archive_shortcode, $_attrs ); 476 return do_shortcode( $shortcode);477 return do_shortcode( wp_kses_post( $shortcode ) ); 477 478 } 478 479 … … 512 513 { 513 514 echo wphelpkit_get_tag_archive( $attrs ) ; 514 } 515 //escaped in the function: return do_shortcode(wp_kses_post($shortcode)); 516 } -
wphelpkit/trunk/templates/search-helpkit-article.php
r3034118 r3035661 25 25 </div> 26 26 <?php if (have_posts()) : ?> 27 <h1 class='page-title'><?php printf(esc_html__('Search Results for “%s”', 'wphelpkit'), '<span>' . get_search_query() . '</span>'); ?></h1>27 <h1 class='page-title'><?php printf(esc_html__('Search Results for “%s”', 'wphelpkit'), '<span>' . esc_attr( get_search_query() ) . '</span>'); ?></h1> 28 28 <?php else : ?> 29 29 <h1 class='page-title'><?php esc_html_e('Nothing Found', 'wphelpkit') ?></h1> … … 63 63 } 64 64 if( !empty($article_excerpt=get_the_excerpt(get_the_ID())) ) { 65 echo sprintf('<p class="wphelpkit-article-excerpt">%s</p>', wp_trim_words( $article_excerpt, 20));65 echo sprintf('<p class="wphelpkit-article-excerpt">%s</p>', wp_trim_words(wp_kses_post($article_excerpt), 20)); 66 66 } 67 67 ?> … … 72 72 </ul> 73 73 <?php 74 echo apply_filters( 'wphelpkit-search-pagination', get_the_posts_pagination());74 echo apply_filters( 'wphelpkit-search-pagination', wp_kses_post( get_the_posts_pagination() ) ); 75 75 else : ?> 76 76 <p><?php esc_html_e('Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'wphelpkit'); ?></p> -
wphelpkit/trunk/templates/template-parts/article/content.php
r3034118 r3035661 116 116 ); 117 117 if ( $tags_list && !is_wp_error( $tags_list ) ) { 118 echo '<span class="wphelpkit-tags-links"><span class="wphelpkiticons wphelpkiticons-tag"></span><span class="screen-reader-text">' . esc_html__( 'Tags', 'wphelpkit' ) . '</span>' . $tags_list. '</span>' ;118 echo '<span class="wphelpkit-tags-links"><span class="wphelpkiticons wphelpkiticons-tag"></span><span class="screen-reader-text">' . esc_html__( 'Tags', 'wphelpkit' ) . '</span>' . wp_kses_post( $tags_list ) . '</span>' ; 119 119 } 120 120 edit_post_link( esc_html__( 'Edit', 'wphelpkit' ) . '<span class="screen-reader-text"> ' . get_the_title() . '</span>', '<span class="edit-link">', '</span>' ); -
wphelpkit/trunk/wphelpkit.php
r3034118 r3035661 3 3 /* 4 4 * Plugin Name: WPHelpKit 5 * Description: Documentation and Knowledge Base — Publish, organize and manage Help Articles for your software product.6 * Version: 1. 25 * Description: Documentation and Knowledge Base — Organize, publish, and manage help articles for your SaaS or software product. 6 * Version: 1.3 7 7 * Author: WPHelpKit 8 8 * Plugin URI: https://wphelpkit.com … … 103 103 * @var string 104 104 */ 105 const VERSION = '1. 2' ;105 const VERSION = '1.3' ; 106 106 /** 107 107 * Transient name to set when we are activated. … … 164 164 add_action( 'init', array( $this, 'maybe_create_helpkit_page' ), PHP_INT_MAX ); 165 165 add_filter( 166 'block_categories ',166 'block_categories_all', 167 167 array( $this, 'block_categories' ), 168 168 10,
Note: See TracChangeset
for help on using the changeset viewer.