Plugin Directory

Changeset 3423281


Ignore:
Timestamp:
12/19/2025 12:20:55 AM (4 months ago)
Author:
pushrelay
Message:

Release 1.5.0 – first functional admin version

Location:
pushrelay/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • pushrelay/trunk/includes/Admin/Page.php

    r3423267 r3423281  
    99
    1010    public static function init(): void {
    11         add_action( 'admin_menu', [ __CLASS__, 'menu' ] );
     11        add_action( 'admin_menu', [ __CLASS__, 'register_menu' ] );
    1212    }
    1313
    14     public static function menu(): void {
     14    public static function register_menu(): void {
    1515        add_menu_page(
    1616            'PushRelay',
     
    1818            'manage_options',
    1919            'pushrelay',
    20             [ __CLASS__, 'render' ],
    21             'dashicons-megaphone',
    22             56
     20            [ __CLASS__, 'render_page' ],
     21            'dashicons-megaphone'
    2322        );
    2423    }
    2524
    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', '' );
    2745        ?>
    2846        <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>
    3290        </div>
    3391        <?php
  • pushrelay/trunk/includes/Core/Plugin.php

    r3423267 r3423281  
    1111final class Plugin {
    1212
    13     private static $instance;
     13    private static $instance = null;
    1414
    1515    public static function instance(): self {
    16         if ( ! self::$instance ) {
     16        if ( null === self::$instance ) {
    1717            self::$instance = new self();
    1818        }
     
    2121
    2222    private function __construct() {
    23         $this->init_admin();
    24         $this->init_health();
     23        $this->includes();
     24        $this->init();
    2525    }
    2626
    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';
    3130    }
    3231
    33     private function init_health(): void {
     32    private function init(): void {
     33        Page::init();
    3434        Health::init();
    3535    }
  • pushrelay/trunk/includes/Utils/Health.php

    r3423267 r3423281  
    1818
    1919        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' ) .
    2121        '</p></div>';
    2222    }
  • pushrelay/trunk/pushrelay.php

    r3423267 r3423281  
    44 * Plugin URI: https://pushrelay.com
    55 * Description: Native Push Notifications for WordPress powered by PushRelay.
    6  * Version: 1.4.0
     6 * Version: 1.5.0
    77 * Author: PushRelay
    88 * Author URI: https://pushrelay.com
     
    1818}
    1919
    20 define( 'PUSHRELAY_VERSION', '1.4.0' );
     20define( 'PUSHRELAY_VERSION', '1.5.0' );
    2121define( 'PUSHRELAY_PLUGIN_FILE', __FILE__ );
    2222define( 'PUSHRELAY_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    23 define( 'PUSHRELAY_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
    2423
    25 require_once PUSHRELAY_PLUGIN_DIR . 'includes/bootstrap.php';
     24require_once PUSHRELAY_PLUGIN_DIR . 'includes/Core/Plugin.php';
    2625
    2726add_action( 'plugins_loaded', function () {
  • pushrelay/trunk/readme.txt

    r3423267 r3423281  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 1.4.0
     7Stable tag: 1.5.0
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 == Short Description ==
    1211Native push notifications for WordPress powered by PushRelay.
    1312
    1413== 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.
     14PushRelay allows WordPress sites to connect with the PushRelay platform to enable modern web push notifications.
    1615
    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
     16This 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.
    3317
    3418== External Services ==
    3519This plugin connects to the PushRelay API (https://pushrelay.com) to enable push notification functionality.
    3620
    37 Data sent may include:
    38 * Site identifiers
    39 * Configuration data required to initialize push notifications
     21Data sent:
     22- API key provided by the site administrator
    4023
    41 This service is provided by PushRelay.
    42 * Terms of Service: https://pushrelay.com/terms
    43 * Privacy Policy: https://pushrelay.com/privacy
     24Purpose:
     25- Verify connection readiness
     26- Enable future push notification features
     27
     28Service provider:
     29PushRelay 
     30Terms of Service: https://pushrelay.com/terms 
     31Privacy Policy: https://pushrelay.com/privacy 
    4432
    4533== 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.
     341. Upload the plugin to your WordPress site.
     352. Activate PushRelay.
     363. Go to PushRelay → Settings.
     374. Enter your PushRelay API key.
    4938
    5039== 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
    6045
    6146== Upgrade Notice ==
    62 = 1.4.0 =
    63 First stable release after architectural rebuild.
     47= 1.5.0 =
     48First functional release with admin interface and connection setup.
Note: See TracChangeset for help on using the changeset viewer.