Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * WordPress automatic updates can sometimes fail when updating a plugin. Common reasons are server timeouts,
- * permission issues, or a plugin script is still in use when WordPress attempts to delete the plugin. When
- * this happens, you may be left with an empty plugin folder which makes it impossible to reinstall the
- * plugin (since the plugin folder still exists).
- *
- * If this has happened to you with Site Reviews, then this snippet will tell WordPress to delete the
- * "site-reviews" folder from your plugins directory when installing the plugin.
- *
- * !! IMPORTANT !! Please remove or disable this snippet once you have finished reinstalling Site Reviews.
- *
- * @param array $options
- * @return array
- */
- add_filter('upgrader_package_options', function ($options) {
- $options = wp_parse_args((array) $options, ['package' => '']);
- if (false !== strpos($options['package'], '/plugin/site-reviews.')) {
- $options['clear_destination'] = true;
- }
- return $options;
- });
Add Comment
Please, Sign In to add comment