Plugin Directory

Changeset 3114628


Ignore:
Timestamp:
07/09/2024 02:09:54 AM (20 months ago)
Author:
kevindees
Message:

tagging version 4.0

Location:
fitvids-for-wordpress
Files:
4 edited
4 copied

Legend:

Unmodified
Added
Removed
  • fitvids-for-wordpress/tags/4.0.0/admin.php

    r2089277 r3114628  
    2424                    <input id="fitvids_wp_selector"
    2525                           placeholder="body"
    26                            value="<?php echo esc_attr( get_option('fitvids_wp_selector', 'body') ); ?>"
     26                           value="<?php echo esc_attr(get_option('fitvids_wp_selector', 'body') ); ?>"
    2727                           name="fitvids_wp_selector"
    2828                           type="text"
     
    7171                               name="fitvids_wp_jq"
    7272                               type="checkbox"
    73                             <?php $this->print_cdn_field_checked(); ?>
     73                               <?php $this->print_cdn_field_checked(); ?>
    7474                        >
    75                         My theme is missing jQuery. Add jQuery 3.4.1 from Google CDN.
     75                        My theme is missing jQuery. Add jQuery 3.7.1 from Google CDN.
    7676                    </label>
    7777                </td>
  • fitvids-for-wordpress/tags/4.0.0/fitvids-for-wordpress.php

    r2805249 r3114628  
    55Description: This plugin makes videos responsive using the FitVids jQuery plugin on WordPress.
    66Version: 3.0.13
     7Requires at least: 6.5
     8Requires PHP: 8.2
    79Tags: videos, fitvids, responsive
    810Author: Kevin Dees
     
    1921    public $path = null;
    2022    public $message = '';
    21     public $request = array();
     23    public $request = [];
    2224    public $activating = false;
    23     public $jquery_version = '3.4.1';
     25    public $jquery_version = '3.7.1';
    2426    public $transient = 'fitvids-admin-notice';
    2527    public $id = 'fitvids-wp';
     
    2931        $this->path = plugin_dir_path(__FILE__);
    3032        $this->setup_request();
    31         register_activation_hook( __FILE__, array($this, 'activation') );
    32         add_action('admin_notices',  array($this, 'activation_notice') );
    33         add_action('admin_menu', array($this, 'menu') );
    34         add_action('wp_enqueue_scripts', array($this, 'scripts') );
     33        register_activation_hook( __FILE__, [$this, 'activation'] );
     34        add_action('admin_notices',  [$this, 'activation_notice'] );
     35        add_action('admin_menu', [$this, 'menu'] );
     36        add_action('wp_enqueue_scripts', [$this, 'scripts'] );
    3537    }
    3638
    37     public function activation()
     39    public function activation(): void
    3840    {
    3941        $this->activating = true;
     
    4143    }
    4244
    43     public function activation_notice()
     45    public function activation_notice(): void
    4446    {
    4547        if( get_transient( $this->transient ) && ! $this->activating ) {
     
    5355    }
    5456
    55     function menu()
    56     {
    57         $page = add_submenu_page('themes.php', 'FitVids for WordPress', 'FitVids', 'switch_themes', $this->id, array($this, 'settings_page'));
    58         add_action('load-' . $page, array($this, 'help_tab') );
     57    function menu(): void
     58    {
     59        $page = add_submenu_page('themes.php', 'FitVids for WordPress', 'FitVids', 'switch_themes', $this->id, [$this, 'settings_page']);
     60        add_action('load-' . $page, [$this, 'help_tab'] );
    5961    }
    6062
    61     public function settings_page()
    62     {
     63    public function settings_page(): void
     64    {
    6365        $post = $this->request['post'];
    6466
     
    7880    }
    7981
    80     public function help_tab()
     82    public function help_tab(): void
    8183    {
    8284        $screen = get_current_screen();
    83         $screen->add_help_tab( array(
    84             'id' => $this->id,
    85             'title' => 'Using FitVids',
    86             'content' => '',
    87             'callback' => array( $this, 'help_content')
    88         ) );
     85        $screen->add_help_tab( ['id' => $this->id, 'title' => 'Using FitVids', 'content' => '', 'callback' => [$this, 'help_content']] );
    8986    }
    9087
    91     public function help_content() {
     88    public function help_content(): void
     89    {
    9290        require( $this->path . '/help.php' );
    9391    }
    9492
    95     public function scripts()
     93    public function scripts(): void
    9694    {
    9795        if ( get_option('fitvids_wp_jq') == 'true') {
    9896            $v = $this->jquery_version;
    9997            wp_deregister_script('jquery');
    100             wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/'.$v.'/jquery.min.js', array(), $v );
     98            wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/'.$v.'/jquery.min.js', [], $v );
    10199            wp_enqueue_script('jquery');
    102100        }
    103101
    104         wp_register_script('fitvids', plugins_url('/jquery.fitvids.js', __FILE__), array('jquery'), '1.1', true);
     102        wp_register_script('fitvids', plugins_url('/jquery.fitvids.js', __FILE__), ['jquery'], '1.1', true);
    105103        wp_enqueue_script('fitvids');
    106         add_action('wp_print_footer_scripts', array($this, 'generate_inline_js') );
     104        add_action('wp_print_footer_scripts', [$this, 'generate_inline_js'] );
    107105    }
    108106
    109     public function generate_inline_js()
     107    public function generate_inline_js(): void
    110108    {
    111109        $selector = get_option('fitvids_wp_selector');
    112110        $ignore = $this->prepare_field( get_option('fitvids_wp_ignore_selector') );
    113111        $custom = $this->prepare_field( get_option('fitvids_wp_custom_selector') );
    114         $selector = $this->prepare_field( $selector ? $selector : 'body' );
    115         $options = array();
     112        $selector = $this->prepare_field( $selector ?: 'body' );
     113        $options = [];
    116114        $settings = '';
    117115
     
    135133    }
    136134
    137     public function prepare_field( $value, $sanitize = true )
     135    public function prepare_field( $value, $sanitize = true ): string
    138136    {
    139137        if($value) {
    140             $value = trim( $value );
     138            $value = trim( (string) $value );
    141139
    142140            if($sanitize) {
    143                 $sanitized = wp_strip_all_tags( preg_replace('/"/', "'", $value), array() );
     141                $sanitized = wp_strip_all_tags( preg_replace('/"/', "'", $value), [] );
    144142                return $sanitized;
    145143            }
     
    149147    }
    150148
    151     public function setup_request()
     149    public function setup_request(): void
    152150    {
    153         $this->request['post'] = ! empty($_POST) ? array_map('wp_unslash', $_POST ) : array();
    154         $this->request['get'] = ! empty($_GET) ? array_map('wp_unslash', $_GET ) : array();
     151        $this->request['post'] = ! empty($_POST) ? array_map('wp_unslash', $_POST ) : [];
     152        $this->request['get'] = ! empty($_GET) ? array_map('wp_unslash', $_GET ) : [];
    155153        $this->request['uri'] = $_SERVER['REQUEST_URI'];
    156154    }
    157155
    158     public function print_cdn_field_checked()
     156    public function print_cdn_field_checked(): void
    159157    {
    160158        if (get_option('fitvids_wp_jq') == 'true') {
     
    163161    }
    164162
    165     public function save_option( $field )
     163    public function save_option( $field ): void
    166164    {
    167165        if( !empty($this->request['post'][$field]) ) {
  • fitvids-for-wordpress/tags/4.0.0/readme.txt

    r2805249 r3114628  
    22Contributors: kevindees
    33Tags: videos, fitvids, responsive
    4 Requires at least: 3.9
    5 Tested up to: 6.1
    6 Stable Tag: 3.0.13
     4Requires at least: 6.5
     5Requires PHP: 8.2
     6Tested up to: 6.6
     7Stable Tag: 4.0.0
    78
    89This plugin makes videos responsive using the FitVids jQuery plugin on WordPress.
     
    2526
    2627== Changelog ==
     28
     29= 4.0.0 =
     30
     31* Update plugin to require PHP 8.2.
     32* Update jQuery to version 3.7.1 from 3.4.1.
    2733
    2834= 3.0.13 =
  • fitvids-for-wordpress/trunk/admin.php

    r2089277 r3114628  
    2424                    <input id="fitvids_wp_selector"
    2525                           placeholder="body"
    26                            value="<?php echo esc_attr( get_option('fitvids_wp_selector', 'body') ); ?>"
     26                           value="<?php echo esc_attr(get_option('fitvids_wp_selector', 'body') ); ?>"
    2727                           name="fitvids_wp_selector"
    2828                           type="text"
     
    7171                               name="fitvids_wp_jq"
    7272                               type="checkbox"
    73                             <?php $this->print_cdn_field_checked(); ?>
     73                               <?php $this->print_cdn_field_checked(); ?>
    7474                        >
    75                         My theme is missing jQuery. Add jQuery 3.4.1 from Google CDN.
     75                        My theme is missing jQuery. Add jQuery 3.7.1 from Google CDN.
    7676                    </label>
    7777                </td>
  • fitvids-for-wordpress/trunk/fitvids-for-wordpress.php

    r2805249 r3114628  
    55Description: This plugin makes videos responsive using the FitVids jQuery plugin on WordPress.
    66Version: 3.0.13
     7Requires at least: 6.5
     8Requires PHP: 8.2
    79Tags: videos, fitvids, responsive
    810Author: Kevin Dees
     
    1921    public $path = null;
    2022    public $message = '';
    21     public $request = array();
     23    public $request = [];
    2224    public $activating = false;
    23     public $jquery_version = '3.4.1';
     25    public $jquery_version = '3.7.1';
    2426    public $transient = 'fitvids-admin-notice';
    2527    public $id = 'fitvids-wp';
     
    2931        $this->path = plugin_dir_path(__FILE__);
    3032        $this->setup_request();
    31         register_activation_hook( __FILE__, array($this, 'activation') );
    32         add_action('admin_notices',  array($this, 'activation_notice') );
    33         add_action('admin_menu', array($this, 'menu') );
    34         add_action('wp_enqueue_scripts', array($this, 'scripts') );
     33        register_activation_hook( __FILE__, [$this, 'activation'] );
     34        add_action('admin_notices',  [$this, 'activation_notice'] );
     35        add_action('admin_menu', [$this, 'menu'] );
     36        add_action('wp_enqueue_scripts', [$this, 'scripts'] );
    3537    }
    3638
    37     public function activation()
     39    public function activation(): void
    3840    {
    3941        $this->activating = true;
     
    4143    }
    4244
    43     public function activation_notice()
     45    public function activation_notice(): void
    4446    {
    4547        if( get_transient( $this->transient ) && ! $this->activating ) {
     
    5355    }
    5456
    55     function menu()
    56     {
    57         $page = add_submenu_page('themes.php', 'FitVids for WordPress', 'FitVids', 'switch_themes', $this->id, array($this, 'settings_page'));
    58         add_action('load-' . $page, array($this, 'help_tab') );
     57    function menu(): void
     58    {
     59        $page = add_submenu_page('themes.php', 'FitVids for WordPress', 'FitVids', 'switch_themes', $this->id, [$this, 'settings_page']);
     60        add_action('load-' . $page, [$this, 'help_tab'] );
    5961    }
    6062
    61     public function settings_page()
    62     {
     63    public function settings_page(): void
     64    {
    6365        $post = $this->request['post'];
    6466
     
    7880    }
    7981
    80     public function help_tab()
     82    public function help_tab(): void
    8183    {
    8284        $screen = get_current_screen();
    83         $screen->add_help_tab( array(
    84             'id' => $this->id,
    85             'title' => 'Using FitVids',
    86             'content' => '',
    87             'callback' => array( $this, 'help_content')
    88         ) );
     85        $screen->add_help_tab( ['id' => $this->id, 'title' => 'Using FitVids', 'content' => '', 'callback' => [$this, 'help_content']] );
    8986    }
    9087
    91     public function help_content() {
     88    public function help_content(): void
     89    {
    9290        require( $this->path . '/help.php' );
    9391    }
    9492
    95     public function scripts()
     93    public function scripts(): void
    9694    {
    9795        if ( get_option('fitvids_wp_jq') == 'true') {
    9896            $v = $this->jquery_version;
    9997            wp_deregister_script('jquery');
    100             wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/'.$v.'/jquery.min.js', array(), $v );
     98            wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/'.$v.'/jquery.min.js', [], $v );
    10199            wp_enqueue_script('jquery');
    102100        }
    103101
    104         wp_register_script('fitvids', plugins_url('/jquery.fitvids.js', __FILE__), array('jquery'), '1.1', true);
     102        wp_register_script('fitvids', plugins_url('/jquery.fitvids.js', __FILE__), ['jquery'], '1.1', true);
    105103        wp_enqueue_script('fitvids');
    106         add_action('wp_print_footer_scripts', array($this, 'generate_inline_js') );
     104        add_action('wp_print_footer_scripts', [$this, 'generate_inline_js'] );
    107105    }
    108106
    109     public function generate_inline_js()
     107    public function generate_inline_js(): void
    110108    {
    111109        $selector = get_option('fitvids_wp_selector');
    112110        $ignore = $this->prepare_field( get_option('fitvids_wp_ignore_selector') );
    113111        $custom = $this->prepare_field( get_option('fitvids_wp_custom_selector') );
    114         $selector = $this->prepare_field( $selector ? $selector : 'body' );
    115         $options = array();
     112        $selector = $this->prepare_field( $selector ?: 'body' );
     113        $options = [];
    116114        $settings = '';
    117115
     
    135133    }
    136134
    137     public function prepare_field( $value, $sanitize = true )
     135    public function prepare_field( $value, $sanitize = true ): string
    138136    {
    139137        if($value) {
    140             $value = trim( $value );
     138            $value = trim( (string) $value );
    141139
    142140            if($sanitize) {
    143                 $sanitized = wp_strip_all_tags( preg_replace('/"/', "'", $value), array() );
     141                $sanitized = wp_strip_all_tags( preg_replace('/"/', "'", $value), [] );
    144142                return $sanitized;
    145143            }
     
    149147    }
    150148
    151     public function setup_request()
     149    public function setup_request(): void
    152150    {
    153         $this->request['post'] = ! empty($_POST) ? array_map('wp_unslash', $_POST ) : array();
    154         $this->request['get'] = ! empty($_GET) ? array_map('wp_unslash', $_GET ) : array();
     151        $this->request['post'] = ! empty($_POST) ? array_map('wp_unslash', $_POST ) : [];
     152        $this->request['get'] = ! empty($_GET) ? array_map('wp_unslash', $_GET ) : [];
    155153        $this->request['uri'] = $_SERVER['REQUEST_URI'];
    156154    }
    157155
    158     public function print_cdn_field_checked()
     156    public function print_cdn_field_checked(): void
    159157    {
    160158        if (get_option('fitvids_wp_jq') == 'true') {
     
    163161    }
    164162
    165     public function save_option( $field )
     163    public function save_option( $field ): void
    166164    {
    167165        if( !empty($this->request['post'][$field]) ) {
  • fitvids-for-wordpress/trunk/readme.txt

    r2805249 r3114628  
    22Contributors: kevindees
    33Tags: videos, fitvids, responsive
    4 Requires at least: 3.9
    5 Tested up to: 6.1
    6 Stable Tag: 3.0.13
     4Requires at least: 6.5
     5Requires PHP: 8.2
     6Tested up to: 6.6
     7Stable Tag: 4.0.0
    78
    89This plugin makes videos responsive using the FitVids jQuery plugin on WordPress.
     
    2526
    2627== Changelog ==
     28
     29= 4.0.0 =
     30
     31* Update plugin to require PHP 8.2.
     32* Update jQuery to version 3.7.1 from 3.4.1.
    2733
    2834= 3.0.13 =
Note: See TracChangeset for help on using the changeset viewer.