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-site.php (10 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
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_Site extends FS_Scope_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
         * @var number
16
         */
17
        public $site_id;
18
        /**
19
         * @var number
20
         */
21
        public $plugin_id;
22
        /**
23
         * @var number
24
         */
25
        public $user_id;
26
        /**
27
         * @var string
28
         */
29
        public $title;
30
        /**
31
         * @var string
32
         */
33
        public $url;
34
        /**
35
         * @var string
36
         */
37
        public $version;
38
        /**
39
         * @var string E.g. en-GB
40
         */
41
        public $language;
42
        /**
43
         * @var string E.g. UTF-8
44
         */
45
        public $charset;
46
        /**
47
         * @var string Platform version (e.g WordPress version).
48
         */
49
        public $platform_version;
50
        /**
51
         * Freemius SDK version
52
         *
53
         * @author Leo Fajardo (@leorw)
54
         * @since  1.2.2
55
         *
56
         * @var string SDK version (e.g.: 1.2.2)
57
         */
58
        public $sdk_version;
59
        /**
60
         * @var string Programming language version (e.g PHP version).
61
         */
62
        public $programming_language_version;
63
        /**
64
         * @var number|null
65
         */
66
        public $plan_id;
67
        /**
68
         * @var number|null
69
         */
70
        public $license_id;
71
        /**
72
         * @var number|null
73
         */
74
        public $trial_plan_id;
75
        /**
76
         * @var string|null
77
         */
78
        public $trial_ends;
79
        /**
80
         * @since 1.0.9
81
         *
82
         * @var bool
83
         */
84
        public $is_premium = false;
85
        /**
86
         * @author Leo Fajardo (@leorw)
87
         *
88
         * @since  1.2.1.5
89
         *
90
         * @var bool
91
         */
92
        public $is_disconnected = false;
93
        /**
94
         * @since  2.0.0
95
         *
96
         * @var bool
97
         */
98
        public $is_active = true;
99
        /**
100
         * @since  2.0.0
101
         *
102
         * @var bool
103
         */
104
        public $is_uninstalled = false;
105
106
        /**
107
         * @param stdClass|bool $site
108
         */
109
        function __construct( $site = 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...
110
            parent::__construct( $site );
111
112
            if ( is_object( $site ) ) {
113
                $this->plan_id = $site->plan_id;
114
            }
115
116
            if ( ! is_bool( $this->is_disconnected ) ) {
117
                $this->is_disconnected = false;
118
            }
119
        }
120
121
        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...
122
            return 'install';
123
        }
124
125
        /**
126
         * @author Vova Feldman (@svovaf)
127
         * @since  2.0.0
128
         *
129
         * @param string $url
130
         *
131
         * @return bool
132
         */
133
        static function is_localhost_by_address( $url ) {
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...
134
            if ( false !== strpos( $url, '127.0.0.1' ) ||
135
                 false !== strpos( $url, 'localhost' )
136
            ) {
137
                return true;
138
            }
139
140
            if ( ! fs_starts_with( $url, 'http' ) ) {
141
                $url = 'http://' . $url;
142
            }
143
144
            $url_parts = parse_url( $url );
145
146
            $subdomain = $url_parts['host'];
147
148
            return (
149
                // Starts with.
150
                fs_starts_with( $subdomain, 'local.' ) ||
151
                fs_starts_with( $subdomain, 'dev.' ) ||
152
                fs_starts_with( $subdomain, 'test.' ) ||
153
                fs_starts_with( $subdomain, 'stage.' ) ||
154
                fs_starts_with( $subdomain, 'staging.' ) ||
155
156
                // Ends with.
157
                fs_ends_with( $subdomain, '.dev' ) ||
158
                fs_ends_with( $subdomain, '.test' ) ||
159
                fs_ends_with( $subdomain, '.staging' ) ||
160
                fs_ends_with( $subdomain, '.local' ) ||
161
                fs_ends_with( $subdomain, '.example' ) ||
162
                fs_ends_with( $subdomain, '.invalid' ) ||
163
                // GoDaddy test/dev.
164
                fs_ends_with( $subdomain, '.myftpupload.com' ) ||
165
                // ngrok tunneling.
166
                fs_ends_with( $subdomain, '.ngrok.io' ) ||
167
                // wpsandbox.
168
                fs_ends_with( $subdomain, '.wpsandbox.pro' ) ||
169
                // SiteGround staging.
170
                fs_starts_with( $subdomain, 'staging' ) ||
171
                // WPEngine staging.
172
                fs_ends_with( $subdomain, '.staging.wpengine.com' ) ||
173
                // Pantheon
174
                ( fs_ends_with($subdomain, 'pantheonsite.io') &&
175
                  (fs_starts_with($subdomain, 'test-') || fs_starts_with($subdomain, 'dev-'))) ||
176
                // Cloudways
177
                fs_ends_with( $subdomain, '.cloudwaysapps.com' ) ||
178
                // Kinsta
179
                (fs_ends_with($subdomain, '.kinsta.com') && fs_starts_with($subdomain, 'staging-'))
180
            );
181
        }
182
183
        function is_localhost() {
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...
184
            return ( WP_FS__IS_LOCALHOST_FOR_SERVER || self::is_localhost_by_address( $this->url ) );
185
        }
186
187
        /**
188
         * Check if site in trial.
189
         *
190
         * @author Vova Feldman (@svovaf)
191
         * @since  1.0.9
192
         *
193
         * @return bool
194
         */
195
        function is_trial() {
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...
196
            return is_numeric( $this->trial_plan_id ) && ( strtotime( $this->trial_ends ) > WP_FS__SCRIPT_START_TIME );
197
        }
198
199
        /**
200
         * Check if user already utilized the trial with the current install.
201
         *
202
         * @author Vova Feldman (@svovaf)
203
         * @since  1.0.9
204
         *
205
         * @return bool
206
         */
207
        function is_trial_utilized() {
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...
208
            return is_numeric( $this->trial_plan_id );
209
        }
210
211
        /**
212
         * @author Vova Feldman (@svovaf)
213
         * @since  2.0.0
214
         *
215
         * @return bool
216
         */
217
        function is_tracking_allowed() {
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...
218
            return ( true !== $this->is_disconnected );
219
        }
220
221
        /**
222
         * @author Vova Feldman (@svovaf)
223
         * @since  2.0.0
224
         *
225
         * @return bool
226
         */
227
        function is_tracking_prohibited() {
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...
228
            return ! $this->is_tracking_allowed();
229
        }
230
    }