Composer Support, Parallel Free/Premium Activation, Pricing Page Update, and Various Fixes
LatestWe are glad to announce v2.10.1 of our WordPress SDK. This version introduces several improvements and bug fixes. Please find the details below.
⚠️ IMPORTANT: DO NOT CHANGE SDK LOCATION YET
While you'll read that this version supports SDK from being loaded from the vendor
directory through composer, please do not change the SDK location of your existing product yet. We discovered it will likely cause some error messages to be shown in the update UI.
This issue only affects premium products changing SDK location, not new or free versions. While the "error message" does not break anything, it still gives bad UX, hence, we ask not to change the location of the SDK yet.
We are already working on a solution and will update you soon. We hugely appreciate your understanding and patience in this regard.
Composer Support
We recognize the growing need for Composer-based installations, especially since many modern plugins and themes use this dependency manager. To enhance developer experience (DX), we now officially support Composer.
You can install our SDK with the following command:
composer require freemius/wordpress-sdk
Then, require the Composer autoloader file:
require_once __DIR__ . '/vendor/autoload.php';
Our SDK will work out of the box without any further modifications.
Note for symlinked plugins:
If you are symlinking any freemius powered plugin to the
wp-content/plugins
directory, which uses composer auto-loading,
please note that the directory name must match with the original directory. For exampleln -s ../../awesome-plugin ./awesome-plugin
will work, butln -s ../../awesome-plugin ./some-other-name
will not work.
Parallel Activation of Both Free and Premium Versions
Historically, our SDK supported activating either the Free or the Premium version of a WordPress plugin. It also included a mechanism to automatically deactivate the free version when the premium version was activated.
However, some use cases require both free and premium versions to remain active, particularly to collect better statistics from WordPress.org.
Previously, we introduced the deactivate_on_activation
filter to modify this behavior. However, it wasn't a complete solution and could lead to bugs in scenarios like bulk plugin activation or updates on WordPress Multisite networks.
We've now completed this feature by introducing a new initialization code. To use this feature, add the following code to your fs_dynamic_init
call:
$my_fs = fs_dynamic_init( [
// ... existing configuration options.
'parallel_activation' => [
'enabled' => true,
'premium_version_basename' => 'premium-slug/filename.php',
],
] );
With this code, the SDK will:
- Avoid deactivating the free version during premium version activation (unless specifically modified by the
deactivate_on_activation
filter). - Automatically show the license activation page if the free version does not have a license activated.
More information can be found here. If you encounter any issues using this feature, please contact our support team.
Pricing Page Update
The SDK now includes v1.1.0 of the pricing page app. Based on community feedback, we've introduced the following enhancements:
- Added the
pricing/show_annual_in_monthly
filter to control how annual billing cycle pricing is displayed. - Introduced the
plugin_icon
filter to override the image displayed on the page. - Added the
pricing/disable_single_package
filter to control the rendering of single-plan products. - Introduced the
pricing/css_path
filter to add custom CSS to the pricing page.
More details can be found in the README file of the pricing page repository.
Additionally, we've fixed the following issues:
- The "Lifetime" tab was incorrectly displayed in some cases. This has been resolved.
- The "Free" plan was mistakenly rendered with an "Upgrade" button, even when it was the current plan. This has been fixed.
- The current plan was not properly highlighted in some scenarios. This has been corrected.
WordPress Playground support
We’re excited to share that the new SDK version officially supports WordPress Playground! When a playground environment is detected, the SDK will automatically run in anonymous mode, skipping the opt-in process to provide a seamless and engaging demo experience.
But that’s not all! The SDK also detects other popular sandbox/playground platforms, like InstaWP and TasteWP, and enables anonymous mode automatically to streamline the setup process even further.
Other bug fixes and enhancements
- Improved heuristics for cron-based syncing of license and install entities to avoid performance issues, especially on Multisite networks.
- Fixed an edge-case JavaScript issue that caused the license activation dialog to fail in some scenarios.
- Updated staging site URL pattern for Kinsta.