PluginProbe
Buttonizer – Floating Menus, Sticky Buttons, & Popup Builder / 1.2
Buttonizer – Floating Menus, Sticky Buttons, & Popup Builder v1.2
3.6.0 3.5.0 trunk 1.0.10 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.6.1 1.0.7 1.0.8 1.0.9 1.1 1.1.1 1.2 1.3 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.5 1.5.1 All 110 releases
buttonizer-multifunctional-button / freemius / includes / entities / class-fs-site.php

class-fs-site.php in Buttonizer – Floating Menus, Sticky Buttons, & Popup Builder 1.2, at freemius/includes/entities/class-fs-site.php

148 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package Freemius
4 * @copyright Copyright (c) 2015, Freemius, Inc.
5 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6 * @since 1.0.3
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 class FS_Site extends FS_Scope_Entity {
14 /**
15 * @var string
16 */
17 public $slug;
18 /**
19 * @var number
20 */
21 public $site_id;
22 /**
23 * @var number
24 */
25 public $plugin_id;
26 /**
27 * @var number
28 */
29 public $user_id;
30 /**
31 * @var string
32 */
33 public $title;
34 /**
35 * @var string
36 */
37 public $url;
38 /**
39 * @var string
40 */
41 public $version;
42 /**
43 * @var string E.g. en-GB
44 */
45 public $language;
46 /**
47 * @var string E.g. UTF-8
48 */
49 public $charset;
50 /**
51 * @var string Platform version (e.g WordPress version).
52 */
53 public $platform_version;
54 /**
55 * Freemius SDK version
56 *
57 * @author Leo Fajardo (@leorw)
58 * @since 1.2.2
59 *
60 * @var string SDK version (e.g.: 1.2.2)
61 */
62 public $sdk_version;
63 /**
64 * @var string Programming language version (e.g PHP version).
65 */
66 public $programming_language_version;
67 /**
68 * @var FS_Plugin_Plan $plan
69 */
70 public $plan;
71 /**
72 * @var number|null
73 */
74 public $license_id;
75 /**
76 * @var number|null
77 */
78 public $trial_plan_id;
79 /**
80 * @var string|null
81 */
82 public $trial_ends;
83 /**
84 * @since 1.0.9
85 *
86 * @var bool
87 */
88 public $is_premium = false;
89 /**
90 * @author Leo Fajardo (@leorw)
91 *
92 * @since 1.2.1.5
93 *
94 * @var bool
95 */
96 public $is_disconnected = false;
97
98 /**
99 * @param stdClass|bool $site
100 */
101 function __construct( $site = false ) {
102 $this->plan = new FS_Plugin_Plan();
103
104 parent::__construct( $site );
105
106 if ( is_object( $site ) ) {
107 $this->plan->id = $site->plan_id;
108 }
109
110 if ( ! is_bool( $this->is_disconnected ) ) {
111 $this->is_disconnected = false;
112 }
113 }
114
115 static function get_type() {
116 return 'install';
117 }
118
119 function is_localhost() {
120 // The server has no way to verify if localhost unless localhost appears in domain.
121 return WP_FS__IS_LOCALHOST_FOR_SERVER;
122 // return (substr($_SERVER['REMOTE_ADDR'], 0, 4) == '127.' || $_SERVER['REMOTE_ADDR'] == '::1');
123 }
124
125 /**
126 * Check if site in trial.
127 *
128 * @author Vova Feldman (@svovaf)
129 * @since 1.0.9
130 *
131 * @return bool
132 */
133 function is_trial() {
134 return is_numeric( $this->trial_plan_id ) && ( strtotime( $this->trial_ends ) > WP_FS__SCRIPT_START_TIME );
135 }
136
137 /**
138 * Check if user already utilized the trial with the current install.
139 *
140 * @author Vova Feldman (@svovaf)
141 * @since 1.0.9
142 *
143 * @return bool
144 */
145 function is_trial_utilized() {
146 return is_numeric( $this->trial_plan_id );
147 }
148 }