Plugin Directory

Changeset 3460404


Ignore:
Timestamp:
02/12/2026 11:05:53 PM (6 days ago)
Author:
ehtmlu
Message:

Version 1.1.3

Location:
peak-publisher
Files:
2 added
5 edited
19 copied

Legend:

Unmodified
Added
Removed
  • peak-publisher/tags/1.1.3/assets/js/components/GlobalDropOverlay.js

    r3445119 r3460404  
    3131    const [keepReadmeTxtEncoding, setKeepReadmeTxtEncoding] = useState(false);
    3232    const [keepReadmeTxtAsIs, setKeepReadmeTxtAsIs] = useState(false);
     33    const [keepOldBootstrapCode, setKeepOldBootstrapCode] = useState(false);
    3334
    3435    const serverSettings = useSelect((select) => select('pblsh/settings').getServer(), []);
     
    4849        setKeepReadmeTxtEncoding(false);
    4950        setKeepReadmeTxtAsIs(false);
     51        setKeepOldBootstrapCode(false);
    5052    }
    5153
     
    498500            [
    499501                meta.plugin_info?.bootstrap_file && [
    500                     !useDifferentCustomUpdateServer && !useWordPressOrgUpdateServer && {
    501                         title: __('Expected bootstrap code', 'peak-publisher'),
    502                         type: 'ok',
    503                         desc: sprintf(__('Found in %s.', 'peak-publisher'), meta.plugin_info?.bootstrap_file)
    504                     },
     502                    !useDifferentCustomUpdateServer && !useWordPressOrgUpdateServer && [
     503                        meta.plugin_info?.bootstrap_is_latest && {
     504                            title: __('Expected bootstrap code', 'peak-publisher'),
     505                            type: 'ok',
     506                            desc: sprintf(__('Found in %s.', 'peak-publisher'), meta.plugin_info?.bootstrap_file)
     507                        },
     508                        !meta.plugin_info?.bootstrap_is_latest && {
     509                            title: __('Unexpected bootstrap code', 'peak-publisher'),
     510                            type: keepOldBootstrapCode ? 'ok' : 'error',
     511                            desc: [
     512                                sprintf(__('Found in %s, but it is not the latest bootstrap code version.', 'peak-publisher'), meta.plugin_info?.bootstrap_file),
     513                                createElement('br'),
     514                                createElement(CheckboxControl, {
     515                                    __nextHasNoMarginBottom: true,
     516                                    label: __('That\'s fine, I want to use the old version of the bootstrap code. I understand that this is not recommended.', 'peak-publisher'),
     517                                    checked: keepOldBootstrapCode,
     518                                    onChange: (value) => setKeepOldBootstrapCode(value),
     519                                }),
     520                            ],
     521                        },
     522                    ],
    505523                    useDifferentCustomUpdateServer && {
    506524                        title: __('Found bootstrap code', 'peak-publisher'),
  • peak-publisher/tags/1.1.3/classes/UploadWorkflow.php

    r3444907 r3460404  
    420420                    'main_file' => $main_file ? $this->rel_path($main_file, $root) : false,
    421421                    'bootstrap_file' => $bootstrap['file'] ? $this->rel_path($bootstrap['file'], $root) : false,
     422                    'bootstrap_version' => $bootstrap['version'] ?? '',
     423                    'bootstrap_is_latest' => $bootstrap['is_latest'] ?? false,
    422424                    'plugin_basename' => $plugin_basename,
    423425                    'plugin_slug' => $plugin_slug,
     
    913915    /**
    914916     * Searches for expected bootstrap/update-related code patterns in PHP files.
    915      * Returns ['found'=>bool, 'file'=>string].
    916917     *
    917918     * @param string $root Plugin root directory.
    918      * @return array Array with 'found' boolean and 'file' string.
     919     * @return array Array with 'found' boolean, 'file' string, 'type' string, and 'is_latest' boolean.
    919920     */
    920921    private function search_bootstrap_code(string $root): array {
    921922        $files = $this->list_php_files($root, 5);
    922         $bootstrap_code = get_bootstrap_code();
    923         $minified = preg_replace('/\s+/', '', preg_replace('/\/\*.*?\*\//s', '', $bootstrap_code));
    924         foreach ($files as $file) {
    925             $contents = @file_get_contents($file);
    926             if ($contents === false) continue;
    927             $minified_contents = preg_replace('/\s+/', '', $contents);
    928             if (strpos($minified_contents, $minified) !== false) return ['found' => true, 'file' => $file];
    929         }
    930         return ['found' => false, 'file' => ''];
     923        $bootstrap_codes = get_bootstrap_codes();
     924        $latest_version = array_key_last($bootstrap_codes);
     925        foreach ($bootstrap_codes as $version => $bootstrap_code) {
     926            $minified = preg_replace('/\s+/', '', preg_replace('/\/\*.*?\*\//s', '', $bootstrap_code));
     927            foreach ($files as $file) {
     928                $contents = @file_get_contents($file);
     929                if ($contents === false) continue;
     930                $minified_contents = preg_replace('/\s+/', '', $contents);
     931                if (strpos($minified_contents, $minified) !== false) return ['found' => true, 'file' => $file, 'version' => $version, 'is_latest' => $version === $latest_version];
     932            }
     933        }
     934        return ['found' => false, 'file' => '', 'version' => '', 'is_latest' => false];
    931935    }
    932936
  • peak-publisher/tags/1.1.3/includes/functions.php

    r3444907 r3460404  
    3030 * Gets the embed code.
    3131 */
    32 function get_bootstrap_code(): string {
    33     $code = @file_get_contents(PBLSH_PLUGIN_DIR . 'assets/bootstrap-codes/basicV1.php.txt');
     32function get_bootstrap_code(string $version = 'basicV2'): string {
     33    if ($version !== 'basicV1' && $version !== 'basicV2') {
     34        return '';
     35    }
     36    $code = @file_get_contents(PBLSH_PLUGIN_DIR . 'assets/bootstrap-codes/' . $version . '.php.txt');
    3437    return is_string($code) ? $code : '';
     38}
     39
     40
     41/**
     42 * Gets the bootstrap codes.
     43 */
     44function get_bootstrap_codes(): array {
     45    return [
     46        'basicV1' => get_bootstrap_code('basicV1'),
     47        'basicV2' => get_bootstrap_code('basicV2'),
     48    ];
    3549}
    3650
  • peak-publisher/tags/1.1.3/peak-publisher.php

    r3446146 r3460404  
    44 * Plugin Name: Peak Publisher
    55 * Description: The easiest way to self-host, manage and publish your own custom plugins.
    6  * Version: 1.1.2
     6 * Version: 1.1.3
    77 * Requires at least: 5.8
    88 * Requires PHP: 8.1
  • peak-publisher/tags/1.1.3/readme.txt

    r3446146 r3460404  
    99Requires PHP: 8.1
    1010Tested up to: 6.9
    11 Stable tag: 1.1.2
     11Stable tag: 1.1.3
    1212License: GPLv2 or later
    1313License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    109109== Changelog ==
    110110
     111= 1.1.3 - 2026-02-12 =
     112* New bootstrap code (basicV2): multisite support and safe handling when update transient has no response/no_update keys
     113* Upload workflow detects basicV1 vs basicV2 bootstrap and shows the matching recommendation
     114
    111115= 1.1.2 - 2026-01-24 =
    112116* Fixed description tab for plugins without a readme.txt (added previous solution as a fallback)
  • peak-publisher/trunk/assets/js/components/GlobalDropOverlay.js

    r3445119 r3460404  
    3131    const [keepReadmeTxtEncoding, setKeepReadmeTxtEncoding] = useState(false);
    3232    const [keepReadmeTxtAsIs, setKeepReadmeTxtAsIs] = useState(false);
     33    const [keepOldBootstrapCode, setKeepOldBootstrapCode] = useState(false);
    3334
    3435    const serverSettings = useSelect((select) => select('pblsh/settings').getServer(), []);
     
    4849        setKeepReadmeTxtEncoding(false);
    4950        setKeepReadmeTxtAsIs(false);
     51        setKeepOldBootstrapCode(false);
    5052    }
    5153
     
    498500            [
    499501                meta.plugin_info?.bootstrap_file && [
    500                     !useDifferentCustomUpdateServer && !useWordPressOrgUpdateServer && {
    501                         title: __('Expected bootstrap code', 'peak-publisher'),
    502                         type: 'ok',
    503                         desc: sprintf(__('Found in %s.', 'peak-publisher'), meta.plugin_info?.bootstrap_file)
    504                     },
     502                    !useDifferentCustomUpdateServer && !useWordPressOrgUpdateServer && [
     503                        meta.plugin_info?.bootstrap_is_latest && {
     504                            title: __('Expected bootstrap code', 'peak-publisher'),
     505                            type: 'ok',
     506                            desc: sprintf(__('Found in %s.', 'peak-publisher'), meta.plugin_info?.bootstrap_file)
     507                        },
     508                        !meta.plugin_info?.bootstrap_is_latest && {
     509                            title: __('Unexpected bootstrap code', 'peak-publisher'),
     510                            type: keepOldBootstrapCode ? 'ok' : 'error',
     511                            desc: [
     512                                sprintf(__('Found in %s, but it is not the latest bootstrap code version.', 'peak-publisher'), meta.plugin_info?.bootstrap_file),
     513                                createElement('br'),
     514                                createElement(CheckboxControl, {
     515                                    __nextHasNoMarginBottom: true,
     516                                    label: __('That\'s fine, I want to use the old version of the bootstrap code. I understand that this is not recommended.', 'peak-publisher'),
     517                                    checked: keepOldBootstrapCode,
     518                                    onChange: (value) => setKeepOldBootstrapCode(value),
     519                                }),
     520                            ],
     521                        },
     522                    ],
    505523                    useDifferentCustomUpdateServer && {
    506524                        title: __('Found bootstrap code', 'peak-publisher'),
  • peak-publisher/trunk/classes/UploadWorkflow.php

    r3444907 r3460404  
    420420                    'main_file' => $main_file ? $this->rel_path($main_file, $root) : false,
    421421                    'bootstrap_file' => $bootstrap['file'] ? $this->rel_path($bootstrap['file'], $root) : false,
     422                    'bootstrap_version' => $bootstrap['version'] ?? '',
     423                    'bootstrap_is_latest' => $bootstrap['is_latest'] ?? false,
    422424                    'plugin_basename' => $plugin_basename,
    423425                    'plugin_slug' => $plugin_slug,
     
    913915    /**
    914916     * Searches for expected bootstrap/update-related code patterns in PHP files.
    915      * Returns ['found'=>bool, 'file'=>string].
    916917     *
    917918     * @param string $root Plugin root directory.
    918      * @return array Array with 'found' boolean and 'file' string.
     919     * @return array Array with 'found' boolean, 'file' string, 'type' string, and 'is_latest' boolean.
    919920     */
    920921    private function search_bootstrap_code(string $root): array {
    921922        $files = $this->list_php_files($root, 5);
    922         $bootstrap_code = get_bootstrap_code();
    923         $minified = preg_replace('/\s+/', '', preg_replace('/\/\*.*?\*\//s', '', $bootstrap_code));
    924         foreach ($files as $file) {
    925             $contents = @file_get_contents($file);
    926             if ($contents === false) continue;
    927             $minified_contents = preg_replace('/\s+/', '', $contents);
    928             if (strpos($minified_contents, $minified) !== false) return ['found' => true, 'file' => $file];
    929         }
    930         return ['found' => false, 'file' => ''];
     923        $bootstrap_codes = get_bootstrap_codes();
     924        $latest_version = array_key_last($bootstrap_codes);
     925        foreach ($bootstrap_codes as $version => $bootstrap_code) {
     926            $minified = preg_replace('/\s+/', '', preg_replace('/\/\*.*?\*\//s', '', $bootstrap_code));
     927            foreach ($files as $file) {
     928                $contents = @file_get_contents($file);
     929                if ($contents === false) continue;
     930                $minified_contents = preg_replace('/\s+/', '', $contents);
     931                if (strpos($minified_contents, $minified) !== false) return ['found' => true, 'file' => $file, 'version' => $version, 'is_latest' => $version === $latest_version];
     932            }
     933        }
     934        return ['found' => false, 'file' => '', 'version' => '', 'is_latest' => false];
    931935    }
    932936
  • peak-publisher/trunk/includes/functions.php

    r3444907 r3460404  
    3030 * Gets the embed code.
    3131 */
    32 function get_bootstrap_code(): string {
    33     $code = @file_get_contents(PBLSH_PLUGIN_DIR . 'assets/bootstrap-codes/basicV1.php.txt');
     32function get_bootstrap_code(string $version = 'basicV2'): string {
     33    if ($version !== 'basicV1' && $version !== 'basicV2') {
     34        return '';
     35    }
     36    $code = @file_get_contents(PBLSH_PLUGIN_DIR . 'assets/bootstrap-codes/' . $version . '.php.txt');
    3437    return is_string($code) ? $code : '';
     38}
     39
     40
     41/**
     42 * Gets the bootstrap codes.
     43 */
     44function get_bootstrap_codes(): array {
     45    return [
     46        'basicV1' => get_bootstrap_code('basicV1'),
     47        'basicV2' => get_bootstrap_code('basicV2'),
     48    ];
    3549}
    3650
  • peak-publisher/trunk/peak-publisher.php

    r3446146 r3460404  
    44 * Plugin Name: Peak Publisher
    55 * Description: The easiest way to self-host, manage and publish your own custom plugins.
    6  * Version: 1.1.2
     6 * Version: 1.1.3
    77 * Requires at least: 5.8
    88 * Requires PHP: 8.1
  • peak-publisher/trunk/readme.txt

    r3446146 r3460404  
    99Requires PHP: 8.1
    1010Tested up to: 6.9
    11 Stable tag: 1.1.2
     11Stable tag: 1.1.3
    1212License: GPLv2 or later
    1313License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    109109== Changelog ==
    110110
     111= 1.1.3 - 2026-02-12 =
     112* New bootstrap code (basicV2): multisite support and safe handling when update transient has no response/no_update keys
     113* Upload workflow detects basicV1 vs basicV2 bootstrap and shows the matching recommendation
     114
    111115= 1.1.2 - 2026-01-24 =
    112116* Fixed description tab for plugins without a readme.txt (added previous solution as a fallback)
Note: See TracChangeset for help on using the changeset viewer.