function get_portable_serverinfo() { echo ' <br class="clear" /> <table class="widefat"> <thead> <tr> <th>Variable Name</th> <th>Value</th> <th>Variable Name</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>OS</td> <td>' . PHP_OS . '</td> <td>Database Data Disk Usage</td> <td>' . format_filesize(get_mysql_data_usage()) . '</td> </tr> <tr class="alternate"> <td>Server</td> <td>' . $_SERVER['SERVER_SOFTWARE'] . '</td> <td>Database Index Disk Usage</td> <td>' . format_filesize(get_mysql_index_usage()) . '</td> </tr> <tr> <td>PHP</td> <td>v' . PHP_VERSION . '</td> <td>MYSQL Maximum Packet Size</td> <td>' . format_filesize(get_mysql_max_allowed_packet()) . '</td> </tr> <tr class="alternate"> <td>MYSQL</td> <td>v' . get_mysql_version() . '</td> <td>MYSQL Maximum Allowed Connections</td> <td>' . number_format_i18n(get_mysql_max_allowed_connections()) . '</td> </tr> </tbody> </table> <br class="clear" />'; }
function wp_dashboard_serverinfo() { global $text_direction; if ('rtl' == $text_direction) { echo '<style type="text/css"> #wp-serverinfo ul { padding-left: 15px !important; } </style>'; echo '<div id="wp-serverinfo" style="direction: ltr; text-align: left;">'; } echo '<p><strong>' . __('General', 'wp-serverinfo') . '</strong></p>'; echo '<ul>'; echo '<li>' . __('OS', 'wp-serverinfo') . ': <strong>' . PHP_OS . '</strong></li>'; echo '<li>' . __('Server', 'wp-serverinfo') . ': <strong>' . $_SERVER["SERVER_SOFTWARE"] . '</strong></li>'; echo '<li>' . __('Hostname', 'wp-serverinfo') . ': <strong>' . $_SERVER['SERVER_NAME'] . '</strong></li>'; echo '<li>' . __('IP:Port', 'wp-serverinfo') . ': <strong>' . $_SERVER['SERVER_ADDR'] . ':' . $_SERVER['SERVER_PORT'] . '</strong></li>'; echo '<li>' . __('Document Root', 'wp-serverinfo') . ': <strong>' . $_SERVER['DOCUMENT_ROOT'] . '</strong></li>'; echo '</ul>'; echo '<p><strong>PHP</strong></p>'; echo '<ul>'; echo '<li>v<strong>' . PHP_VERSION . '</strong></li>'; echo '<li>GD: <strong>' . get_gd_version() . '</strong></li>'; echo '<li>' . __('Magic Quotes GPC', 'wp-serverinfo') . ': <strong>' . get_php_magic_quotes_gpc() . '</strong></li>'; echo '<li>' . __('Memory Limit', 'wp-serverinfo') . ': <strong>' . format_php_size(get_php_memory_limit()) . '</strong></li>'; echo '<li>' . __('Max Upload Size', 'wp-serverinfo') . ': <strong>' . format_php_size(get_php_upload_max()) . '</strong></li>'; echo '</ul>'; echo '<p><strong>MYSQL</strong></p>'; echo '<ul>'; echo '<li>v<strong>' . get_mysql_version() . '</strong></li>'; echo '<li>' . __('Maximum No. Connections', 'wp-serverinfo') . ': <strong>' . number_format_i18n(get_mysql_max_allowed_connections(), 0) . '</strong></li>'; echo '<li>' . __('Maximum Packet Size', 'wp-serverinfo') . ': <strong>' . format_filesize(get_mysql_max_allowed_packet()) . '</strong></li>'; echo '<li>' . __('Data Disk Usage', 'wp-serverinfo') . ': <strong>' . format_filesize(get_mysql_data_usage()) . '</strong></li>'; echo '<li>' . __('Index Disk Usage', 'wp-serverinfo') . ': <strong>' . format_filesize(get_mysql_index_usage()) . '</strong></li>'; echo '</ul>'; echo '<p class="textright"><a href="' . admin_url('index.php?page=wp-serverinfo/wp-serverinfo.php') . '" class="button">' . __('View all', 'wp-serverinfo') . '</a></p>'; if ('rtl' == $text_direction) { echo '</div>'; } }
$msg = "<p><b>" . $lang['backup_restore_error'] . "</b></p>"; $msg .= "<ol>"; foreach ($error_log as $val) { $msg .= sprintf("<li>%s</li>", $val); } $msg .= "</ol>"; } else { $msg .= sprintf("<p><b>%s</b></p>", $lang['backup_restore_success']); } $action = "modifybackups"; } if ($action == "makebackup") { $db_tables = $HTTP_POST_VARS['db_tables']; $crlf = get_user_os() == "WIN" ? "\r\n" : (get_user_os() == "MAC" ? "\r" : "\n"); $tables_info = array(); $db = get_mysql_version() >= 32306 ? "`{$db_name}`" : $db_name; $result = $site_db->query("SHOW TABLE STATUS FROM {$db}"); if ($result) { while ($row = $site_db->fetch_array($result)) { $tables_info[$row['Name']] = isset($row['Type']) ? $row['Type'] : $row['Engine']; } $site_db->free_result($result); } ob_start(); @ob_implicit_flush(0); echo "#----------------------------------------------------------" . $crlf; echo "# Database Backup for " . $config['site_name'] . $crlf; echo "# " . date("Y-m-d H:i") . $crlf; echo "#----------------------------------------------------------" . $crlf; foreach ($db_tables as $table) { if (!isset($tables_info[$table])) {
function get_database_size() { global $global_info, $site_db, $db_name, $table_prefix; if (!empty($global_info['database_size'])) { return $global_info['database_size']; } $database_size_total = 0; $database_size_4images = 0; if (get_mysql_version() >= 32303) { $db = get_mysql_version() >= 32306 ? "`{$db_name}`" : $db_name; if ($result = $site_db->query("SHOW TABLE STATUS FROM {$db}")) { while ($row = $site_db->fetch_array($result)) { if (preg_match('/^(MyISAM|ISAM|HEAP|InnoDB)$/i', isset($row['Type']) ? $row['Type'] : $row['Engine'])) { if ($table_prefix != "") { if (preg_match("/^" . $table_prefix . "/", $row['Name'])) { $database_size_4images += $row['Data_length'] + $row['Index_length']; } $database_size_total += $row['Data_length'] + $row['Index_length']; } else { $database_size_total += $row['Data_length'] + $row['Index_length']; } } } } } $global_info['database_size'] = array("total" => $database_size_total, "4images" => $database_size_4images); return $global_info['database_size']; }