Ready to publish your first plugin? Here’s what you need to do.
Generate a starter template
Go to getpremia.com and use the form to generate your first plugin template. The template includes the basics for your plugin. You can customise this however you want – just make sure not to delete any files or code from this template. (except for the admin_notice function)
Create a Github repository and push the files to Github
Create a new repository using the files from the template, and push these to Github.
Publish a new release
You can create a new release using the steps described here. This will also trigger the Release workflow to run, creating a ZIP file with the essential files.
Create a Personal Access Token
Premia uses a personal access token to retrieve the latest releases from a repository. We highly recommend to use a bot account for this. The bot account has limited access to specified repositories.
So basically, you want to create this bot account and then invite it to collaborate on your repository. You can then create a personal access token with the bot account and give it access to write/read packages.
Create a new post/page/product or other type
On websites in which Premia is active, every post/page/product or other type includes a metabox called Premia Settings. You can add your Github Repository URL and personal access token there. If your plugin doesn’t require a license, make sure to check the “do not validate licenses” checkbox. This is usually the case for normal posts or pages. To make your plugin downloadable, use the following shortcodes:
[premia_download_link]
[premia_download_button]
When you sell your plugin via Woocommerce licenses are created automatically. Only customers can download your plugin and received updates for your plugin.