commit 74a35d83459dcd08ddf0bf325277d20eb3834166 Author: dyzulk <66510723+dyzulk@users.noreply.github.com> Date: Mon Jan 19 10:13:12 2026 +0700 Initial commit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d4d4f90 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,52 @@ +name: Release Plugin + +on: + push: + tags: + - 'v*' # Trigger on version tags, e.g. v1.0.0 + +jobs: + build: + name: Create Release + runs-on: ubuntu-latest + permissions: + contents: write # Needed to create releases + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Get Version + id: get_version + run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT + + - name: Create ZIP Archive + run: | + # Create a temporary directory for the zip + mkdir temp_zip + + # Copy files to temp directory, excluding unwanted files + rsync -av --progress . temp_zip --exclude .git --exclude .github --exclude .gitignore --exclude LICENSE --exclude README.md --exclude temp_zip + + # Create the zip file + cd temp_zip + zip -r ../plugin-example.zip . + cd .. + + echo "Created plugin-example.zip" + + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + files: plugin-example.zip + name: Release ${{ steps.get_version.outputs.VERSION }} + body: | + Automatic release for version ${{ steps.get_version.outputs.VERSION }} + + **Installation:** + 1. Download `plugin-example.zip` + 2. Upload in Mivo > Settings > Plugins + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1a14372 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 DyzulkDev + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..fdf0fbb --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +# Example Plugin for Mivo + +**Category:** System Tools +**Author:** DyzulkDev +**Version:** 1.0.0 + +This is a **developer example** demonstrating how to create plugins for the Mivo Hotspot Manager. It showcases the use of Hooks and Routers to extend core functionality. + +## Features +- **Router Hook**: Registers a custom page at `/plugin-test`. +- **Head Hook**: Injects custom CSS (green border) into the page head. +- **Footer Hook**: Injects a custom message into the page footer. + +## Installation +1. Download the plugin ZIP file. +2. Go to **Mivo > Settings > Plugins**. +3. Click **Upload Plugin** and select the ZIP file. +4. The plugin will immediately activate. + +## Verification +- **Visual Check**: You should see a green top border on all pages. +- **Footer Check**: A message "Plugin System is Working! 🚀" appears in the footer. +- **Route Check**: Visit `/plugin-test` to see the custom page. + +## For Developers +Check the `plugin.php` file source code to understand how `Hooks::addAction` works for `router_init`, `mivo_head`, and `mivo_footer`. diff --git a/plugin.php b/plugin.php new file mode 100644 index 0000000..4a93710 --- /dev/null +++ b/plugin.php @@ -0,0 +1,40 @@ += 1.0.0 + */ + +use App\Core\Hooks; +use App\Core\Router; + +// 1. Hook into Router to add a custom page +Hooks::addAction('router_init', function(Router $router) { + $router->get('/plugin-test', function() { + echo "

Hello from Example Plugin!

"; + echo "

This page is registered via router_init hook.

"; + echo "Back to Home"; + }); +}); + +// 2. Hook into Head to add custom CSS +Hooks::addAction('mivo_head', function() { + echo ""; + echo ""; +}); + +// 3. Hook into Footer to add custom JS or Text +Hooks::addAction('mivo_footer', function() { + echo ""; + echo "
+ Plugin System is Working! 🚀 + Plugin Test +
"; +});