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/InstallActions/ActivationNewSiteMultisite.php +4 -8 0.1.2 → 1.5 View file →
@@ -5,12 +5,9 @@
5 5 */
6 6
7 7 namespace IvyForms\Services\InstallActions;
8 8
9 -// phpcs:disable PSR1.Files.SideEffects
10 -if (!defined('ABSPATH')) {
11 - exit; // Exit if accessed directly
12 -}
9 +use IvyForms\Common\Exceptions\InvalidArgumentException;
13 10
14 11 /**
15 12 * Class ActivationNewSiteMultisite
16 13 *
@@ -21,8 +18,9 @@
21 18 /**
22 19 * Activate the plugin for every newly created site if the plugin is network activated
23 20 *
24 21 * @param int $siteId
22 + * @throws InvalidArgumentException
25 23 */
26 24 public static function init(int $siteId): void
27 25 {
28 26 if (! function_exists('is_plugin_active_for_network')) {
@@ -30,15 +28,13 @@
30 28 require_once ABSPATH . 'wp-admin/includes/plugin.php';
31 29 }
32 30 }
33 31
34 - if (
35 - defined('IVYFORMS_PLUGIN_SLUG') &&
36 - is_plugin_active_for_network(IVYFORMS_PLUGIN_SLUG) // @phpstan-ignore argument.type
37 - ) {
32 + if (defined('IVYFORMS_PLUGIN_SLUG') && is_plugin_active_for_network(IVYFORMS_PLUGIN_SLUG)) {
38 33 switch_to_blog($siteId);
39 34 //Create database table if not exists
40 35 ActivationDatabaseHook::init();
36 + ActivationCapabilitiesHook::ensureAdministratorCaps();
41 37 restore_current_blog();
42 38 }
43 39 }
44 40 }