Issues (435)

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/CMB2_Hookup_Base.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
 * Base class for hooking CMB2 into WordPress.
4
 *
5
 * @since  2.2.0
6
 *
7
 * @category  WordPress_Plugin
8
 * @package   CMB2
9
 * @author    WebDevStudios
10
 * @license   GPL-2.0+
11
 * @link      http://webdevstudios.com
12
 */
13
abstract class CMB2_Hookup_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...
14
15
	/**
16
	 * @var   CMB2 object
17
	 * @since 2.0.2
18
	 */
19
	protected $cmb;
20
21
	/**
22
	 * The object type we are performing the hookup for
23
	 *
24
	 * @var   string
25
	 * @since 2.0.9
26
	 */
27
	protected $object_type = 'post';
28
29
	/**
30
	 * Constructor
31
	 *
32
	 * @since 2.0.0
33
	 * @param CMB2 $cmb The CMB2 object to hookup
34
	 */
35
	public function __construct( CMB2 $cmb ) {
36
		$this->cmb = $cmb;
37
		$this->object_type = $this->cmb->mb_object_type();
38
	}
39
40
	abstract public function universal_hooks();
41
42
	/**
43
	 * Ensures WordPress hook only gets fired once per object.
44
	 *
45
	 * @since  2.0.0
46
	 * @param string   $action        The name of the filter to hook the $hook callback to.
47
	 * @param callback $hook          The callback to be run when the filter is applied.
48
	 * @param integer  $priority      Order the functions are executed
49
	 * @param int      $accepted_args The number of arguments the function accepts.
50
	 */
51
	public function once( $action, $hook, $priority = 10, $accepted_args = 1 ) {
52
		static $hooks_completed = array();
53
54
		$args = func_get_args();
55
56
		// Get object hash.. This bypasses issues with serializing closures.
57
		if ( is_object( $hook ) ) {
58
			$args[1] = spl_object_hash( $args[1] );
59
		} elseif ( is_array( $hook ) && is_object( $hook[0] ) ) {
60
			$args[1][0] = spl_object_hash( $hook[0] );
61
		}
62
63
		$key = md5( serialize( $args ) );
64
65
		if ( ! isset( $hooks_completed[ $key ] ) ) {
66
			$hooks_completed[ $key ] = 1;
67
			add_filter( $action, $hook, $priority, $accepted_args );
68
		}
69
	}
70
71
}
72