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.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 1 month ago class-jetpack-cxn-tests.php 1 month ago class-jetpack-debug-data.php 1 month ago class-jetpack-debugger.php 1 month ago debug-functions.php 1 month ago
class-jetpack-debugger.php
368 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( 0 );
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 Automattic\Jetpack\Connection\Connection_Health_Tests();
49 ?>
50 <div class="wrap">
51 <div class="jp-static-block">
52 <h2><?php esc_html_e( 'Debugging Center', 'jetpack' ); ?></h2>
53
54 <div class="jp-static-block-body">
55 <h3><?php esc_html_e( "Testing your site's compatibility with Jetpack...", 'jetpack' ); ?></h3>
56 <div class="jetpack-debug-test-container">
57 <?php
58 if ( $cxntests->pass() ) {
59 echo '<div class="jetpack-tests-succeed">' . esc_html__( 'Your Jetpack setup looks a-okay!', 'jetpack' ) . '</div>';
60 } else {
61 $failures = $cxntests->list_fails();
62 foreach ( $failures as $fail ) {
63 ?>
64 <div class="notice notice-error inline">
65 <div class="notice-icon-wrapper">
66 <svg xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 24 24" width="24" height="24" class="y_IPyP1wIAOhyNaqvXJq" aria-hidden="true" focusable="false"><path d="M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1.13 9.38l.35-6.46H8.52l.35 6.46h2.26zm-.09 3.36c.24-.23.37-.55.37-.96 0-.42-.12-.74-.36-.97s-.59-.35-1.06-.35-.82.12-1.07.35-.37.55-.37.97c0 .41.13.73.38.96.26.23.61.34 1.06.34s.8-.11 1.05-.34z"></path></svg>
67 </div>
68
69 <div class="notice-main-content">
70 <div class="notice-title"><?php echo esc_html( $fail['short_description'] ); ?></div>
71
72 <div class="notice-action-bar">
73 <div>
74 <a href="<?php echo esc_attr( $fail['action'] ); ?>" aria-disabled="false" class="components-button is-primary"><span><?php echo esc_html( $fail['action_label'] ); ?></span></a>
75 </div>
76 </div>
77 </div>
78 </div>
79 <?php
80 }
81 }
82 ?>
83 </div>
84
85 <div class="entry-content">
86 <h4><?php esc_html_e( 'Trouble with Jetpack?', 'jetpack' ); ?></h4>
87 <p><?php esc_html_e( 'It may be caused by one of these issues, which you can diagnose yourself:', 'jetpack' ); ?></p>
88 <ol>
89 <li><?php esc_html_e( 'A known issue.', 'jetpack' ); ?>
90 <?php
91 printf(
92 wp_kses(
93 /* translators: URLs to Jetpack support pages. */
94 __( 'Some themes and plugins have <a href="%1$s" target="_blank" rel="noopener noreferrer">known conflicts</a> with Jetpack – check the list. (You can also browse the <a href="%2$s" target="_blank" rel="noopener noreferrer">Jetpack support pages</a> or <a href="%3$s" target="_blank" rel="noopener noreferrer">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 'rel' => array(),
100 ),
101 )
102 ),
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>
110 <?php esc_html_e( 'An incompatible plugin.', 'jetpack' ); ?>
111 <?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' ); ?>
112 </li>
113 <li>
114 <?php esc_html_e( 'A theme conflict.', 'jetpack' ); ?>
115 <?php
116 $default_theme = wp_get_theme( WP_DEFAULT_THEME );
117
118 if ( $default_theme->exists() ) {
119 /* translators: %s is the name of a theme */
120 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' ) ) );
121 } else {
122 esc_html_e( "If your problem isn't known or caused by a plugin, try activating the default WordPress theme.", 'jetpack' );
123 }
124 ?>
125 <?php esc_html_e( "If this solves the problem, something in your theme is probably broken – let the theme's author know.", 'jetpack' ); ?>
126 </li>
127 <li>
128 <?php esc_html_e( 'A problem with your XML-RPC file.', 'jetpack' ); ?>
129 <?php
130 printf(
131 wp_kses(
132 /* translators: The URL to the site's xmlrpc.php file. */
133 __( 'Load your <a href="%s">XML-RPC file</a>. It should say “XML-RPC server accepts POST requests only.” on a line by itself.', 'jetpack' ),
134 array( 'a' => array( 'href' => array() ) )
135 ),
136 esc_attr( site_url( 'xmlrpc.php' ) )
137 );
138 ?>
139 <ul>
140 <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>
141 <li><?php esc_html_e( 'If you get a 404 message, contact your web host. Their security may block the XML-RPC file.', 'jetpack' ); ?></li>
142 </ul>
143 </li>
144
145 <?php if ( current_user_can( 'jetpack_disconnect' ) && Jetpack::is_connection_ready() ) : ?>
146 <li>
147 <?php esc_html_e( 'A connection problem with WordPress.com.', 'jetpack' ); ?>
148 <?php
149 printf(
150 wp_kses(
151 /* translators: URL to disconnect and reconnect Jetpack. */
152 __( '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' ),
153 array(
154 'a' => array(
155 'href' => array(),
156 'class' => array(),
157 ),
158 )
159 ),
160 esc_attr(
161 wp_nonce_url(
162 Jetpack::admin_url(
163 array(
164 'page' => 'jetpack-debugger',
165 'disconnect' => true,
166 )
167 ),
168 'jp_disconnect',
169 'nonce'
170 )
171 )
172 );
173 ?>
174 </li>
175 <?php endif; ?>
176 </ol>
177
178 <h4><?php esc_html_e( 'Still having trouble?', 'jetpack' ); ?></h4>
179 <p>
180 <?php esc_html_e( 'Ask us for help!', 'jetpack' ); ?>
181
182 <?php
183 /**
184 * Offload to new WordPress debug data.
185 */
186 printf(
187 wp_kses(
188 /* translators: URL for Jetpack support. URL for WordPress's Site Health */
189 __( '<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' ),
190 array( 'a' => array( 'href' => array() ) )
191 ),
192 esc_url( $support_url ),
193 esc_url( admin_url() . 'site-health.php?tab=debug' )
194 );
195 ?>
196 </p>
197 </div>
198 </div>
199 </div>
200
201 <div class="jp-static-block">
202 <h2><?php esc_html_e( 'More details about your Jetpack settings', 'jetpack' ); ?></h2>
203
204 <div class="jp-static-block-body">
205 <?php if ( Jetpack::is_connection_ready() ) : ?>
206 <div id="connected-user-details">
207 <p>
208 <?php
209 printf(
210 wp_kses(
211 /* translators: %s is an e-mail address */
212 __( 'The primary connection is owned by <strong>%s</strong>\'s WordPress.com account.', 'jetpack' ),
213 array( 'strong' => array() )
214 ),
215 esc_html( Jetpack::get_master_user_email() )
216 );
217 ?>
218 </p>
219 </div>
220 <?php else : ?>
221 <div id="dev-mode-details">
222 <p>
223 <?php
224 printf(
225 wp_kses(
226 /* translators: Link to a Jetpack support page. */
227 __( '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' ),
228 array( 'a' => array( 'href' => array() ) )
229 ),
230 esc_url( Redirect::get_url( 'jetpack-support-development-mode' ) )
231 );
232 ?>
233 </p>
234 </div>
235 <?php endif; ?>
236
237 <?php
238 if (
239 current_user_can( 'jetpack_manage_modules' )
240 && ( ( new Status() )->is_offline_mode() || Jetpack::is_connection_ready() )
241 ) {
242 printf(
243 wp_kses(
244 '<p><a href="%1$s">%2$s</a></p>',
245 array(
246 'a' => array( 'href' => array() ),
247 'p' => array(),
248 )
249 ),
250 esc_attr( Jetpack::admin_url( 'page=jetpack_modules' ) ),
251 esc_html__( 'Access the full list of Jetpack modules available on your site.', 'jetpack' )
252 );
253 }
254 ?>
255 </div>
256 </div>
257 </div>
258 <?php
259 }
260
261 /**
262 * Outputs html needed within the <head> for the in-plugin debugger page.
263 */
264 public static function jetpack_debug_admin_head() {
265
266 $min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
267 wp_enqueue_style( 'jetpack-admin', plugins_url( "css/jetpack-admin{$min}.css", JETPACK__PLUGIN_FILE ), array( 'genericons', 'jetpack-connection' ), JETPACK__VERSION . '-20121016' );
268 wp_style_add_data( 'jetpack-admin', 'rtl', 'replace' );
269 wp_style_add_data( 'jetpack-admin', 'suffix', $min );
270
271 Jetpack_Admin_Page::load_wrapper_styles();
272 ?>
273 <style type="text/css">
274
275 .jetpack-debug-test-container {
276 margin: 8px 0;
277 }
278
279 #connected-user-details p strong {
280 word-break: break-all;
281 }
282
283 .jetpack-tests-succeed {
284 font-size: large;
285 color: #069E08;
286 }
287
288 .jetpack-test-details {
289 margin: 4px 6px;
290 padding: 10px;
291 overflow: auto;
292 display: none;
293 }
294
295 .formbox {
296 margin: 0 0 25px 0;
297 }
298
299 .formbox input[type="text"], .formbox input[type="email"], .formbox input[type="url"], .formbox textarea, #debug_info_div {
300 border: 1px solid var(--wpds-color-stroke-surface-neutral-weak, #e4e4e4);
301 border-radius: var(--wpds-border-radius-md, 4px);
302 color: #646970;
303 font-size: 14px;
304 padding: 10px;
305 width: 97%;
306 }
307 #debug_info_div {
308 border-radius: var(--wpds-border-radius-lg, 8px);
309 margin-top: 16px;
310 background: var(--wpds-color-bg-surface-neutral-strong, #fff);
311 padding: 16px;
312 }
313 .formbox .contact-support input[type="submit"] {
314 float: right;
315 margin: 0 !important;
316 border-radius: 20px !important;
317 cursor: pointer;
318 font-size: 13pt !important;
319 height: auto !important;
320 margin: 0 0 2em 10px !important;
321 padding: 8px 16px !important;
322 background-color: #dcdcde;
323 border: 1px solid rgba(0,0,0,0.05);
324 border-top-color: rgba(255,255,255,0.1);
325 border-bottom-color: rgba(0,0,0,0.15);
326 color: #333;
327 font-weight: 400;
328 display: inline-block;
329 text-align: center;
330 text-decoration: none;
331 }
332
333 .formbox span.errormsg {
334 margin: 0 0 10px 10px;
335 color: #d00;
336 display: none;
337 }
338
339 .formbox.error span.errormsg {
340 display: block;
341 }
342
343 #debug_info_div, #toggle_debug_info, #debug_info_div p {
344 font-size: 12px;
345 }
346
347 #category_div ul li {
348 list-style-type: none;
349 }
350
351 </style>
352 <script type="text/javascript">
353 jQuery( document ).ready( function($) {
354
355 $( '#debug_info' ).prepend( 'jQuery version: ' + jQuery.fn.jquery + "\r\n" );
356 $( '#debug_form_info' ).prepend( 'jQuery version: ' + jQuery.fn.jquery + "\r\n" );
357
358 $( '.jetpack-test-error .jetpack-test-heading' ).on( 'click', function() {
359 $( this ).parents( '.jetpack-test-error' ).find( '.jetpack-test-details' ).slideToggle();
360 return false;
361 } );
362
363 } );
364 </script>
365 <?php
366 }
367 }
368