For some of my free plugins, I use the Hoster by plugins, and I have built up a workflow for doing this that allows me to set up a plugin and then push updates directly from my Windows machine using a bat script and an update file. In this article, I will share with you my updated methodology.
You can view my original video below this update now includes a sleeker flow and auto updating the changelog.
Now I use Hoster for free plugins as currently there are no licensing built in, but this is coming very soon. For paid plugins, I use SureCart, but being a hosted solution, I don’t think it’s exactly fair for me to host my Free plugins on SureCart.
So Hoster allows me to remotely update plugins either directly from Github based on a release methodology, and for smaller ones, I just upload a new zip file and update the release, but it’s a bit of a pain having to login every time to do the update of the details. Below is a typical plugin screen.

To issue a release I need to update the change log (2) and version (1) meta fields, so I set about working out how to do this inspecting the database showed me they where metafields with the names I’ve given them above so I set about working out how I would modify them.
I settled on a bat script that would sit in the plugin directory, and the plugin directory would be auto-synched between my local machine and the remote site using SyncBackPro. Within the plugin directory, I have a folder for each plugin, which contains the files laid out as below

release.html contains the changelog, and the zip file is the plugin, and the release.bat is the bat file I run.
The BAT file contains hardcoded variables for the plugin, such as the flowmattic webhook, the plugin’s name, the post meta for the plugin and the releaseurl, which points to the synced version of release.html for that particular plugin. When run it asks a single question what is the new plugin version i.e 1.1 and then it proceeds to send this information to the flowmattic webhook.

The receiving webhook is now much simpler too, it receives the following parameters, Update URL for the HTML, version number and Post Meta

A) is our incoming webhook which is what captures the data for the BAT Script
B) Runs the fetch_file_content PHP function to grab the content of the Release URL and return it to flowmattic (see code Block Below)
c) then selects the post Id and updates the two custom meta fields of version and change log and applies the changes
The Following codeblock is stored on the site using WPCodeBox
<?php
/**
* Fetch the content of a file from a given URL.
*
* @param string $url The URL of the file to fetch.
* @return string|false The file content on success, or false on failure.
*/
function fetch_file_content($url) {
// Validate the URL
if (!filter_var($url, FILTER_VALIDATE_URL)) {
return false;
}
// Fetch file content using file_get_contents (simple method)
$content = @file_get_contents($url);
// Fallback to cURL if file_get_contents fails
if ($content === false) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$content = curl_exec($ch);
curl_close($ch);
}
return $content ?: false;
}
PHPThe below is the content of the bat script all the set paramaters are included at the top of the file the only user input is the version number
@echo off
setlocal enabledelayedexpansion
:: Define stable variables for easy editing
set "baseURL=WEBHOOK_URL"
set "pluginName=PLUGIN NAME" :: Change this to the plugin name
set "postMeta=641" :: Change this to the desired post meta key
set "releaseURL=yoursite.com/release.html" :: Hardcoded release URL
:: Prompt the user for the version number
set /p version=Enter the new %pluginName% version number:
:: Encode pluginName for URL (replace spaces with %20)
set "pluginNameEncoded=%pluginName: =%%20%"
:: Encode releaseURL using PowerShell (handles &, ?, =, /, and spaces)
for /f %%A in ('powershell -command "[System.Net.WebUtility]::UrlEncode(\"%releaseURL%\")"') do set "releaseURLEncoded=%%A"
:: Construct the full URL with the hardcoded release URL
set "fullURL=%baseURL%/?new-value=%version%&plugin=%pluginNameEncoded%&post=%postMeta%&release=%releaseURLEncoded%"
:: Use curl to send the request
curl "%fullURL%"
:: End the script
endlocal
pause
BAT (Batchfile)Using the code and this workflow I can add a new update to my plugins in a mater of seconds, the updates are automatically uploaded and once i run the BAT file a new update is waiting for my users to download, the same principle could be applied to other meta fields too i.e download link but currently I have no use for it.
As per the opening few paragraphs Hoster is due to get some extensive upgrades over the coming months and I will be keen to do a write up and video on intergrating some of these in your workflows, including issuing licences via various payment providors.