PluginProbe
The Innovative Form Builder – IvyForms / 1.5
The Innovative Form Builder – IvyForms v1.5
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
← All changes | backend/src/Services/Integrations/PluginInstaller.php +20 -1 0.8 → 1.5 View file →
@@ -18,9 +18,10 @@
18 18 *
19 19 * @var array<string, string>
20 20 */
21 21 private array $allowedPlugins = [
22 - 'wpdatatables' => 'wpdatatables/wpdatatables.php',
22 + 'wpdatatables' => 'wpdatatables/wpdatatables.php',
23 + 'ameliabooking' => 'ameliabooking/ameliabooking.php',
23 24 ];
24 25
25 26 /**
26 27 * Check if plugin is allowed to be installed
@@ -55,8 +56,26 @@
55 56 */
56 57 public function isPluginInstalled(string $pluginFile): bool
57 58 {
58 59 return file_exists(WP_PLUGIN_DIR . '/' . $pluginFile);
60 + }
61 +
62 + /**
63 + * Check if plugin is active
64 + *
65 + * @param string $pluginSlug
66 + *
67 + * @return bool
68 + */
69 + public function isPluginActive(string $pluginSlug): bool
70 + {
71 + if (!function_exists('is_plugin_active')) {
72 + require_once ABSPATH . 'wp-admin/includes/plugin.php';
73 + }
74 +
75 + $pluginFile = self::getPluginFile($pluginSlug);
76 +
77 + return $pluginFile !== null && is_plugin_active($pluginFile);
59 78 }
60 79
61 80 /**
62 81 * Activate a plugin