---
title: Hoster - Plugin Updates the easy way (Updated Workflow)
date: 2025-03-05T15:19:26Z
modified: 2026-09-22T19:51:44Z
permalink: "https://techarticles.co.uk/hoster-plugin-updates-the-easy-way-updated-workflow/"
type: post
status: publish
excerpt: ""
wpid: 4599
categories:
  - Automation
  - Blog
  - Coding
  - Hoster
  - Plugins
  - Wordpress
timestamp: 2026-09-22T19:51:44Z
tags:
  - Automation
  - Blog
  - Coding
  - Hoster
  - Plugins
  - Wordpress
---

For some of my free plugins, I use the [Hoster by plugins,](https://dplugins.com/downloads/hoster/) 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.

![](https://i.ytimg.com/vi/dpAV6mD3FbU/maxresdefault.jpg)

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](https://ta0.uk/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.

![Plugin management interface showing changelog, version details, and upload options.](https://techarticles.co.uk/wp-content/uploads/2025/03/hoster-example-plugin-addition.png)

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](https://ta0.uk/syncbackpro). Within the plugin directory, I have a folder for each plugin, which contains the files laid out as below

![File explorer showing release.bat, release.html, and url-parameters-toolkit.zip files.](https://techarticles.co.uk/wp-content/uploads/2025/03/hoster-example-local-folders.png)

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](https://ta0.uk/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.

![Command prompt showing a script run for SureCart, version 1.34, with a successful response message.](https://techarticles.co.uk/wp-content/uploads/2025/03/hoster-example-bat-script-run.png)

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

![FlowMatic workflow diagram showing steps: Webhooks capture, PHP function for release log, WordPress post update.](https://techarticles.co.uk/wp-content/uploads/2025/03/hoster-example-flowmattic-workflow.png)

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**

```
<span class="line"><span style="color: #F97583"><?</span><span style="color: #79B8FF">php</span></span>
<span class="line"><span style="color: #6A737D">/**</span></span>
<span class="line"><span style="color: #6A737D"> * Fetch the content of a file from a given URL.</span></span>
<span class="line"><span style="color: #6A737D"> *</span></span>
<span class="line"><span style="color: #6A737D"> * </span><span style="color: #F97583">@param</span><span style="color: #6A737D"> </span><span style="color: #F97583">string</span><span style="color: #6A737D"> $url The URL of the file to fetch.</span></span>
<span class="line"><span style="color: #6A737D"> * </span><span style="color: #F97583">@return</span><span style="color: #6A737D"> </span><span style="color: #F97583">string</span><span style="color: #6A737D">|</span><span style="color: #F97583">false</span><span style="color: #6A737D"> The file content on success, or false on failure.</span></span>
<span class="line"><span style="color: #6A737D"> */</span></span>
<span class="line"><span style="color: #F97583">function</span><span style="color: #E1E4E8"> </span><span style="color: #B392F0">fetch_file_content</span><span style="color: #E1E4E8">($url) {</span></span>
<span class="line"><span style="color: #E1E4E8">    </span><span style="color: #6A737D">// Validate the URL</span></span>
<span class="line"><span style="color: #E1E4E8">    </span><span style="color: #F97583">if</span><span style="color: #E1E4E8"> (</span><span style="color: #F97583">!</span><span style="color: #79B8FF">filter_var</span><span style="color: #E1E4E8">($url, </span><span style="color: #79B8FF">FILTER_VALIDATE_URL</span><span style="color: #E1E4E8">)) {</span></span>
<span class="line"><span style="color: #E1E4E8">        </span><span style="color: #F97583">return</span><span style="color: #E1E4E8"> </span><span style="color: #79B8FF">false</span><span style="color: #E1E4E8">;</span></span>
<span class="line"><span style="color: #E1E4E8">    }</span></span>
<span class="line"></span>
<span class="line"><span style="color: #E1E4E8">    </span><span style="color: #6A737D">// Fetch file content using file_get_contents (simple method)</span></span>
<span class="line"><span style="color: #E1E4E8">    $content </span><span style="color: #F97583">=</span><span style="color: #E1E4E8"> </span><span style="color: #F97583">@</span><span style="color: #79B8FF">file_get_contents</span><span style="color: #E1E4E8">($url);</span></span>
<span class="line"></span>
<span class="line"><span style="color: #E1E4E8">    </span><span style="color: #6A737D">// Fallback to cURL if file_get_contents fails</span></span>
<span class="line"><span style="color: #E1E4E8">    </span><span style="color: #F97583">if</span><span style="color: #E1E4E8"> ($content </span><span style="color: #F97583">===</span><span style="color: #E1E4E8"> </span><span style="color: #79B8FF">false</span><span style="color: #E1E4E8">) {</span></span>
<span class="line"><span style="color: #E1E4E8">        $ch </span><span style="color: #F97583">=</span><span style="color: #E1E4E8"> </span><span style="color: #79B8FF">curl_init</span><span style="color: #E1E4E8">();</span></span>
<span class="line"><span style="color: #E1E4E8">        </span><span style="color: #79B8FF">curl_setopt</span><span style="color: #E1E4E8">($ch, </span><span style="color: #79B8FF">CURLOPT_URL</span><span style="color: #E1E4E8">, $url);</span></span>
<span class="line"><span style="color: #E1E4E8">        </span><span style="color: #79B8FF">curl_setopt</span><span style="color: #E1E4E8">($ch, </span><span style="color: #79B8FF">CURLOPT_RETURNTRANSFER</span><span style="color: #E1E4E8">, </span><span style="color: #79B8FF">true</span><span style="color: #E1E4E8">);</span></span>
<span class="line"><span style="color: #E1E4E8">        </span><span style="color: #79B8FF">curl_setopt</span><span style="color: #E1E4E8">($ch, </span><span style="color: #79B8FF">CURLOPT_FOLLOWLOCATION</span><span style="color: #E1E4E8">, </span><span style="color: #79B8FF">true</span><span style="color: #E1E4E8">);</span></span>
<span class="line"><span style="color: #E1E4E8">        </span><span style="color: #79B8FF">curl_setopt</span><span style="color: #E1E4E8">($ch, </span><span style="color: #79B8FF">CURLOPT_SSL_VERIFYPEER</span><span style="color: #E1E4E8">, </span><span style="color: #79B8FF">false</span><span style="color: #E1E4E8">);</span></span>
<span class="line"><span style="color: #E1E4E8">        </span><span style="color: #79B8FF">curl_setopt</span><span style="color: #E1E4E8">($ch, </span><span style="color: #79B8FF">CURLOPT_TIMEOUT</span><span style="color: #E1E4E8">, </span><span style="color: #79B8FF">10</span><span style="color: #E1E4E8">);</span></span>
<span class="line"><span style="color: #E1E4E8">        </span></span>
<span class="line"><span style="color: #E1E4E8">        $content </span><span style="color: #F97583">=</span><span style="color: #E1E4E8"> </span><span style="color: #79B8FF">curl_exec</span><span style="color: #E1E4E8">($ch);</span></span>
<span class="line"><span style="color: #E1E4E8">        </span><span style="color: #79B8FF">curl_close</span><span style="color: #E1E4E8">($ch);</span></span>
<span class="line"><span style="color: #E1E4E8">    }</span></span>
<span class="line"></span>
<span class="line"><span style="color: #E1E4E8">    </span><span style="color: #F97583">return</span><span style="color: #E1E4E8"> $content </span><span style="color: #F97583">?:</span><span style="color: #E1E4E8"> </span><span style="color: #79B8FF">false</span><span style="color: #E1E4E8">;</span></span>
<span class="line"><span style="color: #E1E4E8">}</span></span>
<span class="line"></span>
<span class="line"></span>
```PHP

The 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

```
<span class="line"><span style="color: #F97583">@echo</span><span style="color: #E1E4E8"> </span><span style="color: #F97583">off</span></span>
<span class="line"><span style="color: #F97583">setlocal</span><span style="color: #E1E4E8"> </span><span style="color: #F97583">enabledelayedexpansion</span></span>
<span class="line"></span>
<span class="line"><span style="color: #6A737D">:: Define stable variables for easy editing</span></span>
<span class="line"><span style="color: #F97583">set</span><span style="color: #E1E4E8"> </span><span style="color: #9ECBFF">"</span><span style="color: #E1E4E8">baseURL</span><span style="color: #F97583">=</span><span style="color: #9ECBFF">WEBHOOK_URL"</span></span>
<span class="line"><span style="color: #F97583">set</span><span style="color: #E1E4E8"> </span><span style="color: #9ECBFF">"</span><span style="color: #E1E4E8">pluginName</span><span style="color: #F97583">=</span><span style="color: #9ECBFF">PLUGIN NAME"</span><span style="color: #E1E4E8">  :: Change this to the plugin name</span></span>
<span class="line"><span style="color: #F97583">set</span><span style="color: #E1E4E8"> </span><span style="color: #9ECBFF">"</span><span style="color: #E1E4E8">postMeta</span><span style="color: #F97583">=</span><span style="color: #9ECBFF">641"</span><span style="color: #E1E4E8">  :: Change this to the desired post meta key</span></span>
<span class="line"><span style="color: #F97583">set</span><span style="color: #E1E4E8"> </span><span style="color: #9ECBFF">"</span><span style="color: #E1E4E8">releaseURL</span><span style="color: #F97583">=</span><span style="color: #9ECBFF">yoursite.com/release.html"</span><span style="color: #E1E4E8">  :: Hardcoded release URL</span></span>
<span class="line"></span>
<span class="line"><span style="color: #6A737D">:: Prompt the user for the version number</span></span>
<span class="line"><span style="color: #F97583">set</span><span style="color: #E1E4E8"> /p version</span><span style="color: #F97583">=</span><span style="color: #E1E4E8">Enter the new %pluginName% version number: </span></span>
<span class="line"></span>
<span class="line"><span style="color: #6A737D">:: Encode pluginName for URL (replace spaces with %20)</span></span>
<span class="line"><span style="color: #F97583">set</span><span style="color: #E1E4E8"> </span><span style="color: #9ECBFF">"</span><span style="color: #E1E4E8">pluginNameEncoded</span><span style="color: #F97583">=</span><span style="color: #E1E4E8">%pluginName:</span><span style="color: #9ECBFF"> </span><span style="color: #E1E4E8">=%</span><span style="color: #79B8FF">%2</span><span style="color: #9ECBFF">0%"</span></span>
<span class="line"></span>
<span class="line"><span style="color: #6A737D">:: Encode releaseURL using PowerShell (handles &, ?, =, /, and spaces)</span></span>
<span class="line"><span style="color: #F97583">for</span><span style="color: #E1E4E8"> /f </span><span style="color: #FFAB70">%%A</span><span style="color: #E1E4E8"> </span><span style="color: #F97583">in</span><span style="color: #E1E4E8"> ('powershell -command </span><span style="color: #9ECBFF">"[System.Net.WebUtility]::UrlEncode(\"</span><span style="color: #E1E4E8">%releaseURL%\</span><span style="color: #9ECBFF">")"</span><span style="color: #E1E4E8">') </span><span style="color: #F97583">do</span><span style="color: #E1E4E8"> </span><span style="color: #F97583">set</span><span style="color: #E1E4E8"> </span><span style="color: #9ECBFF">"</span><span style="color: #E1E4E8">releaseURLEncoded</span><span style="color: #F97583">=</span><span style="color: #79B8FF">%%A</span><span style="color: #9ECBFF">"</span></span>
<span class="line"></span>
<span class="line"><span style="color: #6A737D">:: Construct the full URL with the hardcoded release URL</span></span>
<span class="line"><span style="color: #F97583">set</span><span style="color: #E1E4E8"> </span><span style="color: #9ECBFF">"</span><span style="color: #E1E4E8">fullURL</span><span style="color: #F97583">=</span><span style="color: #E1E4E8">%baseURL%</span><span style="color: #9ECBFF">/?new-value=</span><span style="color: #E1E4E8">%version%</span><span style="color: #9ECBFF">&plugin=</span><span style="color: #E1E4E8">%pluginNameEncoded%</span><span style="color: #9ECBFF">&post=</span><span style="color: #E1E4E8">%postMeta%</span><span style="color: #9ECBFF">&release=</span><span style="color: #E1E4E8">%releaseURLEncoded%</span><span style="color: #9ECBFF">"</span></span>
<span class="line"></span>
<span class="line"><span style="color: #6A737D">:: Use curl to send the request</span></span>
<span class="line"><span style="color: #E1E4E8">curl </span><span style="color: #9ECBFF">"</span><span style="color: #E1E4E8">%fullURL%</span><span style="color: #9ECBFF">"</span></span>
<span class="line"></span>
<span class="line"><span style="color: #6A737D">:: End the script</span></span>
<span class="line"><span style="color: #F97583">endlocal</span></span>
<span class="line"><span style="color: #F97583">pause</span></span>
<span class="line"></span>
```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.