GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (1881)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

freemius/includes/entities/class-fs-pricing.php (11 issues)

Upgrade to new PHP Analysis Engine

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
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 13 and the first side effect is on line 10.

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.

Loading history...
2
	/**
3
	 * @package     Freemius for EDD Add-On
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.0
7
	 */
8
9
	if ( ! defined( 'ABSPATH' ) ) {
10
		exit;
11
	}
12
13
	class FS_Pricing extends FS_Entity {
0 ignored issues
show
Coding Style Compatibility introduced by
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.

Loading history...
14
15
		#region Properties
16
17
		/**
18
		 * @var number
19
		 */
20
		public $plan_id;
21
		/**
22
		 * @var int
23
		 */
24
		public $licenses;
25
		/**
26
		 * @var null|float
27
		 */
28
		public $monthly_price;
29
		/**
30
		 * @var null|float
31
		 */
32
		public $annual_price;
33
		/**
34
		 * @var null|float
35
		 */
36
		public $lifetime_price;
37
38
		#endregion Properties
39
40
		/**
41
		 * @param object|bool $pricing
42
		 */
43
		function __construct( $pricing = false ) {
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
44
			parent::__construct( $pricing );
45
		}
46
47
		static function get_type() {
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
48
			return 'pricing';
49
		}
50
51
		/**
52
		 * @author Vova Feldman (@svovaf)
53
		 * @since  1.1.8
54
		 *
55
		 * @return bool
56
		 */
57
		function has_monthly() {
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
58
			return ( is_numeric( $this->monthly_price ) && $this->monthly_price > 0 );
59
		}
60
61
		/**
62
		 * @author Vova Feldman (@svovaf)
63
		 * @since  1.1.8
64
		 *
65
		 * @return bool
66
		 */
67
		function has_annual() {
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
68
			return ( is_numeric( $this->annual_price ) && $this->annual_price > 0 );
69
		}
70
71
		/**
72
		 * @author Vova Feldman (@svovaf)
73
		 * @since  1.1.8
74
		 *
75
		 * @return bool
76
		 */
77
		function has_lifetime() {
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
78
			return ( is_numeric( $this->lifetime_price ) && $this->lifetime_price > 0 );
79
		}
80
81
		/**
82
		 * Check if unlimited licenses pricing.
83
		 *
84
		 * @author Vova Feldman (@svovaf)
85
		 * @since  1.1.8
86
		 *
87
		 * @return bool
88
		 */
89
		function is_unlimited() {
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
90
			return is_null( $this->licenses );
91
		}
92
93
94
		/**
95
		 * Check if pricing has more than one billing cycle.
96
		 *
97
		 * @author Vova Feldman (@svovaf)
98
		 * @since  1.1.8
99
		 *
100
		 * @return bool
101
		 */
102
		function is_multi_cycle() {
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
103
			$cycles = 0;
104
			if ( $this->has_monthly() ) {
105
				$cycles ++;
106
			}
107
			if ( $this->has_annual() ) {
108
				$cycles ++;
109
			}
110
			if ( $this->has_lifetime() ) {
111
				$cycles ++;
112
			}
113
114
			return $cycles > 1;
115
		}
116
117
		/**
118
		 * Get annual over monthly discount.
119
		 *
120
		 * @author Vova Feldman (@svovaf)
121
		 * @since  1.1.8
122
		 *
123
		 * @return int
124
		 */
125
		function annual_discount_percentage() {
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
126
			return floor( $this->annual_savings() / ( $this->monthly_price * 12 * ( $this->is_unlimited() ? 1 : $this->licenses ) ) * 100 );
127
		}
128
129
		/**
130
		 * Get annual over monthly savings.
131
		 *
132
		 * @author Vova Feldman (@svovaf)
133
		 * @since  1.1.8
134
		 *
135
		 * @return float
136
		 */
137
		function annual_savings() {
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
138
			return ( $this->monthly_price * 12 - $this->annual_price ) * ( $this->is_unlimited() ? 1 : $this->licenses );
139
		}
140
141
	}