Exemple #1
0
 function gdptStats()
 {
     if (function_exists("memory_get_usage")) {
         $this->memory = gdFunctionsGDPT::size_format(memory_get_usage());
     }
     $this->queries = get_num_queries();
     $this->timer = timer_stop(1);
 }
Exemple #2
0
 function get_tables_overhead()
 {
     $size = GDPTDB::get_tables_overhead_simple();
     return gdFunctionsGDPT::size_format($size);
 }
Exemple #3
0
 echo '<tr>';
 echo '<td style="padding: 0 4px;">';
 echo '<div class="gdptdbtoggle on" id="ct' . $col_id . '"><img src="' . PRESSTOOLS_URL . 'gfx/blank.gif" height="16" width="16" /></div>';
 echo '</td>';
 echo '<td><strong>' . $t->Name . '</strong></td>';
 echo '<td>';
 $status = GDPTDB::check_table($t->Name);
 echo $status->Msg_type . ": " . $status->Msg_text;
 echo '</td>';
 echo '<td>' . $t->Collation . '</td>';
 echo '<td style="text-align: right;">' . $t->Rows . '</td>';
 echo '<td style="text-align: right;">' . gdFunctionsGDPT::size_format($t->Data_length) . '</td>';
 echo '<td style="text-align: right;">';
 if ($t->Data_free > 0) {
     echo '<strong style="color: red">';
     echo gdFunctionsGDPT::size_format($t->Data_free);
     if ($t->Data_free > 0) {
         echo '</strong>';
     }
 } else {
     echo '/';
 }
 echo '</td>';
 echo '<td style="text-align: right;">';
 if (!in_array(strtolower($t->Name), $wp_tables)) {
     echo '<a onclick="return confirmDrop()" href="admin.php?page=gd-press-tools-database&gda=tpldrp&name=' . $t->Name . '">' . __("drop", "gd-press-tools") . '</a> | <a onclick="return confirmEmpty()" href="admin.php?page=gd-press-tools-database&gda=tblemp&name=' . $t->Name . '">' . __("empty", "gd-press-tools") . '</a>';
 }
 echo '</td>';
 echo '</tr>';
 echo '<tr id="cl' . $col_id . '" style="display: none"><td></td><td colspan="6">';
 ?>
Exemple #4
0
:</td>
                        <td class="t options"><?php 
echo gdFunctionsGDPT::php_version(true);
?>
</td>
                    </tr>
                    <?php 
if (function_exists("memory_get_usage")) {
    ?>
                    <tr>
                        <td class="first b"><?php 
    _e("Used Memory", "gd-press-tools");
    ?>
:</td>
                        <td class="t options"><?php 
    echo gdFunctionsGDPT::size_format(memory_get_usage());
    ?>
</td>
                    </tr>
                    <?php 
}
?>
                    <tr>
                        <td class="first b"><?php 
_e("Safe Mode", "gd-press-tools");
?>
:</td>
                        <td class="t options"><?php 
echo ini_get('safe_mode') ? __("On", "gd-press-tools") : __("Off", "gd-press-tools");
?>
</td>
Exemple #5
0
 function generate_queries_log($info = false)
 {
     global $wpdb;
     $result = $queries = "";
     if ($wpdb->queries) {
         $queries .= '<div class="gdptdebugq"><ol>';
         $total_time = 0;
         foreach ($wpdb->queries as $q) {
             $queries .= "<li>";
             $queries .= "<strong>" . __("Call originated from", "gd-press-tools") . ":</strong> " . $q[2] . "<br />";
             $queries .= "<strong>" . __("Execution time", "gd-press-tools") . ":</strong> " . $q[1] . "<br />";
             $queries .= "<em>" . $q[0] . "</em>";
             $total_time += $q[1];
             $queries .= "</li>";
         }
         $queries .= '</ol></div>';
         $result .= '<div class="gdptdebugq">';
         if ($info) {
             $result .= '<p class="gdptinfoq">';
             $result .= __("Thank you for using", "gd-press-tools");
             $result .= ' <a target="_blank" href="http://www.dev4press.com/plugins/gd-press-tools/">GD Press Tools ' . $this->o["version"] . '</a> ';
             $result .= __("administration addon plugin", "gd-press-tools");
             $result .= '.</p>';
         }
         $result .= "<strong>" . __("Page generated in", "gd-press-tools") . ":</strong> " . timer_stop(0) . ' ' . __("seconds.", "gd-press-tools") . "<br />";
         $result .= "<strong>" . __("Total memory used", "gd-press-tools") . ":</strong> " . (function_exists("memory_get_usage") ? gdFunctionsGDPT::size_format(memory_get_usage()) : 0) . "<br />";
         $result .= "<strong>" . __("Total number of queries", "gd-press-tools") . ":</strong> " . count($wpdb->queries) . "<br />";
         $result .= "<strong>" . __("Total execution time", "gd-press-tools") . ":</strong> " . round($total_time, 5) . " " . __("seconds", "gd-press-tools");
         $result .= '</div>';
         $result .= $queries;
     }
     return $result;
 }