Repository navigation
Expand file tree
/
Copy pathreadme.txt
More file actions
177 lines (140 loc) · 59.3 KB
/
Copy pathreadme.txt
File metadata and controls
177 lines (140 loc) · 59.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
=== ovos codesafe ===
Contributors: ovos
Tags: security, firewall, virtual patching, vulnerability, error monitoring
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.3
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
From the first threat to the verified patch: a request-side shield for the vulnerabilities you run, the attacks on your site, a read-only scan for files nobody shipped, and the errors in your code — in your own ovos codesafe.
== Description ==
This plugin connects your WordPress site to [ovos codesafe](https://ovos.github.io/codesafe/), which works around the clock, end to end: it detects the attacks on your site and the errors in your code, shields against the attack pattern while the fix ships, and proves the fix held. Built for a time when AI writes the exploits. You get your own codesafe instance, not a shared tenancy: run for you by ovos in Vienna, or set up on your own infrastructure for larger organisations. The plugin itself is free and GPL-licensed.
**Up to half of what a public WordPress site reports is not a bug.** It is automated traffic looking for a way in — `/wp-login.php`, `/wp-includes/ID3/file.php`, and a long tail of random filenames probing for a backdoor someone else already installed. On our own instances, not-found probes and refused logins are around 45–50% of everything reported. codesafe counts those apart from real errors so they never drown your bug list, folds them into attack waves by the address behind them, matches your installed plugins against a public vulnerability feed — so "vulnerable **and** being probed" is something you can see rather than guess — and, for a CVE with no patch out yet, drafts the exploit's request shape from the fix and lets this plugin shield the site until the update lands.
See it working first: the [live demo](https://codesafe-demo.ovos.at/) is a public instance filled with synthetic errors, no login required.
What the plugin sends — every feature starts on, codesafe's project switches decide what it takes, and a box on the settings page (or a constant) switches one off for this site:
* **PHP errors** — warnings, notices and fatals (uncaught exceptions included) are batched and posted once per request from the shutdown handler, after the response went out. Reporting never blocks or breaks the site: every failure is swallowed, the HTTP call has a hard 1 s timeout.
* **JavaScript errors** — the bundled browser client captures window errors, unhandled rejections and failed fetch/XHR calls, with breadcrumbs and a masked DOM snapshot (replay-lite: input values and scripts stripped in the browser, the page's text included — untick it where that is too much). Same-origin calls carry a W3C traceparent header, so a failed browser request and the PHP error behind it share one trace id in codesafe. Reports carry automation evidence, zero-config: a `webdriver` admission (headless browsers, AI agents) and the external scripts the visitor never even attempted to load — the signature of bots that run inline JS without loading script files. codesafe indexes both as `flags`, so bot-caused issues facet and filter apart from real-user ones.
* **Context** — request variables (redacted before sending), logged-in user id, WordPress version, active theme, and source attribution: each error is tagged with the component its file belongs to — a plugin, a mu-plugin, a theme, a drop-in, WordPress core — or with nobody, when the file is under `uploads` or standing in the site and shipped by no one.
* **Not-found requests** — pages, REST routes and admin-ajax actions this site does not have, as access events apart from errors (30 a minute, static assets ignored): codesafe folds them into attack waves and reads which plugin a scanner is hunting — a route under a namespace this site has not registered, an ajax action nobody handles. Rides the Report 404s switch.
* **Traffic rollups** — anonymous per-minute request counters: totals split by response status, HTTP method, the page type WordPress resolved (front page, post type, archive, search, login, admin, REST per namespace, admin-ajax per registered action) and logged-in state. Never URLs, IPs or visitor data. They give codesafe a denominator, so error and scanner-probe counts read as rates against real traffic — a request answered 404 counts only as "matched nothing", which is exactly the probe signal. Requires the APCu PHP extension (counters accumulate in shared memory, one small POST per minute of traffic; without APCu the feature is silently inert). On by default here (untick it under Settings → ovos codesafe, or set `CODESAFE_ROLLUPS` to false); codesafe takes the counters only while the project's rollups switch is on — either switch off keeps it inert, and a project that refuses them is asked again only once an hour. Requests served by a page-cache plugin before WordPress boots are not counted.
* **Security events** — what WordPress *refused*, beside what broke: failed logins from any door (wp-login form, XML-RPC, application passwords — the username is masked to every fourth character, the rest starred: marcin -> m***i*, and past 24 characters the mask states the real length in brackets, so an oversized login shows as what it is; a login typed as an e-mail address travels as written, for codesafe to mask and keep encrypted), rejected nonce checks (the CSRF signal), REST calls answered 401/403 (permission probing), and sensitive admin changes worth an audit trail — user creation (an account an administrator creates, a sign-up given more than the site's default role, or any sign-up while that role can write posts; an ordinary sign-up is routine and not reported) and role grants, plugin installs and activations, changes to the signup, site-URL and admin-e-mail options, saves from the theme/plugin file editor (by an account WordPress lets edit those files; anyone else's attempt is reported as a refusal), application passwords minted for administrators. It also reports the one login that *succeeded after recent failures* (`auth_success`, with the failure counts) — the credential-stuffing success; clean logins are never reported. They arrive in codesafe as `security` events, grouped apart from errors and accepted independently of the project's severity threshold. The refusals are informational and feed codesafe's attack detection; a login that succeeded after failures and a sensitive admin change become issues, and codesafe's default rules page for the ones that matter — five or more failures before a success, a known attacker's address, a theme install through the admin, a file-editor save, a new application password. Each kind of refusal is capped at 30 reports per minute, so an attack cannot flood its own report channel nor silence another kind, and what goes over a cap is sent as one summary with the count when the minute ends; the sensitive admin changes are never capped. On by default (untick it under Settings → ovos codesafe, or set `CODESAFE_SECURITY_EVENTS` to false).
* **Software inventory** — the installed plugin/theme list with versions (plus WordPress core and PHP versions), reported once a day and after installs, updates or (de)activations, so codesafe can match it against the public vulnerability feeds and show CVE findings on its SECURITY view — including whether the vulnerable path is already being probed. Per entry: type, slug, version, display name, active flag, and for plugins and themes the newest version WordPress's own update check knows and whether it auto-updates — what codesafe's SOFTWARE list shows; never paths, options or user data. On whenever the plugin is connected: the Shield's rules are drafted from these findings. `CODESAFE_INVENTORY` set to false keeps it on the site; codesafe stores nothing while the project's CVE switch is off.
* **Auto-update on codesafe's word** — when codesafe names an installed plugin as vulnerable *and* already being probed (with the project's Auto-update switch on), or an operator picks a plugin or theme on the project's SOFTWARE list, the plugin switches on WordPress' own automatic update for exactly that one — the one virtual patch WordPress supports natively — and reports the switch-on as a security event naming why. An operator's TURN OFF switches it off again — that entry alone, reported the same way. Nothing is downgraded, deactivated or deleted; WordPress updates on its own schedule, twice a day. Needs the software inventory.
* **The Shield** — on whenever the plugin is connected: it pulls this site's exploit rules from codesafe every five minutes — the request shapes of the CVEs the software inventory matched, drafted automatically from each fix or advisory and tested against real traffic — and matches every request against them at `plugins_loaded`, before WordPress runs. A match of an observing rule is reported as a security event (`shield_observe`: the rule, the CVE, the matched fragment capped at 200 bytes — none where a secret could be it, and scrubbed of secrets as an error message is) and nothing is blocked; a blocking rule answers 403, reported as `shield_block`. codesafe decides which rules may block: the project's Shield switch (block, observe or off) and each rule's mode; a rule can be switched off on one project alone. What is read per request: path and query, user agent, address, and the body only while a body rule is live (form fields as `name=value` lines, other bodies capped at 64 KB); nothing of it is kept. A request carrying a login cookie, whose user only WordPress can name, is refused before the other plugins load only by a rule that refuses whoever asks, and judged whole at `plugins_loaded`. A JSON body past 1 MiB, more than the Shield decodes, is refused on the handler a blocking virtual patch pins. The rules are cached in APCu and in a file under `wp-content/ovos-codesafe/` whose name is drawn at random (`shield-<24 hex>.json`), behind a deny `.htaccess`, a codesafe silent for a day lifts them, a rule exists only while a live CVE finding on this site justifies it, and everything fails open. codesafe watches every blocking rule and switches one back to observe when it refuses the site's real visitors (see *Is blocking safe?*). On the site, `CODESAFE_SHIELD_DETECT` and `CODESAFE_SHIELD_ENFORCE` set to false switch detection or blocking off, and `CODESAFE_SHIELD_KILL` switches the whole Shield off with no network. A Shield status line on the settings page says what the site holds.
* **Integrity scan (a weekly background pass, and a Scan now button)** — the static half of finding the file nobody shipped. Every other sensor needs the foreign file to *do* something after the plugin is installed: throw an error, be saved through the editor, be activated. A webshell dropped before the plugin arrived, used once and left behind, does none of that — so the scan asks the tree directly, in a read-only walk: PHP under uploads (`x.php`, and `shell.php.jpg`), media files that open with a PHP tag (the `favicon_a1b2.ico` family), PHP in the document root that WordPress did not ship, hidden PHP, `.htaccess` / `.user.ini` / `php.ini` directives that make other files execute (`auto_prepend_file`, `AddHandler … .jpg`, `SetHandler`, `engine on` under uploads) or send visitors to another host, drop-ins and plugin data directories whose plugin is not installed, and the live `auto_prepend_file` of the PHP configuration itself — plus the hardening posture the removal advice depends on (file editor, file modifications, debug display, PHP denied under uploads, world-writable uploads, world-readable `wp-config.php`, XML-RPC, open registration, version control in the document root). Findings are paths, sizes and dates, never a file's content; nothing is ever deleted or changed. The **Scan now** button under Settings → ovos codesafe answers within seconds on that same page, codesafe or not; the background pass (`Integrity scan`, or `CODESAFE_SCAN`) spends half a second per request after the response went out, one full pass per interval (`CODESAFE_SCAN_INTERVAL`, days: 1 or 7), no WP-Cron, no APCu. Completed reports go to codesafe's SECURITY view. The known false positives are held down by rule — the `index.php` stubs plugins write into uploads (judged by PHP's own tokenizer, so code dressed as a stub is not one), WordPress' own `.l10n.php` translations, dotfile tool configs inside vendored packages, Wordfence's `wordfence-waf.php` and AIOS's `aios-bootstrap.php`, managed hosts' drop-ins carrying a vendor header, the data files plugins keep under PHP names (Ultimate Addons' icon sets, files that stop at an `exit` or `__halt_compiler()`), wp.org plugin files listed under more than one md5, and this plugin's own store and mu-plugin, which are verified against what the plugin writes instead. A finding is a place to look, not a verdict.
Configuration lives under Settings → ovos codesafe, or in wp-config.php via `CODESAFE_*` constants (which lock the corresponding UI field — handy for deploy-time configuration):
`define('CODESAFE_ENABLED', true);`
`define('CODESAFE_URL', 'https://codesafe.example');`
`define('CODESAFE_API_KEY', '...');`
`define('CODESAFE_JS_KEY', '...');`
For a codesafe instance behind a self-signed certificate (intranet setups), TLS verification of the ingest call can be disabled:
`add_filter('ovos_codesafe_sslverify', '__return_false');`
The integrity scan's checksum lists come from wordpress.org over TLS; behind a proxy that re-signs traffic, that verification has its own switch:
`add_filter('ovos_codesafe_sslverify_wporg', '__return_false');`
Manual captures from theme or plugin code:
`ovos_codesafe()->captureException($e, ['orderId' => 7]);`
`ovos_codesafe()->captureMessage('checkout step skipped', 4);`
== Installation ==
The plugin is distributed as a release zip from its [GitHub repository](https://github.com/ovos/codesafe-client-wordpress) and updates itself from there afterwards.
1. Download `ovos-codesafe.zip` from the [latest release](https://github.com/ovos/codesafe-client-wordpress/releases/latest) and install it under Plugins → Add New Plugin → Upload Plugin, or install it with WP-CLI:
`wp plugin install https://github.com/ovos/codesafe-client-wordpress/releases/latest/download/ovos-codesafe.zip --activate`
2. Activate the plugin.
3. Under Settings → ovos codesafe, type your codesafe address and press Connect: sign in to codesafe, pick this site's project, and the URL and both keys arrive by themselves — reporting is enabled and a test error is sent. (Or paste the project's keys into the fields below and enable reporting by hand.)
The plugin keeps itself current: its `Update URI` header points WordPress core's own update flow at this repository's GitHub releases, so new versions appear under Dashboard → Updates and install like any directory plugin — including unattended, via the plugin's "Enable auto-updates" toggle (`wp plugin auto-updates enable ovos-codesafe`). No updater plugin and no license key involved; a failed check simply means "no update visible right now". Every release is signed (Ed25519) and the plugin verifies the signature before WordPress installs a byte — a package that does not verify is refused, and a release without a signature is not offered at all.
== Frequently Asked Questions ==
= Which settings should I turn on? =
The Shield and the software inventory have no box: they run whenever the plugin is connected, and codesafe decides which rules block. For a public site turn on **Enabled**, **Report 404s**, **Security events**, the **Integrity scan** (weekly) and **Report JavaScript errors** with the project's JS key — none of these blocks anything or changes the site. **Traffic rollups** too when your server has APCu: codesafe reads them to tell a rule that refuses real visitors. **Auto-update on codesafe's word** acts only when codesafe names a plugin or theme — untick it on a site whose plugins are updated by a release pipeline. Every switch says exactly what it sends.
= Do I need APCu? =
Only for **Traffic rollups**: the per-minute counters live in APCu's shared memory, and without it that one switch collects nothing (and says nothing — it is a deliberate no-op). The settings page tells you whether APCu is available right above the switch. Everything else works without it; the Shield keeps its rules in a file and only its per-rule hit counters need APCu. Your host enables the `apcu` PHP extension for the web server — the CLI's `php -m` does not count.
= Does the plugin slow the site? =
No. Every report is sent from the shutdown handler after the response went out, with a hard timeout, and every failure is swallowed. The Shield's match runs before WordPress with a bounded grammar and fails open; the integrity scan spends half a second per request after the response; the rollups cost one shared-memory increment per request.
= Is blocking safe? =
codesafe blocks only what it can tell apart from honest traffic. A rule blocks at once only when two independent drafts of it agree on the request it targets and it is guarded the way the fix guards it: a capability every administrator holds, or for a forged request a nonce. Every other rule observes first and reports what it would have blocked. codesafe watches every blocking rule. One that refuses a share of the site's real visitors is switched back to observe automatically; one that refuses logged-in users or addresses with no attack history raises an alarm for a person. In codesafe a rule can be set to observe or off, for this site alone or everywhere, and the project's whole Shield to observe or off; the site follows with its next report. On the server, `CODESAFE_SHIELD_ENFORCE` set to false stops all blocking at the next request, and `CODESAFE_SHIELD_KILL` the whole Shield.
= What leaves the site? =
Errors with their request context, redacted first: credentials, nonces, card and bank fields and password-reset keys dropped by field name, the request body parsed and cleaned (or off). E-mail addresses and usernames travel as written: codesafe masks them on arrival and keeps the original encrypted for an audited reveal — except a login name inside a failed-login line, which is masked here. Counters, never URLs or visitor data, for the rollups. The installed software list (versions, never paths or options) when you opt in. File paths, sizes, dates and the line a finding stands on from the scan, never content. The matched fragment of a request the Shield flagged, capped at 200 bytes — none where a secret could be it (any cookie, a header or field named like a secret), and scrubbed of secrets as an error message is. Once a day and whenever one changes, which of the plugin's own switches are on, the site's host and the plugin's version; when a setting changes, which ones did, never their values. Nothing is ever deleted or changed on the site.
== Changelog ==
= 1.0.3 =
* **PHP under uploads cannot run where the Shield runs before WordPress.** With PHP's `auto_prepend_file` pointing at the plugin's stub, a script run from the uploads directory — whatever it is named: `.php`, `.phtml`, `.phar`, a `.jpg` behind a handler — is refused with 403 (`X-Shield-Guard: uploads`) while the Shield blocks, and reported while it only observes, as the guard for WordPress's update directories already does. The uploads directories come from WordPress itself (the main site's, a network's base, `blogs.dir` where a network still uses it) and are matched as written and as resolved; one that is empty, relative, or at or above the site's root, wp-admin, wp-includes, the content or the plugins directory is never used, so the guard cannot refuse the site itself. `define('CODESAFE_UPLOADS_GUARD', false);` switches this one guard off. A subsite's own uploads path is not covered.
* **The integrity scan sees the Shield switched off under uploads.** A `.htaccess`, `.user.ini` or `php.ini` under uploads — or above it, in wp-content or at the root — that sets `auto_prepend_file` to anything but the plugin's stub (`none`, empty, another file; quoted, split over lines or behind 64 KiB of padding as well) is `prepend_off_uploads`, urgent: it switches the guard off for every script it reaches. The file `user_ini.filename` names is read too.
* **The executed-file watch says what the guard refused.** A request the uploads guard refused is counted apart from one that ran, so codesafe's INTEGRITY ledger reads "refused by the uploads guard, no run recorded" for a file the guard kept from running, and that it ran once any request did. The finding stays urgent: the file is there, and someone knows its path.
* **No Shield pattern costs a site more than it should.** Every regular expression codesafe serves is priced by what one try at it can cost on PCRE and V8 alike — a large count beside a small one, a repeated group, a run of letters a wider count can swallow, alternatives that start alike — and refused past a fixed ceiling, as an up-to-date codesafe already refuses it before serving it. Shapes the old check let through ran for minutes on a crafted request; the slowest it admits now runs well under a second a megabyte. Where PCRE runs without its JIT a regular expression reads a long value only within a budget weighted by that price, and a value it cannot read whole counts as not read: a virtual patch holds on it.
* **Every observing rule hears the request.** The Shield judged a request until the first rule that matched, so a rule that only observed kept every rule after it from seeing that request: a virtual patch behind it never reported its match, codesafe could not set it to block on the evidence, and the rate limits skipped the request. Now every rule is judged. Each one that observes the request counts it and up to four report it, virtual patches first, and the rate limits count every request nothing refused. A block still ends the judgement and is the request's only report. Before WordPress, a full queue of reports gives up an observed one before a refusal. An older copy of the Shield's code that another plugin loads first, or files half-copied during the update, leave a held request judged as before.
* **A page on another site cannot get a visitor's address listed.** Reports now carry the browser's Fetch Metadata headers (`Sec-Fetch-Site`, `Sec-Fetch-Mode`, `Sec-Fetch-Dest`, `Sec-Fetch-User`), so codesafe can tell a request a page or an e-mail elsewhere made a visitor's browser send — an image, a script, a frame — from one the visitor or a scanner sent. Such a request never puts the visitor's address on a threat list. The headers say how the browser sent the request and hold nothing about the visitor.
* **On updating.** A site whose before-WordPress layer blocks starts refusing PHP run from its uploads directory at the next request. If something on the site really runs PHP from there, add `define('CODESAFE_UPLOADS_GUARD', false);` to wp-config.php before updating. Every other setting, constant and switch means what it did in 1.0.2.
= 1.0.2 =
* **Security fix: a forged login cookie no longer carries an exploit past the early Shield.** Any cookie named `wordpress_logged_in_*` — `wordpress_logged_in_x=1` was enough — made the before-WordPress layer and the must-use plugin leave the request to `plugins_loaded`, refusing it early only on a rule for anyone, so a virtual patch for anonymous visitors was asked only after every must-use plugin, drop-in and plugin file had run. The must-use stage now checks the cookie as WordPress will: this site's cookie name, the expiry, the account, the HMAC under the account's password fragment and the `logged_in` salt, and the session token. A cookie that fails signs no one in, and the request is judged there whole, as anonymous; one that passes waits for `plugins_loaded` as before. The check runs where the plugin has seen that WordPress' own code decides the same way (core's cookie functions, no salt or session-token filter, no sample salt); elsewhere the request waits as it did. The admin pages' auth cookie is not consulted.
* **Security fix: a forged `Authorization` header no longer reads as a signed-in caller.** Every XML-RPC call, and every REST request with an `Authorization` header other than Basic, was judged as a caller who may be signed in. codesafe counts such a match as a signed-in one, holds a virtual patch back from blocking on it and raises an urgent row for a signed-in refusal, so one probe with `Authorization: Bearer x` could keep any rule observing on every site it was served to. A REST request whose caller is unknown is now judged once every authentication method has run (the last `rest_authentication_errors` callback), as the user WordPress settled on — a junk token is the anonymous visitor WordPress serves; until then only a rule for anyone refuses it. XML-RPC is judged at `xmlrpc_call`, after the method's login; a call that never gets there is settled at shutdown and only observed. A plugin that signs its users in later still (in a `permission_callback` or on `rest_pre_dispatch`) is read as anonymous.
* **Security fix: a planted ruleset no longer switches the Shield off.** The Shield took the record in its store — the rule file under `wp-content/ovos-codesafe/` and its APCu copy — as codesafe's word whoever wrote it, so a record planted in the file, or in an APCu pool another site on the server shares, could switch the Shield off, and codesafe's 304 renewed it. The ruleset is now sealed with an HMAC under a key derived from the API key, and a record not sealed under it, or pulled for another platform, is refused. The before-WordPress layer reads the seal key from its consent file, never the API key; the settings page warns when that file could not be rewritten. Code that runs as the web server's own user can still read the key, and `docs/FEATURES.md` says what the seal stops and what it does not.
* **Security fix: a site cut off from codesafe keeps its blocking rules.** A ruleset 24 hours without a good pull lifted whole, so whoever kept a site from reaching codesafe for a day switched its Shield off. Past the 24 hours the Shield now keeps every blocking rule until that rule's own expiry, lets only what observes lapse, and pulls on every request until codesafe answers; codesafe refusing the key (a 401: the key rotated, the project switched off or deleted) still lifts every rule at once. The ruleset is always kept on disk — in the store, or in a folder of its own in the temp directory where the store cannot be written — since APCu alone loses it to an idle eviction.
* **Security fix: the Shield reads more of a request before it lets one through.** An upload was read for its first 64 KiB and last 4 KiB, so an exploit in the middle of a larger file passed a virtual patch on its content; uploads are now read whole, within 16 MiB a request. A regular expression PCRE gave up on (its backtracking limit) read as no match, so a request padded to exhaust it passed; it now counts as not read — a virtual patch holds on it, a match rule observes. Padding past a read cap no longer turns a blocking virtual patch into an observe, whatever the number of rules. XML-RPC parameters are a target, read as WordPress reads them, so codesafe serves this plugin its XML-RPC rules (`wordpress-xmlrpc` in `X-Shield-Platforms`), and a form body on PUT, PATCH or DELETE and a method the REST server overrides are read as WordPress reads them.
* **No rule is lost silently.** A rule that throws costs that rule alone; before, it let the request pass every rule. A ruleset cut at the Shield's caps names what it left out: the ids are kept in the sealed store record and sent to codesafe as `X-Shield-Dropped`. The rules that block are judged first.
* **Security fix: the integrity scan reads the places an intruder could live unseen.** Since 1.0.0 the scan judged themes and plugins only against wordpress.org's checksum lists — a theme, a premium or custom plugin, a must-use plugin or a drop-in was never read — and it never read `wp-config.php`, skipped `wp-content/cache` whole, walked only the first level of the document root, read published posts only, passed any cron hook something listened to, and left out every option named `ovos_codesafe*`. Each of these is read now. **After updating, press *Scan now* under Settings → ovos codesafe**: the first pass may report what stood there before.
* **The scan reads code no checksum list covers.** Every such PHP file — themes, premium and custom plugins, must-use plugins at any depth, drop-ins, the root, the cache, core when its list is unavailable — is read with PHP's tokenizer, up to 4 MiB (`oversize_php`, info, past that), for three shapes: `request_exec` (request input run as code, a command or a function; urgent, high where a sanitizer or a cast wraps it), `include_foreign` (an include of a remote or stream URL, of a file under uploads or a temp directory, of a media file) and `eval_chain` (a decoder's output run). `asset_php` (high) is PHP that runs on a direct request inside a package's images, css, fonts or languages folder, `mimic_core` (high) a core `wp-*.php` name where no WordPress stands. Read over 60 wordpress.org plugins as if they had no list, 13 themes, WP Rocket, Sage, Timber and _s, these raise nothing.
* **wp-config.php, the cache and the root's subfolders.** `wp-config.php` is read on every pass. `wp-content/cache` is walked (16 levels, 50 000 names a pass; `cache_php`, high, for code that runs from it — what W3 Total Cache, WP Super Cache, LiteSpeed, Breeze, Docket Cache, Autoptimize and the template compilers write there stays silent), and so are the document root's subfolders (6 levels, 20 000 names; `.git` and `node_modules` left out). A walk that stops at its bound resumes there on the next pass and reads again the files it reported before, so a report still carries every finding it knows.
* **Posts, cron and options.** Posts are read in every status a person or a renderer reaches: drafts, pending, private and scheduled, reusable blocks and navigation too. A cron hook's listener is traced to where it lives: `cron_listener_foreign` outside every installed plugin and theme (urgent from uploads, the cache or eval'd code), `cron_listener_builtin` for PHP's own functions. The option check leaves out only the plugin's own options.
* **One file cannot stop the scan.** A file that kills a scan chunk is named `scan_crash` (high) and skipped on the next one, and a chunk keeps to its deadline between files. Each area says how many findings the 200-finding cap left out of it, so codesafe judges what is gone area by area. A finding path with a `..` segment — a cron hook or an option named so — no longer makes codesafe refuse the whole report: the segment is sent as `%2E%2E`.
* **A time stored ahead of the clock no longer freezes a guard.** Whoever could write the options table could plant a future time and silence a guard for good, with no trace: a security-event budget window that never closed held back every failed login, CSRF refusal and Shield block report, and a scan or executed-file lock dated ahead stopped the integrity scan and the watch's reports. A time later than the plugin itself ever writes, plus five seconds of skew, now reads as stale wherever one gates something — the budgets, the locks, the scan's cadence, the retries, the hello and the inventory's heartbeat — and the 404 budget, the update cache and the checksum cache carry their own time and expire by it.
* **A trusted-proxy range that takes in the internet is refused.** A *Trusted proxy ranges* entry wider than /8 (IPv4), /16 (IPv6) or /104 (IPv4-mapped, NAT64) — `0.0.0.0/0` and `::/0` among them — let every visitor name their own address in the proxy header. Such a range is now left out wherever it comes from: the settings form (which says so), the `CODESAFE_TRUSTED_PROXIES` constant, the stored option, the main site's value a subsite reads. Cloudflare's ranges, the private blocks and any range inside `fc00::/7` or `fe80::/10` pass.
* **The plugin tells codesafe when its own sensor changes.** Deactivating it says goodbye first (`sensor_goodbye`), activating it says hello on the next request. A change of the plugin's settings is told as `sensor_settings` — which settings changed and which switches went off or on, never a value, a URL or a key; a site pointed at another codesafe tells the old one first. The hello carries the site's host, so codesafe tells two senders on one key apart, and is said with error reporting switched off too, so codesafe reads a switch-off instead of a day of silence.
* **Traffic rollups survive an APCu eviction.** APCu can drop the rollups' sequence counter while their instance survives (an `apc.ttl` idle eviction), and the old instance then started over at 1, which codesafe took for retries and dropped. A sequence that starts over now takes a new instance.
* **codesafe, by name.** The settings page speaks of codesafe only (*codesafe connection*, *codesafe URL*, the switches' help, the Shield's lines), the executed-file watch's findings go to codesafe's INTEGRITY ledger (it was FILES), and the plugin's description leads with the Shield and the attacks. The bundled browser client is `assets/codesafe-client.js`, the same file as codesafe's own. The readme's FAQ on moving from ovos-console is gone; the move works as before.
* **On updating.** The first request after the update runs unjudged by the Shield: it refuses the old, unsealed record, writes the seal and pulls a sealed ruleset. A trusted-proxy range wider than /8 or /16 is left out, and the settings page says which. A caching plugin's exclusion that named `console-client.js` needs the new name. Every other setting, constant and switch means what it did in 1.0.1.
= 1.0.1 =
* **Security fix in the integrity scan.** Since 1.0.0 a PHP file could pass the scan as a harmless "silence is golden" stub while carrying code: PHP ends a `//` comment at a bare carriage return as well as at a newline, a `?>` inside a comment closes the PHP block and serves what follows, and a `#[` line is an attribute, not a comment. Under uploads and in wp-content subdirectories such a file was skipped without a finding. Stubs are now judged by PHP's own tokenizer. Update, then press **Scan now** under Settings → ovos codesafe: a file that slipped through before is reported on that pass.
* **Fewer false findings.** The scan verifies the plugin's own store (`wp-content/ovos-codesafe/`) and its mu-plugin against what the plugin writes instead of reporting them; a file there that differs is `store_modified` (urgent for the prepend stub and the mu-plugin). A wp.org plugin file listed under several md5s (a version wordpress.org built more than once) matches any of them instead of being called foreign. A media file is reported for a PHP opener only where PHP could compile the code after it, so the `<?=` that compressed image data happens to contain is no longer urgent. PHP that stops before any code runs (an `exit` or `__halt_compiler()` first, as AIOS and W3 Total Cache write their data) is listed as `inert_php`, Ultimate Addons' icon-set data under uploads as `uploads_php_owned`, and AIOS's `aios-bootstrap.php` in the document root as owned while AIOS is installed.
* **Cron checks on a loaded request.** The scan judges which scheduled hooks nobody listens to only on a request that loaded every plugin (WP-Cron, wp-admin or *Scan now*; any loaded request after a day), so a redirect that ends early no longer reports the hooks of active plugins as orphans. A cron row no longer carries its next run as a date.
* **The executed-file watch knows WordPress' own files under wp-content.** A scanner requesting `/wp-content/index.php` ran core's "silence is golden" guard, and the watch reported it as urgent PHP in wp-content (the guards in `plugins/` and `themes/` as info). A stub that runs no code is now recognised anywhere under wp-content, judged on the bytes as they ran — a webshell replaced by a stub after use is still reported — and a file WordPress core ships there (the guards, Hello Dolly, Akismet and the default themes at the release's versions) is checked against core's own checksum list instead of being reported. A row codesafe already lists for one of these can be acknowledged.
* **A report sent later wears its own request.** The executed-file watch's events carried the HTTP status of whichever later request sent them (a 404 or a redirect instead of the answer the file gave), and a report sent on a signed-in request could carry that visitor's account and session. The watch now records the status as the request that ran the file ends, and a report sent on a later request — the watch's, or one the Shield queued before WordPress loaded — takes nothing of the request sending it. PHP that stops before any code runs (W3 Total Cache's config, AIOS's settings) is listed as `inert_php` when it runs, as the scan lists it, instead of as urgent.
* **codesafe's own actions name no visitor.** An auto-update switched on or off at codesafe's word was reported with the request it happened to run on, so a scanner's address and URL stood on codesafe's own audit line and in that address's record. Those lines now carry no request at all.
* **Security fix: the Shield's report never carries a secret.** A rule matching a cookie, a header or a parameter named like a secret, a body holding one, or a query carrying a secret-named parameter reported the text it matched, so an administrator's session cookie or a password could reach codesafe in a Shield report. Such a report now carries no fragment, and every fragment that is sent is scrubbed of secrets as text first.
* **A ruleset that cannot harm the site.** The Shield keeps at most 25 match and rate rules, 100 virtual patches and 5 000 threat addresses, drops a match rule that would refuse an ordinary visitor or names an address range wider than /8 (IPv6 /32), and leaves an answer from codesafe larger than 2 MiB unread.
* **No Shield pattern can hang the site.** The Shield now checks every regular expression it receives the way codesafe checks it, and drops a rule whose pattern could backtrack without end (an optional or alternating group repeated many times, a nested quantifier), whichever codesafe served it. On PHP such a pattern ran into PHP's backtracking limit and the rule silently matched nothing.
* **A blocking virtual patch blocks a threat address too.** Where codesafe's threat addresses are only observed (the project observes, or blocking is off), the Shield answered a listed address's request with that observation before any rule, so a virtual patch set to block let it through and its match was never reported. The rules now judge the request first; only a request no rule decides is observed as a threat address. Where the threat addresses are blocked, they are still refused first.
* **A pattern's character class is read as one.** The Shield's pattern check took `[*+]` or `[(?=]` (a set of characters) for a possessive quantifier or a lookahead and dropped the rule; it now reads every class as the set it is.
* **A path is read as the server maps it.** `//`, `/./` and `/../` in a URL, or a path after the `.php` script that runs, no longer carry a request past a rule on its path, and the threat addresses' pass for the login page reads the script that runs.
* **Signed-in requests meet the early Shield too.** A request carrying a login cookie, or a REST request carrying Basic credentials, passed the before-WordPress layer and the must-use plugin untouched, though anyone can send a cookie by that name and a plugin's own files run before `plugins_loaded`. Both layers now judge it with its caller unknown and refuse it on a rule that refuses whoever asks (a match rule, a virtual patch for anyone); everything else waits for `plugins_loaded`, which judges the request whole, with its user.
* **The installer pages are judged before WordPress.** `wp-admin/install.php`, `upgrade.php`, `setup-config.php` and `wp-activate.php` load no plugins, so the `plugins_loaded` judge never ran there; the before-WordPress layer now judges them whole.
* **A padded JSON body no longer slips past a virtual patch.** The Shield decodes a JSON body up to 1 MiB; a larger one sent to the handler a blocking virtual patch pins is refused rather than only observed.
* **Virtual patches read the request as PHP does.** A `request:` condition also reads what PHP's `$_REQUEST` holds beside the query and the form (cookies, where `request_order` takes them in), and a `uri` rule also matches the query with every `+` read as a space, as `$_GET` reads it.
* **Smaller queue writes.** The before-WordPress layer caps what it queues of a refused request (the URL at 2 KB, the user agent, referer and host at 512 bytes each), so a flood of oversized requests cannot bloat the files it rewrites on every refusal.
* **On a multisite, network-wide features are the main site's.** A subsite's administrator could switch the inventory, the auto-update of vulnerable plugins and the integrity scan for the whole network. Those settings now take effect from the main site only, and *Scan now* runs there.
* **TURN OFF takes back only codesafe's own switch-ons.** Switching off the auto-update of vulnerable plugins also disabled auto-updates a site owner had switched on by hand for the same plugins. It now reverts only what codesafe itself switched on; a plugin codesafe switched on before this version stays on until it is switched off by hand.
* **More credentials redacted.** A passphrase, a credential, private, access, consumer, licence, encryption and signing keys, a second factor's one-time and backup codes, auth codes and CSRF values are redacted by name like passwords, in PHP and in the browser client.
* **File-editor saves need the right to edit files.** Any signed-in account could post to the file editor's endpoint, and each attempt was reported as an uncapped sensitive admin change, though WordPress refused the save. Only an account WordPress lets edit that kind of file is now reported as a `privileged_action`; anyone else's attempt is a `permission_denied`, under that kind's 30-a-minute budget.
* **A sign-up is not an admin change.** On a site with open registration, or a shop whose checkout creates customer accounts, every new account was reported as an uncapped user creation. An ordinary sign-up (made by no one who may create accounts, with no more than the site's default role grants) is now routine and not reported, like a clean login. An account above the default role, any account an administrator creates, and any sign-up while the default role can write posts are still reported.
* **The codesafe address is http(s) only.** The settings form saved an address of any scheme, and the plugin's sub-second connections handed it to curl, which also speaks gopher://, dict:// and ftp://. The form now saves only an http or https address (a private or loopback address still works), and those connections speak nothing else.
* **A partial settings save raises no notice.** An update of the settings without the scan interval saved the default but raised an undefined-key notice.
* **The documentation matches the code.** It now says the Shield's rule file is named at random (`shield-<24 hex>.json`), each kind of security event is capped at 30 a minute (the Shield's observe and block reports at 60 and 120), the matched fragment is never a secret's and is scrubbed of secrets, and a regex is PHP's PCRE, stopped by its backtracking limit.
* **REST routes and admin-ajax actions this site does not have are reported.** A request for a REST route WordPress has no handler for (`rest_no_route`, also when asked with `_envelope`) or an admin-ajax action no plugin handles (WordPress answers 400) left no report: neither surface runs the template loader the 404 reporter listened on. Both are now access events under Report 404s, with the route named under the site's REST prefix, or admin-ajax.php with its action — the one query parameter that names what was asked for — so codesafe can tell which plugin a scanner is hunting, and whether it is installed here (a route inside a registered namespace, an action that exists for signed-in users only). The same 30-a-minute budget as page 404s.
* **Traffic rollups name REST namespaces and ajax actions.** Answered REST requests count per registered namespace (`/rest/wp/v2`), admin-ajax requests per registered action (`/admin/ajax/<action>`); a request for a namespace or an action this site did not register counts as matched nothing, like a 404 page. Names come from what the site registered, never from the request; at most 40 distinct names a minute, the rest under `/rest` and `/admin/ajax`.
* **The executed-file watch names leftovers.** A file that ran inside a plugin's data directory whose plugin is not installed (`wp-content/w3tc-config/` without W3 Total Cache), or in a plugins/ directory that is no installed plugin, was reported as PHP outside any plugin or theme, or listed as a file no list vouches for. It is now `executed_leftover`, worded by the place and its owner (`in wflogs/ (wordfence, not installed)`): urgent when code ran in a data directory — the directory's name says nothing about who put the file there — high when it ran in a plugins/ directory, info when the file stops before any code runs. A file of a plugin or theme active on no site that answered a request directly is `executed_inactive` (info): WordPress does not load it, the web server still serves it; a theme registered one directory deep counts by its whole name. On a multisite network, a plugin active on any site, or network-wide, counts as active.
* **Network-active plugins read as active.** The integrity scan's protection posture and its active-plugin check read the network's `active_sitewide_plugins` from the site's own options, where it never is on a multisite network, so network-activated plugins read as inactive there.
* **The update working directories are closed before WordPress.** WordPress unpacks every update into `wp-content/upgrade/` and parks old copies in `wp-content/upgrade-temp-backup/`, where for a few seconds a staged copy can be requested over HTTP; up to WordPress 7.1.3 an anonymous request could run the staged installer there. The before-WordPress layer now refuses any PHP file run from either directory with 403 (`X-Shield-Guard: upgrade_dir`), without a rule, and reports it as a `shield_block`; where blocking is off it is observed instead.
* **A deny file in the update directories.** While WordPress unpacks an update (WordPress 6.4 and later), the plugin writes a `.htaccess` (`Require all denied`) and an `index.php` into `wp-content/upgrade/` and `upgrade-temp-backup/`, on every server but nginx, IIS and Caddy, so a site without the before-WordPress layer is covered too. It never overwrites a file it did not write; OpenLiteSpeed reads a new `.htaccess` after a restart unless its auto-load is on.
* **The prepend stub is named for what it is.** New setups point PHP's `auto_prepend_file` at `wp-content/ovos-codesafe/codesafe-shield.php`: a bare `prepend.php` reads as malware persistence to people and to scanners. A configuration that still names `prepend.php` keeps working — the plugin keeps that file current and never deletes it while installed, since another directory's configuration may still name it — and the settings page asks for the new line. The uninstall keeps every stub of ours, inert, while any configuration names one.
* **The site says which environment it is.** The inventory and the hello carry the site's environment, so codesafe keeps a developer's copy apart from production instead of letting its report replace production's; the hello also says whether PHP's prepend runs the Shield (`shield_prepend`).
* **The settings page says the Shield's coverage.** The row is *Shield coverage*: FULL where PHP's `auto_prepend_file` runs codesafe's stub before WordPress, so files WordPress never loads are judged too; BASIC where it does not, with the line to paste for FULL — the words codesafe's PROJECTS list uses.
* No configuration change.
= 1.0.0 =
* First public release: PHP and JavaScript error reporting, security events, traffic rollups, the software inventory and auto-update on codesafe's word, the integrity scan, and the Shield — match, rate and virtual-patch rules and codesafe's threat addresses, judged before the other plugins load and optionally before WordPress. Every release is signed, and the plugin verifies the signature, and that the zip carries the version the release offers, before WordPress installs an update.
* **Everything starts on.** Report 404s, Security events, Traffic rollups, Auto-update on codesafe's word, the Integrity scan, DOM snapshots and their inline styles are on by default; codesafe's project switches decide what it takes, and every box on the settings page is the site's own off. A DOM snapshot carries the page's text (input values and scripts stripped, `data-codesafe-mask` areas blanked) — untick *DOM snapshot* where that is more than you want in codesafe. A `CODESAFE_*` or `OVOS_CONSOLE_*` constant still wins.
* **WordPress core's minor releases, on codesafe's word.** The inventory says core's own update policy and why — minor and major on or off and what decided it (WordPress' default, its option, `WP_AUTO_UPDATE_CORE`, another plugin's filter), what blocks it (`DISALLOW_FILE_MODS`, `AUTOMATIC_UPDATER_DISABLED`, a version-controlled site, a failed update WordPress will not retry) and the minor release on offer — and where each plugin's and theme's updates come from (wordpress.org or the host of its own update server; an update offered without a download, commonly a licence not active, is said too). When codesafe names core — an operator's TURN ON, or a probed vulnerability with the project's AUTO-UPDATE switch — the site switches WordPress' own minor releases on: its own option where that decides, and where `WP_AUTO_UPDATE_CORE` is `false` an override that holds only while *Auto-update on codesafe's word* is ticked (the settings page says when and why, and how to end it). Never a major release, never past what blocks it, never over another plugin's filter; reported as a security event.
* **codesafe's SOFTWARE list knows what is current, and can switch auto-update on and off.** The inventory carries, per plugin and theme, the newest version WordPress's own update check knows (premium and GitHub-hosted plugins included), whether WordPress auto-updates it and whether a filter forces that, plus whether the site can auto-update at all and why not (`DISALLOW_FILE_MODS`, the updater switched off, a version-controlled plugins directory). An operator's TURN ON on the project's SOFTWARE list reaches the site within minutes — every answer codesafe gives, the Shield's five-minute check included, carries the project's software version, and a changed one sends the inventory again — and *Auto-update on codesafe's word* (the setting that also covers vulnerable and probed plugins) switches it on, for themes too, in the option WordPress's updater reads (the network's on a multisite network). An operator's TURN OFF takes it out again — that entry alone, nothing else on the list touched; for WordPress itself it withdraws codesafe's override and leaves WordPress' own setting as it is — sent as a list of its own, so a plugin that does not know it never reads it as an on. The next inventory tells codesafe it took.
* **Connect.** Type your codesafe address under Settings → ovos codesafe and press Connect: codesafe asks you to sign in and pick this site's project, and the URL and both keys arrive by themselves, reporting enabled and a test error sent — no copying keys. The keys never pass through the browser: the site trades a one-time code for them server to server, with a PKCE secret that stays on the site. Not offered while `CODESAFE_URL` or `CODESAFE_API_KEY` is defined. Needs a codesafe with the connect page.
* **Executed-file watch** on the prepend layer: with PHP's `auto_prepend_file` pointing at the plugin's stub, every PHP file the site runs that WordPress did not ship as an entry point is recorded the moment it runs — the dropped webshell, in use — with its size, md5 and the request's address, and judged on the site's next request against what wordpress.org shipped. A file nobody shipped (under uploads, in the document root, foreign or modified under core or a wp.org plugin, hidden, or already deleted again) becomes an integrity finding in codesafe — its FILES ledger, an INBOX case, the mail and chat digest, removal advice — plus one security event (`file_executed`) carrying the address that ran it. A plugin's own endpoint hit directly is judged shipped once and never recorded again; wp-admin's entries come from the core checksum list, never from a pattern. On by default while the layer is active; the *Executed-file watch* box or `CODESAFE_ENTRY_WATCH` switches it off. Read-only: nothing is blocked, deleted or changed.
* **Security events that matter stand out.** A failed login on an **administrator** account (`manage_options`, or a multisite super admin) is a WARNING: codesafe makes it an issue and alerts where the project alerts at that level, while every other wrong password stays at the kind's default. A failed login on an existing account names the account, so codesafe keeps one issue per account and can tell many accounts refused at once from one person retrying; a username no account carries stays nameless. `Sender::reportRefusal()` takes an optional priority, kept when it is more severe than the kind's default. Each kind of event has its own budget: sensitive admin changes are never held back, and what goes over a budget is sent as one summary event with the count.
* **People travel as written, secrets never.** E-mail addresses and usernames — in the request, the URL and referrer, the extra data, a WP-CLI command's arguments, a security event's or a not-found line, a Shield report — travel as written: codesafe masks them on arrival and keeps the original encrypted for an audited reveal. Passwords, tokens, keys, nonces, the reset link's `key` and `rp_key`, card fields in every gateway's spelling, account numbers and IBANs are dropped on the site — from the URL and from the request's bags, percent-encoded or inside a URL carried as a value. The one exception: a login name written into a failed-login line is masked (`m***i*`), since codesafe could not recognise a name inside a sentence; the account travels beside it.
* **Behind a proxy or CDN**, the *Trusted proxy header* and *Trusted proxy ranges* settings (`CODESAFE_TRUSTED_PROXY_HEADER`, `CODESAFE_TRUSTED_PROXIES`; `cloudflare` stands for Cloudflare's published ranges) make reports, rate rules and the prepend layer name the visitor instead of the edge.
* **The software inventory and the Shield run without asking.** There is no box to tick: codesafe's project switches decide — the project's Shield switch (block, observe or off) and each rule's mode say which rules may block, and a rule can be switched off on one project alone. A rule switched off there stops on the site with its next report, not at the next five-minute pull. On the server, `CODESAFE_INVENTORY`, `CODESAFE_SHIELD_DETECT` and `CODESAFE_SHIELD_ENFORCE` set to false are its own off, and `CODESAFE_SHIELD_KILL` stops the Shield with no network; codesafe is told when the kill switch is set.
* **The Shield judges early on every site.** While it is on, it keeps a must-use plugin (`wp-content/mu-plugins/ovos-codesafe-shield.php`) that judges an anonymous request before the other plugins load, so a vulnerability in code a plugin runs as it loads is no longer past the Shield before it is asked. Each request is judged once: with the `auto_prepend_file` layer active the must-use plugin stands aside, and a request judged early is not judged again at `plugins_loaded`. The file is removed when the Shield is off, on deactivation and on uninstall; a file of that name that is not the plugin's is never touched.
* **Virtual patches.** Beside match and rate rules, the Shield takes codesafe's virtual patches: a rule that names the vulnerable entry point, the parameter, a typed test and whom it applies to — anyone, an anonymous visitor, or a user lacking a capability — over the request as WordPress parsed it (query, form fields, cookies, headers, uploaded file names, a JSON body). Capabilities are answered with `current_user_can()` and nonces with `wp_verify_nonce()`; a nonce the early layers cannot check yet is left for WordPress to judge. A REST request is judged as the user WordPress will run it as: an application password in its Basic credentials is checked the way WordPress checks it (read-only, nothing recorded) and is that user, a login cookie without the REST nonce is anonymous. A caller WordPress signs in only later — a REST request with a token another plugin reads (Bearer, JWT, OAuth), an XML-RPC call — is judged again once WordPress has signed it in; until then a rule for anonymous visitors or a capability waits, and where the user cannot be told it only observes. A request to the REST API's batch endpoint has each request it lists judged as a request of its own.
* **Threat addresses.** The addresses codesafe saw sending exploits are refused before any rule is asked — blocked where the project's Shield blocks, observed where it observes — unless the visitor is signed in or on the way to sign in. They are counted in the traffic rollups, never reported as events.
* **The Shield's store** under `wp-content/ovos-codesafe/` is safe on any web server — every file begins with a PHP `exit`, the ruleset's name is drawn at random — and `CODESAFE_STORE_DIR` moves it outside the document root. On multisite the Shield, the executed-file watch and the trusted proxy are the main site's, set by a super admin. Deactivating the plugin switches the prepend layer off; uninstalling removes every option, transient and the store.
* **A report codesafe did not take is not lost.** When codesafe cannot be reached, or answers that it is busy (429, 502, 503, 504), the plugin posts the batch once more a second later — only after the visitor already has the page — and if that fails too it keeps the batch in APCu (at most ten batches, an hour, never into the last quarter of APCu's memory) and sends it along with its next report codesafe accepts; for half a minute after a refusal it posts nothing, so an outage never makes your pages pay a connection timeout. A report codesafe may already have — the connection timed out after it was sent — is never sent twice. Without APCu each report is posted once, as before.
* **Fast pages read as fast.** The traffic rollup's fastest duration bucket (up to 25 ms, where most requests land) is split into up to 5, 10 and 25 ms, so codesafe's PERFORMANCE panel tells a 3 ms page from a 20 ms one instead of reading ≈12.5 ms for both. Still counts only — no raw timing leaves the site.
* **A project that refuses traffic rollups is asked again once an hour.** codesafe answers 403 while the project's rollups switch is off; the site then counts and sends nothing for an hour before it asks again, and the settings page says since when under *Traffic rollups*.
* The plugin tells codesafe which of its own switches are on — the traffic rollups only where APCu lets them count — once a day and whenever one changes, so codesafe's project list shows a feature switched on there but off on this site — and the site's plugin version, even when it reports no errors.
* The bundled JavaScript client runs once per page even when it is loaded twice, sends trace headers only to the exact origins you list, records page elements and large objects logged to the console with limits (never freezing the page), and leaves the page's nonces, tokens and editable text out of snapshots.
* **A site moving from ovos-console starts on these defaults.** ovos-console saved every unticked box as off, so the settings copied from it leave those switches out; a constant still wins.
* The plugin was called ovos-console before: `ovos-codesafe` is its directory and text domain, `CODESAFE_*` its constants, `ovos_codesafe*` its options and filters. A site running ovos-console switches with one activation — see the FAQ.