Skip to content

janmz/wp_plugin_releaser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WP_Plugin_Releaser

Go Version Release License: MIT (Modified) Support: CFI-Kinderhilfe Build Status

🌍 🇩🇪 Deutsche Version | 🇺🇸 English Version

wp_plugin_releaser is a lightweight Go tool for automated WordPress plugin releases, with full internationalization support, including:

  • Automatic version number updates in main PHP file
  • Update info management (update_info.json)
  • ZIP file creation with configurable exclusion patterns
  • Optional automatic SSH upload to update server
  • Multi-language support (German/English) with automatic language detection

Internationalization

This tool supports multiple languages:

  • English (default)
  • German (Deutsch)
  • Automatic language detection based on system locale
  • Extensible - add more languages by creating JSON files in locales/

Language Override

# Force German output
LANG=de_DE.UTF-8 wp_plugin_release /path/to/plugin

# Force English output  
LANG=en_US.UTF-8 wp_plugin_release /path/to/plugin

Features

  • Automatic version detection (from plugin comment or class variable)
  • Update info management (update_info.json)
  • ZIP creation with skip patterns
  • SSH upload (key or password based)
  • Comprehensive logging with all steps
  • Hardware-bound encryption for secure password storage
  • Multi-language support with automatic detection
  • Plugin-update-checker integration for YahnisElsts

Installation

Binary Download

Download the latest release for your platform: Releases

Go Install

go install github.com/janmz/wp_plugin_release@latest

Build from Source

git clone https://github.com/janmz/wp_plugin_release.git
cd wp_plugin_release
make build

Usage

Basic Usage

wp_plugin_release /path/to/plugin
  • If no path is specified, the current directory is used
  • Expects an update.config file in the working directory

Configuration

update.config Example

{
  "main_php_file": "my-plugin.php",
  "skip_pattern": ["*.psd", "*.bak", "node_modules", ".git"],
  "ssh_host": "example.com",
  "ssh_port": "22", 
  "ssh_dir_base": "/var/www/html/updates",
  "ssh_user": "username",
  "ssh_key_file": "/path/to/key.pem",
  "ssh_password": "password in plain text",
  "ssh_secure_password": "will contain encrypted password after first run"
}

Configuration Fields

Field Description Required
main_php_file Main PHP file of the plugin
skip_pattern Files/directories to exclude from ZIP
ssh_host SSH hostname for upload
ssh_port SSH port (default: 22)
ssh_dir_base Base directory on server
ssh_user SSH username
ssh_key_file Path to SSH private key
ssh_known_hosts Path to OpenSSH known_hosts file ✅ (or -fetch-hostkey)
ssh_password SSH password (encrypted after first use)

SSH Host Key Verification (Required)

SSH upload requires host key verification via ssh_known_hosts or the default ~/.ssh/known_hosts. If the file is missing or does not contain the server key, run once with -fetch-hostkey to fetch and append the key:

wp_plugin_release -fetch-hostkey /path/to/plugin

-trustserver is kept as an alias for -fetch-hostkey.

Create a known hosts file manually with:

ssh-keyscan -p 22 your-server.example.com >> known_hosts

Example config:

{
  "ssh_known_hosts": "known_hosts"
}

Security Features

  • Hardware-bound encryption: Passwords are encrypted with a key derived from your system's hardware
  • Automatic password encryption: Plain text passwords are automatically encrypted after first use
  • Secure file handling: Backup files are created before modifications
  • SSH key authentication: Supports both key and password authentication

Development

Setup Development Environment

make setup

Build

# Standard build
make build

# Build for all platforms
make build-all

Testing

# Run tests
make test

# Test internationalization
make test-i18n

# Validate translations
make i18n-validate

Internationalization Development

Extract Translation Keys

make i18n-extract

Add New Language

  1. Create locales/[lang_code].json (e.g., locales/fr.json)
  2. Copy structure from locales/en.json
  3. Translate all values
  4. Test with LANG=[lang_code] wp_plugin_release --help

Translation File Structure

{
  "app.name": "WordPress Plugin Release Tool",
  "app.version": "Version %s from %s started",
  "error.no_directory": "Directory %s does not exist",
  "log.processing_php": "Processing PHP file: %s"
}

Release Workflow

Automated Release

  1. Tag: git tag v1.0.0git push origin v1.0.0
  2. GitHub Actions builds binaries for Linux/macOS/Windows and creates release with assets

Manual Release

make release

Requirements

Runtime

  • No dependencies (static binary)
  • Optional: SSH client for uploads

Development Environment

  • Go 1.21+
  • Make (for build automation)
  • Git

Contributing

Contributions are welcome! Please check CONTRIBUTING.md before creating a pull request.

Translation Contributions

We especially welcome contributions for additional languages:

  1. Fork the repository
  2. Add your language file in locales/[lang_code].json
  3. Test the translation
  4. Submit a pull request

License

This software is under a modified MIT license (see LICENSE). You may freely use, modify, and distribute the code, provided you credit the original author Jan Neuhaus and maintain a link to the original repository: https://github.com/janmz/wp_plugin_release.

No warranty is provided.

Support

If you find this project helpful, please support CFI-Kinderhilfe: https://cfi-kinderhilfe.de (Donations go to CFI-Kinderhilfe, not the author.)

Contact

Author: Jan Neuhaus – VAYA Consulting
Repository: https://github.com/janmz/wp_plugin_release

Additional Resources

Changelog

v1.1.0 (Current)

  • Full internationalization support (German/English)
  • Automatic language detection
  • Enhanced CI/CD pipeline
  • Improved error handling and logging
  • Various bug fixes and improvements

v1.0.0

  • Initial release
  • Basic plugin release functionality
  • SSH upload support
  • Hardware-bound encryption

About

A go application that pushes a WordPress-Plugin-Release on a private Server. In connection with https://github.com/YahnisElsts/plugin-update-checker it allows the easy distribution of WordPress Plugins.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors