Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wpmudev-sls/dd86122ee60cf04aa027aff2678a0c57 to your computer and use it in GitHub Desktop.
Save wpmudev-sls/dd86122ee60cf04aa027aff2678a0c57 to your computer and use it in GitHub Desktop.
[WPMU DEV] Delete wp_snapshot_backup_schedule option
<?php
/**
* Plugin Name: [WPMU DEV] Delete wp_snapshot_backup_schedule option
* Plugin URI: https://glaubersilva.me/
* Description: Sometimes the schedule option gets corrupted in the database and when you try to exchange the date-time in Snapshot you get the message: "Request for a backup schedule was not successful." – This plugin helps you to solve this problem, just access: YOUR-DOMAIN.COM/?delete=wp_snapshot_backup_schedule.
* Author: Glauber Silva @ WPMUDEV
* Author URI: https://glaubersilva.me/
* Task: SLS-1674
* License: GPLv2 or later
*
* @package WPMUDEV_Delete_wp_snapshot_backup_schedule_Option
*/
defined( 'ABSPATH' ) || exit;
/**
* Add this file in you /wp-content/mu-plugins folder
* To delete the option, access: YOUR-DOMAIN.COM/?delete=wp_snapshot_backup_schedule
* After that, delete this file!
*/
function wpmudev_delete_snapshot_schedule_option(){
if ( isset( $_REQUEST['delete'] ) && 'wp_snapshot_backup_schedule' === $_REQUEST['delete'] ) {
$response = delete_option( $_REQUEST['delete'] );
if ( $response ){
echo 'The <b>wp_snapshot_backup_schedule</b> option was successfully deleted.<br><br>';
echo '<b>ATTENTION:</b> remember to remove this plugin now that the option already is deleted! ;-)<br><br>';
exit;
}
}
}
add_action( 'init', 'wpmudev_delete_snapshot_schedule_option' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment