diff --git a/.wordpress.org/blueprints/blueprint.json b/.wordpress.org/blueprints/blueprint.json new file mode 100644 index 0000000..70f5402 --- /dev/null +++ b/.wordpress.org/blueprints/blueprint.json @@ -0,0 +1,30 @@ +{ + "landingPage": "\/wp-admin\/plugins.php", + "preferredVersions": { + "php": "8.0", + "wp": "latest" + }, + "phpExtensionBundles": [ + "kitchen-sink" + ], + "features": { + "networking": true + }, + "steps": [ + { + "step": "installPlugin", + "pluginZipFile": { + "resource": "url", + "url": "https:\/\/downloads.wordpress.org\/plugin\/docket-cache.23.08.02.zip" + }, + "options": { + "activate": true + } + }, + { + "step": "login", + "username": "admin", + "password": "password" + } + ] +} \ No newline at end of file diff --git a/changelog.txt b/changelog.txt index a91413e..d9bc83c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,10 @@ += v24.07.01 (2024-07-21) = + +- Fixed: View::tooltip() -> Typos "dan". +- Fixed: Filesystem::sanitize_maxsizedisk() -> Returns default if empty. +- Added: DOCKET_CACHE_OPCVIEWER_SHOWALL constant to enable/disable listing all opcache file. +- Added: DOCKET_CACHE_PATH_NETWORK_(n) constant, to change default cache path for multinetwork. (n) for network Id. + = v23.08.02 (2023-11-13) = - Fixed: Tweaks::post_missed_schedule() -> Prevent post publish immediately. diff --git a/dist/docket-cache.zip b/dist/docket-cache.zip index 2777c8e..4785961 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 589b339..36de837 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: 23.08.02 - * VerPrev: 23.08.01 + * Version: 24.07.01 + * VerPrev: 23.08.02 * 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/compat.php b/includes/compat.php index 2d67d96..68af4db 100644 --- a/includes/compat.php +++ b/includes/compat.php @@ -162,10 +162,9 @@ function nwdcx_unserialize($data) } // To make query monitor happy. - $nwdcx_suppresserrors = nwdcx_suppresserrors(true); - $data = @unserialize(trim($data)); - - nwdcx_suppresserrors($nwdcx_suppresserrors); + set_error_handler(function () {}); + $data = unserialize(trim($data)); + restore_error_handler(); return $data; } @@ -581,7 +580,17 @@ function nwdcx_network_id() function nwdcx_network_dirpath($save_path) { if (nwdcx_network_multi() && !nwdcx_network_main()) { - $save_path = rtrim($save_path, '/').'/network-'.nwdcx_network_id().'/'; + $network_id = nwdcx_network_id(); + $cache_dir = sprintf('network-%s', $network_id); + + if (false === strpos($save_path, 'docket-cache-data')) { + $cache_path_constant = sprintf('DOCKET_CACHE_PATH_NETWORK_%s', $network_id); + if (\defined($cache_path_constant)) { + $save_path = \constant($cache_path_constant); + } + } + + $save_path = rtrim($save_path, '/').'/'.$cache_dir.'/'; } return $save_path; diff --git a/includes/object-cache.php b/includes/object-cache.php index 3ce82dd..b41f55e 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: 23.08.02 + * Version: 24.07.01 * Description: Object Cache drop-in for Docket Cache. * Author: Nawawi Jamili * Author URI: https://docketcache.com diff --git a/includes/src/Constans.php b/includes/src/Constans.php index cd02cdb..e8b9a4c 100644 --- a/includes/src/Constans.php +++ b/includes/src/Constans.php @@ -394,6 +394,9 @@ public function register_default() // opcviewer $this->maybe_define($this->px('OPCVIEWER'), false); + // opcviewer show all + $this->maybe_define($this->px('OPCVIEWER_SHOWALL'), false); + // cache stats $this->maybe_define($this->px('STATS'), true); diff --git a/includes/src/Crawler.php b/includes/src/Crawler.php index cb0e288..5d545ae 100644 --- a/includes/src/Crawler.php +++ b/includes/src/Crawler.php @@ -14,7 +14,7 @@ final class Crawler { - private static $version = '23.08.02'; + private static $version = '24.07.01'; public static $send_cookie = false; private static function default_args($param = []) diff --git a/includes/src/Filesystem.php b/includes/src/Filesystem.php index 5bc5796..7f53dff 100644 --- a/includes/src/Filesystem.php +++ b/includes/src/Filesystem.php @@ -41,7 +41,8 @@ public function is_docketcachedir($path) // 28042022: new cache directory. // depth = 3: cache/docket-cache/93/b2/8a/ // depth = 4: cache/docket-cache/network-1/93/b2/8a/ - $maxdepth = 4; + // depth = 5: cache/docket-cache/network/network-1/93/b2/8a/ + $maxdepth = 5; foreach ($dir as $n => $c) { if ($n <= $maxdepth && 0 === strcmp($name, $c)) { $ok = true; @@ -1525,7 +1526,7 @@ public function sanitize_maxsize($bytes) public function sanitize_maxsizedisk($bytes) { if (empty($bytes) || !\is_int($bytes)) { - $maxsizedisk = 524288000; // 500MB + return 524288000; // 500MB } if ($bytes < 104857600) { diff --git a/includes/src/OPcacheView.php b/includes/src/OPcacheView.php index a82d4c4..58813fc 100644 --- a/includes/src/OPcacheView.php +++ b/includes/src/OPcacheView.php @@ -124,6 +124,10 @@ private function get_files() $cpath = wp_normalize_path($arr['full_path']); $script = wp_normalize_path($script); + if ($this->pt->cf()->is_dcfalse('OPCVIEWER_SHOWALL') && !(0 === strpos($cpath, ABSPATH))) { + continue; + } + if (!empty($sstr) && false === strpos($cpath, $sstr)) { continue; } diff --git a/includes/src/View.php b/includes/src/View.php index f7c45fc..f0cbe47 100644 --- a/includes/src/View.php +++ b/includes/src/View.php @@ -593,8 +593,8 @@ private function tooltip($id) 'cronoptmzdb' => esc_html__('Docket Cache will optimize WordPress database tables using SQL optimizing syntax at scheduled times.', 'docket-cache'), 'wpoptaload' => esc_html__('Reduce the size of Options Autoload by excluding non-WordPress Option from autoloading.', 'docket-cache'), 'postmissedschedule' => esc_html__('Fix the WordPress Missed Schedule Error after scheduling a future blog post.', 'docket-cache'), - 'misc_tweaks' => esc_html__('Miscellaneous WordPress Tweaks. Including performance, security dan user experience.', 'docket-cache'), - 'wootweaks' => esc_html__('Miscellaneous WooCommerce Tweaks. Including performance, security dan user experience.', 'docket-cache'), + 'misc_tweaks' => esc_html__('Miscellaneous WordPress Tweaks. Including performance, security and user experience.', 'docket-cache'), + 'wootweaks' => esc_html__('Miscellaneous WooCommerce Tweaks. Including performance, security and user experience.', 'docket-cache'), 'wooadminoff' => esc_html__('WooCommerce Admin or Analytics page is a new JavaScript-driven interface for managing stores. Enable this option to turn off any feature-related.', 'docket-cache'), 'woowidgetoff' => esc_html__('Deactivate WooCommerce Classic Widget feature.', 'docket-cache'), 'woowpdashboardoff' => esc_html__('Remove the WooCommerce meta box in the WordPress Dashboard.', 'docket-cache'), diff --git a/languages/docket-cache.pot b/languages/docket-cache.pot index cc76205..b04e9a1 100644 --- a/languages/docket-cache.pot +++ b/languages/docket-cache.pot @@ -1,15 +1,15 @@ -# Copyright (C) 2023 Nawawi Jamili +# Copyright (C) 2024 Nawawi Jamili # This file is distributed under the MIT. msgid "" msgstr "" -"Project-Id-Version: Docket Cache 23.08.02\n" +"Project-Id-Version: Docket Cache 24.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: 2023-11-13T01:07:27+00:00\n" +"POT-Creation-Date: 2024-07-21T14:03:25+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.7.1\n" "X-Domain: docket-cache\n" @@ -457,7 +457,7 @@ msgid "Statistics" msgstr "" #: includes/admin/opcviewer.php:126 -#: includes/src/OPcacheView.php:237 +#: includes/src/OPcacheView.php:241 msgid "Cache Hits" msgstr "" @@ -466,7 +466,7 @@ msgid "Cache Misses" msgstr "" #: includes/admin/opcviewer.php:132 -#: includes/src/OPcacheView.php:236 +#: includes/src/OPcacheView.php:240 msgid "Cached Files" msgstr "" @@ -493,7 +493,7 @@ msgid "Blacklist Miss Ratio" msgstr "" #: includes/admin/opcviewer.php:160 -#: includes/src/OPcacheView.php:238 +#: includes/src/OPcacheView.php:242 msgid "Memory Usage" msgstr "" @@ -1515,19 +1515,19 @@ msgstr[0] "" msgstr[1] "" #. translators: %s = utc offset -#: includes/src/OPcacheView.php:233 +#: includes/src/OPcacheView.php:237 msgid "Last Used %s" msgstr "" -#: includes/src/OPcacheView.php:244 +#: includes/src/OPcacheView.php:248 msgid "File Size" msgstr "" -#: includes/src/OPcacheView.php:298 +#: includes/src/OPcacheView.php:302 msgid "OPcache items not available." msgstr "" -#: includes/src/OPcacheView.php:300 +#: includes/src/OPcacheView.php:304 msgid "No matching OPcache Cached Files." msgstr "" @@ -1972,11 +1972,11 @@ msgid "Fix the WordPress Missed Schedule Error after scheduling a future blog po msgstr "" #: includes/src/View.php:596 -msgid "Miscellaneous WordPress Tweaks. Including performance, security dan user experience." +msgid "Miscellaneous WordPress Tweaks. Including performance, security and user experience." msgstr "" #: includes/src/View.php:597 -msgid "Miscellaneous WooCommerce Tweaks. Including performance, security dan user experience." +msgid "Miscellaneous WooCommerce Tweaks. Including performance, security and user experience." msgstr "" #: includes/src/View.php:598 diff --git a/readme.txt b/readme.txt index 20d82dd..3743832 100644 --- a/readme.txt +++ b/readme.txt @@ -1,10 +1,10 @@ === Docket Cache - Object Cache Accelerator === Contributors: nawawijamili -Tags: object cache, OPcache, cache, database, performance, Optimisation, redis, memcached, speed +Tags: object cache, OPcache, cache, database, performance Requires at least: 5.4 -Tested up to: 6.4 +Tested up to: 6.6 Requires PHP: 7.2.5 -Stable tag: 23.08.02 +Stable tag: 24.07.01 License: MIT License URI: https://github.com/nawawi/docket-cache/blob/master/LICENSE.txt @@ -172,6 +172,12 @@ 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 == += 24.07.01 = +- Fixed: View::tooltip() -> Typos "dan". +- Fixed: Filesystem::sanitize_maxsizedisk() -> Returns default if empty. +- Added: DOCKET_CACHE_OPCVIEWER_SHOWALL constant to enable/disable listing all opcache file. +- Added: DOCKET_CACHE_PATH_NETWORK_(n) constant, to change default cache path for multinetwork. (n) for network Id. + = 23.08.02 = - Fixed: Tweaks::post_missed_schedule() -> Prevent post publish immediately. - Fixed: WP_Object_Cache() -> Add setters and getters for backwards compatibility.