PluginProbe
Hostinger Tools / 2.0.1
Hostinger Tools v2.0.1
3.0.78 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 All 109 releases
← All changes | includes/class-hostinger-helper.php +20 -6 1.9.42.0.1 View file →
@@ -1,11 +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 - ];
5 + public const HOSTINGER_PAGE = '/wp-admin/admin.php?page=hostinger';
8 6
9 7 /**
10 8 *
11 9 * Check if plugin is active
@@ -77,8 +75,13 @@
77 75 return ! empty( $site_url ) && strpos( $site_url, self::HOSTINGER_FREE_SUBDOMAIN_URL ) !== false;
78 76 }
79 77
80 78 public function is_hostinger_admin_page(): bool {
79 +
80 + if( ! isset( $_SERVER['REQUEST_URI'] ) ) {
81 + return false;
82 + }
83 +
81 84 $current_uri = sanitize_text_field( $_SERVER['REQUEST_URI'] );
82 85
83 86 if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
84 87 return false;
@@ -87,15 +90,26 @@
87 90 if ( isset( $current_uri ) && strpos( $current_uri, '/wp-json/' ) !== false ) {
88 91 return false;
89 92 }
90 93
91 - if ( in_array( $current_uri, self::HOSTINGER_PAGE ) ) {
94 + if ( strpos( $current_uri, self::HOSTINGER_PAGE ) !== false ) {
92 95 return true;
93 96 }
94 97
95 98 return false;
99 + }
96 100
101 + /**
102 + *
103 + * Error log
104 + *
105 + * @since 1.9.6
106 + * @access public
107 + */
108 + public function error_log( string $message ): void {
109 + if ( defined( 'WP_DEBUG' ) && WP_DEBUG === true ) {
110 + error_log( print_r( $message, true ) );
111 + }
97 112 }
98 -
99 113 }
100 114
101 -$hostiner_helper = new Hostinger_Helper();
115 +$hostinger_helper = new Hostinger_Helper();