Completed
Pull Request — master (#517)
by Chris
15:12
created
includes/admin/class-admin-notices.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 	 *
38 38
 	 * Display admin bar when active
39 39
 	 *
40
-	 * @return bool
40
+	 * @return false|null
41 41
 	 */
42 42
 	public function give_admin_bar_menu() {
43 43
 		global $wp_admin_bar;
Please login to merge, or discard this patch.
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
 	 * @since 1.0
28 28
 	 */
29 29
 	public function __construct() {
30
-		add_action( 'admin_notices', array( $this, 'show_notices' ) );
31
-		add_action( 'give_dismiss_notices', array( $this, 'dismiss_notices' ) );
32
-		add_action( 'admin_bar_menu', array( $this, 'give_admin_bar_menu' ), 1000 );
30
+		add_action('admin_notices', array($this, 'show_notices'));
31
+		add_action('give_dismiss_notices', array($this, 'dismiss_notices'));
32
+		add_action('admin_bar_menu', array($this, 'give_admin_bar_menu'), 1000);
33 33
 	}
34 34
 
35 35
 
@@ -42,18 +42,18 @@  discard block
 block discarded – undo
42 42
 	public function give_admin_bar_menu() {
43 43
 		global $wp_admin_bar;
44 44
 
45
-		if ( ! give_is_test_mode() || ! current_user_can( 'view_give_reports' ) ) {
45
+		if ( ! give_is_test_mode() || ! current_user_can('view_give_reports')) {
46 46
 			return false;
47 47
 		}
48 48
 
49 49
 		//Add the main siteadmin menu item
50
-		$wp_admin_bar->add_menu( array(
50
+		$wp_admin_bar->add_menu(array(
51 51
 			'id'     => 'give-test-notice',
52
-			'href'   => admin_url() . 'edit.php?post_type=give_forms&page=give-settings&tab=gateways',
52
+			'href'   => admin_url().'edit.php?post_type=give_forms&page=give-settings&tab=gateways',
53 53
 			'parent' => 'top-secondary',
54
-			'title'  => __( 'Give Test Mode Active', 'give' ),
55
-			'meta'   => array( 'class' => 'give-test-mode-active' ),
56
-		) );
54
+			'title'  => __('Give Test Mode Active', 'give'),
55
+			'meta'   => array('class' => 'give-test-mode-active'),
56
+		));
57 57
 
58 58
 	}
59 59
 
@@ -68,97 +68,97 @@  discard block
 block discarded – undo
68 68
 			'error'   => array()
69 69
 		);
70 70
 
71
-		if ( ! give_test_ajax_works() && ! get_user_meta( get_current_user_id(), '_give_admin_ajax_inaccessible_dismissed', true ) && current_user_can( 'manage_give_settings' ) ) {
71
+		if ( ! give_test_ajax_works() && ! get_user_meta(get_current_user_id(), '_give_admin_ajax_inaccessible_dismissed', true) && current_user_can('manage_give_settings')) {
72 72
 			echo '<div class="error">';
73
-			echo '<p>' . __( 'Your site appears to be blocking the WordPress ajax interface. This may causes issues with Give.', 'give' ) . '</p>';
74
-			echo '<p>' . sprintf( esc_attr__( 'Please see %1$sthis reference%2$s for possible solutions.', 'give' ), '<a href="https://givewp.com/documentation/core/troubleshooting/admin-ajax-blocked/" target="_blank">', '</a>' ) . '</p>';
75
-			echo '<p><a href="' . add_query_arg( array(
73
+			echo '<p>'.__('Your site appears to be blocking the WordPress ajax interface. This may causes issues with Give.', 'give').'</p>';
74
+			echo '<p>'.sprintf(esc_attr__('Please see %1$sthis reference%2$s for possible solutions.', 'give'), '<a href="https://givewp.com/documentation/core/troubleshooting/admin-ajax-blocked/" target="_blank">', '</a>').'</p>';
75
+			echo '<p><a href="'.add_query_arg(array(
76 76
 					'give_action' => 'dismiss_notices',
77 77
 					'give_notice' => 'admin_ajax_inaccessible'
78
-				) ) . '">' . esc_attr__( 'Dismiss Notice', 'give' ) . '</a></p>';
78
+				)).'">'.esc_attr__('Dismiss Notice', 'give').'</a></p>';
79 79
 			echo '</div>';
80 80
 		}
81 81
 
82 82
 
83
-		if ( isset( $_GET['give-message'] ) ) {
83
+		if (isset($_GET['give-message'])) {
84 84
 
85 85
 			// Donation reports errors
86
-			if ( current_user_can( 'view_give_reports' ) ) {
87
-				switch ( $_GET['give-message'] ) {
86
+			if (current_user_can('view_give_reports')) {
87
+				switch ($_GET['give-message']) {
88 88
 					case 'payment_deleted' :
89
-						$notices['updated']['give-payment-deleted'] = esc_attr__( 'The payment has been deleted.', 'give' );
89
+						$notices['updated']['give-payment-deleted'] = esc_attr__('The payment has been deleted.', 'give');
90 90
 						break;
91 91
 					case 'email_sent' :
92
-						$notices['updated']['give-payment-sent'] = esc_attr__( 'The donation receipt has been resent.', 'give' );
92
+						$notices['updated']['give-payment-sent'] = esc_attr__('The donation receipt has been resent.', 'give');
93 93
 						break;
94 94
 					case 'refreshed-reports' :
95
-						$notices['updated']['give-refreshed-reports'] = esc_attr__( 'The reports cache has been cleared.', 'give' );
95
+						$notices['updated']['give-refreshed-reports'] = esc_attr__('The reports cache has been cleared.', 'give');
96 96
 						break;
97 97
 					case 'payment-note-deleted' :
98
-						$notices['updated']['give-payment-note-deleted'] = esc_attr__( 'The payment note has been deleted.', 'give' );
98
+						$notices['updated']['give-payment-note-deleted'] = esc_attr__('The payment note has been deleted.', 'give');
99 99
 						break;
100 100
 				}
101 101
 			}
102 102
 
103 103
 			// Give settings notices and errors
104
-			if ( current_user_can( 'manage_give_settings' ) ) {
105
-				switch ( $_GET['give-message'] ) {
104
+			if (current_user_can('manage_give_settings')) {
105
+				switch ($_GET['give-message']) {
106 106
 					case 'settings-imported' :
107
-						$notices['updated']['give-settings-imported'] = esc_attr__( 'The settings have been imported.', 'give' );
107
+						$notices['updated']['give-settings-imported'] = esc_attr__('The settings have been imported.', 'give');
108 108
 						break;
109 109
 					case 'api-key-generated' :
110
-						$notices['updated']['give-api-key-generated'] = esc_attr__( 'API keys successfully generated.', 'give' );
110
+						$notices['updated']['give-api-key-generated'] = esc_attr__('API keys successfully generated.', 'give');
111 111
 						break;
112 112
 					case 'api-key-exists' :
113
-						$notices['error']['give-api-key-exists'] = esc_attr__( 'The specified user already has API keys.', 'give' );
113
+						$notices['error']['give-api-key-exists'] = esc_attr__('The specified user already has API keys.', 'give');
114 114
 						break;
115 115
 					case 'api-key-regenerated' :
116
-						$notices['updated']['give-api-key-regenerated'] = esc_attr__( 'API keys successfully regenerated.', 'give' );
116
+						$notices['updated']['give-api-key-regenerated'] = esc_attr__('API keys successfully regenerated.', 'give');
117 117
 						break;
118 118
 					case 'api-key-revoked' :
119
-						$notices['updated']['give-api-key-revoked'] = esc_attr__( 'API keys successfully revoked.', 'give' );
119
+						$notices['updated']['give-api-key-revoked'] = esc_attr__('API keys successfully revoked.', 'give');
120 120
 						break;
121 121
 					case 'sent-test-email' :
122
-						$notices['updated']['give-sent-test-email'] = esc_attr__( 'The test email has been sent.', 'give' );
122
+						$notices['updated']['give-sent-test-email'] = esc_attr__('The test email has been sent.', 'give');
123 123
 						break;
124 124
 				}
125 125
 			}
126 126
 			// Payments errors
127
-			if ( current_user_can( 'edit_give_payments' ) ) {
128
-				switch ( $_GET['give-message'] ) {
127
+			if (current_user_can('edit_give_payments')) {
128
+				switch ($_GET['give-message']) {
129 129
 					case 'note-added' :
130
-						$notices['updated']['give-note-added'] = esc_attr__( 'The payment note has been added successfully.', 'give' );
130
+						$notices['updated']['give-note-added'] = esc_attr__('The payment note has been added successfully.', 'give');
131 131
 						break;
132 132
 					case 'payment-updated' :
133
-						$notices['updated']['give-payment-updated'] = esc_attr__( 'The payment has been successfully updated.', 'give' );
133
+						$notices['updated']['give-payment-updated'] = esc_attr__('The payment has been successfully updated.', 'give');
134 134
 						break;
135 135
 				}
136 136
 			}
137 137
 
138 138
 			// Customer Notices
139
-			if ( current_user_can( 'edit_give_payments' ) ) {
140
-				switch ( $_GET['give-message'] ) {
139
+			if (current_user_can('edit_give_payments')) {
140
+				switch ($_GET['give-message']) {
141 141
 					case 'customer-deleted' :
142
-						$notices['updated']['give-customer-deleted'] = esc_attr__( 'Donor successfully deleted', 'give' );
142
+						$notices['updated']['give-customer-deleted'] = esc_attr__('Donor successfully deleted', 'give');
143 143
 						break;
144 144
 				}
145 145
 			}
146 146
 
147 147
 		}
148 148
 
149
-		if ( count( $notices['updated'] ) > 0 ) {
150
-			foreach ( $notices['updated'] as $notice => $message ) {
151
-				add_settings_error( 'give-notices', $notice, $message, 'updated' );
149
+		if (count($notices['updated']) > 0) {
150
+			foreach ($notices['updated'] as $notice => $message) {
151
+				add_settings_error('give-notices', $notice, $message, 'updated');
152 152
 			}
153 153
 		}
154 154
 
155
-		if ( count( $notices['error'] ) > 0 ) {
156
-			foreach ( $notices['error'] as $notice => $message ) {
157
-				add_settings_error( 'give-notices', $notice, $message, 'error' );
155
+		if (count($notices['error']) > 0) {
156
+			foreach ($notices['error'] as $notice => $message) {
157
+				add_settings_error('give-notices', $notice, $message, 'error');
158 158
 			}
159 159
 		}
160 160
 
161
-		settings_errors( 'give-notices' );
161
+		settings_errors('give-notices');
162 162
 
163 163
 	}
164 164
 
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
 	 * @return void
171 171
 	 */
172 172
 	function give_admin_addons_notices() {
173
-		add_settings_error( 'give-notices', 'give-addons-feed-error', esc_attr__( 'There seems to be an issue with the server. Please try again in a few minutes.', 'give' ), 'error' );
174
-		settings_errors( 'give-notices' );
173
+		add_settings_error('give-notices', 'give-addons-feed-error', esc_attr__('There seems to be an issue with the server. Please try again in a few minutes.', 'give'), 'error');
174
+		settings_errors('give-notices');
175 175
 	}
176 176
 
177 177
 
@@ -182,9 +182,9 @@  discard block
 block discarded – undo
182 182
 	 * @return void
183 183
 	 */
184 184
 	function dismiss_notices() {
185
-		if ( isset( $_GET['give_notice'] ) ) {
186
-			update_user_meta( get_current_user_id(), '_give_' . $_GET['give_notice'] . '_dismissed', 1 );
187
-			wp_redirect( remove_query_arg( array( 'give_action', 'give_notice' ) ) );
185
+		if (isset($_GET['give_notice'])) {
186
+			update_user_meta(get_current_user_id(), '_give_'.$_GET['give_notice'].'_dismissed', 1);
187
+			wp_redirect(remove_query_arg(array('give_action', 'give_notice')));
188 188
 			exit;
189 189
 		}
190 190
 	}
Please login to merge, or discard this patch.
includes/admin/class-api-keys-table.php 3 patches
Doc Comments   +1 added lines, -4 removed lines patch added patch discarded remove patch
@@ -81,7 +81,6 @@  discard block
 block discarded – undo
81 81
 	 * @since  1.1
82 82
 	 *
83 83
 	 * @param array  $item        Contains all the data of the keys
84
-	 * @param string $column_name The name of the column
85 84
 	 *
86 85
 	 * @return string Column Name
87 86
 	 */
@@ -96,7 +95,6 @@  discard block
 block discarded – undo
96 95
 	 * @since  1.1
97 96
 	 *
98 97
 	 * @param array  $item        Contains all the data of the keys
99
-	 * @param string $column_name The name of the column
100 98
 	 *
101 99
 	 * @return string Column Name
102 100
 	 */
@@ -111,7 +109,6 @@  discard block
 block discarded – undo
111 109
 	 * @since  1.1
112 110
 	 *
113 111
 	 * @param array  $item        Contains all the data of the keys
114
-	 * @param string $column_name The name of the column
115 112
 	 *
116 113
 	 * @return string Column Name
117 114
 	 */
@@ -124,7 +121,7 @@  discard block
 block discarded – undo
124 121
 	 *
125 122
 	 * @access public
126 123
 	 * @since  1.1
127
-	 * @return void
124
+	 * @return string
128 125
 	 */
129 126
 	public function column_user( $item ) {
130 127
 
Please login to merge, or discard this patch.
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
17 17
 // Load WP_List_Table if not loaded
18
-if ( ! class_exists( 'WP_List_Table' ) ) {
19
-	require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
18
+if ( ! class_exists('WP_List_Table')) {
19
+	require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php';
20 20
 }
21 21
 
22 22
 /**
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 		global $status, $page;
51 51
 
52 52
 		// Set parent defaults
53
-		parent::__construct( array(
54
-			'singular' => __( 'API Key', 'give' ),     // Singular name of the listed records
55
-			'plural'   => __( 'API Keys', 'give' ),    // Plural name of the listed records
53
+		parent::__construct(array(
54
+			'singular' => __('API Key', 'give'), // Singular name of the listed records
55
+			'plural'   => __('API Keys', 'give'), // Plural name of the listed records
56 56
 			'ajax'     => false                       // Does this table support ajax?
57
-		) );
57
+		));
58 58
 
59 59
 		$this->query();
60 60
 	}
@@ -70,8 +70,8 @@  discard block
 block discarded – undo
70 70
 	 *
71 71
 	 * @return string Column Name
72 72
 	 */
73
-	public function column_default( $item, $column_name ) {
74
-		return $item[ $column_name ];
73
+	public function column_default($item, $column_name) {
74
+		return $item[$column_name];
75 75
 	}
76 76
 
77 77
 	/**
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
 	 *
86 86
 	 * @return string Column Name
87 87
 	 */
88
-	public function column_key( $item ) {
89
-		return '<input readonly="readonly" type="text" class="large-text" value="' . esc_attr( $item['key'] ) . '"/>';
88
+	public function column_key($item) {
89
+		return '<input readonly="readonly" type="text" class="large-text" value="'.esc_attr($item['key']).'"/>';
90 90
 	}
91 91
 
92 92
 	/**
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
 	 *
101 101
 	 * @return string Column Name
102 102
 	 */
103
-	public function column_token( $item ) {
104
-		return '<input readonly="readonly" type="text" class="large-text" value="' . esc_attr( $item['token'] ) . '"/>';
103
+	public function column_token($item) {
104
+		return '<input readonly="readonly" type="text" class="large-text" value="'.esc_attr($item['token']).'"/>';
105 105
 	}
106 106
 
107 107
 	/**
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
 	 *
116 116
 	 * @return string Column Name
117 117
 	 */
118
-	public function column_secret( $item ) {
119
-		return '<input readonly="readonly" type="text" class="large-text" value="' . esc_attr( $item['secret'] ) . '"/>';
118
+	public function column_secret($item) {
119
+		return '<input readonly="readonly" type="text" class="large-text" value="'.esc_attr($item['secret']).'"/>';
120 120
 	}
121 121
 
122 122
 	/**
@@ -126,43 +126,43 @@  discard block
 block discarded – undo
126 126
 	 * @since  1.1
127 127
 	 * @return void
128 128
 	 */
129
-	public function column_user( $item ) {
129
+	public function column_user($item) {
130 130
 
131 131
 		$actions = array();
132 132
 
133
-		if ( apply_filters( 'give_api_log_requests', true ) ) {
133
+		if (apply_filters('give_api_log_requests', true)) {
134 134
 			$actions['view'] = sprintf(
135 135
 				'<a href="%s">%s</a>',
136
-				esc_url( add_query_arg( array( 'view'      => 'api_requests',
136
+				esc_url(add_query_arg(array('view'      => 'api_requests',
137 137
 				                               'post_type' => 'give_forms',
138 138
 				                               'page'      => 'give-reports',
139 139
 				                               'tab'       => 'logs',
140 140
 				                               's'         => $item['email']
141
-				), 'edit.php' ) ),
142
-				__( 'View API Log', 'give' )
141
+				), 'edit.php')),
142
+				__('View API Log', 'give')
143 143
 			);
144 144
 		}
145 145
 
146 146
 		$actions['reissue'] = sprintf(
147 147
 			'<a href="%s" class="give-regenerate-api-key">%s</a>',
148
-			esc_url( wp_nonce_url( add_query_arg( array( 'user_id'          => $item['id'],
148
+			esc_url(wp_nonce_url(add_query_arg(array('user_id'          => $item['id'],
149 149
 			                                             'give_action'      => 'process_api_key',
150 150
 			                                             'give_api_process' => 'regenerate'
151
-			) ), 'give-api-nonce' ) ),
152
-			__( 'Reissue', 'give' )
151
+			)), 'give-api-nonce')),
152
+			__('Reissue', 'give')
153 153
 		);
154
-		$actions['revoke']  = sprintf(
154
+		$actions['revoke'] = sprintf(
155 155
 			'<a href="%s" class="give-revoke-api-key give-delete">%s</a>',
156
-			esc_url( wp_nonce_url( add_query_arg( array( 'user_id'          => $item['id'],
156
+			esc_url(wp_nonce_url(add_query_arg(array('user_id'          => $item['id'],
157 157
 			                                             'give_action'      => 'process_api_key',
158 158
 			                                             'give_api_process' => 'revoke'
159
-			) ), 'give-api-nonce' ) ),
160
-			__( 'Revoke', 'give' )
159
+			)), 'give-api-nonce')),
160
+			__('Revoke', 'give')
161 161
 		);
162 162
 
163
-		$actions = apply_filters( 'give_api_row_actions', array_filter( $actions ) );
163
+		$actions = apply_filters('give_api_row_actions', array_filter($actions));
164 164
 
165
-		return sprintf( '%1$s %2$s', $item['user'], $this->row_actions( $actions ) );
165
+		return sprintf('%1$s %2$s', $item['user'], $this->row_actions($actions));
166 166
 	}
167 167
 
168 168
 	/**
@@ -174,10 +174,10 @@  discard block
 block discarded – undo
174 174
 	 */
175 175
 	public function get_columns() {
176 176
 		$columns = array(
177
-			'user'   => __( 'Username', 'give' ),
178
-			'key'    => __( 'Public Key', 'give' ),
179
-			'token'  => __( 'Token', 'give' ),
180
-			'secret' => __( 'Secret Key', 'give' )
177
+			'user'   => __('Username', 'give'),
178
+			'key'    => __('Public Key', 'give'),
179
+			'token'  => __('Token', 'give'),
180
+			'secret' => __('Secret Key', 'give')
181 181
 		);
182 182
 
183 183
 		return $columns;
@@ -190,20 +190,20 @@  discard block
 block discarded – undo
190 190
 	 * @since  1.1
191 191
 	 * @return void
192 192
 	 */
193
-	function bulk_actions( $which = '' ) {
193
+	function bulk_actions($which = '') {
194 194
 		// These aren't really bulk actions but this outputs the markup in the right place
195 195
 		static $give_api_is_bottom;
196 196
 
197
-		if ( $give_api_is_bottom ) {
197
+		if ($give_api_is_bottom) {
198 198
 			return;
199 199
 		}
200 200
 		?>
201
-		<form method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=api' ); ?>">
201
+		<form method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-settings&tab=api'); ?>">
202 202
 			<input type="hidden" name="give_action" value="process_api_key" />
203 203
 			<input type="hidden" name="give_api_process" value="generate" />
204
-			<?php wp_nonce_field( 'give-api-nonce' ); ?>
204
+			<?php wp_nonce_field('give-api-nonce'); ?>
205 205
 			<?php echo Give()->html->ajax_user_search(); ?>
206
-			<?php submit_button( __( 'Generate New API Keys', 'give' ), 'secondary', 'submit', false ); ?>
206
+			<?php submit_button(__('Generate New API Keys', 'give'), 'secondary', 'submit', false); ?>
207 207
 		</form>
208 208
 		<?php
209 209
 		$give_api_is_bottom = true;
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 	 * @return int Current page number
218 218
 	 */
219 219
 	public function get_paged() {
220
-		return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1;
220
+		return isset($_GET['paged']) ? absint($_GET['paged']) : 1;
221 221
 	}
222 222
 
223 223
 	/**
@@ -228,21 +228,21 @@  discard block
 block discarded – undo
228 228
 	 * @return void
229 229
 	 */
230 230
 	public function query() {
231
-		$users = get_users( array(
231
+		$users = get_users(array(
232 232
 			'meta_value' => 'give_user_secret_key',
233 233
 			'number'     => $this->per_page,
234
-			'offset'     => $this->per_page * ( $this->get_paged() - 1 )
235
-		) );
236
-		$keys  = array();
237
-
238
-		foreach ( $users as $user ) {
239
-			$keys[ $user->ID ]['id']    = $user->ID;
240
-			$keys[ $user->ID ]['email'] = $user->user_email;
241
-			$keys[ $user->ID ]['user']  = '<a href="' . add_query_arg( 'user_id', $user->ID, 'user-edit.php' ) . '"><strong>' . $user->user_login . '</strong></a>';
242
-
243
-			$keys[ $user->ID ]['key']    = Give()->api->get_user_public_key( $user->ID );
244
-			$keys[ $user->ID ]['secret'] = Give()->api->get_user_secret_key( $user->ID );
245
-			$keys[ $user->ID ]['token']  = Give()->api->get_token( $user->ID );
234
+			'offset'     => $this->per_page * ($this->get_paged() - 1)
235
+		));
236
+		$keys = array();
237
+
238
+		foreach ($users as $user) {
239
+			$keys[$user->ID]['id']    = $user->ID;
240
+			$keys[$user->ID]['email'] = $user->user_email;
241
+			$keys[$user->ID]['user']  = '<a href="'.add_query_arg('user_id', $user->ID, 'user-edit.php').'"><strong>'.$user->user_login.'</strong></a>';
242
+
243
+			$keys[$user->ID]['key']    = Give()->api->get_user_public_key($user->ID);
244
+			$keys[$user->ID]['secret'] = Give()->api->get_user_secret_key($user->ID);
245
+			$keys[$user->ID]['token']  = Give()->api->get_token($user->ID);
246 246
 		}
247 247
 
248 248
 		return $keys;
@@ -259,13 +259,13 @@  discard block
 block discarded – undo
259 259
 	public function total_items() {
260 260
 		global $wpdb;
261 261
 
262
-		if ( ! get_transient( 'give_total_api_keys' ) ) {
263
-			$total_items = $wpdb->get_var( "SELECT count(user_id) FROM $wpdb->usermeta WHERE meta_value='give_user_secret_key'" );
262
+		if ( ! get_transient('give_total_api_keys')) {
263
+			$total_items = $wpdb->get_var("SELECT count(user_id) FROM $wpdb->usermeta WHERE meta_value='give_user_secret_key'");
264 264
 
265
-			set_transient( 'give_total_api_keys', $total_items, 60 * 60 );
265
+			set_transient('give_total_api_keys', $total_items, 60 * 60);
266 266
 		}
267 267
 
268
-		return get_transient( 'give_total_api_keys' );
268
+		return get_transient('give_total_api_keys');
269 269
 	}
270 270
 
271 271
 	/**
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 		$hidden   = array(); // No hidden columns
282 282
 		$sortable = array(); // Not sortable... for now
283 283
 
284
-		$this->_column_headers = array( $columns, $hidden, $sortable, 'id' );
284
+		$this->_column_headers = array($columns, $hidden, $sortable, 'id');
285 285
 
286 286
 		$data = $this->query();
287 287
 
@@ -289,10 +289,10 @@  discard block
 block discarded – undo
289 289
 
290 290
 		$this->items = $data;
291 291
 
292
-		$this->set_pagination_args( array(
292
+		$this->set_pagination_args(array(
293 293
 				'total_items' => $total_items,
294 294
 				'per_page'    => $this->per_page,
295
-				'total_pages' => ceil( $total_items / $this->per_page )
295
+				'total_pages' => ceil($total_items / $this->per_page)
296 296
 			)
297 297
 		);
298 298
 	}
Please login to merge, or discard this patch.
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * API Key Table Class
4
- *
5
- * @package     Give
6
- * @subpackage  Admin/Tools/APIKeys
7
- * @copyright   Copyright (c) 2015, WordImpress
8
- * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
- * @since       1.1
10
- */
3
+	 * API Key Table Class
4
+	 *
5
+	 * @package     Give
6
+	 * @subpackage  Admin/Tools/APIKeys
7
+	 * @copyright   Copyright (c) 2015, WordImpress
8
+	 * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+	 * @since       1.1
10
+	 */
11 11
 
12 12
 // Exit if accessed directly
13 13
 if ( ! defined( 'ABSPATH' ) ) {
@@ -134,10 +134,10 @@  discard block
 block discarded – undo
134 134
 			$actions['view'] = sprintf(
135 135
 				'<a href="%s">%s</a>',
136 136
 				esc_url( add_query_arg( array( 'view'      => 'api_requests',
137
-				                               'post_type' => 'give_forms',
138
-				                               'page'      => 'give-reports',
139
-				                               'tab'       => 'logs',
140
-				                               's'         => $item['email']
137
+											   'post_type' => 'give_forms',
138
+											   'page'      => 'give-reports',
139
+											   'tab'       => 'logs',
140
+											   's'         => $item['email']
141 141
 				), 'edit.php' ) ),
142 142
 				__( 'View API Log', 'give' )
143 143
 			);
@@ -146,16 +146,16 @@  discard block
 block discarded – undo
146 146
 		$actions['reissue'] = sprintf(
147 147
 			'<a href="%s" class="give-regenerate-api-key">%s</a>',
148 148
 			esc_url( wp_nonce_url( add_query_arg( array( 'user_id'          => $item['id'],
149
-			                                             'give_action'      => 'process_api_key',
150
-			                                             'give_api_process' => 'regenerate'
149
+														 'give_action'      => 'process_api_key',
150
+														 'give_api_process' => 'regenerate'
151 151
 			) ), 'give-api-nonce' ) ),
152 152
 			__( 'Reissue', 'give' )
153 153
 		);
154 154
 		$actions['revoke']  = sprintf(
155 155
 			'<a href="%s" class="give-revoke-api-key give-delete">%s</a>',
156 156
 			esc_url( wp_nonce_url( add_query_arg( array( 'user_id'          => $item['id'],
157
-			                                             'give_action'      => 'process_api_key',
158
-			                                             'give_api_process' => 'revoke'
157
+														 'give_action'      => 'process_api_key',
158
+														 'give_api_process' => 'revoke'
159 159
 			) ), 'give-api-nonce' ) ),
160 160
 			__( 'Revoke', 'give' )
161 161
 		);
Please login to merge, or discard this patch.
includes/admin/EDD_SL_Plugin_Updater.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
      * @uses api_request()
68 68
      *
69 69
      * @param array   $_transient_data Update array build by WordPress.
70
-     * @return array Modified update array with custom plugin data.
70
+     * @return stdClass Modified update array with custom plugin data.
71 71
      */
72 72
     function check_update( $_transient_data ) {
73 73
 
Please login to merge, or discard this patch.
Indentation   +255 added lines, -255 removed lines patch added patch discarded remove patch
@@ -13,328 +13,328 @@
 block discarded – undo
13 13
  * @version 1.6
14 14
  */
15 15
 class EDD_SL_Plugin_Updater {
16
-    private $api_url   = '';
17
-    private $api_data  = array();
18
-    private $name      = '';
19
-    private $slug      = '';
20
-
21
-    /**
22
-     * Class constructor.
23
-     *
24
-     * @uses plugin_basename()
25
-     * @uses hook()
26
-     *
27
-     * @param string  $_api_url     The URL pointing to the custom API endpoint.
28
-     * @param string  $_plugin_file Path to the plugin file.
29
-     * @param array   $_api_data    Optional data to send with API calls.
30
-     * @return void
31
-     */
32
-    function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
33
-        $this->api_url  = trailingslashit( $_api_url );
34
-        $this->api_data = $_api_data;
35
-        $this->name     = plugin_basename( $_plugin_file );
36
-        $this->slug     = basename( $_plugin_file, '.php' );
37
-        $this->version  = $_api_data['version'];
38
-
39
-        // Set up hooks.
40
-        $this->init();
41
-        add_action( 'admin_init', array( $this, 'show_changelog' ) );
42
-    }
43
-
44
-    /**
45
-     * Set up WordPress filters to hook into WP's update process.
46
-     *
47
-     * @uses add_filter()
48
-     *
49
-     * @return void
50
-     */
51
-    public function init() {
16
+	private $api_url   = '';
17
+	private $api_data  = array();
18
+	private $name      = '';
19
+	private $slug      = '';
20
+
21
+	/**
22
+	 * Class constructor.
23
+	 *
24
+	 * @uses plugin_basename()
25
+	 * @uses hook()
26
+	 *
27
+	 * @param string  $_api_url     The URL pointing to the custom API endpoint.
28
+	 * @param string  $_plugin_file Path to the plugin file.
29
+	 * @param array   $_api_data    Optional data to send with API calls.
30
+	 * @return void
31
+	 */
32
+	function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
33
+		$this->api_url  = trailingslashit( $_api_url );
34
+		$this->api_data = $_api_data;
35
+		$this->name     = plugin_basename( $_plugin_file );
36
+		$this->slug     = basename( $_plugin_file, '.php' );
37
+		$this->version  = $_api_data['version'];
38
+
39
+		// Set up hooks.
40
+		$this->init();
41
+		add_action( 'admin_init', array( $this, 'show_changelog' ) );
42
+	}
43
+
44
+	/**
45
+	 * Set up WordPress filters to hook into WP's update process.
46
+	 *
47
+	 * @uses add_filter()
48
+	 *
49
+	 * @return void
50
+	 */
51
+	public function init() {
52 52
 
53
-        add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
54
-        add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
53
+		add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
54
+		add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
55 55
 
56
-        add_action( 'after_plugin_row_' . $this->name, array( $this, 'show_update_notification' ), 10, 2 );
57
-    }
56
+		add_action( 'after_plugin_row_' . $this->name, array( $this, 'show_update_notification' ), 10, 2 );
57
+	}
58 58
 
59
-    /**
60
-     * Check for Updates at the defined API endpoint and modify the update array.
61
-     *
62
-     * This function dives into the update API just when WordPress creates its update array,
63
-     * then adds a custom API call and injects the custom plugin data retrieved from the API.
64
-     * It is reassembled from parts of the native WordPress plugin update code.
65
-     * See wp-includes/update.php line 121 for the original wp_update_plugins() function.
66
-     *
67
-     * @uses api_request()
68
-     *
69
-     * @param array   $_transient_data Update array build by WordPress.
70
-     * @return array Modified update array with custom plugin data.
71
-     */
72
-    function check_update( $_transient_data ) {
59
+	/**
60
+	 * Check for Updates at the defined API endpoint and modify the update array.
61
+	 *
62
+	 * This function dives into the update API just when WordPress creates its update array,
63
+	 * then adds a custom API call and injects the custom plugin data retrieved from the API.
64
+	 * It is reassembled from parts of the native WordPress plugin update code.
65
+	 * See wp-includes/update.php line 121 for the original wp_update_plugins() function.
66
+	 *
67
+	 * @uses api_request()
68
+	 *
69
+	 * @param array   $_transient_data Update array build by WordPress.
70
+	 * @return array Modified update array with custom plugin data.
71
+	 */
72
+	function check_update( $_transient_data ) {
73 73
 
74
-        global $pagenow;
74
+		global $pagenow;
75 75
 
76
-        if( ! is_object( $_transient_data ) ) {
77
-            $_transient_data = new stdClass;
78
-        }
76
+		if( ! is_object( $_transient_data ) ) {
77
+			$_transient_data = new stdClass;
78
+		}
79 79
 
80
-        if( 'plugins.php' == $pagenow && is_multisite() ) {
81
-            return $_transient_data;
82
-        }
80
+		if( 'plugins.php' == $pagenow && is_multisite() ) {
81
+			return $_transient_data;
82
+		}
83 83
 
84
-        if ( empty( $_transient_data->response ) || empty( $_transient_data->response[ $this->name ] ) ) {
84
+		if ( empty( $_transient_data->response ) || empty( $_transient_data->response[ $this->name ] ) ) {
85 85
 
86
-            $version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
86
+			$version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
87 87
 
88
-            if ( false !== $version_info && is_object( $version_info ) && isset( $version_info->new_version ) ) {
88
+			if ( false !== $version_info && is_object( $version_info ) && isset( $version_info->new_version ) ) {
89 89
 
90
-                $this->did_check = true;
90
+				$this->did_check = true;
91 91
 
92
-                if( version_compare( $this->version, $version_info->new_version, '<' ) ) {
92
+				if( version_compare( $this->version, $version_info->new_version, '<' ) ) {
93 93
 
94
-                    $_transient_data->response[ $this->name ] = $version_info;
94
+					$_transient_data->response[ $this->name ] = $version_info;
95 95
 
96
-                }
96
+				}
97 97
 
98
-                $_transient_data->last_checked = time();
99
-                $_transient_data->checked[ $this->name ] = $this->version;
98
+				$_transient_data->last_checked = time();
99
+				$_transient_data->checked[ $this->name ] = $this->version;
100 100
 
101
-            }
101
+			}
102 102
 
103
-        }
103
+		}
104 104
 
105
-        return $_transient_data;
106
-    }
105
+		return $_transient_data;
106
+	}
107 107
 
108
-    /**
109
-     * show update nofication row -- needed for multisite subsites, because WP won't tell you otherwise!
110
-     *
111
-     * @param string  $file
112
-     * @param array   $plugin
113
-     */
114
-    public function show_update_notification( $file, $plugin ) {
108
+	/**
109
+	 * show update nofication row -- needed for multisite subsites, because WP won't tell you otherwise!
110
+	 *
111
+	 * @param string  $file
112
+	 * @param array   $plugin
113
+	 */
114
+	public function show_update_notification( $file, $plugin ) {
115 115
 
116
-        if( ! current_user_can( 'update_plugins' ) ) {
117
-            return;
118
-        }
116
+		if( ! current_user_can( 'update_plugins' ) ) {
117
+			return;
118
+		}
119 119
 
120
-        if( ! is_multisite() ) {
121
-            return;
122
-        }
120
+		if( ! is_multisite() ) {
121
+			return;
122
+		}
123 123
 
124
-        if ( $this->name != $file ) {
125
-            return;
126
-        }
124
+		if ( $this->name != $file ) {
125
+			return;
126
+		}
127 127
 
128
-        // Remove our filter on the site transient
129
-        remove_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ), 10 );
128
+		// Remove our filter on the site transient
129
+		remove_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ), 10 );
130 130
 
131
-        $update_cache = get_site_transient( 'update_plugins' );
131
+		$update_cache = get_site_transient( 'update_plugins' );
132 132
 
133
-        if ( ! is_object( $update_cache ) || empty( $update_cache->response ) || empty( $update_cache->response[ $this->name ] ) ) {
133
+		if ( ! is_object( $update_cache ) || empty( $update_cache->response ) || empty( $update_cache->response[ $this->name ] ) ) {
134 134
 
135
-            $cache_key    = md5( 'edd_plugin_' .sanitize_key( $this->name ) . '_version_info' );
136
-            $version_info = get_transient( $cache_key );
135
+			$cache_key    = md5( 'edd_plugin_' .sanitize_key( $this->name ) . '_version_info' );
136
+			$version_info = get_transient( $cache_key );
137 137
 
138
-            if( false === $version_info ) {
138
+			if( false === $version_info ) {
139 139
 
140
-                $version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
140
+				$version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
141 141
 
142
-                set_transient( $cache_key, $version_info, 3600 );
143
-            }
142
+				set_transient( $cache_key, $version_info, 3600 );
143
+			}
144 144
 
145 145
 
146
-            if( ! is_object( $version_info ) ) {
147
-                return;
148
-            }
146
+			if( ! is_object( $version_info ) ) {
147
+				return;
148
+			}
149 149
 
150
-            if( version_compare( $this->version, $version_info->new_version, '<' ) ) {
150
+			if( version_compare( $this->version, $version_info->new_version, '<' ) ) {
151 151
 
152
-                $update_cache->response[ $this->name ] = $version_info;
152
+				$update_cache->response[ $this->name ] = $version_info;
153 153
 
154
-            }
154
+			}
155 155
 
156
-            $update_cache->last_checked = time();
157
-            $update_cache->checked[ $this->name ] = $this->version;
156
+			$update_cache->last_checked = time();
157
+			$update_cache->checked[ $this->name ] = $this->version;
158 158
 
159
-            set_site_transient( 'update_plugins', $update_cache );
159
+			set_site_transient( 'update_plugins', $update_cache );
160 160
 
161
-        } else {
161
+		} else {
162 162
 
163
-            $version_info = $update_cache->response[ $this->name ];
163
+			$version_info = $update_cache->response[ $this->name ];
164 164
 
165
-        }
165
+		}
166 166
 
167
-        // Restore our filter
168
-        add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
167
+		// Restore our filter
168
+		add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
169 169
 
170
-        if ( ! empty( $update_cache->response[ $this->name ] ) && version_compare( $this->version, $version_info->new_version, '<' ) ) {
170
+		if ( ! empty( $update_cache->response[ $this->name ] ) && version_compare( $this->version, $version_info->new_version, '<' ) ) {
171 171
 
172
-            // build a plugin list row, with update notification
173
-            $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
174
-            echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
172
+			// build a plugin list row, with update notification
173
+			$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
174
+			echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
175 175
 
176
-            $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' );
176
+			$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' );
177 177
 
178
-            if ( empty( $version_info->download_link ) ) {
179
-                printf(
180
-                    __( 'There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a>.', 'edd' ),
181
-                    esc_html( $version_info->name ),
182
-                    esc_url( $changelog_link ),
183
-                    esc_html( $version_info->new_version )
184
-                );
185
-            } else {
186
-                printf(
187
-                    __( '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>.', 'edd' ),
188
-                    esc_html( $version_info->name ),
189
-                    esc_url( $changelog_link ),
190
-                    esc_html( $version_info->new_version ),
191
-                    esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) )
192
-                );
193
-            }
178
+			if ( empty( $version_info->download_link ) ) {
179
+				printf(
180
+					__( 'There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a>.', 'edd' ),
181
+					esc_html( $version_info->name ),
182
+					esc_url( $changelog_link ),
183
+					esc_html( $version_info->new_version )
184
+				);
185
+			} else {
186
+				printf(
187
+					__( '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>.', 'edd' ),
188
+					esc_html( $version_info->name ),
189
+					esc_url( $changelog_link ),
190
+					esc_html( $version_info->new_version ),
191
+					esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) )
192
+				);
193
+			}
194 194
 
195
-            echo '</div></td></tr>';
196
-        }
197
-    }
195
+			echo '</div></td></tr>';
196
+		}
197
+	}
198 198
 
199 199
 
200
-    /**
201
-     * Updates information on the "View version x.x details" page with custom data.
202
-     *
203
-     * @uses api_request()
204
-     *
205
-     * @param mixed   $_data
206
-     * @param string  $_action
207
-     * @param object  $_args
208
-     * @return object $_data
209
-     */
210
-    function plugins_api_filter( $_data, $_action = '', $_args = null ) {
200
+	/**
201
+	 * Updates information on the "View version x.x details" page with custom data.
202
+	 *
203
+	 * @uses api_request()
204
+	 *
205
+	 * @param mixed   $_data
206
+	 * @param string  $_action
207
+	 * @param object  $_args
208
+	 * @return object $_data
209
+	 */
210
+	function plugins_api_filter( $_data, $_action = '', $_args = null ) {
211 211
 
212 212
 
213
-        if ( $_action != 'plugin_information' ) {
213
+		if ( $_action != 'plugin_information' ) {
214 214
 
215
-            return $_data;
215
+			return $_data;
216 216
 
217
-        }
217
+		}
218 218
 
219
-        if ( ! isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) {
219
+		if ( ! isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) {
220 220
 
221
-            return $_data;
221
+			return $_data;
222 222
 
223
-        }
223
+		}
224 224
 
225
-        $to_send = array(
226
-            'slug'   => $this->slug,
227
-            'is_ssl' => is_ssl(),
228
-            'fields' => array(
229
-                'banners' => false, // These will be supported soon hopefully
230
-                'reviews' => false
231
-            )
232
-        );
225
+		$to_send = array(
226
+			'slug'   => $this->slug,
227
+			'is_ssl' => is_ssl(),
228
+			'fields' => array(
229
+				'banners' => false, // These will be supported soon hopefully
230
+				'reviews' => false
231
+			)
232
+		);
233 233
 
234
-        $api_response = $this->api_request( 'plugin_information', $to_send );
234
+		$api_response = $this->api_request( 'plugin_information', $to_send );
235 235
 
236
-        if ( false !== $api_response ) {
237
-            $_data = $api_response;
238
-        }
236
+		if ( false !== $api_response ) {
237
+			$_data = $api_response;
238
+		}
239 239
 
240
-        return $_data;
241
-    }
240
+		return $_data;
241
+	}
242 242
 
243 243
 
244
-    /**
245
-     * Disable SSL verification in order to prevent download update failures
246
-     *
247
-     * @param array   $args
248
-     * @param string  $url
249
-     * @return object $array
250
-     */
251
-    function http_request_args( $args, $url ) {
252
-        // If it is an https request and we are performing a package download, disable ssl verification
253
-        if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
254
-            $args['sslverify'] = false;
255
-        }
256
-        return $args;
257
-    }
244
+	/**
245
+	 * Disable SSL verification in order to prevent download update failures
246
+	 *
247
+	 * @param array   $args
248
+	 * @param string  $url
249
+	 * @return object $array
250
+	 */
251
+	function http_request_args( $args, $url ) {
252
+		// If it is an https request and we are performing a package download, disable ssl verification
253
+		if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
254
+			$args['sslverify'] = false;
255
+		}
256
+		return $args;
257
+	}
258 258
 
259
-    /**
260
-     * Calls the API and, if successfull, returns the object delivered by the API.
261
-     *
262
-     * @uses get_bloginfo()
263
-     * @uses wp_remote_post()
264
-     * @uses is_wp_error()
265
-     *
266
-     * @param string  $_action The requested action.
267
-     * @param array   $_data   Parameters for the API action.
268
-     * @return false||object
269
-     */
270
-    private function api_request( $_action, $_data ) {
271
-
272
-        global $wp_version;
273
-
274
-        $data = array_merge( $this->api_data, $_data );
275
-
276
-        if ( $data['slug'] != $this->slug )
277
-            return;
278
-
279
-        if ( empty( $data['license'] ) )
280
-            return;
281
-
282
-        if( $this->api_url == home_url() ) {
283
-            return false; // Don't allow a plugin to ping itself
284
-        }
285
-
286
-        $api_params = array(
287
-            'edd_action' => 'get_version',
288
-            'license'    => $data['license'],
289
-            'item_name'  => isset( $data['item_name'] ) ? $data['item_name'] : false,
290
-            'item_id'    => isset( $data['item_id'] ) ? $data['item_id'] : false,
291
-            'slug'       => $data['slug'],
292
-            'author'     => $data['author'],
293
-            'url'        => home_url()
294
-        );
259
+	/**
260
+	 * Calls the API and, if successfull, returns the object delivered by the API.
261
+	 *
262
+	 * @uses get_bloginfo()
263
+	 * @uses wp_remote_post()
264
+	 * @uses is_wp_error()
265
+	 *
266
+	 * @param string  $_action The requested action.
267
+	 * @param array   $_data   Parameters for the API action.
268
+	 * @return false||object
269
+	 */
270
+	private function api_request( $_action, $_data ) {
271
+
272
+		global $wp_version;
273
+
274
+		$data = array_merge( $this->api_data, $_data );
275
+
276
+		if ( $data['slug'] != $this->slug )
277
+			return;
278
+
279
+		if ( empty( $data['license'] ) )
280
+			return;
281
+
282
+		if( $this->api_url == home_url() ) {
283
+			return false; // Don't allow a plugin to ping itself
284
+		}
285
+
286
+		$api_params = array(
287
+			'edd_action' => 'get_version',
288
+			'license'    => $data['license'],
289
+			'item_name'  => isset( $data['item_name'] ) ? $data['item_name'] : false,
290
+			'item_id'    => isset( $data['item_id'] ) ? $data['item_id'] : false,
291
+			'slug'       => $data['slug'],
292
+			'author'     => $data['author'],
293
+			'url'        => home_url()
294
+		);
295 295
 
296
-        $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
296
+		$request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
297 297
 
298
-        if ( ! is_wp_error( $request ) ) {
299
-            $request = json_decode( wp_remote_retrieve_body( $request ) );
300
-        }
298
+		if ( ! is_wp_error( $request ) ) {
299
+			$request = json_decode( wp_remote_retrieve_body( $request ) );
300
+		}
301 301
 
302
-        if ( $request && isset( $request->sections ) ) {
303
-            $request->sections = maybe_unserialize( $request->sections );
304
-        } else {
305
-            $request = false;
306
-        }
302
+		if ( $request && isset( $request->sections ) ) {
303
+			$request->sections = maybe_unserialize( $request->sections );
304
+		} else {
305
+			$request = false;
306
+		}
307 307
 
308
-        return $request;
309
-    }
308
+		return $request;
309
+	}
310 310
 
311
-    public function show_changelog() {
311
+	public function show_changelog() {
312 312
 
313 313
 
314
-        if( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) {
315
-            return;
316
-        }
314
+		if( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) {
315
+			return;
316
+		}
317 317
 
318
-        if( empty( $_REQUEST['plugin'] ) ) {
319
-            return;
320
-        }
321
-
322
-        if( empty( $_REQUEST['slug'] ) ) {
323
-            return;
324
-        }
325
-
326
-        if( ! current_user_can( 'update_plugins' ) ) {
327
-            wp_die( __( 'You do not have permission to install plugin updates', 'edd' ), __( 'Error', 'edd' ), array( 'response' => 403 ) );
328
-        }
329
-
330
-        $response = $this->api_request( 'plugin_latest_version', array( 'slug' => $_REQUEST['slug'] ) );
331
-
332
-        if( $response && isset( $response->sections['changelog'] ) ) {
333
-            echo '<div style="background:#fff;padding:10px;">' . $response->sections['changelog'] . '</div>';
334
-        }
335
-
336
-
337
-        exit;
338
-    }
318
+		if( empty( $_REQUEST['plugin'] ) ) {
319
+			return;
320
+		}
321
+
322
+		if( empty( $_REQUEST['slug'] ) ) {
323
+			return;
324
+		}
325
+
326
+		if( ! current_user_can( 'update_plugins' ) ) {
327
+			wp_die( __( 'You do not have permission to install plugin updates', 'edd' ), __( 'Error', 'edd' ), array( 'response' => 403 ) );
328
+		}
329
+
330
+		$response = $this->api_request( 'plugin_latest_version', array( 'slug' => $_REQUEST['slug'] ) );
331
+
332
+		if( $response && isset( $response->sections['changelog'] ) ) {
333
+			echo '<div style="background:#fff;padding:10px;">' . $response->sections['changelog'] . '</div>';
334
+		}
335
+
336
+
337
+		exit;
338
+	}
339 339
 
340 340
 }
Please login to merge, or discard this patch.
Spacing   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 //set_site_transient( 'update_plugins', null );
5 5
 
6 6
 // Exit if accessed directly
7
-if ( ! defined( 'ABSPATH' ) ) exit;
7
+if ( ! defined('ABSPATH')) exit;
8 8
 
9 9
 /**
10 10
  * Allows plugins to use their own update API.
@@ -29,16 +29,16 @@  discard block
 block discarded – undo
29 29
      * @param array   $_api_data    Optional data to send with API calls.
30 30
      * @return void
31 31
      */
32
-    function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
33
-        $this->api_url  = trailingslashit( $_api_url );
32
+    function __construct($_api_url, $_plugin_file, $_api_data = null) {
33
+        $this->api_url  = trailingslashit($_api_url);
34 34
         $this->api_data = $_api_data;
35
-        $this->name     = plugin_basename( $_plugin_file );
36
-        $this->slug     = basename( $_plugin_file, '.php' );
35
+        $this->name     = plugin_basename($_plugin_file);
36
+        $this->slug     = basename($_plugin_file, '.php');
37 37
         $this->version  = $_api_data['version'];
38 38
 
39 39
         // Set up hooks.
40 40
         $this->init();
41
-        add_action( 'admin_init', array( $this, 'show_changelog' ) );
41
+        add_action('admin_init', array($this, 'show_changelog'));
42 42
     }
43 43
 
44 44
     /**
@@ -50,10 +50,10 @@  discard block
 block discarded – undo
50 50
      */
51 51
     public function init() {
52 52
 
53
-        add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
54
-        add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
53
+        add_filter('pre_set_site_transient_update_plugins', array($this, 'check_update'));
54
+        add_filter('plugins_api', array($this, 'plugins_api_filter'), 10, 3);
55 55
 
56
-        add_action( 'after_plugin_row_' . $this->name, array( $this, 'show_update_notification' ), 10, 2 );
56
+        add_action('after_plugin_row_'.$this->name, array($this, 'show_update_notification'), 10, 2);
57 57
     }
58 58
 
59 59
     /**
@@ -69,34 +69,34 @@  discard block
 block discarded – undo
69 69
      * @param array   $_transient_data Update array build by WordPress.
70 70
      * @return array Modified update array with custom plugin data.
71 71
      */
72
-    function check_update( $_transient_data ) {
72
+    function check_update($_transient_data) {
73 73
 
74 74
         global $pagenow;
75 75
 
76
-        if( ! is_object( $_transient_data ) ) {
76
+        if ( ! is_object($_transient_data)) {
77 77
             $_transient_data = new stdClass;
78 78
         }
79 79
 
80
-        if( 'plugins.php' == $pagenow && is_multisite() ) {
80
+        if ('plugins.php' == $pagenow && is_multisite()) {
81 81
             return $_transient_data;
82 82
         }
83 83
 
84
-        if ( empty( $_transient_data->response ) || empty( $_transient_data->response[ $this->name ] ) ) {
84
+        if (empty($_transient_data->response) || empty($_transient_data->response[$this->name])) {
85 85
 
86
-            $version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
86
+            $version_info = $this->api_request('plugin_latest_version', array('slug' => $this->slug));
87 87
 
88
-            if ( false !== $version_info && is_object( $version_info ) && isset( $version_info->new_version ) ) {
88
+            if (false !== $version_info && is_object($version_info) && isset($version_info->new_version)) {
89 89
 
90 90
                 $this->did_check = true;
91 91
 
92
-                if( version_compare( $this->version, $version_info->new_version, '<' ) ) {
92
+                if (version_compare($this->version, $version_info->new_version, '<')) {
93 93
 
94
-                    $_transient_data->response[ $this->name ] = $version_info;
94
+                    $_transient_data->response[$this->name] = $version_info;
95 95
 
96 96
                 }
97 97
 
98 98
                 $_transient_data->last_checked = time();
99
-                $_transient_data->checked[ $this->name ] = $this->version;
99
+                $_transient_data->checked[$this->name] = $this->version;
100 100
 
101 101
             }
102 102
 
@@ -111,84 +111,84 @@  discard block
 block discarded – undo
111 111
      * @param string  $file
112 112
      * @param array   $plugin
113 113
      */
114
-    public function show_update_notification( $file, $plugin ) {
114
+    public function show_update_notification($file, $plugin) {
115 115
 
116
-        if( ! current_user_can( 'update_plugins' ) ) {
116
+        if ( ! current_user_can('update_plugins')) {
117 117
             return;
118 118
         }
119 119
 
120
-        if( ! is_multisite() ) {
120
+        if ( ! is_multisite()) {
121 121
             return;
122 122
         }
123 123
 
124
-        if ( $this->name != $file ) {
124
+        if ($this->name != $file) {
125 125
             return;
126 126
         }
127 127
 
128 128
         // Remove our filter on the site transient
129
-        remove_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ), 10 );
129
+        remove_filter('pre_set_site_transient_update_plugins', array($this, 'check_update'), 10);
130 130
 
131
-        $update_cache = get_site_transient( 'update_plugins' );
131
+        $update_cache = get_site_transient('update_plugins');
132 132
 
133
-        if ( ! is_object( $update_cache ) || empty( $update_cache->response ) || empty( $update_cache->response[ $this->name ] ) ) {
133
+        if ( ! is_object($update_cache) || empty($update_cache->response) || empty($update_cache->response[$this->name])) {
134 134
 
135
-            $cache_key    = md5( 'edd_plugin_' .sanitize_key( $this->name ) . '_version_info' );
136
-            $version_info = get_transient( $cache_key );
135
+            $cache_key    = md5('edd_plugin_'.sanitize_key($this->name).'_version_info');
136
+            $version_info = get_transient($cache_key);
137 137
 
138
-            if( false === $version_info ) {
138
+            if (false === $version_info) {
139 139
 
140
-                $version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
140
+                $version_info = $this->api_request('plugin_latest_version', array('slug' => $this->slug));
141 141
 
142
-                set_transient( $cache_key, $version_info, 3600 );
142
+                set_transient($cache_key, $version_info, 3600);
143 143
             }
144 144
 
145 145
 
146
-            if( ! is_object( $version_info ) ) {
146
+            if ( ! is_object($version_info)) {
147 147
                 return;
148 148
             }
149 149
 
150
-            if( version_compare( $this->version, $version_info->new_version, '<' ) ) {
150
+            if (version_compare($this->version, $version_info->new_version, '<')) {
151 151
 
152
-                $update_cache->response[ $this->name ] = $version_info;
152
+                $update_cache->response[$this->name] = $version_info;
153 153
 
154 154
             }
155 155
 
156 156
             $update_cache->last_checked = time();
157
-            $update_cache->checked[ $this->name ] = $this->version;
157
+            $update_cache->checked[$this->name] = $this->version;
158 158
 
159
-            set_site_transient( 'update_plugins', $update_cache );
159
+            set_site_transient('update_plugins', $update_cache);
160 160
 
161 161
         } else {
162 162
 
163
-            $version_info = $update_cache->response[ $this->name ];
163
+            $version_info = $update_cache->response[$this->name];
164 164
 
165 165
         }
166 166
 
167 167
         // Restore our filter
168
-        add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
168
+        add_filter('pre_set_site_transient_update_plugins', array($this, 'check_update'));
169 169
 
170
-        if ( ! empty( $update_cache->response[ $this->name ] ) && version_compare( $this->version, $version_info->new_version, '<' ) ) {
170
+        if ( ! empty($update_cache->response[$this->name]) && version_compare($this->version, $version_info->new_version, '<')) {
171 171
 
172 172
             // build a plugin list row, with update notification
173
-            $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
174
-            echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
173
+            $wp_list_table = _get_list_table('WP_Plugins_List_Table');
174
+            echo '<tr class="plugin-update-tr"><td colspan="'.$wp_list_table->get_column_count().'" class="plugin-update colspanchange"><div class="update-message">';
175 175
 
176
-            $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' );
176
+            $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');
177 177
 
178
-            if ( empty( $version_info->download_link ) ) {
178
+            if (empty($version_info->download_link)) {
179 179
                 printf(
180
-                    __( 'There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a>.', 'edd' ),
181
-                    esc_html( $version_info->name ),
182
-                    esc_url( $changelog_link ),
183
-                    esc_html( $version_info->new_version )
180
+                    __('There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a>.', 'edd'),
181
+                    esc_html($version_info->name),
182
+                    esc_url($changelog_link),
183
+                    esc_html($version_info->new_version)
184 184
                 );
185 185
             } else {
186 186
                 printf(
187
-                    __( '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>.', 'edd' ),
188
-                    esc_html( $version_info->name ),
189
-                    esc_url( $changelog_link ),
190
-                    esc_html( $version_info->new_version ),
191
-                    esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) )
187
+                    __('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>.', 'edd'),
188
+                    esc_html($version_info->name),
189
+                    esc_url($changelog_link),
190
+                    esc_html($version_info->new_version),
191
+                    esc_url(wp_nonce_url(self_admin_url('update.php?action=upgrade-plugin&plugin=').$this->name, 'upgrade-plugin_'.$this->name))
192 192
                 );
193 193
             }
194 194
 
@@ -207,16 +207,16 @@  discard block
 block discarded – undo
207 207
      * @param object  $_args
208 208
      * @return object $_data
209 209
      */
210
-    function plugins_api_filter( $_data, $_action = '', $_args = null ) {
210
+    function plugins_api_filter($_data, $_action = '', $_args = null) {
211 211
 
212 212
 
213
-        if ( $_action != 'plugin_information' ) {
213
+        if ($_action != 'plugin_information') {
214 214
 
215 215
             return $_data;
216 216
 
217 217
         }
218 218
 
219
-        if ( ! isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) {
219
+        if ( ! isset($_args->slug) || ($_args->slug != $this->slug)) {
220 220
 
221 221
             return $_data;
222 222
 
@@ -231,9 +231,9 @@  discard block
 block discarded – undo
231 231
             )
232 232
         );
233 233
 
234
-        $api_response = $this->api_request( 'plugin_information', $to_send );
234
+        $api_response = $this->api_request('plugin_information', $to_send);
235 235
 
236
-        if ( false !== $api_response ) {
236
+        if (false !== $api_response) {
237 237
             $_data = $api_response;
238 238
         }
239 239
 
@@ -248,9 +248,9 @@  discard block
 block discarded – undo
248 248
      * @param string  $url
249 249
      * @return object $array
250 250
      */
251
-    function http_request_args( $args, $url ) {
251
+    function http_request_args($args, $url) {
252 252
         // If it is an https request and we are performing a package download, disable ssl verification
253
-        if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
253
+        if (strpos($url, 'https://') !== false && strpos($url, 'edd_action=package_download')) {
254 254
             $args['sslverify'] = false;
255 255
         }
256 256
         return $args;
@@ -267,40 +267,40 @@  discard block
 block discarded – undo
267 267
      * @param array   $_data   Parameters for the API action.
268 268
      * @return false||object
269 269
      */
270
-    private function api_request( $_action, $_data ) {
270
+    private function api_request($_action, $_data) {
271 271
 
272 272
         global $wp_version;
273 273
 
274
-        $data = array_merge( $this->api_data, $_data );
274
+        $data = array_merge($this->api_data, $_data);
275 275
 
276
-        if ( $data['slug'] != $this->slug )
276
+        if ($data['slug'] != $this->slug)
277 277
             return;
278 278
 
279
-        if ( empty( $data['license'] ) )
279
+        if (empty($data['license']))
280 280
             return;
281 281
 
282
-        if( $this->api_url == home_url() ) {
282
+        if ($this->api_url == home_url()) {
283 283
             return false; // Don't allow a plugin to ping itself
284 284
         }
285 285
 
286 286
         $api_params = array(
287 287
             'edd_action' => 'get_version',
288 288
             'license'    => $data['license'],
289
-            'item_name'  => isset( $data['item_name'] ) ? $data['item_name'] : false,
290
-            'item_id'    => isset( $data['item_id'] ) ? $data['item_id'] : false,
289
+            'item_name'  => isset($data['item_name']) ? $data['item_name'] : false,
290
+            'item_id'    => isset($data['item_id']) ? $data['item_id'] : false,
291 291
             'slug'       => $data['slug'],
292 292
             'author'     => $data['author'],
293 293
             'url'        => home_url()
294 294
         );
295 295
 
296
-        $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
296
+        $request = wp_remote_post($this->api_url, array('timeout' => 15, 'sslverify' => false, 'body' => $api_params));
297 297
 
298
-        if ( ! is_wp_error( $request ) ) {
299
-            $request = json_decode( wp_remote_retrieve_body( $request ) );
298
+        if ( ! is_wp_error($request)) {
299
+            $request = json_decode(wp_remote_retrieve_body($request));
300 300
         }
301 301
 
302
-        if ( $request && isset( $request->sections ) ) {
303
-            $request->sections = maybe_unserialize( $request->sections );
302
+        if ($request && isset($request->sections)) {
303
+            $request->sections = maybe_unserialize($request->sections);
304 304
         } else {
305 305
             $request = false;
306 306
         }
@@ -311,26 +311,26 @@  discard block
 block discarded – undo
311 311
     public function show_changelog() {
312 312
 
313 313
 
314
-        if( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) {
314
+        if (empty($_REQUEST['edd_sl_action']) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action']) {
315 315
             return;
316 316
         }
317 317
 
318
-        if( empty( $_REQUEST['plugin'] ) ) {
318
+        if (empty($_REQUEST['plugin'])) {
319 319
             return;
320 320
         }
321 321
 
322
-        if( empty( $_REQUEST['slug'] ) ) {
322
+        if (empty($_REQUEST['slug'])) {
323 323
             return;
324 324
         }
325 325
 
326
-        if( ! current_user_can( 'update_plugins' ) ) {
327
-            wp_die( __( 'You do not have permission to install plugin updates', 'edd' ), __( 'Error', 'edd' ), array( 'response' => 403 ) );
326
+        if ( ! current_user_can('update_plugins')) {
327
+            wp_die(__('You do not have permission to install plugin updates', 'edd'), __('Error', 'edd'), array('response' => 403));
328 328
         }
329 329
 
330
-        $response = $this->api_request( 'plugin_latest_version', array( 'slug' => $_REQUEST['slug'] ) );
330
+        $response = $this->api_request('plugin_latest_version', array('slug' => $_REQUEST['slug']));
331 331
 
332
-        if( $response && isset( $response->sections['changelog'] ) ) {
333
-            echo '<div style="background:#fff;padding:10px;">' . $response->sections['changelog'] . '</div>';
332
+        if ($response && isset($response->sections['changelog'])) {
333
+            echo '<div style="background:#fff;padding:10px;">'.$response->sections['changelog'].'</div>';
334 334
         }
335 335
 
336 336
 
Please login to merge, or discard this patch.
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,7 +4,9 @@  discard block
 block discarded – undo
4 4
 //set_site_transient( 'update_plugins', null );
5 5
 
6 6
 // Exit if accessed directly
7
-if ( ! defined( 'ABSPATH' ) ) exit;
7
+if ( ! defined( 'ABSPATH' ) ) {
8
+	exit;
9
+}
8 10
 
9 11
 /**
10 12
  * Allows plugins to use their own update API.
@@ -273,11 +275,13 @@  discard block
 block discarded – undo
273 275
 
274 276
         $data = array_merge( $this->api_data, $_data );
275 277
 
276
-        if ( $data['slug'] != $this->slug )
277
-            return;
278
+        if ( $data['slug'] != $this->slug ) {
279
+                    return;
280
+        }
278 281
 
279
-        if ( empty( $data['license'] ) )
280
-            return;
282
+        if ( empty( $data['license'] ) ) {
283
+                    return;
284
+        }
281 285
 
282 286
         if( $this->api_url == home_url() ) {
283 287
             return false; // Don't allow a plugin to ping itself
Please login to merge, or discard this patch.
includes/admin/forms/dashboard-columns.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -321,7 +321,7 @@
 block discarded – undo
321 321
  *
322 322
  * @param int $post_id Download (Post) ID
323 323
  *
324
- * @return void
324
+ * @return null|integer
325 325
  */
326 326
 function give_price_save_quick_edit( $post_id ) {
327 327
 	if ( ! isset( $_POST['post_type'] ) || 'give_forms' !== $_POST['post_type'] ) {
Please login to merge, or discard this patch.
Spacing   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -27,34 +27,34 @@  discard block
 block discarded – undo
27 27
  * @return array $form_columns Updated array of forms columns
28 28
  *  Post Type List Table
29 29
  */
30
-function give_form_columns( $give_form_columns ) {
30
+function give_form_columns($give_form_columns) {
31 31
 
32 32
 	//Standard columns
33 33
 	$give_form_columns = array(
34 34
 		'cb'            => '<input type="checkbox"/>',
35
-		'title'         => __( 'Name', 'give' ),
36
-		'form_category' => __( 'Categories', 'give' ),
37
-		'form_tag'      => __( 'Tags', 'give' ),
38
-		'price'         => __( 'Price', 'give' ),
39
-		'goal'          => __( 'Goal', 'give' ),
40
-		'donations'     => __( 'Donations', 'give' ),
41
-		'earnings'      => __( 'Income', 'give' ),
42
-		'shortcode'     => __( 'Shortcode', 'give' ),
43
-		'date'          => __( 'Date', 'give' )
35
+		'title'         => __('Name', 'give'),
36
+		'form_category' => __('Categories', 'give'),
37
+		'form_tag'      => __('Tags', 'give'),
38
+		'price'         => __('Price', 'give'),
39
+		'goal'          => __('Goal', 'give'),
40
+		'donations'     => __('Donations', 'give'),
41
+		'earnings'      => __('Income', 'give'),
42
+		'shortcode'     => __('Shortcode', 'give'),
43
+		'date'          => __('Date', 'give')
44 44
 	);
45 45
 
46 46
 	//Does the user want categories / tags?
47
-	if ( give_get_option( 'enable_categories' ) !== 'on' ) {
48
-		unset( $give_form_columns['form_category'] );
47
+	if (give_get_option('enable_categories') !== 'on') {
48
+		unset($give_form_columns['form_category']);
49 49
 	}
50
-	if ( give_get_option( 'enable_tags' ) !== 'on' ) {
51
-		unset( $give_form_columns['form_tag'] );
50
+	if (give_get_option('enable_tags') !== 'on') {
51
+		unset($give_form_columns['form_tag']);
52 52
 	}
53 53
 
54
-	return apply_filters( 'give_forms_columns', $give_form_columns );
54
+	return apply_filters('give_forms_columns', $give_form_columns);
55 55
 }
56 56
 
57
-add_filter( 'manage_edit-give_forms_columns', 'give_form_columns' );
57
+add_filter('manage_edit-give_forms_columns', 'give_form_columns');
58 58
 
59 59
 /**
60 60
  * Render Give Form Columns
@@ -66,67 +66,67 @@  discard block
 block discarded – undo
66 66
  *
67 67
  * @return void
68 68
  */
69
-function give_render_form_columns( $column_name, $post_id ) {
70
-	if ( get_post_type( $post_id ) == 'give_forms' ) {
69
+function give_render_form_columns($column_name, $post_id) {
70
+	if (get_post_type($post_id) == 'give_forms') {
71 71
 		global $give_options;
72 72
 
73
-		$style = isset( $give_options['button_style'] ) ? $give_options['button_style'] : 'button';
74
-		$color = isset( $give_options['checkout_color'] ) ? $give_options['checkout_color'] : 'blue';
75
-		$color = ( $color == 'inherit' ) ? '' : $color;
73
+		$style = isset($give_options['button_style']) ? $give_options['button_style'] : 'button';
74
+		$color = isset($give_options['checkout_color']) ? $give_options['checkout_color'] : 'blue';
75
+		$color = ($color == 'inherit') ? '' : $color;
76 76
 
77
-		$purchase_text = ! empty( $give_options['add_to_cart_text'] ) ? $give_options['add_to_cart_text'] : __( 'Purchase', 'give' );
77
+		$purchase_text = ! empty($give_options['add_to_cart_text']) ? $give_options['add_to_cart_text'] : __('Purchase', 'give');
78 78
 
79
-		switch ( $column_name ) {
79
+		switch ($column_name) {
80 80
 			case 'form_category':
81
-				echo get_the_term_list( $post_id, 'give_forms_category', '', ', ', '' );
81
+				echo get_the_term_list($post_id, 'give_forms_category', '', ', ', '');
82 82
 				break;
83 83
 			case 'form_tag':
84
-				echo get_the_term_list( $post_id, 'give_forms_tag', '', ', ', '' );
84
+				echo get_the_term_list($post_id, 'give_forms_tag', '', ', ', '');
85 85
 				break;
86 86
 			case 'price':
87
-				if ( give_has_variable_prices( $post_id ) ) {
88
-					echo give_price_range( $post_id );
87
+				if (give_has_variable_prices($post_id)) {
88
+					echo give_price_range($post_id);
89 89
 				} else {
90
-					echo give_price( $post_id, false );
91
-					echo '<input type="hidden" class="formprice-' . $post_id . '" value="' . give_get_form_price( $post_id ) . '" />';
90
+					echo give_price($post_id, false);
91
+					echo '<input type="hidden" class="formprice-'.$post_id.'" value="'.give_get_form_price($post_id).'" />';
92 92
 				}
93 93
 				break;
94 94
 			case 'goal':
95
-				$goal_option = get_post_meta( $post_id, '_give_goal_option', true );
96
-				if ( ! empty( $goal_option ) && $goal_option === 'yes' ) {
97
-					echo give_goal( $post_id, false );
95
+				$goal_option = get_post_meta($post_id, '_give_goal_option', true);
96
+				if ( ! empty($goal_option) && $goal_option === 'yes') {
97
+					echo give_goal($post_id, false);
98 98
 				} else {
99
-					echo __( 'No Goal Set', 'give' );
99
+					echo __('No Goal Set', 'give');
100 100
 				}
101 101
 
102
-				echo '<input type="hidden" class="formgoal-' . $post_id . '" value="' . give_get_form_goal( $post_id ) . '" />';
102
+				echo '<input type="hidden" class="formgoal-'.$post_id.'" value="'.give_get_form_goal($post_id).'" />';
103 103
 				break;
104 104
 			case 'donations':
105
-				if ( current_user_can( 'view_give_forms_stats', $post_id ) ) {
106
-					echo '<a href="' . esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-reports&tab=logs&view=sales&form=' . $post_id ) ) . '">';
107
-					echo give_get_form_sales_stats( $post_id );
105
+				if (current_user_can('view_give_forms_stats', $post_id)) {
106
+					echo '<a href="'.esc_url(admin_url('edit.php?post_type=give_forms&page=give-reports&tab=logs&view=sales&form='.$post_id)).'">';
107
+					echo give_get_form_sales_stats($post_id);
108 108
 					echo '</a>';
109 109
 				} else {
110 110
 					echo '-';
111 111
 				}
112 112
 				break;
113 113
 			case 'earnings':
114
-				if ( current_user_can( 'view_give_forms_stats', $post_id ) ) {
115
-					echo '<a href="' . esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-reports&view=forms&form-id=' . $post_id ) ) . '">';
116
-					echo give_currency_filter( give_format_amount( give_get_form_earnings_stats( $post_id ) ) );
114
+				if (current_user_can('view_give_forms_stats', $post_id)) {
115
+					echo '<a href="'.esc_url(admin_url('edit.php?post_type=give_forms&page=give-reports&view=forms&form-id='.$post_id)).'">';
116
+					echo give_currency_filter(give_format_amount(give_get_form_earnings_stats($post_id)));
117 117
 					echo '</a>';
118 118
 				} else {
119 119
 					echo '-';
120 120
 				}
121 121
 				break;
122 122
 			case 'shortcode':
123
-				echo '<input onclick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly="" value="[give_form id=&#34;' . absint( $post_id ) . '&#34;]">';
123
+				echo '<input onclick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly="" value="[give_form id=&#34;'.absint($post_id).'&#34;]">';
124 124
 				break;
125 125
 		}
126 126
 	}
127 127
 }
128 128
 
129
-add_action( 'manage_posts_custom_column', 'give_render_form_columns', 10, 2 );
129
+add_action('manage_posts_custom_column', 'give_render_form_columns', 10, 2);
130 130
 
131 131
 /**
132 132
  * Registers the sortable columns in the list table
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
  *
138 138
  * @return array $columns Array of sortable columns
139 139
  */
140
-function give_sortable_form_columns( $columns ) {
140
+function give_sortable_form_columns($columns) {
141 141
 	$columns['price']    = 'price';
142 142
 	$columns['sales']    = 'sales';
143 143
 	$columns['earnings'] = 'earnings';
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	return $columns;
147 147
 }
148 148
 
149
-add_filter( 'manage_edit-give_forms_sortable_columns', 'give_sortable_form_columns' );
149
+add_filter('manage_edit-give_forms_sortable_columns', 'give_sortable_form_columns');
150 150
 
151 151
 /**
152 152
  * Sorts Columns in the Forms List Table
@@ -157,11 +157,11 @@  discard block
 block discarded – undo
157 157
  *
158 158
  * @return array $vars Array of all the sort variables
159 159
  */
160
-function give_sort_forms( $vars ) {
160
+function give_sort_forms($vars) {
161 161
 	// Check if we're viewing the "give_forms" post type
162
-	if ( isset( $vars['post_type'] ) && 'give_forms' == $vars['post_type'] ) {
162
+	if (isset($vars['post_type']) && 'give_forms' == $vars['post_type']) {
163 163
 		// Check if 'orderby' is set to "sales"
164
-		if ( isset( $vars['orderby'] ) && 'sales' == $vars['orderby'] ) {
164
+		if (isset($vars['orderby']) && 'sales' == $vars['orderby']) {
165 165
 			$vars = array_merge(
166 166
 				$vars,
167 167
 				array(
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 		}
173 173
 
174 174
 		// Check if "orderby" is set to "earnings"
175
-		if ( isset( $vars['orderby'] ) && 'earnings' == $vars['orderby'] ) {
175
+		if (isset($vars['orderby']) && 'earnings' == $vars['orderby']) {
176 176
 			$vars = array_merge(
177 177
 				$vars,
178 178
 				array(
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 		}
184 184
 
185 185
 		// Check if "orderby" is set to "price"
186
-		if ( isset( $vars['orderby'] ) && 'price' == $vars['orderby'] ) {
186
+		if (isset($vars['orderby']) && 'price' == $vars['orderby']) {
187 187
 			$vars = array_merge(
188 188
 				$vars,
189 189
 				array(
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 		}
195 195
 
196 196
 		// Check if "orderby" is set to "goal"
197
-		if ( isset( $vars['orderby'] ) && 'goal' == $vars['orderby'] ) {
197
+		if (isset($vars['orderby']) && 'goal' == $vars['orderby']) {
198 198
 			$vars = array_merge(
199 199
 				$vars,
200 200
 				array(
@@ -217,16 +217,16 @@  discard block
 block discarded – undo
217 217
  *
218 218
  * @return array       Array of all sort variables
219 219
  */
220
-function give_filter_forms( $vars ) {
221
-	if ( isset( $vars['post_type'] ) && 'give_forms' == $vars['post_type'] ) {
220
+function give_filter_forms($vars) {
221
+	if (isset($vars['post_type']) && 'give_forms' == $vars['post_type']) {
222 222
 
223 223
 		// If an author ID was passed, use it
224
-		if ( isset( $_REQUEST['author'] ) && ! current_user_can( 'view_give_reports' ) ) {
224
+		if (isset($_REQUEST['author']) && ! current_user_can('view_give_reports')) {
225 225
 
226 226
 			$author_id = $_REQUEST['author'];
227
-			if ( (int) $author_id !== get_current_user_id() ) {
227
+			if ((int) $author_id !== get_current_user_id()) {
228 228
 				// Tried to view the products of another person, sorry
229
-				wp_die( __( 'You do not have permission to view this data.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
229
+				wp_die(__('You do not have permission to view this data.', 'give'), __('Error', 'give'), array('response' => 403));
230 230
 			}
231 231
 			$vars = array_merge(
232 232
 				$vars,
@@ -251,11 +251,11 @@  discard block
 block discarded – undo
251 251
  * @return void
252 252
  */
253 253
 function give_forms_load() {
254
-	add_filter( 'request', 'give_sort_forms' );
255
-	add_filter( 'request', 'give_filter_forms' );
254
+	add_filter('request', 'give_sort_forms');
255
+	add_filter('request', 'give_filter_forms');
256 256
 }
257 257
 
258
-add_action( 'load-edit.php', 'give_forms_load', 9999 );
258
+add_action('load-edit.php', 'give_forms_load', 9999);
259 259
 
260 260
 /**
261 261
  * Remove Forms Month Filter
@@ -269,17 +269,17 @@  discard block
 block discarded – undo
269 269
  * @global      $typenow The post type we are viewing
270 270
  * @return array Empty array disables the dropdown
271 271
  */
272
-function give_remove_month_filter( $dates ) {
272
+function give_remove_month_filter($dates) {
273 273
 	global $typenow;
274 274
 
275
-	if ( $typenow == 'give_forms' ) {
275
+	if ($typenow == 'give_forms') {
276 276
 		$dates = array();
277 277
 	}
278 278
 
279 279
 	return $dates;
280 280
 }
281 281
 
282
-add_filter( 'months_dropdown_results', 'give_remove_month_filter', 99 );
282
+add_filter('months_dropdown_results', 'give_remove_month_filter', 99);
283 283
 
284 284
 /**
285 285
  * Adds price field to Quick Edit options
@@ -291,16 +291,16 @@  discard block
 block discarded – undo
291 291
  *
292 292
  * @return void
293 293
  */
294
-function give_price_field_quick_edit( $column_name, $post_type ) {
295
-	if ( $column_name != 'price' || $post_type != 'give_forms' ) {
294
+function give_price_field_quick_edit($column_name, $post_type) {
295
+	if ($column_name != 'price' || $post_type != 'give_forms') {
296 296
 		return;
297 297
 	}
298 298
 	?>
299 299
 	<fieldset class="inline-edit-col-left">
300 300
 		<div id="give-give-data" class="inline-edit-col">
301
-			<h4><?php echo sprintf( __( '%s Configuration', 'give' ), give_get_forms_label_singular() ); ?></h4>
301
+			<h4><?php echo sprintf(__('%s Configuration', 'give'), give_get_forms_label_singular()); ?></h4>
302 302
 			<label>
303
-				<span class="title"><?php _e( 'Price', 'give' ); ?></span>
303
+				<span class="title"><?php _e('Price', 'give'); ?></span>
304 304
 				<span class="input-text-wrap">
305 305
 					<input type="text" name="_give_regprice" class="text regprice" />
306 306
 				</span>
@@ -311,8 +311,8 @@  discard block
 block discarded – undo
311 311
 	<?php
312 312
 }
313 313
 
314
-add_action( 'quick_edit_custom_box', 'give_price_field_quick_edit', 10, 2 );
315
-add_action( 'bulk_edit_custom_box', 'give_price_field_quick_edit', 10, 2 );
314
+add_action('quick_edit_custom_box', 'give_price_field_quick_edit', 10, 2);
315
+add_action('bulk_edit_custom_box', 'give_price_field_quick_edit', 10, 2);
316 316
 
317 317
 /**
318 318
  * Updates price when saving post
@@ -323,23 +323,23 @@  discard block
 block discarded – undo
323 323
  *
324 324
  * @return void
325 325
  */
326
-function give_price_save_quick_edit( $post_id ) {
327
-	if ( ! isset( $_POST['post_type'] ) || 'give_forms' !== $_POST['post_type'] ) {
326
+function give_price_save_quick_edit($post_id) {
327
+	if ( ! isset($_POST['post_type']) || 'give_forms' !== $_POST['post_type']) {
328 328
 		return;
329 329
 	}
330
-	if ( ! current_user_can( 'edit_post', $post_id ) ) {
330
+	if ( ! current_user_can('edit_post', $post_id)) {
331 331
 		return $post_id;
332 332
 	}
333
-	if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
333
+	if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
334 334
 		return $post_id;
335 335
 	}
336 336
 
337
-	if ( isset( $_REQUEST['_give_regprice'] ) ) {
338
-		update_post_meta( $post_id, '_give_set_price', strip_tags( stripslashes( $_REQUEST['_give_regprice'] ) ) );
337
+	if (isset($_REQUEST['_give_regprice'])) {
338
+		update_post_meta($post_id, '_give_set_price', strip_tags(stripslashes($_REQUEST['_give_regprice'])));
339 339
 	}
340 340
 }
341 341
 
342
-add_action( 'save_post', 'give_price_save_quick_edit' );
342
+add_action('save_post', 'give_price_save_quick_edit');
343 343
 
344 344
 /**
345 345
  * Process bulk edit actions via AJAX
@@ -349,18 +349,18 @@  discard block
 block discarded – undo
349 349
  */
350 350
 function give_save_bulk_edit() {
351 351
 
352
-	$post_ids = ( isset( $_POST['post_ids'] ) && ! empty( $_POST['post_ids'] ) ) ? $_POST['post_ids'] : array();
352
+	$post_ids = (isset($_POST['post_ids']) && ! empty($_POST['post_ids'])) ? $_POST['post_ids'] : array();
353 353
 
354
-	if ( ! empty( $post_ids ) && is_array( $post_ids ) ) {
355
-		$price = isset( $_POST['price'] ) ? strip_tags( stripslashes( $_POST['price'] ) ) : 0;
356
-		foreach ( $post_ids as $post_id ) {
354
+	if ( ! empty($post_ids) && is_array($post_ids)) {
355
+		$price = isset($_POST['price']) ? strip_tags(stripslashes($_POST['price'])) : 0;
356
+		foreach ($post_ids as $post_id) {
357 357
 
358
-			if ( ! current_user_can( 'edit_post', $post_id ) ) {
358
+			if ( ! current_user_can('edit_post', $post_id)) {
359 359
 				continue;
360 360
 			}
361 361
 
362
-			if ( ! empty( $price ) ) {
363
-				update_post_meta( $post_id, '_give_set_price', give_sanitize_amount( $price ) );
362
+			if ( ! empty($price)) {
363
+				update_post_meta($post_id, '_give_set_price', give_sanitize_amount($price));
364 364
 			}
365 365
 		}
366 366
 	}
@@ -368,4 +368,4 @@  discard block
 block discarded – undo
368 368
 	die();
369 369
 }
370 370
 
371
-add_action( 'wp_ajax_give_save_bulk_edit', 'give_save_bulk_edit' );
371
+add_action('wp_ajax_give_save_bulk_edit', 'give_save_bulk_edit');
Please login to merge, or discard this patch.
includes/admin/payments/actions.php 3 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -297,7 +297,6 @@
 block discarded – undo
297 297
  *
298 298
  * @since 1.0
299 299
  *
300
- * @param array $data Arguments passed
301 300
  *
302 301
  * @return void
303 302
  */
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Admin Payment Actions
4
- *
5
- * @package     Give
6
- * @subpackage  Admin/Payments
7
- * @copyright   Copyright (c) 2015, WordImpress
8
- * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
- * @since       1.0
10
- */
3
+										 * Admin Payment Actions
4
+										 *
5
+										 * @package     Give
6
+										 * @subpackage  Admin/Payments
7
+										 * @copyright   Copyright (c) 2015, WordImpress
8
+										 * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+										 * @since       1.0
10
+										 */
11 11
 
12 12
 // Exit if accessed directly
13 13
 if ( ! defined( 'ABSPATH' ) ) {
Please login to merge, or discard this patch.
Spacing   +110 added lines, -110 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
 
@@ -26,109 +26,109 @@  discard block
 block discarded – undo
26 26
  * @return      void
27 27
  *
28 28
  */
29
-function give_update_payment_details( $data ) {
29
+function give_update_payment_details($data) {
30 30
 
31
-	if ( ! current_user_can( 'edit_give_payments', $data['give_payment_id'] ) ) {
32
-		wp_die( __( 'You do not have permission to edit this payment record', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
31
+	if ( ! current_user_can('edit_give_payments', $data['give_payment_id'])) {
32
+		wp_die(__('You do not have permission to edit this payment record', 'give'), __('Error', 'give'), array('response' => 403));
33 33
 	}
34 34
 
35
-	check_admin_referer( 'give_update_payment_details_nonce' );
35
+	check_admin_referer('give_update_payment_details_nonce');
36 36
 
37 37
 	// Retrieve the payment ID
38
-	$payment_id = absint( $data['give_payment_id'] );
38
+	$payment_id = absint($data['give_payment_id']);
39 39
 
40 40
 	// Retrieve existing payment meta
41
-	$meta      = give_get_payment_meta( $payment_id );
42
-	$user_info = give_get_payment_meta_user_info( $payment_id );
41
+	$meta      = give_get_payment_meta($payment_id);
42
+	$user_info = give_get_payment_meta_user_info($payment_id);
43 43
 
44 44
 	$status  = $data['give-payment-status'];
45
-	$user_id = isset( $data['give-payment-user-id'] ) ? intval( $data['give-payment-user-id'] ) : '';
46
-	$date    = sanitize_text_field( $data['give-payment-date'] );
47
-	$hour    = sanitize_text_field( $data['give-payment-time-hour'] );
45
+	$user_id = isset($data['give-payment-user-id']) ? intval($data['give-payment-user-id']) : '';
46
+	$date    = sanitize_text_field($data['give-payment-date']);
47
+	$hour    = sanitize_text_field($data['give-payment-time-hour']);
48 48
 	$form_id = give_get_payment_form_id($payment_id);
49 49
 
50 50
 	// Restrict to our high and low
51
-	if ( $hour > 23 ) {
51
+	if ($hour > 23) {
52 52
 		$hour = 23;
53
-	} elseif ( $hour < 0 ) {
53
+	} elseif ($hour < 0) {
54 54
 		$hour = 00;
55 55
 	}
56 56
 
57
-	$minute = sanitize_text_field( $data['give-payment-time-min'] );
57
+	$minute = sanitize_text_field($data['give-payment-time-min']);
58 58
 
59 59
 	// Restrict to our high and low
60
-	if ( $minute > 59 ) {
60
+	if ($minute > 59) {
61 61
 		$minute = 59;
62
-	} elseif ( $minute < 0 ) {
62
+	} elseif ($minute < 0) {
63 63
 		$minute = 00;
64 64
 	}
65 65
 
66
-	$address          = array_map( 'trim', $data['give-payment-address'][0] );
67
-	$date             = date( 'Y-m-d', strtotime( $date ) ) . ' ' . $hour . ':' . $minute . ':00';
68
-	$curr_total       = give_sanitize_amount( give_get_payment_amount( $payment_id ) );
69
-	$new_total        = give_sanitize_amount( $_POST['give-payment-total'] );
70
-	$curr_customer_id = sanitize_text_field( $data['give-current-customer'] );
71
-	$new_customer_id  = sanitize_text_field( $data['customer-id'] );
66
+	$address          = array_map('trim', $data['give-payment-address'][0]);
67
+	$date             = date('Y-m-d', strtotime($date)).' '.$hour.':'.$minute.':00';
68
+	$curr_total       = give_sanitize_amount(give_get_payment_amount($payment_id));
69
+	$new_total        = give_sanitize_amount($_POST['give-payment-total']);
70
+	$curr_customer_id = sanitize_text_field($data['give-current-customer']);
71
+	$new_customer_id  = sanitize_text_field($data['customer-id']);
72 72
 
73
-	do_action( 'give_update_edited_purchase', $payment_id );
73
+	do_action('give_update_edited_purchase', $payment_id);
74 74
 
75 75
 	// Update main payment record
76
-	$updated = wp_update_post( array(
76
+	$updated = wp_update_post(array(
77 77
 		'ID'        => $payment_id,
78 78
 		'edit_date' => true,
79 79
 		'post_date' => $date
80
-	) );
80
+	));
81 81
 
82
-	if ( 0 === $updated ) {
83
-		wp_die( esc_attr__( 'Error Updating Payment', 'give' ), esc_attr__( 'Error', 'give' ), array( 'response' => 400 ) );
82
+	if (0 === $updated) {
83
+		wp_die(esc_attr__('Error Updating Payment', 'give'), esc_attr__('Error', 'give'), array('response' => 400));
84 84
 	}
85 85
 
86 86
 	$customer_changed = false;
87 87
 
88
-	if ( isset( $data['give-new-customer'] ) && $data['give-new-customer'] == '1' ) {
88
+	if (isset($data['give-new-customer']) && $data['give-new-customer'] == '1') {
89 89
 
90
-		$email = isset( $data['give-new-customer-email'] ) ? sanitize_text_field( $data['give-new-customer-email'] ) : '';
91
-		$names = isset( $data['give-new-customer-name'] ) ? sanitize_text_field( $data['give-new-customer-name'] ) : '';
90
+		$email = isset($data['give-new-customer-email']) ? sanitize_text_field($data['give-new-customer-email']) : '';
91
+		$names = isset($data['give-new-customer-name']) ? sanitize_text_field($data['give-new-customer-name']) : '';
92 92
 
93
-		if ( empty( $email ) || empty( $names ) ) {
94
-			wp_die( esc_attr__( 'New Customers require a name and email address', 'give' ) );
93
+		if (empty($email) || empty($names)) {
94
+			wp_die(esc_attr__('New Customers require a name and email address', 'give'));
95 95
 		}
96 96
 
97
-		$customer = new Give_Customer( $email );
98
-		if ( empty( $customer->id ) ) {
99
-			$customer_data = array( 'name' => $names, 'email' => $email );
100
-			$user_id       = email_exists( $email );
101
-			if ( false !== $user_id ) {
97
+		$customer = new Give_Customer($email);
98
+		if (empty($customer->id)) {
99
+			$customer_data = array('name' => $names, 'email' => $email);
100
+			$user_id       = email_exists($email);
101
+			if (false !== $user_id) {
102 102
 				$customer_data['user_id'] = $user_id;
103 103
 			}
104 104
 
105
-			if ( ! $customer->create( $customer_data ) ) {
105
+			if ( ! $customer->create($customer_data)) {
106 106
 				// Failed to crete the new customer, assume the previous customer
107 107
 				$customer_changed = false;
108
-				$customer         = new Give_Customer( $curr_customer_id );
109
-				give_set_error( 'give-payment-new-customer-fail', __( 'Error creating new customer', 'give' ) );
108
+				$customer         = new Give_Customer($curr_customer_id);
109
+				give_set_error('give-payment-new-customer-fail', __('Error creating new customer', 'give'));
110 110
 			}
111 111
 		}
112 112
 
113 113
 		$new_customer_id = $customer->id;
114 114
 
115
-		$previous_customer = new Give_Customer( $curr_customer_id );
115
+		$previous_customer = new Give_Customer($curr_customer_id);
116 116
 
117 117
 		$customer_changed = true;
118 118
 
119
-	} elseif ( $curr_customer_id !== $new_customer_id ) {
119
+	} elseif ($curr_customer_id !== $new_customer_id) {
120 120
 
121
-		$customer = new Give_Customer( $new_customer_id );
121
+		$customer = new Give_Customer($new_customer_id);
122 122
 		$email    = $customer->email;
123 123
 		$names    = $customer->name;
124 124
 
125
-		$previous_customer = new Give_Customer( $curr_customer_id );
125
+		$previous_customer = new Give_Customer($curr_customer_id);
126 126
 
127 127
 		$customer_changed = true;
128 128
 
129 129
 	} else {
130 130
 
131
-		$customer = new Give_Customer( $curr_customer_id );
131
+		$customer = new Give_Customer($curr_customer_id);
132 132
 		$email    = $customer->email;
133 133
 		$names    = $customer->name;
134 134
 
@@ -136,32 +136,32 @@  discard block
 block discarded – undo
136 136
 
137 137
 
138 138
 	// Setup first and last name from input values
139
-	$names      = explode( ' ', $names );
140
-	$first_name = ! empty( $names[0] ) ? $names[0] : '';
139
+	$names      = explode(' ', $names);
140
+	$first_name = ! empty($names[0]) ? $names[0] : '';
141 141
 	$last_name  = '';
142
-	if ( ! empty( $names[1] ) ) {
143
-		unset( $names[0] );
144
-		$last_name = implode( ' ', $names );
142
+	if ( ! empty($names[1])) {
143
+		unset($names[0]);
144
+		$last_name = implode(' ', $names);
145 145
 	}
146 146
 
147 147
 
148
-	if ( $customer_changed ) {
148
+	if ($customer_changed) {
149 149
 
150 150
 		// Remove the stats and payment from the previous customer and attach it to the new customer
151
-		$previous_customer->remove_payment( $payment_id, false );
152
-		$customer->attach_payment( $payment_id, false );
151
+		$previous_customer->remove_payment($payment_id, false);
152
+		$customer->attach_payment($payment_id, false);
153 153
 
154 154
 		// If purchase was completed and not ever refunded, adjust stats of customers
155
-		if ( 'revoked' == $status || 'publish' == $status ) {
155
+		if ('revoked' == $status || 'publish' == $status) {
156 156
 
157 157
 			$previous_customer->decrease_purchase_count();
158
-			$previous_customer->decrease_value( $new_total );
158
+			$previous_customer->decrease_value($new_total);
159 159
 
160 160
 			$customer->increase_purchase_count();
161
-			$customer->increase_value( $new_total );
161
+			$customer->increase_value($new_total);
162 162
 		}
163 163
 
164
-		update_post_meta( $payment_id, '_give_payment_customer_id', $customer->id );
164
+		update_post_meta($payment_id, '_give_payment_customer_id', $customer->id);
165 165
 
166 166
 	}
167 167
 
@@ -176,47 +176,47 @@  discard block
 block discarded – undo
176 176
 
177 177
 
178 178
 	// Check for payment notes
179
-	if ( ! empty( $data['give-payment-note'] ) ) {
179
+	if ( ! empty($data['give-payment-note'])) {
180 180
 
181
-		$note = wp_kses( $data['give-payment-note'], array() );
182
-		give_insert_payment_note( $payment_id, $note );
181
+		$note = wp_kses($data['give-payment-note'], array());
182
+		give_insert_payment_note($payment_id, $note);
183 183
 
184 184
 	}
185 185
 
186 186
 	// Set new status
187
-	give_update_payment_status( $payment_id, $status );
187
+	give_update_payment_status($payment_id, $status);
188 188
 
189
-	give_update_payment_meta( $payment_id, '_give_payment_user_id', $customer->user_id );
190
-	give_update_payment_meta( $payment_id, '_give_payment_user_email', $customer->email );
191
-	give_update_payment_meta( $payment_id, '_give_payment_meta', $meta );
192
-	give_update_payment_meta( $payment_id, '_give_payment_total', $new_total );
189
+	give_update_payment_meta($payment_id, '_give_payment_user_id', $customer->user_id);
190
+	give_update_payment_meta($payment_id, '_give_payment_user_email', $customer->email);
191
+	give_update_payment_meta($payment_id, '_give_payment_meta', $meta);
192
+	give_update_payment_meta($payment_id, '_give_payment_total', $new_total);
193 193
 
194 194
 	// Adjust total store earnings if the payment total has been changed
195
-	if ( $new_total !== $curr_total && ( 'publish' == $status || 'revoked' == $status ) ) {
195
+	if ($new_total !== $curr_total && ('publish' == $status || 'revoked' == $status)) {
196 196
 
197
-		if ( $new_total > $curr_total ) {
197
+		if ($new_total > $curr_total) {
198 198
 			// Increase if our new total is higher
199 199
 			$difference = $new_total - $curr_total;
200
-			give_increase_total_earnings( $difference );
201
-			$form = new Give_Donate_Form( $form_id );
202
-			$form->increase_earnings( $difference );
203
-		} elseif ( $curr_total > $new_total ) {
200
+			give_increase_total_earnings($difference);
201
+			$form = new Give_Donate_Form($form_id);
202
+			$form->increase_earnings($difference);
203
+		} elseif ($curr_total > $new_total) {
204 204
 			// Decrease if our new total is lower
205 205
 			$difference = $curr_total - $new_total;
206
-			give_decrease_total_earnings( $difference );
207
-			$form = new Give_Donate_Form( $form_id );
208
-			$form->decrease_earnings( $difference );
206
+			give_decrease_total_earnings($difference);
207
+			$form = new Give_Donate_Form($form_id);
208
+			$form->decrease_earnings($difference);
209 209
 		}
210 210
 
211 211
 	}
212 212
 
213
-	do_action( 'give_updated_edited_purchase', $payment_id );
213
+	do_action('give_updated_edited_purchase', $payment_id);
214 214
 
215
-	wp_safe_redirect( admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&give-message=payment-updated&id=' . $payment_id ) );
215
+	wp_safe_redirect(admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&give-message=payment-updated&id='.$payment_id));
216 216
 	exit;
217 217
 }
218 218
 
219
-add_action( 'give_update_payment_details', 'give_update_payment_details' );
219
+add_action('give_update_payment_details', 'give_update_payment_details');
220 220
 
221 221
 /**
222 222
  * Trigger a Purchase Deletion
@@ -227,45 +227,45 @@  discard block
 block discarded – undo
227 227
  *
228 228
  * @return void
229 229
  */
230
-function give_trigger_purchase_delete( $data ) {
231
-	if ( wp_verify_nonce( $data['_wpnonce'], 'give_payment_nonce' ) ) {
230
+function give_trigger_purchase_delete($data) {
231
+	if (wp_verify_nonce($data['_wpnonce'], 'give_payment_nonce')) {
232 232
 
233
-		$payment_id = absint( $data['purchase_id'] );
233
+		$payment_id = absint($data['purchase_id']);
234 234
 
235
-		if ( ! current_user_can( 'edit_give_payments', $payment_id ) ) {
236
-			wp_die( __( 'You do not have permission to edit this payment record', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
235
+		if ( ! current_user_can('edit_give_payments', $payment_id)) {
236
+			wp_die(__('You do not have permission to edit this payment record', 'give'), __('Error', 'give'), array('response' => 403));
237 237
 		}
238 238
 
239
-		give_delete_purchase( $payment_id );
240
-		wp_redirect( admin_url( '/edit.php?post_type=give_forms&page=give-payment-history&give-message=payment_deleted' ) );
239
+		give_delete_purchase($payment_id);
240
+		wp_redirect(admin_url('/edit.php?post_type=give_forms&page=give-payment-history&give-message=payment_deleted'));
241 241
 		give_die();
242 242
 	}
243 243
 }
244 244
 
245
-add_action( 'give_delete_payment', 'give_trigger_purchase_delete' );
245
+add_action('give_delete_payment', 'give_trigger_purchase_delete');
246 246
 
247 247
 function give_ajax_store_payment_note() {
248 248
 
249
-	$payment_id = absint( $_POST['payment_id'] );
250
-	$note       = wp_kses( $_POST['note'], array() );
249
+	$payment_id = absint($_POST['payment_id']);
250
+	$note       = wp_kses($_POST['note'], array());
251 251
 
252
-	if ( ! current_user_can( 'edit_give_payments', $payment_id ) ) {
253
-		wp_die( __( 'You do not have permission to edit this payment record', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
252
+	if ( ! current_user_can('edit_give_payments', $payment_id)) {
253
+		wp_die(__('You do not have permission to edit this payment record', 'give'), __('Error', 'give'), array('response' => 403));
254 254
 	}
255 255
 
256
-	if ( empty( $payment_id ) ) {
257
-		die( '-1' );
256
+	if (empty($payment_id)) {
257
+		die('-1');
258 258
 	}
259 259
 
260
-	if ( empty( $note ) ) {
261
-		die( '-1' );
260
+	if (empty($note)) {
261
+		die('-1');
262 262
 	}
263 263
 
264
-	$note_id = give_insert_payment_note( $payment_id, $note );
265
-	die( give_get_payment_note_html( $note_id ) );
264
+	$note_id = give_insert_payment_note($payment_id, $note);
265
+	die(give_get_payment_note_html($note_id));
266 266
 }
267 267
 
268
-add_action( 'wp_ajax_give_insert_payment_note', 'give_ajax_store_payment_note' );
268
+add_action('wp_ajax_give_insert_payment_note', 'give_ajax_store_payment_note');
269 269
 
270 270
 /**
271 271
  * Triggers a payment note deletion without ajax
@@ -276,24 +276,24 @@  discard block
 block discarded – undo
276 276
  *
277 277
  * @return void
278 278
  */
279
-function give_trigger_payment_note_deletion( $data ) {
279
+function give_trigger_payment_note_deletion($data) {
280 280
 
281
-	if ( ! wp_verify_nonce( $data['_wpnonce'], 'give_delete_payment_note_' . $data['note_id'] ) ) {
281
+	if ( ! wp_verify_nonce($data['_wpnonce'], 'give_delete_payment_note_'.$data['note_id'])) {
282 282
 		return;
283 283
 	}
284 284
 
285
-	if ( ! current_user_can( 'edit_give_payments', $data['payment_id'] ) ) {
286
-		wp_die( __( 'You do not have permission to edit this payment record', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
285
+	if ( ! current_user_can('edit_give_payments', $data['payment_id'])) {
286
+		wp_die(__('You do not have permission to edit this payment record', 'give'), __('Error', 'give'), array('response' => 403));
287 287
 	}
288 288
 
289
-	$edit_order_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&give-message=payment-note-deleted&id=' . absint( $data['payment_id'] ) );
289
+	$edit_order_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&give-message=payment-note-deleted&id='.absint($data['payment_id']));
290 290
 
291
-	give_delete_payment_note( $data['note_id'], $data['payment_id'] );
291
+	give_delete_payment_note($data['note_id'], $data['payment_id']);
292 292
 
293
-	wp_redirect( $edit_order_url );
293
+	wp_redirect($edit_order_url);
294 294
 }
295 295
 
296
-add_action( 'give_delete_payment_note', 'give_trigger_payment_note_deletion' );
296
+add_action('give_delete_payment_note', 'give_trigger_payment_note_deletion');
297 297
 
298 298
 /**
299 299
  * Delete a payment note deletion with ajax
@@ -306,16 +306,16 @@  discard block
 block discarded – undo
306 306
  */
307 307
 function give_ajax_delete_payment_note() {
308 308
 
309
-	if ( ! current_user_can( 'edit_give_payments', $_POST['payment_id'] ) ) {
310
-		wp_die( __( 'You do not have permission to edit this payment record', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
309
+	if ( ! current_user_can('edit_give_payments', $_POST['payment_id'])) {
310
+		wp_die(__('You do not have permission to edit this payment record', 'give'), __('Error', 'give'), array('response' => 403));
311 311
 	}
312 312
 
313
-	if ( give_delete_payment_note( $_POST['note_id'], $_POST['payment_id'] ) ) {
314
-		die( '1' );
313
+	if (give_delete_payment_note($_POST['note_id'], $_POST['payment_id'])) {
314
+		die('1');
315 315
 	} else {
316
-		die( '-1' );
316
+		die('-1');
317 317
 	}
318 318
 
319 319
 }
320 320
 
321
-add_action( 'wp_ajax_give_delete_payment_note', 'give_ajax_delete_payment_note' );
322 321
\ No newline at end of file
322
+add_action('wp_ajax_give_delete_payment_note', 'give_ajax_delete_payment_note');
323 323
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/payments/class-payments-table.php 3 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -279,7 +279,6 @@
 block discarded – undo
279 279
 	 * @access public
280 280
 	 * @since  1.0
281 281
 	 *
282
-	 * @param array  $item        Contains all the data of the discount code
283 282
 	 * @param string $column_name The name of the column
284 283
 	 *
285 284
 	 * @return string Column Name
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Payment History Table Class
4
- *
5
- * @package     Give
6
- * @subpackage  Admin/Payments
7
- * @copyright   Copyright (c) 2015, Give
8
- * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
- * @since       1.0
10
- */
3
+	 * Payment History Table Class
4
+	 *
5
+	 * @package     Give
6
+	 * @subpackage  Admin/Payments
7
+	 * @copyright   Copyright (c) 2015, Give
8
+	 * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+	 * @since       1.0
10
+	 */
11 11
 
12 12
 // Exit if accessed directly
13 13
 if ( ! defined( 'ABSPATH' ) ) {
Please login to merge, or discard this patch.
Spacing   +165 added lines, -165 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
 /**
@@ -120,37 +120,37 @@  discard block
 block discarded – undo
120 120
 		global $status, $page;
121 121
 
122 122
 		// Set parent defaults
123
-		parent::__construct( array(
124
-			'singular' => give_get_forms_label_singular(),    // Singular name of the listed records
125
-			'plural'   => give_get_forms_label_plural(),        // Plural name of the listed records
123
+		parent::__construct(array(
124
+			'singular' => give_get_forms_label_singular(), // Singular name of the listed records
125
+			'plural'   => give_get_forms_label_plural(), // Plural name of the listed records
126 126
 			'ajax'     => false                        // Does this table support ajax?
127
-		) );
127
+		));
128 128
 
129 129
 		$this->get_payment_counts();
130 130
 		$this->process_bulk_action();
131
-		$this->base_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' );
131
+		$this->base_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history');
132 132
 	}
133 133
 
134 134
 	public function advanced_filters() {
135
-		$start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null;
136
-		$end_date   = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : null;
137
-		$status     = isset( $_GET['status'] ) ? $_GET['status'] : '';
135
+		$start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null;
136
+		$end_date   = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : null;
137
+		$status     = isset($_GET['status']) ? $_GET['status'] : '';
138 138
 		?>
139 139
 		<div id="give-payment-filters">
140 140
 			<span id="give-payment-date-filters">
141
-				<label for="start-date" class="give-start-date-label"><?php _e( 'Start Date:', 'give' ); ?></label>
141
+				<label for="start-date" class="give-start-date-label"><?php _e('Start Date:', 'give'); ?></label>
142 142
 				<input type="text" id="start-date" name="start-date" class="give_datepicker" value="<?php echo $start_date; ?>" placeholder="mm/dd/yyyy" />
143
-				<label for="end-date" class="give-end-date-label"><?php _e( 'End Date:', 'give' ); ?></label>
143
+				<label for="end-date" class="give-end-date-label"><?php _e('End Date:', 'give'); ?></label>
144 144
 				<input type="text" id="end-date" name="end-date" class="give_datepicker" value="<?php echo $end_date; ?>" placeholder="mm/dd/yyyy" />
145
-				<input type="submit" class="button-secondary" value="<?php _e( 'Apply', 'give' ); ?>" />
145
+				<input type="submit" class="button-secondary" value="<?php _e('Apply', 'give'); ?>" />
146 146
 			</span>
147
-			<?php if ( ! empty( $status ) ) : ?>
148
-				<input type="hidden" name="status" value="<?php echo esc_attr( $status ); ?>" />
147
+			<?php if ( ! empty($status)) : ?>
148
+				<input type="hidden" name="status" value="<?php echo esc_attr($status); ?>" />
149 149
 			<?php endif; ?>
150
-			<?php if ( ! empty( $start_date ) || ! empty( $end_date ) ) : ?>
151
-				<a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); ?>" class="button-secondary"><?php _e( 'Clear Filter', 'give' ); ?></a>
150
+			<?php if ( ! empty($start_date) || ! empty($end_date)) : ?>
151
+				<a href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history'); ?>" class="button-secondary"><?php _e('Clear Filter', 'give'); ?></a>
152 152
 			<?php endif; ?>
153
-			<?php $this->search_box( __( 'Search', 'give' ), 'give-payments' ); ?>
153
+			<?php $this->search_box(__('Search', 'give'), 'give-payments'); ?>
154 154
 		</div>
155 155
 
156 156
 		<?php
@@ -167,25 +167,25 @@  discard block
 block discarded – undo
167 167
 	 *
168 168
 	 * @return void
169 169
 	 */
170
-	public function search_box( $text, $input_id ) {
171
-		if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) {
170
+	public function search_box($text, $input_id) {
171
+		if (empty($_REQUEST['s']) && ! $this->has_items()) {
172 172
 			return;
173 173
 		}
174 174
 
175
-		$input_id = $input_id . '-search-input';
175
+		$input_id = $input_id.'-search-input';
176 176
 
177
-		if ( ! empty( $_REQUEST['orderby'] ) ) {
178
-			echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
177
+		if ( ! empty($_REQUEST['orderby'])) {
178
+			echo '<input type="hidden" name="orderby" value="'.esc_attr($_REQUEST['orderby']).'" />';
179 179
 		}
180
-		if ( ! empty( $_REQUEST['order'] ) ) {
181
-			echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
180
+		if ( ! empty($_REQUEST['order'])) {
181
+			echo '<input type="hidden" name="order" value="'.esc_attr($_REQUEST['order']).'" />';
182 182
 		}
183 183
 		?>
184 184
 		<p class="search-box">
185
-			<?php do_action( 'give_payment_history_search' ); ?>
185
+			<?php do_action('give_payment_history_search'); ?>
186 186
 			<label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
187 187
 			<input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />
188
-			<?php submit_button( $text, 'button', false, false, array( 'ID' => 'search-submit' ) ); ?><br />
188
+			<?php submit_button($text, 'button', false, false, array('ID' => 'search-submit')); ?><br />
189 189
 		</p>
190 190
 		<?php
191 191
 	}
@@ -199,52 +199,52 @@  discard block
 block discarded – undo
199 199
 	 */
200 200
 	public function get_views() {
201 201
 
202
-		$current         = isset( $_GET['status'] ) ? $_GET['status'] : '';
203
-		$total_count     = '&nbsp;<span class="count">(' . $this->total_count . ')</span>';
204
-		$complete_count  = '&nbsp;<span class="count">(' . $this->complete_count . ')</span>';
205
-		$cancelled_count = '&nbsp;<span class="count">(' . $this->cancelled_count . ')</span>';
206
-		$pending_count   = '&nbsp;<span class="count">(' . $this->pending_count . ')</span>';
207
-		$refunded_count  = '&nbsp;<span class="count">(' . $this->refunded_count . ')</span>';
208
-		$failed_count    = '&nbsp;<span class="count">(' . $this->failed_count . ')</span>';
209
-		$abandoned_count = '&nbsp;<span class="count">(' . $this->abandoned_count . ')</span>';
210
-		$revoked_count   = '&nbsp;<span class="count">(' . $this->revoked_count . ')</span>';
202
+		$current         = isset($_GET['status']) ? $_GET['status'] : '';
203
+		$total_count     = '&nbsp;<span class="count">('.$this->total_count.')</span>';
204
+		$complete_count  = '&nbsp;<span class="count">('.$this->complete_count.')</span>';
205
+		$cancelled_count = '&nbsp;<span class="count">('.$this->cancelled_count.')</span>';
206
+		$pending_count   = '&nbsp;<span class="count">('.$this->pending_count.')</span>';
207
+		$refunded_count  = '&nbsp;<span class="count">('.$this->refunded_count.')</span>';
208
+		$failed_count    = '&nbsp;<span class="count">('.$this->failed_count.')</span>';
209
+		$abandoned_count = '&nbsp;<span class="count">('.$this->abandoned_count.')</span>';
210
+		$revoked_count   = '&nbsp;<span class="count">('.$this->revoked_count.')</span>';
211 211
 
212 212
 		$views = array(
213
-			'all'       => sprintf( '<a href="%s"%s>%s</a>', remove_query_arg( array(
213
+			'all'       => sprintf('<a href="%s"%s>%s</a>', remove_query_arg(array(
214 214
 				'status',
215 215
 				'paged'
216
-			) ), $current === 'all' || $current == '' ? ' class="current"' : '', __( 'All', 'give' ) . $total_count ),
217
-			'publish'   => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
216
+			)), $current === 'all' || $current == '' ? ' class="current"' : '', __('All', 'give').$total_count),
217
+			'publish'   => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
218 218
 				'status' => 'publish',
219 219
 				'paged'  => false
220
-			) ) ), $current === 'publish' ? ' class="current"' : '', __( 'Completed', 'give' ) . $complete_count ),
221
-			'pending'   => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
220
+			))), $current === 'publish' ? ' class="current"' : '', __('Completed', 'give').$complete_count),
221
+			'pending'   => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
222 222
 				'status' => 'pending',
223 223
 				'paged'  => false
224
-			) ) ), $current === 'pending' ? ' class="current"' : '', __( 'Pending', 'give' ) . $pending_count ),
225
-			'refunded'  => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
224
+			))), $current === 'pending' ? ' class="current"' : '', __('Pending', 'give').$pending_count),
225
+			'refunded'  => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
226 226
 				'status' => 'refunded',
227 227
 				'paged'  => false
228
-			) ) ), $current === 'refunded' ? ' class="current"' : '', __( 'Refunded', 'give' ) . $refunded_count ),
229
-			'revoked'   => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
228
+			))), $current === 'refunded' ? ' class="current"' : '', __('Refunded', 'give').$refunded_count),
229
+			'revoked'   => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
230 230
 				'status' => 'revoked',
231 231
 				'paged'  => false
232
-			) ) ), $current === 'revoked' ? ' class="current"' : '', __( 'Revoked', 'give' ) . $revoked_count ),
233
-			'failed'    => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
232
+			))), $current === 'revoked' ? ' class="current"' : '', __('Revoked', 'give').$revoked_count),
233
+			'failed'    => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
234 234
 				'status' => 'failed',
235 235
 				'paged'  => false
236
-			) ) ), $current === 'failed' ? ' class="current"' : '', __( 'Failed', 'give' ) . $failed_count ),
237
-			'cancelled' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
236
+			))), $current === 'failed' ? ' class="current"' : '', __('Failed', 'give').$failed_count),
237
+			'cancelled' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
238 238
 				'status' => 'cancelled',
239 239
 				'paged'  => false
240
-			) ) ), $current === 'cancelled' ? ' class="current"' : '', __( 'Cancelled', 'give' ) . $cancelled_count ),
241
-			'abandoned' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
240
+			))), $current === 'cancelled' ? ' class="current"' : '', __('Cancelled', 'give').$cancelled_count),
241
+			'abandoned' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
242 242
 				'status' => 'abandoned',
243 243
 				'paged'  => false
244
-			) ) ), $current === 'abandoned' ? ' class="current"' : '', __( 'Abandoned', 'give' ) . $abandoned_count )
244
+			))), $current === 'abandoned' ? ' class="current"' : '', __('Abandoned', 'give').$abandoned_count)
245 245
 		);
246 246
 
247
-		return apply_filters( 'give_payments_table_views', $views );
247
+		return apply_filters('give_payments_table_views', $views);
248 248
 	}
249 249
 
250 250
 	/**
@@ -257,16 +257,16 @@  discard block
 block discarded – undo
257 257
 	public function get_columns() {
258 258
 		$columns = array(
259 259
 			'cb'      => '<input type="checkbox" />', //Render a checkbox instead of text
260
-			'email'   => __( 'Email', 'give' ),
261
-			'details' => __( 'Details', 'give' ),
262
-			'amount'  => __( 'Amount', 'give' ),
263
-			'status'  => __( 'Status', 'give' ),
264
-			'date'    => __( 'Date', 'give' ),
265
-			'donor'   => __( 'Donor', 'give' ),
266
-			'ID'      => __( 'ID', 'give' ),
260
+			'email'   => __('Email', 'give'),
261
+			'details' => __('Details', 'give'),
262
+			'amount'  => __('Amount', 'give'),
263
+			'status'  => __('Status', 'give'),
264
+			'date'    => __('Date', 'give'),
265
+			'donor'   => __('Donor', 'give'),
266
+			'ID'      => __('ID', 'give'),
267 267
 		);
268 268
 
269
-		return apply_filters( 'give_payments_table_columns', $columns );
269
+		return apply_filters('give_payments_table_columns', $columns);
270 270
 	}
271 271
 
272 272
 	/**
@@ -278,12 +278,12 @@  discard block
 block discarded – undo
278 278
 	 */
279 279
 	public function get_sortable_columns() {
280 280
 		$columns = array(
281
-			'ID'     => array( 'ID', true ),
282
-			'amount' => array( 'amount', false ),
283
-			'date'   => array( 'date', false )
281
+			'ID'     => array('ID', true),
282
+			'amount' => array('amount', false),
283
+			'date'   => array('date', false)
284 284
 		);
285 285
 
286
-		return apply_filters( 'give_payments_table_sortable_columns', $columns );
286
+		return apply_filters('give_payments_table_sortable_columns', $columns);
287 287
 	}
288 288
 
289 289
 	/**
@@ -297,30 +297,30 @@  discard block
 block discarded – undo
297 297
 	 *
298 298
 	 * @return string Column Name
299 299
 	 */
300
-	public function column_default( $payment, $column_name ) {
301
-		switch ( $column_name ) {
300
+	public function column_default($payment, $column_name) {
301
+		switch ($column_name) {
302 302
 			case 'amount' :
303
-				$amount = ! empty( $payment->total ) ? $payment->total : 0;
304
-				$value  = give_currency_filter( give_format_amount( $amount ), give_get_payment_currency_code( $payment->ID ) );
303
+				$amount = ! empty($payment->total) ? $payment->total : 0;
304
+				$value  = give_currency_filter(give_format_amount($amount), give_get_payment_currency_code($payment->ID));
305 305
 				break;
306 306
 			case 'date' :
307
-				$date  = strtotime( $payment->date );
308
-				$value = date_i18n( get_option( 'date_format' ), $date );
307
+				$date  = strtotime($payment->date);
308
+				$value = date_i18n(get_option('date_format'), $date);
309 309
 				break;
310 310
 			case 'status' :
311
-				$payment = get_post( $payment->ID );
312
-				$value   = '<div class="give-donation-status status-' . sanitize_title( give_get_payment_status( $payment, true ) ) . '"><span class="give-donation-status-icon"></span> ' . give_get_payment_status( $payment, true ) . '</div>';
311
+				$payment = get_post($payment->ID);
312
+				$value   = '<div class="give-donation-status status-'.sanitize_title(give_get_payment_status($payment, true)).'"><span class="give-donation-status-icon"></span> '.give_get_payment_status($payment, true).'</div>';
313 313
 				break;
314 314
 			case 'details' :
315
-				$value = '<div class="give-payment-details-link-wrap"><a href="' . esc_url( add_query_arg( 'id', $payment->ID, admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details' ) ) ) . '" class="give-payment-details-link button button-small">' . __( 'View Donation Details', 'give' ) . '</a></div>';
315
+				$value = '<div class="give-payment-details-link-wrap"><a href="'.esc_url(add_query_arg('id', $payment->ID, admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details'))).'" class="give-payment-details-link button button-small">'.__('View Donation Details', 'give').'</a></div>';
316 316
 				break;
317 317
 			default:
318
-				$value = isset( $payment->$column_name ) ? $payment->$column_name : '';
318
+				$value = isset($payment->$column_name) ? $payment->$column_name : '';
319 319
 				break;
320 320
 
321 321
 		}
322 322
 
323
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, $column_name );
323
+		return apply_filters('give_payments_table_column', $value, $payment->ID, $column_name);
324 324
 	}
325 325
 
326 326
 	/**
@@ -333,32 +333,32 @@  discard block
 block discarded – undo
333 333
 	 *
334 334
 	 * @return string Data shown in the Email column
335 335
 	 */
336
-	public function column_email( $payment ) {
336
+	public function column_email($payment) {
337 337
 
338 338
 		$row_actions = array();
339 339
 
340
-		if ( give_is_payment_complete( $payment->ID ) ) {
341
-			$row_actions['email_links'] = '<a href="' . add_query_arg( array(
340
+		if (give_is_payment_complete($payment->ID)) {
341
+			$row_actions['email_links'] = '<a href="'.add_query_arg(array(
342 342
 					'give-action' => 'email_links',
343 343
 					'purchase_id' => $payment->ID
344
-				), $this->base_url ) . '">' . __( 'Resend Donation Receipt', 'give' ) . '</a>';
344
+				), $this->base_url).'">'.__('Resend Donation Receipt', 'give').'</a>';
345 345
 
346 346
 		}
347 347
 
348
-		$row_actions['delete'] = '<a href="' . wp_nonce_url( add_query_arg( array(
348
+		$row_actions['delete'] = '<a href="'.wp_nonce_url(add_query_arg(array(
349 349
 				'give-action' => 'delete_payment',
350 350
 				'purchase_id' => $payment->ID
351
-			), $this->base_url ), 'give_payment_nonce' ) . '">' . __( 'Delete', 'give' ) . '</a>';
351
+			), $this->base_url), 'give_payment_nonce').'">'.__('Delete', 'give').'</a>';
352 352
 
353
-		$row_actions = apply_filters( 'give_payment_row_actions', $row_actions, $payment );
353
+		$row_actions = apply_filters('give_payment_row_actions', $row_actions, $payment);
354 354
 
355
-		if ( ! isset( $payment->user_info['email'] ) ) {
356
-			$payment->user_info['email'] = __( '(unknown)', 'give' );
355
+		if ( ! isset($payment->user_info['email'])) {
356
+			$payment->user_info['email'] = __('(unknown)', 'give');
357 357
 		}
358 358
 
359
-		$value = '<span class="give-email-column-value">' . $payment->user_info['email'] . '</span>' . $this->row_actions( $row_actions );
359
+		$value = '<span class="give-email-column-value">'.$payment->user_info['email'].'</span>'.$this->row_actions($row_actions);
360 360
 
361
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'email' );
361
+		return apply_filters('give_payments_table_column', $value, $payment->ID, 'email');
362 362
 	}
363 363
 
364 364
 	/**
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 	 *
372 372
 	 * @return string Displays a checkbox
373 373
 	 */
374
-	public function column_cb( $payment ) {
374
+	public function column_cb($payment) {
375 375
 		return sprintf(
376 376
 			'<input type="checkbox" name="%1$s[]" value="%2$s" />',
377 377
 			'payment',
@@ -389,8 +389,8 @@  discard block
 block discarded – undo
389 389
 	 *
390 390
 	 * @return string Displays a checkbox
391 391
 	 */
392
-	public function column_ID( $payment ) {
393
-		return '<span class="give-payment-id">' . give_get_payment_number( $payment->ID ) . '</span>';
392
+	public function column_ID($payment) {
393
+		return '<span class="give-payment-id">'.give_get_payment_number($payment->ID).'</span>';
394 394
 	}
395 395
 
396 396
 	/**
@@ -403,18 +403,18 @@  discard block
 block discarded – undo
403 403
 	 *
404 404
 	 * @return string Data shown in the User column
405 405
 	 */
406
-	public function column_donor( $payment ) {
406
+	public function column_donor($payment) {
407 407
 
408 408
 		//		$user_id = give_get_payment_user_id( $payment->ID );
409 409
 
410
-		$customer_id = give_get_payment_customer_id( $payment->ID );
411
-		$customer    = new Give_Customer( $customer_id );
410
+		$customer_id = give_get_payment_customer_id($payment->ID);
411
+		$customer    = new Give_Customer($customer_id);
412 412
 
413
-		$view_url = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $customer_id );
413
+		$view_url = admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$customer_id);
414 414
 
415
-		$value = '<a href="' . esc_url( $view_url ) . '" data-tooltip="' . __( 'Click here to view this Donor\'s profile', 'give' ) . '">' . $customer->name . '</a>';
415
+		$value = '<a href="'.esc_url($view_url).'" data-tooltip="'.__('Click here to view this Donor\'s profile', 'give').'">'.$customer->name.'</a>';
416 416
 
417
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'donor' );
417
+		return apply_filters('give_payments_table_column', $value, $payment->ID, 'donor');
418 418
 	}
419 419
 
420 420
 	/**
@@ -426,18 +426,18 @@  discard block
 block discarded – undo
426 426
 	 */
427 427
 	public function get_bulk_actions() {
428 428
 		$actions = array(
429
-			'delete'               => __( 'Delete', 'give' ),
430
-			'set-status-publish'   => __( 'Set To Completed', 'give' ),
431
-			'set-status-pending'   => __( 'Set To Pending', 'give' ),
432
-			'set-status-refunded'  => __( 'Set To Refunded', 'give' ),
433
-			'set-status-revoked'   => __( 'Set To Revoked', 'give' ),
434
-			'set-status-failed'    => __( 'Set To Failed', 'give' ),
435
-			'set-status-cancelled' => __( 'Set To Cancelled', 'give' ),
436
-			'set-status-abandoned' => __( 'Set To Abandoned', 'give' ),
437
-			'resend-receipt'       => __( 'Resend Email Receipts', 'give' )
429
+			'delete'               => __('Delete', 'give'),
430
+			'set-status-publish'   => __('Set To Completed', 'give'),
431
+			'set-status-pending'   => __('Set To Pending', 'give'),
432
+			'set-status-refunded'  => __('Set To Refunded', 'give'),
433
+			'set-status-revoked'   => __('Set To Revoked', 'give'),
434
+			'set-status-failed'    => __('Set To Failed', 'give'),
435
+			'set-status-cancelled' => __('Set To Cancelled', 'give'),
436
+			'set-status-abandoned' => __('Set To Abandoned', 'give'),
437
+			'resend-receipt'       => __('Resend Email Receipts', 'give')
438 438
 		);
439 439
 
440
-		return apply_filters( 'give_payments_table_bulk_actions', $actions );
440
+		return apply_filters('give_payments_table_bulk_actions', $actions);
441 441
 	}
442 442
 
443 443
 	/**
@@ -448,57 +448,57 @@  discard block
 block discarded – undo
448 448
 	 * @return void
449 449
 	 */
450 450
 	public function process_bulk_action() {
451
-		$ids    = isset( $_GET['payment'] ) ? $_GET['payment'] : false;
451
+		$ids    = isset($_GET['payment']) ? $_GET['payment'] : false;
452 452
 		$action = $this->current_action();
453 453
 
454
-		if ( ! is_array( $ids ) ) {
455
-			$ids = array( $ids );
454
+		if ( ! is_array($ids)) {
455
+			$ids = array($ids);
456 456
 		}
457 457
 
458
-		if ( empty( $action ) ) {
458
+		if (empty($action)) {
459 459
 			return;
460 460
 		}
461 461
 
462
-		foreach ( $ids as $id ) {
462
+		foreach ($ids as $id) {
463 463
 
464 464
 			// Detect when a bulk action is being triggered...
465
-			if ( 'delete' === $this->current_action() ) {
466
-				give_delete_purchase( $id );
465
+			if ('delete' === $this->current_action()) {
466
+				give_delete_purchase($id);
467 467
 			}
468 468
 
469
-			if ( 'set-status-publish' === $this->current_action() ) {
470
-				give_update_payment_status( $id, 'publish' );
469
+			if ('set-status-publish' === $this->current_action()) {
470
+				give_update_payment_status($id, 'publish');
471 471
 			}
472 472
 
473
-			if ( 'set-status-pending' === $this->current_action() ) {
474
-				give_update_payment_status( $id, 'pending' );
473
+			if ('set-status-pending' === $this->current_action()) {
474
+				give_update_payment_status($id, 'pending');
475 475
 			}
476 476
 
477
-			if ( 'set-status-refunded' === $this->current_action() ) {
478
-				give_update_payment_status( $id, 'refunded' );
477
+			if ('set-status-refunded' === $this->current_action()) {
478
+				give_update_payment_status($id, 'refunded');
479 479
 			}
480 480
 
481
-			if ( 'set-status-revoked' === $this->current_action() ) {
482
-				give_update_payment_status( $id, 'revoked' );
481
+			if ('set-status-revoked' === $this->current_action()) {
482
+				give_update_payment_status($id, 'revoked');
483 483
 			}
484 484
 
485
-			if ( 'set-status-failed' === $this->current_action() ) {
486
-				give_update_payment_status( $id, 'failed' );
485
+			if ('set-status-failed' === $this->current_action()) {
486
+				give_update_payment_status($id, 'failed');
487 487
 			}
488 488
 
489
-			if ( 'set-status-cancelled' === $this->current_action() ) {
490
-				give_update_payment_status( $id, 'cancelled' );
489
+			if ('set-status-cancelled' === $this->current_action()) {
490
+				give_update_payment_status($id, 'cancelled');
491 491
 			}
492 492
 
493
-			if ( 'set-status-abandoned' === $this->current_action() ) {
494
-				give_update_payment_status( $id, 'abandoned' );
493
+			if ('set-status-abandoned' === $this->current_action()) {
494
+				give_update_payment_status($id, 'abandoned');
495 495
 			}
496 496
 
497
-			if ( 'resend-receipt' === $this->current_action() ) {
498
-				give_email_donation_receipt( $id, false );
497
+			if ('resend-receipt' === $this->current_action()) {
498
+				give_email_donation_receipt($id, false);
499 499
 			}
500 500
 
501
-			do_action( 'give_payments_table_do_bulk_action', $id, $this->current_action() );
501
+			do_action('give_payments_table_do_bulk_action', $id, $this->current_action());
502 502
 		}
503 503
 
504 504
 	}
@@ -516,21 +516,21 @@  discard block
 block discarded – undo
516 516
 
517 517
 		$args = array();
518 518
 
519
-		if ( isset( $_GET['user'] ) ) {
520
-			$args['user'] = urldecode( $_GET['user'] );
521
-		} elseif ( isset( $_GET['s'] ) ) {
522
-			$args['s'] = urldecode( $_GET['s'] );
519
+		if (isset($_GET['user'])) {
520
+			$args['user'] = urldecode($_GET['user']);
521
+		} elseif (isset($_GET['s'])) {
522
+			$args['s'] = urldecode($_GET['s']);
523 523
 		}
524 524
 
525
-		if ( ! empty( $_GET['start-date'] ) ) {
526
-			$args['start-date'] = urldecode( $_GET['start-date'] );
525
+		if ( ! empty($_GET['start-date'])) {
526
+			$args['start-date'] = urldecode($_GET['start-date']);
527 527
 		}
528 528
 
529
-		if ( ! empty( $_GET['end-date'] ) ) {
530
-			$args['end-date'] = urldecode( $_GET['end-date'] );
529
+		if ( ! empty($_GET['end-date'])) {
530
+			$args['end-date'] = urldecode($_GET['end-date']);
531 531
 		}
532 532
 
533
-		$payment_count         = give_count_payments( $args );
533
+		$payment_count         = give_count_payments($args);
534 534
 		$this->complete_count  = $payment_count->publish;
535 535
 		$this->pending_count   = $payment_count->pending;
536 536
 		$this->refunded_count  = $payment_count->refunded;
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
 		$this->cancelled_count = $payment_count->cancelled;
540 540
 		$this->abandoned_count = $payment_count->abandoned;
541 541
 
542
-		foreach ( $payment_count as $count ) {
542
+		foreach ($payment_count as $count) {
543 543
 			$this->total_count += $count;
544 544
 		}
545 545
 	}
@@ -554,26 +554,26 @@  discard block
 block discarded – undo
554 554
 	public function payments_data() {
555 555
 
556 556
 		$per_page   = $this->per_page;
557
-		$orderby    = isset( $_GET['orderby'] ) ? urldecode( $_GET['orderby'] ) : 'ID';
558
-		$order      = isset( $_GET['order'] ) ? $_GET['order'] : 'DESC';
559
-		$user       = isset( $_GET['user'] ) ? $_GET['user'] : null;
560
-		$status     = isset( $_GET['status'] ) ? $_GET['status'] : give_get_payment_status_keys();
561
-		$meta_key   = isset( $_GET['meta_key'] ) ? $_GET['meta_key'] : null;
562
-		$year       = isset( $_GET['year'] ) ? $_GET['year'] : null;
563
-		$month      = isset( $_GET['m'] ) ? $_GET['m'] : null;
564
-		$day        = isset( $_GET['day'] ) ? $_GET['day'] : null;
565
-		$search     = isset( $_GET['s'] ) ? sanitize_text_field( $_GET['s'] ) : null;
566
-		$start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null;
567
-		$end_date   = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : $start_date;
568
-
569
-		if ( ! empty( $search ) ) {
557
+		$orderby    = isset($_GET['orderby']) ? urldecode($_GET['orderby']) : 'ID';
558
+		$order      = isset($_GET['order']) ? $_GET['order'] : 'DESC';
559
+		$user       = isset($_GET['user']) ? $_GET['user'] : null;
560
+		$status     = isset($_GET['status']) ? $_GET['status'] : give_get_payment_status_keys();
561
+		$meta_key   = isset($_GET['meta_key']) ? $_GET['meta_key'] : null;
562
+		$year       = isset($_GET['year']) ? $_GET['year'] : null;
563
+		$month      = isset($_GET['m']) ? $_GET['m'] : null;
564
+		$day        = isset($_GET['day']) ? $_GET['day'] : null;
565
+		$search     = isset($_GET['s']) ? sanitize_text_field($_GET['s']) : null;
566
+		$start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null;
567
+		$end_date   = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : $start_date;
568
+
569
+		if ( ! empty($search)) {
570 570
 			$status = 'any'; // Force all payment statuses when searching
571 571
 		}
572 572
 
573 573
 		$args = array(
574 574
 			'output'     => 'payments',
575 575
 			'number'     => $per_page,
576
-			'page'       => isset( $_GET['paged'] ) ? $_GET['paged'] : null,
576
+			'page'       => isset($_GET['paged']) ? $_GET['paged'] : null,
577 577
 			'orderby'    => $orderby,
578 578
 			'order'      => $order,
579 579
 			'user'       => $user,
@@ -587,14 +587,14 @@  discard block
 block discarded – undo
587 587
 			'end_date'   => $end_date,
588 588
 		);
589 589
 
590
-		if ( is_string( $search ) && false !== strpos( $search, 'txn:' ) ) {
590
+		if (is_string($search) && false !== strpos($search, 'txn:')) {
591 591
 
592 592
 			$args['search_in_notes'] = true;
593
-			$args['s']               = trim( str_replace( 'txn:', '', $args['s'] ) );
593
+			$args['s']               = trim(str_replace('txn:', '', $args['s']));
594 594
 
595 595
 		}
596 596
 
597
-		$p_query = new Give_Payments_Query( $args );
597
+		$p_query = new Give_Payments_Query($args);
598 598
 
599 599
 		return $p_query->get_payments();
600 600
 
@@ -614,17 +614,17 @@  discard block
 block discarded – undo
614 614
 	 */
615 615
 	public function prepare_items() {
616 616
 
617
-		wp_reset_vars( array( 'action', 'payment', 'orderby', 'order', 's' ) );
617
+		wp_reset_vars(array('action', 'payment', 'orderby', 'order', 's'));
618 618
 
619 619
 		$columns  = $this->get_columns();
620 620
 		$hidden   = array(); // No hidden columns
621 621
 		$sortable = $this->get_sortable_columns();
622 622
 		$data     = $this->payments_data();
623
-		$status   = isset( $_GET['status'] ) ? $_GET['status'] : 'any';
623
+		$status   = isset($_GET['status']) ? $_GET['status'] : 'any';
624 624
 
625
-		$this->_column_headers = array( $columns, $hidden, $sortable );
625
+		$this->_column_headers = array($columns, $hidden, $sortable);
626 626
 
627
-		switch ( $status ) {
627
+		switch ($status) {
628 628
 			case 'publish':
629 629
 				$total_items = $this->complete_count;
630 630
 				break;
@@ -651,18 +651,18 @@  discard block
 block discarded – undo
651 651
 				break;
652 652
 			default:
653 653
 				// Retrieve the count of the non-default-Give status
654
-				$count       = wp_count_posts( 'give_payment' );
654
+				$count       = wp_count_posts('give_payment');
655 655
 				$total_items = $count->{$status};
656 656
 		}
657 657
 
658 658
 		$this->items = $data;
659 659
 
660
-		$this->set_pagination_args( array(
660
+		$this->set_pagination_args(array(
661 661
 				'total_items' => $total_items,
662 662
 				// WE have to calculate the total number of items
663 663
 				'per_page'    => $this->per_page,
664 664
 				// WE have to determine how many items to show on a page
665
-				'total_pages' => ceil( $total_items / $this->per_page )
665
+				'total_pages' => ceil($total_items / $this->per_page)
666 666
 				// WE have to calculate the total number of pages
667 667
 			)
668 668
 		);
Please login to merge, or discard this patch.
includes/admin/register-settings.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
 	 *
81 81
 	 * @param $url
82 82
 	 *
83
-	 * @return mixed
83
+	 * @return string
84 84
 	 */
85 85
 	public function give_update_cmb_meta_box_url( $url ) {
86 86
 		//Path to Give's CMB
Please login to merge, or discard this patch.
Spacing   +286 added lines, -286 removed lines patch added patch discarded remove patch
@@ -43,24 +43,24 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	public function __construct() {
45 45
 
46
-		add_action( 'admin_init', array( $this, 'init' ) );
46
+		add_action('admin_init', array($this, 'init'));
47 47
 
48 48
 		//Customize CMB2 URL
49
-		add_filter( 'cmb2_meta_box_url', array( $this, 'give_update_cmb_meta_box_url' ) );
49
+		add_filter('cmb2_meta_box_url', array($this, 'give_update_cmb_meta_box_url'));
50 50
 
51 51
 		//Custom CMB2 Settings Fields
52
-		add_action( 'cmb2_render_give_title', 'give_title_callback', 10, 5 );
53
-		add_action( 'cmb2_render_give_description', 'give_description_callback', 10, 5 );
54
-		add_action( 'cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5 );
55
-		add_action( 'cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5 );
56
-		add_action( 'cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5 );
57
-		add_action( 'cmb2_render_system_info', 'give_system_info_callback', 10, 5 );
58
-		add_action( 'cmb2_render_api', 'give_api_callback', 10, 5 );
59
-		add_action( 'cmb2_render_license_key', 'give_license_key_callback', 10, 5 );
60
-		add_action( 'admin_notices', array( $this, 'settings_notices' ) );
52
+		add_action('cmb2_render_give_title', 'give_title_callback', 10, 5);
53
+		add_action('cmb2_render_give_description', 'give_description_callback', 10, 5);
54
+		add_action('cmb2_render_enabled_gateways', 'give_enabled_gateways_callback', 10, 5);
55
+		add_action('cmb2_render_default_gateway', 'give_default_gateway_callback', 10, 5);
56
+		add_action('cmb2_render_email_preview_buttons', 'give_email_preview_buttons_callback', 10, 5);
57
+		add_action('cmb2_render_system_info', 'give_system_info_callback', 10, 5);
58
+		add_action('cmb2_render_api', 'give_api_callback', 10, 5);
59
+		add_action('cmb2_render_license_key', 'give_license_key_callback', 10, 5);
60
+		add_action('admin_notices', array($this, 'settings_notices'));
61 61
 
62 62
 		// Include CMB CSS in the head to avoid FOUC
63
-		add_action( "admin_print_styles-give_forms_page_give-settings", array( 'CMB2_hookup', 'enqueue_cmb_css' ) );
63
+		add_action("admin_print_styles-give_forms_page_give-settings", array('CMB2_hookup', 'enqueue_cmb_css'));
64 64
 
65 65
 	}
66 66
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 * @since  1.0
70 70
 	 */
71 71
 	public function init() {
72
-		register_setting( $this->key, $this->key );
72
+		register_setting($this->key, $this->key);
73 73
 
74 74
 	}
75 75
 
@@ -83,9 +83,9 @@  discard block
 block discarded – undo
83 83
 	 *
84 84
 	 * @return mixed
85 85
 	 */
86
-	public function give_update_cmb_meta_box_url( $url ) {
86
+	public function give_update_cmb_meta_box_url($url) {
87 87
 		//Path to Give's CMB
88
-		return GIVE_PLUGIN_URL . '/includes/libraries/cmb2';
88
+		return GIVE_PLUGIN_URL.'/includes/libraries/cmb2';
89 89
 	}
90 90
 
91 91
 
@@ -97,27 +97,27 @@  discard block
 block discarded – undo
97 97
 	 */
98 98
 	public function give_get_settings_tabs() {
99 99
 
100
-		$settings = $this->give_settings( null );
100
+		$settings = $this->give_settings(null);
101 101
 
102 102
 		$tabs             = array();
103
-		$tabs['general']  = __( 'General', 'give' );
104
-		$tabs['gateways'] = __( 'Payment Gateways', 'give' );
105
-		$tabs['display']  = __( 'Display Options', 'give' );
106
-		$tabs['emails']   = __( 'Emails', 'give' );
103
+		$tabs['general']  = __('General', 'give');
104
+		$tabs['gateways'] = __('Payment Gateways', 'give');
105
+		$tabs['display']  = __('Display Options', 'give');
106
+		$tabs['emails']   = __('Emails', 'give');
107 107
 
108
-		if ( ! empty( $settings['addons']['fields'] ) ) {
109
-			$tabs['addons'] = __( 'Add-ons', 'give' );
108
+		if ( ! empty($settings['addons']['fields'])) {
109
+			$tabs['addons'] = __('Add-ons', 'give');
110 110
 		}
111 111
 
112
-		if ( ! empty( $settings['licenses']['fields'] ) ) {
113
-			$tabs['licenses'] = __( 'Licenses', 'give' );
112
+		if ( ! empty($settings['licenses']['fields'])) {
113
+			$tabs['licenses'] = __('Licenses', 'give');
114 114
 		}
115 115
 
116
-		$tabs['advanced']    = __( 'Advanced', 'give' );
117
-		$tabs['api']         = __( 'API', 'give' );
118
-		$tabs['system_info'] = __( 'System Info', 'give' );
116
+		$tabs['advanced']    = __('Advanced', 'give');
117
+		$tabs['api']         = __('API', 'give');
118
+		$tabs['system_info'] = __('System Info', 'give');
119 119
 
120
-		return apply_filters( 'give_settings_tabs', $tabs );
120
+		return apply_filters('give_settings_tabs', $tabs);
121 121
 	}
122 122
 
123 123
 
@@ -127,31 +127,31 @@  discard block
 block discarded – undo
127 127
 	 */
128 128
 	public function admin_page_display() {
129 129
 
130
-		$active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $this->give_get_settings_tabs() ) ? $_GET['tab'] : 'general';
130
+		$active_tab = isset($_GET['tab']) && array_key_exists($_GET['tab'], $this->give_get_settings_tabs()) ? $_GET['tab'] : 'general';
131 131
 
132 132
 		?>
133 133
 
134 134
 		<div class="wrap give_settings_page cmb2_options_page <?php echo $this->key; ?>">
135 135
 			<h1 class="nav-tab-wrapper">
136 136
 				<?php
137
-				foreach ( $this->give_get_settings_tabs() as $tab_id => $tab_name ) {
137
+				foreach ($this->give_get_settings_tabs() as $tab_id => $tab_name) {
138 138
 
139
-					$tab_url = esc_url( add_query_arg( array(
139
+					$tab_url = esc_url(add_query_arg(array(
140 140
 						'settings-updated' => false,
141 141
 						'tab'              => $tab_id
142
-					) ) );
142
+					)));
143 143
 
144 144
 					$active = $active_tab == $tab_id ? ' nav-tab-active' : '';
145 145
 
146
-					echo '<a href="' . esc_url( $tab_url ) . '" title="' . esc_attr( $tab_name ) . '" class="nav-tab' . $active . '">';
147
-					echo esc_html( $tab_name );
146
+					echo '<a href="'.esc_url($tab_url).'" title="'.esc_attr($tab_name).'" class="nav-tab'.$active.'">';
147
+					echo esc_html($tab_name);
148 148
 
149 149
 					echo '</a>';
150 150
 				}
151 151
 				?>
152 152
 			</h1>
153 153
 
154
-			<?php cmb2_metabox_form( $this->give_settings( $active_tab ), $this->key ); ?>
154
+			<?php cmb2_metabox_form($this->give_settings($active_tab), $this->key); ?>
155 155
 
156 156
 		</div><!-- .wrap -->
157 157
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	 *
168 168
 	 * @return array
169 169
 	 */
170
-	public function give_settings( $active_tab ) {
170
+	public function give_settings($active_tab) {
171 171
 
172 172
 		$give_settings = array(
173 173
 			/**
@@ -175,60 +175,60 @@  discard block
 block discarded – undo
175 175
 			 */
176 176
 			'general'     => array(
177 177
 				'id'         => 'options_page',
178
-				'give_title' => __( 'General Settings', 'give' ),
179
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
180
-				'fields'     => apply_filters( 'give_settings_general', array(
178
+				'give_title' => __('General Settings', 'give'),
179
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
180
+				'fields'     => apply_filters('give_settings_general', array(
181 181
 						array(
182
-							'name' => __( 'General Settings', 'give' ),
182
+							'name' => __('General Settings', 'give'),
183 183
 							'desc' => '',
184 184
 							'type' => 'give_title',
185 185
 							'id'   => 'give_title_general_settings_1'
186 186
 						),
187 187
 						array(
188
-							'name'    => __( 'Success Page', 'give' ),
189
-							'desc'    => sprintf( __( 'This is the page donors are sent to after completing their donations. The %1$s[give_receipt]%2$s shortcode should be on this page.', 'give' ), '<code>', '</code>' ),
188
+							'name'    => __('Success Page', 'give'),
189
+							'desc'    => sprintf(__('This is the page donors are sent to after completing their donations. The %1$s[give_receipt]%2$s shortcode should be on this page.', 'give'), '<code>', '</code>'),
190 190
 							'id'      => 'success_page',
191 191
 							'type'    => 'select',
192
-							'options' => give_cmb2_get_post_options( array(
192
+							'options' => give_cmb2_get_post_options(array(
193 193
 								'post_type'   => 'page',
194
-								'numberposts' => - 1
195
-							) ),
194
+								'numberposts' => -1
195
+							)),
196 196
 						),
197 197
 						array(
198
-							'name'    => __( 'Failed Transaction Page', 'give' ),
199
-							'desc'    => __( 'This is the page donors are sent to if their transaction is cancelled or fails.', 'give' ),
198
+							'name'    => __('Failed Transaction Page', 'give'),
199
+							'desc'    => __('This is the page donors are sent to if their transaction is cancelled or fails.', 'give'),
200 200
 							'id'      => 'failure_page',
201 201
 							'type'    => 'select',
202
-							'options' => give_cmb2_get_post_options( array(
202
+							'options' => give_cmb2_get_post_options(array(
203 203
 								'post_type'   => 'page',
204
-								'numberposts' => - 1
205
-							) ),
204
+								'numberposts' => -1
205
+							)),
206 206
 						),
207 207
 						array(
208
-							'name'    => __( 'Donation History Page', 'give' ),
209
-							'desc'    => __( 'This page shows a complete donation history for the current user. The <code>[donation_history]</code> shortcode should be on this page.', 'give' ),
208
+							'name'    => __('Donation History Page', 'give'),
209
+							'desc'    => __('This page shows a complete donation history for the current user. The <code>[donation_history]</code> shortcode should be on this page.', 'give'),
210 210
 							'id'      => 'history_page',
211 211
 							'type'    => 'select',
212
-							'options' => give_cmb2_get_post_options( array(
212
+							'options' => give_cmb2_get_post_options(array(
213 213
 								'post_type'   => 'page',
214
-								'numberposts' => - 1
215
-							) ),
214
+								'numberposts' => -1
215
+							)),
216 216
 						),
217 217
 						array(
218
-							'name'    => __( 'Base Country', 'give' ),
219
-							'desc'    => __( 'Where does your site operate from?', 'give' ),
218
+							'name'    => __('Base Country', 'give'),
219
+							'desc'    => __('Where does your site operate from?', 'give'),
220 220
 							'id'      => 'base_country',
221 221
 							'type'    => 'select',
222 222
 							'options' => give_get_country_list(),
223 223
 						),
224 224
 						array(
225
-							'name' => __( 'Currency Settings', 'give' ),
225
+							'name' => __('Currency Settings', 'give'),
226 226
 							'desc' => '',
227 227
 							'type' => 'give_title',
228 228
 							'id'   => 'give_title_general_settings_2'
229 229
 						),
230 230
 						array(
231
-							'name'    => __( 'Currency', 'give' ),
231
+							'name'    => __('Currency', 'give'),
232 232
 							'desc'    => 'Choose your currency. Note that some payment gateways have currency restrictions.',
233 233
 							'id'      => 'currency',
234 234
 							'type'    => 'select',
@@ -236,26 +236,26 @@  discard block
 block discarded – undo
236 236
 							'default' => 'USD',
237 237
 						),
238 238
 						array(
239
-							'name'    => __( 'Currency Position', 'give' ),
239
+							'name'    => __('Currency Position', 'give'),
240 240
 							'desc'    => 'Choose the position of the currency sign.',
241 241
 							'id'      => 'currency_position',
242 242
 							'type'    => 'select',
243 243
 							'options' => array(
244
-								'before' => __( 'Before - $10', 'give' ),
245
-								'after'  => __( 'After - 10$', 'give' )
244
+								'before' => __('Before - $10', 'give'),
245
+								'after'  => __('After - 10$', 'give')
246 246
 							),
247 247
 							'default' => 'before',
248 248
 						),
249 249
 						array(
250
-							'name'    => __( 'Thousands Separator', 'give' ),
251
-							'desc'    => __( 'The symbol (typically , or .) to separate thousands', 'give' ),
250
+							'name'    => __('Thousands Separator', 'give'),
251
+							'desc'    => __('The symbol (typically , or .) to separate thousands', 'give'),
252 252
 							'id'      => 'thousands_separator',
253 253
 							'type'    => 'text_small',
254 254
 							'default' => ',',
255 255
 						),
256 256
 						array(
257
-							'name'    => __( 'Decimal Separator', 'give' ),
258
-							'desc'    => __( 'The symbol (usually , or .) to separate decimal points', 'give' ),
257
+							'name'    => __('Decimal Separator', 'give'),
258
+							'desc'    => __('The symbol (usually , or .) to separate decimal points', 'give'),
259 259
 							'id'      => 'decimal_separator',
260 260
 							'type'    => 'text_small',
261 261
 							'default' => '.',
@@ -268,83 +268,83 @@  discard block
 block discarded – undo
268 268
 			 */
269 269
 			'gateways'    => array(
270 270
 				'id'         => 'options_page',
271
-				'give_title' => __( 'Payment Gateways', 'give' ),
272
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
273
-				'fields'     => apply_filters( 'give_settings_gateways', array(
271
+				'give_title' => __('Payment Gateways', 'give'),
272
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
273
+				'fields'     => apply_filters('give_settings_gateways', array(
274 274
 						array(
275
-							'name' => __( 'Gateways Settings', 'give' ),
275
+							'name' => __('Gateways Settings', 'give'),
276 276
 							'desc' => '',
277 277
 							'id'   => 'give_title_gateway_settings_1',
278 278
 							'type' => 'give_title'
279 279
 						),
280 280
 						array(
281
-							'name' => __( 'Test Mode', 'give' ),
282
-							'desc' => __( 'While in test mode no live transactions are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give' ),
281
+							'name' => __('Test Mode', 'give'),
282
+							'desc' => __('While in test mode no live transactions are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give'),
283 283
 							'id'   => 'test_mode',
284 284
 							'type' => 'checkbox'
285 285
 						),
286 286
 						array(
287
-							'name' => __( 'Enabled Gateways', 'give' ),
288
-							'desc' => __( 'Choose the payment gateways you would like enabled.', 'give' ),
287
+							'name' => __('Enabled Gateways', 'give'),
288
+							'desc' => __('Choose the payment gateways you would like enabled.', 'give'),
289 289
 							'id'   => 'gateways',
290 290
 							'type' => 'enabled_gateways'
291 291
 						),
292 292
 						array(
293
-							'name' => __( 'Default Gateway', 'give' ),
294
-							'desc' => __( 'This is the gateway that will be selected by default.', 'give' ),
293
+							'name' => __('Default Gateway', 'give'),
294
+							'desc' => __('This is the gateway that will be selected by default.', 'give'),
295 295
 							'id'   => 'default_gateway',
296 296
 							'type' => 'default_gateway'
297 297
 						),
298 298
 						array(
299
-							'name' => __( 'PayPal Standard', 'give' ),
299
+							'name' => __('PayPal Standard', 'give'),
300 300
 							'desc' => '',
301 301
 							'type' => 'give_title',
302 302
 							'id'   => 'give_title_gateway_settings_2',
303 303
 						),
304 304
 						array(
305
-							'name' => __( 'PayPal Email', 'give' ),
306
-							'desc' => __( 'Enter your PayPal account\'s email', 'give' ),
305
+							'name' => __('PayPal Email', 'give'),
306
+							'desc' => __('Enter your PayPal account\'s email', 'give'),
307 307
 							'id'   => 'paypal_email',
308 308
 							'type' => 'text_email',
309 309
 						),
310 310
 						array(
311
-							'name' => __( 'PayPal Page Style', 'give' ),
312
-							'desc' => __( 'Enter the name of the page style to use, or leave blank to use the default', 'give' ),
311
+							'name' => __('PayPal Page Style', 'give'),
312
+							'desc' => __('Enter the name of the page style to use, or leave blank to use the default', 'give'),
313 313
 							'id'   => 'paypal_page_style',
314 314
 							'type' => 'text',
315 315
 						),
316 316
 						array(
317
-							'name'    => __( 'PayPal Transaction Type', 'give' ),
318
-							'desc'    => __( 'Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give' ),
317
+							'name'    => __('PayPal Transaction Type', 'give'),
318
+							'desc'    => __('Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give'),
319 319
 							'id'      => 'paypal_button_type',
320 320
 							'type'    => 'radio_inline',
321 321
 							'options' => array(
322
-								'donation' => __( 'Donation', 'give' ),
323
-								'standard' => __( 'Standard Transaction', 'give' )
322
+								'donation' => __('Donation', 'give'),
323
+								'standard' => __('Standard Transaction', 'give')
324 324
 							),
325 325
 							'default' => 'donation',
326 326
 						),
327 327
 						array(
328
-							'name' => __( 'Disable PayPal IPN Verification', 'give' ),
329
-							'desc' => __( 'If donations are not getting marked as complete, then check this box. This forces the site to use a slightly less secure method of verifying donations.', 'give' ),
328
+							'name' => __('Disable PayPal IPN Verification', 'give'),
329
+							'desc' => __('If donations are not getting marked as complete, then check this box. This forces the site to use a slightly less secure method of verifying donations.', 'give'),
330 330
 							'id'   => 'disable_paypal_verification',
331 331
 							'type' => 'checkbox'
332 332
 						),
333 333
 						array(
334
-							'name' => __( 'Offline Donations', 'give' ),
334
+							'name' => __('Offline Donations', 'give'),
335 335
 							'desc' => '',
336 336
 							'type' => 'give_title',
337 337
 							'id'   => 'give_title_gateway_settings_3',
338 338
 						),
339 339
 						array(
340
-							'name' => __( 'Collect Billing Details', 'give' ),
341
-							'desc' => __( 'This option will enable the billing details section for offline donations. The fieldset will appear above the offline donation instructions. Note: You may customize this option per form as needed.', 'give' ),
340
+							'name' => __('Collect Billing Details', 'give'),
341
+							'desc' => __('This option will enable the billing details section for offline donations. The fieldset will appear above the offline donation instructions. Note: You may customize this option per form as needed.', 'give'),
342 342
 							'id'   => 'give_offline_donation_enable_billing_fields',
343 343
 							'type' => 'checkbox'
344 344
 						),
345 345
 						array(
346
-							'name'    => __( 'Offline Donation Instructions', 'give' ),
347
-							'desc'    => __( 'The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give' ),
346
+							'name'    => __('Offline Donation Instructions', 'give'),
347
+							'desc'    => __('The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give'),
348 348
 							'id'      => 'global_offline_donation_content',
349 349
 							'default' => give_get_default_offline_donation_content(),
350 350
 							'type'    => 'wysiwyg',
@@ -353,15 +353,15 @@  discard block
 block discarded – undo
353 353
 							)
354 354
 						),
355 355
 						array(
356
-							'name'    => __( 'Offline Donation Email Instructions Subject', 'give' ),
357
-							'desc'    => __( 'Enter the subject line for the donation receipt email.', 'give' ),
356
+							'name'    => __('Offline Donation Email Instructions Subject', 'give'),
357
+							'desc'    => __('Enter the subject line for the donation receipt email.', 'give'),
358 358
 							'id'      => 'offline_donation_subject',
359
-							'default' => __( '{donation} - Offline Donation Instructions', 'give' ),
359
+							'default' => __('{donation} - Offline Donation Instructions', 'give'),
360 360
 							'type'    => 'text'
361 361
 						),
362 362
 						array(
363
-							'name'    => __( 'Offline Donation Email Instructions', 'give' ),
364
-							'desc'    => __( 'Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give' ),
363
+							'name'    => __('Offline Donation Email Instructions', 'give'),
364
+							'desc'    => __('Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give'),
365 365
 							'id'      => 'global_offline_donation_email',
366 366
 							'default' => give_get_default_offline_donation_email_content(),
367 367
 							'type'    => 'wysiwyg',
@@ -375,84 +375,84 @@  discard block
 block discarded – undo
375 375
 			/** Display Settings */
376 376
 			'display'     => array(
377 377
 				'id'         => 'options_page',
378
-				'give_title' => __( 'Display Settings', 'give' ),
379
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
380
-				'fields'     => apply_filters( 'give_settings_display', array(
378
+				'give_title' => __('Display Settings', 'give'),
379
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
380
+				'fields'     => apply_filters('give_settings_display', array(
381 381
 						array(
382
-							'name' => __( 'Display Settings', 'give' ),
382
+							'name' => __('Display Settings', 'give'),
383 383
 							'desc' => '',
384 384
 							'id'   => 'give_title_display_settings_1',
385 385
 							'type' => 'give_title'
386 386
 						),
387 387
 						array(
388
-							'name' => __( 'Disable CSS', 'give' ),
389
-							'desc' => __( 'Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give' ),
388
+							'name' => __('Disable CSS', 'give'),
389
+							'desc' => __('Enable this option if you would like to disable all of Give\'s included CSS stylesheets.', 'give'),
390 390
 							'id'   => 'disable_css',
391 391
 							'type' => 'checkbox'
392 392
 						),
393 393
 						array(
394
-							'name' => __( 'Enable Floating Labels', 'give' ),
395
-							'desc' => sprintf( __( 'Enable this option if you would like to enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms.<br>Be aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give' ), esc_url( "http://bradfrost.com/blog/post/float-label-pattern/" ) ),
394
+							'name' => __('Enable Floating Labels', 'give'),
395
+							'desc' => sprintf(__('Enable this option if you would like to enable <a href="%s" target="_blank">floating labels</a> in Give\'s donation forms.<br>Be aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give'), esc_url("http://bradfrost.com/blog/post/float-label-pattern/")),
396 396
 							'id'   => 'enable_floatlabels',
397 397
 							'type' => 'checkbox'
398 398
 						),
399 399
 						array(
400
-							'name' => __( 'Disable Welcome Screen', 'give' ),
401
-							'desc' => sprintf( __( 'Enable this option if you would like to disable the Give Welcome screen every time Give is activated and/or updated. You can always access the Welcome Screen <a href="%s">here</a> if you want in the future.', 'give' ), esc_url( admin_url( 'index.php?page=give-about' ) ) ),
400
+							'name' => __('Disable Welcome Screen', 'give'),
401
+							'desc' => sprintf(__('Enable this option if you would like to disable the Give Welcome screen every time Give is activated and/or updated. You can always access the Welcome Screen <a href="%s">here</a> if you want in the future.', 'give'), esc_url(admin_url('index.php?page=give-about'))),
402 402
 							'id'   => 'disable_welcome',
403 403
 							'type' => 'checkbox'
404 404
 						),
405 405
 						array(
406
-							'name' => __( 'Post Types', 'give' ),
406
+							'name' => __('Post Types', 'give'),
407 407
 							'desc' => '',
408 408
 							'id'   => 'give_title_display_settings_2',
409 409
 							'type' => 'give_title'
410 410
 						),
411 411
 						array(
412
-							'name' => __( 'Disable Form Single Views', 'give' ),
413
-							'desc' => __( 'By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give' ),
412
+							'name' => __('Disable Form Single Views', 'give'),
413
+							'desc' => __('By default, all forms have single views enabled which create a specific URL on your website for that form. This option disables the singular and archive views from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give'),
414 414
 							'id'   => 'disable_forms_singular',
415 415
 							'type' => 'checkbox'
416 416
 						),
417 417
 						array(
418
-							'name' => __( 'Disable Form Archives', 'give' ),
419
-							'desc' => __( 'Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give' ),
418
+							'name' => __('Disable Form Archives', 'give'),
419
+							'desc' => __('Archives pages list all the forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give'),
420 420
 							'id'   => 'disable_forms_archives',
421 421
 							'type' => 'checkbox'
422 422
 						),
423 423
 						array(
424
-							'name' => __( 'Disable Form Excerpts', 'give' ),
425
-							'desc' => __( 'The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give' ),
424
+							'name' => __('Disable Form Excerpts', 'give'),
425
+							'desc' => __('The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give'),
426 426
 							'id'   => 'disable_forms_excerpt',
427 427
 							'type' => 'checkbox'
428 428
 						),
429 429
 						array(
430
-							'name' => __( 'Disable Form Featured Image', 'give' ),
431
-							'desc' => __( 'The Featured Image is an image that is chosen as the representative image for donation form. The display of this image is largely up to the theme. If you do not wish to use the featured image you can disable it using this option.', 'give' ),
430
+							'name' => __('Disable Form Featured Image', 'give'),
431
+							'desc' => __('The Featured Image is an image that is chosen as the representative image for donation form. The display of this image is largely up to the theme. If you do not wish to use the featured image you can disable it using this option.', 'give'),
432 432
 							'id'   => 'disable_form_featured_img',
433 433
 							'type' => 'checkbox'
434 434
 						),
435 435
 						array(
436
-							'name' => __( 'Disable Single Form Sidebar', 'give' ),
437
-							'desc' => __( 'The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give' ),
436
+							'name' => __('Disable Single Form Sidebar', 'give'),
437
+							'desc' => __('The sidebar allows you to add additional widget to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give'),
438 438
 							'id'   => 'disable_form_sidebar',
439 439
 							'type' => 'checkbox'
440 440
 						),
441 441
 						array(
442
-							'name' => __( 'Taxonomies', 'give' ),
442
+							'name' => __('Taxonomies', 'give'),
443 443
 							'desc' => '',
444 444
 							'id'   => 'give_title_display_settings_3',
445 445
 							'type' => 'give_title'
446 446
 						),
447 447
 						array(
448
-							'name' => __( 'Enable Form Categories', 'give' ),
449
-							'desc' => __( 'Check this option if you would like to categorize your donation forms. This option enables the form\'s category taxonomy.', 'give' ),
448
+							'name' => __('Enable Form Categories', 'give'),
449
+							'desc' => __('Check this option if you would like to categorize your donation forms. This option enables the form\'s category taxonomy.', 'give'),
450 450
 							'id'   => 'enable_categories',
451 451
 							'type' => 'checkbox'
452 452
 						),
453 453
 						array(
454
-							'name' => __( 'Enable Form Tags', 'give' ),
455
-							'desc' => __( 'Check this option if you would like to tag your donation forms. This option enables the form\'s tag taxonomy.', 'give' ),
454
+							'name' => __('Enable Form Tags', 'give'),
455
+							'desc' => __('Check this option if you would like to tag your donation forms. This option enables the form\'s tag taxonomy.', 'give'),
456 456
 							'id'   => 'enable_tags',
457 457
 							'type' => 'checkbox'
458 458
 						),
@@ -465,93 +465,93 @@  discard block
 block discarded – undo
465 465
 			 */
466 466
 			'emails'      => array(
467 467
 				'id'         => 'options_page',
468
-				'give_title' => __( 'Give Email Settings', 'give' ),
469
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
470
-				'fields'     => apply_filters( 'give_settings_emails', array(
468
+				'give_title' => __('Give Email Settings', 'give'),
469
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
470
+				'fields'     => apply_filters('give_settings_emails', array(
471 471
 						array(
472
-							'name' => __( 'Email Settings', 'give' ),
472
+							'name' => __('Email Settings', 'give'),
473 473
 							'desc' => '',
474 474
 							'id'   => 'give_title_email_settings_1',
475 475
 							'type' => 'give_title'
476 476
 						),
477 477
 						array(
478 478
 							'id'      => 'email_template',
479
-							'name'    => __( 'Email Template', 'give' ),
480
-							'desc'    => __( 'Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give' ),
479
+							'name'    => __('Email Template', 'give'),
480
+							'desc'    => __('Choose a template. Click "Save Changes" then "Preview Donation Receipt" to see the new template.', 'give'),
481 481
 							'type'    => 'select',
482 482
 							'options' => give_get_email_templates()
483 483
 						),
484 484
 						array(
485 485
 							'id'   => 'email_logo',
486
-							'name' => __( 'Logo', 'give' ),
487
-							'desc' => __( 'Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give' ),
486
+							'name' => __('Logo', 'give'),
487
+							'desc' => __('Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give'),
488 488
 							'type' => 'file'
489 489
 						),
490 490
 						array(
491 491
 							'id'      => 'from_name',
492
-							'name'    => __( 'From Name', 'give' ),
493
-							'desc'    => __( 'The name donation receipts are said to come from. This should probably be your site or shop name.', 'give' ),
494
-							'default' => get_bloginfo( 'name' ),
492
+							'name'    => __('From Name', 'give'),
493
+							'desc'    => __('The name donation receipts are said to come from. This should probably be your site or shop name.', 'give'),
494
+							'default' => get_bloginfo('name'),
495 495
 							'type'    => 'text'
496 496
 						),
497 497
 						array(
498 498
 							'id'      => 'from_email',
499
-							'name'    => __( 'From Email', 'give' ),
500
-							'desc'    => __( 'Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give' ),
501
-							'default' => get_bloginfo( 'admin_email' ),
499
+							'name'    => __('From Email', 'give'),
500
+							'desc'    => __('Email to send donation receipts from. This will act as the "from" and "reply-to" address.', 'give'),
501
+							'default' => get_bloginfo('admin_email'),
502 502
 							'type'    => 'text'
503 503
 						),
504 504
 						array(
505
-							'name' => __( 'Donation Receipt', 'give' ),
505
+							'name' => __('Donation Receipt', 'give'),
506 506
 							'desc' => '',
507 507
 							'id'   => 'give_title_email_settings_2',
508 508
 							'type' => 'give_title'
509 509
 						),
510 510
 						array(
511 511
 							'id'      => 'donation_subject',
512
-							'name'    => __( 'Donation Email Subject', 'give' ),
513
-							'desc'    => __( 'Enter the subject line for the donation receipt email', 'give' ),
514
-							'default' => __( 'Donation Receipt', 'give' ),
512
+							'name'    => __('Donation Email Subject', 'give'),
513
+							'desc'    => __('Enter the subject line for the donation receipt email', 'give'),
514
+							'default' => __('Donation Receipt', 'give'),
515 515
 							'type'    => 'text'
516 516
 						),
517 517
 						array(
518 518
 							'id'      => 'donation_receipt',
519
-							'name'    => __( 'Donation Receipt', 'give' ),
520
-							'desc'    => __( 'Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags:', 'give' ) . '<br/>' . give_get_emails_tags_list(),
519
+							'name'    => __('Donation Receipt', 'give'),
520
+							'desc'    => __('Enter the email that is sent to users after completing a successful donation. HTML is accepted. Available template tags:', 'give').'<br/>'.give_get_emails_tags_list(),
521 521
 							'type'    => 'wysiwyg',
522
-							'default' => __( "Dear", "give" ) . " {name},\n\n" . __( "Thank you for your donation. Your generosity is appreciated! Please click on the link below to view your receipt.", "give" ) . "\n\n{receipt_link}\n\nSincerely,\n{sitename}"
522
+							'default' => __("Dear", "give")." {name},\n\n".__("Thank you for your donation. Your generosity is appreciated! Please click on the link below to view your receipt.", "give")."\n\n{receipt_link}\n\nSincerely,\n{sitename}"
523 523
 						),
524 524
 						array(
525
-							'name' => __( 'New Donation Notification', 'give' ),
525
+							'name' => __('New Donation Notification', 'give'),
526 526
 							'desc' => '',
527 527
 							'id'   => 'give_title_email_settings_3',
528 528
 							'type' => 'give_title'
529 529
 						),
530 530
 						array(
531 531
 							'id'      => 'donation_notification_subject',
532
-							'name'    => __( 'Donation Notification Subject', 'give' ),
533
-							'desc'    => __( 'Enter the subject line for the donation notification email', 'give' ),
532
+							'name'    => __('Donation Notification Subject', 'give'),
533
+							'desc'    => __('Enter the subject line for the donation notification email', 'give'),
534 534
 							'type'    => 'text',
535
-							'default' => __( 'New Donation - #{payment_id}', 'give' )
535
+							'default' => __('New Donation - #{payment_id}', 'give')
536 536
 						),
537 537
 						array(
538 538
 							'id'      => 'donation_notification',
539
-							'name'    => __( 'Donation Notification', 'give' ),
540
-							'desc'    => __( 'Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags:', 'give' ) . '<br/>' . give_get_emails_tags_list(),
539
+							'name'    => __('Donation Notification', 'give'),
540
+							'desc'    => __('Enter the email that is sent to donation notification emails after completion of a donation. HTML is accepted. Available template tags:', 'give').'<br/>'.give_get_emails_tags_list(),
541 541
 							'type'    => 'wysiwyg',
542 542
 							'default' => give_get_default_donation_notification_email()
543 543
 						),
544 544
 						array(
545 545
 							'id'      => 'admin_notice_emails',
546
-							'name'    => __( 'Donation Notification Emails', 'give' ),
547
-							'desc'    => sprintf( __( 'Enter the email address(es) that should receive a notification anytime a donation is made, please only enter %1$sone email address per line%2$s and not separated by commas.', 'give' ), '<span class="give-underline">', '</span>' ),
546
+							'name'    => __('Donation Notification Emails', 'give'),
547
+							'desc'    => sprintf(__('Enter the email address(es) that should receive a notification anytime a donation is made, please only enter %1$sone email address per line%2$s and not separated by commas.', 'give'), '<span class="give-underline">', '</span>'),
548 548
 							'type'    => 'textarea',
549
-							'default' => get_bloginfo( 'admin_email' )
549
+							'default' => get_bloginfo('admin_email')
550 550
 						),
551 551
 						array(
552 552
 							'id'   => 'disable_admin_notices',
553
-							'name' => __( 'Disable Admin Notifications', 'give' ),
554
-							'desc' => __( 'Check this box if you do not want to receive emails when new donations are made.', 'give' ),
553
+							'name' => __('Disable Admin Notifications', 'give'),
554
+							'desc' => __('Check this box if you do not want to receive emails when new donations are made.', 'give'),
555 555
 							'type' => 'checkbox'
556 556
 						)
557 557
 					)
@@ -560,76 +560,76 @@  discard block
 block discarded – undo
560 560
 			/** Extension Settings */
561 561
 			'addons'      => array(
562 562
 				'id'         => 'options_page',
563
-				'give_title' => __( 'Give Add-ons Settings', 'give' ),
564
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
565
-				'fields'     => apply_filters( 'give_settings_addons', array()
563
+				'give_title' => __('Give Add-ons Settings', 'give'),
564
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
565
+				'fields'     => apply_filters('give_settings_addons', array()
566 566
 				)
567 567
 			),
568 568
 			/** Licenses Settings */
569 569
 			'licenses'    => array(
570 570
 				'id'         => 'options_page',
571
-				'give_title' => __( 'Give Licenses', 'give' ),
572
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
573
-				'fields'     => apply_filters( 'give_settings_licenses', array()
571
+				'give_title' => __('Give Licenses', 'give'),
572
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
573
+				'fields'     => apply_filters('give_settings_licenses', array()
574 574
 				)
575 575
 			),
576 576
 			/** Advanced Options */
577 577
 			'advanced'    => array(
578 578
 				'id'         => 'options_page',
579
-				'give_title' => __( 'Advanced Options', 'give' ),
580
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
581
-				'fields'     => apply_filters( 'give_settings_advanced', array(
579
+				'give_title' => __('Advanced Options', 'give'),
580
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
581
+				'fields'     => apply_filters('give_settings_advanced', array(
582 582
 						array(
583
-							'name' => __( 'Session Control', 'give' ),
583
+							'name' => __('Session Control', 'give'),
584 584
 							'desc' => '',
585 585
 							'id'   => 'give_title_session_control_1',
586 586
 							'type' => 'give_title'
587 587
 						),
588 588
 						array(
589 589
 							'id'      => 'session_lifetime',
590
-							'name'    => __( 'Session Lifetime', 'give' ),
591
-							'desc'    => __( 'Give will start a new session per user once they have donated. This option controls the lifetime a user\'s session is kept alive. An active session allows users to view donation receipts on your site without having to be logged in.', 'give' ),
590
+							'name'    => __('Session Lifetime', 'give'),
591
+							'desc'    => __('Give will start a new session per user once they have donated. This option controls the lifetime a user\'s session is kept alive. An active session allows users to view donation receipts on your site without having to be logged in.', 'give'),
592 592
 							'type'    => 'select',
593 593
 							'options' => array(
594
-								'86400'  => __( '24 Hours', 'give' ),
595
-								'172800' => __( '48 Hours', 'give' ),
596
-								'259200' => __( '72 Hours', 'give' ),
597
-								'604800' => __( '1 Week', 'give' ),
594
+								'86400'  => __('24 Hours', 'give'),
595
+								'172800' => __('48 Hours', 'give'),
596
+								'259200' => __('72 Hours', 'give'),
597
+								'604800' => __('1 Week', 'give'),
598 598
 							)
599 599
 						),
600 600
 						array(
601
-							'name' => __( 'Data Control', 'give' ),
601
+							'name' => __('Data Control', 'give'),
602 602
 							'desc' => '',
603 603
 							'id'   => 'give_title_data_control_2',
604 604
 							'type' => 'give_title'
605 605
 						),
606 606
 						array(
607
-							'name' => __( 'Remove All Data on Uninstall?', 'give' ),
608
-							'desc' => __( 'Check this box if you would like Give to completely remove all of its data when the plugin is deleted.', 'give' ),
607
+							'name' => __('Remove All Data on Uninstall?', 'give'),
608
+							'desc' => __('Check this box if you would like Give to completely remove all of its data when the plugin is deleted.', 'give'),
609 609
 							'id'   => 'uninstall_on_delete',
610 610
 							'type' => 'checkbox'
611 611
 						),
612 612
 						array(
613
-							'name' => __( 'Filter Control', 'give' ),
613
+							'name' => __('Filter Control', 'give'),
614 614
 							'desc' => '',
615 615
 							'id'   => 'give_title_filter_control',
616 616
 							'type' => 'give_title'
617 617
 						),
618 618
 						array(
619
-							'name' => __( 'Disable <code>the_content</code> filter', 'give' ),
620
-							'desc' => sprintf( __( 'If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%s" target="_blank">Learn more</a> about the_content filter.', 'give' ), esc_url( 'https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content' ) ),
619
+							'name' => __('Disable <code>the_content</code> filter', 'give'),
620
+							'desc' => sprintf(__('If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%s" target="_blank">Learn more</a> about the_content filter.', 'give'), esc_url('https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content')),
621 621
 							'id'   => 'disable_the_content_filter',
622 622
 							'type' => 'checkbox'
623 623
 						),
624 624
 						array(
625
-							'name' => __( 'Script Loading', 'give' ),
625
+							'name' => __('Script Loading', 'give'),
626 626
 							'desc' => '',
627 627
 							'id'   => 'give_title_script_control',
628 628
 							'type' => 'give_title'
629 629
 						),
630 630
 						array(
631
-							'name' => __( 'Load Scripts in Footer?', 'give' ),
632
-							'desc' => __( 'Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give' ),
631
+							'name' => __('Load Scripts in Footer?', 'give'),
632
+							'desc' => __('Check this box if you would like Give to load all frontend JavaScript files in the footer.', 'give'),
633 633
 							'id'   => 'scripts_footer',
634 634
 							'type' => 'checkbox'
635 635
 						)
@@ -639,13 +639,13 @@  discard block
 block discarded – undo
639 639
 			/** API Settings */
640 640
 			'api'         => array(
641 641
 				'id'         => 'options_page',
642
-				'give_title' => __( 'API', 'give' ),
643
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
642
+				'give_title' => __('API', 'give'),
643
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
644 644
 				'show_names' => false, // Hide field names on the left
645
-				'fields'     => apply_filters( 'give_settings_system', array(
645
+				'fields'     => apply_filters('give_settings_system', array(
646 646
 						array(
647 647
 							'id'   => 'api',
648
-							'name' => __( 'API', 'give' ),
648
+							'name' => __('API', 'give'),
649 649
 							'type' => 'api'
650 650
 						)
651 651
 					)
@@ -654,13 +654,13 @@  discard block
 block discarded – undo
654 654
 			/** Licenses Settings */
655 655
 			'system_info' => array(
656 656
 				'id'         => 'options_page',
657
-				'give_title' => __( 'System Info', 'give' ),
658
-				'show_on'    => array( 'key' => 'options-page', 'value' => array( $this->key, ), ),
659
-				'fields'     => apply_filters( 'give_settings_system', array(
657
+				'give_title' => __('System Info', 'give'),
658
+				'show_on'    => array('key' => 'options-page', 'value' => array($this->key,),),
659
+				'fields'     => apply_filters('give_settings_system', array(
660 660
 						array(
661 661
 							'id'   => 'system_info',
662
-							'name' => __( 'System Info', 'give' ),
663
-							'desc' => __( 'Please copy and paste this information in your ticket when contacting support.', 'give' ),
662
+							'name' => __('System Info', 'give'),
663
+							'desc' => __('Please copy and paste this information in your ticket when contacting support.', 'give'),
664 664
 							'type' => 'system_info'
665 665
 						)
666 666
 					)
@@ -669,12 +669,12 @@  discard block
 block discarded – undo
669 669
 		);
670 670
 
671 671
 		//Return all settings array if necessary
672
-		if ( $active_tab === null || ! isset( $give_settings[ $active_tab ] ) ) {
673
-			return apply_filters( 'give_registered_settings', $give_settings );
672
+		if ($active_tab === null || ! isset($give_settings[$active_tab])) {
673
+			return apply_filters('give_registered_settings', $give_settings);
674 674
 		}
675 675
 
676 676
 		// Add other tabs and settings fields as needed
677
-		return apply_filters( 'give_registered_settings', $give_settings[ $active_tab ] );
677
+		return apply_filters('give_registered_settings', $give_settings[$active_tab]);
678 678
 
679 679
 	}
680 680
 
@@ -687,11 +687,11 @@  discard block
 block discarded – undo
687 687
 	 */
688 688
 	public function settings_notices() {
689 689
 
690
-		if ( ! isset( $_POST['give_settings_saved'] ) ) {
690
+		if ( ! isset($_POST['give_settings_saved'])) {
691 691
 			return;
692 692
 		}
693 693
 
694
-		add_settings_error( 'give-notices', 'global-settings-updated', __( 'Settings updated.', 'give' ), 'updated' );
694
+		add_settings_error('give-notices', 'global-settings-updated', __('Settings updated.', 'give'), 'updated');
695 695
 
696 696
 	}
697 697
 
@@ -705,17 +705,17 @@  discard block
 block discarded – undo
705 705
 	 *
706 706
 	 * @return mixed          Field value or exception is thrown
707 707
 	 */
708
-	public function __get( $field ) {
708
+	public function __get($field) {
709 709
 
710 710
 		// Allowed fields to retrieve
711
-		if ( in_array( $field, array( 'key', 'fields', 'give_title', 'options_page' ), true ) ) {
711
+		if (in_array($field, array('key', 'fields', 'give_title', 'options_page'), true)) {
712 712
 			return $this->{$field};
713 713
 		}
714
-		if ( 'option_metabox' === $field ) {
714
+		if ('option_metabox' === $field) {
715 715
 			return $this->option_metabox();
716 716
 		}
717 717
 
718
-		throw new Exception( 'Invalid property: ' . $field );
718
+		throw new Exception('Invalid property: '.$field);
719 719
 	}
720 720
 
721 721
 
@@ -732,12 +732,12 @@  discard block
 block discarded – undo
732 732
  *
733 733
  * @return mixed        Option value
734 734
  */
735
-function give_get_option( $key = '', $default = false ) {
735
+function give_get_option($key = '', $default = false) {
736 736
 	global $give_options;
737
-	$value = ! empty( $give_options[ $key ] ) ? $give_options[ $key ] : $default;
738
-	$value = apply_filters( 'give_get_option', $value, $key, $default );
737
+	$value = ! empty($give_options[$key]) ? $give_options[$key] : $default;
738
+	$value = apply_filters('give_get_option', $value, $key, $default);
739 739
 
740
-	return apply_filters( 'give_get_option_' . $key, $value, $key, $default );
740
+	return apply_filters('give_get_option_'.$key, $value, $key, $default);
741 741
 }
742 742
 
743 743
 
@@ -755,33 +755,33 @@  discard block
 block discarded – undo
755 755
  *
756 756
  * @return boolean True if updated, false if not.
757 757
  */
758
-function give_update_option( $key = '', $value = false ) {
758
+function give_update_option($key = '', $value = false) {
759 759
 
760 760
 	// If no key, exit
761
-	if ( empty( $key ) ) {
761
+	if (empty($key)) {
762 762
 		return false;
763 763
 	}
764 764
 
765
-	if ( empty( $value ) ) {
766
-		$remove_option = give_delete_option( $key );
765
+	if (empty($value)) {
766
+		$remove_option = give_delete_option($key);
767 767
 
768 768
 		return $remove_option;
769 769
 	}
770 770
 
771 771
 	// First let's grab the current settings
772
-	$options = get_option( 'give_settings' );
772
+	$options = get_option('give_settings');
773 773
 
774 774
 	// Let's let devs alter that value coming in
775
-	$value = apply_filters( 'give_update_option', $value, $key );
775
+	$value = apply_filters('give_update_option', $value, $key);
776 776
 
777 777
 	// Next let's try to update the value
778
-	$options[ $key ] = $value;
779
-	$did_update      = update_option( 'give_settings', $options );
778
+	$options[$key] = $value;
779
+	$did_update      = update_option('give_settings', $options);
780 780
 
781 781
 	// If it updated, let's update the global variable
782
-	if ( $did_update ) {
782
+	if ($did_update) {
783 783
 		global $give_options;
784
-		$give_options[ $key ] = $value;
784
+		$give_options[$key] = $value;
785 785
 	}
786 786
 
787 787
 	return $did_update;
@@ -798,27 +798,27 @@  discard block
 block discarded – undo
798 798
  *
799 799
  * @return boolean True if updated, false if not.
800 800
  */
801
-function give_delete_option( $key = '' ) {
801
+function give_delete_option($key = '') {
802 802
 
803 803
 	// If no key, exit
804
-	if ( empty( $key ) ) {
804
+	if (empty($key)) {
805 805
 		return false;
806 806
 	}
807 807
 
808 808
 	// First let's grab the current settings
809
-	$options = get_option( 'give_settings' );
809
+	$options = get_option('give_settings');
810 810
 
811 811
 	// Next let's try to update the value
812
-	if ( isset( $options[ $key ] ) ) {
812
+	if (isset($options[$key])) {
813 813
 
814
-		unset( $options[ $key ] );
814
+		unset($options[$key]);
815 815
 
816 816
 	}
817 817
 
818
-	$did_update = update_option( 'give_settings', $options );
818
+	$did_update = update_option('give_settings', $options);
819 819
 
820 820
 	// If it updated, let's update the global variable
821
-	if ( $did_update ) {
821
+	if ($did_update) {
822 822
 		global $give_options;
823 823
 		$give_options = $options;
824 824
 	}
@@ -837,9 +837,9 @@  discard block
 block discarded – undo
837 837
  */
838 838
 function give_get_settings() {
839 839
 
840
-	$settings = get_option( 'give_settings' );
840
+	$settings = get_option('give_settings');
841 841
 
842
-	return (array) apply_filters( 'give_get_settings', $settings );
842
+	return (array) apply_filters('give_get_settings', $settings);
843 843
 
844 844
 }
845 845
 
@@ -857,25 +857,25 @@  discard block
 block discarded – undo
857 857
  *
858 858
  * @return array
859 859
  */
860
-function give_settings_array_insert( $array, $position, $insert ) {
861
-	if ( is_int( $position ) ) {
862
-		array_splice( $array, $position, 0, $insert );
860
+function give_settings_array_insert($array, $position, $insert) {
861
+	if (is_int($position)) {
862
+		array_splice($array, $position, 0, $insert);
863 863
 	} else {
864 864
 
865
-		foreach ( $array as $index => $subarray ) {
866
-			if ( isset( $subarray['id'] ) && $subarray['id'] == $position ) {
865
+		foreach ($array as $index => $subarray) {
866
+			if (isset($subarray['id']) && $subarray['id'] == $position) {
867 867
 				$pos = $index;
868 868
 			}
869 869
 		}
870 870
 
871
-		if ( ! isset( $pos ) ) {
871
+		if ( ! isset($pos)) {
872 872
 			return $array;
873 873
 		}
874 874
 
875 875
 		$array = array_merge(
876
-			array_slice( $array, 0, $pos ),
876
+			array_slice($array, 0, $pos),
877 877
 			$insert,
878
-			array_slice( $array, $pos )
878
+			array_slice($array, $pos)
879 879
 		);
880 880
 	}
881 881
 
@@ -898,7 +898,7 @@  discard block
 block discarded – undo
898 898
  *
899 899
  * @return void
900 900
  */
901
-function give_enabled_gateways_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
901
+function give_enabled_gateways_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
902 902
 
903 903
 	$id                = $field_type_object->field->args['id'];
904 904
 	$field_description = $field_type_object->field->args['desc'];
@@ -906,21 +906,21 @@  discard block
 block discarded – undo
906 906
 
907 907
 	echo '<ul class="cmb2-checkbox-list cmb2-list">';
908 908
 
909
-	foreach ( $gateways as $key => $option ) :
909
+	foreach ($gateways as $key => $option) :
910 910
 
911
-		if ( is_array( $escaped_value ) && array_key_exists( $key, $escaped_value ) ) {
911
+		if (is_array($escaped_value) && array_key_exists($key, $escaped_value)) {
912 912
 			$enabled = '1';
913 913
 		} else {
914 914
 			$enabled = null;
915 915
 		}
916 916
 
917
-		echo '<li><input name="' . $id . '[' . $key . ']" id="' . $id . '[' . $key . ']" type="checkbox" value="1" ' . checked( '1', $enabled, false ) . '/>&nbsp;';
918
-		echo '<label for="' . $id . '[' . $key . ']">' . $option['admin_label'] . '</label></li>';
917
+		echo '<li><input name="'.$id.'['.$key.']" id="'.$id.'['.$key.']" type="checkbox" value="1" '.checked('1', $enabled, false).'/>&nbsp;';
918
+		echo '<label for="'.$id.'['.$key.']">'.$option['admin_label'].'</label></li>';
919 919
 
920 920
 	endforeach;
921 921
 
922
-	if ( $field_description ) {
923
-		echo '<p class="cmb2-metabox-description">' . $field_description . '</p>';
922
+	if ($field_description) {
923
+		echo '<p class="cmb2-metabox-description">'.$field_description.'</p>';
924 924
 	}
925 925
 
926 926
 	echo '</ul>';
@@ -939,31 +939,31 @@  discard block
 block discarded – undo
939 939
  *
940 940
  * @return void
941 941
  */
942
-function give_default_gateway_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
942
+function give_default_gateway_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
943 943
 
944 944
 	$id                = $field_type_object->field->args['id'];
945 945
 	$field_description = $field_type_object->field->args['desc'];
946 946
 	$gateways          = give_get_enabled_payment_gateways();
947 947
 
948
-	echo '<select class="cmb2_select" name="' . $id . '" id="' . $id . '">';
948
+	echo '<select class="cmb2_select" name="'.$id.'" id="'.$id.'">';
949 949
 
950 950
 	//Add a field to the Give Form admin single post view of this field
951
-	if ( $field_type_object->field->object_type === 'post' ) {
952
-		echo '<option value="global">' . __( 'Global Default', 'give' ) . '</option>';
951
+	if ($field_type_object->field->object_type === 'post') {
952
+		echo '<option value="global">'.__('Global Default', 'give').'</option>';
953 953
 	}
954 954
 
955
-	foreach ( $gateways as $key => $option ) :
955
+	foreach ($gateways as $key => $option) :
956 956
 
957
-		$selected = isset( $escaped_value ) ? selected( $key, $escaped_value, false ) : '';
957
+		$selected = isset($escaped_value) ? selected($key, $escaped_value, false) : '';
958 958
 
959 959
 
960
-		echo '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option['admin_label'] ) . '</option>';
960
+		echo '<option value="'.esc_attr($key).'"'.$selected.'>'.esc_html($option['admin_label']).'</option>';
961 961
 
962 962
 	endforeach;
963 963
 
964 964
 	echo '</select>';
965 965
 
966
-	echo '<p class="cmb2-metabox-description">' . $field_description . '</p>';
966
+	echo '<p class="cmb2-metabox-description">'.$field_description.'</p>';
967 967
 
968 968
 }
969 969
 
@@ -978,13 +978,13 @@  discard block
 block discarded – undo
978 978
  *
979 979
  * @return void
980 980
  */
981
-function give_title_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
981
+function give_title_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
982 982
 
983 983
 	$id                = $field_type_object->field->args['id'];
984 984
 	$title             = $field_type_object->field->args['name'];
985 985
 	$field_description = $field_type_object->field->args['desc'];
986 986
 
987
-	echo '<hr>' . $field_description;
987
+	echo '<hr>'.$field_description;
988 988
 
989 989
 }
990 990
 
@@ -999,7 +999,7 @@  discard block
 block discarded – undo
999 999
  *
1000 1000
  * @return void
1001 1001
  */
1002
-function give_description_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1002
+function give_description_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1003 1003
 
1004 1004
 	$id                = $field_type_object->field->args['id'];
1005 1005
 	$title             = $field_type_object->field->args['name'];
@@ -1019,25 +1019,25 @@  discard block
 block discarded – undo
1019 1019
  * @see: https://github.com/WebDevStudios/CMB2/wiki/Adding-your-own-field-types
1020 1020
  * @return array An array of options that matches the CMB2 options array
1021 1021
  */
1022
-function give_cmb2_get_post_options( $query_args, $force = false ) {
1022
+function give_cmb2_get_post_options($query_args, $force = false) {
1023 1023
 
1024
-	$post_options = array( '' => '' ); // Blank option
1024
+	$post_options = array('' => ''); // Blank option
1025 1025
 
1026
-	if ( ( ! isset( $_GET['page'] ) || 'give-settings' != $_GET['page'] ) && ! $force ) {
1026
+	if (( ! isset($_GET['page']) || 'give-settings' != $_GET['page']) && ! $force) {
1027 1027
 		return $post_options;
1028 1028
 	}
1029 1029
 
1030
-	$args = wp_parse_args( $query_args, array(
1030
+	$args = wp_parse_args($query_args, array(
1031 1031
 		'post_type'   => 'page',
1032 1032
 		'numberposts' => 10,
1033
-	) );
1033
+	));
1034 1034
 
1035
-	$posts = get_posts( $args );
1035
+	$posts = get_posts($args);
1036 1036
 
1037
-	if ( $posts ) {
1038
-		foreach ( $posts as $post ) {
1037
+	if ($posts) {
1038
+		foreach ($posts as $post) {
1039 1039
 
1040
-			$post_options[ $post->ID ] = $post->post_title;
1040
+			$post_options[$post->ID] = $post->post_title;
1041 1041
 
1042 1042
 		}
1043 1043
 	}
@@ -1054,14 +1054,14 @@  discard block
 block discarded – undo
1054 1054
  * @since 1.0
1055 1055
  */
1056 1056
 
1057
-add_filter( 'cmb2_get_metabox_form_format', 'give_modify_cmb2_form_output', 10, 3 );
1057
+add_filter('cmb2_get_metabox_form_format', 'give_modify_cmb2_form_output', 10, 3);
1058 1058
 
1059
-function give_modify_cmb2_form_output( $form_format, $object_id, $cmb ) {
1059
+function give_modify_cmb2_form_output($form_format, $object_id, $cmb) {
1060 1060
 
1061 1061
 	//only modify the give settings form
1062
-	if ( 'give_settings' == $object_id && 'options_page' == $cmb->cmb_id ) {
1062
+	if ('give_settings' == $object_id && 'options_page' == $cmb->cmb_id) {
1063 1063
 
1064
-		return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="' . __( 'Save Settings', 'give' ) . '" class="button-primary"></div></form>';
1064
+		return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="give_settings_saved" value="true"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="give-submit-wrap"><input type="submit" name="submit-cmb" value="'.__('Save Settings', 'give').'" class="button-primary"></div></form>';
1065 1065
 	}
1066 1066
 
1067 1067
 	return $form_format;
@@ -1079,35 +1079,35 @@  discard block
 block discarded – undo
1079 1079
  *
1080 1080
  * @return void
1081 1081
  */
1082
-if ( ! function_exists( 'give_license_key_callback' ) ) {
1083
-	function give_license_key_callback( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
1082
+if ( ! function_exists('give_license_key_callback')) {
1083
+	function give_license_key_callback($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
1084 1084
 
1085 1085
 		$id                = $field_type_object->field->args['id'];
1086 1086
 		$field_description = $field_type_object->field->args['desc'];
1087
-		$license_status    = get_option( $field_type_object->field->args['options']['is_valid_license_option'] );
1087
+		$license_status    = get_option($field_type_object->field->args['options']['is_valid_license_option']);
1088 1088
 		$field_classes     = 'regular-text give-license-field';
1089
-		$type              = empty( $escaped_value ) ? 'text' : 'password';
1089
+		$type              = empty($escaped_value) ? 'text' : 'password';
1090 1090
 
1091
-		if ( $license_status === 'valid' ) {
1091
+		if ($license_status === 'valid') {
1092 1092
 			$field_classes .= ' give-license-active';
1093 1093
 		}
1094 1094
 
1095
-		$html = $field_type_object->input( array(
1095
+		$html = $field_type_object->input(array(
1096 1096
 			'class' => $field_classes,
1097 1097
 			'type'  => $type
1098
-		) );
1098
+		));
1099 1099
 
1100 1100
 		//License is active so show deactivate button
1101
-		if ( $license_status === 'valid' ) {
1102
-			$html .= '<input type="submit" class="button-secondary give-license-deactivate" name="' . $id . '_deactivate" value="' . __( 'Deactivate License', 'give' ) . '"/>';
1101
+		if ($license_status === 'valid') {
1102
+			$html .= '<input type="submit" class="button-secondary give-license-deactivate" name="'.$id.'_deactivate" value="'.__('Deactivate License', 'give').'"/>';
1103 1103
 		} else {
1104 1104
 			//This license is not valid so delete it
1105
-			give_delete_option( $id );
1105
+			give_delete_option($id);
1106 1106
 		}
1107 1107
 
1108
-		$html .= '<label for="give_settings[' . $id . ']"> ' . $field_description . '</label>';
1108
+		$html .= '<label for="give_settings['.$id.']"> '.$field_description.'</label>';
1109 1109
 
1110
-		wp_nonce_field( $id . '-nonce', $id . '-nonce' );
1110
+		wp_nonce_field($id.'-nonce', $id.'-nonce');
1111 1111
 
1112 1112
 		echo $html;
1113 1113
 	}
@@ -1122,13 +1122,13 @@  discard block
 block discarded – undo
1122 1122
  */
1123 1123
 function give_api_callback() {
1124 1124
 
1125
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
1125
+	if ( ! current_user_can('manage_give_settings')) {
1126 1126
 		return;
1127 1127
 	}
1128 1128
 
1129
-	do_action( 'give_tools_api_keys_before' );
1129
+	do_action('give_tools_api_keys_before');
1130 1130
 
1131
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
1131
+	require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php';
1132 1132
 
1133 1133
 	$api_keys_table = new Give_API_Keys_Table();
1134 1134
 	$api_keys_table->prepare_items();
@@ -1136,7 +1136,7 @@  discard block
 block discarded – undo
1136 1136
 	?>
1137 1137
 	<p>
1138 1138
 		<?php printf(
1139
-			__( 'API keys allow users to use the <a href="%s">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%s">Zapier</a>.', 'give' ),
1139
+			__('API keys allow users to use the <a href="%s">Give REST API</a> to retrieve donation data in JSON or XML for external applications or devices, such as <a href="%s">Zapier</a>.', 'give'),
1140 1140
 			'https://givewp.com/documentation/give-api-reference/',
1141 1141
 			'https://givewp.com/addons/zapier/'
1142 1142
 		); ?>
@@ -1149,10 +1149,10 @@  discard block
 block discarded – undo
1149 1149
 	</style>
1150 1150
 	<?php
1151 1151
 
1152
-	do_action( 'give_tools_api_keys_after' );
1152
+	do_action('give_tools_api_keys_after');
1153 1153
 }
1154 1154
 
1155
-add_action( 'give_settings_tab_api_keys', 'give_api_callback' );
1155
+add_action('give_settings_tab_api_keys', 'give_api_callback');
1156 1156
 
1157 1157
 /**
1158 1158
  * Hook Callback
@@ -1165,8 +1165,8 @@  discard block
 block discarded – undo
1165 1165
  *
1166 1166
  * @return void
1167 1167
  */
1168
-function give_hook_callback( $args ) {
1169
-	do_action( 'give_' . $args['id'] );
1168
+function give_hook_callback($args) {
1169
+	do_action('give_'.$args['id']);
1170 1170
 }
1171 1171
 
1172 1172
 /**
@@ -1176,10 +1176,10 @@  discard block
 block discarded – undo
1176 1176
  *
1177 1177
  */
1178 1178
 
1179
-if ( file_exists( WP_PLUGIN_DIR . '/cmb2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) {
1180
-	require_once WP_PLUGIN_DIR . '/cmb2/init.php';
1181
-} elseif ( file_exists( GIVE_PLUGIN_DIR . '/includes/libraries/cmb2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) {
1182
-	require_once GIVE_PLUGIN_DIR . '/includes/libraries/cmb2/init.php';
1183
-} elseif ( file_exists( GIVE_PLUGIN_DIR . '/includes/libraries/CMB2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) {
1184
-	require_once GIVE_PLUGIN_DIR . '/includes/libraries/CMB2/init.php';
1179
+if (file_exists(WP_PLUGIN_DIR.'/cmb2/init.php') && ! defined('CMB2_LOADED')) {
1180
+	require_once WP_PLUGIN_DIR.'/cmb2/init.php';
1181
+} elseif (file_exists(GIVE_PLUGIN_DIR.'/includes/libraries/cmb2/init.php') && ! defined('CMB2_LOADED')) {
1182
+	require_once GIVE_PLUGIN_DIR.'/includes/libraries/cmb2/init.php';
1183
+} elseif (file_exists(GIVE_PLUGIN_DIR.'/includes/libraries/CMB2/init.php') && ! defined('CMB2_LOADED')) {
1184
+	require_once GIVE_PLUGIN_DIR.'/includes/libraries/CMB2/init.php';
1185 1185
 }
1186 1186
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/reporting/class-api-requests-logs-list-table.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@
 block discarded – undo
157 157
 	 *
158 158
 	 * @access public
159 159
 	 * @since  1.0
160
-	 * @return mixed String if search is present, false otherwise
160
+	 * @return string|false String if search is present, false otherwise
161 161
 	 */
162 162
 	public function get_search() {
163 163
 		return ! empty( $_GET['s'] ) ? urldecode( trim( $_GET['s'] ) ) : false;
Please login to merge, or discard this patch.
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
17 17
 // Load WP_List_Table if not loaded
18
-if ( ! class_exists( 'WP_List_Table' ) ) {
19
-	require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
18
+if ( ! class_exists('WP_List_Table')) {
19
+	require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php';
20 20
 }
21 21
 
22 22
 /**
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
 		global $status, $page;
46 46
 
47 47
 		// Set parent defaults
48
-		parent::__construct( array(
49
-			'singular' => give_get_forms_label_singular(),    // Singular name of the listed records
50
-			'plural'   => give_get_forms_label_plural(),        // Plural name of the listed records
48
+		parent::__construct(array(
49
+			'singular' => give_get_forms_label_singular(), // Singular name of the listed records
50
+			'plural'   => give_get_forms_label_plural(), // Plural name of the listed records
51 51
 			'ajax'     => false                        // Does this table support ajax?
52
-		) );
52
+		));
53 53
 	}
54 54
 
55 55
 	/**
@@ -63,20 +63,20 @@  discard block
 block discarded – undo
63 63
 	 *
64 64
 	 * @return void
65 65
 	 */
66
-	public function search_box( $text, $input_id ) {
67
-		$input_id = $input_id . '-search-input';
66
+	public function search_box($text, $input_id) {
67
+		$input_id = $input_id.'-search-input';
68 68
 
69
-		if ( ! empty( $_REQUEST['orderby'] ) ) {
70
-			echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
69
+		if ( ! empty($_REQUEST['orderby'])) {
70
+			echo '<input type="hidden" name="orderby" value="'.esc_attr($_REQUEST['orderby']).'" />';
71 71
 		}
72
-		if ( ! empty( $_REQUEST['order'] ) ) {
73
-			echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
72
+		if ( ! empty($_REQUEST['order'])) {
73
+			echo '<input type="hidden" name="order" value="'.esc_attr($_REQUEST['order']).'" />';
74 74
 		}
75 75
 		?>
76 76
 		<p class="search-box">
77 77
 			<label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
78 78
 			<input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />
79
-			<?php submit_button( $text, 'button', false, false, array( 'ID' => 'search-submit' ) ); ?>
79
+			<?php submit_button($text, 'button', false, false, array('ID' => 'search-submit')); ?>
80 80
 		</p>
81 81
 	<?php
82 82
 	}
@@ -90,10 +90,10 @@  discard block
 block discarded – undo
90 90
 	 */
91 91
 	public function get_columns() {
92 92
 		$columns = array(
93
-			'ID'      => __( 'Log ID', 'give' ),
94
-			'details' => __( 'Request Details', 'give' ),
95
-			'ip'      => __( 'Request IP', 'give' ),
96
-			'date'    => __( 'Date', 'give' )
93
+			'ID'      => __('Log ID', 'give'),
94
+			'details' => __('Request Details', 'give'),
95
+			'ip'      => __('Request IP', 'give'),
96
+			'date'    => __('Date', 'give')
97 97
 		);
98 98
 
99 99
 		return $columns;
@@ -110,10 +110,10 @@  discard block
 block discarded – undo
110 110
 	 *
111 111
 	 * @return string Column Name
112 112
 	 */
113
-	public function column_default( $item, $column_name ) {
114
-		switch ( $column_name ) {
113
+	public function column_default($item, $column_name) {
114
+		switch ($column_name) {
115 115
 			default:
116
-				return $item[ $column_name ];
116
+				return $item[$column_name];
117 117
 		}
118 118
 	}
119 119
 
@@ -127,26 +127,26 @@  discard block
 block discarded – undo
127 127
 	 *
128 128
 	 * @return void
129 129
 	 */
130
-	public function column_details( $item ) {
130
+	public function column_details($item) {
131 131
 		?>
132
-		<a href="#TB_inline?width=640&amp;inlineId=log-details-<?php echo $item['ID']; ?>" class="thickbox" title="<?php _e( 'View Request Details', 'give' ); ?> "><?php _e( 'View Request', 'give' ); ?></a>
132
+		<a href="#TB_inline?width=640&amp;inlineId=log-details-<?php echo $item['ID']; ?>" class="thickbox" title="<?php _e('View Request Details', 'give'); ?> "><?php _e('View Request', 'give'); ?></a>
133 133
 		<div id="log-details-<?php echo $item['ID']; ?>" style="display:none;">
134 134
 			<?php
135 135
 
136
-			$request = get_post_field( 'post_excerpt', $item['ID'] );
137
-			$error   = get_post_field( 'post_content', $item['ID'] );
138
-			echo '<p><strong>' . __( 'API Request:', 'give' ) . '</strong></p>';
139
-			echo '<div>' . $request . '</div>';
140
-			if ( ! empty( $error ) ) {
141
-				echo '<p><strong>' . __( 'Error', 'give' ) . '</strong></p>';
142
-				echo '<div>' . esc_html( $error ) . '</div>';
136
+			$request = get_post_field('post_excerpt', $item['ID']);
137
+			$error   = get_post_field('post_content', $item['ID']);
138
+			echo '<p><strong>'.__('API Request:', 'give').'</strong></p>';
139
+			echo '<div>'.$request.'</div>';
140
+			if ( ! empty($error)) {
141
+				echo '<p><strong>'.__('Error', 'give').'</strong></p>';
142
+				echo '<div>'.esc_html($error).'</div>';
143 143
 			}
144
-			echo '<p><strong>' . __( 'API User:', 'give' ) . '</strong></p>';
145
-			echo '<div>' . get_post_meta( $item['ID'], '_give_log_user', true ) . '</div>';
146
-			echo '<p><strong>' . __( 'API Key:', 'give' ) . '</strong></p>';
147
-			echo '<div>' . get_post_meta( $item['ID'], '_give_log_key', true ) . '</div>';
148
-			echo '<p><strong>' . __( 'Request Date:', 'give' ) . '</strong></p>';
149
-			echo '<div>' . get_post_field( 'post_date', $item['ID'] ) . '</div>';
144
+			echo '<p><strong>'.__('API User:', 'give').'</strong></p>';
145
+			echo '<div>'.get_post_meta($item['ID'], '_give_log_user', true).'</div>';
146
+			echo '<p><strong>'.__('API Key:', 'give').'</strong></p>';
147
+			echo '<div>'.get_post_meta($item['ID'], '_give_log_key', true).'</div>';
148
+			echo '<p><strong>'.__('Request Date:', 'give').'</strong></p>';
149
+			echo '<div>'.get_post_field('post_date', $item['ID']).'</div>';
150 150
 			?>
151 151
 		</div>
152 152
 	<?php
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 	 * @return mixed String if search is present, false otherwise
161 161
 	 */
162 162
 	public function get_search() {
163
-		return ! empty( $_GET['s'] ) ? urldecode( trim( $_GET['s'] ) ) : false;
163
+		return ! empty($_GET['s']) ? urldecode(trim($_GET['s'])) : false;
164 164
 	}
165 165
 
166 166
 	/**
@@ -177,31 +177,31 @@  discard block
 block discarded – undo
177 177
 
178 178
 		$search = $this->get_search();
179 179
 
180
-		if ( $search ) {
181
-			if ( filter_var( $search, FILTER_VALIDATE_IP ) ) {
180
+		if ($search) {
181
+			if (filter_var($search, FILTER_VALIDATE_IP)) {
182 182
 				// This is an IP address search
183 183
 				$key = '_give_log_request_ip';
184
-			} else if ( is_email( $search ) ) {
184
+			} else if (is_email($search)) {
185 185
 				// This is an email search
186
-				$userdata = get_user_by( 'email', $search );
186
+				$userdata = get_user_by('email', $search);
187 187
 
188
-				if ( $userdata ) {
188
+				if ($userdata) {
189 189
 					$search = $userdata->ID;
190 190
 				}
191 191
 
192 192
 				$key = '_give_log_user';
193
-			} elseif ( strlen( $search ) == 32 ) {
193
+			} elseif (strlen($search) == 32) {
194 194
 				// Look for an API key
195 195
 				$key = '_give_log_key';
196
-			} elseif ( stristr( $search, 'token:' ) ) {
196
+			} elseif (stristr($search, 'token:')) {
197 197
 				// Look for an API token
198
-				$search = str_ireplace( 'token:', '', $search );
198
+				$search = str_ireplace('token:', '', $search);
199 199
 				$key    = '_give_log_token';
200 200
 			} else {
201 201
 				// This is (probably) a user ID search
202
-				$userdata = get_userdata( $search );
202
+				$userdata = get_userdata($search);
203 203
 
204
-				if ( $userdata ) {
204
+				if ($userdata) {
205 205
 					$search = $userdata->ID;
206 206
 				}
207 207
 
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 	 * @return int Current page number
228 228
 	 */
229 229
 	public function get_paged() {
230
-		return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1;
230
+		return isset($_GET['paged']) ? absint($_GET['paged']) : 1;
231 231
 	}
232 232
 
233 233
 	/**
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 	 * @since  1.0
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
 		give_log_views();
243 243
 	}
@@ -261,14 +261,14 @@  discard block
 block discarded – undo
261 261
 			'meta_query' => $this->get_meta_query()
262 262
 		);
263 263
 
264
-		$logs = $give_logs->get_connected_logs( $log_query );
264
+		$logs = $give_logs->get_connected_logs($log_query);
265 265
 
266
-		if ( $logs ) {
267
-			foreach ( $logs as $log ) {
266
+		if ($logs) {
267
+			foreach ($logs as $log) {
268 268
 
269 269
 				$logs_data[] = array(
270 270
 					'ID'   => $log->ID,
271
-					'ip'   => get_post_meta( $log->ID, '_give_log_request_ip', true ),
271
+					'ip'   => get_post_meta($log->ID, '_give_log_request_ip', true),
272 272
 					'date' => $log->post_date
273 273
 				);
274 274
 			}
@@ -296,14 +296,14 @@  discard block
 block discarded – undo
296 296
 		$columns               = $this->get_columns();
297 297
 		$hidden                = array(); // No hidden columns
298 298
 		$sortable              = $this->get_sortable_columns();
299
-		$this->_column_headers = array( $columns, $hidden, $sortable );
299
+		$this->_column_headers = array($columns, $hidden, $sortable);
300 300
 		$this->items           = $this->get_logs();
301
-		$total_items           = $give_logs->get_log_count( 0, 'api_requests' );
301
+		$total_items           = $give_logs->get_log_count(0, 'api_requests');
302 302
 
303
-		$this->set_pagination_args( array(
303
+		$this->set_pagination_args(array(
304 304
 				'total_items' => $total_items,
305 305
 				'per_page'    => $this->per_page,
306
-				'total_pages' => ceil( $total_items / $this->per_page )
306
+				'total_pages' => ceil($total_items / $this->per_page)
307 307
 			)
308 308
 		);
309 309
 	}
Please login to merge, or discard this patch.
includes/admin/reporting/class-sales-logs-list-table.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@
 block discarded – undo
143 143
 	 *
144 144
 	 * @access public
145 145
 	 * @since  1.0
146
-	 * @return mixed string If search is present, false otherwise
146
+	 * @return string|false string If search is present, false otherwise
147 147
 	 */
148 148
 	public function get_search() {
149 149
 		return ! empty( $_GET['s'] ) ? urldecode( trim( $_GET['s'] ) ) : false;
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,8 +71,8 @@
 block discarded – undo
71 71
 
72 72
 			case 'user_id' :
73 73
 				return '<a href="' .
74
-				       admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . ( ! empty( $item['user_id'] ) ? urlencode( $item['user_id'] ) : give_get_payment_user_email( $item['payment_id'] ) ) ) .
75
-				       '">' . $item['user_name'] . '</a>';
74
+					   admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . ( ! empty( $item['user_id'] ) ? urlencode( $item['user_id'] ) : give_get_payment_user_email( $item['payment_id'] ) ) ) .
75
+					   '">' . $item['user_name'] . '</a>';
76 76
 
77 77
 			case 'amount' :
78 78
 				return give_currency_filter( give_format_amount( $item['amount'] ) );
Please login to merge, or discard this patch.
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -9,13 +9,13 @@  discard block
 block discarded – undo
9 9
  */
10 10
 
11 11
 // Exit if accessed directly
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit;
14 14
 }
15 15
 
16 16
 // Load WP_List_Table if not loaded
17
-if ( ! class_exists( 'WP_List_Table' ) ) {
18
-	require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
17
+if ( ! class_exists('WP_List_Table')) {
18
+	require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php';
19 19
 }
20 20
 
21 21
 /**
@@ -44,13 +44,13 @@  discard block
 block discarded – undo
44 44
 		global $status, $page;
45 45
 
46 46
 		// Set parent defaults
47
-		parent::__construct( array(
48
-			'singular' => give_get_forms_label_singular(),    // Singular name of the listed records
49
-			'plural'   => give_get_forms_label_plural(),        // Plural name of the listed records
47
+		parent::__construct(array(
48
+			'singular' => give_get_forms_label_singular(), // Singular name of the listed records
49
+			'plural'   => give_get_forms_label_plural(), // Plural name of the listed records
50 50
 			'ajax'     => false                        // Does this table support ajax?
51
-		) );
51
+		));
52 52
 
53
-		add_action( 'give_log_view_actions', array( $this, 'give_forms_filter' ) );
53
+		add_action('give_log_view_actions', array($this, 'give_forms_filter'));
54 54
 	}
55 55
 
56 56
 	/**
@@ -64,24 +64,24 @@  discard block
 block discarded – undo
64 64
 	 *
65 65
 	 * @return string Column Name
66 66
 	 */
67
-	public function column_default( $item, $column_name ) {
68
-		switch ( $column_name ) {
67
+	public function column_default($item, $column_name) {
68
+		switch ($column_name) {
69 69
 			case 'form' :
70
-				return '<a href="' . esc_url( add_query_arg( 'form', $item[ $column_name ] ) ) . '" >' . get_the_title( $item[ $column_name ] ) . '</a>';
70
+				return '<a href="'.esc_url(add_query_arg('form', $item[$column_name])).'" >'.get_the_title($item[$column_name]).'</a>';
71 71
 
72 72
 			case 'user_id' :
73
-				return '<a href="' .
74
-				       admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . ( ! empty( $item['user_id'] ) ? urlencode( $item['user_id'] ) : give_get_payment_user_email( $item['payment_id'] ) ) ) .
75
-				       '">' . $item['user_name'] . '</a>';
73
+				return '<a href="'.
74
+				       admin_url('edit.php?post_type=give_forms&page=give-payment-history&user='.( ! empty($item['user_id']) ? urlencode($item['user_id']) : give_get_payment_user_email($item['payment_id']))).
75
+				       '">'.$item['user_name'].'</a>';
76 76
 
77 77
 			case 'amount' :
78
-				return give_currency_filter( give_format_amount( $item['amount'] ) );
78
+				return give_currency_filter(give_format_amount($item['amount']));
79 79
 
80 80
 			case 'payment_id' :
81
-				return '<a href="' . admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id=' . $item['payment_id'] ) . '">' . give_get_payment_number( $item['payment_id'] ) . '</a>';
81
+				return '<a href="'.admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id='.$item['payment_id']).'">'.give_get_payment_number($item['payment_id']).'</a>';
82 82
 
83 83
 			default:
84
-				return $item[ $column_name ];
84
+				return $item[$column_name];
85 85
 		}
86 86
 	}
87 87
 
@@ -94,12 +94,12 @@  discard block
 block discarded – undo
94 94
 	 */
95 95
 	public function get_columns() {
96 96
 		$columns = array(
97
-			'ID'         => __( 'Log ID', 'give' ),
98
-			'user_id'    => __( 'User', 'give' ),
97
+			'ID'         => __('Log ID', 'give'),
98
+			'user_id'    => __('User', 'give'),
99 99
 			'form'       => give_get_forms_label_singular(),
100
-			'amount'     => __( 'Item Amount', 'give' ),
101
-			'payment_id' => __( 'Payment ID', 'give' ),
102
-			'date'       => __( 'Date', 'give' )
100
+			'amount'     => __('Item Amount', 'give'),
101
+			'payment_id' => __('Payment ID', 'give'),
102
+			'date'       => __('Date', 'give')
103 103
 		);
104 104
 
105 105
 		return $columns;
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 	 * @return int Current page number
114 114
 	 */
115 115
 	public function get_paged() {
116
-		return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1;
116
+		return isset($_GET['paged']) ? absint($_GET['paged']) : 1;
117 117
 	}
118 118
 
119 119
 	/**
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	 * @return mixed int If User ID, string If Email/Login
125 125
 	 */
126 126
 	public function get_filtered_user() {
127
-		return isset( $_GET['user'] ) ? absint( $_GET['user'] ) : false;
127
+		return isset($_GET['user']) ? absint($_GET['user']) : false;
128 128
 	}
129 129
 
130 130
 	/**
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 	 * @return int Download ID
136 136
 	 */
137 137
 	public function get_filtered_give_form() {
138
-		return ! empty( $_GET['form'] ) ? absint( $_GET['form'] ) : false;
138
+		return ! empty($_GET['form']) ? absint($_GET['form']) : false;
139 139
 	}
140 140
 
141 141
 	/**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	 * @return mixed string If search is present, false otherwise
147 147
 	 */
148 148
 	public function get_search() {
149
-		return ! empty( $_GET['s'] ) ? urldecode( trim( $_GET['s'] ) ) : false;
149
+		return ! empty($_GET['s']) ? urldecode(trim($_GET['s'])) : false;
150 150
 	}
151 151
 
152 152
 	/**
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 
164 164
 		$meta_query = array();
165 165
 
166
-		if ( $user ) {
166
+		if ($user) {
167 167
 			// Show only logs from a specific user
168 168
 			$meta_query[] = array(
169 169
 				'key'   => '_give_log_user_id',
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
 		}
173 173
 
174 174
 		$search = $this->get_search();
175
-		if ( $search ) {
176
-			if ( is_email( $search ) ) {
175
+		if ($search) {
176
+			if (is_email($search)) {
177 177
 				// This is an email search. We use this to ensure it works for guest users and logged-in users
178 178
 				$key     = '_give_log_user_info';
179 179
 				$compare = 'LIKE';
@@ -182,32 +182,32 @@  discard block
 block discarded – undo
182 182
 				$key     = '_give_log_user_id';
183 183
 				$compare = 'LIKE';
184 184
 
185
-				if ( ! is_numeric( $search ) ) {
185
+				if ( ! is_numeric($search)) {
186 186
 					// Searching for user by username
187
-					$user = get_user_by( 'login', $search );
187
+					$user = get_user_by('login', $search);
188 188
 
189
-					if ( $user ) {
189
+					if ($user) {
190 190
 						// Found one, set meta value to user's ID
191 191
 						$search = $user->ID;
192 192
 					} else {
193 193
 						// No user found so let's do a real search query
194
-						$users = new WP_User_Query( array(
194
+						$users = new WP_User_Query(array(
195 195
 							'search'         => $search,
196
-							'search_columns' => array( 'user_url', 'user_nicename' ),
196
+							'search_columns' => array('user_url', 'user_nicename'),
197 197
 							'number'         => 1,
198 198
 							'fields'         => 'ids'
199
-						) );
199
+						));
200 200
 
201 201
 						$found_user = $users->get_results();
202 202
 
203
-						if ( $found_user ) {
203
+						if ($found_user) {
204 204
 							$search = $found_user[0];
205 205
 						}
206 206
 					}
207 207
 				}
208 208
 			}
209 209
 
210
-			if ( ! $this->file_search ) {
210
+			if ( ! $this->file_search) {
211 211
 				// Meta query only works for non file name searche
212 212
 				$meta_query[] = array(
213 213
 					'key'     => $key,
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 	 * @since  1.0
229 229
 	 * @return void
230 230
 	 */
231
-	function bulk_actions( $which = '' ) {
231
+	function bulk_actions($which = '') {
232 232
 		// These aren't really bulk actions but this outputs the markup in the right place
233 233
 		give_log_views();
234 234
 	}
@@ -241,22 +241,22 @@  discard block
 block discarded – undo
241 241
 	 * @return void
242 242
 	 */
243 243
 	public function give_forms_filter() {
244
-		$give_forms = get_posts( array(
244
+		$give_forms = get_posts(array(
245 245
 			'post_type'              => 'give_forms',
246 246
 			'post_status'            => 'any',
247
-			'posts_per_page'         => - 1,
247
+			'posts_per_page'         => -1,
248 248
 			'orderby'                => 'title',
249 249
 			'order'                  => 'ASC',
250 250
 			'fields'                 => 'ids',
251 251
 			'update_post_meta_cache' => false,
252 252
 			'update_post_term_cache' => false
253
-		) );
253
+		));
254 254
 
255
-		if ( $give_forms ) {
255
+		if ($give_forms) {
256 256
 			echo '<select name="form" id="give-log-form-filter">';
257
-			echo '<option value="0">' . __( 'All', 'give' ) . '</option>';
258
-			foreach ( $give_forms as $form ) {
259
-				echo '<option value="' . $form . '"' . selected( $form, $this->get_filtered_give_form() ) . '>' . esc_html( get_the_title( $form ) ) . '</option>';
257
+			echo '<option value="0">'.__('All', 'give').'</option>';
258
+			foreach ($give_forms as $form) {
259
+				echo '<option value="'.$form.'"'.selected($form, $this->get_filtered_give_form()).'>'.esc_html(get_the_title($form)).'</option>';
260 260
 			}
261 261
 			echo '</select>';
262 262
 		}
@@ -274,11 +274,11 @@  discard block
 block discarded – undo
274 274
 		global $give_logs;
275 275
 
276 276
 		// Prevent the queries from getting cached. Without this there are occasional memory issues for some installs
277
-		wp_suspend_cache_addition( true );
277
+		wp_suspend_cache_addition(true);
278 278
 
279 279
 		$logs_data = array();
280 280
 		$paged     = $this->get_paged();
281
-		$give_form = empty( $_GET['s'] ) ? $this->get_filtered_give_form() : null;
281
+		$give_form = empty($_GET['s']) ? $this->get_filtered_give_form() : null;
282 282
 		$user      = $this->get_filtered_user();
283 283
 
284 284
 		$log_query = array(
@@ -288,26 +288,26 @@  discard block
 block discarded – undo
288 288
 			'meta_query'  => $this->get_meta_query()
289 289
 		);
290 290
 
291
-		$logs = $give_logs->get_connected_logs( $log_query );
291
+		$logs = $give_logs->get_connected_logs($log_query);
292 292
 
293
-		if ( $logs ) {
294
-			foreach ( $logs as $log ) {
295
-				$payment_id = get_post_meta( $log->ID, '_give_log_payment_id', true );
293
+		if ($logs) {
294
+			foreach ($logs as $log) {
295
+				$payment_id = get_post_meta($log->ID, '_give_log_payment_id', true);
296 296
 
297 297
 				// Make sure this payment hasn't been deleted
298
-				if ( get_post( $payment_id ) ) :
299
-					$user_info      = give_get_payment_meta_user_info( $payment_id );
300
-					$payment_meta   = give_get_payment_meta( $payment_id );
301
-					$payment_amount = give_get_payment_amount( $payment_id );
298
+				if (get_post($payment_id)) :
299
+					$user_info      = give_get_payment_meta_user_info($payment_id);
300
+					$payment_meta   = give_get_payment_meta($payment_id);
301
+					$payment_amount = give_get_payment_amount($payment_id);
302 302
 
303 303
 					$logs_data[] = array(
304
-						'ID'         => '<span class="give-item-label give-item-label-gray">' . $log->ID . '</span>',
304
+						'ID'         => '<span class="give-item-label give-item-label-gray">'.$log->ID.'</span>',
305 305
 						'payment_id' => $payment_id,
306 306
 						'form'       => $log->post_parent,
307 307
 						'amount'     => $payment_amount,
308 308
 						'user_id'    => $user_info['id'],
309
-						'user_name'  => $user_info['first_name'] . ' ' . $user_info['last_name'],
310
-						'date'       => get_post_field( 'post_date', $payment_id )
309
+						'user_name'  => $user_info['first_name'].' '.$user_info['last_name'],
310
+						'date'       => get_post_field('post_date', $payment_id)
311 311
 					);
312 312
 
313 313
 				endif;
@@ -336,15 +336,15 @@  discard block
 block discarded – undo
336 336
 		$columns               = $this->get_columns();
337 337
 		$hidden                = array();
338 338
 		$sortable              = $this->get_sortable_columns();
339
-		$this->_column_headers = array( $columns, $hidden, $sortable );
339
+		$this->_column_headers = array($columns, $hidden, $sortable);
340 340
 		$current_page          = $this->get_pagenum();
341 341
 		$this->items           = $this->get_logs();
342
-		$total_items           = $give_logs->get_log_count( $this->get_filtered_give_form(), 'sale', $this->get_meta_query() );
342
+		$total_items           = $give_logs->get_log_count($this->get_filtered_give_form(), 'sale', $this->get_meta_query());
343 343
 
344
-		$this->set_pagination_args( array(
344
+		$this->set_pagination_args(array(
345 345
 				'total_items' => $total_items,
346 346
 				'per_page'    => $this->per_page,
347
-				'total_pages' => ceil( $total_items / $this->per_page )
347
+				'total_pages' => ceil($total_items / $this->per_page)
348 348
 			)
349 349
 		);
350 350
 	}
Please login to merge, or discard this patch.