Plugin Directory

Changeset 3487927


Ignore:
Timestamp:
03/21/2026 07:12:55 PM (7 days ago)
Author:
ehtmlu
Message:

Version 1.3.0

Location:
peak-publisher
Files:
6 edited
22 copied

Legend:

Unmodified
Added
Removed
  • peak-publisher/tags/1.3.0/assets/js/components/Settings.js

    r3444907 r3487927  
    44    const { useState, useEffect, createElement, createInterpolateElement } = wp.element;
    55    const { useSelect } = wp.data;
    6     const { Button, Panel, PanelBody, ToggleControl, TextareaControl, SelectControl, RadioControl } = wp.components;
     6    const { Button, Panel, PanelBody, ToggleControl, TextControl, TextareaControl, SelectControl, RadioControl } = wp.components;
    77    const { showAlert } = Pblsh.Utils;
    88    const settingsController = window.Pblsh.Controllers && window.Pblsh.Controllers.Settings ? window.Pblsh.Controllers.Settings : null;
     
    1919        ip_whitelist: [],
    2020        count_plugin_installations: false,
     21        standalone_redirect_url: '',
    2122    });
    2223    const [currentSection, setCurrentSection] = useState('general');
     
    3839                ip_whitelist: getTextareaFromList(Array.isArray(serverSettings.ip_whitelist) ? serverSettings.ip_whitelist : []),
    3940                count_plugin_installations: !!serverSettings.count_plugin_installations,
     41                standalone_redirect_url: serverSettings.standalone_redirect_url || '',
    4042            });
    4143        }
     
    6769                ip_whitelist: normalizeListFromTextarea(settings.ip_whitelist),
    6870                count_plugin_installations: !!settings.count_plugin_installations,
     71                standalone_redirect_url: settings.standalone_redirect_url || '',
    6972            };
    7073            if (settingsController) {
     
    106109                            __next40pxDefaultSize: true,
    107110                        }),
     111                        settings.standalone_mode ? createElement('div', {
     112                                style: {
     113                                    marginInlineStart: '40px',
     114                                },
     115                            },
     116                            createElement(TextControl, {
     117                                type: 'url',
     118                                label: __('Frontend redirect URL', 'peak-publisher'),
     119                                help: __('Leave blank to show a white page.', 'peak-publisher'),
     120                                value: settings.standalone_redirect_url,
     121                                placeholder: 'https://',
     122                                onChange: (val) => setField('standalone_redirect_url', val),
     123                                __next40pxDefaultSize: true,
     124                            })
     125                        ) : null,
    108126                        createElement('p', null, createElement('strong', null, __('Peak Publisher can be used within any WordPress website, but it\'s highly recommended to use a separate WordPress installation for Peak Publisher from the start so that the plugin update URL doesn\'t have to change later. Changing the URL later may require a lengthy transition period.', 'peak-publisher'))),
    109127                    ),
  • peak-publisher/tags/1.3.0/includes/functions.php

    r3477599 r3487927  
    8787        ],
    8888        'ip_whitelist' => [],
     89        'standalone_redirect_url' => '',
    8990    ];
    9091    $raw = get_option('pblsh_settings');
     
    127128        return trim((string) $ip);
    128129    }, $ips)));
     130    $redirect_url = trim((string) ($settings['standalone_redirect_url'] ?? ''));
     131    $out['standalone_redirect_url'] = $redirect_url !== '' ? esc_url_raw($redirect_url) : '';
    129132    return $out;
    130133}
  • peak-publisher/tags/1.3.0/includes/init.php

    r3425579 r3487927  
    1313    // Disable themes.
    1414    add_filter('wp_using_themes', '__return_false');
     15
     16    // Redirect frontend visitors to a configured URL.
     17    $standalone_redirect_url = get_peak_publisher_settings()['standalone_redirect_url'] ?? '';
     18    if ($standalone_redirect_url !== '') {
     19        add_action('wp', function() use ($standalone_redirect_url) {
     20            wp_redirect($standalone_redirect_url, 302);
     21            exit;
     22        }, 9999);
     23    }
    1524
    1625    // Re-enable redirection from "/admin" to real admin url (because it's disabled by disabling themes)
     
    7685        $wp_admin_bar->remove_node('site-name');
    7786    }, 999);
     87
     88    // Highlight toolbar update icon (since Dashboard/Updates menu is hidden in standalone mode)
     89    add_action('admin_head', function() {
     90        ?>
     91        <style>
     92            .admin-color-fresh     { --pblsh-wp-update-notif-bg: #d63638; }
     93            .admin-color-light     { --pblsh-wp-update-notif-bg: #d64e07; }
     94            .admin-color-modern    { --pblsh-wp-update-notif-bg: #3858e9; }
     95            .admin-color-blue      { --pblsh-wp-update-notif-bg: #e1a948; }
     96            .admin-color-midnight  { --pblsh-wp-update-notif-bg: #69a8bb; }
     97            .admin-color-coffee    { --pblsh-wp-update-notif-bg: #9ea476; }
     98            .admin-color-sunrise   { --pblsh-wp-update-notif-bg: #ccaf0b; }
     99            .admin-color-ectoplasm { --pblsh-wp-update-notif-bg: #d46f15; }
     100            .admin-color-ocean     { --pblsh-wp-update-notif-bg: #aa9d88; }
     101
     102            #wpadminbar #wp-admin-bar-updates .ab-label {
     103                position: relative;
     104                color: #fff !important;
     105                margin-left: 4px;
     106                margin-right: 6px;
     107                z-index: 0;
     108            }
     109
     110            #wpadminbar #wp-admin-bar-updates .ab-label::after {
     111                content: " ";
     112                position: absolute;
     113                min-width: 20px;
     114                width: calc(6px + 100% + 6px);
     115                height: 20px;
     116                background: var(--pblsh-wp-update-notif-bg);
     117                border-radius: 10px;
     118                bottom: 50%;
     119                right: 50%;
     120                z-index: -1;
     121                transform: translate(50%, 50%);
     122            }
     123        </style>
     124        <?php
     125    });
    78126}
    79127
  • peak-publisher/tags/1.3.0/peak-publisher.php

    r3477599 r3487927  
    44 * Plugin Name: Peak Publisher
    55 * Description: The easiest way to self-host, manage and publish your own custom plugins.
    6  * Version: 1.2.0
     6 * Version: 1.3.0
    77 * Requires at least: 5.8
    88 * Requires PHP: 8.1
    9  * Author: ehtmlu
    10  * Author URI: https://ehtmlu.com/
     9 * Author: wppeak.com
     10 * Author URI: https://www.wppeak.com/
    1111 * License: GPL v2 or later
    1212 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • peak-publisher/tags/1.3.0/readme.txt

    r3477599 r3487927  
    11=== Peak Publisher ===
    22Plugin Name: Peak Publisher
    3 Author: eHtmlu
     3Author: wppeak.com
    44Author URI: https://www.wppeak.com/
    55Contributors: eHtmlu
     
    99Requires PHP: 8.1
    1010Tested up to: 6.9
    11 Stable tag: 1.2.0
     11Stable tag: 1.3.0
    1212License: GPLv2 or later
    1313License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    109109== Changelog ==
    110110
     111= 1.3.0 - 2026-03-21 =
     112* Added standalone redirect URL setting for redirecting frontend visitors in standalone mode
     113* Added visual highlighting of the update notification icon in the admin toolbar in standalone mode
     114
    111115= 1.2.0 - 2026-03-08 =
    112116* Added asset management: upload, replace, reorder, and delete plugin icons, banners, and screenshots directly in the admin UI
  • peak-publisher/trunk/assets/js/components/Settings.js

    r3444907 r3487927  
    44    const { useState, useEffect, createElement, createInterpolateElement } = wp.element;
    55    const { useSelect } = wp.data;
    6     const { Button, Panel, PanelBody, ToggleControl, TextareaControl, SelectControl, RadioControl } = wp.components;
     6    const { Button, Panel, PanelBody, ToggleControl, TextControl, TextareaControl, SelectControl, RadioControl } = wp.components;
    77    const { showAlert } = Pblsh.Utils;
    88    const settingsController = window.Pblsh.Controllers && window.Pblsh.Controllers.Settings ? window.Pblsh.Controllers.Settings : null;
     
    1919        ip_whitelist: [],
    2020        count_plugin_installations: false,
     21        standalone_redirect_url: '',
    2122    });
    2223    const [currentSection, setCurrentSection] = useState('general');
     
    3839                ip_whitelist: getTextareaFromList(Array.isArray(serverSettings.ip_whitelist) ? serverSettings.ip_whitelist : []),
    3940                count_plugin_installations: !!serverSettings.count_plugin_installations,
     41                standalone_redirect_url: serverSettings.standalone_redirect_url || '',
    4042            });
    4143        }
     
    6769                ip_whitelist: normalizeListFromTextarea(settings.ip_whitelist),
    6870                count_plugin_installations: !!settings.count_plugin_installations,
     71                standalone_redirect_url: settings.standalone_redirect_url || '',
    6972            };
    7073            if (settingsController) {
     
    106109                            __next40pxDefaultSize: true,
    107110                        }),
     111                        settings.standalone_mode ? createElement('div', {
     112                                style: {
     113                                    marginInlineStart: '40px',
     114                                },
     115                            },
     116                            createElement(TextControl, {
     117                                type: 'url',
     118                                label: __('Frontend redirect URL', 'peak-publisher'),
     119                                help: __('Leave blank to show a white page.', 'peak-publisher'),
     120                                value: settings.standalone_redirect_url,
     121                                placeholder: 'https://',
     122                                onChange: (val) => setField('standalone_redirect_url', val),
     123                                __next40pxDefaultSize: true,
     124                            })
     125                        ) : null,
    108126                        createElement('p', null, createElement('strong', null, __('Peak Publisher can be used within any WordPress website, but it\'s highly recommended to use a separate WordPress installation for Peak Publisher from the start so that the plugin update URL doesn\'t have to change later. Changing the URL later may require a lengthy transition period.', 'peak-publisher'))),
    109127                    ),
  • peak-publisher/trunk/includes/functions.php

    r3477599 r3487927  
    8787        ],
    8888        'ip_whitelist' => [],
     89        'standalone_redirect_url' => '',
    8990    ];
    9091    $raw = get_option('pblsh_settings');
     
    127128        return trim((string) $ip);
    128129    }, $ips)));
     130    $redirect_url = trim((string) ($settings['standalone_redirect_url'] ?? ''));
     131    $out['standalone_redirect_url'] = $redirect_url !== '' ? esc_url_raw($redirect_url) : '';
    129132    return $out;
    130133}
  • peak-publisher/trunk/includes/init.php

    r3425579 r3487927  
    1313    // Disable themes.
    1414    add_filter('wp_using_themes', '__return_false');
     15
     16    // Redirect frontend visitors to a configured URL.
     17    $standalone_redirect_url = get_peak_publisher_settings()['standalone_redirect_url'] ?? '';
     18    if ($standalone_redirect_url !== '') {
     19        add_action('wp', function() use ($standalone_redirect_url) {
     20            wp_redirect($standalone_redirect_url, 302);
     21            exit;
     22        }, 9999);
     23    }
    1524
    1625    // Re-enable redirection from "/admin" to real admin url (because it's disabled by disabling themes)
     
    7685        $wp_admin_bar->remove_node('site-name');
    7786    }, 999);
     87
     88    // Highlight toolbar update icon (since Dashboard/Updates menu is hidden in standalone mode)
     89    add_action('admin_head', function() {
     90        ?>
     91        <style>
     92            .admin-color-fresh     { --pblsh-wp-update-notif-bg: #d63638; }
     93            .admin-color-light     { --pblsh-wp-update-notif-bg: #d64e07; }
     94            .admin-color-modern    { --pblsh-wp-update-notif-bg: #3858e9; }
     95            .admin-color-blue      { --pblsh-wp-update-notif-bg: #e1a948; }
     96            .admin-color-midnight  { --pblsh-wp-update-notif-bg: #69a8bb; }
     97            .admin-color-coffee    { --pblsh-wp-update-notif-bg: #9ea476; }
     98            .admin-color-sunrise   { --pblsh-wp-update-notif-bg: #ccaf0b; }
     99            .admin-color-ectoplasm { --pblsh-wp-update-notif-bg: #d46f15; }
     100            .admin-color-ocean     { --pblsh-wp-update-notif-bg: #aa9d88; }
     101
     102            #wpadminbar #wp-admin-bar-updates .ab-label {
     103                position: relative;
     104                color: #fff !important;
     105                margin-left: 4px;
     106                margin-right: 6px;
     107                z-index: 0;
     108            }
     109
     110            #wpadminbar #wp-admin-bar-updates .ab-label::after {
     111                content: " ";
     112                position: absolute;
     113                min-width: 20px;
     114                width: calc(6px + 100% + 6px);
     115                height: 20px;
     116                background: var(--pblsh-wp-update-notif-bg);
     117                border-radius: 10px;
     118                bottom: 50%;
     119                right: 50%;
     120                z-index: -1;
     121                transform: translate(50%, 50%);
     122            }
     123        </style>
     124        <?php
     125    });
    78126}
    79127
  • peak-publisher/trunk/peak-publisher.php

    r3477599 r3487927  
    44 * Plugin Name: Peak Publisher
    55 * Description: The easiest way to self-host, manage and publish your own custom plugins.
    6  * Version: 1.2.0
     6 * Version: 1.3.0
    77 * Requires at least: 5.8
    88 * Requires PHP: 8.1
    9  * Author: ehtmlu
    10  * Author URI: https://ehtmlu.com/
     9 * Author: wppeak.com
     10 * Author URI: https://www.wppeak.com/
    1111 * License: GPL v2 or later
    1212 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • peak-publisher/trunk/readme.txt

    r3477599 r3487927  
    11=== Peak Publisher ===
    22Plugin Name: Peak Publisher
    3 Author: eHtmlu
     3Author: wppeak.com
    44Author URI: https://www.wppeak.com/
    55Contributors: eHtmlu
     
    99Requires PHP: 8.1
    1010Tested up to: 6.9
    11 Stable tag: 1.2.0
     11Stable tag: 1.3.0
    1212License: GPLv2 or later
    1313License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    109109== Changelog ==
    110110
     111= 1.3.0 - 2026-03-21 =
     112* Added standalone redirect URL setting for redirecting frontend visitors in standalone mode
     113* Added visual highlighting of the update notification icon in the admin toolbar in standalone mode
     114
    111115= 1.2.0 - 2026-03-08 =
    112116* Added asset management: upload, replace, reorder, and delete plugin icons, banners, and screenshots directly in the admin UI
Note: See TracChangeset for help on using the changeset viewer.