Edit File by line
/home/barbar84/www/wp-conte.../plugins/minioran.../controll...
File: backup.php
<?php
[0] Fix | Delete
[1] Fix | Delete
global $MoMmpUtility,$mmp_dirName;
[2] Fix | Delete
$img_loader_url = plugin_dir_url(dirname(dirname(__FILE__)).'/includes/images/loader.gif');
[3] Fix | Delete
$page_url = "";
[4] Fix | Delete
$message = '<div id=\'backupmessage\'><h2>DO NOT :</h2><ol><li>Close this browser</li><li>Reload this page</li><li>Click the Stop or Back button.</li></ol><h2>Untill your database backup is completed</h2></div><br/><div class=\'backupmessage\'><h2><div id=\'inprogress\'>DATABASE BACKUP IN PROGRESS</div></h2></div><div id=\'dbloader\' ><img src=\"'.$img_loader_url.'\"></div>';
[5] Fix | Delete
$message2a = 'Database Backup is Completed. Check <b><i>';
[6] Fix | Delete
$message2b = '</i></b>file in db-backups folder.';
[7] Fix | Delete
[8] Fix | Delete
[9] Fix | Delete
if(current_user_can( 'manage_options' ) && isset($_POST['option']))
[10] Fix | Delete
{
[11] Fix | Delete
switch(sanitize_text_field($_POST['option']))
[12] Fix | Delete
{
[13] Fix | Delete
case "mo2f_enable_cron_backup":
[14] Fix | Delete
mmp_handle_db_enable_form($_POST); break;
[15] Fix | Delete
case "mo2f_cron_backup_configuration":
[16] Fix | Delete
mmp_handle_db_configuration_form($_POST); break;
[17] Fix | Delete
case "mo2f_enable_cron_file_backup":
[18] Fix | Delete
mmp_handle_file_backup_enable_form($_POST); break;
[19] Fix | Delete
}
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
[23] Fix | Delete
[24] Fix | Delete
[25] Fix | Delete
function mmp_handle_db_enable_form($postData){
[26] Fix | Delete
if(! get_option('mo2f_cron_hours')){
[27] Fix | Delete
update_option('mo2f_cron_hours', 43200);
[28] Fix | Delete
}
[29] Fix | Delete
$enable = isset($postData['mo2f_enable_cron_backup_timely']) ? $postData['mo2f_enable_cron_backup_timely'] : '0';
[30] Fix | Delete
update_option( 'mo2f_enable_cron_backup', $enable );
[31] Fix | Delete
if(get_option('mo2f_enable_cron_backup') == '0'){
[32] Fix | Delete
$handler_obj = new mo_mmp_site_backup;
[33] Fix | Delete
$handler_obj->bl_deactivate();
[34] Fix | Delete
do_action('mo_mmp_show_message',MoMmpMessages::showMessage('CRON_DB_BACKUP_DISABLE'),'ERROR');
[35] Fix | Delete
}else{
[36] Fix | Delete
do_action('mo_mmp_show_message',MoMmpMessages::showMessage('CRON_DB_BACKUP_ENABLE'),'SUCCESS');
[37] Fix | Delete
}
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
function mmp_handle_db_configuration_form($postData){
[41] Fix | Delete
$mo2f_cron_hours = $postData['mo2f_cron_hours'] * 60 *60;
[42] Fix | Delete
if($mo2f_cron_hours < 3600){
[43] Fix | Delete
do_action('mo_mmp_show_message',MoMmpMessages::showMessage('INVALID_HOURS'),'ERROR');
[44] Fix | Delete
}else{
[45] Fix | Delete
update_option('mo2f_cron_hours', $mo2f_cron_hours);
[46] Fix | Delete
$mo2f_enable_cron_backup =get_option('mo2f_enable_cron_backup',true);
[47] Fix | Delete
if(isset($mo2f_enable_cron_backup) && $mo2f_enable_cron_backup=='1'){
[48] Fix | Delete
$handler_obj = new mo_mmp_site_backup;
[49] Fix | Delete
$handler_obj->bl_deactivate();
[50] Fix | Delete
if ( ! wp_next_scheduled( 'bl_cron_hook' ) ) {
[51] Fix | Delete
wp_schedule_event( time(), 'db_backup_time', 'bl_cron_hook' );
[52] Fix | Delete
}
[53] Fix | Delete
do_action('mo_mmp_show_message',MoMmpMessages::showMessage('CONFIG_SAVED'),'SUCCESS');
[54] Fix | Delete
}
[55] Fix | Delete
}
[56] Fix | Delete
}
[57] Fix | Delete
[58] Fix | Delete
function mmp_handle_file_backup_enable_form($postData){
[59] Fix | Delete
if(! get_option('mo2f_cron_file_backup_hours')){
[60] Fix | Delete
update_option('mo2f_cron_file_backup_hours', 43200);
[61] Fix | Delete
}
[62] Fix | Delete
$enable = isset($postData['mo2f_enable_cron_file_backup_timely']) ? $postData['mo2f_enable_cron_file_backup_timely'] : '0';
[63] Fix | Delete
update_option( 'mo2f_enable_cron_file_backup', $enable );
[64] Fix | Delete
if(get_option('mo2f_enable_cron_file_backup') == '0'){
[65] Fix | Delete
$handler_obj = new mo_mmp_site_backup;
[66] Fix | Delete
$handler_obj->file_backup_deactivate();
[67] Fix | Delete
do_action('mo_mmp_show_message',MoMmpMessages::showMessage('CRON_FILE_BACKUP_DISABLE'),'ERROR');
[68] Fix | Delete
}
[69] Fix | Delete
else{
[70] Fix | Delete
do_action('mo_mmp_show_message',MoMmpMessages::showMessage('CRON_FILE_BACKUP_ENABLE'),'SUCCESS');
[71] Fix | Delete
}
[72] Fix | Delete
}
[73] Fix | Delete
[74] Fix | Delete
[75] Fix | Delete
include $mmp_dirName . 'views'.DIRECTORY_SEPARATOR.'backup.php';
[76] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function