Skip to content

Commit

Permalink
New build
Browse files Browse the repository at this point in the history
  • Loading branch information
jeherve committed Feb 20, 2020
1 parent 1140ea9 commit c62a4e6
Show file tree
Hide file tree
Showing 41 changed files with 1,234 additions and 1,212 deletions.
34 changes: 33 additions & 1 deletion class.jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,37 @@ static function delete_active_modules() {
self::update_active_modules( array() );
}

/**
* Adds a hook to plugins_loaded at a priority that's currently the earliest
* available.
*/
public function add_configure_hook() {
global $wp_filter;

$current_priority = has_filter( 'plugins_loaded', array( $this, 'configure' ) );
if ( false !== $current_priority ) {
remove_action( 'plugins_loaded', array( $this, 'configure' ), $current_priority );
}

$taken_priorities = array_map( 'intval', array_keys( $wp_filter['plugins_loaded']->callbacks ) );
sort( $taken_priorities );

$first_priority = array_shift( $taken_priorities );

if ( defined( 'PHP_INT_MAX' ) && $first_priority <= - PHP_INT_MAX ) {
trigger_error( // phpcs:ignore
/* translators: plugins_loaded is a filter name in WordPress, no need to translate. */
__( 'A plugin on your site is using the plugins_loaded filter with a priority that is too high. Jetpack does not support this, you may experience problems.', 'jetpack' ), // phpcs:ignore
E_USER_NOTICE
);
$new_priority = - PHP_INT_MAX;
} else {
$new_priority = $first_priority - 1;
}

add_action( 'plugins_loaded', array( $this, 'configure' ), $new_priority );
}

/**
* Constructor. Initializes WordPress hooks
*/
Expand All @@ -558,7 +589,8 @@ private function __construct() {
*/
add_action( 'init', array( $this, 'deprecated_hooks' ) );

add_action( 'plugins_loaded', array( $this, 'configure' ), 1 );
// Note how this runs at an earlier plugin_loaded hook intentionally to accomodate for other plugins.
add_action( 'plugin_loaded', array( $this, 'add_configure_hook' ), 90 );
add_action( 'plugins_loaded', array( $this, 'late_initialization' ), 90 );

add_filter(
Expand Down
4 changes: 2 additions & 2 deletions jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin URI: https://jetpack.com
* Description: Bring the power of the WordPress.com cloud to your self-hosted WordPress. Jetpack enables you to connect your blog to a WordPress.com account to use the powerful features normally only available to WordPress.com users.
* Author: Automattic
* Version: 8.2.1
* Version: 8.2.2
* Author URI: https://jetpack.com
* License: GPL2+
* Text Domain: jetpack
Expand All @@ -15,7 +15,7 @@

define( 'JETPACK__MINIMUM_WP_VERSION', '5.2' );
define( 'JETPACK__MINIMUM_PHP_VERSION', '5.6' );
define( 'JETPACK__VERSION', '8.2.1' );
define( 'JETPACK__VERSION', '8.2.2' );
define( 'JETPACK_MASTER_USER', true );
define( 'JETPACK__API_VERSION', 1 );
define( 'JETPACK__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
Expand Down
Loading

0 comments on commit c62a4e6

Please sign in to comment.