Issues (461)

Branch: master

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  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.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  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.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  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.
  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.
  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.
  Header Injection
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/classes/class-lsx-optimisation.php (18 issues)

1
<?php
0 ignored issues
show
This file is missing a doc comment.
Loading history...
2
3
if ( ! defined( 'ABSPATH' ) ) {
4
	exit;
5
}
6
7
/**
8
 * Holds the speed optimization functions for LSX.
9
 *
10
 * @author   LightSpeed
11
 * @category Widgets
12
 * @package  LSX
13
 * @return   LSX_Optimisation
14
 */
15
class LSX_Optimisation {
16
17
	/**
18
	 * Holds class instance
19
	 *
20
	 * @since 1.0.0
21
	 * @var      object
22
	 */
23
	protected static $instance = null;
24
25
	/**
26
	 * Constructor.
27
	 */
28
	public function __construct() {
29
		//add_filter( 'style_loader_tag', array( $this, 'preload_css' ), 100, 4 );
0 ignored issues
show
No space found before comment text; expected "// add_filter( 'style_loader_tag', array( $this, 'preload_css' ), 100, 4 );" but found "//add_filter( 'style_loader_tag', array( $this, 'preload_css' ), 100, 4 );"
Loading history...
Unused Code Comprehensibility introduced by
61% 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...
30
		//add_filter( 'script_loader_tag', array( $this, 'defer_parsing_of_js' ), 100, 3 );
0 ignored issues
show
No space found before comment text; expected "// add_filter( 'script_loader_tag', array( $this, 'defer_parsing_of_js' ), 100, 3 );" but found "//add_filter( 'script_loader_tag', array( $this, 'defer_parsing_of_js' ), 100, 3 );"
Loading history...
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
31
		add_action( 'init', array( $this, 'pum_remove_admin_bar_tools' ), 100 );
32
	}
33
	/**
34
	 * Return an instance of this class.
35
	 *
36
	 * @since 1.0.0
37
	 * @return    object    A single instance of this class.
38
	 */
39
	public static function get_instance() {
40
		// If the single instance hasn't been set, set it now.
41
		if ( null === self::$instance ) {
42
			self::$instance = new self;
0 ignored issues
show
Parenthesis should always be used when instantiating a new object.
Loading history...
43
		}
44
		return self::$instance;
45
	}
46
47
	/**
0 ignored issues
show
Coding Style Documentation introduced by
Doc comment for parameter "$tag" missing
Loading history...
Coding Style Documentation introduced by
Doc comment for parameter "$handle" missing
Loading history...
Coding Style Documentation introduced by
Doc comment for parameter "$href" missing
Loading history...
Coding Style Documentation introduced by
Doc comment for parameter "$media" missing
Loading history...
48
	 * Defers the JS loading till Last
49
	 *
50
	 * @param  string $url The url to check and defer.
0 ignored issues
show
Doc comment for parameter $url does not match actual variable name $tag
Loading history...
51
	 * @return string
52
	 */
53
	public function preload_css( $tag, $handle, $href, $media ) {
0 ignored issues
show
The parameter $media is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

53
	public function preload_css( $tag, $handle, $href, /** @scrutinizer ignore-unused */ $media ) {

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

Loading history...
The parameter $href is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

53
	public function preload_css( $tag, $handle, /** @scrutinizer ignore-unused */ $href, $media ) {

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

Loading history...
54
		if ( 'lsx_fonts' === $handle || 'fontawesome' === $handle ) {
55
			$tag = str_replace( 'href', ' preload href', $tag );
56
		}
57
		return $tag;
58
	}
59
60
	/**
0 ignored issues
show
Coding Style Documentation introduced by
Doc comment for parameter "$tag" missing
Loading history...
Coding Style Documentation introduced by
Doc comment for parameter "$handle" missing
Loading history...
Coding Style Documentation introduced by
Doc comment for parameter "$href" missing
Loading history...
61
	 * Defers the JS loading till Last
62
	 *
63
	 * @param  string $url The url to check and defer.
0 ignored issues
show
Doc comment for parameter $url does not match actual variable name $tag
Loading history...
64
	 * @return string
65
	 */
66
	public function defer_parsing_of_js( $tag, $handle, $href ) {
67
		$skip_defer = apply_filters( 'lsx_defer_parsing_of_js', false, $tag, $handle, $href );
68
		if ( ! is_admin() && false !== stripos( $href, '.js' ) && false === stripos( $href, 'jquery.js' ) && false === $skip_defer ) {
69
			$tag = str_replace( 'src=', ' defer src=', $tag );
70
		}
71
		return $tag;
72
	}
73
74
	public function pum_remove_admin_bar_tools() {
0 ignored issues
show
Coding Style Documentation introduced by
Missing doc comment for function pum_remove_admin_bar_tools()
Loading history...
75
		remove_action( 'admin_bar_menu', array( 'PUM_Modules_Admin_Bar', 'toolbar_links' ), 999 );
76
		remove_action( 'wp_footer', array( 'PUM_Modules_Admin_Bar', 'admin_bar_styles' ), 999 );
77
		remove_action( 'init', array( 'PUM_Modules_Admin_Bar', 'show_debug_bar' ) );
78
	}
79
}
80
LSX_Optimisation::get_instance();
81