Issues (4296)

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/class-give-donor-wall-widget.php (12 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
 * Donors Gravatars
4
 *
5
 * @package     Give
6
 * @subpackage  Classes/Give_Donors_Gravatars
7
 * @copyright   Copyright (c) 2016, WordImpress
8
 * @license     https://opensource.org/licenses/gpl-license GNU Public License
9
 * @since       1.0
10
 */
11
12
// Exit if accessed directly.
13
if ( ! defined( 'ABSPATH' ) ) {
14
	exit;
15
}
16
17
/**
18
 * Give_Donor_Wall_Widget Class
19
 *
20
 * This class handles donors gravatars
21
 *
22
 * @since 1.0
23
 */
24
class Give_Donor_Wall_Widget extends WP_Widget {
25
26
	/**
27
	 * Widget constructor
28
	 *
29
	 * @since  1.0
30
	 * @access public
31
	 */
32
	public function __construct() {
33
34
		// widget settings
35
		$widget_ops = array(
36
			'classname'   => 'give-donors-gravatars',
37
			'description' => esc_html__( 'Displays gravatars of people who have donated using your your form. Will only show on the single form page.', 'give' ),
38
		);
39
40
		// widget control settings
41
		$control_ops = array(
42
			'width'   => 250,
43
			'height'  => 350,
44
			'id_base' => 'give_gravatars_widget'
45
		);
46
47
		// create the widget
48
		parent::__construct(
49
			'give_donors_gravatars_widget',
50
			esc_html__( 'Give Donors Gravatars', 'give' ),
51
			$widget_ops,
52
			$control_ops
53
		);
54
55
	}
56
57
	/**
58
	 * Donors gravatars widget content
59
	 *
60
	 * Outputs the content of the widget
61
	 *
62
	 * @since  1.0
63
	 * @access public
64
	 *
65
	 * @param  array $args     Display arguments including 'before_title', 'after_title', 'before_widget', and 'after_widget'.
66
	 * @param  array $instance Settings for the current Links widget instance.
67
	 *
68
	 * @return void
69
	 */
70
	public function widget( $args, $instance ) {
71
72
		//@TODO: Don't extract it!!!
73
		extract( $args );
0 ignored issues
show
extract() usage is highly discouraged, due to the complexity and unintended issues it might cause.
Loading history...
74
75
		if ( ! is_singular( 'give_forms' ) ) {
76
			return;
77
		}
78
79
		// Variables from widget settings
80
		$title = apply_filters( 'widget_title', $instance['title'] );
81
82
		// Used by themes. Opens the widget
83
		echo $before_widget;
0 ignored issues
show
Expected next thing to be a escaping function, not '$before_widget'
Loading history...
84
85
		// Display the widget title
86
		if ( $title ) {
87
			echo $before_title . $title . $after_title;
0 ignored issues
show
Expected next thing to be a escaping function, not '$before_title'
Loading history...
Expected next thing to be a escaping function, not '$title'
Loading history...
Expected next thing to be a escaping function, not '$after_title'
Loading history...
88
		}
89
90
		$gravatars = new Give_Donor_Wall();
91
92
		echo $gravatars->gravatars( get_the_ID(), null ); // remove title
0 ignored issues
show
The method gravatars() does not seem to exist on object<Give_Donor_Wall>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Expected next thing to be a escaping function, not '$gravatars'
Loading history...
93
94
		// Used by themes. Closes the widget
95
		echo $after_widget;
0 ignored issues
show
Expected next thing to be a escaping function, not '$after_widget'
Loading history...
96
97
	}
98
99
	/**
100
	 * Update donors gravatars
101
	 *
102
	 * Processes widget options to be saved.
103
	 *
104
	 * @since  1.0
105
	 * @access public
106
	 *
107
	 * @param  array $new_instance New settings for this instance as input by the user via WP_Widget::form().
108
	 * @param  array $old_instance Old settings for this instance.
109
	 *
110
	 * @return array Updated settings to save.
111
	 */
112
	public function update( $new_instance, $old_instance ) {
113
114
		$instance = $old_instance;
115
116
		$instance['title'] = strip_tags( $new_instance['title'] );
117
118
		return $instance;
119
120
	}
121
122
	/**
123
	 * Output donors
124
	 *
125
	 * Displays the actual form on the widget page.
126
	 *
127
	 * @since  1.0
128
	 * @access public
129
	 *
130
	 * @param  array $instance Current settings.
131
	 *
132
	 * @return void
133
	 */
134
	public function form( $instance ) {
135
136
		// Set up some default widget settings.
137
		$defaults = array(
138
			'title' => '',
139
		);
140
141
		$instance = wp_parse_args( (array) $instance, $defaults ); ?>
142
143
		<!-- Title -->
144
		<p>
145
			<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php esc_html_e( 'Title:', 'give' ) ?></label>
0 ignored issues
show
Expected next thing to be a escaping function, not '$this'
Loading history...
146
			<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $instance['title']; ?>" />
0 ignored issues
show
Expected next thing to be a escaping function, not '$this'
Loading history...
Expected next thing to be a escaping function, not '$instance'
Loading history...
147
		</p>
148
149
		<?php
150
	}
151
152
	/**
153
	 * Register the widget
154
	 *
155
	 * @return void
156
	 */
157
	function widget_init(){
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...
158
		register_widget( $this->self );
159
	}
160
161
}
162
163
164
165