NovaStats HockeyData self-updates
The hockey game center widget for WordPress.
by Nachbauer GmbH · github.com/naba-network/hd-plugin-wordpress · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/naba-network/hd-plugin-wordpress/archive/refs/heads/main.zipShips its own WordPress updater (Plugin Update Checker), so new versions show up under Dashboard → Updates.
The hockey game center widget for WordPress.
Development
This plugin has been updated to use modern development standards, including Composer for PHP dependency management and PSR-4 autoloading.
Prerequisites
Setup Instructions
- Install PHP Dependencies:
Since the plugin now uses Composer for managing the
NabaHdwpnamespace and autoloading, you must install the dependencies before the plugin will work. Run the following command in the plugin's root directory:
composer install
- Install Frontend Dependencies (if applicable):
npm ci
npm run build
Note: Make sure to build your frontend assets before releasing or using the plugin if a build step is required (e.g., npm run build).
Building for Production
When deploying this plugin, ensure that the vendor/ directory generated by Composer is included in your deployment, as it contains the required autoloader. Do not commit vendor/ or node_modules/ to your Git repository (ensure they are in .gitignore).
To easily package a production-ready .zip release without any development files, run the provided build script:
./build.sh
This will automatically include only the files and directories explicitly defined in .distinclude, install production dependencies, package the plugin, and then restore your local development dependencies.
Automatic Updates & Deployment
This plugin now features an integrated GitHub Actions build pipeline and automatic WordPress updates:
- Build Pipeline: A GitHub Actions workflow (
.github/workflows/release.yml) automatically triggers on new tags (e.g.,v1.0.0) or GitHub releases. It builds the plugin usingbuild.shand attaches the final.zipas a release asset. - Automatic Updates: The plugin incorporates
plugin-update-checkerto connect directly to the GitHub repository (naba-network/hd-plugin-wordpress). Updates are installed from the built.ziprelease asset (release assets are enabled viaenableReleaseAssets()), not from branch zipballs — those lack the gitignoredvendor/andfrontend/build artifacts and would install a broken plugin. When a new release is available, it appears in the WordPress admin panel alongside standard plugin updates, allowing for seamless updates. - Repository visibility: The GitHub repository must be public for unauthenticated update checks. If the repository is (or becomes) private, define the constant
NABA_HDWP_GITHUB_TOKENinwp-config.phpwith a GitHub token that has read access to the repository; the updater passes it tosetAuthentication()automatically. Never commit a token to the codebase.
Code Quality and Linting
This project uses phpstan and php-cs-fixer to maintain code quality, alongside PHPUnit for testing. You can run the following commands:
- Run Unit Tests:
composer testornpm run test:unit - Check Code Formatting:
composer cs-check - Fix Code Formatting:
composer cs-fix - Run Static Analysis:
composer phpstan
Version Management
To easily update the plugin version across package.json, plugin.php, and CHANGELOG.md, use the built-in release script:
npm run release [major | minor | patch | <version>]
npm run release(no arguments) bumps the patch version (e.g.,1.0.0->1.0.1).npm run release minorbumps the minor version (e.g.,1.0.0->1.1.0).npm run release majorbumps the major version (e.g.,1.0.0->2.0.0).npm run release 2.5.0sets the version explicitly to2.5.0.
To automatically commit your changes with a clean release message ("Release v1.0.0"):
npm run release:commit
To create and push a git tag matching the current version:
npm run release:tag