Updated fork for PHP 8.x
-
Hi there,I’ve updated the Moosend Website Connector plugin codebase so it runs cleanly on PHP 8.1–8.4 and recent WordPress (tested with WP 6.6.x). I’m sharing the changes here in case the maintainers would like to review and ship an official update, as I know many sites still rely on this plugin.I’m also happy to provide a Git repo or patch file and/or help maintain the plugin if needed.What’s currently brokenOn modern hosting (PHP 8.x):
- Old Guzzle dependencies emit PHP 8+ deprecation warnings (implicit nullable parameters).
- Dev tooling is very dated:
- phpunit/phpunit is pinned to 4.8, which fatal-errors on PHP 8+ with Call to undefined function each().
- In earlier versions, deployer/deployer was removed, but a composer.json script still referenced the dep binary (making composer deploy fail). I’ve cleaned this up as well.
Changes I made (high level)1. composer.json
- Dev dependency:
- phpunit/phpunit updated from ~4.8 → ^10.5 (current, PHP 8.1+ compatible).
- Scripts:
- Kept:
- “test”: “phpunit –colors=always –debug”
- “start”: “php -S localhost:8080”
- Removed old broken script:
- “deploy”: “dep staging”
(because deployer/deployer is no longer required, so dep doesn’t exist.)2. Dependencies / composer.lock (generated via Composer)
- Guzzle stack updated to resolve PHP 8 deprecations:
- guzzlehttp/guzzle → 7.10.0
- guzzlehttp/promises → 2.3.0
- guzzlehttp/psr7 → 2.8.0
- Moosend tracking package:
- moosend/website-tracking → 1.12.67
- PHPUnit & test ecosystem:
- phpunit/phpunit → 10.5.60
- Matching modern versions of:
- phpunit/php-code-coverage, phpunit/php-file-iterator,
phpunit/php-text-template, phpunit/php-timer,phpunit/php-invoker
- sebastian/* packages (diff, environment, exporter, global-state,
recursion-context, version, type, etc.)
- phar-io/manifest, phar-io/version, myclabs/deep-copy,
nikic/php-parser, theseer/tokenizer
- Removed obsolete, PHPUnit‑4‑only dev packages:
- phpunit/phpunit-mock-objects
- phpunit/php-token-stream
- phpspec/prophecy
- phpdocumentor/reflection-docblock
- doctrine/instantiator
- Old symfony/yaml and symfony/polyfill-ctype versions brought in only for the legacy test stack.
> Result: composer install succeeds on PHP 8.4, and vendor/bin/phpunit (v10.5.60) runs without fatal errors.What I did not change
- No changes to:
- MooTracker.php
- Any WordPress hooks, WooCommerce integration, or tracking logic.
- All updates are confined to:
- composer.json
- composer.lock
- The auto‑generated vendor/ directory.
The plugin’s runtime behavior on WordPress should remain the same; it’s simply now compatible with modern PHP and tooling.Offer to help / next stepsIf a maintainer is available:
- I can provide:
- A single diff/patch against the latest SVN version, or
- A public Git repository with these exact changes.
- I’m also happy to:
- Adjust anything to match your coding or release standards.
- Help test on specific PHP versions / WordPress combinations.
- Be added as a co‑maintainer/committer if you’d like someone to help keep it up to date.
Given that the plugin is still in use and officially marked as last updated over a year ago, I think an official release with PHP 8.x compatibility would help a lot of sites.Thanks for your work on this plugin, and let me know how I can best share the patch.
You must be logged in to reply to this topic.