How to add StackCache when it is deleted

Times by times users overwrite WordPress files or just simply delete some files and contact us asking to restore StackCache.

Here is how you can do it for yourself and all you need to do is ensure you have the correct file path for the plugin:

public_html > wp-content > mu-plugins > wp-stack-cache.php

The code you will need to add into wp-stack-cache.php, is:

<?php

/**
* Plugin Name: StackCache
* Plugin URI: http://cache.stackcp.com/
* Description: Wrapper to include the Stack Cache Plugin Library
* Author: Stack CP
*/

// If this file is called directly, abort.
if ( ! defined( "WPINC" ) ) die;

// Load and run
foreach ( ["/../../../wp-admin/includes/file.php", "/../../wp-admin/includes/file.php"] as $path ) {
$full_path = plugin_dir_path(__FILE__) . $path;
if ( file_exists($full_path) ) {
require_once($full_path);
define( 'PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
}
}
require "/usr/share/php/wp-stack-cache.php";
$wpsc = new WPStackCache();

Wish to copy/paste it? You can do it from here: https://pastebin.com/mWsfPH4Q

That's it :)

Have a great day,

Helmuts

  • StackCache, stackcp
  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

How to access all support articles about Cloud Hosting

Did you know that we have a dedicated support articles database for all our Cloud Hosting...

What are my email sending limits?

Email Account Limits The following limits apply to all messages sent via authenticated SMTP....

What’s the maximum MySQL database size allowed?

At stackcp.com  each MySQL database you create can store up to 1024 MB (1 GB) of data. As...

How do I use the free Website Malware Scanner?

Overview One of the major problems with malware is its persistence. This is why stackcp.com...

Can I have additional IP address for my Cloud Hosting?

Short answer: No. That's not possible as all Cloud Hosting packages use our CDN network, they...