Skip to content

Commit ea53a50

Browse files
authored
Merge pull request #10 from WordPress-Phoenix/develop
1.0.5 hotpatch
2 parents bf0b4b0 + 99932e5 commit ea53a50

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#### 1.0.5
2+
* Hotfix more GHU adjustments
3+
* Organized filters into filter class
4+
* run rest_cache->init() on actual wp init hook
5+
16
#### 1.0.4
27
* Version bump fixes
38

inc/class-wrc-filters.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ static function always_filters() {
2727
* Admin only filters are registered
2828
*/
2929
static function admin_filters() {
30+
// hook into refresh transients and clear cache at the same time
31+
add_action( 'ghu_refresh_transients', array( 'WRC_Utility', 'clear_ghu_cache') );
32+
// disable using transients as it is basically double caching
3033
add_filter( 'ghu_use_remote_call_transients', '__return_false' );
34+
// bypass update logic so ghu always reaches out to rest_cache for data
35+
add_filter('ghu_always_fetch_update', '__return_true');
3136
}
3237

3338
/**

wp-rest-cache.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Plugin URI: https://github.com/WordPress-Phoenix/wordpress-rest-cache
55
* Description: A solution to caching REST data calls without relying on transients or wp_options tables. Note: for multisite "Network Activate", table may need manually created before activation.
66
* Author: scarstens
7-
* Version: 1.0.4
7+
* Version: 1.0.5
88
* Author URI: http://github.com/scarstens
99
* License: GPL V2
1010
* Text Domain: rest_cache
@@ -60,18 +60,12 @@ public function __construct() {
6060
// Loads the /inc/ autoloader
6161
$this->load_classes();
6262

63-
// initialize not by adding an action but by running init function that adds its own actions/filters
64-
// nesting actions/filters within the init action was causing the transport filter to run too late in some cases
65-
$this->init();
66-
67-
add_action( 'before_ghu_delete_all_transients', array( 'WRC_Utility', 'clear_ghu_cache') );
63+
// initialize plugin during init
64+
add_action( 'init', array( $this, 'init' ) );
6865

6966
// init for use with logged in users, see this::authenticated_init for more details
7067
add_action( 'init', array( $this, 'authenticated_init' ) );
7168

72-
// uncomment the following to setup custom widget registration
73-
//add_action( 'widgets_init', array( $this, 'register_custom_widget' ) );
74-
7569
// hook can be used by mu plugins to modify plugin behavior after plugin is setup
7670
do_action( get_called_class() . '_setup', $this );
7771

0 commit comments

Comments
 (0)