diff --git a/CHANGELOG.md b/CHANGELOG.md index f344ebe..cb73233 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.1] - 2026-02-02 + +### Added + +- **Localhost license bypass** - License check is automatically bypassed on local development environments + - Detects `localhost`, `127.0.0.1`, `::1` + - Detects common local TLDs: `.local`, `.test`, `.localhost`, `.dev.local` + - Allows full plugin functionality without license on development sites + ## [0.5.0] - 2026-02-02 ### Added diff --git a/README.md b/README.md index 1afd375..bcd31d4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Stream music over ActivityPub - Build your own music streaming platform for Musicians and Labels. -[![Version](https://img.shields.io/badge/version-0.5.0-blue.svg)](CHANGELOG.md) +[![Version](https://img.shields.io/badge/version-0.5.1-blue.svg)](CHANGELOG.md) [![PHP](https://img.shields.io/badge/PHP-%3E%3D8.3-purple.svg)](https://php.net) [![WordPress](https://img.shields.io/badge/WordPress-%3E%3D6.4-blue.svg)](https://wordpress.org) [![License](https://img.shields.io/badge/license-GPL--2.0%2B-green.svg)](https://www.gnu.org/licenses/gpl-2.0.html) diff --git a/includes/License/Manager.php b/includes/License/Manager.php index f388480..da4b242 100644 --- a/includes/License/Manager.php +++ b/includes/License/Manager.php @@ -421,15 +421,50 @@ final class Manager { /** * Check if the license is currently valid. * - * Uses cached status for performance. + * Uses cached status for performance. Bypasses license check on localhost. * * @return bool */ public static function is_license_valid(): bool { + // Bypass license check on localhost for development. + if ( self::is_localhost() ) { + return true; + } + $status = get_option( self::OPTION_LICENSE_STATUS, 'unchecked' ); return 'valid' === $status; } + /** + * Check if the current site is running on localhost. + * + * @return bool + */ + public static function is_localhost(): bool { + $host = wp_parse_url( home_url(), PHP_URL_HOST ); + + // Common localhost identifiers. + $localhost_hosts = array( + 'localhost', + '127.0.0.1', + '::1', + ); + + if ( in_array( $host, $localhost_hosts, true ) ) { + return true; + } + + // Common local development TLDs. + $local_tlds = array( '.local', '.test', '.localhost', '.dev.local' ); + foreach ( $local_tlds as $tld ) { + if ( str_ends_with( $host, $tld ) ) { + return true; + } + } + + return false; + } + /** * Get the license key. * diff --git a/wp-fedistream.php b/wp-fedistream.php index 63ce11e..cc155e0 100644 --- a/wp-fedistream.php +++ b/wp-fedistream.php @@ -3,7 +3,7 @@ * Plugin Name: WP FediStream * Plugin URI: https://src.bundespruefstelle.ch/magdev/wp-fedistream * Description: Stream music over ActivityPub - Build your own music streaming platform for Musicians and Labels. - * Version: 0.5.0 + * Version: 0.5.1 * Requires at least: 6.4 * Requires PHP: 8.3 * Author: Marco Graetsch @@ -26,7 +26,7 @@ if ( ! defined( 'ABSPATH' ) ) { * * @var string */ -define( 'WP_FEDISTREAM_VERSION', '0.5.0' ); +define( 'WP_FEDISTREAM_VERSION', '0.5.1' ); /** * Plugin file path.