You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,11 +23,11 @@ There are two main ways to contribute to the compatibility layer: reporting an i
23
23
24
24
Use this method when a plugin is incompatible and requires manual user action, or when there is no programmatic fix. These notices appear in the WordPress Site Health tool.
25
25
26
-
1.**Choose the correct category in `inc/site-health.php`:**
27
-
***`get_compatibility_manual_fixes()`**: For plugins that require specific manual configuration. The user will be told a "Manual Fix Required".
28
-
***`get_compatibility_review_fixes()`**: For plugins that are partially or fully incompatible. The user will see statuses like "Incompatible" or "Partial Compatibility".
26
+
1.**Choose the correct category in `inc/site-health.php`:**
27
+
***`get_compatibility_manual_fixes()`**: For plugins that require specific manual configuration. The user will be told a "Manual Fix Required".
28
+
***`get_compatibility_review_fixes()`**: For plugins that are partially or fully incompatible. The user will see statuses like "Incompatible" or "Partial Compatibility".
29
29
30
-
2.**Add the plugin to the appropriate function's `$plugins` array.**
30
+
2.**Add the plugin to the appropriate function's `$plugins` array.**
31
31
32
32
*Example (Adding a "Manual Fix Required" notice):*
33
33
```php
@@ -48,16 +48,16 @@ Use this method when you can fix an incompatibility with code. This involves cre
48
48
49
49
#### Understanding the Classes
50
50
51
-
* **Compatibility Class (The "When"):** This class is the trigger. It tells the system *when* to run a fix for a specific plugin. It extends `Pantheon\Compatibility\Base` and is stored in `inc/compatibility/`. Its primary job is to define the conditions for the fix (e.g., run on every page load, only on activation).
51
+
* **Compatibility Class (The "When"):** This class is the trigger. It tells the system *when* to run a fix for a specific plugin. It extends `Pantheon\Compatibility\Base` and is stored in `inc/compatibility/`. Its primary job is to define the conditions for the fix (e.g., run on every page load, only on activation).
52
52
53
-
* **Fix Class (The "What"):** This class contains the *actual code* that solves the problem (e.g., defines a constant, adds a filter). It is stored in `inc/compatibility/fixes/`. **Using a separate Fix Class is optional but highly recommended for clarity and reusability.** For very simple, one-line fixes, you can place the logic directly in the Compatibility Class. For anything more complex, or for logic that could be reused (like `DefineConstantFix`), a Fix Class is the best practice.
53
+
* **Fix Class (The "What"):** This class contains the *actual code* that solves the problem (e.g., defines a constant, adds a filter). It is stored in `inc/compatibility/fixes/`. **Using a separate Fix Class is optional but highly recommended for clarity and reusability.** For very simple, one-line fixes, you can place the logic directly in the Compatibility Class. For anything more complex, or for logic that could be reused (like `DefineConstantFix`), a Fix Class is the best practice.
54
54
55
55
#### How to Implement an Automated Fix
56
56
57
-
1. **Create the Compatibility Class (Required):**
58
-
* Create a new file in `inc/compatibility/` named `class-{plugin-name}.php`.
59
-
* The class must extend `Pantheon\Compatibility\Base`.
60
-
* You must implement the `apply_fix()` and `remove_fix()` methods, even if their bodies are empty.
57
+
1. **Create the Compatibility Class (Required):**
58
+
* Create a new file in `inc/compatibility/` named `class-{plugin-name}.php`.
59
+
* The class must extend `Pantheon\Compatibility\Base`.
60
+
* You must implement the `apply_fix()` and `remove_fix()` methods, even if their bodies are empty.
61
61
* Set a property like `$run_fix_everytime = true;` to control when the fix runs.
0 commit comments