Skip to content

Commit

Permalink
bump 24.07.01
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
nawawi committed Jul 21, 2024
1 parent 3f647c0 commit 05cb891
Show file tree
Hide file tree
Showing 13 changed files with 88 additions and 28 deletions.
30 changes: 30 additions & 0 deletions .wordpress.org/blueprints/blueprint.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Binary file modified dist/docket-cache.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions docket-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 14 additions & 5 deletions includes/compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion includes/object-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions includes/src/Constans.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion includes/src/Crawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [])
Expand Down
5 changes: 3 additions & 2 deletions includes/src/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 4 additions & 0 deletions includes/src/OPcacheView.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions includes/src/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
24 changes: 12 additions & 12 deletions languages/docket-cache.pot
Original file line number Diff line number Diff line change
@@ -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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\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"
Expand Down Expand Up @@ -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 ""

Expand All @@ -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 ""

Expand All @@ -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 ""

Expand Down Expand Up @@ -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 ""

Expand Down Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 05cb891

Please sign in to comment.