Plugin Directory

Changeset 3156633


Ignore:
Timestamp:
09/24/2024 06:46:09 AM (19 months ago)
Author:
wearerequired
Message:

Update to version 3.0.1 from GitHub

Location:
wp-widget-disable
Files:
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wp-widget-disable/tags/3.0.1/CHANGELOG.md

    r2887107 r3156633  
    55and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
    66
     7### [3.0.1] - 2024-09-19
     8
     9* Enhancement: Code cleanup, ensuring WordPress 6.6 compatibility.
     10
    711### [3.0.0] - 2022-03-17
     12
    813* Fixed: Replace use of jQuery to avoid deprecation warnings.
    914* Changed: Requires at least PHP 7.4 and WordPress 6.0.
  • wp-widget-disable/tags/3.0.1/classes/class-wp-widget-disable.php

    r2695407 r3156633  
    88 */
    99class WP_Widget_Disable {
    10     /**
    11      * Plugin version.
    12      */
    13     const VERSION = '2.1.0';
    1410
    1511    /**
     
    5652     * Adds hooks.
    5753     */
    58     public function add_hooks() {
     54    public function add_hooks(): void {
    5955        add_action( 'init', [ $this, 'load_textdomain' ] );
    6056
     
    9086     * @return string The URL to the plugin directory.
    9187     */
    92     protected function get_url() {
     88    protected function get_url(): string {
    9389        return plugin_dir_url( __DIR__ );
    9490    }
     
    9995     * @return string The absolute path to the plugin directory.
    10096     */
    101     protected function get_path() {
     97    protected function get_path(): string {
    10298        return plugin_dir_path( __DIR__ );
    10399    }
     
    110106     * @return string The plugin basename.
    111107     */
    112     protected function get_basename() {
     108    protected function get_basename(): string {
    113109        return plugin_basename( $this->get_path() . 'wp-widget-disable.php' );
    114110    }
     
    117113     * Initializes the plugin, registers textdomain, etc.
    118114     */
    119     public function load_textdomain() {
     115    public function load_textdomain(): void {
    120116        load_plugin_textdomain( 'wp-widget-disable' );
    121117    }
     
    126122     * @since 1.0.0
    127123     */
    128     public function admin_menu() {
     124    public function admin_menu(): void {
    129125        if ( is_network_admin() ) {
    130126            $this->page_hook = add_submenu_page(
     
    156152     * @since 2.0.0
    157153     */
    158     public function settings_page_load_callback() {
     154    public function settings_page_load_callback(): void {
    159155        $key = md5( $_SERVER['HTTP_USER_AGENT'] );
    160156        add_filter( 'pre_site_transient_browser_' . $key, '__return_null' );
     
    171167     * @since 1.6.0
    172168     */
    173     public function settings_page_callback() {
     169    public function settings_page_callback(): void {
    174170        include trailingslashit( $this->get_path() ) . 'views/admin.php';
    175171    }
     
    180176     * @since 1.7.0
    181177     */
    182     public function settings_errors() {
     178    public function settings_errors(): void {
    183179        settings_errors( 'wp-widget-disable' );
    184180    }
     
    191187     * @return bool True if settings errors exist, false if not.
    192188     */
    193     public function has_settings_errors() {
     189    public function has_settings_errors(): bool {
    194190        return count( get_settings_errors( 'wp-widget-disable' ) ) > 0;
    195191    }
     
    204200     * @since 1.9.0
    205201     */
    206     public function save_network_options() {
     202    public function save_network_options(): void {
    207203        $data = [];
    208204
     
    239235     * @since 1.0.0
    240236     *
    241      * @param array $links Plugin action links.
    242      * @return array
    243      */
    244     public function plugin_action_links( array $links ) {
     237     * @param mixed[] $links Plugin action links.
     238     * @return mixed[]
     239     */
     240    public function plugin_action_links( array $links ): array {
    245241        $settings_url = add_query_arg(
    246242            [ 'page' => 'wp-widget-disable' ],
     
    270266     * Set the default sidebar widgets.
    271267     */
    272     public function set_default_sidebar_widgets() {
     268    public function set_default_sidebar_widgets(): void {
    273269        $widgets = [];
    274270
     
    288284     * Get the default dashboard widgets.
    289285     *
    290      * @return array Sidebar widgets.
    291      */
    292     protected function get_default_dashboard_widgets() {
     286     * @return mixed[] Sidebar widgets.
     287     */
     288    protected function get_default_dashboard_widgets(): array {
    293289        global $wp_meta_boxes;
    294290
     
    342338     * @since 1.0.0
    343339     */
    344     public function disable_sidebar_widgets() {
     340    public function disable_sidebar_widgets(): void {
    345341        $widgets = (array) get_option( $this->sidebar_widgets_option, [] );
    346342        if ( ! empty( $widgets ) ) {
     
    356352     * @since 2.0.0
    357353     *
    358      * @return array List of disabled widget IDs.
    359      */
    360     protected function get_disabled_dashboard_widgets() {
     354     * @return mixed[] List of disabled widget IDs.
     355     */
     356    protected function get_disabled_dashboard_widgets(): array {
    361357        $widgets = (array) get_option( $this->dashboard_widgets_option, [] );
    362358
     
    376372     * @since 2.0.0
    377373     */
    378     public function disable_dashboard_widgets_with_remote_requests() {
     374    public function disable_dashboard_widgets_with_remote_requests(): void {
    379375        $widgets = $this->get_disabled_dashboard_widgets();
    380376
     
    408404     * @since 1.0.0
    409405     */
    410     public function disable_dashboard_widgets() {
     406    public function disable_dashboard_widgets(): void {
    411407        $widgets = $this->get_disabled_dashboard_widgets();
    412408
     
    443439     * @since 1.0.0
    444440     *
    445      * @param array $input Sidebar widgets to disable.
    446      * @return array
    447      */
    448     public function sanitize_sidebar_widgets( $input ) {
     441     * @param mixed[] $input Sidebar widgets to disable.
     442     * @return mixed[]
     443     */
     444    public function sanitize_sidebar_widgets( ?array $input ): array { // phpcs:ignore Squiz.Commenting.FunctionComment.IncorrectTypeHint -- mixed is not a valid type hint in PHP 7.4.
    449445        // If there are settings errors the input was already sanitized.
    450446        // See https://core.trac.wordpress.org/ticket/21989.
     
    503499     * @since 1.0.0
    504500     *
    505      * @param array $input Dashboards widgets to disable.
    506      * @return array
    507      */
    508     public function sanitize_dashboard_widgets( $input ) {
     501     * @param mixed[] $input Dashboards widgets to disable.
     502     * @return mixed[]
     503     */
     504    public function sanitize_dashboard_widgets( ?array $input ): array { // phpcs:ignore Squiz.Commenting.FunctionComment.IncorrectTypeHint -- mixed is not a valid type hint in PHP 7.4.
    509505        // If there are settings errors the input was already sanitized.
    510506        // See https://core.trac.wordpress.org/ticket/21989.
     
    563559     * @since 1.0.0
    564560     */
    565     public function register_settings() {
     561    public function register_settings(): void {
    566562        register_setting(
    567563            $this->sidebar_widgets_option,
     
    573569            'widget_disable_widget_section',
    574570            __( 'Disable Sidebar Widgets', 'wp-widget-disable' ),
    575             function () {
     571            function (): void {
    576572                echo '<p>';
    577573                _e( 'Choose the sidebar widgets you would like to disable. Note that developers can still display widgets using PHP.', 'wp-widget-disable' );
     
    598594            'widget_disable_dashboard_section',
    599595            __( 'Disable Dashboard Widgets', 'wp-widget-disable' ),
    600             function () {
     596            function (): void {
    601597                echo '<p>';
    602598                _e( 'Choose the dashboard widgets you would like to disable.', 'wp-widget-disable' );
     
    620616     * @since 1.0.0
    621617     */
    622     public function render_sidebar_checkboxes() {
     618    public function render_sidebar_checkboxes(): void {
    623619        $widgets = $this->sidebar_widgets;
    624620
     
    668664     * @since 1.0.0
    669665     */
    670     public function render_dashboard_checkboxes() {
     666    public function render_dashboard_checkboxes(): void {
    671667        $widgets = $this->get_default_dashboard_widgets();
    672668
     
    801797    /**
    802798     * Check if block editor is enabled for widgets.
    803      *
    804      * @return bool
    805      */
    806     public function use_widgets_block_editor() {
     799     */
     800    public function use_widgets_block_editor(): bool {
    807801        if ( function_exists( 'wp_use_widgets_block_editor' ) ) {
    808802            return wp_use_widgets_block_editor();
     
    814808     * Get list of widgets to hide from legacy widget block.
    815809     *
    816      * @return array
    817      */
    818     public function get_widgets_to_hide_from_legacy_widget_block() {
     810     * @return mixed[]
     811     */
     812    public function get_widgets_to_hide_from_legacy_widget_block(): array {
    819813        if ( function_exists( 'get_legacy_widget_block_editor_settings' ) ) {
    820814            return get_legacy_widget_block_editor_settings()['widgetTypesToHideFromLegacyWidgetBlock'];
  • wp-widget-disable/tags/3.0.1/vendor/autoload.php

    r2887107 r3156633  
    2323require_once __DIR__ . '/composer/autoload_real.php';
    2424
    25 return ComposerAutoloaderInitfc830ce5553f798caa2f884b466c6301::getLoader();
     25return ComposerAutoloaderInitd093fc0356bf5ad255baf9551c055d9d::getLoader();
  • wp-widget-disable/tags/3.0.1/vendor/composer/ClassLoader.php

    r2887107 r3156633  
    4646    private static $includeFile;
    4747
    48     /** @var ?string */
     48    /** @var string|null */
    4949    private $vendorDir;
    5050
    5151    // PSR-4
    5252    /**
    53      * @var array[]
    54      * @psalm-var array<string, array<string, int>>
     53     * @var array<string, array<string, int>>
    5554     */
    5655    private $prefixLengthsPsr4 = array();
    5756    /**
    58      * @var array[]
    59      * @psalm-var array<string, array<int, string>>
     57     * @var array<string, list<string>>
    6058     */
    6159    private $prefixDirsPsr4 = array();
    6260    /**
    63      * @var array[]
    64      * @psalm-var array<string, string>
     61     * @var list<string>
    6562     */
    6663    private $fallbackDirsPsr4 = array();
     
    6865    // PSR-0
    6966    /**
    70      * @var array[]
    71      * @psalm-var array<string, array<string, string[]>>
     67     * List of PSR-0 prefixes
     68     *
     69     * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
     70     *
     71     * @var array<string, array<string, list<string>>>
    7272     */
    7373    private $prefixesPsr0 = array();
    7474    /**
    75      * @var array[]
    76      * @psalm-var array<string, string>
     75     * @var list<string>
    7776     */
    7877    private $fallbackDirsPsr0 = array();
     
    8281
    8382    /**
    84      * @var string[]
    85      * @psalm-var array<string, string>
     83     * @var array<string, string>
    8684     */
    8785    private $classMap = array();
     
    9189
    9290    /**
    93      * @var bool[]
    94      * @psalm-var array<string, bool>
     91     * @var array<string, bool>
    9592     */
    9693    private $missingClasses = array();
    9794
    98     /** @var ?string */
     95    /** @var string|null */
    9996    private $apcuPrefix;
    10097
    10198    /**
    102      * @var self[]
     99     * @var array<string, self>
    103100     */
    104101    private static $registeredLoaders = array();
    105102
    106103    /**
    107      * @param ?string $vendorDir
     104     * @param string|null $vendorDir
    108105     */
    109106    public function __construct($vendorDir = null)
     
    114111
    115112    /**
    116      * @return string[]
     113     * @return array<string, list<string>>
    117114     */
    118115    public function getPrefixes()
     
    126123
    127124    /**
    128      * @return array[]
    129      * @psalm-return array<string, array<int, string>>
     125     * @return array<string, list<string>>
    130126     */
    131127    public function getPrefixesPsr4()
     
    135131
    136132    /**
    137      * @return array[]
    138      * @psalm-return array<string, string>
     133     * @return list<string>
    139134     */
    140135    public function getFallbackDirs()
     
    144139
    145140    /**
    146      * @return array[]
    147      * @psalm-return array<string, string>
     141     * @return list<string>
    148142     */
    149143    public function getFallbackDirsPsr4()
     
    153147
    154148    /**
    155      * @return string[] Array of classname => path
    156      * @psalm-return array<string, string>
     149     * @return array<string, string> Array of classname => path
    157150     */
    158151    public function getClassMap()
     
    162155
    163156    /**
    164      * @param string[] $classMap Class to filename map
    165      * @psalm-param array<string, string> $classMap
     157     * @param array<string, string> $classMap Class to filename map
    166158     *
    167159     * @return void
     
    180172     * appending or prepending to the ones previously set for this prefix.
    181173     *
    182      * @param string          $prefix  The prefix
    183      * @param string[]|string $paths   The PSR-0 root directories
    184      * @param bool            $prepend Whether to prepend the directories
     174     * @param string              $prefix  The prefix
     175     * @param list<string>|string $paths   The PSR-0 root directories
     176     * @param bool                $prepend Whether to prepend the directories
    185177     *
    186178     * @return void
     
    188180    public function add($prefix, $paths, $prepend = false)
    189181    {
     182        $paths = (array) $paths;
    190183        if (!$prefix) {
    191184            if ($prepend) {
    192185                $this->fallbackDirsPsr0 = array_merge(
    193                     (array) $paths,
     186                    $paths,
    194187                    $this->fallbackDirsPsr0
    195188                );
     
    197190                $this->fallbackDirsPsr0 = array_merge(
    198191                    $this->fallbackDirsPsr0,
    199                     (array) $paths
     192                    $paths
    200193                );
    201194            }
     
    206199        $first = $prefix[0];
    207200        if (!isset($this->prefixesPsr0[$first][$prefix])) {
    208             $this->prefixesPsr0[$first][$prefix] = (array) $paths;
     201            $this->prefixesPsr0[$first][$prefix] = $paths;
    209202
    210203            return;
     
    212205        if ($prepend) {
    213206            $this->prefixesPsr0[$first][$prefix] = array_merge(
    214                 (array) $paths,
     207                $paths,
    215208                $this->prefixesPsr0[$first][$prefix]
    216209            );
     
    218211            $this->prefixesPsr0[$first][$prefix] = array_merge(
    219212                $this->prefixesPsr0[$first][$prefix],
    220                 (array) $paths
     213                $paths
    221214            );
    222215        }
     
    227220     * appending or prepending to the ones previously set for this namespace.
    228221     *
    229      * @param string          $prefix  The prefix/namespace, with trailing '\\'
    230      * @param string[]|string $paths   The PSR-4 base directories
    231      * @param bool            $prepend Whether to prepend the directories
     222     * @param string              $prefix  The prefix/namespace, with trailing '\\'
     223     * @param list<string>|string $paths   The PSR-4 base directories
     224     * @param bool                $prepend Whether to prepend the directories
    232225     *
    233226     * @throws \InvalidArgumentException
     
    237230    public function addPsr4($prefix, $paths, $prepend = false)
    238231    {
     232        $paths = (array) $paths;
    239233        if (!$prefix) {
    240234            // Register directories for the root namespace.
    241235            if ($prepend) {
    242236                $this->fallbackDirsPsr4 = array_merge(
    243                     (array) $paths,
     237                    $paths,
    244238                    $this->fallbackDirsPsr4
    245239                );
     
    247241                $this->fallbackDirsPsr4 = array_merge(
    248242                    $this->fallbackDirsPsr4,
    249                     (array) $paths
     243                    $paths
    250244                );
    251245            }
     
    257251            }
    258252            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
    259             $this->prefixDirsPsr4[$prefix] = (array) $paths;
     253            $this->prefixDirsPsr4[$prefix] = $paths;
    260254        } elseif ($prepend) {
    261255            // Prepend directories for an already registered namespace.
    262256            $this->prefixDirsPsr4[$prefix] = array_merge(
    263                 (array) $paths,
     257                $paths,
    264258                $this->prefixDirsPsr4[$prefix]
    265259            );
     
    268262            $this->prefixDirsPsr4[$prefix] = array_merge(
    269263                $this->prefixDirsPsr4[$prefix],
    270                 (array) $paths
     264                $paths
    271265            );
    272266        }
     
    277271     * replacing any others previously set for this prefix.
    278272     *
    279      * @param string          $prefix The prefix
    280      * @param string[]|string $paths  The PSR-0 base directories
     273     * @param string              $prefix The prefix
     274     * @param list<string>|string $paths  The PSR-0 base directories
    281275     *
    282276     * @return void
     
    295289     * replacing any others previously set for this namespace.
    296290     *
    297      * @param string          $prefix The prefix/namespace, with trailing '\\'
    298      * @param string[]|string $paths  The PSR-4 base directories
     291     * @param string              $prefix The prefix/namespace, with trailing '\\'
     292     * @param list<string>|string $paths  The PSR-4 base directories
    299293     *
    300294     * @throws \InvalidArgumentException
     
    482476
    483477    /**
    484      * Returns the currently registered loaders indexed by their corresponding vendor directories.
    485      *
    486      * @return self[]
     478     * Returns the currently registered loaders keyed by their corresponding vendor directories.
     479     *
     480     * @return array<string, self>
    487481     */
    488482    public static function getRegisteredLoaders()
  • wp-widget-disable/tags/3.0.1/vendor/composer/autoload_real.php

    r2887107 r3156633  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInitfc830ce5553f798caa2f884b466c6301
     5class ComposerAutoloaderInitd093fc0356bf5ad255baf9551c055d9d
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInitfc830ce5553f798caa2f884b466c6301', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInitd093fc0356bf5ad255baf9551c055d9d', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInitfc830ce5553f798caa2f884b466c6301', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInitd093fc0356bf5ad255baf9551c055d9d', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInitfc830ce5553f798caa2f884b466c6301::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInitd093fc0356bf5ad255baf9551c055d9d::getInitializer($loader));
    3333
    3434        $loader->register(true);
  • wp-widget-disable/tags/3.0.1/vendor/composer/autoload_static.php

    r2887107 r3156633  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInitfc830ce5553f798caa2f884b466c6301
     7class ComposerStaticInitd093fc0356bf5ad255baf9551c055d9d
    88{
    99    public static $classMap = array (
     
    1515    {
    1616        return \Closure::bind(function () use ($loader) {
    17             $loader->classMap = ComposerStaticInitfc830ce5553f798caa2f884b466c6301::$classMap;
     17            $loader->classMap = ComposerStaticInitd093fc0356bf5ad255baf9551c055d9d::$classMap;
    1818
    1919        }, null, ClassLoader::class);
  • wp-widget-disable/tags/3.0.1/vendor/composer/installed.php

    r2887107 r3156633  
    22    'root' => array(
    33        'name' => 'wearerequired/wp-widget-disable',
    4         'pretty_version' => '3.0.0',
    5         'version' => '3.0.0.0',
    6         'reference' => '7b52c2f91b9b31427dbc784cba00965c6e62c7e8',
     4        'pretty_version' => '3.0.1',
     5        'version' => '3.0.1.0',
     6        'reference' => 'c32dc018f5c85882198aa9351d8798fe01f8a41a',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    2121        ),
    2222        'wearerequired/wp-widget-disable' => array(
    23             'pretty_version' => '3.0.0',
    24             'version' => '3.0.0.0',
    25             'reference' => '7b52c2f91b9b31427dbc784cba00965c6e62c7e8',
     23            'pretty_version' => '3.0.1',
     24            'version' => '3.0.1.0',
     25            'reference' => 'c32dc018f5c85882198aa9351d8798fe01f8a41a',
    2626            'type' => 'wordpress-plugin',
    2727            'install_path' => __DIR__ . '/../../',
  • wp-widget-disable/tags/3.0.1/wp-widget-disable.php

    r2887107 r3156633  
    44 * Plugin URI:        https://required.com/services/wordpress-plugins/wp-widget-disable/
    55 * Description:       Disable sidebar and dashboard widgets with an easy to use interface. Simply use the checkboxes provided under <strong>Appearance -> Disable Widgets</strong> and select the widgets you'd like to hide.
    6  * Version:           3.0.0
     6 * Version:           3.0.1
    77 * Requires at least: 6.0
    88 * Requires PHP:      7.4
     
    1212 * Text Domain:       wp-widget-disable
    1313 *
    14  * Copyright (c) 2015-2023 required (email: support@required.ch)
     14 * Copyright (c) 2015-2024 required (email: support@required.ch)
    1515 *
    1616 * This program is free software; you can redistribute it and/or modify
  • wp-widget-disable/trunk/CHANGELOG.md

    r2887107 r3156633  
    55and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
    66
     7### [3.0.1] - 2024-09-19
     8
     9* Enhancement: Code cleanup, ensuring WordPress 6.6 compatibility.
     10
    711### [3.0.0] - 2022-03-17
     12
    813* Fixed: Replace use of jQuery to avoid deprecation warnings.
    914* Changed: Requires at least PHP 7.4 and WordPress 6.0.
  • wp-widget-disable/trunk/classes/class-wp-widget-disable.php

    r2695407 r3156633  
    88 */
    99class WP_Widget_Disable {
    10     /**
    11      * Plugin version.
    12      */
    13     const VERSION = '2.1.0';
    1410
    1511    /**
     
    5652     * Adds hooks.
    5753     */
    58     public function add_hooks() {
     54    public function add_hooks(): void {
    5955        add_action( 'init', [ $this, 'load_textdomain' ] );
    6056
     
    9086     * @return string The URL to the plugin directory.
    9187     */
    92     protected function get_url() {
     88    protected function get_url(): string {
    9389        return plugin_dir_url( __DIR__ );
    9490    }
     
    9995     * @return string The absolute path to the plugin directory.
    10096     */
    101     protected function get_path() {
     97    protected function get_path(): string {
    10298        return plugin_dir_path( __DIR__ );
    10399    }
     
    110106     * @return string The plugin basename.
    111107     */
    112     protected function get_basename() {
     108    protected function get_basename(): string {
    113109        return plugin_basename( $this->get_path() . 'wp-widget-disable.php' );
    114110    }
     
    117113     * Initializes the plugin, registers textdomain, etc.
    118114     */
    119     public function load_textdomain() {
     115    public function load_textdomain(): void {
    120116        load_plugin_textdomain( 'wp-widget-disable' );
    121117    }
     
    126122     * @since 1.0.0
    127123     */
    128     public function admin_menu() {
     124    public function admin_menu(): void {
    129125        if ( is_network_admin() ) {
    130126            $this->page_hook = add_submenu_page(
     
    156152     * @since 2.0.0
    157153     */
    158     public function settings_page_load_callback() {
     154    public function settings_page_load_callback(): void {
    159155        $key = md5( $_SERVER['HTTP_USER_AGENT'] );
    160156        add_filter( 'pre_site_transient_browser_' . $key, '__return_null' );
     
    171167     * @since 1.6.0
    172168     */
    173     public function settings_page_callback() {
     169    public function settings_page_callback(): void {
    174170        include trailingslashit( $this->get_path() ) . 'views/admin.php';
    175171    }
     
    180176     * @since 1.7.0
    181177     */
    182     public function settings_errors() {
     178    public function settings_errors(): void {
    183179        settings_errors( 'wp-widget-disable' );
    184180    }
     
    191187     * @return bool True if settings errors exist, false if not.
    192188     */
    193     public function has_settings_errors() {
     189    public function has_settings_errors(): bool {
    194190        return count( get_settings_errors( 'wp-widget-disable' ) ) > 0;
    195191    }
     
    204200     * @since 1.9.0
    205201     */
    206     public function save_network_options() {
     202    public function save_network_options(): void {
    207203        $data = [];
    208204
     
    239235     * @since 1.0.0
    240236     *
    241      * @param array $links Plugin action links.
    242      * @return array
    243      */
    244     public function plugin_action_links( array $links ) {
     237     * @param mixed[] $links Plugin action links.
     238     * @return mixed[]
     239     */
     240    public function plugin_action_links( array $links ): array {
    245241        $settings_url = add_query_arg(
    246242            [ 'page' => 'wp-widget-disable' ],
     
    270266     * Set the default sidebar widgets.
    271267     */
    272     public function set_default_sidebar_widgets() {
     268    public function set_default_sidebar_widgets(): void {
    273269        $widgets = [];
    274270
     
    288284     * Get the default dashboard widgets.
    289285     *
    290      * @return array Sidebar widgets.
    291      */
    292     protected function get_default_dashboard_widgets() {
     286     * @return mixed[] Sidebar widgets.
     287     */
     288    protected function get_default_dashboard_widgets(): array {
    293289        global $wp_meta_boxes;
    294290
     
    342338     * @since 1.0.0
    343339     */
    344     public function disable_sidebar_widgets() {
     340    public function disable_sidebar_widgets(): void {
    345341        $widgets = (array) get_option( $this->sidebar_widgets_option, [] );
    346342        if ( ! empty( $widgets ) ) {
     
    356352     * @since 2.0.0
    357353     *
    358      * @return array List of disabled widget IDs.
    359      */
    360     protected function get_disabled_dashboard_widgets() {
     354     * @return mixed[] List of disabled widget IDs.
     355     */
     356    protected function get_disabled_dashboard_widgets(): array {
    361357        $widgets = (array) get_option( $this->dashboard_widgets_option, [] );
    362358
     
    376372     * @since 2.0.0
    377373     */
    378     public function disable_dashboard_widgets_with_remote_requests() {
     374    public function disable_dashboard_widgets_with_remote_requests(): void {
    379375        $widgets = $this->get_disabled_dashboard_widgets();
    380376
     
    408404     * @since 1.0.0
    409405     */
    410     public function disable_dashboard_widgets() {
     406    public function disable_dashboard_widgets(): void {
    411407        $widgets = $this->get_disabled_dashboard_widgets();
    412408
     
    443439     * @since 1.0.0
    444440     *
    445      * @param array $input Sidebar widgets to disable.
    446      * @return array
    447      */
    448     public function sanitize_sidebar_widgets( $input ) {
     441     * @param mixed[] $input Sidebar widgets to disable.
     442     * @return mixed[]
     443     */
     444    public function sanitize_sidebar_widgets( ?array $input ): array { // phpcs:ignore Squiz.Commenting.FunctionComment.IncorrectTypeHint -- mixed is not a valid type hint in PHP 7.4.
    449445        // If there are settings errors the input was already sanitized.
    450446        // See https://core.trac.wordpress.org/ticket/21989.
     
    503499     * @since 1.0.0
    504500     *
    505      * @param array $input Dashboards widgets to disable.
    506      * @return array
    507      */
    508     public function sanitize_dashboard_widgets( $input ) {
     501     * @param mixed[] $input Dashboards widgets to disable.
     502     * @return mixed[]
     503     */
     504    public function sanitize_dashboard_widgets( ?array $input ): array { // phpcs:ignore Squiz.Commenting.FunctionComment.IncorrectTypeHint -- mixed is not a valid type hint in PHP 7.4.
    509505        // If there are settings errors the input was already sanitized.
    510506        // See https://core.trac.wordpress.org/ticket/21989.
     
    563559     * @since 1.0.0
    564560     */
    565     public function register_settings() {
     561    public function register_settings(): void {
    566562        register_setting(
    567563            $this->sidebar_widgets_option,
     
    573569            'widget_disable_widget_section',
    574570            __( 'Disable Sidebar Widgets', 'wp-widget-disable' ),
    575             function () {
     571            function (): void {
    576572                echo '<p>';
    577573                _e( 'Choose the sidebar widgets you would like to disable. Note that developers can still display widgets using PHP.', 'wp-widget-disable' );
     
    598594            'widget_disable_dashboard_section',
    599595            __( 'Disable Dashboard Widgets', 'wp-widget-disable' ),
    600             function () {
     596            function (): void {
    601597                echo '<p>';
    602598                _e( 'Choose the dashboard widgets you would like to disable.', 'wp-widget-disable' );
     
    620616     * @since 1.0.0
    621617     */
    622     public function render_sidebar_checkboxes() {
     618    public function render_sidebar_checkboxes(): void {
    623619        $widgets = $this->sidebar_widgets;
    624620
     
    668664     * @since 1.0.0
    669665     */
    670     public function render_dashboard_checkboxes() {
     666    public function render_dashboard_checkboxes(): void {
    671667        $widgets = $this->get_default_dashboard_widgets();
    672668
     
    801797    /**
    802798     * Check if block editor is enabled for widgets.
    803      *
    804      * @return bool
    805      */
    806     public function use_widgets_block_editor() {
     799     */
     800    public function use_widgets_block_editor(): bool {
    807801        if ( function_exists( 'wp_use_widgets_block_editor' ) ) {
    808802            return wp_use_widgets_block_editor();
     
    814808     * Get list of widgets to hide from legacy widget block.
    815809     *
    816      * @return array
    817      */
    818     public function get_widgets_to_hide_from_legacy_widget_block() {
     810     * @return mixed[]
     811     */
     812    public function get_widgets_to_hide_from_legacy_widget_block(): array {
    819813        if ( function_exists( 'get_legacy_widget_block_editor_settings' ) ) {
    820814            return get_legacy_widget_block_editor_settings()['widgetTypesToHideFromLegacyWidgetBlock'];
  • wp-widget-disable/trunk/vendor/autoload.php

    r2887107 r3156633  
    2323require_once __DIR__ . '/composer/autoload_real.php';
    2424
    25 return ComposerAutoloaderInitfc830ce5553f798caa2f884b466c6301::getLoader();
     25return ComposerAutoloaderInitd093fc0356bf5ad255baf9551c055d9d::getLoader();
  • wp-widget-disable/trunk/vendor/composer/ClassLoader.php

    r2887107 r3156633  
    4646    private static $includeFile;
    4747
    48     /** @var ?string */
     48    /** @var string|null */
    4949    private $vendorDir;
    5050
    5151    // PSR-4
    5252    /**
    53      * @var array[]
    54      * @psalm-var array<string, array<string, int>>
     53     * @var array<string, array<string, int>>
    5554     */
    5655    private $prefixLengthsPsr4 = array();
    5756    /**
    58      * @var array[]
    59      * @psalm-var array<string, array<int, string>>
     57     * @var array<string, list<string>>
    6058     */
    6159    private $prefixDirsPsr4 = array();
    6260    /**
    63      * @var array[]
    64      * @psalm-var array<string, string>
     61     * @var list<string>
    6562     */
    6663    private $fallbackDirsPsr4 = array();
     
    6865    // PSR-0
    6966    /**
    70      * @var array[]
    71      * @psalm-var array<string, array<string, string[]>>
     67     * List of PSR-0 prefixes
     68     *
     69     * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
     70     *
     71     * @var array<string, array<string, list<string>>>
    7272     */
    7373    private $prefixesPsr0 = array();
    7474    /**
    75      * @var array[]
    76      * @psalm-var array<string, string>
     75     * @var list<string>
    7776     */
    7877    private $fallbackDirsPsr0 = array();
     
    8281
    8382    /**
    84      * @var string[]
    85      * @psalm-var array<string, string>
     83     * @var array<string, string>
    8684     */
    8785    private $classMap = array();
     
    9189
    9290    /**
    93      * @var bool[]
    94      * @psalm-var array<string, bool>
     91     * @var array<string, bool>
    9592     */
    9693    private $missingClasses = array();
    9794
    98     /** @var ?string */
     95    /** @var string|null */
    9996    private $apcuPrefix;
    10097
    10198    /**
    102      * @var self[]
     99     * @var array<string, self>
    103100     */
    104101    private static $registeredLoaders = array();
    105102
    106103    /**
    107      * @param ?string $vendorDir
     104     * @param string|null $vendorDir
    108105     */
    109106    public function __construct($vendorDir = null)
     
    114111
    115112    /**
    116      * @return string[]
     113     * @return array<string, list<string>>
    117114     */
    118115    public function getPrefixes()
     
    126123
    127124    /**
    128      * @return array[]
    129      * @psalm-return array<string, array<int, string>>
     125     * @return array<string, list<string>>
    130126     */
    131127    public function getPrefixesPsr4()
     
    135131
    136132    /**
    137      * @return array[]
    138      * @psalm-return array<string, string>
     133     * @return list<string>
    139134     */
    140135    public function getFallbackDirs()
     
    144139
    145140    /**
    146      * @return array[]
    147      * @psalm-return array<string, string>
     141     * @return list<string>
    148142     */
    149143    public function getFallbackDirsPsr4()
     
    153147
    154148    /**
    155      * @return string[] Array of classname => path
    156      * @psalm-return array<string, string>
     149     * @return array<string, string> Array of classname => path
    157150     */
    158151    public function getClassMap()
     
    162155
    163156    /**
    164      * @param string[] $classMap Class to filename map
    165      * @psalm-param array<string, string> $classMap
     157     * @param array<string, string> $classMap Class to filename map
    166158     *
    167159     * @return void
     
    180172     * appending or prepending to the ones previously set for this prefix.
    181173     *
    182      * @param string          $prefix  The prefix
    183      * @param string[]|string $paths   The PSR-0 root directories
    184      * @param bool            $prepend Whether to prepend the directories
     174     * @param string              $prefix  The prefix
     175     * @param list<string>|string $paths   The PSR-0 root directories
     176     * @param bool                $prepend Whether to prepend the directories
    185177     *
    186178     * @return void
     
    188180    public function add($prefix, $paths, $prepend = false)
    189181    {
     182        $paths = (array) $paths;
    190183        if (!$prefix) {
    191184            if ($prepend) {
    192185                $this->fallbackDirsPsr0 = array_merge(
    193                     (array) $paths,
     186                    $paths,
    194187                    $this->fallbackDirsPsr0
    195188                );
     
    197190                $this->fallbackDirsPsr0 = array_merge(
    198191                    $this->fallbackDirsPsr0,
    199                     (array) $paths
     192                    $paths
    200193                );
    201194            }
     
    206199        $first = $prefix[0];
    207200        if (!isset($this->prefixesPsr0[$first][$prefix])) {
    208             $this->prefixesPsr0[$first][$prefix] = (array) $paths;
     201            $this->prefixesPsr0[$first][$prefix] = $paths;
    209202
    210203            return;
     
    212205        if ($prepend) {
    213206            $this->prefixesPsr0[$first][$prefix] = array_merge(
    214                 (array) $paths,
     207                $paths,
    215208                $this->prefixesPsr0[$first][$prefix]
    216209            );
     
    218211            $this->prefixesPsr0[$first][$prefix] = array_merge(
    219212                $this->prefixesPsr0[$first][$prefix],
    220                 (array) $paths
     213                $paths
    221214            );
    222215        }
     
    227220     * appending or prepending to the ones previously set for this namespace.
    228221     *
    229      * @param string          $prefix  The prefix/namespace, with trailing '\\'
    230      * @param string[]|string $paths   The PSR-4 base directories
    231      * @param bool            $prepend Whether to prepend the directories
     222     * @param string              $prefix  The prefix/namespace, with trailing '\\'
     223     * @param list<string>|string $paths   The PSR-4 base directories
     224     * @param bool                $prepend Whether to prepend the directories
    232225     *
    233226     * @throws \InvalidArgumentException
     
    237230    public function addPsr4($prefix, $paths, $prepend = false)
    238231    {
     232        $paths = (array) $paths;
    239233        if (!$prefix) {
    240234            // Register directories for the root namespace.
    241235            if ($prepend) {
    242236                $this->fallbackDirsPsr4 = array_merge(
    243                     (array) $paths,
     237                    $paths,
    244238                    $this->fallbackDirsPsr4
    245239                );
     
    247241                $this->fallbackDirsPsr4 = array_merge(
    248242                    $this->fallbackDirsPsr4,
    249                     (array) $paths
     243                    $paths
    250244                );
    251245            }
     
    257251            }
    258252            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
    259             $this->prefixDirsPsr4[$prefix] = (array) $paths;
     253            $this->prefixDirsPsr4[$prefix] = $paths;
    260254        } elseif ($prepend) {
    261255            // Prepend directories for an already registered namespace.
    262256            $this->prefixDirsPsr4[$prefix] = array_merge(
    263                 (array) $paths,
     257                $paths,
    264258                $this->prefixDirsPsr4[$prefix]
    265259            );
     
    268262            $this->prefixDirsPsr4[$prefix] = array_merge(
    269263                $this->prefixDirsPsr4[$prefix],
    270                 (array) $paths
     264                $paths
    271265            );
    272266        }
     
    277271     * replacing any others previously set for this prefix.
    278272     *
    279      * @param string          $prefix The prefix
    280      * @param string[]|string $paths  The PSR-0 base directories
     273     * @param string              $prefix The prefix
     274     * @param list<string>|string $paths  The PSR-0 base directories
    281275     *
    282276     * @return void
     
    295289     * replacing any others previously set for this namespace.
    296290     *
    297      * @param string          $prefix The prefix/namespace, with trailing '\\'
    298      * @param string[]|string $paths  The PSR-4 base directories
     291     * @param string              $prefix The prefix/namespace, with trailing '\\'
     292     * @param list<string>|string $paths  The PSR-4 base directories
    299293     *
    300294     * @throws \InvalidArgumentException
     
    482476
    483477    /**
    484      * Returns the currently registered loaders indexed by their corresponding vendor directories.
    485      *
    486      * @return self[]
     478     * Returns the currently registered loaders keyed by their corresponding vendor directories.
     479     *
     480     * @return array<string, self>
    487481     */
    488482    public static function getRegisteredLoaders()
  • wp-widget-disable/trunk/vendor/composer/autoload_real.php

    r2887107 r3156633  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInitfc830ce5553f798caa2f884b466c6301
     5class ComposerAutoloaderInitd093fc0356bf5ad255baf9551c055d9d
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInitfc830ce5553f798caa2f884b466c6301', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInitd093fc0356bf5ad255baf9551c055d9d', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInitfc830ce5553f798caa2f884b466c6301', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInitd093fc0356bf5ad255baf9551c055d9d', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInitfc830ce5553f798caa2f884b466c6301::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInitd093fc0356bf5ad255baf9551c055d9d::getInitializer($loader));
    3333
    3434        $loader->register(true);
  • wp-widget-disable/trunk/vendor/composer/autoload_static.php

    r2887107 r3156633  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInitfc830ce5553f798caa2f884b466c6301
     7class ComposerStaticInitd093fc0356bf5ad255baf9551c055d9d
    88{
    99    public static $classMap = array (
     
    1515    {
    1616        return \Closure::bind(function () use ($loader) {
    17             $loader->classMap = ComposerStaticInitfc830ce5553f798caa2f884b466c6301::$classMap;
     17            $loader->classMap = ComposerStaticInitd093fc0356bf5ad255baf9551c055d9d::$classMap;
    1818
    1919        }, null, ClassLoader::class);
  • wp-widget-disable/trunk/vendor/composer/installed.php

    r2887107 r3156633  
    22    'root' => array(
    33        'name' => 'wearerequired/wp-widget-disable',
    4         'pretty_version' => '3.0.0',
    5         'version' => '3.0.0.0',
    6         'reference' => '7b52c2f91b9b31427dbc784cba00965c6e62c7e8',
     4        'pretty_version' => '3.0.1',
     5        'version' => '3.0.1.0',
     6        'reference' => 'c32dc018f5c85882198aa9351d8798fe01f8a41a',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    2121        ),
    2222        'wearerequired/wp-widget-disable' => array(
    23             'pretty_version' => '3.0.0',
    24             'version' => '3.0.0.0',
    25             'reference' => '7b52c2f91b9b31427dbc784cba00965c6e62c7e8',
     23            'pretty_version' => '3.0.1',
     24            'version' => '3.0.1.0',
     25            'reference' => 'c32dc018f5c85882198aa9351d8798fe01f8a41a',
    2626            'type' => 'wordpress-plugin',
    2727            'install_path' => __DIR__ . '/../../',
  • wp-widget-disable/trunk/wp-widget-disable.php

    r2887107 r3156633  
    44 * Plugin URI:        https://required.com/services/wordpress-plugins/wp-widget-disable/
    55 * Description:       Disable sidebar and dashboard widgets with an easy to use interface. Simply use the checkboxes provided under <strong>Appearance -> Disable Widgets</strong> and select the widgets you'd like to hide.
    6  * Version:           3.0.0
     6 * Version:           3.0.1
    77 * Requires at least: 6.0
    88 * Requires PHP:      7.4
     
    1212 * Text Domain:       wp-widget-disable
    1313 *
    14  * Copyright (c) 2015-2023 required (email: support@required.ch)
     14 * Copyright (c) 2015-2024 required (email: support@required.ch)
    1515 *
    1616 * This program is free software; you can redistribute it and/or modify
Note: See TracChangeset for help on using the changeset viewer.