Repository navigation
Commit e909ca5
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 d1e4947 commit e909ca5
22 files changed
Lines changed: 1139 additions & 109 deletions
File tree
- .github/workflows
- src
- Response
- tests
| 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 | | |
| |||
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
53 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
54 | 60 | | |
55 | 61 | | |
56 | 62 | | |
57 | 63 | | |
58 | 64 | | |
59 | 65 | | |
60 | 66 | | |
61 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
62 | 71 | | |
63 | 72 | | |
0 commit comments