Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/wpforms-.../src/Migratio...
File: Upgrade1_9_1.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace WPForms\Migrations;
[2] Fix | Delete
[3] Fix | Delete
/**
[4] Fix | Delete
* Class upgrade for 1.9.1 release.
[5] Fix | Delete
*
[6] Fix | Delete
* @since 1.9.1
[7] Fix | Delete
*/
[8] Fix | Delete
class Upgrade1_9_1 extends UpgradeBase {
[9] Fix | Delete
[10] Fix | Delete
/**
[11] Fix | Delete
* Delete existed notifications for the customer.
[12] Fix | Delete
*
[13] Fix | Delete
* @since 1.9.1
[14] Fix | Delete
*
[15] Fix | Delete
* @return bool|null Upgrade result:
[16] Fix | Delete
* true - the upgrade completed successfully,
[17] Fix | Delete
* false - in the case of failure,
[18] Fix | Delete
* null - upgrade started but not yet finished (background task).
[19] Fix | Delete
*/
[20] Fix | Delete
public function run() {
[21] Fix | Delete
[22] Fix | Delete
$this->clean_summaries_cron_event();
[23] Fix | Delete
[24] Fix | Delete
$notifications_option_key = 'wpforms_notifications';
[25] Fix | Delete
$notifications = get_option( $notifications_option_key, [] );
[26] Fix | Delete
[27] Fix | Delete
if ( empty( $notifications['events'] ) ) {
[28] Fix | Delete
return true;
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
$notifications['events'] = [];
[32] Fix | Delete
[33] Fix | Delete
update_option( 'wpforms_notifications', $notifications );
[34] Fix | Delete
[35] Fix | Delete
return true;
[36] Fix | Delete
}
[37] Fix | Delete
[38] Fix | Delete
/**
[39] Fix | Delete
* Clean summaries and entries count cron events,
[40] Fix | Delete
* Since the 1.9.1 release these cron events recurrences have been changed to single event.
[41] Fix | Delete
* The events will be recreated on the next page load.
[42] Fix | Delete
*
[43] Fix | Delete
* @since 1.9.1
[44] Fix | Delete
*/
[45] Fix | Delete
private function clean_summaries_cron_event() {
[46] Fix | Delete
[47] Fix | Delete
if ( wp_next_scheduled( 'wpforms_weekly_entries_count_cron' ) ) {
[48] Fix | Delete
wp_clear_scheduled_hook( 'wpforms_weekly_entries_count_cron' );
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
if ( wp_next_scheduled( 'wpforms_email_summaries_cron' ) ) {
[52] Fix | Delete
wp_clear_scheduled_hook( 'wpforms_email_summaries_cron' );
[53] Fix | Delete
}
[54] Fix | Delete
}
[55] Fix | Delete
}
[56] Fix | Delete
[57] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function