WP Manifestindependent plugin directory
manifest / events / hd-plugin-wordpress

NovaStats HockeyData self-updates

The hockey game center widget for WordPress.

by Nachbauer GmbH · github.com/naba-network/hd-plugin-wordpress · website

0stars
0forks

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.zip

Ships 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

  1. Install PHP Dependencies: Since the plugin now uses Composer for managing the NabaHdwp namespace and autoloading, you must install the dependencies before the plugin will work. Run the following command in the plugin's root directory:
composer install
  1. 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 using build.sh and attaches the final .zip as a release asset.
  • Automatic Updates: The plugin incorporates plugin-update-checker to connect directly to the GitHub repository (naba-network/hd-plugin-wordpress). Updates are installed from the built .zip release asset (release assets are enabled via enableReleaseAssets()), not from branch zipballs — those lack the gitignored vendor/ and frontend/ 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_TOKEN in wp-config.php with a GitHub token that has read access to the repository; the updater passes it to setAuthentication() 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 test or npm 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 minor bumps the minor version (e.g., 1.0.0 -> 1.1.0).
  • npm run release major bumps the major version (e.g., 1.0.0 -> 2.0.0).
  • npm run release 2.5.0 sets the version explicitly to 2.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