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/admin/class-extensions.php (1 issue)

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
2
/*
3
 * FooGallery Admin Extension class
4
 */
5
6
if ( ! class_exists( 'FooGallery_Admin_Extensions' ) ) {
7
8
	class FooGallery_Admin_Extensions {
9
10
		function __construct() {
11
			add_action( 'init', array( $this, 'init' ) );
12
			add_action( 'deactivated_plugin', array( $this, 'handle_extensions_deactivation' ), 10, 2 );
13
			add_action( 'activated_plugin', array( $this, 'handle_extensions_activation' ), 10, 2 );
14
		}
15
16
		function init() {
17
			add_action( 'admin_init', array( $this, 'handle_extension_action' ) );
18
			//add_action( 'admin_init', array( $this, 'redirect_on_activation' ) );
0 ignored issues
show
Unused Code Comprehensibility introduced by
62% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
19
		}
20
21
		function handle_extensions_deactivation( $plugin, $network_deactivating ) {
22
			//make sure that if we are dealing with a FooGallery extension, that we deactivate it too
23
			$api = new FooGallery_Extensions_API();
24
			$api->handle_wordpress_plugin_deactivation( $plugin );
25
		}
26
27
		function handle_extensions_activation( $plugin, $network_deactivating ) {
28
			//make sure that if we are dealing with a FooGallery extension, that we deactivate it too
29
			$api = new FooGallery_Extensions_API();
30
			$api->handle_wordpress_plugin_activation( $plugin );
31
		}
32
33
		function handle_extension_action() {
34
			$action         = safe_get_from_request( 'action' );
35
			$extension_slug = safe_get_from_request( 'extension' );
36
			$has_error      = safe_get_from_request( 'has_error' );
37
38
			if ( ( 'download' === $action || 'activate' === $action || 'deactivate' === $action ) && $extension_slug ) {
39
				$api = new FooGallery_Extensions_API();
40
41
				$fatal_error_redirect = remove_query_arg( 'action' );
42
				wp_redirect( add_query_arg( 'has_error', 'yes', $fatal_error_redirect ) ); // we'll override this later if the plugin can be included without fatal error
43
				ob_start();
44
45
				switch ( $action ) {
46
					case 'download':
47
						$result = $api->download( $extension_slug );
48
						break;
49
					case 'activate':
50
						$result = $api->activate( $extension_slug );
51
						break;
52
					case 'deactivate':
53
						$result = $api->deactivate( $extension_slug );
54
						break;
55
				}
56
57
				//if we get here then no fatal error - cool!
58
				ob_end_clean();
59
60
				//store the result in a short-lived transient
61
				if ( isset($result) ) {
62
					set_transient( FOOGALLERY_EXTENSIONS_MESSAGE_TRANSIENT_KEY, $result, 30 );
63
				}
64
65
				//first, remove unwanted query args
66
				$redirect_url = remove_query_arg( array( 'extension', 'action' ) );
67
				//then add a query arg for our message
68
				$redirect_url = add_query_arg( 'show_message', 'yes', $redirect_url );
69
				//finally, allow extensions to override their own redirect
70
				$redirect_url = apply_filters( 'foogallery_extensions_redirect_url-' . $extension_slug, $redirect_url, $action );
71
72
				//redirect to this page, so the plugin can be properly activated/deactivated etc
73
				if ( $redirect_url ) {
74
					wp_redirect( $redirect_url );
75
					die();
76
				}
77
			} else if ( 'reload' === $action ) {
78
				$api = new FooGallery_Extensions_API();
79
				$api->reload();
80
81
				//first, remove unwanted query args
82
				$redirect_url = remove_query_arg( array( 'extension', 'action' ) );
83
84
				if ( ! $api->has_extension_loading_errors() ) {
85
					$result = array(
86
						'message' => __( 'The extensions have been reloaded', 'foogallery' ),
87
						'type'    => 'success',
88
					);
89
90
					set_transient( FOOGALLERY_EXTENSIONS_MESSAGE_TRANSIENT_KEY, $result, 30 );
91
92
					//then add a query arg for our message
93
					$redirect_url = add_query_arg( 'show_message', 'yes', $redirect_url );
94
				}
95
96
				wp_redirect( $redirect_url );
97
				die();
98
			} else if ( $has_error ) {
99
				$api = new FooGallery_Extensions_API();
100
				$api->deactivate( $extension_slug, true, false );
101
102
				$result = array(
103
					'message' => __( 'The extension could not be activated due to an error!', 'foogallery' ),
104
					'type'    => 'error',
105
				);
106
107
				set_transient( FOOGALLERY_EXTENSIONS_MESSAGE_TRANSIENT_KEY, $result, 30 );
108
109
				$api->add_to_error_extensions( $extension_slug, __( 'Activation Error!', 'foogallery' ) );
110
111
				//first, remove unwanted query args
112
				$redirect_url = remove_query_arg( array( 'extension', 'action', 'has_error' ) );
113
				//then add a query arg for our message
114
				$redirect_url = add_query_arg( 'show_message', 'yes', $redirect_url );
115
116
				wp_redirect( $redirect_url );
117
			}
118
		}
119
120
		function redirect_on_activation() {
121
			// Bail if no activation redirect
122
			if ( ! get_transient( FOOGALLERY_ACTIVATION_REDIRECT_TRANSIENT_KEY ) ) {
123
				return;
124
			}
125
126
			// Delete the redirect transient
127
			delete_transient( FOOGALLERY_ACTIVATION_REDIRECT_TRANSIENT_KEY );
128
129
			// Bail if activating from network, or bulk
130
			if ( is_network_admin() || isset($_GET['activate-multi']) ) {
131
				return;
132
			}
133
134
			wp_safe_redirect( foogallery_admin_help_url() );
135
			exit;
136
		}
137
	}
138
}
139