February 27, 2024
Thoughts and updates —

Sell and distribute WordPress plugins using SupplyKit

Sell and distribute WordPress plugins using SupplyKit

In the dynamic world of WordPress, offering premium plugins directly to your users can be both a lucrative and challenging endeavour. At Line Industries, we've simplified this process with SupplyKit, a comprehensive service designed to sell both tangible and digital products through a monthly subscription model.

A standout feature of SupplyKit is its ability to revolutionise how premium WordPress plugins are sold and automatically updated, ensuring your users always have the latest features and security enhancements.

Getting Started with SupplyKit

Setting up your digital storefront on SupplyKit is straightforward:

  1. Upload Your Plugin: After configuring your SupplyKit store, upload the latest version of your WordPress plugin. Specify the maximum number of downloads for each paid user, making your first step into the plugin market as smooth as possible.
  2. Enable Automatic Updates: To transcend basic sales and venture into providing seamless automatic updates, we've developed a unique system using a JSON file. This file plays a pivotal role in notifying your users about new updates.

The Magic Behind Automatic Updates

Automatic updates are facilitated through a simple yet effective process:

Create the Update JSON File: This file is the heart of the automatic update system. It contains crucial information about the plugin's latest version and update details. When there's a new version of your plugin, update this JSON file on SupplyKit.


{
	"name": "Your Plugin Name",
	"slug": "your-plugin-slug",
	"author": "Your Company or Author Name",
	"author_profile": "Author Profile URL",
	"version": "1.0.0",
	"download_url": "##downloadlink##",
	"requires": "WordPress 5.0 or higher",
	"tested": "WordPress 5.8.1",
	"requires_php": "PHP 7.0 or higher",
	"last_updated": "YYYY-MM-DD HH:MM:SS",
	"sections": {
		"description": "Brief overview of your plugin and its features.",
		"installation": "Step-by-step guide on how to install your plugin.",
		"changelog": "Summary of recent changes, improvements, and bug fixes."
	},
	"banners": {
		"low": "Low-resolution banner image URL",
		"high": "High-resolution banner image URL"
	}
}

Note: This is a basic structure. Replace it with your actual plugin details.

Ensure you enable "Allow public access to update information" in your SupplyKit plugin plan details to make this information accessible.

Integration Within Your WordPress Plugin: Introduce a new class in your plugin dedicated to checking for and providing updates. This class will contain functions to get the update JSON from SupplyKit, use the JSON to provide update info for these WordPress filters and actions:


// Hook into the plugins API to modify the plugin's information display.
add_filter( 'plugins_api', 'your_custom_display_plugin_info_callback', 10, 3);

// Modify the site transient data for plugin updates.
add_filter( 'site_transient_update_plugins', 'your_custom_push_update_callback');

// Intercept the plugin update download process to potentially modify the download URL.
add_filter('upgrader_pre_download', 'your_custom_update_download_url_callback', 10, 4);

// Customize the plugin update message displayed within the plugin list in your WordPress admin.
add_action( 'in_plugin_update_message-your_plugin_folder/your_plugin_file', 'your_custom_plugin_update_message_callback', 10, 2 );

Note: When fetching the JSON make sure to append "&subscription=" along with the user's SupplyKit subscription ID to this URL for personalised update checks.

Fetching and Storing Update Information: Develop a function within your plugin that retrieves the update information from SupplyKit. Store this data using WordPress transients — a method for caching data for a short period. This ensures efficient use of resources by avoiding unnecessary repeated requests.

Incorporating Update Checks: Utilise WordPress hooks to integrate your update checking mechanism seamlessly with the WordPress dashboard. When your plugin identifies an update, it should inform the site admin through the standard WordPress update notifications. This integration ensures that plugin updates are as straightforward as installing updates for any other WordPress plugin.

Handling One-Time Use URLs: SupplyKit generates a unique, one-time use URL for each update to secure the process and ensure that only valid subscriptions can download updates. Incorporate an additional verification step in your update function to validate the subscription ID before the plugin attempts to update. This guarantees that updates are delivered smoothly and securely.

Putting It All Together

To illustrate the effectiveness of SupplyKit integration, we've implemented this subscription and update delivery system in our own BoxOffice WP Pro WordPress plugin. By leveraging SupplyKit, you not only simplify subscription management for your users but also ensure they always have access to the latest plugin features and fixes.

Conclusion

SupplyKit offers a powerful solution for selling and automatically updating WordPress plugins. By following the steps outlined above, you can enhance your plugin's value to users, ensuring they benefit from continuous improvements with minimal effort.

Get started by signing-up for a free SupplyKit account.