-
Notifications
You must be signed in to change notification settings - Fork 84
[multisite] Improve retrieval of individual‑site info in a multisite … #802
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
[multisite] Improve retrieval of individual‑site info in a multisite … #802
Conversation
e62f937
to
2f18daa
Compare
includes/class-fs-hook-snapshot.php
Outdated
public function remove( $hook ) { | ||
global $wp_filter; | ||
|
||
if ( isset( $wp_filter[ $hook ] ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In normal WP context this is good enough, but in edge cases it could be useful to safe check the existence of $wp_filter
:
if ( isset( $wp_filter ) && isset( $wp_filter[ $hook ] ) ) {
This makes the code more robust in edge cases, such as when the file is loaded outside of the standard WordPress environment or during automated tests.
In normal WordPress usage, this is rarely necessary, but it helps prevent potential errors in atypical scenarios.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good enough to me, only read the one comment and think about it (we have to deal with tons of different use cases).
2f18daa
to
99d55b6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see my only question
includes/class-freemius.php
Outdated
@@ -7897,18 +7897,20 @@ private function activate_bundle_license( $license, $sites = array(), $current_b | |||
} | |||
} | |||
|
|||
$current_blog_id = get_current_blog_id(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not fully aware of the mechanism, but don't we want to call this before even switching on line 7854
?
includes/class-freemius.php
Outdated
@@ -15832,9 +15833,8 @@ function get_site_info( $site = null, $load_registration = false ) { | |||
$info[ 'registration_date' ] = $registration_date; | |||
} | |||
|
|||
if ( $switched ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fajardoleo why are we removing this? Don't we want to restore the blog like before?
…ure/swas/restore_blog_fix_alt_exploration` branch.
99d55b6
to
a8e7e4b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice addition
…network.