CreaCaptcha

class-plugin-updater.php

CreaCaptcha Plugin Updater – GitHub Self-Hosted Updates

Adapted from the "JPKCom Plugin Updater" class, authored and externally maintained by Jean Pierre Kolb (jpk@jpkc.com) across several of his open-source WordPress-plugin projects (originally vendored from jpkcom-post-filter/includes/class-plugin-updater.php). When porting updates or bug-fixes upstream/downstream, treat the version in this file as a downstream copy of that shared codebase.

Plugin-local changes vs. the shared upstream:

  • Namespace renamed JPKComPostFilterGitUpdateCreationell\Captcha\GitUpdate
  • Class renamed JPKComGitPluginUpdaterCreationellCaptchaGitPluginUpdater
  • Contributors entries include display_name (WP core expects it in the plugin-information popup; fix pending upstream port)
  • no_update entries include new_version/package/tested/requires_php (WP-CLI reads new_version in wp plugin list; fix pending upstream port)

Both renames are necessary to avoid Cannot redeclare class fatals when more than one of Jean Pierre's plugins (each carrying its own vendored copy of this updater) is active on the same WordPress install. Everything else in this file should stay byte-identical with the upstream to keep cross-project diffs minimal.

--- Original upstream description follows ---

This class provides a secure, self-hosted update mechanism for WordPress plugins hosted on GitHub. It integrates with the WordPress plugin update system and provides comprehensive security features including:

  • SHA256 checksum verification of downloaded packages
  • URL validation and sanitization of all remote data
  • Race condition prevention for manifest fetching
  • Comprehensive error logging in WP_DEBUG mode
  • Transient caching with 24-hour TTL
  • Backward compatibility with manifests without checksums

Security Features:

  • All URLs are validated using wp_http_validate_url() before use
  • All manifest data is sanitized before display
  • Download packages are verified against SHA256 checksum from manifest
  • Failed verifications prevent installation and log errors

Namespace: Creationell\Captcha\GitUpdate (renamed from JPKComPostFilterGitUpdate) PHP Version: 8.3+ WordPress Version: 6.8+

Tags
author

Jean Pierre Kolb jpk@jpkc.com

since
1.0.0

Initial release with GitHub integration

Table of Contents

Classes

CreationellCaptchaGitPluginUpdater
Class CreationellCaptchaGitPluginUpdater

        
On this page

Search results