Repository navigation
Commit 56d0189
Run the coding standards, and fix what they found
These four ran php -l and the test suite in CI and nothing else, so the
WordPress sniffs had never been applied. Adding phpcs surfaced real defects,
not just formatting:
clear_cache() deleted the _transient_<prefix>_* option rows with a raw DELETE.
The matching _transient_timeout_<prefix>_* rows do not carry that prefix, so
the LIKE never saw them and every cached lookup orphaned one options row,
permanently. It now selects the names and calls delete_transient(), which
removes both halves, fires the delete_transient_* hooks, and clears the entry
from an external object cache. The same copy-pasted bug was in wp-ipinfo,
wp-ipqualityscore and wp-proxycheck.
wp-ipqualityscore also forwarded $_SERVER['HTTP_USER_AGENT'] and
HTTP_ACCEPT_LANGUAGE straight into the outbound query. WordPress slashes the
superglobals, so a header containing a quote was reported to IPQualityScore
with a backslash the visitor never sent; it is now unslashed and sanitised.
Its date range used date() rather than gmdate(), so a site running ahead of
UTC asked for a range ending tomorrow.
in_array() calls now pass $strict. A __() call built its message by
interpolating a variable into the msgid, which cannot be translated at all;
that value moved into a placeholder. Translator comments added throughout,
and placeholders ordered where there is more than one.
Parameters named after reserved keywords are renamed the way core renamed
them ($default -> $default_value).
The abstract private method in email-blocklist's CustomLists trait is
suppressed rather than changed: private abstract is illegal on a class but
legal in a trait, and the sniff does not distinguish the two. Verified it
runs on 8.5 before suppressing.
CI now runs composer lint and composer format:check alongside the tests.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tk8y5eZa3CHVVSM6nVxsJw1 parent 5d0814b commit 56d0189
18 files changed
Lines changed: 4105 additions & 1121 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
39 | 47 | | |
40 | 48 | | |
41 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
| |||
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
45 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
46 | 52 | | |
47 | 53 | | |
48 | 54 | | |
49 | 55 | | |
50 | 56 | | |
51 | 57 | | |
52 | 58 | | |
53 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
54 | 63 | | |
55 | 64 | | |
0 commit comments