Repository navigation
Release SureCart SDK v1.2.3 - #29
Merged
Merged
Conversation
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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Release of SureCart Licensing SDK v1.2.3.
Fixes
https, the host is lowercased, a leadingwww.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 newActivation::get_fingerprint()is used by bothcreate()andupdate().Settings::add_notice()no longer causes a fatal error whenadd_settings_error()isn't loaded (front end, cron, REST).Improvements
surecart_licensing_fingerprintfilter with arguments( $fingerprint, $site_url, $client ). Every product bundling the SDK runs this filter, so check$client->slugto change the fingerprint for one product only.SureCart\Licensingnamespace.1.2.3.Sites whose URL is
http://or starts withwww.will send a different fingerprint after upgrading (e.g.https://example.cominstead ofhttp://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. Plainhttps://non-www sites keep the same fingerprint.Test plan
npm run test:php(wp-env), including the newActivationFingerprintTestwww./http://site and confirm the fingerprint sent is normalized🤖 Generated with Claude Code