diff --git a/changelog.txt b/changelog.txt index d6e87be..f64798d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,8 @@ += v22.07.01 (2022-07-15) = +- Fixed: Plugin:cleanuppost() -> Invalid index for trashbin. +- Fixed: MoCache() -> Add $entries, $headers properties to avoid warning on get_translations_for_domain. +- Updated: Symfony component -> symfony/var-exporter. + = v21.08.11 (2022-05-30) = - Fixed: Avoid calling Filesystem::close_buffer() if a process involved accessing a disk. - Fixed: Removed handling stale cache on shutdown. diff --git a/dist/docket-cache.zip b/dist/docket-cache.zip index 9a11e8d..c14b3ea 100644 Binary files a/dist/docket-cache.zip and b/dist/docket-cache.zip differ diff --git a/docket-cache.php b/docket-cache.php index f868baf..9395220 100644 --- a/docket-cache.php +++ b/docket-cache.php @@ -12,8 +12,8 @@ * @wordpress-plugin * Plugin Name: Docket Cache * Plugin URI: https://docketcache.com/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash - * Version: 21.08.11 - * VerPrev: 21.08.10 + * Version: 22.07.01 + * VerPrev: 21.08.11 * Description: A persistent object cache stored as a plain PHP code, accelerates caching with OPcache backend. * GitHub Plugin URI: https://github.com/nawawi/docket-cache * Author: Nawawi Jamili diff --git a/includes/object-cache.php b/includes/object-cache.php index 2d0d4b7..48ca42d 100644 --- a/includes/object-cache.php +++ b/includes/object-cache.php @@ -3,7 +3,7 @@ * @wordpress-plugin * Plugin Name: Docket Cache Drop-in * Plugin URI: https://wordpress.org/plugins/docket-cache/ - * Version: 21.08.11 + * Version: 22.07.01 * Description: A persistent object cache stored as a plain PHP code, accelerates caching with OPcache backend. * Author: Nawawi Jamili * Author URI: https://docketcache.com diff --git a/includes/src/Crawler.php b/includes/src/Crawler.php index 13c6f48..84450c9 100644 --- a/includes/src/Crawler.php +++ b/includes/src/Crawler.php @@ -14,7 +14,7 @@ final class Crawler { - private static $version = '21.08.11'; + private static $version = '22.07.01'; public static $send_cookie = false; private static function default_args($param = []) diff --git a/includes/src/Event.php b/includes/src/Event.php index 74a26ef..6a7ec69 100644 --- a/includes/src/Event.php +++ b/includes/src/Event.php @@ -265,7 +265,6 @@ public function garbage_collector($force = false) $fcnt = 0; $pcnt = 0; $slowdown = 0; - $slowdown2 = 0; foreach ($this->pt->scanfiles($this->pt->cache_path) as $object) { if ($this->max_execution_time > 0 && (microtime(true) - $this->wp_start_timestamp) > $this->max_execution_time) { diff --git a/includes/src/MoCache.php b/includes/src/MoCache.php index 9ee3bc2..0b9edb6 100644 --- a/includes/src/MoCache.php +++ b/includes/src/MoCache.php @@ -21,6 +21,11 @@ final class MoCache private $upstream = null; private $mofile = null; + // Avoid warning on get_translations_for_domain. + // Reference: wp-includes/pomo/translations.php. + public $entries = []; + public $headers = []; + public function __construct($mofile, $domain, $override) { $this->mofile = apply_filters('load_textdomain_mofile', $mofile, $domain); diff --git a/includes/src/Plugin.php b/includes/src/Plugin.php index 6f4e161..f9246d1 100644 --- a/includes/src/Plugin.php +++ b/includes/src/Plugin.php @@ -843,7 +843,7 @@ public function cleanuppost() wp_delete_post($id, true); $doflush = true; } - $collect['trash'] += \count($query); + $collect['trashbin'] += \count($query); } if ($is_multisite) { diff --git a/includes/vendor/autoload.php b/includes/vendor/autoload.php index 77acf5e..02a47a9 100644 --- a/includes/vendor/autoload.php +++ b/includes/vendor/autoload.php @@ -2,6 +2,11 @@ // autoload.php @generated by Composer +if (PHP_VERSION_ID < 50600) { + echo '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; + exit(1); +} + require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInit71169967e8f502f7da209e4236957996::getLoader(); diff --git a/includes/vendor/composer/InstalledVersions.php b/includes/vendor/composer/InstalledVersions.php index 41bc143..c6b54af 100644 --- a/includes/vendor/composer/InstalledVersions.php +++ b/includes/vendor/composer/InstalledVersions.php @@ -28,7 +28,7 @@ class InstalledVersions { /** * @var mixed[]|null - * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null + * @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}|array{}|null */ private static $installed; @@ -39,7 +39,7 @@ class InstalledVersions /** * @var array[] - * @psalm-var array}> + * @psalm-var array}> */ private static $installedByVendor = array(); @@ -243,7 +243,7 @@ public static function getInstallPath($packageName) /** * @return array - * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} + * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} */ public static function getRootPackage() { @@ -257,7 +257,7 @@ public static function getRootPackage() * * @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. * @return array[] - * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} + * @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} */ public static function getRawData() { @@ -280,7 +280,7 @@ public static function getRawData() * Returns the raw data of all installed.php which are currently loaded for custom implementations * * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ public static function getAllRawData() { @@ -303,7 +303,7 @@ public static function getAllRawData() * @param array[] $data A vendor/composer/installed.php data set * @return void * - * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data + * @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} $data */ public static function reload($data) { @@ -313,7 +313,7 @@ public static function reload($data) /** * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ private static function getInstalled() { diff --git a/includes/vendor/composer/autoload_real.php b/includes/vendor/composer/autoload_real.php index a2be10f..acbaf51 100644 --- a/includes/vendor/composer/autoload_real.php +++ b/includes/vendor/composer/autoload_real.php @@ -29,7 +29,7 @@ public static function getLoader() spl_autoload_unregister(array('ComposerAutoloaderInit71169967e8f502f7da209e4236957996', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - \Composer\Autoload\ComposerStaticInit71169967e8f502f7da209e4236957996::getInitializer($loader)(); + call_user_func(\Composer\Autoload\ComposerStaticInit71169967e8f502f7da209e4236957996::getInitializer($loader)); $loader->register(true); diff --git a/includes/vendor/composer/installed.php b/includes/vendor/composer/installed.php index 5f972a7..5b5aaa1 100644 --- a/includes/vendor/composer/installed.php +++ b/includes/vendor/composer/installed.php @@ -1,40 +1,40 @@ array( + 'name' => 'nawawi/docket-cache', 'pretty_version' => 'dev-master', 'version' => 'dev-master', + 'reference' => '23082fe9d10007bed258a977b1d5f0173d5729c3', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../../', 'aliases' => array(), - 'reference' => 'aae4a66153c4248f80e3cfc8e93b330032109d39', - 'name' => 'nawawi/docket-cache', 'dev' => true, ), 'versions' => array( 'nawawi/docket-cache' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', + 'reference' => '23082fe9d10007bed258a977b1d5f0173d5729c3', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../../', 'aliases' => array(), - 'reference' => 'aae4a66153c4248f80e3cfc8e93b330032109d39', 'dev_requirement' => false, ), 'symfony/polyfill-php80' => array( - 'pretty_version' => 'v1.25.0', - 'version' => '1.25.0.0', + 'pretty_version' => 'v1.26.0', + 'version' => '1.26.0.0', + 'reference' => 'cfa0ae98841b9e461207c13ab093d76b0fa7bace', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php80', 'aliases' => array(), - 'reference' => '4407588e0d3f1f52efb65fbe92babe41f37fe50c', 'dev_requirement' => false, ), 'symfony/var-exporter' => array( - 'pretty_version' => 'v5.4.8', - 'version' => '5.4.8.0', + 'pretty_version' => 'v5.4.10', + 'version' => '5.4.10.0', + 'reference' => '8fc03ee75eeece3d9be1ef47d26d79bea1afb340', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/var-exporter', 'aliases' => array(), - 'reference' => '7e132a3fcd4b57add721b4207236877b6017ec93', 'dev_requirement' => false, ), ), diff --git a/includes/vendor/symfony/var-exporter/Instantiator.php b/includes/vendor/symfony/var-exporter/Instantiator.php index 9b3c7b7..e94c8c3 100644 --- a/includes/vendor/symfony/var-exporter/Instantiator.php +++ b/includes/vendor/symfony/var-exporter/Instantiator.php @@ -39,10 +39,10 @@ final class Instantiator * Bar::class => ['privateBarProperty' => $propertyValue], * ]); * - * Instances of ArrayObject, ArrayIterator and SplObjectHash can be created + * Instances of ArrayObject, ArrayIterator and SplObjectStorage can be created * by using the special "\0" property name to define their internal value: * - * // creates an SplObjectHash where $info1 is attached to $obj1, etc. + * // creates an SplObjectStorage where $info1 is attached to $obj1, etc. * Instantiator::instantiate(SplObjectStorage::class, ["\0" => [$obj1, $info1, $obj2, $info2...]]); * * // creates an ArrayObject populated with $inputArray diff --git a/includes/vendor/symfony/var-exporter/Internal/Exporter.php b/includes/vendor/symfony/var-exporter/Internal/Exporter.php index 334d02d..dad9002 100644 --- a/includes/vendor/symfony/var-exporter/Internal/Exporter.php +++ b/includes/vendor/symfony/var-exporter/Internal/Exporter.php @@ -108,12 +108,7 @@ public static function prepare($values, $objectsPool, &$refsPool, &$objectsCount $arrayValue = (array) $value; } elseif ($value instanceof \Serializable || $value instanceof \__PHP_Incomplete_Class - || $value instanceof \DatePeriod - || (\PHP_VERSION_ID >= 80200 && ( - $value instanceof \DateTimeInterface - || $value instanceof \DateTimeZone - || $value instanceof \DateInterval - )) + || \PHP_VERSION_ID < 80200 && $value instanceof \DatePeriod ) { ++$objectsCount; $objectsPool[$value] = [$id = \count($objectsPool), serialize($value), [], 0]; diff --git a/languages/docket-cache.pot b/languages/docket-cache.pot index 277dcd1..e4edf6e 100644 --- a/languages/docket-cache.pot +++ b/languages/docket-cache.pot @@ -2,16 +2,16 @@ # This file is distributed under the MIT. msgid "" msgstr "" -"Project-Id-Version: Docket Cache 21.08.11\n" +"Project-Id-Version: Docket Cache 22.07.01\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/docket-cache\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2022-05-30T13:40:11+00:00\n" +"POT-Creation-Date: 2022-07-15T11:40:35+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"X-Generator: WP-CLI 2.5.0\n" +"X-Generator: WP-CLI 2.6.0\n" "X-Domain: docket-cache\n" #. Plugin Name of the plugin diff --git a/readme.txt b/readme.txt index 4377c9c..1aba851 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: object cache, OPcache, fastcgi, cache, database, Optimisation, performance Requires at least: 5.4 Tested up to: 6.0 Requires PHP: 7.2.5 -Stable tag: 21.08.11 +Stable tag: 22.07.01 License: MIT License URI: https://github.com/nawawi/docket-cache/blob/master/LICENSE.txt @@ -171,6 +171,11 @@ Yes, you can. It can boost more your WordPress performance since there is no net Please do manually remove wp-content/object-cache.php and wp-content/cache/docket-cache if an error occurs during updates. Thanks. == Changelog == += 22.07.01 (2022-07-15) = +- Fixed: Plugin:cleanuppost() -> Invalid index for trashbin. +- Fixed: MoCache() -> Add $entries, $headers properties to avoid warning on get_translations_for_domain. +- Updated: Symfony component -> symfony/var-exporter. + = 21.08.11 = - Fixed: Avoid calling Filesystem::close_buffer() if a process involved accessing a disk. - Fixed: Removed handling stale cache on shutdown.