Warn about using `register_activation_hook` ?
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by reading the linked discussion and the two Speaker Deck slides to understand the multisite concern and the recommended version-based pattern. Then inspect existing WordPress Coding Standards sniffs for how warnings are defined; done means a sniff detects register_activation_hook() usage and reports an actionable warning.
Written by the indexing model from the issue text.
Description
Inspired by this discussion: https://github.com/TGMPA/TGM-Plugin-Activation/issues/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.
- Dominant language
- PHP
- Stars
- 2.8k
- Forks
- 521
- Avg merge
- 5d 20h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from WordPress/WordPress-Coding-Standards
-
Component: Core Focus: DB Type: Bug
Difficulty 2/5 Half a day Newbie friendliness 68/100
WordPress/WordPress-Coding-Standards#2720 · 1 comment ·
-
Component: Extra Type: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
WordPress/WordPress-Coding-Standards#2516 · 3 comments ·
-
WordPress.Security.EscapeOutput: Wiki misses hint about lower case entry for customEscapingFunctions Open
Difficulty 1/5 Under an hour Newbie friendliness 62/100
WordPress/WordPress-Coding-Standards#2508 · 3 comments ·
-
Status: Good first issue Status: Help wanted Type: Documentation
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
WordPress/WordPress-Coding-Standards#1722 · 15 comments ·
-
Component: Helpers Priority: Low Type: Bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
All issues in WordPress/WordPress-Coding-Standards
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
getgrav/grav-plugin-api#45 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
RSS-Bridge/rss-bridge#5098 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
phingofficial/phing#2025 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
silverstripe/developer-docs#911 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100