PluginProbe ʕ •ᴥ•ʔ
Image Widget / 4.2
Image Widget v4.2
trunk 1.0 2.0 2.1 2.2 2.2.1 2.2.2 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.2 3.2.1 3.2.10 3.2.11 3.2.2 3.2.3 3.2.4 3.2.5 3.2.7 3.2.8 3.2.9 3.3 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 4.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.0.9 4.1 4.1.1 4.1.2 4.2 4.2.1 4.2.2 4.3 4.3.1 4.4 4.4.1 4.4.11 4.4.12 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9
image-widget / freemius / includes / entities / class-fs-plugin-plan.php
image-widget / freemius / includes / entities Last commit date
class-fs-entity.php 10 years ago class-fs-plugin-info.php 10 years ago class-fs-plugin-license.php 10 years ago class-fs-plugin-plan.php 10 years ago class-fs-plugin-tag.php 10 years ago class-fs-plugin.php 10 years ago class-fs-scope-entity.php 10 years ago class-fs-site.php 10 years ago class-fs-subscription.php 10 years ago class-fs-user.php 10 years ago
class-fs-plugin-plan.php
71 lines
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.5
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 class FS_Plugin_Plan extends FS_Entity {
14
15 #region Properties
16
17 /**
18 * @var string
19 */
20 public $title;
21 /**
22 * @var string
23 */
24 public $name;
25 /**
26 * @var int Trial days.
27 */
28 public $trial_period;
29 /**
30 * @var string If true, require payment for trial.
31 */
32 public $is_require_subscription;
33
34 #endregion Properties
35
36 /**
37 * @param object|bool $plan
38 */
39 function __construct( $plan = false ) {
40 parent::__construct( $plan );
41
42 if ( is_object( $plan ) ) {
43 $this->name = strtolower( $plan->name );
44 }
45 }
46
47 static function get_type() {
48 return 'plan';
49 }
50
51 /**
52 * @author Vova Feldman (@svovaf)
53 * @since 1.0.9
54 *
55 * @return bool
56 */
57 function is_free() {
58 return ( 'free' === $this->name );
59 }
60
61 /**
62 * @author Vova Feldman (@svovaf)
63 * @since 1.0.9
64 *
65 * @return bool
66 */
67 function has_trial() {
68 return ! $this->is_free() &&
69 is_numeric( $this->trial_period ) && ( $this->trial_period > 0 );
70 }
71 }