PluginProbe ʕ •ᴥ•ʔ
Jetpack – WP Security, Backup, Speed, & Growth / 12.0.3
Jetpack – WP Security, Backup, Speed, & Growth v12.0.3
12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 14.2.2 14.3.1 14.4.2 14.5.1 14.6.1 14.7.1 14.8.1 14.9.2 15.0.3 15.1.2 15.2.1 15.3.2 15.4.1 15.5.1 15.6.1 15.7.2 15.8.1 15.9.2 16.0.2 16.1.3 16.2-a.5 16.2-a.3 16.1.2 16.2-a.1 16.1.1 16.1 16.1-beta 16.1-beta.2 16.1-beta.3 16.1-a.5 16.1-a.3 16.0.1 16.1-a.1 16.0 16.0-beta 16.0-a.7 16.0-a.5 15.9.1 16.0-a.3 16.0-a.1 15.9 15.9-beta 15.9-a.7 15.9-a.5 15.9-a.3 15.9-a.1 15.8 15.8-beta 15.8-a.7 15.8-a.5 5.2.5 5.3.4 5.4.4 5.5.5 5.6.5 5.7.5 5.8.4 5.9.4 6.0.4 6.1 6.1.1 6.1.2 6.1.3 6.1.4 6.1.5 6.2 6.2.1 6.2.2 6.2.3 6.2.4 6.2.5 6.3 6.3.1 6.3.2 6.3.3 6.3.4 6.3.5 6.3.6 6.3.7 6.4 6.4.1 6.4.2 6.4.3 6.4.4 6.4.5 6.4.6 6.5 6.5.1 6.5.2 6.5.3 6.5.4 6.6 6.6.1 6.6.2 6.6.3 6.6.4 6.6.5 6.7 6.7.1 6.7.2 6.7.3 6.7.4 6.8 6.8.1 6.8.2 6.8.3 6.8.4 6.8.5 6.9 6.9.1 6.9.2 6.9.3 6.9.4 7.0 7.0.1 7.0.2 7.0.3 7.0.4 7.0.5 7.1 7.1.1 7.1.2 7.1.3 7.1.4 7.1.5 7.2 7.2.1 7.2.1.1 7.2.2 7.2.3 7.2.4 7.2.5 7.3 7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3 4.7.4 4.8.5 4.9.3 5.0.3 5.1.4 trunk 10.0 10.0.1 10.0.2 10.1 10.1.1 10.1.2 10.2 10.2.1 10.2.2 10.2.3 10.3 10.3.1 10.3.2 10.4 10.4.1 10.4.2 10.5 10.5.1 10.5.2 10.5.3 10.6 10.6.1 10.6.2 10.7 10.7.1 10.7.2 10.8 10.8.1 10.8.2 10.9 10.9.1 10.9.2 10.9.3 11.0 11.0.1 11.0.2 11.1 11.1.1 11.1.2 11.1.3 11.1.4 11.2 11.2.1 11.2.2 11.3 11.3.1 11.3.2 11.3.3 11.3.4 11.4 11.4.1 11.4.2 11.5 11.5.1 11.5.2 11.5.3 11.6 11.6.1 11.6.2 11.7 11.7.1 11.7.2 11.7.3 11.8 11.8.3 11.8.4 11.8.5 11.8.6 11.9 11.9.1 11.9.2 11.9.3 12.0 12.0.1 12.0.2 12.1 12.1.1 12.1.2 12.2 12.2.1 12.2.2 12.3 12.3.1 12.4 12.4.1 12.5 12.5.1 12.6 12.6.1 12.6.2 12.6.3 12.7 12.7.1 12.7.2 12.8 12.8.1 12.8.2 12.9 12.9.1 12.9.2 12.9.3 12.9.4 13.0 13.0.1 13.1 13.1.1 13.1.2 13.1.3 13.1.4 13.2 13.2.1 13.2.2 13.2.3 13.3 13.3.1 13.3.2 13.4 13.4.1 13.4.2 13.4.3 13.4.4 13.5 13.5.1 13.6 13.6.1 13.7 13.7.1 13.8 13.8.1 13.8.2 13.9 13.9.1 14.0 14.1 14.2 14.2.1 14.3 14.4 14.4.1 14.5 14.6 14.7 14.8 14.9 14.9.1 15.0 15.0.1 15.0.2 15.1 15.1.1 15.2 15.3 15.3.1 15.4 15.5 15.6 15.7 15.7-a.1 15.7-a.3 15.7-a.5 15.7-a.7 15.7-beta
jetpack / _inc / lib / debugger / class-jetpack-debugger.php
jetpack / _inc / lib / debugger Last commit date
class-jetpack-cxn-test-base.php 3 years ago class-jetpack-cxn-tests.php 3 years ago class-jetpack-debug-data.php 4 years ago class-jetpack-debugger.php 4 years ago debug-functions.php 3 years ago jetpack-debugger-site-health.css 6 years ago jetpack-debugger-site-health.js 6 years ago
class-jetpack-debugger.php
373 lines
1 <?php
2 /**
3 * Jetpack Debugger functionality allowing for self-service diagnostic information via the legacy jetpack debugger.
4 *
5 * @package automattic/jetpack
6 */
7
8 use Automattic\Jetpack\Redirect;
9 use Automattic\Jetpack\Status;
10
11 /**
12 * Class Jetpack_Debugger
13 *
14 * A namespacing class for functionality related to the legacy in-plugin diagnostic tooling.
15 */
16 class Jetpack_Debugger {
17 /**
18 * Disconnect Jetpack and redirect user to connection flow.
19 *
20 * Used in class.jetpack-admin.php.
21 */
22 public static function disconnect_and_redirect() {
23 if ( ! ( isset( $_GET['nonce'] ) && wp_verify_nonce( $_GET['nonce'], 'jp_disconnect' ) ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.MissingUnslash
24 return;
25 }
26
27 if ( ! empty( $_GET['disconnect'] ) ) {
28 if ( Jetpack::is_connection_ready() ) {
29 Jetpack::disconnect();
30 wp_safe_redirect( Jetpack::admin_url() );
31 exit;
32 }
33 }
34 }
35
36 /**
37 * Handles output to the browser for the in-plugin debugger.
38 */
39 public static function jetpack_debug_display_handler() {
40 if ( ! current_user_can( 'manage_options' ) ) {
41 wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'jetpack' ) );
42 }
43
44 $support_url = Jetpack::is_development_version()
45 ? Redirect::get_url( 'jetpack-contact-support-beta-group' )
46 : Redirect::get_url( 'jetpack-contact-support' );
47
48 $cxntests = new Jetpack_Cxn_Tests();
49 ?>
50 <div class="wrap">
51 <h2><?php esc_html_e( 'Debugging Center', 'jetpack' ); ?></h2>
52 <h3><?php esc_html_e( "Testing your site's compatibility with Jetpack...", 'jetpack' ); ?></h3>
53 <div class="jetpack-debug-test-container">
54 <?php
55 if ( $cxntests->pass() ) {
56 echo '<div class="jetpack-tests-succeed">' . esc_html__( 'Your Jetpack setup looks a-okay!', 'jetpack' ) . '</div>';
57 } else {
58 $failures = $cxntests->list_fails();
59 foreach ( $failures as $fail ) {
60 $action_link = $fail['action'];
61 $action_label = $fail['action_label'];
62 $action = ( $action_link ) ? '<a href="' . $action_link . '">' . $action_label . '</a>' : $action_label;
63 echo '<div class="jetpack-test-error">';
64 echo '<p><a class="jetpack-test-heading" href="#">' . esc_html( $fail['short_description'] );
65 echo '<span class="noticon noticon-collapse"></span></a></p>';
66 echo '<p class="jetpack-test-details">' . wp_kses(
67 $action,
68 array(
69 'a' => array(
70 'href' => array(),
71 'target' => array(),
72 'rel' => array(),
73 ),
74 )
75 ) . '</p>';
76 echo '</div>';
77 }
78 }
79 ?>
80 </div>
81 <div class="entry-content">
82 <h3><?php esc_html_e( 'Trouble with Jetpack?', 'jetpack' ); ?></h3>
83 <h4><?php esc_html_e( 'It may be caused by one of these issues, which you can diagnose yourself:', 'jetpack' ); ?></h4>
84 <ol>
85 <li><b><em>
86 <?php
87 esc_html_e( 'A known issue.', 'jetpack' );
88 ?>
89 </em></b>
90 <?php
91 echo sprintf(
92 wp_kses(
93 /* translators: URLs to Jetpack support pages. */
94 __( 'Some themes and plugins have <a href="%1$s" target="_blank">known conflicts</a> with Jetpack – check the <a href="%2$s" target="_blank">list</a>. (You can also browse the <a href="%3$s" target="_blank">Jetpack support pages</a> or <a href="%4$s" target="_blank">Jetpack support forum</a> to see if others have experienced and solved the problem.)', 'jetpack' ),
95 array(
96 'a' => array(
97 'href' => array(),
98 'target' => array(),
99 ),
100 )
101 ),
102 esc_url( Redirect::get_url( 'jetpack-contact-support-known-issues' ) ),
103 esc_url( Redirect::get_url( 'jetpack-contact-support-known-issues' ) ),
104 esc_url( Redirect::get_url( 'jetpack-support' ) ),
105 esc_url( Redirect::get_url( 'wporg-support-plugin-jetpack' ) )
106 );
107 ?>
108 </li>
109 <li><b><em><?php esc_html_e( 'An incompatible plugin.', 'jetpack' ); ?></em></b> <?php esc_html_e( "Find out by disabling all plugins except Jetpack. If the problem persists, it's not a plugin issue. If the problem is solved, turn your plugins on one by one until the problem pops up again – there's the culprit! Let us know, and we'll try to help.", 'jetpack' ); ?></li>
110 <li>
111 <b><em><?php esc_html_e( 'A theme conflict.', 'jetpack' ); ?></em></b>
112 <?php
113 $default_theme = wp_get_theme( WP_DEFAULT_THEME );
114
115 if ( $default_theme->exists() ) {
116 /* translators: %s is the name of a theme */
117 echo esc_html( sprintf( __( "If your problem isn't known or caused by a plugin, try activating %s (the default WordPress theme).", 'jetpack' ), $default_theme->get( 'Name' ) ) );
118 } else {
119 esc_html_e( "If your problem isn't known or caused by a plugin, try activating the default WordPress theme.", 'jetpack' );
120 }
121 ?>
122 <?php esc_html_e( "If this solves the problem, something in your theme is probably broken – let the theme's author know.", 'jetpack' ); ?>
123 </li>
124 <li><b><em><?php esc_html_e( 'A problem with your XMLRPC file.', 'jetpack' ); ?></em></b>
125 <?php
126 echo sprintf(
127 wp_kses(
128 /* translators: The URL to the site's xmlrpc.php file. */
129 __( 'Load your <a href="%s">XMLRPC file</a>. It should say “XML-RPC server accepts POST requests only.” on a line by itself.', 'jetpack' ),
130 array( 'a' => array( 'href' => array() ) )
131 ),
132 esc_attr( site_url( 'xmlrpc.php' ) )
133 );
134 ?>
135 <ul>
136 <li>- <?php esc_html_e( "If it's not by itself, a theme or plugin is displaying extra characters. Try steps 2 and 3.", 'jetpack' ); ?></li>
137 <li>- <?php esc_html_e( 'If you get a 404 message, contact your web host. Their security may block XMLRPC.', 'jetpack' ); ?></li>
138 </ul>
139 </li>
140 <?php if ( current_user_can( 'jetpack_disconnect' ) && Jetpack::is_connection_ready() ) : ?>
141 <li>
142 <strong><em><?php esc_html_e( 'A connection problem with WordPress.com.', 'jetpack' ); ?></em></strong>
143 <?php
144 echo sprintf(
145 wp_kses(
146 /* translators: URL to disconnect and reconnect Jetpack. */
147 __( 'Jetpack works by connecting to WordPress.com for a lot of features. Sometimes, when the connection gets messed up, you need to disconnect and reconnect to get things working properly. <a href="%s">Disconnect from WordPress.com</a>', 'jetpack' ),
148 array(
149 'a' => array(
150 'href' => array(),
151 'class' => array(),
152 ),
153 )
154 ),
155 esc_attr(
156 wp_nonce_url(
157 Jetpack::admin_url(
158 array(
159 'page' => 'jetpack-debugger',
160 'disconnect' => true,
161 )
162 ),
163 'jp_disconnect',
164 'nonce'
165 )
166 )
167 );
168 ?>
169 </li>
170 <?php endif; ?>
171 </ol>
172 <h4><?php esc_html_e( 'Still having trouble?', 'jetpack' ); ?></h4>
173 <p><b><em><?php esc_html_e( 'Ask us for help!', 'jetpack' ); ?></em></b>
174 <?php
175 /**
176 * Offload to new WordPress debug data.
177 */
178 echo sprintf(
179 wp_kses(
180 /* translators: URL for Jetpack support. URL for WordPress's Site Health */
181 __( '<a href="%1$s">Contact our Happiness team</a>. When you do, please include the <a href="%2$s">full debug information from your site</a>.', 'jetpack' ),
182 array( 'a' => array( 'href' => array() ) )
183 ),
184 esc_url( $support_url ),
185 esc_url( admin_url() . 'site-health.php?tab=debug' )
186 );
187 ?>
188 </p>
189 <hr />
190 <?php if ( Jetpack::is_connection_ready() ) : ?>
191 <div id="connected-user-details">
192 <h3><?php esc_html_e( 'More details about your Jetpack settings', 'jetpack' ); ?></h3>
193 <p>
194 <?php
195 printf(
196 wp_kses(
197 /* translators: %s is an e-mail address */
198 __( 'The primary connection is owned by <strong>%s</strong>\'s WordPress.com account.', 'jetpack' ),
199 array( 'strong' => array() )
200 ),
201 esc_html( Jetpack::get_master_user_email() )
202 );
203 ?>
204 </p>
205 </div>
206 <?php else : ?>
207 <div id="dev-mode-details">
208 <p>
209 <?php
210 printf(
211 wp_kses(
212 /* translators: Link to a Jetpack support page. */
213 __( 'Would you like to use Jetpack on your local development site? You can do so thanks to <a href="%s">Jetpack\'s offline mode</a>.', 'jetpack' ),
214 array( 'a' => array( 'href' => array() ) )
215 ),
216 esc_url( Redirect::get_url( 'jetpack-support-development-mode' ) )
217 );
218 ?>
219 </p>
220 </div>
221 <?php endif; ?>
222 <?php
223 if (
224 current_user_can( 'jetpack_manage_modules' )
225 && ( ( new Status() )->is_offline_mode() || Jetpack::is_connection_ready() )
226 ) {
227 printf(
228 wp_kses(
229 '<p><a href="%1$s">%2$s</a></p>',
230 array(
231 'a' => array( 'href' => array() ),
232 'p' => array(),
233 )
234 ),
235 esc_attr( Jetpack::admin_url( 'page=jetpack_modules' ) ),
236 esc_html__( 'Access the full list of Jetpack modules available on your site.', 'jetpack' )
237 );
238 }
239 ?>
240 </div>
241 </div>
242 <?php
243 }
244
245 /**
246 * Outputs html needed within the <head> for the in-plugin debugger page.
247 */
248 public static function jetpack_debug_admin_head() {
249
250 Jetpack_Admin_Page::load_wrapper_styles();
251 ?>
252 <style type="text/css">
253
254 .jetpack-debug-test-container {
255 margin-top: 20px;
256 margin-bottom: 30px;
257 }
258
259 .jetpack-tests-succeed {
260 font-size: large;
261 color: #8BAB3E;
262 }
263
264 .jetpack-test-details {
265 margin: 4px 6px;
266 padding: 10px;
267 overflow: auto;
268 display: none;
269 }
270
271 .jetpack-test-error {
272 margin-bottom: 10px;
273 background: #FFEBE8;
274 border: solid 1px #C00;
275 border-radius: 3px;
276 }
277
278 .jetpack-test-error p {
279 margin: 0;
280 padding: 0;
281 }
282
283 p.jetpack-test-details {
284 margin: 4px 6px;
285 padding: 10px;
286 }
287
288 .jetpack-test-error a.jetpack-test-heading {
289 padding: 4px 6px;
290 display: block;
291 text-decoration: none;
292 color: inherit;
293 }
294
295 .jetpack-test-error .noticon {
296 float: right;
297 }
298
299 .formbox {
300 margin: 0 0 25px 0;
301 }
302
303 .formbox input[type="text"], .formbox input[type="email"], .formbox input[type="url"], .formbox textarea, #debug_info_div {
304 border: 1px solid #dcdcde;
305 border-radius: 11px;
306 box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
307 color: #646970;
308 font-size: 14px;
309 padding: 10px;
310 width: 97%;
311 }
312 #debug_info_div {
313 border-radius: 0;
314 margin-top: 16px;
315 background: #FFF;
316 padding: 16px;
317 }
318 .formbox .contact-support input[type="submit"] {
319 float: right;
320 margin: 0 !important;
321 border-radius: 20px !important;
322 cursor: pointer;
323 font-size: 13pt !important;
324 height: auto !important;
325 margin: 0 0 2em 10px !important;
326 padding: 8px 16px !important;
327 background-color: #dcdcde;
328 border: 1px solid rgba(0,0,0,0.05);
329 border-top-color: rgba(255,255,255,0.1);
330 border-bottom-color: rgba(0,0,0,0.15);
331 color: #333;
332 font-weight: 400;
333 display: inline-block;
334 text-align: center;
335 text-decoration: none;
336 }
337
338 .formbox span.errormsg {
339 margin: 0 0 10px 10px;
340 color: #d00;
341 display: none;
342 }
343
344 .formbox.error span.errormsg {
345 display: block;
346 }
347
348 #debug_info_div, #toggle_debug_info, #debug_info_div p {
349 font-size: 12px;
350 }
351
352 #category_div ul li {
353 list-style-type: none;
354 }
355
356 </style>
357 <script type="text/javascript">
358 jQuery( document ).ready( function($) {
359
360 $( '#debug_info' ).prepend( 'jQuery version: ' + jQuery.fn.jquery + "\r\n" );
361 $( '#debug_form_info' ).prepend( 'jQuery version: ' + jQuery.fn.jquery + "\r\n" );
362
363 $( '.jetpack-test-error .jetpack-test-heading' ).on( 'click', function() {
364 $( this ).parents( '.jetpack-test-error' ).find( '.jetpack-test-details' ).slideToggle();
365 return false;
366 } );
367
368 } );
369 </script>
370 <?php
371 }
372 }
373