PluginProbe
Tiered Pricing Table for WooCommerce / 2.2.3
Tiered Pricing Table for WooCommerce v2.2.3
7.1.7 7.1.5 7.1.4 7.1.1 6.5.0 6.4.0 6.1.0 trunk 1.0 1.1 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 All 90 releases
tier-pricing-table / freemius / includes / entities / class-fs-plugin.php

class-fs-plugin.php in Tiered Pricing Table for WooCommerce 2.2.3, at freemius/includes/entities/class-fs-plugin.php

154 lines 3.6 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 https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6 * @since 1.0.3
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 class FS_Plugin extends FS_Scope_Entity {
14 /**
15 * @since 1.0.6
16 * @var null|number
17 */
18 public $parent_plugin_id;
19 /**
20 * @var string
21 */
22 public $title;
23 /**
24 * @var string
25 */
26 public $slug;
27 /**
28 * @author Leo Fajardo (@leorw)
29 * @since 2.2.1
30 *
31 * @var string
32 */
33 public $premium_slug;
34 /**
35 * @since 1.2.2
36 *
37 * @var string 'plugin' or 'theme'
38 */
39 public $type;
40 /**
41 * @author Leo Fajardo (@leorw)
42 *
43 * @since 1.2.3
44 *
45 * @var string|false false if the module doesn't have an affiliate program or one of the following: 'selected', 'customers', or 'all'.
46 */
47 public $affiliate_moderation;
48 /**
49 * @var bool Set to true if the free version of the module is hosted on WordPress.org. Defaults to true.
50 */
51 public $is_wp_org_compliant = true;
52 /**
53 * @author Leo Fajardo (@leorw)
54 * @since 2.2.5
55 *
56 * @var int
57 */
58 public $premium_releases_count;
59
60 #region Install Specific Properties
61
62 /**
63 * @var string
64 */
65 public $file;
66 /**
67 * @var string
68 */
69 public $version;
70 /**
71 * @var bool
72 */
73 public $auto_update;
74 /**
75 * @var FS_Plugin_Info
76 */
77 public $info;
78 /**
79 * @since 1.0.9
80 *
81 * @var bool
82 */
83 public $is_premium;
84 /**
85 * @author Leo Fajardo (@leorw)
86 * @since 2.2.1
87 *
88 * @var string
89 */
90 public $premium_suffix;
91 /**
92 * @since 1.0.9
93 *
94 * @var bool
95 */
96 public $is_live;
97 /**
98 * @since 2.2.3
99 * @var null|number
100 */
101 public $bundle_id;
102
103 const AFFILIATE_MODERATION_CUSTOMERS = 'customers';
104
105 #endregion Install Specific Properties
106
107 /**
108 * @param stdClass|bool $plugin
109 */
110 function __construct( $plugin = false ) {
111 parent::__construct( $plugin );
112
113 $this->is_premium = false;
114 $this->is_live = true;
115
116 if ( empty( $this->premium_slug ) && ! empty( $plugin->slug ) ) {
117 $this->premium_slug = "{$this->slug}-premium";
118 }
119
120 if ( empty( $this->premium_suffix ) ) {
121 $this->premium_suffix = '(Premium)';
122 }
123
124 if ( isset( $plugin->info ) && is_object( $plugin->info ) ) {
125 $this->info = new FS_Plugin_Info( $plugin->info );
126 }
127 }
128
129 /**
130 * Check if plugin is an add-on (has parent).
131 *
132 * @author Vova Feldman (@svovaf)
133 * @since 1.0.6
134 *
135 * @return bool
136 */
137 function is_addon() {
138 return isset( $this->parent_plugin_id ) && is_numeric( $this->parent_plugin_id );
139 }
140
141 /**
142 * @author Leo Fajardo (@leorw)
143 * @since 1.2.3
144 *
145 * @return bool
146 */
147 function has_affiliate_program() {
148 return ( ! empty( $this->affiliate_moderation ) );
149 }
150
151 static function get_type() {
152 return 'plugin';
153 }
154 }