• Hi guys,

    i am the creator of WP Staging

    All WP Staging users who are using WP Super Cache on their website are complaining about the fatal error below when they are trying to create a staging site in the subfolder of WordPress. This only happened in recent version of WP Super Cache and was no issue before:

    Fatal error: Cannot redeclare gzip_accepted() (previously declared in .../wp-content/plugins/wp-super-cache/wp-cache-phase2.php:62) in.../staging-site/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 4

    WP Staging creates a staging site in a subfolder of the main website for testing plugin and theme updates first before updating them on the live site. To bypass this issue for the moment we need to exclude wp super cache from the cloning process but than we can not test wp super cache any longer.

    To fix the issue permanently we just need to check if gzip_accepted() has been declared already or better create a method which checks if a site is a staging site. Jetpack had the same issue in a previous version until they wrote the is_staging_site() method https://github.com/Automattic/jetpack/blob/9e16317e8fe3113668cc95e2e5e20fdb38ffa374/class.jetpack.php#L6042

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Fatal error: Cannot redeclare gzip_accepted()’ is closed to new replies.