This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
0 ignored issues
–
show
|
|||
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.5 |
||
7 | */ |
||
8 | |||
9 | if ( ! defined( 'ABSPATH' ) ) { |
||
10 | exit; |
||
11 | } |
||
12 | |||
13 | /** |
||
14 | * Class FS_Plugin_Plan |
||
15 | * |
||
16 | * @property FS_Pricing[] $pricing |
||
17 | */ |
||
18 | class FS_Plugin_Plan extends FS_Entity { |
||
0 ignored issues
–
show
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.
You can fix this by adding a namespace to your class: namespace YourVendor;
class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries. ![]() |
|||
19 | |||
20 | #region Properties |
||
21 | |||
22 | /** |
||
23 | * @var number |
||
24 | */ |
||
25 | public $plugin_id; |
||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | public $name; |
||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | public $title; |
||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | public $description; |
||
38 | /** |
||
39 | * @var bool Defaults to true. If true, allow unlimited localhost installs with the same license. |
||
40 | */ |
||
41 | public $is_free_localhost; |
||
42 | /** |
||
43 | * @var bool Defaults to true. If false, don't block features after license expiry - only block updates and |
||
44 | * support. |
||
45 | */ |
||
46 | public $is_block_features; |
||
47 | /** |
||
48 | * @var int |
||
49 | */ |
||
50 | public $license_type; |
||
51 | /** |
||
52 | * @var bool |
||
53 | */ |
||
54 | public $is_https_support; |
||
55 | /** |
||
56 | * @var int Trial days. |
||
57 | */ |
||
58 | public $trial_period; |
||
59 | /** |
||
60 | * @var string If true, require payment for trial. |
||
61 | */ |
||
62 | public $is_require_subscription; |
||
63 | /** |
||
64 | * @var string Knowledge Base URL. |
||
65 | */ |
||
66 | public $support_kb; |
||
67 | /** |
||
68 | * @var string Support Forum URL. |
||
69 | */ |
||
70 | public $support_forum; |
||
71 | /** |
||
72 | * @var string Support email address. |
||
73 | */ |
||
74 | public $support_email; |
||
75 | /** |
||
76 | * @var string Support phone. |
||
77 | */ |
||
78 | public $support_phone; |
||
79 | /** |
||
80 | * @var string Support skype username. |
||
81 | */ |
||
82 | public $support_skype; |
||
83 | /** |
||
84 | * @var bool Is personal success manager supported with the plan. |
||
85 | */ |
||
86 | public $is_success_manager; |
||
87 | /** |
||
88 | * @var bool Is featured plan. |
||
89 | */ |
||
90 | public $is_featured; |
||
91 | |||
92 | #endregion Properties |
||
93 | |||
94 | /** |
||
95 | * @param object|bool $plan |
||
96 | */ |
||
97 | function __construct( $plan = false ) { |
||
0 ignored issues
–
show
|
|||
98 | parent::__construct( $plan ); |
||
99 | |||
100 | if ( is_object( $plan ) ) { |
||
101 | $this->name = strtolower( $plan->name ); |
||
102 | } |
||
103 | } |
||
104 | |||
105 | static function get_type() { |
||
0 ignored issues
–
show
|
|||
106 | return 'plan'; |
||
107 | } |
||
108 | |||
109 | /** |
||
110 | * @author Vova Feldman (@svovaf) |
||
111 | * @since 1.0.9 |
||
112 | * |
||
113 | * @return bool |
||
114 | */ |
||
115 | function is_free() { |
||
0 ignored issues
–
show
|
|||
116 | return ( 'free' === $this->name ); |
||
117 | } |
||
118 | |||
119 | /** |
||
120 | * Checks if this plan supports "Technical Support". |
||
121 | * |
||
122 | * @author Leo Fajardo (leorw) |
||
123 | * @since 1.2.0 |
||
124 | * |
||
125 | * @return bool |
||
126 | */ |
||
127 | function has_technical_support() { |
||
0 ignored issues
–
show
|
|||
128 | return ( ! empty( $this->support_email ) || |
||
129 | ! empty( $this->support_skype ) || |
||
130 | ! empty( $this->support_phone ) || |
||
131 | ! empty( $this->is_success_manager ) |
||
132 | ); |
||
133 | } |
||
134 | |||
135 | /** |
||
136 | * @author Vova Feldman (@svovaf) |
||
137 | * @since 1.0.9 |
||
138 | * |
||
139 | * @return bool |
||
140 | */ |
||
141 | function has_trial() { |
||
0 ignored issues
–
show
|
|||
142 | return ! $this->is_free() && |
||
143 | is_numeric( $this->trial_period ) && ( $this->trial_period > 0 ); |
||
144 | } |
||
145 | } |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.