Network and servers
What the server needs to talk to w-pencil.cloud, one address for the site and its admin, page caches, proxies, several web servers, what WP-Cron does and the Site Health checks.
5 min read WordPress 6.6+ Updated 1 Dec 2026
What the server needs
- Outbound HTTPS from your server to
w-pencil.cloud. Nothing needs to reach your site from outside: w-pencil.cloud never calls it, and connecting goes through the admin's browser. When no browser of yours can reach the site's admin, paste a site key instead. - PHP 8.1 or newer. Requests are signed with PHP's sodium extension, or with sodium_compat, which comes with WordPress, when the extension is off.
W-Pencil calls https://w-pencil.cloud/api/v1/ with WordPress's HTTP API. Each call waits 3 seconds at most, redirects aren't followed, and the user agent names only W-Pencil, not your site. To check the way out, run this on the server:
$ curl https://w-pencil.cloud/api/v1/health
{"ok":true,"time":1795689000}The site never waits for w-pencil.cloud during a save. If it can't reach it, editing carries on with offline edits.
Updates come from w-pencil.cloud too, not wordpress.org: the zip from https://w-pencil.cloud/download/, checked against a signed manifest. WP-CLI commands covers updating.
One address for the site and its admin
Editors' popups talk to wp-admin/admin-ajax.php, and More fields… opens a page of wp-admin in a frame. Browsers only allow both on the page's own origin, so the site and its admin must share one scheme, host and port: Settings › General, WordPress Address and Site Address. Site Health warns when they don't.
If a firewall, a security plugin or password protection sits in front of wp-admin, let signed-in editors reach admin-ajax.php and admin.php?page=w-pencil-frame. The routes are listed in The plugin and the cloud.
Page caches
Editors' pages carry markers and the editor, so they must never be cached or shown to anyone else. W-Pencil sends them with nocache_headers() and defines DONOTCACHEPAGE, which WordPress's page cache plugins respect.
A cache that works outside WordPress, like a server cache, a CDN or a host's own cache, must pass requests with a wordpress_logged_in_ cookie through to WordPress. Most hosts do this already. If editors get no toolbar while a cache is on, it is the first thing to check.
Visitors' pages are untouched: they have no markers, load no W-Pencil files, and cache as before.
Through a proxy
W-Pencil uses WordPress's HTTP API, so WordPress's proxy constants apply. In wp-config.php:
define( 'WP_PROXY_HOST', 'proxy.example.org' );
define( 'WP_PROXY_PORT', '8080' );Behind a load balancer or CDN
W-Pencil reads the scheme and host of each request. They are the origin the site connects from, and they tell the live site from a local one or a copy. So WordPress must see the address editors use:
- HTTPS ended by a proxy: make sure WordPress sees
https, for example with$_SERVER['HTTPS'] = 'on'inwp-config.phpwhen the proxy sendsX-Forwarded-Proto: https. Otherwise the site connects ashttp://, and the consent page warns "Not HTTPS". - One host: connect from the host editors use.
www.example.organdexample.orgare different hosts: edits on the other one are taken for a copy's, so they aren't counted and admins see "This site looks like a copy of example.org".
Several web servers
Everything W-Pencil keeps is in the database, so web servers that share it share W-Pencil:
- The connection, in the
w_pencil_connectionoption: the site's ID, origin, account and key fingerprint. The private key too, unlessW_PENCIL_KEYgives it. - The allowance and the reports waiting to go, in the
wp_w_pencil_leaseandwp_w_pencil_outboxtables (with your table prefix). - Free Undo: each editor's last save of each item, in transients, for 10 minutes. With a persistent object cache, every server must share it.
Spending a credit is one UPDATE, so two servers never spend the same one. Talking to w-pencil.cloud takes a database lock without waiting, so one server does it at a time. And a new allowance asked for after the same one is the same allowance, so servers that ask at once get one between them.
If you keep the signing key in wp-config.php, give every server the same W_PENCIL_KEY: a server without it can't sign. The signing key and copies has more.
What WP-Cron does
After a save, when a report or a new allowance is due, the editor's browser sends a background request to admin-ajax.php?action=w_pencil_sync. Opening a popup on a used-up allowance asks too. WP-Cron does the same every hour (the w_pencil_sync event), in case no browser did:
- it reports the last saves of a quiet day;
- it notices that w-pencil.cloud is back after an outage, and clears the admins' "Can't reach W-Pencil" notice.
A daily event, w_pencil_purge, deletes activity older than 90 days and uploads nobody used within a day.
With DISABLE_WP_CRON, run the due events from the server's own cron, as for any WordPress site:
$ wp cron event run --due-nowWithout cron nothing breaks, but saves wait for the next editor's save to be reported.
Site Health
Tools › Site Health has W-Pencil's checks, each with a W-Pencil badge:
- W-Pencil signing: the sodium extension signs requests, or sodium_compat does, a little slower.
- W-Pencil's tables: they exist and use InnoDB, so a save and its credit are written in one transaction.
- W-Pencil: front end and admin: both share one address.
- W-Pencil sync: WP-Cron runs the hourly sync.
- W-Pencil's key: where the private key is kept, and whether
W_PENCIL_KEYis a valid key. - W-Pencil cloud: this server can reach w-pencil.cloud. It runs in the background when the page opens.
Two test constants. W_PENCIL_CLOUD_URL and W_PENCIL_FORCE_METERING are only honoured on local development hosts. A live site always talks to https://w-pencil.cloud and always counts. wp-config constants.