Warn about using register_activation_hook
?
#1290
Labels
Focus: WP interoperability
Doing things the WP way, prefer using WP functionality over userland/PHP native
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.The text was updated successfully, but these errors were encountered: