PluginProbe
Hostinger Tools / 2.0.1
Hostinger Tools v2.0.1
3.0.77 3.0.76 3.0.75 3.0.74 3.0.73 3.0.72 3.0.71 3.0.70 3.0.69 3.0.68 3.0.67 3.0.66 1.8.1 1.8.2 1.8.3 1.9.1 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.4 All 108 releases
← All changes | includes/class-hostinger-helper.php +7 -6 1.9.72.0.1 View file →
@@ -1,12 +1,9 @@
1 1 <?php
2 2
3 3 class Hostinger_Helper {
4 4 public const HOSTINGER_FREE_SUBDOMAIN_URL = 'hostingersite.com';
5 - public const HOSTINGER_PAGE = [
6 - '/wp-admin/admin.php?page=hostinger',
7 - '/wp-admin/admin.php?page=hostinger&'
8 - ];
5 + public const HOSTINGER_PAGE = '/wp-admin/admin.php?page=hostinger';
9 6
10 7 /**
11 8 *
12 9 * Check if plugin is active
@@ -78,8 +75,13 @@
78 75 return ! empty( $site_url ) && strpos( $site_url, self::HOSTINGER_FREE_SUBDOMAIN_URL ) !== false;
79 76 }
80 77
81 78 public function is_hostinger_admin_page(): bool {
79 +
80 + if( ! isset( $_SERVER['REQUEST_URI'] ) ) {
81 + return false;
82 + }
83 +
82 84 $current_uri = sanitize_text_field( $_SERVER['REQUEST_URI'] );
83 85
84 86 if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
85 87 return false;
@@ -88,14 +90,13 @@
88 90 if ( isset( $current_uri ) && strpos( $current_uri, '/wp-json/' ) !== false ) {
89 91 return false;
90 92 }
91 93
92 - if ( in_array( $current_uri, self::HOSTINGER_PAGE ) ) {
94 + if ( strpos( $current_uri, self::HOSTINGER_PAGE ) !== false ) {
93 95 return true;
94 96 }
95 97
96 98 return false;
97 -
98 99 }
99 100
100 101 /**
101 102 *