Plugin Directory

Changeset 3035661


Ignore:
Timestamp:
02/14/2024 12:58:35 PM (2 years ago)
Author:
wphelpkit
Message:

Update to version 1.3 from GitHub

Location:
wphelpkit
Files:
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wphelpkit/tags/1.3/README.txt

    r3034118 r3035661  
    33Contributors: wphelpkit
    44Tags: WPHelpKit, knowledge base, documentation, faqs, support, docs, help center, wiki
    5 Stable tag: 1.2
     5Stable tag: 1.3
    66Requires at least: 6.0
    77Tested up to: 6.4
     
    5353== Changelog ==
    5454
     55= 1.3 =
     56* Fix: Address some issues requested by the WordPress team
     57
    5558= 1.2 =
    5659* Fix: Address some issues requested by the WordPress team
  • wphelpkit/tags/1.3/includes/class-wphelpkit-customizer.php

    r3028651 r3035661  
    9393        check_ajax_referer(self::$get_archive_page_permalink_action . '-nonce', 'nonce');
    9494
    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));
    9696
    9797        exit;
  • wphelpkit/tags/1.3/includes/class-wphelpkit-settings.php

    r3034118 r3035661  
    540540
    541541        add_settings_field(
    542             'wphelpkit-hidden-permalink-field',
     542            'wphelpkit_permalink_custom_settings',
    543543            '',
    544             array( $this, 'output_hidden_text_settings_permalink_field' ),
     544            array( $this, 'output_wphelpkit_permalink_custom_settings' ),
    545545            'permalink',
    546             'wphelpkit-slugs',
    547             array( 'option' => 'wphelpkit_hidden_permalink_field' )
     546            'wphelpkit-slugs'
    548547        );
    549548
     
    595594    }
    596595
    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');
    605599        return;
    606600    }
     
    731725    public function save_settings()
    732726    {
    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        {
    735737            return;
    736738        }
     
    740742            $data = array_map( 'sanitize_text_field', $_POST[ self::$option_name ] );
    741743
    742             if (isset($_POST['wphelpkit_settings_nonce'])) {
     744            if ( isset($_POST['wphelpkit_settings_nonce']) && wp_verify_nonce($_POST['wphelpkit_settings_nonce'], 'wphelpkit_settings_action') ) {
    743745                $data['search_in_category'] = $this->sanitize_checkbox_option($_POST[ self::$option_name ]['search_in_category'] || false);
    744746                $data['category_index_tree'] = $this->sanitize_checkbox_option($_POST[ self::$option_name ]['category_index_tree'] || false);
     
    746748            }
    747749
    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') ) {
    749751                $product_base = isset( $data['article_permalink_structure'] ) ? $this->clean_permalink( wp_unslash( $data['article_permalink_structure'] ) ) : '';
    750752                $data['article_permalink_structure'] = $this->sanitize_permalink_option( $product_base );
  • wphelpkit/tags/1.3/includes/data-model/class-wphelpkit-article.php

    r3034118 r3035661  
    288288       
    289289        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'] ) ) );
    291291        } elseif ( $post ) {
    292292            $current_post = $post;
  • wphelpkit/tags/1.3/includes/template-tags.php

    r3034118 r3035661  
    327327function wphelpkit_related_articles( $post = null )
    328328{
    329     echo  wphelpkit_get_related_articles( $post ) ;
     329    echo  wp_kses_post( wphelpkit_get_related_articles( $post ) ) ;
    330330    return;
    331331}
     
    370370    $_attrs = trim( $_attrs );
    371371    $shortcode = sprintf( '[%s %s]', WPHelpKit_Article::$article_archive_shortcode, $_attrs );
    372     return do_shortcode( $shortcode );
     372    return do_shortcode( wp_kses_post( $shortcode ) );
    373373}
    374374
     
    394394{
    395395    echo  wphelpkit_get_archive( $attrs ) ;
     396    //escaped in the function: return do_shortcode(wp_kses_post($shortcode));
    396397    return;
    397398}
     
    474475    $_attrs = trim( $_attrs );
    475476    $shortcode = sprintf( '[%s %s]', WPHelpKit_Article_Tag::$tag_archive_shortcode, $_attrs );
    476     return do_shortcode( $shortcode );
     477    return do_shortcode( wp_kses_post( $shortcode ) );
    477478}
    478479
     
    512513{
    513514    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  
    2525        </div>
    2626        <?php if (have_posts()) : ?>
    27             <h1 class='page-title'><?php printf(esc_html__('Search Results for &ldquo;%s&rdquo;', 'wphelpkit'), '<span>' . get_search_query() . '</span>'); ?></h1>
     27            <h1 class='page-title'><?php printf(esc_html__('Search Results for &ldquo;%s&rdquo;', 'wphelpkit'), '<span>' . esc_attr( get_search_query() ) . '</span>'); ?></h1>
    2828        <?php else : ?>
    2929            <h1 class='page-title'><?php esc_html_e('Nothing Found', 'wphelpkit') ?></h1>
     
    6363                    }
    6464                    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));
    6666                    }
    6767                    ?>
     
    7272            </ul>
    7373    <?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() ) );
    7575else : ?>
    7676            <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  
    116116);
    117117if ( $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>' ;
    119119}
    120120edit_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  
    33/*
    44 * Plugin Name: WPHelpKit
    5  * Description: Documentation and Knowledge Base — Publish, organize and manage Help Articles for your software product.
    6  * Version: 1.2
     5 * Description: Documentation and Knowledge Base — Organize, publish, and manage help articles for your SaaS or software product.
     6 * Version: 1.3
    77 * Author: WPHelpKit
    88 * Plugin URI: https://wphelpkit.com
     
    103103             * @var string
    104104             */
    105             const  VERSION = '1.2' ;
     105            const  VERSION = '1.3' ;
    106106            /**
    107107             * Transient name to set when we are activated.
     
    164164                add_action( 'init', array( $this, 'maybe_create_helpkit_page' ), PHP_INT_MAX );
    165165                add_filter(
    166                     'block_categories',
     166                    'block_categories_all',
    167167                    array( $this, 'block_categories' ),
    168168                    10,
  • wphelpkit/trunk/README.txt

    r3034118 r3035661  
    33Contributors: wphelpkit
    44Tags: WPHelpKit, knowledge base, documentation, faqs, support, docs, help center, wiki
    5 Stable tag: 1.2
     5Stable tag: 1.3
    66Requires at least: 6.0
    77Tested up to: 6.4
     
    5353== Changelog ==
    5454
     55= 1.3 =
     56* Fix: Address some issues requested by the WordPress team
     57
    5558= 1.2 =
    5659* Fix: Address some issues requested by the WordPress team
  • wphelpkit/trunk/includes/class-wphelpkit-customizer.php

    r3028651 r3035661  
    9393        check_ajax_referer(self::$get_archive_page_permalink_action . '-nonce', 'nonce');
    9494
    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));
    9696
    9797        exit;
  • wphelpkit/trunk/includes/class-wphelpkit-settings.php

    r3034118 r3035661  
    540540
    541541        add_settings_field(
    542             'wphelpkit-hidden-permalink-field',
     542            'wphelpkit_permalink_custom_settings',
    543543            '',
    544             array( $this, 'output_hidden_text_settings_permalink_field' ),
     544            array( $this, 'output_wphelpkit_permalink_custom_settings' ),
    545545            'permalink',
    546             'wphelpkit-slugs',
    547             array( 'option' => 'wphelpkit_hidden_permalink_field' )
     546            'wphelpkit-slugs'
    548547        );
    549548
     
    595594    }
    596595
    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');
    605599        return;
    606600    }
     
    731725    public function save_settings()
    732726    {
    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        {
    735737            return;
    736738        }
     
    740742            $data = array_map( 'sanitize_text_field', $_POST[ self::$option_name ] );
    741743
    742             if (isset($_POST['wphelpkit_settings_nonce'])) {
     744            if ( isset($_POST['wphelpkit_settings_nonce']) && wp_verify_nonce($_POST['wphelpkit_settings_nonce'], 'wphelpkit_settings_action') ) {
    743745                $data['search_in_category'] = $this->sanitize_checkbox_option($_POST[ self::$option_name ]['search_in_category'] || false);
    744746                $data['category_index_tree'] = $this->sanitize_checkbox_option($_POST[ self::$option_name ]['category_index_tree'] || false);
     
    746748            }
    747749
    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') ) {
    749751                $product_base = isset( $data['article_permalink_structure'] ) ? $this->clean_permalink( wp_unslash( $data['article_permalink_structure'] ) ) : '';
    750752                $data['article_permalink_structure'] = $this->sanitize_permalink_option( $product_base );
  • wphelpkit/trunk/includes/data-model/class-wphelpkit-article.php

    r3034118 r3035661  
    288288       
    289289        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'] ) ) );
    291291        } elseif ( $post ) {
    292292            $current_post = $post;
  • wphelpkit/trunk/includes/template-tags.php

    r3034118 r3035661  
    327327function wphelpkit_related_articles( $post = null )
    328328{
    329     echo  wphelpkit_get_related_articles( $post ) ;
     329    echo  wp_kses_post( wphelpkit_get_related_articles( $post ) ) ;
    330330    return;
    331331}
     
    370370    $_attrs = trim( $_attrs );
    371371    $shortcode = sprintf( '[%s %s]', WPHelpKit_Article::$article_archive_shortcode, $_attrs );
    372     return do_shortcode( $shortcode );
     372    return do_shortcode( wp_kses_post( $shortcode ) );
    373373}
    374374
     
    394394{
    395395    echo  wphelpkit_get_archive( $attrs ) ;
     396    //escaped in the function: return do_shortcode(wp_kses_post($shortcode));
    396397    return;
    397398}
     
    474475    $_attrs = trim( $_attrs );
    475476    $shortcode = sprintf( '[%s %s]', WPHelpKit_Article_Tag::$tag_archive_shortcode, $_attrs );
    476     return do_shortcode( $shortcode );
     477    return do_shortcode( wp_kses_post( $shortcode ) );
    477478}
    478479
     
    512513{
    513514    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  
    2525        </div>
    2626        <?php if (have_posts()) : ?>
    27             <h1 class='page-title'><?php printf(esc_html__('Search Results for &ldquo;%s&rdquo;', 'wphelpkit'), '<span>' . get_search_query() . '</span>'); ?></h1>
     27            <h1 class='page-title'><?php printf(esc_html__('Search Results for &ldquo;%s&rdquo;', 'wphelpkit'), '<span>' . esc_attr( get_search_query() ) . '</span>'); ?></h1>
    2828        <?php else : ?>
    2929            <h1 class='page-title'><?php esc_html_e('Nothing Found', 'wphelpkit') ?></h1>
     
    6363                    }
    6464                    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));
    6666                    }
    6767                    ?>
     
    7272            </ul>
    7373    <?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() ) );
    7575else : ?>
    7676            <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  
    116116);
    117117if ( $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>' ;
    119119}
    120120edit_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  
    33/*
    44 * Plugin Name: WPHelpKit
    5  * Description: Documentation and Knowledge Base — Publish, organize and manage Help Articles for your software product.
    6  * Version: 1.2
     5 * Description: Documentation and Knowledge Base — Organize, publish, and manage help articles for your SaaS or software product.
     6 * Version: 1.3
    77 * Author: WPHelpKit
    88 * Plugin URI: https://wphelpkit.com
     
    103103             * @var string
    104104             */
    105             const  VERSION = '1.2' ;
     105            const  VERSION = '1.3' ;
    106106            /**
    107107             * Transient name to set when we are activated.
     
    164164                add_action( 'init', array( $this, 'maybe_create_helpkit_page' ), PHP_INT_MAX );
    165165                add_filter(
    166                     'block_categories',
     166                    'block_categories_all',
    167167                    array( $this, 'block_categories' ),
    168168                    10,
Note: See TracChangeset for help on using the changeset viewer.