Plugin Directory

Changeset 2887107


Ignore:
Timestamp:
03/26/2023 01:36:45 PM (3 years ago)
Author:
wearerequired
Message:

Update to version 3.0.0 from GitHub

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

Legend:

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

    r2695407 r2887107  
    55and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
    66
     7### [3.0.0] - 2022-03-17
     8* Fixed: Replace use of jQuery to avoid deprecation warnings.
     9* Changed: Requires at least PHP 7.4 and WordPress 6.0.
     10
    711### [2.1.0] - 2022-03-17
    812
    9 * Enhancement: Hide disbaled sidebar widgets when widget block editor is enabled.
     13* Enhancement: Hide disabled sidebar widgets when widget block editor is enabled.
    1014* Changed: Requires at least PHP 5.6 and WordPress 4.7.
    1115
     
    8488* German (de_DE) translations added.
    8589
    86 [Unreleased]: https://github.com/wearerequired/WP-Widget-Disable/compare/2.0.0...master
     90[Unreleased]: https://github.com/wearerequired/WP-Widget-Disable/compare/3.0.0...master
     91[3.0.0]: https://github.com/wearerequired/WP-Widget-Disable/compare/2.1.0...3.0.0
    8792[2.1.0]: https://github.com/wearerequired/WP-Widget-Disable/compare/2.0.0...2.1.0
    8893[2.0.0]: https://github.com/wearerequired/WP-Widget-Disable/compare/1.9.0...2.0.0
  • wp-widget-disable/tags/3.0.0/vendor/autoload.php

    r2695407 r2887107  
    33// autoload.php @generated by Composer
    44
     5if (PHP_VERSION_ID < 50600) {
     6    if (!headers_sent()) {
     7        header('HTTP/1.1 500 Internal Server Error');
     8    }
     9    $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
     10    if (!ini_get('display_errors')) {
     11        if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
     12            fwrite(STDERR, $err);
     13        } elseif (!headers_sent()) {
     14            echo $err;
     15        }
     16    }
     17    trigger_error(
     18        $err,
     19        E_USER_ERROR
     20    );
     21}
     22
    523require_once __DIR__ . '/composer/autoload_real.php';
    624
    7 return ComposerAutoloaderInit914942eb63a3b2b6fe068eb2b363a597::getLoader();
     25return ComposerAutoloaderInitfc830ce5553f798caa2f884b466c6301::getLoader();
  • wp-widget-disable/tags/3.0.0/vendor/composer/ClassLoader.php

    r2695407 r2887107  
    4343class ClassLoader
    4444{
     45    /** @var \Closure(string):void */
     46    private static $includeFile;
     47
    4548    /** @var ?string */
    4649    private $vendorDir;
     
    107110    {
    108111        $this->vendorDir = $vendorDir;
     112        self::initializeIncludeClosure();
    109113    }
    110114
     
    426430    {
    427431        if ($file = $this->findFile($class)) {
    428             includeFile($file);
     432            $includeFile = self::$includeFile;
     433            $includeFile($file);
    429434
    430435            return true;
     
    556561        return false;
    557562    }
     563
     564    /**
     565     * @return void
     566     */
     567    private static function initializeIncludeClosure()
     568    {
     569        if (self::$includeFile !== null) {
     570            return;
     571        }
     572
     573        /**
     574         * Scope isolated include.
     575         *
     576         * Prevents access to $this/self from included files.
     577         *
     578         * @param  string $file
     579         * @return void
     580         */
     581        self::$includeFile = \Closure::bind(static function($file) {
     582            include $file;
     583        }, null, null);
     584    }
    558585}
    559 
    560 /**
    561  * Scope isolated include.
    562  *
    563  * Prevents access to $this/self from included files.
    564  *
    565  * @param  string $file
    566  * @return void
    567  * @private
    568  */
    569 function includeFile($file)
    570 {
    571     include $file;
    572 }
  • wp-widget-disable/tags/3.0.0/vendor/composer/InstalledVersions.php

    r2695407 r2887107  
    2222 *
    2323 * To require its presence, you can require `composer-runtime-api ^2.0`
     24 *
     25 * @final
    2426 */
    2527class InstalledVersions
     
    2729    /**
    2830     * @var mixed[]|null
    29      * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
     31     * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
    3032     */
    3133    private static $installed;
     
    3840    /**
    3941     * @var array[]
    40      * @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     42     * @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
    4143     */
    4244    private static $installedByVendor = array();
     
    9799        foreach (self::getInstalled() as $installed) {
    98100            if (isset($installed['versions'][$packageName])) {
    99                 return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
     101                return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
    100102            }
    101103        }
     
    118120    public static function satisfies(VersionParser $parser, $packageName, $constraint)
    119121    {
    120         $constraint = $parser->parseConstraints($constraint);
     122        $constraint = $parser->parseConstraints((string) $constraint);
    121123        $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
    122124
     
    242244    /**
    243245     * @return array
    244      * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
     246     * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
    245247     */
    246248    public static function getRootPackage()
     
    256258     * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
    257259     * @return array[]
    258      * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
     260     * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
    259261     */
    260262    public static function getRawData()
     
    279281     *
    280282     * @return array[]
    281      * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     283     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
    282284     */
    283285    public static function getAllRawData()
     
    302304     * @return void
    303305     *
    304      * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
     306     * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
    305307     */
    306308    public static function reload($data)
     
    312314    /**
    313315     * @return array[]
    314      * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     316     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
    315317     */
    316318    private static function getInstalled()
     
    327329                    $installed[] = self::$installedByVendor[$vendorDir];
    328330                } elseif (is_file($vendorDir.'/composer/installed.php')) {
    329                     $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
     331                    /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
     332                    $required = require $vendorDir.'/composer/installed.php';
     333                    $installed[] = self::$installedByVendor[$vendorDir] = $required;
    330334                    if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
    331335                        self::$installed = $installed[count($installed) - 1];
     
    339343            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
    340344            if (substr(__DIR__, -8, 1) !== 'C') {
    341                 self::$installed = require __DIR__ . '/installed.php';
     345                /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
     346                $required = require __DIR__ . '/installed.php';
     347                self::$installed = $required;
    342348            } else {
    343349                self::$installed = array();
    344350            }
    345351        }
    346         $installed[] = self::$installed;
     352
     353        if (self::$installed !== array()) {
     354            $installed[] = self::$installed;
     355        }
    347356
    348357        return $installed;
  • wp-widget-disable/tags/3.0.0/vendor/composer/autoload_classmap.php

    r2695407 r2887107  
    33// autoload_classmap.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • wp-widget-disable/tags/3.0.0/vendor/composer/autoload_namespaces.php

    r1487873 r2887107  
    33// autoload_namespaces.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • wp-widget-disable/tags/3.0.0/vendor/composer/autoload_psr4.php

    r1487873 r2887107  
    33// autoload_psr4.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • wp-widget-disable/tags/3.0.0/vendor/composer/autoload_real.php

    r2695407 r2887107  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit914942eb63a3b2b6fe068eb2b363a597
     5class ComposerAutoloaderInitfc830ce5553f798caa2f884b466c6301
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit914942eb63a3b2b6fe068eb2b363a597', 'loadClassLoader'), true, true);
    28         self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit914942eb63a3b2b6fe068eb2b363a597', 'loadClassLoader'));
     27        spl_autoload_register(array('ComposerAutoloaderInitfc830ce5553f798caa2f884b466c6301', 'loadClassLoader'), true, true);
     28        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
     29        spl_autoload_unregister(array('ComposerAutoloaderInitfc830ce5553f798caa2f884b466c6301', 'loadClassLoader'));
    3030
    31         $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
    32         if ($useStaticLoader) {
    33             require __DIR__ . '/autoload_static.php';
    34 
    35             call_user_func(\Composer\Autoload\ComposerStaticInit914942eb63a3b2b6fe068eb2b363a597::getInitializer($loader));
    36         } else {
    37             $map = require __DIR__ . '/autoload_namespaces.php';
    38             foreach ($map as $namespace => $path) {
    39                 $loader->set($namespace, $path);
    40             }
    41 
    42             $map = require __DIR__ . '/autoload_psr4.php';
    43             foreach ($map as $namespace => $path) {
    44                 $loader->setPsr4($namespace, $path);
    45             }
    46 
    47             $classMap = require __DIR__ . '/autoload_classmap.php';
    48             if ($classMap) {
    49                 $loader->addClassMap($classMap);
    50             }
    51         }
     31        require __DIR__ . '/autoload_static.php';
     32        call_user_func(\Composer\Autoload\ComposerStaticInitfc830ce5553f798caa2f884b466c6301::getInitializer($loader));
    5233
    5334        $loader->register(true);
  • wp-widget-disable/tags/3.0.0/vendor/composer/autoload_static.php

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

    r2695407 r2887107  
    11<?php return array(
    22    'root' => array(
    3         'pretty_version' => '2.1.0',
    4         'version' => '2.1.0.0',
     3        'name' => 'wearerequired/wp-widget-disable',
     4        'pretty_version' => '3.0.0',
     5        'version' => '3.0.0.0',
     6        'reference' => '7b52c2f91b9b31427dbc784cba00965c6e62c7e8',
    57        'type' => 'wordpress-plugin',
    68        'install_path' => __DIR__ . '/../../',
    79        'aliases' => array(),
    8         'reference' => '351c3de5dd4cb1cc5a24712afb95b58cd0550c5c',
    9         'name' => 'wearerequired/wp-widget-disable',
    1010        'dev' => false,
    1111    ),
     
    1414            'pretty_version' => '1.1.0',
    1515            'version' => '1.1.0.0',
     16            'reference' => '82b8a6c4b953f59e7e534df2d4287e34af950812',
    1617            'type' => 'library',
    1718            'install_path' => __DIR__ . '/../wearerequired/wp-requirements-check',
    1819            'aliases' => array(),
    19             'reference' => '82b8a6c4b953f59e7e534df2d4287e34af950812',
    2020            'dev_requirement' => false,
    2121        ),
    2222        'wearerequired/wp-widget-disable' => array(
    23             'pretty_version' => '2.1.0',
    24             'version' => '2.1.0.0',
     23            'pretty_version' => '3.0.0',
     24            'version' => '3.0.0.0',
     25            'reference' => '7b52c2f91b9b31427dbc784cba00965c6e62c7e8',
    2526            'type' => 'wordpress-plugin',
    2627            'install_path' => __DIR__ . '/../../',
    2728            'aliases' => array(),
    28             'reference' => '351c3de5dd4cb1cc5a24712afb95b58cd0550c5c',
    2929            'dev_requirement' => false,
    3030        ),
  • wp-widget-disable/tags/3.0.0/vendor/composer/platform_check.php

    r2695407 r2887107  
    55$issues = array();
    66
    7 if (!(PHP_VERSION_ID >= 50600)) {
    8     $issues[] = 'Your Composer dependencies require a PHP version ">= 5.6.0". You are running ' . PHP_VERSION . '.';
     7if (!(PHP_VERSION_ID >= 70400)) {
     8    $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.';
    99}
    1010
  • wp-widget-disable/tags/3.0.0/views/admin.php

    r2048125 r2887107  
    4848    <?php endif; ?>
    4949
    50     <script type="text/javascript">
    51         jQuery( document ).ready( function( $ ) {
    52             $( '#wp_widget_disable_select_all, #wp_widget_disable_deselect_all' ).click( function() {
    53                 var isChecked = 'wp_widget_disable_select_all' === $( this ).attr( 'id' );
    54                 $( this ).parents( 'td' ).find( 'input' ).each( function() {
    55                     $( this ).get( 0 ).checked = isChecked;
    56                 } );
    57             } );
    58         } );
    59     </script>
    60 
    6150    <form method="post" action="<?php echo esc_url( $form_action ); ?>" class="wp-widget-disable-form">
    6251        <?php
     
    6756    </form>
    6857</div>
     58
     59<script>
     60    const toggleButtons = document.querySelectorAll( '#wp_widget_disable_select_all, #wp_widget_disable_deselect_all' );
     61    toggleButtons.forEach( function( button ) {
     62        button.addEventListener( 'click', function() {
     63            const isChecked = 'wp_widget_disable_select_all' === button.id;
     64            const inputs = button.closest( 'td' ).querySelectorAll( 'input' );
     65            inputs.forEach( function( input ) {
     66                input.checked = isChecked;
     67            } );
     68        } );
     69    } );
     70</script>
  • wp-widget-disable/tags/3.0.0/wp-widget-disable.php

    r2695407 r2887107  
    11<?php
    22/**
    3  * Plugin Name: Widget Disable
    4  * Plugin URI:  https://required.com/services/wordpress-plugins/wp-widget-disable/
    5  * 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:     2.1.0
    7  * Author:      required
    8  * Author URI:  https://required.com
    9  * License:     GPLv2+
    10  * Text Domain: wp-widget-disable
     3 * Plugin Name:       Widget Disable
     4 * Plugin URI:        https://required.com/services/wordpress-plugins/wp-widget-disable/
     5 * 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
     7 * Requires at least: 6.0
     8 * Requires PHP:      7.4
     9 * Author:            required
     10 * Author URI:        https://required.com
     11 * License:           GPLv2+
     12 * Text Domain:       wp-widget-disable
    1113 *
    12  * Copyright (c) 2015-2022 required (email: support@required.ch)
     14 * Copyright (c) 2015-2023 required (email: support@required.ch)
    1315 *
    1416 * This program is free software; you can redistribute it and/or modify
     
    3739    array(
    3840        'title' => 'WP Widget Disable',
    39         'php'   => '5.6',
    40         'wp'    => '4.7',
     41        'php'   => '7.4',
     42        'wp'    => '6.0',
    4143        'file'  => __FILE__,
    4244    )
  • wp-widget-disable/trunk/CHANGELOG.md

    r2695407 r2887107  
    55and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
    66
     7### [3.0.0] - 2022-03-17
     8* Fixed: Replace use of jQuery to avoid deprecation warnings.
     9* Changed: Requires at least PHP 7.4 and WordPress 6.0.
     10
    711### [2.1.0] - 2022-03-17
    812
    9 * Enhancement: Hide disbaled sidebar widgets when widget block editor is enabled.
     13* Enhancement: Hide disabled sidebar widgets when widget block editor is enabled.
    1014* Changed: Requires at least PHP 5.6 and WordPress 4.7.
    1115
     
    8488* German (de_DE) translations added.
    8589
    86 [Unreleased]: https://github.com/wearerequired/WP-Widget-Disable/compare/2.0.0...master
     90[Unreleased]: https://github.com/wearerequired/WP-Widget-Disable/compare/3.0.0...master
     91[3.0.0]: https://github.com/wearerequired/WP-Widget-Disable/compare/2.1.0...3.0.0
    8792[2.1.0]: https://github.com/wearerequired/WP-Widget-Disable/compare/2.0.0...2.1.0
    8893[2.0.0]: https://github.com/wearerequired/WP-Widget-Disable/compare/1.9.0...2.0.0
  • wp-widget-disable/trunk/vendor/autoload.php

    r2695407 r2887107  
    33// autoload.php @generated by Composer
    44
     5if (PHP_VERSION_ID < 50600) {
     6    if (!headers_sent()) {
     7        header('HTTP/1.1 500 Internal Server Error');
     8    }
     9    $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
     10    if (!ini_get('display_errors')) {
     11        if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
     12            fwrite(STDERR, $err);
     13        } elseif (!headers_sent()) {
     14            echo $err;
     15        }
     16    }
     17    trigger_error(
     18        $err,
     19        E_USER_ERROR
     20    );
     21}
     22
    523require_once __DIR__ . '/composer/autoload_real.php';
    624
    7 return ComposerAutoloaderInit914942eb63a3b2b6fe068eb2b363a597::getLoader();
     25return ComposerAutoloaderInitfc830ce5553f798caa2f884b466c6301::getLoader();
  • wp-widget-disable/trunk/vendor/composer/ClassLoader.php

    r2695407 r2887107  
    4343class ClassLoader
    4444{
     45    /** @var \Closure(string):void */
     46    private static $includeFile;
     47
    4548    /** @var ?string */
    4649    private $vendorDir;
     
    107110    {
    108111        $this->vendorDir = $vendorDir;
     112        self::initializeIncludeClosure();
    109113    }
    110114
     
    426430    {
    427431        if ($file = $this->findFile($class)) {
    428             includeFile($file);
     432            $includeFile = self::$includeFile;
     433            $includeFile($file);
    429434
    430435            return true;
     
    556561        return false;
    557562    }
     563
     564    /**
     565     * @return void
     566     */
     567    private static function initializeIncludeClosure()
     568    {
     569        if (self::$includeFile !== null) {
     570            return;
     571        }
     572
     573        /**
     574         * Scope isolated include.
     575         *
     576         * Prevents access to $this/self from included files.
     577         *
     578         * @param  string $file
     579         * @return void
     580         */
     581        self::$includeFile = \Closure::bind(static function($file) {
     582            include $file;
     583        }, null, null);
     584    }
    558585}
    559 
    560 /**
    561  * Scope isolated include.
    562  *
    563  * Prevents access to $this/self from included files.
    564  *
    565  * @param  string $file
    566  * @return void
    567  * @private
    568  */
    569 function includeFile($file)
    570 {
    571     include $file;
    572 }
  • wp-widget-disable/trunk/vendor/composer/InstalledVersions.php

    r2695407 r2887107  
    2222 *
    2323 * To require its presence, you can require `composer-runtime-api ^2.0`
     24 *
     25 * @final
    2426 */
    2527class InstalledVersions
     
    2729    /**
    2830     * @var mixed[]|null
    29      * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
     31     * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
    3032     */
    3133    private static $installed;
     
    3840    /**
    3941     * @var array[]
    40      * @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     42     * @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
    4143     */
    4244    private static $installedByVendor = array();
     
    9799        foreach (self::getInstalled() as $installed) {
    98100            if (isset($installed['versions'][$packageName])) {
    99                 return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
     101                return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
    100102            }
    101103        }
     
    118120    public static function satisfies(VersionParser $parser, $packageName, $constraint)
    119121    {
    120         $constraint = $parser->parseConstraints($constraint);
     122        $constraint = $parser->parseConstraints((string) $constraint);
    121123        $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
    122124
     
    242244    /**
    243245     * @return array
    244      * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
     246     * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
    245247     */
    246248    public static function getRootPackage()
     
    256258     * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
    257259     * @return array[]
    258      * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
     260     * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
    259261     */
    260262    public static function getRawData()
     
    279281     *
    280282     * @return array[]
    281      * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     283     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
    282284     */
    283285    public static function getAllRawData()
     
    302304     * @return void
    303305     *
    304      * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
     306     * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
    305307     */
    306308    public static function reload($data)
     
    312314    /**
    313315     * @return array[]
    314      * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     316     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
    315317     */
    316318    private static function getInstalled()
     
    327329                    $installed[] = self::$installedByVendor[$vendorDir];
    328330                } elseif (is_file($vendorDir.'/composer/installed.php')) {
    329                     $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
     331                    /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
     332                    $required = require $vendorDir.'/composer/installed.php';
     333                    $installed[] = self::$installedByVendor[$vendorDir] = $required;
    330334                    if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
    331335                        self::$installed = $installed[count($installed) - 1];
     
    339343            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
    340344            if (substr(__DIR__, -8, 1) !== 'C') {
    341                 self::$installed = require __DIR__ . '/installed.php';
     345                /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
     346                $required = require __DIR__ . '/installed.php';
     347                self::$installed = $required;
    342348            } else {
    343349                self::$installed = array();
    344350            }
    345351        }
    346         $installed[] = self::$installed;
     352
     353        if (self::$installed !== array()) {
     354            $installed[] = self::$installed;
     355        }
    347356
    348357        return $installed;
  • wp-widget-disable/trunk/vendor/composer/autoload_classmap.php

    r2695407 r2887107  
    33// autoload_classmap.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • wp-widget-disable/trunk/vendor/composer/autoload_namespaces.php

    r1487873 r2887107  
    33// autoload_namespaces.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • wp-widget-disable/trunk/vendor/composer/autoload_psr4.php

    r1487873 r2887107  
    33// autoload_psr4.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • wp-widget-disable/trunk/vendor/composer/autoload_real.php

    r2695407 r2887107  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInit914942eb63a3b2b6fe068eb2b363a597
     5class ComposerAutoloaderInitfc830ce5553f798caa2f884b466c6301
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInit914942eb63a3b2b6fe068eb2b363a597', 'loadClassLoader'), true, true);
    28         self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    29         spl_autoload_unregister(array('ComposerAutoloaderInit914942eb63a3b2b6fe068eb2b363a597', 'loadClassLoader'));
     27        spl_autoload_register(array('ComposerAutoloaderInitfc830ce5553f798caa2f884b466c6301', 'loadClassLoader'), true, true);
     28        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
     29        spl_autoload_unregister(array('ComposerAutoloaderInitfc830ce5553f798caa2f884b466c6301', 'loadClassLoader'));
    3030
    31         $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
    32         if ($useStaticLoader) {
    33             require __DIR__ . '/autoload_static.php';
    34 
    35             call_user_func(\Composer\Autoload\ComposerStaticInit914942eb63a3b2b6fe068eb2b363a597::getInitializer($loader));
    36         } else {
    37             $map = require __DIR__ . '/autoload_namespaces.php';
    38             foreach ($map as $namespace => $path) {
    39                 $loader->set($namespace, $path);
    40             }
    41 
    42             $map = require __DIR__ . '/autoload_psr4.php';
    43             foreach ($map as $namespace => $path) {
    44                 $loader->setPsr4($namespace, $path);
    45             }
    46 
    47             $classMap = require __DIR__ . '/autoload_classmap.php';
    48             if ($classMap) {
    49                 $loader->addClassMap($classMap);
    50             }
    51         }
     31        require __DIR__ . '/autoload_static.php';
     32        call_user_func(\Composer\Autoload\ComposerStaticInitfc830ce5553f798caa2f884b466c6301::getInitializer($loader));
    5233
    5334        $loader->register(true);
  • wp-widget-disable/trunk/vendor/composer/autoload_static.php

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

    r2695407 r2887107  
    11<?php return array(
    22    'root' => array(
    3         'pretty_version' => '2.1.0',
    4         'version' => '2.1.0.0',
     3        'name' => 'wearerequired/wp-widget-disable',
     4        'pretty_version' => '3.0.0',
     5        'version' => '3.0.0.0',
     6        'reference' => '7b52c2f91b9b31427dbc784cba00965c6e62c7e8',
    57        'type' => 'wordpress-plugin',
    68        'install_path' => __DIR__ . '/../../',
    79        'aliases' => array(),
    8         'reference' => '351c3de5dd4cb1cc5a24712afb95b58cd0550c5c',
    9         'name' => 'wearerequired/wp-widget-disable',
    1010        'dev' => false,
    1111    ),
     
    1414            'pretty_version' => '1.1.0',
    1515            'version' => '1.1.0.0',
     16            'reference' => '82b8a6c4b953f59e7e534df2d4287e34af950812',
    1617            'type' => 'library',
    1718            'install_path' => __DIR__ . '/../wearerequired/wp-requirements-check',
    1819            'aliases' => array(),
    19             'reference' => '82b8a6c4b953f59e7e534df2d4287e34af950812',
    2020            'dev_requirement' => false,
    2121        ),
    2222        'wearerequired/wp-widget-disable' => array(
    23             'pretty_version' => '2.1.0',
    24             'version' => '2.1.0.0',
     23            'pretty_version' => '3.0.0',
     24            'version' => '3.0.0.0',
     25            'reference' => '7b52c2f91b9b31427dbc784cba00965c6e62c7e8',
    2526            'type' => 'wordpress-plugin',
    2627            'install_path' => __DIR__ . '/../../',
    2728            'aliases' => array(),
    28             'reference' => '351c3de5dd4cb1cc5a24712afb95b58cd0550c5c',
    2929            'dev_requirement' => false,
    3030        ),
  • wp-widget-disable/trunk/vendor/composer/platform_check.php

    r2695407 r2887107  
    55$issues = array();
    66
    7 if (!(PHP_VERSION_ID >= 50600)) {
    8     $issues[] = 'Your Composer dependencies require a PHP version ">= 5.6.0". You are running ' . PHP_VERSION . '.';
     7if (!(PHP_VERSION_ID >= 70400)) {
     8    $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.';
    99}
    1010
  • wp-widget-disable/trunk/views/admin.php

    r2048125 r2887107  
    4848    <?php endif; ?>
    4949
    50     <script type="text/javascript">
    51         jQuery( document ).ready( function( $ ) {
    52             $( '#wp_widget_disable_select_all, #wp_widget_disable_deselect_all' ).click( function() {
    53                 var isChecked = 'wp_widget_disable_select_all' === $( this ).attr( 'id' );
    54                 $( this ).parents( 'td' ).find( 'input' ).each( function() {
    55                     $( this ).get( 0 ).checked = isChecked;
    56                 } );
    57             } );
    58         } );
    59     </script>
    60 
    6150    <form method="post" action="<?php echo esc_url( $form_action ); ?>" class="wp-widget-disable-form">
    6251        <?php
     
    6756    </form>
    6857</div>
     58
     59<script>
     60    const toggleButtons = document.querySelectorAll( '#wp_widget_disable_select_all, #wp_widget_disable_deselect_all' );
     61    toggleButtons.forEach( function( button ) {
     62        button.addEventListener( 'click', function() {
     63            const isChecked = 'wp_widget_disable_select_all' === button.id;
     64            const inputs = button.closest( 'td' ).querySelectorAll( 'input' );
     65            inputs.forEach( function( input ) {
     66                input.checked = isChecked;
     67            } );
     68        } );
     69    } );
     70</script>
  • wp-widget-disable/trunk/wp-widget-disable.php

    r2695407 r2887107  
    11<?php
    22/**
    3  * Plugin Name: Widget Disable
    4  * Plugin URI:  https://required.com/services/wordpress-plugins/wp-widget-disable/
    5  * 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:     2.1.0
    7  * Author:      required
    8  * Author URI:  https://required.com
    9  * License:     GPLv2+
    10  * Text Domain: wp-widget-disable
     3 * Plugin Name:       Widget Disable
     4 * Plugin URI:        https://required.com/services/wordpress-plugins/wp-widget-disable/
     5 * 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
     7 * Requires at least: 6.0
     8 * Requires PHP:      7.4
     9 * Author:            required
     10 * Author URI:        https://required.com
     11 * License:           GPLv2+
     12 * Text Domain:       wp-widget-disable
    1113 *
    12  * Copyright (c) 2015-2022 required (email: support@required.ch)
     14 * Copyright (c) 2015-2023 required (email: support@required.ch)
    1315 *
    1416 * This program is free software; you can redistribute it and/or modify
     
    3739    array(
    3840        'title' => 'WP Widget Disable',
    39         'php'   => '5.6',
    40         'wp'    => '4.7',
     41        'php'   => '7.4',
     42        'wp'    => '6.0',
    4143        'file'  => __FILE__,
    4244    )
Note: See TracChangeset for help on using the changeset viewer.