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.

video/class-foogallery-pro-video-oembed.php (7 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 14 and the first side effect is on line 12.

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
/**
4
 * Created by PhpStorm.
5
 * User: steve
6
 * Date: 4/17/2018
7
 * Time: 10:09 PM
8
 */
9
10
if ( ! class_exists( "FooGallery_Pro_Video_oEmbed" ) ) {
11
12
	require_once dirname( __FILE__ ) . '/class-foogallery-pro-video-base.php';
13
14
	class FooGallery_Pro_Video_oEmbed extends FooGallery_Pro_Video_Base {
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...
15
16
		/**
17
		 * Takes a URL and attempts to return a result generated from its oEmbed data.
18
		 *
19
		 * @param string $url The url to fetch.
20
		 *
21
		 * @return array(
0 ignored issues
show
The doc-type array( could not be parsed: Expected "|" or "end of type", but got "(" at position 5. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
22
		 *  "mode" => "embed",
23
		 *    "videos" => array(
24
		 *        array(
25
		 *            "provider" => string,
26
		 *            "id" => string,
27
		 *            "url" => string,
28
		 *            "thumbnail" => string,
29
		 *            "title" => string,
30
		 *            "description" => string,
31
		 *            "html" => string
32
		 *        )
33
		 *    )
34
		 * )
35
		 * @return array(
0 ignored issues
show
The doc-type array( could not be parsed: Expected "|" or "end of type", but got "(" at position 5. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
36
		 *    "mode" => "error",
37
		 *    "title" => string,
38
		 *    "message" => string
39
		 * )
40
		 */
41
		function fetch( $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...
42
			// check if the url is not empty and is not false
43
			if ( empty( $url ) || $url === false ) {
44
				return $this->error_response( "Invalid url supplied." );
45
			}
46
47
			$data = foogallery_oembed_get_data( $url );
48
			if ( $data === false ) {
49
				return $this->error_response( "Unable to retrieve any data from the supplied URL." );
50
			}
51
			if ( strtolower( $data->type ) !== "video" ) {
52
				return $this->error_response( "The data returned for the supplied URL was not a video." );
53
			}
54
55
			$provider = sanitize_title($data->provider_name, "oembed");
56
57
			$video = array(
58
				"provider" => $provider,
59
				"id" => $this->get_id($provider, $url),
60
				"url" => $url,
61
				"thumbnail" => $data->thumbnail_url,
62
				"title" => $data->title,
63
				"description" => !empty($data->description) ? $data->description : ""
64
			);
65
66
			if (empty($data->thumbnail_url) || empty($data->title)) {
67
				$video["mode"] = "oembed";
68
				return $video;
69
			}
70
			return array(
71
				"mode" => "embed",
72
				"videos" => array($video)
73
			);
74
		}
75
76
		/**
77
		 * Gets a unique ID for the supplied provider and url.
78
		 *
79
		 * @param string $provider The provider for the current URL.
80
		 * @param string $url      The URL to the oEmbed video.
81
		 *
82
		 * @return string
83
		 */
84
		private function get_id( $provider, $url ) {
0 ignored issues
show
The parameter $url 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...
85
			switch ( $provider ) {
86
				default:
0 ignored issues
show
default: return hash('crc32', $url, false); does not seem to be reachable.

This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.

Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.

function fx() {
    try {
        doSomething();
        return true;
    }
    catch (\Exception $e) {
        return false;
    }

    return false;
}

In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.

Loading history...
87
					// this is setup so in the future we can handle different providers accordingly
88
					// but by default a ID is simply generated by hashing the url. This works fine as
89
					// the ID for oEmbed videos is just used to generate the uploaded filename and if
90
					// there is a duplicate WordPress will auto-append a count to the name in any case.
91
					return hash( 'crc32', $url, false );
92
			}
93
		}
94
	}
95
}