Add check for register_uninstall_hook
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 42/100
Rechercherichtung
Beginne damit, die vorhandenen PHP_CodeSniffer-Sniffs und -Tests zum Erkennen von Funktionsaufrufen zu finden, und verwende dann das Beispiel register_uninstall_hook in diesem Issue als Einstiegspunkt. Als erledigt gilt die Aufgabe, wenn Aufrufe von register_uninstall_hook als Fehler gemeldet werden und im Issue keine Fälle mit False Positives identifiziert wurden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
What problem would the enhancement address for VIP?
Because the contents of /wp-content/plugins and /wp-content/themes are setup as read-only directories on the VIP Go platform, admin users cannot uninstall plugins from within the wp-admin. This results in the function register_uninstall_hook never being able to run.
A VIP customer can deactivate a plugin through the admin, but uninstallation can only be done by removing the plugin from the GitHub repo and deploying the changes. If a customer needs to run any clean-up steps associated with a plugin or theme's use of register_uninstall_hook, their development team has to reverse engineer the code to execute any functionality that needs to run.
This is not entirely unique to VIP, but only impacts WordPress environments where the /wp-content/plugins and /wp-content/themes are read-only, so it may not be a good fit for the WordPress Coding Standards.
Describe the solution you'd like
A sniff that will flag places where the register_uninstall_hook function is used. Preferably as an error because it is functionality that will not work.
What code should be reported as a violation?
register_uninstall_hook( __FILE__, 'your_prefix_uninstall' );
What code should not be reported as a violation?
I'm unaware of cases where this might be detected as a false positive.
Additional context
None applicable
- Vorherrschende Sprache
- PHP
- Sterne
- 261
- Forks
- 44
- Ø Merge
- 3 T. 9 Std.
- Gemergte PRs (30 T.)
- 10
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus Automattic/VIP-Coding-Standards
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 48/100
Automattic/VIP-Coding-Standards#876 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Breaking Change Type: Maintenance
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
Automattic/VIP-Coding-Standards#849 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
Automattic/VIP-Coding-Standards#832 ·
Maintainer antworten meist innerhalb von 1 Tag
-
WordPress.WP.AlternativeFunctions.file_system_operations error messages cannot be fixed anymoreOffen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 48/100
Automattic/VIP-Coding-Standards#823 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Status: Awaiting feedback
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 45/100
Automattic/VIP-Coding-Standards#754 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in Automattic/VIP-Coding-Standards
Ähnliche Issues
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
MagnaCapax/PMSS#1206 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
backdrop-contrib/print#58 ·
-
`openssl_pkcs7_read()` / `openssl_cms_read()`: CRLs overwrite certificates in the output arrayOffenBug Status: Needs Triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Maintainer antworten meist innerhalb von 1 Tag