Plugin Directory

Changeset 2981933


Ignore:
Timestamp:
10/21/2023 06:55:26 AM (2 years ago)
Author:
morisdov
Message:

version 1.0.4

Location:
mysql-query-cache-stats
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • mysql-query-cache-stats/trunk/mysql-query-cache-stats.php

    r2403329 r2981933  
    66Plugin URI: https://wordpress.org/plugins/mysql-query-cache-stats
    77Author URI: https://profiles.wordpress.org/morisdov
    8 Version: 1.0.3
     8Version: 1.0.4
    99
    1010*/
     
    3838            return;
    3939        }
     40        global $wpdb;
     41        $wpdb->show_errors(true);
     42        $start_time = microtime(true);
     43        $sql = "SELECT * FROM " . $wpdb->prefix . "options WHERE autoload='yes' ";
     44        $result = $wpdb->get_results($sql, ARRAY_A);
     45        $end_time = microtime(true);
     46        $wpdb->show_errors(false);
     47       
     48        $execution_time = ($end_time - $start_time) * 1000;  // Convert to milliseconds
     49        //$execution_time = number_format($execution_time, 1);  // Format to 1 decimal place
     50        $execution_time = number_format($execution_time);  // Format to 0 decimal place
     51        //error_log("Query took " . $execution_time . " milliseconds to execute");
     52       
    4053        $myArr = [];
    41         global $wpdb;
     54        $myArr['Options Autoload Query Time'] = $execution_time . ' ms';
     55       
    4256        $sql = "SELECT 'Options Autoload Size', (SUM(LENGTH(option_name)) + SUM(LENGTH(option_value)) + (count(option_name)*32))
    4357                AS 'value' FROM " . $wpdb->prefix . "options WHERE autoload='yes'
     
    6377            }
    6478        }               
    65         $myOrder = array('Questions','Qcache_hits','Query_cache_type','Database Size','Query_cache_size','Qcache_free_memory','Query_cache_limit','Options Autoload Size',
     79        $myOrder = array('Questions','Qcache_hits','Query_cache_type','Database Size','Query_cache_size','Qcache_free_memory','Query_cache_limit','Options Autoload Size','Options Autoload Query Time',
    6680                        'Qcache_lowmem_prunes','Qcache_inserts','Qcache_queries_in_cache','Qcache_not_cached','Qcache_total_blocks');
    6781        $tmp = [];
  • mysql-query-cache-stats/trunk/readme.txt

    r2963259 r2981933  
    3030
    3131== Changelog ==
     32= 1.0.4 =
     33* Added wp_options Autoload Query Time
    3234= 1.0.3 =
    3335* Added wp_options Autoload Size
  • mysql-query-cache-stats/trunk/widget.css

    r2403329 r2981933  
    55    text-align: right;
    66}
    7 .md_qcache_table tr:nth-child(3), .md_qcache_table tr:nth-child(8), .md_qcache_table tr:last-child {
     7.md_qcache_table tr:nth-child(3), .md_qcache_table tr:nth-child(9), .md_qcache_table tr:last-child {
    88    box-shadow: 0 1px 0 rgba(0,0,0,.08);
    99}
Note: See TracChangeset for help on using the changeset viewer.