Changeset 3460404
- Timestamp:
- 02/12/2026 11:05:53 PM (6 days ago)
- Location:
- peak-publisher
- Files:
-
- 2 added
- 5 edited
- 19 copied
-
tags/1.1.3 (copied) (copied from peak-publisher/trunk)
-
tags/1.1.3/assets/bootstrap-codes/basicV2.php.txt (added)
-
tags/1.1.3/assets/css/admin.css (copied) (copied from peak-publisher/trunk/assets/css/admin.css)
-
tags/1.1.3/assets/js/admin.js (copied) (copied from peak-publisher/trunk/assets/js/admin.js)
-
tags/1.1.3/assets/js/api.js (copied) (copied from peak-publisher/trunk/assets/js/api.js)
-
tags/1.1.3/assets/js/components/GlobalDropOverlay.js (copied) (copied from peak-publisher/trunk/assets/js/components/GlobalDropOverlay.js) (3 diffs)
-
tags/1.1.3/assets/js/components/PluginEditor.js (copied) (copied from peak-publisher/trunk/assets/js/components/PluginEditor.js)
-
tags/1.1.3/assets/js/components/PluginList.js (copied) (copied from peak-publisher/trunk/assets/js/components/PluginList.js)
-
tags/1.1.3/assets/js/components/Settings.js (copied) (copied from peak-publisher/trunk/assets/js/components/Settings.js)
-
tags/1.1.3/assets/js/stores (copied) (copied from peak-publisher/trunk/assets/js/stores)
-
tags/1.1.3/assets/js/utils-upload.js (copied) (copied from peak-publisher/trunk/assets/js/utils-upload.js)
-
tags/1.1.3/assets/js/utils.js (copied) (copied from peak-publisher/trunk/assets/js/utils.js)
-
tags/1.1.3/classes/AdminAPI.php (copied) (copied from peak-publisher/trunk/classes/AdminAPI.php)
-
tags/1.1.3/classes/AdminUI.php (copied) (copied from peak-publisher/trunk/classes/AdminUI.php)
-
tags/1.1.3/classes/PublicAPI.php (copied) (copied from peak-publisher/trunk/classes/PublicAPI.php)
-
tags/1.1.3/classes/UploadWorkflow.php (copied) (copied from peak-publisher/trunk/classes/UploadWorkflow.php) (2 diffs)
-
tags/1.1.3/includes/functions.php (copied) (copied from peak-publisher/trunk/includes/functions.php) (1 diff)
-
tags/1.1.3/libs (copied) (copied from peak-publisher/trunk/libs)
-
tags/1.1.3/peak-publisher.php (copied) (copied from peak-publisher/trunk/peak-publisher.php) (1 diff)
-
tags/1.1.3/readme.txt (copied) (copied from peak-publisher/trunk/readme.txt) (2 diffs)
-
trunk/assets/bootstrap-codes/basicV2.php.txt (added)
-
trunk/assets/js/components/GlobalDropOverlay.js (modified) (3 diffs)
-
trunk/classes/UploadWorkflow.php (modified) (2 diffs)
-
trunk/includes/functions.php (modified) (1 diff)
-
trunk/peak-publisher.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
peak-publisher/tags/1.1.3/assets/js/components/GlobalDropOverlay.js
r3445119 r3460404 31 31 const [keepReadmeTxtEncoding, setKeepReadmeTxtEncoding] = useState(false); 32 32 const [keepReadmeTxtAsIs, setKeepReadmeTxtAsIs] = useState(false); 33 const [keepOldBootstrapCode, setKeepOldBootstrapCode] = useState(false); 33 34 34 35 const serverSettings = useSelect((select) => select('pblsh/settings').getServer(), []); … … 48 49 setKeepReadmeTxtEncoding(false); 49 50 setKeepReadmeTxtAsIs(false); 51 setKeepOldBootstrapCode(false); 50 52 } 51 53 … … 498 500 [ 499 501 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 ], 505 523 useDifferentCustomUpdateServer && { 506 524 title: __('Found bootstrap code', 'peak-publisher'), -
peak-publisher/tags/1.1.3/classes/UploadWorkflow.php
r3444907 r3460404 420 420 'main_file' => $main_file ? $this->rel_path($main_file, $root) : false, 421 421 'bootstrap_file' => $bootstrap['file'] ? $this->rel_path($bootstrap['file'], $root) : false, 422 'bootstrap_version' => $bootstrap['version'] ?? '', 423 'bootstrap_is_latest' => $bootstrap['is_latest'] ?? false, 422 424 'plugin_basename' => $plugin_basename, 423 425 'plugin_slug' => $plugin_slug, … … 913 915 /** 914 916 * Searches for expected bootstrap/update-related code patterns in PHP files. 915 * Returns ['found'=>bool, 'file'=>string].916 917 * 917 918 * @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. 919 920 */ 920 921 private function search_bootstrap_code(string $root): array { 921 922 $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]; 931 935 } 932 936 -
peak-publisher/tags/1.1.3/includes/functions.php
r3444907 r3460404 30 30 * Gets the embed code. 31 31 */ 32 function get_bootstrap_code(): string { 33 $code = @file_get_contents(PBLSH_PLUGIN_DIR . 'assets/bootstrap-codes/basicV1.php.txt'); 32 function 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'); 34 37 return is_string($code) ? $code : ''; 38 } 39 40 41 /** 42 * Gets the bootstrap codes. 43 */ 44 function get_bootstrap_codes(): array { 45 return [ 46 'basicV1' => get_bootstrap_code('basicV1'), 47 'basicV2' => get_bootstrap_code('basicV2'), 48 ]; 35 49 } 36 50 -
peak-publisher/tags/1.1.3/peak-publisher.php
r3446146 r3460404 4 4 * Plugin Name: Peak Publisher 5 5 * Description: The easiest way to self-host, manage and publish your own custom plugins. 6 * Version: 1.1. 26 * Version: 1.1.3 7 7 * Requires at least: 5.8 8 8 * Requires PHP: 8.1 -
peak-publisher/tags/1.1.3/readme.txt
r3446146 r3460404 9 9 Requires PHP: 8.1 10 10 Tested up to: 6.9 11 Stable tag: 1.1. 211 Stable tag: 1.1.3 12 12 License: GPLv2 or later 13 13 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 109 109 == Changelog == 110 110 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 111 115 = 1.1.2 - 2026-01-24 = 112 116 * 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 31 31 const [keepReadmeTxtEncoding, setKeepReadmeTxtEncoding] = useState(false); 32 32 const [keepReadmeTxtAsIs, setKeepReadmeTxtAsIs] = useState(false); 33 const [keepOldBootstrapCode, setKeepOldBootstrapCode] = useState(false); 33 34 34 35 const serverSettings = useSelect((select) => select('pblsh/settings').getServer(), []); … … 48 49 setKeepReadmeTxtEncoding(false); 49 50 setKeepReadmeTxtAsIs(false); 51 setKeepOldBootstrapCode(false); 50 52 } 51 53 … … 498 500 [ 499 501 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 ], 505 523 useDifferentCustomUpdateServer && { 506 524 title: __('Found bootstrap code', 'peak-publisher'), -
peak-publisher/trunk/classes/UploadWorkflow.php
r3444907 r3460404 420 420 'main_file' => $main_file ? $this->rel_path($main_file, $root) : false, 421 421 'bootstrap_file' => $bootstrap['file'] ? $this->rel_path($bootstrap['file'], $root) : false, 422 'bootstrap_version' => $bootstrap['version'] ?? '', 423 'bootstrap_is_latest' => $bootstrap['is_latest'] ?? false, 422 424 'plugin_basename' => $plugin_basename, 423 425 'plugin_slug' => $plugin_slug, … … 913 915 /** 914 916 * Searches for expected bootstrap/update-related code patterns in PHP files. 915 * Returns ['found'=>bool, 'file'=>string].916 917 * 917 918 * @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. 919 920 */ 920 921 private function search_bootstrap_code(string $root): array { 921 922 $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]; 931 935 } 932 936 -
peak-publisher/trunk/includes/functions.php
r3444907 r3460404 30 30 * Gets the embed code. 31 31 */ 32 function get_bootstrap_code(): string { 33 $code = @file_get_contents(PBLSH_PLUGIN_DIR . 'assets/bootstrap-codes/basicV1.php.txt'); 32 function 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'); 34 37 return is_string($code) ? $code : ''; 38 } 39 40 41 /** 42 * Gets the bootstrap codes. 43 */ 44 function get_bootstrap_codes(): array { 45 return [ 46 'basicV1' => get_bootstrap_code('basicV1'), 47 'basicV2' => get_bootstrap_code('basicV2'), 48 ]; 35 49 } 36 50 -
peak-publisher/trunk/peak-publisher.php
r3446146 r3460404 4 4 * Plugin Name: Peak Publisher 5 5 * Description: The easiest way to self-host, manage and publish your own custom plugins. 6 * Version: 1.1. 26 * Version: 1.1.3 7 7 * Requires at least: 5.8 8 8 * Requires PHP: 8.1 -
peak-publisher/trunk/readme.txt
r3446146 r3460404 9 9 Requires PHP: 8.1 10 10 Tested up to: 6.9 11 Stable tag: 1.1. 211 Stable tag: 1.1.3 12 12 License: GPLv2 or later 13 13 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 109 109 == Changelog == 110 110 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 111 115 = 1.1.2 - 2026-01-24 = 112 116 * 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.