Issues (25)

Security Analysis    no request data  

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.

lib/Loader.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
/**
4
 * Register all actions and filters for the plugin
5
 *
6
 * @link       http://example.com
7
 * @since      1.0.0
8
 *
9
 * @package    PluginName
10
 * @subpackage PluginName/includes
11
 */
12
13
namespace logoscon\WP\RedmineEmbed;
14
15
/**
16
 * Register all actions and filters for the plugin.
17
 *
18
 * Maintain a list of all hooks that are registered throughout
19
 * the plugin, and register them with the WordPress API. Call the
20
 * run function to execute the list of actions and filters.
21
 *
22
 * @package    PluginName
23
 * @subpackage PluginName/includes
24
 * @author     Your Name <[email protected]>
25
 */
26
class Loader {
27
28
	/**
29
	 * The array of actions registered with WordPress.
30
	 *
31
	 * @since    1.0.0
32
	 * @access   protected
33
	 * @var      array    $actions    The actions registered with WordPress to fire when the plugin loads.
34
	 */
35
	protected $actions;
36
37
	/**
38
	 * The array of filters registered with WordPress.
39
	 *
40
	 * @since    1.0.0
41
	 * @access   protected
42
	 * @var      array    $filters    The filters registered with WordPress to fire when the plugin loads.
43
	 */
44
	protected $filters;
45
46
	/**
47
	 * Initialize the collections used to maintain the actions and filters.
48
	 *
49
	 * @since    1.0.0
50
	 */
51
	public function __construct() {
52
53
		$this->actions = array();
54
		$this->filters = array();
55
56
	}
57
58
	/**
59
	 * Add a new action to the collection to be registered with WordPress.
60
	 *
61
	 * @since    1.0.0
62
	 * @param      string               $hook             The name of the WordPress action that is being registered.
63
	 * @param      object               $component        A reference to the instance of the object on which the action is defined.
64
	 * @param      string               $callback         The name of the function definition on the $component.
65
	 * @param      int      Optional    $priority         The priority at which the function should be fired.
66
	 * @param      int      Optional    $accepted_args    The number of arguments that should be passed to the $callback.
67
	 */
68
	public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
69
		$this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
70
	}
71
72
	/**
73
	 * Add a new filter to the collection to be registered with WordPress.
74
	 *
75
	 * @since    1.0.0
76
	 * @param      string               $hook             The name of the WordPress filter that is being registered.
77
	 * @param      object               $component        A reference to the instance of the object on which the filter is defined.
78
	 * @param      string               $callback         The name of the function definition on the $component.
79
	 * @param      int      Optional    $priority         The priority at which the function should be fired.
80
	 * @param      int      Optional    $accepted_args    The number of arguments that should be passed to the $callback.
81
	 */
82
	public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
83
		$this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
84
	}
85
86
	/**
87
	 * A utility function that is used to register the actions and hooks into a single
88
	 * collection.
89
	 *
90
	 * @since    1.0.0
91
	 * @access   private
92
	 * @param      array                $hooks            The collection of hooks that is being registered (that is, actions or filters).
93
	 * @param      string               $hook             The name of the WordPress filter that is being registered.
94
	 * @param      object               $component        A reference to the instance of the object on which the filter is defined.
95
	 * @param      string               $callback         The name of the function definition on the $component.
96
	 * @param      int      Optional    $priority         The priority at which the function should be fired.
97
	 * @param      int      Optional    $accepted_args    The number of arguments that should be passed to the $callback.
98
	 * @return   type                                   The collection of actions and filters registered with WordPress.
0 ignored issues
show
Should the return type not be array[]?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
99
	 */
100
	private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
101
102
		$hooks[] = array(
103
			'hook'          => $hook,
104
			'component'     => $component,
105
			'callback'      => $callback,
106
			'priority'      => $priority,
107
			'accepted_args' => $accepted_args
108
		);
109
110
		return $hooks;
111
112
	}
113
114
	/**
115
	 * Register the filters and actions with WordPress.
116
	 *
117
	 * @since    1.0.0
118
	 */
119
	public function run() {
120
121 View Code Duplication
		foreach ( $this->filters as $hook ) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
122
			\add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
123
		}
124
125 View Code Duplication
		foreach ( $this->actions as $hook ) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
126
			\add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
127
		}
128
129
	}
130
131
}
132