Completed
Push — master ( 82a250...ece35a )
by Devin
38:40 queued 18:41
created
includes/admin/class-api-keys-table.php 1 patch
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
17 17
 // Load WP_List_Table if not loaded
18
-if ( ! class_exists( 'WP_List_Table' ) ) {
19
-	require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
18
+if ( ! class_exists('WP_List_Table')) {
19
+	require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php';
20 20
 }
21 21
 
22 22
 /**
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 		global $status, $page;
51 51
 
52 52
 		// Set parent defaults
53
-		parent::__construct( array(
54
-			'singular' => esc_html__( 'API Key', 'give' ),     // Singular name of the listed records
55
-			'plural'   => esc_html__( 'API Keys', 'give' ),    // Plural name of the listed records
53
+		parent::__construct(array(
54
+			'singular' => esc_html__('API Key', 'give'), // Singular name of the listed records
55
+			'plural'   => esc_html__('API Keys', 'give'), // Plural name of the listed records
56 56
 			'ajax'     => false                       // Does this table support ajax?
57
-		) );
57
+		));
58 58
 
59 59
 		$this->query();
60 60
 	}
@@ -70,8 +70,8 @@  discard block
 block discarded – undo
70 70
 	 *
71 71
 	 * @return string Column Name
72 72
 	 */
73
-	public function column_default( $item, $column_name ) {
74
-		return $item[ $column_name ];
73
+	public function column_default($item, $column_name) {
74
+		return $item[$column_name];
75 75
 	}
76 76
 
77 77
 	/**
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
 	 *
86 86
 	 * @return string Column Name
87 87
 	 */
88
-	public function column_key( $item ) {
89
-		return '<input onClick="this.setSelectionRange(0, this.value.length)" readonly="readonly" type="text" class="large-text" value="' . esc_attr( $item['key'] ) . '"/>';
88
+	public function column_key($item) {
89
+		return '<input onClick="this.setSelectionRange(0, this.value.length)" readonly="readonly" type="text" class="large-text" value="'.esc_attr($item['key']).'"/>';
90 90
 	}
91 91
 
92 92
 	/**
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
 	 *
101 101
 	 * @return string Column Name
102 102
 	 */
103
-	public function column_token( $item ) {
104
-		return '<input onClick="this.setSelectionRange(0, this.value.length)" readonly="readonly" type="text" class="large-text" value="' . esc_attr( $item['token'] ) . '"/>';
103
+	public function column_token($item) {
104
+		return '<input onClick="this.setSelectionRange(0, this.value.length)" readonly="readonly" type="text" class="large-text" value="'.esc_attr($item['token']).'"/>';
105 105
 	}
106 106
 
107 107
 	/**
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
 	 *
116 116
 	 * @return string Column Name
117 117
 	 */
118
-	public function column_secret( $item ) {
119
-		return '<input onClick="this.setSelectionRange(0, this.value.length)" readonly="readonly" type="text" class="large-text" value="' . esc_attr( $item['secret'] ) . '"/>';
118
+	public function column_secret($item) {
119
+		return '<input onClick="this.setSelectionRange(0, this.value.length)" readonly="readonly" type="text" class="large-text" value="'.esc_attr($item['secret']).'"/>';
120 120
 	}
121 121
 
122 122
 	/**
@@ -126,46 +126,46 @@  discard block
 block discarded – undo
126 126
 	 * @since  1.1
127 127
 	 * @return void
128 128
 	 */
129
-	public function column_user( $item ) {
129
+	public function column_user($item) {
130 130
 
131 131
 		$actions = array();
132 132
 
133
-		if ( apply_filters( 'give_api_log_requests', true ) ) {
133
+		if (apply_filters('give_api_log_requests', true)) {
134 134
 			$actions['view'] = sprintf(
135 135
 				'<a href="%s">%s</a>',
136
-				esc_url( add_query_arg( array(
136
+				esc_url(add_query_arg(array(
137 137
 					'view'      => 'api_requests',
138 138
 					'post_type' => 'give_forms',
139 139
 					'page'      => 'give-reports',
140 140
 					'tab'       => 'logs',
141 141
 					's'         => $item['email']
142
-				), 'edit.php' ) ),
143
-				esc_html__( 'View API Log', 'give' )
142
+				), 'edit.php')),
143
+				esc_html__('View API Log', 'give')
144 144
 			);
145 145
 		}
146 146
 
147 147
 		$actions['reissue'] = sprintf(
148 148
 			'<a href="%s" class="give-regenerate-api-key">%s</a>',
149
-			esc_url( wp_nonce_url( add_query_arg( array(
149
+			esc_url(wp_nonce_url(add_query_arg(array(
150 150
 				'user_id'          => $item['id'],
151 151
 				'give_action'      => 'process_api_key',
152 152
 				'give_api_process' => 'regenerate'
153
-			) ), 'give-api-nonce' ) ),
154
-			esc_html__( 'Reissue', 'give' )
153
+			)), 'give-api-nonce')),
154
+			esc_html__('Reissue', 'give')
155 155
 		);
156
-		$actions['revoke']  = sprintf(
156
+		$actions['revoke'] = sprintf(
157 157
 			'<a href="%s" class="give-revoke-api-key give-delete">%s</a>',
158
-			esc_url( wp_nonce_url( add_query_arg( array(
158
+			esc_url(wp_nonce_url(add_query_arg(array(
159 159
 				'user_id'          => $item['id'],
160 160
 				'give_action'      => 'process_api_key',
161 161
 				'give_api_process' => 'revoke'
162
-			) ), 'give-api-nonce' ) ),
163
-			esc_html__( 'Revoke', 'give' )
162
+			)), 'give-api-nonce')),
163
+			esc_html__('Revoke', 'give')
164 164
 		);
165 165
 
166
-		$actions = apply_filters( 'give_api_row_actions', array_filter( $actions ) );
166
+		$actions = apply_filters('give_api_row_actions', array_filter($actions));
167 167
 
168
-		return sprintf( '%1$s %2$s', $item['user'], $this->row_actions( $actions ) );
168
+		return sprintf('%1$s %2$s', $item['user'], $this->row_actions($actions));
169 169
 	}
170 170
 
171 171
 	/**
@@ -177,10 +177,10 @@  discard block
 block discarded – undo
177 177
 	 */
178 178
 	public function get_columns() {
179 179
 		$columns = array(
180
-			'user'   => esc_html__( 'Username', 'give' ),
181
-			'key'    => esc_html__( 'Public Key', 'give' ),
182
-			'token'  => esc_html__( 'Token', 'give' ),
183
-			'secret' => esc_html__( 'Secret Key', 'give' )
180
+			'user'   => esc_html__('Username', 'give'),
181
+			'key'    => esc_html__('Public Key', 'give'),
182
+			'token'  => esc_html__('Token', 'give'),
183
+			'secret' => esc_html__('Secret Key', 'give')
184 184
 		);
185 185
 
186 186
 		return $columns;
@@ -193,19 +193,19 @@  discard block
 block discarded – undo
193 193
 	 * @since  1.1
194 194
 	 * @return void
195 195
 	 */
196
-	function bulk_actions( $which = '' ) {
196
+	function bulk_actions($which = '') {
197 197
 		// These aren't really bulk actions but this outputs the markup in the right place
198 198
 		static $give_api_is_bottom;
199 199
 
200
-		if ( $give_api_is_bottom ) {
200
+		if ($give_api_is_bottom) {
201 201
 			return;
202 202
 		}
203 203
 		?>
204 204
 		<input type="hidden" name="give_action" value="process_api_key"/>
205 205
 		<input type="hidden" name="give_api_process" value="generate"/>
206
-		<?php wp_nonce_field( 'give-api-nonce' ); ?>
206
+		<?php wp_nonce_field('give-api-nonce'); ?>
207 207
 		<?php echo Give()->html->ajax_user_search(); ?>
208
-		<?php submit_button( esc_html__( 'Generate New API Keys', 'give' ), 'secondary', 'submit', false ); ?>
208
+		<?php submit_button(esc_html__('Generate New API Keys', 'give'), 'secondary', 'submit', false); ?>
209 209
 		<?php
210 210
 		$give_api_is_bottom = true;
211 211
 	}
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 	 * @return int Current page number
219 219
 	 */
220 220
 	public function get_paged() {
221
-		return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1;
221
+		return isset($_GET['paged']) ? absint($_GET['paged']) : 1;
222 222
 	}
223 223
 
224 224
 	/**
@@ -229,21 +229,21 @@  discard block
 block discarded – undo
229 229
 	 * @return array
230 230
 	 */
231 231
 	public function query() {
232
-		$users = get_users( array(
232
+		$users = get_users(array(
233 233
 			'meta_value' => 'give_user_secret_key',
234 234
 			'number'     => $this->per_page,
235
-			'offset'     => $this->per_page * ( $this->get_paged() - 1 )
236
-		) );
237
-		$keys  = array();
238
-
239
-		foreach ( $users as $user ) {
240
-			$keys[ $user->ID ]['id']    = $user->ID;
241
-			$keys[ $user->ID ]['email'] = $user->user_email;
242
-			$keys[ $user->ID ]['user']  = '<a href="' . add_query_arg( 'user_id', $user->ID, 'user-edit.php' ) . '"><strong>' . $user->user_login . '</strong></a>';
243
-
244
-			$keys[ $user->ID ]['key']    = Give()->api->get_user_public_key( $user->ID );
245
-			$keys[ $user->ID ]['secret'] = Give()->api->get_user_secret_key( $user->ID );
246
-			$keys[ $user->ID ]['token']  = Give()->api->get_token( $user->ID );
235
+			'offset'     => $this->per_page * ($this->get_paged() - 1)
236
+		));
237
+		$keys = array();
238
+
239
+		foreach ($users as $user) {
240
+			$keys[$user->ID]['id']    = $user->ID;
241
+			$keys[$user->ID]['email'] = $user->user_email;
242
+			$keys[$user->ID]['user']  = '<a href="'.add_query_arg('user_id', $user->ID, 'user-edit.php').'"><strong>'.$user->user_login.'</strong></a>';
243
+
244
+			$keys[$user->ID]['key']    = Give()->api->get_user_public_key($user->ID);
245
+			$keys[$user->ID]['secret'] = Give()->api->get_user_secret_key($user->ID);
246
+			$keys[$user->ID]['token']  = Give()->api->get_token($user->ID);
247 247
 		}
248 248
 
249 249
 		return $keys;
@@ -260,13 +260,13 @@  discard block
 block discarded – undo
260 260
 	public function total_items() {
261 261
 		global $wpdb;
262 262
 
263
-		if ( ! get_transient( 'give_total_api_keys' ) ) {
264
-			$total_items = $wpdb->get_var( "SELECT count(user_id) FROM $wpdb->usermeta WHERE meta_value='give_user_secret_key'" );
263
+		if ( ! get_transient('give_total_api_keys')) {
264
+			$total_items = $wpdb->get_var("SELECT count(user_id) FROM $wpdb->usermeta WHERE meta_value='give_user_secret_key'");
265 265
 
266
-			set_transient( 'give_total_api_keys', $total_items, 60 * 60 );
266
+			set_transient('give_total_api_keys', $total_items, 60 * 60);
267 267
 		}
268 268
 
269
-		return get_transient( 'give_total_api_keys' );
269
+		return get_transient('give_total_api_keys');
270 270
 	}
271 271
 
272 272
 	/**
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 		$hidden   = array(); // No hidden columns
283 283
 		$sortable = array(); // Not sortable... for now
284 284
 
285
-		$this->_column_headers = array( $columns, $hidden, $sortable, 'id' );
285
+		$this->_column_headers = array($columns, $hidden, $sortable, 'id');
286 286
 
287 287
 		$data = $this->query();
288 288
 
@@ -290,10 +290,10 @@  discard block
 block discarded – undo
290 290
 
291 291
 		$this->items = $data;
292 292
 
293
-		$this->set_pagination_args( array(
293
+		$this->set_pagination_args(array(
294 294
 				'total_items' => $total_items,
295 295
 				'per_page'    => $this->per_page,
296
-				'total_pages' => ceil( $total_items / $this->per_page )
296
+				'total_pages' => ceil($total_items / $this->per_page)
297 297
 			)
298 298
 		);
299 299
 	}
Please login to merge, or discard this patch.
includes/admin/class-admin-notices.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
 	 * @since 1.0
28 28
 	 */
29 29
 	public function __construct() {
30
-		add_action( 'admin_notices', array( $this, 'show_notices' ) );
31
-		add_action( 'give_dismiss_notices', array( $this, 'dismiss_notices' ) );
32
-		add_action( 'admin_bar_menu', array( $this, 'give_admin_bar_menu' ), 1000 );
30
+		add_action('admin_notices', array($this, 'show_notices'));
31
+		add_action('give_dismiss_notices', array($this, 'dismiss_notices'));
32
+		add_action('admin_bar_menu', array($this, 'give_admin_bar_menu'), 1000);
33 33
 	}
34 34
 
35 35
 
@@ -42,18 +42,18 @@  discard block
 block discarded – undo
42 42
 	public function give_admin_bar_menu() {
43 43
 		global $wp_admin_bar;
44 44
 
45
-		if ( ! give_is_test_mode() || ! current_user_can( 'view_give_reports' ) ) {
45
+		if ( ! give_is_test_mode() || ! current_user_can('view_give_reports')) {
46 46
 			return false;
47 47
 		}
48 48
 
49 49
 		//Add the main siteadmin menu item
50
-		$wp_admin_bar->add_menu( array(
50
+		$wp_admin_bar->add_menu(array(
51 51
 			'id'     => 'give-test-notice',
52
-			'href'   => admin_url() . 'edit.php?post_type=give_forms&page=give-settings&tab=gateways',
52
+			'href'   => admin_url().'edit.php?post_type=give_forms&page=give-settings&tab=gateways',
53 53
 			'parent' => 'top-secondary',
54
-			'title'  => esc_html__( 'Give Test Mode Active', 'give' ),
55
-			'meta'   => array( 'class' => 'give-test-mode-active' ),
56
-		) );
54
+			'title'  => esc_html__('Give Test Mode Active', 'give'),
55
+			'meta'   => array('class' => 'give-test-mode-active'),
56
+		));
57 57
 
58 58
 	}
59 59
 
@@ -68,98 +68,98 @@  discard block
 block discarded – undo
68 68
 			'error'   => array()
69 69
 		);
70 70
 
71
-		if ( ! give_test_ajax_works() && ! get_user_meta( get_current_user_id(), '_give_admin_ajax_inaccessible_dismissed', true ) && current_user_can( 'manage_give_settings' ) ) {
71
+		if ( ! give_test_ajax_works() && ! get_user_meta(get_current_user_id(), '_give_admin_ajax_inaccessible_dismissed', true) && current_user_can('manage_give_settings')) {
72 72
 			echo '<div class="error">';
73
-			echo '<p>' . esc_html__( 'Your site appears to be blocking the WordPress ajax interface. This may cause issues with Give.', 'give' ) . '</p>';
73
+			echo '<p>'.esc_html__('Your site appears to be blocking the WordPress ajax interface. This may cause issues with Give.', 'give').'</p>';
74 74
 			/* translators: %s: https://givewp.com/documentation/core/troubleshooting/admin-ajax-blocked/ */
75
-			echo '<p>' . sprintf( __( 'Please see <a href="%s" target="_blank">this reference</a> for possible solutions.', 'give' ), esc_url( 'https://givewp.com/documentation/core/troubleshooting/admin-ajax-blocked/' ) ) . '</p>';
76
-			echo '<p><a href="' . add_query_arg( array(
75
+			echo '<p>'.sprintf(__('Please see <a href="%s" target="_blank">this reference</a> for possible solutions.', 'give'), esc_url('https://givewp.com/documentation/core/troubleshooting/admin-ajax-blocked/')).'</p>';
76
+			echo '<p><a href="'.add_query_arg(array(
77 77
 					'give_action' => 'dismiss_notices',
78 78
 					'give_notice' => 'admin_ajax_inaccessible'
79
-				) ) . '">' . esc_attr__( 'Dismiss Notice', 'give' ) . '</a></p>';
79
+				)).'">'.esc_attr__('Dismiss Notice', 'give').'</a></p>';
80 80
 			echo '</div>';
81 81
 		}
82 82
 
83 83
 
84
-		if ( isset( $_GET['give-message'] ) ) {
84
+		if (isset($_GET['give-message'])) {
85 85
 
86 86
 			// Donation reports errors
87
-			if ( current_user_can( 'view_give_reports' ) ) {
88
-				switch ( $_GET['give-message'] ) {
87
+			if (current_user_can('view_give_reports')) {
88
+				switch ($_GET['give-message']) {
89 89
 					case 'payment_deleted' :
90
-						$notices['updated']['give-payment-deleted'] = esc_attr__( 'The payment has been deleted.', 'give' );
90
+						$notices['updated']['give-payment-deleted'] = esc_attr__('The payment has been deleted.', 'give');
91 91
 						break;
92 92
 					case 'email_sent' :
93
-						$notices['updated']['give-payment-sent'] = esc_attr__( 'The donation receipt has been resent.', 'give' );
93
+						$notices['updated']['give-payment-sent'] = esc_attr__('The donation receipt has been resent.', 'give');
94 94
 						break;
95 95
 					case 'refreshed-reports' :
96
-						$notices['updated']['give-refreshed-reports'] = esc_attr__( 'The reports cache has been cleared.', 'give' );
96
+						$notices['updated']['give-refreshed-reports'] = esc_attr__('The reports cache has been cleared.', 'give');
97 97
 						break;
98 98
 					case 'payment-note-deleted' :
99
-						$notices['updated']['give-payment-note-deleted'] = esc_attr__( 'The payment note has been deleted.', 'give' );
99
+						$notices['updated']['give-payment-note-deleted'] = esc_attr__('The payment note has been deleted.', 'give');
100 100
 						break;
101 101
 				}
102 102
 			}
103 103
 
104 104
 			// Give settings notices and errors
105
-			if ( current_user_can( 'manage_give_settings' ) ) {
106
-				switch ( $_GET['give-message'] ) {
105
+			if (current_user_can('manage_give_settings')) {
106
+				switch ($_GET['give-message']) {
107 107
 					case 'settings-imported' :
108
-						$notices['updated']['give-settings-imported'] = esc_attr__( 'The settings have been imported.', 'give' );
108
+						$notices['updated']['give-settings-imported'] = esc_attr__('The settings have been imported.', 'give');
109 109
 						break;
110 110
 					case 'api-key-generated' :
111
-						$notices['updated']['give-api-key-generated'] = esc_attr__( 'API keys successfully generated.', 'give' );
111
+						$notices['updated']['give-api-key-generated'] = esc_attr__('API keys successfully generated.', 'give');
112 112
 						break;
113 113
 					case 'api-key-exists' :
114
-						$notices['error']['give-api-key-exists'] = esc_attr__( 'The specified user already has API keys.', 'give' );
114
+						$notices['error']['give-api-key-exists'] = esc_attr__('The specified user already has API keys.', 'give');
115 115
 						break;
116 116
 					case 'api-key-regenerated' :
117
-						$notices['updated']['give-api-key-regenerated'] = esc_attr__( 'API keys successfully regenerated.', 'give' );
117
+						$notices['updated']['give-api-key-regenerated'] = esc_attr__('API keys successfully regenerated.', 'give');
118 118
 						break;
119 119
 					case 'api-key-revoked' :
120
-						$notices['updated']['give-api-key-revoked'] = esc_attr__( 'API keys successfully revoked.', 'give' );
120
+						$notices['updated']['give-api-key-revoked'] = esc_attr__('API keys successfully revoked.', 'give');
121 121
 						break;
122 122
 					case 'sent-test-email' :
123
-						$notices['updated']['give-sent-test-email'] = esc_attr__( 'The test email has been sent.', 'give' );
123
+						$notices['updated']['give-sent-test-email'] = esc_attr__('The test email has been sent.', 'give');
124 124
 						break;
125 125
 				}
126 126
 			}
127 127
 			// Payments errors
128
-			if ( current_user_can( 'edit_give_payments' ) ) {
129
-				switch ( $_GET['give-message'] ) {
128
+			if (current_user_can('edit_give_payments')) {
129
+				switch ($_GET['give-message']) {
130 130
 					case 'note-added' :
131
-						$notices['updated']['give-note-added'] = esc_attr__( 'The payment note has been added successfully.', 'give' );
131
+						$notices['updated']['give-note-added'] = esc_attr__('The payment note has been added successfully.', 'give');
132 132
 						break;
133 133
 					case 'payment-updated' :
134
-						$notices['updated']['give-payment-updated'] = esc_attr__( 'The payment has been successfully updated.', 'give' );
134
+						$notices['updated']['give-payment-updated'] = esc_attr__('The payment has been successfully updated.', 'give');
135 135
 						break;
136 136
 				}
137 137
 			}
138 138
 
139 139
 			// Customer Notices
140
-			if ( current_user_can( 'edit_give_payments' ) ) {
141
-				switch ( $_GET['give-message'] ) {
140
+			if (current_user_can('edit_give_payments')) {
141
+				switch ($_GET['give-message']) {
142 142
 					case 'customer-deleted' :
143
-						$notices['updated']['give-customer-deleted'] = esc_attr__( 'Donor successfully deleted.', 'give' );
143
+						$notices['updated']['give-customer-deleted'] = esc_attr__('Donor successfully deleted.', 'give');
144 144
 						break;
145 145
 				}
146 146
 			}
147 147
 
148 148
 		}
149 149
 
150
-		if ( count( $notices['updated'] ) > 0 ) {
151
-			foreach ( $notices['updated'] as $notice => $message ) {
152
-				add_settings_error( 'give-notices', $notice, $message, 'updated' );
150
+		if (count($notices['updated']) > 0) {
151
+			foreach ($notices['updated'] as $notice => $message) {
152
+				add_settings_error('give-notices', $notice, $message, 'updated');
153 153
 			}
154 154
 		}
155 155
 
156
-		if ( count( $notices['error'] ) > 0 ) {
157
-			foreach ( $notices['error'] as $notice => $message ) {
158
-				add_settings_error( 'give-notices', $notice, $message, 'error' );
156
+		if (count($notices['error']) > 0) {
157
+			foreach ($notices['error'] as $notice => $message) {
158
+				add_settings_error('give-notices', $notice, $message, 'error');
159 159
 			}
160 160
 		}
161 161
 
162
-		settings_errors( 'give-notices' );
162
+		settings_errors('give-notices');
163 163
 
164 164
 	}
165 165
 
@@ -171,8 +171,8 @@  discard block
 block discarded – undo
171 171
 	 * @return void
172 172
 	 */
173 173
 	function give_admin_addons_notices() {
174
-		add_settings_error( 'give-notices', 'give-addons-feed-error', esc_attr__( 'There seems to be an issue with the server. Please try again in a few minutes.', 'give' ), 'error' );
175
-		settings_errors( 'give-notices' );
174
+		add_settings_error('give-notices', 'give-addons-feed-error', esc_attr__('There seems to be an issue with the server. Please try again in a few minutes.', 'give'), 'error');
175
+		settings_errors('give-notices');
176 176
 	}
177 177
 
178 178
 
@@ -183,9 +183,9 @@  discard block
 block discarded – undo
183 183
 	 * @return void
184 184
 	 */
185 185
 	function dismiss_notices() {
186
-		if ( isset( $_GET['give_notice'] ) ) {
187
-			update_user_meta( get_current_user_id(), '_give_' . $_GET['give_notice'] . '_dismissed', 1 );
188
-			wp_redirect( remove_query_arg( array( 'give_action', 'give_notice' ) ) );
186
+		if (isset($_GET['give_notice'])) {
187
+			update_user_meta(get_current_user_id(), '_give_'.$_GET['give_notice'].'_dismissed', 1);
188
+			wp_redirect(remove_query_arg(array('give_action', 'give_notice')));
189 189
 			exit;
190 190
 		}
191 191
 	}
Please login to merge, or discard this patch.
includes/admin/welcome.php 1 patch
Spacing   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 // Exit if accessed directly
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit;
16 16
 }
17 17
 
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
 	 * @since 1.0
36 36
 	 */
37 37
 	public function __construct() {
38
-		add_action( 'admin_menu', array( $this, 'admin_menus' ) );
39
-		add_action( 'admin_head', array( $this, 'admin_head' ) );
40
-		add_action( 'admin_init', array( $this, 'welcome' ) );
38
+		add_action('admin_menu', array($this, 'admin_menus'));
39
+		add_action('admin_head', array($this, 'admin_head'));
40
+		add_action('admin_init', array($this, 'welcome'));
41 41
 	}
42 42
 
43 43
 	/**
@@ -51,38 +51,38 @@  discard block
 block discarded – undo
51 51
 	public function admin_menus() {
52 52
 		// About Page
53 53
 		add_dashboard_page(
54
-			esc_html__( 'Welcome to Give', 'give' ),
55
-			esc_html__( 'Welcome to Give', 'give' ),
54
+			esc_html__('Welcome to Give', 'give'),
55
+			esc_html__('Welcome to Give', 'give'),
56 56
 			$this->minimum_capability,
57 57
 			'give-about',
58
-			array( $this, 'about_screen' )
58
+			array($this, 'about_screen')
59 59
 		);
60 60
 
61 61
 		// Changelog Page
62 62
 		add_dashboard_page(
63
-			esc_html__( 'Give Changelog', 'give' ),
64
-			esc_html__( 'Give Changelog', 'give' ),
63
+			esc_html__('Give Changelog', 'give'),
64
+			esc_html__('Give Changelog', 'give'),
65 65
 			$this->minimum_capability,
66 66
 			'give-changelog',
67
-			array( $this, 'changelog_screen' )
67
+			array($this, 'changelog_screen')
68 68
 		);
69 69
 
70 70
 		// Getting Started Page
71 71
 		add_dashboard_page(
72
-			esc_html__( 'Getting started with Give', 'give' ),
73
-			esc_html__( 'Getting started with Give', 'give' ),
72
+			esc_html__('Getting started with Give', 'give'),
73
+			esc_html__('Getting started with Give', 'give'),
74 74
 			$this->minimum_capability,
75 75
 			'give-getting-started',
76
-			array( $this, 'getting_started_screen' )
76
+			array($this, 'getting_started_screen')
77 77
 		);
78 78
 
79 79
 		// Credits Page
80 80
 		add_dashboard_page(
81
-			esc_html__( 'The people that build Give', 'give' ),
82
-			esc_html__( 'The people that build Give', 'give' ),
81
+			esc_html__('The people that build Give', 'give'),
82
+			esc_html__('The people that build Give', 'give'),
83 83
 			$this->minimum_capability,
84 84
 			'give-credits',
85
-			array( $this, 'credits_screen' )
85
+			array($this, 'credits_screen')
86 86
 		);
87 87
 	}
88 88
 
@@ -95,13 +95,13 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	public function admin_head() {
97 97
 
98
-		remove_submenu_page( 'index.php', 'give-about' );
99
-		remove_submenu_page( 'index.php', 'give-changelog' );
100
-		remove_submenu_page( 'index.php', 'give-getting-started' );
101
-		remove_submenu_page( 'index.php', 'give-credits' );
98
+		remove_submenu_page('index.php', 'give-about');
99
+		remove_submenu_page('index.php', 'give-changelog');
100
+		remove_submenu_page('index.php', 'give-getting-started');
101
+		remove_submenu_page('index.php', 'give-credits');
102 102
 
103 103
 		// Badge for welcome page
104
-		$badge_url = GIVE_PLUGIN_URL . 'assets/images/give-badge.png';
104
+		$badge_url = GIVE_PLUGIN_URL.'assets/images/give-badge.png';
105 105
 
106 106
 		?>
107 107
 		<style type="text/css" media="screen">
@@ -215,20 +215,20 @@  discard block
 block discarded – undo
215 215
 	 * @return void
216 216
 	 */
217 217
 	public function tabs() {
218
-		$selected = isset( $_GET['page'] ) ? $_GET['page'] : 'give-about';
218
+		$selected = isset($_GET['page']) ? $_GET['page'] : 'give-about';
219 219
 		?>
220 220
 		<h2 class="nav-tab-wrapper">
221
-			<a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-about' ), 'index.php' ) ) ); ?>">
222
-				<?php esc_html_e( 'About Give', 'give' ); ?>
221
+			<a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-about'), 'index.php'))); ?>">
222
+				<?php esc_html_e('About Give', 'give'); ?>
223 223
 			</a>
224
-			<a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-getting-started' ), 'index.php' ) ) ); ?>">
225
-				<?php esc_html_e( 'Getting Started', 'give' ); ?>
224
+			<a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-getting-started'), 'index.php'))); ?>">
225
+				<?php esc_html_e('Getting Started', 'give'); ?>
226 226
 			</a>
227
-			<a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-credits' ), 'index.php' ) ) ); ?>">
228
-				<?php esc_html_e( 'Credits', 'give' ); ?>
227
+			<a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-credits'), 'index.php'))); ?>">
228
+				<?php esc_html_e('Credits', 'give'); ?>
229 229
 			</a>
230
-			<a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( null, 'index.php' ) ) . 'edit.php?post_type=give_forms&page=give-addons'; ?>">
231
-				<?php esc_html_e( 'Add-ons', 'give' ); ?>
230
+			<a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(null, 'index.php')).'edit.php?post_type=give_forms&page=give-addons'; ?>">
231
+				<?php esc_html_e('Add-ons', 'give'); ?>
232 232
 			</a>
233 233
 		</h2>
234 234
 	<?php
@@ -242,13 +242,13 @@  discard block
 block discarded – undo
242 242
 	 * @return void
243 243
 	 */
244 244
 	public function about_screen() {
245
-		list( $display_version ) = explode( '-', GIVE_VERSION );
245
+		list($display_version) = explode('-', GIVE_VERSION);
246 246
 		?>
247 247
 		<div class="wrap about-wrap">
248 248
 			<h1 class="welcome-h1"><?php
249 249
 				printf(
250 250
 					/* translators: %s: Give version */
251
-					esc_html__( 'Welcome to Give %s', 'give' ),
251
+					esc_html__('Welcome to Give %s', 'give'),
252 252
 					$display_version
253 253
 				);
254 254
 			?></h1>
@@ -258,20 +258,20 @@  discard block
 block discarded – undo
258 258
 			<p class="about-text"><?php
259 259
 				printf(
260 260
 					/* translators: 1: https://givewp.com/documenation/ 2: title attribute text */
261
-					__( 'Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. </You>We encourage you to check out the <a href="%1$s" title="%2$s" target="_blank">plugin documentation</a> and getting started guide below.', 'give' ),
262
-					esc_url( 'https://givewp.com/documenation/' ),
263
-					esc_attr__( 'View the Give plugin documentation online', 'give' )
261
+					__('Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. </You>We encourage you to check out the <a href="%1$s" title="%2$s" target="_blank">plugin documentation</a> and getting started guide below.', 'give'),
262
+					esc_url('https://givewp.com/documenation/'),
263
+					esc_attr__('View the Give plugin documentation online', 'give')
264 264
 				);
265 265
 			?></p>
266 266
 
267
-			<p class="newsletter-intro"><?php esc_html_e( 'Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give' ); ?></p>
267
+			<p class="newsletter-intro"><?php esc_html_e('Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give'); ?></p>
268 268
 
269 269
 			<?php give_get_newsletter() ?>
270 270
 
271 271
 			<div class="give-badge"><?php
272 272
 				printf(
273 273
 					/* translators: %s: Give version */
274
-					esc_html__( 'Version %s', 'give' ),
274
+					esc_html__('Version %s', 'give'),
275 275
 					$display_version
276 276
 				);
277 277
 			?></div>
@@ -281,15 +281,15 @@  discard block
 block discarded – undo
281 281
 			<div class="feature-section clearfix introduction">
282 282
 
283 283
 				<div class="video feature-section-item">
284
-					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-form-mockup.png' ?>" title="A Give donation form" alt="A Give donation form">
284
+					<img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-form-mockup.png' ?>" title="A Give donation form" alt="A Give donation form">
285 285
 
286 286
 				</div>
287 287
 
288 288
 				<div class="content feature-section-item last-feature">
289 289
 
290
-					<h3><?php esc_html_e( 'Give - Democratizing Generosity', 'give' ); ?></h3>
290
+					<h3><?php esc_html_e('Give - Democratizing Generosity', 'give'); ?></h3>
291 291
 
292
-					<p><?php esc_html_e( 'Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give' ); ?></p>
292
+					<p><?php esc_html_e('Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give'); ?></p>
293 293
 					<a href="https://givewp.com" target="_blank" class="button-secondary" title="Visit the Give Website">Learn More
294 294
 						<span class="dashicons dashicons-external"></span></a>
295 295
 
@@ -302,9 +302,9 @@  discard block
 block discarded – undo
302 302
 
303 303
 				<div class="content feature-section-item">
304 304
 
305
-					<h3><?php esc_html_e( 'Getting to Know Give', 'give' ); ?></h3>
305
+					<h3><?php esc_html_e('Getting to Know Give', 'give'); ?></h3>
306 306
 
307
-					<p><?php esc_html_e( 'Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have an question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give' ); ?></p>
307
+					<p><?php esc_html_e('Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have an question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give'); ?></p>
308 308
 					<a href="https://givewp.com/documentation" target="_blank" class="button-secondary" title="Visit the Give Website">View Documentation
309 309
 						<span class="dashicons dashicons-external"></span></a>
310 310
 
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 
313 313
 				<div class="content  feature-section-item last-feature">
314 314
 
315
-					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-logo-photo-mashup.png' ?>" title="Give" alt="Give">
315
+					<img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-logo-photo-mashup.png' ?>" title="Give" alt="Give">
316 316
 
317 317
 				</div>
318 318
 
@@ -332,22 +332,22 @@  discard block
 block discarded – undo
332 332
 	 * @return void
333 333
 	 */
334 334
 	public function changelog_screen() {
335
-		list( $display_version ) = explode( '-', GIVE_VERSION );
335
+		list($display_version) = explode('-', GIVE_VERSION);
336 336
 		?>
337 337
 		<div class="wrap about-wrap">
338
-			<h1><?php esc_html_e( 'Give Changelog', 'give' ); ?></h1>
338
+			<h1><?php esc_html_e('Give Changelog', 'give'); ?></h1>
339 339
 
340 340
 			<p class="about-text"><?php
341 341
 				printf(
342 342
 					/* translators: %s: Give version */
343
-					esc_html__( 'Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give' ),
343
+					esc_html__('Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give'),
344 344
 					$display_version
345 345
 				);
346 346
 			?></p>
347 347
 			<div class="give-badge"><?php
348 348
 				printf(
349 349
 					/* translators: %s: Give version */
350
-					esc_html__( 'Version %s', 'give' ),
350
+					esc_html__('Version %s', 'give'),
351 351
 					$display_version
352 352
 				);
353 353
 			?></div>
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 			<?php $this->tabs(); ?>
356 356
 
357 357
 			<div class="changelog">
358
-				<h3><?php esc_html_e( 'Full Changelog', 'give' ); ?></h3>
358
+				<h3><?php esc_html_e('Full Changelog', 'give'); ?></h3>
359 359
 
360 360
 				<div class="feature-section">
361 361
 					<?php echo $this->parse_readme(); ?>
@@ -363,10 +363,10 @@  discard block
 block discarded – undo
363 363
 			</div>
364 364
 
365 365
 			<div class="return-to-dashboard">
366
-				<a href="<?php echo esc_url( admin_url( add_query_arg( array(
366
+				<a href="<?php echo esc_url(admin_url(add_query_arg(array(
367 367
 					'post_type' => 'give_forms',
368 368
 					'page'      => 'give-settings'
369
-				), 'edit.php' ) ) ); ?>"><?php esc_html_e( 'Go to Give Settings', 'give' ); ?></a>
369
+				), 'edit.php'))); ?>"><?php esc_html_e('Go to Give Settings', 'give'); ?></a>
370 370
 			</div>
371 371
 		</div>
372 372
 	<?php
@@ -380,45 +380,45 @@  discard block
 block discarded – undo
380 380
 	 * @return void
381 381
 	 */
382 382
 	public function getting_started_screen() {
383
-		list( $display_version ) = explode( '-', GIVE_VERSION );
383
+		list($display_version) = explode('-', GIVE_VERSION);
384 384
 		?>
385 385
 		<div class="wrap about-wrap get-started">
386 386
 			<h1 class="welcome-h1"><?php
387 387
 				printf(
388 388
 					/* translators: %s: Give version */
389
-					esc_html__( 'Give %s - Getting Started Guide', 'give' ),
389
+					esc_html__('Give %s - Getting Started Guide', 'give'),
390 390
 					$display_version
391 391
 				);
392 392
 			?></h1>
393 393
 
394 394
 			<?php give_social_media_elements() ?>
395 395
 
396
-			<p class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></p>
396
+			<p class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></p>
397 397
 
398
-			<p class="newsletter-intro"><?php esc_html_e( 'Don\'t forget to sign up for the newsletter!', 'give' ); ?>.</p>
398
+			<p class="newsletter-intro"><?php esc_html_e('Don\'t forget to sign up for the newsletter!', 'give'); ?>.</p>
399 399
 
400 400
 			<?php give_get_newsletter() ?>
401 401
 
402 402
 			<div class="give-badge"><?php
403 403
 				printf(
404 404
 					/* translators: %s: Give version */
405
-					esc_html__( 'Version %s', 'give' ),
405
+					esc_html__('Version %s', 'give'),
406 406
 					$display_version
407 407
 				);
408 408
 			?></div>
409 409
 
410 410
 			<?php $this->tabs(); ?>
411 411
 
412
-			<p class="about-text"><?php printf( esc_html__( 'Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give' ), $display_version ); ?></p>
412
+			<p class="about-text"><?php printf(esc_html__('Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give'), $display_version); ?></p>
413 413
 
414 414
 			<div class="feature-section clearfix">
415 415
 
416 416
 				<div class="content feature-section-item">
417
-					<h3><?php esc_html_e( 'STEP 1: Create a New Form', 'give' ); ?></h3>
417
+					<h3><?php esc_html_e('STEP 1: Create a New Form', 'give'); ?></h3>
418 418
 
419
-					<p><?php esc_html_e( 'Give is driven by it\'s powerful form building features. But it is not simply a "form". From the "Add New Form" page you\'ll be able to choose how and where you want to receive your donations. You\'ll be able to set the donation amounts. You even get to choose whether you want to create a whole page for your form, or embed it on a different page of your site.', 'give' ); ?></p>
419
+					<p><?php esc_html_e('Give is driven by it\'s powerful form building features. But it is not simply a "form". From the "Add New Form" page you\'ll be able to choose how and where you want to receive your donations. You\'ll be able to set the donation amounts. You even get to choose whether you want to create a whole page for your form, or embed it on a different page of your site.', 'give'); ?></p>
420 420
 
421
-					<p><?php esc_html_e( 'But all of these features begin simply by going to the menu and choosing "Add New Form."', 'give' ); ?></p>
421
+					<p><?php esc_html_e('But all of these features begin simply by going to the menu and choosing "Add New Form."', 'give'); ?></p>
422 422
 				</div>
423 423
 
424 424
 				<div class="content feature-section-item last-feature">
@@ -435,9 +435,9 @@  discard block
 block discarded – undo
435 435
 				</div>
436 436
 
437 437
 				<div class="content feature-section-item last-feature">
438
-					<h3><?php esc_html_e( 'STEP 2: Choose Your Levels', 'give' ); ?></h3>
438
+					<h3><?php esc_html_e('STEP 2: Choose Your Levels', 'give'); ?></h3>
439 439
 
440
-					<p><?php esc_html_e( 'Each Form can be set to receive either a pre-determined amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the levels section where you can add as many levels as you like with your own custom names and amounts.', 'give' ); ?></p>
440
+					<p><?php esc_html_e('Each Form can be set to receive either a pre-determined amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the levels section where you can add as many levels as you like with your own custom names and amounts.', 'give'); ?></p>
441 441
 				</div>
442 442
 
443 443
 			</div>
@@ -446,11 +446,11 @@  discard block
 block discarded – undo
446 446
 			<div class="feature-section clearfix">
447 447
 
448 448
 				<div class="content feature-section-item add-content">
449
-					<h3><?php esc_html_e( 'STEP 3: Landing Page or Shortcode Mode?', 'give' ); ?></h3>
449
+					<h3><?php esc_html_e('STEP 3: Landing Page or Shortcode Mode?', 'give'); ?></h3>
450 450
 
451
-					<p><?php esc_html_e( 'Every form you create in Give can either become it\'s own stand-alone page, or it can be inserted into any other page or post throughout your site as a Shortcode.', 'give' ); ?></p>
451
+					<p><?php esc_html_e('Every form you create in Give can either become it\'s own stand-alone page, or it can be inserted into any other page or post throughout your site as a Shortcode.', 'give'); ?></p>
452 452
 
453
-					<p><?php esc_html_e( 'You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the Donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give' ); ?></p>
453
+					<p><?php esc_html_e('You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the Donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give'); ?></p>
454 454
 				</div>
455 455
 
456 456
 				<div class="content feature-section-item last-feature">
@@ -467,9 +467,9 @@  discard block
 block discarded – undo
467 467
 				</div>
468 468
 
469 469
 				<div class="content feature-section-item last-feature">
470
-					<h3><?php esc_html_e( 'STEP 4: Configure Your Display Options', 'give' ); ?></h3>
470
+					<h3><?php esc_html_e('STEP 4: Configure Your Display Options', 'give'); ?></h3>
471 471
 
472
-					<p><?php esc_html_e( 'Lastly, you can present the form in a lot of different ways. With the "Display Options" section you can configure how the credit card field appears, the submit button text, which Gateway you want to use, whether Guests (non-logged in users) can donate or not, and a log-in form.', 'give' ); ?></p>
472
+					<p><?php esc_html_e('Lastly, you can present the form in a lot of different ways. With the "Display Options" section you can configure how the credit card field appears, the submit button text, which Gateway you want to use, whether Guests (non-logged in users) can donate or not, and a log-in form.', 'give'); ?></p>
473 473
 				</div>
474 474
 
475 475
 
@@ -489,38 +489,38 @@  discard block
 block discarded – undo
489 489
 	 * @return void
490 490
 	 */
491 491
 	public function credits_screen() {
492
-		list( $display_version ) = explode( '-', GIVE_VERSION );
492
+		list($display_version) = explode('-', GIVE_VERSION);
493 493
 		?>
494 494
 		<div class="wrap about-wrap">
495 495
 			<h1 class="welcome-h1"><?php
496 496
 				printf(
497 497
 					/* translators: %s: Give version */
498
-					esc_html__( 'Give %s - Credits', 'give' ),
498
+					esc_html__('Give %s - Credits', 'give'),
499 499
 					$display_version
500 500
 				);
501 501
 			?></h1>
502 502
 
503 503
 			<?php give_social_media_elements() ?>
504 504
 
505
-			<p class="about-text"><?php esc_html_e( 'Thanks to all those who have contributed code directly or indirectly. ', 'give' ); ?></p>
505
+			<p class="about-text"><?php esc_html_e('Thanks to all those who have contributed code directly or indirectly. ', 'give'); ?></p>
506 506
 
507
-			<p class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></p>
507
+			<p class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></p>
508 508
 
509
-			<p class="newsletter-intro"><?php esc_html_e( 'Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give' ); ?></p>
509
+			<p class="newsletter-intro"><?php esc_html_e('Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give'); ?></p>
510 510
 
511 511
 			<?php give_get_newsletter() ?>
512 512
 
513 513
 			<div class="give-badge"><?php
514 514
 				printf(
515 515
 					/* translators: %s: Give version */
516
-					esc_html__( 'Version %s', 'give' ),
516
+					esc_html__('Version %s', 'give'),
517 517
 					$display_version
518 518
 				);
519 519
 			?></div>
520 520
 
521 521
 			<?php $this->tabs(); ?>
522 522
 
523
-			<p class="about-description"><?php printf( __( 'Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give' ), esc_url( 'https://github.com/WordImpress/give' ) ); ?></p>
523
+			<p class="about-description"><?php printf(__('Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give'), esc_url('https://github.com/WordImpress/give')); ?></p>
524 524
 
525 525
 			<?php echo $this->contributors(); ?>
526 526
 		</div>
@@ -535,21 +535,21 @@  discard block
 block discarded – undo
535 535
 	 * @return string $readme HTML formatted readme file
536 536
 	 */
537 537
 	public function parse_readme() {
538
-		$file = file_exists( GIVE_PLUGIN_DIR . 'readme.txt' ) ? GIVE_PLUGIN_DIR . 'readme.txt' : null;
538
+		$file = file_exists(GIVE_PLUGIN_DIR.'readme.txt') ? GIVE_PLUGIN_DIR.'readme.txt' : null;
539 539
 
540
-		if ( ! $file ) {
541
-			$readme = '<p>' . esc_html__( 'No valid changlog was found.', 'give' ) . '</p>';
540
+		if ( ! $file) {
541
+			$readme = '<p>'.esc_html__('No valid changlog was found.', 'give').'</p>';
542 542
 		} else {
543
-			$readme = file_get_contents( $file );
544
-			$readme = nl2br( esc_html( $readme ) );
545
-			$readme = explode( '== Changelog ==', $readme );
546
-			$readme = end( $readme );
547
-
548
-			$readme = preg_replace( '/`(.*?)`/', '<code>\\1</code>', $readme );
549
-			$readme = preg_replace( '/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme );
550
-			$readme = preg_replace( '/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme );
551
-			$readme = preg_replace( '/= (.*?) =/', '<h4>\\1</h4>', $readme );
552
-			$readme = preg_replace( '/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme );
543
+			$readme = file_get_contents($file);
544
+			$readme = nl2br(esc_html($readme));
545
+			$readme = explode('== Changelog ==', $readme);
546
+			$readme = end($readme);
547
+
548
+			$readme = preg_replace('/`(.*?)`/', '<code>\\1</code>', $readme);
549
+			$readme = preg_replace('/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme);
550
+			$readme = preg_replace('/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme);
551
+			$readme = preg_replace('/= (.*?) =/', '<h4>\\1</h4>', $readme);
552
+			$readme = preg_replace('/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme);
553 553
 		}
554 554
 
555 555
 		return $readme;
@@ -566,27 +566,27 @@  discard block
 block discarded – undo
566 566
 	public function contributors() {
567 567
 		$contributors = $this->get_contributors();
568 568
 
569
-		if ( empty( $contributors ) ) {
569
+		if (empty($contributors)) {
570 570
 			return '';
571 571
 		}
572 572
 
573 573
 		$contributor_list = '<ul class="wp-people-group">';
574 574
 
575
-		foreach ( $contributors as $contributor ) {
575
+		foreach ($contributors as $contributor) {
576 576
 			$contributor_list .= '<li class="wp-person">';
577
-			$contributor_list .= sprintf( '<a href="%s" title="%s">',
578
-				esc_url( 'https://github.com/' . $contributor->login ),
577
+			$contributor_list .= sprintf('<a href="%s" title="%s">',
578
+				esc_url('https://github.com/'.$contributor->login),
579 579
 				esc_html(
580 580
 					sprintf(
581 581
 						/* translators: %s: github contributor */
582
-						esc_html__( 'View %s', 'give' ),
582
+						esc_html__('View %s', 'give'),
583 583
 						$contributor->login
584 584
 					)
585 585
 				)
586 586
 			);
587
-			$contributor_list .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $contributor->avatar_url ), esc_html( $contributor->login ) );
587
+			$contributor_list .= sprintf('<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url($contributor->avatar_url), esc_html($contributor->login));
588 588
 			$contributor_list .= '</a>';
589
-			$contributor_list .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/' . $contributor->login ), esc_html( $contributor->login ) );
589
+			$contributor_list .= sprintf('<a class="web" href="%s">%s</a>', esc_url('https://github.com/'.$contributor->login), esc_html($contributor->login));
590 590
 			$contributor_list .= '</a>';
591 591
 			$contributor_list .= '</li>';
592 592
 		}
@@ -604,25 +604,25 @@  discard block
 block discarded – undo
604 604
 	 * @return array $contributors List of contributors
605 605
 	 */
606 606
 	public function get_contributors() {
607
-		$contributors = get_transient( 'give_contributors' );
607
+		$contributors = get_transient('give_contributors');
608 608
 
609
-		if ( false !== $contributors ) {
609
+		if (false !== $contributors) {
610 610
 			return $contributors;
611 611
 		}
612 612
 
613
-		$response = wp_remote_get( 'https://api.github.com/repos/WordImpress/Give/contributors', array( 'sslverify' => false ) );
613
+		$response = wp_remote_get('https://api.github.com/repos/WordImpress/Give/contributors', array('sslverify' => false));
614 614
 
615
-		if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
615
+		if (is_wp_error($response) || 200 != wp_remote_retrieve_response_code($response)) {
616 616
 			return array();
617 617
 		}
618 618
 
619
-		$contributors = json_decode( wp_remote_retrieve_body( $response ) );
619
+		$contributors = json_decode(wp_remote_retrieve_body($response));
620 620
 
621
-		if ( ! is_array( $contributors ) ) {
621
+		if ( ! is_array($contributors)) {
622 622
 			return array();
623 623
 		}
624 624
 
625
-		set_transient( 'give_contributors', $contributors, 3600 );
625
+		set_transient('give_contributors', $contributors, 3600);
626 626
 
627 627
 		return $contributors;
628 628
 	}
@@ -641,24 +641,24 @@  discard block
 block discarded – undo
641 641
 
642 642
 
643 643
 		// Bail if no activation redirect
644
-		if ( ! get_transient( '_give_activation_redirect' ) ) {
644
+		if ( ! get_transient('_give_activation_redirect')) {
645 645
 			return;
646 646
 		}
647 647
 
648 648
 		// Delete the redirect transient
649
-		delete_transient( '_give_activation_redirect' );
649
+		delete_transient('_give_activation_redirect');
650 650
 
651 651
 		// Bail if activating from network, or bulk
652
-		if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
652
+		if (is_network_admin() || isset($_GET['activate-multi'])) {
653 653
 			return;
654 654
 		}
655 655
 
656
-		$upgrade = get_option( 'give_version_upgraded_from' );
656
+		$upgrade = get_option('give_version_upgraded_from');
657 657
 
658
-		if ( ! $upgrade ) { // First time install
659
-			wp_safe_redirect( admin_url( 'index.php?page=give-about' ) );
658
+		if ( ! $upgrade) { // First time install
659
+			wp_safe_redirect(admin_url('index.php?page=give-about'));
660 660
 			exit;
661
-		} elseif( isset( $give_options['disable_welcome'] ) ) { // Welcome is disabled in settings
661
+		} elseif (isset($give_options['disable_welcome'])) { // Welcome is disabled in settings
662 662
 
663 663
 		} else { // Welcome is NOT disabled in settings
664 664
 			wp_safe_redirect(admin_url('index.php?page=give-about'));
Please login to merge, or discard this patch.
includes/admin/payments/view-order-details.php 1 patch
Spacing   +128 added lines, -128 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -20,27 +20,27 @@  discard block
 block discarded – undo
20 20
  * @since 1.0
21 21
  * @return void
22 22
  */
23
-if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) {
24
-	wp_die( esc_html__( 'Donation ID not supplied. Please try again.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) );
23
+if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) {
24
+	wp_die(esc_html__('Donation ID not supplied. Please try again.', 'give'), esc_html__('Error', 'give'), array('response' => 400));
25 25
 }
26 26
 
27 27
 // Setup the variables
28
-$payment_id = absint( $_GET['id'] );
29
-$payment    = new Give_Payment( $payment_id );
28
+$payment_id = absint($_GET['id']);
29
+$payment    = new Give_Payment($payment_id);
30 30
 
31 31
 // Sanity check... fail if purchase ID is invalid
32 32
 $payment_exists = $payment->ID;
33
-if ( empty( $payment_exists ) ) {
34
-	wp_die( esc_html__( 'The specified ID does not belong to a payment. Please try again.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) );
33
+if (empty($payment_exists)) {
34
+	wp_die(esc_html__('The specified ID does not belong to a payment. Please try again.', 'give'), esc_html__('Error', 'give'), array('response' => 400));
35 35
 }
36 36
 
37 37
 $number         = $payment->number;
38 38
 $payment_meta   = $payment->get_meta();
39
-$transaction_id = esc_attr( $payment->transaction_id );
39
+$transaction_id = esc_attr($payment->transaction_id);
40 40
 $user_id        = $payment->user_id;
41 41
 $customer_id    = $payment->customer_id;
42
-$payment_date   = strtotime( $payment->date );
43
-$user_info      = give_get_payment_meta_user_info( $payment_id );
42
+$payment_date   = strtotime($payment->date);
43
+$user_info      = give_get_payment_meta_user_info($payment_id);
44 44
 $address        = $payment->address;
45 45
 $gateway        = $payment->gateway;
46 46
 $currency_code  = $payment->currency;
@@ -53,75 +53,75 @@  discard block
 block discarded – undo
53 53
 	<h1 id="transaction-details-heading"><?php
54 54
 		printf(
55 55
 		/* translators: %s: payment number */
56
-			esc_html__( 'Payment %s', 'give' ),
56
+			esc_html__('Payment %s', 'give'),
57 57
 			$number
58 58
 		);
59
-		if ( $payment_mode == 'test' ) {
60
-			echo '<span id="test-payment-label" class="give-item-label give-item-label-orange" data-tooltip="' . esc_attr__( 'This payment was made in Test Mode', 'give' ) . '" data-tooltip-my-position="center left" data-tooltip-target-position="center right">' . esc_html__( 'Test Payment', 'give' ) . '</span>';
59
+		if ($payment_mode == 'test') {
60
+			echo '<span id="test-payment-label" class="give-item-label give-item-label-orange" data-tooltip="'.esc_attr__('This payment was made in Test Mode', 'give').'" data-tooltip-my-position="center left" data-tooltip-target-position="center right">'.esc_html__('Test Payment', 'give').'</span>';
61 61
 		}
62 62
 		?></h1>
63 63
 
64
-	<?php do_action( 'give_view_order_details_before', $payment_id ); ?>
64
+	<?php do_action('give_view_order_details_before', $payment_id); ?>
65 65
 	<form id="give-edit-order-form" method="post">
66
-		<?php do_action( 'give_view_order_details_form_top', $payment_id ); ?>
66
+		<?php do_action('give_view_order_details_form_top', $payment_id); ?>
67 67
 		<div id="poststuff">
68 68
 			<div id="give-dashboard-widgets-wrap">
69 69
 				<div id="post-body" class="metabox-holder columns-2">
70 70
 					<div id="postbox-container-1" class="postbox-container">
71 71
 						<div id="side-sortables" class="meta-box-sortables ui-sortable">
72 72
 
73
-							<?php do_action( 'give_view_order_details_sidebar_before', $payment_id ); ?>
73
+							<?php do_action('give_view_order_details_sidebar_before', $payment_id); ?>
74 74
 
75 75
 							<div id="give-order-update" class="postbox give-order-data">
76 76
 
77 77
 								<h3 class="hndle">
78
-									<span><?php esc_html_e( 'Update Payment', 'give' ); ?></span>
78
+									<span><?php esc_html_e('Update Payment', 'give'); ?></span>
79 79
 								</h3>
80 80
 
81 81
 								<div class="inside">
82 82
 									<div class="give-admin-box">
83 83
 
84
-										<?php do_action( 'give_view_order_details_totals_before', $payment_id ); ?>
84
+										<?php do_action('give_view_order_details_totals_before', $payment_id); ?>
85 85
 
86 86
 										<div class="give-admin-box-inside">
87 87
 											<p>
88
-												<span class="label"><?php esc_html_e( 'Status:', 'give' ); ?></span>&nbsp;
88
+												<span class="label"><?php esc_html_e('Status:', 'give'); ?></span>&nbsp;
89 89
 												<select name="give-payment-status" class="medium-text">
90
-													<?php foreach ( give_get_payment_statuses() as $key => $status ) : ?>
91
-														<option value="<?php echo esc_attr( $key ); ?>"<?php selected( $payment->status, $key, true ); ?>><?php echo esc_html( $status ); ?></option>
90
+													<?php foreach (give_get_payment_statuses() as $key => $status) : ?>
91
+														<option value="<?php echo esc_attr($key); ?>"<?php selected($payment->status, $key, true); ?>><?php echo esc_html($status); ?></option>
92 92
 													<?php endforeach; ?>
93 93
 												</select>
94
-												<span class="give-donation-status status-<?php echo sanitize_title( $payment->status ); ?>"><span class="give-donation-status-icon"></span></span>
94
+												<span class="give-donation-status status-<?php echo sanitize_title($payment->status); ?>"><span class="give-donation-status-icon"></span></span>
95 95
 											</p>
96 96
 										</div>
97 97
 
98 98
 										<div class="give-admin-box-inside">
99 99
 											<p>
100
-												<span class="label"><?php esc_html_e( 'Date:', 'give' ); ?></span>&nbsp;
101
-												<input type="text" name="give-payment-date" value="<?php echo esc_attr( date( 'm/d/Y', $payment_date ) ); ?>" class="medium-text give_datepicker"/>
100
+												<span class="label"><?php esc_html_e('Date:', 'give'); ?></span>&nbsp;
101
+												<input type="text" name="give-payment-date" value="<?php echo esc_attr(date('m/d/Y', $payment_date)); ?>" class="medium-text give_datepicker"/>
102 102
 											</p>
103 103
 										</div>
104 104
 
105 105
 										<div class="give-admin-box-inside">
106 106
 											<p>
107
-												<span class="label"><?php esc_html_e( 'Time:', 'give' ); ?></span>&nbsp;
108
-												<input type="number" step="1" max="24" name="give-payment-time-hour" value="<?php echo esc_attr( date_i18n( 'H', $payment_date ) ); ?>" class="small-text give-payment-time-hour"/>&nbsp;:&nbsp;
109
-												<input type="number" step="1" max="59" name="give-payment-time-min" value="<?php echo esc_attr( date( 'i', $payment_date ) ); ?>" class="small-text give-payment-time-min"/>
107
+												<span class="label"><?php esc_html_e('Time:', 'give'); ?></span>&nbsp;
108
+												<input type="number" step="1" max="24" name="give-payment-time-hour" value="<?php echo esc_attr(date_i18n('H', $payment_date)); ?>" class="small-text give-payment-time-hour"/>&nbsp;:&nbsp;
109
+												<input type="number" step="1" max="59" name="give-payment-time-min" value="<?php echo esc_attr(date('i', $payment_date)); ?>" class="small-text give-payment-time-min"/>
110 110
 											</p>
111 111
 										</div>
112 112
 
113
-										<?php do_action( 'give_view_order_details_update_inner', $payment_id ); ?>
113
+										<?php do_action('give_view_order_details_update_inner', $payment_id); ?>
114 114
 
115 115
 										<?php
116 116
 										//@TODO: Fees
117
-										$fees = give_get_payment_fees( $payment_id );
118
-										if ( ! empty( $fees ) ) : ?>
117
+										$fees = give_get_payment_fees($payment_id);
118
+										if ( ! empty($fees)) : ?>
119 119
 											<div class="give-order-fees give-admin-box-inside">
120
-												<p class="strong"><?php esc_html_e( 'Fees', 'give' ); ?>:</p>
120
+												<p class="strong"><?php esc_html_e('Fees', 'give'); ?>:</p>
121 121
 												<ul class="give-payment-fees">
122
-													<?php foreach ( $fees as $fee ) : ?>
122
+													<?php foreach ($fees as $fee) : ?>
123 123
 														<li>
124
-															<span class="fee-label"><?php echo $fee['label'] . ':</span> ' . '<span class="fee-amount" data-fee="' . esc_attr( $fee['amount'] ) . '">' . give_currency_filter( $fee['amount'], $currency_code ); ?></span>
124
+															<span class="fee-label"><?php echo $fee['label'].':</span> '.'<span class="fee-amount" data-fee="'.esc_attr($fee['amount']).'">'.give_currency_filter($fee['amount'], $currency_code); ?></span>
125 125
 														</li>
126 126
 													<?php endforeach; ?>
127 127
 												</ul>
@@ -131,12 +131,12 @@  discard block
 block discarded – undo
131 131
 
132 132
 										<div class="give-order-payment give-admin-box-inside">
133 133
 											<p>
134
-												<span class="label"><?php esc_html_e( 'Total Donation', 'give' ); ?>:</span>&nbsp;
135
-												<?php echo give_currency_symbol( $payment->currency ); ?>&nbsp;<input name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr( give_format_decimal( give_get_payment_amount( $payment_id ) ) ); ?>"/>
134
+												<span class="label"><?php esc_html_e('Total Donation', 'give'); ?>:</span>&nbsp;
135
+												<?php echo give_currency_symbol($payment->currency); ?>&nbsp;<input name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr(give_format_decimal(give_get_payment_amount($payment_id))); ?>"/>
136 136
 											</p>
137 137
 										</div>
138 138
 
139
-										<?php do_action( 'give_view_order_details_totals_after', $payment_id ); ?>
139
+										<?php do_action('give_view_order_details_totals_after', $payment_id); ?>
140 140
 
141 141
 									</div>
142 142
 									<!-- /.give-admin-box -->
@@ -145,20 +145,20 @@  discard block
 block discarded – undo
145 145
 								<!-- /.inside -->
146 146
 
147 147
 								<div class="give-order-update-box give-admin-box">
148
-									<?php do_action( 'give_view_order_details_update_before', $payment_id ); ?>
148
+									<?php do_action('give_view_order_details_update_before', $payment_id); ?>
149 149
 									<div id="major-publishing-actions">
150 150
 										<div id="publishing-action">
151
-											<input type="submit" class="button button-primary right" value="<?php esc_attr_e( 'Save Payment', 'give' ); ?>"/>
152
-											<?php if ( give_is_payment_complete( $payment_id ) ) : ?>
153
-												<a href="<?php echo esc_url( add_query_arg( array(
151
+											<input type="submit" class="button button-primary right" value="<?php esc_attr_e('Save Payment', 'give'); ?>"/>
152
+											<?php if (give_is_payment_complete($payment_id)) : ?>
153
+												<a href="<?php echo esc_url(add_query_arg(array(
154 154
 													'give-action' => 'email_links',
155 155
 													'purchase_id' => $payment_id
156
-												) ) ); ?>" id="give-resend-receipt" class="button-secondary right"><?php esc_html_e( 'Resend Receipt', 'give' ); ?></a>
156
+												))); ?>" id="give-resend-receipt" class="button-secondary right"><?php esc_html_e('Resend Receipt', 'give'); ?></a>
157 157
 											<?php endif; ?>
158 158
 										</div>
159 159
 										<div class="clear"></div>
160 160
 									</div>
161
-									<?php do_action( 'give_view_order_details_update_after', $payment_id ); ?>
161
+									<?php do_action('give_view_order_details_update_after', $payment_id); ?>
162 162
 								</div>
163 163
 								<!-- /.give-order-update-box -->
164 164
 
@@ -168,55 +168,55 @@  discard block
 block discarded – undo
168 168
 							<div id="give-order-details" class="postbox give-order-data">
169 169
 
170 170
 								<h3 class="hndle">
171
-									<span><?php esc_html_e( 'Payment Meta', 'give' ); ?></span>
171
+									<span><?php esc_html_e('Payment Meta', 'give'); ?></span>
172 172
 								</h3>
173 173
 
174 174
 								<div class="inside">
175 175
 									<div class="give-admin-box">
176 176
 
177
-										<?php do_action( 'give_view_order_details_payment_meta_before', $payment_id ); ?>
177
+										<?php do_action('give_view_order_details_payment_meta_before', $payment_id); ?>
178 178
 
179 179
 										<?php
180
-										$gateway = give_get_payment_gateway( $payment_id );
181
-										if ( $gateway ) : ?>
180
+										$gateway = give_get_payment_gateway($payment_id);
181
+										if ($gateway) : ?>
182 182
 											<div class="give-order-gateway give-admin-box-inside">
183 183
 												<p>
184
-													<span class="label"><?php esc_html_e( 'Gateway:', 'give' ); ?></span>&nbsp;
185
-													<?php echo give_get_gateway_admin_label( $gateway ); ?>
184
+													<span class="label"><?php esc_html_e('Gateway:', 'give'); ?></span>&nbsp;
185
+													<?php echo give_get_gateway_admin_label($gateway); ?>
186 186
 												</p>
187 187
 											</div>
188 188
 										<?php endif; ?>
189 189
 
190 190
 										<div class="give-order-payment-key give-admin-box-inside">
191 191
 											<p>
192
-												<span class="label"><?php esc_html_e( 'Key:', 'give' ); ?></span>&nbsp;
193
-												<span><?php echo give_get_payment_key( $payment_id ); ?></span>
192
+												<span class="label"><?php esc_html_e('Key:', 'give'); ?></span>&nbsp;
193
+												<span><?php echo give_get_payment_key($payment_id); ?></span>
194 194
 											</p>
195 195
 										</div>
196 196
 
197 197
 										<div class="give-order-ip give-admin-box-inside">
198 198
 											<p>
199
-												<span class="label"><?php esc_html_e( 'IP:', 'give' ); ?></span>&nbsp;
200
-												<span><?php echo esc_html( give_get_payment_user_ip( $payment_id ) ); ?></span>
199
+												<span class="label"><?php esc_html_e('IP:', 'give'); ?></span>&nbsp;
200
+												<span><?php echo esc_html(give_get_payment_user_ip($payment_id)); ?></span>
201 201
 											</p>
202 202
 										</div>
203 203
 
204
-										<?php if ( $transaction_id ) : ?>
204
+										<?php if ($transaction_id) : ?>
205 205
 											<div class="give-order-tx-id give-admin-box-inside">
206 206
 												<p>
207
-													<span class="label"><?php esc_html_e( 'Transaction ID:', 'give' ); ?></span>&nbsp;
208
-													<span><?php echo apply_filters( 'give_payment_details_transaction_id-' . $gateway, $transaction_id, $payment_id ); ?></span>
207
+													<span class="label"><?php esc_html_e('Transaction ID:', 'give'); ?></span>&nbsp;
208
+													<span><?php echo apply_filters('give_payment_details_transaction_id-'.$gateway, $transaction_id, $payment_id); ?></span>
209 209
 												</p>
210 210
 											</div>
211 211
 										<?php endif; ?>
212 212
 
213 213
 										<div class="give-admin-box-inside">
214
-											<p><?php $purchase_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( esc_attr( give_get_payment_user_email( $payment_id ) ) ) ); ?>
215
-												<a href="<?php echo $purchase_url; ?>"><?php esc_html_e( 'View all donations for this donor &raquo;', 'give' ); ?></a>
214
+											<p><?php $purchase_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history&user='.urlencode(esc_attr(give_get_payment_user_email($payment_id)))); ?>
215
+												<a href="<?php echo $purchase_url; ?>"><?php esc_html_e('View all donations for this donor &raquo;', 'give'); ?></a>
216 216
 											</p>
217 217
 										</div>
218 218
 
219
-										<?php do_action( 'give_view_order_details_payment_meta_after', $payment_id ); ?>
219
+										<?php do_action('give_view_order_details_payment_meta_after', $payment_id); ?>
220 220
 
221 221
 									</div>
222 222
 									<!-- /.column-container -->
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 							</div>
228 228
 							<!-- /#give-order-data -->
229 229
 
230
-							<?php do_action( 'give_view_order_details_sidebar_after', $payment_id ); ?>
230
+							<?php do_action('give_view_order_details_sidebar_after', $payment_id); ?>
231 231
 
232 232
 						</div>
233 233
 						<!-- /#side-sortables -->
@@ -238,12 +238,12 @@  discard block
 block discarded – undo
238 238
 
239 239
 						<div id="normal-sortables" class="meta-box-sortables ui-sortable">
240 240
 
241
-							<?php do_action( 'give_view_order_details_main_before', $payment_id ); ?>
241
+							<?php do_action('give_view_order_details_main_before', $payment_id); ?>
242 242
 
243 243
 							<?php $column_count = 'columns-3'; ?>
244 244
 							<div id="give-donation-overview" class="postbox <?php echo $column_count; ?>">
245 245
 								<h3 class="hndle">
246
-									<span><?php esc_html_e( 'Donation Information', 'give' ); ?></span>
246
+									<span><?php esc_html_e('Donation Information', 'give'); ?></span>
247 247
 								</h3>
248 248
 
249 249
 								<div class="inside">
@@ -251,31 +251,31 @@  discard block
 block discarded – undo
251 251
 									<table style="width:100%;">
252 252
 										<thead>
253 253
 										<tr>
254
-											<?php do_action( 'give_donation_details_thead_before', $payment_id ); ?>
255
-											<th><?php esc_html_e( 'Donation Form ID', 'give' ) ?></th>
256
-											<th><?php esc_html_e( 'Donation Form Title', 'give' ) ?></th>
257
-											<th><?php esc_html_e( 'Donation Level', 'give' ) ?></th>
258
-											<th><?php esc_html_e( 'Donation Date', 'give' ) ?></th>
259
-											<th><?php esc_html_e( 'Total Donation', 'give' ) ?></th>
260
-											<?php do_action( 'give_donation_details_thead_after', $payment_id ); ?>
254
+											<?php do_action('give_donation_details_thead_before', $payment_id); ?>
255
+											<th><?php esc_html_e('Donation Form ID', 'give') ?></th>
256
+											<th><?php esc_html_e('Donation Form Title', 'give') ?></th>
257
+											<th><?php esc_html_e('Donation Level', 'give') ?></th>
258
+											<th><?php esc_html_e('Donation Date', 'give') ?></th>
259
+											<th><?php esc_html_e('Total Donation', 'give') ?></th>
260
+											<?php do_action('give_donation_details_thead_after', $payment_id); ?>
261 261
 										</tr>
262 262
 										</thead>
263 263
 										<tr>
264
-											<?php do_action( 'give_donation_details_tbody_before', $payment_id ); ?>
264
+											<?php do_action('give_donation_details_tbody_before', $payment_id); ?>
265 265
 											<td>
266 266
 												<?php echo $payment_meta['form_id']; ?>
267 267
 											</td>
268 268
 											<td>
269
-												<?php give_get_form_dropdown( array(
269
+												<?php give_get_form_dropdown(array(
270 270
 													'id'       => $payment_meta['form_id'],
271 271
 													'selected' => $payment_meta['form_id'],
272 272
 													'chosen'   => true
273
-												), true ); ?>
273
+												), true); ?>
274 274
 											</td>
275 275
 											<td>
276 276
 												<?php
277
-												if ( empty( give_has_variable_prices( $payment_meta['form_id'] ) ) ) {
278
-													echo esc_html__( 'n/a', 'give' );
277
+												if (empty(give_has_variable_prices($payment_meta['form_id']))) {
278
+													echo esc_html__('n/a', 'give');
279 279
 												} else {
280 280
 													// Variable price dropdown options.
281 281
 													$variable_price_dropdown_option = array(
@@ -287,20 +287,20 @@  discard block
 block discarded – undo
287 287
 													);
288 288
 
289 289
 													// Render variable prices select tag html.
290
-													give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true );
290
+													give_get_form_variable_price_dropdown($variable_price_dropdown_option, true);
291 291
 												}
292 292
 												?>
293 293
 											</td>
294 294
 											<td>
295 295
 												<?php
296 296
 												//Transaction Date
297
-												$date_format = get_option( 'date_format' );
298
-												echo date_i18n( $date_format, strtotime( $payment_date ) );
297
+												$date_format = get_option('date_format');
298
+												echo date_i18n($date_format, strtotime($payment_date));
299 299
 												?>
300 300
 											</td>
301 301
 											<td>
302
-												<?php echo esc_html( give_currency_filter( give_format_amount( give_get_payment_amount( $payment_id ) ) ) ); ?></td>
303
-											<?php do_action( 'give_donation_details_tbody_after', $payment_id ); ?>
302
+												<?php echo esc_html(give_currency_filter(give_format_amount(give_get_payment_amount($payment_id)))); ?></td>
303
+											<?php do_action('give_donation_details_tbody_after', $payment_id); ?>
304 304
 
305 305
 										</tr>
306 306
 									</table>
@@ -312,64 +312,64 @@  discard block
 block discarded – undo
312 312
 							</div>
313 313
 							<!-- /#give-donation-overview -->
314 314
 
315
-							<?php do_action( 'give_view_order_details_files_after', $payment_id ); ?>
315
+							<?php do_action('give_view_order_details_files_after', $payment_id); ?>
316 316
 
317
-							<?php do_action( 'give_view_order_details_billing_before', $payment_id ); ?>
317
+							<?php do_action('give_view_order_details_billing_before', $payment_id); ?>
318 318
 
319 319
 
320 320
 							<div id="give-customer-details" class="postbox">
321 321
 								<h3 class="hndle">
322
-									<span><?php esc_html_e( 'Donor Details', 'give' ); ?></span>
322
+									<span><?php esc_html_e('Donor Details', 'give'); ?></span>
323 323
 								</h3>
324 324
 
325 325
 								<div class="inside give-clearfix">
326 326
 
327
-									<?php $customer = new Give_Customer( $customer_id ); ?>
327
+									<?php $customer = new Give_Customer($customer_id); ?>
328 328
 
329 329
 									<div class="column-container customer-info">
330 330
 										<div class="column">
331
-											<?php echo Give()->html->donor_dropdown( array(
331
+											<?php echo Give()->html->donor_dropdown(array(
332 332
 												'selected' => $customer->id,
333 333
 												'name'     => 'customer-id'
334
-											) ); ?>
334
+											)); ?>
335 335
 										</div>
336 336
 										<div class="column">
337 337
 											<input type="hidden" name="give-current-customer" value="<?php echo $customer->id; ?>"/>
338 338
 										</div>
339 339
 										<div class="column">
340
-											<?php if ( ! empty( $customer->id ) ) : ?>
341
-												<?php $customer_url = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $customer->id ); ?>
342
-												<a href="<?php echo $customer_url; ?>" title="<?php esc_attr_e( 'View Donor Details', 'give' ); ?>"><?php esc_html_e( 'View Donor Details', 'give' ); ?></a>
340
+											<?php if ( ! empty($customer->id)) : ?>
341
+												<?php $customer_url = admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$customer->id); ?>
342
+												<a href="<?php echo $customer_url; ?>" title="<?php esc_attr_e('View Donor Details', 'give'); ?>"><?php esc_html_e('View Donor Details', 'give'); ?></a>
343 343
 												&nbsp;|&nbsp;
344 344
 											<?php endif; ?>
345
-											<a href="#new" class="give-payment-new-customer" title="<?php esc_attr_e( 'New Donor', 'give' ); ?>"><?php esc_html_e( 'New Donor', 'give' ); ?></a>
345
+											<a href="#new" class="give-payment-new-customer" title="<?php esc_attr_e('New Donor', 'give'); ?>"><?php esc_html_e('New Donor', 'give'); ?></a>
346 346
 										</div>
347 347
 									</div>
348 348
 
349 349
 									<div class="column-container new-customer" style="display: none">
350 350
 										<div class="column">
351
-											<label for="give-new-customer-name"><?php esc_html_e( 'Name:', 'give' ); ?></label>&nbsp;
351
+											<label for="give-new-customer-name"><?php esc_html_e('Name:', 'give'); ?></label>&nbsp;
352 352
 											<input id="give-new-customer-name" type="text" name="give-new-customer-name" value="" class="medium-text"/>
353 353
 										</div>
354 354
 										<div class="column">
355
-											<label for="give-new-customer-email"><?php esc_html_e( 'Email:', 'give' ); ?></label>&nbsp;
355
+											<label for="give-new-customer-email"><?php esc_html_e('Email:', 'give'); ?></label>&nbsp;
356 356
 											<input id="give-new-customer-email" type="email" name="give-new-customer-email" value="" class="medium-text"/>
357 357
 										</div>
358 358
 										<div class="column">
359 359
 											<input type="hidden" id="give-new-customer" name="give-new-customer" value="0"/>
360
-											<a href="#cancel" class="give-payment-new-customer-cancel give-delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a>
360
+											<a href="#cancel" class="give-payment-new-customer-cancel give-delete"><?php esc_html_e('Cancel', 'give'); ?></a>
361 361
 										</div>
362 362
 										<div class="column">
363 363
 											<small>
364
-												<em>*<?php esc_html_e( 'Click "Save Payment" to create new donor', 'give' ); ?></em>
364
+												<em>*<?php esc_html_e('Click "Save Payment" to create new donor', 'give'); ?></em>
365 365
 											</small>
366 366
 										</div>
367 367
 									</div>
368 368
 
369 369
 									<?php
370 370
 									// The give_payment_personal_details_list hook is left here for backwards compatibility
371
-									do_action( 'give_payment_personal_details_list', $payment_meta, $user_info );
372
-									do_action( 'give_payment_view_details', $payment_id );
371
+									do_action('give_payment_personal_details_list', $payment_meta, $user_info);
372
+									do_action('give_payment_view_details', $payment_id);
373 373
 									?>
374 374
 
375 375
 								</div>
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
 
381 381
 							<div id="give-billing-details" class="postbox">
382 382
 								<h3 class="hndle">
383
-									<span><?php esc_html_e( 'Billing Address', 'give' ); ?></span>
383
+									<span><?php esc_html_e('Billing Address', 'give'); ?></span>
384 384
 								</h3>
385 385
 
386 386
 								<div class="inside give-clearfix">
@@ -391,62 +391,62 @@  discard block
 block discarded – undo
391 391
 											<div class="data column-container">
392 392
 												<div class="column">
393 393
 													<div class="give-wrap-address-line1">
394
-														<label for="give-payment-address-line1" class="order-data-address"><?php esc_html_e( 'Street Address Line 1:', 'give' ); ?></label>
395
-														<input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr( $address['line1'] ); ?>" class="medium-text"/>
394
+														<label for="give-payment-address-line1" class="order-data-address"><?php esc_html_e('Street Address Line 1:', 'give'); ?></label>
395
+														<input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr($address['line1']); ?>" class="medium-text"/>
396 396
 													</div>
397 397
 
398 398
 													<div class="give-wrap-address-line2">
399
-														<label for="give-payment-address-line2" class="order-data-address-line"><?php esc_html_e( 'Street Address Line 2:', 'give' ); ?></label>
400
-														<input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr( $address['line2'] ); ?>" class="medium-text"/>
399
+														<label for="give-payment-address-line2" class="order-data-address-line"><?php esc_html_e('Street Address Line 2:', 'give'); ?></label>
400
+														<input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr($address['line2']); ?>" class="medium-text"/>
401 401
 													</div>
402 402
 
403 403
 												</div>
404 404
 												<div class="column">
405 405
 													<div class="give-wrap-address-city">
406
-														<label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e( 'City:', 'give' ); ?></label>
407
-														<input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr( $address['city'] ); ?>" class="medium-text"/>
406
+														<label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e('City:', 'give'); ?></label>
407
+														<input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr($address['city']); ?>" class="medium-text"/>
408 408
 
409 409
 													</div>
410 410
 
411 411
 													<div class="give-wrap-address-zip">
412
-														<label for="give-payment-address-zip" class="order-data-address-line"><?php esc_html_e( 'Zip / Postal Code:', 'give' ); ?></label>
413
-														<input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr( $address['zip'] ); ?>" class="medium-text"/>
412
+														<label for="give-payment-address-zip" class="order-data-address-line"><?php esc_html_e('Zip / Postal Code:', 'give'); ?></label>
413
+														<input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr($address['zip']); ?>" class="medium-text"/>
414 414
 
415 415
 													</div>
416 416
 												</div>
417 417
 												<div class="column">
418 418
 													<div id="give-order-address-country-wrap">
419
-														<label class="order-data-address-line"><?php esc_html_e( 'Country:', 'give' ); ?></label>
419
+														<label class="order-data-address-line"><?php esc_html_e('Country:', 'give'); ?></label>
420 420
 														<?php
421
-														echo Give()->html->select( array(
421
+														echo Give()->html->select(array(
422 422
 															'options'          => give_get_country_list(),
423 423
 															'name'             => 'give-payment-address[0][country]',
424 424
 															'selected'         => $address['country'],
425 425
 															'show_option_all'  => false,
426 426
 															'show_option_none' => false,
427 427
 															'chosen'           => true,
428
-															'placeholder'      => esc_attr__( 'Select a country', 'give' )
429
-														) );
428
+															'placeholder'      => esc_attr__('Select a country', 'give')
429
+														));
430 430
 														?>
431 431
 													</div>
432 432
 
433 433
 													<div id="give-order-address-state-wrap">
434
-														<label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e( 'State / Province:', 'give' ); ?></label>
434
+														<label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e('State / Province:', 'give'); ?></label>
435 435
 														<?php
436
-														$states = give_get_states( $address['country'] );
437
-														if ( ! empty( $states ) ) {
438
-															echo Give()->html->select( array(
436
+														$states = give_get_states($address['country']);
437
+														if ( ! empty($states)) {
438
+															echo Give()->html->select(array(
439 439
 																'options'          => $states,
440 440
 																'name'             => 'give-payment-address[0][state]',
441 441
 																'selected'         => $address['state'],
442 442
 																'show_option_all'  => false,
443 443
 																'show_option_none' => false,
444 444
 																'chosen'           => true,
445
-																'placeholder'      => esc_attr__( 'Select a state', 'give' )
446
-															) );
445
+																'placeholder'      => esc_attr__('Select a state', 'give')
446
+															));
447 447
 														} else {
448 448
 															?>
449
-															<input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr( $address['state'] ); ?>" class="medium-text"/>
449
+															<input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr($address['state']); ?>" class="medium-text"/>
450 450
 															<?php
451 451
 														} ?>
452 452
 													</div>
@@ -456,38 +456,38 @@  discard block
 block discarded – undo
456 456
 									</div>
457 457
 									<!-- /#give-order-address -->
458 458
 
459
-									<?php do_action( 'give_payment_billing_details', $payment_id ); ?>
459
+									<?php do_action('give_payment_billing_details', $payment_id); ?>
460 460
 
461 461
 								</div>
462 462
 								<!-- /.inside -->
463 463
 							</div>
464 464
 							<!-- /#give-billing-details -->
465 465
 
466
-							<?php do_action( 'give_view_order_details_billing_after', $payment_id ); ?>
466
+							<?php do_action('give_view_order_details_billing_after', $payment_id); ?>
467 467
 
468 468
 							<div id="give-payment-notes" class="postbox">
469
-								<h3 class="hndle"><span><?php esc_html_e( 'Payment Notes', 'give' ); ?></span></h3>
469
+								<h3 class="hndle"><span><?php esc_html_e('Payment Notes', 'give'); ?></span></h3>
470 470
 
471 471
 								<div class="inside">
472 472
 									<div id="give-payment-notes-inner">
473 473
 										<?php
474
-										$notes = give_get_payment_notes( $payment_id );
475
-										if ( ! empty( $notes ) ) :
474
+										$notes = give_get_payment_notes($payment_id);
475
+										if ( ! empty($notes)) :
476 476
 											$no_notes_display = ' style="display:none;"';
477
-											foreach ( $notes as $note ) :
477
+											foreach ($notes as $note) :
478 478
 
479
-												echo give_get_payment_note_html( $note, $payment_id );
479
+												echo give_get_payment_note_html($note, $payment_id);
480 480
 
481 481
 											endforeach;
482 482
 										else :
483 483
 											$no_notes_display = '';
484 484
 										endif;
485
-										echo '<p class="give-no-payment-notes"' . $no_notes_display . '>' . esc_html__( 'No payment notes', 'give' ) . '</p>'; ?>
485
+										echo '<p class="give-no-payment-notes"'.$no_notes_display.'>'.esc_html__('No payment notes', 'give').'</p>'; ?>
486 486
 									</div>
487 487
 									<textarea name="give-payment-note" id="give-payment-note" class="large-text"></textarea>
488 488
 
489 489
 									<div class="give-clearfix">
490
-										<button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint( $payment_id ); ?>"><?php esc_html_e( 'Add Note', 'give' ); ?></button>
490
+										<button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint($payment_id); ?>"><?php esc_html_e('Add Note', 'give'); ?></button>
491 491
 									</div>
492 492
 
493 493
 								</div>
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
 							</div>
496 496
 							<!-- /#give-payment-notes -->
497 497
 
498
-							<?php do_action( 'give_view_order_details_main_after', $payment_id ); ?>
498
+							<?php do_action('give_view_order_details_main_after', $payment_id); ?>
499 499
 						</div>
500 500
 						<!-- /#normal-sortables -->
501 501
 					</div>
@@ -506,10 +506,10 @@  discard block
 block discarded – undo
506 506
 			<!-- #give-dashboard-widgets-wrap -->
507 507
 		</div>
508 508
 		<!-- /#post-stuff -->
509
-		<?php do_action( 'give_view_order_details_form_bottom', $payment_id ); ?>
510
-		<?php wp_nonce_field( 'give_update_payment_details_nonce' ); ?>
511
-		<input type="hidden" name="give_payment_id" value="<?php echo esc_attr( $payment_id ); ?>"/>
509
+		<?php do_action('give_view_order_details_form_bottom', $payment_id); ?>
510
+		<?php wp_nonce_field('give_update_payment_details_nonce'); ?>
511
+		<input type="hidden" name="give_payment_id" value="<?php echo esc_attr($payment_id); ?>"/>
512 512
 		<input type="hidden" name="give_action" value="update_payment_details"/>
513 513
 	</form>
514
-	<?php do_action( 'give_view_order_details_after', $payment_id ); ?>
514
+	<?php do_action('give_view_order_details_after', $payment_id); ?>
515 515
 </div><!-- /.wrap -->
Please login to merge, or discard this patch.
includes/admin/admin-footer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -24,14 +24,14 @@  discard block
 block discarded – undo
24 24
  *
25 25
  * @return      string
26 26
  */
27
-function give_admin_rate_us( $footer_text ) {
27
+function give_admin_rate_us($footer_text) {
28 28
 	global $typenow;
29 29
 
30
-	if ( $typenow == 'give_forms' ) {
30
+	if ($typenow == 'give_forms') {
31 31
 		$rate_text = sprintf(
32 32
 			/* translators: %s: Link to 5 star rating */
33
-			__( 'If you like <strong>Give</strong> please leave us a %s rating. It takes a minute and helps a lot. Thanks in advance!', 'give' ),
34
-			'<a href="https://wordpress.org/support/view/plugin-reviews/give?filter=5#postform" target="_blank" class="give-rating-link" data-rated="' . esc_attr__( 'Thanks :)', 'give' ) . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
33
+			__('If you like <strong>Give</strong> please leave us a %s rating. It takes a minute and helps a lot. Thanks in advance!', 'give'),
34
+			'<a href="https://wordpress.org/support/view/plugin-reviews/give?filter=5#postform" target="_blank" class="give-rating-link" data-rated="'.esc_attr__('Thanks :)', 'give').'">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
35 35
 		);
36 36
 
37 37
 		return $rate_text;
@@ -40,4 +40,4 @@  discard block
 block discarded – undo
40 40
 	}
41 41
 }
42 42
 
43
-add_filter( 'admin_footer_text', 'give_admin_rate_us' );
43
+add_filter('admin_footer_text', 'give_admin_rate_us');
Please login to merge, or discard this patch.
includes/admin/reporting/pdf-reports.php 1 patch
Spacing   +146 added lines, -146 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -25,82 +25,82 @@  discard block
 block discarded – undo
25 25
  *
26 26
  * @uses   give_pdf
27 27
  */
28
-function give_generate_pdf( $data ) {
28
+function give_generate_pdf($data) {
29 29
 
30
-	if ( ! current_user_can( 'view_give_reports' ) ) {
31
-		wp_die( esc_html__( 'You do not have permission to generate PDF sales reports.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
30
+	if ( ! current_user_can('view_give_reports')) {
31
+		wp_die(esc_html__('You do not have permission to generate PDF sales reports.', 'give'), esc_html__('Error', 'give'), array('response' => 403));
32 32
 	}
33 33
 
34
-	if ( ! wp_verify_nonce( $_GET['_wpnonce'], 'give_generate_pdf' ) ) {
35
-		wp_die( esc_html__( 'Nonce verification failed.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
34
+	if ( ! wp_verify_nonce($_GET['_wpnonce'], 'give_generate_pdf')) {
35
+		wp_die(esc_html__('Nonce verification failed.', 'give'), esc_html__('Error', 'give'), array('response' => 403));
36 36
 	}
37 37
 
38
-	require_once GIVE_PLUGIN_DIR . '/includes/libraries/fpdf/fpdf.php';
39
-	require_once GIVE_PLUGIN_DIR . '/includes/libraries/fpdf/give_pdf.php';
38
+	require_once GIVE_PLUGIN_DIR.'/includes/libraries/fpdf/fpdf.php';
39
+	require_once GIVE_PLUGIN_DIR.'/includes/libraries/fpdf/give_pdf.php';
40 40
 
41 41
 	$daterange = utf8_decode(
42 42
 		sprintf(
43 43
 		/* translators: 1: start date 2: end date */
44
-			esc_html__( '%1$s to %2$s', 'give' ),
45
-			date_i18n( get_option( 'date_format' ), mktime( 0, 0, 0, 1, 1, date( 'Y' ) ) ),
46
-			date_i18n( get_option( 'date_format' ) )
44
+			esc_html__('%1$s to %2$s', 'give'),
45
+			date_i18n(get_option('date_format'), mktime(0, 0, 0, 1, 1, date('Y'))),
46
+			date_i18n(get_option('date_format'))
47 47
 		)
48 48
 	);
49 49
 
50 50
 	$pdf = new give_pdf();
51
-	$pdf->AddPage( 'L', 'A4' );
51
+	$pdf->AddPage('L', 'A4');
52 52
 
53
-	$pdf->SetTitle( utf8_decode( __( 'Donation report for the current year for all forms', 'give' ) ) );
54
-	$pdf->SetAuthor( utf8_decode( __( 'Give - Democratizing Generosity', 'give' ) ) );
55
-	$pdf->SetCreator( utf8_decode( __( 'Give - Democratizing Generosity', 'give' ) ) );
53
+	$pdf->SetTitle(utf8_decode(__('Donation report for the current year for all forms', 'give')));
54
+	$pdf->SetAuthor(utf8_decode(__('Give - Democratizing Generosity', 'give')));
55
+	$pdf->SetCreator(utf8_decode(__('Give - Democratizing Generosity', 'give')));
56 56
 
57
-	$pdf->Image( apply_filters( 'give_pdf_export_logo', GIVE_PLUGIN_URL . 'assets/images/give-logo-small.png' ), 247, 8 );
57
+	$pdf->Image(apply_filters('give_pdf_export_logo', GIVE_PLUGIN_URL.'assets/images/give-logo-small.png'), 247, 8);
58 58
 
59
-	$pdf->SetMargins( 8, 8, 8 );
60
-	$pdf->SetX( 8 );
59
+	$pdf->SetMargins(8, 8, 8);
60
+	$pdf->SetX(8);
61 61
 
62
-	$pdf->SetFont( 'Helvetica', '', 16 );
63
-	$pdf->SetTextColor( 50, 50, 50 );
64
-	$pdf->Cell( 0, 3, utf8_decode( __( 'Donation report for the current year for all forms', 'give' ) ), 0, 2, 'L', false );
62
+	$pdf->SetFont('Helvetica', '', 16);
63
+	$pdf->SetTextColor(50, 50, 50);
64
+	$pdf->Cell(0, 3, utf8_decode(__('Donation report for the current year for all forms', 'give')), 0, 2, 'L', false);
65 65
 
66
-	$pdf->SetFont( 'Helvetica', '', 13 );
66
+	$pdf->SetFont('Helvetica', '', 13);
67 67
 	$pdf->Ln();
68
-	$pdf->SetTextColor( 150, 150, 150 );
69
-	$pdf->Cell( 0, 6, utf8_decode( __( 'Date Range: ', 'give' ) ) . $daterange, 0, 2, 'L', false );
68
+	$pdf->SetTextColor(150, 150, 150);
69
+	$pdf->Cell(0, 6, utf8_decode(__('Date Range: ', 'give')).$daterange, 0, 2, 'L', false);
70 70
 	$pdf->Ln();
71
-	$pdf->SetTextColor( 50, 50, 50 );
72
-	$pdf->SetFont( 'Helvetica', '', 14 );
73
-	$pdf->Cell( 0, 10, utf8_decode( __( 'Table View', 'give' ) ), 0, 2, 'L', false );
74
-	$pdf->SetFont( 'Helvetica', '', 12 );
71
+	$pdf->SetTextColor(50, 50, 50);
72
+	$pdf->SetFont('Helvetica', '', 14);
73
+	$pdf->Cell(0, 10, utf8_decode(__('Table View', 'give')), 0, 2, 'L', false);
74
+	$pdf->SetFont('Helvetica', '', 12);
75 75
 
76
-	$pdf->SetFillColor( 238, 238, 238 );
77
-	$pdf->Cell( 70, 6, utf8_decode( __( 'Form Name', 'give' ) ), 1, 0, 'L', true );
78
-	$pdf->Cell( 30, 6, utf8_decode( __( 'Price', 'give' ) ), 1, 0, 'L', true );
79
-	$pdf->Cell( 50, 6, utf8_decode( __( 'Categories', 'give' ) ), 1, 0, 'L', true );
80
-	$pdf->Cell( 50, 6, utf8_decode( __( 'Tags', 'give' ) ), 1, 0, 'L', true );
81
-	$pdf->Cell( 45, 6, utf8_decode( __( 'Number of Donations', 'give' ) ), 1, 0, 'L', true );
82
-	$pdf->Cell( 35, 6, utf8_decode( __( 'Income to Date', 'give' ) ), 1, 1, 'L', true );
76
+	$pdf->SetFillColor(238, 238, 238);
77
+	$pdf->Cell(70, 6, utf8_decode(__('Form Name', 'give')), 1, 0, 'L', true);
78
+	$pdf->Cell(30, 6, utf8_decode(__('Price', 'give')), 1, 0, 'L', true);
79
+	$pdf->Cell(50, 6, utf8_decode(__('Categories', 'give')), 1, 0, 'L', true);
80
+	$pdf->Cell(50, 6, utf8_decode(__('Tags', 'give')), 1, 0, 'L', true);
81
+	$pdf->Cell(45, 6, utf8_decode(__('Number of Donations', 'give')), 1, 0, 'L', true);
82
+	$pdf->Cell(35, 6, utf8_decode(__('Income to Date', 'give')), 1, 1, 'L', true);
83 83
 
84
-	$year       = date( 'Y' );
85
-	$give_forms = get_posts( array( 'post_type' => 'give_forms', 'year' => $year, 'posts_per_page' => - 1 ) );
84
+	$year       = date('Y');
85
+	$give_forms = get_posts(array('post_type' => 'give_forms', 'year' => $year, 'posts_per_page' => -1));
86 86
 
87
-	if ( $give_forms ):
88
-		$pdf->SetWidths( array( 70, 30, 50, 50, 45, 35 ) );
87
+	if ($give_forms):
88
+		$pdf->SetWidths(array(70, 30, 50, 50, 45, 35));
89 89
 
90
-		foreach ( $give_forms as $form ):
91
-			$pdf->SetFillColor( 255, 255, 255 );
90
+		foreach ($give_forms as $form):
91
+			$pdf->SetFillColor(255, 255, 255);
92 92
 
93 93
 			$title = $form->post_title;
94 94
 
95
-			if ( give_has_variable_prices( $form->ID ) ) {
95
+			if (give_has_variable_prices($form->ID)) {
96 96
 
97
-				$prices = give_get_variable_prices( $form->ID );
97
+				$prices = give_get_variable_prices($form->ID);
98 98
 
99 99
 				$first = $prices[0]['_give_amount'];
100
-				$last  = array_pop( $prices );
100
+				$last  = array_pop($prices);
101 101
 				$last  = $last['_give_amount'];
102 102
 
103
-				if ( $first < $last ) {
103
+				if ($first < $last) {
104 104
 					$min = $first;
105 105
 					$max = $last;
106 106
 				} else {
@@ -108,57 +108,57 @@  discard block
 block discarded – undo
108 108
 					$max = $first;
109 109
 				}
110 110
 
111
-				$price = html_entity_decode( give_currency_filter( give_format_amount( $min ) ) . ' - ' . give_currency_filter( give_format_amount( $max ) ) );
111
+				$price = html_entity_decode(give_currency_filter(give_format_amount($min)).' - '.give_currency_filter(give_format_amount($max)));
112 112
 			} else {
113
-				$price = html_entity_decode( give_currency_filter( give_get_form_price( $form->ID ) ) );
113
+				$price = html_entity_decode(give_currency_filter(give_get_form_price($form->ID)));
114 114
 			}
115 115
 
116
-			$categories = get_the_term_list( $form->ID, 'give_forms_category', '', ', ', '' );
117
-			$categories = ! is_wp_error( $categories ) ? strip_tags( $categories ) : '';
116
+			$categories = get_the_term_list($form->ID, 'give_forms_category', '', ', ', '');
117
+			$categories = ! is_wp_error($categories) ? strip_tags($categories) : '';
118 118
 
119
-			$tags = get_the_term_list( $form->ID, 'give_forms_tag', '', ', ', '' );
120
-			$tags = ! is_wp_error( $tags ) ? strip_tags( $tags ) : '';
119
+			$tags = get_the_term_list($form->ID, 'give_forms_tag', '', ', ', '');
120
+			$tags = ! is_wp_error($tags) ? strip_tags($tags) : '';
121 121
 
122
-			$sales    = give_get_form_sales_stats( $form->ID );
123
-			$link     = get_permalink( $form->ID );
124
-			$earnings = html_entity_decode( give_currency_filter( give_get_form_earnings_stats( $form->ID ) ) );
122
+			$sales    = give_get_form_sales_stats($form->ID);
123
+			$link     = get_permalink($form->ID);
124
+			$earnings = html_entity_decode(give_currency_filter(give_get_form_earnings_stats($form->ID)));
125 125
 
126
-			if ( function_exists( 'iconv' ) ) {
126
+			if (function_exists('iconv')) {
127 127
 				// Ensure characters like euro; are properly converted.
128
-				$price    = iconv( 'UTF-8', 'windows-1252', utf8_encode( $price ) );
129
-				$earnings = iconv( 'UTF-8', 'windows-1252', utf8_encode( $earnings ) );
128
+				$price    = iconv('UTF-8', 'windows-1252', utf8_encode($price));
129
+				$earnings = iconv('UTF-8', 'windows-1252', utf8_encode($earnings));
130 130
 			}
131 131
 
132
-			$pdf->Row( array( $title, $price, $categories, $tags, $sales, $earnings ) );
132
+			$pdf->Row(array($title, $price, $categories, $tags, $sales, $earnings));
133 133
 		endforeach;
134 134
 	else:
135
-		$pdf->SetWidths( array( 280 ) );
135
+		$pdf->SetWidths(array(280));
136 136
 		$title = utf8_decode(
137 137
 			sprintf(
138 138
 			/* translators: %s: form plural label */
139
-				esc_html__( 'No %s found.', 'give' ),
139
+				esc_html__('No %s found.', 'give'),
140 140
 				give_get_forms_label_plural()
141 141
 			)
142 142
 		);
143
-		$pdf->Row( array( $title ) );
143
+		$pdf->Row(array($title));
144 144
 	endif;
145 145
 
146 146
 	$pdf->Ln();
147
-	$pdf->SetTextColor( 50, 50, 50 );
148
-	$pdf->SetFont( 'Helvetica', '', 14 );
149
-	$pdf->Cell( 0, 10, utf8_decode( __( 'Graph View', 'give' ) ), 0, 2, 'L', false );
150
-	$pdf->SetFont( 'Helvetica', '', 12 );
151
-
152
-	$image = html_entity_decode( urldecode( give_draw_chart_image() ) );
153
-	$image = str_replace( ' ', '%20', $image );
154
-
155
-	$pdf->SetX( 25 );
156
-	$pdf->Image( $image . '&file=.png' );
157
-	$pdf->Ln( 7 );
158
-	$pdf->Output( apply_filters( 'give_sales_earnings_pdf_export_filename', 'give-report-' . date_i18n( 'Y-m-d' ) ) . '.pdf', 'D' );
147
+	$pdf->SetTextColor(50, 50, 50);
148
+	$pdf->SetFont('Helvetica', '', 14);
149
+	$pdf->Cell(0, 10, utf8_decode(__('Graph View', 'give')), 0, 2, 'L', false);
150
+	$pdf->SetFont('Helvetica', '', 12);
151
+
152
+	$image = html_entity_decode(urldecode(give_draw_chart_image()));
153
+	$image = str_replace(' ', '%20', $image);
154
+
155
+	$pdf->SetX(25);
156
+	$pdf->Image($image.'&file=.png');
157
+	$pdf->Ln(7);
158
+	$pdf->Output(apply_filters('give_sales_earnings_pdf_export_filename', 'give-report-'.date_i18n('Y-m-d')).'.pdf', 'D');
159 159
 }
160 160
 
161
-add_action( 'give_generate_pdf', 'give_generate_pdf' );
161
+add_action('give_generate_pdf', 'give_generate_pdf');
162 162
 
163 163
 /**
164 164
  * Draws Chart for PDF Report.
@@ -175,38 +175,38 @@  discard block
 block discarded – undo
175 175
  * @return string $chart->getUrl() URL for the Google Chart
176 176
  */
177 177
 function give_draw_chart_image() {
178
-	require_once GIVE_PLUGIN_DIR . '/includes/libraries/googlechartlib/GoogleChart.php';
179
-	require_once GIVE_PLUGIN_DIR . '/includes/libraries/googlechartlib/markers/GoogleChartShapeMarker.php';
180
-	require_once GIVE_PLUGIN_DIR . '/includes/libraries/googlechartlib/markers/GoogleChartTextMarker.php';
178
+	require_once GIVE_PLUGIN_DIR.'/includes/libraries/googlechartlib/GoogleChart.php';
179
+	require_once GIVE_PLUGIN_DIR.'/includes/libraries/googlechartlib/markers/GoogleChartShapeMarker.php';
180
+	require_once GIVE_PLUGIN_DIR.'/includes/libraries/googlechartlib/markers/GoogleChartTextMarker.php';
181 181
 
182
-	$chart = new GoogleChart( 'lc', 900, 330 );
182
+	$chart = new GoogleChart('lc', 900, 330);
183 183
 
184 184
 	$i        = 1;
185 185
 	$earnings = "";
186 186
 	$sales    = "";
187 187
 
188
-	while ( $i <= 12 ) :
189
-		$earnings .= give_get_earnings_by_date( null, $i, date( 'Y' ) ) . ",";
190
-		$sales .= give_get_sales_by_date( null, $i, date( 'Y' ) ) . ",";
191
-		$i ++;
188
+	while ($i <= 12) :
189
+		$earnings .= give_get_earnings_by_date(null, $i, date('Y')).",";
190
+		$sales .= give_get_sales_by_date(null, $i, date('Y')).",";
191
+		$i++;
192 192
 	endwhile;
193 193
 
194
-	$earnings_array = explode( ",", $earnings );
195
-	$sales_array    = explode( ",", $sales );
194
+	$earnings_array = explode(",", $earnings);
195
+	$sales_array    = explode(",", $sales);
196 196
 
197 197
 	$i = 0;
198
-	while ( $i <= 11 ) {
199
-		if ( empty( $sales_array[ $i ] ) ) {
200
-			$sales_array[ $i ] = 0;
198
+	while ($i <= 11) {
199
+		if (empty($sales_array[$i])) {
200
+			$sales_array[$i] = 0;
201 201
 		}
202
-		$i ++;
202
+		$i++;
203 203
 	}
204 204
 
205 205
 	$min_earnings   = 0;
206
-	$max_earnings   = max( $earnings_array );
207
-	$earnings_scale = round( $max_earnings, - 1 );
206
+	$max_earnings   = max($earnings_array);
207
+	$earnings_scale = round($max_earnings, - 1);
208 208
 
209
-	$data = new GoogleChartData( array(
209
+	$data = new GoogleChartData(array(
210 210
 		$earnings_array[0],
211 211
 		$earnings_array[1],
212 212
 		$earnings_array[2],
@@ -219,25 +219,25 @@  discard block
 block discarded – undo
219 219
 		$earnings_array[9],
220 220
 		$earnings_array[10],
221 221
 		$earnings_array[11]
222
-	) );
222
+	));
223 223
 
224
-	$data->setLegend( esc_html__( 'Income', 'give' ) );
225
-	$data->setColor( '1b58a3' );
226
-	$chart->addData( $data );
224
+	$data->setLegend(esc_html__('Income', 'give'));
225
+	$data->setColor('1b58a3');
226
+	$chart->addData($data);
227 227
 
228
-	$shape_marker = new GoogleChartShapeMarker( GoogleChartShapeMarker::CIRCLE );
229
-	$shape_marker->setColor( '000000' );
230
-	$shape_marker->setSize( 7 );
231
-	$shape_marker->setBorder( 2 );
232
-	$shape_marker->setData( $data );
233
-	$chart->addMarker( $shape_marker );
228
+	$shape_marker = new GoogleChartShapeMarker(GoogleChartShapeMarker::CIRCLE);
229
+	$shape_marker->setColor('000000');
230
+	$shape_marker->setSize(7);
231
+	$shape_marker->setBorder(2);
232
+	$shape_marker->setData($data);
233
+	$chart->addMarker($shape_marker);
234 234
 
235
-	$value_marker = new GoogleChartTextMarker( GoogleChartTextMarker::VALUE );
236
-	$value_marker->setColor( '000000' );
237
-	$value_marker->setData( $data );
238
-	$chart->addMarker( $value_marker );
235
+	$value_marker = new GoogleChartTextMarker(GoogleChartTextMarker::VALUE);
236
+	$value_marker->setColor('000000');
237
+	$value_marker->setData($data);
238
+	$chart->addMarker($value_marker);
239 239
 
240
-	$data = new GoogleChartData( array(
240
+	$data = new GoogleChartData(array(
241 241
 		$sales_array[0],
242 242
 		$sales_array[1],
243 243
 		$sales_array[2],
@@ -250,46 +250,46 @@  discard block
 block discarded – undo
250 250
 		$sales_array[9],
251 251
 		$sales_array[10],
252 252
 		$sales_array[11]
253
-	) );
254
-	$data->setLegend( esc_html__( 'Donations', 'give' ) );
255
-	$data->setColor( 'ff6c1c' );
256
-	$chart->addData( $data );
257
-
258
-	$chart->setTitle( esc_html__( 'Donations by Month for all Give Forms', 'give' ), '336699', 18 );
259
-
260
-	$chart->setScale( 0, $max_earnings );
261
-
262
-	$y_axis = new GoogleChartAxis( 'y' );
263
-	$y_axis->setDrawTickMarks( true )->setLabels( array( 0, $max_earnings ) );
264
-	$chart->addAxis( $y_axis );
265
-
266
-	$x_axis = new GoogleChartAxis( 'x' );
267
-	$x_axis->setTickMarks( 5 );
268
-	$x_axis->setLabels( array(
269
-		esc_html__( 'Jan', 'give' ),
270
-		esc_html__( 'Feb', 'give' ),
271
-		esc_html__( 'Mar', 'give' ),
272
-		esc_html__( 'Apr', 'give' ),
273
-		esc_html__( 'May', 'give' ),
274
-		esc_html__( 'June', 'give' ),
275
-		esc_html__( 'July', 'give' ),
276
-		esc_html__( 'Aug', 'give' ),
277
-		esc_html__( 'Sept', 'give' ),
278
-		esc_html__( 'Oct', 'give' ),
279
-		esc_html__( 'Nov', 'give' ),
280
-		esc_html__( 'Dec', 'give' )
281
-	) );
282
-	$chart->addAxis( $x_axis );
283
-
284
-	$shape_marker = new GoogleChartShapeMarker( GoogleChartShapeMarker::CIRCLE );
285
-	$shape_marker->setSize( 6 );
286
-	$shape_marker->setBorder( 2 );
287
-	$shape_marker->setData( $data );
288
-	$chart->addMarker( $shape_marker );
289
-
290
-	$value_marker = new GoogleChartTextMarker( GoogleChartTextMarker::VALUE );
291
-	$value_marker->setData( $data );
292
-	$chart->addMarker( $value_marker );
253
+	));
254
+	$data->setLegend(esc_html__('Donations', 'give'));
255
+	$data->setColor('ff6c1c');
256
+	$chart->addData($data);
257
+
258
+	$chart->setTitle(esc_html__('Donations by Month for all Give Forms', 'give'), '336699', 18);
259
+
260
+	$chart->setScale(0, $max_earnings);
261
+
262
+	$y_axis = new GoogleChartAxis('y');
263
+	$y_axis->setDrawTickMarks(true)->setLabels(array(0, $max_earnings));
264
+	$chart->addAxis($y_axis);
265
+
266
+	$x_axis = new GoogleChartAxis('x');
267
+	$x_axis->setTickMarks(5);
268
+	$x_axis->setLabels(array(
269
+		esc_html__('Jan', 'give'),
270
+		esc_html__('Feb', 'give'),
271
+		esc_html__('Mar', 'give'),
272
+		esc_html__('Apr', 'give'),
273
+		esc_html__('May', 'give'),
274
+		esc_html__('June', 'give'),
275
+		esc_html__('July', 'give'),
276
+		esc_html__('Aug', 'give'),
277
+		esc_html__('Sept', 'give'),
278
+		esc_html__('Oct', 'give'),
279
+		esc_html__('Nov', 'give'),
280
+		esc_html__('Dec', 'give')
281
+	));
282
+	$chart->addAxis($x_axis);
283
+
284
+	$shape_marker = new GoogleChartShapeMarker(GoogleChartShapeMarker::CIRCLE);
285
+	$shape_marker->setSize(6);
286
+	$shape_marker->setBorder(2);
287
+	$shape_marker->setData($data);
288
+	$chart->addMarker($shape_marker);
289
+
290
+	$value_marker = new GoogleChartTextMarker(GoogleChartTextMarker::VALUE);
291
+	$value_marker->setData($data);
292
+	$chart->addMarker($value_marker);
293 293
 
294 294
 	return $chart->getUrl();
295 295
 }
Please login to merge, or discard this patch.
includes/admin/reporting/reports.php 1 patch
Spacing   +108 added lines, -108 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  */
17 17
 
18 18
 // Exit if accessed directly
19
-if ( ! defined( 'ABSPATH' ) ) {
19
+if ( ! defined('ABSPATH')) {
20 20
 	exit;
21 21
 }
22 22
 
@@ -29,39 +29,39 @@  discard block
 block discarded – undo
29 29
  * @return void
30 30
  */
31 31
 function give_reports_page() {
32
-	$current_page = admin_url( 'edit.php?post_type=give_forms&page=give-reports' );
33
-	$active_tab   = isset( $_GET['tab'] ) ? $_GET['tab'] : 'reports';
32
+	$current_page = admin_url('edit.php?post_type=give_forms&page=give-reports');
33
+	$active_tab   = isset($_GET['tab']) ? $_GET['tab'] : 'reports';
34 34
 	?>
35 35
 	<div class="wrap">
36 36
 
37
-		<h1 class="screen-reader-text"><?php esc_html_e( 'Give Reports', 'give' ); ?></h1>
37
+		<h1 class="screen-reader-text"><?php esc_html_e('Give Reports', 'give'); ?></h1>
38 38
 
39 39
 		<h2 class="nav-tab-wrapper">
40
-			<a href="<?php echo esc_url( add_query_arg( array(
40
+			<a href="<?php echo esc_url(add_query_arg(array(
41 41
 				'tab'              => 'reports',
42 42
 				'settings-updated' => false
43
-			), $current_page ) ); ?>" class="nav-tab <?php echo $active_tab == 'reports' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'Reports', 'give' ); ?></a>
44
-			<?php if ( current_user_can( 'export_give_reports' ) ) { ?>
45
-				<a href="<?php echo esc_url( add_query_arg( array(
43
+			), $current_page)); ?>" class="nav-tab <?php echo $active_tab == 'reports' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e('Reports', 'give'); ?></a>
44
+			<?php if (current_user_can('export_give_reports')) { ?>
45
+				<a href="<?php echo esc_url(add_query_arg(array(
46 46
 					'tab'              => 'export',
47 47
 					'settings-updated' => false
48
-				), $current_page ) ); ?>" class="nav-tab <?php echo $active_tab == 'export' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'Export', 'give' ); ?></a>
48
+				), $current_page)); ?>" class="nav-tab <?php echo $active_tab == 'export' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e('Export', 'give'); ?></a>
49 49
 			<?php } ?>
50
-			<a href="<?php echo esc_url( add_query_arg( array(
50
+			<a href="<?php echo esc_url(add_query_arg(array(
51 51
 				'tab'              => 'logs',
52 52
 				'settings-updated' => false
53
-			), $current_page ) ); ?>" class="nav-tab <?php echo $active_tab == 'logs' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'Logs', 'give' ); ?></a>
54
-			<a href="<?php echo esc_url( add_query_arg( array(
53
+			), $current_page)); ?>" class="nav-tab <?php echo $active_tab == 'logs' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e('Logs', 'give'); ?></a>
54
+			<a href="<?php echo esc_url(add_query_arg(array(
55 55
 				'tab'              => 'tools',
56 56
 				'settings-updated' => false
57
-			), $current_page ) ); ?>" class="nav-tab <?php echo $active_tab == 'tools' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'Tools', 'give' ); ?></a>
58
-			<?php do_action( 'give_reports_tabs' ); ?>
57
+			), $current_page)); ?>" class="nav-tab <?php echo $active_tab == 'tools' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e('Tools', 'give'); ?></a>
58
+			<?php do_action('give_reports_tabs'); ?>
59 59
 		</h2>
60 60
 
61 61
 		<?php
62
-		do_action( 'give_reports_page_top' );
63
-		do_action( 'give_reports_tab_' . $active_tab );
64
-		do_action( 'give_reports_page_bottom' );
62
+		do_action('give_reports_page_top');
63
+		do_action('give_reports_tab_'.$active_tab);
64
+		do_action('give_reports_page_bottom');
65 65
 		?>
66 66
 	</div><!-- .wrap -->
67 67
 	<?php
@@ -75,13 +75,13 @@  discard block
 block discarded – undo
75 75
  */
76 76
 function give_reports_default_views() {
77 77
 	$views = array(
78
-		'earnings' => esc_html__( 'Income', 'give' ),
78
+		'earnings' => esc_html__('Income', 'give'),
79 79
 		'forms'    => give_get_forms_label_plural(),
80
-		'donors'   => esc_html__( 'Donors', 'give' ),
81
-		'gateways' => esc_html__( 'Payment Methods', 'give' )
80
+		'donors'   => esc_html__('Donors', 'give'),
81
+		'gateways' => esc_html__('Payment Methods', 'give')
82 82
 	);
83 83
 
84
-	$views = apply_filters( 'give_report_views', $views );
84
+	$views = apply_filters('give_report_views', $views);
85 85
 
86 86
 	return $views;
87 87
 }
@@ -97,15 +97,15 @@  discard block
 block discarded – undo
97 97
  * @return string $view Report View
98 98
  *
99 99
  */
100
-function give_get_reporting_view( $default = 'earnings' ) {
100
+function give_get_reporting_view($default = 'earnings') {
101 101
 
102
-	if ( ! isset( $_GET['view'] ) || ! in_array( $_GET['view'], array_keys( give_reports_default_views() ) ) ) {
102
+	if ( ! isset($_GET['view']) || ! in_array($_GET['view'], array_keys(give_reports_default_views()))) {
103 103
 		$view = $default;
104 104
 	} else {
105 105
 		$view = $_GET['view'];
106 106
 	}
107 107
 
108
-	return apply_filters( 'give_get_reporting_view', $view );
108
+	return apply_filters('give_get_reporting_view', $view);
109 109
 }
110 110
 
111 111
 /**
@@ -118,14 +118,14 @@  discard block
 block discarded – undo
118 118
 	$current_view = 'earnings';
119 119
 	$views        = give_reports_default_views();
120 120
 
121
-	if ( isset( $_GET['view'] ) && array_key_exists( $_GET['view'], $views ) ) {
121
+	if (isset($_GET['view']) && array_key_exists($_GET['view'], $views)) {
122 122
 		$current_view = $_GET['view'];
123 123
 	}
124 124
 
125
-	do_action( 'give_reports_view_' . $current_view );
125
+	do_action('give_reports_view_'.$current_view);
126 126
 }
127 127
 
128
-add_action( 'give_reports_tab_reports', 'give_reports_tab_reports' );
128
+add_action('give_reports_tab_reports', 'give_reports_tab_reports');
129 129
 
130 130
 /**
131 131
  * Renders the Reports Page Views Drop Downs
@@ -135,25 +135,25 @@  discard block
 block discarded – undo
135 135
  */
136 136
 function give_report_views() {
137 137
 	$views        = give_reports_default_views();
138
-	$current_view = isset( $_GET['view'] ) ? $_GET['view'] : 'earnings';
139
-	do_action( 'give_report_view_actions_before' );
138
+	$current_view = isset($_GET['view']) ? $_GET['view'] : 'earnings';
139
+	do_action('give_report_view_actions_before');
140 140
 	?>
141 141
 	<form id="give-reports-filter" method="get">
142 142
 		<select id="give-reports-view" name="view">
143
-			<option value="-1"><?php esc_html_e( 'Report Type', 'give' ); ?></option>
144
-			<?php foreach ( $views as $view_id => $label ) : ?>
145
-				<option value="<?php echo esc_attr( $view_id ); ?>" <?php selected( $view_id, $current_view ); ?>><?php echo $label; ?></option>
143
+			<option value="-1"><?php esc_html_e('Report Type', 'give'); ?></option>
144
+			<?php foreach ($views as $view_id => $label) : ?>
145
+				<option value="<?php echo esc_attr($view_id); ?>" <?php selected($view_id, $current_view); ?>><?php echo $label; ?></option>
146 146
 			<?php endforeach; ?>
147 147
 		</select>
148 148
 
149
-		<?php do_action( 'give_report_view_actions' ); ?>
149
+		<?php do_action('give_report_view_actions'); ?>
150 150
 
151 151
 		<input type="hidden" name="post_type" value="give_forms"/>
152 152
 		<input type="hidden" name="page" value="give-reports"/>
153
-		<?php submit_button( esc_html__( 'Show', 'give' ), 'secondary', 'submit', false ); ?>
153
+		<?php submit_button(esc_html__('Show', 'give'), 'secondary', 'submit', false); ?>
154 154
 	</form>
155 155
 	<?php
156
-	do_action( 'give_report_view_actions_after' );
156
+	do_action('give_report_view_actions_after');
157 157
 }
158 158
 
159 159
 /**
@@ -166,18 +166,18 @@  discard block
 block discarded – undo
166 166
  */
167 167
 function give_reports_forms_table() {
168 168
 
169
-	if ( isset( $_GET['form-id'] ) ) {
169
+	if (isset($_GET['form-id'])) {
170 170
 		return;
171 171
 	}
172 172
 
173
-	include( dirname( __FILE__ ) . '/class-form-reports-table.php' );
173
+	include(dirname(__FILE__).'/class-form-reports-table.php');
174 174
 
175 175
 	$give_table = new Give_Form_Reports_Table();
176 176
 	$give_table->prepare_items();
177 177
 	$give_table->display();
178 178
 }
179 179
 
180
-add_action( 'give_reports_view_forms', 'give_reports_forms_table' );
180
+add_action('give_reports_view_forms', 'give_reports_forms_table');
181 181
 
182 182
 /**
183 183
  * Renders the detailed report for a specific give form
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
  * @return void
187 187
  */
188 188
 function give_reports_form_details() {
189
-	if ( ! isset( $_GET['form-id'] ) ) {
189
+	if ( ! isset($_GET['form-id'])) {
190 190
 		return;
191 191
 	}
192 192
 	?>
@@ -194,14 +194,14 @@  discard block
 block discarded – undo
194 194
 		<div class="actions bulkactions">
195 195
 			<?php give_report_views(); ?>
196 196
 			&nbsp;
197
-			<button onclick="history.go(-1);" class="button-secondary"><?php esc_html_e( 'Go Back', 'give' ); ?></button>
197
+			<button onclick="history.go(-1);" class="button-secondary"><?php esc_html_e('Go Back', 'give'); ?></button>
198 198
 		</div>
199 199
 	</div>
200 200
 	<?php
201
-	give_reports_graph_of_form( absint( $_GET['form-id'] ) );
201
+	give_reports_graph_of_form(absint($_GET['form-id']));
202 202
 }
203 203
 
204
-add_action( 'give_reports_view_forms', 'give_reports_form_details' );
204
+add_action('give_reports_view_forms', 'give_reports_form_details');
205 205
 
206 206
 /**
207 207
  * Renders the Reports Donors Table
@@ -212,28 +212,28 @@  discard block
 block discarded – undo
212 212
  * @return void
213 213
  */
214 214
 function give_reports_donors_table() {
215
-	include( dirname( __FILE__ ) . '/class-donor-reports-table.php' );
215
+	include(dirname(__FILE__).'/class-donor-reports-table.php');
216 216
 
217 217
 	$give_table = new Give_Donor_Reports_Table();
218 218
 	$give_table->prepare_items();
219 219
 	?>
220 220
 	<div class="wrap give-reports-donors-wrap">
221
-		<?php do_action( 'give_logs_donors_table_top' ); ?>
222
-		<form id="give-donors-filter" method="get" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-reports&view=donors' ); ?>">
221
+		<?php do_action('give_logs_donors_table_top'); ?>
222
+		<form id="give-donors-filter" method="get" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-reports&view=donors'); ?>">
223 223
 			<?php
224
-			$give_table->search_box( esc_html__( 'Search', 'give' ), 'give-donors' );
224
+			$give_table->search_box(esc_html__('Search', 'give'), 'give-donors');
225 225
 			$give_table->display();
226 226
 			?>
227 227
 			<input type="hidden" name="post_type" value="give_forms"/>
228 228
 			<input type="hidden" name="page" value="give-reports"/>
229 229
 			<input type="hidden" name="view" value="donors"/>
230 230
 		</form>
231
-		<?php do_action( 'give_logs_donors_table_bottom' ); ?>
231
+		<?php do_action('give_logs_donors_table_bottom'); ?>
232 232
 	</div>
233 233
 	<?php
234 234
 }
235 235
 
236
-add_action( 'give_reports_view_donors', 'give_reports_donors_table' );
236
+add_action('give_reports_view_donors', 'give_reports_donors_table');
237 237
 
238 238
 
239 239
 /**
@@ -245,14 +245,14 @@  discard block
 block discarded – undo
245 245
  * @return void
246 246
  */
247 247
 function give_reports_gateways_table() {
248
-	include( dirname( __FILE__ ) . '/class-gateways-reports-table.php' );
248
+	include(dirname(__FILE__).'/class-gateways-reports-table.php');
249 249
 
250 250
 	$give_table = new Give_Gateawy_Reports_Table();
251 251
 	$give_table->prepare_items();
252 252
 	$give_table->display();
253 253
 }
254 254
 
255
-add_action( 'give_reports_view_gateways', 'give_reports_gateways_table' );
255
+add_action('give_reports_view_gateways', 'give_reports_gateways_table');
256 256
 
257 257
 
258 258
 /**
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 function give_reports_earnings() {
265 265
 	?>
266 266
 	<div class="tablenav top reports-table-nav">
267
-		<h3 class="alignleft reports-earnings-title"><span><?php esc_html_e( 'Income Over Time', 'give' ); ?></span></h3>
267
+		<h3 class="alignleft reports-earnings-title"><span><?php esc_html_e('Income Over Time', 'give'); ?></span></h3>
268 268
 
269 269
 		<div class="alignright actions reports-views-wrap"><?php give_report_views(); ?></div>
270 270
 	</div>
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 	give_reports_graph();
273 273
 }
274 274
 
275
-add_action( 'give_reports_view_earnings', 'give_reports_earnings' );
275
+add_action('give_reports_view_earnings', 'give_reports_earnings');
276 276
 
277 277
 
278 278
 /**
@@ -287,53 +287,53 @@  discard block
 block discarded – undo
287 287
 		<div id="post-body">
288 288
 			<div id="post-body-content">
289 289
 
290
-				<?php do_action( 'give_reports_tab_export_content_top' ); ?>
290
+				<?php do_action('give_reports_tab_export_content_top'); ?>
291 291
 
292 292
 				<table class="widefat export-options-table give-table">
293 293
 					<thead>
294 294
 					<tr>
295
-						<th class="row-title"><?php esc_html_e( 'Export Type', 'give' ); ?></th>
296
-						<th><?php esc_html_e( 'Export Options', 'give' ); ?></th>
295
+						<th class="row-title"><?php esc_html_e('Export Type', 'give'); ?></th>
296
+						<th><?php esc_html_e('Export Options', 'give'); ?></th>
297 297
 					</tr>
298 298
 					</thead>
299 299
 					<tbody>
300
-					<?php do_action( 'give_reports_tab_export_table_top' ); ?>
300
+					<?php do_action('give_reports_tab_export_table_top'); ?>
301 301
 					<tr class="give-export-pdf-sales-earnings">
302 302
 						<td class="row-title">
303
-							<h3><span><?php esc_html_e( 'Export PDF of Donations and Income', 'give' ); ?></span></h3>
303
+							<h3><span><?php esc_html_e('Export PDF of Donations and Income', 'give'); ?></span></h3>
304 304
 
305
-							<p><?php esc_html_e( 'Download a PDF of Donations and Income reports for all forms for the current year.', 'give' ); ?></p>
305
+							<p><?php esc_html_e('Download a PDF of Donations and Income reports for all forms for the current year.', 'give'); ?></p>
306 306
 						</td>
307 307
 						<td>
308
-							<a class="button" href="<?php echo wp_nonce_url( add_query_arg( array( 'give-action' => 'generate_pdf' ) ), 'give_generate_pdf' ); ?>"><?php esc_html_e( 'Generate PDF', 'give' ); ?></a>
308
+							<a class="button" href="<?php echo wp_nonce_url(add_query_arg(array('give-action' => 'generate_pdf')), 'give_generate_pdf'); ?>"><?php esc_html_e('Generate PDF', 'give'); ?></a>
309 309
 						</td>
310 310
 					</tr>
311 311
 					<tr class="alternate give-export-sales-earnings">
312 312
 						<td class="row-title">
313
-							<h3><span><?php esc_html_e( 'Export Income and Donation Stats', 'give' ); ?></span></h3>
313
+							<h3><span><?php esc_html_e('Export Income and Donation Stats', 'give'); ?></span></h3>
314 314
 
315
-							<p><?php esc_html_e( 'Download a CSV of income and donations over time.', 'give' ); ?></p>
315
+							<p><?php esc_html_e('Download a CSV of income and donations over time.', 'give'); ?></p>
316 316
 						</td>
317 317
 						<td>
318 318
 							<form method="post">
319 319
 								<?php
320 320
 									printf(
321 321
 										/* translators: 1: start date dropdown 2: end date dropdown */
322
-										esc_html__( '%1$s to %2$s', 'give' ),
323
-										Give()->html->year_dropdown( 'start_year' ) . ' ' . Give()->html->month_dropdown( 'start_month' ),
324
-										Give()->html->year_dropdown( 'end_year' )   . ' ' . Give()->html->month_dropdown( 'end_month' )
322
+										esc_html__('%1$s to %2$s', 'give'),
323
+										Give()->html->year_dropdown('start_year').' '.Give()->html->month_dropdown('start_month'),
324
+										Give()->html->year_dropdown('end_year').' '.Give()->html->month_dropdown('end_month')
325 325
 									);
326 326
 								?>
327 327
 								<input type="hidden" name="give-action" value="earnings_export"/>
328
-								<input type="submit" value="<?php esc_attr_e( 'Generate CSV', 'give' ); ?>" class="button-secondary"/>
328
+								<input type="submit" value="<?php esc_attr_e('Generate CSV', 'give'); ?>" class="button-secondary"/>
329 329
 							</form>
330 330
 						</td>
331 331
 					</tr>
332 332
 					<tr class="give-export-payment-history">
333 333
 						<td class="row-title">
334
-							<h3><span><?php esc_html_e( 'Export Donation History', 'give' ); ?></span></h3>
334
+							<h3><span><?php esc_html_e('Export Donation History', 'give'); ?></span></h3>
335 335
 
336
-							<p><?php esc_html_e( 'Download a CSV of all donations recorded.', 'give' ); ?></p>
336
+							<p><?php esc_html_e('Download a CSV of all donations recorded.', 'give'); ?></p>
337 337
 						</td>
338 338
 						<td>
339 339
 							<form id="give-export-payments" class="give-export-form" method="post">
@@ -341,29 +341,29 @@  discard block
 block discarded – undo
341 341
 								$args = array(
342 342
 									'id'          => 'give-payment-export-start',
343 343
 									'name'        => 'start',
344
-									'placeholder' => esc_attr__( 'Start date', 'give' )
344
+									'placeholder' => esc_attr__('Start date', 'give')
345 345
 								);
346
-								echo Give()->html->date_field( $args ); ?>
346
+								echo Give()->html->date_field($args); ?>
347 347
 								<?php
348 348
 								$args = array(
349 349
 									'id'          => 'give-payment-export-end',
350 350
 									'name'        => 'end',
351
-									'placeholder' => esc_attr__( 'End date', 'give' )
351
+									'placeholder' => esc_attr__('End date', 'give')
352 352
 								);
353
-								echo Give()->html->date_field( $args ); ?>
353
+								echo Give()->html->date_field($args); ?>
354 354
 								<select name="status">
355
-									<option value="any"><?php esc_html_e( 'All Statuses', 'give' ); ?></option>
355
+									<option value="any"><?php esc_html_e('All Statuses', 'give'); ?></option>
356 356
 									<?php
357 357
 									$statuses = give_get_payment_statuses();
358
-									foreach ( $statuses as $status => $label ) {
359
-										echo '<option value="' . $status . '">' . $label . '</option>';
358
+									foreach ($statuses as $status => $label) {
359
+										echo '<option value="'.$status.'">'.$label.'</option>';
360 360
 									}
361 361
 									?>
362 362
 								</select>
363
-								<?php wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); ?>
363
+								<?php wp_nonce_field('give_ajax_export', 'give_ajax_export'); ?>
364 364
 								<input type="hidden" name="give-export-class" value="Give_Batch_Payments_Export"/>
365 365
 								<span>
366
-									<input type="submit" value="<?php esc_attr_e( 'Generate CSV', 'give' ); ?>" class="button-secondary"/>
366
+									<input type="submit" value="<?php esc_attr_e('Generate CSV', 'give'); ?>" class="button-secondary"/>
367 367
 									<span class="spinner"></span>
368 368
 								</span>
369 369
 							</form>
@@ -372,9 +372,9 @@  discard block
 block discarded – undo
372 372
 					</tr>
373 373
 					<tr class="alternate give-export-donors">
374 374
 						<td class="row-title">
375
-							<h3><span><?php esc_html_e( 'Export Donors in CSV', 'give' ); ?></span></h3>
375
+							<h3><span><?php esc_html_e('Export Donors in CSV', 'give'); ?></span></h3>
376 376
 
377
-							<p><?php esc_html_e( 'Download an export of donors for all donation forms or only those who have given to a particular form.', 'give' ); ?></p>
377
+							<p><?php esc_html_e('Download an export of donors for all donation forms or only those who have given to a particular form.', 'give'); ?></p>
378 378
 						</td>
379 379
 						<td>
380 380
 							<form method="post" id="give_donor_export" class="give-export-form">
@@ -385,54 +385,54 @@  discard block
 block discarded – undo
385 385
 										'id'     => 'give_customer_export_form',
386 386
 										'chosen' => true
387 387
 									);
388
-									echo Give()->html->forms_dropdown( $args ); ?>
388
+									echo Give()->html->forms_dropdown($args); ?>
389 389
 								
390
-								<input type="submit" value="<?php esc_attr_e( 'Generate CSV', 'give' ); ?>" class="button-secondary"/>
390
+								<input type="submit" value="<?php esc_attr_e('Generate CSV', 'give'); ?>" class="button-secondary"/>
391 391
 
392 392
 								<div id="export-donor-options-wrap" class="give-clearfix">
393
-									<p><?php esc_html_e( 'Export Columns', 'give' ); ?>:</p>
393
+									<p><?php esc_html_e('Export Columns', 'give'); ?>:</p>
394 394
 									<ul id="give-export-option-ul">
395 395
 										<li>
396
-											<label for="give-export-fullname"><input type="checkbox" checked name="give_export_option[full_name]" id="give-export-fullname"><?php esc_html_e( 'Name', 'give' ); ?>
396
+											<label for="give-export-fullname"><input type="checkbox" checked name="give_export_option[full_name]" id="give-export-fullname"><?php esc_html_e('Name', 'give'); ?>
397 397
 											</label>
398 398
 										</li>
399 399
 										<li>
400
-											<label for="give-export-email"><input type="checkbox" checked name="give_export_option[email]" id="give-export-email"><?php esc_html_e( 'Email', 'give' ); ?>
400
+											<label for="give-export-email"><input type="checkbox" checked name="give_export_option[email]" id="give-export-email"><?php esc_html_e('Email', 'give'); ?>
401 401
 											</label>
402 402
 										</li>
403 403
 										<li>
404
-											<label for="give-export-address"><input type="checkbox" checked name="give_export_option[address]" id="give-export-address"><?php esc_html_e( 'Address', 'give' ); ?>
404
+											<label for="give-export-address"><input type="checkbox" checked name="give_export_option[address]" id="give-export-address"><?php esc_html_e('Address', 'give'); ?>
405 405
 											</label>
406 406
 										</li>
407 407
 										<li>
408
-											<label for="give-export-userid"><input type="checkbox" checked name="give_export_option[userid]" id="give-export-userid"><?php esc_html_e( 'User ID', 'give' ); ?>
408
+											<label for="give-export-userid"><input type="checkbox" checked name="give_export_option[userid]" id="give-export-userid"><?php esc_html_e('User ID', 'give'); ?>
409 409
 											</label>
410 410
 										</li>
411 411
 										<li>
412
-											<label for="give-export-first-donation-date"><input type="checkbox" checked name="give_export_option[date_first_donated]" id="give-export-first-donation-date"><?php esc_html_e( 'First Donation Date', 'give' ); ?>
412
+											<label for="give-export-first-donation-date"><input type="checkbox" checked name="give_export_option[date_first_donated]" id="give-export-first-donation-date"><?php esc_html_e('First Donation Date', 'give'); ?>
413 413
 											</label>
414 414
 										</li>
415 415
 										<li>
416
-											<label for="give-export-donation-number"><input type="checkbox" checked name="give_export_option[donations]" id="give-export-donation-number"><?php esc_html_e( 'Number of Donations', 'give' ); ?>
416
+											<label for="give-export-donation-number"><input type="checkbox" checked name="give_export_option[donations]" id="give-export-donation-number"><?php esc_html_e('Number of Donations', 'give'); ?>
417 417
 											</label>
418 418
 										</li>
419 419
 										<li>
420
-											<label for="give-export-donation-sum"><input type="checkbox" checked name="give_export_option[donation_sum]" id="give-export-donation-sum"><?php esc_html_e( 'Total Donated', 'give' ); ?>
420
+											<label for="give-export-donation-sum"><input type="checkbox" checked name="give_export_option[donation_sum]" id="give-export-donation-sum"><?php esc_html_e('Total Donated', 'give'); ?>
421 421
 											</label>
422 422
 										</li>
423 423
 									</ul>
424 424
 								</div>
425
-								<?php wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); ?>
425
+								<?php wp_nonce_field('give_ajax_export', 'give_ajax_export'); ?>
426 426
 								<input type="hidden" name="give-export-class" value="Give_Batch_Customers_Export"/>
427 427
 								<input type="hidden" name="give-action" value="email_export"/>
428 428
 							</form>
429 429
 						</td>
430 430
 					</tr>
431
-					<?php do_action( 'give_reports_tab_export_table_bottom' ); ?>
431
+					<?php do_action('give_reports_tab_export_table_bottom'); ?>
432 432
 					</tbody>
433 433
 				</table>
434 434
 
435
-				<?php do_action( 'give_reports_tab_export_content_bottom' ); ?>
435
+				<?php do_action('give_reports_tab_export_content_bottom'); ?>
436 436
 
437 437
 			</div>
438 438
 			<!-- .post-body-content -->
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 	<?php
443 443
 }
444 444
 
445
-add_action( 'give_reports_tab_export', 'give_reports_tab_export' );
445
+add_action('give_reports_tab_export', 'give_reports_tab_export');
446 446
 
447 447
 /**
448 448
  * Renders the Reports page
@@ -452,19 +452,19 @@  discard block
 block discarded – undo
452 452
  */
453 453
 function give_reports_tab_logs() {
454 454
 
455
-	require( GIVE_PLUGIN_DIR . 'includes/admin/reporting/logs.php' );
455
+	require(GIVE_PLUGIN_DIR.'includes/admin/reporting/logs.php');
456 456
 
457 457
 	$current_view = 'sales';
458 458
 	$log_views    = give_log_default_views();
459 459
 
460
-	if ( isset( $_GET['view'] ) && array_key_exists( $_GET['view'], $log_views ) ) {
460
+	if (isset($_GET['view']) && array_key_exists($_GET['view'], $log_views)) {
461 461
 		$current_view = $_GET['view'];
462 462
 	}
463 463
 
464
-	do_action( 'give_logs_view_' . $current_view );
464
+	do_action('give_logs_view_'.$current_view);
465 465
 }
466 466
 
467
-add_action( 'give_reports_tab_logs', 'give_reports_tab_logs' );
467
+add_action('give_reports_tab_logs', 'give_reports_tab_logs');
468 468
 
469 469
 /**
470 470
  * Retrieves estimated monthly earnings and sales
@@ -474,9 +474,9 @@  discard block
 block discarded – undo
474 474
  */
475 475
 function give_estimated_monthly_stats() {
476 476
 
477
-	$estimated = get_transient( 'give_estimated_monthly_stats' );
477
+	$estimated = get_transient('give_estimated_monthly_stats');
478 478
 
479
-	if ( false === $estimated ) {
479
+	if (false === $estimated) {
480 480
 
481 481
 		$estimated = array(
482 482
 			'earnings' => 0,
@@ -485,20 +485,20 @@  discard block
 block discarded – undo
485 485
 
486 486
 		$stats = new Give_Payment_Stats;
487 487
 
488
-		$to_date_earnings = $stats->get_earnings( 0, 'this_month' );
489
-		$to_date_sales    = $stats->get_sales( 0, 'this_month' );
488
+		$to_date_earnings = $stats->get_earnings(0, 'this_month');
489
+		$to_date_sales    = $stats->get_sales(0, 'this_month');
490 490
 
491
-		$current_day   = date( 'd', current_time( 'timestamp' ) );
492
-		$current_month = date( 'n', current_time( 'timestamp' ) );
493
-		$current_year  = date( 'Y', current_time( 'timestamp' ) );
494
-		$days_in_month = cal_days_in_month( CAL_GREGORIAN, $current_month, $current_year );
491
+		$current_day   = date('d', current_time('timestamp'));
492
+		$current_month = date('n', current_time('timestamp'));
493
+		$current_year  = date('Y', current_time('timestamp'));
494
+		$days_in_month = cal_days_in_month(CAL_GREGORIAN, $current_month, $current_year);
495 495
 
496
-		$estimated['earnings'] = ( $to_date_earnings / $current_day ) * $days_in_month;
497
-		$estimated['sales']    = ( $to_date_sales / $current_day ) * $days_in_month;
496
+		$estimated['earnings'] = ($to_date_earnings / $current_day) * $days_in_month;
497
+		$estimated['sales']    = ($to_date_sales / $current_day) * $days_in_month;
498 498
 
499 499
 		// Cache for one day
500
-		set_transient( 'give_estimated_monthly_stats', $estimated, 86400 );
500
+		set_transient('give_estimated_monthly_stats', $estimated, 86400);
501 501
 	}
502 502
 
503
-	return maybe_unserialize( $estimated );
503
+	return maybe_unserialize($estimated);
504 504
 }
Please login to merge, or discard this patch.
includes/admin/reporting/export/class-batch-export-payments.php 1 patch
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if accessed directly.
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
@@ -39,30 +39,30 @@  discard block
 block discarded – undo
39 39
 	 */
40 40
 	public function csv_cols() {
41 41
 		$cols = array(
42
-			'id'        => esc_html__( 'ID', 'give' ), // unaltered payment ID (use for querying).
43
-			'seq_id'    => esc_html__( 'Payment Number', 'give' ), // sequential payment ID.
44
-			'email'     => esc_html__( 'Email', 'give' ),
45
-			'first'     => esc_html__( 'First Name', 'give' ),
46
-			'last'      => esc_html__( 'Last Name', 'give' ),
47
-			'address1'  => esc_html__( 'Address', 'give' ),
48
-			'address2'  => esc_html__( 'Address (Line 2)', 'give' ),
49
-			'city'      => esc_html__( 'City', 'give' ),
50
-			'state'     => esc_html__( 'State', 'give' ),
51
-			'country'   => esc_html__( 'Country', 'give' ),
52
-			'zip'       => esc_html__( 'Zip / Postal Code', 'give' ),
53
-			'form_id'   => esc_html__( 'Form ID', 'give' ),
54
-			'form_name' => esc_html__( 'Form Name', 'give' ),
55
-			'amount'    => esc_html__( 'Amount', 'give' ) . ' (' . html_entity_decode( give_currency_filter( '' ) ) . ')',
56
-			'gateway'   => esc_html__( 'Payment Method', 'give' ),
57
-			'trans_id'  => esc_html__( 'Transaction ID', 'give' ),
58
-			'key'       => esc_html__( 'Purchase Key', 'give' ),
59
-			'date'      => esc_html__( 'Date', 'give' ),
60
-			'user'      => esc_html__( 'User', 'give' ),
61
-			'status'    => esc_html__( 'Status', 'give' )
42
+			'id'        => esc_html__('ID', 'give'), // unaltered payment ID (use for querying).
43
+			'seq_id'    => esc_html__('Payment Number', 'give'), // sequential payment ID.
44
+			'email'     => esc_html__('Email', 'give'),
45
+			'first'     => esc_html__('First Name', 'give'),
46
+			'last'      => esc_html__('Last Name', 'give'),
47
+			'address1'  => esc_html__('Address', 'give'),
48
+			'address2'  => esc_html__('Address (Line 2)', 'give'),
49
+			'city'      => esc_html__('City', 'give'),
50
+			'state'     => esc_html__('State', 'give'),
51
+			'country'   => esc_html__('Country', 'give'),
52
+			'zip'       => esc_html__('Zip / Postal Code', 'give'),
53
+			'form_id'   => esc_html__('Form ID', 'give'),
54
+			'form_name' => esc_html__('Form Name', 'give'),
55
+			'amount'    => esc_html__('Amount', 'give').' ('.html_entity_decode(give_currency_filter('')).')',
56
+			'gateway'   => esc_html__('Payment Method', 'give'),
57
+			'trans_id'  => esc_html__('Transaction ID', 'give'),
58
+			'key'       => esc_html__('Purchase Key', 'give'),
59
+			'date'      => esc_html__('Date', 'give'),
60
+			'user'      => esc_html__('User', 'give'),
61
+			'status'    => esc_html__('Status', 'give')
62 62
 		);
63 63
 
64
-		if ( ! give_get_option( 'enable_sequential' ) ) {
65
-			unset( $cols['seq_id'] );
64
+		if ( ! give_get_option('enable_sequential')) {
65
+			unset($cols['seq_id']);
66 66
 		}
67 67
 
68 68
 		return $cols;
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
 			'status' => $this->status
88 88
 		);
89 89
 
90
-		if ( ! empty( $this->start ) || ! empty( $this->end ) ) {
90
+		if ( ! empty($this->start) || ! empty($this->end)) {
91 91
 
92 92
 			$args['date_query'] = array(
93 93
 				array(
94
-					'after'     => date( 'Y-n-d 00:00:00', strtotime( $this->start ) ),
95
-					'before'    => date( 'Y-n-d 23:59:59', strtotime( $this->end ) ),
94
+					'after'     => date('Y-n-d 00:00:00', strtotime($this->start)),
95
+					'before'    => date('Y-n-d 23:59:59', strtotime($this->end)),
96 96
 					'inclusive' => true
97 97
 				)
98 98
 			);
@@ -101,52 +101,52 @@  discard block
 block discarded – undo
101 101
 
102 102
 		//echo json_encode($args ); exit;
103 103
 
104
-		$payments = give_get_payments( $args );
104
+		$payments = give_get_payments($args);
105 105
 
106
-		if ( $payments ) {
106
+		if ($payments) {
107 107
 
108
-			foreach ( $payments as $payment ) {
109
-				$payment_meta = give_get_payment_meta( $payment->ID );
110
-				$user_info    = give_get_payment_meta_user_info( $payment->ID );
111
-				$total        = give_get_payment_amount( $payment->ID );
112
-				$user_id      = isset( $user_info['id'] ) && $user_info['id'] != - 1 ? $user_info['id'] : $user_info['email'];
108
+			foreach ($payments as $payment) {
109
+				$payment_meta = give_get_payment_meta($payment->ID);
110
+				$user_info    = give_get_payment_meta_user_info($payment->ID);
111
+				$total        = give_get_payment_amount($payment->ID);
112
+				$user_id      = isset($user_info['id']) && $user_info['id'] != - 1 ? $user_info['id'] : $user_info['email'];
113 113
 				$products     = '';
114 114
 				$skus         = '';
115 115
 
116
-				if ( is_numeric( $user_id ) ) {
117
-					$user = get_userdata( $user_id );
116
+				if (is_numeric($user_id)) {
117
+					$user = get_userdata($user_id);
118 118
 				} else {
119 119
 					$user = false;
120 120
 				}
121 121
 
122 122
 				$data[] = array(
123 123
 					'id'        => $payment->ID,
124
-					'seq_id'    => give_get_payment_number( $payment->ID ),
124
+					'seq_id'    => give_get_payment_number($payment->ID),
125 125
 					'email'     => $payment_meta['email'],
126 126
 					'first'     => $user_info['first_name'],
127 127
 					'last'      => $user_info['last_name'],
128
-					'address1'  => isset( $user_info['address']['line1'] ) ? $user_info['address']['line1'] : '',
129
-					'address2'  => isset( $user_info['address']['line2'] ) ? $user_info['address']['line2'] : '',
130
-					'city'      => isset( $user_info['address']['city'] ) ? $user_info['address']['city'] : '',
131
-					'state'     => isset( $user_info['address']['state'] ) ? $user_info['address']['state'] : '',
132
-					'country'   => isset( $user_info['address']['country'] ) ? $user_info['address']['country'] : '',
133
-					'zip'       => isset( $user_info['address']['zip'] ) ? $user_info['address']['zip'] : '',
134
-					'form_id'   => isset( $payment_meta['form_id'] ) ? $payment_meta['form_id'] : '',
135
-					'form_name' => isset( $payment_meta['form_title'] ) ? $payment_meta['form_title'] : '',
128
+					'address1'  => isset($user_info['address']['line1']) ? $user_info['address']['line1'] : '',
129
+					'address2'  => isset($user_info['address']['line2']) ? $user_info['address']['line2'] : '',
130
+					'city'      => isset($user_info['address']['city']) ? $user_info['address']['city'] : '',
131
+					'state'     => isset($user_info['address']['state']) ? $user_info['address']['state'] : '',
132
+					'country'   => isset($user_info['address']['country']) ? $user_info['address']['country'] : '',
133
+					'zip'       => isset($user_info['address']['zip']) ? $user_info['address']['zip'] : '',
134
+					'form_id'   => isset($payment_meta['form_id']) ? $payment_meta['form_id'] : '',
135
+					'form_name' => isset($payment_meta['form_title']) ? $payment_meta['form_title'] : '',
136 136
 					'skus'      => $skus,
137
-					'amount'    => html_entity_decode( give_format_amount( $total ) ),
138
-					'gateway'   => give_get_gateway_admin_label( get_post_meta( $payment->ID, '_give_payment_gateway', true ) ),
139
-					'trans_id'  => give_get_payment_transaction_id( $payment->ID ),
137
+					'amount'    => html_entity_decode(give_format_amount($total)),
138
+					'gateway'   => give_get_gateway_admin_label(get_post_meta($payment->ID, '_give_payment_gateway', true)),
139
+					'trans_id'  => give_get_payment_transaction_id($payment->ID),
140 140
 					'key'       => $payment_meta['key'],
141 141
 					'date'      => $payment->post_date,
142
-					'user'      => $user ? $user->display_name : __( 'guest', 'give' ),
143
-					'status'    => give_get_payment_status( $payment, true )
142
+					'user'      => $user ? $user->display_name : __('guest', 'give'),
143
+					'status'    => give_get_payment_status($payment, true)
144 144
 				);
145 145
 
146 146
 			}
147 147
 
148
-			$data = apply_filters( 'give_export_get_data', $data );
149
-			$data = apply_filters( 'give_export_get_data_' . $this->export_type, $data );
148
+			$data = apply_filters('give_export_get_data', $data);
149
+			$data = apply_filters('give_export_get_data_'.$this->export_type, $data);
150 150
 
151 151
 			return $data;
152 152
 
@@ -166,27 +166,27 @@  discard block
 block discarded – undo
166 166
 
167 167
 		$status = $this->status;
168 168
 		$args   = array(
169
-			'start-date' => date( 'n/d/Y', strtotime( $this->start ) ),
170
-			'end-date'   => date( 'n/d/Y', strtotime( $this->end ) ),
169
+			'start-date' => date('n/d/Y', strtotime($this->start)),
170
+			'end-date'   => date('n/d/Y', strtotime($this->end)),
171 171
 		);
172 172
 
173
-		if ( 'any' == $status ) {
173
+		if ('any' == $status) {
174 174
 
175
-			$total = array_sum( (array) give_count_payments( $args ) );
175
+			$total = array_sum((array) give_count_payments($args));
176 176
 
177 177
 		} else {
178 178
 
179
-			$total = give_count_payments( $args )->$status;
179
+			$total = give_count_payments($args)->$status;
180 180
 
181 181
 		}
182 182
 
183 183
 		$percentage = 100;
184 184
 
185
-		if ( $total > 0 ) {
186
-			$percentage = ( ( 30 * $this->step ) / $total ) * 100;
185
+		if ($total > 0) {
186
+			$percentage = ((30 * $this->step) / $total) * 100;
187 187
 		}
188 188
 
189
-		if ( $percentage > 100 ) {
189
+		if ($percentage > 100) {
190 190
 			$percentage = 100;
191 191
 		}
192 192
 
@@ -200,9 +200,9 @@  discard block
 block discarded – undo
200 200
 	 *
201 201
 	 * @param array $request The Form Data passed into the batch processing.
202 202
 	 */
203
-	public function set_properties( $request ) {
204
-		$this->start  = isset( $request['start'] ) ? sanitize_text_field( $request['start'] ) : '';
205
-		$this->end    = isset( $request['end'] ) ? sanitize_text_field( $request['end'] ) : '';
206
-		$this->status = isset( $request['status'] ) ? sanitize_text_field( $request['status'] ) : 'complete';
203
+	public function set_properties($request) {
204
+		$this->start  = isset($request['start']) ? sanitize_text_field($request['start']) : '';
205
+		$this->end    = isset($request['end']) ? sanitize_text_field($request['end']) : '';
206
+		$this->status = isset($request['status']) ? sanitize_text_field($request['status']) : 'complete';
207 207
 	}
208 208
 }
Please login to merge, or discard this patch.
includes/admin/reporting/class-gateways-reports-table.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
17 17
 // Load WP_List_Table if not loaded
18
-if ( ! class_exists( 'WP_List_Table' ) ) {
19
-	require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
18
+if ( ! class_exists('WP_List_Table')) {
19
+	require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php';
20 20
 }
21 21
 
22 22
 /**
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
 		global $status, $page;
46 46
 
47 47
 		// Set parent defaults
48
-		parent::__construct( array(
49
-			'singular' => give_get_forms_label_singular(),    // Singular name of the listed records
50
-			'plural'   => give_get_forms_label_plural(),        // Plural name of the listed records
48
+		parent::__construct(array(
49
+			'singular' => give_get_forms_label_singular(), // Singular name of the listed records
50
+			'plural'   => give_get_forms_label_plural(), // Plural name of the listed records
51 51
 			'ajax'     => false                        // Does this table support ajax?
52
-		) );
52
+		));
53 53
 
54 54
 	}
55 55
 
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
 	 *
65 65
 	 * @return string Column Name
66 66
 	 */
67
-	public function column_default( $item, $column_name ) {
68
-		switch ( $column_name ) {
67
+	public function column_default($item, $column_name) {
68
+		switch ($column_name) {
69 69
 			default:
70
-				return $item[ $column_name ];
70
+				return $item[$column_name];
71 71
 		}
72 72
 	}
73 73
 
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
 	 */
81 81
 	public function get_columns() {
82 82
 		$columns = array(
83
-			'label'           => esc_attr__( 'Gateway', 'give' ),
84
-			'complete_sales'  => esc_attr__( 'Complete Transactions', 'give' ),
85
-			'pending_sales'   => esc_attr__( 'Pending / Failed Transactions', 'give' ),
86
-			'total_sales'     => esc_attr__( 'Total Transactions', 'give' ),
87
-			'total_donations' => esc_attr__( 'Total Donations', 'give' )
83
+			'label'           => esc_attr__('Gateway', 'give'),
84
+			'complete_sales'  => esc_attr__('Complete Transactions', 'give'),
85
+			'pending_sales'   => esc_attr__('Pending / Failed Transactions', 'give'),
86
+			'total_sales'     => esc_attr__('Total Transactions', 'give'),
87
+			'total_donations' => esc_attr__('Total Donations', 'give')
88 88
 		);
89 89
 
90 90
 		return $columns;
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 	 * @return int Current page number
100 100
 	 */
101 101
 	public function get_paged() {
102
-		return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1;
102
+		return isset($_GET['paged']) ? absint($_GET['paged']) : 1;
103 103
 	}
104 104
 
105 105
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 	 * @since  1.0
111 111
 	 * @return void
112 112
 	 */
113
-	public function bulk_actions( $which = '' ) {
113
+	public function bulk_actions($which = '') {
114 114
 		// These aren't really bulk actions but this outputs the markup in the right place
115 115
 		give_report_views();
116 116
 	}
@@ -123,23 +123,23 @@  discard block
 block discarded – undo
123 123
 	 *
124 124
 	 * @param string $which
125 125
 	 */
126
-	protected function display_tablenav( $which ) {
126
+	protected function display_tablenav($which) {
127 127
 
128
-		if ( 'top' == $which ) {
129
-			wp_nonce_field( 'bulk-' . $this->_args['plural'] );
128
+		if ('top' == $which) {
129
+			wp_nonce_field('bulk-'.$this->_args['plural']);
130 130
 		}
131 131
 		?>
132
-		<div class="tablenav gateways-report-tablenav give-clearfix <?php echo esc_attr( $which ); ?>">
132
+		<div class="tablenav gateways-report-tablenav give-clearfix <?php echo esc_attr($which); ?>">
133 133
 
134
-			<h3 class="alignleft reports-earnings-title"><span><?php esc_html_e( 'Payment Methods Report', 'give' ); ?></span></h3>
134
+			<h3 class="alignleft reports-earnings-title"><span><?php esc_html_e('Payment Methods Report', 'give'); ?></span></h3>
135 135
 
136 136
 			<div class="alignright tablenav-right">
137 137
 				<div class="actions bulkactions">
138
-					<?php $this->bulk_actions( $which ); ?>
138
+					<?php $this->bulk_actions($which); ?>
139 139
 				</div>
140 140
 				<?php
141
-				$this->extra_tablenav( $which );
142
-				$this->pagination( $which );
141
+				$this->extra_tablenav($which);
142
+				$this->pagination($which);
143 143
 				?>
144 144
 			</div>
145 145
 
@@ -164,18 +164,18 @@  discard block
 block discarded – undo
164 164
 		$gateways     = give_get_payment_gateways();
165 165
 		$stats        = new Give_Payment_Stats();
166 166
 
167
-		foreach ( $gateways as $gateway_id => $gateway ) {
167
+		foreach ($gateways as $gateway_id => $gateway) {
168 168
 
169
-			$complete_count = give_count_sales_by_gateway( $gateway_id, 'publish' );
170
-			$pending_count  = give_count_sales_by_gateway( $gateway_id, array( 'pending', 'failed' ) );
169
+			$complete_count = give_count_sales_by_gateway($gateway_id, 'publish');
170
+			$pending_count  = give_count_sales_by_gateway($gateway_id, array('pending', 'failed'));
171 171
 
172 172
 			$reports_data[] = array(
173 173
 				'ID'              => $gateway_id,
174 174
 				'label'           => $gateway['admin_label'],
175
-				'complete_sales'  => give_format_amount( $complete_count, false ),
176
-				'pending_sales'   => give_format_amount( $pending_count, false ),
177
-				'total_sales'     => give_format_amount( $complete_count + $pending_count, false ),
178
-				'total_donations' => give_currency_filter( give_format_amount( $stats->get_earnings( 0, 0, 0, $gateway_id ) ) )
175
+				'complete_sales'  => give_format_amount($complete_count, false),
176
+				'pending_sales'   => give_format_amount($pending_count, false),
177
+				'total_sales'     => give_format_amount($complete_count + $pending_count, false),
178
+				'total_donations' => give_currency_filter(give_format_amount($stats->get_earnings(0, 0, 0, $gateway_id)))
179 179
 			);
180 180
 		}
181 181
 
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 		$columns               = $this->get_columns();
198 198
 		$hidden                = array(); // No hidden columns
199 199
 		$sortable              = $this->get_sortable_columns();
200
-		$this->_column_headers = array( $columns, $hidden, $sortable );
200
+		$this->_column_headers = array($columns, $hidden, $sortable);
201 201
 		$this->items           = $this->reports_data();
202 202
 
203 203
 	}
Please login to merge, or discard this patch.