is_support_open );
}
catch ( Exception $e ) {
return true;
}
}
public static function jetpack_increase_timeout($time) {
$time = 30; //seconds
return $time;
}
public static function jetpack_debug_display_handler() {
if ( ! current_user_can( 'manage_options' ) )
wp_die( esc_html__('You do not have sufficient permissions to access this page.', 'jetpack' ) );
global $current_user;
get_currentuserinfo();
$user_id = get_current_user_id();
$user_tokens = Jetpack_Options::get_option( 'user_tokens' );
if ( is_array( $user_tokens ) && array_key_exists( $user_id, $user_tokens ) ) {
$user_token = $user_tokens[$user_id];
} else {
$user_token = '[this user has no token]';
}
unset( $user_tokens );
$debug_info = "\r\n";
foreach ( array(
'CLIENT_ID' => 'id',
'BLOG_TOKEN' => 'blog_token',
'MASTER_USER' => 'master_user',
'CERT' => 'fallback_no_verify_ssl_certs',
'TIME_DIFF' => 'time_diff',
'VERSION' => 'version',
'OLD_VERSION' => 'old_version',
'PUBLIC' => 'public',
) as $label => $option_name ) {
$debug_info .= "\r\n" . esc_html( $label . ": " . Jetpack_Options::get_option( $option_name ) );
}
$debug_info .= "\r\n" . esc_html( "USER_ID: " . $user_id );
$debug_info .= "\r\n" . esc_html( "USER_TOKEN: " . $user_token );
$debug_info .= "\r\n" . esc_html( "PHP_VERSION: " . PHP_VERSION );
$debug_info .= "\r\n" . esc_html( "WORDPRESS_VERSION: " . $GLOBALS['wp_version'] );
$debug_info .= "\r\n" . esc_html( "JETPACK__VERSION: " . JETPACK__VERSION );
$debug_info .= "\r\n" . esc_html( "JETPACK__PLUGIN_DIR: " . JETPACK__PLUGIN_DIR );
$debug_info .= "\r\n" . esc_html( "SITE_URL: " . site_url() );
$debug_info .= "\r\n" . esc_html( "HOME_URL: " . home_url() );
$debug_info .= "\r\n\r\nTEST RESULTS:\r\n\r\n";
$debug_raw_info = '';
$tests = array();
$tests['HTTP']['result'] = wp_remote_get( preg_replace( '/^https:/', 'http:', JETPACK__API_BASE ) . 'test/1/' );
$tests['HTTP']['fail_message'] = esc_html__( 'Your site isn’t reaching the Jetpack servers.', 'jetpack' );
$tests['HTTPS']['result'] = wp_remote_get( preg_replace( '/^http:/', 'https:', JETPACK__API_BASE ) . 'test/1/' );
$tests['HTTPS']['fail_message'] = esc_html__( 'Your site isn’t securely reaching the Jetpack servers.', 'jetpack' );
$identity_crisis_message = '';
if ( $identity_crisis = Jetpack::check_identity_crisis( true ) ) {
foreach( $identity_crisis as $key => $value ) {
$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";
}
$identity_crisis = new WP_Error( 'identity-crisis', $identity_crisis_message, $identity_crisis );
} else {
$identity_crisis = 'PASS';
}
$tests['IDENTITY_CRISIS']['result'] = $identity_crisis;
$tests['IDENTITY_CRISIS']['fail_message'] = esc_html__( 'Something has gotten mixed up in your Jetpack Connection!', 'jetpack' );
$self_xml_rpc_url = home_url( 'xmlrpc.php' );
$args = array();
$testsite_url = Jetpack::fix_url_for_bad_hosts( JETPACK__API_BASE . 'testsite/1/?url=' );
add_filter( 'http_request_timeout', array( 'Jetpack_Debugger', 'jetpack_increase_timeout' ) );
$tests['SELF']['result'] = wp_remote_get( $testsite_url . $self_xml_rpc_url );
$tests['SELF']['fail_message'] = esc_html__( 'It looks like your site can not communicate properly with Jetpack.', 'jetpack' );
remove_filter( 'http_request_timeout', array( 'Jetpack_Debugger', 'jetpack_increase_timeout' ) );
?>
$test_info ) :
if ( 'PASS' !== $test_info['result'] && ( is_wp_error( $test_info['result'] ) ||
false == ( $response_code = wp_remote_retrieve_response_code( $test_info['result'] ) ) ||
'200' != $response_code ) ) {
$debug_info .= $test_name . ": FAIL\r\n";
?>
:
get_error_message() : print_r( $test_info['result'], 1 ) ); ?>
get_error_message() : print_r( $test_info['result'], 1 ) );
?>
' . esc_html__( 'Your Jetpack setup looks a-okay!', 'jetpack' ) . '
';
}
else {
echo '
' . esc_html__( 'There seems to be a problem with your site’s ability to communicate with Jetpack!', 'jetpack' ) . '
';
echo $html;
}
$debug_info .= "\r\n\r\nRAW TEST RESULTS:" . $debug_raw_info ."\r\n";
?>
- known conflicts with Jetpack – check the list. (You can also browse the Jetpack support pages or Jetpack support forum 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' ); ?>
-
-
- XMLRPC file. It should say “XML-RPC server accepts POST requests only.” on a line by itself.', 'jetpack' ), site_url( 'xmlrpc.php' ) ); ?>
click here to contact Jetpack support. 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' ); ?>