PluginProbe
Autoptimize / 2.7.8
Autoptimize v2.7.8
2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.5.0 2.5.1 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 All 107 releases
autoptimize / classes / critcss-inc / admin_settings_debug.php

admin_settings_debug.php in Autoptimize 2.7.8, at classes/critcss-inc/admin_settings_debug.php

82 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Debug panel.
4 */
5
6 // Attach wpdb() object.
7 global $wpdb;
8
9 // Query AO's options.
10 $ao_options = $wpdb->get_results('
11 SELECT option_name AS name,
12 option_value AS value
13 FROM ' . $wpdb->options . '
14 WHERE option_name LIKE "autoptimize_%%"
15 ORDER BY name
16 ', ARRAY_A);
17
18 // Query AO's transients.
19 $ao_trans = $wpdb->get_results('
20 SELECT option_name AS name,
21 option_value AS value
22 FROM ' . $wpdb->options . '
23 WHERE option_name LIKE "_transient_autoptimize_%%"
24 OR option_name LIKE "_transient_timeout_autoptimize_%%"
25 ', ARRAY_A);
26
27 // Render debug panel if there's something to show.
28 if ( $ao_options || $ao_trans ) {
29 ?>
30 <!-- BEGIN: Settings Debug -->
31 <ul>
32 <li class="itemDetail">
33 <h2 class="itemTitle"><?php _e( 'Debug Information', 'autoptimize' ); ?></h2>
34
35 <?php
36 // Render options.
37 if ( $ao_options ) {
38 ?>
39 <h4><?php _e( 'Options', 'autoptimize' ); ?>:</h4>
40 <table class="form-table debug">
41 <?php
42 foreach ( $ao_options as $option ) {
43 ?>
44 <tr>
45 <th scope="row">
46 <?php echo $option['name']; ?>
47 </th>
48 <td>
49 <?php
50 if ( 'autoptimize_ccss_queue' == $option['name'] || 'autoptimize_ccss_rules' == $option['name'] ) {
51 $value = print_r( json_decode( $option['value'], true ), true );
52 if ( $value ) {
53 echo "Raw JSON:\n<pre>" . $option['value'] . "</pre>\n\nDecoded JSON:\n<pre>" . $value . '</pre>';
54 } else {
55 echo 'Empty';
56 }
57 } else {
58 echo $option['value'];
59 }
60 ?>
61 </td>
62 </tr>
63 <?php
64 }
65 ?>
66 </table>
67 <hr />
68 <?php
69 }
70 // Render WP-Cron intervals and scheduled events.
71 ?>
72 <h4><?php _e( 'WP-Cron Intervals', 'autoptimize' ); ?>:</h4>
73 <pre><?php print_r( wp_get_schedules() ); ?></pre>
74 <hr />
75 <h4><?php _e( 'WP-Cron Scheduled Events', 'autoptimize' ); ?>:</h4>
76 <pre><?php print_r( _get_cron_array() ); ?></pre>
77 </li>
78 </ul>
79 <!-- END: Settings Debug -->
80 <?php
81 }
82