Support » Plugin: Swift Performance Lite » Please do not use static path in must-use plugin. Breaking staging sites!

  • Rene Hermenau


    Hi guys,

    I am the developer of WP Staging

    In your must-use plugin you are using a static path like this:

    $plugin_file = '/home/public_html/wp-content/plugins/swift-performance-lite/performance.php';

    WP Staging creates staging sites in sub folders like It’s also cloning the must-use plugins.

    This code is breaking users staging sites and lead to fatal errors when they create a staging site with WP Staging and other cloning plugins (Error Cannot declare class Swift…) This happens because WP Staging clones an entire site which includes the must-use plugins, too.

    So instead of using a static path please switch over to a dynamic approach like the one below:

    $plugin_file = ABSPATH '/wp-content/plugins/swift-performance-lite/performance.php';

    This should be working.


Viewing 5 replies - 1 through 5 (of 5 total)
  • Thx a lot for this input, I draw attention to your feedback to Swift’s author. He knows about it now, hopefully he will find a way to solve this one.

    • This reply was modified 1 month ago by  Ivica Delic.
    Rene Hermenau


    Thank you very much:-)

    Rene could you review my post and advise where to correct this error? I believe its the same one effecting me.


    @homegrownandy In folder wp-content/mu-plugins you find the swift must use plugin.

    Just do the code changes there and it is hopefully working.

    Otherwise, remove the must use plugin on the staging site. This should also fix it.

    If you really have the same issue please open another ticket here with the same issue. We need to make the developer of the swift plugin aware that this is a serious issue which needs to be fixed.

    PS Author found a way how to fix this, but not using the way you described due to other technical limitations of that solution, he had some other fix on his mind.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.