PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 27.6
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v27.6
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / introductions / application / current-page-trait.php

current-page-trait.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 27.6, at src/introductions/application/current-page-trait.php

44 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yoast\WP\SEO\Introductions\Application;
4
5 trait Current_Page_Trait {
6
7 /**
8 * Determines whether the current page is applicable.
9 *
10 * @param string[] $pages The applicable pages.
11 *
12 * @return bool Whether the current page is applicable.
13 */
14 private function is_on_yoast_page( $pages ) {
15 return \in_array( $this->get_page(), $pages, true );
16 }
17
18 /**
19 * Determines whether the current page is one of our installation pages.
20 *
21 * @return bool Whether the current page is one of our installation pages.
22 */
23 private function is_on_installation_page() {
24 return $this->is_on_yoast_page( [ 'wpseo_installation_successful_free', 'wpseo_installation_successful' ] );
25 }
26
27 /**
28 * Retrieve the page variable.
29 *
30 * Note: the result is not safe to use in anything than strict comparisons!
31 *
32 * @return string The page variable.
33 */
34 private function get_page() {
35 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
36 if ( isset( $_GET['page'] ) && \is_string( $_GET['page'] ) ) {
37 // phpcs:ignore WordPress.Security.NonceVerification.Recommended,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are not processing form information, only using it in strict comparison.
38 return \wp_unslash( $_GET['page'] );
39 }
40
41 return '';
42 }
43 }
44