'.__('The settings for WordPress File Backup are empty!', 'wp-postratings').'
'.sprintf(__('To fix this, Go to "Backup Site Files" in the administration menu and select an option in the "Settings" area then click "Save Changes"', 'wp-postratings')).'
';
}
}
if(!@file_exists(WP_CONTENT_DIR . '/alex-file-backups/')) {
mkdir(WP_CONTENT_DIR . "/alex-file-backups");
}
if(!@file_exists(WP_CONTENT_DIR . '/alex-file-backups/index.php')) {
if (!copy(WP_CONTENT_DIR . "/plugins/wordpress-file-backup/index.php", WP_CONTENT_DIR . "/alex-file-backups/index.php")) {
echo "failed to write file '" . WP_CONTENT_DIR . "/alex-file-backups/index.php" / "' in '" . WP_CONTENT_DIR . "/alex-file-backups/" . "'";
}
}
function alex_file_plugin_menu() {
add_menu_page('Backup Site Files', 'Backup Site Files', 'manage_options', 'alex_file_wp_backup', 'alex_file_plugin_options');
}
function alex_file_plugin_options() {
if (!current_user_can('manage_options')) {
wp_die( __('You do not have sufficient permissions to access this page.') );
}
echo '
Old backups are automatically deleted when new ones are made, but you can delete old ones manually
";
}
if($_REQUEST["action"]=="email_to_admin"){
wp_mail(get_option('admin_email'),'Alex Wordpress Backup', "Here's your backup","" ,get_option("alex_file_backup_filename"));
echo "There!, I sent the backup as an attachment to your email The attached backup file should look something like 4958e2917dbf36ea53b46c6b954917e9.tar.gz Have fun!";
}
if($_REQUEST["action"]=="delete_old"){
$fh = fopen(get_option('alex_file_backup_filename'), 'w') or die("can't open file, are you sure I have permission to open the file?");
fclose($fh);
echo "Old backup file successfully deleted!";
}
}
echo "