mirror of
https://gh.wpcy.net/https://github.com/djav1985/v-wordpress-plugin-updater.git
synced 2026-04-24 04:03:01 +08:00
Agent-Logs-Url: https://github.com/djav1985/v-wordpress-plugin-updater/sessions/9c874cfc-1613-4796-98af-4eb1b1494f3d Co-authored-by: djav1985 <174835544+djav1985@users.noreply.github.com>
6 KiB
6 KiB
Changelog
All notable changes to this project will be documented in this file. See standard-version for commit guidelines.
Unreleased
- 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
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.