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.

classes/class-lsx-wc-widget-recent-reviews.php (11 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
 * Recent Reviews Widget.
9
 *
10
 * @author   WooThemes
11
 * @category Widgets
12
 * @package  WooCommerce/Widgets
13
 * @version  2.3.0
14
 * @extends  WC_Widget
15
 */
16
class LSX_WC_Widget_Recent_Reviews extends WC_Widget {
0 ignored issues
show
The type WC_Widget was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
17
18
	/**
19
	 * Constructor.
20
	 */
21
	public function __construct() {
22
		$this->widget_cssclass    = 'woocommerce widget_recent_reviews';
0 ignored issues
show
Bug Best Practice introduced by
The property widget_cssclass does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
23
		$this->widget_description = __( 'Display a list of your most recent reviews on your site.', 'lsx' );
0 ignored issues
show
Bug Best Practice introduced by
The property widget_description does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
24
		$this->widget_id          = 'woocommerce_recent_reviews';
0 ignored issues
show
Bug Best Practice introduced by
The property widget_id does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
25
		$this->widget_name        = __( 'WooCommerce recent reviews', 'lsx' );
0 ignored issues
show
Bug Best Practice introduced by
The property widget_name does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
26
		$this->settings           = array(
0 ignored issues
show
Bug Best Practice introduced by
The property settings does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
27
			'title'  => array(
28
				'type'  => 'text',
29
				'std'   => __( 'Recent reviews', 'lsx' ),
30
				'label' => __( 'Title', 'lsx' ),
31
			),
32
			'number' => array(
33
				'type'  => 'number',
34
				'step'  => 1,
35
				'min'   => 1,
36
				'max'   => '',
37
				'std'   => 10,
38
				'label' => __( 'Number of reviews to show', 'lsx' ),
39
			),
40
		);
41
42
		parent::__construct();
43
	}
44
45
	/**
46
	 * Output widget.
47
	 *
48
	 * @see WP_Widget
49
	 *
50
	 * @param array $args
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
51
	 * @param array $instance
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
52
	 */
53
	public function widget( $args, $instance ) {
54
		if ( $this->get_cached_widget( $args ) ) {
55
			return;
56
		}
57
		ob_start();
58
		$number   = ! empty( $instance['number'] ) ? absint( $instance['number'] ) : $this->settings['number']['std'];
59
		$comments = get_comments(
60
			array(
61
				'number'      => $number,
62
				'status'      => 'approve',
63
				'post_status' => 'publish',
64
				'post_type'   => 'product',
65
				'parent'      => 0,
66
			)
67
		);
68
69
		if ( $comments ) {
70
			$this->widget_start( $args, $instance );
71
72
			echo wp_kses_post( apply_filters( 'woocommerce_before_widget_product_list', '<ul class="product_list_widget">' ) );
73
74
			global $stored_comment, $_product, $rating;
75
76
			the_comment();
77
			foreach ( (array) $comments as $comment ) {
78
				$_product = wc_get_product( $comment->comment_post_ID );
0 ignored issues
show
The function wc_get_product was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

78
				$_product = /** @scrutinizer ignore-call */ wc_get_product( $comment->comment_post_ID );
Loading history...
79
				$rating = intval( get_comment_meta( $comment->comment_ID, 'rating', true ) );
80
				$stored_comment = $comment;
81
82
				wc_get_template( 'content-widget-review.php' );
0 ignored issues
show
The function wc_get_template was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

82
				/** @scrutinizer ignore-call */ 
83
    wc_get_template( 'content-widget-review.php' );
Loading history...
83
			}
84
85
			echo wp_kses_post( apply_filters( 'woocommerce_after_widget_product_list', '</ul>' ) );
86
87
			$this->widget_end( $args );
88
		}
89
		$content = ob_get_clean();
90
		echo wp_kses_post( $content );
91
		$this->cache_widget( $args, $content );
92
	}
93
}
94