15 KiB
Changelog
All notable changes to this project will be documented in this file. See standard-version for commit guidelines.
Unreleased
(No unreleased changes at this time.)
4.5.0
-
Upgraded
nikic/fast-routeto2.0.0-beta1and alignedRouterwith the v2 configuration interface. -
Raised minimum PHP requirements to match the current dependency set:
v-update-apinow declares PHP 8.2+ to align with Doctrine DBAL 4.x.- README now distinguishes the API server PHP 8.2+ requirement from the WordPress plugin PHP 8.0+ requirement.
-
Refactored cron execution to CLI-only model:
v-update-api/cron.phpnow validates CLI execution viaphp_sapi_name()and delegates to model sync methods.PluginModel::syncFromDirectory()andThemeModel::syncFromDirectory()sync filesystem ZIPs to database metadata.BlacklistModel::cleanup()removes expired blacklist entries on each cron run.
-
Consolidated secure random-byte generation into
EncryptionHelper::bytes():- Updated consumers (
LoginController,public/index.php) to use the centralized helper method.
- Updated consumers (
-
Removed
RouteDispatcherFactory;Routernow builds its FastRoute dispatcher directly viarecommendedSettings(). -
Strengthened model/controller consistency and failure-safe update flows:
PluginModelandThemeModeluploads now stage files, perform DB upserts in transactions, and apply rollback/compensation when filesystem or DB steps fail.deletePlugin/deleteThemenow validateunlink()success, skip DB deletion on file-delete failures, and emit structured log entries for invalid path/race/permission cases.HostsModel::getEntries()now returns structured{domain, key}rows; host update/delete APIs are domain-keyed (removed misleading unused line parameters), andHomeControllerno longer parses concatenated host strings.HomeController::handleSubmission()now reports delete failures with explicit log+message behavior, aligned with add/regenerate flows.ApiControllerkey comparison now useshash_equalsafter decryption for constant-time credential checks.- Added regression coverage for delete failure handling and upload rollback paths in plugin/theme model tests, and updated host/home tests for structured host rows and domain-keyed mutations.
-
Tightened session, lockout, and key-display security controls:
SessionHelper::destroynow expires the active session cookie with matching cookie attributes beforesession_destroy().BlacklistModel::updateFailedAttemptsnow refreshestimestampon every failed attempt while preserving atomic UPSERT behavior.HomeControllerhost listing now masks keys by default, adds explicit reveal/copy controls, and limits plaintext display to a short-lived (30s) session-backed reveal window; UI toasts/messages never include full keys.- Added regression coverage in
SessionDestroyCookieTest,BlacklistModelTest, and newHomeControllerTestfor these behaviors.
-
Hardened file-ingest edge cases across upload and cron sync flows:
PluginModel::uploadFilesandThemeModel::uploadFilesnow normalize both single-file and multi-file upload payload shapes, validate required keys/types before indexing, and emit explicit malformed-entry errors instead of runtime warnings.PluginModel::syncFromDirectory()andThemeModel::syncFromDirectory()now guard unreadable/missing directories andglob()failures, log sync-read failures, and exit safely without deleting existing records when scanning cannot proceed.- Added regression tests for upload payload normalization and model sync behavior.
-
Hardened host onboarding and key storage paths:
v-update-api/public/install.phpnow defensively parsesHOSTSimports, skips/records malformed records, validates domains, normalizes plaintext/legacy keys into the expected encrypted storage format, and logs normalization summaries for traceability.HostsModel::updateEntrynow usesUPDATEinstead ofREPLACE INTOto avoid delete+insert side effects while preserving encrypted key storage behavior.- Added
tests/HostsModelTest.phpregression coverage for update-in-place behavior, missing-domain failures, and foreign-key-safe host updates.
-
Removed the unused
Controller::render()helper fromv-update-api/app/Core/Controller.phpto reduce view-render attack surface and keep rendering centralized inRouter::sendResponse. -
Refined Update API failure semantics and lockout accounting:
ApiControllernow returns400for malformed input,403only for authentication failures,204for no-update responses, and404for authenticated unknown slugs.- Blacklist increments now occur only for credential/auth failures (e.g., unknown domain or wrong key), not malformed requests or authenticated unknown slugs.
-
Unified canonical slug handling across validation and model workflows:
- Added shared slug/filename parsing in
ValidationHelper(validateSlug,validateFilename,parsePackageFilename). - Updated plugin/theme upload and delete flows to use the canonical parser, including dotted slugs and underscored slugs.
- Added shared slug/filename parsing in
-
Added regression coverage for slug and lockout edge cases:
ApiControllerTestnow verifies malformed requests do not consume blacklist budget, wrong keys do consume budget, and authenticated unknown slugs return404without budget impact.- Model/validation tests now cover dotted slugs, underscored slugs, and single-file plugin slug filename handling end-to-end.
- Added
PluginUpdaterStatusTestfor single-file plugin enumeration (single-file-plugin.php→single-file-plugin) and directory plugin slug behavior.
-
Replaced remaining obsolete
mu-plugintest/tooling references with activev-wp-updaterpaths inApiKeyHelperTest,UpdaterEncodingTest, andphpstan.neon. -
Unified updater status options to canonical
vwpu_*keys (vwpu_plugin_update_status,vwpu_theme_update_status) across updater services, activation defaults, and uninstall cleanup. -
Added activation-time migration from legacy status keys (
vontmnt-*,vwpu-*hyphen variants) to canonical status keys so existing installs retain prior status data. -
Hardened deactivation/uninstall execution by validating
uninstall.phpexistence, guarding helper calls withfunction_exists(...), and logging structured errors while safely continuing. -
Renamed
v-update-api/app/Core/Response.phptov-update-api/app/Core/ResponseManager.phpand updated all controller/router/test references accordingly. -
Moved CSRF token initialization into the
ErrorManager::handle(...)request callback inv-update-api/public/index.phpso token generation exceptions are handled through the centralized error pathway. -
Hardened database bootstrap in
DatabaseManagerby using least-privilege directory permissions (0750), validatingmkdir/touchoutcomes, and throwing/logging controlled runtime exceptions with context when file-system setup fails. -
Updated
/apirouting semantics so/apiis always treated as an API route (no auth redirect fallback) and returns consistent API status behavior (400validation errors,403auth failure,405method mismatch). -
Simplified cron execution by removing worker mode (
--worker/worker) and documenting single-run daily cron scheduling. -
Switched admin password configuration from hash-based verification to plain-text
VALID_PASSWORDcomparison inconfig.phpandLoginController. -
Replaced login-session CSRF token regeneration in
LoginControllerwith cryptographically secure output usingbin2hex(random_bytes(32))while preserving existing timeout and session ID regeneration flow. -
Fixed API query argument construction in
PluginUpdaterandThemeUpdaterby removing pre-encoding (rawurlencode) soadd_query_argperforms a single RFC3986 encoding pass. -
Hardened package delete parsing in
PluginModel::deletePluginandThemeModel::deleteThemeusing strict^([A-Za-z0-9_-]+)_([0-9.]+)\.zip$extraction, including regression coverage for underscore-containing slugs and non-matching filenames. -
Hardened file response streaming:
ApiControllernow validates update package readability andfilesize()before building a file response.Routerrejects unreadable file responses and emits deterministic500text responses.Response::sendnow suppresses rawreadfilewarnings, logs failures, and follows a controlled500fallback path for unreadable files.
-
Dependency follow-up (
nikic/fast-route):- Reviewed upgrade path from
v1.3.0to2.0.0-beta1(composer dry-run succeeds but targets a beta line and introducespsr/simple-cache). - Deferred immediate upgrade and added explicit migration tracking in
README.mdandv-update-api/docs/dependency-tracking.md(ticketDEP-001). - Constrained FastRoute usage behind
App\Core\RouteDispatcherFactoryto reduce migration surface for the eventual v2 adoption.
- Reviewed upgrade path from
-
Aligned update-check contract (Option A): Unified the request/response protocol used between the WordPress client plugin and the Update API server.
PluginUpdater::fetch_packagenow sendstype=plugin&slug=<slug>instead ofplugin=<slug>.ThemeUpdater::fetch_packagenow sendstype=theme&slug=<slug>instead oftheme=<slug>.- Both updaters now treat HTTP
403as the auth-failure signal (replacing the previous incorrect401check) to match the status code returned byApiController. - Both updaters now handle the direct binary ZIP response on HTTP
200(no JSONzip_urlparsing) and return the authenticated API URL asdownload_urlforAbstractRemoteUpdater. - Added
tests/ApiControllerTest.phpcovering request validation, auth failure (403), no-update (204), and successful update (200) for bothpluginandthemetypes. - Added
tests/UpdaterFetchPackageTest.phpwith 22 tests locking parameter names, status-code branches, WP_Error handling, and a regression test proving a valid request reaches the install path. - Updated
v-wp-updater/api/API_SCHEMA.mdwith the canonical update-check endpoint contract.
-
Updated
v-update-api/cron.phpto accept the positionalworkerargument, reject unknown CLI options, and propagate non-zero exit codes when cron work fails viaErrorManager. -
Added integration tests covering worker invocation, argument validation, and CLI error handling, plus lightweight mu-plugin fixtures required for the suite.
-
Updated README.md to match current codebase: Replaced all references to obsolete
mu-plugin/directory withv-wp-updater/. Updated project structure documentation to reflect dual-component architecture (Update API Server + WordPress Client Plugin). Removed references to non-existent files (HOSTS, autoload.php) and controllers (AccountsController, InfoController, UsersController). Added documentation for SiteLogsController and cron.php with worker mode. Updated installation and usage sections with accurate paths and separate setup procedures for API server and client plugin. -
Removed legacy key-exchange workflow; clients now use a stored API key.
-
Updated installation to use
VONTMNT_UPDATE_KEYREGENinstead ofVONTMENT_KEY. -
Consolidated
VONTMENT_PLUGINSandVONTMENT_THEMESinto a singleVONTMNT_API_URLconstant. -
Split update loops into single-item tasks: Refactored plugin and theme updaters to use asynchronous per-item processing. Daily update checks now schedule individual
wp_schedule_single_event()tasks for each plugin/theme instead of processing all items synchronously. Addedvontmnt_plugin_update_single()andvontmnt_theme_update_single()callback functions. -
Expanded test coverage to reflect current codebase: Added comprehensive tests for ThemeModel, Encryption, Blacklist, CronWorker, Validation, Response, Csrf, and MessageHelper classes. Test suite expanded from 37 to 105 tests with 241 assertions, providing coverage for all major components including models, helpers, and core classes.
-
Stored admin password as a hash and verified with
password_verifyduring login. -
Controllers now return structured
Responseobjects; router and session handling updated accordingly. -
Expanded filename validation to allow digits and underscores in slugs and updated tests.
-
Introduced configurable
LOG_FILEand centralized logging throughErrorManager. -
Made
SessionManager::requireAuthnon-terminating, returning a boolean instead. -
Enhanced
vontmnt_get_api_keywith wp-config backups and validation. -
Streamlined plugin updates using a single streaming
wp_remote_getcall. -
Removed HTML escaping in
HostsModelin favor of parameterized queries.
4.0.0
- Added PHP_CodeSniffer with WordPress Coding Standards for linting.
- Moved validation helpers to
App\Helpers\Validationand encryption helpers toApp\Helpers\Encryption. - Added
App\Models\Blacklistfor IP blacklist management and removedApp\Core\Utility. - Introduced centralized
SessionManagerandCsrfutilities, refactored controllers and routing to use them, and replacedAuthControllerwithLoginController. - Switched router to instantiate controllers, dropped unused account/user/info routes, and added
/apiendpoint. - Updated
LoginControllerto render views through$thisinstead of creating a new instance. - Converted controllers to instance methods using
$this->renderand removed the feeds controller and route. - Refined router dispatch to include HTTP method and validate API requests before enforcing authentication.
- Streamlined session validation to check only timeout and user agent, moved IP blacklist enforcement to authentication, and added unit tests for session expiry, user-agent changes, and blacklist handling.
- Refactored router into a singleton and documented root URL redirection to
/home. - Restricted table generation helpers in controllers and
SessionManager::isValidto internal use and updated tests accordingly. - Fixed PHPStan reported issues by initializing variables, adding explicit type annotations, and excluding vendor code from analysis.
- Introduced SQLite persistence using Doctrine DBAL with install and cron scripts, and migrated models and controllers to use the database.
- Replaced JSON-based blacklist with SQLite table that automatically resets entries after three days.
- Moved blacklist table creation to installer script.
- Removed
rawurlencodefrom updater request parameters to prevent double encoding. - Added
WP_Errorchecks afterwp_remote_getcalls to log network failures and skip processing. - Corrected the header in
v-sys-theme-updater.phpso it loads as a plugin. - Updated
SessionManager::requireAuthto return a boolean and halt routing for blacklisted IPs. - Logged failed package writes in plugin and theme updaters and skipped installation when writes fail.