Completed
Branch master (f308d6)
by Sudar
02:43
created
include/class-email-log-list-table.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	 * To field
180 180
 	 *
181 181
 	 * @param unknown $item
182
-	 * @return unknown
182
+	 * @return string
183 183
 	 */
184 184
 	function column_to( $item ) {
185 185
 		return stripslashes( $item->to_email );
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 	 * Subject field
190 190
 	 *
191 191
 	 * @param unknown $item
192
-	 * @return unknown
192
+	 * @return string
193 193
 	 */
194 194
 	function column_subject( $item ) {
195 195
 		return stripslashes( $item->subject );
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 	 * Markup for action column
200 200
 	 *
201 201
 	 * @param unknown $item
202
-	 * @return unknown
202
+	 * @return string
203 203
 	 */
204 204
 	function column_cb( $item ) {
205 205
 		return sprintf(
Please login to merge, or discard this patch.
Spacing   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -14,11 +14,11 @@  discard block
 block discarded – undo
14 14
 	 * We use the parent reference to set some default configs.
15 15
 	 */
16 16
 	function __construct() {
17
-		parent::__construct( array(
18
-				'singular'  => 'email-log',     //singular name of the listed records
19
-				'plural'    => 'email-logs',    //plural name of the listed records
20
-				'ajax'      => false,           //does this table support ajax?
21
-			) );
17
+		parent::__construct(array(
18
+				'singular'  => 'email-log', //singular name of the listed records
19
+				'plural'    => 'email-logs', //plural name of the listed records
20
+				'ajax'      => false, //does this table support ajax?
21
+			));
22 22
 	}
23 23
 
24 24
 	/**
@@ -26,47 +26,47 @@  discard block
 block discarded – undo
26 26
 	 *
27 27
 	 * @param string $which Add the markup after (bottom) or before (top) the list
28 28
 	 */
29
-	function extra_tablenav( $which ) {
30
-		if ( 'top' == $which ) {
29
+	function extra_tablenav($which) {
30
+		if ('top' == $which) {
31 31
 			//The code that goes before the table is here
32 32
 			echo '<span id = "el-pro-msg">';
33
-			_e( 'More fields are available in Pro addon. ', 'email-log' );
33
+			_e('More fields are available in Pro addon. ', 'email-log');
34 34
 			echo '<a href = "http://sudarmuthu.com/out/buy-email-log-more-fields-addon" style = "color:red">';
35
-			_e( 'Buy Now', 'email-log' );
35
+			_e('Buy Now', 'email-log');
36 36
 			echo '</a>';
37 37
 			echo '</span>';
38 38
 		}
39 39
 
40
-		if ( 'bottom' == $which ) {
40
+		if ('bottom' == $which) {
41 41
 			//The code that goes after the table is there
42 42
 			echo '<p>&nbsp;</p>';
43 43
 			echo '<p>&nbsp;</p>';
44 44
 
45 45
 			echo '<p>';
46
-			_e( 'The following are the list of pro addons that are currently available for purchase.', 'email-log' );
46
+			_e('The following are the list of pro addons that are currently available for purchase.', 'email-log');
47 47
 			echo '</p>';
48 48
 
49 49
 			echo '<ul style="list-style:disc; padding-left:35px">';
50 50
 
51 51
 			echo '<li>';
52
-			echo '<strong>', __( 'Email Log - Resend Email', 'email-log' ), '</strong>', ' - ';
53
-			echo __( 'Adds the ability to resend email from logs.', 'email-log' );
54
-			echo ' <a href = "http://sudarmuthu.com/wordpress/email-log/pro-addons#resend-email-addon">', __( 'More Info', 'email-log' ), '</a>.';
55
-			echo ' <a href = "http://sudarmuthu.com/out/buy-email-log-resend-email-addon">', __( 'Buy now', 'email-log' ), '</a>';
52
+			echo '<strong>', __('Email Log - Resend Email', 'email-log'), '</strong>', ' - ';
53
+			echo __('Adds the ability to resend email from logs.', 'email-log');
54
+			echo ' <a href = "http://sudarmuthu.com/wordpress/email-log/pro-addons#resend-email-addon">', __('More Info', 'email-log'), '</a>.';
55
+			echo ' <a href = "http://sudarmuthu.com/out/buy-email-log-resend-email-addon">', __('Buy now', 'email-log'), '</a>';
56 56
 			echo '</li>';
57 57
 
58 58
 			echo '<li>';
59
-			echo '<strong>', __( 'Email Log - More fields', 'email-log' ), '</strong>', ' - ';
60
-			echo __( 'Adds more fields (From, CC, BCC, Reply To, Attachment) to the logs page.', 'email-log' );
61
-			echo ' <a href = "http://sudarmuthu.com/wordpress/email-log/pro-addons#more-fields-addon">', __( 'More Info', 'email-log' ), '</a>.';
62
-			echo ' <a href = "http://sudarmuthu.com/out/buy-email-log-more-fields-addon">', __( 'Buy now', 'email-log' ), '</a>';
59
+			echo '<strong>', __('Email Log - More fields', 'email-log'), '</strong>', ' - ';
60
+			echo __('Adds more fields (From, CC, BCC, Reply To, Attachment) to the logs page.', 'email-log');
61
+			echo ' <a href = "http://sudarmuthu.com/wordpress/email-log/pro-addons#more-fields-addon">', __('More Info', 'email-log'), '</a>.';
62
+			echo ' <a href = "http://sudarmuthu.com/out/buy-email-log-more-fields-addon">', __('Buy now', 'email-log'), '</a>';
63 63
 			echo '</li>';
64 64
 
65 65
 			echo '<li>';
66
-			echo '<strong>', __( 'Email Log - Forward Email', 'email-log' ), '</strong>', ' - ';
67
-			echo __( 'This addon allows you to send a copy of all emails send from WordPress to another email address', 'email-log' );
68
-			echo ' <a href = "http://sudarmuthu.com/wordpress/email-log/pro-addons#forward-email-addon">', __( 'More Info', 'email-log' ), '</a>.';
69
-			echo ' <a href = "http://sudarmuthu.com/out/buy-email-log-forward-email-addon">', __( 'Buy now', 'email-log' ), '</a>';
66
+			echo '<strong>', __('Email Log - Forward Email', 'email-log'), '</strong>', ' - ';
67
+			echo __('This addon allows you to send a copy of all emails send from WordPress to another email address', 'email-log');
68
+			echo ' <a href = "http://sudarmuthu.com/wordpress/email-log/pro-addons#forward-email-addon">', __('More Info', 'email-log'), '</a>.';
69
+			echo ' <a href = "http://sudarmuthu.com/out/buy-email-log-forward-email-addon">', __('Buy now', 'email-log'), '</a>';
70 70
 			echo '</li>';
71 71
 
72 72
 			echo '</ul>';
@@ -82,12 +82,12 @@  discard block
 block discarded – undo
82 82
 	function get_columns() {
83 83
 		$columns = array(
84 84
 			'cb'        => '<input type="checkbox" />', //Render a checkbox instead of text
85
-			'sent_date' => __( 'Sent at', 'email-log' ),
86
-			'to'        => __( 'To', 'email-log' ),
87
-			'subject'   => __( 'Subject', 'email-log' ),
85
+			'sent_date' => __('Sent at', 'email-log'),
86
+			'to'        => __('To', 'email-log'),
87
+			'subject'   => __('Subject', 'email-log'),
88 88
 		);
89 89
 
90
-		return apply_filters( EmailLog::HOOK_LOG_COLUMNS, $columns );
90
+		return apply_filters(EmailLog::HOOK_LOG_COLUMNS, $columns);
91 91
 	}
92 92
 
93 93
 	/**
@@ -97,9 +97,9 @@  discard block
 block discarded – undo
97 97
 	 */
98 98
 	function get_sortable_columns() {
99 99
 		$sortable_columns = array(
100
-			'sent_date'   => array( 'sent_date', true ), //true means it's already sorted
101
-			'to'          => array( 'to_email', false ),
102
-			'subject'     => array( 'subject', false ),
100
+			'sent_date'   => array('sent_date', true), //true means it's already sorted
101
+			'to'          => array('to_email', false),
102
+			'subject'     => array('subject', false),
103 103
 		);
104 104
 		return $sortable_columns;
105 105
 	}
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
 	 * @param unknown $item
111 111
 	 * @param unknown $column_name
112 112
 	 */
113
-	function column_default( $item, $column_name ) {
114
-		do_action( EmailLog::HOOK_LOG_DISPLAY_COLUMNS, $column_name, $item );
113
+	function column_default($item, $column_name) {
114
+		do_action(EmailLog::HOOK_LOG_DISPLAY_COLUMNS, $column_name, $item);
115 115
 	}
116 116
 
117 117
 	/**
@@ -120,9 +120,9 @@  discard block
 block discarded – undo
120 120
 	 * @param  object $item Current item object
121 121
 	 * @return string       Markup to be displayed for the column
122 122
 	 */
123
-	function column_sent_date( $item ) {
123
+	function column_sent_date($item) {
124 124
 		$email_date = mysql2date(
125
-			sprintf( __( '%s @ %s', 'email-log' ), get_option( 'date_format', 'F j, Y' ), get_option( 'time_format', 'g:i A' ) ),
125
+			sprintf(__('%s @ %s', 'email-log'), get_option('date_format', 'F j, Y'), get_option('time_format', 'g:i A')),
126 126
 			$item->sent_date
127 127
 		);
128 128
 
@@ -139,10 +139,10 @@  discard block
 block discarded – undo
139 139
 			'admin-ajax.php'
140 140
 		);
141 141
 
142
-		$actions['view-content'] = sprintf( '<a href="%1$s" class="thickbox" title="%2$s">%3$s</a>',
143
-			esc_url( $content_ajax_url ),
144
-			__( 'Email Content', 'email-log' ),
145
-			__( 'View Content', 'email-log' )
142
+		$actions['view-content'] = sprintf('<a href="%1$s" class="thickbox" title="%2$s">%3$s</a>',
143
+			esc_url($content_ajax_url),
144
+			__('Email Content', 'email-log'),
145
+			__('View Content', 'email-log')
146 146
 		);
147 147
 
148 148
 		$delete_url = add_query_arg(
@@ -150,13 +150,13 @@  discard block
 block discarded – undo
150 150
 				'page'                           => $_REQUEST['page'],
151 151
 				'action'                         => 'delete',
152 152
 				$this->_args['singular']         => $item->id,
153
-				EmailLog::DELETE_LOG_NONCE_FIELD => wp_create_nonce( EmailLog::DELETE_LOG_ACTION ),
153
+				EmailLog::DELETE_LOG_NONCE_FIELD => wp_create_nonce(EmailLog::DELETE_LOG_ACTION),
154 154
 			)
155 155
 		);
156 156
 
157
-		$actions['delete'] = sprintf( '<a href="%s">%s</a>',
158
-			esc_url( $delete_url ),
159
-			__( 'Delete', 'email-log' )
157
+		$actions['delete'] = sprintf('<a href="%s">%s</a>',
158
+			esc_url($delete_url),
159
+			__('Delete', 'email-log')
160 160
 		);
161 161
 
162 162
 		/**
@@ -166,12 +166,12 @@  discard block
 block discarded – undo
166 166
 		 * @param array $actions List of actions.
167 167
 		 * @param object $item The current log item.
168 168
 		 */
169
-		$actions = apply_filters( 'el_row_actions', $actions, $item );
169
+		$actions = apply_filters('el_row_actions', $actions, $item);
170 170
 
171
-		return sprintf( '%1$s <span style="color:silver">(id:%2$s)</span>%3$s',
171
+		return sprintf('%1$s <span style="color:silver">(id:%2$s)</span>%3$s',
172 172
 			/*$1%s*/ $email_date,
173 173
 			/*$2%s*/ $item->id,
174
-			/*$3%s*/ $this->row_actions( $actions )
174
+			/*$3%s*/ $this->row_actions($actions)
175 175
 		);
176 176
 	}
177 177
 
@@ -181,8 +181,8 @@  discard block
 block discarded – undo
181 181
 	 * @param unknown $item
182 182
 	 * @return unknown
183 183
 	 */
184
-	function column_to( $item ) {
185
-		return stripslashes( $item->to_email );
184
+	function column_to($item) {
185
+		return stripslashes($item->to_email);
186 186
 	}
187 187
 
188 188
 	/**
@@ -191,8 +191,8 @@  discard block
 block discarded – undo
191 191
 	 * @param unknown $item
192 192
 	 * @return unknown
193 193
 	 */
194
-	function column_subject( $item ) {
195
-		return stripslashes( $item->subject );
194
+	function column_subject($item) {
195
+		return stripslashes($item->subject);
196 196
 	}
197 197
 
198 198
 	/**
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 	 * @param unknown $item
202 202
 	 * @return unknown
203 203
 	 */
204
-	function column_cb( $item ) {
204
+	function column_cb($item) {
205 205
 		return sprintf(
206 206
 			'<input type="checkbox" name="%1$s[]" value="%2$s" />',
207 207
 			/*$1%s*/ $this->_args['singular'],
@@ -216,8 +216,8 @@  discard block
 block discarded – undo
216 216
 	 */
217 217
 	function get_bulk_actions() {
218 218
 		$actions = array(
219
-			'delete'     => __( 'Delete', 'email-log' ),
220
-			'delete-all' => __( 'Delete All Logs', 'email-log' ),
219
+			'delete'     => __('Delete', 'email-log'),
220
+			'delete-all' => __('Delete All Logs', 'email-log'),
221 221
 		);
222 222
 		return $actions;
223 223
 	}
@@ -231,16 +231,16 @@  discard block
 block discarded – undo
231 231
 		global $wpdb;
232 232
 		global $EmailLog;
233 233
 
234
-		if ( 'delete' === $this->current_action() ) {
234
+		if ('delete' === $this->current_action()) {
235 235
 			// delete a list of logs by id
236 236
 
237
-			$nonce = $_REQUEST[ EmailLog::DELETE_LOG_NONCE_FIELD ];
238
-			if ( wp_verify_nonce( $nonce, EmailLog::DELETE_LOG_ACTION ) ) {
237
+			$nonce = $_REQUEST[EmailLog::DELETE_LOG_NONCE_FIELD];
238
+			if (wp_verify_nonce($nonce, EmailLog::DELETE_LOG_ACTION)) {
239 239
 
240
-				$ids = $_GET[ $this->_args['singular'] ];
240
+				$ids = $_GET[$this->_args['singular']];
241 241
 
242
-				if ( is_array( $ids ) ) {
243
-					$selected_ids = implode( ',', $ids );
242
+				if (is_array($ids)) {
243
+					$selected_ids = implode(',', $ids);
244 244
 				} else {
245 245
 					$selected_ids = $ids;
246 246
 				}
@@ -248,21 +248,21 @@  discard block
 block discarded – undo
248 248
 				// Can't use wpdb->prepare for the below query. If used it results in this bug
249 249
 				// https://github.com/sudar/email-log/issues/13
250 250
 
251
-				$selected_ids = esc_sql( $selected_ids );
251
+				$selected_ids = esc_sql($selected_ids);
252 252
 
253 253
 				$table_name = $wpdb->prefix . EmailLog::TABLE_NAME;
254
-				$EmailLog->logs_deleted = $wpdb->query( "DELETE FROM $table_name where id IN ( $selected_ids )" );
254
+				$EmailLog->logs_deleted = $wpdb->query("DELETE FROM $table_name where id IN ( $selected_ids )");
255 255
 			} else {
256
-				wp_die( 'Cheating, Huh? ' );
256
+				wp_die('Cheating, Huh? ');
257 257
 			}
258
-		} else if ( 'delete-all' === $this->current_action() ) {
258
+		} else if ('delete-all' === $this->current_action()) {
259 259
 			// delete all logs
260
-			$nonce = $_REQUEST[ EmailLog::DELETE_LOG_NONCE_FIELD ];
261
-			if ( wp_verify_nonce( $nonce, EmailLog::DELETE_LOG_ACTION ) ) {
260
+			$nonce = $_REQUEST[EmailLog::DELETE_LOG_NONCE_FIELD];
261
+			if (wp_verify_nonce($nonce, EmailLog::DELETE_LOG_ACTION)) {
262 262
 				$table_name = $wpdb->prefix . EmailLog::TABLE_NAME;
263
-				$EmailLog->logs_deleted = $wpdb->query( "DELETE FROM $table_name" );
263
+				$EmailLog->logs_deleted = $wpdb->query("DELETE FROM $table_name");
264 264
 			} else {
265
-				wp_die( 'Cheating, Huh? ' );
265
+				wp_die('Cheating, Huh? ');
266 266
 			}
267 267
 		}
268 268
 	}
@@ -286,47 +286,47 @@  discard block
 block discarded – undo
286 286
 		$count_query = 'SELECT * FROM ' . $table_name;
287 287
 		$query_cond = '';
288 288
 
289
-		if ( isset( $_GET['s'] ) ) {
290
-			$search_term = trim( esc_sql( $_GET['s'] ) );
289
+		if (isset($_GET['s'])) {
290
+			$search_term = trim(esc_sql($_GET['s']));
291 291
 			$query_cond .= " WHERE to_email LIKE '%$search_term%' OR subject LIKE '%$search_term%' ";
292 292
 		}
293 293
 
294 294
 		// Ordering parameters
295
-		$orderby = ! empty( $_GET['orderby'] ) ? esc_sql( $_GET['orderby'] ) : 'sent_date';
296
-		$order   = ! empty( $_GET['order'] ) ? esc_sql( $_GET['order'] ) : 'DESC';
295
+		$orderby = ! empty($_GET['orderby']) ? esc_sql($_GET['orderby']) : 'sent_date';
296
+		$order   = ! empty($_GET['order']) ? esc_sql($_GET['order']) : 'DESC';
297 297
 
298
-		if ( ! empty( $orderby ) & ! empty( $order ) ) {
298
+		if ( ! empty($orderby) & ! empty($order)) {
299 299
 			$query_cond .= ' ORDER BY ' . $orderby . ' ' . $order;
300 300
 		}
301 301
 
302 302
 		// find total number of items
303 303
 		$count_query = $count_query . $query_cond;
304
-		$total_items = $wpdb->get_var( $count_query );
304
+		$total_items = $wpdb->get_var($count_query);
305 305
 
306 306
 		// adjust the query to take pagination into account
307 307
 		$per_page = EmailLog::get_per_page();
308
-		if ( ! empty( $current_page ) && ! empty( $per_page ) ) {
309
-			$offset = ( $current_page - 1 ) * $per_page;
308
+		if ( ! empty($current_page) && ! empty($per_page)) {
309
+			$offset = ($current_page - 1) * $per_page;
310 310
 			$query_cond .= ' LIMIT ' . (int) $offset . ',' . (int) $per_page;
311 311
 		}
312 312
 
313 313
 		// Fetch the items
314 314
 		$query = $query . $query_cond;
315
-		$this->items = $wpdb->get_results( $query );
315
+		$this->items = $wpdb->get_results($query);
316 316
 
317 317
 		// register pagination options & calculations.
318
-		$this->set_pagination_args( array(
318
+		$this->set_pagination_args(array(
319 319
 				'total_items' => $total_items,
320 320
 				'per_page'    => $per_page,
321
-				'total_pages' => ceil( $total_items / $per_page ),
322
-			) );
321
+				'total_pages' => ceil($total_items / $per_page),
322
+			));
323 323
 	}
324 324
 
325 325
 	/**
326 326
 	 * If no items are found
327 327
 	 */
328 328
 	function no_items() {
329
-		_e( 'Your email log is empty', 'email-log' );
329
+		_e('Your email log is empty', 'email-log');
330 330
 	}
331 331
 }
332 332
 ?>
Please login to merge, or discard this patch.
include/install.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
 	 *
70 70
 	 * @global object $wpdb
71 71
 	 * @param  array  $tables List of tables to be deleted
72
-	 * @return array  $tables Modified list of tables to be deleted
72
+	 * @return string[]  $tables Modified list of tables to be deleted
73 73
 	 */
74 74
 	public static function on_delete_blog( $tables ) {
75 75
 		global $wpdb;
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  * @since       1.7
9 9
  */
10 10
 
11
-defined( 'ABSPATH' ) || exit; // Exit if accessed directly
11
+defined('ABSPATH') || exit; // Exit if accessed directly
12 12
 
13 13
 /**
14 14
  * Helper class to create and maintain tables
@@ -26,17 +26,17 @@  discard block
 block discarded – undo
26 26
 	 *
27 27
 	 * @global object $wpdb
28 28
 	 */
29
-	public static function on_activate( $network_wide ) {
29
+	public static function on_activate($network_wide) {
30 30
 		global $wpdb;
31 31
 
32
-		if ( is_multisite() && $network_wide ) {
32
+		if (is_multisite() && $network_wide) {
33 33
 			// store the current blog id
34 34
 			$current_blog = $wpdb->blogid;
35 35
 
36 36
 			// Get all blogs in the network and activate plugin on each one
37
-			$blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
38
-			foreach ( $blog_ids as $blog_id ) {
39
-				switch_to_blog( $blog_id );
37
+			$blog_ids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
38
+			foreach ($blog_ids as $blog_id) {
39
+				switch_to_blog($blog_id);
40 40
 				self::create_emaillog_table();
41 41
 				restore_current_blog();
42 42
 			}
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
 	 * @static
53 53
 	 * @access public
54 54
 	 */
55
-	public static function on_create_blog( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
56
-		if ( is_plugin_active_for_network( 'email-log/email-log.php' ) ) {
57
-			switch_to_blog( $blog_id );
55
+	public static function on_create_blog($blog_id, $user_id, $domain, $path, $site_id, $meta) {
56
+		if (is_plugin_active_for_network('email-log/email-log.php')) {
57
+			switch_to_blog($blog_id);
58 58
 			self::create_emaillog_table();
59 59
 			restore_current_blog();
60 60
 		}
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 * @param  array  $tables List of tables to be deleted
72 72
 	 * @return array  $tables Modified list of tables to be deleted
73 73
 	 */
74
-	public static function on_delete_blog( $tables ) {
74
+	public static function on_delete_blog($tables) {
75 75
 		global $wpdb;
76 76
 		$tables[] = $wpdb->prefix . EmailLog::TABLE_NAME;
77 77
 		return $tables;
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 		$table_name = $wpdb->prefix . EmailLog::TABLE_NAME;
93 93
 		$charset_collate = $wpdb->get_charset_collate();
94 94
 
95
-		if ( $wpdb->get_var( "show tables like '{$table_name}'" ) != $table_name ) {
95
+		if ($wpdb->get_var("show tables like '{$table_name}'") != $table_name) {
96 96
 
97 97
 			$sql = 'CREATE TABLE ' . $table_name . ' (
98 98
 				id mediumint(9) NOT NULL AUTO_INCREMENT,
@@ -105,20 +105,20 @@  discard block
 block discarded – undo
105 105
 				PRIMARY KEY  (id)
106 106
 			) ' . $charset_collate . ' ;';
107 107
 
108
-			require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
109
-			dbDelta( $sql );
108
+			require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
109
+			dbDelta($sql);
110 110
 
111
-			add_option( EmailLog::DB_OPTION_NAME, EmailLog::DB_VERSION );
111
+			add_option(EmailLog::DB_OPTION_NAME, EmailLog::DB_VERSION);
112 112
 		}
113 113
 	}
114 114
 }
115 115
 
116 116
 // When the Plugin installed
117
-register_activation_hook( EMAIL_LOG_PLUGIN_FILE, array( 'Email_Log_Init', 'on_activate' ) );
117
+register_activation_hook(EMAIL_LOG_PLUGIN_FILE, array('Email_Log_Init', 'on_activate'));
118 118
 
119 119
 // when a new blog is created in multisite
120
-add_action( 'wpmu_new_blog', array( 'Email_Log_Init', 'on_create_blog' ), 10, 6 );
120
+add_action('wpmu_new_blog', array('Email_Log_Init', 'on_create_blog'), 10, 6);
121 121
 
122 122
 // when a blog is deleted in multisite
123
-add_filter( 'wpmu_drop_tables', array( 'Email_Log_Init', 'on_delete_blog' ) );
123
+add_filter('wpmu_drop_tables', array('Email_Log_Init', 'on_delete_blog'));
124 124
 ?>
Please login to merge, or discard this patch.
uninstall.php 3 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -8,24 +8,24 @@  discard block
 block discarded – undo
8 8
 */
9 9
 // uninstall page for Email Log Plugin to clean up db.
10 10
 if( !defined( 'ABSPATH' ) && !defined( 'WP_UNINSTALL_PLUGIN' ) )
11
-    exit();
11
+	exit();
12 12
 
13 13
 if ( is_multisite() ) {
14
-    global $wpdb;
14
+	global $wpdb;
15 15
 
16
-    $original_blog_id = get_current_blog_id();
16
+	$original_blog_id = get_current_blog_id();
17 17
 
18
-    $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
18
+	$blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
19 19
 
20
-    foreach ( $blog_ids as $blog_id ) {
21
-        switch_to_blog( $blog_id );
22
-        email_log_delete_table();
23
-    }
20
+	foreach ( $blog_ids as $blog_id ) {
21
+		switch_to_blog( $blog_id );
22
+		email_log_delete_table();
23
+	}
24 24
 
25
-    switch_to_blog( $original_blog_id );
25
+	switch_to_blog( $original_blog_id );
26 26
 
27 27
 } else {
28
-    email_log_delete_table();
28
+	email_log_delete_table();
29 29
 }
30 30
 
31 31
 /**
@@ -36,15 +36,15 @@  discard block
 block discarded – undo
36 36
  * @global object $wpdb
37 37
  */
38 38
 function email_log_delete_table() {
39
-    global $wpdb;
40
-    $table_name = $wpdb->prefix . "email_log"; // This is hardcoded on purpose
39
+	global $wpdb;
40
+	$table_name = $wpdb->prefix . "email_log"; // This is hardcoded on purpose
41 41
 
42
-    if( $wpdb->get_var( "SHOW TABLES LIKE '{$table_name}'" ) == $table_name ) {
43
-        // If table is present, drop it
44
-        $wpdb->query( "DROP TABLE $table_name" );
45
-    }
42
+	if( $wpdb->get_var( "SHOW TABLES LIKE '{$table_name}'" ) == $table_name ) {
43
+		// If table is present, drop it
44
+		$wpdb->query( "DROP TABLE $table_name" );
45
+	}
46 46
 
47
-    // Delete the option
48
-    delete_option('email-log-db');
47
+	// Delete the option
48
+	delete_option('email-log-db');
49 49
 }
50 50
 ?>
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,22 +7,22 @@  discard block
 block discarded – undo
7 7
  * @author      Sudar
8 8
 */
9 9
 // uninstall page for Email Log Plugin to clean up db.
10
-if( !defined( 'ABSPATH' ) && !defined( 'WP_UNINSTALL_PLUGIN' ) )
10
+if ( ! defined('ABSPATH') && ! defined('WP_UNINSTALL_PLUGIN'))
11 11
     exit();
12 12
 
13
-if ( is_multisite() ) {
13
+if (is_multisite()) {
14 14
     global $wpdb;
15 15
 
16 16
     $original_blog_id = get_current_blog_id();
17 17
 
18
-    $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
18
+    $blog_ids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
19 19
 
20
-    foreach ( $blog_ids as $blog_id ) {
21
-        switch_to_blog( $blog_id );
20
+    foreach ($blog_ids as $blog_id) {
21
+        switch_to_blog($blog_id);
22 22
         email_log_delete_table();
23 23
     }
24 24
 
25
-    switch_to_blog( $original_blog_id );
25
+    switch_to_blog($original_blog_id);
26 26
 
27 27
 } else {
28 28
     email_log_delete_table();
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
     global $wpdb;
40 40
     $table_name = $wpdb->prefix . "email_log"; // This is hardcoded on purpose
41 41
 
42
-    if( $wpdb->get_var( "SHOW TABLES LIKE '{$table_name}'" ) == $table_name ) {
42
+    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") == $table_name) {
43 43
         // If table is present, drop it
44
-        $wpdb->query( "DROP TABLE $table_name" );
44
+        $wpdb->query("DROP TABLE $table_name");
45 45
     }
46 46
 
47 47
     // Delete the option
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,8 +7,9 @@
 block discarded – undo
7 7
  * @author      Sudar
8 8
 */
9 9
 // uninstall page for Email Log Plugin to clean up db.
10
-if( !defined( 'ABSPATH' ) && !defined( 'WP_UNINSTALL_PLUGIN' ) )
10
+if( !defined( 'ABSPATH' ) && !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
11 11
     exit();
12
+}
12 13
 
13 14
 if ( is_multisite() ) {
14 15
     global $wpdb;
Please login to merge, or discard this patch.
include/class-email-header-parser.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @package EmailLog
7 7
  */
8 8
 
9
-defined( 'ABSPATH' ) || exit; // Exit if accessed directly
9
+defined('ABSPATH') || exit; // Exit if accessed directly
10 10
 
11 11
 /**
12 12
  * Class Email Header Parser.
@@ -23,26 +23,26 @@  discard block
 block discarded – undo
23 23
 	 * @param array $data Headers to be joined.
24 24
 	 * @return string Joined headers.
25 25
 	 */
26
-	public function join_headers( $data ) {
26
+	public function join_headers($data) {
27 27
 		$headers = '';
28 28
 
29
-		if ( ! empty( $data['from'] ) ) {
29
+		if ( ! empty($data['from'])) {
30 30
 			$headers .= 'From: ' . $data['from'] . "\r\n";
31 31
 		}
32 32
 
33
-		if ( ! empty( $data['cc'] ) ) {
33
+		if ( ! empty($data['cc'])) {
34 34
 			$headers .= 'CC: ' . $data['cc'] . "\r\n";
35 35
 		}
36 36
 
37
-		if ( ! empty( $data['bcc'] ) ) {
37
+		if ( ! empty($data['bcc'])) {
38 38
 			$headers .= 'BCC: ' . $data['bcc'] . "\r\n";
39 39
 		}
40 40
 
41
-		if ( ! empty( $data['reply_to'] ) ) {
41
+		if ( ! empty($data['reply_to'])) {
42 42
 			$headers .= 'Reply-to: ' . $data['reply_to'] . "\r\n";
43 43
 		}
44 44
 
45
-		if ( ! empty( $data['content_type'] ) ) {
45
+		if ( ! empty($data['content_type'])) {
46 46
 			$headers .= 'Content-type: ' . $data['content_type'] . "\r\n";
47 47
 		}
48 48
 
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
 	 * @param string $headers Headers to parse
56 56
 	 * @return array Parsed Headers.
57 57
 	 */
58
-	public function parse_headers( $headers ) {
59
-		return $this->parse( $headers );
58
+	public function parse_headers($headers) {
59
+		return $this->parse($headers);
60 60
 	}
61 61
 
62 62
 	/**
@@ -67,16 +67,16 @@  discard block
 block discarded – undo
67 67
 	 * @param string $headers Headers to be parsed.
68 68
 	 * @return array Parsed headers
69 69
 	 */
70
-	private function parse( $headers ) {
70
+	private function parse($headers) {
71 71
 		$data = array();
72
-		$arr_headers = explode( "\n", $headers );
72
+		$arr_headers = explode("\n", $headers);
73 73
 
74
-		foreach ( $arr_headers as $header ) {
75
-			$split_header = explode( ':', $header );
76
-			$value = $this->parse_header_line( $split_header );
74
+		foreach ($arr_headers as $header) {
75
+			$split_header = explode(':', $header);
76
+			$value = $this->parse_header_line($split_header);
77 77
 
78
-			if ( trim( $value ) != '' ) {
79
-				switch ( strtolower( $split_header[0] ) ) {
78
+			if (trim($value) != '') {
79
+				switch (strtolower($split_header[0])) {
80 80
 					case 'from':
81 81
 						$data['from'] = $value;
82 82
 						break;
@@ -111,13 +111,13 @@  discard block
 block discarded – undo
111 111
 	 * @param array   $header Header line to be parsed
112 112
 	 * @return string         Parsed value
113 113
 	 */
114
-	private function parse_header_line( $header ) {
114
+	private function parse_header_line($header) {
115 115
 		$value = '';
116
-		if ( count( $header ) == 2 ) {
117
-			if ( is_array( $header[1] ) ) {
118
-				$value = trim( implode( ',', array_map( 'trim', $header[1] ) ) );
116
+		if (count($header) == 2) {
117
+			if (is_array($header[1])) {
118
+				$value = trim(implode(',', array_map('trim', $header[1])));
119 119
 			} else {
120
-				$value = trim( $header[1] );
120
+				$value = trim($header[1]);
121 121
 			}
122 122
 		}
123 123
 
Please login to merge, or discard this patch.
email-log.php 1 patch
Spacing   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -32,12 +32,12 @@  discard block
 block discarded – undo
32 32
  *
33 33
  * @since 1.7.2
34 34
  */
35
-if ( ! defined( 'EMAIL_LOG_PLUGIN_FILE' ) ) {
36
-	define( 'EMAIL_LOG_PLUGIN_FILE', __FILE__ );
35
+if ( ! defined('EMAIL_LOG_PLUGIN_FILE')) {
36
+	define('EMAIL_LOG_PLUGIN_FILE', __FILE__);
37 37
 }
38 38
 
39 39
 // handle installation and table creation
40
-require_once plugin_dir_path( __FILE__ ) . 'include/install.php';
40
+require_once plugin_dir_path(__FILE__) . 'include/install.php';
41 41
 
42 42
 /**
43 43
  * The main Plugin class
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
 	const DELETE_LOG_ACTION        = 'sm-delete-email-log';
55 55
 
56 56
 	// DB stuff
57
-	const TABLE_NAME               = 'email_log';          /* Database table name */
58
-	const DB_OPTION_NAME           = 'email-log-db';       /* Database option name */
59
-	const DB_VERSION               = '0.1';                /* Database version */
57
+	const TABLE_NAME               = 'email_log'; /* Database table name */
58
+	const DB_OPTION_NAME           = 'email-log-db'; /* Database option name */
59
+	const DB_VERSION               = '0.1'; /* Database version */
60 60
 
61 61
 	// JS Stuff
62 62
 	const JS_HANDLE                = 'email-log';
@@ -69,25 +69,25 @@  discard block
 block discarded – undo
69 69
 	 * Initialize the plugin by registering the hooks
70 70
 	 */
71 71
 	function __construct() {
72
-		$this->include_path = plugin_dir_path( __FILE__ );
72
+		$this->include_path = plugin_dir_path(__FILE__);
73 73
 
74 74
 		// Load localization domain
75
-		$this->translations = dirname( plugin_basename( __FILE__ ) ) . '/languages/' ;
76
-		load_plugin_textdomain( 'email-log', false, $this->translations );
75
+		$this->translations = dirname(plugin_basename(__FILE__)) . '/languages/';
76
+		load_plugin_textdomain('email-log', false, $this->translations);
77 77
 
78 78
 		// Register hooks
79
-		add_action( 'admin_menu', array( $this, 'register_settings_page' ) );
79
+		add_action('admin_menu', array($this, 'register_settings_page'));
80 80
 
81 81
 		// Register Filter
82
-		add_filter( 'wp_mail', array( $this, 'log_email' ) );
83
-		add_filter( 'set-screen-option', array( $this, 'save_screen_options' ), 10, 3 );
84
-		add_filter( 'plugin_row_meta', array( $this, 'add_plugin_links' ), 10, 2 );
82
+		add_filter('wp_mail', array($this, 'log_email'));
83
+		add_filter('set-screen-option', array($this, 'save_screen_options'), 10, 3);
84
+		add_filter('plugin_row_meta', array($this, 'add_plugin_links'), 10, 2);
85 85
 
86
-		$plugin = plugin_basename( __FILE__ );
87
-		add_filter( "plugin_action_links_$plugin", array( $this, 'add_action_links' ) );
86
+		$plugin = plugin_basename(__FILE__);
87
+		add_filter("plugin_action_links_$plugin", array($this, 'add_action_links'));
88 88
 
89 89
 		//Add our ajax call
90
-		add_action( 'wp_ajax_display_content', array( $this, 'display_content_callback' ) );
90
+		add_action('wp_ajax_display_content', array($this, 'display_content_callback'));
91 91
 	}
92 92
 
93 93
 	/**
@@ -97,13 +97,13 @@  discard block
 block discarded – undo
97 97
 	 * @param unknown $file
98 98
 	 * @return unknown
99 99
 	 */
100
-	function add_plugin_links( $links, $file ) {
101
-		$plugin = plugin_basename( __FILE__ );
100
+	function add_plugin_links($links, $file) {
101
+		$plugin = plugin_basename(__FILE__);
102 102
 
103
-		if ( $file == $plugin ) {
103
+		if ($file == $plugin) {
104 104
 			// only for this plugin
105
-			return array_merge( $links,
106
-				array( '<a href="http://sudarmuthu.com/wordpress/email-log/pro-addons" target="_blank">' . __( 'Buy Addons', 'email-log' ) . '</a>' )
105
+			return array_merge($links,
106
+				array('<a href="http://sudarmuthu.com/wordpress/email-log/pro-addons" target="_blank">' . __('Buy Addons', 'email-log') . '</a>')
107 107
 			);
108 108
 		}
109 109
 		return $links;
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
 	 */
115 115
 	function register_settings_page() {
116 116
 		//Save the handle to your admin page - you'll need it to create a WP_Screen object
117
-		$this->admin_page = add_submenu_page( 'tools.php', __( 'Email Log', 'email-log' ), __( 'Email Log', 'email-log' ), 'manage_options', self::PAGE_SLUG , array( $this, 'display_logs' ) );
117
+		$this->admin_page = add_submenu_page('tools.php', __('Email Log', 'email-log'), __('Email Log', 'email-log'), 'manage_options', self::PAGE_SLUG, array($this, 'display_logs'));
118 118
 
119
-		add_action( "load-{$this->admin_page}", array( $this, 'create_settings_panel' ) );
119
+		add_action("load-{$this->admin_page}", array($this, 'create_settings_panel'));
120 120
 	}
121 121
 
122 122
 	/**
@@ -125,33 +125,33 @@  discard block
 block discarded – undo
125 125
 	function display_logs() {
126 126
 		add_thickbox();
127 127
 
128
-		$this->logs_table->prepare_items( $this->get_per_page() );
128
+		$this->logs_table->prepare_items($this->get_per_page());
129 129
 ?>
130 130
 	<div class="wrap">
131
-		<h2><?php _e( 'Email Logs', 'email-log' );?></h2>
131
+		<h2><?php _e('Email Logs', 'email-log'); ?></h2>
132 132
 		<?php
133
-		if ( isset( $this->logs_deleted ) && $this->logs_deleted != '' ) {
134
-			$logs_deleted = intval( $this->logs_deleted );
133
+		if (isset($this->logs_deleted) && $this->logs_deleted != '') {
134
+			$logs_deleted = intval($this->logs_deleted);
135 135
 
136
-			if ( $logs_deleted > 0 ) {
137
-				echo '<div class="updated"><p>' . sprintf( _n( '1 email log deleted.', '%s email logs deleted', $logs_deleted, 'email-log' ), $logs_deleted ) . '</p></div>';
136
+			if ($logs_deleted > 0) {
137
+				echo '<div class="updated"><p>' . sprintf(_n('1 email log deleted.', '%s email logs deleted', $logs_deleted, 'email-log'), $logs_deleted) . '</p></div>';
138 138
 			} else {
139
-				echo '<div class="updated"><p>' . __( 'There was some problem in deleting the email logs' , 'email-log' ) . '</p></div>';
139
+				echo '<div class="updated"><p>' . __('There was some problem in deleting the email logs', 'email-log') . '</p></div>';
140 140
 			}
141
-			unset( $this->logs_deleted );
141
+			unset($this->logs_deleted);
142 142
 		}
143 143
 ?>
144 144
 		<form id="email-logs-search" method="get">
145 145
 			<input type="hidden" name="page" value="<?php echo self::PAGE_SLUG; ?>" >
146 146
 <?php
147
-		$this->logs_table->search_box( __( 'Search Logs', 'email-log' ), 'search_id' );
147
+		$this->logs_table->search_box(__('Search Logs', 'email-log'), 'search_id');
148 148
 ?>
149 149
 		</form>
150 150
 
151 151
 		<form id="email-logs-filter" method="get">
152 152
 			<input type="hidden" name="page" value="<?php echo $_REQUEST['page'] ?>" />
153 153
 <?php
154
-		wp_nonce_field( self::DELETE_LOG_ACTION, self::DELETE_LOG_NONCE_FIELD );
154
+		wp_nonce_field(self::DELETE_LOG_ACTION, self::DELETE_LOG_NONCE_FIELD);
155 155
 		$this->logs_table->display();
156 156
 ?>
157 157
 		</form>
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
 		 *
163 163
 		 * @since 1.8
164 164
 		 */
165
-		do_action( 'el_admin_footer' );
165
+		do_action('el_admin_footer');
166 166
 
167 167
 		// Display credits in Footer
168
-		add_action( 'in_admin_footer', array( $this, 'add_footer_links' ) );
168
+		add_action('in_admin_footer', array($this, 'add_footer_links'));
169 169
 	}
170 170
 
171 171
 	/**
@@ -177,43 +177,43 @@  discard block
 block discarded – undo
177 177
 		 * Create the WP_Screen object against your admin page handle
178 178
 		 * This ensures we're working with the right admin page
179 179
 		 */
180
-		$this->admin_screen = WP_Screen::get( $this->admin_page );
180
+		$this->admin_screen = WP_Screen::get($this->admin_page);
181 181
 
182 182
 		/**
183 183
 		 * Content specified inline
184 184
 		 */
185 185
 		$this->admin_screen->add_help_tab(
186 186
 			array(
187
-				'title'    => __( 'About Plugin', 'email-log' ),
187
+				'title'    => __('About Plugin', 'email-log'),
188 188
 				'id'       => 'about_tab',
189
-				'content'  => '<p>' . __( 'Email Log WordPress Plugin, allows you to log all emails that are sent through WordPress.', 'email-log' ) . '</p>',
189
+				'content'  => '<p>' . __('Email Log WordPress Plugin, allows you to log all emails that are sent through WordPress.', 'email-log') . '</p>',
190 190
 				'callback' => false,
191 191
 			)
192 192
 		);
193 193
 
194 194
 		// Add help sidebar
195 195
 		$this->admin_screen->set_help_sidebar(
196
-			'<p><strong>' . __( 'More information', 'email-log' ) . '</strong></p>' .
197
-			'<p><a href = "http://sudarmuthu.com/wordpress/email-log">' . __( 'Plugin Homepage/support', 'email-log' ) . '</a></p>' .
198
-			'<p><a href = "http://sudarmuthu.com/blog">' . __( "Plugin author's blog", 'email-log' ) . '</a></p>' .
199
-			'<p><a href = "http://sudarmuthu.com/wordpress/">' . __( "Other Plugin's by Author", 'email-log' ) . '</a></p>'
196
+			'<p><strong>' . __('More information', 'email-log') . '</strong></p>' .
197
+			'<p><a href = "http://sudarmuthu.com/wordpress/email-log">' . __('Plugin Homepage/support', 'email-log') . '</a></p>' .
198
+			'<p><a href = "http://sudarmuthu.com/blog">' . __("Plugin author's blog", 'email-log') . '</a></p>' .
199
+			'<p><a href = "http://sudarmuthu.com/wordpress/">' . __("Other Plugin's by Author", 'email-log') . '</a></p>'
200 200
 		);
201 201
 
202 202
 		// Add screen options
203 203
 		$this->admin_screen->add_option(
204 204
 			'per_page',
205 205
 			array(
206
-				'label' => __( 'Entries per page', 'email-log' ),
206
+				'label' => __('Entries per page', 'email-log'),
207 207
 				'default' => 20,
208 208
 				'option' => 'per_page',
209 209
 			)
210 210
 		);
211 211
 
212
-		if ( ! class_exists( 'WP_List_Table' ) ) {
212
+		if ( ! class_exists('WP_List_Table')) {
213 213
 			require_once ABSPATH . WPINC . '/class-wp-list-table.php';
214 214
 		}
215 215
 
216
-		if ( ! class_exists( 'Email_Log_List_Table' ) ) {
216
+		if ( ! class_exists('Email_Log_List_Table')) {
217 217
 			require_once $this->include_path . 'include/class-email-log-list-table.php';
218 218
 		}
219 219
 
@@ -230,12 +230,12 @@  discard block
 block discarded – undo
230 230
 		global $wpdb;
231 231
 
232 232
 		$table_name = $wpdb->prefix . self::TABLE_NAME;
233
-		$email_id   = absint( $_GET['email_id'] );
233
+		$email_id   = absint($_GET['email_id']);
234 234
 
235
-		$query      = $wpdb->prepare( 'SELECT * FROM ' . $table_name . ' WHERE id = %d', $email_id );
236
-		$content    = $wpdb->get_results( $query );
235
+		$query      = $wpdb->prepare('SELECT * FROM ' . $table_name . ' WHERE id = %d', $email_id);
236
+		$content    = $wpdb->get_results($query);
237 237
 
238
-		echo wpautop( $content[0]->message );
238
+		echo wpautop($content[0]->message);
239 239
 
240 240
 		die(); // this is required to return a proper result
241 241
 	}
@@ -248,8 +248,8 @@  discard block
 block discarded – undo
248 248
 	 * @param unknown $value
249 249
 	 * @return unknown
250 250
 	 */
251
-	function save_screen_options( $status, $option, $value ) {
252
-		if ( 'per_page' == $option ) {
251
+	function save_screen_options($status, $option, $value) {
252
+		if ('per_page' == $option) {
253 253
 			return $value;
254 254
 		} else {
255 255
 			return $status;
@@ -266,12 +266,12 @@  discard block
 block discarded – undo
266 266
 	 */
267 267
 	public static function get_per_page() {
268 268
 		$screen = get_current_screen();
269
-		$option = $screen->get_option( 'per_page', 'option' );
269
+		$option = $screen->get_option('per_page', 'option');
270 270
 
271
-		$per_page = get_user_meta( get_current_user_id(), $option, true );
271
+		$per_page = get_user_meta(get_current_user_id(), $option, true);
272 272
 
273
-		if ( empty( $per_page ) || $per_page < 1 ) {
274
-			$per_page = $screen->get_option( 'per_page', 'default' );
273
+		if (empty($per_page) || $per_page < 1) {
274
+			$per_page = $screen->get_option('per_page', 'default');
275 275
 		}
276 276
 
277 277
 		return $per_page;
@@ -283,10 +283,10 @@  discard block
 block discarded – undo
283 283
 	 * @param <type>  $links
284 284
 	 * @return <type>
285 285
 	 */
286
-	function add_action_links( $links ) {
286
+	function add_action_links($links) {
287 287
 		// Add a link to this plugin's settings page
288
-		$settings_link = '<a href="tools.php?page=email-log">' . __( 'Log', 'email-log' ) . '</a>';
289
-		array_unshift( $links, $settings_link );
288
+		$settings_link = '<a href="tools.php?page=email-log">' . __('Log', 'email-log') . '</a>';
289
+		array_unshift($links, $settings_link);
290 290
 		return $links;
291 291
 	}
292 292
 
@@ -294,8 +294,8 @@  discard block
 block discarded – undo
294 294
 	 * Adds Footer links. Based on http://striderweb.com/nerdaphernalia/2008/06/give-your-wordpress-plugin-credit/
295 295
 	 */
296 296
 	function add_footer_links() {
297
-		$plugin_data = get_plugin_data( __FILE__ );
298
-		printf( '%1$s ' . __( 'plugin', 'email-log' ) . ' | ' . __( 'Version', 'email-log' ) . ' %2$s | ' . __( 'by', 'email-log' ) . ' %3$s<br />', $plugin_data['Title'], $plugin_data['Version'], $plugin_data['Author'] );
297
+		$plugin_data = get_plugin_data(__FILE__);
298
+		printf('%1$s ' . __('plugin', 'email-log') . ' | ' . __('Version', 'email-log') . ' %2$s | ' . __('by', 'email-log') . ' %3$s<br />', $plugin_data['Title'], $plugin_data['Version'], $plugin_data['Author']);
299 299
 	}
300 300
 
301 301
 	/**
@@ -305,21 +305,21 @@  discard block
 block discarded – undo
305 305
 	 * @param array   $mail_info Information about email
306 306
 	 * @return array             Information about email
307 307
 	 */
308
-	function log_email( $mail_info ) {
308
+	function log_email($mail_info) {
309 309
 		global $wpdb;
310 310
 
311
-		$attachment_present = ( count( $mail_info['attachments'] ) > 0 ) ? 'true' : 'false';
311
+		$attachment_present = (count($mail_info['attachments']) > 0) ? 'true' : 'false';
312 312
 
313 313
 		// return filtered array
314
-		$mail_info  = apply_filters( self::FILTER_NAME, $mail_info );
314
+		$mail_info  = apply_filters(self::FILTER_NAME, $mail_info);
315 315
 		$table_name = $wpdb->prefix . self::TABLE_NAME;
316 316
 
317
-		if ( isset( $mail_info['message'] ) ) {
317
+		if (isset($mail_info['message'])) {
318 318
 			$message = $mail_info['message'];
319 319
 		} else {
320 320
 			// wpmandrill plugin is changing "message" key to "html". See https://github.com/sudar/email-log/issues/20
321 321
 			// Ideally this should be fixed in wpmandrill, but I am including this hack here till it is fixed by them.
322
-			if ( isset( $mail_info['html'] ) ) {
322
+			if (isset($mail_info['html'])) {
323 323
 				$message = $mail_info['html'];
324 324
 			} else {
325 325
 				$message = '';
@@ -327,14 +327,14 @@  discard block
 block discarded – undo
327 327
 		}
328 328
 
329 329
 		// Log into the database
330
-		$wpdb->insert( $table_name, array(
331
-				'to_email'    => is_array( $mail_info['to'] ) ? implode( ',', $mail_info['to'] ) : $mail_info['to'],
330
+		$wpdb->insert($table_name, array(
331
+				'to_email'    => is_array($mail_info['to']) ? implode(',', $mail_info['to']) : $mail_info['to'],
332 332
 				'subject'     => $mail_info['subject'],
333 333
 				'message'     => $message,
334
-				'headers'     => is_array( $mail_info['headers'] ) ? implode( "\n", $mail_info['headers'] ) : $mail_info['headers'],
334
+				'headers'     => is_array($mail_info['headers']) ? implode("\n", $mail_info['headers']) : $mail_info['headers'],
335 335
 				'attachments' => $attachment_present,
336
-				'sent_date'   => current_time( 'mysql' ),
337
-			) );
336
+				'sent_date'   => current_time('mysql'),
337
+			));
338 338
 
339 339
 		return $mail_info;
340 340
 	}
@@ -347,5 +347,5 @@  discard block
 block discarded – undo
347 347
 	global $EmailLog;
348 348
 	$EmailLog = new EmailLog();
349 349
 }
350
-add_action( 'init', 'email_log' );
350
+add_action('init', 'email_log');
351 351
 ?>
Please login to merge, or discard this patch.