PluginProbe
WindPress – Tailwind CSS integration for WordPress / trunk
WindPress – Tailwind CSS integration for WordPress vtrunk
3.2.88 3.2.87 3.2.86 3.2.85 3.2.84 3.2.83 3.2.82 3.2.81 trunk 3.0.0 3.0.1 3.0.10 3.0.11 3.0.12 3.0.13 3.0.14 3.0.15 3.0.16 3.0.17 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 All 142 releases
windpress / src / Integration / GreenShift / Main.php

Main.php in WindPress – Tailwind CSS integration for WordPress trunk, at src/Integration/GreenShift/Main.php

46 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 * This file is part of the WindPress package.
5 *
6 * (c) Joshua Gugun Siagian <suabahasa@gmail.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11 declare (strict_types=1);
12 namespace WindPress\WindPress\Integration\GreenShift;
13
14 use WindPress\WindPress\Integration\IntegrationInterface;
15 use WindPress\WindPress\Utils\Common;
16 use WindPress\WindPress\Utils\Config;
17 /**
18 * Tested with GreenShift version 9.4
19 * @author Joshua Gugun Siagian <suabahasa@gmail.com>
20 */
21 class Main implements IntegrationInterface
22 {
23 public function __construct()
24 {
25 add_filter('f!windpress/core/cache:compile.providers', fn(array $providers): array => $this->register_provider($providers));
26 }
27 public function get_name(): string
28 {
29 return 'greenshift';
30 }
31 public function is_enabled(): bool
32 {
33 return (bool) apply_filters('f!windpress/integration/greenshift:enabled', Config::get(sprintf('integration.%s.enabled', $this->get_name()), \true));
34 }
35 public function register_provider(array $providers): array
36 {
37 $providers[] = ['id' => $this->get_name(), 'name' => __('GreenShift', 'windpress'), 'description' => __('The GreenShift integration. It requires the Gutenberg/Block Editor integration enabled.', 'windpress'), 'callback' => Config::get(sprintf('integration.%s.compile.enabled', $this->get_name()), \true) ? \WindPress\WindPress\Integration\GreenShift\Compile::class : static fn() => [], 'enabled' => $this->is_enabled(), 'type' => 'plugin', 'homepage' => 'https://shop.greenshiftwp.com/?from=3679', 'is_installed_active' => static function () {
38 $is = -1;
39 $is += Common::is_plugin_installed('GreenShift - Animation and Page Builder Blocks') ? 1 : 0;
40 $is += Common::is_plugin_active_by_name('GreenShift - Animation and Page Builder Blocks') ? 1 : 0;
41 return $is;
42 }, 'meta' => ['experimental' => \true]];
43 return $providers;
44 }
45 }
46