Title: Feature &#8211; SpinupWP
Last modified: August 30, 2024

---

# Feature – SpinupWP

 *  Resolved [jordantrizz](https://wordpress.org/support/users/jordantrizz/)
 * (@jordantrizz)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/feature-spinupwp/)
 * Are you able to add SpinupWP to the list of providers.
 *     ```wp-block-code
       <?php/* * Add this to your theme functions.php, or add to a plugin. **//** * Clear the SpinupWP Cache for the entire website. */function clear_spinup_cache(): bool{    if (! class_exists('SpinupWp\Cache')) {        return false;    }    $class_spinup_admin = new SpinupWp\AdminBar('/wp-content/plugins/spinupwp/');    $class_spinup_cli = new SpinupWp\Cli;    $class_spinup_cache = new SpinupWp\Cache($class_spinup_admin, $class_spinup_cli);    if ($class_spinup_cache->is_page_cache_enabled()) {        $purge = $GLOBALS['spinupwp']->cache->purge_page_cache();        $type = 'Page cache';        $res = $purge ? 'Cleared' : 'Not Cleared';        helpers\log("Purging {$type} result: {$res}");    }    if ($class_spinup_cache->is_object_cache_enabled()) {        $purge = $GLOBALS['spinupwp']->cache->purge_object_cache();        $type = 'Object cache';        $res = $purge ? 'Cleared' : 'Not Cleared';        // Commenting out because this helper class is unique to stafflink.        //helpers\log("Purging {$type} result: {$res}");    }    return true;}/** * Clear the cache for the specific URL only. */function clear_spinup_cache_for_this_url(): bool{    // exit quickly if spinup plugin does not exist    if (! class_exists('SpinupWp\Cache')) {        return false;    }    $url = home_url().'/wp-content/plugins/spinupwp/';    $class_spinup_admin = new SpinupWp\AdminBar($url);    $class_spinup_cli = new SpinupWp\Cli;    $class_spinup_cache = new SpinupWp\Cache($class_spinup_admin, $class_spinup_cli);    if ($class_spinup_cache->is_page_cache_enabled()) {        $url = $_SERVER['HTTP_REFERER'];        $purge = $GLOBALS['spinupwp']->cache->purge_url($url);        $type = 'URL page cache';        $res = $purge ? 'Cleared' : 'Not Cleared';        // Log page cache if success        // Commented out because this helper class is unique to STAFFLINK.        //helpers\log("Purging {$type} result: {$res}");    }}
       ```
   

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Kevin Pirnie](https://wordpress.org/support/users/kevp75/)
 * (@kevp75)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/feature-spinupwp/#post-17985056)
 * I will take a look
 * Thanks
 *  Plugin Author [Kevin Pirnie](https://wordpress.org/support/users/kevp75/)
 * (@kevp75)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/feature-spinupwp/#post-18024625)
 * This will be in the next version… will be out soon
 *  [Ryan Tvenge](https://wordpress.org/support/users/rtvenge/)
 * (@rtvenge)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/feature-spinupwp/#post-18049945)
 * [@kevp75](https://wordpress.org/support/users/kevp75/) Thanks for adding this!
 * Just a heads up that SpinupWP does [disable `opcache_get_status()` by default](https://spinupwp.com/doc/php-disabled-functions/),
   so this will throw a fatal php error (specifically it happened for me when trying
   to save a menu):
 *     ```wp-block-code
       Error Details=============An error of type E_ERROR was caused in line 126 of the file /sites/nda-mn.org/files/wp-content/plugins/the-cache-purger/work/inc/modules/php.php. Error message: Uncaught Error: Call to undefined function opcache_get_status() in /sites/nda-mn.org/files/wp-content/plugins/the-cache-purger/work/inc/modules/php.php:126Stack trace:#0 /sites/nda-mn.org/files/wp-content/plugins/the-cache-purger/work/inc/modules/php.php(65): KP_Cache_Purge->purge_php_opcache()#1 /sites/nda-mn.org/files/wp-content/plugins/the-cache-purger/work/inc/kp-cache-purge.php(123): KP_Cache_Purge->purge_php_caches()#2 /sites/nda-mn.org/files/wp-content/plugins/the-cache-purger/work/inc/kp-cache-purge-processor.php(606): KP_Cache_Purge->kp_do_purge()#3 /sites/nda-mn.org/files/wp-includes/class-wp-hook.php(326): KP_Cache_Purge_Processor->{closure}()#4 /sites/nda-mn.org/files/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()#5 /sites/nda-mn.org/files/wp-includes/plugin.php(517): WP_Hook->do_action()#6 /sites/nda-mn.org/files/wp-includes/taxonomy.php(3474): do_action()#7 /sites/nda-mn.org/files/wp-includes/nav-menu.php(386): wp_update_term()#8 /sites/nda-mn.org/files/wp-admin/nav-menus.php(486): wp_update_nav_menu_object()#9 {main} thrown
       ```
   
 * The server admin can remove this in the `php.ini` to fix the fatal error which
   is what I ended up doing. I’m not sure if this function is crucial for your plugin
   to work but maybe it would be worth doing a `function_exists('opcache_get_status')`
   on it first to avoid the fatal error?
 * Thanks again!
 *  Plugin Author [Kevin Pirnie](https://wordpress.org/support/users/kevp75/)
 * (@kevp75)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/feature-spinupwp/#post-18050052)
 * Interesting…
 * It shouldn’t have been erroring at all, I tossed an `@` before it which should
   have been silencing any error output.
 * However, even doing as you suggested will not correct the underlying issue. We
   need that method to ensure opcache is actually being utilized in order to clear
   it. It has a flag: `opcache_enabled`
 * I’m not sure that I will correct this… maybe the error from popping, but I can’t
   correct anything beyond that… but even correcting that will not fulfill the purpose
   of the plugin, in that… opcache needs to be cleared…
 * I’ll think on this and see if I can come up with some other way…

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Feature – SpinupWP’ is closed to new replies.

 * ![](https://ps.w.org/the-cache-purger/assets/icon-256x256.png?rev=3154520)
 * [The Cache Purger](https://wordpress.org/plugins/the-cache-purger/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/the-cache-purger/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/the-cache-purger/)
 * [Active Topics](https://wordpress.org/support/plugin/the-cache-purger/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/the-cache-purger/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/the-cache-purger/reviews/)

## Tags

 * [object-cache](https://wordpress.org/support/topic-tag/object-cache/)
 * [page-cache](https://wordpress.org/support/topic-tag/page-cache/)

 * 4 replies
 * 3 participants
 * Last reply from: [Kevin Pirnie](https://wordpress.org/support/users/kevp75/)
 * Last activity: [1 year, 10 months ago](https://wordpress.org/support/topic/feature-spinupwp/#post-18050052)
 * Status: resolved