• Resolved mdxclr

    (@mdxclr)


    Hi,
    When roots/bedrock + sage is used and WP Rest cache required as mu-plugin – the cache not working (for custom and defaults endpoints also).
    The mu rest-cache helper was autocreated and is the same as from sources folder.
    If plugin is installed as basic plugin – all is ok and all works fine.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Richard Korthuis

    (@rockfire)

    Hi @mdxclr

    Thank you for using our plugin!

    Sorry I didn’t respond earlier, I did not have time to test roots/bedrock + sage together with our plugin any sooner and didn’t want to give you an answer without testing.

    Am I correct in assuming you were requiring our complete plugin as a mu-plugin? I am asking this since our plugin also installs its own mu-plugin (the one you call the mu rest-cache helper). If you did, than yes our plugin isn’t working. This has to do with the mu-plugin created by our plugin, it doesn’t account for the fact that our plugin might be installed as a mu-plugin.
    In order for this to work, you would have to change the mu-plugin created by our plugin. You would have to change:

    if ( is_plugin_active( 'wp-rest-cache/wp-rest-cache.php' ) ) {
    	include_once WP_PLUGIN_DIR . '/wp-rest-cache/wp-rest-cache.php';
    
    	$wp_rest_cache_api = new \WP_Rest_Cache_Plugin\Includes\API\Endpoint_Api();
    	$wp_rest_cache_api->get_api_cache();
    }

    into this:

    include_once WPMU_PLUGIN_DIR . '/wp-rest-cache/wp-rest-cache.php';
    
    $wp_rest_cache_api = new \WP_Rest_Cache_Plugin\Includes\API\Endpoint_Api();
    $wp_rest_cache_api->get_api_cache();

    So remove the if-clause and change the constant WP_PLUGIN_DIR into WPMU_PLUGIN_DIR

    Thread Starter mdxclr

    (@mdxclr)

    Hi,
    is that possible to make on your side?
    I’m installing wp-rest-cache via composer so I can’t change the plugin files manually.
    Thanks

    Plugin Author Richard Korthuis

    (@rockfire)

    Hi @mdxclr

    We just released a new version of our plugin with a fix for this problem. You have to deactivate and then activate the plugin in order for the fix to be applied.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘bedrock + mu-plugin’ is closed to new replies.