| @@ -9,8 +9,11 @@ | ||
| 9 | 9 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | 10 | exit; |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | + /** | |
| 14 | + * @property int $blog_id | |
| 15 | + */ | |
| 13 | 16 | class FS_Site extends FS_Scope_Entity { |
| 14 | 17 | /** |
| 15 | 18 | * @var number |
| 16 | 19 | */ |
| @@ -39,12 +42,8 @@ | ||
| 39 | 42 | * @var string E.g. en-GB |
| 40 | 43 | */ |
| 41 | 44 | public $language; |
| 42 | 45 | /** |
| 43 | - * @var string E.g. UTF-8 | |
| 44 | - */ | |
| 45 | - public $charset; | |
| 46 | - /** | |
| 47 | 46 | * @var string Platform version (e.g WordPress version). |
| 48 | 47 | */ |
| 49 | 48 | public $platform_version; |
| 50 | 49 | /** |
| @@ -85,8 +84,10 @@ | ||
| 85 | 84 | /** |
| 86 | 85 | * @author Leo Fajardo (@leorw) |
| 87 | 86 | * |
| 88 | 87 | * @since 1.2.1.5 |
| 88 | + * @deprecated Since 2.5.1 | |
| 89 | + * @todo Remove after a few releases. | |
| 89 | 90 | * |
| 90 | 91 | * @var bool |
| 91 | 92 | */ |
| 92 | 93 | public $is_disconnected = false; |
| @@ -101,8 +102,16 @@ | ||
| 101 | 102 | * |
| 102 | 103 | * @var bool |
| 103 | 104 | */ |
| 104 | 105 | public $is_uninstalled = false; |
| 106 | + /** | |
| 107 | + * @author Edgar Melkonyan | |
| 108 | + * | |
| 109 | + * @since 2.4.2 | |
| 110 | + * | |
| 111 | + * @var bool | |
| 112 | + */ | |
| 113 | + public $is_beta; | |
| 105 | 114 | |
| 106 | 115 | /** |
| 107 | 116 | * @param stdClass|bool $site |
| 108 | 117 | */ |
| @@ -177,13 +186,22 @@ | ||
| 177 | 186 | ( fs_starts_with( $subdomain, 'test-' ) || fs_starts_with( $subdomain, 'dev-' ) ) ) || |
| 178 | 187 | // Cloudways |
| 179 | 188 | fs_ends_with( $subdomain, '.cloudwaysapps.com' ) || |
| 180 | 189 | // Kinsta |
| 181 | - ( fs_starts_with( $subdomain, 'staging-' ) && ( fs_ends_with( $subdomain, '.kinsta.com' ) || fs_ends_with( $subdomain, '.kinsta.cloud' ) ) ) || | |
| 190 | + ( | |
| 191 | + ( fs_starts_with( $subdomain, 'staging-' ) || fs_starts_with( $subdomain, 'env-' ) ) && | |
| 192 | + ( fs_ends_with( $subdomain, '.kinsta.com' ) || fs_ends_with( $subdomain, '.kinsta.cloud' ) ) | |
| 193 | + ) || | |
| 182 | 194 | // DesktopServer |
| 183 | 195 | fs_ends_with( $subdomain, '.dev.cc' ) || |
| 184 | 196 | // Pressable |
| 185 | - fs_ends_with( $subdomain, '.mystagingwebsite.com' ) | |
| 197 | + fs_ends_with( $subdomain, '.mystagingwebsite.com' ) || | |
| 198 | + // WPMU DEV | |
| 199 | + ( fs_ends_with( $subdomain, '.tempurl.host' ) || fs_ends_with( $subdomain, '.wpmudev.host' ) ) || | |
| 200 | + // Vendasta | |
| 201 | + ( fs_ends_with( $subdomain, '.websitepro-staging.com' ) || fs_ends_with( $subdomain, '.websitepro.hosting' ) ) || | |
| 202 | + // InstaWP | |
| 203 | + fs_ends_with( $subdomain, '.instawp.xyz' ) | |
| 186 | 204 | ); |
| 187 | 205 | } |
| 188 | 206 | |
| 189 | 207 | function is_localhost() { |
| @@ -214,23 +232,26 @@ | ||
| 214 | 232 | return is_numeric( $this->trial_plan_id ); |
| 215 | 233 | } |
| 216 | 234 | |
| 217 | 235 | /** |
| 218 | - * @author Vova Feldman (@svovaf) | |
| 219 | - * @since 2.0.0 | |
| 236 | + * @author Edgar Melkonyan | |
| 220 | 237 | * |
| 221 | 238 | * @return bool |
| 222 | 239 | */ |
| 223 | - function is_tracking_allowed() { | |
| 224 | - return ( true !== $this->is_disconnected ); | |
| 240 | + function is_beta() { | |
| 241 | + return ( isset( $this->is_beta ) && true === $this->is_beta ); | |
| 225 | 242 | } |
| 226 | 243 | |
| 227 | 244 | /** |
| 228 | - * @author Vova Feldman (@svovaf) | |
| 229 | - * @since 2.0.0 | |
| 245 | + * @author Leo Fajardo (@leorw) | |
| 246 | + * @since 2.5.1 | |
| 230 | 247 | * |
| 248 | + * @param string $site_url | |
| 249 | + * | |
| 231 | 250 | * @return bool |
| 232 | 251 | */ |
| 233 | - function is_tracking_prohibited() { | |
| 234 | - return ! $this->is_tracking_allowed(); | |
| 252 | + function is_clone( $site_url ) { | |
| 253 | + $clone_install_url = trailingslashit( fs_strip_url_protocol( $this->url ) ); | |
| 254 | + | |
| 255 | + return ( $clone_install_url !== $site_url ); | |
| 235 | 256 | } |
| 236 | 257 | } |