Plugin Directory

Changeset 3321472


Ignore:
Timestamp:
07/02/2025 10:35:40 PM (5 months ago)
Author:
majick
Message:

0.9.7 trunk commit

Location:
guten-free-options/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • guten-free-options/trunk/guten-free-options.php

    r3316103 r3321472  
    55Author: Tony Hayes
    66Description: Gutenberg Free Options for your WordPressed Burger err I mean Editor
    7 Version: 0.9.6
     7Version: 0.9.7
    88Author URI: https://wpmedic.tech
    99GitHub Plugin URI: majick777/guten-free-options
     
    384384// ----------------------
    385385// [unused] - via Classic Editor plugin
    386 function gfo_add_edit_links($actions, $post) {
     386function gfo_add_edit_links( $actions, $post ) {
    387387
    388388    // This is in Gutenberg now.
     
    461461
    462462    // --- output the switch editor button on the editor page ---
     463    // 0.9.7: add missing escaping to style/class outputs
    463464    echo '<div id="gutenberg-editor-button-wrapper">' . "\n";
    464465        echo '<a href="' . esc_url( $button['url'] ) . '">' . "\n";
    465466            echo '<div id="' . esc_attr( $button['id'] ) . '" class="' . esc_attr( $button['class'] ) . '" title="' . esc_attr( $button['title'] ) . '"';
    466467            if ( !empty( $button['styles'] ) ) {
    467                 echo ' style="' . $button['styles'] . '"';
     468                echo ' style="' . esc_attr( $button['styles'] ) . '"';
    468469            }
    469470            echo '>' . "\n";
    470                 echo '<span class="'.$button['icon_class'].'"';
     471                echo '<span class="' . esc_attr( $button['icon_class'] ) . '"';
    471472                if ( !empty( $button['icon_style'] ) ) {
    472                     echo ' style="' . $button['icon_style'] . '"';
     473                    echo ' style="' . esc_attr( $button['icon_style'] ) . '"';
    473474                }
    474475                echo '></span>' . "\n";
     
    680681    $disable_widget_blocks = false;
    681682    $widget_blocks = gfo_get_setting( 'widget_blocks', false );
    682    
     683
     684    // 0.9.7: fix mismatched text domains
    683685    echo '<div class="message">' . "\n";
    684         echo '<b>' . esc_html( __( 'Guten Free Options', 'bioship' ) ) . '</b>: ';
     686        echo '<b>' . esc_html( __( 'Guten Free Options', 'guten-free-options' ) ) . '</b>: ';
    685687        if ( 'off' == $widget_blocks ) {
    686             echo esc_html( __( 'The use of the Block Editor has been disabled for Widgets.', 'bioship' ) );
     688            echo esc_html( __( 'The use of the Block Editor has been disabled for Widgets.', 'guten-free-options' ) );
    687689        } elseif ( ( '' == $widget_blocks ) || ( 'auto' == $widget_blocks ) ) {
    688             echo esc_html( __( 'No Widgets contain blocks. Auto mode has disabled the Block Editor for Widgets.', 'bioship' ) );
     690            echo esc_html( __( 'No Widgets contain blocks. Auto mode has disabled the Block Editor for Widgets.', 'guten-free-options' ) );
    689691        }
    690692        // 0.9.6: link to settings at options-general.php not admin.php
     
    12431245    // --- update network default editor setting ---
    12441246    if ( isset( $_POST['gfo_network_default_editor'] ) ) {
    1245         $default_editor = sanitize_text_field( $_POST['gfo_network_default_editor'] );
     1247        $default_editor = sanitize_text_field( wp_unslash( $_POST['gfo_network_default_editor'] ) );
    12461248        $valid = array( 'classic', 'block' );
    12471249        if ( in_array( $default_editor, $valid ) ) {
     
    12991301    if ( isset( $_GET['updated'] ) ) {
    13001302        echo '<tr><td></td><td></td><td>' . "\n";
    1301         if ( 'yes' == sanitize_text_field( $_GET['updated'] ) ) {
     1303        if ( 'yes' == sanitize_text_field( wp_unslash( $_GET['updated'] ) ) ) {
    13021304            $message = esc_html( $settings['title'] ) . ' ';
    13031305            if ( $network ) {
     
    22332235    if ( has_filter( 'replace_editor', 'gutenberg_init' )
    22342236      || has_filter( 'load-post.php', 'gutenberg_intercept_edit_post' )
    2235       || has_filter( 'load-post-new.php', 'gutenberg_intercept_post_new') ) {
     2237      || has_filter( 'load-post-new.php', 'gutenberg_intercept_post_new' ) ) {
    22362238        return 'plugin';
    22372239    }
     
    22582260        if ( 'yes' == gfo_get_setting( 'check_blocks' ) ) {
    22592261            $protocol = 'http';
    2260             if ( isset($_SERVER['HTTPS'] ) && ( 'off' !== $_SERVER['HTTPS'] ) ) {
     2262            if ( isset( $_SERVER['HTTPS'] ) && ( 'off' !== $_SERVER['HTTPS'] ) ) {
    22612263                $protocol = 'https';
    22622264            }
     
    23422344        // use querystring or set to post for post-new.php if not specified and on that page
    23432345        if ( isset( $_GET['post_type'] ) ) {
    2344             $post_type = sanitize_text_field( $_GET['post_type'] );
     2346            $post_type = sanitize_text_field( wp_unslash( $_GET['post_type'] ) );
    23452347        } elseif ( gfo_is_gutenberg_admin_url( array( 'post-new.php' ) ) ) {
    23462348            $post_type = 'post';
     
    23782380    if ( !$locked ) {
    23792381        if ( isset( $_GET['editor'] ) ) {
    2380             if ( 'block' == $_GET['editor'] ) {
     2382            if ( 'block' == sanitize_text_field( wp_unslash( $_GET['editor'] ) ) ) {
    23812383                $gutenfree['last'] = 'querystring';
    23822384                return true;
    2383             } elseif ( 'classic' == $_GET['editor'] ) {
     2385            } elseif ( 'classic' == sanitize_text_field( wp_unslash( $_GET['editor'] ) ) ) {
    23842386                $gutenfree['last'] = 'querystring';
    23852387                return false;
     
    26252627    // --- check for editor querystrings (manual user override) ---
    26262628    if ( isset( $_GET['editor'] ) ) {
    2627         if ( 'block' == $_GET['editor'] ) {
     2629        if ( 'block' == sanitize_text_field( wp_unslash( $_GET['editor'] ) ) ) {
    26282630            $gutenfree['last'] = 'querystring';
    26292631            return true;
    2630         } elseif ( 'classic' == $_GET['editor'] ) {
     2632        } elseif ( 'classic' == sanitize_text_field( wp_unslash( $_GET['editor'] ) ) ) {
    26312633            $gutenfree['last'] = 'querystring';
    26322634            return false;
     
    27462748        $can_edit = false;
    27472749        $gutenfree['last'] = 'meta';
    2748         gfo_debug_log('Post ' . $post_id . ' Meta Other -> Classic' );
     2750        gfo_debug_log( 'Post ' . $post_id . ' Meta Other -> Classic' );
    27492751    }
    27502752
     
    31053107
    31063108        // 0.9.6: removed unused and undefined onchange variable
    3107         echo '<td><span class="editor-override-label">' . __( 'Editor','guten-free-options' ) . '</span></td>';
     3109        // 0.9.7: adding missing escaping on editor label
     3110        echo '<td><span class="editor-override-label">' . esc_html( __( 'Editor','guten-free-options' ) ) . '</span></td>';
    31083111        echo '<td><select name="editor_override" id="editor_override">';
    31093112        foreach ( $options as $option => $label ) {
     
    31183121        // --- set a help icon with title for the setting ---
    31193122        $posttypeobject = get_post_type_object( get_post_type($post->ID ) );
    3120         $title = __( 'Set the Editor for this', 'guten-free-options' ) . " " . $posttypeobject->labels->singular_name;
     3123        $title = __( 'Set the Editor for this', 'guten-free-options' ) . ' ' . $posttypeobject->labels->singular_name;
    31213124        echo '<td><span id="editor-override-help" class="dashicons dashicons-editor-help" title="' . esc_attr( $title ) . '"></span></td>';
    31223125
     
    31873190    }
    31883191    if ( isset( $_POST['editor_override'] ) ) {
    3189         $override = sanitize_text_field( $_POST['editor_override'] );
     3192        $override = sanitize_text_field( wp_unslash( $_POST['editor_override'] ) );
    31903193        $options = array(
    31913194            ''          => __( 'Do Not Override', 'guten-free-options' ),
     
    32703273        $referer = sanitize_text_field( wp_unslash( $_POST['_wp_http_referer'] ) );
    32713274        if ( false !== strpos( $referer, '&classic-editor' ) ) {
    3272             $location = add_query_arg('classic-editor', '', $location);
     3275            $location = add_query_arg( 'classic-editor', '', $location );
    32733276        }
    32743277        if ( false !== strpos( $referer, '&editor=classic' ) ) {
    3275             $location = add_query_arg('editor', 'classic', $location );
     3278            $location = add_query_arg( 'editor', 'classic', $location );
    32763279        }
    32773280        // not sure if will ever really be needed... but let us add the other way around just in case!
     
    33193322function gfo_get_post_name_only( $post_id ) {
    33203323    global $wpdb;
    3321     $query = "SELECT post_name FROM ".$wpdb->prefix."posts WHERE ID = '%d'";
     3324    $query = "SELECT post_name FROM " . $wpdb->prefix . "posts WHERE ID = '%d'";
    33223325    $query = $wpdb->prepare( $query, $post_id );
    33233326    $result = $wpdb->get_var( $query );
     
    33353338    global $wpdb;
    33363339    // 0.9.6: remove unnecessary quotes around integer value
    3337     $query = "SELECT post_content FROM ".$wpdb->prefix."posts WHERE ID = %d";
     3340    $query = "SELECT post_content FROM " . $wpdb->prefix . "posts WHERE ID = %d";
    33383341    // 0.9.2: fix to use post_id not id
    33393342    $query = $wpdb->prepare( $query, $post_id );
     
    33523355        return true;
    33533356    }
    3354     $active_plugins = (array)get_option( 'active_plugins' );
     3357    $active_plugins = (array) get_option( 'active_plugins' );
    33553358    if ( in_array( 'gutenberg/gutenberg.php', $active_plugins ) ) {
    33563359        $active = true;
  • guten-free-options/trunk/readme.md

    r3316103 r3321472  
    1010Requires at least: 4.9.0
    1111Tested up to: 6.8.1
    12 Stable tag: 0.9.6
     12Stable tag: 0.9.7
    1313
    14 Gutenberg Free Options for your WordPressed Burger err I mean Editor
     14Gutenberg Free Options for your WordPressed Burger err I mean Editor.
    1515
    1616== Description ==
    1717
    1818Want to use and/or not use the new Block Editor (Gutenberg) according to *your needs*?
     19
     20Guten Free Options provides this for your WordPressed Burger err I mean Editor.
    1921
    2022Guten Free Options allows you to smoothly transition your writing experience to WordPress 5+ by giving you full control over when a post should be edited with the Classic Editor or Block Editor... plus have a button to easily switch between them like other page builders.
     
    7375
    7476== Changelog ==
     77
     78= 0.9.7 =
     79* Fixed: extra sanitization and escaping
    7580
    7681= 0.9.6 =
  • guten-free-options/trunk/readme.txt

    r3316103 r3321472  
    1010Requires at least: 4.9.0
    1111Tested up to: 6.8.1
    12 Stable tag: 0.9.6
     12Stable tag: 0.9.7
    1313
    1414Gutenberg Free Options for your WordPressed Burger err I mean Editor.
     
    7676== Changelog ==
    7777
     78= 0.9.7 =
     79* Fixed: extra sanitization and escaping
     80
    7881= 0.9.6 =
    7982* Updated: WordQuest Helper (1.8.3)
Note: See TracChangeset for help on using the changeset viewer.