Changeset 3282418
- Timestamp:
- 04/26/2025 01:52:27 PM (11 months ago)
- Location:
- wp-tweaks
- Files:
-
- 28 edited
- 1 copied
-
tags/2.4.1 (copied) (copied from wp-tweaks/trunk)
-
tags/2.4.1/changelog.txt (modified) (1 diff)
-
tags/2.4.1/classes/Settings.php (modified) (1 diff)
-
tags/2.4.1/includes/tweaks/disable-rest-api-users-endpoint.php (modified) (1 diff)
-
tags/2.4.1/languages/wp-tweaks-pt_BR.mo (modified) (previous)
-
tags/2.4.1/languages/wp-tweaks-pt_BR.po (modified) (4 diffs)
-
tags/2.4.1/languages/wp-tweaks.pot (modified) (3 diffs)
-
tags/2.4.1/readme.txt (modified) (2 diffs)
-
tags/2.4.1/vendor/autoload.php (modified) (1 diff)
-
tags/2.4.1/vendor/composer/ClassLoader.php (modified) (24 diffs)
-
tags/2.4.1/vendor/composer/InstalledVersions.php (modified) (6 diffs)
-
tags/2.4.1/vendor/composer/autoload_real.php (modified) (2 diffs)
-
tags/2.4.1/vendor/composer/autoload_static.php (modified) (2 diffs)
-
tags/2.4.1/vendor/composer/installed.php (modified) (2 diffs)
-
tags/2.4.1/wp-tweaks.php (modified) (1 diff)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/classes/Settings.php (modified) (1 diff)
-
trunk/includes/tweaks/disable-rest-api-users-endpoint.php (modified) (1 diff)
-
trunk/languages/wp-tweaks-pt_BR.mo (modified) (previous)
-
trunk/languages/wp-tweaks-pt_BR.po (modified) (4 diffs)
-
trunk/languages/wp-tweaks.pot (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/composer/ClassLoader.php (modified) (24 diffs)
-
trunk/vendor/composer/InstalledVersions.php (modified) (6 diffs)
-
trunk/vendor/composer/autoload_real.php (modified) (2 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/wp-tweaks.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-tweaks/tags/2.4.1/changelog.txt
r3204865 r3282418 1 = 2.4.1 - 2025-04-26 = 2 3 - Fix: missing author field in visual editor. 4 1 5 = 2.4.0 - 2024-12-09 = 2 6 -
wp-tweaks/tags/2.4.1/classes/Settings.php
r3204865 r3282418 148 148 'type' => 'checkbox', 149 149 'default' => true, 150 'description' => esc_html__( 'Disable user s enumeration via REST API.', 'wp-tweaks' )150 'description' => esc_html__( 'Disable user enumeration via REST API for non-logged in users.', 'wp-tweaks' ) 151 151 ], 152 152 [ -
wp-tweaks/tags/2.4.1/includes/tweaks/disable-rest-api-users-endpoint.php
r2956929 r3282418 9 9 add_filter( 'rest_endpoints', 'wp_tweaks_disable_rest_api_users_endpoint' ); 10 10 function wp_tweaks_disable_rest_api_users_endpoint ( $endpoints ) { 11 if ( is_user_logged_in() ) return $endpoints; 12 11 13 if ( isset( $endpoints['/wp/v2/users'] ) ) { 12 14 unset( $endpoints['/wp/v2/users'] ); 13 15 } 16 14 17 if ( isset( $endpoints['/wp/v2/users/(?P<id>[\d]+)'] ) ) { 15 18 unset( $endpoints['/wp/v2/users/(?P<id>[\d]+)'] ); 16 19 } 20 17 21 return $endpoints; 18 22 } -
wp-tweaks/tags/2.4.1/languages/wp-tweaks-pt_BR.po
r3204865 r3282418 3 3 "Project-Id-Version: WP Tweaks\n" 4 4 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-tweaks\n" 5 "POT-Creation-Date: 202 4-12-09T12:43:40+00:00\n"6 "PO-Revision-Date: 202 4-12-09 09:44-0300\n"5 "POT-Creation-Date: 2025-04-26T10:32:31-03:00\n" 6 "PO-Revision-Date: 2025-04-26 10:35-0300\n" 7 7 "Last-Translator: \n" 8 8 "Language-Team: Português do Brasil\n" … … 12 12 "Content-Transfer-Encoding: 8bit\n" 13 13 "Plural-Forms: nplurals=2; plural=n != 1;\n" 14 "X-Generator: Poedit 3. 4.4\n"14 "X-Generator: Poedit 3.2.2\n" 15 15 "X-Loco-Version: 2.6.1; wp-5.9.3\n" 16 16 17 17 #. Plugin Name of the plugin 18 #: wp-tweaks.php 18 19 msgid "WP Tweaks" 19 20 msgstr "WP Ajustes" 20 21 21 22 #. Plugin URI of the plugin 23 #: wp-tweaks.php 22 24 msgid "https://github.com/luizbills/wp-tweaks" 23 25 msgstr "https://github.com/luizbills/wp-tweaks" 24 26 25 27 #. Description of the plugin 28 #: wp-tweaks.php 26 29 msgid "" 27 30 "Several opinionated WordPress tweaks focused in security and performance." … … 30 33 31 34 #. Author of the plugin 35 #: wp-tweaks.php 32 36 msgid "Luiz Bills" 33 37 msgstr "Luiz Bills" 34 38 35 39 #. Author URI of the plugin 40 #: wp-tweaks.php 36 41 msgid "https://luizpb.com/en" 37 42 msgstr "https://luizpb.com/pt/" … … 137 142 138 143 #: classes/Settings.php:150 139 msgid "Disable users enumeration via REST API." 140 msgstr "Desativar a enumeração de usuários pela REST API." 144 msgid "Disable user enumeration via REST API for non-logged in users." 145 msgstr "" 146 "Desativar a enumeração de usuário pela REST API para usuários deslogados." 141 147 142 148 #: classes/Settings.php:154 -
wp-tweaks/tags/2.4.1/languages/wp-tweaks.pot
r3204865 r3282418 1 # Copyright (C) 202 4Luiz Bills1 # Copyright (C) 2025 Luiz Bills 2 2 # This file is distributed under the GPLv3. 3 3 msgid "" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 202 4-12-09T12:43:40+00:00\n"12 "POT-Creation-Date: 2025-04-26T10:32:31-03:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2. 6.0\n"14 "X-Generator: WP-CLI 2.11.0\n" 15 15 "X-Domain: wp-tweaks\n" 16 16 17 17 #. Plugin Name of the plugin 18 #: wp-tweaks.php 18 19 msgid "WP Tweaks" 19 20 msgstr "" 20 21 21 22 #. Plugin URI of the plugin 23 #: wp-tweaks.php 22 24 msgid "https://github.com/luizbills/wp-tweaks" 23 25 msgstr "" 24 26 25 27 #. Description of the plugin 28 #: wp-tweaks.php 26 29 msgid "Several opinionated WordPress tweaks focused in security and performance." 27 30 msgstr "" 28 31 29 32 #. Author of the plugin 33 #: wp-tweaks.php 30 34 msgid "Luiz Bills" 31 35 msgstr "" 32 36 33 37 #. Author URI of the plugin 38 #: wp-tweaks.php 34 39 msgid "https://luizpb.com/en" 35 40 msgstr "" … … 131 136 132 137 #: classes/Settings.php:150 133 msgid "Disable user s enumeration via REST API."138 msgid "Disable user enumeration via REST API for non-logged in users." 134 139 msgstr "" 135 140 -
wp-tweaks/tags/2.4.1/readme.txt
r3204865 r3282418 4 4 Donate link: https://www.luizpb.com/donate/ 5 5 Requires at least: 4.0 6 Tested up to: 6. 76 Tested up to: 6.8 7 7 Requires PHP: 7.4 8 Stable tag: 2.4. 08 Stable tag: 2.4.1 9 9 License: GPLv3 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 56 56 == Changelog == 57 57 58 = 2.4.1 - 2025-04-26 = 59 60 - Fix: missing author field in visual editor. 61 58 62 = 2.4.0 - 2024-12-09 = 59 63 -
wp-tweaks/tags/2.4.1/vendor/autoload.php
r3204865 r3282418 15 15 } 16 16 } 17 trigger_error( 18 $err, 19 E_USER_ERROR 20 ); 17 throw new RuntimeException($err); 21 18 } 22 19 23 20 require_once __DIR__ . '/composer/autoload_real.php'; 24 21 25 return ComposerAutoloaderInit 3de4af3b4286b390214179267289e6fd::getLoader();22 return ComposerAutoloaderInit0ebffebf507b02320f4e68797ef498f0::getLoader(); -
wp-tweaks/tags/2.4.1/vendor/composer/ClassLoader.php
r3204865 r3282418 46 46 private static $includeFile; 47 47 48 /** @var ?string*/48 /** @var string|null */ 49 49 private $vendorDir; 50 50 51 51 // PSR-4 52 52 /** 53 * @var array[] 54 * @psalm-var array<string, array<string, int>> 53 * @var array<string, array<string, int>> 55 54 */ 56 55 private $prefixLengthsPsr4 = array(); 57 56 /** 58 * @var array[] 59 * @psalm-var array<string, array<int, string>> 57 * @var array<string, list<string>> 60 58 */ 61 59 private $prefixDirsPsr4 = array(); 62 60 /** 63 * @var array[] 64 * @psalm-var array<string, string> 61 * @var list<string> 65 62 */ 66 63 private $fallbackDirsPsr4 = array(); … … 68 65 // PSR-0 69 66 /** 70 * @var array[] 71 * @psalm-var array<string, array<string, string[]>> 67 * List of PSR-0 prefixes 68 * 69 * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) 70 * 71 * @var array<string, array<string, list<string>>> 72 72 */ 73 73 private $prefixesPsr0 = array(); 74 74 /** 75 * @var array[] 76 * @psalm-var array<string, string> 75 * @var list<string> 77 76 */ 78 77 private $fallbackDirsPsr0 = array(); … … 82 81 83 82 /** 84 * @var string[] 85 * @psalm-var array<string, string> 83 * @var array<string, string> 86 84 */ 87 85 private $classMap = array(); … … 91 89 92 90 /** 93 * @var bool[] 94 * @psalm-var array<string, bool> 91 * @var array<string, bool> 95 92 */ 96 93 private $missingClasses = array(); 97 94 98 /** @var ?string*/95 /** @var string|null */ 99 96 private $apcuPrefix; 100 97 101 98 /** 102 * @var self[]99 * @var array<string, self> 103 100 */ 104 101 private static $registeredLoaders = array(); 105 102 106 103 /** 107 * @param ?string$vendorDir104 * @param string|null $vendorDir 108 105 */ 109 106 public function __construct($vendorDir = null) … … 114 111 115 112 /** 116 * @return string[]113 * @return array<string, list<string>> 117 114 */ 118 115 public function getPrefixes() … … 126 123 127 124 /** 128 * @return array[] 129 * @psalm-return array<string, array<int, string>> 125 * @return array<string, list<string>> 130 126 */ 131 127 public function getPrefixesPsr4() … … 135 131 136 132 /** 137 * @return array[] 138 * @psalm-return array<string, string> 133 * @return list<string> 139 134 */ 140 135 public function getFallbackDirs() … … 144 139 145 140 /** 146 * @return array[] 147 * @psalm-return array<string, string> 141 * @return list<string> 148 142 */ 149 143 public function getFallbackDirsPsr4() … … 153 147 154 148 /** 155 * @return string[] Array of classname => path 156 * @psalm-return array<string, string> 149 * @return array<string, string> Array of classname => path 157 150 */ 158 151 public function getClassMap() … … 162 155 163 156 /** 164 * @param string[] $classMap Class to filename map 165 * @psalm-param array<string, string> $classMap 157 * @param array<string, string> $classMap Class to filename map 166 158 * 167 159 * @return void … … 180 172 * appending or prepending to the ones previously set for this prefix. 181 173 * 182 * @param string $prefix The prefix183 * @param string[]|string $paths The PSR-0 root directories184 * @param bool $prepend Whether to prepend the directories174 * @param string $prefix The prefix 175 * @param list<string>|string $paths The PSR-0 root directories 176 * @param bool $prepend Whether to prepend the directories 185 177 * 186 178 * @return void … … 188 180 public function add($prefix, $paths, $prepend = false) 189 181 { 182 $paths = (array) $paths; 190 183 if (!$prefix) { 191 184 if ($prepend) { 192 185 $this->fallbackDirsPsr0 = array_merge( 193 (array)$paths,186 $paths, 194 187 $this->fallbackDirsPsr0 195 188 ); … … 197 190 $this->fallbackDirsPsr0 = array_merge( 198 191 $this->fallbackDirsPsr0, 199 (array)$paths192 $paths 200 193 ); 201 194 } … … 206 199 $first = $prefix[0]; 207 200 if (!isset($this->prefixesPsr0[$first][$prefix])) { 208 $this->prefixesPsr0[$first][$prefix] = (array)$paths;201 $this->prefixesPsr0[$first][$prefix] = $paths; 209 202 210 203 return; … … 212 205 if ($prepend) { 213 206 $this->prefixesPsr0[$first][$prefix] = array_merge( 214 (array)$paths,207 $paths, 215 208 $this->prefixesPsr0[$first][$prefix] 216 209 ); … … 218 211 $this->prefixesPsr0[$first][$prefix] = array_merge( 219 212 $this->prefixesPsr0[$first][$prefix], 220 (array)$paths213 $paths 221 214 ); 222 215 } … … 227 220 * appending or prepending to the ones previously set for this namespace. 228 221 * 229 * @param string $prefix The prefix/namespace, with trailing '\\'230 * @param string[]|string $paths The PSR-4 base directories231 * @param bool $prepend Whether to prepend the directories222 * @param string $prefix The prefix/namespace, with trailing '\\' 223 * @param list<string>|string $paths The PSR-4 base directories 224 * @param bool $prepend Whether to prepend the directories 232 225 * 233 226 * @throws \InvalidArgumentException … … 237 230 public function addPsr4($prefix, $paths, $prepend = false) 238 231 { 232 $paths = (array) $paths; 239 233 if (!$prefix) { 240 234 // Register directories for the root namespace. 241 235 if ($prepend) { 242 236 $this->fallbackDirsPsr4 = array_merge( 243 (array)$paths,237 $paths, 244 238 $this->fallbackDirsPsr4 245 239 ); … … 247 241 $this->fallbackDirsPsr4 = array_merge( 248 242 $this->fallbackDirsPsr4, 249 (array)$paths243 $paths 250 244 ); 251 245 } … … 257 251 } 258 252 $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; 259 $this->prefixDirsPsr4[$prefix] = (array)$paths;253 $this->prefixDirsPsr4[$prefix] = $paths; 260 254 } elseif ($prepend) { 261 255 // Prepend directories for an already registered namespace. 262 256 $this->prefixDirsPsr4[$prefix] = array_merge( 263 (array)$paths,257 $paths, 264 258 $this->prefixDirsPsr4[$prefix] 265 259 ); … … 268 262 $this->prefixDirsPsr4[$prefix] = array_merge( 269 263 $this->prefixDirsPsr4[$prefix], 270 (array)$paths264 $paths 271 265 ); 272 266 } … … 277 271 * replacing any others previously set for this prefix. 278 272 * 279 * @param string $prefix The prefix280 * @param string[]|string $paths The PSR-0 base directories273 * @param string $prefix The prefix 274 * @param list<string>|string $paths The PSR-0 base directories 281 275 * 282 276 * @return void … … 295 289 * replacing any others previously set for this namespace. 296 290 * 297 * @param string $prefix The prefix/namespace, with trailing '\\'298 * @param string[]|string $paths The PSR-4 base directories291 * @param string $prefix The prefix/namespace, with trailing '\\' 292 * @param list<string>|string $paths The PSR-4 base directories 299 293 * 300 294 * @throws \InvalidArgumentException … … 482 476 483 477 /** 484 * Returns the currently registered loaders indexed by their corresponding vendor directories.485 * 486 * @return self[]478 * Returns the currently registered loaders keyed by their corresponding vendor directories. 479 * 480 * @return array<string, self> 487 481 */ 488 482 public static function getRegisteredLoaders() -
wp-tweaks/tags/2.4.1/vendor/composer/InstalledVersions.php
r3204865 r3282418 28 28 { 29 29 /** 30 * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to 31 * @internal 32 */ 33 private static $selfDir = null; 34 35 /** 30 36 * @var mixed[]|null 31 37 * @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 38 */ 33 39 private static $installed; 40 41 /** 42 * @var bool 43 */ 44 private static $installedIsLocalDir; 34 45 35 46 /** … … 99 110 foreach (self::getInstalled() as $installed) { 100 111 if (isset($installed['versions'][$packageName])) { 101 return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);112 return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; 102 113 } 103 114 } … … 120 131 public static function satisfies(VersionParser $parser, $packageName, $constraint) 121 132 { 122 $constraint = $parser->parseConstraints( $constraint);133 $constraint = $parser->parseConstraints((string) $constraint); 123 134 $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); 124 135 … … 310 321 self::$installed = $data; 311 322 self::$installedByVendor = array(); 323 324 // when using reload, we disable the duplicate protection to ensure that self::$installed data is 325 // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not, 326 // so we have to assume it does not, and that may result in duplicate data being returned when listing 327 // all installed packages for example 328 self::$installedIsLocalDir = false; 329 } 330 331 /** 332 * @return string 333 */ 334 private static function getSelfDir() 335 { 336 if (self::$selfDir === null) { 337 self::$selfDir = strtr(__DIR__, '\\', '/'); 338 } 339 340 return self::$selfDir; 312 341 } 313 342 … … 323 352 324 353 $installed = array(); 354 $copiedLocalDir = false; 325 355 326 356 if (self::$canGetVendors) { 357 $selfDir = self::getSelfDir(); 327 358 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { 359 $vendorDir = strtr($vendorDir, '\\', '/'); 328 360 if (isset(self::$installedByVendor[$vendorDir])) { 329 361 $installed[] = self::$installedByVendor[$vendorDir]; 330 362 } elseif (is_file($vendorDir.'/composer/installed.php')) { 331 $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; 332 if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { 333 self::$installed = $installed[count($installed) - 1]; 363 /** @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 */ 364 $required = require $vendorDir.'/composer/installed.php'; 365 self::$installedByVendor[$vendorDir] = $required; 366 $installed[] = $required; 367 if (self::$installed === null && $vendorDir.'/composer' === $selfDir) { 368 self::$installed = $required; 369 self::$installedIsLocalDir = true; 334 370 } 371 } 372 if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) { 373 $copiedLocalDir = true; 335 374 } 336 375 } … … 341 380 // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 342 381 if (substr(__DIR__, -8, 1) !== 'C') { 343 self::$installed = require __DIR__ . '/installed.php'; 382 /** @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 */ 383 $required = require __DIR__ . '/installed.php'; 384 self::$installed = $required; 344 385 } else { 345 386 self::$installed = array(); 346 387 } 347 388 } 348 $installed[] = self::$installed; 389 390 if (self::$installed !== array() && !$copiedLocalDir) { 391 $installed[] = self::$installed; 392 } 349 393 350 394 return $installed; -
wp-tweaks/tags/2.4.1/vendor/composer/autoload_real.php
r3204865 r3282418 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 3de4af3b4286b390214179267289e6fd5 class ComposerAutoloaderInit0ebffebf507b02320f4e68797ef498f0 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit 3de4af3b4286b390214179267289e6fd', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInit0ebffebf507b02320f4e68797ef498f0', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInit 3de4af3b4286b390214179267289e6fd', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInit0ebffebf507b02320f4e68797ef498f0', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInit 3de4af3b4286b390214179267289e6fd::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInit0ebffebf507b02320f4e68797ef498f0::getInitializer($loader)); 33 33 34 34 $loader->register(true); -
wp-tweaks/tags/2.4.1/vendor/composer/autoload_static.php
r3204865 r3282418 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 3de4af3b4286b390214179267289e6fd7 class ComposerStaticInit0ebffebf507b02320f4e68797ef498f0 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 37 37 { 38 38 return \Closure::bind(function () use ($loader) { 39 $loader->prefixLengthsPsr4 = ComposerStaticInit 3de4af3b4286b390214179267289e6fd::$prefixLengthsPsr4;40 $loader->prefixDirsPsr4 = ComposerStaticInit 3de4af3b4286b390214179267289e6fd::$prefixDirsPsr4;41 $loader->classMap = ComposerStaticInit 3de4af3b4286b390214179267289e6fd::$classMap;39 $loader->prefixLengthsPsr4 = ComposerStaticInit0ebffebf507b02320f4e68797ef498f0::$prefixLengthsPsr4; 40 $loader->prefixDirsPsr4 = ComposerStaticInit0ebffebf507b02320f4e68797ef498f0::$prefixDirsPsr4; 41 $loader->classMap = ComposerStaticInit0ebffebf507b02320f4e68797ef498f0::$classMap; 42 42 43 43 }, null, ClassLoader::class); -
wp-tweaks/tags/2.4.1/vendor/composer/installed.php
r3204865 r3282418 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' d07f32d0cdf99046b105b74e53d2810730c6f033',6 'reference' => '6d868ed12f3509115897b88907fed895ae1d4fd0', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-main', 15 15 'version' => 'dev-main', 16 'reference' => ' d07f32d0cdf99046b105b74e53d2810730c6f033',16 'reference' => '6d868ed12f3509115897b88907fed895ae1d4fd0', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../', -
wp-tweaks/tags/2.4.1/wp-tweaks.php
r3204865 r3282418 4 4 * Plugin URI: https://github.com/luizbills/wp-tweaks 5 5 * Description: Several opinionated WordPress tweaks focused in security and performance. 6 * Version: 2.4. 06 * Version: 2.4.1 7 7 * Requires at least: 4.0 8 8 * Requires PHP: 7.4 -
wp-tweaks/trunk/changelog.txt
r3204865 r3282418 1 = 2.4.1 - 2025-04-26 = 2 3 - Fix: missing author field in visual editor. 4 1 5 = 2.4.0 - 2024-12-09 = 2 6 -
wp-tweaks/trunk/classes/Settings.php
r3204865 r3282418 148 148 'type' => 'checkbox', 149 149 'default' => true, 150 'description' => esc_html__( 'Disable user s enumeration via REST API.', 'wp-tweaks' )150 'description' => esc_html__( 'Disable user enumeration via REST API for non-logged in users.', 'wp-tweaks' ) 151 151 ], 152 152 [ -
wp-tweaks/trunk/includes/tweaks/disable-rest-api-users-endpoint.php
r2956929 r3282418 9 9 add_filter( 'rest_endpoints', 'wp_tweaks_disable_rest_api_users_endpoint' ); 10 10 function wp_tweaks_disable_rest_api_users_endpoint ( $endpoints ) { 11 if ( is_user_logged_in() ) return $endpoints; 12 11 13 if ( isset( $endpoints['/wp/v2/users'] ) ) { 12 14 unset( $endpoints['/wp/v2/users'] ); 13 15 } 16 14 17 if ( isset( $endpoints['/wp/v2/users/(?P<id>[\d]+)'] ) ) { 15 18 unset( $endpoints['/wp/v2/users/(?P<id>[\d]+)'] ); 16 19 } 20 17 21 return $endpoints; 18 22 } -
wp-tweaks/trunk/languages/wp-tweaks-pt_BR.po
r3204865 r3282418 3 3 "Project-Id-Version: WP Tweaks\n" 4 4 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-tweaks\n" 5 "POT-Creation-Date: 202 4-12-09T12:43:40+00:00\n"6 "PO-Revision-Date: 202 4-12-09 09:44-0300\n"5 "POT-Creation-Date: 2025-04-26T10:32:31-03:00\n" 6 "PO-Revision-Date: 2025-04-26 10:35-0300\n" 7 7 "Last-Translator: \n" 8 8 "Language-Team: Português do Brasil\n" … … 12 12 "Content-Transfer-Encoding: 8bit\n" 13 13 "Plural-Forms: nplurals=2; plural=n != 1;\n" 14 "X-Generator: Poedit 3. 4.4\n"14 "X-Generator: Poedit 3.2.2\n" 15 15 "X-Loco-Version: 2.6.1; wp-5.9.3\n" 16 16 17 17 #. Plugin Name of the plugin 18 #: wp-tweaks.php 18 19 msgid "WP Tweaks" 19 20 msgstr "WP Ajustes" 20 21 21 22 #. Plugin URI of the plugin 23 #: wp-tweaks.php 22 24 msgid "https://github.com/luizbills/wp-tweaks" 23 25 msgstr "https://github.com/luizbills/wp-tweaks" 24 26 25 27 #. Description of the plugin 28 #: wp-tweaks.php 26 29 msgid "" 27 30 "Several opinionated WordPress tweaks focused in security and performance." … … 30 33 31 34 #. Author of the plugin 35 #: wp-tweaks.php 32 36 msgid "Luiz Bills" 33 37 msgstr "Luiz Bills" 34 38 35 39 #. Author URI of the plugin 40 #: wp-tweaks.php 36 41 msgid "https://luizpb.com/en" 37 42 msgstr "https://luizpb.com/pt/" … … 137 142 138 143 #: classes/Settings.php:150 139 msgid "Disable users enumeration via REST API." 140 msgstr "Desativar a enumeração de usuários pela REST API." 144 msgid "Disable user enumeration via REST API for non-logged in users." 145 msgstr "" 146 "Desativar a enumeração de usuário pela REST API para usuários deslogados." 141 147 142 148 #: classes/Settings.php:154 -
wp-tweaks/trunk/languages/wp-tweaks.pot
r3204865 r3282418 1 # Copyright (C) 202 4Luiz Bills1 # Copyright (C) 2025 Luiz Bills 2 2 # This file is distributed under the GPLv3. 3 3 msgid "" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 202 4-12-09T12:43:40+00:00\n"12 "POT-Creation-Date: 2025-04-26T10:32:31-03:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2. 6.0\n"14 "X-Generator: WP-CLI 2.11.0\n" 15 15 "X-Domain: wp-tweaks\n" 16 16 17 17 #. Plugin Name of the plugin 18 #: wp-tweaks.php 18 19 msgid "WP Tweaks" 19 20 msgstr "" 20 21 21 22 #. Plugin URI of the plugin 23 #: wp-tweaks.php 22 24 msgid "https://github.com/luizbills/wp-tweaks" 23 25 msgstr "" 24 26 25 27 #. Description of the plugin 28 #: wp-tweaks.php 26 29 msgid "Several opinionated WordPress tweaks focused in security and performance." 27 30 msgstr "" 28 31 29 32 #. Author of the plugin 33 #: wp-tweaks.php 30 34 msgid "Luiz Bills" 31 35 msgstr "" 32 36 33 37 #. Author URI of the plugin 38 #: wp-tweaks.php 34 39 msgid "https://luizpb.com/en" 35 40 msgstr "" … … 131 136 132 137 #: classes/Settings.php:150 133 msgid "Disable user s enumeration via REST API."138 msgid "Disable user enumeration via REST API for non-logged in users." 134 139 msgstr "" 135 140 -
wp-tweaks/trunk/readme.txt
r3204865 r3282418 4 4 Donate link: https://www.luizpb.com/donate/ 5 5 Requires at least: 4.0 6 Tested up to: 6. 76 Tested up to: 6.8 7 7 Requires PHP: 7.4 8 Stable tag: 2.4. 08 Stable tag: 2.4.1 9 9 License: GPLv3 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 56 56 == Changelog == 57 57 58 = 2.4.1 - 2025-04-26 = 59 60 - Fix: missing author field in visual editor. 61 58 62 = 2.4.0 - 2024-12-09 = 59 63 -
wp-tweaks/trunk/vendor/autoload.php
r3204865 r3282418 15 15 } 16 16 } 17 trigger_error( 18 $err, 19 E_USER_ERROR 20 ); 17 throw new RuntimeException($err); 21 18 } 22 19 23 20 require_once __DIR__ . '/composer/autoload_real.php'; 24 21 25 return ComposerAutoloaderInit 3de4af3b4286b390214179267289e6fd::getLoader();22 return ComposerAutoloaderInit0ebffebf507b02320f4e68797ef498f0::getLoader(); -
wp-tweaks/trunk/vendor/composer/ClassLoader.php
r3204865 r3282418 46 46 private static $includeFile; 47 47 48 /** @var ?string*/48 /** @var string|null */ 49 49 private $vendorDir; 50 50 51 51 // PSR-4 52 52 /** 53 * @var array[] 54 * @psalm-var array<string, array<string, int>> 53 * @var array<string, array<string, int>> 55 54 */ 56 55 private $prefixLengthsPsr4 = array(); 57 56 /** 58 * @var array[] 59 * @psalm-var array<string, array<int, string>> 57 * @var array<string, list<string>> 60 58 */ 61 59 private $prefixDirsPsr4 = array(); 62 60 /** 63 * @var array[] 64 * @psalm-var array<string, string> 61 * @var list<string> 65 62 */ 66 63 private $fallbackDirsPsr4 = array(); … … 68 65 // PSR-0 69 66 /** 70 * @var array[] 71 * @psalm-var array<string, array<string, string[]>> 67 * List of PSR-0 prefixes 68 * 69 * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) 70 * 71 * @var array<string, array<string, list<string>>> 72 72 */ 73 73 private $prefixesPsr0 = array(); 74 74 /** 75 * @var array[] 76 * @psalm-var array<string, string> 75 * @var list<string> 77 76 */ 78 77 private $fallbackDirsPsr0 = array(); … … 82 81 83 82 /** 84 * @var string[] 85 * @psalm-var array<string, string> 83 * @var array<string, string> 86 84 */ 87 85 private $classMap = array(); … … 91 89 92 90 /** 93 * @var bool[] 94 * @psalm-var array<string, bool> 91 * @var array<string, bool> 95 92 */ 96 93 private $missingClasses = array(); 97 94 98 /** @var ?string*/95 /** @var string|null */ 99 96 private $apcuPrefix; 100 97 101 98 /** 102 * @var self[]99 * @var array<string, self> 103 100 */ 104 101 private static $registeredLoaders = array(); 105 102 106 103 /** 107 * @param ?string$vendorDir104 * @param string|null $vendorDir 108 105 */ 109 106 public function __construct($vendorDir = null) … … 114 111 115 112 /** 116 * @return string[]113 * @return array<string, list<string>> 117 114 */ 118 115 public function getPrefixes() … … 126 123 127 124 /** 128 * @return array[] 129 * @psalm-return array<string, array<int, string>> 125 * @return array<string, list<string>> 130 126 */ 131 127 public function getPrefixesPsr4() … … 135 131 136 132 /** 137 * @return array[] 138 * @psalm-return array<string, string> 133 * @return list<string> 139 134 */ 140 135 public function getFallbackDirs() … … 144 139 145 140 /** 146 * @return array[] 147 * @psalm-return array<string, string> 141 * @return list<string> 148 142 */ 149 143 public function getFallbackDirsPsr4() … … 153 147 154 148 /** 155 * @return string[] Array of classname => path 156 * @psalm-return array<string, string> 149 * @return array<string, string> Array of classname => path 157 150 */ 158 151 public function getClassMap() … … 162 155 163 156 /** 164 * @param string[] $classMap Class to filename map 165 * @psalm-param array<string, string> $classMap 157 * @param array<string, string> $classMap Class to filename map 166 158 * 167 159 * @return void … … 180 172 * appending or prepending to the ones previously set for this prefix. 181 173 * 182 * @param string $prefix The prefix183 * @param string[]|string $paths The PSR-0 root directories184 * @param bool $prepend Whether to prepend the directories174 * @param string $prefix The prefix 175 * @param list<string>|string $paths The PSR-0 root directories 176 * @param bool $prepend Whether to prepend the directories 185 177 * 186 178 * @return void … … 188 180 public function add($prefix, $paths, $prepend = false) 189 181 { 182 $paths = (array) $paths; 190 183 if (!$prefix) { 191 184 if ($prepend) { 192 185 $this->fallbackDirsPsr0 = array_merge( 193 (array)$paths,186 $paths, 194 187 $this->fallbackDirsPsr0 195 188 ); … … 197 190 $this->fallbackDirsPsr0 = array_merge( 198 191 $this->fallbackDirsPsr0, 199 (array)$paths192 $paths 200 193 ); 201 194 } … … 206 199 $first = $prefix[0]; 207 200 if (!isset($this->prefixesPsr0[$first][$prefix])) { 208 $this->prefixesPsr0[$first][$prefix] = (array)$paths;201 $this->prefixesPsr0[$first][$prefix] = $paths; 209 202 210 203 return; … … 212 205 if ($prepend) { 213 206 $this->prefixesPsr0[$first][$prefix] = array_merge( 214 (array)$paths,207 $paths, 215 208 $this->prefixesPsr0[$first][$prefix] 216 209 ); … … 218 211 $this->prefixesPsr0[$first][$prefix] = array_merge( 219 212 $this->prefixesPsr0[$first][$prefix], 220 (array)$paths213 $paths 221 214 ); 222 215 } … … 227 220 * appending or prepending to the ones previously set for this namespace. 228 221 * 229 * @param string $prefix The prefix/namespace, with trailing '\\'230 * @param string[]|string $paths The PSR-4 base directories231 * @param bool $prepend Whether to prepend the directories222 * @param string $prefix The prefix/namespace, with trailing '\\' 223 * @param list<string>|string $paths The PSR-4 base directories 224 * @param bool $prepend Whether to prepend the directories 232 225 * 233 226 * @throws \InvalidArgumentException … … 237 230 public function addPsr4($prefix, $paths, $prepend = false) 238 231 { 232 $paths = (array) $paths; 239 233 if (!$prefix) { 240 234 // Register directories for the root namespace. 241 235 if ($prepend) { 242 236 $this->fallbackDirsPsr4 = array_merge( 243 (array)$paths,237 $paths, 244 238 $this->fallbackDirsPsr4 245 239 ); … … 247 241 $this->fallbackDirsPsr4 = array_merge( 248 242 $this->fallbackDirsPsr4, 249 (array)$paths243 $paths 250 244 ); 251 245 } … … 257 251 } 258 252 $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; 259 $this->prefixDirsPsr4[$prefix] = (array)$paths;253 $this->prefixDirsPsr4[$prefix] = $paths; 260 254 } elseif ($prepend) { 261 255 // Prepend directories for an already registered namespace. 262 256 $this->prefixDirsPsr4[$prefix] = array_merge( 263 (array)$paths,257 $paths, 264 258 $this->prefixDirsPsr4[$prefix] 265 259 ); … … 268 262 $this->prefixDirsPsr4[$prefix] = array_merge( 269 263 $this->prefixDirsPsr4[$prefix], 270 (array)$paths264 $paths 271 265 ); 272 266 } … … 277 271 * replacing any others previously set for this prefix. 278 272 * 279 * @param string $prefix The prefix280 * @param string[]|string $paths The PSR-0 base directories273 * @param string $prefix The prefix 274 * @param list<string>|string $paths The PSR-0 base directories 281 275 * 282 276 * @return void … … 295 289 * replacing any others previously set for this namespace. 296 290 * 297 * @param string $prefix The prefix/namespace, with trailing '\\'298 * @param string[]|string $paths The PSR-4 base directories291 * @param string $prefix The prefix/namespace, with trailing '\\' 292 * @param list<string>|string $paths The PSR-4 base directories 299 293 * 300 294 * @throws \InvalidArgumentException … … 482 476 483 477 /** 484 * Returns the currently registered loaders indexed by their corresponding vendor directories.485 * 486 * @return self[]478 * Returns the currently registered loaders keyed by their corresponding vendor directories. 479 * 480 * @return array<string, self> 487 481 */ 488 482 public static function getRegisteredLoaders() -
wp-tweaks/trunk/vendor/composer/InstalledVersions.php
r3204865 r3282418 28 28 { 29 29 /** 30 * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to 31 * @internal 32 */ 33 private static $selfDir = null; 34 35 /** 30 36 * @var mixed[]|null 31 37 * @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 38 */ 33 39 private static $installed; 40 41 /** 42 * @var bool 43 */ 44 private static $installedIsLocalDir; 34 45 35 46 /** … … 99 110 foreach (self::getInstalled() as $installed) { 100 111 if (isset($installed['versions'][$packageName])) { 101 return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);112 return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; 102 113 } 103 114 } … … 120 131 public static function satisfies(VersionParser $parser, $packageName, $constraint) 121 132 { 122 $constraint = $parser->parseConstraints( $constraint);133 $constraint = $parser->parseConstraints((string) $constraint); 123 134 $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); 124 135 … … 310 321 self::$installed = $data; 311 322 self::$installedByVendor = array(); 323 324 // when using reload, we disable the duplicate protection to ensure that self::$installed data is 325 // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not, 326 // so we have to assume it does not, and that may result in duplicate data being returned when listing 327 // all installed packages for example 328 self::$installedIsLocalDir = false; 329 } 330 331 /** 332 * @return string 333 */ 334 private static function getSelfDir() 335 { 336 if (self::$selfDir === null) { 337 self::$selfDir = strtr(__DIR__, '\\', '/'); 338 } 339 340 return self::$selfDir; 312 341 } 313 342 … … 323 352 324 353 $installed = array(); 354 $copiedLocalDir = false; 325 355 326 356 if (self::$canGetVendors) { 357 $selfDir = self::getSelfDir(); 327 358 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { 359 $vendorDir = strtr($vendorDir, '\\', '/'); 328 360 if (isset(self::$installedByVendor[$vendorDir])) { 329 361 $installed[] = self::$installedByVendor[$vendorDir]; 330 362 } elseif (is_file($vendorDir.'/composer/installed.php')) { 331 $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; 332 if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { 333 self::$installed = $installed[count($installed) - 1]; 363 /** @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 */ 364 $required = require $vendorDir.'/composer/installed.php'; 365 self::$installedByVendor[$vendorDir] = $required; 366 $installed[] = $required; 367 if (self::$installed === null && $vendorDir.'/composer' === $selfDir) { 368 self::$installed = $required; 369 self::$installedIsLocalDir = true; 334 370 } 371 } 372 if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) { 373 $copiedLocalDir = true; 335 374 } 336 375 } … … 341 380 // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 342 381 if (substr(__DIR__, -8, 1) !== 'C') { 343 self::$installed = require __DIR__ . '/installed.php'; 382 /** @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 */ 383 $required = require __DIR__ . '/installed.php'; 384 self::$installed = $required; 344 385 } else { 345 386 self::$installed = array(); 346 387 } 347 388 } 348 $installed[] = self::$installed; 389 390 if (self::$installed !== array() && !$copiedLocalDir) { 391 $installed[] = self::$installed; 392 } 349 393 350 394 return $installed; -
wp-tweaks/trunk/vendor/composer/autoload_real.php
r3204865 r3282418 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 3de4af3b4286b390214179267289e6fd5 class ComposerAutoloaderInit0ebffebf507b02320f4e68797ef498f0 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit 3de4af3b4286b390214179267289e6fd', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInit0ebffebf507b02320f4e68797ef498f0', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInit 3de4af3b4286b390214179267289e6fd', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInit0ebffebf507b02320f4e68797ef498f0', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInit 3de4af3b4286b390214179267289e6fd::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInit0ebffebf507b02320f4e68797ef498f0::getInitializer($loader)); 33 33 34 34 $loader->register(true); -
wp-tweaks/trunk/vendor/composer/autoload_static.php
r3204865 r3282418 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 3de4af3b4286b390214179267289e6fd7 class ComposerStaticInit0ebffebf507b02320f4e68797ef498f0 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 37 37 { 38 38 return \Closure::bind(function () use ($loader) { 39 $loader->prefixLengthsPsr4 = ComposerStaticInit 3de4af3b4286b390214179267289e6fd::$prefixLengthsPsr4;40 $loader->prefixDirsPsr4 = ComposerStaticInit 3de4af3b4286b390214179267289e6fd::$prefixDirsPsr4;41 $loader->classMap = ComposerStaticInit 3de4af3b4286b390214179267289e6fd::$classMap;39 $loader->prefixLengthsPsr4 = ComposerStaticInit0ebffebf507b02320f4e68797ef498f0::$prefixLengthsPsr4; 40 $loader->prefixDirsPsr4 = ComposerStaticInit0ebffebf507b02320f4e68797ef498f0::$prefixDirsPsr4; 41 $loader->classMap = ComposerStaticInit0ebffebf507b02320f4e68797ef498f0::$classMap; 42 42 43 43 }, null, ClassLoader::class); -
wp-tweaks/trunk/vendor/composer/installed.php
r3204865 r3282418 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' d07f32d0cdf99046b105b74e53d2810730c6f033',6 'reference' => '6d868ed12f3509115897b88907fed895ae1d4fd0', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-main', 15 15 'version' => 'dev-main', 16 'reference' => ' d07f32d0cdf99046b105b74e53d2810730c6f033',16 'reference' => '6d868ed12f3509115897b88907fed895ae1d4fd0', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../', -
wp-tweaks/trunk/wp-tweaks.php
r3204865 r3282418 4 4 * Plugin URI: https://github.com/luizbills/wp-tweaks 5 5 * Description: Several opinionated WordPress tweaks focused in security and performance. 6 * Version: 2.4. 06 * Version: 2.4.1 7 7 * Requires at least: 4.0 8 8 * Requires PHP: 7.4
Note: See TracChangeset
for help on using the changeset viewer.