| @@ -9,15 +9,15 @@ | ||
| 9 | 9 | declare(strict_types=1); |
| 10 | 10 | |
| 11 | 11 | namespace Parsely; |
| 12 | 12 | |
| 13 | -use Parsely\Utils\Utils; | |
| 13 | +use function Parsely\Utils\get_asset_info; | |
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * Inserts the scripts and tracking code into the site's front-end. |
| 17 | 17 | * |
| 18 | 18 | * @since 1.0.0 |
| 19 | - * @since 3.0.0 Moved from class-parsely to separate file. | |
| 19 | + * @since 3.0.0 Moved from class-parsely to separate file | |
| 20 | 20 | */ |
| 21 | 21 | class Scripts { |
| 22 | 22 | /** |
| 23 | 23 | * Instance of Parsely class. |
| @@ -51,9 +51,9 @@ | ||
| 51 | 51 | /** |
| 52 | 52 | * Registers scripts, if there's a Site ID value saved. |
| 53 | 53 | * |
| 54 | 54 | * @since 2.5.0 |
| 55 | - * @since 3.0.0 Rename from register_js. | |
| 55 | + * @since 3.0.0 Rename from register_js | |
| 56 | 56 | */ |
| 57 | 57 | public function register_scripts(): void { |
| 58 | 58 | wp_register_script( |
| 59 | 59 | 'wp-parsely-tracker', |
| @@ -62,9 +62,9 @@ | ||
| 62 | 62 | PARSELY_VERSION, |
| 63 | 63 | true |
| 64 | 64 | ); |
| 65 | 65 | |
| 66 | - $loader_asset = Utils::get_asset_info( 'build/loader.asset.php' ); | |
| 66 | + $loader_asset = get_asset_info( 'build/loader.asset.php' ); | |
| 67 | 67 | |
| 68 | 68 | wp_register_script( |
| 69 | 69 | 'wp-parsely-loader', |
| 70 | 70 | plugin_dir_url( PARSELY_FILE ) . 'build/loader.js', |
| @@ -76,10 +76,10 @@ | ||
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | 78 | * Enqueues the JavaScript code required to send off beacon requests. |
| 79 | 79 | * |
| 80 | - * @since 2.5.0 Rename from insert_parsely_javascript. | |
| 81 | - * @since 3.0.0 Rename from load_js_tracker. | |
| 80 | + * @since 2.5.0 Rename from insert_parsely_javascript | |
| 81 | + * @since 3.0.0 Rename from load_js_tracker | |
| 82 | 82 | */ |
| 83 | 83 | public function enqueue_js_tracker(): void { |
| 84 | 84 | if ( is_preview() ) { |
| 85 | 85 | return; |
| @@ -141,13 +141,9 @@ | ||
| 141 | 141 | * @param string $handle The script's registered handle. |
| 142 | 142 | * @param string $src Unused? The script's source URL. |
| 143 | 143 | * @return string Amended `script` tag. |
| 144 | 144 | */ |
| 145 | - public function script_loader_tag( // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed | |
| 146 | - string $tag, | |
| 147 | - string $handle, | |
| 148 | - string $src | |
| 149 | - ): string { | |
| 145 | + public function script_loader_tag( string $tag, string $handle, string $src ): string { | |
| 150 | 146 | if ( \in_array( |
| 151 | 147 | $handle, |
| 152 | 148 | array( |
| 153 | 149 | 'wp-parsely-loader', |