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

1.1.1: you should not run register_uninstall_hook() unconditionally on every request #3

Open
lkraav opened this issue Nov 14, 2018 · 3 comments

Comments

@lkraav
Copy link

lkraav commented Nov 14, 2018

https://plugins.trac.wordpress.org/browser/index-autoload-littlebizzy/trunk/index-autoload.php#L103

This causes slow update_option() calls on every request for no reason.

Please use https://github.com/johnbillion/query-monitor (define SAVEQUERIES true) to profile your performance better.

See docs for wrapping instructions https://developer.wordpress.org/reference/functions/register_uninstall_hook/

@lkraav
Copy link
Author

lkraav commented May 27, 2020

This is still a problem. Does nobody care here, or you're waiting for a PR, or...?

@jessuppi
Copy link
Member

@lkraav Thanks for your feedback, I seem to have missed this Issue. You are certainly welcome to provide a code snippet suggestion here if possible, that might be easier than a PR.

That said, WordPress 5.3+ now indexes the autoload tables by default. So we no longer include this plugin in our SlickStack default plugins, as it's not really needed anymore.

Ref: https://core.trac.wordpress.org/ticket/24044

@lkraav
Copy link
Author

lkraav commented May 27, 2020

Thanks for the reminder for 5.3. I basically had forgotten to disable plugins/index-autoload.

Regardless, to fix https://plugins.trac.wordpress.org/browser/index-autoload-littlebizzy/trunk/admin-notices.php#L134 we have an implementation example at https://developer.wordpress.org/reference/functions/register_uninstall_hook/

Basically, you should only be registering uninstall hooks once, on plugin activation. Could also grep your plugins/ directory for probably tens more examples.

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

No branches or pull requests

2 participants