Repository navigation
WonderCMS 3.7.0
Features and fixes
Security, updater and stability release for the WonderCMS core (index.php, about 340 lines larger than 3.6.0's); the behaviour changes a theme, a plugin or a server setup could notice are listed under Backwards compatibility. The one-click updater now refuses an incomplete download, a theme that fails to parse or throws while loading no longer takes your site down, search finally covers subpages, themes and plugins you upload by hand show up in Settings, pages can be made private, and Sky's submenus work on phones. Every change carries its own test and was rehearsed on a fenced copy on the wondercms.com server before this release.
Changes
-
Safer one-click updates
- The downloaded
index.phpis checked before it replaces the running one: it must be a complete, parseable WonderCMS core with a newer version. An HTML error page, a rate-limit message or a truncated download is refused and your site keeps working (on the rare host without PHP's tokenizer extension the check is structural rather than a full parse). This protects every update from 3.7.0 onwards; the update to 3.7.0 itself still runs through your current version's updater, so back upindex.phpanddata/first. The new core is first written whole to a temporary file next toindex.php; if that fails (a full disk, or a disk or quota with no free inode) the update is refused with an alert,index.phpis untouched and the site keeps running (with no free inode 3.6.0 wrote in place). Then the temporary file is renamed overindex.php, keeping its owner, group and mode. Where a rename would be wrong, the temporary copy has proven the room, is removed, and the file is written in place: PHP running as a different user or group than the file's, a hard-linkedindex.php(every name of the link gets the new core), or a host that allows the write but not the replace. Only two cases still write in place with no temporary copy, exactly as 3.6.0 did, so a full disk can still truncate the file there; keep backups: a folder PHP cannot write to (including a folder that lets PHP change files but not create them, which an SELinux label or a Windows ACL can set, where the host reports it as not writable; see Bug fixes), and a host that disables one of the file functions involved. Saves ofdatabase.jsfollow the same rules (see Bug fixes). A symlinkedindex.phpis handled by the normal path: PHP works on the link's target, so the new file lands next to the target and replaces it, and the link stays. On a disk with less free space than one copy ofindex.phpthe update is refused and the site keeps running (3.6.0 overwrote in place, needing only the file's own space; with no space left at all it could leave an empty file). Because the new file is renamed over the old one, extended attributes and ACLs onindex.phpare not carried over (owner, group and mode are). If GitHub is briefly unreachable or answers with an error page, the update reports that the download was refused and nothing was changed; try again in a few minutes. One side effect: a read-onlyindex.php(mode 444) in a writable folder now updates when PHP owns it, where 3.6.0's write failed silently and still reported success; the admin clicked Update and the content comes only from the official repository. A read-onlydatabase.js(mode 444) in a writable folder is saved the same way now, by rename, and keeps its mode, when PHP owns it (its user and group), where 3.6.0's save failed silently; owned by another user or group, its save is refused with the alert. If anything goes wrong, re-uploadindex.phpfrom the ZIP. If the version shown does not change right after the update, wait a moment and reload: opcache can serve the old code briefly (on a host withopcache.validate_timestampsoff it keeps serving the old code until the cache is reset or PHP restarts). - The core download has connect and total timeouts; an update that cannot be written reports failure instead of success, and the alert says which it was: a refused download, or a file that could not be written (check free disk space and permissions). When GitHub or a module repository answers with an HTTP error, the alert names the status, for example
Cannot get content from url (HTTP 429).; a connection that fails outright keeps the old sentence.
- The downloaded
-
Update notice once a day
- While you are logged in, WonderCMS checks for a new version once a day, on the first admin page you open that day, and whenever you click "Check for updates" (3.6.0 checked only on that click). Nothing is installed automatically; you still click Update. The day's check is stamped before it runs, so a check cut short by a host time limit is not repeated on every page; it runs again the next day.
-
Security hardening
- Theme path jail: the theme setting can only point at a folder inside
themes/, including when switching themes. Custom theme folder names, including ones with dots or spaces, keep working. - Protected config keys: the generic save endpoint can no longer change the password, menu, custom modules, disabled plugins, the forced-logout flag or the login-IP log; those keep their dedicated handlers (the password change re-checks the current password).
- Deleting a file, theme or plugin refuses empty or
..names (which could remove a whole folder) and does not follow a symlink out of its folder (where the host allowsis_link(); a hardened host that disables it removes as 3.6.0 did, see Bug fixes). - Visitor requests with array parameters (
?page[]=) no longer answer HTTP 500. Custom module URLs must be http(s). Login IPs are escaped. The shipped.htaccessdeniesdata/logs/andtests/(installs made from a git clone or the Docker image carry the test folder), and all four of its deny rules now ignore case ([F,NC]), so on a case-insensitive disk (Windows, macOS)/DATABASE.JSis refused like/database.js; existing sites addRewriteRule ^data/logs/ - [F,NC]andRewriteRule ^tests/ - [F,NC]to their own.htaccessby hand, and change those two rules toRewriteRule database\.js - [F,NC]andRewriteRule cache\.json - [F,NC](escaped dots, so an upload named likeDatabase_JS_Tutorial.pdfis not refused; an upload whose name containsdatabase.jsorcache.jsonin any letter case, such asMy-Database.js, is refused, asdatabase.jsitself was before). - Thanks to Slaven Stančič for the review.
- Theme path jail: the theme setting can only point at a folder inside
-
Credits
- Slaven Stančič (security review), Almorca (hand-uploaded themes and plugins listed in Settings, #345), NorfolkGreg (search and menu reports; his GregCustom theme's menu showed the touch recipe), andre5x (reports and requests #346 to #357), hightowe (legacy subpage report and a proposed fix, #336 and #337), Joe90 (search report on the forum), James1949 (#343 report), Edward205 (Romanian translation plugin), Joaquim Homrighausen (joho1968, the wcms-bs5 theme) and Marco Antonio Blanco (mablanco, the Docker image), whose work is now also served from robiso forks with their credit. The same names are credited in the README and on wondercms.com/contributors.
-
A broken theme no longer white-screens the site
- If the active theme fails to parse or throws while loading, WonderCMS renders Sky and tells the admin which theme failed (or which plugin, when the exception came from a plugin's hook that only that theme calls; a hook Sky calls too still fails on Sky, as before). Your theme setting is left untouched. Alerts the theme had already printed before it failed (a save confirmation, "Wrong password." at the login form) are shown again by Sky instead of being lost with the theme's output.
-
Search
- Searches subpages at any depth and pages hidden from the menu (they are public by URL). Excerpts are multibyte-safe, so Cyrillic, CJK and accented text no longer break the results. Matching is case-insensitive for non-Latin text. Reported by NorfolkGreg and Joe90 on the forum.
-
Themes and plugins uploaded by hand are listed
- Folders in
themes/andplugins/that are not in the official list appear in Settings as installed, so they can be activated and removed from the UI. Based on a pull request by Almorca. When the official list itself could not be loaded, such folders are described that way rather than as "not in the official list". An official theme folder with notheme.phpin it (a broken download) is offered for Install, which repairs it, instead of Activate, and can be removed from the same card (Sky excepted, as always).
- Folders in
-
Private pages (#366)
- Settings -> Menu has a lock button on every page except the home page, its parents and 404 (it reads "public" or "private"). A private page, and every subpage under it, is served only to the logged-in admin: visitors get the 404 page, the menu and site search skip it. The admin sees everything, with a note on the page (or subpage) that it is private. A subpage can be private on its own under a public parent. Click the button again to make the page public. Visitors must always find a public home page, so the home page, its parents and 404 cannot be made private, and the home page cannot be deleted while no other public page remains (the alert asks you to make another page public first). Their rows have no lock button, and a private page cannot be chosen as the home page. Private pages do not make uploads private: files in
data/filesare served by the web server to anyone who has the link. - Private pages are enforced where the core renders a page, builds the menu and runs site search. A theme or plugin that reads
database.jsdirectly has to check the flag itself. The four known add-ons that did are updated on the official list: GregCustom 2.6.1 or newer (its own search could show an excerpt of a private page; it now skips private pages in its search and its menu), adivvyo 20261029B (its own menu showed the private page's title, with a link answering 404), simple-seo 3.4.4 (its sitemap listed the private page's URL) and wcms-bs5 1.2.4 (it uses the core menu; its leak was its own search only). Update them in Settings -> Themes and Settings -> Plugins after the core. Any other theme or plugin that readsdatabase.jsitself must skip a private page, and every subpage under it, for visitors. - Restoring an older
index.php(the rollback described under Safer one-click updates) makes private pages public again: older cores ignore the flag.
- Settings -> Menu has a lock button on every page except the home page, its parents and 404 (it reads "public" or "private"). A private page, and every subpage under it, is served only to the logged-in admin: visitors get the 404 page, the menu and site search skip it. The admin sees everything, with a note on the page (or subpage) that it is private. A subpage can be private on its own under a public parent. Click the button again to make the page public. Visitors must always find a public home page, so the home page, its parents and 404 cannot be made private, and the home page cannot be deleted while no other public page remains (the alert asks you to make another page public first). Their rows have no lock button, and a private page cannot be chosen as the home page. Private pages do not make uploads private: files in
-
Custom module repositories can be removed
- Settings -> Themes or Plugins -> Custom module lists each repository you added, with a red Remove button. Themes and plugins already installed from it stay until you remove them.
-
Sky theme: submenus on touch screens
- First tap opens the submenu, second tap follows the link, tap outside closes. Hover and keyboard behaviour unchanged. Core menu markup is unchanged, so other themes are not affected. Existing sites get this by updating Sky in Settings -> Themes (the core update replaces
index.phponly). A theme update replaces the wholethemes/skyfolder, so copy any edits you made to Sky first. Thanks to NorfolkGreg. Sky as published since March 2025 callsgetSiteLanguage(), which cores 3.0.0 to 3.4.2 do not have, so updating Sky from Settings on one of those cores broke the page until Sky 3.7.1, on the official list now, which checks for the function and setslang="en"on those cores.
- First tap opens the submenu, second tap follows the link, tap outside closes. Hover and keyboard behaviour unchanged. Core menu markup is unchanged, so other themes are not affected. Existing sites get this by updating Sky in Settings -> Themes (the core update replaces
-
Bug fixes
- Creating a subpage under a page made before 3.2.0 no longer fails (#336; report and a proposed fix by hightowe, #337); no more warning when creating a subpage from its URL.
- Menu links no longer start with
//on Windows hosts (#348). - Uploads work on hosts without the fileinfo extension (#356).
- Notifications are visible above the open settings modal (#346); deleting a file returns to the page you were on (#347); "Visit page" closes a persisted modal (#353). Reported by andre5x. Files tab shows each file's name, with the full URL kept on the link (#357, andre5x; NorfolkGreg agreed the domain and path were noise; thumbnails stay a plugin matter); a file whose name the delete guard would have to clean (
..or~in it) cannot be deleted from the tab; the click answers "Invalid file name." (3.6.0 acted on the cleaned name instead, which could hit another file); and on Windows no longer shows\in file URLs (#348). - Deleting a page from Settings asks for confirmation in every translation: the Delete page button and the menu's delete button use the same
data-confirmattribute as the other confirmations, which the translation plugins already translate (with the Arabic, Hausa and Hindi plugins active the page was deleted without asking). Installing or updating a theme or plugin whose ZIP answers with an HTTP error names the status instead of only "Error opening ZIP file.", and that download has connect and total timeouts. The Files tab sorts names naturally and ignores case (photo2beforephoto10). - Viewing an old subpage no longer writes a duplicate top-level page into
database.js(#360); search skips the duplicates earlier versions created. - The last page can no longer have its content deleted; deleting a stale menu entry cannot remove a sibling.
- Menu keys stay whole: deleting a subpage renumbers its siblings, so the next "Add subpage" no longer replaces the last one in the menu (a gap left by an older version is skipped too); a move past either end of the menu is ignored instead of storing an empty entry that broke every page.
- "Remove" on a theme, plugin or file refuses a name it would have had to clean (such as a hand-uploaded
mytheme~), where it used to act on the cleaned name. - A theme whose folder was deleted (or whose name was hand-edited into something that is not a folder) falls back to Sky and tells the admin which theme is missing (3.6.0 showed a blank page); a theme folder without a
theme.phpcounts as missing too. Sky can no longer be removed from Settings, since it is the fallback for a missing or broken theme (remove it over FTP if you really want to). - A custom module URL that no longer answers: 3.6.0 already warned the admin once a day; the daily check now also shows the "Cannot get content from url" alert, so two alerts name the problem; remove the dead URL in Settings -> Themes or Plugins -> Custom module.
- Hand-uploaded themes and plugins with unusual characters in the folder name (
&,#,', a leading space) are handled or refused exactly, never acted on as a different name. The Settings cards print every field of the module list, and the installed module's own version text, as text; they link only http(s) URLs and encode the module name in every action link. That text comes from the official list, a custom repository the admin added, or a folder name, so none of it is trusted as markup. - Wrong password shows a normal alert again.
- Logging in issues a fresh security token instead of keeping the one the browser had as a visitor.
database.jsis read under a shared lock. A page requested in the instant another request was saving could read the file half-written and fail; it now waits for the save to finish (hosts without file locking, or with the locking functions disabled, read as before).database.jsand the module cachecache.jsonare written whole next to themselves and renamed into place, like the core update. A save first writes the whole file to a temporary copy next to it; if that fails (a full disk, or a disk or quota with no free inode) the save is refused with an alert naming the file anddatabase.jsis untouched (3.6.0 truncated it first and wrote what fitted; with no free inode it wrote in place). A save therefore needs free space for a second copy ofdatabase.jsfor a moment: on a nearly full account the save is refused with that alert instead of leaving a truncated file. A symlinkeddatabase.jsis followed to its target when PHP can write the target's folder: the copy is written there and renamed over the target, and the link stays. Otherwise the copy is written next to the link and the target is written in place through the link, so the room is proven on the link's disk. If that target sits on another disk that is full, the target can still be left empty, as in 3.6.0 (see the docs FAQ); keep backups there too. A hard-linkeddatabase.js(a rename would detach it), a file owned by another user or group than PHP, and a host that allows the write but not the replace are written in place under a lock, after the temporary copy has proven the room and been removed (the copy is written as PHP's own user, so for a file owned by another user it proves room under PHP's quota, not under that user's, which 3.6.0 did not check either). Only a folder PHP cannot write to and a host that disables one of the file functions involved still write in place with no copy, as 3.6.0 did, so a full disk can still truncate the file there; keep backups. A folder that lets PHP change files but not create them (an SELinux label or a Windows ACL can set that) depends on what the host reports: where PHP sees it as not writable, the file is written in place as in 3.6.0; where PHP sees it as writable, the temporary copy cannot be created and the save is refused with the alert. Keep backups either way. A temporary copy that an interrupted save left next to the file (a full copy of the database, password hash included) is removed by the next save once it is an hour old.- The two Remove paths (Settings and a theme or plugin update) check for a symlink only where the host allows
is_link(); a hardened host that disables it removes as 3.6.0 did instead of failing with an error. - When a theme fails and Sky is shown, the cause (theme, error, file and line) is also written to the server's PHP error log, one line, so a site owner who is not logged in can find it there.
- "Hide all alerts until next login" now does what it says. The hide was a browser flag that only the Login button and the "Check for updates" link cleared, so it survived a logout and hid the alerts shown in that browser until one of them was clicked. It is now tied to the login it was clicked in; after the update, alerts hidden under 3.6.0 show once more.
-
PHP
- Runs clean on PHP 7.4 through 8.5 (tested in CI on 7.4, 8.1, 8.3, 8.4 and 8.5;
curl_close()andE_USER_ERRORdeprecations removed). Minimum PHP is 7.4, stated honestly by the install check. - On PHP 8.5, a 3.6.0 site logs
curl_close()deprecation notices to the server log during the Update click itself: that request still runs 3.6.0's code. They stop once 3.7.0 is in place.
- Runs clean on PHP 7.4 through 8.5 (tested in CI on 7.4, 8.1, 8.3, 8.4 and 8.5;
-
Project
- Tests run again (
php phpunit.phar, no Composer) and in CI on PHP 7.4, 8.1, 8.3, 8.4 and 8.5, plus the URL, updater, database-lock and local-module tests on Windows, and the whole suite once more on a PHP without the tokenizer function.RELEASING.mddocuments the release. The admin CSS is pinned with an integrity hash like the JS.
- Tests run again (
Backwards compatibility
- No plugin or theme API changes. Menu markup, hook names and arguments, and the
database.jsformat are unchanged; a private page adds"private": trueto its menu entry and its page, so a site that never made a page private keeps the exact 3.6.0 shape. One markup detail moved: the Delete, Remove and Activate confirmations in Settings aredata-confirmattributes now instead of inlineonclick="return confirm('...')"(so a name with a quote cannot break out of the script); all 21 official translation plugins, Arabic included, carry the 3.7.0 rows since their 2026-10-29 versions (Dutch 3.0.7, Polish 3.1.9 and newer), so update them from Settings -> Plugins after the core. - The
alerthook fires on everyalert()call, a repeated one included (the duplicate check now runs on the hook's result), and, while alerts render for the logged-in admin, once per alert with the "Hide all alerts until next login" link text, so a listener that rewrites text should match only the strings it means. - Pages hidden from the menu now appear in site search; "hidden" has always meant hidden from navigation, the page is public by URL.
- An address whose first part is not a page (for example
/missing/about) now gets the 404 page; earlier versions served the top-level page named by the second part, an accident of the page lookup rather than a feature. Leading and trailing slashes in thepageparameter are ignored (?page=/aboutisabout), so servers that pass the full path, such as Caddy's{path}, keep working. - An install in a subfolder whose rewrite forwards the whole request path, folder included, in
page=(nginxtry_files $uri $uri/ /sub/index.php?page=$uri, or Apache rules in the server configuration or in a parent folder's.htaccess, givingpage=sub/aboutfor/sub/about) keeps working: whenpageequals the request's path, the install's own folder is stripped once from its start. An install with its own.htaccessin the folder (the shipped one) forwards only the part after the folder and is unchanged: nothing is stripped, so a site in/blog/running Simple Blog keeps its posts at/blog/blog/<post>. - Saves and updates on a full disk: the whole file is written to a temporary copy first, so a full disk, or a disk or quota with no free inode, refuses the save or the update with an alert and leaves
database.jsorindex.phpuntouched (3.6.0 truncated on a full disk, and wrote in place when only the inodes had run out). This covers symlinked files too (the copy is renamed over the target when PHP can write the target's folder; otherwise it is written next to the link and the target is written in place through the link; the link stays either way), and hard-linked and other-owner files, which are then written in place. The plain in-place write of 3.6.0, where a full disk can still truncate the file, remains only for a folder PHP cannot write to (including one that lets PHP change files but not create them, as an SELinux label or a Windows ACL can set, where the host reports it as not writable) and for hosts that disable the file functions involved; keep backups there. There a full disk can leavedatabase.jsempty: the site then shows an error instead of its pages, the save alert cannot appear, and the way back isdata/database.jsfrom your backup. - Existing duplicate
parent/childentries written by earlier versions are left in place and skipped by search; remove them by hand if you like (see docs). - Theme output is buffered while
theme.phpruns so a failure can be caught and Sky shown instead. A theme that callsflush()or expects headers to be sent partway through the page sees its output delivered at the end of the request instead. A theme that callsob_end_flush()itself sends its output at that point and ends the buffer; a failure after that point is still caught and Sky is shown, but the output already sent stays above it (3.6.0 showed the partial output and then a fatal); the core then flushes nothing further. The page content is the same either way (Sky does neither). A host that disables PHP's output-buffering functions renders themes unbuffered, as before.
How to update
- Log into your WonderCMS website and create a backup through Settings -> Security.
- Click "Update".
- If the update is not visible, open Settings -> Themes and click "Check for updates".
- The update is forward-only: the updater cannot move a 3.7.0 site back to 3.6.0. The way back is the
index.phpfrom your backup, uploaded by hand; pages made private become public again on 3.6.0, which ignores the flag.
Installation
- Unzip and upload the files wherever you want WonderCMS installed and visit that URL.
- SHA-256 signature: ed19d814d42a47f5eb720132e1a417043bfde46b70b8119d5598fcec80bb1a3d