Issues (942)

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.

emails/class-wc-email-customer-on-hold-order.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
 * Class WC_Email_Customer_On_Hold_Order file.
4
 *
5
 * @package WooCommerce\Emails
6
 */
7
8 1
if ( ! defined( 'ABSPATH' ) ) {
9
	exit; // Exit if accessed directly.
10
}
11
12 1
if ( ! class_exists( 'WC_Email_Customer_On_Hold_Order', false ) ) :
13
14
	/**
15
	 * Customer On-hold Order Email.
16
	 *
17
	 * An email sent to the customer when a new order is on-hold for.
18
	 *
19
	 * @class       WC_Email_Customer_On_Hold_Order
20
	 * @version     2.6.0
21
	 * @package     WooCommerce/Classes/Emails
22
	 * @extends     WC_Email
23
	 */
24
	class WC_Email_Customer_On_Hold_Order extends WC_Email {
25
26
		/**
27
		 * Constructor.
28
		 */
29 1 View Code Duplication
		public function __construct() {
0 ignored issues
show
This method seems to be duplicated in 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...
30 1
			$this->id             = 'customer_on_hold_order';
31 1
			$this->customer_email = true;
32 1
			$this->title          = __( 'Order on-hold', 'woocommerce' );
33 1
			$this->description    = __( 'This is an order notification sent to customers containing order details after an order is placed on-hold.', 'woocommerce' );
34 1
			$this->template_html  = 'emails/customer-on-hold-order.php';
35 1
			$this->template_plain = 'emails/plain/customer-on-hold-order.php';
36 1
			$this->placeholders   = array(
37
				'{order_date}'   => '',
38
				'{order_number}' => '',
39
			);
40
41
			// Triggers for this email.
42 1
			add_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $this, 'trigger' ), 10, 2 );
43 1
			add_action( 'woocommerce_order_status_failed_to_on-hold_notification', array( $this, 'trigger' ), 10, 2 );
44 1
			add_action( 'woocommerce_order_status_cancelled_to_on-hold_notification', array( $this, 'trigger' ), 10, 2 );
45
46
			// Call parent constructor.
47 1
			parent::__construct();
48
		}
49
50
		/**
51
		 * Get email subject.
52
		 *
53
		 * @since  3.1.0
54
		 * @return string
55
		 */
56 1
		public function get_default_subject() {
57 1
			return __( 'Your {site_title} order has been received!', 'woocommerce' );
58
		}
59
60
		/**
61
		 * Get email heading.
62
		 *
63
		 * @since  3.1.0
64
		 * @return string
65
		 */
66 1
		public function get_default_heading() {
67 1
			return __( 'Thank you for your order', 'woocommerce' );
68
		}
69
70
		/**
71
		 * Trigger the sending of this email.
72
		 *
73
		 * @param int            $order_id The order ID.
74
		 * @param WC_Order|false $order Order object.
75
		 */
76 View Code Duplication
		public function trigger( $order_id, $order = false ) {
77
			$this->setup_locale();
78
79
			if ( $order_id && ! is_a( $order, 'WC_Order' ) ) {
80
				$order = wc_get_order( $order_id );
81
			}
82
83
			if ( is_a( $order, 'WC_Order' ) ) {
84
				$this->object                         = $order;
85
				$this->recipient                      = $this->object->get_billing_email();
86
				$this->placeholders['{order_date}']   = wc_format_datetime( $this->object->get_date_created() );
87
				$this->placeholders['{order_number}'] = $this->object->get_order_number();
88
			}
89
90
			if ( $this->is_enabled() && $this->get_recipient() ) {
91
				$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
92
			}
93
94
			$this->restore_locale();
95
		}
96
97
		/**
98
		 * Get content html.
99
		 *
100
		 * @return string
101
		 */
102
		public function get_content_html() {
103
			return wc_get_template_html(
104
				$this->template_html,
105
				array(
106
					'order'              => $this->object,
107
					'email_heading'      => $this->get_heading(),
108
					'additional_content' => $this->get_additional_content(),
109
					'sent_to_admin'      => false,
110
					'plain_text'         => false,
111
					'email'              => $this,
112
				)
113
			);
114
		}
115
116
		/**
117
		 * Get content plain.
118
		 *
119
		 * @return string
120
		 */
121
		public function get_content_plain() {
122
			return wc_get_template_html(
123
				$this->template_plain,
124
				array(
125
					'order'              => $this->object,
126
					'email_heading'      => $this->get_heading(),
127
					'additional_content' => $this->get_additional_content(),
128
					'sent_to_admin'      => false,
129
					'plain_text'         => true,
130
					'email'              => $this,
131
				)
132
			);
133
		}
134
135
		/**
136
		 * Default content to show below main email content.
137
		 *
138
		 * @since 3.7.0
139
		 * @return string
140
		 */
141 1
		public function get_default_additional_content() {
142 1
			return __( 'We look forward to fulfilling your order soon.', 'woocommerce' );
143
		}
144
	}
145
146
endif;
147
148
return new WC_Email_Customer_On_Hold_Order();
149