Issues (234)

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/admin/fields/date-picker.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
 * Date Picker Field
4
 *
5
 * @package SimpleCalendar/Admin
6
 */
7
namespace SimpleCalendar\Admin\Fields;
8
9
use SimpleCalendar\Abstracts\Field;
10
11
if ( ! defined( 'ABSPATH' ) ) {
12
	exit;
13
}
14
15
/**
16
 * Date Picker input field.
17
 *
18
 * A special field to choose dates or date ranges.
19
 * Holds a date value in 'yy-mm-dd' format.
20
 *
21
 * @since 3.0.0
22
 */
23
class Date_Picker extends Field {
24
25
	/**
26
	 * Select a date range.
27
	 *
28
	 * @access public
29
	 * @var bool
30
	 */
31
	public $range = false;
32
33
	/**
34
	 * Use an inline picker.
35
	 *
36
	 * @access public
37
	 * @var bool
38
	 */
39
	public $inline = true;
40
41
	/**
42
	 * Construct.
43
	 *
44
	 * @since 3.0.0
45
	 *
46
	 * @param array $field
47
	 */
48
	public function __construct( $field ) {
49
50
		$this->range  = isset( $field['range'] )  ? ( $field['range'] === true ? true : false ) : false;
51
		$this->inline = isset( $field['inline'] ) ? ( $field['inline'] === true ? true : false ) : true;
52
53
		$subtype = $this->range === true ? 'simcal-field-date-picker-range ' : '';
54
		$this->type_class = 'simcal-field-date-picker ' . $subtype;
55
56
		$data = array(
57
			'data-inline' => $this->inline === true ? 'true' : 'false',
58
		);
59
		$field['attributes'] = isset( $field['attributes'] ) ? array_merge( $field['attributes'], $data ) : $data;
60
61
		parent::__construct( $field );
62
	}
63
64
	/**
65
	 * Output the field markup
66
	 *
67
	 * @since 3.0.0
68
	 */
69
	public function html() {
70
71
		if ( ! empty( $this->description ) ) {
72
			echo '<p class="description">' . wp_kses_post( $this->description ) . '</p>';
73
		}
74
75
		?>
76
		<div id="<?php echo $this->id; ?>"
77
		     class="<?php echo $this->class; ?>"
78
		     <?php echo $this->style ? 'style="' . $this->style . '"' : ''; ?>
79
			 <?php echo $this->attributes ?>>
80
			<?php
81
82
			if ( false === $this->range ) {
83
84
				?>
85
				<i class="simcal-icon-calendar"></i>
86
				<input type="<?php echo $this->inline === true ? 'text' : 'hidden'; ?>"
87
				       name="<?php echo $this->name; ?>"
88
				       value="<?php echo $this->value; ?>"
89
				       placeholder="..."
90
				       readonly="readonly" />
91
				<?php
92
93
				if ( true === $this->inline ) {
94
					echo $this->tooltip;
95
				}
96
97
			} else {
0 ignored issues
show
This else statement is empty and can be removed.

This check looks for the else branches of if statements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.

These else branches can be removed.

if (rand(1, 6) > 3) {
print "Check failed";
} else {
    //print "Check succeeded";
}

could be turned into

if (rand(1, 6) > 3) {
    print "Check failed";
}

This is much more concise to read.

Loading history...
98
			    // @todo eventually if a date range picker is needed, this can be extended
99
			}
100
101
			?>
102
		</div>
103
		<?php
104
105
	}
106
107
}
108