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.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 / class.jetpack-debugger.php
jetpack Last commit date
3rd-party 10 years ago _inc 10 years ago css 10 years ago images 10 years ago json-endpoints 10 years ago languages 10 years ago modules 5 years ago scss 10 years ago views 10 years ago .svnignore 10 years ago changelog.txt 10 years ago class.jetpack-admin.php 10 years ago class.jetpack-autoupdate.php 10 years ago class.jetpack-bbpress-json-api-compat.php 10 years ago class.jetpack-cli.php 10 years ago class.jetpack-client-server.php 10 years ago class.jetpack-client.php 10 years ago class.jetpack-data.php 10 years ago class.jetpack-debugger.php 10 years ago class.jetpack-error.php 10 years ago class.jetpack-heartbeat.php 10 years ago class.jetpack-ixr-client.php 10 years ago class.jetpack-jitm.php 10 years ago class.jetpack-modules-list-table.php 10 years ago class.jetpack-network-sites-list-table.php 10 years ago class.jetpack-network.php 10 years ago class.jetpack-options.php 10 years ago class.jetpack-post-images.php 10 years ago class.jetpack-signature.php 10 years ago class.jetpack-sync.php 10 years ago class.jetpack-twitter-cards.php 10 years ago class.jetpack-user-agent.php 10 years ago class.jetpack-xmlrpc-server.php 10 years ago class.jetpack.php 10 years ago class.json-api-endpoints.php 3 years ago class.json-api.php 10 years ago class.media-extractor.php 10 years ago class.media-summary.php 10 years ago class.photon.php 10 years ago composer.json 10 years ago functions.compat.php 10 years ago functions.gallery.php 10 years ago functions.opengraph.php 10 years ago functions.photon.php 10 years ago jetpack.php 3 years ago json-api-config.php 10 years ago json-endpoints.php 10 years ago locales.php 10 years ago readme.txt 3 years ago require-lib.php 10 years ago uninstall.php 10 years ago wpml-config.xml 10 years ago
class.jetpack-debugger.php
379 lines
1 <?php
2
3 class Jetpack_Debugger {
4
5 private static function is_jetpack_support_open() {
6 try {
7 $response = wp_remote_request( "http://jetpack.me/is-support-open" );
8 $body = wp_remote_retrieve_body( $response );
9 $json = json_decode( $body );
10 return ( ( bool ) $json->is_support_open );
11 }
12 catch ( Exception $e ) {
13 return true;
14 }
15 }
16
17 public static function jetpack_increase_timeout($time) {
18 $time = 30; //seconds
19 return $time;
20 }
21
22 public static function jetpack_debug_display_handler() {
23 if ( ! current_user_can( 'manage_options' ) )
24 wp_die( esc_html__('You do not have sufficient permissions to access this page.', 'jetpack' ) );
25
26 global $current_user;
27 get_currentuserinfo();
28
29 $user_id = get_current_user_id();
30 $user_tokens = Jetpack_Options::get_option( 'user_tokens' );
31 if ( is_array( $user_tokens ) && array_key_exists( $user_id, $user_tokens ) ) {
32 $user_token = $user_tokens[$user_id];
33 } else {
34 $user_token = '[this user has no token]';
35 }
36 unset( $user_tokens );
37
38 $debug_info = "\r\n";
39 foreach ( array(
40 'CLIENT_ID' => 'id',
41 'BLOG_TOKEN' => 'blog_token',
42 'MASTER_USER' => 'master_user',
43 'CERT' => 'fallback_no_verify_ssl_certs',
44 'TIME_DIFF' => 'time_diff',
45 'VERSION' => 'version',
46 'OLD_VERSION' => 'old_version',
47 'PUBLIC' => 'public',
48 ) as $label => $option_name ) {
49 $debug_info .= "\r\n" . esc_html( $label . ": " . Jetpack_Options::get_option( $option_name ) );
50 }
51
52 $debug_info .= "\r\n" . esc_html( "USER_ID: " . $user_id );
53 $debug_info .= "\r\n" . esc_html( "USER_TOKEN: " . $user_token );
54 $debug_info .= "\r\n" . esc_html( "PHP_VERSION: " . PHP_VERSION );
55 $debug_info .= "\r\n" . esc_html( "WORDPRESS_VERSION: " . $GLOBALS['wp_version'] );
56 $debug_info .= "\r\n" . esc_html( "JETPACK__VERSION: " . JETPACK__VERSION );
57 $debug_info .= "\r\n" . esc_html( "JETPACK__PLUGIN_DIR: " . JETPACK__PLUGIN_DIR );
58 $debug_info .= "\r\n" . esc_html( "SITE_URL: " . site_url() );
59 $debug_info .= "\r\n" . esc_html( "HOME_URL: " . home_url() );
60
61 $debug_info .= "\r\n\r\nTEST RESULTS:\r\n\r\n";
62 $debug_raw_info = '';
63
64
65 $tests = array();
66
67 $tests['HTTP']['result'] = wp_remote_get( preg_replace( '/^https:/', 'http:', JETPACK__API_BASE ) . 'test/1/' );
68 $tests['HTTP']['fail_message'] = esc_html__( 'Your site isn’t reaching the Jetpack servers.', 'jetpack' );
69
70 $tests['HTTPS']['result'] = wp_remote_get( preg_replace( '/^http:/', 'https:', JETPACK__API_BASE ) . 'test/1/' );
71 $tests['HTTPS']['fail_message'] = esc_html__( 'Your site isn’t securely reaching the Jetpack servers.', 'jetpack' );
72
73 $identity_crisis_message = '';
74 if ( $identity_crisis = Jetpack::check_identity_crisis( true ) ) {
75 foreach( $identity_crisis as $key => $value ) {
76 $identity_crisis_message .= sprintf( __( 'Your `%1$s` option is set up as `%2$s`, but your WordPress.com connection lists it as `%3$s`!', 'jetpack' ), $key, (string) get_option( $key ), $value ) . "\r\n";
77 }
78 $identity_crisis = new WP_Error( 'identity-crisis', $identity_crisis_message, $identity_crisis );
79 } else {
80 $identity_crisis = 'PASS';
81 }
82 $tests['IDENTITY_CRISIS']['result'] = $identity_crisis;
83 $tests['IDENTITY_CRISIS']['fail_message'] = esc_html__( 'Something has gotten mixed up in your Jetpack Connection!', 'jetpack' );
84
85 $self_xml_rpc_url = home_url( 'xmlrpc.php' );
86
87 $testsite_url = Jetpack::fix_url_for_bad_hosts( JETPACK__API_BASE . 'testsite/1/?url=' );
88
89 add_filter( 'http_request_timeout', array( 'Jetpack_Debugger', 'jetpack_increase_timeout' ) );
90
91 $tests['SELF']['result'] = wp_remote_get( $testsite_url . $self_xml_rpc_url );
92 $tests['SELF']['fail_message'] = esc_html__( 'It looks like your site can not communicate properly with Jetpack.', 'jetpack' );
93
94 remove_filter( 'http_request_timeout', array( 'Jetpack_Debugger', 'jetpack_increase_timeout' ) );
95
96 ?>
97 <div class="wrap">
98 <h2><?php esc_html_e( 'Jetpack Debugging Center', 'jetpack' ); ?></h2>
99 <h3><?php _e( "Testing your site's compatibility with Jetpack...", 'jetpack' ); ?></h3>
100 <div class="jetpack-debug-test-container">
101 <?php
102 ob_start();
103 foreach ( $tests as $test_name => $test_info ) :
104 if ( 'PASS' !== $test_info['result'] && ( is_wp_error( $test_info['result'] ) ||
105 false == ( $response_code = wp_remote_retrieve_response_code( $test_info['result'] ) ) ||
106 '200' != $response_code ) ) {
107 $debug_info .= $test_name . ": FAIL\r\n";
108 ?>
109 <div class="jetpack-test-error">
110 <p>
111 <a class="jetpack-test-heading" href="#"><?php echo $test_info['fail_message']; ?>
112 <span class="noticon noticon-collapse"></span>
113 </a>
114 </p>
115 <pre class="jetpack-test-details"><?php echo esc_html( $test_name ); ?>:
116 <?php echo esc_html( is_wp_error( $test_info['result'] ) ? $test_info['result']->get_error_message() : print_r( $test_info['result'], 1 ) ); ?></pre>
117 </div><?php
118 } else {
119 $debug_info .= $test_name . ": PASS\r\n";
120 }
121 $debug_raw_info .= "\r\n\r\n" . $test_name . "\r\n" . esc_html( is_wp_error( $test_info['result'] ) ? $test_info['result']->get_error_message() : print_r( $test_info['result'], 1 ) );
122 ?>
123 <?php endforeach;
124 $html = ob_get_clean();
125
126 if ( '' == trim( $html ) ) {
127 echo '<div class="jetpack-tests-succed">' . esc_html__( 'Your Jetpack setup looks a-okay!', 'jetpack' ) . '</div>';
128 }
129 else {
130 echo '<h3>' . esc_html__( 'There seems to be a problem with your site’s ability to communicate with Jetpack!', 'jetpack' ) . '</h3>';
131 echo $html;
132 }
133 $debug_info .= "\r\n\r\nRAW TEST RESULTS:" . $debug_raw_info ."\r\n";
134 ?>
135 </div>
136 <div class="entry-content">
137 <h3><?php esc_html_e( 'Trouble with Jetpack?', 'jetpack' ); ?></h3>
138 <h4><?php esc_html_e( 'It may be caused by one of these issues, which you can diagnose yourself:', 'jetpack' ); ?></h4>
139 <ol>
140 <li><b><em><?php esc_html_e( 'A known issue.', 'jetpack' ); ?></em></b> <?php echo sprintf( __( 'Some themes and plugins have <a href="%1$s">known conflicts</a> with Jetpack – check the <a href="%2$s">list</a>. (You can also browse the <a href="%3$s">Jetpack support pages</a> or <a href="%4$s">Jetpack support forum</a> to see if others have experienced and solved the problem.)', 'jetpack' ), 'http://jetpack.me/support/getting-started-with-jetpack/known-issues/', 'http://jetpack.me/support/getting-started-with-jetpack/known-issues/', 'http://jetpack.me/support/', 'http://wordpress.org/support/plugin/jetpack' ); ?></li>
141 <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>
142 <li><b><em><?php esc_html_e( 'A theme conflict.', 'jetpack' ); ?></em></b> <?php esc_html_e( "If your problem isn't known or caused by a plugin, try activating Twenty Twelve (the default WordPress theme). If this solves the problem, something in your theme is probably broken – let the theme's author know.", 'jetpack' ); ?></li>
143 <li><b><em><?php esc_html_e( 'A problem with your XMLRPC file.', 'jetpack' ); ?></em></b> <?php echo sprintf( __( 'Load your <a href="%s">XMLRPC file</a>. It should say “XML-RPC server accepts POST requests only.” on a line by itself.', 'jetpack' ), site_url( 'xmlrpc.php' ) ); ?>
144 <ul>
145 <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>
146 <li>- <?php esc_html_e( "If you get a 404 message, contact your web host. Their security may block XMLRPC.", 'jetpack' ); ?></li>
147 </ul>
148 </li>
149 </ol>
150 <?php if ( self::is_jetpack_support_open() ): ?>
151 <p class="jetpack-show-contact-form"><?php echo sprintf( __( 'If none of these help you find a solution, <a href="%s">click here to contact Jetpack support</a>. Tell us as much as you can about the issue and what steps you\'ve tried to resolve it, and one of our Happiness Engineers will be in touch to help.', 'jetpack' ), Jetpack::admin_url( array( 'page' => 'jetpack-debugger', 'contact' => true ) ) ); ?>
152 </p>
153 <?php endif; ?>
154 <?php if ( Jetpack::is_active() ) : ?>
155 <hr />
156 <div id="connected-user-details">
157 <p><?php printf( __( 'The primary connection is owned by <strong>%s</strong>\'s WordPress.com account.', 'jetpack' ), esc_html( Jetpack::get_master_user_email() ) ); ?></p>
158 </div>
159 <hr />
160 <div id="sync-related-posts">
161 <p><?php echo esc_html__( 'Some features of Jetpack uses the WordPress.com infrastructure and requires that your public content be mirrored there. If you see intermittent issues only affecting certain posts, please try requesting a reindex of your posts.', 'jetpack' ); ?></p>
162 <?php echo Jetpack::init()->sync->reindex_ui() ?>
163 </div>
164 <?php endif; ?>
165 </div>
166 <div id="contact-message" <?php if( ! isset( $_GET['contact'] ) ) {?> style="display:none" <?php } ?>>
167 <?php if ( self::is_jetpack_support_open() ): ?>
168 <form id="contactme" method="post" action="http://jetpack.me/contact-support/">
169 <input type="hidden" name="action" value="submit">
170 <input type="hidden" name="jetpack" value="needs-service">
171
172 <input type="hidden" name="contact_form" id="contact_form" value="1">
173 <input type="hidden" name="blog_url" id="blog_url" value="<?php echo esc_attr( site_url() ); ?>">
174 <input type="hidden" name="subject" id="subject" value="from: <?php echo esc_attr( site_url() ); ?> Jetpack contact form">
175 <div class="formbox">
176 <label for="message" class="h"><?php esc_html_e( 'Please describe the problem you are having.', 'jetpack' ); ?></label>
177 <textarea name="message" cols="40" rows="7" id="did"></textarea>
178 </div>
179
180 <div id="name_div" class="formbox">
181 <label class="h" for="your_name"><?php esc_html_e( 'Name', 'jetpack' ); ?></label>
182 <span class="errormsg"><?php esc_html_e( 'Let us know your name.', 'jetpack' ); ?></span>
183 <input name="your_name" type="text" id="your_name" value="<?php esc_html_e( $current_user->display_name, 'jetpack'); ?>" size="40">
184 </div>
185
186 <div id="email_div" class="formbox">
187 <label class="h" for="your_email"><?php esc_html_e( 'E-mail', 'jetpack' ); ?></label>
188 <span class="errormsg"><?php esc_html_e( 'Use a valid email address.', 'jetpack' ); ?></span>
189 <input name="your_email" type="text" id="your_email" value="<?php esc_html_e( $current_user->user_email, 'jetpack'); ?>" size="40">
190 </div>
191
192 <div id="toggle_debug_info" class="formbox">
193 <p><?php _e( 'The test results and some other useful debug information will be sent to the support team. Please feel free to <a href="#">review/modify</a> this information.', 'jetpack' ); ?></p>
194 </div>
195
196 <div id="debug_info_div" class="formbox" style="display:none">
197 <label class="h" for="debug_info"><?php esc_html_e( 'Debug Info', 'jetpack' ); ?></label>
198 <textarea name="debug_info" cols="40" rows="7" id="debug_info"><?php echo esc_attr( $debug_info ); ?></textarea>
199 </div>
200
201 <div style="clear: both;"></div>
202
203 <div id="blog_div" class="formbox">
204 <div id="submit_div" class="contact-support">
205 <input type="submit" name="submit" value="<?php esc_html_e( 'Submit &#187;', 'jetpack' ); ?>">
206 </div>
207 </div>
208 <div style="clear: both;"></div>
209 </form>
210 <?php endif; ?>
211 </div>
212 </div>
213 <?php
214 }
215
216 public static function jetpack_debug_admin_head() {
217 ?>
218 <style type="text/css">
219
220 .jetpack-debug-test-container {
221 margin-top: 20px;
222 margin-bottom: 30px;
223 }
224
225 .jetpack-tests-succed {
226 font-size: large;
227 color: #8BAB3E;
228 }
229
230 .jetpack-test-details {
231 margin: 4px 6px;
232 padding: 10px;
233 overflow: auto;
234 display: none;
235 }
236
237 .jetpack-test-error {
238 margin-bottom: 10px;
239 background: #FFEBE8;
240 border: solid 1px #C00;
241 border-radius: 3px;
242 }
243
244 .jetpack-test-error p {
245 margin: 0;
246 padding: 0;
247 }
248
249 .jetpack-test-error a.jetpack-test-heading {
250 padding: 4px 6px;
251 display: block;
252 text-decoration: none;
253 color: inherit;
254 }
255
256 .jetpack-test-error .noticon {
257 float: right;
258 }
259
260 form#contactme {
261 border: 1px solid #dfdfdf;
262 background: #eaf3fa;
263 padding: 20px;
264 margin: 10px;
265 background-color: #eaf3fa;
266 border-radius: 5px;
267 font-size: 15px;
268 font-family: "Open Sans", "Helvetica Neue", sans-serif;
269 }
270
271 form#contactme label.h {
272 color: #444;
273 display: block;
274 font-weight: bold;
275 margin: 0 0 7px 10px;
276 text-shadow: 1px 1px 0 #fff;
277 }
278
279 .formbox {
280 margin: 0 0 25px 0;
281 }
282
283 .formbox input[type="text"], .formbox input[type="email"], .formbox input[type="url"], .formbox textarea {
284 border: 1px solid #e5e5e5;
285 border-radius: 11px;
286 box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
287 color: #666;
288 font-size: 14px;
289 padding: 10px;
290 width: 97%;
291 }
292 .formbox .contact-support input[type="submit"] {
293 float: right;
294 margin: 0 !important;
295 border-radius: 20px !important;
296 cursor: pointer;
297 font-size: 13pt !important;
298 height: auto !important;
299 margin: 0 0 2em 10px !important;
300 padding: 8px 16px !important;
301 background-color: #ddd;
302 border: 1px solid rgba(0,0,0,0.05);
303 border-top-color: rgba(255,255,255,0.1);
304 border-bottom-color: rgba(0,0,0,0.15);
305 color: #333;
306 font-weight: 400;
307 display: inline-block;
308 text-align: center;
309 text-decoration: none;
310 }
311
312 .formbox span.errormsg {
313 margin: 0 0 10px 10px;
314 color: #d00;
315 display: none;
316 }
317
318 .formbox.error span.errormsg {
319 display: block;
320 }
321
322 #contact-message ul {
323 margin: 0 0 20px 10px;
324 }
325
326 #contact-message li {
327 margin: 0 0 10px 10px;
328 list-style: disc;
329 display: list-item;
330 }
331
332 </style>
333 <script type="text/javascript">
334 jQuery( document ).ready( function($) {
335
336 $('#debug_info').prepend('jQuery version: ' + jQuery.fn.jquery + "\r\n");
337
338 $( '.jetpack-test-error .jetpack-test-heading' ).on( 'click', function() {
339 $( this ).parents( '.jetpack-test-error' ).find( '.jetpack-test-details' ).slideToggle();
340 return false;
341 } );
342
343 $( '.jetpack-show-contact-form a' ).on( 'click', function() {
344 $('#contact-message').slideToggle();
345 return false;
346 } );
347
348 $( '#toggle_debug_info a' ).on( 'click', function() {
349 $('#debug_info_div').slideToggle();
350 return false;
351 } );
352
353 $('form#contactme').on("submit", function(e){
354 var form = $(this);
355 var message = form.find('#did');
356 var name = form.find('#your_name');
357 var email = form.find('#your_email')
358 var validation_error = false;
359 if( !name.val() ) {
360 name.parents('.formbox').addClass('error');
361 validation_error = true;
362 }
363 if( !email.val() ) {
364 email.parents('.formbox').addClass('error');
365 validation_error = true;
366 }
367 if ( validation_error ) {
368 return false;
369 }
370 message.val(message.val() + "\r\n\r\n----------------------------------------------\r\n\r\nDEBUG INFO:\r\n" + $('#debug_info').val() );
371 return true;
372 });
373
374 } );
375 </script>
376 <?php
377 }
378 }
379