• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Jetpack a2z

Jetpack a2z

Jetpack a2z

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Jetpack_Cxn_Tests::test__check_if_connected() – Test if Jetpack is connected.

You appear to be a bot. Output may be restricted

Description

Test if Jetpack is connected.

Usage

Jetpack_Cxn_Tests::test__check_if_connected();

Parameters

Returns

void

Source

File name: jetpack/_inc/lib/debugger/class-jetpack-cxn-tests.php


Lines:

1 to 43 of 43
  protected function test__check_if_connected() {
    $name = __FUNCTION__;

    if ( ! $this->helper_get_blog_token() ) {
      return self::skipped_test(
        array(
          'name'              => $name,
          'short_description' => __( 'Blog token is missing.', 'jetpack' ),
        )
      );
    }

    if ( $this->helper_is_jetpack_connected() ) {
      $result = self::passing_test(
        array(
          'name'             => $name,
          'label'            => __( 'Your site is connected to Jetpack', 'jetpack' ),
          'long_description' => sprintf(
            '<p>%1$s</p>' .
            '<p><span class="dashicons pass"><span class="screen-reader-text">%2$s</span></span> %3$s</p>',
            __( 'A healthy connection ensures Jetpack essential services are provided to your WordPress site, such as Stats and Site Security.', 'jetpack' ),
            /* translators: Screen reader text indicating a test has passed */
            __( 'Passed', 'jetpack' ),
            __( 'Your site is connected to Jetpack.', 'jetpack' )
          ),
        )
      );
    } elseif ( ( new Status() )->is_offline_mode() ) {
      $result = self::skipped_test(
        array(
          'name'              => $name,
          'short_description' => __( 'Jetpack is in Offline Mode:', 'jetpack' ) . ' ' . Jetpack::development_mode_trigger_text(),
        )
      );
    } else {
      $connection_error = __( 'Your site is not connected to Jetpack', 'jetpack' );

      $result = self::connection_failing_test( $name, $connection_error );
    }

    return $result;
  }
 

 View on GitHub View on Trac

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Pinterest (Opens in new window)

Related

Published: 27 November 2019 | Last updated: 10 December 2020

Primary Sidebar

Information

Function name: Jetpack_Cxn_Tests::test__check_if_connected
Class ref: Jetpack_Cxn_Tests
Plugin ref: Jetpack
Version: 9.2
Sourcefile: _inc/lib/debugger/class-jetpack-cxn-tests.php
File ref: _inc/lib/debugger/class-jetpack-cxn-tests.php
Deprecated?: No
API Letters: C,J,T

Footer

Jetpack a2z
Jetpack a2z
Jetpack a2z
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  jetpack.wp-a2z.org
© Copyright Jetpack a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites