Test Failed
Push — release/1.8.12 ( b58a2f...d255b1 )
by Ravinder
375:09 queued 372:17
created

templates/emails/header-default.php (15 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
 * Email Header
4
 *
5
 * @package     Give/Templates/Emails
6
 * @version     1.0
7
 */
8
9
if ( ! defined( 'ABSPATH' ) ) {
10
	exit;
11
} // Exit if accessed directly.
12
13
// For gmail compatibility, including CSS styles in head/body are stripped out therefore styles need to be inline. These variables contain rules which are added to the template inline. !important; is a gmail hack to prevent styles being stripped if it doesn't like something.
14
$body               = "
15
	background-color: #f6f6f6;
16
	font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
17
";
18
$wrapper            = "
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal \n width:100%;\n -...dding: 30px 0 50px 0;\n does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
19
	width:100%;
20
	-webkit-text-size-adjust:none !important;
21
	margin:0;
22
	padding: 30px 0 50px 0;
23
";
24
$template_container = "
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal \n box-shadow:0 0 0 1...;\n padding: 20px;\n does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
25
	box-shadow:0 0 0 1px #f3f3f3 !important;
26
	border-radius:3px !important;
27
	background-color: #ffffff;
28
	border: 1px solid #e9e9e9;
29
	border-radius:3px !important;
30
	padding: 20px;
31
";
32
$template_image     = "
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal \n max-width:450px;\n does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
33
	max-width:450px;
34
";
35
$template_header    = "
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal \n color: #00000;\n ...ertical-align:middle;\n does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
36
	color: #00000;
37
	border-top-left-radius:3px !important;
38
	border-top-right-radius:3px !important;
39
	border-bottom: 0;
40
	font-weight:bold;
41
	line-height:100%;
42
	text-align: center;
43
	vertical-align:middle;
44
";
45
$body_content       = "
46
	border-radius:3px !important;
47
	font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
48
";
49
$body_content_inner = "
50
	color: #000000;
51
	font-size:14px;
52
	font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
53
	line-height:150%;
54
	text-align:left;
55
";
56
$header_content_h1  = "
57
	color: #000000;
58
	margin:0;
59
	padding: 28px 24px;
60
	display:block;
61
	font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
62
	font-size:32px;
63
	font-weight: 500;
64
	line-height: 1.2;
65
";
66
$header_img         = give_get_option( 'email_logo', '' );
67
?>
68
<!DOCTYPE html>
69
<html>
70
<head>
71
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
72
	<title><?php echo get_bloginfo( 'name' ); ?></title>
0 ignored issues
show
Expected a sanitizing function (see Codex for 'Data Validation'), but instead saw 'get_bloginfo'
Loading history...
73
</head>
74
<body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0" style="<?php echo $body; ?>">
0 ignored issues
show
Expected next thing to be a escaping function, not '$body'
Loading history...
75
<div style="<?php echo $wrapper; ?>">
0 ignored issues
show
Expected next thing to be a escaping function, not '$wrapper'
Loading history...
76
	<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
77
		<tr>
78
			<td align="center" valign="top">
79
				<?php
80
				if ( ! empty( $header_img ) ) : ?>
81
					<div id="template_header_image">
82
						<?php echo '<p style="margin-top:0;"><img style="' . $template_image . '" src="' . esc_url( $header_img ) . '" alt="' . get_bloginfo( 'name' ) . '" /></p>'; ?>
0 ignored issues
show
Expected next thing to be a escaping function, not '$template_image'
Loading history...
Expected a sanitizing function (see Codex for 'Data Validation'), but instead saw 'get_bloginfo'
Loading history...
83
					</div>
84
				<?php endif; ?>
85
				<table border="0" cellpadding="0" cellspacing="0" width="600" id="template_container" style="<?php echo $template_container; ?>">
0 ignored issues
show
Expected next thing to be a escaping function, not '$template_container'
Loading history...
86
					<tr>
87
						<td align="center" valign="top">
88
							<!-- Header -->
89
							<table border="0" cellpadding="0" cellspacing="0" width="600" id="template_header" style="<?php echo $template_header; ?>" bgcolor="#ffffff">
0 ignored issues
show
Expected next thing to be a escaping function, not '$template_header'
Loading history...
90
								<tr>
91
									<td>
92
										<h1 style="<?php echo $header_content_h1; ?>"><?php echo Give()->emails->get_heading(); ?></h1>
0 ignored issues
show
Expected next thing to be a escaping function, not '$header_content_h1'
Loading history...
Expected a sanitizing function (see Codex for 'Data Validation'), but instead saw 'Give'
Loading history...
93
									</td>
94
								</tr>
95
							</table>
96
							<!-- End Header -->
97
						</td>
98
					</tr>
99
					<tr>
100
						<td align="center" valign="top">
101
							<!-- Body -->
102
							<table border="0" cellpadding="0" cellspacing="0" width="600" id="template_body">
103
								<tr>
104
									<td valign="top" style="<?php echo $body_content; ?>">
0 ignored issues
show
Expected next thing to be a escaping function, not '$body_content'
Loading history...
105
										<!-- Content -->
106
										<table border="0" cellpadding="20" cellspacing="0" width="100%">
107
											<tr>
108
												<td valign="top">
109
													<div style="<?php echo $body_content_inner; ?>">
0 ignored issues
show
Expected next thing to be a escaping function, not '$body_content_inner'
Loading history...