Skip to content

Release SureCart SDK v1.2.3 - #29

Merged
mzakash merged 14 commits into
mainfrom
release/v1.2.3
Oct 21, 2026
Merged

mzakash merged 14 commits into
mainfrom
release/v1.2.3

Conversation

@mzakash

@mzakash mzakash commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Release of SureCart Licensing SDK v1.2.3.

Fixes

  • Normalize the activation fingerprint (Normalize the activation fingerprint so www/http variants of one site match #28): URL variants of one site now map to one fingerprint. The scheme becomes https, the host is lowercased, a leading www. is dropped and a trailing slash is removed. The port and path are kept, since subdirectory installs and different ports can be separate sites. The new Activation::get_fingerprint() is used by both create() and update().
  • Skip license notices outside wp-admin (Fix fatal in add_notice() outside wp-admin #27): Settings::add_notice() no longer causes a fatal error when add_settings_error() isn't loaded (front end, cron, REST).

Improvements

  • New surecart_licensing_fingerprint filter with arguments ( $fingerprint, $site_url, $client ). Every product bundling the SDK runs this filter, so check $client->slug to change the fingerprint for one product only.
  • README note recommending a namespace scoper (Strauss / PHP-Scoper), because every product that bundles the SDK shares the SureCart\Licensing namespace.
  • SDK version bumped to 1.2.3.

⚠️ Behaviour change

Sites whose URL is http:// or starts with www. will send a different fingerprint after upgrading (e.g. https://example.com instead of http://www.example.com). The SDK doesn't update existing activations, so if the server matches activations by fingerprint, re-activating on such a site may use one extra activation slot, once. Plain https:// non-www sites keep the same fingerprint.

Test plan

  • npm run test:php (wp-env), including the new ActivationFingerprintTest
  • Activate a license on a www. / http:// site and confirm the fingerprint sent is normalized
  • Trigger a license check outside wp-admin and confirm there's no fatal error

🤖 Generated with Claude Code

epigeyre and others added 5 commits June 5, 2026 08:56
WP_Errror::get_error_code() does not take any arguments. This commit fix the issue.
get_activation() adds a notice on any API error, and add_settings_error()
only exists in wp-admin. Calling it on init, the front end, REST, cron or
WP-CLI fataled whenever the license API failed.

Also bump to 1.2.3 and note in the README that bundled copies share one
namespace.
get_site_url() was sent as-is, so https://www.example.com, https://example.com
and http://example.com created separate activations for the same site. The
scheme also follows the current request via is_ssl(), so one site could send
both http and https.

Activation::get_fingerprint() now forces https, lowercases the host, drops a
leading www. label and a trailing slash, and keeps the port and path. A
canonical https non-www URL keeps its exact previous fingerprint. Exposed via
the surecart_licensing_fingerprint filter.
…-settingsadd_notice-fatals-outside-wp-admin

Fix fatal in add_notice() outside wp-admin
…gerprint

Normalize the activation fingerprint so www/http variants of one site match
@mzakash mzakash self-assigned this Oct 21, 2026
ManiruzzamanAkash and others added 9 commits October 21, 2026 13:48
Every product bundling the SDK shares the surecart_licensing_fingerprint
filter, so pass the client as a third argument to let a callback target
one product by slug. Move the site_url filter cleanup into tear_down()
so a failing assertion can't leak it into later tests.
Upgrade WordPress Coding Standards to 3.4, PHP_CodeSniffer to 3.13,
PHPUnit to 9.6 and PHPUnit Polyfills to 1.1, which the WordPress test
suite now requires. Pin config.platform.php to 7.4 so the lock file
stays installable on the oldest PHP version CI runs.

WPCS 3 adds sniffs the code didn't pass: apply its auto-fixes and
exclude ExceptionNotEscaped, since exceptions are caught and returned
as WP_Error rather than printed.
wp-env 12 drops the vulnerable transitive dependencies of 4.x. Pin qs
and http-cache-semantics to patched versions with resolutions. .yarnrc
sets ignore-engines because @wp-playground/cli declares Node >= 24.18,
which the Docker runtime doesn't need.

Mount the SDK with mappings instead of plugins, because wp-env 12 fails
when it can't activate it, and move the tests environment to
.wp-env.tests.json now that env.tests is deprecated. test:php runs
PHPUnit in that environment's cli container, since the phpunit
container no longer exists.
Use set_up() in SettingsTest, which current WordPress test cases
require, and drop the Feature suite whose directory doesn't exist.

Set the site URL in the fingerprint tests through the site_url filter:
wp-env defines WP_SITEURL, which overrides the siteurl option the tests
were updating.
Follow the SureCart readme.txt changelog format and link it from the README.
fix(licence): issue with specific error message in validate_license
@mzakash
mzakash merged commit 9c76043 into main Oct 21, 2026
2 checks passed
@mzakash
mzakash deleted the release/v1.2.3 branch October 21, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants