PluginProbe
Autoptimize / 3.1.16
Autoptimize v3.1.16
3.1.16 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 All 108 releases
← All changes | classes/critcss-inc/admin_settings_debug.php +33 -27 2.7.0 → 3.1.16 View file →
@@ -6,62 +6,68 @@
6 6 // Attach wpdb() object.
7 7 global $wpdb;
8 8
9 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);
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 +);
17 20
18 21 // 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);
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 +);
26 32
27 33 // Render debug panel if there's something to show.
28 34 if ( $ao_options || $ao_trans ) {
29 -?>
35 + ?>
30 36 <!-- BEGIN: Settings Debug -->
31 37 <ul>
32 38 <li class="itemDetail">
33 - <h2 class="itemTitle"><?php _e( 'Debug Information', 'autoptimize' ); ?></h2>
39 + <h2 class="itemTitle"><?php esc_html_e( 'Debug Information', 'autoptimize' ); ?></h2>
34 40
35 41 <?php
36 42 // Render options.
37 43 if ( $ao_options ) {
38 - ?>
39 - <h4><?php _e( 'Options', 'autoptimize' ); ?>:</h4>
44 + ?>
45 + <h4><?php esc_html_e( 'Options', 'autoptimize' ); ?>:</h4>
40 46 <table class="form-table debug">
41 47 <?php
42 48 foreach ( $ao_options as $option ) {
43 - ?>
49 + ?>
44 50 <tr>
45 51 <th scope="row">
46 - <?php echo $option['name']; ?>
52 + <?php echo wp_strip_all_tags( $option['name'] ); ?>
47 53 </th>
48 54 <td>
49 55 <?php
50 56 if ( 'autoptimize_ccss_queue' == $option['name'] || 'autoptimize_ccss_rules' == $option['name'] ) {
51 - $value = print_r( json_decode( $option['value'], true ), true );
57 + $value = print_r( json_decode( wp_strip_all_tags( $option['value'] ), true ), true );
52 58 if ( $value ) {
53 - echo "Raw JSON:\n<pre>" . $option['value'] . "</pre>\n\nDecoded JSON:\n<pre>" . $value . '</pre>';
59 + echo "Raw JSON:\n<pre>" . wp_strip_all_tags( $option['value'] ) . "</pre>\n\nDecoded JSON:\n<pre>" . wp_strip_all_tags( $value ) . '</pre>';
54 60 } else {
55 61 echo 'Empty';
56 62 }
57 63 } else {
58 - echo $option['value'];
64 + echo wp_strip_all_tags( $option['value'] );
59 65 }
60 66 ?>
61 67 </td>
62 68 </tr>
63 - <?php
69 + <?php
64 70 }
65 71 ?>
66 72 </table>
67 73 <hr />
@@ -68,14 +74,14 @@
68 74 <?php
69 75 }
70 76 // Render WP-Cron intervals and scheduled events.
71 77 ?>
72 - <h4><?php _e( 'WP-Cron Intervals', 'autoptimize' ); ?>:</h4>
78 + <h4><?php esc_html_e( 'WP-Cron Intervals', 'autoptimize' ); ?>:</h4>
73 79 <pre><?php print_r( wp_get_schedules() ); ?></pre>
74 80 <hr />
75 - <h4><?php _e( 'WP-Cron Scheduled Events', 'autoptimize' ); ?>:</h4>
81 + <h4><?php esc_html_e( 'WP-Cron Scheduled Events', 'autoptimize' ); ?>:</h4>
76 82 <pre><?php print_r( _get_cron_array() ); ?></pre>
77 83 </li>
78 84 </ul>
79 85 <!-- END: Settings Debug -->
80 -<?php
86 + <?php
81 87 }