WP2Static 6.6.5: Broken PLACEHOLDER.wpsho URLs

I have a Wordpress site that is for security reasons only accessible behind HTTP basic authentication. To make the content accessible to everyone I use the WP2Static plugin that generates a static export of all files, which can then be served without any PHP. I can sleep much better with that setup, given Wordpress' security track record.

Some time ago the export broke: All URLs (links, image and CSS references) on the site were http://PLACEHOLDER.wpsho/, and had no paths.

I traced the cause back to a URL2.php (of the Net_URL2 PEAR package) that WP2Static had copied and shipped with its source code. In it, _encodeData uses the following code:

return preg_replace_callback(
    '([\x-\x20\x22\x3C\x3E\x7F-\xFF]+)',
    array($this, '_encodeCallback'), $url
);

The problematic code is \x-\x20, which means "byte value ranging from 0x00 to 0x20". \x was once allowed, but then libpcre2 released version 10.45 in 2025-02-05 which removed support for the shorthand, requiring people to always write out the 00 after \x:

* (Minor pattern syntax change) Parsing of the \x escape is stricter, and is no longer parsed as an escape for the NUL character if not followed by '{' or a hexadecimal digit. Use \x00 instead.

The solution is to replace \x- with \x00-, and the WP2Static plugin works again.

WP2Static is dead​

At first the plugin had been removed (blog post) from the Wordpress plugin registry. The next step was version 7 of the plugin, which removed functionality and added advertisements for Strattic, because WP2Static had been bought by Strattic.

A Strattic competitor posted a bit of history about what happened: What Happened to WP2Static and Strattic? .

Written by Christian Weiske.

Comments? Please send an e-mail.