Issues (1182)

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-new-account.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
if ( ! defined( 'ABSPATH' ) ) {
4
	exit; // Exit if accessed directly
5
}
6
7
if ( ! class_exists( 'WC_Email_Customer_New_Account' ) ) :
8
9
/**
10
 * Customer New Account.
11
 *
12
 * An email sent to the customer when they create an account.
13
 *
14
 * @class       WC_Email_Customer_New_Account
15
 * @version     2.3.0
16
 * @package     WooCommerce/Classes/Emails
17
 * @author      WooThemes
18
 * @extends     WC_Email
19
 */
20
class WC_Email_Customer_New_Account extends WC_Email {
21
22
	/**
23
	 * User login name.
24
	 *
25
	 * @var string
26
	 */
27
	public $user_login;
28
29
	/**
30
	 * User email.
31
	 *
32
	 * @var string
33
	 */
34
	public $user_email;
35
36
	/**
37
	 * User password.
38
	 *
39
	 * @var string
40
	 */
41
	public $user_pass;
42
43
	/**
44
	 * Is the password generated?
45
	 *
46
	 * @var bool
47
	 */
48
	public $password_generated;
49
50
	/**
51
	 * Constructor.
52
	 */
53
	public function __construct() {
54
55
		$this->id             = 'customer_new_account';
56
		$this->customer_email = true;
57
		$this->title          = __( 'New account', 'woocommerce' );
58
		$this->description    = __( 'Customer "new account" emails are sent to the customer when a customer signs up via checkout or account pages.', 'woocommerce' );
59
60
		$this->template_html  = 'emails/customer-new-account.php';
61
		$this->template_plain = 'emails/plain/customer-new-account.php';
62
63
		$this->subject        = __( 'Your account on {site_title}', 'woocommerce');
64
		$this->heading        = __( 'Welcome to {site_title}', 'woocommerce');
65
66
		// Call parent constuctor
67
		parent::__construct();
68
	}
69
70
	/**
71
	 * Trigger.
72
	 *
73
	 * @param int $user_id
74
	 * @param string $user_pass
75
	 * @param bool $password_generated
76
	 */
77
	public function trigger( $user_id, $user_pass = '', $password_generated = false ) {
78
79
		if ( $user_id ) {
80
			$this->object             = new WP_User( $user_id );
81
82
			$this->user_pass          = $user_pass;
83
			$this->user_login         = stripslashes( $this->object->user_login );
84
			$this->user_email         = stripslashes( $this->object->user_email );
85
			$this->recipient          = $this->user_email;
86
			$this->password_generated = $password_generated;
87
		}
88
89
		if ( ! $this->is_enabled() || ! $this->get_recipient() ) {
90
			return;
91
		}
92
93
		$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
94
	}
95
96
	/**
97
	 * Get content html.
98
	 *
99
	 * @access public
100
	 * @return string
101
	 */
102
	public function get_content_html() {
103
		return wc_get_template_html( $this->template_html, array(
104
			'email_heading'      => $this->get_heading(),
105
			'user_login'         => $this->user_login,
106
			'user_pass'          => $this->user_pass,
107
			'blogname'           => $this->get_blogname(),
108
			'password_generated' => $this->password_generated,
109
			'sent_to_admin'      => false,
110
			'plain_text'         => false,
111
			'email'				 => $this
112
		) );
113
	}
114
115
	/**
116
	 * Get content plain.
117
	 *
118
	 * @access public
119
	 * @return string
120
	 */
121 View Code Duplication
	public function get_content_plain() {
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...
122
		return wc_get_template_html( $this->template_plain, array(
123
			'email_heading'      => $this->get_heading(),
124
			'user_login'         => $this->user_login,
125
			'user_pass'          => $this->user_pass,
126
			'blogname'           => $this->get_blogname(),
127
			'password_generated' => $this->password_generated,
128
			'sent_to_admin'      => false,
129
			'plain_text'         => true,
130
			'email'			     => $this
131
		) );
132
	}
133
}
134
135
endif;
136
137
return new WC_Email_Customer_New_Account();
138