'.__('The folder /wp-content/alex-backups/ is visible to the public!', 'wp-postratings').'

'.sprintf(__('To fix this, create an empty file called index.php in the directory wp-content/alex-backups', 'wp-postratings')).'

'; } if(get_option("alex_file_backup_whattouse")=="nothing"){ echo '

'.__('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 '
'; echo "

Generate Backup

"; if(isset($_REQUEST["action"])){ if($_REQUEST["action"]=="backup"){ require("file_backup.php"); echo "What do you want to do?
"; echo "

Directly download the backup file

"; echo "

Email this backup to the administrator's email as an attachment

"; echo "

Delete old backup

"; 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 "

Settings:

"; echo '
'; echo 'Current setting: ' . get_option('alex_file_backup_whattouse') . '
'; if($_REQUEST["whattouse"]){ update_option('alex_file_backup_whattouse', $_REQUEST["whattouse"]); echo '

Settings Updated!

'; } if(function_exists('passthru')) { echo 'passthru() is enabled.
'; echo 'Use passthru?
'; } else { echo 'passthru() is disabled and cant be used.
'; } if(function_exists('system')) { echo 'system() is enabled
'; echo 'Use System?
'; } else { echo 'system() is disabled and cant be used.font>
'; } if(function_exists('exec')) { echo 'exec() is enabled
'; echo 'Use exec?
'; } else { echo 'exec() is disabled and cant be used.'; } echo ''; echo ''; echo "

Please visit my site http://www.strangebutfunny.net

"; echo '
'; } add_action('admin_menu', 'alex_file_plugin_menu'); ?>