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

Warn about using register_activation_hook ? #1290

Open
jrfnl opened this issue Jan 25, 2018 · 0 comments
Open

Warn about using register_activation_hook ? #1290

jrfnl opened this issue Jan 25, 2018 · 0 comments
Labels
Focus: WP interoperability Doing things the WP way, prefer using WP functionality over userland/PHP native

Comments

@jrfnl
Copy link
Member

jrfnl commented Jan 25, 2018

Inspired by this discussion: TGMPA/TGM-Plugin-Activation#722

Activation routines via register_activation_hook are generally speaking not compatible with WP multi-site.
It is better to use a plugin/theme version-based upgrade routine pattern to handle both activation as well as upgrade routines.
An example pattern which will work with multi-site, but also with updates via Composer or via FTP:
https://speakerdeck.com/jrf/the-secret-to-mastering-wordpress-multi-site-php-world?slide=26
https://speakerdeck.com/jrf/the-secret-to-mastering-wordpress-multi-site-php-world?slide=27

It might be worth having a sniff to check for usage of register_activation_hook() and warn against it.

@jrfnl jrfnl added the Focus: WP interoperability Doing things the WP way, prefer using WP functionality over userland/PHP native label Apr 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Focus: WP interoperability Doing things the WP way, prefer using WP functionality over userland/PHP native
Projects
None yet
Development

No branches or pull requests

1 participant