| @@ -1,10 +1,10 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Google Web Stories integration class | |
| 3 | + * Integrations: Google Web Stories integration class | |
| 4 | 4 | * |
| 5 | - * @package Parsely\Integrations | |
| 6 | - * @since 3.2.0 | |
| 5 | + * @package Parsely | |
| 6 | + * @since 3.2.0 | |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | declare(strict_types=1); |
| 10 | 10 | |
| @@ -14,15 +14,14 @@ | ||
| 14 | 14 | * Integrates Parse.ly tracking with the Google Web Stories plugin. |
| 15 | 15 | * |
| 16 | 16 | * @since 3.2.0 |
| 17 | 17 | */ |
| 18 | -final class Google_Web_Stories implements Integration { | |
| 18 | +final class Google_Web_Stories extends Integration { | |
| 19 | 19 | /** |
| 20 | - * Apply the hooks that integrate the plugin or theme with the Parse.ly plugin. | |
| 20 | + * Applies the hooks that integrate the plugin or theme with the Parse.ly | |
| 21 | + * plugin. | |
| 21 | 22 | * |
| 22 | 23 | * @since 3.2.0 |
| 23 | - * | |
| 24 | - * @return void | |
| 25 | 24 | */ |
| 26 | 25 | public function integrate(): void { |
| 27 | 26 | if ( defined( 'WEBSTORIES_PLUGIN_FILE' ) ) { |
| 28 | 27 | add_action( 'web_stories_print_analytics', array( $this, 'render_amp_analytics_tracker' ) ); |
| @@ -29,14 +28,14 @@ | ||
| 29 | 28 | } |
| 30 | 29 | } |
| 31 | 30 | |
| 32 | 31 | /** |
| 33 | - * Load additional JavaScript for Google's Web Stories WordPress plugin. This relies on the `amp-analytics` element. | |
| 32 | + * Loads additional JavaScript for Google's Web Stories WordPress plugin. | |
| 33 | + * This relies on the `amp-analytics` element. | |
| 34 | + * | |
| 34 | 35 | * See more at: https://www.parse.ly/help/integration/google-amp. |
| 35 | 36 | * |
| 36 | 37 | * @since 3.2.0 |
| 37 | - * | |
| 38 | - * @return void | |
| 39 | 38 | */ |
| 40 | 39 | public function render_amp_analytics_tracker(): void { |
| 41 | 40 | $json = Amp::construct_amp_json(); |
| 42 | 41 | if ( strlen( $json ) > 0 ) { |
| @@ -43,9 +42,9 @@ | ||
| 43 | 42 | ?> |
| 44 | 43 | <amp-analytics type="parsely"> |
| 45 | 44 | <script type="application/json"> |
| 46 | 45 | <?php |
| 47 | - // Output contains the API key, and it's already escaped in the construct_amp_json function. | |
| 46 | + // Output contains the Site ID, and it's already escaped in the construct_amp_json function. | |
| 48 | 47 | // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 49 | 48 | echo $json; |
| 50 | 49 | ?> |
| 51 | 50 | </script> |