Completed
Pull Request — master (#1412)
by Ravinder
17:25
created
includes/admin/class-addon-activation-banner.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 // Exit if accessed directly.
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -32,14 +32,14 @@  discard block
 block discarded – undo
32 32
 	 *                               'testing'           => false, // (required) Never leave as "true" in production!!!
33 33
 	 *                               }
34 34
 	 */
35
-	function __construct( $_banner_details ) {
35
+	function __construct($_banner_details) {
36 36
 		$current_user = wp_get_current_user();
37 37
 
38 38
 		$this->plugin_activate_by   = 0;
39 39
 		$this->banner_details       = $_banner_details;
40
-		$this->test_mode            = ( $this->banner_details['testing'] == 'true' ) ? true : false;
41
-		$this->nag_meta_key         = 'give_addon_activation_ignore_' . sanitize_title( $this->banner_details['name'] );
42
-		$this->activate_by_meta_key = 'give_addon_' . sanitize_title( $this->banner_details['name'] ) . '_active_by_user';
40
+		$this->test_mode            = ($this->banner_details['testing'] == 'true') ? true : false;
41
+		$this->nag_meta_key         = 'give_addon_activation_ignore_'.sanitize_title($this->banner_details['name']);
42
+		$this->activate_by_meta_key = 'give_addon_'.sanitize_title($this->banner_details['name']).'_active_by_user';
43 43
 
44 44
 		//Get current user
45 45
 		$this->user_id = $current_user->ID;
@@ -62,16 +62,16 @@  discard block
 block discarded – undo
62 62
 	public function init() {
63 63
 
64 64
 		//Testing?
65
-		if ( $this->test_mode ) {
66
-			delete_user_meta( $this->user_id, $this->nag_meta_key );
65
+		if ($this->test_mode) {
66
+			delete_user_meta($this->user_id, $this->nag_meta_key);
67 67
 		}
68 68
 
69 69
 		//Get the current page to add the notice to
70
-		add_action( 'current_screen', array( $this, 'give_addon_notice_ignore' ) );
71
-		add_action( 'admin_notices', array( $this, 'give_addon_activation_admin_notice' ) );
70
+		add_action('current_screen', array($this, 'give_addon_notice_ignore'));
71
+		add_action('admin_notices', array($this, 'give_addon_activation_admin_notice'));
72 72
 
73 73
 		// File path of addon must be included in banner detail other addon activate meta will not delete.
74
-		add_action( 'deactivate_' . $this->get_plugin_file_name(), array( $this, 'remove_addon_activate_meta' ) );
74
+		add_action('deactivate_'.$this->get_plugin_file_name(), array($this, 'remove_addon_activate_meta'));
75 75
 	}
76 76
 
77 77
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	private function is_plugin_page() {
86 86
 		$screen = get_current_screen();
87 87
 
88
-		return ( $screen->parent_file === 'plugins.php' );
88
+		return ($screen->parent_file === 'plugins.php');
89 89
 	}
90 90
 
91 91
 
@@ -98,12 +98,12 @@  discard block
 block discarded – undo
98 98
 	public function give_addon_activation_admin_notice() {
99 99
 
100 100
 		// Bailout.
101
-		if ( ! $this->is_plugin_page() || $this->user_id !== $this->plugin_activate_by ) {
101
+		if ( ! $this->is_plugin_page() || $this->user_id !== $this->plugin_activate_by) {
102 102
 			return;
103 103
 		}
104 104
 
105 105
 		// If the user hasn't already dismissed the alert, output activation banner.
106
-		if ( ! get_user_meta( $this->user_id, $this->nag_meta_key ) ) {
106
+		if ( ! get_user_meta($this->user_id, $this->nag_meta_key)) {
107 107
 
108 108
 			// Output inline styles here because there's no reason
109 109
 			// to enqueued them after the alert is dismissed.
@@ -185,44 +185,44 @@  discard block
 block discarded – undo
185 185
 					<h3><?php
186 186
 						printf(
187 187
 						/* translators: %s: Add-on name */
188
-							esc_html__( "Thank you for installing Give's %s Add-on!", 'give' ),
189
-							'<span>' . $this->banner_details['name'] . '</span>'
188
+							esc_html__("Thank you for installing Give's %s Add-on!", 'give'),
189
+							'<span>'.$this->banner_details['name'].'</span>'
190 190
 						);
191 191
 						?></h3>
192 192
 
193 193
 					<a href="<?php
194 194
 					//The Dismiss Button.
195
-					$nag_admin_dismiss_url = 'plugins.php?' . $this->nag_meta_key . '=0';
196
-					echo admin_url( $nag_admin_dismiss_url ); ?>" class="dismiss"><span
195
+					$nag_admin_dismiss_url = 'plugins.php?'.$this->nag_meta_key.'=0';
196
+					echo admin_url($nag_admin_dismiss_url); ?>" class="dismiss"><span
197 197
 							class="dashicons dashicons-dismiss"></span></a>
198 198
 
199 199
 					<div class="alert-actions">
200 200
 
201 201
 						<?php //Point them to your settings page.
202
-						if ( isset( $this->banner_details['settings_url'] ) ) { ?>
202
+						if (isset($this->banner_details['settings_url'])) { ?>
203 203
 							<a href="<?php echo $this->banner_details['settings_url']; ?>">
204
-								<span class="dashicons dashicons-admin-settings"></span><?php esc_html_e( 'Go to Settings', 'give' ); ?>
204
+								<span class="dashicons dashicons-admin-settings"></span><?php esc_html_e('Go to Settings', 'give'); ?>
205 205
 							</a>
206 206
 						<?php } ?>
207 207
 
208 208
 						<?php
209 209
 						// Show them how to configure the Addon.
210
-						if ( isset( $this->banner_details['documentation_url'] ) ) { ?>
210
+						if (isset($this->banner_details['documentation_url'])) { ?>
211 211
 							<a href="<?php echo $this->banner_details['documentation_url'] ?>" target="_blank">
212 212
 								<span class="dashicons dashicons-media-text"></span><?php
213 213
 								printf(
214 214
 								/* translators: %s: Add-on name */
215
-									esc_html__( 'Documentation: %s Add-on', 'give' ),
215
+									esc_html__('Documentation: %s Add-on', 'give'),
216 216
 									$this->banner_details['name']
217 217
 								);
218 218
 								?></a>
219 219
 						<?php } ?>
220 220
 						<?php
221 221
 						//Let them signup for plugin updates
222
-						if ( isset( $this->banner_details['support_url'] ) ) { ?>
222
+						if (isset($this->banner_details['support_url'])) { ?>
223 223
 
224 224
 							<a href="<?php echo $this->banner_details['support_url'] ?>" target="_blank">
225
-								<span class="dashicons dashicons-sos"></span><?php esc_html_e( 'Get Support', 'give' ); ?>
225
+								<span class="dashicons dashicons-sos"></span><?php esc_html_e('Get Support', 'give'); ?>
226 226
 							</a>
227 227
 
228 228
 						<?php } ?>
@@ -249,13 +249,13 @@  discard block
 block discarded – undo
249 249
 		 * If user clicks to ignore the notice, add that to their user meta the banner then checks whether this tag exists already or not.
250 250
 		 * See here: http://codex.wordpress.org/Function_Reference/add_user_meta
251 251
 		 */
252
-		if ( isset( $_GET[ $this->nag_meta_key ] ) && '0' == $_GET[ $this->nag_meta_key ] ) {
252
+		if (isset($_GET[$this->nag_meta_key]) && '0' == $_GET[$this->nag_meta_key]) {
253 253
 
254 254
 			//Get the global user
255 255
 			$current_user = wp_get_current_user();
256 256
 			$user_id      = $current_user->ID;
257 257
 
258
-			add_user_meta( $user_id, $this->nag_meta_key, 'true', true );
258
+			add_user_meta($user_id, $this->nag_meta_key, 'true', true);
259 259
 		}
260 260
 	}
261 261
 
@@ -266,11 +266,11 @@  discard block
 block discarded – undo
266 266
 	 * @access private
267 267
 	 */
268 268
 	private function add_addon_activate_meta() {
269
-		$user_id                  = get_option( $this->activate_by_meta_key );
269
+		$user_id                  = get_option($this->activate_by_meta_key);
270 270
 		$this->plugin_activate_by = (int) $user_id;
271 271
 
272
-		if ( ! $user_id ) {
273
-			add_option( $this->activate_by_meta_key, $this->user_id, '', 'no' );
272
+		if ( ! $user_id) {
273
+			add_option($this->activate_by_meta_key, $this->user_id, '', 'no');
274 274
 			$this->plugin_activate_by = (int) $this->user_id;
275 275
 		}
276 276
 	}
@@ -283,10 +283,10 @@  discard block
 block discarded – undo
283 283
 	 * @access public
284 284
 	 */
285 285
 	public function remove_addon_activate_meta() {
286
-		$user_id = get_option( $this->activate_by_meta_key );
286
+		$user_id = get_option($this->activate_by_meta_key);
287 287
 
288
-		if ( $user_id ) {
289
-			delete_option( $this->activate_by_meta_key );
288
+		if ($user_id) {
289
+			delete_option($this->activate_by_meta_key);
290 290
 		}
291 291
 	}
292 292
 
@@ -299,35 +299,35 @@  discard block
 block discarded – undo
299 299
 	 * @return mixed
300 300
 	 */
301 301
 	private function get_plugin_file_name() {
302
-		$active_plugins = get_option( 'active_plugins' );
302
+		$active_plugins = get_option('active_plugins');
303 303
 		$file_name      = '';
304 304
 
305 305
 		try {
306 306
 
307 307
 			// Check addon file path.
308
-			if ( ! empty( $this->banner_details['file'] ) ) {
308
+			if ( ! empty($this->banner_details['file'])) {
309 309
 				$file_name = '';
310
-				if ( $file_path = explode( '/plugins/', $this->banner_details['file'] ) ) {
311
-					$file_path = array_pop( $file_path );
312
-					$file_name = current( explode( '/', $file_path ) );
310
+				if ($file_path = explode('/plugins/', $this->banner_details['file'])) {
311
+					$file_path = array_pop($file_path);
312
+					$file_name = current(explode('/', $file_path));
313 313
 				}
314 314
 
315
-				foreach ( $active_plugins as $plugin ) {
316
-					if ( false !== strpos( $plugin, $file_name ) ) {
315
+				foreach ($active_plugins as $plugin) {
316
+					if (false !== strpos($plugin, $file_name)) {
317 317
 						$file_name = $plugin;
318 318
 						break;
319 319
 					}
320 320
 				}
321 321
 			} else {
322
-				throw new Exception( __( "File path must be added of {$this->banner_details['name']} addon in banner details.", 'give' ) );
322
+				throw new Exception(__("File path must be added of {$this->banner_details['name']} addon in banner details.", 'give'));
323 323
 			}
324 324
 
325 325
 			// Check plugin path calculated by addon file path.
326
-			if ( empty( $file_name ) ) {
327
-				throw new Exception( __( "Empty Addon plugin path for {$this->banner_details['name']} addon.", 'give' ) );
326
+			if (empty($file_name)) {
327
+				throw new Exception(__("Empty Addon plugin path for {$this->banner_details['name']} addon.", 'give'));
328 328
 			}
329 329
 
330
-		} catch ( Exception $e ) {
330
+		} catch (Exception $e) {
331 331
 			echo $e->getMessage();
332 332
 		}
333 333
 
Please login to merge, or discard this patch.
includes/admin/class-api-keys-table.php 1 patch
Spacing   +66 added lines, -66 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
 /**
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
 		global $status, $page;
54 54
 
55 55
 		// Set parent defaults
56
-		parent::__construct( array(
57
-			'singular' => esc_html__( 'API Key', 'give' ),     // Singular name of the listed records
58
-			'plural'   => esc_html__( 'API Keys', 'give' ),    // Plural name of the listed records
59
-			'ajax'     => false,// Does this table support ajax?
60
-		) );
56
+		parent::__construct(array(
57
+			'singular' => esc_html__('API Key', 'give'), // Singular name of the listed records
58
+			'plural'   => esc_html__('API Keys', 'give'), // Plural name of the listed records
59
+			'ajax'     => false, // Does this table support ajax?
60
+		));
61 61
 
62 62
 		$this->query();
63 63
 	}
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
 	 *
74 74
 	 * @return string Column Name
75 75
 	 */
76
-	public function column_default( $item, $column_name ) {
77
-		return $item[ $column_name ];
76
+	public function column_default($item, $column_name) {
77
+		return $item[$column_name];
78 78
 	}
79 79
 
80 80
 	/**
@@ -87,8 +87,8 @@  discard block
 block discarded – undo
87 87
 	 *
88 88
 	 * @return string Column Name
89 89
 	 */
90
-	public function column_key( $item ) {
91
-		return '<input onClick="this.setSelectionRange(0, this.value.length)" readonly="readonly" type="text" class="large-text" value="' . esc_attr( $item['key'] ) . '"/>';
90
+	public function column_key($item) {
91
+		return '<input onClick="this.setSelectionRange(0, this.value.length)" readonly="readonly" type="text" class="large-text" value="'.esc_attr($item['key']).'"/>';
92 92
 	}
93 93
 
94 94
 	/**
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
 	 *
102 102
 	 * @return string Column Name
103 103
 	 */
104
-	public function column_token( $item ) {
105
-		return '<input onClick="this.setSelectionRange(0, this.value.length)" readonly="readonly" type="text" class="large-text" value="' . esc_attr( $item['token'] ) . '"/>';
104
+	public function column_token($item) {
105
+		return '<input onClick="this.setSelectionRange(0, this.value.length)" readonly="readonly" type="text" class="large-text" value="'.esc_attr($item['token']).'"/>';
106 106
 	}
107 107
 
108 108
 	/**
@@ -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 string
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
 					'section'   => 'api_requests',
138 138
 					'post_type' => 'give_forms',
139 139
 					'page'      => 'give-tools',
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
 	/**
@@ -189,10 +189,10 @@  discard block
 block discarded – undo
189 189
 	 */
190 190
 	public function get_columns() {
191 191
 		$columns = array(
192
-			'user'   => esc_html__( 'Username', 'give' ),
193
-			'key'    => esc_html__( 'Public Key', 'give' ),
194
-			'token'  => esc_html__( 'Token', 'give' ),
195
-			'secret' => esc_html__( 'Secret Key', 'give' ),
192
+			'user'   => esc_html__('Username', 'give'),
193
+			'key'    => esc_html__('Public Key', 'give'),
194
+			'token'  => esc_html__('Token', 'give'),
195
+			'secret' => esc_html__('Secret Key', 'give'),
196 196
 		);
197 197
 
198 198
 		return $columns;
@@ -206,20 +206,20 @@  discard block
 block discarded – undo
206 206
 	 *
207 207
 	 * @param string $which
208 208
 	 */
209
-	protected function display_tablenav( $which ) {
210
-		if ( 'top' === $which ) {
211
-			wp_nonce_field( 'bulk-' . $this->_args['plural'] );
209
+	protected function display_tablenav($which) {
210
+		if ('top' === $which) {
211
+			wp_nonce_field('bulk-'.$this->_args['plural']);
212 212
 		}
213 213
 		?>
214
-		<div class="tablenav <?php echo esc_attr( $which ); ?>">
214
+		<div class="tablenav <?php echo esc_attr($which); ?>">
215 215
 
216 216
 			<div class="alignleft actions bulkactions">
217
-				<?php $this->bulk_actions( $which ); ?>
217
+				<?php $this->bulk_actions($which); ?>
218 218
 			</div>
219 219
 
220 220
 			<?php
221
-			$this->extra_tablenav( $which );
222
-			$this->pagination( $which );
221
+			$this->extra_tablenav($which);
222
+			$this->pagination($which);
223 223
 			?>
224 224
 
225 225
 			<br class="clear"/>
@@ -237,19 +237,19 @@  discard block
 block discarded – undo
237 237
 	 *
238 238
 	 * @return void
239 239
 	 */
240
-	function bulk_actions( $which = '' ) {
240
+	function bulk_actions($which = '') {
241 241
 		// These aren't really bulk actions but this outputs the markup in the right place
242 242
 		static $give_api_is_bottom;
243 243
 
244
-		if ( $give_api_is_bottom ) {
244
+		if ($give_api_is_bottom) {
245 245
 			return;
246 246
 		}
247 247
 		?>
248 248
 		<input type="hidden" name="give_action" value="process_api_key"/>
249 249
 		<input type="hidden" name="give_api_process" value="generate"/>
250
-		<?php wp_nonce_field( 'give-api-nonce' ); ?>
250
+		<?php wp_nonce_field('give-api-nonce'); ?>
251 251
 		<?php echo Give()->html->ajax_user_search(); ?>
252
-		<?php submit_button( esc_html__( 'Generate New API Keys', 'give' ), 'secondary', 'submit', false ); ?>
252
+		<?php submit_button(esc_html__('Generate New API Keys', 'give'), 'secondary', 'submit', false); ?>
253 253
 		<?php
254 254
 		$give_api_is_bottom = true;
255 255
 	}
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 	 * @return int Current page number
263 263
 	 */
264 264
 	public function get_paged() {
265
-		return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1;
265
+		return isset($_GET['paged']) ? absint($_GET['paged']) : 1;
266 266
 	}
267 267
 
268 268
 	/**
@@ -273,21 +273,21 @@  discard block
 block discarded – undo
273 273
 	 * @return array
274 274
 	 */
275 275
 	public function query() {
276
-		$users = get_users( array(
276
+		$users = get_users(array(
277 277
 			'meta_value' => 'give_user_secret_key',
278 278
 			'number'     => $this->per_page,
279
-			'offset'     => $this->per_page * ( $this->get_paged() - 1 ),
280
-		) );
281
-		$keys  = array();
282
-
283
-		foreach ( $users as $user ) {
284
-			$keys[ $user->ID ]['id']    = $user->ID;
285
-			$keys[ $user->ID ]['email'] = $user->user_email;
286
-			$keys[ $user->ID ]['user']  = '<a href="' . add_query_arg( 'user_id', $user->ID, 'user-edit.php' ) . '"><strong>' . $user->user_login . '</strong></a>';
287
-
288
-			$keys[ $user->ID ]['key']    = Give()->api->get_user_public_key( $user->ID );
289
-			$keys[ $user->ID ]['secret'] = Give()->api->get_user_secret_key( $user->ID );
290
-			$keys[ $user->ID ]['token']  = Give()->api->get_token( $user->ID );
279
+			'offset'     => $this->per_page * ($this->get_paged() - 1),
280
+		));
281
+		$keys = array();
282
+
283
+		foreach ($users as $user) {
284
+			$keys[$user->ID]['id']    = $user->ID;
285
+			$keys[$user->ID]['email'] = $user->user_email;
286
+			$keys[$user->ID]['user']  = '<a href="'.add_query_arg('user_id', $user->ID, 'user-edit.php').'"><strong>'.$user->user_login.'</strong></a>';
287
+
288
+			$keys[$user->ID]['key']    = Give()->api->get_user_public_key($user->ID);
289
+			$keys[$user->ID]['secret'] = Give()->api->get_user_secret_key($user->ID);
290
+			$keys[$user->ID]['token']  = Give()->api->get_token($user->ID);
291 291
 		}
292 292
 
293 293
 		return $keys;
@@ -304,13 +304,13 @@  discard block
 block discarded – undo
304 304
 	public function total_items() {
305 305
 		global $wpdb;
306 306
 
307
-		if ( ! get_transient( 'give_total_api_keys' ) ) {
308
-			$total_items = $wpdb->get_var( "SELECT count(user_id) FROM $wpdb->usermeta WHERE meta_value='give_user_secret_key'" );
307
+		if ( ! get_transient('give_total_api_keys')) {
308
+			$total_items = $wpdb->get_var("SELECT count(user_id) FROM $wpdb->usermeta WHERE meta_value='give_user_secret_key'");
309 309
 
310
-			set_transient( 'give_total_api_keys', $total_items, 60 * 60 );
310
+			set_transient('give_total_api_keys', $total_items, 60 * 60);
311 311
 		}
312 312
 
313
-		return get_transient( 'give_total_api_keys' );
313
+		return get_transient('give_total_api_keys');
314 314
 	}
315 315
 
316 316
 	/**
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
 		$hidden   = array(); // No hidden columns
327 327
 		$sortable = array(); // Not sortable... for now
328 328
 
329
-		$this->_column_headers = array( $columns, $hidden, $sortable );
329
+		$this->_column_headers = array($columns, $hidden, $sortable);
330 330
 
331 331
 		$data = $this->query();
332 332
 
@@ -334,10 +334,10 @@  discard block
 block discarded – undo
334 334
 
335 335
 		$this->items = $data;
336 336
 
337
-		$this->set_pagination_args( array(
337
+		$this->set_pagination_args(array(
338 338
 				'total_items' => $total_items,
339 339
 				'per_page'    => $this->per_page,
340
-				'total_pages' => ceil( $total_items / $this->per_page ),
340
+				'total_pages' => ceil($total_items / $this->per_page),
341 341
 			)
342 342
 		);
343 343
 	}
Please login to merge, or discard this patch.
includes/admin/reporting/tools/tools-actions.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -20,10 +20,10 @@  discard block
 block discarded – undo
20 20
  * @since  1.5
21 21
  */
22 22
 function give_register_batch_recount_export_classes() {
23
-	add_action( 'give_batch_export_class_include', 'give_include_batch_export_class', 10, 1 );
23
+	add_action('give_batch_export_class_include', 'give_include_batch_export_class', 10, 1);
24 24
 }
25 25
 
26
-add_action( 'give_register_batch_exporter', 'give_register_batch_recount_export_classes', 10 );
26
+add_action('give_register_batch_exporter', 'give_register_batch_recount_export_classes', 10);
27 27
 
28 28
 
29 29
 /**
@@ -35,31 +35,31 @@  discard block
 block discarded – undo
35 35
  *
36 36
  * @return void
37 37
  */
38
-function give_include_batch_export_class( $class ) {
39
-	switch ( $class ) {
38
+function give_include_batch_export_class($class) {
39
+	switch ($class) {
40 40
 
41 41
 		case 'Give_Tools_Delete_Test_Transactions':
42
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools/class-give-tools-delete-test-transactions.php';
42
+			require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/tools/class-give-tools-delete-test-transactions.php';
43 43
 			break;
44 44
 
45 45
 		case 'Give_Tools_Recount_Customer_Stats':
46
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools/class-give-tools-recount-customer-stats.php';
46
+			require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/tools/class-give-tools-recount-customer-stats.php';
47 47
 			break;
48 48
 
49 49
 		case 'Give_Tools_Reset_Stats':
50
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools/class-give-tools-reset-stats.php';
50
+			require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/tools/class-give-tools-reset-stats.php';
51 51
 			break;
52 52
 
53 53
 		case 'Give_Tools_Recount_All_Stats':
54
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools/class-give-tools-recount-all-stats.php';
54
+			require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/tools/class-give-tools-recount-all-stats.php';
55 55
 			break;
56 56
 
57 57
 		case 'Give_Tools_Recount_Form_Stats':
58
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools/class-give-tools-recount-form-stats.php';
58
+			require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/tools/class-give-tools-recount-form-stats.php';
59 59
 			break;
60 60
 
61 61
 		case 'Give_Tools_Recount_Income':
62
-			require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/tools/class-give-tools-recount-income.php';
62
+			require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/tools/class-give-tools-recount-income.php';
63 63
 			break;
64 64
 	}
65 65
 }
Please login to merge, or discard this patch.
includes/admin/reporting/export/class-batch-export-payments.php 1 patch
Spacing   +71 added lines, -71 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 1', 'give' ),
48
-			'address2'  => esc_html__( 'Address 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__( '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 1', 'give'),
48
+			'address2'  => esc_html__('Address 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__('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
 			);
@@ -100,11 +100,11 @@  discard block
 block discarded – undo
100 100
 		}
101 101
 
102 102
 		// Add category or tag to payment query if any.
103
-		if ( ! empty( $this->categories ) || ! empty( $this->tags ) ) {
103
+		if ( ! empty($this->categories) || ! empty($this->tags)) {
104 104
 			$form_args = array(
105 105
 				'post_type'      => 'give_forms',
106 106
 				'post_status'    => 'publish',
107
-				'posts_per_page' => - 1,
107
+				'posts_per_page' => -1,
108 108
 				'fields'         => 'ids',
109 109
 				'tax_query'      => array(
110 110
 					'relation' => 'AND',
@@ -112,75 +112,75 @@  discard block
 block discarded – undo
112 112
 			);
113 113
 
114 114
 
115
-			if ( ! empty( $this->categories ) ) {
115
+			if ( ! empty($this->categories)) {
116 116
 				$form_args['tax_query'][] = array(
117 117
 					'taxonomy' => 'give_forms_category',
118 118
 					'terms'    => $this->categories,
119 119
 				);
120 120
 			}
121 121
 
122
-			if ( ! empty( $this->tags ) ) {
122
+			if ( ! empty($this->tags)) {
123 123
 				$form_args['tax_query'][] = array(
124 124
 					'taxonomy' => 'give_forms_tag',
125 125
 					'terms'    => $this->tags,
126 126
 				);
127 127
 			}
128 128
 
129
-			$forms = new WP_Query( $form_args );
129
+			$forms = new WP_Query($form_args);
130 130
 
131
-			if ( empty( $forms->posts ) ) {
131
+			if (empty($forms->posts)) {
132 132
 				return array();
133 133
 			}
134 134
 
135 135
 			$args['give_forms'] = $forms->posts;
136 136
 		}
137 137
 
138
-		$payments = give_get_payments( $args );
138
+		$payments = give_get_payments($args);
139 139
 
140
-		if ( $payments ) {
140
+		if ($payments) {
141 141
 
142
-			foreach ( $payments as $payment ) {
143
-				$payment_meta = give_get_payment_meta( $payment->ID );
144
-				$user_info    = give_get_payment_meta_user_info( $payment->ID );
145
-				$total        = give_get_payment_amount( $payment->ID );
146
-				$user_id      = isset( $user_info['id'] ) && $user_info['id'] != - 1 ? $user_info['id'] : $user_info['email'];
142
+			foreach ($payments as $payment) {
143
+				$payment_meta = give_get_payment_meta($payment->ID);
144
+				$user_info    = give_get_payment_meta_user_info($payment->ID);
145
+				$total        = give_get_payment_amount($payment->ID);
146
+				$user_id      = isset($user_info['id']) && $user_info['id'] != - 1 ? $user_info['id'] : $user_info['email'];
147 147
 				$products     = '';
148 148
 				$skus         = '';
149 149
 
150
-				if ( is_numeric( $user_id ) ) {
151
-					$user = get_userdata( $user_id );
150
+				if (is_numeric($user_id)) {
151
+					$user = get_userdata($user_id);
152 152
 				} else {
153 153
 					$user = false;
154 154
 				}
155 155
 
156 156
 				$data[] = array(
157 157
 					'id'        => $payment->ID,
158
-					'seq_id'    => give_get_payment_number( $payment->ID ),
158
+					'seq_id'    => give_get_payment_number($payment->ID),
159 159
 					'email'     => $payment_meta['email'],
160 160
 					'first'     => $user_info['first_name'],
161 161
 					'last'      => $user_info['last_name'],
162
-					'address1'  => isset( $user_info['address']['line1'] ) ? $user_info['address']['line1'] : '',
163
-					'address2'  => isset( $user_info['address']['line2'] ) ? $user_info['address']['line2'] : '',
164
-					'city'      => isset( $user_info['address']['city'] ) ? $user_info['address']['city'] : '',
165
-					'state'     => isset( $user_info['address']['state'] ) ? $user_info['address']['state'] : '',
166
-					'country'   => isset( $user_info['address']['country'] ) ? $user_info['address']['country'] : '',
167
-					'zip'       => isset( $user_info['address']['zip'] ) ? $user_info['address']['zip'] : '',
168
-					'form_id'   => isset( $payment_meta['form_id'] ) ? $payment_meta['form_id'] : '',
169
-					'form_name' => isset( $payment_meta['form_title'] ) ? $payment_meta['form_title'] : '',
162
+					'address1'  => isset($user_info['address']['line1']) ? $user_info['address']['line1'] : '',
163
+					'address2'  => isset($user_info['address']['line2']) ? $user_info['address']['line2'] : '',
164
+					'city'      => isset($user_info['address']['city']) ? $user_info['address']['city'] : '',
165
+					'state'     => isset($user_info['address']['state']) ? $user_info['address']['state'] : '',
166
+					'country'   => isset($user_info['address']['country']) ? $user_info['address']['country'] : '',
167
+					'zip'       => isset($user_info['address']['zip']) ? $user_info['address']['zip'] : '',
168
+					'form_id'   => isset($payment_meta['form_id']) ? $payment_meta['form_id'] : '',
169
+					'form_name' => isset($payment_meta['form_title']) ? $payment_meta['form_title'] : '',
170 170
 					'skus'      => $skus,
171
-					'amount'    => html_entity_decode( give_format_amount( $total ) ),
172
-					'gateway'   => give_get_gateway_admin_label( get_post_meta( $payment->ID, '_give_payment_gateway', true ) ),
173
-					'trans_id'  => give_get_payment_transaction_id( $payment->ID ),
171
+					'amount'    => html_entity_decode(give_format_amount($total)),
172
+					'gateway'   => give_get_gateway_admin_label(get_post_meta($payment->ID, '_give_payment_gateway', true)),
173
+					'trans_id'  => give_get_payment_transaction_id($payment->ID),
174 174
 					'key'       => $payment_meta['key'],
175 175
 					'date'      => $payment->post_date,
176
-					'user'      => $user ? $user->display_name : __( 'guest', 'give' ),
177
-					'status'    => give_get_payment_status( $payment, true )
176
+					'user'      => $user ? $user->display_name : __('guest', 'give'),
177
+					'status'    => give_get_payment_status($payment, true)
178 178
 				);
179 179
 
180 180
 			}
181 181
 
182
-			$data = apply_filters( 'give_export_get_data', $data );
183
-			$data = apply_filters( "give_export_get_data_{$this->export_type}", $data );
182
+			$data = apply_filters('give_export_get_data', $data);
183
+			$data = apply_filters("give_export_get_data_{$this->export_type}", $data);
184 184
 
185 185
 			return $data;
186 186
 
@@ -200,27 +200,27 @@  discard block
 block discarded – undo
200 200
 
201 201
 		$status = $this->status;
202 202
 		$args   = array(
203
-			'start-date' => date( 'n/d/Y', strtotime( $this->start ) ),
204
-			'end-date'   => date( 'n/d/Y', strtotime( $this->end ) ),
203
+			'start-date' => date('n/d/Y', strtotime($this->start)),
204
+			'end-date'   => date('n/d/Y', strtotime($this->end)),
205 205
 		);
206 206
 
207
-		if ( 'any' == $status ) {
207
+		if ('any' == $status) {
208 208
 
209
-			$total = array_sum( (array) give_count_payments( $args ) );
209
+			$total = array_sum((array) give_count_payments($args));
210 210
 
211 211
 		} else {
212 212
 
213
-			$total = give_count_payments( $args )->$status;
213
+			$total = give_count_payments($args)->$status;
214 214
 
215 215
 		}
216 216
 
217 217
 		$percentage = 100;
218 218
 
219
-		if ( $total > 0 ) {
220
-			$percentage = ( ( 30 * $this->step ) / $total ) * 100;
219
+		if ($total > 0) {
220
+			$percentage = ((30 * $this->step) / $total) * 100;
221 221
 		}
222 222
 
223
-		if ( $percentage > 100 ) {
223
+		if ($percentage > 100) {
224 224
 			$percentage = 100;
225 225
 		}
226 226
 
@@ -234,11 +234,11 @@  discard block
 block discarded – undo
234 234
 	 *
235 235
 	 * @param array $request The Form Data passed into the batch processing.
236 236
 	 */
237
-	public function set_properties( $request ) {
238
-		$this->start      = isset( $request['start'] ) ? sanitize_text_field( $request['start'] ) : '';
239
-		$this->end        = isset( $request['end'] ) ? sanitize_text_field( $request['end'] ) : '';
240
-		$this->status     = isset( $request['status'] ) ? sanitize_text_field( $request['status'] ) : 'complete';
241
-		$this->categories = isset( $request['give_forms_categories'] ) ? give_clean( $request['give_forms_categories'] ) : array();
242
-		$this->tags       = isset( $request['give_forms_tags'] ) ? give_clean( $request['give_forms_tags'] ) : array();
237
+	public function set_properties($request) {
238
+		$this->start      = isset($request['start']) ? sanitize_text_field($request['start']) : '';
239
+		$this->end        = isset($request['end']) ? sanitize_text_field($request['end']) : '';
240
+		$this->status     = isset($request['status']) ? sanitize_text_field($request['status']) : 'complete';
241
+		$this->categories = isset($request['give_forms_categories']) ? give_clean($request['give_forms_categories']) : array();
242
+		$this->tags       = isset($request['give_forms_tags']) ? give_clean($request['give_forms_tags']) : array();
243 243
 	}
244 244
 }
Please login to merge, or discard this patch.
includes/admin/reporting/logs.php 1 patch
Spacing   +14 added lines, -14 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
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
  * @return void
24 24
  */
25 25
 function give_logs_view_sales() {
26
-	include( dirname( __FILE__ ) . '/class-sales-logs-list-table.php' );
26
+	include(dirname(__FILE__).'/class-sales-logs-list-table.php');
27 27
 
28 28
 	$logs_table = new Give_Sales_Log_Table();
29 29
 	$logs_table->prepare_items();
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 }
33 33
 
34
-add_action( 'give_logs_view_sales', 'give_logs_view_sales' );
34
+add_action('give_logs_view_sales', 'give_logs_view_sales');
35 35
 
36 36
 
37 37
 /**
@@ -43,14 +43,14 @@  discard block
 block discarded – undo
43 43
  * @return void
44 44
  */
45 45
 function give_logs_view_gateway_errors() {
46
-	include( dirname( __FILE__ ) . '/class-gateway-error-logs-list-table.php' );
46
+	include(dirname(__FILE__).'/class-gateway-error-logs-list-table.php');
47 47
 
48 48
 	$logs_table = new Give_Gateway_Error_Log_Table();
49 49
 	$logs_table->prepare_items();
50 50
 	$logs_table->display();
51 51
 }
52 52
 
53
-add_action( 'give_logs_view_gateway_errors', 'give_logs_view_gateway_errors' );
53
+add_action('give_logs_view_gateway_errors', 'give_logs_view_gateway_errors');
54 54
 
55 55
 /**
56 56
  * API Request Logs
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
  * @return void
63 63
  */
64 64
 function give_logs_view_api_requests() {
65
-	include( dirname( __FILE__ ) . '/class-api-requests-logs-list-table.php' );
65
+	include(dirname(__FILE__).'/class-api-requests-logs-list-table.php');
66 66
 
67 67
 	$logs_table = new Give_API_Request_Log_Table();
68 68
 	$logs_table->prepare_items();
@@ -75,12 +75,12 @@  discard block
 block discarded – undo
75 75
 		 *
76 76
 		 * @since 1.0
77 77
 		 */
78
-		do_action( 'give_logs_api_requests_top' );
78
+		do_action('give_logs_api_requests_top');
79 79
 		?>
80 80
 
81 81
 		<form id="give-logs-filter" method="get" action="<?php echo 'edit.php?post_type=give_forms&page=give-tools&tab=logs'; ?>">
82 82
 			<?php
83
-			$logs_table->search_box( esc_html__( 'Search', 'give' ), 'give-api-requests' );
83
+			$logs_table->search_box(esc_html__('Search', 'give'), 'give-api-requests');
84 84
 			$logs_table->display();
85 85
 			?>
86 86
 			<input type="hidden" name="post_type" value="give_forms"/>
@@ -93,14 +93,14 @@  discard block
 block discarded – undo
93 93
 		 *
94 94
 		 * @since 1.0
95 95
 		 */
96
-		do_action( 'give_logs_api_requests_bottom' );
96
+		do_action('give_logs_api_requests_bottom');
97 97
 		?>
98 98
 
99 99
 	</div>
100 100
 	<?php
101 101
 }
102 102
 
103
-add_action( 'give_logs_view_api_requests', 'give_logs_view_api_requests' );
103
+add_action('give_logs_view_api_requests', 'give_logs_view_api_requests');
104 104
 
105 105
 /**
106 106
  * Renders the Reports page views drop down
@@ -112,11 +112,11 @@  discard block
 block discarded – undo
112 112
 	$current_section = give_get_current_setting_section();
113 113
 
114 114
 	// If there are not any event attach to action then do not show form.
115
-	if ( ! has_action( 'give_log_view_actions' ) ) {
115
+	if ( ! has_action('give_log_view_actions')) {
116 116
 		return;
117 117
 	}
118 118
 	?>
119
-	<form id="give-logs-filter" method="get" action="<?php echo 'edit.php?post_type=give_forms&page=give-tools&tab=logs&section=' . $current_section; ?>">
119
+	<form id="give-logs-filter" method="get" action="<?php echo 'edit.php?post_type=give_forms&page=give-tools&tab=logs&section='.$current_section; ?>">
120 120
 		<?php
121 121
 		/**
122 122
 		 * Fires after displaying the reports page views drop down.
@@ -125,14 +125,14 @@  discard block
 block discarded – undo
125 125
 		 *
126 126
 		 * @since 1.0
127 127
 		 */
128
-		do_action( 'give_log_view_actions' );
128
+		do_action('give_log_view_actions');
129 129
 		?>
130 130
 
131 131
 		<input type="hidden" name="post_type" value="give_forms"/>
132 132
 		<input type="hidden" name="page" value="give-tools"/>
133 133
 		<input type="hidden" name="tab" value="logs"/>
134 134
 
135
-		<?php submit_button( esc_html__( 'Apply', 'give' ), 'secondary', 'submit', false ); ?>
135
+		<?php submit_button(esc_html__('Apply', 'give'), 'secondary', 'submit', false); ?>
136 136
 	</form>
137 137
 	<?php
138 138
 }
Please login to merge, or discard this patch.
includes/admin/reporting/reports.php 1 patch
Spacing   +107 added lines, -107 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,8 +29,8 @@  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'] ) ? sanitize_text_field( $_GET['tab'] ) : 'earnings';
32
+	$current_page = admin_url('edit.php?post_type=give_forms&page=give-reports');
33
+	$active_tab   = isset($_GET['tab']) ? sanitize_text_field($_GET['tab']) : 'earnings';
34 34
 	$views        = give_reports_default_views();
35 35
 	?>
36 36
 	<div class="wrap">
@@ -38,17 +38,17 @@  discard block
 block discarded – undo
38 38
 		<h1 class="screen-reader-text"><?php echo get_admin_page_title(); ?></h1>
39 39
 
40 40
 		<h2 class="nav-tab-wrapper">
41
-			<?php foreach ( $views as $tab => $label ) { ?>
42
-				<a href="<?php echo esc_url( add_query_arg( array(
41
+			<?php foreach ($views as $tab => $label) { ?>
42
+				<a href="<?php echo esc_url(add_query_arg(array(
43 43
 					'tab'              => $tab,
44 44
 					'settings-updated' => false,
45
-				), $current_page ) ); ?>" class="nav-tab <?php echo $tab === $active_tab ? esc_attr( 'nav-tab-active' ) : ''; ?>"><?php echo esc_html( $label ); ?></a>
45
+				), $current_page)); ?>" class="nav-tab <?php echo $tab === $active_tab ? esc_attr('nav-tab-active') : ''; ?>"><?php echo esc_html($label); ?></a>
46 46
 			<?php } ?>
47
-			<?php if ( current_user_can( 'export_give_reports' ) ) { ?>
48
-				<a href="<?php echo esc_url( add_query_arg( array(
47
+			<?php if (current_user_can('export_give_reports')) { ?>
48
+				<a href="<?php echo esc_url(add_query_arg(array(
49 49
 					'tab'              => 'export',
50 50
 					'settings-updated' => false,
51
-				), $current_page ) ); ?>" class="nav-tab <?php echo 'export' === $active_tab ? esc_attr( 'nav-tab-active' ) : ''; ?>"><?php esc_html_e( 'Export', 'give' ); ?></a>
51
+				), $current_page)); ?>" class="nav-tab <?php echo 'export' === $active_tab ? esc_attr('nav-tab-active') : ''; ?>"><?php esc_html_e('Export', 'give'); ?></a>
52 52
 			<?php }
53 53
 			/**
54 54
 			 * Fires in the report tabs.
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 			 *
58 58
 			 * @since 1.0
59 59
 			 */
60
-			do_action( 'give_reports_tabs' );
60
+			do_action('give_reports_tabs');
61 61
 			?>
62 62
 		</h2>
63 63
 
@@ -67,10 +67,10 @@  discard block
 block discarded – undo
67 67
 		 *
68 68
 		 * @since 1.0
69 69
 		 */
70
-		do_action( 'give_reports_page_top' );
70
+		do_action('give_reports_page_top');
71 71
 
72 72
 		// Set $active_tab prior to hook firing.
73
-		if ( in_array( $active_tab, array_keys( $views ) ) ) {
73
+		if (in_array($active_tab, array_keys($views))) {
74 74
 			$active_tab = 'reports';
75 75
 		}
76 76
 
@@ -79,14 +79,14 @@  discard block
 block discarded – undo
79 79
 		 *
80 80
 		 * @since 1.0
81 81
 		 */
82
-		do_action( "give_reports_tab_{$active_tab}" );
82
+		do_action("give_reports_tab_{$active_tab}");
83 83
 
84 84
 		/**
85 85
 		 * Fires after the report page.
86 86
 		 *
87 87
 		 * @since 1.0
88 88
 		 */
89
-		do_action( 'give_reports_page_bottom' );
89
+		do_action('give_reports_page_bottom');
90 90
 		?>
91 91
 	</div><!-- .wrap -->
92 92
 	<?php
@@ -100,13 +100,13 @@  discard block
 block discarded – undo
100 100
  */
101 101
 function give_reports_default_views() {
102 102
 	$views = array(
103
-		'earnings' => esc_html__( 'Income', 'give' ),
104
-		'forms'    => esc_html__( 'Forms', 'give' ),
105
-		'donors'   => esc_html__( 'Donors', 'give' ),
106
-		'gateways' => esc_html__( 'Donation Methods', 'give' ),
103
+		'earnings' => esc_html__('Income', 'give'),
104
+		'forms'    => esc_html__('Forms', 'give'),
105
+		'donors'   => esc_html__('Donors', 'give'),
106
+		'gateways' => esc_html__('Donation Methods', 'give'),
107 107
 	);
108 108
 
109
-	$views = apply_filters( 'give_report_views', $views );
109
+	$views = apply_filters('give_report_views', $views);
110 110
 
111 111
 	return $views;
112 112
 }
@@ -121,15 +121,15 @@  discard block
 block discarded – undo
121 121
  * @since 1.0
122 122
  * @return string $view Report View
123 123
  */
124
-function give_get_reporting_view( $default = 'earnings' ) {
124
+function give_get_reporting_view($default = 'earnings') {
125 125
 
126
-	if ( ! isset( $_GET['view'] ) || ! in_array( $_GET['view'], array_keys( give_reports_default_views() ) ) ) {
126
+	if ( ! isset($_GET['view']) || ! in_array($_GET['view'], array_keys(give_reports_default_views()))) {
127 127
 		$view = $default;
128 128
 	} else {
129 129
 		$view = $_GET['view'];
130 130
 	}
131 131
 
132
-	return apply_filters( 'give_get_reporting_view', $view );
132
+	return apply_filters('give_get_reporting_view', $view);
133 133
 }
134 134
 
135 135
 /**
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	$current_view = 'earnings';
143 143
 	$views        = give_reports_default_views();
144 144
 
145
-	if ( isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $views ) ) {
145
+	if (isset($_GET['tab']) && array_key_exists($_GET['tab'], $views)) {
146 146
 		$current_view = $_GET['tab'];
147 147
 	}
148 148
 
@@ -151,10 +151,10 @@  discard block
 block discarded – undo
151 151
 	 *
152 152
 	 * @since 1.0
153 153
 	 */
154
-	do_action( "give_reports_view_{$current_view}" );
154
+	do_action("give_reports_view_{$current_view}");
155 155
 }
156 156
 
157
-add_action( 'give_reports_tab_reports', 'give_reports_tab_reports' );
157
+add_action('give_reports_tab_reports', 'give_reports_tab_reports');
158 158
 
159 159
 /**
160 160
  * Renders the Reports Page Views Drop Downs
@@ -164,19 +164,19 @@  discard block
 block discarded – undo
164 164
  */
165 165
 function give_report_views() {
166 166
 	$views        = give_reports_default_views();
167
-	$current_view = isset( $_GET['view'] ) ? $_GET['view'] : 'earnings';
167
+	$current_view = isset($_GET['view']) ? $_GET['view'] : 'earnings';
168 168
 	/**
169 169
 	 * Fires before the report page actions form.
170 170
 	 *
171 171
 	 * @since 1.0
172 172
 	 */
173
-	do_action( 'give_report_view_actions_before' );
173
+	do_action('give_report_view_actions_before');
174 174
 	?>
175 175
 	<form id="give-reports-filter" method="get">
176 176
 		<select id="give-reports-view" name="view">
177
-			<option value="-1"><?php esc_html_e( 'Report Type', 'give' ); ?></option>
178
-			<?php foreach ( $views as $view_id => $label ) : ?>
179
-				<option value="<?php echo esc_attr( $view_id ); ?>" <?php selected( $view_id, $current_view ); ?>><?php echo $label; ?></option>
177
+			<option value="-1"><?php esc_html_e('Report Type', 'give'); ?></option>
178
+			<?php foreach ($views as $view_id => $label) : ?>
179
+				<option value="<?php echo esc_attr($view_id); ?>" <?php selected($view_id, $current_view); ?>><?php echo $label; ?></option>
180 180
 			<?php endforeach; ?>
181 181
 		</select>
182 182
 
@@ -188,12 +188,12 @@  discard block
 block discarded – undo
188 188
 		 *
189 189
 		 * @since 1.0
190 190
 		 */
191
-		do_action( 'give_report_view_actions' );
191
+		do_action('give_report_view_actions');
192 192
 		?>
193 193
 
194 194
 		<input type="hidden" name="post_type" value="give_forms"/>
195 195
 		<input type="hidden" name="page" value="give-reports"/>
196
-		<?php submit_button( esc_html__( 'Show', 'give' ), 'secondary', 'submit', false ); ?>
196
+		<?php submit_button(esc_html__('Show', 'give'), 'secondary', 'submit', false); ?>
197 197
 	</form>
198 198
 	<?php
199 199
 	/**
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 	 *
202 202
 	 * @since 1.0
203 203
 	 */
204
-	do_action( 'give_report_view_actions_after' );
204
+	do_action('give_report_view_actions_after');
205 205
 }
206 206
 
207 207
 /**
@@ -214,18 +214,18 @@  discard block
 block discarded – undo
214 214
  */
215 215
 function give_reports_forms_table() {
216 216
 
217
-	if ( isset( $_GET['form-id'] ) ) {
217
+	if (isset($_GET['form-id'])) {
218 218
 		return;
219 219
 	}
220 220
 
221
-	include( dirname( __FILE__ ) . '/class-form-reports-table.php' );
221
+	include(dirname(__FILE__).'/class-form-reports-table.php');
222 222
 
223 223
 	$give_table = new Give_Form_Reports_Table();
224 224
 	$give_table->prepare_items();
225 225
 	$give_table->display();
226 226
 }
227 227
 
228
-add_action( 'give_reports_view_forms', 'give_reports_forms_table' );
228
+add_action('give_reports_view_forms', 'give_reports_forms_table');
229 229
 
230 230
 /**
231 231
  * Renders the detailed report for a specific give form
@@ -234,20 +234,20 @@  discard block
 block discarded – undo
234 234
  * @return void
235 235
  */
236 236
 function give_reports_form_details() {
237
-	if ( ! isset( $_GET['form-id'] ) ) {
237
+	if ( ! isset($_GET['form-id'])) {
238 238
 		return;
239 239
 	}
240 240
 	?>
241 241
 	<div class="tablenav top reports-forms-details-wrap">
242 242
 		<div class="actions bulkactions">
243
-			<button onclick="history.go(-1);" class="button-secondary"><?php esc_html_e( 'Go Back', 'give' ); ?></button>
243
+			<button onclick="history.go(-1);" class="button-secondary"><?php esc_html_e('Go Back', 'give'); ?></button>
244 244
 		</div>
245 245
 	</div>
246 246
 	<?php
247
-	give_reports_graph_of_form( absint( $_GET['form-id'] ) );
247
+	give_reports_graph_of_form(absint($_GET['form-id']));
248 248
 }
249 249
 
250
-add_action( 'give_reports_view_forms', 'give_reports_form_details' );
250
+add_action('give_reports_view_forms', 'give_reports_form_details');
251 251
 
252 252
 /**
253 253
  * Renders the Reports Donors Table
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
  * @return void
259 259
  */
260 260
 function give_reports_donors_table() {
261
-	include( dirname( __FILE__ ) . '/class-donor-reports-table.php' );
261
+	include(dirname(__FILE__).'/class-donor-reports-table.php');
262 262
 
263 263
 	$give_table = new Give_Donor_Reports_Table();
264 264
 	$give_table->prepare_items();
@@ -270,11 +270,11 @@  discard block
 block discarded – undo
270 270
 		 *
271 271
 		 * @since 1.0
272 272
 		 */
273
-		do_action( 'give_logs_donors_table_top' );
273
+		do_action('give_logs_donors_table_top');
274 274
 		?>
275 275
 		<form id="give-donors-filter" method="get">
276 276
 			<?php
277
-			$give_table->search_box( esc_html__( 'Search', 'give' ), 'give-donors' );
277
+			$give_table->search_box(esc_html__('Search', 'give'), 'give-donors');
278 278
 			$give_table->display();
279 279
 			?>
280 280
 			<input type="hidden" name="post_type" value="give_forms"/>
@@ -287,13 +287,13 @@  discard block
 block discarded – undo
287 287
 		 *
288 288
 		 * @since 1.0
289 289
 		 */
290
-		do_action( 'give_logs_donors_table_bottom' );
290
+		do_action('give_logs_donors_table_bottom');
291 291
 		?>
292 292
 	</div>
293 293
 	<?php
294 294
 }
295 295
 
296
-add_action( 'give_reports_view_donors', 'give_reports_donors_table' );
296
+add_action('give_reports_view_donors', 'give_reports_donors_table');
297 297
 
298 298
 
299 299
 /**
@@ -305,14 +305,14 @@  discard block
 block discarded – undo
305 305
  * @return void
306 306
  */
307 307
 function give_reports_gateways_table() {
308
-	include( dirname( __FILE__ ) . '/class-gateways-reports-table.php' );
308
+	include(dirname(__FILE__).'/class-gateways-reports-table.php');
309 309
 
310 310
 	$give_table = new Give_Gateawy_Reports_Table();
311 311
 	$give_table->prepare_items();
312 312
 	$give_table->display();
313 313
 }
314 314
 
315
-add_action( 'give_reports_view_gateways', 'give_reports_gateways_table' );
315
+add_action('give_reports_view_gateways', 'give_reports_gateways_table');
316 316
 
317 317
 
318 318
 /**
@@ -324,13 +324,13 @@  discard block
 block discarded – undo
324 324
 function give_reports_earnings() {
325 325
 	?>
326 326
 	<div class="tablenav top reports-table-nav">
327
-		<h3 class="alignleft reports-earnings-title"><span><?php esc_html_e( 'Income Report', 'give' ); ?></span></h3>
327
+		<h3 class="alignleft reports-earnings-title"><span><?php esc_html_e('Income Report', 'give'); ?></span></h3>
328 328
 	</div>
329 329
 	<?php
330 330
 	give_reports_graph();
331 331
 }
332 332
 
333
-add_action( 'give_reports_view_earnings', 'give_reports_earnings' );
333
+add_action('give_reports_view_earnings', 'give_reports_earnings');
334 334
 
335 335
 
336 336
 /**
@@ -351,14 +351,14 @@  discard block
 block discarded – undo
351 351
 				 *
352 352
 				 * @since 1.0
353 353
 				 */
354
-				do_action( 'give_reports_tab_export_content_top' );
354
+				do_action('give_reports_tab_export_content_top');
355 355
 				?>
356 356
 
357 357
 				<table class="widefat export-options-table give-table">
358 358
 					<thead>
359 359
 						<tr>
360
-							<th scope="col"><?php esc_html_e( 'Export Type', 'give' ); ?></th>
361
-							<th scope="col"><?php esc_html_e( 'Export Options', 'give' ); ?></th>
360
+							<th scope="col"><?php esc_html_e('Export Type', 'give'); ?></th>
361
+							<th scope="col"><?php esc_html_e('Export Options', 'give'); ?></th>
362 362
 						</tr>
363 363
 					</thead>
364 364
 					<tbody>
@@ -370,42 +370,42 @@  discard block
 block discarded – undo
370 370
 						 *
371 371
 						 * @since 1.0
372 372
 						 */
373
-						do_action( 'give_reports_tab_export_table_top' );
373
+						do_action('give_reports_tab_export_table_top');
374 374
 						?>
375 375
 						<tr class="give-export-pdf-sales-earnings">
376 376
 							<td scope="row" class="row-title">
377
-								<h3><span><?php esc_html_e( 'Export PDF of Donations and Income', 'give' ); ?></span>
377
+								<h3><span><?php esc_html_e('Export PDF of Donations and Income', 'give'); ?></span>
378 378
 								</h3>
379
-								<p><?php esc_html_e( 'Download a PDF of Donations and Income reports for all forms for the current year.', 'give' ); ?></p>
379
+								<p><?php esc_html_e('Download a PDF of Donations and Income reports for all forms for the current year.', 'give'); ?></p>
380 380
 							</td>
381 381
 							<td>
382
-								<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>
382
+								<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>
383 383
 							</td>
384 384
 						</tr>
385 385
 						<tr class="alternate give-export-sales-earnings">
386 386
 							<td scope="row" class="row-title">
387
-								<h3><span><?php esc_html_e( 'Export Income and Donation Stats', 'give' ); ?></span></h3>
388
-								<p><?php esc_html_e( 'Download a CSV of income and donations over time.', 'give' ); ?></p>
387
+								<h3><span><?php esc_html_e('Export Income and Donation Stats', 'give'); ?></span></h3>
388
+								<p><?php esc_html_e('Download a CSV of income and donations over time.', 'give'); ?></p>
389 389
 							</td>
390 390
 							<td>
391 391
 								<form method="post">
392 392
 									<?php
393 393
 									printf(
394 394
 									/* translators: 1: start date dropdown 2: end date dropdown */
395
-										esc_html__( '%1$s to %2$s', 'give' ),
396
-										Give()->html->year_dropdown( 'start_year' ) . ' ' . Give()->html->month_dropdown( 'start_month' ),
397
-										Give()->html->year_dropdown( 'end_year' ) . ' ' . Give()->html->month_dropdown( 'end_month' )
395
+										esc_html__('%1$s to %2$s', 'give'),
396
+										Give()->html->year_dropdown('start_year').' '.Give()->html->month_dropdown('start_month'),
397
+										Give()->html->year_dropdown('end_year').' '.Give()->html->month_dropdown('end_month')
398 398
 									);
399 399
 									?>
400 400
 									<input type="hidden" name="give-action" value="earnings_export"/>
401
-									<input type="submit" value="<?php esc_attr_e( 'Generate CSV', 'give' ); ?>" class="button-secondary"/>
401
+									<input type="submit" value="<?php esc_attr_e('Generate CSV', 'give'); ?>" class="button-secondary"/>
402 402
 								</form>
403 403
 							</td>
404 404
 						</tr>
405 405
 						<tr class="give-export-payment-history">
406 406
 							<td scope="row" class="row-title">
407
-								<h3><span><?php esc_html_e( 'Export Donation History', 'give' ); ?></span></h3>
408
-								<p><?php esc_html_e( 'Download a CSV of all donations recorded.', 'give' ); ?></p>
407
+								<h3><span><?php esc_html_e('Export Donation History', 'give'); ?></span></h3>
408
+								<p><?php esc_html_e('Download a CSV of all donations recorded.', 'give'); ?></p>
409 409
 							</td>
410 410
 							<td>
411 411
 								<form id="give-export-payments" class="give-export-form" method="post">
@@ -413,27 +413,27 @@  discard block
 block discarded – undo
413 413
 									$args = array(
414 414
 										'id'          => 'give-payment-export-start',
415 415
 										'name'        => 'start',
416
-										'placeholder' => esc_attr__( 'Start date', 'give' ),
416
+										'placeholder' => esc_attr__('Start date', 'give'),
417 417
 									);
418
-									echo Give()->html->date_field( $args ); ?>
418
+									echo Give()->html->date_field($args); ?>
419 419
 									<?php
420 420
 									$args = array(
421 421
 										'id'          => 'give-payment-export-end',
422 422
 										'name'        => 'end',
423
-										'placeholder' => esc_attr__( 'End date', 'give' ),
423
+										'placeholder' => esc_attr__('End date', 'give'),
424 424
 									);
425
-									echo Give()->html->date_field( $args ); ?>
425
+									echo Give()->html->date_field($args); ?>
426 426
 									<select name="status">
427
-										<option value="any"><?php esc_html_e( 'All Statuses', 'give' ); ?></option>
427
+										<option value="any"><?php esc_html_e('All Statuses', 'give'); ?></option>
428 428
 										<?php
429 429
 										$statuses = give_get_payment_statuses();
430
-										foreach ( $statuses as $status => $label ) {
431
-											echo '<option value="' . $status . '">' . $label . '</option>';
430
+										foreach ($statuses as $status => $label) {
431
+											echo '<option value="'.$status.'">'.$label.'</option>';
432 432
 										}
433 433
 										?>
434 434
 									</select>
435 435
 									<?php
436
-									if ( give_is_setting_enabled( give_get_option( 'categories' ) ) ) {
436
+									if (give_is_setting_enabled(give_get_option('categories'))) {
437 437
 										echo Give()->html->category_dropdown(
438 438
 											'give_forms_categories[]',
439 439
 											0,
@@ -443,13 +443,13 @@  discard block
 block discarded – undo
443 443
 												'multiple'        => true,
444 444
 												'selected'        => array(),
445 445
 												'show_option_all' => false,
446
-												'placeholder'     => __( 'Choose one or more from categories', 'give' ),
446
+												'placeholder'     => __('Choose one or more from categories', 'give'),
447 447
 											)
448 448
 										);
449 449
 										$add_break = true;
450 450
 									}
451 451
 
452
-									if ( give_is_setting_enabled( give_get_option( 'tags' ) ) ) {
452
+									if (give_is_setting_enabled(give_get_option('tags'))) {
453 453
 										echo Give()->html->tags_dropdown(
454 454
 											'give_forms_tags[]',
455 455
 											0,
@@ -459,17 +459,17 @@  discard block
 block discarded – undo
459 459
 												'multiple'        => true,
460 460
 												'selected'        => array(),
461 461
 												'show_option_all' => false,
462
-												'placeholder'     => __( 'Choose one or more from tags', 'give' ),
462
+												'placeholder'     => __('Choose one or more from tags', 'give'),
463 463
 											)
464 464
 										);
465 465
 										$add_break = true;
466 466
 									}
467 467
 
468
-									wp_nonce_field( 'give_ajax_export', 'give_ajax_export' );
468
+									wp_nonce_field('give_ajax_export', 'give_ajax_export');
469 469
 									?>
470 470
 									<input type="hidden" name="give-export-class" value="Give_Batch_Payments_Export"/>
471 471
 									<span>
472
-									<input type="submit" value="<?php esc_attr_e( 'Generate CSV', 'give' ); ?>" class="button-secondary"/>
472
+									<input type="submit" value="<?php esc_attr_e('Generate CSV', 'give'); ?>" class="button-secondary"/>
473 473
 									<span class="spinner"></span>
474 474
 								</span>
475 475
 								</form>
@@ -477,8 +477,8 @@  discard block
 block discarded – undo
477 477
 						</tr>
478 478
 						<tr class="alternate give-export-donors">
479 479
 							<td scope="row" class="row-title">
480
-								<h3><span><?php esc_html_e( 'Export Donors in CSV', 'give' ); ?></span></h3>
481
-								<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>
480
+								<h3><span><?php esc_html_e('Export Donors in CSV', 'give'); ?></span></h3>
481
+								<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>
482 482
 							</td>
483 483
 							<td>
484 484
 								<form method="post" id="give_donor_export" class="give-export-form">
@@ -489,44 +489,44 @@  discard block
 block discarded – undo
489 489
 										'id'     => 'give_customer_export_form',
490 490
 										'chosen' => true,
491 491
 									);
492
-									echo Give()->html->forms_dropdown( $args ); ?>
492
+									echo Give()->html->forms_dropdown($args); ?>
493 493
 
494
-									<input type="submit" value="<?php esc_attr_e( 'Generate CSV', 'give' ); ?>" class="button-secondary"/>
494
+									<input type="submit" value="<?php esc_attr_e('Generate CSV', 'give'); ?>" class="button-secondary"/>
495 495
 
496 496
 									<div id="export-donor-options-wrap" class="give-clearfix">
497
-										<p><?php esc_html_e( 'Export Columns:', 'give' ); ?></p>
497
+										<p><?php esc_html_e('Export Columns:', 'give'); ?></p>
498 498
 										<ul id="give-export-option-ul">
499 499
 											<li>
500
-												<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' ); ?>
500
+												<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'); ?>
501 501
 												</label>
502 502
 											</li>
503 503
 											<li>
504
-												<label for="give-export-email"><input type="checkbox" checked name="give_export_option[email]" id="give-export-email"><?php esc_html_e( 'Email', 'give' ); ?>
504
+												<label for="give-export-email"><input type="checkbox" checked name="give_export_option[email]" id="give-export-email"><?php esc_html_e('Email', 'give'); ?>
505 505
 												</label>
506 506
 											</li>
507 507
 											<li>
508
-												<label for="give-export-address"><input type="checkbox" checked name="give_export_option[address]" id="give-export-address"><?php esc_html_e( 'Address', 'give' ); ?>
508
+												<label for="give-export-address"><input type="checkbox" checked name="give_export_option[address]" id="give-export-address"><?php esc_html_e('Address', 'give'); ?>
509 509
 												</label>
510 510
 											</li>
511 511
 											<li>
512
-												<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' ); ?>
512
+												<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'); ?>
513 513
 												</label>
514 514
 											</li>
515 515
 											<li>
516
-												<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' ); ?>
516
+												<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'); ?>
517 517
 												</label>
518 518
 											</li>
519 519
 											<li>
520
-												<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' ); ?>
520
+												<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'); ?>
521 521
 												</label>
522 522
 											</li>
523 523
 											<li>
524
-												<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' ); ?>
524
+												<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'); ?>
525 525
 												</label>
526 526
 											</li>
527 527
 										</ul>
528 528
 									</div>
529
-									<?php wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); ?>
529
+									<?php wp_nonce_field('give_ajax_export', 'give_ajax_export'); ?>
530 530
 									<input type="hidden" name="give-export-class" value="Give_Batch_Customers_Export"/>
531 531
 									<input type="hidden" name="give-action" value="email_export"/>
532 532
 								</form>
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
 						 *
541 541
 						 * @since 1.0
542 542
 						 */
543
-						do_action( 'give_reports_tab_export_table_bottom' );
543
+						do_action('give_reports_tab_export_table_bottom');
544 544
 						?>
545 545
 					</tbody>
546 546
 				</table>
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 				 *
552 552
 				 * @since 1.0
553 553
 				 */
554
-				do_action( 'give_reports_tab_export_content_bottom' );
554
+				do_action('give_reports_tab_export_content_bottom');
555 555
 				?>
556 556
 
557 557
 			</div>
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
 	<?php
563 563
 }
564 564
 
565
-add_action( 'give_reports_tab_export', 'give_reports_tab_export' );
565
+add_action('give_reports_tab_export', 'give_reports_tab_export');
566 566
 
567 567
 /**
568 568
  * Renders the Reports page
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
  */
573 573
 function give_reports_tab_logs() {
574 574
 
575
-	require( GIVE_PLUGIN_DIR . 'includes/admin/reporting/logs.php' );
575
+	require(GIVE_PLUGIN_DIR.'includes/admin/reporting/logs.php');
576 576
 
577 577
 	// Get current section.
578 578
 	$current_section = $_GET['section'] = give_get_current_setting_section();
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
 	 *
583 583
 	 * @since 1.0
584 584
 	 */
585
-	do_action( "give_logs_view_{$current_section}" );
585
+	do_action("give_logs_view_{$current_section}");
586 586
 }
587 587
 
588 588
 /**
@@ -593,9 +593,9 @@  discard block
 block discarded – undo
593 593
  */
594 594
 function give_estimated_monthly_stats() {
595 595
 
596
-	$estimated = get_transient( 'give_estimated_monthly_stats' );
596
+	$estimated = get_transient('give_estimated_monthly_stats');
597 597
 
598
-	if ( false === $estimated ) {
598
+	if (false === $estimated) {
599 599
 
600 600
 		$estimated = array(
601 601
 			'earnings' => 0,
@@ -604,20 +604,20 @@  discard block
 block discarded – undo
604 604
 
605 605
 		$stats = new Give_Payment_Stats;
606 606
 
607
-		$to_date_earnings = $stats->get_earnings( 0, 'this_month' );
608
-		$to_date_sales    = $stats->get_sales( 0, 'this_month' );
607
+		$to_date_earnings = $stats->get_earnings(0, 'this_month');
608
+		$to_date_sales    = $stats->get_sales(0, 'this_month');
609 609
 
610
-		$current_day   = date( 'd', current_time( 'timestamp' ) );
611
-		$current_month = date( 'n', current_time( 'timestamp' ) );
612
-		$current_year  = date( 'Y', current_time( 'timestamp' ) );
613
-		$days_in_month = cal_days_in_month( CAL_GREGORIAN, $current_month, $current_year );
610
+		$current_day   = date('d', current_time('timestamp'));
611
+		$current_month = date('n', current_time('timestamp'));
612
+		$current_year  = date('Y', current_time('timestamp'));
613
+		$days_in_month = cal_days_in_month(CAL_GREGORIAN, $current_month, $current_year);
614 614
 
615
-		$estimated['earnings'] = ( $to_date_earnings / $current_day ) * $days_in_month;
616
-		$estimated['sales']    = ( $to_date_sales / $current_day ) * $days_in_month;
615
+		$estimated['earnings'] = ($to_date_earnings / $current_day) * $days_in_month;
616
+		$estimated['sales']    = ($to_date_sales / $current_day) * $days_in_month;
617 617
 
618 618
 		// Cache for one day
619
-		set_transient( 'give_estimated_monthly_stats', $estimated, 86400 );
619
+		set_transient('give_estimated_monthly_stats', $estimated, 86400);
620 620
 	}
621 621
 
622
-	return maybe_unserialize( $estimated );
622
+	return maybe_unserialize($estimated);
623 623
 }
Please login to merge, or discard this patch.
includes/admin/EDD_SL_Plugin_Updater.php 1 patch
Spacing   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 // uncomment this line for testing
4 4
 // set_site_transient( 'update_plugins', null );
5 5
 // Exit if accessed directly.
6
-if ( ! defined( 'ABSPATH' ) ) {
6
+if ( ! defined('ABSPATH')) {
7 7
 	exit;
8 8
 }
9 9
 
@@ -26,16 +26,16 @@  discard block
 block discarded – undo
26 26
 	 * @param string $_plugin_file Path to the plugin file.
27 27
 	 * @param array  $_api_data    Optional data to send with API calls.
28 28
 	 */
29
-	function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
30
-		$this->api_url  = trailingslashit( $_api_url );
29
+	function __construct($_api_url, $_plugin_file, $_api_data = null) {
30
+		$this->api_url  = trailingslashit($_api_url);
31 31
 		$this->api_data = $_api_data;
32
-		$this->name     = plugin_basename( $_plugin_file );
33
-		$this->slug     = basename( $_plugin_file, '.php' );
32
+		$this->name     = plugin_basename($_plugin_file);
33
+		$this->slug     = basename($_plugin_file, '.php');
34 34
 		$this->version  = $_api_data['version'];
35 35
 
36 36
 		// Set up hooks.
37 37
 		$this->init();
38
-		add_action( 'admin_init', array( $this, 'show_changelog' ) );
38
+		add_action('admin_init', array($this, 'show_changelog'));
39 39
 	}
40 40
 
41 41
 	/**
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
 	 */
46 46
 	public function init() {
47 47
 
48
-		add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
49
-		add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
48
+		add_filter('pre_set_site_transient_update_plugins', array($this, 'check_update'));
49
+		add_filter('plugins_api', array($this, 'plugins_api_filter'), 10, 3);
50 50
 
51
-		add_action( 'after_plugin_row_' . $this->name, array( $this, 'show_update_notification' ), 10, 2 );
51
+		add_action('after_plugin_row_'.$this->name, array($this, 'show_update_notification'), 10, 2);
52 52
 	}
53 53
 
54 54
 	/**
@@ -65,34 +65,34 @@  discard block
 block discarded – undo
65 65
 	 *
66 66
 	 * @return stdClass Modified update array with custom plugin data
67 67
 	 */
68
-	function check_update( $_transient_data ) {
68
+	function check_update($_transient_data) {
69 69
 
70 70
 		$screen = get_current_screen();
71 71
 
72
-		if ( ! is_object( $_transient_data ) ) {
72
+		if ( ! is_object($_transient_data)) {
73 73
 			$_transient_data = new stdClass;
74 74
 		}
75 75
 
76
-		if ( is_object( $screen ) && 'plugins.php' == $screen->parent_file && is_multisite() ) {
76
+		if (is_object($screen) && 'plugins.php' == $screen->parent_file && is_multisite()) {
77 77
 			return $_transient_data;
78 78
 		}
79 79
 
80
-		if ( empty( $_transient_data->response ) || empty( $_transient_data->response[ $this->name ] ) ) {
80
+		if (empty($_transient_data->response) || empty($_transient_data->response[$this->name])) {
81 81
 
82
-			$version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
82
+			$version_info = $this->api_request('plugin_latest_version', array('slug' => $this->slug));
83 83
 
84
-			if ( false !== $version_info && is_object( $version_info ) && isset( $version_info->new_version ) ) {
84
+			if (false !== $version_info && is_object($version_info) && isset($version_info->new_version)) {
85 85
 
86 86
 				$this->did_check = true;
87 87
 
88
-				if ( version_compare( $this->version, $version_info->new_version, '<' ) ) {
88
+				if (version_compare($this->version, $version_info->new_version, '<')) {
89 89
 
90
-					$_transient_data->response[ $this->name ] = $version_info;
90
+					$_transient_data->response[$this->name] = $version_info;
91 91
 
92 92
 				}
93 93
 
94 94
 				$_transient_data->last_checked           = time();
95
-				$_transient_data->checked[ $this->name ] = $this->version;
95
+				$_transient_data->checked[$this->name] = $this->version;
96 96
 
97 97
 			}
98 98
 		}
@@ -106,85 +106,85 @@  discard block
 block discarded – undo
106 106
 	 * @param string $file
107 107
 	 * @param array  $plugin
108 108
 	 */
109
-	public function show_update_notification( $file, $plugin ) {
109
+	public function show_update_notification($file, $plugin) {
110 110
 
111
-		if ( ! current_user_can( 'update_plugins' ) ) {
111
+		if ( ! current_user_can('update_plugins')) {
112 112
 			return;
113 113
 		}
114 114
 
115
-		if ( ! is_multisite() ) {
115
+		if ( ! is_multisite()) {
116 116
 			return;
117 117
 		}
118 118
 
119
-		if ( $this->name != $file ) {
119
+		if ($this->name != $file) {
120 120
 			return;
121 121
 		}
122 122
 
123 123
 		// Remove our filter on the site transient
124
-		remove_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ), 10 );
124
+		remove_filter('pre_set_site_transient_update_plugins', array($this, 'check_update'), 10);
125 125
 
126
-		$update_cache = get_site_transient( 'update_plugins' );
126
+		$update_cache = get_site_transient('update_plugins');
127 127
 
128
-		if ( ! is_object( $update_cache ) || empty( $update_cache->response ) || empty( $update_cache->response[ $this->name ] ) ) {
128
+		if ( ! is_object($update_cache) || empty($update_cache->response) || empty($update_cache->response[$this->name])) {
129 129
 
130
-			$cache_key    = md5( 'edd_plugin_' . sanitize_key( $this->name ) . '_version_info' );
131
-			$version_info = get_transient( $cache_key );
130
+			$cache_key    = md5('edd_plugin_'.sanitize_key($this->name).'_version_info');
131
+			$version_info = get_transient($cache_key);
132 132
 
133
-			if ( false === $version_info ) {
133
+			if (false === $version_info) {
134 134
 
135
-				$version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
135
+				$version_info = $this->api_request('plugin_latest_version', array('slug' => $this->slug));
136 136
 
137
-				set_transient( $cache_key, $version_info, 3600 );
137
+				set_transient($cache_key, $version_info, 3600);
138 138
 			}
139 139
 
140
-			if ( ! is_object( $version_info ) ) {
140
+			if ( ! is_object($version_info)) {
141 141
 				return;
142 142
 			}
143 143
 
144
-			if ( version_compare( $this->version, $version_info->new_version, '<' ) ) {
144
+			if (version_compare($this->version, $version_info->new_version, '<')) {
145 145
 
146
-				$update_cache->response[ $this->name ] = $version_info;
146
+				$update_cache->response[$this->name] = $version_info;
147 147
 
148 148
 			}
149 149
 
150 150
 			$update_cache->last_checked           = time();
151
-			$update_cache->checked[ $this->name ] = $this->version;
151
+			$update_cache->checked[$this->name] = $this->version;
152 152
 
153
-			set_site_transient( 'update_plugins', $update_cache );
153
+			set_site_transient('update_plugins', $update_cache);
154 154
 
155 155
 		} else {
156 156
 
157
-			$version_info = $update_cache->response[ $this->name ];
157
+			$version_info = $update_cache->response[$this->name];
158 158
 
159 159
 		}
160 160
 
161 161
 		// Restore our filter
162
-		add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
162
+		add_filter('pre_set_site_transient_update_plugins', array($this, 'check_update'));
163 163
 
164
-		if ( ! empty( $update_cache->response[ $this->name ] ) && version_compare( $this->version, $version_info->new_version, '<' ) ) {
164
+		if ( ! empty($update_cache->response[$this->name]) && version_compare($this->version, $version_info->new_version, '<')) {
165 165
 
166 166
 			// build a plugin list row, with update notification
167
-			$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
168
-			echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
167
+			$wp_list_table = _get_list_table('WP_Plugins_List_Table');
168
+			echo '<tr class="plugin-update-tr"><td colspan="'.$wp_list_table->get_column_count().'" class="plugin-update colspanchange"><div class="update-message">';
169 169
 
170
-			$changelog_link = self_admin_url( 'index.php?edd_sl_action=view_plugin_changelog&plugin=' . $this->name . '&slug=' . $this->slug . '&TB_iframe=true&width=772&height=911' );
170
+			$changelog_link = self_admin_url('index.php?edd_sl_action=view_plugin_changelog&plugin='.$this->name.'&slug='.$this->slug.'&TB_iframe=true&width=772&height=911');
171 171
 
172
-			if ( empty( $version_info->download_link ) ) {
172
+			if (empty($version_info->download_link)) {
173 173
 				printf(
174 174
 				/* translators: 1: name 2: changelog URL 3: version */
175
-					__( 'There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a>.', 'give' ),
176
-					esc_html( $version_info->name ),
177
-					esc_url( $changelog_link ),
178
-					esc_html( $version_info->new_version )
175
+					__('There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a>.', 'give'),
176
+					esc_html($version_info->name),
177
+					esc_url($changelog_link),
178
+					esc_html($version_info->new_version)
179 179
 				);
180 180
 			} else {
181 181
 				printf(
182 182
 				/* translators: 1: name 2: changelog URL 3: version 4: update URL */
183
-					__( 'There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a> or <a href="%4$s">update now</a>.', 'give' ),
184
-					esc_html( $version_info->name ),
185
-					esc_url( $changelog_link ),
186
-					esc_html( $version_info->new_version ),
187
-					esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) )
183
+					__('There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a> or <a href="%4$s">update now</a>.', 'give'),
184
+					esc_html($version_info->name),
185
+					esc_url($changelog_link),
186
+					esc_html($version_info->new_version),
187
+					esc_url(wp_nonce_url(self_admin_url('update.php?action=upgrade-plugin&plugin=').$this->name, 'upgrade-plugin_'.$this->name))
188 188
 				);
189 189
 			}
190 190
 
@@ -204,15 +204,15 @@  discard block
 block discarded – undo
204 204
 	 *
205 205
 	 * @return object $_data
206 206
 	 */
207
-	function plugins_api_filter( $_data, $_action = '', $_args = null ) {
207
+	function plugins_api_filter($_data, $_action = '', $_args = null) {
208 208
 
209
-		if ( $_action != 'plugin_information' ) {
209
+		if ($_action != 'plugin_information') {
210 210
 
211 211
 			return $_data;
212 212
 
213 213
 		}
214 214
 
215
-		if ( ! isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) {
215
+		if ( ! isset($_args->slug) || ($_args->slug != $this->slug)) {
216 216
 
217 217
 			return $_data;
218 218
 
@@ -227,9 +227,9 @@  discard block
 block discarded – undo
227 227
 			),
228 228
 		);
229 229
 
230
-		$api_response = $this->api_request( 'plugin_information', $to_send );
230
+		$api_response = $this->api_request('plugin_information', $to_send);
231 231
 
232
-		if ( false !== $api_response ) {
232
+		if (false !== $api_response) {
233 233
 			$_data = $api_response;
234 234
 		}
235 235
 
@@ -245,9 +245,9 @@  discard block
 block discarded – undo
245 245
 	 *
246 246
 	 * @return object $array
247 247
 	 */
248
-	function http_request_args( $args, $url ) {
248
+	function http_request_args($args, $url) {
249 249
 		// If it is an https request and we are performing a package download, disable ssl verification
250
-		if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
250
+		if (strpos($url, 'https://') !== false && strpos($url, 'edd_action=package_download')) {
251 251
 			$args['sslverify'] = false;
252 252
 		}
253 253
 
@@ -266,43 +266,43 @@  discard block
 block discarded – undo
266 266
 	 *
267 267
 	 * @return false||object
268 268
 	 */
269
-	private function api_request( $_action, $_data ) {
269
+	private function api_request($_action, $_data) {
270 270
 
271
-		$data = array_merge( $this->api_data, $_data );
271
+		$data = array_merge($this->api_data, $_data);
272 272
 
273
-		if ( $data['slug'] != $this->slug ) {
273
+		if ($data['slug'] != $this->slug) {
274 274
 			return;
275 275
 		}
276 276
 
277
-		if ( empty( $data['license'] ) ) {
277
+		if (empty($data['license'])) {
278 278
 			return;
279 279
 		}
280 280
 
281
-		if ( $this->api_url == home_url() ) {
281
+		if ($this->api_url == home_url()) {
282 282
 			return false; // Don't allow a plugin to ping itself
283 283
 		}
284 284
 
285 285
 		$api_params = array(
286 286
 			'edd_action' => 'get_version',
287 287
 			'license'    => $data['license'],
288
-			'item_name'  => isset( $data['item_name'] ) ? $data['item_name'] : false,
289
-			'item_id'    => isset( $data['item_id'] ) ? $data['item_id'] : false,
288
+			'item_name'  => isset($data['item_name']) ? $data['item_name'] : false,
289
+			'item_id'    => isset($data['item_id']) ? $data['item_id'] : false,
290 290
 			'slug'       => $data['slug'],
291 291
 			'author'     => $data['author'],
292 292
 			'url'        => home_url(),
293 293
 		);
294 294
 
295
-		$request = wp_remote_post( $this->api_url, array( 'timeout'   => 15,
295
+		$request = wp_remote_post($this->api_url, array('timeout'   => 15,
296 296
 														  'sslverify' => false,
297 297
 														  'body'      => $api_params,
298
-		) );
298
+		));
299 299
 
300
-		if ( ! is_wp_error( $request ) ) {
301
-			$request = json_decode( wp_remote_retrieve_body( $request ) );
300
+		if ( ! is_wp_error($request)) {
301
+			$request = json_decode(wp_remote_retrieve_body($request));
302 302
 		}
303 303
 
304
-		if ( $request && isset( $request->sections ) ) {
305
-			$request->sections = maybe_unserialize( $request->sections );
304
+		if ($request && isset($request->sections)) {
305
+			$request->sections = maybe_unserialize($request->sections);
306 306
 		} else {
307 307
 			$request = false;
308 308
 		}
@@ -312,26 +312,26 @@  discard block
 block discarded – undo
312 312
 
313 313
 	public function show_changelog() {
314 314
 
315
-		if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) {
315
+		if (empty($_REQUEST['edd_sl_action']) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action']) {
316 316
 			return;
317 317
 		}
318 318
 
319
-		if ( empty( $_REQUEST['plugin'] ) ) {
319
+		if (empty($_REQUEST['plugin'])) {
320 320
 			return;
321 321
 		}
322 322
 
323
-		if ( empty( $_REQUEST['slug'] ) ) {
323
+		if (empty($_REQUEST['slug'])) {
324 324
 			return;
325 325
 		}
326 326
 
327
-		if ( ! current_user_can( 'update_plugins' ) ) {
328
-			wp_die( esc_html__( 'You do not have permission to install plugin updates.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
327
+		if ( ! current_user_can('update_plugins')) {
328
+			wp_die(esc_html__('You do not have permission to install plugin updates.', 'give'), esc_html__('Error', 'give'), array('response' => 403));
329 329
 		}
330 330
 
331
-		$response = $this->api_request( 'plugin_latest_version', array( 'slug' => $_REQUEST['slug'] ) );
331
+		$response = $this->api_request('plugin_latest_version', array('slug' => $_REQUEST['slug']));
332 332
 
333
-		if ( $response && isset( $response->sections['changelog'] ) ) {
334
-			echo '<div style="background:#fff;padding:10px;">' . $response->sections['changelog'] . '</div>';
333
+		if ($response && isset($response->sections['changelog'])) {
334
+			echo '<div style="background:#fff;padding:10px;">'.$response->sections['changelog'].'</div>';
335 335
 		}
336 336
 
337 337
 		exit;
Please login to merge, or discard this patch.
includes/admin/abstract-admin-settings-page.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_Page' ) ) :
16
+if ( ! class_exists('Give_Settings_Page')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Page.
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 			// Get current setting page.
63 63
 			$this->current_setting_page = give_get_current_setting_page();
64 64
 
65
-			add_filter( "give_default_setting_tab_section_{$this->id}", array( $this, 'set_default_setting_tab' ), 10 );
66
-			add_filter( "{$this->current_setting_page}_tabs_array", array( $this, 'add_settings_page' ), 20 );
67
-			add_action( "{$this->current_setting_page}_sections_{$this->id}_page", array( $this, 'output_sections' ) );
68
-			add_action( "{$this->current_setting_page}_settings_{$this->id}_page", array( $this, 'output' ) );
69
-			add_action( "{$this->current_setting_page}_save_{$this->id}", array( $this, 'save' ) );
65
+			add_filter("give_default_setting_tab_section_{$this->id}", array($this, 'set_default_setting_tab'), 10);
66
+			add_filter("{$this->current_setting_page}_tabs_array", array($this, 'add_settings_page'), 20);
67
+			add_action("{$this->current_setting_page}_sections_{$this->id}_page", array($this, 'output_sections'));
68
+			add_action("{$this->current_setting_page}_settings_{$this->id}_page", array($this, 'output'));
69
+			add_action("{$this->current_setting_page}_save_{$this->id}", array($this, 'save'));
70 70
 		}
71 71
 
72 72
 		/**
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 		 *
79 79
 		 * @return string
80 80
 		 */
81
-		function set_default_setting_tab( $setting_tab ) {
81
+		function set_default_setting_tab($setting_tab) {
82 82
 			return $this->default_tab;
83 83
 		}
84 84
 
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
 		 *
92 92
 		 * @return array
93 93
 		 */
94
-		public function add_settings_page( $pages ) {
95
-			$pages[ $this->id ] = $this->label;
94
+		public function add_settings_page($pages) {
95
+			$pages[$this->id] = $this->label;
96 96
 
97 97
 			return $pages;
98 98
 		}
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 			 *
112 112
 			 * @param  array $settings
113 113
 			 */
114
-			$settings = apply_filters( 'give_get_settings_' . $this->id, array() );
114
+			$settings = apply_filters('give_get_settings_'.$this->id, array());
115 115
 
116 116
 			// Output.
117 117
 			return $settings;
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 		 * @return array
125 125
 		 */
126 126
 		public function get_sections() {
127
-			return apply_filters( 'give_get_sections_' . $this->id, array() );
127
+			return apply_filters('give_get_sections_'.$this->id, array());
128 128
 		}
129 129
 
130 130
 		/**
@@ -141,28 +141,28 @@  discard block
 block discarded – undo
141 141
 			$sections = $this->get_sections();
142 142
 
143 143
 			// Show section settings only if setting section exist.
144
-			if ( ! in_array( $current_section, array_keys( $sections ) ) ) {
145
-				echo '<div class="error"><p>' . __( 'Oops, this settings page does not exist.', 'give' ) . '</p></div>';
144
+			if ( ! in_array($current_section, array_keys($sections))) {
145
+				echo '<div class="error"><p>'.__('Oops, this settings page does not exist.', 'give').'</p></div>';
146 146
 
147 147
 				return;
148 148
 			}
149 149
 
150 150
 			// Bailout.
151
-			if ( empty( $sections ) ) {
151
+			if (empty($sections)) {
152 152
 				return;
153 153
 			}
154 154
 
155
-			if ( is_null( $this->current_setting_page ) ) {
155
+			if (is_null($this->current_setting_page)) {
156 156
 				$this->current_setting_page = give_get_current_setting_page();
157 157
 			}
158 158
 
159 159
 			echo '<ul class="subsubsub">';
160 160
 
161 161
 			// Get section keys.
162
-			$array_keys = array_keys( $sections );
162
+			$array_keys = array_keys($sections);
163 163
 
164
-			foreach ( $sections as $id => $label ) {
165
-				echo '<li><a href="' . admin_url( 'edit.php?post_type=give_forms&page=' . $this->current_setting_page . '&tab=' . $this->id . '&section=' . sanitize_title( $id ) ) . '" class="' . ( $current_section == $id ? 'current' : '' ) . '">' . $label . '</a> ' . ( end( $array_keys ) == $id ? '' : '|' ) . ' </li>';
164
+			foreach ($sections as $id => $label) {
165
+				echo '<li><a href="'.admin_url('edit.php?post_type=give_forms&page='.$this->current_setting_page.'&tab='.$this->id.'&section='.sanitize_title($id)).'" class="'.($current_section == $id ? 'current' : '').'">'.$label.'</a> '.(end($array_keys) == $id ? '' : '|').' </li>';
166 166
 			}
167 167
 
168 168
 			echo '</ul><br class="clear" /><hr>';
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 		public function output() {
178 178
 			$settings = $this->get_settings();
179 179
 
180
-			Give_Admin_Settings::output_fields( $settings, 'give_settings' );
180
+			Give_Admin_Settings::output_fields($settings, 'give_settings');
181 181
 		}
182 182
 
183 183
 		/**
@@ -190,14 +190,14 @@  discard block
 block discarded – undo
190 190
 			$settings        = $this->get_settings();
191 191
 			$current_section = give_get_current_setting_section();
192 192
 
193
-			Give_Admin_Settings::save_fields( $settings, 'give_settings' );
193
+			Give_Admin_Settings::save_fields($settings, 'give_settings');
194 194
 
195 195
 			/**
196 196
 			 * Trigger Action
197 197
 			 *
198 198
 			 * @since 1.8
199 199
 			 */
200
-			do_action( 'give_update_options_' . $this->id . '_' . $current_section );
200
+			do_action('give_update_options_'.$this->id.'_'.$current_section);
201 201
 		}
202 202
 	}
203 203
 
Please login to merge, or discard this patch.
includes/admin/welcome.php 1 patch
Spacing   +103 added lines, -103 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
 	/**
@@ -49,45 +49,45 @@  discard block
 block discarded – undo
49 49
 	 * @return void
50 50
 	 */
51 51
 	public function admin_menus() {
52
-		list( $display_version ) = explode( '-', GIVE_VERSION );
52
+		list($display_version) = explode('-', GIVE_VERSION);
53 53
 
54 54
 		// About Page
55 55
 		add_dashboard_page(
56 56
 			/* translators: %s: Give version */
57
-			sprintf( esc_html__( 'Welcome to Give %s', 'give' ), $display_version ),
58
-			esc_html__( 'Welcome to Give', 'give' ),
57
+			sprintf(esc_html__('Welcome to Give %s', 'give'), $display_version),
58
+			esc_html__('Welcome to Give', 'give'),
59 59
 			$this->minimum_capability,
60 60
 			'give-about',
61
-			array( $this, 'about_screen' )
61
+			array($this, 'about_screen')
62 62
 		);
63 63
 
64 64
 		// Changelog Page
65 65
 		add_dashboard_page(
66
-			esc_html__( 'Give Changelog', 'give' ),
67
-			esc_html__( 'Give Changelog', 'give' ),
66
+			esc_html__('Give Changelog', 'give'),
67
+			esc_html__('Give Changelog', 'give'),
68 68
 			$this->minimum_capability,
69 69
 			'give-changelog',
70
-			array( $this, 'changelog_screen' )
70
+			array($this, 'changelog_screen')
71 71
 		);
72 72
 
73 73
 		// Getting Started Page
74 74
 		add_dashboard_page(
75 75
 			/* translators: %s: Give version */
76
-			sprintf( esc_html__( 'Give %s - Getting Started Guide', 'give' ), $display_version ),
77
-			esc_html__( 'Getting started with Give', 'give' ),
76
+			sprintf(esc_html__('Give %s - Getting Started Guide', 'give'), $display_version),
77
+			esc_html__('Getting started with Give', 'give'),
78 78
 			$this->minimum_capability,
79 79
 			'give-getting-started',
80
-			array( $this, 'getting_started_screen' )
80
+			array($this, 'getting_started_screen')
81 81
 		);
82 82
 
83 83
 		// Credits Page
84 84
 		add_dashboard_page(
85 85
 			/* translators: %s: Give version */
86
-			sprintf( esc_html__( 'Give %s - Credits', 'give' ), $display_version ),
87
-			esc_html__( 'The people that build Give', 'give' ),
86
+			sprintf(esc_html__('Give %s - Credits', 'give'), $display_version),
87
+			esc_html__('The people that build Give', 'give'),
88 88
 			$this->minimum_capability,
89 89
 			'give-credits',
90
-			array( $this, 'credits_screen' )
90
+			array($this, 'credits_screen')
91 91
 		);
92 92
 	}
93 93
 
@@ -100,13 +100,13 @@  discard block
 block discarded – undo
100 100
 	 */
101 101
 	public function admin_head() {
102 102
 
103
-		remove_submenu_page( 'index.php', 'give-about' );
104
-		remove_submenu_page( 'index.php', 'give-changelog' );
105
-		remove_submenu_page( 'index.php', 'give-getting-started' );
106
-		remove_submenu_page( 'index.php', 'give-credits' );
103
+		remove_submenu_page('index.php', 'give-about');
104
+		remove_submenu_page('index.php', 'give-changelog');
105
+		remove_submenu_page('index.php', 'give-getting-started');
106
+		remove_submenu_page('index.php', 'give-credits');
107 107
 
108 108
 		// Badge for welcome page
109
-		$badge_url = GIVE_PLUGIN_URL . 'assets/images/give-badge.png';
109
+		$badge_url = GIVE_PLUGIN_URL.'assets/images/give-badge.png';
110 110
 
111 111
 		?>
112 112
 		<style type="text/css" media="screen">
@@ -186,20 +186,20 @@  discard block
 block discarded – undo
186 186
 	 * @return void
187 187
 	 */
188 188
 	public function tabs() {
189
-		$selected = isset( $_GET['page'] ) ? $_GET['page'] : 'give-about';
189
+		$selected = isset($_GET['page']) ? $_GET['page'] : 'give-about';
190 190
 		?>
191 191
 		<h2 class="nav-tab-wrapper">
192
-			<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' ) ) ); ?>">
193
-				<?php esc_html_e( 'About Give', 'give' ); ?>
192
+			<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'))); ?>">
193
+				<?php esc_html_e('About Give', 'give'); ?>
194 194
 			</a>
195
-			<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' ) ) ); ?>">
196
-				<?php esc_html_e( 'Getting Started', 'give' ); ?>
195
+			<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'))); ?>">
196
+				<?php esc_html_e('Getting Started', 'give'); ?>
197 197
 			</a>
198
-			<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' ) ) ); ?>">
199
-				<?php esc_html_e( 'Credits', 'give' ); ?>
198
+			<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'))); ?>">
199
+				<?php esc_html_e('Credits', 'give'); ?>
200 200
 			</a>
201
-			<a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-addons' ) ); ?>">
202
-				<?php esc_html_e( 'Add-ons', 'give' ); ?>
201
+			<a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url('edit.php?post_type=give_forms&page=give-addons')); ?>">
202
+				<?php esc_html_e('Add-ons', 'give'); ?>
203 203
 			</a>
204 204
 		</h2>
205 205
 	<?php
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 	 * @return void
214 214
 	 */
215 215
 	public function about_screen() {
216
-		list( $display_version ) = explode( '-', GIVE_VERSION );
216
+		list($display_version) = explode('-', GIVE_VERSION);
217 217
 		?>
218 218
 		<div class="wrap about-wrap">
219 219
 			<h1 class="welcome-h1"><?php echo get_admin_page_title(); ?></h1>
@@ -223,8 +223,8 @@  discard block
 block discarded – undo
223 223
 			<p class="about-text"><?php
224 224
 				printf(
225 225
 					/* translators: %s: https://givewp.com/documenation/ */
226
-					__( '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. We encourage you to check out the <a href="%s" target="_blank">plugin documentation</a> and getting started guide below.', 'give' ),
227
-					esc_url( 'https://givewp.com/documenation/' )
226
+					__('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. We encourage you to check out the <a href="%s" target="_blank">plugin documentation</a> and getting started guide below.', 'give'),
227
+					esc_url('https://givewp.com/documenation/')
228 228
 				);
229 229
 			?></p>
230 230
 
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 			<div class="give-badge"><?php
234 234
 				printf(
235 235
 					/* translators: %s: Give version */
236
-					esc_html__( 'Version %s', 'give' ),
236
+					esc_html__('Version %s', 'give'),
237 237
 					$display_version
238 238
 				);
239 239
 			?></div>
@@ -243,16 +243,16 @@  discard block
 block discarded – undo
243 243
 			<div class="feature-section clearfix introduction">
244 244
 
245 245
 				<div class="video feature-section-item">
246
-					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-form-mockup.png' ?>" alt="<?php esc_attr_e( 'A Give donation form', 'give' ); ?>">
246
+					<img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-form-mockup.png' ?>" alt="<?php esc_attr_e('A Give donation form', 'give'); ?>">
247 247
 				</div>
248 248
 
249 249
 				<div class="content feature-section-item last-feature">
250 250
 
251
-					<h3><?php esc_html_e( 'Give - Democratizing Generosity', 'give' ); ?></h3>
251
+					<h3><?php esc_html_e('Give - Democratizing Generosity', 'give'); ?></h3>
252 252
 
253
-					<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>
253
+					<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>
254 254
 					<a href="https://givewp.com" target="_blank" class="button-secondary">
255
-						<?php esc_html_e( 'Learn More', 'give' ); ?>
255
+						<?php esc_html_e('Learn More', 'give'); ?>
256 256
 						<span class="dashicons dashicons-external"></span>
257 257
 					</a>
258 258
 
@@ -265,11 +265,11 @@  discard block
 block discarded – undo
265 265
 
266 266
 				<div class="content feature-section-item">
267 267
 
268
-					<h3><?php esc_html_e( 'Getting to Know Give', 'give' ); ?></h3>
268
+					<h3><?php esc_html_e('Getting to Know Give', 'give'); ?></h3>
269 269
 
270
-					<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>
270
+					<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>
271 271
 					<a href="https://givewp.com/documentation" target="_blank" class="button-secondary">
272
-						<?php esc_html_e( 'View Documentation', 'give' ); ?>
272
+						<?php esc_html_e('View Documentation', 'give'); ?>
273 273
 						<span class="dashicons dashicons-external"></span>
274 274
 					</a>
275 275
 
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 
278 278
 				<div class="content  feature-section-item last-feature">
279 279
 
280
-					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-logo-photo-mashup.png' ?>" alt="<?php esc_attr_e( 'Give', 'give' ); ?>">
280
+					<img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-logo-photo-mashup.png' ?>" alt="<?php esc_attr_e('Give', 'give'); ?>">
281 281
 
282 282
 				</div>
283 283
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 	 * @return void
298 298
 	 */
299 299
 	public function changelog_screen() {
300
-		list( $display_version ) = explode( '-', GIVE_VERSION );
300
+		list($display_version) = explode('-', GIVE_VERSION);
301 301
 		?>
302 302
 		<div class="wrap about-wrap">
303 303
 			<h1><?php echo get_admin_page_title(); ?></h1>
@@ -305,14 +305,14 @@  discard block
 block discarded – undo
305 305
 			<p class="about-text"><?php
306 306
 				printf(
307 307
 					/* translators: %s: Give version */
308
-					esc_html__( 'Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give' ),
308
+					esc_html__('Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give'),
309 309
 					$display_version
310 310
 				);
311 311
 			?></p>
312 312
 			<div class="give-badge"><?php
313 313
 				printf(
314 314
 					/* translators: %s: Give version */
315
-					esc_html__( 'Version %s', 'give' ),
315
+					esc_html__('Version %s', 'give'),
316 316
 					$display_version
317 317
 				);
318 318
 			?></div>
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 			<?php $this->tabs(); ?>
321 321
 
322 322
 			<div class="changelog">
323
-				<h3><?php esc_html_e( 'Full Changelog', 'give' ); ?></h3>
323
+				<h3><?php esc_html_e('Full Changelog', 'give'); ?></h3>
324 324
 
325 325
 				<div class="feature-section">
326 326
 					<?php echo $this->parse_readme(); ?>
@@ -328,10 +328,10 @@  discard block
 block discarded – undo
328 328
 			</div>
329 329
 
330 330
 			<div class="return-to-dashboard">
331
-				<a href="<?php echo esc_url( admin_url( add_query_arg( array(
331
+				<a href="<?php echo esc_url(admin_url(add_query_arg(array(
332 332
 					'post_type' => 'give_forms',
333 333
 					'page'      => 'give-settings'
334
-				), 'edit.php' ) ) ); ?>"><?php esc_html_e( 'Give Settings', 'give' ); ?></a>
334
+				), 'edit.php'))); ?>"><?php esc_html_e('Give Settings', 'give'); ?></a>
335 335
 			</div>
336 336
 		</div>
337 337
 	<?php
@@ -345,37 +345,37 @@  discard block
 block discarded – undo
345 345
 	 * @return void
346 346
 	 */
347 347
 	public function getting_started_screen() {
348
-		list( $display_version ) = explode( '-', GIVE_VERSION );
348
+		list($display_version) = explode('-', GIVE_VERSION);
349 349
 		?>
350 350
 		<div class="wrap about-wrap get-started">
351 351
 			<h1 class="welcome-h1"><?php echo get_admin_page_title(); ?></h1>
352 352
 
353 353
 			<?php give_social_media_elements() ?>
354 354
 
355
-			<p class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></p>
355
+			<p class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></p>
356 356
 
357 357
 			<?php give_get_newsletter(); ?>
358 358
 
359 359
 			<div class="give-badge"><?php
360 360
 				printf(
361 361
 					/* translators: %s: Give version */
362
-					esc_html__( 'Version %s', 'give' ),
362
+					esc_html__('Version %s', 'give'),
363 363
 					$display_version
364 364
 				);
365 365
 			?></div>
366 366
 
367 367
 			<?php $this->tabs(); ?>
368 368
 
369
-			<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>
369
+			<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>
370 370
 
371 371
 			<div class="feature-section clearfix">
372 372
 
373 373
 				<div class="content feature-section-item">
374
-					<h3><?php esc_html_e( 'STEP 1: Create a New Form', 'give' ); ?></h3>
374
+					<h3><?php esc_html_e('STEP 1: Create a New Form', 'give'); ?></h3>
375 375
 
376
-					<p><?php esc_html_e( 'Give is driven by it\'s powerful donation form building features. However, it is much more than just a "donation form". From the "Add Form" page you\'ll be able to choose how and where you want to receive your donations. You will also be able to set the preferred donation amounts.', 'give' ); ?></p>
376
+					<p><?php esc_html_e('Give is driven by it\'s powerful donation form building features. However, it is much more than just a "donation form". From the "Add Form" page you\'ll be able to choose how and where you want to receive your donations. You will also be able to set the preferred donation amounts.', 'give'); ?></p>
377 377
 
378
-					<p><?php esc_html_e( 'All of these features begin by simply going to the menu and choosing "Donations > Add Form".', 'give' ); ?></p>
378
+					<p><?php esc_html_e('All of these features begin by simply going to the menu and choosing "Donations > Add Form".', 'give'); ?></p>
379 379
 				</div>
380 380
 
381 381
 				<div class="content feature-section-item last-feature">
@@ -392,9 +392,9 @@  discard block
 block discarded – undo
392 392
 				</div>
393 393
 
394 394
 				<div class="content feature-section-item last-feature">
395
-					<h3><?php esc_html_e( 'STEP 2: Customize Your Donation Forms', 'give' ); ?></h3>
395
+					<h3><?php esc_html_e('STEP 2: Customize Your Donation Forms', 'give'); ?></h3>
396 396
 
397
-					<p><?php esc_html_e( 'Each donation form you create can be customized to receive either a pre-determined set donation amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the donation levels view where you can add as many levels as you\'d like with your own custom names and suggested amounts. As well, you can allow donors to give a custom amount and even set up donation goals.', 'give' ); ?></p>
397
+					<p><?php esc_html_e('Each donation form you create can be customized to receive either a pre-determined set donation amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the donation levels view where you can add as many levels as you\'d like with your own custom names and suggested amounts. As well, you can allow donors to give a custom amount and even set up donation goals.', 'give'); ?></p>
398 398
 				</div>
399 399
 
400 400
 			</div>
@@ -403,11 +403,11 @@  discard block
 block discarded – undo
403 403
 			<div class="feature-section clearfix">
404 404
 
405 405
 				<div class="content feature-section-item add-content">
406
-					<h3><?php esc_html_e( 'STEP 3: Add Additional Content', 'give' ); ?></h3>
406
+					<h3><?php esc_html_e('STEP 3: Add Additional Content', 'give'); ?></h3>
407 407
 
408
-					<p><?php esc_html_e( 'Every donation form you create with Give can be used on its own stand-alone page, or it can be inserted into any other page or post throughout your site via a shortcode or widget.', 'give' ); ?></p>
408
+					<p><?php esc_html_e('Every donation form you create with Give can be used on its own stand-alone page, or it can be inserted into any other page or post throughout your site via a shortcode or widget.', 'give'); ?></p>
409 409
 
410
-					<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>
410
+					<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>
411 411
 				</div>
412 412
 
413 413
 				<div class="content feature-section-item last-feature">
@@ -424,9 +424,9 @@  discard block
 block discarded – undo
424 424
 				</div>
425 425
 
426 426
 				<div class="content feature-section-item last-feature">
427
-					<h3><?php esc_html_e( 'STEP 4: Configure Your Display Options', 'give' ); ?></h3>
427
+					<h3><?php esc_html_e('STEP 4: Configure Your Display Options', 'give'); ?></h3>
428 428
 
429
-					<p><?php esc_html_e( 'Lastly, you can present the form in a number of different ways that each create their own unique donor experience. The "Modal" display mode opens the credit card fieldset within a popup window. The "Reveal" mode will slide into place the additional fields. If you\'re looking for a simple button, then "Button" more is the way to go. This allows you to create a customizable "Donate Now" button which will open the donation form upon clicking. There\'s tons of possibilities here, give it a try!', 'give' ); ?></p>
429
+					<p><?php esc_html_e('Lastly, you can present the form in a number of different ways that each create their own unique donor experience. The "Modal" display mode opens the credit card fieldset within a popup window. The "Reveal" mode will slide into place the additional fields. If you\'re looking for a simple button, then "Button" more is the way to go. This allows you to create a customizable "Donate Now" button which will open the donation form upon clicking. There\'s tons of possibilities here, give it a try!', 'give'); ?></p>
430 430
 				</div>
431 431
 
432 432
 
@@ -446,23 +446,23 @@  discard block
 block discarded – undo
446 446
 	 * @return void
447 447
 	 */
448 448
 	public function credits_screen() {
449
-		list( $display_version ) = explode( '-', GIVE_VERSION );
449
+		list($display_version) = explode('-', GIVE_VERSION);
450 450
 		?>
451 451
 		<div class="wrap about-wrap">
452 452
 			<h1 class="welcome-h1"><?php echo get_admin_page_title(); ?></h1>
453 453
 
454 454
 			<?php give_social_media_elements() ?>
455 455
 
456
-			<p class="about-text"><?php esc_html_e( 'Thanks to all those who have contributed code directly or indirectly.', 'give' ); ?></p>
456
+			<p class="about-text"><?php esc_html_e('Thanks to all those who have contributed code directly or indirectly.', 'give'); ?></p>
457 457
 
458
-			<p class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></p>
458
+			<p class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></p>
459 459
 
460 460
 			<?php give_get_newsletter(); ?>
461 461
 
462 462
 			<div class="give-badge"><?php
463 463
 				printf(
464 464
 					/* translators: %s: Give version */
465
-					esc_html__( 'Version %s', 'give' ),
465
+					esc_html__('Version %s', 'give'),
466 466
 					$display_version
467 467
 				);
468 468
 			?></div>
@@ -472,8 +472,8 @@  discard block
 block discarded – undo
472 472
 			<p class="about-description"><?php
473 473
 				printf(
474 474
 					/* translators: %s: https://github.com/WordImpress/give */
475
-					__( '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' ),
476
-					esc_url( 'https://github.com/WordImpress/give' )
475
+					__('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'),
476
+					esc_url('https://github.com/WordImpress/give')
477 477
 				);
478 478
 			?></p>
479 479
 
@@ -490,21 +490,21 @@  discard block
 block discarded – undo
490 490
 	 * @return string $readme HTML formatted readme file
491 491
 	 */
492 492
 	public function parse_readme() {
493
-		$file = file_exists( GIVE_PLUGIN_DIR . 'readme.txt' ) ? GIVE_PLUGIN_DIR . 'readme.txt' : null;
493
+		$file = file_exists(GIVE_PLUGIN_DIR.'readme.txt') ? GIVE_PLUGIN_DIR.'readme.txt' : null;
494 494
 
495
-		if ( ! $file ) {
496
-			$readme = '<p>' . esc_html__( 'No valid changlog was found.', 'give' ) . '</p>';
495
+		if ( ! $file) {
496
+			$readme = '<p>'.esc_html__('No valid changlog was found.', 'give').'</p>';
497 497
 		} else {
498
-			$readme = file_get_contents( $file );
499
-			$readme = nl2br( esc_html( $readme ) );
500
-			$readme = explode( '== Changelog ==', $readme );
501
-			$readme = end( $readme );
502
-
503
-			$readme = preg_replace( '/`(.*?)`/', '<code>\\1</code>', $readme );
504
-			$readme = preg_replace( '/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme );
505
-			$readme = preg_replace( '/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme );
506
-			$readme = preg_replace( '/= (.*?) =/', '<h4>\\1</h4>', $readme );
507
-			$readme = preg_replace( '/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme );
498
+			$readme = file_get_contents($file);
499
+			$readme = nl2br(esc_html($readme));
500
+			$readme = explode('== Changelog ==', $readme);
501
+			$readme = end($readme);
502
+
503
+			$readme = preg_replace('/`(.*?)`/', '<code>\\1</code>', $readme);
504
+			$readme = preg_replace('/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme);
505
+			$readme = preg_replace('/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme);
506
+			$readme = preg_replace('/= (.*?) =/', '<h4>\\1</h4>', $readme);
507
+			$readme = preg_replace('/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme);
508 508
 		}
509 509
 
510 510
 		return $readme;
@@ -521,24 +521,24 @@  discard block
 block discarded – undo
521 521
 	public function contributors() {
522 522
 		$contributors = $this->get_contributors();
523 523
 
524
-		if ( empty( $contributors ) ) {
524
+		if (empty($contributors)) {
525 525
 			return '';
526 526
 		}
527 527
 
528 528
 		$contributor_list = '<ul class="wp-people-group">';
529 529
 
530
-		foreach ( $contributors as $contributor ) {
530
+		foreach ($contributors as $contributor) {
531 531
 			$contributor_list .= '<li class="wp-person">';
532 532
 			$contributor_list .= sprintf(
533 533
 				'<a href="%1$s" target="_blank"><img src="%2$s" width="64" height="64" class="gravatar" alt="%3$s" /></a>',
534
-				esc_url( 'https://github.com/' . $contributor->login ),
535
-				esc_url( $contributor->avatar_url ),
536
-				esc_attr( $contributor->login )
534
+				esc_url('https://github.com/'.$contributor->login),
535
+				esc_url($contributor->avatar_url),
536
+				esc_attr($contributor->login)
537 537
 			);
538 538
 			$contributor_list .= sprintf(
539 539
 				'<a class="web" target="_blank" href="%1$s">%2$s</a>',
540
-				esc_url( 'https://github.com/' . $contributor->login ),
541
-				esc_html( $contributor->login )
540
+				esc_url('https://github.com/'.$contributor->login),
541
+				esc_html($contributor->login)
542 542
 			);
543 543
 			$contributor_list .= '</li>';
544 544
 		}
@@ -556,25 +556,25 @@  discard block
 block discarded – undo
556 556
 	 * @return array $contributors List of contributors
557 557
 	 */
558 558
 	public function get_contributors() {
559
-		$contributors = get_transient( 'give_contributors' );
559
+		$contributors = get_transient('give_contributors');
560 560
 
561
-		if ( false !== $contributors ) {
561
+		if (false !== $contributors) {
562 562
 			return $contributors;
563 563
 		}
564 564
 
565
-		$response = wp_remote_get( 'https://api.github.com/repos/WordImpress/Give/contributors', array( 'sslverify' => false ) );
565
+		$response = wp_remote_get('https://api.github.com/repos/WordImpress/Give/contributors', array('sslverify' => false));
566 566
 
567
-		if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
567
+		if (is_wp_error($response) || 200 != wp_remote_retrieve_response_code($response)) {
568 568
 			return array();
569 569
 		}
570 570
 
571
-		$contributors = json_decode( wp_remote_retrieve_body( $response ) );
571
+		$contributors = json_decode(wp_remote_retrieve_body($response));
572 572
 
573
-		if ( ! is_array( $contributors ) ) {
573
+		if ( ! is_array($contributors)) {
574 574
 			return array();
575 575
 		}
576 576
 
577
-		set_transient( 'give_contributors', $contributors, 3600 );
577
+		set_transient('give_contributors', $contributors, 3600);
578 578
 
579 579
 		return $contributors;
580 580
 	}
@@ -592,24 +592,24 @@  discard block
 block discarded – undo
592 592
 		$give_options = give_get_settings();
593 593
 
594 594
 		// Bail if no activation redirect
595
-		if ( ! get_transient( '_give_activation_redirect' ) ) {
595
+		if ( ! get_transient('_give_activation_redirect')) {
596 596
 			return;
597 597
 		}
598 598
 
599 599
 		// Delete the redirect transient
600
-		delete_transient( '_give_activation_redirect' );
600
+		delete_transient('_give_activation_redirect');
601 601
 
602 602
 		// Bail if activating from network, or bulk
603
-		if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
603
+		if (is_network_admin() || isset($_GET['activate-multi'])) {
604 604
 			return;
605 605
 		}
606 606
 
607
-		$upgrade = get_option( 'give_version_upgraded_from' );
607
+		$upgrade = get_option('give_version_upgraded_from');
608 608
 
609
-		if ( ! $upgrade ) { // First time install
610
-			wp_safe_redirect( admin_url( 'index.php?page=give-about' ) );
609
+		if ( ! $upgrade) { // First time install
610
+			wp_safe_redirect(admin_url('index.php?page=give-about'));
611 611
 			exit;
612
-		} elseif( ! give_is_setting_enabled( give_get_option( 'welcome' ) ) ) { // Welcome is disabled in settings
612
+		} elseif ( ! give_is_setting_enabled(give_get_option('welcome'))) { // Welcome is disabled in settings
613 613
 
614 614
 		} else { // Welcome is NOT disabled in settings
615 615
 			wp_safe_redirect(admin_url('index.php?page=give-about'));
Please login to merge, or discard this patch.