Completed
Pull Request — master (#1248)
by Devin
17:40
created
includes/admin/payments/payments-history.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -25,12 +25,12 @@  discard block
 block discarded – undo
25 25
 */
26 26
 function give_payment_history_page() {
27 27
 
28
-	$give_payment = get_post_type_object( 'give_payment' );
28
+	$give_payment = get_post_type_object('give_payment');
29 29
 
30
-	if ( isset( $_GET['view'] ) && 'view-order-details' == $_GET['view'] ) {
31
-		require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/view-order-details.php';
30
+	if (isset($_GET['view']) && 'view-order-details' == $_GET['view']) {
31
+		require_once GIVE_PLUGIN_DIR.'includes/admin/payments/view-order-details.php';
32 32
 	} else {
33
-		require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/class-payments-table.php';
33
+		require_once GIVE_PLUGIN_DIR.'includes/admin/payments/class-payments-table.php';
34 34
 		$payments_table = new Give_Payment_History_Table();
35 35
 		$payments_table->prepare_items();
36 36
 	?>
@@ -44,10 +44,10 @@  discard block
 block discarded – undo
44 44
 		 *
45 45
 		 * @since 1.7
46 46
 		 */
47
-		do_action( 'give_payments_page_top' );
47
+		do_action('give_payments_page_top');
48 48
 		?>
49 49
 
50
-		<form id="give-payments-filter" method="get" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); ?>">
50
+		<form id="give-payments-filter" method="get" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history'); ?>">
51 51
 			<input type="hidden" name="post_type" value="give_forms" />
52 52
 			<input type="hidden" name="page" value="give-payment-history" />
53 53
 			<?php $payments_table->views() ?>
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 		 *
62 62
 		 * @since 1.7
63 63
 		 */
64
-		do_action( 'give_payments_page_bottom' );
64
+		do_action('give_payments_page_bottom');
65 65
 		?>
66 66
 
67 67
 	</div>
@@ -78,29 +78,29 @@  discard block
 block discarded – undo
78 78
  * @param $title
79 79
  * @return string
80 80
  */
81
-function give_view_order_details_title( $admin_title, $title ) {
81
+function give_view_order_details_title($admin_title, $title) {
82 82
 
83
-	if ( 'give_forms_page_give-payment-history' != get_current_screen()->base ) {
83
+	if ('give_forms_page_give-payment-history' != get_current_screen()->base) {
84 84
 		return $admin_title;
85 85
 	}
86 86
 
87
-	if( ! isset( $_GET['give-action'] ) ) {
87
+	if ( ! isset($_GET['give-action'])) {
88 88
 		return $admin_title;
89 89
 	}
90 90
 
91
-	switch( $_GET['give-action'] ) :
91
+	switch ($_GET['give-action']) :
92 92
 
93 93
 		case 'view-order-details' :
94 94
 			$title = sprintf(
95 95
 				/* translators: %s: admin title */
96
-				esc_html__( 'View Donation Details - %s', 'give' ),
96
+				esc_html__('View Donation Details - %s', 'give'),
97 97
 				$admin_title
98 98
 			);
99 99
 			break;
100 100
 		case 'edit-payment' :
101 101
 			$title = sprintf(
102 102
 				/* translators: %s: admin title */
103
-				esc_html__( 'Edit Donation - %s', 'give' ),
103
+				esc_html__('Edit Donation - %s', 'give'),
104 104
 				$admin_title
105 105
 			);
106 106
 			break;
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 
112 112
 	return $title;
113 113
 }
114
-add_filter( 'admin_title', 'give_view_order_details_title', 10, 2 );
114
+add_filter('admin_title', 'give_view_order_details_title', 10, 2);
115 115
 
116 116
 /**
117 117
  * Intercept default Edit post links for Give payments and rewrite them to the View Order Details screen
@@ -123,20 +123,20 @@  discard block
 block discarded – undo
123 123
  * @param $context
124 124
  * @return string
125 125
  */
126
-function give_override_edit_post_for_payment_link( $url, $post_id = 0, $context ) {
126
+function give_override_edit_post_for_payment_link($url, $post_id = 0, $context) {
127 127
 
128
-	$post = get_post( $post_id );
128
+	$post = get_post($post_id);
129 129
 
130
-	if( ! $post ) {
130
+	if ( ! $post) {
131 131
 		return $url;
132 132
 	}
133 133
 
134
-	if( 'give_payment' != $post->post_type ) {
134
+	if ('give_payment' != $post->post_type) {
135 135
 		return $url;
136 136
 	}
137 137
 
138
-	$url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id=' . $post_id );
138
+	$url = admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id='.$post_id);
139 139
 
140 140
 	return $url;
141 141
 }
142
-add_filter( 'get_edit_post_link', 'give_override_edit_post_for_payment_link', 10, 3 );
142
+add_filter('get_edit_post_link', 'give_override_edit_post_for_payment_link', 10, 3);
Please login to merge, or discard this patch.
includes/admin/class-addon-activation-banner.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 // Exit if accessed directly.
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
 	 *
26 26
 	 * @param $_banner_details
27 27
 	 */
28
-	function __construct( $_banner_details ) {
28
+	function __construct($_banner_details) {
29 29
 
30 30
 		$current_user = wp_get_current_user();
31 31
 
32 32
 		$this->banner_details = $_banner_details;
33
-		$this->test_mode      = ( $this->banner_details['testing'] == 'true' ) ? true : false;
34
-		$this->nag_meta_key   = 'give_addon_activation_ignore_' . sanitize_title( $this->banner_details['name'] );
33
+		$this->test_mode      = ($this->banner_details['testing'] == 'true') ? true : false;
34
+		$this->nag_meta_key   = 'give_addon_activation_ignore_'.sanitize_title($this->banner_details['name']);
35 35
 
36 36
 		//Get current user
37 37
 		$this->user_id = $current_user->ID;
@@ -51,13 +51,13 @@  discard block
 block discarded – undo
51 51
 	public function init() {
52 52
 
53 53
 		//Testing?
54
-		if ( $this->test_mode ) {
55
-			delete_user_meta( $this->user_id, $this->nag_meta_key );
54
+		if ($this->test_mode) {
55
+			delete_user_meta($this->user_id, $this->nag_meta_key);
56 56
 		}
57 57
 
58 58
 		//Get the current page to add the notice to
59
-		add_action( 'current_screen', array( $this, 'give_addon_notice_ignore' ) );
60
-		add_action( 'admin_notices', array( $this, 'give_addon_activation_admin_notice' ) );
59
+		add_action('current_screen', array($this, 'give_addon_notice_ignore'));
60
+		add_action('admin_notices', array($this, 'give_addon_activation_admin_notice'));
61 61
 
62 62
 	}
63 63
 
@@ -71,12 +71,12 @@  discard block
 block discarded – undo
71 71
 		$screen = get_current_screen();
72 72
 
73 73
 		//Make sure we're on the plugins page.
74
-		if ( $screen->parent_file !== 'plugins.php' ) {
74
+		if ($screen->parent_file !== 'plugins.php') {
75 75
 			return false;
76 76
 		}
77 77
 
78 78
 		// If the user hasn't already dismissed the alert, output activation banner.
79
-		if ( ! get_user_meta( $this->user_id, $this->nag_meta_key ) ) {
79
+		if ( ! get_user_meta($this->user_id, $this->nag_meta_key)) {
80 80
 
81 81
 			// Output inline styles here because there's no reason
82 82
 			// to enqueued them after the alert is dismissed.
@@ -158,43 +158,43 @@  discard block
 block discarded – undo
158 158
 					<h3><?php
159 159
 						printf(
160 160
 						/* translators: %s: Add-on name */
161
-							esc_html__( "Thank you for installing Give's %s Add-on!", 'give' ),
162
-							'<span>' . $this->banner_details['name'] . '</span>'
161
+							esc_html__("Thank you for installing Give's %s Add-on!", 'give'),
162
+							'<span>'.$this->banner_details['name'].'</span>'
163 163
 						);
164 164
 						?></h3>
165 165
 
166 166
 					<a href="<?php
167 167
 					//The Dismiss Button.
168
-					$nag_admin_dismiss_url = 'plugins.php?' . $this->nag_meta_key . '=0';
169
-					echo admin_url( $nag_admin_dismiss_url ); ?>" class="dismiss"><span
168
+					$nag_admin_dismiss_url = 'plugins.php?'.$this->nag_meta_key.'=0';
169
+					echo admin_url($nag_admin_dismiss_url); ?>" class="dismiss"><span
170 170
 							class="dashicons dashicons-dismiss"></span></a>
171 171
 
172 172
 					<div class="alert-actions">
173 173
 
174 174
 						<?php //Point them to your settings page.
175
-						if ( isset( $this->banner_details['settings_url'] ) ) { ?>
175
+						if (isset($this->banner_details['settings_url'])) { ?>
176 176
 							<a href="<?php echo $this->banner_details['settings_url']; ?>">
177
-								<span class="dashicons dashicons-admin-settings"></span><?php esc_html_e( 'Go to Settings', 'give' ); ?></a>
177
+								<span class="dashicons dashicons-admin-settings"></span><?php esc_html_e('Go to Settings', 'give'); ?></a>
178 178
 						<?php } ?>
179 179
 
180 180
 						<?php
181 181
 						// Show them how to configure the Addon.
182
-						if ( isset( $this->banner_details['documentation_url'] ) ) { ?>
182
+						if (isset($this->banner_details['documentation_url'])) { ?>
183 183
 							<a href="<?php echo $this->banner_details['documentation_url'] ?>" target="_blank">
184 184
 								<span class="dashicons dashicons-media-text"></span><?php
185 185
 								printf(
186 186
 								/* translators: %s: Add-on name */
187
-									esc_html__( 'Documentation: %s Add-on', 'give' ),
187
+									esc_html__('Documentation: %s Add-on', 'give'),
188 188
 									$this->banner_details['name']
189 189
 								);
190 190
 								?></a>
191 191
 						<?php } ?>
192 192
 						<?php
193 193
 						//Let them signup for plugin updates
194
-						if ( isset( $this->banner_details['support_url'] ) ) { ?>
194
+						if (isset($this->banner_details['support_url'])) { ?>
195 195
 
196 196
 							<a href="<?php echo $this->banner_details['support_url'] ?>" target="_blank">
197
-								<span class="dashicons dashicons-sos"></span><?php esc_html_e( 'Get Support', 'give' ); ?>
197
+								<span class="dashicons dashicons-sos"></span><?php esc_html_e('Get Support', 'give'); ?>
198 198
 							</a>
199 199
 
200 200
 						<?php } ?>
@@ -221,13 +221,13 @@  discard block
 block discarded – undo
221 221
 		 * If user clicks to ignore the notice, add that to their user meta the banner then checks whether this tag exists already or not.
222 222
 		 * See here: http://codex.wordpress.org/Function_Reference/add_user_meta
223 223
 		 */
224
-		if ( isset( $_GET[ $this->nag_meta_key ] ) && '0' == $_GET[ $this->nag_meta_key ] ) {
224
+		if (isset($_GET[$this->nag_meta_key]) && '0' == $_GET[$this->nag_meta_key]) {
225 225
 
226 226
 			//Get the global user
227 227
 			$current_user = wp_get_current_user();
228 228
 			$user_id = $current_user->ID;
229 229
 
230
-			add_user_meta( $user_id, $this->nag_meta_key, 'true', true );
230
+			add_user_meta($user_id, $this->nag_meta_key, 'true', true);
231 231
 		}
232 232
 	}
233 233
 
Please login to merge, or discard this patch.
includes/gateways/offline-donations.php 1 patch
Spacing   +123 added lines, -123 removed lines patch added patch discarded remove patch
@@ -18,17 +18,17 @@  discard block
 block discarded – undo
18 18
  *
19 19
  * @return array
20 20
  */
21
-function give_offline_register_gateway( $gateways ) {
21
+function give_offline_register_gateway($gateways) {
22 22
 	// Format: ID => Name
23 23
 	$gateways['offline'] = array(
24
-		'admin_label'    => esc_attr__( 'Offline Donation', 'give' ),
25
-		'checkout_label' => esc_attr__( 'Offline Donation', 'give' )
24
+		'admin_label'    => esc_attr__('Offline Donation', 'give'),
25
+		'checkout_label' => esc_attr__('Offline Donation', 'give')
26 26
 	);
27 27
 
28 28
 	return $gateways;
29 29
 }
30 30
 
31
-add_filter( 'give_payment_gateways', 'give_offline_register_gateway', 1 );
31
+add_filter('give_payment_gateways', 'give_offline_register_gateway', 1);
32 32
 
33 33
 
34 34
 /**
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
  *
41 41
  * @return void
42 42
  */
43
-function give_offline_payment_cc_form( $form_id ) {
43
+function give_offline_payment_cc_form($form_id) {
44 44
 
45
-	$post_offline_customization_option = get_post_meta( $form_id, '_give_customize_offline_donations', true );
46
-	$post_offline_instructions         = get_post_meta( $form_id, '_give_offline_checkout_notes', true );
47
-	$global_offline_instruction        = give_get_option( 'global_offline_donation_content' );
45
+	$post_offline_customization_option = get_post_meta($form_id, '_give_customize_offline_donations', true);
46
+	$post_offline_instructions         = get_post_meta($form_id, '_give_offline_checkout_notes', true);
47
+	$global_offline_instruction        = give_get_option('global_offline_donation_content');
48 48
 	$offline_instructions              = $global_offline_instruction;
49 49
 
50
-	if ( $post_offline_customization_option == 'yes' ) {
50
+	if ($post_offline_customization_option == 'yes') {
51 51
 		$offline_instructions = $post_offline_instructions;
52 52
 	}
53 53
 
@@ -60,14 +60,14 @@  discard block
 block discarded – undo
60 60
 	 *
61 61
 	 * @param int $form_id Give form id.
62 62
 	 */
63
-	do_action( 'give_before_offline_info_fields', $form_id );
63
+	do_action('give_before_offline_info_fields', $form_id);
64 64
 	?>
65 65
 	<fieldset id="give_offline_payment_info">
66 66
 		<?php
67
-		$settings_url         = admin_url( 'post.php?post=' . $form_id . '&action=edit&message=1' );
67
+		$settings_url         = admin_url('post.php?post='.$form_id.'&action=edit&message=1');
68 68
 		/* translators: %s: form settings url */
69
-		$offline_instructions = ! empty( $offline_instructions ) ? $offline_instructions : sprintf( __( 'Please enter offline donation instructions in <a href="%s">this form\'s settings</a>.', 'give' ), $settings_url );
70
-		echo wpautop( stripslashes( $offline_instructions ) );
69
+		$offline_instructions = ! empty($offline_instructions) ? $offline_instructions : sprintf(__('Please enter offline donation instructions in <a href="%s">this form\'s settings</a>.', 'give'), $settings_url);
70
+		echo wpautop(stripslashes($offline_instructions));
71 71
 		?>
72 72
 	</fieldset>
73 73
 	<?php
@@ -78,34 +78,34 @@  discard block
 block discarded – undo
78 78
 	 *
79 79
 	 * @param int $form_id Give form id.
80 80
 	 */
81
-	do_action( 'give_after_offline_info_fields', $form_id );
81
+	do_action('give_after_offline_info_fields', $form_id);
82 82
 
83 83
 	echo ob_get_clean();
84 84
 }
85 85
 
86
-add_action( 'give_offline_cc_form', 'give_offline_payment_cc_form' );
86
+add_action('give_offline_cc_form', 'give_offline_payment_cc_form');
87 87
 
88 88
 /**
89 89
  * Give Offline Billing Field
90 90
  *
91 91
  * @param $form_id
92 92
  */
93
-function give_offline_billing_fields( $form_id ) {
93
+function give_offline_billing_fields($form_id) {
94 94
 	//Enable Default CC fields (billing info)
95
-	$post_offline_cc_fields        = get_post_meta( $form_id, '_give_offline_donation_enable_billing_fields_single', true );
96
-	$post_offline_customize_option = get_post_meta( $form_id, '_give_customize_offline_donations', true );
95
+	$post_offline_cc_fields        = get_post_meta($form_id, '_give_offline_donation_enable_billing_fields_single', true);
96
+	$post_offline_customize_option = get_post_meta($form_id, '_give_customize_offline_donations', true);
97 97
 
98
-	$global_offline_cc_fields      = give_get_option( 'give_offline_donation_enable_billing_fields' );
98
+	$global_offline_cc_fields      = give_get_option('give_offline_donation_enable_billing_fields');
99 99
 
100 100
 	//Output CC Address fields if global option is on and user hasn't elected to customize this form's offline donation options
101
-	if ( $global_offline_cc_fields == 'on' && $post_offline_customize_option !== 'yes' ) {
102
-		give_default_cc_address_fields( $form_id );
103
-	} elseif($post_offline_customize_option == 'yes' && $post_offline_cc_fields == 'on') {
104
-		give_default_cc_address_fields( $form_id );
101
+	if ($global_offline_cc_fields == 'on' && $post_offline_customize_option !== 'yes') {
102
+		give_default_cc_address_fields($form_id);
103
+	} elseif ($post_offline_customize_option == 'yes' && $post_offline_cc_fields == 'on') {
104
+		give_default_cc_address_fields($form_id);
105 105
 	}
106 106
 }
107 107
 
108
-add_action( 'give_before_offline_info_fields', 'give_offline_billing_fields', 10, 1 );
108
+add_action('give_before_offline_info_fields', 'give_offline_billing_fields', 10, 1);
109 109
 
110 110
 /**
111 111
  * Process the payment
@@ -116,16 +116,16 @@  discard block
 block discarded – undo
116 116
  *
117 117
  * @return void
118 118
  */
119
-function give_offline_process_payment( $purchase_data ) {
119
+function give_offline_process_payment($purchase_data) {
120 120
 
121
-	$purchase_summary = give_get_purchase_summary( $purchase_data );
121
+	$purchase_summary = give_get_purchase_summary($purchase_data);
122 122
 
123 123
 	// setup the payment details
124 124
 	$payment_data = array(
125 125
 		'price'           => $purchase_data['price'],
126 126
 		'give_form_title' => $purchase_data['post_data']['give-form-title'],
127
-		'give_form_id'    => intval( $purchase_data['post_data']['give-form-id'] ),
128
-		'give_price_id'   => isset( $purchase_data['post_data']['give-price-id'] ) ? $purchase_data['post_data']['give-price-id'] : '',
127
+		'give_form_id'    => intval($purchase_data['post_data']['give-form-id']),
128
+		'give_price_id'   => isset($purchase_data['post_data']['give-price-id']) ? $purchase_data['post_data']['give-price-id'] : '',
129 129
 		'date'            => $purchase_data['date'],
130 130
 		'user_email'      => $purchase_data['user_email'],
131 131
 		'purchase_key'    => $purchase_data['purchase_key'],
@@ -137,20 +137,20 @@  discard block
 block discarded – undo
137 137
 
138 138
 
139 139
 	// record the pending payment
140
-	$payment = give_insert_payment( $payment_data );
140
+	$payment = give_insert_payment($payment_data);
141 141
 
142
-	if ( $payment ) {
143
-		give_offline_send_admin_notice( $payment );
144
-		give_offline_send_donor_instructions( $payment );
142
+	if ($payment) {
143
+		give_offline_send_admin_notice($payment);
144
+		give_offline_send_donor_instructions($payment);
145 145
 		give_send_to_success_page();
146 146
 	} else {
147 147
 		// if errors are present, send the user back to the donation form so they can be corrected
148
-		give_send_back_to_checkout( '?payment-mode=' . $purchase_data['post_data']['give-gateway'] );
148
+		give_send_back_to_checkout('?payment-mode='.$purchase_data['post_data']['give-gateway']);
149 149
 	}
150 150
 
151 151
 }
152 152
 
153
-add_action( 'give_gateway_offline', 'give_offline_process_payment' );
153
+add_action('give_gateway_offline', 'give_offline_process_payment');
154 154
 
155 155
 
156 156
 /**
@@ -163,59 +163,59 @@  discard block
 block discarded – undo
163 163
  * @since       1.0
164 164
  * @return void
165 165
  */
166
-function give_offline_send_donor_instructions( $payment_id = 0 ) {
166
+function give_offline_send_donor_instructions($payment_id = 0) {
167 167
 
168
-	$payment_data                      = give_get_payment_meta( $payment_id );
169
-	$post_offline_customization_option = get_post_meta( $payment_data['form_id'], '_give_customize_offline_donations', true );
168
+	$payment_data                      = give_get_payment_meta($payment_id);
169
+	$post_offline_customization_option = get_post_meta($payment_data['form_id'], '_give_customize_offline_donations', true);
170 170
 
171 171
 	//Customize email content depending on whether the single form has been customized
172
-	$email_content = give_get_option( 'global_offline_donation_email' );
172
+	$email_content = give_get_option('global_offline_donation_email');
173 173
 
174
-	if ( $post_offline_customization_option === 'yes' ) {
175
-		$email_content = get_post_meta( $payment_data['form_id'], '_give_offline_donation_email', true );
174
+	if ($post_offline_customization_option === 'yes') {
175
+		$email_content = get_post_meta($payment_data['form_id'], '_give_offline_donation_email', true);
176 176
 	}
177 177
 
178
-	$from_name = give_get_option( 'from_name', wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ) );
178
+	$from_name = give_get_option('from_name', wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES));
179 179
 
180 180
 	/**
181 181
 	 * Filters the from name.
182 182
 	 *
183 183
 	 * @since 1.7
184 184
 	 */
185
-	$from_name = apply_filters( 'give_donation_from_name', $from_name, $payment_id, $payment_data );
185
+	$from_name = apply_filters('give_donation_from_name', $from_name, $payment_id, $payment_data);
186 186
 
187
-	$from_email = give_get_option( 'from_email', get_bloginfo( 'admin_email' ) );
187
+	$from_email = give_get_option('from_email', get_bloginfo('admin_email'));
188 188
 
189 189
 	/**
190 190
 	 * Filters the from email.
191 191
 	 *
192 192
 	 * @since 1.7
193 193
 	 */
194
-	$from_email = apply_filters( 'give_donation_from_address', $from_email, $payment_id, $payment_data );
194
+	$from_email = apply_filters('give_donation_from_address', $from_email, $payment_id, $payment_data);
195 195
 
196
-	$to_email = give_get_payment_user_email( $payment_id );
196
+	$to_email = give_get_payment_user_email($payment_id);
197 197
 
198
-	$subject = give_get_option( 'offline_donation_subject', esc_html__( 'Offline Donation Instructions', 'give' ) );
199
-	if ( $post_offline_customization_option === 'yes' ) {
200
-		$subject = get_post_meta( $payment_data['form_id'], '_give_offline_donation_subject', true );
198
+	$subject = give_get_option('offline_donation_subject', esc_html__('Offline Donation Instructions', 'give'));
199
+	if ($post_offline_customization_option === 'yes') {
200
+		$subject = get_post_meta($payment_data['form_id'], '_give_offline_donation_subject', true);
201 201
 	}
202 202
 
203
-	$subject = apply_filters( 'give_offline_donation_subject', wp_strip_all_tags( $subject ), $payment_id );
204
-	$subject = give_do_email_tags( $subject, $payment_id );
203
+	$subject = apply_filters('give_offline_donation_subject', wp_strip_all_tags($subject), $payment_id);
204
+	$subject = give_do_email_tags($subject, $payment_id);
205 205
 
206
-	$attachments = apply_filters( 'give_offline_donation_attachments', array(), $payment_id, $payment_data );
207
-	$message     = give_do_email_tags( $email_content, $payment_id );
206
+	$attachments = apply_filters('give_offline_donation_attachments', array(), $payment_id, $payment_data);
207
+	$message     = give_do_email_tags($email_content, $payment_id);
208 208
 
209 209
 	$emails = Give()->emails;
210 210
 
211
-	$emails->__set( 'from_name', $from_name );
212
-	$emails->__set( 'from_email', $from_email );
213
-	$emails->__set( 'heading', esc_html__( 'Offline Donation Instructions', 'give' ) );
211
+	$emails->__set('from_name', $from_name);
212
+	$emails->__set('from_email', $from_email);
213
+	$emails->__set('heading', esc_html__('Offline Donation Instructions', 'give'));
214 214
 
215
-	$headers = apply_filters( 'give_receipt_headers', $emails->get_headers(), $payment_id, $payment_data );
216
-	$emails->__set( 'headers', $headers );
215
+	$headers = apply_filters('give_receipt_headers', $emails->get_headers(), $payment_id, $payment_data);
216
+	$emails->__set('headers', $headers);
217 217
 
218
-	$emails->send( $to_email, $subject, $message, $attachments );
218
+	$emails->send($to_email, $subject, $message, $attachments);
219 219
 
220 220
 }
221 221
 
@@ -232,52 +232,52 @@  discard block
 block discarded – undo
232 232
  * @return void
233 233
  *
234 234
  */
235
-function give_offline_send_admin_notice( $payment_id = 0 ) {
235
+function give_offline_send_admin_notice($payment_id = 0) {
236 236
 
237 237
 	/* Send an email notification to the admin */
238 238
 	$admin_email = give_get_admin_notice_emails();
239
-	$user_info   = give_get_payment_meta_user_info( $payment_id );
239
+	$user_info   = give_get_payment_meta_user_info($payment_id);
240 240
 
241
-	if ( isset( $user_info['id'] ) && $user_info['id'] > 0 ) {
242
-		$user_data = get_userdata( $user_info['id'] );
241
+	if (isset($user_info['id']) && $user_info['id'] > 0) {
242
+		$user_data = get_userdata($user_info['id']);
243 243
 		$name      = $user_data->display_name;
244
-	} elseif ( isset( $user_info['first_name'] ) && isset( $user_info['last_name'] ) ) {
245
-		$name = $user_info['first_name'] . ' ' . $user_info['last_name'];
244
+	} elseif (isset($user_info['first_name']) && isset($user_info['last_name'])) {
245
+		$name = $user_info['first_name'].' '.$user_info['last_name'];
246 246
 	} else {
247 247
 		$name = $user_info['email'];
248 248
 	}
249 249
 
250
-	$amount = give_currency_filter( give_format_amount( give_get_payment_amount( $payment_id ) ) );
250
+	$amount = give_currency_filter(give_format_amount(give_get_payment_amount($payment_id)));
251 251
 
252
-	$admin_subject = apply_filters( 'give_offline_admin_donation_notification_subject', esc_attr__( 'New Pending Donation', 'give' ), $payment_id );
252
+	$admin_subject = apply_filters('give_offline_admin_donation_notification_subject', esc_attr__('New Pending Donation', 'give'), $payment_id);
253 253
 
254
-	$admin_message = esc_attr__( 'Dear Admin,', 'give' ) . "\n\n";
255
-	$admin_message .= esc_attr__( 'An offline donation has been made on your website:', 'give' ) . ' ' . get_bloginfo( 'name' ) . ' ';
256
-	$admin_message .= esc_attr__( 'Hooray! The donation is in a pending status and is awaiting payment. Donation instructions have been emailed to the donor. Once you receive payment, be sure to mark the donation as complete using the link below.', 'give' ) . "\n\n";
254
+	$admin_message = esc_attr__('Dear Admin,', 'give')."\n\n";
255
+	$admin_message .= esc_attr__('An offline donation has been made on your website:', 'give').' '.get_bloginfo('name').' ';
256
+	$admin_message .= esc_attr__('Hooray! The donation is in a pending status and is awaiting payment. Donation instructions have been emailed to the donor. Once you receive payment, be sure to mark the donation as complete using the link below.', 'give')."\n\n";
257 257
 
258 258
 
259
-	$admin_message .= '<strong>' . esc_attr__( 'Donor:', 'give' ) . '</strong> {fullname}' . "\n";
260
-	$admin_message .= '<strong>' . esc_attr__( 'Amount:', 'give' ) . '</strong> {price}' . "\n\n";
259
+	$admin_message .= '<strong>'.esc_attr__('Donor:', 'give').'</strong> {fullname}'."\n";
260
+	$admin_message .= '<strong>'.esc_attr__('Amount:', 'give').'</strong> {price}'."\n\n";
261 261
 
262 262
 	$admin_message .= sprintf(
263 263
 		'<a href="%1$s">%2$s</a>',
264
-		admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id=' . $payment_id ),
265
-		esc_html__( 'Click Here to View and/or Update Donation Details', 'give' )
266
-	) . "\n\n";
264
+		admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id='.$payment_id),
265
+		esc_html__('Click Here to View and/or Update Donation Details', 'give')
266
+	)."\n\n";
267 267
 
268
-	$admin_message = apply_filters( 'give_offline_admin_donation_notification', $admin_message, $payment_id );
269
-	$admin_message = give_do_email_tags( $admin_message, $payment_id );
268
+	$admin_message = apply_filters('give_offline_admin_donation_notification', $admin_message, $payment_id);
269
+	$admin_message = give_do_email_tags($admin_message, $payment_id);
270 270
 
271
-	$attachments   = apply_filters( 'give_offline_admin_donation_notification_attachments', array(), $payment_id );
272
-	$admin_headers = apply_filters( 'give_offline_admin_donation_notification_headers', array(), $payment_id );
271
+	$attachments   = apply_filters('give_offline_admin_donation_notification_attachments', array(), $payment_id);
272
+	$admin_headers = apply_filters('give_offline_admin_donation_notification_headers', array(), $payment_id);
273 273
 
274 274
 	//Send Email
275 275
 	$emails = Give()->emails;
276
-	if ( ! empty( $admin_headers ) ) {
277
-		$emails->__set( 'headers', $admin_headers );
276
+	if ( ! empty($admin_headers)) {
277
+		$emails->__set('headers', $admin_headers);
278 278
 	}
279 279
 
280
-	$emails->send( $admin_email, $admin_subject, $admin_message, $attachments );
280
+	$emails->send($admin_email, $admin_subject, $admin_message, $attachments);
281 281
 
282 282
 }
283 283
 
@@ -288,15 +288,15 @@  discard block
 block discarded – undo
288 288
  * @since  1.0
289 289
  * @return array
290 290
  */
291
-function give_offline_add_settings( $settings ) {
291
+function give_offline_add_settings($settings) {
292 292
 
293 293
 	//Vars
294 294
 	$prefix = '_give_';
295 295
 
296
-	$is_gateway_active = give_is_gateway_active( 'offline' );
296
+	$is_gateway_active = give_is_gateway_active('offline');
297 297
 
298 298
 	//this gateway isn't active
299
-	if ( ! $is_gateway_active ) {
299
+	if ( ! $is_gateway_active) {
300 300
 		//return settings and bounce
301 301
 		return $settings;
302 302
 	}
@@ -305,27 +305,27 @@  discard block
 block discarded – undo
305 305
 	$check_settings = array(
306 306
 
307 307
 		array(
308
-			'name'    => esc_attr__( 'Customize Offline Donations', 'give' ),
309
-			'desc'    => esc_attr__( 'If you would like to customize the donation instructions for this specific forms check this option.', 'give' ),
310
-			'id'      => $prefix . 'customize_offline_donations',
308
+			'name'    => esc_attr__('Customize Offline Donations', 'give'),
309
+			'desc'    => esc_attr__('If you would like to customize the donation instructions for this specific forms check this option.', 'give'),
310
+			'id'      => $prefix.'customize_offline_donations',
311 311
 			'type'    => 'radio_inline',
312 312
 			'default' => 'no',
313 313
 			'options' => array(
314
-				'yes' => esc_attr__( 'Yes', 'give' ),
315
-				'no'  => esc_attr__( 'No', 'give' ),
314
+				'yes' => esc_attr__('Yes', 'give'),
315
+				'no'  => esc_attr__('No', 'give'),
316 316
 			),
317 317
 		),
318 318
 		array(
319
-			'name'        => esc_attr__( 'Request Billing Information', 'give' ),
320
-			'desc'        => esc_attr__( 'This option will enable the billing details section for this form\'s offline donation payment gateway. The fieldset will appear above the offline donation instructions.', 'give' ),
321
-			'id'          => $prefix . 'offline_donation_enable_billing_fields_single',
319
+			'name'        => esc_attr__('Request Billing Information', 'give'),
320
+			'desc'        => esc_attr__('This option will enable the billing details section for this form\'s offline donation payment gateway. The fieldset will appear above the offline donation instructions.', 'give'),
321
+			'id'          => $prefix.'offline_donation_enable_billing_fields_single',
322 322
 			'row_classes' => 'give-subfield',
323 323
 			'type'        => 'checkbox'
324 324
 		),
325 325
 		array(
326
-			'id'          => $prefix . 'offline_checkout_notes',
327
-			'name'        => esc_attr__( 'Offline Donation Instructions', 'give' ),
328
-			'desc'        => esc_attr__( 'Enter the instructions you want to display to the donor during the donation process. Most likely this would include important information like mailing address and who to make the check out to.', 'give' ),
326
+			'id'          => $prefix.'offline_checkout_notes',
327
+			'name'        => esc_attr__('Offline Donation Instructions', 'give'),
328
+			'desc'        => esc_attr__('Enter the instructions you want to display to the donor during the donation process. Most likely this would include important information like mailing address and who to make the check out to.', 'give'),
329 329
 			'default'     => give_get_default_offline_donation_content(),
330 330
 			'type'        => 'wysiwyg',
331 331
 			'row_classes' => 'give-subfield',
@@ -334,17 +334,17 @@  discard block
 block discarded – undo
334 334
 			)
335 335
 		),
336 336
 		array(
337
-			'id'          => $prefix . 'offline_donation_subject',
338
-			'name'        => esc_attr__( 'Offline Donation Email Instructions Subject', 'give' ),
339
-			'desc'        => esc_attr__( 'Enter the subject line for the donation receipt email.', 'give' ),
340
-			'default'     => esc_attr__( '{donation} - Offline Donation Instructions', 'give' ),
337
+			'id'          => $prefix.'offline_donation_subject',
338
+			'name'        => esc_attr__('Offline Donation Email Instructions Subject', 'give'),
339
+			'desc'        => esc_attr__('Enter the subject line for the donation receipt email.', 'give'),
340
+			'default'     => esc_attr__('{donation} - Offline Donation Instructions', 'give'),
341 341
 			'row_classes' => 'give-subfield',
342 342
 			'type'        => 'text'
343 343
 		),
344 344
 		array(
345
-			'id'          => $prefix . 'offline_donation_email',
346
-			'name'        => esc_attr__( 'Offline Donation Email Instructions', 'give' ),
347
-			'desc'        => esc_attr__( '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' ),
345
+			'id'          => $prefix.'offline_donation_email',
346
+			'name'        => esc_attr__('Offline Donation Email Instructions', 'give'),
347
+			'desc'        => esc_attr__('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'),
348 348
 			'default'     => give_get_default_offline_donation_email_content(),
349 349
 			'type'        => 'wysiwyg',
350 350
 			'row_classes' => 'give-subfield',
@@ -354,10 +354,10 @@  discard block
 block discarded – undo
354 354
 		)
355 355
 	);
356 356
 
357
-	return array_merge( $settings, $check_settings );
357
+	return array_merge($settings, $check_settings);
358 358
 }
359 359
 
360
-add_filter( 'give_forms_display_options_metabox_fields', 'give_offline_add_settings' );
360
+add_filter('give_forms_display_options_metabox_fields', 'give_offline_add_settings');
361 361
 
362 362
 
363 363
 /**
@@ -369,32 +369,32 @@  discard block
 block discarded – undo
369 369
  */
370 370
 function give_get_default_offline_donation_content() {
371 371
 
372
-	$sitename = get_bloginfo( 'sitename' );
372
+	$sitename = get_bloginfo('sitename');
373 373
 
374
-	$default_text = '<p>' . esc_attr__( 'In order to make an offline donation we ask that you please follow these instructions', 'give' ) . ': </p>';
374
+	$default_text = '<p>'.esc_attr__('In order to make an offline donation we ask that you please follow these instructions', 'give').': </p>';
375 375
 	$default_text .= '<ol>';
376 376
 	$default_text .= '<li>';
377 377
 	$default_text .= sprintf(
378 378
 		/* translators: %s: site name */
379
-		esc_html__( 'Make a check payable to "%s"', 'give' ),
379
+		esc_html__('Make a check payable to "%s"', 'give'),
380 380
 		$sitename
381 381
 	);
382 382
 	$default_text .= '</li>';
383 383
 	$default_text .= '<li>';
384 384
 	$default_text .= sprintf(
385 385
 		/* translators: %s: site name */
386
-		esc_html__( 'On the memo line of the check, please indicate that the donation is for "%s"', 'give' ),
386
+		esc_html__('On the memo line of the check, please indicate that the donation is for "%s"', 'give'),
387 387
 		$sitename
388 388
 	);
389 389
 	$default_text .= '</li>';
390
-	$default_text .= '<li>' . esc_html__( 'Please mail your check to:', 'give' ) . '</li>';
390
+	$default_text .= '<li>'.esc_html__('Please mail your check to:', 'give').'</li>';
391 391
 	$default_text .= '</ol>';
392
-	$default_text .= '&nbsp;&nbsp;&nbsp;&nbsp;<em>' . $sitename . '</em><br>';
392
+	$default_text .= '&nbsp;&nbsp;&nbsp;&nbsp;<em>'.$sitename.'</em><br>';
393 393
 	$default_text .= '&nbsp;&nbsp;&nbsp;&nbsp;<em>123 G Street </em><br>';
394 394
 	$default_text .= '&nbsp;&nbsp;&nbsp;&nbsp;<em>San Diego, CA 92101 </em><br>';
395
-	$default_text .= '<p>' . esc_attr__( 'All contributions will be gratefully acknowledged and are tax deductible.', 'give' ) . '</p>';
395
+	$default_text .= '<p>'.esc_attr__('All contributions will be gratefully acknowledged and are tax deductible.', 'give').'</p>';
396 396
 
397
-	return apply_filters( 'give_default_offline_donation_content', $default_text );
397
+	return apply_filters('give_default_offline_donation_content', $default_text);
398 398
 
399 399
 }
400 400
 
@@ -407,33 +407,33 @@  discard block
 block discarded – undo
407 407
  */
408 408
 function give_get_default_offline_donation_email_content() {
409 409
 
410
-	$sitename      = get_bloginfo( 'sitename' );
411
-	$default_text  = '<p>' . esc_html__( 'Dear {name},', 'give' ) . '</p>';
412
-	$default_text .= '<p>' . esc_html__( 'Thank you for your offline donation request! Your generosity is greatly appreciated. In order to make an offline donation we ask that you please follow these instructions:', 'give' ) . '</p>';
410
+	$sitename      = get_bloginfo('sitename');
411
+	$default_text  = '<p>'.esc_html__('Dear {name},', 'give').'</p>';
412
+	$default_text .= '<p>'.esc_html__('Thank you for your offline donation request! Your generosity is greatly appreciated. In order to make an offline donation we ask that you please follow these instructions:', 'give').'</p>';
413 413
 	$default_text .= '<ol>';
414 414
 	$default_text .= '<li>';
415 415
 	$default_text .= sprintf(
416 416
 		/* translators: %s: site name */
417
-		esc_html__( 'Make a check payable to "%s"', 'give' ),
417
+		esc_html__('Make a check payable to "%s"', 'give'),
418 418
 		$sitename
419 419
 	);
420 420
 	$default_text .= '</li>';
421 421
 	$default_text .= '<li>';
422 422
 	$default_text .= sprintf(
423 423
 		/* translators: %s: site name */
424
-		esc_html__( 'On the memo line of the check, please indicate that the donation is for "%s"', 'give' ),
424
+		esc_html__('On the memo line of the check, please indicate that the donation is for "%s"', 'give'),
425 425
 		$sitename
426 426
 	);
427 427
 	$default_text .= '</li>';
428
-	$default_text .= '<li>' . esc_html__( 'Please mail your check to:', 'give' ) . '</li>';
428
+	$default_text .= '<li>'.esc_html__('Please mail your check to:', 'give').'</li>';
429 429
 	$default_text .= '</ol>';
430
-	$default_text .= '&nbsp;&nbsp;&nbsp;&nbsp;<em>' . $sitename . '</em><br>';
430
+	$default_text .= '&nbsp;&nbsp;&nbsp;&nbsp;<em>'.$sitename.'</em><br>';
431 431
 	$default_text .= '&nbsp;&nbsp;&nbsp;&nbsp;<em>123 G Street </em><br>';
432 432
 	$default_text .= '&nbsp;&nbsp;&nbsp;&nbsp;<em>San Diego, CA 92101 </em><br>';
433
-	$default_text .= '<p>' . esc_html__( 'Once your donation has been received we will mark it as complete and you will receive an email receipt for your records. Please contact us with any questions you may have!', 'give' ) . '</p>';
434
-	$default_text .= '<p>' . esc_html__( 'Sincerely,', 'give' ) . '</p>';
435
-	$default_text .= '<p>' . $sitename . '</p>';
433
+	$default_text .= '<p>'.esc_html__('Once your donation has been received we will mark it as complete and you will receive an email receipt for your records. Please contact us with any questions you may have!', 'give').'</p>';
434
+	$default_text .= '<p>'.esc_html__('Sincerely,', 'give').'</p>';
435
+	$default_text .= '<p>'.$sitename.'</p>';
436 436
 
437
-	return apply_filters( 'give_default_offline_donation_content', $default_text );
437
+	return apply_filters('give_default_offline_donation_content', $default_text);
438 438
 
439 439
 }
Please login to merge, or discard this patch.
includes/country-functions.php 1 patch
Spacing   +333 added lines, -333 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
  */
24 24
 function give_get_country() {
25 25
 	$give_options = give_get_settings();
26
-	$country = isset( $give_options['base_country'] ) ? $give_options['base_country'] : 'US';
26
+	$country = isset($give_options['base_country']) ? $give_options['base_country'] : 'US';
27 27
 
28
-	return apply_filters( 'give_give_country', $country );
28
+	return apply_filters('give_give_country', $country);
29 29
 }
30 30
 
31 31
 /**
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
  */
37 37
 function give_get_state() {
38 38
 	$give_options = give_get_settings();
39
-	$state = isset( $give_options['base_state'] ) ? $give_options['base_state'] : false;
39
+	$state = isset($give_options['base_state']) ? $give_options['base_state'] : false;
40 40
 
41
-	return apply_filters( 'give_give_state', $state );
41
+	return apply_filters('give_give_state', $state);
42 42
 }
43 43
 
44 44
 /**
@@ -50,13 +50,13 @@  discard block
 block discarded – undo
50 50
  *
51 51
  * @return mixed|void  A list of states for the shop's base country
52 52
  */
53
-function give_get_states( $country = null ) {
53
+function give_get_states($country = null) {
54 54
 
55
-	if ( empty( $country ) ) {
55
+	if (empty($country)) {
56 56
 		$country = give_get_country();
57 57
 	}
58 58
 
59
-	switch ( $country ) :
59
+	switch ($country) :
60 60
 
61 61
 		case 'US' :
62 62
 			$states = give_get_states_list();
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 
107 107
 	endswitch;
108 108
 
109
-	return apply_filters( 'give_give_states', $states );
109
+	return apply_filters('give_give_states', $states);
110 110
 }
111 111
 
112 112
 
@@ -119,253 +119,253 @@  discard block
 block discarded – undo
119 119
 function give_get_country_list() {
120 120
 	$countries = array(
121 121
 		''   => '',
122
-		'US' => esc_html__( 'United States', 'give' ),
123
-		'CA' => esc_html__( 'Canada', 'give' ),
124
-		'GB' => esc_html__( 'United Kingdom', 'give' ),
125
-		'AF' => esc_html__( 'Afghanistan', 'give' ),
126
-		'AL' => esc_html__( 'Albania', 'give' ),
127
-		'DZ' => esc_html__( 'Algeria', 'give' ),
128
-		'AS' => esc_html__( 'American Samoa', 'give' ),
129
-		'AD' => esc_html__( 'Andorra', 'give' ),
130
-		'AO' => esc_html__( 'Angola', 'give' ),
131
-		'AI' => esc_html__( 'Anguilla', 'give' ),
132
-		'AQ' => esc_html__( 'Antarctica', 'give' ),
133
-		'AG' => esc_html__( 'Antigua and Barbuda', 'give' ),
134
-		'AR' => esc_html__( 'Argentina', 'give' ),
135
-		'AM' => esc_html__( 'Armenia', 'give' ),
136
-		'AW' => esc_html__( 'Aruba', 'give' ),
137
-		'AU' => esc_html__( 'Australia', 'give' ),
138
-		'AT' => esc_html__( 'Austria', 'give' ),
139
-		'AZ' => esc_html__( 'Azerbaijan', 'give' ),
140
-		'BS' => esc_html__( 'Bahamas', 'give'),
141
-		'BH' => esc_html__( 'Bahrain', 'give' ),
142
-		'BD' => esc_html__( 'Bangladesh', 'give' ),
143
-		'BB' => esc_html__( 'Barbados', 'give' ),
144
-		'BY' => esc_html__( 'Belarus', 'give' ),
145
-		'BE' => esc_html__( 'Belgium', 'give' ),
146
-		'BZ' => esc_html__( 'Belize', 'give' ),
147
-		'BJ' => esc_html__( 'Benin', 'give' ),
148
-		'BM' => esc_html__( 'Bermuda', 'give' ),
149
-		'BT' => esc_html__( 'Bhutan', 'give' ),
150
-		'BO' => esc_html__( 'Bolivia', 'give' ),
151
-		'BA' => esc_html__( 'Bosnia and Herzegovina', 'give' ),
152
-		'BW' => esc_html__( 'Botswana', 'give' ),
153
-		'BV' => esc_html__( 'Bouvet Island', 'give' ),
154
-		'BR' => esc_html__( 'Brazil', 'give' ),
155
-		'IO' => esc_html__( 'British Indian Ocean Territory', 'give' ),
156
-		'BN' => esc_html__( 'Brunei Darrussalam', 'give' ),
157
-		'BG' => esc_html__( 'Bulgaria', 'give' ),
158
-		'BF' => esc_html__( 'Burkina Faso', 'give' ),
159
-		'BI' => esc_html__( 'Burundi', 'give' ),
160
-		'KH' => esc_html__( 'Cambodia', 'give' ),
161
-		'CM' => esc_html__( 'Cameroon', 'give' ),
162
-		'CV' => esc_html__( 'Cape Verde', 'give' ),
163
-		'KY' => esc_html__( 'Cayman Islands', 'give' ),
164
-		'CF' => esc_html__( 'Central African Republic', 'give' ),
165
-		'TD' => esc_html__( 'Chad', 'give' ),
166
-		'CL' => esc_html__( 'Chile', 'give' ),
167
-		'CN' => esc_html__( 'China', 'give' ),
168
-		'CX' => esc_html__( 'Christmas Island', 'give' ),
169
-		'CC' => esc_html__( 'Cocos Islands', 'give' ),
170
-		'CO' => esc_html__( 'Colombia', 'give' ),
171
-		'KM' => esc_html__( 'Comoros', 'give' ),
172
-		'CD' => esc_html__( 'Congo, Democratic People\'s Republic', 'give' ),
173
-		'CG' => esc_html__( 'Congo, Republic of', 'give' ),
174
-		'CK' => esc_html__( 'Cook Islands', 'give' ),
175
-		'CR' => esc_html__( 'Costa Rica', 'give' ),
176
-		'CI' => esc_html__( 'Cote d\'Ivoire', 'give' ),
177
-		'HR' => esc_html__( 'Croatia/Hrvatska', 'give' ),
178
-		'CU' => esc_html__( 'Cuba', 'give' ),
179
-		'CY' => esc_html__( 'Cyprus Island', 'give' ),
180
-		'CZ' => esc_html__( 'Czech Republic', 'give' ),
181
-		'DK' => esc_html__( 'Denmark', 'give' ),
182
-		'DJ' => esc_html__( 'Djibouti', 'give' ),
183
-		'DM' => esc_html__( 'Dominica', 'give' ),
184
-		'DO' => esc_html__( 'Dominican Republic', 'give' ),
185
-		'TP' => esc_html__( 'East Timor', 'give' ),
186
-		'EC' => esc_html__( 'Ecuador', 'give' ),
187
-		'EG' => esc_html__( 'Egypt', 'give' ),
188
-		'GQ' => esc_html__( 'Equatorial Guinea', 'give' ),
189
-		'SV' => esc_html__( 'El Salvador', 'give' ),
190
-		'ER' => esc_html__( 'Eritrea', 'give' ),
191
-		'EE' => esc_html__( 'Estonia', 'give' ),
192
-		'ET' => esc_html__( 'Ethiopia', 'give' ),
193
-		'FK' => esc_html__( 'Falkland Islands', 'give' ),
194
-		'FO' => esc_html__( 'Faroe Islands', 'give' ),
195
-		'FJ' => esc_html__( 'Fiji', 'give' ),
196
-		'FI' => esc_html__( 'Finland', 'give' ),
197
-		'FR' => esc_html__( 'France', 'give' ),
198
-		'GF' => esc_html__( 'French Guiana', 'give' ),
199
-		'PF' => esc_html__( 'French Polynesia', 'give' ),
200
-		'TF' => esc_html__( 'French Southern Territories', 'give' ),
201
-		'GA' => esc_html__( 'Gabon', 'give' ),
202
-		'GM' => esc_html__( 'Gambia', 'give' ),
203
-		'GE' => esc_html__( 'Georgia', 'give' ),
204
-		'DE' => esc_html__( 'Germany', 'give' ),
205
-		'GR' => esc_html__( 'Greece', 'give' ),
206
-		'GH' => esc_html__( 'Ghana', 'give' ),
207
-		'GI' => esc_html__( 'Gibraltar', 'give' ),
208
-		'GL' => esc_html__( 'Greenland', 'give' ),
209
-		'GD' => esc_html__( 'Grenada', 'give' ),
210
-		'GP' => esc_html__( 'Guadeloupe', 'give' ),
211
-		'GU' => esc_html__( 'Guam', 'give' ),
212
-		'GT' => esc_html__( 'Guatemala', 'give' ),
213
-		'GG' => esc_html__( 'Guernsey', 'give' ),
214
-		'GN' => esc_html__( 'Guinea', 'give' ),
215
-		'GW' => esc_html__( 'Guinea-Bissau', 'give' ),
216
-		'GY' => esc_html__( 'Guyana', 'give' ),
217
-		'HT' => esc_html__( 'Haiti', 'give' ),
218
-		'HM' => esc_html__( 'Heard and McDonald Islands', 'give' ),
219
-		'VA' => esc_html__( 'Holy See (City Vatican State)', 'give' ),
220
-		'HN' => esc_html__( 'Honduras', 'give' ),
221
-		'HK' => esc_html__( 'Hong Kong', 'give' ),
222
-		'HU' => esc_html__( 'Hungary', 'give' ),
223
-		'IS' => esc_html__( 'Iceland', 'give' ),
224
-		'IN' => esc_html__( 'India', 'give' ),
225
-		'ID' => esc_html__( 'Indonesia', 'give' ),
226
-		'IR' => esc_html__( 'Iran', 'give' ),
227
-		'IQ' => esc_html__( 'Iraq', 'give' ),
228
-		'IE' => esc_html__( 'Ireland', 'give' ),
229
-		'IM' => esc_html__( 'Isle of Man', 'give' ),
230
-		'IL' => esc_html__( 'Israel', 'give' ),
231
-		'IT' => esc_html__( 'Italy', 'give' ),
232
-		'JM' => esc_html__( 'Jamaica', 'give' ),
233
-		'JP' => esc_html__( 'Japan', 'give' ),
234
-		'JE' => esc_html__( 'Jersey', 'give' ),
235
-		'JO' => esc_html__( 'Jordan', 'give' ),
236
-		'KZ' => esc_html__( 'Kazakhstan', 'give' ),
237
-		'KE' => esc_html__( 'Kenya', 'give' ),
238
-		'KI' => esc_html__( 'Kiribati', 'give' ),
239
-		'KW' => esc_html__( 'Kuwait', 'give' ),
240
-		'KG' => esc_html__( 'Kyrgyzstan', 'give' ),
241
-		'LA' => esc_html__( 'Lao People\'s Democratic Republic', 'give' ),
242
-		'LV' => esc_html__( 'Latvia', 'give' ),
243
-		'LB' => esc_html__( 'Lebanon', 'give' ),
244
-		'LS' => esc_html__( 'Lesotho', 'give' ),
245
-		'LR' => esc_html__( 'Liberia', 'give' ),
246
-		'LY' => esc_html__( 'Libyan Arab Jamahiriya', 'give' ),
247
-		'LI' => esc_html__( 'Liechtenstein', 'give' ),
248
-		'LT' => esc_html__( 'Lithuania', 'give' ),
249
-		'LU' => esc_html__( 'Luxembourg', 'give' ),
250
-		'MO' => esc_html__( 'Macau', 'give' ),
251
-		'MK' => esc_html__( 'Macedonia', 'give' ),
252
-		'MG' => esc_html__( 'Madagascar', 'give' ),
253
-		'MW' => esc_html__( 'Malawi', 'give' ),
254
-		'MY' => esc_html__( 'Malaysia', 'give' ),
255
-		'MV' => esc_html__( 'Maldives', 'give' ),
256
-		'ML' => esc_html__( 'Mali', 'give' ),
257
-		'MT' => esc_html__( 'Malta', 'give' ),
258
-		'MH' => esc_html__( 'Marshall Islands', 'give' ),
259
-		'MQ' => esc_html__( 'Martinique', 'give' ),
260
-		'MR' => esc_html__( 'Mauritania', 'give' ),
261
-		'MU' => esc_html__( 'Mauritius', 'give' ),
262
-		'YT' => esc_html__( 'Mayotte', 'give' ),
263
-		'MX' => esc_html__( 'Mexico', 'give' ),
264
-		'FM' => esc_html__( 'Micronesia', 'give' ),
265
-		'MD' => esc_html__( 'Moldova, Republic of', 'give' ),
266
-		'MC' => esc_html__( 'Monaco', 'give' ),
267
-		'MN' => esc_html__( 'Mongolia', 'give' ),
268
-		'ME' => esc_html__( 'Montenegro', 'give' ),
269
-		'MS' => esc_html__( 'Montserrat', 'give' ),
270
-		'MA' => esc_html__( 'Morocco', 'give' ),
271
-		'MZ' => esc_html__( 'Mozambique', 'give' ),
272
-		'MM' => esc_html__( 'Myanmar', 'give' ),
273
-		'NA' => esc_html__( 'Namibia', 'give' ),
274
-		'NR' => esc_html__( 'Nauru', 'give' ),
275
-		'NP' => esc_html__( 'Nepal', 'give' ),
276
-		'NL' => esc_html__( 'Netherlands', 'give' ),
277
-		'AN' => esc_html__( 'Netherlands Antilles', 'give' ),
278
-		'NC' => esc_html__( 'New Caledonia', 'give' ),
279
-		'NZ' => esc_html__( 'New Zealand', 'give' ),
280
-		'NI' => esc_html__( 'Nicaragua', 'give' ),
281
-		'NE' => esc_html__( 'Niger', 'give' ),
282
-		'NG' => esc_html__( 'Nigeria', 'give' ),
283
-		'NU' => esc_html__( 'Niue', 'give' ),
284
-		'NF' => esc_html__( 'Norfolk Island', 'give' ),
285
-		'KP' => esc_html__( 'North Korea', 'give' ),
286
-		'MP' => esc_html__( 'Northern Mariana Islands', 'give' ),
287
-		'NO' => esc_html__( 'Norway', 'give' ),
288
-		'OM' => esc_html__( 'Oman', 'give' ),
289
-		'PK' => esc_html__( 'Pakistan', 'give' ),
290
-		'PW' => esc_html__( 'Palau', 'give' ),
291
-		'PS' => esc_html__( 'Palestinian Territories', 'give' ),
292
-		'PA' => esc_html__( 'Panama', 'give' ),
293
-		'PG' => esc_html__( 'Papua New Guinea', 'give' ),
294
-		'PY' => esc_html__( 'Paraguay', 'give' ),
295
-		'PE' => esc_html__( 'Peru', 'give' ),
296
-		'PH' => esc_html__( 'Phillipines', 'give' ),
297
-		'PN' => esc_html__( 'Pitcairn Island', 'give' ),
298
-		'PL' => esc_html__( 'Poland', 'give' ),
299
-		'PT' => esc_html__( 'Portugal', 'give' ),
300
-		'PR' => esc_html__( 'Puerto Rico', 'give' ),
301
-		'QA' => esc_html__( 'Qatar', 'give' ),
302
-		'RE' => esc_html__( 'Reunion Island', 'give' ),
303
-		'RO' => esc_html__( 'Romania', 'give' ),
304
-		'RU' => esc_html__( 'Russian Federation', 'give' ),
305
-		'RW' => esc_html__( 'Rwanda', 'give' ),
306
-		'SH' => esc_html__( 'Saint Helena', 'give' ),
307
-		'KN' => esc_html__( 'Saint Kitts and Nevis', 'give' ),
308
-		'LC' => esc_html__( 'Saint Lucia', 'give' ),
309
-		'PM' => esc_html__( 'Saint Pierre and Miquelon', 'give' ),
310
-		'VC' => esc_html__( 'Saint Vincent and the Grenadines', 'give' ),
311
-		'SM' => esc_html__( 'San Marino', 'give' ),
312
-		'ST' => esc_html__( 'Sao Tome and Principe', 'give' ),
313
-		'SA' => esc_html__( 'Saudi Arabia', 'give' ),
314
-		'SN' => esc_html__( 'Senegal', 'give' ),
315
-		'RS' => esc_html__( 'Serbia', 'give' ),
316
-		'SC' => esc_html__( 'Seychelles', 'give' ),
317
-		'SL' => esc_html__( 'Sierra Leone', 'give' ),
318
-		'SG' => esc_html__( 'Singapore', 'give' ),
319
-		'SK' => esc_html__( 'Slovak Republic', 'give' ),
320
-		'SI' => esc_html__( 'Slovenia', 'give' ),
321
-		'SB' => esc_html__( 'Solomon Islands', 'give' ),
322
-		'SO' => esc_html__( 'Somalia', 'give' ),
323
-		'ZA' => esc_html__( 'South Africa', 'give' ),
324
-		'GS' => esc_html__( 'South Georgia', 'give' ),
325
-		'KR' => esc_html__( 'South Korea', 'give' ),
326
-		'ES' => esc_html__( 'Spain', 'give' ),
327
-		'LK' => esc_html__( 'Sri Lanka', 'give' ),
328
-		'SD' => esc_html__( 'Sudan', 'give' ),
329
-		'SR' => esc_html__( 'Suriname', 'give' ),
330
-		'SJ' => esc_html__( 'Svalbard and Jan Mayen Islands', 'give' ),
331
-		'SZ' => esc_html__( 'Swaziland', 'give' ),
332
-		'SE' => esc_html__( 'Sweden', 'give' ),
333
-		'CH' => esc_html__( 'Switzerland', 'give' ),
334
-		'SY' => esc_html__( 'Syrian Arab Republic', 'give' ),
335
-		'TW' => esc_html__( 'Taiwan', 'give' ),
336
-		'TJ' => esc_html__( 'Tajikistan', 'give' ),
337
-		'TZ' => esc_html__( 'Tanzania', 'give' ),
338
-		'TG' => esc_html__( 'Togo', 'give' ),
339
-		'TK' => esc_html__( 'Tokelau', 'give' ),
340
-		'TO' => esc_html__( 'Tonga', 'give' ),
341
-		'TH' => esc_html__( 'Thailand', 'give' ),
342
-		'TT' => esc_html__( 'Trinidad and Tobago', 'give' ),
343
-		'TN' => esc_html__( 'Tunisia', 'give' ),
344
-		'TR' => esc_html__( 'Turkey', 'give' ),
345
-		'TM' => esc_html__( 'Turkmenistan', 'give' ),
346
-		'TC' => esc_html__( 'Turks and Caicos Islands', 'give' ),
347
-		'TV' => esc_html__( 'Tuvalu', 'give' ),
348
-		'UG' => esc_html__( 'Uganda', 'give' ),
349
-		'UA' => esc_html__( 'Ukraine', 'give' ),
350
-		'AE' => esc_html__( 'United Arab Emirates', 'give' ),
351
-		'UY' => esc_html__( 'Uruguay', 'give' ),
352
-		'UM' => esc_html__( 'US Minor Outlying Islands', 'give' ),
353
-		'UZ' => esc_html__( 'Uzbekistan', 'give' ),
354
-		'VU' => esc_html__( 'Vanuatu', 'give' ),
355
-		'VE' => esc_html__( 'Venezuela', 'give' ),
356
-		'VN' => esc_html__( 'Vietnam', 'give' ),
357
-		'VG' => esc_html__( 'Virgin Islands (British)', 'give' ),
358
-		'VI' => esc_html__( 'Virgin Islands (USA)', 'give' ),
359
-		'WF' => esc_html__( 'Wallis and Futuna Islands', 'give' ),
360
-		'EH' => esc_html__( 'Western Sahara', 'give' ),
361
-		'WS' => esc_html__( 'Western Samoa', 'give' ),
362
-		'YE' => esc_html__( 'Yemen', 'give' ),
363
-		'YU' => esc_html__( 'Yugoslavia', 'give' ),
364
-		'ZM' => esc_html__( 'Zambia', 'give' ),
365
-		'ZW' => esc_html__( 'Zimbabwe', 'give' )
122
+		'US' => esc_html__('United States', 'give'),
123
+		'CA' => esc_html__('Canada', 'give'),
124
+		'GB' => esc_html__('United Kingdom', 'give'),
125
+		'AF' => esc_html__('Afghanistan', 'give'),
126
+		'AL' => esc_html__('Albania', 'give'),
127
+		'DZ' => esc_html__('Algeria', 'give'),
128
+		'AS' => esc_html__('American Samoa', 'give'),
129
+		'AD' => esc_html__('Andorra', 'give'),
130
+		'AO' => esc_html__('Angola', 'give'),
131
+		'AI' => esc_html__('Anguilla', 'give'),
132
+		'AQ' => esc_html__('Antarctica', 'give'),
133
+		'AG' => esc_html__('Antigua and Barbuda', 'give'),
134
+		'AR' => esc_html__('Argentina', 'give'),
135
+		'AM' => esc_html__('Armenia', 'give'),
136
+		'AW' => esc_html__('Aruba', 'give'),
137
+		'AU' => esc_html__('Australia', 'give'),
138
+		'AT' => esc_html__('Austria', 'give'),
139
+		'AZ' => esc_html__('Azerbaijan', 'give'),
140
+		'BS' => esc_html__('Bahamas', 'give'),
141
+		'BH' => esc_html__('Bahrain', 'give'),
142
+		'BD' => esc_html__('Bangladesh', 'give'),
143
+		'BB' => esc_html__('Barbados', 'give'),
144
+		'BY' => esc_html__('Belarus', 'give'),
145
+		'BE' => esc_html__('Belgium', 'give'),
146
+		'BZ' => esc_html__('Belize', 'give'),
147
+		'BJ' => esc_html__('Benin', 'give'),
148
+		'BM' => esc_html__('Bermuda', 'give'),
149
+		'BT' => esc_html__('Bhutan', 'give'),
150
+		'BO' => esc_html__('Bolivia', 'give'),
151
+		'BA' => esc_html__('Bosnia and Herzegovina', 'give'),
152
+		'BW' => esc_html__('Botswana', 'give'),
153
+		'BV' => esc_html__('Bouvet Island', 'give'),
154
+		'BR' => esc_html__('Brazil', 'give'),
155
+		'IO' => esc_html__('British Indian Ocean Territory', 'give'),
156
+		'BN' => esc_html__('Brunei Darrussalam', 'give'),
157
+		'BG' => esc_html__('Bulgaria', 'give'),
158
+		'BF' => esc_html__('Burkina Faso', 'give'),
159
+		'BI' => esc_html__('Burundi', 'give'),
160
+		'KH' => esc_html__('Cambodia', 'give'),
161
+		'CM' => esc_html__('Cameroon', 'give'),
162
+		'CV' => esc_html__('Cape Verde', 'give'),
163
+		'KY' => esc_html__('Cayman Islands', 'give'),
164
+		'CF' => esc_html__('Central African Republic', 'give'),
165
+		'TD' => esc_html__('Chad', 'give'),
166
+		'CL' => esc_html__('Chile', 'give'),
167
+		'CN' => esc_html__('China', 'give'),
168
+		'CX' => esc_html__('Christmas Island', 'give'),
169
+		'CC' => esc_html__('Cocos Islands', 'give'),
170
+		'CO' => esc_html__('Colombia', 'give'),
171
+		'KM' => esc_html__('Comoros', 'give'),
172
+		'CD' => esc_html__('Congo, Democratic People\'s Republic', 'give'),
173
+		'CG' => esc_html__('Congo, Republic of', 'give'),
174
+		'CK' => esc_html__('Cook Islands', 'give'),
175
+		'CR' => esc_html__('Costa Rica', 'give'),
176
+		'CI' => esc_html__('Cote d\'Ivoire', 'give'),
177
+		'HR' => esc_html__('Croatia/Hrvatska', 'give'),
178
+		'CU' => esc_html__('Cuba', 'give'),
179
+		'CY' => esc_html__('Cyprus Island', 'give'),
180
+		'CZ' => esc_html__('Czech Republic', 'give'),
181
+		'DK' => esc_html__('Denmark', 'give'),
182
+		'DJ' => esc_html__('Djibouti', 'give'),
183
+		'DM' => esc_html__('Dominica', 'give'),
184
+		'DO' => esc_html__('Dominican Republic', 'give'),
185
+		'TP' => esc_html__('East Timor', 'give'),
186
+		'EC' => esc_html__('Ecuador', 'give'),
187
+		'EG' => esc_html__('Egypt', 'give'),
188
+		'GQ' => esc_html__('Equatorial Guinea', 'give'),
189
+		'SV' => esc_html__('El Salvador', 'give'),
190
+		'ER' => esc_html__('Eritrea', 'give'),
191
+		'EE' => esc_html__('Estonia', 'give'),
192
+		'ET' => esc_html__('Ethiopia', 'give'),
193
+		'FK' => esc_html__('Falkland Islands', 'give'),
194
+		'FO' => esc_html__('Faroe Islands', 'give'),
195
+		'FJ' => esc_html__('Fiji', 'give'),
196
+		'FI' => esc_html__('Finland', 'give'),
197
+		'FR' => esc_html__('France', 'give'),
198
+		'GF' => esc_html__('French Guiana', 'give'),
199
+		'PF' => esc_html__('French Polynesia', 'give'),
200
+		'TF' => esc_html__('French Southern Territories', 'give'),
201
+		'GA' => esc_html__('Gabon', 'give'),
202
+		'GM' => esc_html__('Gambia', 'give'),
203
+		'GE' => esc_html__('Georgia', 'give'),
204
+		'DE' => esc_html__('Germany', 'give'),
205
+		'GR' => esc_html__('Greece', 'give'),
206
+		'GH' => esc_html__('Ghana', 'give'),
207
+		'GI' => esc_html__('Gibraltar', 'give'),
208
+		'GL' => esc_html__('Greenland', 'give'),
209
+		'GD' => esc_html__('Grenada', 'give'),
210
+		'GP' => esc_html__('Guadeloupe', 'give'),
211
+		'GU' => esc_html__('Guam', 'give'),
212
+		'GT' => esc_html__('Guatemala', 'give'),
213
+		'GG' => esc_html__('Guernsey', 'give'),
214
+		'GN' => esc_html__('Guinea', 'give'),
215
+		'GW' => esc_html__('Guinea-Bissau', 'give'),
216
+		'GY' => esc_html__('Guyana', 'give'),
217
+		'HT' => esc_html__('Haiti', 'give'),
218
+		'HM' => esc_html__('Heard and McDonald Islands', 'give'),
219
+		'VA' => esc_html__('Holy See (City Vatican State)', 'give'),
220
+		'HN' => esc_html__('Honduras', 'give'),
221
+		'HK' => esc_html__('Hong Kong', 'give'),
222
+		'HU' => esc_html__('Hungary', 'give'),
223
+		'IS' => esc_html__('Iceland', 'give'),
224
+		'IN' => esc_html__('India', 'give'),
225
+		'ID' => esc_html__('Indonesia', 'give'),
226
+		'IR' => esc_html__('Iran', 'give'),
227
+		'IQ' => esc_html__('Iraq', 'give'),
228
+		'IE' => esc_html__('Ireland', 'give'),
229
+		'IM' => esc_html__('Isle of Man', 'give'),
230
+		'IL' => esc_html__('Israel', 'give'),
231
+		'IT' => esc_html__('Italy', 'give'),
232
+		'JM' => esc_html__('Jamaica', 'give'),
233
+		'JP' => esc_html__('Japan', 'give'),
234
+		'JE' => esc_html__('Jersey', 'give'),
235
+		'JO' => esc_html__('Jordan', 'give'),
236
+		'KZ' => esc_html__('Kazakhstan', 'give'),
237
+		'KE' => esc_html__('Kenya', 'give'),
238
+		'KI' => esc_html__('Kiribati', 'give'),
239
+		'KW' => esc_html__('Kuwait', 'give'),
240
+		'KG' => esc_html__('Kyrgyzstan', 'give'),
241
+		'LA' => esc_html__('Lao People\'s Democratic Republic', 'give'),
242
+		'LV' => esc_html__('Latvia', 'give'),
243
+		'LB' => esc_html__('Lebanon', 'give'),
244
+		'LS' => esc_html__('Lesotho', 'give'),
245
+		'LR' => esc_html__('Liberia', 'give'),
246
+		'LY' => esc_html__('Libyan Arab Jamahiriya', 'give'),
247
+		'LI' => esc_html__('Liechtenstein', 'give'),
248
+		'LT' => esc_html__('Lithuania', 'give'),
249
+		'LU' => esc_html__('Luxembourg', 'give'),
250
+		'MO' => esc_html__('Macau', 'give'),
251
+		'MK' => esc_html__('Macedonia', 'give'),
252
+		'MG' => esc_html__('Madagascar', 'give'),
253
+		'MW' => esc_html__('Malawi', 'give'),
254
+		'MY' => esc_html__('Malaysia', 'give'),
255
+		'MV' => esc_html__('Maldives', 'give'),
256
+		'ML' => esc_html__('Mali', 'give'),
257
+		'MT' => esc_html__('Malta', 'give'),
258
+		'MH' => esc_html__('Marshall Islands', 'give'),
259
+		'MQ' => esc_html__('Martinique', 'give'),
260
+		'MR' => esc_html__('Mauritania', 'give'),
261
+		'MU' => esc_html__('Mauritius', 'give'),
262
+		'YT' => esc_html__('Mayotte', 'give'),
263
+		'MX' => esc_html__('Mexico', 'give'),
264
+		'FM' => esc_html__('Micronesia', 'give'),
265
+		'MD' => esc_html__('Moldova, Republic of', 'give'),
266
+		'MC' => esc_html__('Monaco', 'give'),
267
+		'MN' => esc_html__('Mongolia', 'give'),
268
+		'ME' => esc_html__('Montenegro', 'give'),
269
+		'MS' => esc_html__('Montserrat', 'give'),
270
+		'MA' => esc_html__('Morocco', 'give'),
271
+		'MZ' => esc_html__('Mozambique', 'give'),
272
+		'MM' => esc_html__('Myanmar', 'give'),
273
+		'NA' => esc_html__('Namibia', 'give'),
274
+		'NR' => esc_html__('Nauru', 'give'),
275
+		'NP' => esc_html__('Nepal', 'give'),
276
+		'NL' => esc_html__('Netherlands', 'give'),
277
+		'AN' => esc_html__('Netherlands Antilles', 'give'),
278
+		'NC' => esc_html__('New Caledonia', 'give'),
279
+		'NZ' => esc_html__('New Zealand', 'give'),
280
+		'NI' => esc_html__('Nicaragua', 'give'),
281
+		'NE' => esc_html__('Niger', 'give'),
282
+		'NG' => esc_html__('Nigeria', 'give'),
283
+		'NU' => esc_html__('Niue', 'give'),
284
+		'NF' => esc_html__('Norfolk Island', 'give'),
285
+		'KP' => esc_html__('North Korea', 'give'),
286
+		'MP' => esc_html__('Northern Mariana Islands', 'give'),
287
+		'NO' => esc_html__('Norway', 'give'),
288
+		'OM' => esc_html__('Oman', 'give'),
289
+		'PK' => esc_html__('Pakistan', 'give'),
290
+		'PW' => esc_html__('Palau', 'give'),
291
+		'PS' => esc_html__('Palestinian Territories', 'give'),
292
+		'PA' => esc_html__('Panama', 'give'),
293
+		'PG' => esc_html__('Papua New Guinea', 'give'),
294
+		'PY' => esc_html__('Paraguay', 'give'),
295
+		'PE' => esc_html__('Peru', 'give'),
296
+		'PH' => esc_html__('Phillipines', 'give'),
297
+		'PN' => esc_html__('Pitcairn Island', 'give'),
298
+		'PL' => esc_html__('Poland', 'give'),
299
+		'PT' => esc_html__('Portugal', 'give'),
300
+		'PR' => esc_html__('Puerto Rico', 'give'),
301
+		'QA' => esc_html__('Qatar', 'give'),
302
+		'RE' => esc_html__('Reunion Island', 'give'),
303
+		'RO' => esc_html__('Romania', 'give'),
304
+		'RU' => esc_html__('Russian Federation', 'give'),
305
+		'RW' => esc_html__('Rwanda', 'give'),
306
+		'SH' => esc_html__('Saint Helena', 'give'),
307
+		'KN' => esc_html__('Saint Kitts and Nevis', 'give'),
308
+		'LC' => esc_html__('Saint Lucia', 'give'),
309
+		'PM' => esc_html__('Saint Pierre and Miquelon', 'give'),
310
+		'VC' => esc_html__('Saint Vincent and the Grenadines', 'give'),
311
+		'SM' => esc_html__('San Marino', 'give'),
312
+		'ST' => esc_html__('Sao Tome and Principe', 'give'),
313
+		'SA' => esc_html__('Saudi Arabia', 'give'),
314
+		'SN' => esc_html__('Senegal', 'give'),
315
+		'RS' => esc_html__('Serbia', 'give'),
316
+		'SC' => esc_html__('Seychelles', 'give'),
317
+		'SL' => esc_html__('Sierra Leone', 'give'),
318
+		'SG' => esc_html__('Singapore', 'give'),
319
+		'SK' => esc_html__('Slovak Republic', 'give'),
320
+		'SI' => esc_html__('Slovenia', 'give'),
321
+		'SB' => esc_html__('Solomon Islands', 'give'),
322
+		'SO' => esc_html__('Somalia', 'give'),
323
+		'ZA' => esc_html__('South Africa', 'give'),
324
+		'GS' => esc_html__('South Georgia', 'give'),
325
+		'KR' => esc_html__('South Korea', 'give'),
326
+		'ES' => esc_html__('Spain', 'give'),
327
+		'LK' => esc_html__('Sri Lanka', 'give'),
328
+		'SD' => esc_html__('Sudan', 'give'),
329
+		'SR' => esc_html__('Suriname', 'give'),
330
+		'SJ' => esc_html__('Svalbard and Jan Mayen Islands', 'give'),
331
+		'SZ' => esc_html__('Swaziland', 'give'),
332
+		'SE' => esc_html__('Sweden', 'give'),
333
+		'CH' => esc_html__('Switzerland', 'give'),
334
+		'SY' => esc_html__('Syrian Arab Republic', 'give'),
335
+		'TW' => esc_html__('Taiwan', 'give'),
336
+		'TJ' => esc_html__('Tajikistan', 'give'),
337
+		'TZ' => esc_html__('Tanzania', 'give'),
338
+		'TG' => esc_html__('Togo', 'give'),
339
+		'TK' => esc_html__('Tokelau', 'give'),
340
+		'TO' => esc_html__('Tonga', 'give'),
341
+		'TH' => esc_html__('Thailand', 'give'),
342
+		'TT' => esc_html__('Trinidad and Tobago', 'give'),
343
+		'TN' => esc_html__('Tunisia', 'give'),
344
+		'TR' => esc_html__('Turkey', 'give'),
345
+		'TM' => esc_html__('Turkmenistan', 'give'),
346
+		'TC' => esc_html__('Turks and Caicos Islands', 'give'),
347
+		'TV' => esc_html__('Tuvalu', 'give'),
348
+		'UG' => esc_html__('Uganda', 'give'),
349
+		'UA' => esc_html__('Ukraine', 'give'),
350
+		'AE' => esc_html__('United Arab Emirates', 'give'),
351
+		'UY' => esc_html__('Uruguay', 'give'),
352
+		'UM' => esc_html__('US Minor Outlying Islands', 'give'),
353
+		'UZ' => esc_html__('Uzbekistan', 'give'),
354
+		'VU' => esc_html__('Vanuatu', 'give'),
355
+		'VE' => esc_html__('Venezuela', 'give'),
356
+		'VN' => esc_html__('Vietnam', 'give'),
357
+		'VG' => esc_html__('Virgin Islands (British)', 'give'),
358
+		'VI' => esc_html__('Virgin Islands (USA)', 'give'),
359
+		'WF' => esc_html__('Wallis and Futuna Islands', 'give'),
360
+		'EH' => esc_html__('Western Sahara', 'give'),
361
+		'WS' => esc_html__('Western Samoa', 'give'),
362
+		'YE' => esc_html__('Yemen', 'give'),
363
+		'YU' => esc_html__('Yugoslavia', 'give'),
364
+		'ZM' => esc_html__('Zambia', 'give'),
365
+		'ZW' => esc_html__('Zimbabwe', 'give')
366 366
 	);
367 367
 
368
-	return apply_filters( 'give_countries', $countries );
368
+	return apply_filters('give_countries', $countries);
369 369
 }
370 370
 
371 371
 /**
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 		'AP' => 'Armed Forces - Pacific'
447 447
 	);
448 448
 
449
-	return apply_filters( 'give_us_states', $states );
449
+	return apply_filters('give_us_states', $states);
450 450
 }
451 451
 
452 452
 /**
@@ -459,22 +459,22 @@  discard block
 block discarded – undo
459 459
 function give_get_provinces_list() {
460 460
 	$provinces = array(
461 461
 		''   => '',
462
-		'AB' => esc_html__('Alberta', 'give' ),
463
-		'BC' => esc_html__('British Columbia', 'give' ),
464
-		'MB' => esc_html__('Manitoba', 'give' ),
465
-		'NB' => esc_html__('New Brunswick', 'give' ),
466
-		'NL' => esc_html__('Newfoundland and Labrador', 'give' ),
467
-		'NS' => esc_html__('Nova Scotia', 'give' ),
468
-		'NT' => esc_html__('Northwest Territories', 'give' ),
469
-		'NU' => esc_html__('Nunavut', 'give' ),
470
-		'ON' => esc_html__('Ontario', 'give' ),
471
-		'PE' => esc_html__('Prince Edward Island', 'give' ),
472
-		'QC' => esc_html__('Quebec', 'give' ),
473
-		'SK' => esc_html__('Saskatchewan', 'give' ),
474
-		'YT' => esc_html__('Yukon', 'give' )
462
+		'AB' => esc_html__('Alberta', 'give'),
463
+		'BC' => esc_html__('British Columbia', 'give'),
464
+		'MB' => esc_html__('Manitoba', 'give'),
465
+		'NB' => esc_html__('New Brunswick', 'give'),
466
+		'NL' => esc_html__('Newfoundland and Labrador', 'give'),
467
+		'NS' => esc_html__('Nova Scotia', 'give'),
468
+		'NT' => esc_html__('Northwest Territories', 'give'),
469
+		'NU' => esc_html__('Nunavut', 'give'),
470
+		'ON' => esc_html__('Ontario', 'give'),
471
+		'PE' => esc_html__('Prince Edward Island', 'give'),
472
+		'QC' => esc_html__('Quebec', 'give'),
473
+		'SK' => esc_html__('Saskatchewan', 'give'),
474
+		'YT' => esc_html__('Yukon', 'give')
475 475
 	);
476 476
 
477
-	return apply_filters( 'give_canada_provinces', $provinces );
477
+	return apply_filters('give_canada_provinces', $provinces);
478 478
 }
479 479
 
480 480
 /**
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
 		'WA'  => 'Western Australia'
497 497
 	);
498 498
 
499
-	return apply_filters( 'give_australian_states', $states );
499
+	return apply_filters('give_australian_states', $states);
500 500
 }
501 501
 
502 502
 /**
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
 		'TO' => 'Tocantins'
538 538
 	);
539 539
 
540
-	return apply_filters( 'give_brazil_states', $states );
540
+	return apply_filters('give_brazil_states', $states);
541 541
 }
542 542
 
543 543
 /**
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 		'NEW TERRITORIES' => 'New Territories'
555 555
 	);
556 556
 
557
-	return apply_filters( 'give_hong_kong_states', $states );
557
+	return apply_filters('give_hong_kong_states', $states);
558 558
 }
559 559
 
560 560
 /**
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
 		'ZA' => 'Zala'
589 589
 	);
590 590
 
591
-	return apply_filters( 'give_hungary_states', $states );
591
+	return apply_filters('give_hungary_states', $states);
592 592
 }
593 593
 
594 594
 /**
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
 		'CN32' => 'Xinjiang / &#26032;&#30086;'
635 635
 	);
636 636
 
637
-	return apply_filters( 'give_chinese_states', $states );
637
+	return apply_filters('give_chinese_states', $states);
638 638
 }
639 639
 
640 640
 /**
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
 		'WC' => 'West Coast'
664 664
 	);
665 665
 
666
-	return apply_filters( 'give_new_zealand_states', $states );
666
+	return apply_filters('give_new_zealand_states', $states);
667 667
 }
668 668
 
669 669
 /**
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
 		'PB' => 'Papua Barat'
712 712
 	);
713 713
 
714
-	return apply_filters( 'give_indonesia_states', $states );
714
+	return apply_filters('give_indonesia_states', $states);
715 715
 }
716 716
 
717 717
 /**
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
 		'PY' => 'Pondicherry (Puducherry)'
762 762
 	);
763 763
 
764
-	return apply_filters( 'give_indian_states', $states );
764
+	return apply_filters('give_indian_states', $states);
765 765
 }
766 766
 
767 767
 /**
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
 		'PJY' => 'W.P. Putrajaya'
792 792
 	);
793 793
 
794
-	return apply_filters( 'give_malaysian_states', $states );
794
+	return apply_filters('give_malaysian_states', $states);
795 795
 }
796 796
 
797 797
 /**
@@ -814,7 +814,7 @@  discard block
 block discarded – undo
814 814
 		'WC'  => 'Western Cape'
815 815
 	);
816 816
 
817
-	return apply_filters( 'give_south_african_states', $states );
817
+	return apply_filters('give_south_african_states', $states);
818 818
 }
819 819
 
820 820
 /**
@@ -905,7 +905,7 @@  discard block
 block discarded – undo
905 905
 		'TH-35' => 'Yasothon (&#3618;&#3650;&#3626;&#3608;&#3619;)'
906 906
 	);
907 907
 
908
-	return apply_filters( 'give_thailand_states', $states );
908
+	return apply_filters('give_thailand_states', $states);
909 909
 }
910 910
 
911 911
 /**
@@ -917,59 +917,59 @@  discard block
 block discarded – undo
917 917
 function give_get_spain_states_list() {
918 918
 	$states = array(
919 919
 		''   => '',
920
-		'C'  => esc_html__( 'A Coru&ntilde;a', 'give' ),
921
-		'VI' => esc_html__( 'Álava', 'give' ),
922
-		'AB' => esc_html__( 'Albacete', 'give' ),
923
-		'A'  => esc_html__( 'Alicante', 'give' ),
924
-		'AL' => esc_html__( 'Almer&iacute;a', 'give' ),
925
-		'O'  => esc_html__( 'Asturias', 'give' ),
926
-		'AV' => esc_html__( '&Aacute;vila', 'give' ),
927
-		'BA' => esc_html__( 'Badajoz', 'give' ),
928
-		'PM' => esc_html__( 'Baleares', 'give' ),
929
-		'B'  => esc_html__( 'Barcelona', 'give' ),
930
-		'BU' => esc_html__( 'Burgos', 'give' ),
931
-		'CC' => esc_html__( 'C&aacute;ceres', 'give' ),
932
-		'CA' => esc_html__( 'C&aacute;diz', 'give' ),
933
-		'S'  => esc_html__( 'Cantabria', 'give' ),
934
-		'CS' => esc_html__( 'Castell&oacute;n', 'give' ),
935
-		'CE' => esc_html__( 'Ceuta', 'give' ),
936
-		'CR' => esc_html__( 'Ciudad Real', 'give' ),
937
-		'CO' => esc_html__( 'C&oacute;rdoba', 'give' ),
938
-		'CU' => esc_html__( 'Cuenca', 'give' ),
939
-		'GI' => esc_html__( 'Girona', 'give' ),
940
-		'GR' => esc_html__( 'Granada', 'give' ),
941
-		'GU' => esc_html__( 'Guadalajara', 'give' ),
942
-		'SS' => esc_html__( 'Gipuzkoa', 'give' ),
943
-		'H'  => esc_html__( 'Huelva', 'give' ),
944
-		'HU' => esc_html__( 'Huesca', 'give' ),
945
-		'J'  => esc_html__( 'Ja&eacute;n', 'give' ),
946
-		'LO' => esc_html__( 'La Rioja', 'give' ),
947
-		'GC' => esc_html__( 'Las Palmas', 'give' ),
948
-		'LE' => esc_html__( 'Le&oacute;n', 'give' ),
949
-		'L'  => esc_html__( 'Lleida', 'give' ),
950
-		'LU' => esc_html__( 'Lugo', 'give' ),
951
-		'M'  => esc_html__( 'Madrid', 'give' ),
952
-		'MA' => esc_html__( 'M&aacute;laga', 'give' ),
953
-		'ML' => esc_html__( 'Melilla', 'give' ),
954
-		'MU' => esc_html__( 'Murcia', 'give' ),
955
-		'NA' => esc_html__( 'Navarra', 'give' ),
956
-		'OR' => esc_html__( 'Ourense', 'give' ),
957
-		'P'  => esc_html__( 'Palencia', 'give' ),
958
-		'PO' => esc_html__( 'Pontevedra', 'give' ),
959
-		'SA' => esc_html__( 'Salamanca', 'give' ),
960
-		'TF' => esc_html__( 'Santa Cruz de Tenerife', 'give' ),
961
-		'SG' => esc_html__( 'Segovia', 'give' ),
962
-		'SE' => esc_html__( 'Sevilla', 'give' ),
963
-		'SO' => esc_html__( 'Soria', 'give' ),
964
-		'T'  => esc_html__( 'Tarragona', 'give' ),
965
-		'TE' => esc_html__( 'Teruel', 'give' ),
966
-		'TO' => esc_html__( 'Toledo', 'give' ),
967
-		'V'  => esc_html__( 'Valencia', 'give' ),
968
-		'VA' => esc_html__( 'Valladolid', 'give' ),
969
-		'BI' => esc_html__( 'Bizkaia', 'give' ),
970
-		'ZA' => esc_html__( 'Zamora', 'give' ),
971
-		'Z'  => esc_html__( 'Zaragoza', 'give' )
920
+		'C'  => esc_html__('A Coru&ntilde;a', 'give'),
921
+		'VI' => esc_html__('Álava', 'give'),
922
+		'AB' => esc_html__('Albacete', 'give'),
923
+		'A'  => esc_html__('Alicante', 'give'),
924
+		'AL' => esc_html__('Almer&iacute;a', 'give'),
925
+		'O'  => esc_html__('Asturias', 'give'),
926
+		'AV' => esc_html__('&Aacute;vila', 'give'),
927
+		'BA' => esc_html__('Badajoz', 'give'),
928
+		'PM' => esc_html__('Baleares', 'give'),
929
+		'B'  => esc_html__('Barcelona', 'give'),
930
+		'BU' => esc_html__('Burgos', 'give'),
931
+		'CC' => esc_html__('C&aacute;ceres', 'give'),
932
+		'CA' => esc_html__('C&aacute;diz', 'give'),
933
+		'S'  => esc_html__('Cantabria', 'give'),
934
+		'CS' => esc_html__('Castell&oacute;n', 'give'),
935
+		'CE' => esc_html__('Ceuta', 'give'),
936
+		'CR' => esc_html__('Ciudad Real', 'give'),
937
+		'CO' => esc_html__('C&oacute;rdoba', 'give'),
938
+		'CU' => esc_html__('Cuenca', 'give'),
939
+		'GI' => esc_html__('Girona', 'give'),
940
+		'GR' => esc_html__('Granada', 'give'),
941
+		'GU' => esc_html__('Guadalajara', 'give'),
942
+		'SS' => esc_html__('Gipuzkoa', 'give'),
943
+		'H'  => esc_html__('Huelva', 'give'),
944
+		'HU' => esc_html__('Huesca', 'give'),
945
+		'J'  => esc_html__('Ja&eacute;n', 'give'),
946
+		'LO' => esc_html__('La Rioja', 'give'),
947
+		'GC' => esc_html__('Las Palmas', 'give'),
948
+		'LE' => esc_html__('Le&oacute;n', 'give'),
949
+		'L'  => esc_html__('Lleida', 'give'),
950
+		'LU' => esc_html__('Lugo', 'give'),
951
+		'M'  => esc_html__('Madrid', 'give'),
952
+		'MA' => esc_html__('M&aacute;laga', 'give'),
953
+		'ML' => esc_html__('Melilla', 'give'),
954
+		'MU' => esc_html__('Murcia', 'give'),
955
+		'NA' => esc_html__('Navarra', 'give'),
956
+		'OR' => esc_html__('Ourense', 'give'),
957
+		'P'  => esc_html__('Palencia', 'give'),
958
+		'PO' => esc_html__('Pontevedra', 'give'),
959
+		'SA' => esc_html__('Salamanca', 'give'),
960
+		'TF' => esc_html__('Santa Cruz de Tenerife', 'give'),
961
+		'SG' => esc_html__('Segovia', 'give'),
962
+		'SE' => esc_html__('Sevilla', 'give'),
963
+		'SO' => esc_html__('Soria', 'give'),
964
+		'T'  => esc_html__('Tarragona', 'give'),
965
+		'TE' => esc_html__('Teruel', 'give'),
966
+		'TO' => esc_html__('Toledo', 'give'),
967
+		'V'  => esc_html__('Valencia', 'give'),
968
+		'VA' => esc_html__('Valladolid', 'give'),
969
+		'BI' => esc_html__('Bizkaia', 'give'),
970
+		'ZA' => esc_html__('Zamora', 'give'),
971
+		'Z'  => esc_html__('Zaragoza', 'give')
972 972
 	);
973 973
 
974
-	return apply_filters( 'give_spain_states', $states );
974
+	return apply_filters('give_spain_states', $states);
975 975
 }
Please login to merge, or discard this patch.
includes/deprecated/deprecated-actions.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
  */
5 5
 $give_map_deprecated_actions = give_deprecated_actions();
6 6
 
7
-foreach ( $give_map_deprecated_actions as $new => $old ) {
8
-	add_action( $new, 'give_deprecated_action_mapping', 10, 4 );
7
+foreach ($give_map_deprecated_actions as $new => $old) {
8
+	add_action($new, 'give_deprecated_action_mapping', 10, 4);
9 9
 }
10 10
 
11 11
 /**
@@ -59,20 +59,20 @@  discard block
 block discarded – undo
59 59
  *
60 60
  * @return mixed|void
61 61
  */
62
-function give_deprecated_action_mapping( $data, $arg_1 = '', $arg_2 = '', $arg_3 = '' ) {
62
+function give_deprecated_action_mapping($data, $arg_1 = '', $arg_2 = '', $arg_3 = '') {
63 63
 	$give_map_deprecated_actions = give_deprecated_actions();
64 64
 	$action                      = current_filter();
65 65
 
66
-	if ( isset( $give_map_deprecated_actions[ $action ] ) ) {
67
-		if ( has_action( $give_map_deprecated_actions[ $action ] ) ) {
68
-			do_action( $give_map_deprecated_actions[ $action ], $data, $arg_1, $arg_2, $arg_3 );
66
+	if (isset($give_map_deprecated_actions[$action])) {
67
+		if (has_action($give_map_deprecated_actions[$action])) {
68
+			do_action($give_map_deprecated_actions[$action], $data, $arg_1, $arg_2, $arg_3);
69 69
 
70
-			if ( ! defined( 'DOING_AJAX' ) ) {
70
+			if ( ! defined('DOING_AJAX')) {
71 71
 				// translators: %s: action name.
72 72
 				_give_deprecated_function(
73 73
 					sprintf(
74
-						__( 'The %s action' ),
75
-						$give_map_deprecated_actions[ $action ]
74
+						__('The %s action'),
75
+						$give_map_deprecated_actions[$action]
76 76
 					),
77 77
 					'1.7',
78 78
 					$action
Please login to merge, or discard this patch.
includes/deprecated/deprecated-filters.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@  discard block
 block discarded – undo
4 4
  */
5 5
 $give_map_deprecated_filters = give_deprecated_filters();
6 6
 
7
-foreach ( $give_map_deprecated_filters as $new => $old ) {
8
-	add_filter( $new, 'give_deprecated_filter_mapping', 10, 4 );
7
+foreach ($give_map_deprecated_filters as $new => $old) {
8
+	add_filter($new, 'give_deprecated_filter_mapping', 10, 4);
9 9
 }
10 10
 
11 11
 /**
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
 	);
29 29
 
30 30
 	// Dynamic filters.
31
-	switch ( true ) {
32
-		case ( ! empty( $_GET['payment-confirmation'] ) ) :
31
+	switch (true) {
32
+		case ( ! empty($_GET['payment-confirmation'])) :
33 33
 			$give_deprecated_filters["give_donation_confirm_{$_GET['payment-confirmation']}"] = "give_payment_confirm_{$_GET['payment-confirmation']}";
34 34
 	}
35 35
 
@@ -46,20 +46,20 @@  discard block
 block discarded – undo
46 46
  *
47 47
  * @return mixed|void
48 48
  */
49
-function give_deprecated_filter_mapping( $data, $arg_1 = '', $arg_2 = '', $arg_3 = '' ) {
49
+function give_deprecated_filter_mapping($data, $arg_1 = '', $arg_2 = '', $arg_3 = '') {
50 50
 	$give_map_deprecated_filters = give_deprecated_filters();
51 51
 	$filter = current_filter();
52 52
 
53
-	if ( isset( $give_map_deprecated_filters[ $filter ] ) ) {
54
-		if ( has_filter( $give_map_deprecated_filters[ $filter ] ) ) {
55
-			$data = apply_filters( $give_map_deprecated_filters[ $filter ], $data, $arg_1, $arg_2, $arg_3 );
53
+	if (isset($give_map_deprecated_filters[$filter])) {
54
+		if (has_filter($give_map_deprecated_filters[$filter])) {
55
+			$data = apply_filters($give_map_deprecated_filters[$filter], $data, $arg_1, $arg_2, $arg_3);
56 56
 
57
-			if ( ! defined( 'DOING_AJAX' ) ) {
57
+			if ( ! defined('DOING_AJAX')) {
58 58
 				_give_deprecated_function(
59 59
 					sprintf(
60 60
 						/* translators: %s: filter name */
61
-						__( 'The %s filter' ),
62
-						$give_map_deprecated_filters[ $filter ]
61
+						__('The %s filter'),
62
+						$give_map_deprecated_filters[$filter]
63 63
 					),
64 64
 					'1.7',
65 65
 					$filter
Please login to merge, or discard this patch.
includes/class-give-session.php 1 patch
Spacing   +61 added lines, -61 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
 
@@ -74,53 +74,53 @@  discard block
 block discarded – undo
74 74
 	public function __construct() {
75 75
 
76 76
 		$this->use_php_sessions = $this->use_php_sessions();
77
-		$this->exp_option       = give_get_option( 'session_lifetime' );
77
+		$this->exp_option       = give_get_option('session_lifetime');
78 78
 
79 79
 		// PHP Sessions.
80
-		if ( $this->use_php_sessions ) {
80
+		if ($this->use_php_sessions) {
81 81
 
82
-			if ( is_multisite() ) {
82
+			if (is_multisite()) {
83 83
 
84
-				$this->prefix = '_' . get_current_blog_id();
84
+				$this->prefix = '_'.get_current_blog_id();
85 85
 
86 86
 			}
87 87
 
88
-			add_action( 'init', array( $this, 'maybe_start_session' ), - 2 );
88
+			add_action('init', array($this, 'maybe_start_session'), - 2);
89 89
 
90 90
 		} else {
91 91
 
92
-			if ( ! $this->should_start_session() ) {
92
+			if ( ! $this->should_start_session()) {
93 93
 				return;
94 94
 			}
95 95
 
96 96
 			// Use WP_Session.
97
-			if ( ! defined( 'WP_SESSION_COOKIE' ) ) {
98
-				define( 'WP_SESSION_COOKIE', 'give_wp_session' );
97
+			if ( ! defined('WP_SESSION_COOKIE')) {
98
+				define('WP_SESSION_COOKIE', 'give_wp_session');
99 99
 			}
100 100
 
101
-			if ( ! class_exists( 'Recursive_ArrayAccess' ) ) {
102
-				require_once GIVE_PLUGIN_DIR . 'includes/libraries/sessions/class-recursive-arrayaccess.php';
101
+			if ( ! class_exists('Recursive_ArrayAccess')) {
102
+				require_once GIVE_PLUGIN_DIR.'includes/libraries/sessions/class-recursive-arrayaccess.php';
103 103
 			}
104 104
 
105
-			if ( ! class_exists( 'WP_Session' ) ) {
106
-				require_once GIVE_PLUGIN_DIR . 'includes/libraries/sessions/class-wp-session.php';
107
-				require_once GIVE_PLUGIN_DIR . 'includes/libraries/sessions/wp-session.php';
105
+			if ( ! class_exists('WP_Session')) {
106
+				require_once GIVE_PLUGIN_DIR.'includes/libraries/sessions/class-wp-session.php';
107
+				require_once GIVE_PLUGIN_DIR.'includes/libraries/sessions/wp-session.php';
108 108
 			}
109 109
 
110
-			add_filter( 'wp_session_expiration_variant', array( $this, 'set_expiration_variant_time' ), 99999 );
111
-			add_filter( 'wp_session_expiration', array( $this, 'set_expiration_time' ), 99999 );
110
+			add_filter('wp_session_expiration_variant', array($this, 'set_expiration_variant_time'), 99999);
111
+			add_filter('wp_session_expiration', array($this, 'set_expiration_time'), 99999);
112 112
 
113 113
 		}
114 114
 
115 115
 		// Init Session.
116
-		if ( empty( $this->session ) && ! $this->use_php_sessions ) {
117
-			add_action( 'plugins_loaded', array( $this, 'init' ), - 1 );
116
+		if (empty($this->session) && ! $this->use_php_sessions) {
117
+			add_action('plugins_loaded', array($this, 'init'), - 1);
118 118
 		} else {
119
-			add_action( 'init', array( $this, 'init' ), - 1 );
119
+			add_action('init', array($this, 'init'), - 1);
120 120
 		}
121 121
 
122 122
 		// Set cookie on Donation Completion page.
123
-		add_action( 'give_pre_process_donation', array( $this, 'set_session_cookies' ) );
123
+		add_action('give_pre_process_donation', array($this, 'set_session_cookies'));
124 124
 
125 125
 	}
126 126
 
@@ -136,8 +136,8 @@  discard block
 block discarded – undo
136 136
 	 */
137 137
 	public function init() {
138 138
 
139
-		if ( $this->use_php_sessions ) {
140
-			$this->session = isset( $_SESSION[ 'give' . $this->prefix ] ) && is_array( $_SESSION[ 'give' . $this->prefix ] ) ? $_SESSION[ 'give' . $this->prefix ] : array();
139
+		if ($this->use_php_sessions) {
140
+			$this->session = isset($_SESSION['give'.$this->prefix]) && is_array($_SESSION['give'.$this->prefix]) ? $_SESSION['give'.$this->prefix] : array();
141 141
 		} else {
142 142
 			$this->session = WP_Session::get_instance();
143 143
 		}
@@ -172,10 +172,10 @@  discard block
 block discarded – undo
172 172
 	 *
173 173
 	 * @return string      Session variable.
174 174
 	 */
175
-	public function get( $key ) {
176
-		$key = sanitize_key( $key );
175
+	public function get($key) {
176
+		$key = sanitize_key($key);
177 177
 
178
-		return isset( $this->session[ $key ] ) ? maybe_unserialize( $this->session[ $key ] ) : false;
178
+		return isset($this->session[$key]) ? maybe_unserialize($this->session[$key]) : false;
179 179
 
180 180
 	}
181 181
 
@@ -192,21 +192,21 @@  discard block
 block discarded – undo
192 192
 	 *
193 193
 	 * @return string        Session variable.
194 194
 	 */
195
-	public function set( $key, $value ) {
195
+	public function set($key, $value) {
196 196
 
197
-		$key = sanitize_key( $key );
197
+		$key = sanitize_key($key);
198 198
 
199
-		if ( is_array( $value ) ) {
200
-			$this->session[ $key ] = serialize( $value );
199
+		if (is_array($value)) {
200
+			$this->session[$key] = serialize($value);
201 201
 		} else {
202
-			$this->session[ $key ] = $value;
202
+			$this->session[$key] = $value;
203 203
 		}
204 204
 
205
-		if ( $this->use_php_sessions ) {
206
-			$_SESSION[ 'give' . $this->prefix ] = $this->session;
205
+		if ($this->use_php_sessions) {
206
+			$_SESSION['give'.$this->prefix] = $this->session;
207 207
 		}
208 208
 
209
-		return $this->session[ $key ];
209
+		return $this->session[$key];
210 210
 	}
211 211
 
212 212
 	/**
@@ -220,10 +220,10 @@  discard block
 block discarded – undo
220 220
 	 * @hook
221 221
 	 */
222 222
 	public function set_session_cookies() {
223
-		if ( ! headers_sent() ) {
224
-			$lifetime = current_time( 'timestamp' ) + $this->set_expiration_time();
225
-			@setcookie( session_name(), session_id(), $lifetime, COOKIEPATH, COOKIE_DOMAIN, false );
226
-			@setcookie( session_name() . '_expiration', $lifetime, $lifetime, COOKIEPATH, COOKIE_DOMAIN, false );
223
+		if ( ! headers_sent()) {
224
+			$lifetime = current_time('timestamp') + $this->set_expiration_time();
225
+			@setcookie(session_name(), session_id(), $lifetime, COOKIEPATH, COOKIE_DOMAIN, false);
226
+			@setcookie(session_name().'_expiration', $lifetime, $lifetime, COOKIEPATH, COOKIE_DOMAIN, false);
227 227
 		}
228 228
 	}
229 229
 
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 	 */
240 240
 	public function set_expiration_variant_time() {
241 241
 
242
-		return ( ! empty( $this->exp_option ) ? ( intval( $this->exp_option ) - 3600 ) : 30 * 60 * 23 );
242
+		return ( ! empty($this->exp_option) ? (intval($this->exp_option) - 3600) : 30 * 60 * 23);
243 243
 	}
244 244
 
245 245
 	/**
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 	 */
255 255
 	public function set_expiration_time() {
256 256
 
257
-		return ( ! empty( $this->exp_option ) ? intval( $this->exp_option ) : 30 * 60 * 24 );
257
+		return ( ! empty($this->exp_option) ? intval($this->exp_option) : 30 * 60 * 24);
258 258
 	}
259 259
 
260 260
 	/**
@@ -272,21 +272,21 @@  discard block
 block discarded – undo
272 272
 		$ret = false;
273 273
 
274 274
 		// If the database variable is already set, no need to run auto detection.
275
-		$give_use_php_sessions = (bool) get_option( 'give_use_php_sessions' );
275
+		$give_use_php_sessions = (bool) get_option('give_use_php_sessions');
276 276
 
277
-		if ( ! $give_use_php_sessions ) {
277
+		if ( ! $give_use_php_sessions) {
278 278
 
279 279
 			// Attempt to detect if the server supports PHP sessions.
280
-			if ( function_exists( 'session_start' ) && ! ini_get( 'safe_mode' ) ) {
280
+			if (function_exists('session_start') && ! ini_get('safe_mode')) {
281 281
 
282
-				$this->set( 'give_use_php_sessions', 1 );
282
+				$this->set('give_use_php_sessions', 1);
283 283
 
284
-				if ( $this->get( 'give_use_php_sessions' ) ) {
284
+				if ($this->get('give_use_php_sessions')) {
285 285
 
286 286
 					$ret = true;
287 287
 
288 288
 					// Set the database option.
289
-					update_option( 'give_use_php_sessions', true );
289
+					update_option('give_use_php_sessions', true);
290 290
 
291 291
 				}
292 292
 			}
@@ -296,13 +296,13 @@  discard block
 block discarded – undo
296 296
 		}
297 297
 
298 298
 		// Enable or disable PHP Sessions based on the GIVE_USE_PHP_SESSIONS constant.
299
-		if ( defined( 'GIVE_USE_PHP_SESSIONS' ) && GIVE_USE_PHP_SESSIONS ) {
299
+		if (defined('GIVE_USE_PHP_SESSIONS') && GIVE_USE_PHP_SESSIONS) {
300 300
 			$ret = true;
301
-		} elseif ( defined( 'GIVE_USE_PHP_SESSIONS' ) && ! GIVE_USE_PHP_SESSIONS ) {
301
+		} elseif (defined('GIVE_USE_PHP_SESSIONS') && ! GIVE_USE_PHP_SESSIONS) {
302 302
 			$ret = false;
303 303
 		}
304 304
 
305
-		return (bool) apply_filters( 'give_use_php_sessions', $ret );
305
+		return (bool) apply_filters('give_use_php_sessions', $ret);
306 306
 	}
307 307
 
308 308
 	/**
@@ -319,9 +319,9 @@  discard block
 block discarded – undo
319 319
 
320 320
 		$start_session = true;
321 321
 
322
-		if ( ! empty( $_SERVER['REQUEST_URI'] ) ) {
322
+		if ( ! empty($_SERVER['REQUEST_URI'])) {
323 323
 
324
-			$blacklist = apply_filters( 'give_session_start_uri_blacklist', array(
324
+			$blacklist = apply_filters('give_session_start_uri_blacklist', array(
325 325
 				'feed',
326 326
 				'feed',
327 327
 				'feed/rss',
@@ -329,21 +329,21 @@  discard block
 block discarded – undo
329 329
 				'feed/rdf',
330 330
 				'feed/atom',
331 331
 				'comments/feed/',
332
-			) );
333
-			$uri       = ltrim( $_SERVER['REQUEST_URI'], '/' );
334
-			$uri       = untrailingslashit( $uri );
335
-			if ( in_array( $uri, $blacklist ) ) {
332
+			));
333
+			$uri       = ltrim($_SERVER['REQUEST_URI'], '/');
334
+			$uri       = untrailingslashit($uri);
335
+			if (in_array($uri, $blacklist)) {
336 336
 				$start_session = false;
337 337
 			}
338
-			if ( false !== strpos( $uri, 'feed=' ) ) {
338
+			if (false !== strpos($uri, 'feed=')) {
339 339
 				$start_session = false;
340 340
 			}
341
-			if ( is_admin() ) {
341
+			if (is_admin()) {
342 342
 				$start_session = false;
343 343
 			}
344 344
 		}
345 345
 
346
-		return apply_filters( 'give_start_session', $start_session );
346
+		return apply_filters('give_start_session', $start_session);
347 347
 	}
348 348
 
349 349
 	/**
@@ -359,11 +359,11 @@  discard block
 block discarded – undo
359 359
 	 */
360 360
 	public function maybe_start_session() {
361 361
 
362
-		if ( ! $this->should_start_session() ) {
362
+		if ( ! $this->should_start_session()) {
363 363
 			return;
364 364
 		}
365 365
 
366
-		if ( ! session_id() && ! headers_sent() ) {
366
+		if ( ! session_id() && ! headers_sent()) {
367 367
 			session_start();
368 368
 		}
369 369
 
@@ -382,9 +382,9 @@  discard block
 block discarded – undo
382 382
 
383 383
 		$expiration = false;
384 384
 
385
-		if ( session_id() && isset( $_COOKIE[ session_name() . '_expiration' ] ) ) {
385
+		if (session_id() && isset($_COOKIE[session_name().'_expiration'])) {
386 386
 
387
-			$expiration = date( 'D, d M Y h:i:s', intval( $_COOKIE[ session_name() . '_expiration' ] ) );
387
+			$expiration = date('D, d M Y h:i:s', intval($_COOKIE[session_name().'_expiration']));
388 388
 
389 389
 		}
390 390
 
Please login to merge, or discard this patch.
includes/emails/actions.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -23,17 +23,17 @@  discard block
 block discarded – undo
23 23
  *
24 24
  * @return void
25 25
  */
26
-function give_trigger_donation_receipt( $payment_id ) {
26
+function give_trigger_donation_receipt($payment_id) {
27 27
 	// Make sure we don't send a receipt while editing a donation.
28
-	if ( isset( $_POST['give-action'] ) && 'edit_payment' == $_POST['give-action'] ) {
28
+	if (isset($_POST['give-action']) && 'edit_payment' == $_POST['give-action']) {
29 29
 		return;
30 30
 	}
31 31
 
32 32
 	// Send email.
33
-	give_email_donation_receipt( $payment_id );
33
+	give_email_donation_receipt($payment_id);
34 34
 }
35 35
 
36
-add_action( 'give_complete_donation', 'give_trigger_donation_receipt', 999, 1 );
36
+add_action('give_complete_donation', 'give_trigger_donation_receipt', 999, 1);
37 37
 
38 38
 /**
39 39
  * Resend the Email Donation Receipt. (This can be done from the Donation History Page)
@@ -44,29 +44,29 @@  discard block
 block discarded – undo
44 44
  *
45 45
  * @return void
46 46
  */
47
-function give_resend_donation_receipt( $data ) {
47
+function give_resend_donation_receipt($data) {
48 48
 
49
-	$purchase_id = absint( $data['purchase_id'] );
49
+	$purchase_id = absint($data['purchase_id']);
50 50
 
51
-	if ( empty( $purchase_id ) ) {
51
+	if (empty($purchase_id)) {
52 52
 		return;
53 53
 	}
54 54
 
55
-	if ( ! current_user_can( 'edit_give_payments', $purchase_id ) ) {
56
-		wp_die( esc_html__( 'You do not have permission to edit payments.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
55
+	if ( ! current_user_can('edit_give_payments', $purchase_id)) {
56
+		wp_die(esc_html__('You do not have permission to edit payments.', 'give'), esc_html__('Error', 'give'), array('response' => 403));
57 57
 	}
58 58
 
59
-	give_email_donation_receipt( $purchase_id, false );
59
+	give_email_donation_receipt($purchase_id, false);
60 60
 
61
-	wp_redirect( add_query_arg( array(
61
+	wp_redirect(add_query_arg(array(
62 62
 		'give-message' => 'email_sent',
63 63
 		'give-action'  => false,
64 64
 		'purchase_id'  => false
65
-	) ) );
65
+	)));
66 66
 	exit;
67 67
 }
68 68
 
69
-add_action( 'give_email_links', 'give_resend_donation_receipt' );
69
+add_action('give_email_links', 'give_resend_donation_receipt');
70 70
 
71 71
 /**
72 72
  * Trigger the sending of a Test Email
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
77 77
  *
78 78
  * @return void
79 79
  */
80
-function give_send_test_email( $data ) {
81
-	if ( ! wp_verify_nonce( $data['_wpnonce'], 'give-test-email' ) ) {
80
+function give_send_test_email($data) {
81
+	if ( ! wp_verify_nonce($data['_wpnonce'], 'give-test-email')) {
82 82
 		return;
83 83
 	}
84 84
 
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 	give_email_test_donation_receipt();
87 87
 
88 88
 	// Remove the test email query arg.
89
-	wp_redirect( remove_query_arg( 'give_action' ) );
89
+	wp_redirect(remove_query_arg('give_action'));
90 90
 	exit;
91 91
 }
92 92
 
93
-add_action( 'give_send_test_email', 'give_send_test_email' );
93
+add_action('give_send_test_email', 'give_send_test_email');
Please login to merge, or discard this patch.
includes/payments/actions.php 1 patch
Spacing   +59 added lines, -59 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
 
@@ -28,21 +28,21 @@  discard block
 block discarded – undo
28 28
  *
29 29
  * @return void
30 30
  */
31
-function give_complete_purchase( $payment_id, $new_status, $old_status ) {
31
+function give_complete_purchase($payment_id, $new_status, $old_status) {
32 32
 
33 33
 	// Make sure that payments are only completed once.
34
-	if ( $old_status == 'publish' || $old_status == 'complete' ) {
34
+	if ($old_status == 'publish' || $old_status == 'complete') {
35 35
 		return;
36 36
 	}
37 37
 
38 38
 	// Make sure the payment completion is only processed when new status is complete.
39
-	if ( $new_status != 'publish' && $new_status != 'complete' ) {
39
+	if ($new_status != 'publish' && $new_status != 'complete') {
40 40
 		return;
41 41
 	}
42 42
 
43
-	$payment = new Give_Payment( $payment_id );
43
+	$payment = new Give_Payment($payment_id);
44 44
 
45
-	$creation_date  = get_post_field( 'post_date', $payment_id, 'raw' );
45
+	$creation_date  = get_post_field('post_date', $payment_id, 'raw');
46 46
 	$payment_meta   = $payment->payment_meta;
47 47
 	$completed_date = $payment->completed_date;
48 48
 	$user_info      = $payment->user_info;
@@ -58,12 +58,12 @@  discard block
 block discarded – undo
58 58
 	 *
59 59
 	 * @param int $payment_id The ID of the payment.
60 60
 	 */
61
-	do_action( 'give_pre_complete_purchase', $payment_id );
61
+	do_action('give_pre_complete_purchase', $payment_id);
62 62
 
63 63
 	// Ensure these actions only run once, ever.
64
-	if ( empty( $completed_date ) ) {
64
+	if (empty($completed_date)) {
65 65
 
66
-		give_record_sale_in_log( $form_id, $payment_id, $price_id, $creation_date );
66
+		give_record_sale_in_log($form_id, $payment_id, $price_id, $creation_date);
67 67
 
68 68
 		/**
69 69
 		 * Fires after logging donation record.
@@ -74,32 +74,32 @@  discard block
 block discarded – undo
74 74
 		 * @param int   $payment_id   The ID number of the payment.
75 75
 		 * @param array $payment_meta The payment meta.
76 76
 		 */
77
-		do_action( 'give_complete_form_donation', $form_id, $payment_id, $payment_meta );
77
+		do_action('give_complete_form_donation', $form_id, $payment_id, $payment_meta);
78 78
 
79 79
 	}
80 80
 
81 81
 	// Increase the earnings for this form ID.
82
-	give_increase_earnings( $form_id, $amount );
83
-	give_increase_purchase_count( $form_id );
82
+	give_increase_earnings($form_id, $amount);
83
+	give_increase_purchase_count($form_id);
84 84
 
85 85
 	// Clear the total earnings cache.
86
-	delete_transient( 'give_earnings_total' );
86
+	delete_transient('give_earnings_total');
87 87
 	// Clear the This Month earnings (this_monththis_month is NOT a typo).
88
-	delete_transient( md5( 'give_earnings_this_monththis_month' ) );
89
-	delete_transient( md5( 'give_earnings_todaytoday' ) );
88
+	delete_transient(md5('give_earnings_this_monththis_month'));
89
+	delete_transient(md5('give_earnings_todaytoday'));
90 90
 
91 91
 	// Increase the donor's donation stats.
92
-	$customer = new Give_Customer( $customer_id );
92
+	$customer = new Give_Customer($customer_id);
93 93
 	$customer->increase_purchase_count();
94
-	$customer->increase_value( $amount );
94
+	$customer->increase_value($amount);
95 95
 
96
-	give_increase_total_earnings( $amount );
96
+	give_increase_total_earnings($amount);
97 97
 
98 98
 	// Ensure this action only runs once ever.
99
-	if ( empty( $completed_date ) ) {
99
+	if (empty($completed_date)) {
100 100
 
101 101
 		// Save the completed date.
102
-		$payment->completed_date = current_time( 'mysql' );
102
+		$payment->completed_date = current_time('mysql');
103 103
 		$payment->save();
104 104
 
105 105
 		/**
@@ -109,12 +109,12 @@  discard block
 block discarded – undo
109 109
 		 *
110 110
 		 * @param int $payment_id The ID of the payment.
111 111
 		 */
112
-		do_action( 'give_complete_donation', $payment_id );
112
+		do_action('give_complete_donation', $payment_id);
113 113
 	}
114 114
 
115 115
 }
116 116
 
117
-add_action( 'give_update_payment_status', 'give_complete_purchase', 100, 3 );
117
+add_action('give_update_payment_status', 'give_complete_purchase', 100, 3);
118 118
 
119 119
 
120 120
 /**
@@ -128,24 +128,24 @@  discard block
 block discarded – undo
128 128
  *
129 129
  * @return void
130 130
  */
131
-function give_record_status_change( $payment_id, $new_status, $old_status ) {
131
+function give_record_status_change($payment_id, $new_status, $old_status) {
132 132
 
133 133
 	// Get the list of statuses so that status in the payment note can be translated.
134 134
 	$stati      = give_get_payment_statuses();
135
-	$old_status = isset( $stati[ $old_status ] ) ? $stati[ $old_status ] : $old_status;
136
-	$new_status = isset( $stati[ $new_status ] ) ? $stati[ $new_status ] : $new_status;
135
+	$old_status = isset($stati[$old_status]) ? $stati[$old_status] : $old_status;
136
+	$new_status = isset($stati[$new_status]) ? $stati[$new_status] : $new_status;
137 137
 
138 138
 	// translators: 1: old status 2: new status.
139 139
 	$status_change = sprintf(
140
-		esc_html__( 'Status changed from %1$s to %2$s.', 'give' ),
140
+		esc_html__('Status changed from %1$s to %2$s.', 'give'),
141 141
 		$old_status,
142 142
 		$new_status
143 143
 	);
144 144
 
145
-	give_insert_payment_note( $payment_id, $status_change );
145
+	give_insert_payment_note($payment_id, $status_change);
146 146
 }
147 147
 
148
-add_action( 'give_update_payment_status', 'give_record_status_change', 100, 3 );
148
+add_action('give_update_payment_status', 'give_record_status_change', 100, 3);
149 149
 
150 150
 
151 151
 /**
@@ -162,17 +162,17 @@  discard block
 block discarded – undo
162 162
  *
163 163
  * @return void
164 164
  */
165
-function give_clear_user_history_cache( $payment_id, $new_status, $old_status ) {
165
+function give_clear_user_history_cache($payment_id, $new_status, $old_status) {
166 166
 
167
-	$payment = new Give_Payment( $payment_id );
167
+	$payment = new Give_Payment($payment_id);
168 168
 
169
-	if ( ! empty( $payment->user_id ) ) {
170
-		delete_transient( 'give_user_' . $payment->user_id . '_purchases' );
169
+	if ( ! empty($payment->user_id)) {
170
+		delete_transient('give_user_'.$payment->user_id.'_purchases');
171 171
 	}
172 172
 
173 173
 }
174 174
 
175
-add_action( 'give_update_payment_status', 'give_clear_user_history_cache', 10, 3 );
175
+add_action('give_update_payment_status', 'give_clear_user_history_cache', 10, 3);
176 176
 
177 177
 /**
178 178
  * Update Old Payments Totals
@@ -187,25 +187,25 @@  discard block
 block discarded – undo
187 187
  *
188 188
  * @return void
189 189
  */
190
-function give_update_old_payments_with_totals( $data ) {
191
-	if ( ! wp_verify_nonce( $data['_wpnonce'], 'give_upgrade_payments_nonce' ) ) {
190
+function give_update_old_payments_with_totals($data) {
191
+	if ( ! wp_verify_nonce($data['_wpnonce'], 'give_upgrade_payments_nonce')) {
192 192
 		return;
193 193
 	}
194 194
 
195
-	if ( get_option( 'give_payment_totals_upgraded' ) ) {
195
+	if (get_option('give_payment_totals_upgraded')) {
196 196
 		return;
197 197
 	}
198 198
 
199
-	$payments = give_get_payments( array(
199
+	$payments = give_get_payments(array(
200 200
 		'offset' => 0,
201
-		'number' => - 1,
201
+		'number' => -1,
202 202
 		'mode'   => 'all',
203
-	) );
203
+	));
204 204
 
205
-	if ( $payments ) {
206
-		foreach ( $payments as $payment ) {
205
+	if ($payments) {
206
+		foreach ($payments as $payment) {
207 207
 
208
-			$payment = new Give_Payment( $payment->ID );
208
+			$payment = new Give_Payment($payment->ID);
209 209
 			$meta    = $payment->get_meta();
210 210
 
211 211
 			$payment->total = $meta['amount'];
@@ -214,10 +214,10 @@  discard block
 block discarded – undo
214 214
 		}
215 215
 	}
216 216
 
217
-	add_option( 'give_payment_totals_upgraded', 1 );
217
+	add_option('give_payment_totals_upgraded', 1);
218 218
 }
219 219
 
220
-add_action( 'give_upgrade_payments', 'give_update_old_payments_with_totals' );
220
+add_action('give_upgrade_payments', 'give_update_old_payments_with_totals');
221 221
 
222 222
 /**
223 223
  * Mark Abandoned Donations
@@ -231,17 +231,17 @@  discard block
 block discarded – undo
231 231
 function give_mark_abandoned_donations() {
232 232
 	$args = array(
233 233
 		'status' => 'pending',
234
-		'number' => - 1,
234
+		'number' => -1,
235 235
 		'output' => 'give_payments',
236 236
 	);
237 237
 
238
-	add_filter( 'posts_where', 'give_filter_where_older_than_week' );
238
+	add_filter('posts_where', 'give_filter_where_older_than_week');
239 239
 
240
-	$payments = give_get_payments( $args );
240
+	$payments = give_get_payments($args);
241 241
 
242
-	remove_filter( 'posts_where', 'give_filter_where_older_than_week' );
242
+	remove_filter('posts_where', 'give_filter_where_older_than_week');
243 243
 
244
-	if ( $payments ) {
244
+	if ($payments) {
245 245
 		/**
246 246
 		 * Filter payment gateways:  Used to set payment gateways which can be skip while transferring pending payment to abandon.
247 247
 		 *
@@ -249,13 +249,13 @@  discard block
 block discarded – undo
249 249
 		 *
250 250
 		 * @param array $skip_payment_gateways Array of payment gateways
251 251
 		 */
252
-		$skip_payment_gateways = apply_filters( 'give_mark_abandoned_donation_gateways', array( 'offline' ) );
252
+		$skip_payment_gateways = apply_filters('give_mark_abandoned_donation_gateways', array('offline'));
253 253
 
254
-		foreach ( $payments as $payment ) {
255
-			$gateway = give_get_payment_gateway( $payment );
254
+		foreach ($payments as $payment) {
255
+			$gateway = give_get_payment_gateway($payment);
256 256
 
257 257
 			// Skip payment gateways.
258
-			if ( in_array( $gateway, $skip_payment_gateways ) ) {
258
+			if (in_array($gateway, $skip_payment_gateways)) {
259 259
 				continue;
260 260
 			}
261 261
 
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 	}
266 266
 }
267 267
 
268
-add_action( 'give_weekly_scheduled_events', 'give_mark_abandoned_donations' );
268
+add_action('give_weekly_scheduled_events', 'give_mark_abandoned_donations');
269 269
 
270 270
 
271 271
 /**
@@ -277,15 +277,15 @@  discard block
 block discarded – undo
277 277
  *
278 278
  * @return void
279 279
  */
280
-function give_refresh_thismonth_stat_transients( $payment_ID ) {
280
+function give_refresh_thismonth_stat_transients($payment_ID) {
281 281
 
282 282
 	/* @var Give_Payment_Stats $stats Give_Payment_Stats class object.  */
283 283
 	$stats = new Give_Payment_Stats();
284 284
 
285 285
 	// Delete transients.
286
-	delete_transient( 'give_estimated_monthly_stats' );
287
-	delete_transient( 'give_earnings_total' );
288
-	delete_transient( $stats->get_earnings_cache_key( 0, 'this_month' ) );
286
+	delete_transient('give_estimated_monthly_stats');
287
+	delete_transient('give_earnings_total');
288
+	delete_transient($stats->get_earnings_cache_key(0, 'this_month'));
289 289
 }
290 290
 
291
-add_action( 'save_post_give_payment', 'give_refresh_thismonth_stat_transients' );
291
+add_action('save_post_give_payment', 'give_refresh_thismonth_stat_transients');
Please login to merge, or discard this patch.