Changeset 2989634
- Timestamp:
- 11/06/2023 08:28:59 AM (17 months ago)
- Location:
- yabe-kokoro
- Files:
-
- 28 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
yabe-kokoro/tags/1.0.7/constant.php
r2985510 r2989634 26 26 * @var string 27 27 */ 28 public const VERSION = '1.0. 6';28 public const VERSION = '1.0.7'; 29 29 /** 30 30 * @var int 31 31 */ 32 public const VERSION_ID = 1000 6;32 public const VERSION_ID = 10007; 33 33 /** 34 34 * @var int … … 42 42 * @var int 43 43 */ 44 public const RELEASE_VERSION = 6;44 public const RELEASE_VERSION = 7; 45 45 /** 46 46 * @var string -
yabe-kokoro/tags/1.0.7/readme.txt
r2985510 r2989634 5 5 Requires at least: 6.0 6 6 Tested up to: 6.3 7 Stable tag: 1.0. 67 Stable tag: 1.0.7 8 8 Requires PHP: 7.4 9 9 License: GPLv3 … … 57 57 58 58 59 = 1.0.7 = 60 * **Fix**: Plugin requirements checking issue 61 59 62 = 1.0.6 = 60 63 * **New**: Yabe Kokoro Lite is now available on [WordPress.org](https://wordpress.org/plugins/yabe-kokoro/) -
yabe-kokoro/tags/1.0.7/src/Admin/AdminPage.php
r2985507 r2989634 13 13 14 14 use _YabeKokoro\EDD_SL\PluginUpdater; 15 use _YabeKokoro\YABE_KOKORO;16 15 use Yabe\Kokoro\Ecommerce\Loader as PlatformLoader; 17 16 use Yabe\Kokoro\Utils\Asset; 17 use _YabeKokoro\YABE_KOKORO; 18 18 class AdminPage 19 19 { -
yabe-kokoro/tags/1.0.7/src/Api/Admin/Setting.php
r2985507 r2989634 12 12 namespace Yabe\Kokoro\Api\Admin; 13 13 14 use _YabeKokoro\YABE_KOKORO;15 14 use WP_REST_Request; 16 15 use WP_REST_Response; … … 19 18 use Yabe\Kokoro\Api\ApiInterface; 20 19 use Yabe\Kokoro\Plugin; 20 use _YabeKokoro\YABE_KOKORO; 21 21 /** 22 22 * @since 1.0.0 -
yabe-kokoro/tags/1.0.7/src/Api/Router.php
r2985507 r2989634 12 12 namespace Yabe\Kokoro\Api; 13 13 14 use _YabeKokoro\YABE_KOKORO;15 14 use ReflectionClass; 16 15 use _YabeKokoro\Symfony\Component\Finder\Finder; 16 use _YabeKokoro\YABE_KOKORO; 17 17 class Router 18 18 { -
yabe-kokoro/tags/1.0.7/src/Ecommerce/Loader.php
r2985507 r2989634 13 13 14 14 use Exception; 15 use _YabeKokoro\YABE_KOKORO;16 15 use ReflectionClass; 17 16 use _YabeKokoro\Symfony\Component\Finder\Finder; 17 use _YabeKokoro\YABE_KOKORO; 18 18 class Loader 19 19 { -
yabe-kokoro/tags/1.0.7/src/Ecommerce/Platform/WooCommerce/Email.php
r2985507 r2989634 73 73 <div style="padding: 12px; color: #636363; border: 1px solid #e5e5e5;" > 74 74 <?php 75 $table_body;75 echo $table_body; 76 76 ?> 77 77 </div> -
yabe-kokoro/tags/1.0.7/src/Ecommerce/Platform/WooCommerce/Metabox.php
r2985507 r2989634 12 12 namespace Yabe\Kokoro\Ecommerce\Platform\WooCommerce; 13 13 14 use WP_Post; 14 15 use _YabeKokoro\YABE_KOKORO; 15 use WP_Post;16 16 /** 17 17 * @since 1.0.0 … … 49 49 <div class="kokoro-container"> 50 50 <?php 51 $nonce_field;51 echo $nonce_field; 52 52 ?> 53 53 <div> … … 55 55 <label for="kokoro_should_generate"> 56 56 <input type="checkbox" name="kokoro_should_generate" id="kokoro_should_generate" <?php 57 $should_generate;57 echo $should_generate; 58 58 ?>> 59 59 Generate the license automatically … … 65 65 <label for="kokoro_should_renewal"> 66 66 <input type="checkbox" name="kokoro_should_renewal" id="kokoro_should_renewal" <?php 67 $should_renewal;67 echo $should_renewal; 68 68 ?>> 69 69 Allow license renewal … … 78 78 </p> 79 79 <input type="number" name="kokoro_max_sites" id="kokoro_max_sites" value="<?php 80 $max_sites;80 echo $max_sites; 81 81 ?>" min="0"> 82 82 </div> … … 89 89 <div> 90 90 <input type="number" name="kokoro_active_duration" id="kokoro_active_duration" value="<?php 91 $active_duration;91 echo $active_duration; 92 92 ?>" min="0"> 93 93 days -
yabe-kokoro/tags/1.0.7/src/Ecommerce/Platform/WooCommerce/ReceiptBlock.php
r2985507 r2989634 100 100 </thead> 101 101 <?php 102 $table_body;102 echo $table_body; 103 103 ?> 104 104 </table> -
yabe-kokoro/tags/1.0.7/src/Migration.php
r2985507 r2989634 12 12 namespace Yabe\Kokoro; 13 13 14 use _YabeKokoro\Rosua\Migrations\Migrator; 14 15 use _YabeKokoro\YABE_KOKORO; 15 use _YabeKokoro\Rosua\Migrations\Migrator;16 16 /** 17 17 * Manage the plugin custom database tables. -
yabe-kokoro/tags/1.0.7/src/Plugin.php
r2985507 r2989634 14 14 use _YabeKokoro\EDD_SL\PluginUpdater; 15 15 use Exception; 16 use _YabeKokoro\YABE_KOKORO;17 16 use WP_Upgrader; 18 17 use wpdb; … … 24 23 use Yabe\Kokoro\Utils\Debug; 25 24 use Yabe\Kokoro\Utils\Notice; 25 use _YabeKokoro\YABE_KOKORO; 26 26 /** 27 27 * Manage the plugin lifecycle and provides a single point of entry to the plugin. … … 131 131 } 132 132 /** 133 * Initialize the plugin updater. 134 * Pro version only. 135 * 136 * @return PluginUpdater 137 */ 138 public function maybe_update_plugin() 139 { 140 if (!\class_exists(PluginUpdater::class)) { 141 return null; 142 } 143 if ($this->plugin_updater instanceof \_YabeKokoro\EDD_SL\PluginUpdater) { 144 return $this->plugin_updater; 145 } 146 $license = \get_option(YABE_KOKORO::WP_OPTION . '_license', ['key' => '', 'opt_in_pre_release' => \false]); 147 $this->plugin_updater = new PluginUpdater(YABE_KOKORO::WP_OPTION, ['version' => YABE_KOKORO::VERSION, 'license' => $license['key'] ? \trim($license['key']) : \false, 'beta' => $license['opt_in_pre_release'], 'plugin_file' => YABE_KOKORO::FILE, 'item_id' => YABE_KOKORO::EDD_STORE['item_id'], 'store_url' => YABE_KOKORO::EDD_STORE['store_url'], 'author' => YABE_KOKORO::EDD_STORE['author']]); 148 return $this->plugin_updater; 149 } 150 /** 133 151 * Handle the plugin's activation by (maybe) running database migrations 134 152 * and initializing the plugin configuration. … … 203 221 } 204 222 /** 205 * Initialize the plugin updater.206 * Pro version only.207 *208 * @return PluginUpdater209 */210 public function maybe_update_plugin()211 {212 if (!\class_exists(PluginUpdater::class)) {213 return null;214 }215 if ($this->plugin_updater instanceof \_YabeKokoro\EDD_SL\PluginUpdater) {216 return $this->plugin_updater;217 }218 $license = \get_option(YABE_KOKORO::WP_OPTION . '_license', ['key' => '', 'opt_in_pre_release' => \false]);219 $this->plugin_updater = new PluginUpdater(YABE_KOKORO::WP_OPTION, ['version' => YABE_KOKORO::VERSION, 'license' => $license['key'] ? \trim($license['key']) : \false, 'beta' => $license['opt_in_pre_release'], 'plugin_file' => YABE_KOKORO::FILE, 'item_id' => YABE_KOKORO::EDD_STORE['item_id'], 'store_url' => YABE_KOKORO::EDD_STORE['store_url'], 'author' => YABE_KOKORO::EDD_STORE['author']]);220 return $this->plugin_updater;221 }222 /**223 223 * Check if the plugin distributed with an embedded license and activate the license. 224 224 * Pro version only. -
yabe-kokoro/tags/1.0.7/src/Utils/Config.php
r2985507 r2989634 13 13 14 14 use Exception; 15 use _YabeKokoro\YABE_KOKORO;16 15 use _YabeKokoro\Symfony\Component\PropertyAccess\Exception\AccessException; 17 16 use _YabeKokoro\Symfony\Component\PropertyAccess\Exception\InvalidArgumentException; 18 17 use _YabeKokoro\Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException; 19 18 use _YabeKokoro\Symfony\Component\PropertyAccess\PropertyAccess; 19 use _YabeKokoro\YABE_KOKORO; 20 20 /** 21 21 * Accessor for the plugin config. -
yabe-kokoro/tags/1.0.7/src/Utils/Requirement.php
r2985510 r2989634 76 76 * Check if plugins are active and may have the minimum version specified. 77 77 * 78 * @param list< string|array{0: string, 1: string}> $plugins The plugins to check. Use the plugin file path, e.g. `yabe-kokoro/yabe-kokoro.php`.78 * @param list<array{slug: string, name: string, version?: string}> $plugins The plugins to check. The `version` is optional. 79 79 */ 80 80 public function plugins(array $plugins) : self 81 81 { 82 foreach ($plugins as $k => $v) { 83 if (\is_int($k)) { 84 if (!\is_plugin_active($v)) { 85 $pluginName = \get_plugin_data(\WP_PLUGIN_DIR . '/' . $v)['Name']; 86 $this->doesNotMeet[] = \sprintf('<strong>%s</strong>', \esc_html($pluginName)); 87 } 88 } else { 89 $pluginName = \get_plugin_data(\WP_PLUGIN_DIR . '/' . $k)['Name']; 90 if (!\is_plugin_active($k)) { 91 $this->doesNotMeet[] = \sprintf('<strong>%s</strong>', \esc_html($pluginName)); 92 } elseif (\version_compare(\get_plugin_data(\WP_PLUGIN_DIR . '/' . $k)['Version'], $v, '<')) { 93 $this->doesNotMeet[] = \sprintf('<strong>%s</strong> <code>%s</code> or higher', \esc_html($pluginName), $v); 94 } 82 $installed_plugins = \get_plugins(); 83 foreach ($plugins as $plugin) { 84 if (!\array_key_exists($plugin['slug'], $installed_plugins) && !\in_array($plugin['slug'], $installed_plugins, \true)) { 85 $this->doesNotMeet[] = \sprintf('<strong>%s</strong> are not installed', \esc_html($plugin['name'])); 86 continue; 87 } 88 $pluginData = \get_plugin_data(\WP_PLUGIN_DIR . '/' . $plugin['slug']); 89 if (isset($plugin['version']) && \version_compare($pluginData['Version'], $plugin['version'], '<')) { 90 $this->doesNotMeet[] = \sprintf('<strong>%s</strong> <code>%s</code> or higher version', \esc_html($pluginData['Name']), $plugin['version']); 91 continue; 92 } 93 if (!\is_plugin_active($plugin['slug'])) { 94 $this->doesNotMeet[] = \sprintf('<strong>%s</strong> are not activated', \esc_html($pluginData['Name'])); 95 continue; 95 96 } 96 97 } … … 105 106 public function theme(string $parentTheme, ?string $version = null) : self 106 107 { 107 $ theme = \wp_get_theme();108 $wpTheme = \wp_get_theme(); 108 109 if (\get_template() !== $parentTheme) { 109 110 $this->doesNotMeet[] = \sprintf('<strong>%s</strong>', $parentTheme); 110 } elseif ($version && \version_compare(($ theme->parent() ?: $theme)->get('Version'), $version, '<')) {111 } elseif ($version && \version_compare(($wpTheme->parent() ?: $wpTheme)->get('Version'), $version, '<')) { 111 112 $this->doesNotMeet[] = \sprintf('<strong>%s</strong> <code>%s</code> or higher', $parentTheme, $version); 112 113 } … … 120 121 $notice = \sprintf( 121 122 /* translators: 1: plugin name, 2: list of requirements */ 122 \ esc_html__('The <strong>%1$s</strong> plugin minimum requirements are not met:', 'yabe-kokoro'),123 \__('The <strong>%1$s</strong> plugin minimum requirements are not met:', 'yabe-kokoro'), 123 124 \esc_html(\get_plugin_data(YABE_KOKORO::FILE, \false)['Name']) 124 125 ); -
yabe-kokoro/tags/1.0.7/yabe-kokoro.php
r2985510 r2989634 8 8 * Plugin URI: https://kokoro.yabe.land 9 9 * Description: Oxygen design sets manager 10 * Version: 1.0. 610 * Version: 1.0.7 11 11 * Requires at least: 6.0 12 12 * Requires PHP: 7.4 … … 32 32 } 33 33 $requirement = new Requirement(); 34 $requirement->php('7.4')->wp('6.0')->plugins([ 'oxygen/functions.php' => '4.0']);34 $requirement->php('7.4')->wp('6.0')->plugins([['slug' => 'oxygen/functions.php', 'name' => 'Oxygen', 'version' => '4.0']]); 35 35 if ($requirement->met()) { 36 36 Plugin::get_instance()->boot(); -
yabe-kokoro/trunk/constant.php
r2985510 r2989634 26 26 * @var string 27 27 */ 28 public const VERSION = '1.0. 6';28 public const VERSION = '1.0.7'; 29 29 /** 30 30 * @var int 31 31 */ 32 public const VERSION_ID = 1000 6;32 public const VERSION_ID = 10007; 33 33 /** 34 34 * @var int … … 42 42 * @var int 43 43 */ 44 public const RELEASE_VERSION = 6;44 public const RELEASE_VERSION = 7; 45 45 /** 46 46 * @var string -
yabe-kokoro/trunk/readme.txt
r2985510 r2989634 5 5 Requires at least: 6.0 6 6 Tested up to: 6.3 7 Stable tag: 1.0. 67 Stable tag: 1.0.7 8 8 Requires PHP: 7.4 9 9 License: GPLv3 … … 57 57 58 58 59 = 1.0.7 = 60 * **Fix**: Plugin requirements checking issue 61 59 62 = 1.0.6 = 60 63 * **New**: Yabe Kokoro Lite is now available on [WordPress.org](https://wordpress.org/plugins/yabe-kokoro/) -
yabe-kokoro/trunk/src/Admin/AdminPage.php
r2985507 r2989634 13 13 14 14 use _YabeKokoro\EDD_SL\PluginUpdater; 15 use _YabeKokoro\YABE_KOKORO;16 15 use Yabe\Kokoro\Ecommerce\Loader as PlatformLoader; 17 16 use Yabe\Kokoro\Utils\Asset; 17 use _YabeKokoro\YABE_KOKORO; 18 18 class AdminPage 19 19 { -
yabe-kokoro/trunk/src/Api/Admin/Setting.php
r2985507 r2989634 12 12 namespace Yabe\Kokoro\Api\Admin; 13 13 14 use _YabeKokoro\YABE_KOKORO;15 14 use WP_REST_Request; 16 15 use WP_REST_Response; … … 19 18 use Yabe\Kokoro\Api\ApiInterface; 20 19 use Yabe\Kokoro\Plugin; 20 use _YabeKokoro\YABE_KOKORO; 21 21 /** 22 22 * @since 1.0.0 -
yabe-kokoro/trunk/src/Api/Router.php
r2985507 r2989634 12 12 namespace Yabe\Kokoro\Api; 13 13 14 use _YabeKokoro\YABE_KOKORO;15 14 use ReflectionClass; 16 15 use _YabeKokoro\Symfony\Component\Finder\Finder; 16 use _YabeKokoro\YABE_KOKORO; 17 17 class Router 18 18 { -
yabe-kokoro/trunk/src/Ecommerce/Loader.php
r2985507 r2989634 13 13 14 14 use Exception; 15 use _YabeKokoro\YABE_KOKORO;16 15 use ReflectionClass; 17 16 use _YabeKokoro\Symfony\Component\Finder\Finder; 17 use _YabeKokoro\YABE_KOKORO; 18 18 class Loader 19 19 { -
yabe-kokoro/trunk/src/Ecommerce/Platform/WooCommerce/Email.php
r2985507 r2989634 73 73 <div style="padding: 12px; color: #636363; border: 1px solid #e5e5e5;" > 74 74 <?php 75 $table_body;75 echo $table_body; 76 76 ?> 77 77 </div> -
yabe-kokoro/trunk/src/Ecommerce/Platform/WooCommerce/Metabox.php
r2985507 r2989634 12 12 namespace Yabe\Kokoro\Ecommerce\Platform\WooCommerce; 13 13 14 use WP_Post; 14 15 use _YabeKokoro\YABE_KOKORO; 15 use WP_Post;16 16 /** 17 17 * @since 1.0.0 … … 49 49 <div class="kokoro-container"> 50 50 <?php 51 $nonce_field;51 echo $nonce_field; 52 52 ?> 53 53 <div> … … 55 55 <label for="kokoro_should_generate"> 56 56 <input type="checkbox" name="kokoro_should_generate" id="kokoro_should_generate" <?php 57 $should_generate;57 echo $should_generate; 58 58 ?>> 59 59 Generate the license automatically … … 65 65 <label for="kokoro_should_renewal"> 66 66 <input type="checkbox" name="kokoro_should_renewal" id="kokoro_should_renewal" <?php 67 $should_renewal;67 echo $should_renewal; 68 68 ?>> 69 69 Allow license renewal … … 78 78 </p> 79 79 <input type="number" name="kokoro_max_sites" id="kokoro_max_sites" value="<?php 80 $max_sites;80 echo $max_sites; 81 81 ?>" min="0"> 82 82 </div> … … 89 89 <div> 90 90 <input type="number" name="kokoro_active_duration" id="kokoro_active_duration" value="<?php 91 $active_duration;91 echo $active_duration; 92 92 ?>" min="0"> 93 93 days -
yabe-kokoro/trunk/src/Ecommerce/Platform/WooCommerce/ReceiptBlock.php
r2985507 r2989634 100 100 </thead> 101 101 <?php 102 $table_body;102 echo $table_body; 103 103 ?> 104 104 </table> -
yabe-kokoro/trunk/src/Migration.php
r2985507 r2989634 12 12 namespace Yabe\Kokoro; 13 13 14 use _YabeKokoro\Rosua\Migrations\Migrator; 14 15 use _YabeKokoro\YABE_KOKORO; 15 use _YabeKokoro\Rosua\Migrations\Migrator;16 16 /** 17 17 * Manage the plugin custom database tables. -
yabe-kokoro/trunk/src/Plugin.php
r2985507 r2989634 14 14 use _YabeKokoro\EDD_SL\PluginUpdater; 15 15 use Exception; 16 use _YabeKokoro\YABE_KOKORO;17 16 use WP_Upgrader; 18 17 use wpdb; … … 24 23 use Yabe\Kokoro\Utils\Debug; 25 24 use Yabe\Kokoro\Utils\Notice; 25 use _YabeKokoro\YABE_KOKORO; 26 26 /** 27 27 * Manage the plugin lifecycle and provides a single point of entry to the plugin. … … 131 131 } 132 132 /** 133 * Initialize the plugin updater. 134 * Pro version only. 135 * 136 * @return PluginUpdater 137 */ 138 public function maybe_update_plugin() 139 { 140 if (!\class_exists(PluginUpdater::class)) { 141 return null; 142 } 143 if ($this->plugin_updater instanceof \_YabeKokoro\EDD_SL\PluginUpdater) { 144 return $this->plugin_updater; 145 } 146 $license = \get_option(YABE_KOKORO::WP_OPTION . '_license', ['key' => '', 'opt_in_pre_release' => \false]); 147 $this->plugin_updater = new PluginUpdater(YABE_KOKORO::WP_OPTION, ['version' => YABE_KOKORO::VERSION, 'license' => $license['key'] ? \trim($license['key']) : \false, 'beta' => $license['opt_in_pre_release'], 'plugin_file' => YABE_KOKORO::FILE, 'item_id' => YABE_KOKORO::EDD_STORE['item_id'], 'store_url' => YABE_KOKORO::EDD_STORE['store_url'], 'author' => YABE_KOKORO::EDD_STORE['author']]); 148 return $this->plugin_updater; 149 } 150 /** 133 151 * Handle the plugin's activation by (maybe) running database migrations 134 152 * and initializing the plugin configuration. … … 203 221 } 204 222 /** 205 * Initialize the plugin updater.206 * Pro version only.207 *208 * @return PluginUpdater209 */210 public function maybe_update_plugin()211 {212 if (!\class_exists(PluginUpdater::class)) {213 return null;214 }215 if ($this->plugin_updater instanceof \_YabeKokoro\EDD_SL\PluginUpdater) {216 return $this->plugin_updater;217 }218 $license = \get_option(YABE_KOKORO::WP_OPTION . '_license', ['key' => '', 'opt_in_pre_release' => \false]);219 $this->plugin_updater = new PluginUpdater(YABE_KOKORO::WP_OPTION, ['version' => YABE_KOKORO::VERSION, 'license' => $license['key'] ? \trim($license['key']) : \false, 'beta' => $license['opt_in_pre_release'], 'plugin_file' => YABE_KOKORO::FILE, 'item_id' => YABE_KOKORO::EDD_STORE['item_id'], 'store_url' => YABE_KOKORO::EDD_STORE['store_url'], 'author' => YABE_KOKORO::EDD_STORE['author']]);220 return $this->plugin_updater;221 }222 /**223 223 * Check if the plugin distributed with an embedded license and activate the license. 224 224 * Pro version only. -
yabe-kokoro/trunk/src/Utils/Config.php
r2985507 r2989634 13 13 14 14 use Exception; 15 use _YabeKokoro\YABE_KOKORO;16 15 use _YabeKokoro\Symfony\Component\PropertyAccess\Exception\AccessException; 17 16 use _YabeKokoro\Symfony\Component\PropertyAccess\Exception\InvalidArgumentException; 18 17 use _YabeKokoro\Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException; 19 18 use _YabeKokoro\Symfony\Component\PropertyAccess\PropertyAccess; 19 use _YabeKokoro\YABE_KOKORO; 20 20 /** 21 21 * Accessor for the plugin config. -
yabe-kokoro/trunk/src/Utils/Requirement.php
r2985510 r2989634 76 76 * Check if plugins are active and may have the minimum version specified. 77 77 * 78 * @param list< string|array{0: string, 1: string}> $plugins The plugins to check. Use the plugin file path, e.g. `yabe-kokoro/yabe-kokoro.php`.78 * @param list<array{slug: string, name: string, version?: string}> $plugins The plugins to check. The `version` is optional. 79 79 */ 80 80 public function plugins(array $plugins) : self 81 81 { 82 foreach ($plugins as $k => $v) { 83 if (\is_int($k)) { 84 if (!\is_plugin_active($v)) { 85 $pluginName = \get_plugin_data(\WP_PLUGIN_DIR . '/' . $v)['Name']; 86 $this->doesNotMeet[] = \sprintf('<strong>%s</strong>', \esc_html($pluginName)); 87 } 88 } else { 89 $pluginName = \get_plugin_data(\WP_PLUGIN_DIR . '/' . $k)['Name']; 90 if (!\is_plugin_active($k)) { 91 $this->doesNotMeet[] = \sprintf('<strong>%s</strong>', \esc_html($pluginName)); 92 } elseif (\version_compare(\get_plugin_data(\WP_PLUGIN_DIR . '/' . $k)['Version'], $v, '<')) { 93 $this->doesNotMeet[] = \sprintf('<strong>%s</strong> <code>%s</code> or higher', \esc_html($pluginName), $v); 94 } 82 $installed_plugins = \get_plugins(); 83 foreach ($plugins as $plugin) { 84 if (!\array_key_exists($plugin['slug'], $installed_plugins) && !\in_array($plugin['slug'], $installed_plugins, \true)) { 85 $this->doesNotMeet[] = \sprintf('<strong>%s</strong> are not installed', \esc_html($plugin['name'])); 86 continue; 87 } 88 $pluginData = \get_plugin_data(\WP_PLUGIN_DIR . '/' . $plugin['slug']); 89 if (isset($plugin['version']) && \version_compare($pluginData['Version'], $plugin['version'], '<')) { 90 $this->doesNotMeet[] = \sprintf('<strong>%s</strong> <code>%s</code> or higher version', \esc_html($pluginData['Name']), $plugin['version']); 91 continue; 92 } 93 if (!\is_plugin_active($plugin['slug'])) { 94 $this->doesNotMeet[] = \sprintf('<strong>%s</strong> are not activated', \esc_html($pluginData['Name'])); 95 continue; 95 96 } 96 97 } … … 105 106 public function theme(string $parentTheme, ?string $version = null) : self 106 107 { 107 $ theme = \wp_get_theme();108 $wpTheme = \wp_get_theme(); 108 109 if (\get_template() !== $parentTheme) { 109 110 $this->doesNotMeet[] = \sprintf('<strong>%s</strong>', $parentTheme); 110 } elseif ($version && \version_compare(($ theme->parent() ?: $theme)->get('Version'), $version, '<')) {111 } elseif ($version && \version_compare(($wpTheme->parent() ?: $wpTheme)->get('Version'), $version, '<')) { 111 112 $this->doesNotMeet[] = \sprintf('<strong>%s</strong> <code>%s</code> or higher', $parentTheme, $version); 112 113 } … … 120 121 $notice = \sprintf( 121 122 /* translators: 1: plugin name, 2: list of requirements */ 122 \ esc_html__('The <strong>%1$s</strong> plugin minimum requirements are not met:', 'yabe-kokoro'),123 \__('The <strong>%1$s</strong> plugin minimum requirements are not met:', 'yabe-kokoro'), 123 124 \esc_html(\get_plugin_data(YABE_KOKORO::FILE, \false)['Name']) 124 125 ); -
yabe-kokoro/trunk/yabe-kokoro.php
r2985510 r2989634 8 8 * Plugin URI: https://kokoro.yabe.land 9 9 * Description: Oxygen design sets manager 10 * Version: 1.0. 610 * Version: 1.0.7 11 11 * Requires at least: 6.0 12 12 * Requires PHP: 7.4 … … 32 32 } 33 33 $requirement = new Requirement(); 34 $requirement->php('7.4')->wp('6.0')->plugins([ 'oxygen/functions.php' => '4.0']);34 $requirement->php('7.4')->wp('6.0')->plugins([['slug' => 'oxygen/functions.php', 'name' => 'Oxygen', 'version' => '4.0']]); 35 35 if ($requirement->met()) { 36 36 Plugin::get_instance()->boot();
Note: See TracChangeset
for help on using the changeset viewer.