diff --git a/bin/phpstan/constants.php b/bin/phpstan/constants.php index 746aa5b..065e62f 100644 --- a/bin/phpstan/constants.php +++ b/bin/phpstan/constants.php @@ -5,8 +5,8 @@ * @package GTM Kit */ -define( 'GTMKIT_FILE', '/gtm-kit.php' ); -define( 'GTMKIT_PATH', '/' ); +define( 'GTMKIT_FILE', './gtm-kit.php' ); +define( 'GTMKIT_PATH', './' ); define( 'GTMKIT_BASENAME', '/gtm-kit.php' ); define( 'GTMKIT_URL', '/gtm-kit.php' ); define( 'GTMKIT_ADMIN_SLUG', 'gtmkit_' ); diff --git a/composer.json b/composer.json index c913a1f..acd2356 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "php-stubs/woocommerce-stubs": "^9.2", "phpcompatibility/phpcompatibility-wp": "*", "phpstan/extension-installer": "^1.4.2", - "phpstan/phpstan": "^1.12.0", + "phpstan/phpstan": "^1.12", "phpstan/phpstan-deprecation-rules": "^1.2", "szepeviktor/phpstan-wordpress": "^v1.3.5", "wp-coding-standards/wpcs": "^3.1" diff --git a/composer.lock b/composer.lock index c1fd8fa..8332679 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7254d08b177a78b92ab927706095765d", + "content-hash": "2db0a8796f3ef426f0cb179486023569", "packages": [], "packages-dev": [ { @@ -827,22 +827,22 @@ }, { "name": "phpstan/extension-installer", - "version": "1.4.2", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/phpstan/extension-installer.git", - "reference": "46c8219b3fb0deb3fc08301e8f0797d321d17dcd" + "reference": "85e90b3942d06b2326fba0403ec24fe912372936" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/46c8219b3fb0deb3fc08301e8f0797d321d17dcd", - "reference": "46c8219b3fb0deb3fc08301e8f0797d321d17dcd", + "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/85e90b3942d06b2326fba0403ec24fe912372936", + "reference": "85e90b3942d06b2326fba0403ec24fe912372936", "shasum": "" }, "require": { "composer-plugin-api": "^2.0", "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.9.0" + "phpstan/phpstan": "^1.9.0 || ^2.0" }, "require-dev": { "composer/composer": "^2.0", @@ -869,22 +869,22 @@ ], "support": { "issues": "https://github.com/phpstan/extension-installer/issues", - "source": "https://github.com/phpstan/extension-installer/tree/1.4.2" + "source": "https://github.com/phpstan/extension-installer/tree/1.4.3" }, - "time": "2024-08-26T07:38:00+00:00" + "time": "2024-09-04T20:21:43+00:00" }, { "name": "phpstan/phpstan", - "version": "1.12.0", + "version": "1.12.3", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "384af967d35b2162f69526c7276acadce534d0e1" + "reference": "0fcbf194ab63d8159bb70d9aa3e1350051632009" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/384af967d35b2162f69526c7276acadce534d0e1", - "reference": "384af967d35b2162f69526c7276acadce534d0e1", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0fcbf194ab63d8159bb70d9aa3e1350051632009", + "reference": "0fcbf194ab63d8159bb70d9aa3e1350051632009", "shasum": "" }, "require": { @@ -929,7 +929,7 @@ "type": "github" } ], - "time": "2024-08-27T09:18:05+00:00" + "time": "2024-09-09T08:10:35+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", @@ -1235,20 +1235,20 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", - "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" @@ -1295,7 +1295,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" }, "funding": [ { @@ -1311,24 +1311,24 @@ "type": "tidelift" } ], - "time": "2024-06-19T12:30:46+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1" + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/ec444d3f3f6505bb28d11afa41e75faadebc10a1", - "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb", + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { @@ -1371,7 +1371,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.31.0" }, "funding": [ { @@ -1387,24 +1387,24 @@ "type": "tidelift" } ], - "time": "2024-05-31T15:07:36+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", - "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { @@ -1451,7 +1451,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" }, "funding": [ { @@ -1467,7 +1467,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T15:07:36+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/translation", diff --git a/phpstan.neon.dist b/phpstan.neon.dist index fe7dcfb..951c7cb 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -14,3 +14,5 @@ parameters: - gtm-kit.php - src/ - uninstall.php + ignoreErrors: + - '#Path in require_once.*plugin#' diff --git a/src/Installation/PluginDataImport.php b/src/Installation/PluginDataImport.php index 12f40ed..5b398c2 100644 --- a/src/Installation/PluginDataImport.php +++ b/src/Installation/PluginDataImport.php @@ -234,7 +234,7 @@ private function get_google_tag_manager(): array { private function is_plugin_active( string $plugin ): bool { if ( ! function_exists( 'is_plugin_active' ) ) { - include_once ABSPATH . 'wp-admin/includes/plugin.php'; + require_once ABSPATH . 'wp-admin/includes/plugin.php'; } diff --git a/src/Options.php b/src/Options.php index b8724fc..a9ade3f 100644 --- a/src/Options.php +++ b/src/Options.php @@ -148,7 +148,7 @@ public function pre_update_option( $new_value, $old_value ): ?array { public static function get_defaults(): array { if ( ! function_exists( 'is_plugin_active' ) ) { - include_once ABSPATH . 'wp-admin/includes/plugin.php'; + require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $map = self::$map; diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 621f40b..ecf2152 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'tlamedia/gtm-kit', 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => '12e7711143893383db41f72c329ee58fa26b6819', + 'reference' => '8f779ad9f08f3aeba4a68076cd25114917840707', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ 'tlamedia/gtm-kit' => array( 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => '12e7711143893383db41f72c329ee58fa26b6819', + 'reference' => '8f779ad9f08f3aeba4a68076cd25114917840707', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(),