PluginProbe
Autoptimize / 3.1.7
Autoptimize v3.1.7
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 3.1.7, at classes/critcss-inc/admin_settings_debug.php

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