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

Use dequeue rather than deregister to prevent Query Monitor Errors #793

Closed
mrwweb opened this issue Jun 21, 2021 · 6 comments
Closed

Use dequeue rather than deregister to prevent Query Monitor Errors #793

mrwweb opened this issue Jun 21, 2021 · 6 comments
Assignees

Comments

@mrwweb
Copy link

mrwweb commented Jun 21, 2021

With WP2Static installed, Query Monitor shows an error on every page "Missing: wp-embed". This is because that script is deregistered but not dequeued.

Changing that linked line from wp_deregister_script() to wp_dequeue_script() resolved the error (and I believe is the correct way to do what is intended).

Relevant support thread.

@leonstafford
Copy link
Contributor

Great, thanks @mrwweb! Will fix!

@leonstafford leonstafford self-assigned this Jun 22, 2021
@leonstafford
Copy link
Contributor

@mrwweb I didn't dive deep enough in to check what each of those functions look like, but saw enough examples of developers calling both, so went with that for now. Please let me know if persists with latest code.

Could you please let me know a bit more of your test environment? ie Theme/plugins in use? I wasn't able to get Query Monitor showing me that error on a vanilla WP test site...

@mrwweb
Copy link
Author

mrwweb commented Jul 19, 2021

@leonstafford Sorry I didn't get back to you sooner. I poked around at this a bit and I'm not quite sure what you're running into. I've got a site running nothing but Query Monitor and wp2static with Twenty Twenty as the active theme and I'm still getting the error displayed in Query Monitor. I wish I had something better to tell you!

@leonstafford
Copy link
Contributor

@mrwweb - to confirm, you're still seeing it with the latest changes in develop branch?

e88b0b6

fixes #793 dequeue when deregistering scripts

If still seeing it, please share me some more info about your WP hosting setup and I can try to reproduce

@mrwweb
Copy link
Author

mrwweb commented Jul 20, 2021

@leonstafford Sorry for not being clearer! The fix definitely works, but I couldn't figure out why you couldn't reproduce the issue for yourself before that.

@leonstafford
Copy link
Contributor

@mrwweb ah, all good then! Probably just the environment I was using (https://lokl.dev). In case you try it and find WP Debug not working as usual, happy to fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants