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.

gutenberg/class-foogallery-rest-routes.php (3 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
2
/**
3
 * class for Rest API Routes within FooGallery
4
 *
5
 * @since 1.6.0
6
 */
7
if ( ! class_exists( 'FooGallery_Rest_Routes' ) ) {
8
9
	class FooGallery_Rest_Routes {
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...
10
		/**
11
		 * Constructs the class.
12
		 *
13
		 * @access public
14
		 */
15
		public function __construct() {
16
			add_action( 'rest_api_init', array( $this, 'register_routes' ) );
17
		}
18
19
		/**
20
		 * Registers the necessary REST API routes for FooGallery
21
		 *
22
		 * @access public
23
		 */
24
		public function register_routes() {
25
			if ( !apply_filters( 'foogallery_gutenberg_enabled', true ) ) {
26
				return;
27
			}
28
29
			register_rest_route(
30
				'foogallery/v1',
31
				'galleries',
32
				array(
33
					'methods'  			  => WP_REST_Server::READABLE,
34
					'callback' 			  => array( $this, 'get_galleries' ),
35
					'permission_callback' => array( $this, 'get_galleries_permissions_check' ),
36
					'schema' 			  => array( $this, 'get_galleries_schema' ),
37
				)
38
			);
39
		}
40
41
		/**
42
		 * Checks if a given request has access to get galleries.
43
		 *
44
		 * @access public
45
		 *
46
		 * @param WP_REST_Request $request Request.
47
		 *
48
		 * @return true|WP_Error True if the request has read access, WP_Error object otherwise.
49
		 */
50
		public function get_galleries_permissions_check( $request ) {
0 ignored issues
show
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
51
			if ( ! current_user_can( 'edit_posts' ) ) {
52
				return new WP_Error(
53
					'foogallery_galleries_cannot_read',
54
					__( 'Sorry, you are not allowed to read galleries as this user.', 'foogallery' ),
55
					array(
56
						'status' => rest_authorization_required_code(),
57
					)
58
				);
59
			}
60
61
			return true;
62
		}
63
64
		/**
65
		 * Returns a list of all galleries.
66
		 *
67
		 * @since  2.8.0
68
		 * @access public
69
		 *
70
		 * @param WP_REST_Request $request Full details about the request.
71
		 *
72
		 * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
73
		 */
74
		public function get_galleries( $request ) {
0 ignored issues
show
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
75
76
			$galleries = foogallery_get_all_galleries();
77
78
			$result = array();
79
80
			if ( !empty( $galleries ) ) {
81
				foreach ( $galleries as $gallery ) {
82
					$args = array(
83
						'width' => 150,
84
						'height' => 150
85
					);
86
87
					$featuredAttachment = $gallery->featured_attachment();
88
					if ( $featuredAttachment ) {
89
						$img = $featuredAttachment->html_img_src( $args );
90
					} else {
91
						//if we have no featured attachment, then use the built-in image placeholder
92
						$img = foogallery_image_placeholder_src();
93
					}
94
95
96
					$result[] = array(
97
						'id' => $gallery->ID,
98
						'name' => $gallery->name,
99
						'thumbnail' => $img
100
					);
101
				}
102
			}
103
104
			return rest_ensure_response( $result );
105
		}
106
107
		/**
108
		 * Retrieves block's output schema, conforming to JSON Schema.
109
		 *
110
		 * @since  2.8.0
111
		 * @access public
112
		 *
113
		 * @return array Item schema data.
114
		 */
115
		public function get_item_schema() {
116
			return array(
117
				'$schema'    => 'http://json-schema.org/schema#',
118
				'title'      => 'foogallery',
119
				'type'       => 'object',
120
				'properties' => array(
121
					'id' => array(
122
						'description' => __( 'The FooGallery ID.', 'foogallery' ),
123
						'type'        => 'int',
124
						'required'    => true,
125
						'context'     => array( 'edit' ),
126
					),
127
					'name' => array(
128
						'description' => __( 'The FooGallery Name.', 'foogallery' ),
129
						'type'        => 'string',
130
						'required'    => false,
131
						'context'     => array( 'edit' ),
132
					),
133
					'thumbnail' => array(
134
						'description' => __( 'The FooGallery Thumbnail.', 'foogallery' ),
135
						'type'        => 'string',
136
						'required'    => false,
137
						'context'     => array( 'edit' ),
138
					),
139
				),
140
			);
141
		}
142
	}
143
}
144