Changeset 2906632
- Timestamp:
- 05/01/2023 05:02:42 PM (3 years ago)
- Location:
- mpress-hide-from-search
- Files:
-
- 10 added
- 34 edited
- 1 copied
-
tags/1.1.4 (copied) (copied from mpress-hide-from-search/trunk)
-
tags/1.1.4/.husky (added)
-
tags/1.1.4/.husky/pre-commit (added)
-
tags/1.1.4/.nvmrc (added)
-
tags/1.1.4/cypress.config.js (added)
-
tags/1.1.4/includes/MetaBox.php (modified) (1 diff)
-
tags/1.1.4/includes/Plugin.php (modified) (2 diffs)
-
tags/1.1.4/languages/mpress-hide-from-search.pot (modified) (1 diff)
-
tags/1.1.4/mpress-hide-from-search.php (modified) (4 diffs)
-
tags/1.1.4/readme.txt (modified) (3 diffs)
-
tags/1.1.4/set-latest-wp-version.js (added)
-
tags/1.1.4/vendor/autoload.php (modified) (1 diff)
-
tags/1.1.4/vendor/composer/ClassLoader.php (modified) (18 diffs)
-
tags/1.1.4/vendor/composer/InstalledVersions.php (modified) (2 diffs)
-
tags/1.1.4/vendor/composer/autoload_classmap.php (modified) (1 diff)
-
tags/1.1.4/vendor/composer/autoload_namespaces.php (modified) (1 diff)
-
tags/1.1.4/vendor/composer/autoload_psr4.php (modified) (1 diff)
-
tags/1.1.4/vendor/composer/autoload_real.php (modified) (2 diffs)
-
tags/1.1.4/vendor/composer/autoload_static.php (modified) (2 diffs)
-
tags/1.1.4/vendor/composer/installed.php (modified) (1 diff)
-
tags/1.1.4/vendor/composer/platform_check.php (modified) (1 diff)
-
tags/1.1.4/vendor/psr/container/src/ContainerExceptionInterface.php (modified) (1 diff)
-
tags/1.1.4/vendor/wp-forge/container/includes/Container.php (modified) (7 diffs)
-
trunk/.husky (added)
-
trunk/.husky/pre-commit (added)
-
trunk/.nvmrc (added)
-
trunk/cypress.config.js (added)
-
trunk/includes/MetaBox.php (modified) (1 diff)
-
trunk/includes/Plugin.php (modified) (2 diffs)
-
trunk/languages/mpress-hide-from-search.pot (modified) (1 diff)
-
trunk/mpress-hide-from-search.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/set-latest-wp-version.js (added)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/composer/ClassLoader.php (modified) (18 diffs)
-
trunk/vendor/composer/InstalledVersions.php (modified) (2 diffs)
-
trunk/vendor/composer/autoload_classmap.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_namespaces.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_psr4.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_real.php (modified) (2 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/vendor/composer/installed.php (modified) (1 diff)
-
trunk/vendor/composer/platform_check.php (modified) (1 diff)
-
trunk/vendor/psr/container/src/ContainerExceptionInterface.php (modified) (1 diff)
-
trunk/vendor/wp-forge/container/includes/Container.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mpress-hide-from-search/tags/1.1.4/includes/MetaBox.php
r2328021 r2906632 26 26 add_meta_box( 27 27 'hide-from-search', 28 esc_html__( 'Hide from Search', ' hide-from-search' ),28 esc_html__( 'Hide from Search', 'mpress-hide-from-search' ), 29 29 array( __CLASS__, 'render' ), 30 30 $post_type, -
mpress-hide-from-search/tags/1.1.4/includes/Plugin.php
r2531747 r2906632 117 117 array( 118 118 'type' => 'boolean', 119 'description' => esc_html__( 'Hide from WordPress search', ' hide-from-search' ),119 'description' => esc_html__( 'Hide from WordPress search', 'mpress-hide-from-search' ), 120 120 'single' => true, 121 121 'sanitize_callback' => function ( $value ) { … … 137 137 array( 138 138 'type' => 'boolean', 139 'description' => esc_html__( 'Hide from search engines', ' hide-from-search' ),139 'description' => esc_html__( 'Hide from search engines', 'mpress-hide-from-search' ), 140 140 'single' => true, 141 141 'sanitize_callback' => function ( $value ) { -
mpress-hide-from-search/tags/1.1.4/languages/mpress-hide-from-search.pot
r2286622 r2906632 1 # Copyright (C) 202 0Micah Wood2 # This file is distributed under the GPL 3.1 # Copyright (C) 2023 Micah Wood 2 # This file is distributed under the GPL V2 or later. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Hide from Search 1.0.2\n" 6 "Report-Msgid-Bugs-To: " 7 "https://wordpress.org/support/plugin/mpress-hide-from-search\n" 8 "POT-Creation-Date: 2020-04-19 03:39:51+00:00\n" 9 "MIME-Version: 1.0\n" 10 "Content-Type: text/plain; charset=utf-8\n" 11 "Content-Transfer-Encoding: 8bit\n" 12 "PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n" 5 "Project-Id-Version: Hide from Search 1.1.4\n" 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mpress-hide-from-search\n" 13 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 14 8 "Language-Team: LANGUAGE <[email protected]>\n" 15 "X-Generator: node-wp-i18n 1.2.3\n" 9 "MIME-Version: 1.0\n" 10 "Content-Type: text/plain; charset=UTF-8\n" 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: \n" 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2.7.1\n" 15 "X-Domain: mpress-hide-from-search\n" 16 16 17 #. Plugin Name of the plugin/theme 17 #. Plugin Name of the plugin 18 #: includes/MetaBox.php:28 18 19 msgid "Hide from Search" 19 20 msgstr "" 20 21 21 #: mpress-hide-from-search.php:104 22 #. translators: post type 23 msgid "Hide this %s from WordPress search" 22 #. Plugin URI of the plugin 23 msgid "https://wordpress.org/plugins/mpress-hide-from-search/" 24 24 msgstr "" 25 25 26 #. Plugin URI of the plugin/theme27 msgid " https://wpscholar.com/wordpress-plugins/mpress-hide-from-search/"26 #. Description of the plugin 27 msgid "Hide individual WordPress pages from search engines and/or WordPress search results." 28 28 msgstr "" 29 29 30 #. Description of the plugin/theme 31 msgid "" 32 "Hide individual posts, pages and other post types from the default " 33 "WordPress search functionality." 34 msgstr "" 35 36 #. Author of the plugin/theme 30 #. Author of the plugin 37 31 msgid "Micah Wood" 38 32 msgstr "" 39 33 40 #. Author URI of the plugin /theme41 msgid "https://wpscholar.com /"34 #. Author URI of the plugin 35 msgid "https://wpscholar.com" 42 36 msgstr "" 37 38 #: includes/Plugin.php:119 39 msgid "Hide from WordPress search" 40 msgstr "" 41 42 #: includes/Plugin.php:139 43 msgid "Hide from search engines" 44 msgstr "" -
mpress-hide-from-search/tags/1.1.4/mpress-hide-from-search.php
r2531747 r2906632 5 5 * @package HideFromSearch 6 6 * @author Micah Wood 7 * @copyright Copyright 2020 by Micah Wood - All rights reserved.7 * @copyright Copyright 2020-2023 by Micah Wood - All rights reserved. 8 8 * @license GPL2.0-or-later 9 9 * … … 12 12 * Plugin URI: https://wordpress.org/plugins/mpress-hide-from-search/ 13 13 * Description: Hide individual WordPress pages from search engines and/or WordPress search results. 14 * Version: 1.1. 315 * Requires PHP: 5.616 * Requires at least: 5.014 * Version: 1.1.4 15 * Requires PHP: 7.4 16 * Requires at least: 6.0 17 17 * Author: Micah Wood 18 18 * Author URI: https://wpscholar.com … … 23 23 */ 24 24 25 define( 'HIDE_FROM_SEARCH_VERSION', '1.1. 3' );25 define( 'HIDE_FROM_SEARCH_VERSION', '1.1.4' ); 26 26 define( 'HIDE_FROM_SEARCH_FILE', __FILE__ ); 27 27 28 require dirname( __FILE__ ). '/vendor/autoload.php';28 require __DIR__ . '/vendor/autoload.php'; 29 29 30 30 // Check plugin requirements … … 33 33 $plugin_check = new WP_Forge_Plugin_Check( __FILE__ ); 34 34 35 $plugin_check->min_php_version = ' 5.6';36 $plugin_check->min_wp_version = ' 5.0';35 $plugin_check->min_php_version = '7.4'; 36 $plugin_check->min_wp_version = '6.0'; 37 37 $plugin_check->check_plugin_requirements(); 38 38 } 39 39 40 require dirname( __FILE__ ). '/includes/Plugin.php';40 require __DIR__ . '/includes/Plugin.php'; -
mpress-hide-from-search/tags/1.1.4/readme.txt
r2531747 r2906632 3 3 Donate link: https://www.paypal.me/wpscholar 4 4 Tags: search, search engines, WordPress search, hide from search, exclude from search, hide post, hidden posts 5 Requires at least: 5.06 Requires PHP: 5.67 Tested up to: 5.78 Stable tag: 1.1. 35 Requires at least: 6.0 6 Requires PHP: 7.4 7 Tested up to: 6.2 8 Stable tag: 1.1.4 9 9 License: GPLv3 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 67 67 == Changelog == 68 68 69 = 1.1.4 = 70 * Minor maintenance release 71 69 72 = 1.1.3 = 70 73 * Fix PHP notice when Yoast SEO is active … … 121 124 == Upgrade Notice == 122 125 126 = 1.1.4 = 127 * Minor maintenance release 128 123 129 = 1.1.3 = 124 130 * Bugfix and security release. -
mpress-hide-from-search/tags/1.1.4/vendor/autoload.php
r2531747 r2906632 3 3 // autoload.php @generated by Composer 4 4 5 if (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 5 23 require_once __DIR__ . '/composer/autoload_real.php'; 6 24 7 return ComposerAutoloaderInit b07ca972432d775e6bc4de539c97e7cc::getLoader();25 return ComposerAutoloaderInitff7c20cb8ecfc15a5454f691a0eecf59::getLoader(); -
mpress-hide-from-search/tags/1.1.4/vendor/composer/ClassLoader.php
r2507158 r2906632 43 43 class ClassLoader 44 44 { 45 /** @var \Closure(string):void */ 46 private static $includeFile; 47 48 /** @var ?string */ 45 49 private $vendorDir; 46 50 47 51 // PSR-4 52 /** 53 * @var array[] 54 * @psalm-var array<string, array<string, int>> 55 */ 48 56 private $prefixLengthsPsr4 = array(); 57 /** 58 * @var array[] 59 * @psalm-var array<string, array<int, string>> 60 */ 49 61 private $prefixDirsPsr4 = array(); 62 /** 63 * @var array[] 64 * @psalm-var array<string, string> 65 */ 50 66 private $fallbackDirsPsr4 = array(); 51 67 52 68 // PSR-0 69 /** 70 * @var array[] 71 * @psalm-var array<string, array<string, string[]>> 72 */ 53 73 private $prefixesPsr0 = array(); 74 /** 75 * @var array[] 76 * @psalm-var array<string, string> 77 */ 54 78 private $fallbackDirsPsr0 = array(); 55 79 80 /** @var bool */ 56 81 private $useIncludePath = false; 82 83 /** 84 * @var string[] 85 * @psalm-var array<string, string> 86 */ 57 87 private $classMap = array(); 88 89 /** @var bool */ 58 90 private $classMapAuthoritative = false; 91 92 /** 93 * @var bool[] 94 * @psalm-var array<string, bool> 95 */ 59 96 private $missingClasses = array(); 97 98 /** @var ?string */ 60 99 private $apcuPrefix; 61 100 101 /** 102 * @var self[] 103 */ 62 104 private static $registeredLoaders = array(); 63 105 106 /** 107 * @param ?string $vendorDir 108 */ 64 109 public function __construct($vendorDir = null) 65 110 { 66 111 $this->vendorDir = $vendorDir; 67 } 68 112 self::initializeIncludeClosure(); 113 } 114 115 /** 116 * @return string[] 117 */ 69 118 public function getPrefixes() 70 119 { … … 76 125 } 77 126 127 /** 128 * @return array[] 129 * @psalm-return array<string, array<int, string>> 130 */ 78 131 public function getPrefixesPsr4() 79 132 { … … 81 134 } 82 135 136 /** 137 * @return array[] 138 * @psalm-return array<string, string> 139 */ 83 140 public function getFallbackDirs() 84 141 { … … 86 143 } 87 144 145 /** 146 * @return array[] 147 * @psalm-return array<string, string> 148 */ 88 149 public function getFallbackDirsPsr4() 89 150 { … … 91 152 } 92 153 154 /** 155 * @return string[] Array of classname => path 156 * @psalm-return array<string, string> 157 */ 93 158 public function getClassMap() 94 159 { … … 97 162 98 163 /** 99 * @param array $classMap Class to filename map 164 * @param string[] $classMap Class to filename map 165 * @psalm-param array<string, string> $classMap 166 * 167 * @return void 100 168 */ 101 169 public function addClassMap(array $classMap) … … 112 180 * appending or prepending to the ones previously set for this prefix. 113 181 * 114 * @param string $prefix The prefix 115 * @param array|string $paths The PSR-0 root directories 116 * @param bool $prepend Whether to prepend the directories 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 185 * 186 * @return void 117 187 */ 118 188 public function add($prefix, $paths, $prepend = false) … … 157 227 * appending or prepending to the ones previously set for this namespace. 158 228 * 159 * @param string $prefix The prefix/namespace, with trailing '\\'160 * @param array|string $paths The PSR-4 base directories161 * @param bool $prepend Whether to prepend the directories229 * @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 162 232 * 163 233 * @throws \InvalidArgumentException 234 * 235 * @return void 164 236 */ 165 237 public function addPsr4($prefix, $paths, $prepend = false) … … 205 277 * replacing any others previously set for this prefix. 206 278 * 207 * @param string $prefix The prefix 208 * @param array|string $paths The PSR-0 base directories 279 * @param string $prefix The prefix 280 * @param string[]|string $paths The PSR-0 base directories 281 * 282 * @return void 209 283 */ 210 284 public function set($prefix, $paths) … … 221 295 * replacing any others previously set for this namespace. 222 296 * 223 * @param string $prefix The prefix/namespace, with trailing '\\'224 * @param array|string $paths The PSR-4 base directories297 * @param string $prefix The prefix/namespace, with trailing '\\' 298 * @param string[]|string $paths The PSR-4 base directories 225 299 * 226 300 * @throws \InvalidArgumentException 301 * 302 * @return void 227 303 */ 228 304 public function setPsr4($prefix, $paths) … … 244 320 * 245 321 * @param bool $useIncludePath 322 * 323 * @return void 246 324 */ 247 325 public function setUseIncludePath($useIncludePath) … … 266 344 * 267 345 * @param bool $classMapAuthoritative 346 * 347 * @return void 268 348 */ 269 349 public function setClassMapAuthoritative($classMapAuthoritative) … … 286 366 * 287 367 * @param string|null $apcuPrefix 368 * 369 * @return void 288 370 */ 289 371 public function setApcuPrefix($apcuPrefix) … … 306 388 * 307 389 * @param bool $prepend Whether to prepend the autoloader or not 390 * 391 * @return void 308 392 */ 309 393 public function register($prepend = false) … … 325 409 /** 326 410 * Unregisters this instance as an autoloader. 411 * 412 * @return void 327 413 */ 328 414 public function unregister() … … 339 425 * 340 426 * @param string $class The name of the class 341 * @return bool|null True if loaded, null otherwise427 * @return true|null True if loaded, null otherwise 342 428 */ 343 429 public function loadClass($class) 344 430 { 345 431 if ($file = $this->findFile($class)) { 346 includeFile($file); 432 $includeFile = self::$includeFile; 433 $includeFile($file); 347 434 348 435 return true; 349 436 } 437 438 return null; 350 439 } 351 440 … … 402 491 } 403 492 493 /** 494 * @param string $class 495 * @param string $ext 496 * @return string|false 497 */ 404 498 private function findFileWithExtension($class, $ext) 405 499 { … … 467 561 return false; 468 562 } 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 } 469 585 } 470 471 /**472 * Scope isolated include.473 *474 * Prevents access to $this/self from included files.475 */476 function includeFile($file)477 {478 include $file;479 } -
mpress-hide-from-search/tags/1.1.4/vendor/composer/InstalledVersions.php
r2531747 r2906632 1 1 <?php 2 2 3 4 5 6 7 8 9 10 11 3 /* 4 * This file is part of Composer. 5 * 6 * (c) Nils Adermann <[email protected]> 7 * Jordi Boggiano <[email protected]> 8 * 9 * For the full copyright and license information, please view the LICENSE 10 * file that was distributed with this source code. 11 */ 12 12 13 13 namespace Composer; … … 16 16 use Composer\Semver\VersionParser; 17 17 18 19 20 21 22 23 24 18 /** 19 * This class is copied in every Composer installed project and available to all 20 * 21 * See also https://getcomposer.org/doc/07-runtime.md#installed-versions 22 * 23 * To require its presence, you can require `composer-runtime-api ^2.0` 24 * 25 * @final 26 */ 25 27 class InstalledVersions 26 28 { 27 private static $installed = array ( 28 'root' => 29 array ( 30 'pretty_version' => '1.1.3', 31 'version' => '1.1.3.0', 32 'aliases' => 33 array ( 34 ), 35 'reference' => 'bd6f7d832ff2ac391f05faca0b5a96a5a9030163', 36 'name' => 'wpscholar/mpress-hide-from-search', 37 ), 38 'versions' => 39 array ( 40 'psr/container' => 41 array ( 42 'pretty_version' => '1.1.1', 43 'version' => '1.1.1.0', 44 'aliases' => 45 array ( 46 ), 47 'reference' => '8622567409010282b7aeebe4bb841fe98b58dcaf', 48 ), 49 'wp-forge/container' => 50 array ( 51 'pretty_version' => '1.0', 52 'version' => '1.0.0.0', 53 'aliases' => 54 array ( 55 ), 56 'reference' => 'e76a208d048b163dcb23068b149e16bdcfabc901', 57 ), 58 'wp-forge/wp-plugin-check' => 59 array ( 60 'pretty_version' => '1.0', 61 'version' => '1.0.0.0', 62 'aliases' => 63 array ( 64 ), 65 'reference' => '3497a1bc557ae1108c11fb6cc694ae97ae2d4fc6', 66 ), 67 'wp-forge/wp-upgrade-handler' => 68 array ( 69 'pretty_version' => '1.0', 70 'version' => '1.0.0.0', 71 'aliases' => 72 array ( 73 ), 74 'reference' => 'b0a7f4c66710f95b4c5702fea3af505ea72fb215', 75 ), 76 'wpscholar/mpress-hide-from-search' => 77 array ( 78 'pretty_version' => '1.1.3', 79 'version' => '1.1.3.0', 80 'aliases' => 81 array ( 82 ), 83 'reference' => 'bd6f7d832ff2ac391f05faca0b5a96a5a9030163', 84 ), 85 ), 86 ); 87 private static $canGetVendors; 88 private static $installedByVendor = array(); 89 90 91 92 93 94 95 96 public static function getInstalledPackages() 97 { 98 $packages = array(); 99 foreach (self::getInstalled() as $installed) { 100 $packages[] = array_keys($installed['versions']); 29 /** 30 * @var mixed[]|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 32 */ 33 private static $installed; 34 35 /** 36 * @var bool|null 37 */ 38 private static $canGetVendors; 39 40 /** 41 * @var array[] 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[]}>}> 43 */ 44 private static $installedByVendor = array(); 45 46 /** 47 * Returns a list of all package names which are present, either by being installed, replaced or provided 48 * 49 * @return string[] 50 * @psalm-return list<string> 51 */ 52 public static function getInstalledPackages() 53 { 54 $packages = array(); 55 foreach (self::getInstalled() as $installed) { 56 $packages[] = array_keys($installed['versions']); 57 } 58 59 if (1 === \count($packages)) { 60 return $packages[0]; 61 } 62 63 return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); 64 } 65 66 /** 67 * Returns a list of all package names with a specific type e.g. 'library' 68 * 69 * @param string $type 70 * @return string[] 71 * @psalm-return list<string> 72 */ 73 public static function getInstalledPackagesByType($type) 74 { 75 $packagesByType = array(); 76 77 foreach (self::getInstalled() as $installed) { 78 foreach ($installed['versions'] as $name => $package) { 79 if (isset($package['type']) && $package['type'] === $type) { 80 $packagesByType[] = $name; 81 } 82 } 83 } 84 85 return $packagesByType; 86 } 87 88 /** 89 * Checks whether the given package is installed 90 * 91 * This also returns true if the package name is provided or replaced by another package 92 * 93 * @param string $packageName 94 * @param bool $includeDevRequirements 95 * @return bool 96 */ 97 public static function isInstalled($packageName, $includeDevRequirements = true) 98 { 99 foreach (self::getInstalled() as $installed) { 100 if (isset($installed['versions'][$packageName])) { 101 return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; 102 } 103 } 104 105 return false; 106 } 107 108 /** 109 * Checks whether the given package satisfies a version constraint 110 * 111 * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: 112 * 113 * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') 114 * 115 * @param VersionParser $parser Install composer/semver to have access to this class and functionality 116 * @param string $packageName 117 * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package 118 * @return bool 119 */ 120 public static function satisfies(VersionParser $parser, $packageName, $constraint) 121 { 122 $constraint = $parser->parseConstraints((string) $constraint); 123 $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); 124 125 return $provided->matches($constraint); 126 } 127 128 /** 129 * Returns a version constraint representing all the range(s) which are installed for a given package 130 * 131 * It is easier to use this via isInstalled() with the $constraint argument if you need to check 132 * whether a given version of a package is installed, and not just whether it exists 133 * 134 * @param string $packageName 135 * @return string Version constraint usable with composer/semver 136 */ 137 public static function getVersionRanges($packageName) 138 { 139 foreach (self::getInstalled() as $installed) { 140 if (!isset($installed['versions'][$packageName])) { 141 continue; 142 } 143 144 $ranges = array(); 145 if (isset($installed['versions'][$packageName]['pretty_version'])) { 146 $ranges[] = $installed['versions'][$packageName]['pretty_version']; 147 } 148 if (array_key_exists('aliases', $installed['versions'][$packageName])) { 149 $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); 150 } 151 if (array_key_exists('replaced', $installed['versions'][$packageName])) { 152 $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); 153 } 154 if (array_key_exists('provided', $installed['versions'][$packageName])) { 155 $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); 156 } 157 158 return implode(' || ', $ranges); 159 } 160 161 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); 162 } 163 164 /** 165 * @param string $packageName 166 * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present 167 */ 168 public static function getVersion($packageName) 169 { 170 foreach (self::getInstalled() as $installed) { 171 if (!isset($installed['versions'][$packageName])) { 172 continue; 173 } 174 175 if (!isset($installed['versions'][$packageName]['version'])) { 176 return null; 177 } 178 179 return $installed['versions'][$packageName]['version']; 180 } 181 182 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); 183 } 184 185 /** 186 * @param string $packageName 187 * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present 188 */ 189 public static function getPrettyVersion($packageName) 190 { 191 foreach (self::getInstalled() as $installed) { 192 if (!isset($installed['versions'][$packageName])) { 193 continue; 194 } 195 196 if (!isset($installed['versions'][$packageName]['pretty_version'])) { 197 return null; 198 } 199 200 return $installed['versions'][$packageName]['pretty_version']; 201 } 202 203 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); 204 } 205 206 /** 207 * @param string $packageName 208 * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference 209 */ 210 public static function getReference($packageName) 211 { 212 foreach (self::getInstalled() as $installed) { 213 if (!isset($installed['versions'][$packageName])) { 214 continue; 215 } 216 217 if (!isset($installed['versions'][$packageName]['reference'])) { 218 return null; 219 } 220 221 return $installed['versions'][$packageName]['reference']; 222 } 223 224 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); 225 } 226 227 /** 228 * @param string $packageName 229 * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. 230 */ 231 public static function getInstallPath($packageName) 232 { 233 foreach (self::getInstalled() as $installed) { 234 if (!isset($installed['versions'][$packageName])) { 235 continue; 236 } 237 238 return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; 239 } 240 241 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); 242 } 243 244 /** 245 * @return array 246 * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} 247 */ 248 public static function getRootPackage() 249 { 250 $installed = self::getInstalled(); 251 252 return $installed[0]['root']; 253 } 254 255 /** 256 * Returns the raw installed.php data for custom implementations 257 * 258 * @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. 259 * @return array[] 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[]}>} 261 */ 262 public static function getRawData() 263 { 264 @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); 265 266 if (null === self::$installed) { 267 // only require the installed.php file if this file is loaded from its dumped location, 268 // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 269 if (substr(__DIR__, -8, 1) !== 'C') { 270 self::$installed = include __DIR__ . '/installed.php'; 271 } else { 272 self::$installed = array(); 273 } 274 } 275 276 return self::$installed; 277 } 278 279 /** 280 * Returns the raw data of all installed.php which are currently loaded for custom implementations 281 * 282 * @return array[] 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[]}>}> 284 */ 285 public static function getAllRawData() 286 { 287 return self::getInstalled(); 288 } 289 290 /** 291 * Lets you reload the static array from another file 292 * 293 * This is only useful for complex integrations in which a project needs to use 294 * this class but then also needs to execute another project's autoloader in process, 295 * and wants to ensure both projects have access to their version of installed.php. 296 * 297 * A typical case would be PHPUnit, where it would need to make sure it reads all 298 * the data it needs from this class, then call reload() with 299 * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure 300 * the project in which it runs can then also use this class safely, without 301 * interference between PHPUnit's dependencies and the project's dependencies. 302 * 303 * @param array[] $data A vendor/composer/installed.php data set 304 * @return void 305 * 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 307 */ 308 public static function reload($data) 309 { 310 self::$installed = $data; 311 self::$installedByVendor = array(); 312 } 313 314 /** 315 * @return array[] 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[]}>}> 317 */ 318 private static function getInstalled() 319 { 320 if (null === self::$canGetVendors) { 321 self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); 322 } 323 324 $installed = array(); 325 326 if (self::$canGetVendors) { 327 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { 328 if (isset(self::$installedByVendor[$vendorDir])) { 329 $installed[] = self::$installedByVendor[$vendorDir]; 330 } elseif (is_file($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; 334 if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { 335 self::$installed = $installed[count($installed) - 1]; 336 } 337 } 338 } 339 } 340 341 if (null === self::$installed) { 342 // only require the installed.php file if this file is loaded from its dumped location, 343 // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 344 if (substr(__DIR__, -8, 1) !== 'C') { 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; 348 } else { 349 self::$installed = array(); 350 } 351 } 352 353 if (self::$installed !== array()) { 354 $installed[] = self::$installed; 355 } 356 357 return $installed; 358 } 101 359 } 102 103 if (1 === \count($packages)) {104 return $packages[0];105 }106 107 return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));108 }109 110 111 112 113 114 115 116 117 118 public static function isInstalled($packageName)119 {120 foreach (self::getInstalled() as $installed) {121 if (isset($installed['versions'][$packageName])) {122 return true;123 }124 }125 126 return false;127 }128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 public static function satisfies(VersionParser $parser, $packageName, $constraint)143 {144 $constraint = $parser->parseConstraints($constraint);145 $provided = $parser->parseConstraints(self::getVersionRanges($packageName));146 147 return $provided->matches($constraint);148 }149 150 151 152 153 154 155 156 157 158 159 public static function getVersionRanges($packageName)160 {161 foreach (self::getInstalled() as $installed) {162 if (!isset($installed['versions'][$packageName])) {163 continue;164 }165 166 $ranges = array();167 if (isset($installed['versions'][$packageName]['pretty_version'])) {168 $ranges[] = $installed['versions'][$packageName]['pretty_version'];169 }170 if (array_key_exists('aliases', $installed['versions'][$packageName])) {171 $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);172 }173 if (array_key_exists('replaced', $installed['versions'][$packageName])) {174 $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);175 }176 if (array_key_exists('provided', $installed['versions'][$packageName])) {177 $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);178 }179 180 return implode(' || ', $ranges);181 }182 183 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');184 }185 186 187 188 189 190 public static function getVersion($packageName)191 {192 foreach (self::getInstalled() as $installed) {193 if (!isset($installed['versions'][$packageName])) {194 continue;195 }196 197 if (!isset($installed['versions'][$packageName]['version'])) {198 return null;199 }200 201 return $installed['versions'][$packageName]['version'];202 }203 204 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');205 }206 207 208 209 210 211 public static function getPrettyVersion($packageName)212 {213 foreach (self::getInstalled() as $installed) {214 if (!isset($installed['versions'][$packageName])) {215 continue;216 }217 218 if (!isset($installed['versions'][$packageName]['pretty_version'])) {219 return null;220 }221 222 return $installed['versions'][$packageName]['pretty_version'];223 }224 225 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');226 }227 228 229 230 231 232 public static function getReference($packageName)233 {234 foreach (self::getInstalled() as $installed) {235 if (!isset($installed['versions'][$packageName])) {236 continue;237 }238 239 if (!isset($installed['versions'][$packageName]['reference'])) {240 return null;241 }242 243 return $installed['versions'][$packageName]['reference'];244 }245 246 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');247 }248 249 250 251 252 253 public static function getRootPackage()254 {255 $installed = self::getInstalled();256 257 return $installed[0]['root'];258 }259 260 261 262 263 264 265 266 public static function getRawData()267 {268 return self::$installed;269 }270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 public static function reload($data)290 {291 self::$installed = $data;292 self::$installedByVendor = array();293 }294 295 296 297 298 299 private static function getInstalled()300 {301 if (null === self::$canGetVendors) {302 self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');303 }304 305 $installed = array();306 307 if (self::$canGetVendors) {308 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {309 if (isset(self::$installedByVendor[$vendorDir])) {310 $installed[] = self::$installedByVendor[$vendorDir];311 } elseif (is_file($vendorDir.'/composer/installed.php')) {312 $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';313 }314 }315 }316 317 $installed[] = self::$installed;318 319 return $installed;320 }321 } -
mpress-hide-from-search/tags/1.1.4/vendor/composer/autoload_classmap.php
r2507158 r2906632 3 3 // autoload_classmap.php @generated by Composer 4 4 5 $vendorDir = dirname( dirname(__FILE__));5 $vendorDir = dirname(__DIR__); 6 6 $baseDir = dirname($vendorDir); 7 7 -
mpress-hide-from-search/tags/1.1.4/vendor/composer/autoload_namespaces.php
r2328021 r2906632 3 3 // autoload_namespaces.php @generated by Composer 4 4 5 $vendorDir = dirname( dirname(__FILE__));5 $vendorDir = dirname(__DIR__); 6 6 $baseDir = dirname($vendorDir); 7 7 -
mpress-hide-from-search/tags/1.1.4/vendor/composer/autoload_psr4.php
r2328021 r2906632 3 3 // autoload_psr4.php @generated by Composer 4 4 5 $vendorDir = dirname( dirname(__FILE__));5 $vendorDir = dirname(__DIR__); 6 6 $baseDir = dirname($vendorDir); 7 7 -
mpress-hide-from-search/tags/1.1.4/vendor/composer/autoload_real.php
r2531747 r2906632 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit b07ca972432d775e6bc4de539c97e7cc5 class ComposerAutoloaderInitff7c20cb8ecfc15a5454f691a0eecf59 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit b07ca972432d775e6bc4de539c97e7cc', 'loadClassLoader'), true, true);28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname( \dirname(__FILE__)));29 spl_autoload_unregister(array('ComposerAutoloaderInit b07ca972432d775e6bc4de539c97e7cc', 'loadClassLoader'));27 spl_autoload_register(array('ComposerAutoloaderInitff7c20cb8ecfc15a5454f691a0eecf59', 'loadClassLoader'), true, true); 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInitff7c20cb8ecfc15a5454f691a0eecf59', 'loadClassLoader')); 30 30 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\ComposerStaticInitb07ca972432d775e6bc4de539c97e7cc::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\ComposerStaticInitff7c20cb8ecfc15a5454f691a0eecf59::getInitializer($loader)); 52 33 53 34 $loader->register(true); -
mpress-hide-from-search/tags/1.1.4/vendor/composer/autoload_static.php
r2531747 r2906632 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit b07ca972432d775e6bc4de539c97e7cc7 class ComposerStaticInitff7c20cb8ecfc15a5454f691a0eecf59 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 59 59 { 60 60 return \Closure::bind(function () use ($loader) { 61 $loader->prefixLengthsPsr4 = ComposerStaticInit b07ca972432d775e6bc4de539c97e7cc::$prefixLengthsPsr4;62 $loader->prefixDirsPsr4 = ComposerStaticInit b07ca972432d775e6bc4de539c97e7cc::$prefixDirsPsr4;63 $loader->classMap = ComposerStaticInit b07ca972432d775e6bc4de539c97e7cc::$classMap;61 $loader->prefixLengthsPsr4 = ComposerStaticInitff7c20cb8ecfc15a5454f691a0eecf59::$prefixLengthsPsr4; 62 $loader->prefixDirsPsr4 = ComposerStaticInitff7c20cb8ecfc15a5454f691a0eecf59::$prefixDirsPsr4; 63 $loader->classMap = ComposerStaticInitff7c20cb8ecfc15a5454f691a0eecf59::$classMap; 64 64 65 65 }, null, ClassLoader::class); -
mpress-hide-from-search/tags/1.1.4/vendor/composer/installed.php
r2531747 r2906632 1 <?php return array ( 2 'root' => 3 array ( 4 'pretty_version' => '1.1.3', 5 'version' => '1.1.3.0', 6 'aliases' => 7 array ( 1 <?php return array( 2 'root' => array( 3 'name' => 'wpscholar/mpress-hide-from-search', 4 'pretty_version' => '1.1.4', 5 'version' => '1.1.4.0', 6 'reference' => '70843b28b5f83753f5335647c31b0e8846c3d730', 7 'type' => 'wordpress-plugin', 8 'install_path' => __DIR__ . '/../../', 9 'aliases' => array(), 10 'dev' => false, 8 11 ), 9 'reference' => 'bd6f7d832ff2ac391f05faca0b5a96a5a9030163', 10 'name' => 'wpscholar/mpress-hide-from-search', 11 ), 12 'versions' => 13 array ( 14 'psr/container' => 15 array ( 16 'pretty_version' => '1.1.1', 17 'version' => '1.1.1.0', 18 'aliases' => 19 array ( 20 ), 21 'reference' => '8622567409010282b7aeebe4bb841fe98b58dcaf', 12 'versions' => array( 13 'psr/container' => array( 14 'pretty_version' => '1.1.2', 15 'version' => '1.1.2.0', 16 'reference' => '513e0666f7216c7459170d56df27dfcefe1689ea', 17 'type' => 'library', 18 'install_path' => __DIR__ . '/../psr/container', 19 'aliases' => array(), 20 'dev_requirement' => false, 21 ), 22 'wp-forge/container' => array( 23 'pretty_version' => '1.1', 24 'version' => '1.1.0.0', 25 'reference' => '1c48853f79b6319e4e7f14b9f3e28c2142ec89b5', 26 'type' => 'library', 27 'install_path' => __DIR__ . '/../wp-forge/container', 28 'aliases' => array(), 29 'dev_requirement' => false, 30 ), 31 'wp-forge/wp-plugin-check' => array( 32 'pretty_version' => '1.0', 33 'version' => '1.0.0.0', 34 'reference' => '3497a1bc557ae1108c11fb6cc694ae97ae2d4fc6', 35 'type' => 'library', 36 'install_path' => __DIR__ . '/../wp-forge/wp-plugin-check', 37 'aliases' => array(), 38 'dev_requirement' => false, 39 ), 40 'wp-forge/wp-upgrade-handler' => array( 41 'pretty_version' => '1.0', 42 'version' => '1.0.0.0', 43 'reference' => 'b0a7f4c66710f95b4c5702fea3af505ea72fb215', 44 'type' => 'library', 45 'install_path' => __DIR__ . '/../wp-forge/wp-upgrade-handler', 46 'aliases' => array(), 47 'dev_requirement' => false, 48 ), 49 'wpscholar/mpress-hide-from-search' => array( 50 'pretty_version' => '1.1.4', 51 'version' => '1.1.4.0', 52 'reference' => '70843b28b5f83753f5335647c31b0e8846c3d730', 53 'type' => 'wordpress-plugin', 54 'install_path' => __DIR__ . '/../../', 55 'aliases' => array(), 56 'dev_requirement' => false, 57 ), 22 58 ), 23 'wp-forge/container' =>24 array (25 'pretty_version' => '1.0',26 'version' => '1.0.0.0',27 'aliases' =>28 array (29 ),30 'reference' => 'e76a208d048b163dcb23068b149e16bdcfabc901',31 ),32 'wp-forge/wp-plugin-check' =>33 array (34 'pretty_version' => '1.0',35 'version' => '1.0.0.0',36 'aliases' =>37 array (38 ),39 'reference' => '3497a1bc557ae1108c11fb6cc694ae97ae2d4fc6',40 ),41 'wp-forge/wp-upgrade-handler' =>42 array (43 'pretty_version' => '1.0',44 'version' => '1.0.0.0',45 'aliases' =>46 array (47 ),48 'reference' => 'b0a7f4c66710f95b4c5702fea3af505ea72fb215',49 ),50 'wpscholar/mpress-hide-from-search' =>51 array (52 'pretty_version' => '1.1.3',53 'version' => '1.1.3.0',54 'aliases' =>55 array (56 ),57 'reference' => 'bd6f7d832ff2ac391f05faca0b5a96a5a9030163',58 ),59 ),60 59 ); -
mpress-hide-from-search/tags/1.1.4/vendor/composer/platform_check.php
r2507158 r2906632 5 5 $issues = array(); 6 6 7 if (!(PHP_VERSION_ID >= 70 200)) {8 $issues[] = 'Your Composer dependencies require a PHP version ">= 7. 2.0". You are running ' . PHP_VERSION . '.';7 if (!(PHP_VERSION_ID >= 70400)) { 8 $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.'; 9 9 } 10 10 -
mpress-hide-from-search/tags/1.1.4/vendor/psr/container/src/ContainerExceptionInterface.php
r2507158 r2906632 3 3 namespace Psr\Container; 4 4 5 use Throwable; 6 5 7 /** 6 8 * Base interface representing a generic exception in a container. 7 9 */ 8 interface ContainerExceptionInterface 10 interface ContainerExceptionInterface extends Throwable 9 11 { 10 12 } -
mpress-hide-from-search/tags/1.1.4/vendor/wp-forge/container/includes/Container.php
r2328021 r2906632 95 95 * @return bool 96 96 */ 97 public function has( $id ) {97 public function has( string $id ) { 98 98 return array_key_exists( $id, $this->entries ); 99 99 } … … 108 108 * @throws NotFoundException 109 109 */ 110 public function raw( $id ) {110 public function raw( string $id ) { 111 111 if ( ! $this->has( $id ) ) { 112 112 throw new NotFoundException( sprintf( 'No entry was found for "%s" identifier.', $id ) ); … … 125 125 * @throws NotFoundException No entry was found for **this** identifier. 126 126 */ 127 public function get( $id ) {127 public function get( string $id ) { 128 128 // Return class instance, if available. 129 129 if ( isset( $this->instances[ $id ] ) ) { … … 162 162 * @return $this 163 163 */ 164 public function set( $id, $value ) {164 public function set( string $id, $value ) { 165 165 $this->entries[ $id ] = $value; 166 166 … … 177 177 * @throws NotFoundException 178 178 */ 179 public function delete( $id ) {179 public function delete( string $id ) { 180 180 if ( $this->has( $id ) ) { 181 181 $value = $this->get( $id ); … … 200 200 * @return $this 201 201 */ 202 public function deleteInstance( $id ) {202 public function deleteInstance( string $id ) { 203 203 unset( $this->instances[ $id ] ); 204 204 … … 228 228 * @throws NotFoundException 229 229 */ 230 public function extend( $id, Closure $closure ) {230 public function extend( string $id, Closure $closure ) { 231 231 232 232 // Get the existing raw value -
mpress-hide-from-search/trunk/includes/MetaBox.php
r2328021 r2906632 26 26 add_meta_box( 27 27 'hide-from-search', 28 esc_html__( 'Hide from Search', ' hide-from-search' ),28 esc_html__( 'Hide from Search', 'mpress-hide-from-search' ), 29 29 array( __CLASS__, 'render' ), 30 30 $post_type, -
mpress-hide-from-search/trunk/includes/Plugin.php
r2531747 r2906632 117 117 array( 118 118 'type' => 'boolean', 119 'description' => esc_html__( 'Hide from WordPress search', ' hide-from-search' ),119 'description' => esc_html__( 'Hide from WordPress search', 'mpress-hide-from-search' ), 120 120 'single' => true, 121 121 'sanitize_callback' => function ( $value ) { … … 137 137 array( 138 138 'type' => 'boolean', 139 'description' => esc_html__( 'Hide from search engines', ' hide-from-search' ),139 'description' => esc_html__( 'Hide from search engines', 'mpress-hide-from-search' ), 140 140 'single' => true, 141 141 'sanitize_callback' => function ( $value ) { -
mpress-hide-from-search/trunk/languages/mpress-hide-from-search.pot
r2286622 r2906632 1 # Copyright (C) 202 0Micah Wood2 # This file is distributed under the GPL 3.1 # Copyright (C) 2023 Micah Wood 2 # This file is distributed under the GPL V2 or later. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Hide from Search 1.0.2\n" 6 "Report-Msgid-Bugs-To: " 7 "https://wordpress.org/support/plugin/mpress-hide-from-search\n" 8 "POT-Creation-Date: 2020-04-19 03:39:51+00:00\n" 9 "MIME-Version: 1.0\n" 10 "Content-Type: text/plain; charset=utf-8\n" 11 "Content-Transfer-Encoding: 8bit\n" 12 "PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n" 5 "Project-Id-Version: Hide from Search 1.1.4\n" 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mpress-hide-from-search\n" 13 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 14 8 "Language-Team: LANGUAGE <[email protected]>\n" 15 "X-Generator: node-wp-i18n 1.2.3\n" 9 "MIME-Version: 1.0\n" 10 "Content-Type: text/plain; charset=UTF-8\n" 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: \n" 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2.7.1\n" 15 "X-Domain: mpress-hide-from-search\n" 16 16 17 #. Plugin Name of the plugin/theme 17 #. Plugin Name of the plugin 18 #: includes/MetaBox.php:28 18 19 msgid "Hide from Search" 19 20 msgstr "" 20 21 21 #: mpress-hide-from-search.php:104 22 #. translators: post type 23 msgid "Hide this %s from WordPress search" 22 #. Plugin URI of the plugin 23 msgid "https://wordpress.org/plugins/mpress-hide-from-search/" 24 24 msgstr "" 25 25 26 #. Plugin URI of the plugin/theme27 msgid " https://wpscholar.com/wordpress-plugins/mpress-hide-from-search/"26 #. Description of the plugin 27 msgid "Hide individual WordPress pages from search engines and/or WordPress search results." 28 28 msgstr "" 29 29 30 #. Description of the plugin/theme 31 msgid "" 32 "Hide individual posts, pages and other post types from the default " 33 "WordPress search functionality." 34 msgstr "" 35 36 #. Author of the plugin/theme 30 #. Author of the plugin 37 31 msgid "Micah Wood" 38 32 msgstr "" 39 33 40 #. Author URI of the plugin /theme41 msgid "https://wpscholar.com /"34 #. Author URI of the plugin 35 msgid "https://wpscholar.com" 42 36 msgstr "" 37 38 #: includes/Plugin.php:119 39 msgid "Hide from WordPress search" 40 msgstr "" 41 42 #: includes/Plugin.php:139 43 msgid "Hide from search engines" 44 msgstr "" -
mpress-hide-from-search/trunk/mpress-hide-from-search.php
r2531747 r2906632 5 5 * @package HideFromSearch 6 6 * @author Micah Wood 7 * @copyright Copyright 2020 by Micah Wood - All rights reserved.7 * @copyright Copyright 2020-2023 by Micah Wood - All rights reserved. 8 8 * @license GPL2.0-or-later 9 9 * … … 12 12 * Plugin URI: https://wordpress.org/plugins/mpress-hide-from-search/ 13 13 * Description: Hide individual WordPress pages from search engines and/or WordPress search results. 14 * Version: 1.1. 315 * Requires PHP: 5.616 * Requires at least: 5.014 * Version: 1.1.4 15 * Requires PHP: 7.4 16 * Requires at least: 6.0 17 17 * Author: Micah Wood 18 18 * Author URI: https://wpscholar.com … … 23 23 */ 24 24 25 define( 'HIDE_FROM_SEARCH_VERSION', '1.1. 3' );25 define( 'HIDE_FROM_SEARCH_VERSION', '1.1.4' ); 26 26 define( 'HIDE_FROM_SEARCH_FILE', __FILE__ ); 27 27 28 require dirname( __FILE__ ). '/vendor/autoload.php';28 require __DIR__ . '/vendor/autoload.php'; 29 29 30 30 // Check plugin requirements … … 33 33 $plugin_check = new WP_Forge_Plugin_Check( __FILE__ ); 34 34 35 $plugin_check->min_php_version = ' 5.6';36 $plugin_check->min_wp_version = ' 5.0';35 $plugin_check->min_php_version = '7.4'; 36 $plugin_check->min_wp_version = '6.0'; 37 37 $plugin_check->check_plugin_requirements(); 38 38 } 39 39 40 require dirname( __FILE__ ). '/includes/Plugin.php';40 require __DIR__ . '/includes/Plugin.php'; -
mpress-hide-from-search/trunk/readme.txt
r2531747 r2906632 3 3 Donate link: https://www.paypal.me/wpscholar 4 4 Tags: search, search engines, WordPress search, hide from search, exclude from search, hide post, hidden posts 5 Requires at least: 5.06 Requires PHP: 5.67 Tested up to: 5.78 Stable tag: 1.1. 35 Requires at least: 6.0 6 Requires PHP: 7.4 7 Tested up to: 6.2 8 Stable tag: 1.1.4 9 9 License: GPLv3 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 67 67 == Changelog == 68 68 69 = 1.1.4 = 70 * Minor maintenance release 71 69 72 = 1.1.3 = 70 73 * Fix PHP notice when Yoast SEO is active … … 121 124 == Upgrade Notice == 122 125 126 = 1.1.4 = 127 * Minor maintenance release 128 123 129 = 1.1.3 = 124 130 * Bugfix and security release. -
mpress-hide-from-search/trunk/vendor/autoload.php
r2531747 r2906632 3 3 // autoload.php @generated by Composer 4 4 5 if (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 5 23 require_once __DIR__ . '/composer/autoload_real.php'; 6 24 7 return ComposerAutoloaderInit b07ca972432d775e6bc4de539c97e7cc::getLoader();25 return ComposerAutoloaderInitff7c20cb8ecfc15a5454f691a0eecf59::getLoader(); -
mpress-hide-from-search/trunk/vendor/composer/ClassLoader.php
r2507158 r2906632 43 43 class ClassLoader 44 44 { 45 /** @var \Closure(string):void */ 46 private static $includeFile; 47 48 /** @var ?string */ 45 49 private $vendorDir; 46 50 47 51 // PSR-4 52 /** 53 * @var array[] 54 * @psalm-var array<string, array<string, int>> 55 */ 48 56 private $prefixLengthsPsr4 = array(); 57 /** 58 * @var array[] 59 * @psalm-var array<string, array<int, string>> 60 */ 49 61 private $prefixDirsPsr4 = array(); 62 /** 63 * @var array[] 64 * @psalm-var array<string, string> 65 */ 50 66 private $fallbackDirsPsr4 = array(); 51 67 52 68 // PSR-0 69 /** 70 * @var array[] 71 * @psalm-var array<string, array<string, string[]>> 72 */ 53 73 private $prefixesPsr0 = array(); 74 /** 75 * @var array[] 76 * @psalm-var array<string, string> 77 */ 54 78 private $fallbackDirsPsr0 = array(); 55 79 80 /** @var bool */ 56 81 private $useIncludePath = false; 82 83 /** 84 * @var string[] 85 * @psalm-var array<string, string> 86 */ 57 87 private $classMap = array(); 88 89 /** @var bool */ 58 90 private $classMapAuthoritative = false; 91 92 /** 93 * @var bool[] 94 * @psalm-var array<string, bool> 95 */ 59 96 private $missingClasses = array(); 97 98 /** @var ?string */ 60 99 private $apcuPrefix; 61 100 101 /** 102 * @var self[] 103 */ 62 104 private static $registeredLoaders = array(); 63 105 106 /** 107 * @param ?string $vendorDir 108 */ 64 109 public function __construct($vendorDir = null) 65 110 { 66 111 $this->vendorDir = $vendorDir; 67 } 68 112 self::initializeIncludeClosure(); 113 } 114 115 /** 116 * @return string[] 117 */ 69 118 public function getPrefixes() 70 119 { … … 76 125 } 77 126 127 /** 128 * @return array[] 129 * @psalm-return array<string, array<int, string>> 130 */ 78 131 public function getPrefixesPsr4() 79 132 { … … 81 134 } 82 135 136 /** 137 * @return array[] 138 * @psalm-return array<string, string> 139 */ 83 140 public function getFallbackDirs() 84 141 { … … 86 143 } 87 144 145 /** 146 * @return array[] 147 * @psalm-return array<string, string> 148 */ 88 149 public function getFallbackDirsPsr4() 89 150 { … … 91 152 } 92 153 154 /** 155 * @return string[] Array of classname => path 156 * @psalm-return array<string, string> 157 */ 93 158 public function getClassMap() 94 159 { … … 97 162 98 163 /** 99 * @param array $classMap Class to filename map 164 * @param string[] $classMap Class to filename map 165 * @psalm-param array<string, string> $classMap 166 * 167 * @return void 100 168 */ 101 169 public function addClassMap(array $classMap) … … 112 180 * appending or prepending to the ones previously set for this prefix. 113 181 * 114 * @param string $prefix The prefix 115 * @param array|string $paths The PSR-0 root directories 116 * @param bool $prepend Whether to prepend the directories 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 185 * 186 * @return void 117 187 */ 118 188 public function add($prefix, $paths, $prepend = false) … … 157 227 * appending or prepending to the ones previously set for this namespace. 158 228 * 159 * @param string $prefix The prefix/namespace, with trailing '\\'160 * @param array|string $paths The PSR-4 base directories161 * @param bool $prepend Whether to prepend the directories229 * @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 162 232 * 163 233 * @throws \InvalidArgumentException 234 * 235 * @return void 164 236 */ 165 237 public function addPsr4($prefix, $paths, $prepend = false) … … 205 277 * replacing any others previously set for this prefix. 206 278 * 207 * @param string $prefix The prefix 208 * @param array|string $paths The PSR-0 base directories 279 * @param string $prefix The prefix 280 * @param string[]|string $paths The PSR-0 base directories 281 * 282 * @return void 209 283 */ 210 284 public function set($prefix, $paths) … … 221 295 * replacing any others previously set for this namespace. 222 296 * 223 * @param string $prefix The prefix/namespace, with trailing '\\'224 * @param array|string $paths The PSR-4 base directories297 * @param string $prefix The prefix/namespace, with trailing '\\' 298 * @param string[]|string $paths The PSR-4 base directories 225 299 * 226 300 * @throws \InvalidArgumentException 301 * 302 * @return void 227 303 */ 228 304 public function setPsr4($prefix, $paths) … … 244 320 * 245 321 * @param bool $useIncludePath 322 * 323 * @return void 246 324 */ 247 325 public function setUseIncludePath($useIncludePath) … … 266 344 * 267 345 * @param bool $classMapAuthoritative 346 * 347 * @return void 268 348 */ 269 349 public function setClassMapAuthoritative($classMapAuthoritative) … … 286 366 * 287 367 * @param string|null $apcuPrefix 368 * 369 * @return void 288 370 */ 289 371 public function setApcuPrefix($apcuPrefix) … … 306 388 * 307 389 * @param bool $prepend Whether to prepend the autoloader or not 390 * 391 * @return void 308 392 */ 309 393 public function register($prepend = false) … … 325 409 /** 326 410 * Unregisters this instance as an autoloader. 411 * 412 * @return void 327 413 */ 328 414 public function unregister() … … 339 425 * 340 426 * @param string $class The name of the class 341 * @return bool|null True if loaded, null otherwise427 * @return true|null True if loaded, null otherwise 342 428 */ 343 429 public function loadClass($class) 344 430 { 345 431 if ($file = $this->findFile($class)) { 346 includeFile($file); 432 $includeFile = self::$includeFile; 433 $includeFile($file); 347 434 348 435 return true; 349 436 } 437 438 return null; 350 439 } 351 440 … … 402 491 } 403 492 493 /** 494 * @param string $class 495 * @param string $ext 496 * @return string|false 497 */ 404 498 private function findFileWithExtension($class, $ext) 405 499 { … … 467 561 return false; 468 562 } 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 } 469 585 } 470 471 /**472 * Scope isolated include.473 *474 * Prevents access to $this/self from included files.475 */476 function includeFile($file)477 {478 include $file;479 } -
mpress-hide-from-search/trunk/vendor/composer/InstalledVersions.php
r2531747 r2906632 1 1 <?php 2 2 3 4 5 6 7 8 9 10 11 3 /* 4 * This file is part of Composer. 5 * 6 * (c) Nils Adermann <[email protected]> 7 * Jordi Boggiano <[email protected]> 8 * 9 * For the full copyright and license information, please view the LICENSE 10 * file that was distributed with this source code. 11 */ 12 12 13 13 namespace Composer; … … 16 16 use Composer\Semver\VersionParser; 17 17 18 19 20 21 22 23 24 18 /** 19 * This class is copied in every Composer installed project and available to all 20 * 21 * See also https://getcomposer.org/doc/07-runtime.md#installed-versions 22 * 23 * To require its presence, you can require `composer-runtime-api ^2.0` 24 * 25 * @final 26 */ 25 27 class InstalledVersions 26 28 { 27 private static $installed = array ( 28 'root' => 29 array ( 30 'pretty_version' => '1.1.3', 31 'version' => '1.1.3.0', 32 'aliases' => 33 array ( 34 ), 35 'reference' => 'bd6f7d832ff2ac391f05faca0b5a96a5a9030163', 36 'name' => 'wpscholar/mpress-hide-from-search', 37 ), 38 'versions' => 39 array ( 40 'psr/container' => 41 array ( 42 'pretty_version' => '1.1.1', 43 'version' => '1.1.1.0', 44 'aliases' => 45 array ( 46 ), 47 'reference' => '8622567409010282b7aeebe4bb841fe98b58dcaf', 48 ), 49 'wp-forge/container' => 50 array ( 51 'pretty_version' => '1.0', 52 'version' => '1.0.0.0', 53 'aliases' => 54 array ( 55 ), 56 'reference' => 'e76a208d048b163dcb23068b149e16bdcfabc901', 57 ), 58 'wp-forge/wp-plugin-check' => 59 array ( 60 'pretty_version' => '1.0', 61 'version' => '1.0.0.0', 62 'aliases' => 63 array ( 64 ), 65 'reference' => '3497a1bc557ae1108c11fb6cc694ae97ae2d4fc6', 66 ), 67 'wp-forge/wp-upgrade-handler' => 68 array ( 69 'pretty_version' => '1.0', 70 'version' => '1.0.0.0', 71 'aliases' => 72 array ( 73 ), 74 'reference' => 'b0a7f4c66710f95b4c5702fea3af505ea72fb215', 75 ), 76 'wpscholar/mpress-hide-from-search' => 77 array ( 78 'pretty_version' => '1.1.3', 79 'version' => '1.1.3.0', 80 'aliases' => 81 array ( 82 ), 83 'reference' => 'bd6f7d832ff2ac391f05faca0b5a96a5a9030163', 84 ), 85 ), 86 ); 87 private static $canGetVendors; 88 private static $installedByVendor = array(); 89 90 91 92 93 94 95 96 public static function getInstalledPackages() 97 { 98 $packages = array(); 99 foreach (self::getInstalled() as $installed) { 100 $packages[] = array_keys($installed['versions']); 29 /** 30 * @var mixed[]|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 32 */ 33 private static $installed; 34 35 /** 36 * @var bool|null 37 */ 38 private static $canGetVendors; 39 40 /** 41 * @var array[] 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[]}>}> 43 */ 44 private static $installedByVendor = array(); 45 46 /** 47 * Returns a list of all package names which are present, either by being installed, replaced or provided 48 * 49 * @return string[] 50 * @psalm-return list<string> 51 */ 52 public static function getInstalledPackages() 53 { 54 $packages = array(); 55 foreach (self::getInstalled() as $installed) { 56 $packages[] = array_keys($installed['versions']); 57 } 58 59 if (1 === \count($packages)) { 60 return $packages[0]; 61 } 62 63 return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); 64 } 65 66 /** 67 * Returns a list of all package names with a specific type e.g. 'library' 68 * 69 * @param string $type 70 * @return string[] 71 * @psalm-return list<string> 72 */ 73 public static function getInstalledPackagesByType($type) 74 { 75 $packagesByType = array(); 76 77 foreach (self::getInstalled() as $installed) { 78 foreach ($installed['versions'] as $name => $package) { 79 if (isset($package['type']) && $package['type'] === $type) { 80 $packagesByType[] = $name; 81 } 82 } 83 } 84 85 return $packagesByType; 86 } 87 88 /** 89 * Checks whether the given package is installed 90 * 91 * This also returns true if the package name is provided or replaced by another package 92 * 93 * @param string $packageName 94 * @param bool $includeDevRequirements 95 * @return bool 96 */ 97 public static function isInstalled($packageName, $includeDevRequirements = true) 98 { 99 foreach (self::getInstalled() as $installed) { 100 if (isset($installed['versions'][$packageName])) { 101 return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; 102 } 103 } 104 105 return false; 106 } 107 108 /** 109 * Checks whether the given package satisfies a version constraint 110 * 111 * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: 112 * 113 * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') 114 * 115 * @param VersionParser $parser Install composer/semver to have access to this class and functionality 116 * @param string $packageName 117 * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package 118 * @return bool 119 */ 120 public static function satisfies(VersionParser $parser, $packageName, $constraint) 121 { 122 $constraint = $parser->parseConstraints((string) $constraint); 123 $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); 124 125 return $provided->matches($constraint); 126 } 127 128 /** 129 * Returns a version constraint representing all the range(s) which are installed for a given package 130 * 131 * It is easier to use this via isInstalled() with the $constraint argument if you need to check 132 * whether a given version of a package is installed, and not just whether it exists 133 * 134 * @param string $packageName 135 * @return string Version constraint usable with composer/semver 136 */ 137 public static function getVersionRanges($packageName) 138 { 139 foreach (self::getInstalled() as $installed) { 140 if (!isset($installed['versions'][$packageName])) { 141 continue; 142 } 143 144 $ranges = array(); 145 if (isset($installed['versions'][$packageName]['pretty_version'])) { 146 $ranges[] = $installed['versions'][$packageName]['pretty_version']; 147 } 148 if (array_key_exists('aliases', $installed['versions'][$packageName])) { 149 $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); 150 } 151 if (array_key_exists('replaced', $installed['versions'][$packageName])) { 152 $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); 153 } 154 if (array_key_exists('provided', $installed['versions'][$packageName])) { 155 $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); 156 } 157 158 return implode(' || ', $ranges); 159 } 160 161 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); 162 } 163 164 /** 165 * @param string $packageName 166 * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present 167 */ 168 public static function getVersion($packageName) 169 { 170 foreach (self::getInstalled() as $installed) { 171 if (!isset($installed['versions'][$packageName])) { 172 continue; 173 } 174 175 if (!isset($installed['versions'][$packageName]['version'])) { 176 return null; 177 } 178 179 return $installed['versions'][$packageName]['version']; 180 } 181 182 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); 183 } 184 185 /** 186 * @param string $packageName 187 * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present 188 */ 189 public static function getPrettyVersion($packageName) 190 { 191 foreach (self::getInstalled() as $installed) { 192 if (!isset($installed['versions'][$packageName])) { 193 continue; 194 } 195 196 if (!isset($installed['versions'][$packageName]['pretty_version'])) { 197 return null; 198 } 199 200 return $installed['versions'][$packageName]['pretty_version']; 201 } 202 203 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); 204 } 205 206 /** 207 * @param string $packageName 208 * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference 209 */ 210 public static function getReference($packageName) 211 { 212 foreach (self::getInstalled() as $installed) { 213 if (!isset($installed['versions'][$packageName])) { 214 continue; 215 } 216 217 if (!isset($installed['versions'][$packageName]['reference'])) { 218 return null; 219 } 220 221 return $installed['versions'][$packageName]['reference']; 222 } 223 224 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); 225 } 226 227 /** 228 * @param string $packageName 229 * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. 230 */ 231 public static function getInstallPath($packageName) 232 { 233 foreach (self::getInstalled() as $installed) { 234 if (!isset($installed['versions'][$packageName])) { 235 continue; 236 } 237 238 return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; 239 } 240 241 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); 242 } 243 244 /** 245 * @return array 246 * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} 247 */ 248 public static function getRootPackage() 249 { 250 $installed = self::getInstalled(); 251 252 return $installed[0]['root']; 253 } 254 255 /** 256 * Returns the raw installed.php data for custom implementations 257 * 258 * @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. 259 * @return array[] 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[]}>} 261 */ 262 public static function getRawData() 263 { 264 @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); 265 266 if (null === self::$installed) { 267 // only require the installed.php file if this file is loaded from its dumped location, 268 // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 269 if (substr(__DIR__, -8, 1) !== 'C') { 270 self::$installed = include __DIR__ . '/installed.php'; 271 } else { 272 self::$installed = array(); 273 } 274 } 275 276 return self::$installed; 277 } 278 279 /** 280 * Returns the raw data of all installed.php which are currently loaded for custom implementations 281 * 282 * @return array[] 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[]}>}> 284 */ 285 public static function getAllRawData() 286 { 287 return self::getInstalled(); 288 } 289 290 /** 291 * Lets you reload the static array from another file 292 * 293 * This is only useful for complex integrations in which a project needs to use 294 * this class but then also needs to execute another project's autoloader in process, 295 * and wants to ensure both projects have access to their version of installed.php. 296 * 297 * A typical case would be PHPUnit, where it would need to make sure it reads all 298 * the data it needs from this class, then call reload() with 299 * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure 300 * the project in which it runs can then also use this class safely, without 301 * interference between PHPUnit's dependencies and the project's dependencies. 302 * 303 * @param array[] $data A vendor/composer/installed.php data set 304 * @return void 305 * 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 307 */ 308 public static function reload($data) 309 { 310 self::$installed = $data; 311 self::$installedByVendor = array(); 312 } 313 314 /** 315 * @return array[] 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[]}>}> 317 */ 318 private static function getInstalled() 319 { 320 if (null === self::$canGetVendors) { 321 self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); 322 } 323 324 $installed = array(); 325 326 if (self::$canGetVendors) { 327 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { 328 if (isset(self::$installedByVendor[$vendorDir])) { 329 $installed[] = self::$installedByVendor[$vendorDir]; 330 } elseif (is_file($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; 334 if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { 335 self::$installed = $installed[count($installed) - 1]; 336 } 337 } 338 } 339 } 340 341 if (null === self::$installed) { 342 // only require the installed.php file if this file is loaded from its dumped location, 343 // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 344 if (substr(__DIR__, -8, 1) !== 'C') { 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; 348 } else { 349 self::$installed = array(); 350 } 351 } 352 353 if (self::$installed !== array()) { 354 $installed[] = self::$installed; 355 } 356 357 return $installed; 358 } 101 359 } 102 103 if (1 === \count($packages)) {104 return $packages[0];105 }106 107 return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));108 }109 110 111 112 113 114 115 116 117 118 public static function isInstalled($packageName)119 {120 foreach (self::getInstalled() as $installed) {121 if (isset($installed['versions'][$packageName])) {122 return true;123 }124 }125 126 return false;127 }128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 public static function satisfies(VersionParser $parser, $packageName, $constraint)143 {144 $constraint = $parser->parseConstraints($constraint);145 $provided = $parser->parseConstraints(self::getVersionRanges($packageName));146 147 return $provided->matches($constraint);148 }149 150 151 152 153 154 155 156 157 158 159 public static function getVersionRanges($packageName)160 {161 foreach (self::getInstalled() as $installed) {162 if (!isset($installed['versions'][$packageName])) {163 continue;164 }165 166 $ranges = array();167 if (isset($installed['versions'][$packageName]['pretty_version'])) {168 $ranges[] = $installed['versions'][$packageName]['pretty_version'];169 }170 if (array_key_exists('aliases', $installed['versions'][$packageName])) {171 $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);172 }173 if (array_key_exists('replaced', $installed['versions'][$packageName])) {174 $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);175 }176 if (array_key_exists('provided', $installed['versions'][$packageName])) {177 $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);178 }179 180 return implode(' || ', $ranges);181 }182 183 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');184 }185 186 187 188 189 190 public static function getVersion($packageName)191 {192 foreach (self::getInstalled() as $installed) {193 if (!isset($installed['versions'][$packageName])) {194 continue;195 }196 197 if (!isset($installed['versions'][$packageName]['version'])) {198 return null;199 }200 201 return $installed['versions'][$packageName]['version'];202 }203 204 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');205 }206 207 208 209 210 211 public static function getPrettyVersion($packageName)212 {213 foreach (self::getInstalled() as $installed) {214 if (!isset($installed['versions'][$packageName])) {215 continue;216 }217 218 if (!isset($installed['versions'][$packageName]['pretty_version'])) {219 return null;220 }221 222 return $installed['versions'][$packageName]['pretty_version'];223 }224 225 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');226 }227 228 229 230 231 232 public static function getReference($packageName)233 {234 foreach (self::getInstalled() as $installed) {235 if (!isset($installed['versions'][$packageName])) {236 continue;237 }238 239 if (!isset($installed['versions'][$packageName]['reference'])) {240 return null;241 }242 243 return $installed['versions'][$packageName]['reference'];244 }245 246 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');247 }248 249 250 251 252 253 public static function getRootPackage()254 {255 $installed = self::getInstalled();256 257 return $installed[0]['root'];258 }259 260 261 262 263 264 265 266 public static function getRawData()267 {268 return self::$installed;269 }270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 public static function reload($data)290 {291 self::$installed = $data;292 self::$installedByVendor = array();293 }294 295 296 297 298 299 private static function getInstalled()300 {301 if (null === self::$canGetVendors) {302 self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');303 }304 305 $installed = array();306 307 if (self::$canGetVendors) {308 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {309 if (isset(self::$installedByVendor[$vendorDir])) {310 $installed[] = self::$installedByVendor[$vendorDir];311 } elseif (is_file($vendorDir.'/composer/installed.php')) {312 $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';313 }314 }315 }316 317 $installed[] = self::$installed;318 319 return $installed;320 }321 } -
mpress-hide-from-search/trunk/vendor/composer/autoload_classmap.php
r2507158 r2906632 3 3 // autoload_classmap.php @generated by Composer 4 4 5 $vendorDir = dirname( dirname(__FILE__));5 $vendorDir = dirname(__DIR__); 6 6 $baseDir = dirname($vendorDir); 7 7 -
mpress-hide-from-search/trunk/vendor/composer/autoload_namespaces.php
r2328021 r2906632 3 3 // autoload_namespaces.php @generated by Composer 4 4 5 $vendorDir = dirname( dirname(__FILE__));5 $vendorDir = dirname(__DIR__); 6 6 $baseDir = dirname($vendorDir); 7 7 -
mpress-hide-from-search/trunk/vendor/composer/autoload_psr4.php
r2328021 r2906632 3 3 // autoload_psr4.php @generated by Composer 4 4 5 $vendorDir = dirname( dirname(__FILE__));5 $vendorDir = dirname(__DIR__); 6 6 $baseDir = dirname($vendorDir); 7 7 -
mpress-hide-from-search/trunk/vendor/composer/autoload_real.php
r2531747 r2906632 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit b07ca972432d775e6bc4de539c97e7cc5 class ComposerAutoloaderInitff7c20cb8ecfc15a5454f691a0eecf59 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit b07ca972432d775e6bc4de539c97e7cc', 'loadClassLoader'), true, true);28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname( \dirname(__FILE__)));29 spl_autoload_unregister(array('ComposerAutoloaderInit b07ca972432d775e6bc4de539c97e7cc', 'loadClassLoader'));27 spl_autoload_register(array('ComposerAutoloaderInitff7c20cb8ecfc15a5454f691a0eecf59', 'loadClassLoader'), true, true); 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInitff7c20cb8ecfc15a5454f691a0eecf59', 'loadClassLoader')); 30 30 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\ComposerStaticInitb07ca972432d775e6bc4de539c97e7cc::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\ComposerStaticInitff7c20cb8ecfc15a5454f691a0eecf59::getInitializer($loader)); 52 33 53 34 $loader->register(true); -
mpress-hide-from-search/trunk/vendor/composer/autoload_static.php
r2531747 r2906632 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit b07ca972432d775e6bc4de539c97e7cc7 class ComposerStaticInitff7c20cb8ecfc15a5454f691a0eecf59 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 59 59 { 60 60 return \Closure::bind(function () use ($loader) { 61 $loader->prefixLengthsPsr4 = ComposerStaticInit b07ca972432d775e6bc4de539c97e7cc::$prefixLengthsPsr4;62 $loader->prefixDirsPsr4 = ComposerStaticInit b07ca972432d775e6bc4de539c97e7cc::$prefixDirsPsr4;63 $loader->classMap = ComposerStaticInit b07ca972432d775e6bc4de539c97e7cc::$classMap;61 $loader->prefixLengthsPsr4 = ComposerStaticInitff7c20cb8ecfc15a5454f691a0eecf59::$prefixLengthsPsr4; 62 $loader->prefixDirsPsr4 = ComposerStaticInitff7c20cb8ecfc15a5454f691a0eecf59::$prefixDirsPsr4; 63 $loader->classMap = ComposerStaticInitff7c20cb8ecfc15a5454f691a0eecf59::$classMap; 64 64 65 65 }, null, ClassLoader::class); -
mpress-hide-from-search/trunk/vendor/composer/installed.php
r2531747 r2906632 1 <?php return array ( 2 'root' => 3 array ( 4 'pretty_version' => '1.1.3', 5 'version' => '1.1.3.0', 6 'aliases' => 7 array ( 1 <?php return array( 2 'root' => array( 3 'name' => 'wpscholar/mpress-hide-from-search', 4 'pretty_version' => '1.1.4', 5 'version' => '1.1.4.0', 6 'reference' => '70843b28b5f83753f5335647c31b0e8846c3d730', 7 'type' => 'wordpress-plugin', 8 'install_path' => __DIR__ . '/../../', 9 'aliases' => array(), 10 'dev' => false, 8 11 ), 9 'reference' => 'bd6f7d832ff2ac391f05faca0b5a96a5a9030163', 10 'name' => 'wpscholar/mpress-hide-from-search', 11 ), 12 'versions' => 13 array ( 14 'psr/container' => 15 array ( 16 'pretty_version' => '1.1.1', 17 'version' => '1.1.1.0', 18 'aliases' => 19 array ( 20 ), 21 'reference' => '8622567409010282b7aeebe4bb841fe98b58dcaf', 12 'versions' => array( 13 'psr/container' => array( 14 'pretty_version' => '1.1.2', 15 'version' => '1.1.2.0', 16 'reference' => '513e0666f7216c7459170d56df27dfcefe1689ea', 17 'type' => 'library', 18 'install_path' => __DIR__ . '/../psr/container', 19 'aliases' => array(), 20 'dev_requirement' => false, 21 ), 22 'wp-forge/container' => array( 23 'pretty_version' => '1.1', 24 'version' => '1.1.0.0', 25 'reference' => '1c48853f79b6319e4e7f14b9f3e28c2142ec89b5', 26 'type' => 'library', 27 'install_path' => __DIR__ . '/../wp-forge/container', 28 'aliases' => array(), 29 'dev_requirement' => false, 30 ), 31 'wp-forge/wp-plugin-check' => array( 32 'pretty_version' => '1.0', 33 'version' => '1.0.0.0', 34 'reference' => '3497a1bc557ae1108c11fb6cc694ae97ae2d4fc6', 35 'type' => 'library', 36 'install_path' => __DIR__ . '/../wp-forge/wp-plugin-check', 37 'aliases' => array(), 38 'dev_requirement' => false, 39 ), 40 'wp-forge/wp-upgrade-handler' => array( 41 'pretty_version' => '1.0', 42 'version' => '1.0.0.0', 43 'reference' => 'b0a7f4c66710f95b4c5702fea3af505ea72fb215', 44 'type' => 'library', 45 'install_path' => __DIR__ . '/../wp-forge/wp-upgrade-handler', 46 'aliases' => array(), 47 'dev_requirement' => false, 48 ), 49 'wpscholar/mpress-hide-from-search' => array( 50 'pretty_version' => '1.1.4', 51 'version' => '1.1.4.0', 52 'reference' => '70843b28b5f83753f5335647c31b0e8846c3d730', 53 'type' => 'wordpress-plugin', 54 'install_path' => __DIR__ . '/../../', 55 'aliases' => array(), 56 'dev_requirement' => false, 57 ), 22 58 ), 23 'wp-forge/container' =>24 array (25 'pretty_version' => '1.0',26 'version' => '1.0.0.0',27 'aliases' =>28 array (29 ),30 'reference' => 'e76a208d048b163dcb23068b149e16bdcfabc901',31 ),32 'wp-forge/wp-plugin-check' =>33 array (34 'pretty_version' => '1.0',35 'version' => '1.0.0.0',36 'aliases' =>37 array (38 ),39 'reference' => '3497a1bc557ae1108c11fb6cc694ae97ae2d4fc6',40 ),41 'wp-forge/wp-upgrade-handler' =>42 array (43 'pretty_version' => '1.0',44 'version' => '1.0.0.0',45 'aliases' =>46 array (47 ),48 'reference' => 'b0a7f4c66710f95b4c5702fea3af505ea72fb215',49 ),50 'wpscholar/mpress-hide-from-search' =>51 array (52 'pretty_version' => '1.1.3',53 'version' => '1.1.3.0',54 'aliases' =>55 array (56 ),57 'reference' => 'bd6f7d832ff2ac391f05faca0b5a96a5a9030163',58 ),59 ),60 59 ); -
mpress-hide-from-search/trunk/vendor/composer/platform_check.php
r2507158 r2906632 5 5 $issues = array(); 6 6 7 if (!(PHP_VERSION_ID >= 70 200)) {8 $issues[] = 'Your Composer dependencies require a PHP version ">= 7. 2.0". You are running ' . PHP_VERSION . '.';7 if (!(PHP_VERSION_ID >= 70400)) { 8 $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.'; 9 9 } 10 10 -
mpress-hide-from-search/trunk/vendor/psr/container/src/ContainerExceptionInterface.php
r2507158 r2906632 3 3 namespace Psr\Container; 4 4 5 use Throwable; 6 5 7 /** 6 8 * Base interface representing a generic exception in a container. 7 9 */ 8 interface ContainerExceptionInterface 10 interface ContainerExceptionInterface extends Throwable 9 11 { 10 12 } -
mpress-hide-from-search/trunk/vendor/wp-forge/container/includes/Container.php
r2328021 r2906632 95 95 * @return bool 96 96 */ 97 public function has( $id ) {97 public function has( string $id ) { 98 98 return array_key_exists( $id, $this->entries ); 99 99 } … … 108 108 * @throws NotFoundException 109 109 */ 110 public function raw( $id ) {110 public function raw( string $id ) { 111 111 if ( ! $this->has( $id ) ) { 112 112 throw new NotFoundException( sprintf( 'No entry was found for "%s" identifier.', $id ) ); … … 125 125 * @throws NotFoundException No entry was found for **this** identifier. 126 126 */ 127 public function get( $id ) {127 public function get( string $id ) { 128 128 // Return class instance, if available. 129 129 if ( isset( $this->instances[ $id ] ) ) { … … 162 162 * @return $this 163 163 */ 164 public function set( $id, $value ) {164 public function set( string $id, $value ) { 165 165 $this->entries[ $id ] = $value; 166 166 … … 177 177 * @throws NotFoundException 178 178 */ 179 public function delete( $id ) {179 public function delete( string $id ) { 180 180 if ( $this->has( $id ) ) { 181 181 $value = $this->get( $id ); … … 200 200 * @return $this 201 201 */ 202 public function deleteInstance( $id ) {202 public function deleteInstance( string $id ) { 203 203 unset( $this->instances[ $id ] ); 204 204 … … 228 228 * @throws NotFoundException 229 229 */ 230 public function extend( $id, Closure $closure ) {230 public function extend( string $id, Closure $closure ) { 231 231 232 232 // Get the existing raw value
Note: See TracChangeset
for help on using the changeset viewer.