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

Hook wpmu_new_blog callbacks to wp_insert_site / wp_initialize_site #11437

Closed
iandunn opened this issue Feb 28, 2019 · 4 comments · Fixed by #12252
Closed

Hook wpmu_new_blog callbacks to wp_insert_site / wp_initialize_site #11437

iandunn opened this issue Feb 28, 2019 · 4 comments · Fixed by #12252
Assignees
Labels
[Feature] Likes [Focus] Multisite [Type] Bug When a feature is broken and / or not performing as intended [Type] Janitorial
Milestone

Comments

@iandunn
Copy link

iandunn commented Feb 28, 2019

Jetpack hooks into the wpmu_new_blog action in two places:

https://github.com/Automattic/jetpack/blob/ca7c26b/modules/likes.php#L80

https://github.com/Automattic/jetpack/blob/b578d60/class.jetpack-network.php#L76

WP 5.1 deprecated that hook in favor of wp_insert_site and wp_initialize_site.

Because of that, notices are being triggered when any plugin calls wp_insert_site(), even if that plugin uses the new hooks correctly. The notice is triggered if any active plugin is using the deprecated hooks. Because of that, local development workflows are broken by headers already sent crashes, and production error logs are cluttered with noise, making them less useful.

Steps to reproduce the issue

  1. Activate latest JP on WP 5.1
  2. Call wp_insert_site() from an mu-plugin, wp shell, etc

What I expected

No notices should be triggered.

What happened instead

A notice was triggered.

Screenshots

screen shot 2019-02-27 at 5 09 14 pm

@iandunn
Copy link
Author

iandunn commented May 2, 2019

Just noting that this is still happening, so that Stalebot doesn't close the issue.

@kraftbj kraftbj added this to the 7.4 milestone May 2, 2019
@kraftbj
Copy link
Contributor

kraftbj commented May 2, 2019

I'm marking this as 7.4. As soon as WP 5.2 has been released, our minimum supported WP version becomes 5.1 so we can switch to this without any version checks for 5.0 for the old hooks.

@kraftbj
Copy link
Contributor

kraftbj commented May 2, 2019

I'm not going to attempt to fix the Likes reference in the Jetpack PR since that is code that only runs on WordPress.com and the callable being passed to the filter does not exist in the JP codebase.

I'd like it to fix it on the WP.com and bring it over in Fusion.

@iandunn
Copy link
Author

iandunn commented May 3, 2019

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Likes [Focus] Multisite [Type] Bug When a feature is broken and / or not performing as intended [Type] Janitorial
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants