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.

includes/managers/class-fs-gdpr-manager.php (6 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       2.1.0
7
     */
8
9
    if ( ! defined( 'ABSPATH' ) ) {
10
        exit;
11
    }
12
13
    class FS_GDPR_Manager {
0 ignored issues
show
Since you have declared the constructor as private, maybe you should also declare the class as final.
Loading history...
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 FS_Option_Manager
16
         */
17
        private $_storage;
18
        /**
19
         * @var array {
20
         * @type bool $required           Are GDPR rules apply on the current context admin.
21
         * @type bool $show_opt_in_notice Should the marketing and offers opt-in message be shown to the admin or not. If not set, defaults to `true`.
22
         * @type int  $notice_shown_at    Last time the special GDPR opt-in message was shown to the current admin.
23
         * }
24
         */
25
        private $_data;
26
        /**
27
         * @var int
28
         */
29
        private $_wp_user_id;
30
        /**
31
         * @var string
32
         */
33
        private $_option_name;
34
        /**
35
         * @var FS_Admin_Notices
36
         */
37
        private $_notices;
38
39
        #--------------------------------------------------------------------------------
40
        #region Singleton
41
        #--------------------------------------------------------------------------------
42
43
        /**
44
         * @var FS_GDPR_Manager
45
         */
46
        private static $_instance;
47
48
        /**
49
         * @return FS_GDPR_Manager
50
         */
51
        public static function instance() {
52
            if ( ! isset( self::$_instance ) ) {
53
                self::$_instance = new self();
54
            }
55
56
            return self::$_instance;
57
        }
58
59
        #endregion
60
61
        private function __construct() {
62
            $this->_storage     = FS_Option_Manager::get_manager( WP_FS__GDPR_OPTION_NAME, true, true );
63
            $this->_wp_user_id  = Freemius::get_current_wp_user_id();
64
            $this->_option_name = "u{$this->_wp_user_id}";
65
            $this->_data        = $this->_storage->get_option( $this->_option_name, array() );
66
            $this->_notices     = FS_Admin_Notices::instance( 'all_admins', '', '', true );
67
68
            if ( ! is_array( $this->_data ) ) {
69
                $this->_data = array();
70
            }
71
        }
72
73
        /**
74
         * Update a GDPR option for the current admin and store it.
75
         *
76
         * @author Vova Feldman (@svovaf)
77
         * @since  2.1.0
78
         *
79
         * @param string $name
80
         * @param mixed  $value
81
         */
82
        private function update_option( $name, $value ) {
83
            $this->_data[ $name ] = $value;
84
85
            $this->_storage->set_option( $this->_option_name, $this->_data, true );
86
        }
87
88
        /**
89
         * @author Leo Fajardo (@leorw)
90
         * @since  2.1.0
91
         *
92
         * @return bool|null
93
         */
94
        public function is_required() {
95
            return isset( $this->_data['required'] ) ?
96
                $this->_data['required'] :
97
                null;
98
        }
99
100
        /**
101
         * @author Leo Fajardo (@leorw)
102
         * @since  2.1.0
103
         *
104
         * @param bool $is_required
105
         */
106
        public function store_is_required( $is_required ) {
107
            $this->update_option( 'required', $is_required );
108
        }
109
110
        /**
111
         * Checks if the GDPR opt-in sticky notice is currently shown.
112
         *
113
         * @author Vova Feldman (@svovaf)
114
         * @since  2.1.0
115
         *
116
         * @return bool
117
         */
118
        public function is_opt_in_notice_shown() {
119
            return $this->_notices->has_sticky( "gdpr_optin_actions_{$this->_wp_user_id}", true );
0 ignored issues
show
true is of type boolean, but the function expects a integer|null.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
120
        }
121
122
        /**
123
         * Remove the GDPR opt-in sticky notice.
124
         *
125
         * @author Vova Feldman (@svovaf)
126
         * @since  2.1.0
127
         */
128
        public function remove_opt_in_notice() {
129
            $this->_notices->remove_sticky( "gdpr_optin_actions_{$this->_wp_user_id}", true );
0 ignored issues
show
true is of type boolean, but the function expects a integer|null.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
130
131
            $this->disable_opt_in_notice();
132
        }
133
134
        /**
135
         * Prevents the opt-in message from being added/shown.
136
         *
137
         * @author Leo Fajardo (@leorw)
138
         * @since  2.1.0
139
         */
140
        public function disable_opt_in_notice() {
141
            $this->update_option( 'show_opt_in_notice', false );
142
        }
143
144
        /**
145
         * Checks if a GDPR opt-in message needs to be shown to the current admin.
146
         *
147
         * @author Vova Feldman (@svovaf)
148
         * @since  2.1.0
149
         *
150
         * @return bool
151
         */
152
        public function should_show_opt_in_notice() {
153
            return (
154
                ! isset( $this->_data['show_opt_in_notice'] ) ||
155
                true === $this->_data['show_opt_in_notice']
156
            );
157
        }
158
159
        /**
160
         * Get the last time the GDPR opt-in notice was shown.
161
         *
162
         * @author Vova Feldman (@svovaf)
163
         * @since  2.1.0
164
         *
165
         * @return false|int
166
         */
167
        public function last_time_notice_was_shown() {
168
            return isset( $this->_data['notice_shown_at'] ) ?
169
                $this->_data['notice_shown_at'] :
170
                false;
171
        }
172
173
        /**
174
         * Update the timestamp of the last time the GDPR opt-in message was shown to now.
175
         *
176
         * @author Vova Feldman (@svovaf)
177
         * @since  2.1.0
178
         */
179
        public function notice_was_just_shown() {
180
            $this->update_option( 'notice_shown_at', WP_FS__SCRIPT_START_TIME );
181
        }
182
183
        /**
184
         * @param string      $message
185
         * @param string|null $plugin_title
186
         *
187
         * @author Vova Feldman (@svovaf)
188
         * @since  2.1.0
189
         */
190
        public function add_opt_in_sticky_notice( $message, $plugin_title = null ) {
191
            $this->_notices->add_sticky(
192
                $message,
193
                "gdpr_optin_actions_{$this->_wp_user_id}",
194
                '',
195
                'promotion',
196
                true,
0 ignored issues
show
true is of type boolean, but the function expects a integer|null.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
197
                $this->_wp_user_id,
198
                $plugin_title,
199
                true
200
            );
201
        }
202
    }