Plugin Directory

Changeset 3189525


Ignore:
Timestamp:
11/15/2024 12:11:32 PM (17 months ago)
Author:
srumery
Message:

Update to version 2.2.0 from GitHub

Location:
simple-side-tab
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • simple-side-tab/tags/2.2.0/admin/class-simple-side-tab-admin.php

    r2857412 r3189525  
    120120    public function settings_api_init() {
    121121
    122         register_setting( 'rum_sst_option_group', 'rum_sst_plugin_options' );
     122        register_setting(
     123            'rum_sst_option_group',
     124            'rum_sst_plugin_options',
     125            [
     126                'sanitize_callback' => [ $this, 'sanitize_plugin_options' ]
     127            ]
     128        );
    123129    }
    124130
     
    176182    }
    177183
     184
     185
     186
     187    /**
     188     * Sanitize the plugin options.
     189     *
     190     * @param array $input The unsanitized options input.
     191     * @return array The sanitized options.
     192     */
     193    public function sanitize_plugin_options( $input ) {
     194        $sanitized = [];
     195
     196        $valid_fonts = [
     197            'Arial, sans-serif',
     198            'Georgia, serif',
     199            '"Helvetica Neue", Helvetica, sans-serif',
     200            '"Lucida Sans Unicode", "Lucida Grande", sans-serif',
     201            'Tahoma, sans-serif',
     202            '"Trebuchet MS", sans-serif',
     203            'Verdana, sans-serif'
     204        ];
     205
     206        $valid_positions = [ 'left', 'right' ];
     207
     208        if ( isset( $input['text_for_tab'] ) ) {
     209            $sanitized['text_for_tab'] = sanitize_text_field( $input['text_for_tab'] );
     210        }
     211
     212        if ( isset( $input['tab_url'] ) ) {
     213            $sanitized['tab_url'] = sanitize_url( $input['tab_url'] );
     214        }
     215
     216        if ( isset( $input['font_family'] ) && in_array( $input['font_family'], $valid_fonts, true ) ) {
     217            $sanitized['font_family'] = $input['font_family'];
     218        } else {
     219            $sanitized['font_family'] = 'Arial, sans-serif';
     220        }
     221
     222        if ( isset( $input['font_weight_bold'] ) && $input['font_weight_bold'] === '1' ) {
     223            $sanitized['font_weight_bold'] = '1';
     224        }
     225
     226        if ( isset( $input['text_shadow'] ) && $input['text_shadow'] === '1' ) {
     227            $sanitized['text_shadow'] = '1';
     228        }
     229
     230        if ( isset( $input['target_blank'] ) && $input['target_blank'] === '1' ) {
     231            $sanitized['target_blank'] = '1';
     232        }
     233
     234        if ( isset( $input['left_right'] ) && in_array( $input['left_right'], $valid_positions, true ) ) {
     235            $sanitized['left_right'] = $input['left_right'];
     236        } else {
     237            $sanitized['left_right'] = 'left';
     238        }
     239
     240        if ( isset( $input['pixels_from_top'] ) && is_numeric( $input['pixels_from_top'] ) && absint( $input['pixels_from_top'] ) > 0 ) {
     241            $sanitized['pixels_from_top'] = absint( $input['pixels_from_top'] );
     242        } else {
     243            $sanitized['pixels_from_top'] = 350;
     244        }
     245
     246        if ( isset( $input['text_color'] ) ) {
     247            $sanitized['text_color'] = sanitize_hex_color( $input['text_color'] );
     248            if ( ! $sanitized['text_color'] ) {
     249                $sanitized['text_color'] = '#ffffff';
     250            }
     251        } else {
     252            $sanitized['text_color'] = '#ffffff';
     253        }
     254
     255        if ( isset( $input['tab_color'] ) ) {
     256            $sanitized['tab_color'] = sanitize_hex_color( $input['tab_color'] );
     257            if ( ! $sanitized['tab_color'] ) {
     258                $sanitized['tab_color'] = '#a0244e';
     259            }
     260        } else {
     261            $sanitized['tab_color'] = '#a0244e';
     262        }
     263
     264        if ( isset( $input['hover_color'] ) ) {
     265            $sanitized['hover_color'] = sanitize_hex_color( $input['hover_color'] );
     266            if ( ! $sanitized['hover_color'] ) {
     267                $sanitized['hover_color'] = '#a4a4a4';
     268            }
     269        } else {
     270            $sanitized['hover_color'] = '#a4a4a4';
     271        }
     272
     273        return $sanitized;
     274    }
    178275}
  • simple-side-tab/tags/2.2.0/public/partials/dynamic-css.php

    r2483076 r3189525  
    1515/* START Styles Simple Side Tab v<?php echo SIMPLE_SIDE_TAB_VERSION ?> */
    1616#rum_sst_tab {
    17     font-family:<?php echo $this->settings->font_family; ?>;
    18     top:<?php echo $this->settings->pixels_from_top; ?>px;
    19     background-color:<?php echo $this->settings->tab_color; ?>;
    20     color:<?php echo $this->settings->text_color; ?>;
    21     border-style:solid;
    22     border-width:0px;
     17    font-family: <?php echo esc_attr( $this->settings->font_family ); ?>;
     18    top: <?php echo esc_attr( intval( $this->settings->pixels_from_top ) ); ?>px;
     19    background-color: <?php echo esc_attr( $this->settings->tab_color ); ?>;
     20    color: <?php echo esc_attr( $this->settings->text_color ); ?>;
     21    border-style: solid;
     22    border-width: 0px;
    2323}
    2424
    2525#rum_sst_tab:hover {
    26     background-color: <?php echo $this->settings->hover_color; ?>;
     26    background-color: <?php echo esc_attr( $this->settings->hover_color ); ?>;
    2727<?php
    2828    if ( $this->settings->text_shadow ) {
  • simple-side-tab/tags/2.2.0/readme.txt

    r3118676 r3189525  
    33Tags: tab, side tab, navigation, call to action, page link
    44Requires at least: 6.0
    5 Tested up to: 6.6
    6 Stable tag: 2.1.14
     5Tested up to: 6.7
     6Stable tag: 2.2.0
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    8080
    8181== Changelog ==
     82
     83= 2.2.0 =
     84* Tested up to: 6.7
     85* Updated register_setting()
    8286
    8387= 2.1.14 =
  • simple-side-tab/tags/2.2.0/simple_side_tab.php

    r3118676 r3189525  
    44 * Plugin URI:        https://rumspeed.com/wordpress-plugins/simple-side-tab/
    55 * Description:       Display a side tab that you can easily link to any page. Customize the tab text, font and colors. It's that simple. That's Simple Side Tab.
    6  * Version:           2.1.14
     6 * Version:           2.2.0
    77 * Requires at least: 6.0
    88 * Requires PHP:      7.4
     
    4747 * Plugin constants.
    4848 */
    49 define( 'SIMPLE_SIDE_TAB_VERSION', '2.1.14' );
     49define( 'SIMPLE_SIDE_TAB_VERSION', '2.2.0' );
    5050define( 'SIMPLE_SIDE_TAB_DIR', dirname( __FILE__ ) );
    5151define( 'SIMPLE_SIDE_TAB_URI', plugins_url( '' , __FILE__ ) );
  • simple-side-tab/trunk/admin/class-simple-side-tab-admin.php

    r2857412 r3189525  
    120120    public function settings_api_init() {
    121121
    122         register_setting( 'rum_sst_option_group', 'rum_sst_plugin_options' );
     122        register_setting(
     123            'rum_sst_option_group',
     124            'rum_sst_plugin_options',
     125            [
     126                'sanitize_callback' => [ $this, 'sanitize_plugin_options' ]
     127            ]
     128        );
    123129    }
    124130
     
    176182    }
    177183
     184
     185
     186
     187    /**
     188     * Sanitize the plugin options.
     189     *
     190     * @param array $input The unsanitized options input.
     191     * @return array The sanitized options.
     192     */
     193    public function sanitize_plugin_options( $input ) {
     194        $sanitized = [];
     195
     196        $valid_fonts = [
     197            'Arial, sans-serif',
     198            'Georgia, serif',
     199            '"Helvetica Neue", Helvetica, sans-serif',
     200            '"Lucida Sans Unicode", "Lucida Grande", sans-serif',
     201            'Tahoma, sans-serif',
     202            '"Trebuchet MS", sans-serif',
     203            'Verdana, sans-serif'
     204        ];
     205
     206        $valid_positions = [ 'left', 'right' ];
     207
     208        if ( isset( $input['text_for_tab'] ) ) {
     209            $sanitized['text_for_tab'] = sanitize_text_field( $input['text_for_tab'] );
     210        }
     211
     212        if ( isset( $input['tab_url'] ) ) {
     213            $sanitized['tab_url'] = sanitize_url( $input['tab_url'] );
     214        }
     215
     216        if ( isset( $input['font_family'] ) && in_array( $input['font_family'], $valid_fonts, true ) ) {
     217            $sanitized['font_family'] = $input['font_family'];
     218        } else {
     219            $sanitized['font_family'] = 'Arial, sans-serif';
     220        }
     221
     222        if ( isset( $input['font_weight_bold'] ) && $input['font_weight_bold'] === '1' ) {
     223            $sanitized['font_weight_bold'] = '1';
     224        }
     225
     226        if ( isset( $input['text_shadow'] ) && $input['text_shadow'] === '1' ) {
     227            $sanitized['text_shadow'] = '1';
     228        }
     229
     230        if ( isset( $input['target_blank'] ) && $input['target_blank'] === '1' ) {
     231            $sanitized['target_blank'] = '1';
     232        }
     233
     234        if ( isset( $input['left_right'] ) && in_array( $input['left_right'], $valid_positions, true ) ) {
     235            $sanitized['left_right'] = $input['left_right'];
     236        } else {
     237            $sanitized['left_right'] = 'left';
     238        }
     239
     240        if ( isset( $input['pixels_from_top'] ) && is_numeric( $input['pixels_from_top'] ) && absint( $input['pixels_from_top'] ) > 0 ) {
     241            $sanitized['pixels_from_top'] = absint( $input['pixels_from_top'] );
     242        } else {
     243            $sanitized['pixels_from_top'] = 350;
     244        }
     245
     246        if ( isset( $input['text_color'] ) ) {
     247            $sanitized['text_color'] = sanitize_hex_color( $input['text_color'] );
     248            if ( ! $sanitized['text_color'] ) {
     249                $sanitized['text_color'] = '#ffffff';
     250            }
     251        } else {
     252            $sanitized['text_color'] = '#ffffff';
     253        }
     254
     255        if ( isset( $input['tab_color'] ) ) {
     256            $sanitized['tab_color'] = sanitize_hex_color( $input['tab_color'] );
     257            if ( ! $sanitized['tab_color'] ) {
     258                $sanitized['tab_color'] = '#a0244e';
     259            }
     260        } else {
     261            $sanitized['tab_color'] = '#a0244e';
     262        }
     263
     264        if ( isset( $input['hover_color'] ) ) {
     265            $sanitized['hover_color'] = sanitize_hex_color( $input['hover_color'] );
     266            if ( ! $sanitized['hover_color'] ) {
     267                $sanitized['hover_color'] = '#a4a4a4';
     268            }
     269        } else {
     270            $sanitized['hover_color'] = '#a4a4a4';
     271        }
     272
     273        return $sanitized;
     274    }
    178275}
  • simple-side-tab/trunk/public/partials/dynamic-css.php

    r2483076 r3189525  
    1515/* START Styles Simple Side Tab v<?php echo SIMPLE_SIDE_TAB_VERSION ?> */
    1616#rum_sst_tab {
    17     font-family:<?php echo $this->settings->font_family; ?>;
    18     top:<?php echo $this->settings->pixels_from_top; ?>px;
    19     background-color:<?php echo $this->settings->tab_color; ?>;
    20     color:<?php echo $this->settings->text_color; ?>;
    21     border-style:solid;
    22     border-width:0px;
     17    font-family: <?php echo esc_attr( $this->settings->font_family ); ?>;
     18    top: <?php echo esc_attr( intval( $this->settings->pixels_from_top ) ); ?>px;
     19    background-color: <?php echo esc_attr( $this->settings->tab_color ); ?>;
     20    color: <?php echo esc_attr( $this->settings->text_color ); ?>;
     21    border-style: solid;
     22    border-width: 0px;
    2323}
    2424
    2525#rum_sst_tab:hover {
    26     background-color: <?php echo $this->settings->hover_color; ?>;
     26    background-color: <?php echo esc_attr( $this->settings->hover_color ); ?>;
    2727<?php
    2828    if ( $this->settings->text_shadow ) {
  • simple-side-tab/trunk/readme.txt

    r3118676 r3189525  
    33Tags: tab, side tab, navigation, call to action, page link
    44Requires at least: 6.0
    5 Tested up to: 6.6
    6 Stable tag: 2.1.14
     5Tested up to: 6.7
     6Stable tag: 2.2.0
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    8080
    8181== Changelog ==
     82
     83= 2.2.0 =
     84* Tested up to: 6.7
     85* Updated register_setting()
    8286
    8387= 2.1.14 =
  • simple-side-tab/trunk/simple_side_tab.php

    r3118676 r3189525  
    44 * Plugin URI:        https://rumspeed.com/wordpress-plugins/simple-side-tab/
    55 * Description:       Display a side tab that you can easily link to any page. Customize the tab text, font and colors. It's that simple. That's Simple Side Tab.
    6  * Version:           2.1.14
     6 * Version:           2.2.0
    77 * Requires at least: 6.0
    88 * Requires PHP:      7.4
     
    4747 * Plugin constants.
    4848 */
    49 define( 'SIMPLE_SIDE_TAB_VERSION', '2.1.14' );
     49define( 'SIMPLE_SIDE_TAB_VERSION', '2.2.0' );
    5050define( 'SIMPLE_SIDE_TAB_DIR', dirname( __FILE__ ) );
    5151define( 'SIMPLE_SIDE_TAB_URI', plugins_url( '' , __FILE__ ) );
Note: See TracChangeset for help on using the changeset viewer.