Skip to content

Commit

Permalink
bump 23.08.02
Browse files Browse the repository at this point in the history
- Fixed: Tweaks::post_missed_schedule() -> Prevent post publish immediately.
- Fixed: WP_Object_Cache() -> Add setters and getters for backwards compatibility.
- Added: TWEAKS_SINGLESEARCHREDIRECT_DISABLED constant to disable redirection of single search results to the page.
- Updated: Tested up to 6.4.
  • Loading branch information
nawawi committed Nov 13, 2023
1 parent 581686e commit dbaf78e
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 23 deletions.
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
= v23.08.02 (2023-11-13) =

- Fixed: Tweaks::post_missed_schedule() -> Prevent post publish immediately.
- Fixed: WP_Object_Cache() -> Add setters and getters for backwards compatibility.
- Added: TWEAKS_SINGLESEARCHREDIRECT_DISABLED constant to disable redirection of single search results to the page.
- Updated: Tested up to 6.4.

= v23.08.01 (2023-08-19) =

- Fixed: LimitBulkedit::bulk_editing_is_limited() -> Deprecated Constant FILTER_SANITIZE_STRING.
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.01
* VerPrev: 22.07.05
* Version: 23.08.02
* VerPrev: 23.08.01
* 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
55 changes: 55 additions & 0 deletions includes/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,61 @@ public function __construct()
$this->dc_init();
}

/**
* Makes private properties readable for backward compatibility.
*
* @since 4.0.0
*
* @param string $name property to get
*
* @return mixed property
*/
public function __get($name)
{
return $this->$name;
}

/**
* Makes private properties settable for backward compatibility.
*
* @since 4.0.0
*
* @param string $name property to set
* @param mixed $value property value
*
* @return mixed newly-set property
*/
public function __set($name, $value)
{
return $this->$name = $value;
}

/**
* Makes private properties checkable for backward compatibility.
*
* @since 4.0.0
*
* @param string $name property to check if set
*
* @return bool whether the property is set
*/
public function __isset($name)
{
return isset($this->$name);
}

/**
* Makes private properties un-settable for backward compatibility.
*
* @since 4.0.0
*
* @param string $name property to unset
*/
public function __unset($name)
{
unset($this->$name);
}

/**
* Serves as a utility function to determine whether a key exists in the cache.
*
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.01
* Version: 23.08.02
* Description: Object Cache drop-in for Docket Cache.
* Author: Nawawi Jamili
* Author URI: https://docketcache.com
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.01';
private static $version = '23.08.02';
public static $send_cookie = false;

private static function default_args($param = [])
Expand Down
32 changes: 17 additions & 15 deletions includes/src/Tweaks.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,19 +245,21 @@ function ($post_id) {
public function misc()
{
// wp: if only one post is found by the search results, redirect user to that post
add_action(
'template_redirect',
function () {
if (is_search()) {
global $wp_query;
if (1 === (int) $wp_query->post_count && 1 === (int) $wp_query->max_num_pages) {
wp_redirect(get_permalink($wp_query->posts['0']->ID));
exit;
if (nwdcx_consfalse('TWEAKS_SINGLESEARCHREDIRECT_DISABLED')) {
add_action(
'template_redirect',
function () {
if (is_search()) {
global $wp_query;
if (1 === (int) $wp_query->post_count && 1 === (int) $wp_query->max_num_pages) {
wp_redirect(get_permalink($wp_query->posts['0']->ID));
exit;
}
}
}
},
\PHP_INT_MAX
);
},
\PHP_INT_MAX
);
}

// wp: hide update notifications to non-admin users
add_action(
Expand Down Expand Up @@ -630,7 +632,6 @@ function () {
$code .= 'script.src = src;';
$code .= 'script.async = true;';
$code .= 'document.head.appendChild(script);';
$code .= '';
$code .= '}';
$code .= '}';
$code .= '};';
Expand Down Expand Up @@ -736,11 +737,12 @@ public function post_missed_schedule()
];

$post_types = get_post_types($args, 'names', 'and');
$current_datetime = date('Y-m-d H:i:s');
if (!empty($post_types) && \is_array($post_types)) {
$types = implode("','", $post_types);
$query = $wpdb->prepare("SELECT ID FROM `{$wpdb->posts}` WHERE post_type in ('post','page','%s') AND post_status='future' ORDER BY ID ASC LIMIT %d", $types, $limit);
$query = $wpdb->prepare("SELECT ID FROM `{$wpdb->posts}` WHERE post_type in ('post','page','%s') AND post_status='future' AND %s >= post_date_gmt ORDER BY ID ASC LIMIT %d", $types, $current_datetime, $limit);
} else {
$query = $wpdb->prepare("SELECT ID FROM `{$wpdb->posts}` WHERE post_type in ('post','page') AND post_status='future' ORDER BY ID ASC LIMIT %d", $limit);
$query = $wpdb->prepare("SELECT ID FROM `{$wpdb->posts}` WHERE post_type in ('post','page') AND post_status='future' AND %s >= post_date_gmt ORDER BY ID ASC LIMIT %d", $current_datetime, $limit);
}

$results = $wpdb->get_results($query, ARRAY_A);
Expand Down
4 changes: 2 additions & 2 deletions languages/docket-cache.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# This file is distributed under the MIT.
msgid ""
msgstr ""
"Project-Id-Version: Docket Cache 23.08.01\n"
"Project-Id-Version: Docket Cache 23.08.02\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-08-19T13:14:48+00:00\n"
"POT-Creation-Date: 2023-11-13T01:07:27+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
10 changes: 8 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Contributors: nawawijamili
Tags: object cache, OPcache, cache, database, performance, Optimisation, redis, memcached, speed
Requires at least: 5.4
Tested up to: 6.3
Tested up to: 6.4
Requires PHP: 7.2.5
Stable tag: 23.08.01
Stable tag: 23.08.02
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 ==
= 23.08.02 =
- Fixed: Tweaks::post_missed_schedule() -> Prevent post publish immediately.
- Fixed: WP_Object_Cache() -> Add setters and getters for backwards compatibility.
- Added: TWEAKS_SINGLESEARCHREDIRECT_DISABLED constant to disable redirection of single search results to the page.
- Updated: Tested up to 6.4.

= 23.08.01 =
- Fixed: LimitBulkedit::bulk_editing_is_limited() -> Deprecated Constant FILTER_SANITIZE_STRING.
- Fixed: restrict_api error notice.
Expand Down

0 comments on commit dbaf78e

Please sign in to comment.