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

Run setup() on plugins_loaded instead of after_setup_theme #716

Closed
raamdev opened this issue Mar 14, 2016 · 4 comments
Closed

Run setup() on plugins_loaded instead of after_setup_theme #716

raamdev opened this issue Mar 14, 2016 · 4 comments

Comments

@raamdev
Copy link
Contributor

@raamdev raamdev commented Mar 14, 2016

Comet Cache currently hooks its setup routine into after_theme_setup, which runs after plugins_loaded.

Other plugins that integrate with Comet Cache might hook into plugins_loaded to make API calls like comet_cache::clear(), which would currently fail with a fatal error because the setup routine hasn't been run yet:

PHP Fatal error: Uncaught exception 'Exception' with message 'Missing base_dir option value.'

We should take a closer look at this and use the plugins_loaded hook instead if possible.


Referencing: https://wordpress.org/support/topic/clearing-cache-from-autoptimize-base_dir-option

@raamdev
Copy link
Contributor Author

@raamdev raamdev commented Mar 14, 2016

@jaswsinc Is there any reason we're hooking into after_setup_theme here and not plugins_loaded? I reviewed the setup() function and I'm not seeing anything in there that would require waiting until after_theme_setup.

zytzagoo added a commit to zytzagoo/autoptimize that referenced this issue Mar 15, 2016
…ead of 'plugins_loaded' in order to avoid a fatal error caused by zencache/comet-cache

It might change back though, depending on wpsharks/comet-cache#716
@jaswrks
Copy link

@jaswrks jaswrks commented Mar 22, 2016

No, that sounds fine to me also.

@raamdev
Copy link
Contributor Author

@raamdev raamdev commented Apr 6, 2016

Next Release Changelog:

  • Hooks/Filters: Comet Cache now hooks into plugins_loaded instead of after_setup_theme when calling its own setup routine. This improves integration with other plugins that may be expecting the Comet Cache API functions to be available after plugins_loaded. Props to Frank Goossens (@futtta) from Autoptimize for helping with this. See Issue #716.
@raamdev raamdev closed this Apr 6, 2016
@raamdev
Copy link
Contributor Author

@raamdev raamdev commented Apr 16, 2016

Comet Cache v160416 has been released and includes changes from this GitHub Issue. See the v160416 announcement for further details.


This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one (#716).

@wpsharks wpsharks locked and limited conversation to collaborators Apr 16, 2016
raamdev referenced this issue in wpsharks/comet-cache-pro Nov 26, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants