Plugin Directory

Changeset 2989634


Ignore:
Timestamp:
11/06/2023 08:28:59 AM (17 months ago)
Author:
rosua
Message:

Update to version 1.0.7 from GitHub

Location:
yabe-kokoro
Files:
28 edited
1 copied

Legend:

Unmodified
Added
Removed
  • yabe-kokoro/tags/1.0.7/constant.php

    r2985510 r2989634  
    2626     * @var string
    2727     */
    28     public const VERSION = '1.0.6';
     28    public const VERSION = '1.0.7';
    2929    /**
    3030     * @var int
    3131     */
    32     public const VERSION_ID = 10006;
     32    public const VERSION_ID = 10007;
    3333    /**
    3434     * @var int
     
    4242     * @var int
    4343     */
    44     public const RELEASE_VERSION = 6;
     44    public const RELEASE_VERSION = 7;
    4545    /**
    4646     * @var string
  • yabe-kokoro/tags/1.0.7/readme.txt

    r2985510 r2989634  
    55Requires at least: 6.0
    66Tested up to: 6.3
    7 Stable tag: 1.0.6
     7Stable tag: 1.0.7
    88Requires PHP: 7.4
    99License: GPLv3
     
    5757
    5858
     59= 1.0.7 =
     60* **Fix**: Plugin requirements checking issue
     61
    5962= 1.0.6 =
    6063* **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  
    1313
    1414use _YabeKokoro\EDD_SL\PluginUpdater;
    15 use _YabeKokoro\YABE_KOKORO;
    1615use Yabe\Kokoro\Ecommerce\Loader as PlatformLoader;
    1716use Yabe\Kokoro\Utils\Asset;
     17use _YabeKokoro\YABE_KOKORO;
    1818class AdminPage
    1919{
  • yabe-kokoro/tags/1.0.7/src/Api/Admin/Setting.php

    r2985507 r2989634  
    1212namespace Yabe\Kokoro\Api\Admin;
    1313
    14 use _YabeKokoro\YABE_KOKORO;
    1514use WP_REST_Request;
    1615use WP_REST_Response;
     
    1918use Yabe\Kokoro\Api\ApiInterface;
    2019use Yabe\Kokoro\Plugin;
     20use _YabeKokoro\YABE_KOKORO;
    2121/**
    2222 * @since 1.0.0
  • yabe-kokoro/tags/1.0.7/src/Api/Router.php

    r2985507 r2989634  
    1212namespace Yabe\Kokoro\Api;
    1313
    14 use _YabeKokoro\YABE_KOKORO;
    1514use ReflectionClass;
    1615use _YabeKokoro\Symfony\Component\Finder\Finder;
     16use _YabeKokoro\YABE_KOKORO;
    1717class Router
    1818{
  • yabe-kokoro/tags/1.0.7/src/Ecommerce/Loader.php

    r2985507 r2989634  
    1313
    1414use Exception;
    15 use _YabeKokoro\YABE_KOKORO;
    1615use ReflectionClass;
    1716use _YabeKokoro\Symfony\Component\Finder\Finder;
     17use _YabeKokoro\YABE_KOKORO;
    1818class Loader
    1919{
  • yabe-kokoro/tags/1.0.7/src/Ecommerce/Platform/WooCommerce/Email.php

    r2985507 r2989634  
    7373                            <div style="padding: 12px; color: #636363; border: 1px solid #e5e5e5;" >
    7474                                <?php
    75         $table_body;
     75        echo $table_body;
    7676        ?>
    7777                            </div>
  • yabe-kokoro/tags/1.0.7/src/Ecommerce/Platform/WooCommerce/Metabox.php

    r2985507 r2989634  
    1212namespace Yabe\Kokoro\Ecommerce\Platform\WooCommerce;
    1313
     14use WP_Post;
    1415use _YabeKokoro\YABE_KOKORO;
    15 use WP_Post;
    1616/**
    1717 * @since 1.0.0
     
    4949            <div class="kokoro-container">
    5050                <?php
    51         $nonce_field;
     51        echo $nonce_field;
    5252        ?>
    5353                <div>
     
    5555                    <label for="kokoro_should_generate">
    5656                        <input type="checkbox" name="kokoro_should_generate" id="kokoro_should_generate" <?php
    57         $should_generate;
     57        echo $should_generate;
    5858        ?>>
    5959                        Generate the license automatically
     
    6565                    <label for="kokoro_should_renewal">
    6666                        <input type="checkbox" name="kokoro_should_renewal" id="kokoro_should_renewal" <?php
    67         $should_renewal;
     67        echo $should_renewal;
    6868        ?>>
    6969                        Allow license renewal
     
    7878                    </p>
    7979                    <input type="number" name="kokoro_max_sites" id="kokoro_max_sites" value="<?php
    80         $max_sites;
     80        echo $max_sites;
    8181        ?>" min="0">
    8282                </div>
     
    8989                    <div>
    9090                        <input type="number" name="kokoro_active_duration" id="kokoro_active_duration" value="<?php
    91         $active_duration;
     91        echo $active_duration;
    9292        ?>" min="0">
    9393                         days
  • yabe-kokoro/tags/1.0.7/src/Ecommerce/Platform/WooCommerce/ReceiptBlock.php

    r2985507 r2989634  
    100100                </thead>
    101101                <?php
    102         $table_body;
     102        echo $table_body;
    103103        ?>
    104104            </table>
  • yabe-kokoro/tags/1.0.7/src/Migration.php

    r2985507 r2989634  
    1212namespace Yabe\Kokoro;
    1313
     14use _YabeKokoro\Rosua\Migrations\Migrator;
    1415use _YabeKokoro\YABE_KOKORO;
    15 use _YabeKokoro\Rosua\Migrations\Migrator;
    1616/**
    1717 * Manage the plugin custom database tables.
  • yabe-kokoro/tags/1.0.7/src/Plugin.php

    r2985507 r2989634  
    1414use _YabeKokoro\EDD_SL\PluginUpdater;
    1515use Exception;
    16 use _YabeKokoro\YABE_KOKORO;
    1716use WP_Upgrader;
    1817use wpdb;
     
    2423use Yabe\Kokoro\Utils\Debug;
    2524use Yabe\Kokoro\Utils\Notice;
     25use _YabeKokoro\YABE_KOKORO;
    2626/**
    2727 * Manage the plugin lifecycle and provides a single point of entry to the plugin.
     
    131131    }
    132132    /**
     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    /**
    133151     * Handle the plugin's activation by (maybe) running database migrations
    134152     * and initializing the plugin configuration.
     
    203221    }
    204222    /**
    205      * Initialize the plugin updater.
    206      * Pro version only.
    207      *
    208      * @return PluginUpdater
    209      */
    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     /**
    223223     * Check if the plugin distributed with an embedded license and activate the license.
    224224     * Pro version only.
  • yabe-kokoro/tags/1.0.7/src/Utils/Config.php

    r2985507 r2989634  
    1313
    1414use Exception;
    15 use _YabeKokoro\YABE_KOKORO;
    1615use _YabeKokoro\Symfony\Component\PropertyAccess\Exception\AccessException;
    1716use _YabeKokoro\Symfony\Component\PropertyAccess\Exception\InvalidArgumentException;
    1817use _YabeKokoro\Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException;
    1918use _YabeKokoro\Symfony\Component\PropertyAccess\PropertyAccess;
     19use _YabeKokoro\YABE_KOKORO;
    2020/**
    2121 * Accessor for the plugin config.
  • yabe-kokoro/tags/1.0.7/src/Utils/Requirement.php

    r2985510 r2989634  
    7676     * Check if plugins are active and may have the minimum version specified.
    7777     *
    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.
    7979     */
    8080    public function plugins(array $plugins) : self
    8181    {
    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;
    9596            }
    9697        }
     
    105106    public function theme(string $parentTheme, ?string $version = null) : self
    106107    {
    107         $theme = \wp_get_theme();
     108        $wpTheme = \wp_get_theme();
    108109        if (\get_template() !== $parentTheme) {
    109110            $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, '<')) {
    111112            $this->doesNotMeet[] = \sprintf('<strong>%s</strong> <code>%s</code> or higher', $parentTheme, $version);
    112113        }
     
    120121        $notice = \sprintf(
    121122            /* 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'),
    123124            \esc_html(\get_plugin_data(YABE_KOKORO::FILE, \false)['Name'])
    124125        );
  • yabe-kokoro/tags/1.0.7/yabe-kokoro.php

    r2985510 r2989634  
    88 * Plugin URI:          https://kokoro.yabe.land
    99 * Description:         Oxygen design sets manager
    10  * Version:             1.0.6
     10 * Version:             1.0.7
    1111 * Requires at least:   6.0
    1212 * Requires PHP:        7.4
     
    3232}
    3333$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']]);
    3535if ($requirement->met()) {
    3636    Plugin::get_instance()->boot();
  • yabe-kokoro/trunk/constant.php

    r2985510 r2989634  
    2626     * @var string
    2727     */
    28     public const VERSION = '1.0.6';
     28    public const VERSION = '1.0.7';
    2929    /**
    3030     * @var int
    3131     */
    32     public const VERSION_ID = 10006;
     32    public const VERSION_ID = 10007;
    3333    /**
    3434     * @var int
     
    4242     * @var int
    4343     */
    44     public const RELEASE_VERSION = 6;
     44    public const RELEASE_VERSION = 7;
    4545    /**
    4646     * @var string
  • yabe-kokoro/trunk/readme.txt

    r2985510 r2989634  
    55Requires at least: 6.0
    66Tested up to: 6.3
    7 Stable tag: 1.0.6
     7Stable tag: 1.0.7
    88Requires PHP: 7.4
    99License: GPLv3
     
    5757
    5858
     59= 1.0.7 =
     60* **Fix**: Plugin requirements checking issue
     61
    5962= 1.0.6 =
    6063* **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  
    1313
    1414use _YabeKokoro\EDD_SL\PluginUpdater;
    15 use _YabeKokoro\YABE_KOKORO;
    1615use Yabe\Kokoro\Ecommerce\Loader as PlatformLoader;
    1716use Yabe\Kokoro\Utils\Asset;
     17use _YabeKokoro\YABE_KOKORO;
    1818class AdminPage
    1919{
  • yabe-kokoro/trunk/src/Api/Admin/Setting.php

    r2985507 r2989634  
    1212namespace Yabe\Kokoro\Api\Admin;
    1313
    14 use _YabeKokoro\YABE_KOKORO;
    1514use WP_REST_Request;
    1615use WP_REST_Response;
     
    1918use Yabe\Kokoro\Api\ApiInterface;
    2019use Yabe\Kokoro\Plugin;
     20use _YabeKokoro\YABE_KOKORO;
    2121/**
    2222 * @since 1.0.0
  • yabe-kokoro/trunk/src/Api/Router.php

    r2985507 r2989634  
    1212namespace Yabe\Kokoro\Api;
    1313
    14 use _YabeKokoro\YABE_KOKORO;
    1514use ReflectionClass;
    1615use _YabeKokoro\Symfony\Component\Finder\Finder;
     16use _YabeKokoro\YABE_KOKORO;
    1717class Router
    1818{
  • yabe-kokoro/trunk/src/Ecommerce/Loader.php

    r2985507 r2989634  
    1313
    1414use Exception;
    15 use _YabeKokoro\YABE_KOKORO;
    1615use ReflectionClass;
    1716use _YabeKokoro\Symfony\Component\Finder\Finder;
     17use _YabeKokoro\YABE_KOKORO;
    1818class Loader
    1919{
  • yabe-kokoro/trunk/src/Ecommerce/Platform/WooCommerce/Email.php

    r2985507 r2989634  
    7373                            <div style="padding: 12px; color: #636363; border: 1px solid #e5e5e5;" >
    7474                                <?php
    75         $table_body;
     75        echo $table_body;
    7676        ?>
    7777                            </div>
  • yabe-kokoro/trunk/src/Ecommerce/Platform/WooCommerce/Metabox.php

    r2985507 r2989634  
    1212namespace Yabe\Kokoro\Ecommerce\Platform\WooCommerce;
    1313
     14use WP_Post;
    1415use _YabeKokoro\YABE_KOKORO;
    15 use WP_Post;
    1616/**
    1717 * @since 1.0.0
     
    4949            <div class="kokoro-container">
    5050                <?php
    51         $nonce_field;
     51        echo $nonce_field;
    5252        ?>
    5353                <div>
     
    5555                    <label for="kokoro_should_generate">
    5656                        <input type="checkbox" name="kokoro_should_generate" id="kokoro_should_generate" <?php
    57         $should_generate;
     57        echo $should_generate;
    5858        ?>>
    5959                        Generate the license automatically
     
    6565                    <label for="kokoro_should_renewal">
    6666                        <input type="checkbox" name="kokoro_should_renewal" id="kokoro_should_renewal" <?php
    67         $should_renewal;
     67        echo $should_renewal;
    6868        ?>>
    6969                        Allow license renewal
     
    7878                    </p>
    7979                    <input type="number" name="kokoro_max_sites" id="kokoro_max_sites" value="<?php
    80         $max_sites;
     80        echo $max_sites;
    8181        ?>" min="0">
    8282                </div>
     
    8989                    <div>
    9090                        <input type="number" name="kokoro_active_duration" id="kokoro_active_duration" value="<?php
    91         $active_duration;
     91        echo $active_duration;
    9292        ?>" min="0">
    9393                         days
  • yabe-kokoro/trunk/src/Ecommerce/Platform/WooCommerce/ReceiptBlock.php

    r2985507 r2989634  
    100100                </thead>
    101101                <?php
    102         $table_body;
     102        echo $table_body;
    103103        ?>
    104104            </table>
  • yabe-kokoro/trunk/src/Migration.php

    r2985507 r2989634  
    1212namespace Yabe\Kokoro;
    1313
     14use _YabeKokoro\Rosua\Migrations\Migrator;
    1415use _YabeKokoro\YABE_KOKORO;
    15 use _YabeKokoro\Rosua\Migrations\Migrator;
    1616/**
    1717 * Manage the plugin custom database tables.
  • yabe-kokoro/trunk/src/Plugin.php

    r2985507 r2989634  
    1414use _YabeKokoro\EDD_SL\PluginUpdater;
    1515use Exception;
    16 use _YabeKokoro\YABE_KOKORO;
    1716use WP_Upgrader;
    1817use wpdb;
     
    2423use Yabe\Kokoro\Utils\Debug;
    2524use Yabe\Kokoro\Utils\Notice;
     25use _YabeKokoro\YABE_KOKORO;
    2626/**
    2727 * Manage the plugin lifecycle and provides a single point of entry to the plugin.
     
    131131    }
    132132    /**
     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    /**
    133151     * Handle the plugin's activation by (maybe) running database migrations
    134152     * and initializing the plugin configuration.
     
    203221    }
    204222    /**
    205      * Initialize the plugin updater.
    206      * Pro version only.
    207      *
    208      * @return PluginUpdater
    209      */
    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     /**
    223223     * Check if the plugin distributed with an embedded license and activate the license.
    224224     * Pro version only.
  • yabe-kokoro/trunk/src/Utils/Config.php

    r2985507 r2989634  
    1313
    1414use Exception;
    15 use _YabeKokoro\YABE_KOKORO;
    1615use _YabeKokoro\Symfony\Component\PropertyAccess\Exception\AccessException;
    1716use _YabeKokoro\Symfony\Component\PropertyAccess\Exception\InvalidArgumentException;
    1817use _YabeKokoro\Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException;
    1918use _YabeKokoro\Symfony\Component\PropertyAccess\PropertyAccess;
     19use _YabeKokoro\YABE_KOKORO;
    2020/**
    2121 * Accessor for the plugin config.
  • yabe-kokoro/trunk/src/Utils/Requirement.php

    r2985510 r2989634  
    7676     * Check if plugins are active and may have the minimum version specified.
    7777     *
    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.
    7979     */
    8080    public function plugins(array $plugins) : self
    8181    {
    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;
    9596            }
    9697        }
     
    105106    public function theme(string $parentTheme, ?string $version = null) : self
    106107    {
    107         $theme = \wp_get_theme();
     108        $wpTheme = \wp_get_theme();
    108109        if (\get_template() !== $parentTheme) {
    109110            $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, '<')) {
    111112            $this->doesNotMeet[] = \sprintf('<strong>%s</strong> <code>%s</code> or higher', $parentTheme, $version);
    112113        }
     
    120121        $notice = \sprintf(
    121122            /* 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'),
    123124            \esc_html(\get_plugin_data(YABE_KOKORO::FILE, \false)['Name'])
    124125        );
  • yabe-kokoro/trunk/yabe-kokoro.php

    r2985510 r2989634  
    88 * Plugin URI:          https://kokoro.yabe.land
    99 * Description:         Oxygen design sets manager
    10  * Version:             1.0.6
     10 * Version:             1.0.7
    1111 * Requires at least:   6.0
    1212 * Requires PHP:        7.4
     
    3232}
    3333$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']]);
    3535if ($requirement->met()) {
    3636    Plugin::get_instance()->boot();
Note: See TracChangeset for help on using the changeset viewer.