Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix race condition with Update Manager #3321

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion classes/class-pmpro-admin-activity-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ public function sendAdminActivity( $frequency = '', $recipient = null ) {
// Get Add On statistics.
$all_addons = 0;
$update_addons = 0;
require_once( PMPRO_DIR . '/includes/addons.php' );
$addons = pmpro_getAddons();
$plugin_info = get_site_transient( 'update_plugins' );
foreach ( $addons as $addon ) {
Expand Down
3 changes: 0 additions & 3 deletions classes/class-pmpro-wisdom-integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,6 @@ public function get_levels_info() {
* @return array The list of Add Ons categorized by active, inactive, and update available.
*/
public function get_addons_info() {
// This file only is usually only required when is_admin().
require_once( PMPRO_DIR . '/includes/addons.php' );

// Build the list of Add Ons data to track.
$addons = pmpro_getAddons();
$plugin_info = get_site_transient( 'update_plugins' );
Expand Down
2 changes: 1 addition & 1 deletion includes/addons.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function pmpro_setupAddonUpdateInfo() {
add_filter( 'http_request_args', 'pmpro_http_request_args_for_addons', 10, 2 );
add_action( 'update_option_pmpro_license_key', 'pmpro_reset_update_plugins_cache', 10, 2 );
}
add_action( 'init', 'pmpro_setupAddonUpdateInfo' );
add_action( 'admin_init', 'pmpro_setupAddonUpdateInfo' );

/**
* Get addon information from PMPro server.
Expand Down
4 changes: 1 addition & 3 deletions paid-memberships-pro.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,7 @@
}

// load plugin updater
if ( is_admin() ) {
require_once( PMPRO_DIR . '/includes/addons.php' );
}
require_once( PMPRO_DIR . '/includes/addons.php' );

/*
Definitions
Expand Down