Changeset 3423281
- Timestamp:
- 12/19/2025 12:20:55 AM (4 months ago)
- Location:
- pushrelay/trunk
- Files:
-
- 5 edited
-
includes/Admin/Page.php (modified) (2 diffs)
-
includes/Core/Plugin.php (modified) (2 diffs)
-
includes/Utils/Health.php (modified) (1 diff)
-
pushrelay.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
pushrelay/trunk/includes/Admin/Page.php
r3423267 r3423281 9 9 10 10 public static function init(): void { 11 add_action( 'admin_menu', [ __CLASS__, ' menu' ] );11 add_action( 'admin_menu', [ __CLASS__, 'register_menu' ] ); 12 12 } 13 13 14 public static function menu(): void {14 public static function register_menu(): void { 15 15 add_menu_page( 16 16 'PushRelay', … … 18 18 'manage_options', 19 19 'pushrelay', 20 [ __CLASS__, 'render' ], 21 'dashicons-megaphone', 22 56 20 [ __CLASS__, 'render_page' ], 21 'dashicons-megaphone' 23 22 ); 24 23 } 25 24 26 public static function render(): void { 25 public static function render_page(): void { 26 if ( ! current_user_can( 'manage_options' ) ) { 27 return; 28 } 29 30 $status_message = ''; 31 32 if ( 33 isset( $_POST['pushrelay_nonce'], $_POST['pushrelay_api_key'] ) && 34 wp_verify_nonce( 35 sanitize_text_field( wp_unslash( $_POST['pushrelay_nonce'] ) ), 36 'pushrelay_save_settings' 37 ) 38 ) { 39 $api_key = sanitize_text_field( wp_unslash( $_POST['pushrelay_api_key'] ) ); 40 update_option( 'pushrelay_api_key', $api_key ); 41 $status_message = esc_html__( 'API key saved. Connection ready.', 'pushrelay' ); 42 } 43 44 $stored_key = get_option( 'pushrelay_api_key', '' ); 27 45 ?> 28 46 <div class="wrap"> 29 <h1>PushRelay</h1> 30 <p><strong>Status:</strong> Core system loaded successfully.</p> 31 <p>This plugin is running correctly.</p> 47 <h1><?php echo esc_html__( 'PushRelay Settings', 'pushrelay' ); ?></h1> 48 49 <p><?php echo esc_html__( 'PushRelay is active and ready.', 'pushrelay' ); ?></p> 50 51 <?php if ( $status_message ) : ?> 52 <div class="notice notice-success"> 53 <p><?php echo esc_html( $status_message ); ?></p> 54 </div> 55 <?php endif; ?> 56 57 <form method="post"> 58 <?php wp_nonce_field( 'pushrelay_save_settings', 'pushrelay_nonce' ); ?> 59 60 <table class="form-table"> 61 <tr> 62 <th scope="row"> 63 <label for="pushrelay_api_key"> 64 <?php echo esc_html__( 'API Key', 'pushrelay' ); ?> 65 </label> 66 </th> 67 <td> 68 <input 69 type="password" 70 id="pushrelay_api_key" 71 name="pushrelay_api_key" 72 value="<?php echo esc_attr( $stored_key ); ?>" 73 class="regular-text" 74 /> 75 </td> 76 </tr> 77 </table> 78 79 <?php submit_button(); ?> 80 </form> 81 82 <h2><?php echo esc_html__( 'Status', 'pushrelay' ); ?></h2> 83 <p> 84 <?php 85 echo $stored_key 86 ? esc_html__( 'Connection ready.', 'pushrelay' ) 87 : esc_html__( 'No API key configured.', 'pushrelay' ); 88 ?> 89 </p> 32 90 </div> 33 91 <?php -
pushrelay/trunk/includes/Core/Plugin.php
r3423267 r3423281 11 11 final class Plugin { 12 12 13 private static $instance ;13 private static $instance = null; 14 14 15 15 public static function instance(): self { 16 if ( !self::$instance ) {16 if ( null === self::$instance ) { 17 17 self::$instance = new self(); 18 18 } … … 21 21 22 22 private function __construct() { 23 $this->in it_admin();24 $this->init _health();23 $this->includes(); 24 $this->init(); 25 25 } 26 26 27 private function init_admin(): void { 28 if ( is_admin() ) { 29 Page::init(); 30 } 27 private function includes(): void { 28 require_once PUSHRELAY_PLUGIN_DIR . 'includes/Admin/Page.php'; 29 require_once PUSHRELAY_PLUGIN_DIR . 'includes/Utils/Health.php'; 31 30 } 32 31 33 private function init_health(): void { 32 private function init(): void { 33 Page::init(); 34 34 Health::init(); 35 35 } -
pushrelay/trunk/includes/Utils/Health.php
r3423267 r3423281 18 18 19 19 echo '<div class="notice notice-success"><p>' . 20 esc_html__( 'PushRelay is ready. Core system loaded successfully.', 'pushrelay' ) .20 esc_html__( 'PushRelay is active and ready.', 'pushrelay' ) . 21 21 '</p></div>'; 22 22 } -
pushrelay/trunk/pushrelay.php
r3423267 r3423281 4 4 * Plugin URI: https://pushrelay.com 5 5 * Description: Native Push Notifications for WordPress powered by PushRelay. 6 * Version: 1. 4.06 * Version: 1.5.0 7 7 * Author: PushRelay 8 8 * Author URI: https://pushrelay.com … … 18 18 } 19 19 20 define( 'PUSHRELAY_VERSION', '1. 4.0' );20 define( 'PUSHRELAY_VERSION', '1.5.0' ); 21 21 define( 'PUSHRELAY_PLUGIN_FILE', __FILE__ ); 22 22 define( 'PUSHRELAY_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 23 define( 'PUSHRELAY_PLUGIN_URL', plugin_dir_url( __FILE__ ) );24 23 25 require_once PUSHRELAY_PLUGIN_DIR . 'includes/ bootstrap.php';24 require_once PUSHRELAY_PLUGIN_DIR . 'includes/Core/Plugin.php'; 26 25 27 26 add_action( 'plugins_loaded', function () { -
pushrelay/trunk/readme.txt
r3423267 r3423281 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 1. 4.07 Stable tag: 1.5.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 10 11 == Short Description ==12 11 Native push notifications for WordPress powered by PushRelay. 13 12 14 13 == Description == 15 PushRelay is a native WordPress plugin that provides a solid and standards-compliant foundation for web push notifications powered by the PushRelay platform.14 PushRelay allows WordPress sites to connect with the PushRelay platform to enable modern web push notifications. 16 15 17 This release represents the first stable architecture of the plugin after an internal rebuild, focusing on reliability, compatibility, and long-term extensibility. 18 19 Current features include: 20 * Clean and secure plugin architecture 21 * WordPress admin menu integration 22 * Core system health checks 23 * Compatibility with WordPress coding standards 24 25 Planned features for upcoming releases: 26 * Automatic service worker injection 27 * Push notification delivery via PushRelay API 28 * WooCommerce native automation 29 * Language-based subscriber segmentation 30 * Manual and automated push notifications 31 * Subscriber analytics and notification flows 32 * No external dashboard required 16 This plugin provides a secure and simple way to configure your PushRelay API key directly from the WordPress admin panel. Future versions will include advanced automation, WooCommerce integration, and real-time push delivery. 33 17 34 18 == External Services == 35 19 This plugin connects to the PushRelay API (https://pushrelay.com) to enable push notification functionality. 36 20 37 Data sent may include: 38 * Site identifiers 39 * Configuration data required to initialize push notifications 21 Data sent: 22 - API key provided by the site administrator 40 23 41 This service is provided by PushRelay. 42 * Terms of Service: https://pushrelay.com/terms 43 * Privacy Policy: https://pushrelay.com/privacy 24 Purpose: 25 - Verify connection readiness 26 - Enable future push notification features 27 28 Service provider: 29 PushRelay 30 Terms of Service: https://pushrelay.com/terms 31 Privacy Policy: https://pushrelay.com/privacy 44 32 45 33 == Installation == 46 1. Upload the plugin to the `/wp-content/plugins/` directory, or install it via the WordPress Plugins screen. 47 2. Activate the plugin through the “Plugins” menu in WordPress. 48 3. Go to **PushRelay** in the WordPress admin menu to verify system status. 34 1. Upload the plugin to your WordPress site. 35 2. Activate PushRelay. 36 3. Go to PushRelay → Settings. 37 4. Enter your PushRelay API key. 49 38 50 39 == Changelog == 51 = 1.4.0 = 52 * Major refactor and stabilization release 53 * Rebuilt plugin architecture 54 * Admin menu integration 55 * Core system health check 56 * Clean foundation for future push features 57 58 = Earlier versions = 59 * Initial experimental releases and internal hotfixes 40 = 1.5.0 = 41 * Added admin settings page 42 * Secure API key storage 43 * Connection status indicator 44 * Initial functional release 60 45 61 46 == Upgrade Notice == 62 = 1. 4.0 =63 First stable release after architectural rebuild.47 = 1.5.0 = 48 First functional release with admin interface and connection setup.
Note: See TracChangeset
for help on using the changeset viewer.