Skip to content

Commit

Permalink
No longer using <font>
Browse files Browse the repository at this point in the history
  • Loading branch information
lesterchan committed Oct 11, 2014
1 parent 787d6b8 commit 53bd97f
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 51 deletions.
44 changes: 22 additions & 22 deletions database-backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@
}
$error = execute_backup($backup['command']);
if(!is_writable($backup['path'])) {
$text = '<font color="red">'.sprintf(__('Database Failed To Backup On \'%s\'. Backup Folder Not Writable.', 'wp-dbmanager'), $current_date).'</font>';
$text = '<p style="color: red;">'.sprintf(__('Database Failed To Backup On \'%s\'. Backup Folder Not Writable.', 'wp-dbmanager'), $current_date).'</p>';
} elseif(filesize($backup['filepath']) == 0) {
unlink($backup['filepath']);
$text = '<font color="red">'.sprintf(__('Database Failed To Backup On \'%s\'. Backup File Size Is 0KB.', 'wp-dbmanager'), $current_date).'</font>';
$text = '<p style="color: red;">'.sprintf(__('Database Failed To Backup On \'%s\'. Backup File Size Is 0KB.', 'wp-dbmanager'), $current_date).'</p>';
} elseif(!is_file($backup['filepath'])) {
$text = '<font color="red">'.sprintf(__('Database Failed To Backup On \'%s\'. Invalid Backup File Path.', 'wp-dbmanager'), $current_date).'</font>';
$text = '<p style="color: red;">'.sprintf(__('Database Failed To Backup On \'%s\'. Invalid Backup File Path.', 'wp-dbmanager'), $current_date).'</p>';
} elseif($error) {
$text = '<font color="red">'.sprintf(__('Database Failed To Backup On \'%s\'.', 'wp-dbmanager'), $current_date).'</font>';
$text = '<p style="color: red;">'.sprintf(__('Database Failed To Backup On \'%s\'.', 'wp-dbmanager'), $current_date).'</p>';
} else {
$text = '<font color="green">'.sprintf(__('Database Backed Up Successfully On \'%s\'.', 'wp-dbmanager'), $current_date).'</font>';
$text = '<p style="color: green;">'.sprintf(__('Database Backed Up Successfully On \'%s\'.', 'wp-dbmanager'), $current_date).'</p>';
}
break;
}
Expand All @@ -83,75 +83,75 @@
<?php _e('Checking Backup Folder', 'wp-dbmanager'); ?> <span dir="ltr">(<strong><?php echo stripslashes($backup['path']); ?></strong>)</span> ...<br />
<?php
if(@is_dir(stripslashes($backup['path']))) {
echo '<font color="green">'.__('Backup folder exists', 'wp-dbmanager').'</font><br />';
echo '<p style="color: green;">'.__('Backup folder exists', 'wp-dbmanager').'</p>';
$status_count++;
} else {
echo '<font color="red">'.sprintf(__('Backup folder does NOT exist. Please create \'backup-db\' folder in \'%s\' folder and CHMOD it to \'777\' or change the location of the backup folder under DB Option.', 'wp-dbmanager'), WP_CONTENT_DIR).'</font><br />';
echo '<p style="color: red;">'.sprintf(__('Backup folder does NOT exist. Please create \'backup-db\' folder in \'%s\' folder and CHMOD it to \'777\' or change the location of the backup folder under DB Option.', 'wp-dbmanager'), WP_CONTENT_DIR).'</p>';
}
if(@is_writable(stripslashes($backup['path']))) {
echo '<font color="green">'.__('Backup folder is writable', 'wp-dbmanager').'</font>';
echo '<p style="color: green;">'.__('Backup folder is writable', 'wp-dbmanager').'</p>';
$status_count++;
} else {
echo '<font color="red">'.__('Backup folder is NOT writable. Please CHMOD it to \'777\'.', 'wp-dbmanager').'</font>';
echo '<p style="color: red;">'.__('Backup folder is NOT writable. Please CHMOD it to \'777\'.', 'wp-dbmanager').'</p>';
}
?>
</p>
<p>
<?php
if(@file_exists(stripslashes($backup['mysqldumppath']))) {
echo __('Checking MYSQL Dump Path', 'wp-dbmanager').' <span dir="ltr">(<strong>'.stripslashes($backup['mysqldumppath']).'</strong>)</span> ...<br />';
echo '<font color="green">'.__('MYSQL dump path exists.', 'wp-dbmanager').'</font>';
echo '<p style="color: green;">'.__('MYSQL dump path exists.', 'wp-dbmanager').'</p>';
$status_count++;
} else {
echo __('Checking MYSQL Dump Path', 'wp-dbmanager').' ...<br />';
echo '<font color="red">'.__('MYSQL dump path does NOT exist. Please check your mysqldump path under DB Options. If uncertain, contact your server administrator.', 'wp-dbmanager').'</font>';
echo '<p style="color: red;">'.__('MYSQL dump path does NOT exist. Please check your mysqldump path under DB Options. If uncertain, contact your server administrator.', 'wp-dbmanager').'</p>';
}
?>
</p>
<p>
<?php
if(@file_exists(stripslashes($backup['mysqlpath']))) {
echo __('Checking MYSQL Path', 'wp-dbmanager').' <span dir="ltr">(<strong>'.stripslashes($backup['mysqlpath']).'</strong>)</span> ...<br />';
echo '<font color="green">'.__('MYSQL path exists.', 'wp-dbmanager').'</font>';
echo '<p style="color: green;">'.__('MYSQL path exists.', 'wp-dbmanager').'</p>';
$status_count++;
} else {
echo __('Checking MYSQL Path', 'wp-dbmanager').' ...<br />';
echo '<font color="red">'.__('MYSQL path does NOT exist. Please check your mysql path under DB Options. If uncertain, contact your server administrator.', 'wp-dbmanager').'</font>';
echo '<p style="color: red;">'.__('MYSQL path does NOT exist. Please check your mysql path under DB Options. If uncertain, contact your server administrator.', 'wp-dbmanager').'</p>';
}
?>
</p>
<p>
<?php _e('Checking PHP Functions', 'wp-dbmanager'); ?> <span dir="ltr">(<strong>passthru()</strong>, <strong>system()</strong> <?php _e('and', 'wp-dbmanager'); ?> <strong>exec()</strong>)</span> ...<br />
<?php
if(function_exists('passthru')) {
echo '<font color="green"><span dir="ltr">passthru()</span> '.__('enabled', 'wp-dbmanager').'.</font><br />';
echo '<p style="color: green;"><span dir="ltr">passthru()</span> '.__('enabled', 'wp-dbmanager').'.</p>';
$status_count++;
} else {
echo '<font color="red"><span dir="ltr">passthru()</span> '.__('disabled', 'wp-dbmanager').'.</font><br />';
echo '<p style="color: red;"><span dir="ltr">passthru()</span> '.__('disabled', 'wp-dbmanager').'.</p>';
$stats_function_disabled++;
}
if(function_exists('system')) {
echo '<font color="green"><span dir="ltr">system()</span> '.__('enabled', 'wp-dbmanager').'.</font><br />';
echo '<p style="color: green;"><span dir="ltr">system()</span> '.__('enabled', 'wp-dbmanager').'.</p>';
} else {
echo '<font color="red"><span dir="ltr">system()</span> '.__('disabled', 'wp-dbmanager').'.</font><br />';
echo '<p style="color: red;"><span dir="ltr">system()</span> '.__('disabled', 'wp-dbmanager').'.</p>';
$stats_function_disabled++;
}
if(function_exists('exec')) {
echo '<font color="green"><span dir="ltr">exec()</span> '.__('enabled', 'wp-dbmanager').'.</font>';
echo '<p style="color: green;"><span dir="ltr">exec()</span> '.__('enabled', 'wp-dbmanager').'.</p>';
} else {
echo '<font color="red"><span dir="ltr">exec()</span> '.__('disabled', 'wp-dbmanager').'.</font>';
echo '<p style="color: red;"><span dir="ltr">exec()</span> '.__('disabled', 'wp-dbmanager').'.</p>';
$stats_function_disabled++;
}
?>
</p>
<p>
<?php
if($status_count == 5) {
echo '<strong><font color="green">'.__('Excellent. You Are Good To Go.', 'wp-dbmanager').'</font></strong>';
echo '<strong><p style="color: green;">'.__('Excellent. You Are Good To Go.', 'wp-dbmanager').'</p></strong>';
} else if($stats_function_disabled == 3) {
echo '<strong><font color="red">'.__('I\'m sorry, your server administrator has disabled passthru(), system() and exec(), thus you cannot use this backup script. You may consider using the default WordPress database backup script instead.', 'wp-dbmanager').'</font></strong>';
echo '<strong><p style="color: red;">'.__('I\'m sorry, your server administrator has disabled passthru(), system() and exec(), thus you cannot use this backup script. You may consider using the default WordPress database backup script instead.', 'wp-dbmanager').'</p></strong>';
} else {
echo '<strong><font color="red">'.__('Please Rectify The Error Highlighted In Red Before Proceeding On.', 'wp-dbmanager').'</font></strong>';
echo '<strong><p style="color: red;">'.__('Please Rectify The Error Highlighted In Red Before Proceeding On.', 'wp-dbmanager').'</p></strong>';
}
?>
</p>
Expand Down
6 changes: 3 additions & 3 deletions database-empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@
}
}
} else {
$text = '<font color="red">'.__('No Tables Selected.', 'wp-dbmanager').'</font>';
$text = '<p style="color: red;">'.__('No Tables Selected.', 'wp-dbmanager').'</p>';
}
$drop_tables = substr($drop_tables, 2);
if(!empty($empty_tables)) {
foreach($empty_tables as $empty_table) {
$empty_query = $wpdb->query("TRUNCATE $empty_table");
$text .= '<font color="green">'.sprintf(__('Table \'%s\' Emptied', 'wp-dbmanager'), $empty_table).'</font><br />';
$text .= '<p style="color: green;">'.sprintf(__('Table \'%s\' Emptied', 'wp-dbmanager'), $empty_table).'</p>';
}
}
if(!empty($drop_tables)) {
$drop_query = $wpdb->query("DROP TABLE $drop_tables");
$text = '<font color="green">'.sprintf(__('Table(s) \'%s\' Dropped', 'wp-dbmanager'), $drop_tables).'</font>';
$text = '<p style="color: green;">'.sprintf(__('Table(s) \'%s\' Dropped', 'wp-dbmanager'), $drop_tables).'</p>';
}
break;
}
Expand Down
22 changes: 11 additions & 11 deletions database-manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,45 +50,45 @@
}
passthru($backup['command'], $error);
if($error) {
$text = '<font color="red">'.sprintf(__('Database On \'%s\' Failed To Restore', 'wp-dbmanager'), $nice_file_date).'</font>';
$text = '<p style="color: red;">'.sprintf(__('Database On \'%s\' Failed To Restore', 'wp-dbmanager'), $nice_file_date).'</p>';
} else {
$text = '<font color="green">'.sprintf(__('Database On \'%s\' Restored Successfully', 'wp-dbmanager'), $nice_file_date).'</font>';
$text = '<p style="color: green;">'.sprintf(__('Database On \'%s\' Restored Successfully', 'wp-dbmanager'), $nice_file_date).'</p>';
}
} else {
$text = '<font color="red">'.__('No Backup Database File Selected', 'wp-dbmanager').'</font>';
$text = '<p style="color: red;">'.__('No Backup Database File Selected', 'wp-dbmanager').'</p>';
}
break;
case __('E-Mail', 'wp-dbmanager'):
if(!empty($database_file)) {
$to = ( !empty( $_POST['email_to'] ) ? sanitize_email( $_POST['email_to'] ) : get_option( 'admin_email' ) );

if( dbmanager_email_backup( $to, $backup['path'].'/'.$database_file ) ) {
$text .= '<font color="green">'.sprintf(__('Database Backup File For \'%s\' Successfully E-Mailed To \'%s\'', 'wp-dbmanager'), $nice_file_date, $to).'</font><br />';
$text .= '<p style="color: green;">'.sprintf(__('Database Backup File For \'%s\' Successfully E-Mailed To \'%s\'', 'wp-dbmanager'), $nice_file_date, $to).'</p>';
} else {
$text = '<font color="red">'.sprintf(__('Unable To E-Mail Database Backup File For \'%s\' To \'%s\'', 'wp-dbmanager'), $nice_file_date, $to).'</font>';
$text = '<p style="color: red;">'.sprintf(__('Unable To E-Mail Database Backup File For \'%s\' To \'%s\'', 'wp-dbmanager'), $nice_file_date, $to).'</p>';
}
} else {
$text = '<font color="red">'.__('No Backup Database File Selected', 'wp-dbmanager').'</font>';
$text = '<p style="color: red;">'.__('No Backup Database File Selected', 'wp-dbmanager').'</p>';
}
break;
case __('Download', 'wp-dbmanager'):
if(empty($database_file)) {
$text = '<font color="red">'.__('No Backup Database File Selected', 'wp-dbmanager').'</font>';
$text = '<p style="color: red;">'.__('No Backup Database File Selected', 'wp-dbmanager').'</p>';
}
break;
case __('Delete', 'wp-dbmanager'):
if(!empty($database_file)) {
if(is_file($backup['path'].'/'.$database_file)) {
if(!unlink($backup['path'].'/'.$database_file)) {
$text .= '<font color="red">'.sprintf(__('Unable To Delete Database Backup File On \'%s\'', 'wp-dbmanager'), $nice_file_date).'</font><br />';
$text .= '<p style="color: red;">'.sprintf(__('Unable To Delete Database Backup File On \'%s\'', 'wp-dbmanager'), $nice_file_date).'</p>';
} else {
$text .= '<font color="green">'.sprintf(__('Database Backup File On \'%s\' Deleted Successfully', 'wp-dbmanager'), $nice_file_date).'</font><br />';
$text .= '<p style="color: green;">'.sprintf(__('Database Backup File On \'%s\' Deleted Successfully', 'wp-dbmanager'), $nice_file_date).'</p>';
}
} else {
$text = '<font color="red">'.sprintf(__('Invalid Database Backup File On \'%s\'', 'wp-dbmanager'), $nice_file_date).'</font>';
$text = '<p style="color: red;">'.sprintf(__('Invalid Database Backup File On \'%s\'', 'wp-dbmanager'), $nice_file_date).'</p>';
}
} else {
$text = '<font color="red">'.__('No Backup Database File Selected', 'wp-dbmanager').'</font>';
$text = '<p style="color: red;">'.__('No Backup Database File Selected', 'wp-dbmanager').'</p>';
}
break;
}
Expand Down
6 changes: 3 additions & 3 deletions database-optimize.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@
}
}
} else {
$text = '<font color="red">'.__('No Tables Selected', 'wp-dbmanager').'</font>';
$text = '<p style="color: red;">'.__('No Tables Selected', 'wp-dbmanager').'</p>';
}
$selected_tables = substr($tables_string, 3);
$selected_tables .= '`';
if(!empty($selected_tables)) {
$optimize2 = $wpdb->query("OPTIMIZE TABLE $selected_tables");
if(!$optimize2) {
$text = '<font color="red">'.sprintf(__('Table(s) \'%s\' NOT Optimized', 'wp-dbmanager'), str_replace('`', '', $selected_tables)).'</font>';
$text = '<p style="color: red;">'.sprintf(__('Table(s) \'%s\' NOT Optimized', 'wp-dbmanager'), str_replace('`', '', $selected_tables)).'</p>';
} else {
$text = '<font color="green">'.sprintf(__('Table(s) \'%s\' Optimized', 'wp-dbmanager'), str_replace('`', '', $selected_tables)).'</font>';
$text = '<p style="color: green;">'.sprintf(__('Table(s) \'%s\' Optimized', 'wp-dbmanager'), str_replace('`', '', $selected_tables)).'</p>';
}
}
break;
Expand Down
6 changes: 3 additions & 3 deletions database-repair.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@
}
}
} else {
$text = '<font color="red">'.__('No Tables Selected', 'wp-dbmanager').'</font>';
$text = '<p style="color: red;">'.__('No Tables Selected', 'wp-dbmanager').'</p>';
}
$selected_tables = substr($tables_string, 2);
$selected_tables .= '`';
if(!empty($selected_tables)) {
$repair2 = $wpdb->query("REPAIR TABLE $selected_tables");
if(!$repair2) {
$text = '<font color="red">'.sprintf(__('Table(s) \'%s\' NOT Repaired', 'wp-dbmanager'), str_replace('`', '', $selected_tables)).'</font>';
$text = '<p style="color: red;">'.sprintf(__('Table(s) \'%s\' NOT Repaired', 'wp-dbmanager'), str_replace('`', '', $selected_tables)).'</p>';
} else {
$text = '<font color="green">'.sprintf(__('Table(s) \'%s\' Repaired', 'wp-dbmanager'), str_replace('`', '', $selected_tables)).'</font>';
$text = '<p style="color: green;">'.sprintf(__('Table(s) \'%s\' Repaired', 'wp-dbmanager'), str_replace('`', '', $selected_tables)).'</p>';
}
}
break;
Expand Down
14 changes: 7 additions & 7 deletions database-run.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,23 @@
if (preg_match("/^\\s*(insert|update|replace|delete|create|alter) /i",$sql_query)) {
$run_query = $wpdb->query($sql_query);
if(!$run_query) {
$text .= "<span dir=\"ltr\"><font color=\"red\">$sql_query</font></span><br />";
$text .= "<p style=\"color: red;\">$sql_query</p>";
} else {
$successquery++;
$text .= "<span dir=\"ltr\"><font color=\"green\">$sql_query</font></span><br />";
$text .= "<p style=\"color: green;\">$sql_query</p>";
}
$totalquerycount++;
} elseif (preg_match("/^\\s*(select|drop|show|grant) /i",$sql_query)) {
$text .= "<span dir=\"ltr\"><font color=\"red\">$sql_query</font></span><br />";
$text .= "<p style=\"color: red;\">$sql_query</p>";
$totalquerycount++;
}
}
$text .= '<font color="blue">'.number_format_i18n($successquery).'/'.number_format_i18n($totalquerycount).' '.__('Query(s) Executed Successfully', 'wp-dbmanager').'</font>';
$text .= '<p style="color: blue;">'.number_format_i18n($successquery).'/'.number_format_i18n($totalquerycount).' '.__('Query(s) Executed Successfully', 'wp-dbmanager').'</p>';
} else {
$text = '<font color="red">'.__('Empty Query', 'wp-dbmanager').'</font>';
$text = '<p style="color: red;">'.__('Empty Query', 'wp-dbmanager').'</p>';
}
} else {
$text = '<font color="red">'.__('Empty Query', 'wp-dbmanager').'</font>';
$text = '<p style="color: red;">'.__('Empty Query', 'wp-dbmanager').'</p>';
}
break;
}
Expand All @@ -72,7 +72,7 @@
<br style="clear" />
<div>
<strong><?php _e('Seperate Multiple Queries With A New Line', 'wp-dbmanager'); ?></strong><br />
<font color="green"><?php _e('Use Only INSERT, UPDATE, REPLACE, DELETE, CREATE and ALTER statements.', 'wp-dbmanager'); ?></font>
<p style="color: green;"><?php _e('Use Only INSERT, UPDATE, REPLACE, DELETE, CREATE and ALTER statements.', 'wp-dbmanager'); ?></p>
</div>
<table class="form-table">
<tr>
Expand Down
4 changes: 2 additions & 2 deletions wp-dbmanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -488,10 +488,10 @@ function dbmanager_options() {

$update_db_options = update_option('dbmanager_options', $backup_options);
if($update_db_options) {
$text = '<font color="green">'.__('Database Options Updated', 'wp-dbmanager').'</font>';
$text = '<p style="color: green;">'.__('Database Options Updated', 'wp-dbmanager').'</p>';
}
if(empty($text)) {
$text = '<font color="red">'.__('No Database Option Updated', 'wp-dbmanager').'</font>';
$text = '<p style="color: red;">'.__('No Database Option Updated', 'wp-dbmanager').'</p>';
}
wp_clear_scheduled_hook('dbmanager_cron_backup');
if($backup_options['backup_period'] > 0) {
Expand Down

0 comments on commit 53bd97f

Please sign in to comment.