Completed
Push — master ( b2b30d...461219 )
by Matt
20:30
created
includes/admin/reporting/tools.php 1 patch
Spacing   +29 added lines, -29 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
 
@@ -22,80 +22,80 @@  discard block
 block discarded – undo
22 22
  */
23 23
 function give_tools_recount_stats_display() {
24 24
 
25
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
25
+	if ( ! current_user_can('manage_give_settings')) {
26 26
 		return;
27 27
 	}
28 28
 
29
-	do_action( 'give_tools_recount_stats_before' );
29
+	do_action('give_tools_recount_stats_before');
30 30
 	?>
31 31
 	<div id="poststuff">
32 32
 		<div class="postbox">
33 33
 
34
-			<h2 class="hndle ui-sortable-handle"><span><?php esc_html_e( 'Recount Stats', 'give' ); ?></span></h2>
34
+			<h2 class="hndle ui-sortable-handle"><span><?php esc_html_e('Recount Stats', 'give'); ?></span></h2>
35 35
 
36 36
 			<div class="inside recount-stats-controls">
37
-				<p><?php esc_html_e( 'Use these tools to recount stats, delete test transactions, or reset stats.', 'give' ); ?></p>
37
+				<p><?php esc_html_e('Use these tools to recount stats, delete test transactions, or reset stats.', 'give'); ?></p>
38 38
 				<form method="post" id="give-tools-recount-form" class="give-export-form">
39 39
 
40
-					<?php wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); ?>
40
+					<?php wp_nonce_field('give_ajax_export', 'give_ajax_export'); ?>
41 41
 
42 42
 					<select name="give-export-class" id="recount-stats-type">
43
-						<option value="0" selected="selected" disabled="disabled"><?php esc_html_e( 'Please select an option', 'give' ); ?></option>
44
-						<option data-type="recount-stats" value="Give_Tools_Recount_Income"><?php esc_html_e( 'Recalculate Total Donation Income Amount', 'give' ); ?></option>
45
-						<option data-type="recount-form" value="Give_Tools_Recount_Form_Stats"><?php esc_html_e( 'Recalculate Income Amount and Donation Counts for a Form', 'give' ); ?></option>
46
-						<option data-type="recount-all" value="Give_Tools_Recount_All_Stats"><?php esc_html_e( 'Recalculate Income Amount and Donation Counts for All Forms', 'give' ); ?></option>
47
-						<option data-type="recount-customer-stats" value="Give_Tools_Recount_Customer_Stats"><?php esc_html_e( 'Recalculate Donor Statistics', 'give' ); ?></option>
48
-						<option data-type="delete-test-transactions" value="Give_Tools_Delete_Test_Transactions"><?php esc_html_e( 'Delete Test Transactions', 'give' ); ?></option>
49
-						<option data-type="reset-stats" value="Give_Tools_Reset_Stats"><?php esc_html_e( 'Delete All Data', 'give' ); ?></option>
50
-						<?php do_action( 'give_recount_tool_options' ); ?>
43
+						<option value="0" selected="selected" disabled="disabled"><?php esc_html_e('Please select an option', 'give'); ?></option>
44
+						<option data-type="recount-stats" value="Give_Tools_Recount_Income"><?php esc_html_e('Recalculate Total Donation Income Amount', 'give'); ?></option>
45
+						<option data-type="recount-form" value="Give_Tools_Recount_Form_Stats"><?php esc_html_e('Recalculate Income Amount and Donation Counts for a Form', 'give'); ?></option>
46
+						<option data-type="recount-all" value="Give_Tools_Recount_All_Stats"><?php esc_html_e('Recalculate Income Amount and Donation Counts for All Forms', 'give'); ?></option>
47
+						<option data-type="recount-customer-stats" value="Give_Tools_Recount_Customer_Stats"><?php esc_html_e('Recalculate Donor Statistics', 'give'); ?></option>
48
+						<option data-type="delete-test-transactions" value="Give_Tools_Delete_Test_Transactions"><?php esc_html_e('Delete Test Transactions', 'give'); ?></option>
49
+						<option data-type="reset-stats" value="Give_Tools_Reset_Stats"><?php esc_html_e('Delete All Data', 'give'); ?></option>
50
+						<?php do_action('give_recount_tool_options'); ?>
51 51
 					</select>
52 52
 
53 53
 					<span id="tools-form-dropdown" style="display: none">
54 54
 						<?php
55 55
 						$args = array(
56 56
 							'name'   => 'form_id',
57
-							'number' => - 1,
57
+							'number' => -1,
58 58
 							'chosen' => true,
59 59
 						);
60
-						echo Give()->html->forms_dropdown( $args );
60
+						echo Give()->html->forms_dropdown($args);
61 61
 						?>
62 62
 					</span>
63 63
 
64
-					<input type="submit" id="recount-stats-submit" value="<?php esc_attr_e( 'Submit', 'give' ); ?>" class="button-secondary"/>
64
+					<input type="submit" id="recount-stats-submit" value="<?php esc_attr_e('Submit', 'give'); ?>" class="button-secondary"/>
65 65
 
66 66
 					<br/>
67 67
 
68 68
 					<span class="give-recount-stats-descriptions">
69
-						<span id="recount-stats"><?php esc_html_e( 'Recalculates the overall donation income amount.', 'give' ); ?></span>
69
+						<span id="recount-stats"><?php esc_html_e('Recalculates the overall donation income amount.', 'give'); ?></span>
70 70
 						<span id="recount-form"><?php
71 71
 							printf(
72 72
 								/* translators: %s: form singular label */
73
-								esc_html__( 'Recalculates the donation and income stats for a specific %s.', 'give' ),
74
-								give_get_forms_label_singular( true )
73
+								esc_html__('Recalculates the donation and income stats for a specific %s.', 'give'),
74
+								give_get_forms_label_singular(true)
75 75
 							);
76 76
 						?></span>
77 77
 						<span id="recount-all"><?php
78 78
 							printf(
79 79
 								/* translators: %s: form plural label */
80
-								esc_html__( 'Recalculates the earnings and sales stats for all %s.', 'give' ),
81
-								give_get_forms_label_plural( true )
80
+								esc_html__('Recalculates the earnings and sales stats for all %s.', 'give'),
81
+								give_get_forms_label_plural(true)
82 82
 							);
83 83
 						?></span>
84
-						<span id="recount-customer-stats"><?php esc_html_e( 'Recalculates the lifetime value and donation counts for all donors.', 'give' ); ?></span>
85
-						<?php do_action( 'give_recount_tool_descriptions' ); ?>
86
-						<span id="delete-test-transactions"><?php _e( '<strong>Deletes</strong> all TEST payment records, donors, and related log entries.', 'give' ); ?></span>
87
-						<span id="reset-stats"><?php _e( '<strong>Deletes</strong> ALL transaction records, donors, and related log entries regardless of test or live mode.', 'give' ); ?></span>
84
+						<span id="recount-customer-stats"><?php esc_html_e('Recalculates the lifetime value and donation counts for all donors.', 'give'); ?></span>
85
+						<?php do_action('give_recount_tool_descriptions'); ?>
86
+						<span id="delete-test-transactions"><?php _e('<strong>Deletes</strong> all TEST payment records, donors, and related log entries.', 'give'); ?></span>
87
+						<span id="reset-stats"><?php _e('<strong>Deletes</strong> ALL transaction records, donors, and related log entries regardless of test or live mode.', 'give'); ?></span>
88 88
 					</span>
89 89
 
90 90
 					<span class="spinner"></span>
91 91
 
92 92
 				</form>
93
-				<?php do_action( 'give_tools_recount_forms' ); ?>
93
+				<?php do_action('give_tools_recount_forms'); ?>
94 94
 			</div><!-- .inside -->
95 95
 		</div><!-- .postbox -->
96 96
 	</div><!-- #poststuff -->
97 97
 	<?php
98
-	do_action( 'give_tools_recount_stats_after' );
98
+	do_action('give_tools_recount_stats_after');
99 99
 }
100 100
 
101
-add_action( 'give_reports_tab_tools', 'give_tools_recount_stats_display' );
101
+add_action('give_reports_tab_tools', 'give_tools_recount_stats_display');
Please login to merge, or discard this patch.
includes/admin/admin-pages.php 1 patch
Spacing   +65 added lines, -65 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
 
@@ -29,31 +29,31 @@  discard block
 block discarded – undo
29 29
 	global $give_settings_page, $give_payments_page, $give_reports_page, $give_add_ons_page, $give_upgrades_screen, $give_donors_page;
30 30
 
31 31
 	//Payments
32
-	$give_payment       = get_post_type_object( 'give_payment' );
33
-	$give_payments_page = add_submenu_page( 'edit.php?post_type=give_forms', $give_payment->labels->name, $give_payment->labels->menu_name, 'edit_give_payments', 'give-payment-history', 'give_payment_history_page' );
32
+	$give_payment       = get_post_type_object('give_payment');
33
+	$give_payments_page = add_submenu_page('edit.php?post_type=give_forms', $give_payment->labels->name, $give_payment->labels->menu_name, 'edit_give_payments', 'give-payment-history', 'give_payment_history_page');
34 34
 
35 35
 	//Donors
36
-	$give_donors_page = add_submenu_page( 'edit.php?post_type=give_forms', esc_html__( 'Donors', 'give' ), esc_html__( 'Donors', 'give' ), 'view_give_reports', 'give-donors', 'give_customers_page' );
36
+	$give_donors_page = add_submenu_page('edit.php?post_type=give_forms', esc_html__('Donors', 'give'), esc_html__('Donors', 'give'), 'view_give_reports', 'give-donors', 'give_customers_page');
37 37
 
38 38
 	//Reports`
39
-	$give_reports_page = add_submenu_page( 'edit.php?post_type=give_forms', esc_html__( 'Donation Reports', 'give' ), esc_html__( 'Reports', 'give' ), 'view_give_reports', 'give-reports', 'give_reports_page' );
39
+	$give_reports_page = add_submenu_page('edit.php?post_type=give_forms', esc_html__('Donation Reports', 'give'), esc_html__('Reports', 'give'), 'view_give_reports', 'give-reports', 'give_reports_page');
40 40
 
41 41
 	//Settings
42
-	$give_settings_page = add_submenu_page( 'edit.php?post_type=give_forms', esc_html__( 'Give Settings', 'give' ), esc_html__( 'Settings', 'give' ), 'manage_give_settings', 'give-settings', array(
42
+	$give_settings_page = add_submenu_page('edit.php?post_type=give_forms', esc_html__('Give Settings', 'give'), esc_html__('Settings', 'give'), 'manage_give_settings', 'give-settings', array(
43 43
 		Give()->give_settings,
44 44
 		'admin_page_display'
45
-	) );
45
+	));
46 46
 
47 47
 	//Add-ons
48
-	$give_add_ons_page = add_submenu_page( 'edit.php?post_type=give_forms', esc_html__( 'Give Add-ons', 'give' ), esc_html__( 'Add-ons', 'give' ), 'install_plugins', 'give-addons', 'give_add_ons_page' );
48
+	$give_add_ons_page = add_submenu_page('edit.php?post_type=give_forms', esc_html__('Give Add-ons', 'give'), esc_html__('Add-ons', 'give'), 'install_plugins', 'give-addons', 'give_add_ons_page');
49 49
 
50 50
 	//Upgrades
51
-	$give_upgrades_screen = add_submenu_page( null, esc_html__( 'Give Upgrades', 'give' ), esc_html__( 'Give Upgrades', 'give' ), 'manage_give_settings', 'give-upgrades', 'give_upgrades_screen' );
51
+	$give_upgrades_screen = add_submenu_page(null, esc_html__('Give Upgrades', 'give'), esc_html__('Give Upgrades', 'give'), 'manage_give_settings', 'give-upgrades', 'give_upgrades_screen');
52 52
 
53 53
 
54 54
 }
55 55
 
56
-add_action( 'admin_menu', 'give_add_options_links', 10 );
56
+add_action('admin_menu', 'give_add_options_links', 10);
57 57
 
58 58
 /**
59 59
  *  Determines whether the current admin page is a Give admin page.
@@ -68,224 +68,224 @@  discard block
 block discarded – undo
68 68
  *
69 69
  * @return bool True if Give admin page.
70 70
  */
71
-function give_is_admin_page( $passed_page = '', $passed_view = '' ) {
71
+function give_is_admin_page($passed_page = '', $passed_view = '') {
72 72
 
73 73
 	global $pagenow, $typenow;
74 74
 
75 75
 	$found     = false;
76
-	$post_type = isset( $_GET['post_type'] ) ? strtolower( $_GET['post_type'] ) : false;
77
-	$action    = isset( $_GET['action'] ) ? strtolower( $_GET['action'] ) : false;
78
-	$taxonomy  = isset( $_GET['taxonomy'] ) ? strtolower( $_GET['taxonomy'] ) : false;
79
-	$page      = isset( $_GET['page'] ) ? strtolower( $_GET['page'] ) : false;
80
-	$view      = isset( $_GET['view'] ) ? strtolower( $_GET['view'] ) : false;
81
-	$tab       = isset( $_GET['tab'] ) ? strtolower( $_GET['tab'] ) : false;
76
+	$post_type = isset($_GET['post_type']) ? strtolower($_GET['post_type']) : false;
77
+	$action    = isset($_GET['action']) ? strtolower($_GET['action']) : false;
78
+	$taxonomy  = isset($_GET['taxonomy']) ? strtolower($_GET['taxonomy']) : false;
79
+	$page      = isset($_GET['page']) ? strtolower($_GET['page']) : false;
80
+	$view      = isset($_GET['view']) ? strtolower($_GET['view']) : false;
81
+	$tab       = isset($_GET['tab']) ? strtolower($_GET['tab']) : false;
82 82
 
83
-	switch ( $passed_page ) {
83
+	switch ($passed_page) {
84 84
 		case 'give_forms':
85
-			switch ( $passed_view ) {
85
+			switch ($passed_view) {
86 86
 				case 'list-table':
87
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' ) {
87
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php') {
88 88
 						$found = true;
89 89
 					}
90 90
 					break;
91 91
 				case 'edit':
92
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'post.php' ) {
92
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'post.php') {
93 93
 						$found = true;
94 94
 					}
95 95
 					break;
96 96
 				case 'new':
97
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'post-new.php' ) {
97
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'post-new.php') {
98 98
 						$found = true;
99 99
 					}
100 100
 					break;
101 101
 				default:
102
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) || 'give_forms' === $post_type || ( 'post-new.php' == $pagenow && 'give_forms' === $post_type ) ) {
102
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) || 'give_forms' === $post_type || ('post-new.php' == $pagenow && 'give_forms' === $post_type)) {
103 103
 						$found = true;
104 104
 					}
105 105
 					break;
106 106
 			}
107 107
 			break;
108 108
 		case 'categories':
109
-			switch ( $passed_view ) {
109
+			switch ($passed_view) {
110 110
 				case 'list-table':
111 111
 				case 'new':
112
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_category' === $taxonomy ) {
112
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_category' === $taxonomy) {
113 113
 						$found = true;
114 114
 					}
115 115
 					break;
116 116
 				case 'edit':
117
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_category' === $taxonomy ) {
117
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_category' === $taxonomy) {
118 118
 						$found = true;
119 119
 					}
120 120
 					break;
121 121
 				default:
122
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'give_forms_category' === $taxonomy ) {
122
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'give_forms_category' === $taxonomy) {
123 123
 						$found = true;
124 124
 					}
125 125
 					break;
126 126
 			}
127 127
 			break;
128 128
 		case 'tags':
129
-			switch ( $passed_view ) {
129
+			switch ($passed_view) {
130 130
 				case 'list-table':
131 131
 				case 'new':
132
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_tag' === $taxonomy ) {
132
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_tag' === $taxonomy) {
133 133
 						$found = true;
134 134
 					}
135 135
 					break;
136 136
 				case 'edit':
137
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_tag' === $taxonomy ) {
137
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_tag' === $taxonomy) {
138 138
 						$found = true;
139 139
 					}
140 140
 					break;
141 141
 				default:
142
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'give_forms_tag' === $taxonomy ) {
142
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'give_forms_tag' === $taxonomy) {
143 143
 						$found = true;
144 144
 					}
145 145
 					break;
146 146
 			}
147 147
 			break;
148 148
 		case 'payments':
149
-			switch ( $passed_view ) {
149
+			switch ($passed_view) {
150 150
 				case 'list-table':
151
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-payment-history' === $page && false === $view ) {
151
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-payment-history' === $page && false === $view) {
152 152
 						$found = true;
153 153
 					}
154 154
 					break;
155 155
 				case 'edit':
156
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-payment-history' === $page && 'view-order-details' === $view ) {
156
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-payment-history' === $page && 'view-order-details' === $view) {
157 157
 						$found = true;
158 158
 					}
159 159
 					break;
160 160
 				default:
161
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-payment-history' === $page ) {
161
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-payment-history' === $page) {
162 162
 						$found = true;
163 163
 					}
164 164
 					break;
165 165
 			}
166 166
 			break;
167 167
 		case 'reports':
168
-			switch ( $passed_view ) {
168
+			switch ($passed_view) {
169 169
 				// If you want to do something like enqueue a script on a particular report's duration, look at $_GET[ 'range' ]
170 170
 				case 'earnings':
171
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && ( 'earnings' === $view || '-1' === $view || false === $view ) ) {
171
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && ('earnings' === $view || '-1' === $view || false === $view)) {
172 172
 						$found = true;
173 173
 					}
174 174
 					break;
175 175
 				case 'donors':
176
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'customers' === $view ) {
176
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'customers' === $view) {
177 177
 						$found = true;
178 178
 					}
179 179
 					break;
180 180
 				case 'gateways':
181
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'gateways' === $view ) {
181
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'gateways' === $view) {
182 182
 						$found = true;
183 183
 					}
184 184
 					break;
185 185
 				case 'export':
186
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'export' === $view ) {
186
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'export' === $view) {
187 187
 						$found = true;
188 188
 					}
189 189
 					break;
190 190
 				case 'logs':
191
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'logs' === $view ) {
191
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'logs' === $view) {
192 192
 						$found = true;
193 193
 					}
194 194
 					break;
195 195
 				default:
196
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page ) {
196
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page) {
197 197
 						$found = true;
198 198
 					}
199 199
 					break;
200 200
 			}
201 201
 			break;
202 202
 		case 'settings':
203
-			switch ( $passed_view ) {
203
+			switch ($passed_view) {
204 204
 				case 'general':
205
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && ( 'general' === $tab || false === $tab ) ) {
205
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && ('general' === $tab || false === $tab)) {
206 206
 						$found = true;
207 207
 					}
208 208
 					break;
209 209
 				case 'gateways':
210
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'gateways' === $tab ) {
210
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'gateways' === $tab) {
211 211
 						$found = true;
212 212
 					}
213 213
 					break;
214 214
 				case 'emails':
215
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'emails' === $tab ) {
215
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'emails' === $tab) {
216 216
 						$found = true;
217 217
 					}
218 218
 					break;
219 219
 				case 'display':
220
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'display' === $tab ) {
220
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'display' === $tab) {
221 221
 						$found = true;
222 222
 					}
223 223
 					break;
224 224
 				case 'licenses':
225
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'licenses' === $tab ) {
225
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'licenses' === $tab) {
226 226
 						$found = true;
227 227
 					}
228 228
 					break;
229 229
 				case 'api':
230
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'api' === $tab ) {
230
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'api' === $tab) {
231 231
 						$found = true;
232 232
 					}
233 233
 					break;
234 234
 				case 'advanced':
235
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'advanced' === $tab ) {
235
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'advanced' === $tab) {
236 236
 						$found = true;
237 237
 					}
238 238
 					break;
239 239
 				case 'system_info':
240
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'system_info' === $tab ) {
240
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'system_info' === $tab) {
241 241
 						$found = true;
242 242
 					}
243 243
 					break;
244 244
 				default:
245
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page ) {
245
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page) {
246 246
 						$found = true;
247 247
 					}
248 248
 					break;
249 249
 			}
250 250
 			break;
251 251
 		case 'addons':
252
-			if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-addons' === $page ) {
252
+			if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-addons' === $page) {
253 253
 				$found = true;
254 254
 			}
255 255
 			break;
256 256
 		case 'donors':
257
-			switch ( $passed_view ) {
257
+			switch ($passed_view) {
258 258
 				case 'list-table':
259
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page && false === $view ) {
259
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page && false === $view) {
260 260
 						$found = true;
261 261
 					}
262 262
 					break;
263 263
 				case 'overview':
264
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page && 'overview' === $view ) {
264
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page && 'overview' === $view) {
265 265
 						$found = true;
266 266
 					}
267 267
 					break;
268 268
 				case 'notes':
269
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page && 'notes' === $view ) {
269
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page && 'notes' === $view) {
270 270
 						$found = true;
271 271
 					}
272 272
 					break;
273 273
 				default:
274
-					if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page ) {
274
+					if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page) {
275 275
 						$found = true;
276 276
 					}
277 277
 					break;
278 278
 			}
279 279
 			break;
280 280
 		case 'reports':
281
-			if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page ) {
281
+			if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page) {
282 282
 				$found = true;
283 283
 			}
284 284
 			break;
285 285
 		default:
286 286
 			global $give_payments_page, $give_settings_page, $give_reports_page, $give_system_info_page, $give_add_ons_page, $give_settings_export, $give_upgrades_screen, $give_customers_page;
287 287
 
288
-			$admin_pages = apply_filters( 'give_admin_pages', array(
288
+			$admin_pages = apply_filters('give_admin_pages', array(
289 289
 				$give_payments_page,
290 290
 				$give_settings_page,
291 291
 				$give_reports_page,
@@ -294,18 +294,18 @@  discard block
 block discarded – undo
294 294
 				$give_upgrades_screen,
295 295
 				$give_settings_export,
296 296
 				$give_customers_page
297
-			) );
298
-			if ( 'give_forms' == $typenow || 'index.php' == $pagenow || 'post-new.php' == $pagenow || 'post.php' == $pagenow ) {
297
+			));
298
+			if ('give_forms' == $typenow || 'index.php' == $pagenow || 'post-new.php' == $pagenow || 'post.php' == $pagenow) {
299 299
 				$found = true;
300
-				if ( 'give-upgrades' === $page ) {
300
+				if ('give-upgrades' === $page) {
301 301
 					$found = false;
302 302
 				}
303
-			} elseif ( in_array( $pagenow, $admin_pages ) ) {
303
+			} elseif (in_array($pagenow, $admin_pages)) {
304 304
 				$found = true;
305 305
 			}
306 306
 			break;
307 307
 	}
308 308
 
309
-	return (bool) apply_filters( 'give_is_admin_page', $found, $page, $view, $passed_page, $passed_view );
309
+	return (bool) apply_filters('give_is_admin_page', $found, $page, $view, $passed_page, $passed_view);
310 310
 
311 311
 }
312 312
\ No newline at end of file
Please login to merge, or discard this patch.
includes/emails/class-give-emails.php 1 patch
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if accessed directly
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
@@ -79,12 +79,12 @@  discard block
 block discarded – undo
79 79
 	 */
80 80
 	public function __construct() {
81 81
 
82
-		if ( 'none' === $this->get_template() ) {
82
+		if ('none' === $this->get_template()) {
83 83
 			$this->html = false;
84 84
 		}
85 85
 
86
-		add_action( 'give_email_send_before', array( $this, 'send_before' ) );
87
-		add_action( 'give_email_send_after', array( $this, 'send_after' ) );
86
+		add_action('give_email_send_before', array($this, 'send_before'));
87
+		add_action('give_email_send_after', array($this, 'send_after'));
88 88
 
89 89
 	}
90 90
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	 *
94 94
 	 * @since 1.0
95 95
 	 */
96
-	public function __set( $key, $value ) {
96
+	public function __set($key, $value) {
97 97
 		$this->$key = $value;
98 98
 	}
99 99
 
@@ -103,11 +103,11 @@  discard block
 block discarded – undo
103 103
 	 * @since 1.0
104 104
 	 */
105 105
 	public function get_from_name() {
106
-		if ( ! $this->from_name ) {
107
-			$this->from_name = give_get_option( 'from_name', get_bloginfo( 'name' ) );
106
+		if ( ! $this->from_name) {
107
+			$this->from_name = give_get_option('from_name', get_bloginfo('name'));
108 108
 		}
109 109
 
110
-		return apply_filters( 'give_email_from_name', wp_specialchars_decode( $this->from_name ), $this );
110
+		return apply_filters('give_email_from_name', wp_specialchars_decode($this->from_name), $this);
111 111
 	}
112 112
 
113 113
 	/**
@@ -116,11 +116,11 @@  discard block
 block discarded – undo
116 116
 	 * @since 1.0
117 117
 	 */
118 118
 	public function get_from_address() {
119
-		if ( ! $this->from_address ) {
120
-			$this->from_address = give_get_option( 'from_email', get_option( 'admin_email' ) );
119
+		if ( ! $this->from_address) {
120
+			$this->from_address = give_get_option('from_email', get_option('admin_email'));
121 121
 		}
122 122
 
123
-		return apply_filters( 'give_email_from_address', $this->from_address, $this );
123
+		return apply_filters('give_email_from_address', $this->from_address, $this);
124 124
 	}
125 125
 
126 126
 	/**
@@ -129,13 +129,13 @@  discard block
 block discarded – undo
129 129
 	 * @since 1.0
130 130
 	 */
131 131
 	public function get_content_type() {
132
-		if ( ! $this->content_type && $this->html ) {
133
-			$this->content_type = apply_filters( 'give_email_default_content_type', 'text/html', $this );
134
-		} else if ( ! $this->html ) {
132
+		if ( ! $this->content_type && $this->html) {
133
+			$this->content_type = apply_filters('give_email_default_content_type', 'text/html', $this);
134
+		} else if ( ! $this->html) {
135 135
 			$this->content_type = 'text/plain';
136 136
 		}
137 137
 
138
-		return apply_filters( 'give_email_content_type', $this->content_type, $this );
138
+		return apply_filters('give_email_content_type', $this->content_type, $this);
139 139
 	}
140 140
 
141 141
 	/**
@@ -144,13 +144,13 @@  discard block
 block discarded – undo
144 144
 	 * @since 1.0
145 145
 	 */
146 146
 	public function get_headers() {
147
-		if ( ! $this->headers ) {
147
+		if ( ! $this->headers) {
148 148
 			$this->headers = "From: {$this->get_from_name()} <{$this->get_from_address()}>\r\n";
149 149
 			$this->headers .= "Reply-To: {$this->get_from_address()}\r\n";
150 150
 			$this->headers .= "Content-Type: {$this->get_content_type()}; charset=utf-8\r\n";
151 151
 		}
152 152
 
153
-		return apply_filters( 'give_email_headers', $this->headers, $this );
153
+		return apply_filters('give_email_headers', $this->headers, $this);
154 154
 	}
155 155
 
156 156
 	/**
@@ -160,11 +160,11 @@  discard block
 block discarded – undo
160 160
 	 */
161 161
 	public function get_templates() {
162 162
 		$templates = array(
163
-			'default' => esc_html__( 'Default Template', 'give' ),
164
-			'none'    => esc_html__( 'No template, plain text only', 'give' )
163
+			'default' => esc_html__('Default Template', 'give'),
164
+			'none'    => esc_html__('No template, plain text only', 'give')
165 165
 		);
166 166
 
167
-		return apply_filters( 'give_email_templates', $templates );
167
+		return apply_filters('give_email_templates', $templates);
168 168
 	}
169 169
 
170 170
 	/**
@@ -173,11 +173,11 @@  discard block
 block discarded – undo
173 173
 	 * @since 1.0
174 174
 	 */
175 175
 	public function get_template() {
176
-		if ( ! $this->template ) {
177
-			$this->template = give_get_option( 'email_template', 'default' );
176
+		if ( ! $this->template) {
177
+			$this->template = give_get_option('email_template', 'default');
178 178
 		}
179 179
 
180
-		return apply_filters( 'give_email_template', $this->template );
180
+		return apply_filters('give_email_template', $this->template);
181 181
 	}
182 182
 
183 183
 	/**
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 	 * @since 1.0
187 187
 	 */
188 188
 	public function get_heading() {
189
-		return apply_filters( 'give_email_heading', $this->heading );
189
+		return apply_filters('give_email_heading', $this->heading);
190 190
 	}
191 191
 
192 192
 	/**
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 	 *
197 197
 	 * @return mixed
198 198
 	 */
199
-	public function parse_tags( $content ) {
199
+	public function parse_tags($content) {
200 200
 		return $content;
201 201
 	}
202 202
 
@@ -205,36 +205,36 @@  discard block
 block discarded – undo
205 205
 	 *
206 206
 	 * @since 1.0
207 207
 	 */
208
-	public function build_email( $message ) {
208
+	public function build_email($message) {
209 209
 
210
-		if ( false === $this->html ) {
211
-			return apply_filters( 'give_email_message', wp_strip_all_tags( $message ), $this );
210
+		if (false === $this->html) {
211
+			return apply_filters('give_email_message', wp_strip_all_tags($message), $this);
212 212
 		}
213 213
 
214
-		$message = $this->text_to_html( $message );
214
+		$message = $this->text_to_html($message);
215 215
 
216 216
 		ob_start();
217 217
 
218
-		give_get_template_part( 'emails/header', $this->get_template(), true );
218
+		give_get_template_part('emails/header', $this->get_template(), true);
219 219
 
220
-		do_action( 'give_email_header', $this );
220
+		do_action('give_email_header', $this);
221 221
 
222
-		if ( has_action( 'give_email_template_' . $this->get_template() ) ) {
223
-			do_action( 'give_email_template_' . $this->get_template() );
222
+		if (has_action('give_email_template_'.$this->get_template())) {
223
+			do_action('give_email_template_'.$this->get_template());
224 224
 		} else {
225
-			give_get_template_part( 'emails/body', $this->get_template(), true );
225
+			give_get_template_part('emails/body', $this->get_template(), true);
226 226
 		}
227 227
 
228
-		do_action( 'give_email_body', $this );
228
+		do_action('give_email_body', $this);
229 229
 
230
-		give_get_template_part( 'emails/footer', $this->get_template(), true );
230
+		give_get_template_part('emails/footer', $this->get_template(), true);
231 231
 
232
-		do_action( 'give_email_footer', $this );
232
+		do_action('give_email_footer', $this);
233 233
 
234 234
 		$body    = ob_get_clean();
235
-		$message = str_replace( '{email}', $message, $body );
235
+		$message = str_replace('{email}', $message, $body);
236 236
 
237
-		return apply_filters( 'give_email_message', $message, $this );
237
+		return apply_filters('give_email_message', $message, $this);
238 238
 	}
239 239
 
240 240
 	/**
@@ -247,26 +247,26 @@  discard block
 block discarded – undo
247 247
 	 *
248 248
 	 * @return bool
249 249
 	 */
250
-	public function send( $to, $subject, $message, $attachments = '' ) {
250
+	public function send($to, $subject, $message, $attachments = '') {
251 251
 
252
-		if ( ! did_action( 'init' ) && ! did_action( 'admin_init' ) ) {
253
-			_doing_it_wrong( __FUNCTION__, esc_html__( 'You cannot send email with Give_Emails until init/admin_init has been reached.', 'give' ), null );
252
+		if ( ! did_action('init') && ! did_action('admin_init')) {
253
+			_doing_it_wrong(__FUNCTION__, esc_html__('You cannot send email with Give_Emails until init/admin_init has been reached.', 'give'), null);
254 254
 
255 255
 			return false;
256 256
 		}
257 257
 
258
-		do_action( 'give_email_send_before', $this );
258
+		do_action('give_email_send_before', $this);
259 259
 
260
-		$subject = $this->parse_tags( $subject );
261
-		$message = $this->parse_tags( $message );
260
+		$subject = $this->parse_tags($subject);
261
+		$message = $this->parse_tags($message);
262 262
 
263
-		$message = $this->build_email( $message );
263
+		$message = $this->build_email($message);
264 264
 
265
-		$attachments = apply_filters( 'give_email_attachments', $attachments, $this );
265
+		$attachments = apply_filters('give_email_attachments', $attachments, $this);
266 266
 
267
-		$sent = wp_mail( $to, $subject, $message, $this->get_headers(), $attachments );
267
+		$sent = wp_mail($to, $subject, $message, $this->get_headers(), $attachments);
268 268
 
269
-		do_action( 'give_email_send_after', $this );
269
+		do_action('give_email_send_after', $this);
270 270
 
271 271
 		return $sent;
272 272
 
@@ -278,9 +278,9 @@  discard block
 block discarded – undo
278 278
 	 * @since 1.0
279 279
 	 */
280 280
 	public function send_before() {
281
-		add_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );
282
-		add_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );
283
-		add_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );
281
+		add_filter('wp_mail_from', array($this, 'get_from_address'));
282
+		add_filter('wp_mail_from_name', array($this, 'get_from_name'));
283
+		add_filter('wp_mail_content_type', array($this, 'get_content_type'));
284 284
 	}
285 285
 
286 286
 	/**
@@ -289,9 +289,9 @@  discard block
 block discarded – undo
289 289
 	 * @since 1.0
290 290
 	 */
291 291
 	public function send_after() {
292
-		remove_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );
293
-		remove_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );
294
-		remove_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );
292
+		remove_filter('wp_mail_from', array($this, 'get_from_address'));
293
+		remove_filter('wp_mail_from_name', array($this, 'get_from_name'));
294
+		remove_filter('wp_mail_content_type', array($this, 'get_content_type'));
295 295
 
296 296
 		// Reset heading to an empty string
297 297
 		$this->heading = '';
@@ -302,10 +302,10 @@  discard block
 block discarded – undo
302 302
 	 *
303 303
 	 * @since 1.0
304 304
 	 */
305
-	public function text_to_html( $message ) {
305
+	public function text_to_html($message) {
306 306
 
307
-		if ( 'text/html' == $this->content_type || true === $this->html ) {
308
-			$message = wpautop( $message );
307
+		if ('text/html' == $this->content_type || true === $this->html) {
308
+			$message = wpautop($message);
309 309
 		}
310 310
 
311 311
 		return $message;
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 purchase receipt while editing a payment
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_purchase', 'give_trigger_donation_receipt', 999, 1 );
36
+add_action('give_complete_purchase', 'give_trigger_donation_receipt', 999, 1);
37 37
 
38 38
 /**
39 39
  * Resend the Email Purchase Receipt. (This can be done from the Payment 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 payment records.', '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 payment records.', '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/class-give-license-handler.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -8,11 +8,11 @@  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
 
15
-if ( ! class_exists( 'Give_License' ) ) :
15
+if ( ! class_exists('Give_License')) :
16 16
 
17 17
 	/**
18 18
 	 * Give_License Class
@@ -38,16 +38,16 @@  discard block
 block discarded – undo
38 38
 		 * @param string  $_optname
39 39
 		 * @param string  $_api_url
40 40
 		 */
41
-		public function __construct( $_file, $_item_name, $_version, $_author, $_optname = null, $_api_url = null ) {
41
+		public function __construct($_file, $_item_name, $_version, $_author, $_optname = null, $_api_url = null) {
42 42
 			global $give_options;
43 43
 
44 44
 			$this->file           = $_file;
45 45
 			$this->item_name      = $_item_name;
46
-			$this->item_shortname = 'give_' . preg_replace( '/[^a-zA-Z0-9_\s]/', '', str_replace( ' ', '_', strtolower( $this->item_name ) ) );
46
+			$this->item_shortname = 'give_'.preg_replace('/[^a-zA-Z0-9_\s]/', '', str_replace(' ', '_', strtolower($this->item_name)));
47 47
 			$this->version        = $_version;
48
-			$this->license        = isset( $give_options[ $this->item_shortname . '_license_key' ] ) ? trim( $give_options[ $this->item_shortname . '_license_key' ] ) : '';
48
+			$this->license        = isset($give_options[$this->item_shortname.'_license_key']) ? trim($give_options[$this->item_shortname.'_license_key']) : '';
49 49
 			$this->author         = $_author;
50
-			$this->api_url        = is_null( $_api_url ) ? $this->api_url : $_api_url;
50
+			$this->api_url        = is_null($_api_url) ? $this->api_url : $_api_url;
51 51
 
52 52
 
53 53
 			// Setup hooks
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 		 * @return  void
64 64
 		 */
65 65
 		private function includes() {
66
-			if ( ! class_exists( 'EDD_SL_Plugin_Updater' ) ) {
66
+			if ( ! class_exists('EDD_SL_Plugin_Updater')) {
67 67
 				require_once 'admin/EDD_SL_Plugin_Updater.php';
68 68
 			}
69 69
 		}
@@ -77,18 +77,18 @@  discard block
 block discarded – undo
77 77
 		private function hooks() {
78 78
 
79 79
 			// Register settings
80
-			add_filter( 'give_settings_licenses', array( $this, 'settings' ), 1 );
80
+			add_filter('give_settings_licenses', array($this, 'settings'), 1);
81 81
 
82 82
 			// Activate license key on settings save
83
-			add_action( 'admin_init', array( $this, 'activate_license' ) );
83
+			add_action('admin_init', array($this, 'activate_license'));
84 84
 
85 85
 			// Deactivate license key
86
-			add_action( 'admin_init', array( $this, 'deactivate_license' ) );
86
+			add_action('admin_init', array($this, 'deactivate_license'));
87 87
 
88 88
 			// Updater
89
-			add_action( 'admin_init', array( $this, 'auto_updater' ), 0 );
89
+			add_action('admin_init', array($this, 'auto_updater'), 0);
90 90
 
91
-			add_action( 'admin_notices', array( $this, 'notices' ) );
91
+			add_action('admin_notices', array($this, 'notices'));
92 92
 		}
93 93
 
94 94
 		/**
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		 */
101 101
 		public function auto_updater() {
102 102
 
103
-			if ( 'valid' !== get_option( $this->item_shortname . '_license_active' ) ) {
103
+			if ('valid' !== get_option($this->item_shortname.'_license_active')) {
104 104
 				return;
105 105
 			}
106 106
 
@@ -127,20 +127,20 @@  discard block
 block discarded – undo
127 127
 		 *
128 128
 		 * @return  array
129 129
 		 */
130
-		public function settings( $settings ) {
130
+		public function settings($settings) {
131 131
 
132 132
 			$give_license_settings = array(
133 133
 				array(
134 134
 					'name'    => $this->item_name,
135
-					'id'      => $this->item_shortname . '_license_key',
135
+					'id'      => $this->item_shortname.'_license_key',
136 136
 					'desc'    => '',
137 137
 					'type'    => 'license_key',
138
-					'options' => array( 'is_valid_license_option' => $this->item_shortname . '_license_active' ),
138
+					'options' => array('is_valid_license_option' => $this->item_shortname.'_license_active'),
139 139
 					'size'    => 'regular'
140 140
 				)
141 141
 			);
142 142
 
143
-			return array_merge( $settings, $give_license_settings );
143
+			return array_merge($settings, $give_license_settings);
144 144
 		}
145 145
 
146 146
 		/**
@@ -152,18 +152,18 @@  discard block
 block discarded – undo
152 152
 		 *
153 153
 		 * @return  array
154 154
 		 */
155
-		public function license_settings_content( $settings ) {
155
+		public function license_settings_content($settings) {
156 156
 
157 157
 			$give_license_settings = array(
158 158
 				array(
159
-					'name' => esc_html__( 'Add-on Licenses', 'give' ),
159
+					'name' => esc_html__('Add-on Licenses', 'give'),
160 160
 					'desc' => '<hr>',
161 161
 					'type' => 'give_title',
162 162
 					'id'   => 'give_title'
163 163
 				),
164 164
 			);
165 165
 
166
-			return array_merge( $settings, $give_license_settings );
166
+			return array_merge($settings, $give_license_settings);
167 167
 		}
168 168
 
169 169
 
@@ -175,34 +175,34 @@  discard block
 block discarded – undo
175 175
 		 */
176 176
 		public function activate_license() {
177 177
 
178
-			if ( ! isset( $_POST[ $this->item_shortname . '_license_key' ] ) ) {
178
+			if ( ! isset($_POST[$this->item_shortname.'_license_key'])) {
179 179
 				return;
180 180
 			}
181 181
 
182
-			foreach ( $_POST as $key => $value ) {
183
-				if ( false !== strpos( $key, 'license_key_deactivate' ) ) {
182
+			foreach ($_POST as $key => $value) {
183
+				if (false !== strpos($key, 'license_key_deactivate')) {
184 184
 					// Don't activate a key when deactivating a different key
185 185
 					return;
186 186
 				}
187 187
 			}
188 188
 
189
-			if ( ! wp_verify_nonce( $_REQUEST[ $this->item_shortname . '_license_key-nonce' ], $this->item_shortname . '_license_key-nonce' ) ) {
189
+			if ( ! wp_verify_nonce($_REQUEST[$this->item_shortname.'_license_key-nonce'], $this->item_shortname.'_license_key-nonce')) {
190 190
 
191
-				wp_die( esc_html__( 'Nonce verification failed.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
191
+				wp_die(esc_html__('Nonce verification failed.', 'give'), esc_html__('Error', 'give'), array('response' => 403));
192 192
 
193 193
 			}
194 194
 
195
-			if ( ! current_user_can( 'manage_give_settings' ) ) {
195
+			if ( ! current_user_can('manage_give_settings')) {
196 196
 				return;
197 197
 			}
198 198
 
199
-			if ( 'valid' === get_option( $this->item_shortname . '_license_active' ) ) {
199
+			if ('valid' === get_option($this->item_shortname.'_license_active')) {
200 200
 				return;
201 201
 			}
202 202
 
203
-			$license = sanitize_text_field( $_POST[ $this->item_shortname . '_license_key' ] );
203
+			$license = sanitize_text_field($_POST[$this->item_shortname.'_license_key']);
204 204
 
205
-			if ( empty( $license ) ) {
205
+			if (empty($license)) {
206 206
 				return;
207 207
 			}
208 208
 
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 			$api_params = array(
211 211
 				'edd_action' => 'activate_license', //never change from "edd_" to "give_"!
212 212
 				'license'    => $license,
213
-				'item_name'  => urlencode( $this->item_name ),
213
+				'item_name'  => urlencode($this->item_name),
214 214
 				'url'        => home_url()
215 215
 			);
216 216
 
@@ -225,22 +225,22 @@  discard block
 block discarded – undo
225 225
 			);
226 226
 
227 227
 			// Make sure there are no errors
228
-			if ( is_wp_error( $response ) ) {
228
+			if (is_wp_error($response)) {
229 229
 				return;
230 230
 			}
231 231
 
232 232
 			// Tell WordPress to look for updates
233
-			set_site_transient( 'update_plugins', null );
233
+			set_site_transient('update_plugins', null);
234 234
 
235 235
 			// Decode license data
236
-			$license_data = json_decode( wp_remote_retrieve_body( $response ) );
236
+			$license_data = json_decode(wp_remote_retrieve_body($response));
237 237
 
238
-			update_option( $this->item_shortname . '_license_active', $license_data->license );
238
+			update_option($this->item_shortname.'_license_active', $license_data->license);
239 239
 
240
-			if ( ! (bool) $license_data->success ) {
241
-				set_transient( 'give_license_error', $license_data, 1000 );
240
+			if ( ! (bool) $license_data->success) {
241
+				set_transient('give_license_error', $license_data, 1000);
242 242
 			} else {
243
-				delete_transient( 'give_license_error' );
243
+				delete_transient('give_license_error');
244 244
 			}
245 245
 		}
246 246
 
@@ -253,28 +253,28 @@  discard block
 block discarded – undo
253 253
 		 */
254 254
 		public function deactivate_license() {
255 255
 
256
-			if ( ! isset( $_POST[ $this->item_shortname . '_license_key' ] ) ) {
256
+			if ( ! isset($_POST[$this->item_shortname.'_license_key'])) {
257 257
 				return;
258 258
 			}
259 259
 
260
-			if ( ! wp_verify_nonce( $_REQUEST[ $this->item_shortname . '_license_key-nonce' ], $this->item_shortname . '_license_key-nonce' ) ) {
260
+			if ( ! wp_verify_nonce($_REQUEST[$this->item_shortname.'_license_key-nonce'], $this->item_shortname.'_license_key-nonce')) {
261 261
 
262
-				wp_die( esc_html__( 'Nonce verification failed.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
262
+				wp_die(esc_html__('Nonce verification failed.', 'give'), esc_html__('Error', 'give'), array('response' => 403));
263 263
 
264 264
 			}
265 265
 
266
-			if ( ! current_user_can( 'manage_give_settings' ) ) {
266
+			if ( ! current_user_can('manage_give_settings')) {
267 267
 				return;
268 268
 			}
269 269
 
270 270
 			// Run on deactivate button press
271
-			if ( isset( $_POST[ $this->item_shortname . '_license_key_deactivate' ] ) ) {
271
+			if (isset($_POST[$this->item_shortname.'_license_key_deactivate'])) {
272 272
 
273 273
 				// Data to send to the API
274 274
 				$api_params = array(
275 275
 					'edd_action' => 'deactivate_license', //never change from "edd_" to "give_"!
276 276
 					'license'    => $this->license,
277
-					'item_name'  => urlencode( $this->item_name ),
277
+					'item_name'  => urlencode($this->item_name),
278 278
 					'url'        => home_url()
279 279
 				);
280 280
 
@@ -290,19 +290,19 @@  discard block
 block discarded – undo
290 290
 
291 291
 
292 292
 				// Make sure there are no errors
293
-				if ( is_wp_error( $response ) ) {
293
+				if (is_wp_error($response)) {
294 294
 					return;
295 295
 				}
296 296
 
297 297
 				// Decode the license data
298
-				$license_data = json_decode( wp_remote_retrieve_body( $response ) );
298
+				$license_data = json_decode(wp_remote_retrieve_body($response));
299 299
 
300
-				delete_option( $this->item_shortname . '_license_active' );
300
+				delete_option($this->item_shortname.'_license_active');
301 301
 
302
-				if ( ! (bool) $license_data->success ) {
303
-					set_transient( 'give_license_error', $license_data, 1000 );
302
+				if ( ! (bool) $license_data->success) {
303
+					set_transient('give_license_error', $license_data, 1000);
304 304
 				} else {
305
-					delete_transient( 'give_license_error' );
305
+					delete_transient('give_license_error');
306 306
 				}
307 307
 			}
308 308
 		}
@@ -316,44 +316,44 @@  discard block
 block discarded – undo
316 316
 		 */
317 317
 		public function notices() {
318 318
 
319
-			if ( ! isset( $_GET['page'] ) || 'give-settings' !== $_GET['page'] ) {
319
+			if ( ! isset($_GET['page']) || 'give-settings' !== $_GET['page']) {
320 320
 				return;
321 321
 			}
322 322
 
323
-			if ( ! isset( $_GET['tab'] ) || 'licenses' !== $_GET['tab'] ) {
323
+			if ( ! isset($_GET['tab']) || 'licenses' !== $_GET['tab']) {
324 324
 				return;
325 325
 			}
326 326
 
327
-			$license_error = get_transient( 'give_license_error' );
327
+			$license_error = get_transient('give_license_error');
328 328
 
329
-			if ( false === $license_error ) {
329
+			if (false === $license_error) {
330 330
 				return;
331 331
 			}
332 332
 
333
-			if ( ! empty( $license_error->error ) ) {
333
+			if ( ! empty($license_error->error)) {
334 334
 
335
-				switch ( $license_error->error ) {
335
+				switch ($license_error->error) {
336 336
 
337 337
 					case 'item_name_mismatch' :
338 338
 
339
-						$message = esc_html__( 'This license does not belong to the product you have entered it for.', 'give' );
339
+						$message = esc_html__('This license does not belong to the product you have entered it for.', 'give');
340 340
 						break;
341 341
 
342 342
 					case 'no_activations_left' :
343 343
 
344
-						$message = esc_html__( 'This license does not have any activations left.', 'give' );
344
+						$message = esc_html__('This license does not have any activations left.', 'give');
345 345
 						break;
346 346
 
347 347
 					case 'expired' :
348 348
 
349
-						$message = esc_html__( 'This license key is expired. Please renew it.', 'give' );
349
+						$message = esc_html__('This license key is expired. Please renew it.', 'give');
350 350
 						break;
351 351
 
352 352
 					default :
353 353
 
354 354
 						$message = sprintf(
355 355
 							/* translators: %s: license error */
356
-							esc_html__( 'There was a problem activating your license key, please try again or contact support. Error code: %s', 'give' ),
356
+							esc_html__('There was a problem activating your license key, please try again or contact support. Error code: %s', 'give'),
357 357
 							$license_error->error
358 358
 						);
359 359
 						break;
@@ -362,15 +362,15 @@  discard block
 block discarded – undo
362 362
 
363 363
 			}
364 364
 
365
-			if ( ! empty( $message ) ) {
365
+			if ( ! empty($message)) {
366 366
 
367 367
 				echo '<div class="error">';
368
-				echo '<p>' . $message . '</p>';
368
+				echo '<p>'.$message.'</p>';
369 369
 				echo '</div>';
370 370
 
371 371
 			}
372 372
 
373
-			delete_transient( 'give_license_error' );
373
+			delete_transient('give_license_error');
374 374
 
375 375
 		}
376 376
 	}
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
 	global $give_options;
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
 	global $give_options;
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,14 +50,14 @@  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
 	global $give_options;
55 55
 
56
-	if ( empty( $country ) ) {
56
+	if (empty($country)) {
57 57
 		$country = give_get_country();
58 58
 	}
59 59
 
60
-	switch ( $country ) :
60
+	switch ($country) :
61 61
 
62 62
 		case 'US' :
63 63
 			$states = give_get_states_list();
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
 	endswitch;
109 109
 
110
-	return apply_filters( 'give_give_states', $states );
110
+	return apply_filters('give_give_states', $states);
111 111
 }
112 112
 
113 113
 
@@ -120,253 +120,253 @@  discard block
 block discarded – undo
120 120
 function give_get_country_list() {
121 121
 	$countries = array(
122 122
 		''   => '',
123
-		'US' => esc_html__( 'United States', 'give' ),
124
-		'CA' => esc_html__( 'Canada', 'give' ),
125
-		'GB' => esc_html__( 'United Kingdom', 'give' ),
126
-		'AF' => esc_html__( 'Afghanistan', 'give' ),
127
-		'AL' => esc_html__( 'Albania', 'give' ),
128
-		'DZ' => esc_html__( 'Algeria', 'give' ),
129
-		'AS' => esc_html__( 'American Samoa', 'give' ),
130
-		'AD' => esc_html__( 'Andorra', 'give' ),
131
-		'AO' => esc_html__( 'Angola', 'give' ),
132
-		'AI' => esc_html__( 'Anguilla', 'give' ),
133
-		'AQ' => esc_html__( 'Antarctica', 'give' ),
134
-		'AG' => esc_html__( 'Antigua and Barbuda', 'give' ),
135
-		'AR' => esc_html__( 'Argentina', 'give' ),
136
-		'AM' => esc_html__( 'Armenia', 'give' ),
137
-		'AW' => esc_html__( 'Aruba', 'give' ),
138
-		'AU' => esc_html__( 'Australia', 'give' ),
139
-		'AT' => esc_html__( 'Austria', 'give' ),
140
-		'AZ' => esc_html__( 'Azerbaijan', 'give' ),
141
-		'BS' => esc_html__( 'Bahamas', 'give'),
142
-		'BH' => esc_html__( 'Bahrain', 'give' ),
143
-		'BD' => esc_html__( 'Bangladesh', 'give' ),
144
-		'BB' => esc_html__( 'Barbados', 'give' ),
145
-		'BY' => esc_html__( 'Belarus', 'give' ),
146
-		'BE' => esc_html__( 'Belgium', 'give' ),
147
-		'BZ' => esc_html__( 'Belize', 'give' ),
148
-		'BJ' => esc_html__( 'Benin', 'give' ),
149
-		'BM' => esc_html__( 'Bermuda', 'give' ),
150
-		'BT' => esc_html__( 'Bhutan', 'give' ),
151
-		'BO' => esc_html__( 'Bolivia', 'give' ),
152
-		'BA' => esc_html__( 'Bosnia and Herzegovina', 'give' ),
153
-		'BW' => esc_html__( 'Botswana', 'give' ),
154
-		'BV' => esc_html__( 'Bouvet Island', 'give' ),
155
-		'BR' => esc_html__( 'Brazil', 'give' ),
156
-		'IO' => esc_html__( 'British Indian Ocean Territory', 'give' ),
157
-		'BN' => esc_html__( 'Brunei Darrussalam', 'give' ),
158
-		'BG' => esc_html__( 'Bulgaria', 'give' ),
159
-		'BF' => esc_html__( 'Burkina Faso', 'give' ),
160
-		'BI' => esc_html__( 'Burundi', 'give' ),
161
-		'KH' => esc_html__( 'Cambodia', 'give' ),
162
-		'CM' => esc_html__( 'Cameroon', 'give' ),
163
-		'CV' => esc_html__( 'Cape Verde', 'give' ),
164
-		'KY' => esc_html__( 'Cayman Islands', 'give' ),
165
-		'CF' => esc_html__( 'Central African Republic', 'give' ),
166
-		'TD' => esc_html__( 'Chad', 'give' ),
167
-		'CL' => esc_html__( 'Chile', 'give' ),
168
-		'CN' => esc_html__( 'China', 'give' ),
169
-		'CX' => esc_html__( 'Christmas Island', 'give' ),
170
-		'CC' => esc_html__( 'Cocos Islands', 'give' ),
171
-		'CO' => esc_html__( 'Colombia', 'give' ),
172
-		'KM' => esc_html__( 'Comoros', 'give' ),
173
-		'CD' => esc_html__( 'Congo, Democratic People\'s Republic', 'give' ),
174
-		'CG' => esc_html__( 'Congo, Republic of', 'give' ),
175
-		'CK' => esc_html__( 'Cook Islands', 'give' ),
176
-		'CR' => esc_html__( 'Costa Rica', 'give' ),
177
-		'CI' => esc_html__( 'Cote d\'Ivoire', 'give' ),
178
-		'HR' => esc_html__( 'Croatia/Hrvatska', 'give' ),
179
-		'CU' => esc_html__( 'Cuba', 'give' ),
180
-		'CY' => esc_html__( 'Cyprus Island', 'give' ),
181
-		'CZ' => esc_html__( 'Czech Republic', 'give' ),
182
-		'DK' => esc_html__( 'Denmark', 'give' ),
183
-		'DJ' => esc_html__( 'Djibouti', 'give' ),
184
-		'DM' => esc_html__( 'Dominica', 'give' ),
185
-		'DO' => esc_html__( 'Dominican Republic', 'give' ),
186
-		'TP' => esc_html__( 'East Timor', 'give' ),
187
-		'EC' => esc_html__( 'Ecuador', 'give' ),
188
-		'EG' => esc_html__( 'Egypt', 'give' ),
189
-		'GQ' => esc_html__( 'Equatorial Guinea', 'give' ),
190
-		'SV' => esc_html__( 'El Salvador', 'give' ),
191
-		'ER' => esc_html__( 'Eritrea', 'give' ),
192
-		'EE' => esc_html__( 'Estonia', 'give' ),
193
-		'ET' => esc_html__( 'Ethiopia', 'give' ),
194
-		'FK' => esc_html__( 'Falkland Islands', 'give' ),
195
-		'FO' => esc_html__( 'Faroe Islands', 'give' ),
196
-		'FJ' => esc_html__( 'Fiji', 'give' ),
197
-		'FI' => esc_html__( 'Finland', 'give' ),
198
-		'FR' => esc_html__( 'France', 'give' ),
199
-		'GF' => esc_html__( 'French Guiana', 'give' ),
200
-		'PF' => esc_html__( 'French Polynesia', 'give' ),
201
-		'TF' => esc_html__( 'French Southern Territories', 'give' ),
202
-		'GA' => esc_html__( 'Gabon', 'give' ),
203
-		'GM' => esc_html__( 'Gambia', 'give' ),
204
-		'GE' => esc_html__( 'Georgia', 'give' ),
205
-		'DE' => esc_html__( 'Germany', 'give' ),
206
-		'GR' => esc_html__( 'Greece', 'give' ),
207
-		'GH' => esc_html__( 'Ghana', 'give' ),
208
-		'GI' => esc_html__( 'Gibraltar', 'give' ),
209
-		'GL' => esc_html__( 'Greenland', 'give' ),
210
-		'GD' => esc_html__( 'Grenada', 'give' ),
211
-		'GP' => esc_html__( 'Guadeloupe', 'give' ),
212
-		'GU' => esc_html__( 'Guam', 'give' ),
213
-		'GT' => esc_html__( 'Guatemala', 'give' ),
214
-		'GG' => esc_html__( 'Guernsey', 'give' ),
215
-		'GN' => esc_html__( 'Guinea', 'give' ),
216
-		'GW' => esc_html__( 'Guinea-Bissau', 'give' ),
217
-		'GY' => esc_html__( 'Guyana', 'give' ),
218
-		'HT' => esc_html__( 'Haiti', 'give' ),
219
-		'HM' => esc_html__( 'Heard and McDonald Islands', 'give' ),
220
-		'VA' => esc_html__( 'Holy See (City Vatican State)', 'give' ),
221
-		'HN' => esc_html__( 'Honduras', 'give' ),
222
-		'HK' => esc_html__( 'Hong Kong', 'give' ),
223
-		'HU' => esc_html__( 'Hungary', 'give' ),
224
-		'IS' => esc_html__( 'Iceland', 'give' ),
225
-		'IN' => esc_html__( 'India', 'give' ),
226
-		'ID' => esc_html__( 'Indonesia', 'give' ),
227
-		'IR' => esc_html__( 'Iran', 'give' ),
228
-		'IQ' => esc_html__( 'Iraq', 'give' ),
229
-		'IE' => esc_html__( 'Ireland', 'give' ),
230
-		'IM' => esc_html__( 'Isle of Man', 'give' ),
231
-		'IL' => esc_html__( 'Israel', 'give' ),
232
-		'IT' => esc_html__( 'Italy', 'give' ),
233
-		'JM' => esc_html__( 'Jamaica', 'give' ),
234
-		'JP' => esc_html__( 'Japan', 'give' ),
235
-		'JE' => esc_html__( 'Jersey', 'give' ),
236
-		'JO' => esc_html__( 'Jordan', 'give' ),
237
-		'KZ' => esc_html__( 'Kazakhstan', 'give' ),
238
-		'KE' => esc_html__( 'Kenya', 'give' ),
239
-		'KI' => esc_html__( 'Kiribati', 'give' ),
240
-		'KW' => esc_html__( 'Kuwait', 'give' ),
241
-		'KG' => esc_html__( 'Kyrgyzstan', 'give' ),
242
-		'LA' => esc_html__( 'Lao People\'s Democratic Republic', 'give' ),
243
-		'LV' => esc_html__( 'Latvia', 'give' ),
244
-		'LB' => esc_html__( 'Lebanon', 'give' ),
245
-		'LS' => esc_html__( 'Lesotho', 'give' ),
246
-		'LR' => esc_html__( 'Liberia', 'give' ),
247
-		'LY' => esc_html__( 'Libyan Arab Jamahiriya', 'give' ),
248
-		'LI' => esc_html__( 'Liechtenstein', 'give' ),
249
-		'LT' => esc_html__( 'Lithuania', 'give' ),
250
-		'LU' => esc_html__( 'Luxembourg', 'give' ),
251
-		'MO' => esc_html__( 'Macau', 'give' ),
252
-		'MK' => esc_html__( 'Macedonia', 'give' ),
253
-		'MG' => esc_html__( 'Madagascar', 'give' ),
254
-		'MW' => esc_html__( 'Malawi', 'give' ),
255
-		'MY' => esc_html__( 'Malaysia', 'give' ),
256
-		'MV' => esc_html__( 'Maldives', 'give' ),
257
-		'ML' => esc_html__( 'Mali', 'give' ),
258
-		'MT' => esc_html__( 'Malta', 'give' ),
259
-		'MH' => esc_html__( 'Marshall Islands', 'give' ),
260
-		'MQ' => esc_html__( 'Martinique', 'give' ),
261
-		'MR' => esc_html__( 'Mauritania', 'give' ),
262
-		'MU' => esc_html__( 'Mauritius', 'give' ),
263
-		'YT' => esc_html__( 'Mayotte', 'give' ),
264
-		'MX' => esc_html__( 'Mexico', 'give' ),
265
-		'FM' => esc_html__( 'Micronesia', 'give' ),
266
-		'MD' => esc_html__( 'Moldova, Republic of', 'give' ),
267
-		'MC' => esc_html__( 'Monaco', 'give' ),
268
-		'MN' => esc_html__( 'Mongolia', 'give' ),
269
-		'ME' => esc_html__( 'Montenegro', 'give' ),
270
-		'MS' => esc_html__( 'Montserrat', 'give' ),
271
-		'MA' => esc_html__( 'Morocco', 'give' ),
272
-		'MZ' => esc_html__( 'Mozambique', 'give' ),
273
-		'MM' => esc_html__( 'Myanmar', 'give' ),
274
-		'NA' => esc_html__( 'Namibia', 'give' ),
275
-		'NR' => esc_html__( 'Nauru', 'give' ),
276
-		'NP' => esc_html__( 'Nepal', 'give' ),
277
-		'NL' => esc_html__( 'Netherlands', 'give' ),
278
-		'AN' => esc_html__( 'Netherlands Antilles', 'give' ),
279
-		'NC' => esc_html__( 'New Caledonia', 'give' ),
280
-		'NZ' => esc_html__( 'New Zealand', 'give' ),
281
-		'NI' => esc_html__( 'Nicaragua', 'give' ),
282
-		'NE' => esc_html__( 'Niger', 'give' ),
283
-		'NG' => esc_html__( 'Nigeria', 'give' ),
284
-		'NU' => esc_html__( 'Niue', 'give' ),
285
-		'NF' => esc_html__( 'Norfolk Island', 'give' ),
286
-		'KP' => esc_html__( 'North Korea', 'give' ),
287
-		'MP' => esc_html__( 'Northern Mariana Islands', 'give' ),
288
-		'NO' => esc_html__( 'Norway', 'give' ),
289
-		'OM' => esc_html__( 'Oman', 'give' ),
290
-		'PK' => esc_html__( 'Pakistan', 'give' ),
291
-		'PW' => esc_html__( 'Palau', 'give' ),
292
-		'PS' => esc_html__( 'Palestinian Territories', 'give' ),
293
-		'PA' => esc_html__( 'Panama', 'give' ),
294
-		'PG' => esc_html__( 'Papua New Guinea', 'give' ),
295
-		'PY' => esc_html__( 'Paraguay', 'give' ),
296
-		'PE' => esc_html__( 'Peru', 'give' ),
297
-		'PH' => esc_html__( 'Phillipines', 'give' ),
298
-		'PN' => esc_html__( 'Pitcairn Island', 'give' ),
299
-		'PL' => esc_html__( 'Poland', 'give' ),
300
-		'PT' => esc_html__( 'Portugal', 'give' ),
301
-		'PR' => esc_html__( 'Puerto Rico', 'give' ),
302
-		'QA' => esc_html__( 'Qatar', 'give' ),
303
-		'RE' => esc_html__( 'Reunion Island', 'give' ),
304
-		'RO' => esc_html__( 'Romania', 'give' ),
305
-		'RU' => esc_html__( 'Russian Federation', 'give' ),
306
-		'RW' => esc_html__( 'Rwanda', 'give' ),
307
-		'SH' => esc_html__( 'Saint Helena', 'give' ),
308
-		'KN' => esc_html__( 'Saint Kitts and Nevis', 'give' ),
309
-		'LC' => esc_html__( 'Saint Lucia', 'give' ),
310
-		'PM' => esc_html__( 'Saint Pierre and Miquelon', 'give' ),
311
-		'VC' => esc_html__( 'Saint Vincent and the Grenadines', 'give' ),
312
-		'SM' => esc_html__( 'San Marino', 'give' ),
313
-		'ST' => esc_html__( 'Sao Tome and Principe', 'give' ),
314
-		'SA' => esc_html__( 'Saudi Arabia', 'give' ),
315
-		'SN' => esc_html__( 'Senegal', 'give' ),
316
-		'RS' => esc_html__( 'Serbia', 'give' ),
317
-		'SC' => esc_html__( 'Seychelles', 'give' ),
318
-		'SL' => esc_html__( 'Sierra Leone', 'give' ),
319
-		'SG' => esc_html__( 'Singapore', 'give' ),
320
-		'SK' => esc_html__( 'Slovak Republic', 'give' ),
321
-		'SI' => esc_html__( 'Slovenia', 'give' ),
322
-		'SB' => esc_html__( 'Solomon Islands', 'give' ),
323
-		'SO' => esc_html__( 'Somalia', 'give' ),
324
-		'ZA' => esc_html__( 'South Africa', 'give' ),
325
-		'GS' => esc_html__( 'South Georgia', 'give' ),
326
-		'KR' => esc_html__( 'South Korea', 'give' ),
327
-		'ES' => esc_html__( 'Spain', 'give' ),
328
-		'LK' => esc_html__( 'Sri Lanka', 'give' ),
329
-		'SD' => esc_html__( 'Sudan', 'give' ),
330
-		'SR' => esc_html__( 'Suriname', 'give' ),
331
-		'SJ' => esc_html__( 'Svalbard and Jan Mayen Islands', 'give' ),
332
-		'SZ' => esc_html__( 'Swaziland', 'give' ),
333
-		'SE' => esc_html__( 'Sweden', 'give' ),
334
-		'CH' => esc_html__( 'Switzerland', 'give' ),
335
-		'SY' => esc_html__( 'Syrian Arab Republic', 'give' ),
336
-		'TW' => esc_html__( 'Taiwan', 'give' ),
337
-		'TJ' => esc_html__( 'Tajikistan', 'give' ),
338
-		'TZ' => esc_html__( 'Tanzania', 'give' ),
339
-		'TG' => esc_html__( 'Togo', 'give' ),
340
-		'TK' => esc_html__( 'Tokelau', 'give' ),
341
-		'TO' => esc_html__( 'Tonga', 'give' ),
342
-		'TH' => esc_html__( 'Thailand', 'give' ),
343
-		'TT' => esc_html__( 'Trinidad and Tobago', 'give' ),
344
-		'TN' => esc_html__( 'Tunisia', 'give' ),
345
-		'TR' => esc_html__( 'Turkey', 'give' ),
346
-		'TM' => esc_html__( 'Turkmenistan', 'give' ),
347
-		'TC' => esc_html__( 'Turks and Caicos Islands', 'give' ),
348
-		'TV' => esc_html__( 'Tuvalu', 'give' ),
349
-		'UG' => esc_html__( 'Uganda', 'give' ),
350
-		'UA' => esc_html__( 'Ukraine', 'give' ),
351
-		'AE' => esc_html__( 'United Arab Emirates', 'give' ),
352
-		'UY' => esc_html__( 'Uruguay', 'give' ),
353
-		'UM' => esc_html__( 'US Minor Outlying Islands', 'give' ),
354
-		'UZ' => esc_html__( 'Uzbekistan', 'give' ),
355
-		'VU' => esc_html__( 'Vanuatu', 'give' ),
356
-		'VE' => esc_html__( 'Venezuela', 'give' ),
357
-		'VN' => esc_html__( 'Vietnam', 'give' ),
358
-		'VG' => esc_html__( 'Virgin Islands (British)', 'give' ),
359
-		'VI' => esc_html__( 'Virgin Islands (USA)', 'give' ),
360
-		'WF' => esc_html__( 'Wallis and Futuna Islands', 'give' ),
361
-		'EH' => esc_html__( 'Western Sahara', 'give' ),
362
-		'WS' => esc_html__( 'Western Samoa', 'give' ),
363
-		'YE' => esc_html__( 'Yemen', 'give' ),
364
-		'YU' => esc_html__( 'Yugoslavia', 'give' ),
365
-		'ZM' => esc_html__( 'Zambia', 'give' ),
366
-		'ZW' => esc_html__( 'Zimbabwe', 'give' )
123
+		'US' => esc_html__('United States', 'give'),
124
+		'CA' => esc_html__('Canada', 'give'),
125
+		'GB' => esc_html__('United Kingdom', 'give'),
126
+		'AF' => esc_html__('Afghanistan', 'give'),
127
+		'AL' => esc_html__('Albania', 'give'),
128
+		'DZ' => esc_html__('Algeria', 'give'),
129
+		'AS' => esc_html__('American Samoa', 'give'),
130
+		'AD' => esc_html__('Andorra', 'give'),
131
+		'AO' => esc_html__('Angola', 'give'),
132
+		'AI' => esc_html__('Anguilla', 'give'),
133
+		'AQ' => esc_html__('Antarctica', 'give'),
134
+		'AG' => esc_html__('Antigua and Barbuda', 'give'),
135
+		'AR' => esc_html__('Argentina', 'give'),
136
+		'AM' => esc_html__('Armenia', 'give'),
137
+		'AW' => esc_html__('Aruba', 'give'),
138
+		'AU' => esc_html__('Australia', 'give'),
139
+		'AT' => esc_html__('Austria', 'give'),
140
+		'AZ' => esc_html__('Azerbaijan', 'give'),
141
+		'BS' => esc_html__('Bahamas', 'give'),
142
+		'BH' => esc_html__('Bahrain', 'give'),
143
+		'BD' => esc_html__('Bangladesh', 'give'),
144
+		'BB' => esc_html__('Barbados', 'give'),
145
+		'BY' => esc_html__('Belarus', 'give'),
146
+		'BE' => esc_html__('Belgium', 'give'),
147
+		'BZ' => esc_html__('Belize', 'give'),
148
+		'BJ' => esc_html__('Benin', 'give'),
149
+		'BM' => esc_html__('Bermuda', 'give'),
150
+		'BT' => esc_html__('Bhutan', 'give'),
151
+		'BO' => esc_html__('Bolivia', 'give'),
152
+		'BA' => esc_html__('Bosnia and Herzegovina', 'give'),
153
+		'BW' => esc_html__('Botswana', 'give'),
154
+		'BV' => esc_html__('Bouvet Island', 'give'),
155
+		'BR' => esc_html__('Brazil', 'give'),
156
+		'IO' => esc_html__('British Indian Ocean Territory', 'give'),
157
+		'BN' => esc_html__('Brunei Darrussalam', 'give'),
158
+		'BG' => esc_html__('Bulgaria', 'give'),
159
+		'BF' => esc_html__('Burkina Faso', 'give'),
160
+		'BI' => esc_html__('Burundi', 'give'),
161
+		'KH' => esc_html__('Cambodia', 'give'),
162
+		'CM' => esc_html__('Cameroon', 'give'),
163
+		'CV' => esc_html__('Cape Verde', 'give'),
164
+		'KY' => esc_html__('Cayman Islands', 'give'),
165
+		'CF' => esc_html__('Central African Republic', 'give'),
166
+		'TD' => esc_html__('Chad', 'give'),
167
+		'CL' => esc_html__('Chile', 'give'),
168
+		'CN' => esc_html__('China', 'give'),
169
+		'CX' => esc_html__('Christmas Island', 'give'),
170
+		'CC' => esc_html__('Cocos Islands', 'give'),
171
+		'CO' => esc_html__('Colombia', 'give'),
172
+		'KM' => esc_html__('Comoros', 'give'),
173
+		'CD' => esc_html__('Congo, Democratic People\'s Republic', 'give'),
174
+		'CG' => esc_html__('Congo, Republic of', 'give'),
175
+		'CK' => esc_html__('Cook Islands', 'give'),
176
+		'CR' => esc_html__('Costa Rica', 'give'),
177
+		'CI' => esc_html__('Cote d\'Ivoire', 'give'),
178
+		'HR' => esc_html__('Croatia/Hrvatska', 'give'),
179
+		'CU' => esc_html__('Cuba', 'give'),
180
+		'CY' => esc_html__('Cyprus Island', 'give'),
181
+		'CZ' => esc_html__('Czech Republic', 'give'),
182
+		'DK' => esc_html__('Denmark', 'give'),
183
+		'DJ' => esc_html__('Djibouti', 'give'),
184
+		'DM' => esc_html__('Dominica', 'give'),
185
+		'DO' => esc_html__('Dominican Republic', 'give'),
186
+		'TP' => esc_html__('East Timor', 'give'),
187
+		'EC' => esc_html__('Ecuador', 'give'),
188
+		'EG' => esc_html__('Egypt', 'give'),
189
+		'GQ' => esc_html__('Equatorial Guinea', 'give'),
190
+		'SV' => esc_html__('El Salvador', 'give'),
191
+		'ER' => esc_html__('Eritrea', 'give'),
192
+		'EE' => esc_html__('Estonia', 'give'),
193
+		'ET' => esc_html__('Ethiopia', 'give'),
194
+		'FK' => esc_html__('Falkland Islands', 'give'),
195
+		'FO' => esc_html__('Faroe Islands', 'give'),
196
+		'FJ' => esc_html__('Fiji', 'give'),
197
+		'FI' => esc_html__('Finland', 'give'),
198
+		'FR' => esc_html__('France', 'give'),
199
+		'GF' => esc_html__('French Guiana', 'give'),
200
+		'PF' => esc_html__('French Polynesia', 'give'),
201
+		'TF' => esc_html__('French Southern Territories', 'give'),
202
+		'GA' => esc_html__('Gabon', 'give'),
203
+		'GM' => esc_html__('Gambia', 'give'),
204
+		'GE' => esc_html__('Georgia', 'give'),
205
+		'DE' => esc_html__('Germany', 'give'),
206
+		'GR' => esc_html__('Greece', 'give'),
207
+		'GH' => esc_html__('Ghana', 'give'),
208
+		'GI' => esc_html__('Gibraltar', 'give'),
209
+		'GL' => esc_html__('Greenland', 'give'),
210
+		'GD' => esc_html__('Grenada', 'give'),
211
+		'GP' => esc_html__('Guadeloupe', 'give'),
212
+		'GU' => esc_html__('Guam', 'give'),
213
+		'GT' => esc_html__('Guatemala', 'give'),
214
+		'GG' => esc_html__('Guernsey', 'give'),
215
+		'GN' => esc_html__('Guinea', 'give'),
216
+		'GW' => esc_html__('Guinea-Bissau', 'give'),
217
+		'GY' => esc_html__('Guyana', 'give'),
218
+		'HT' => esc_html__('Haiti', 'give'),
219
+		'HM' => esc_html__('Heard and McDonald Islands', 'give'),
220
+		'VA' => esc_html__('Holy See (City Vatican State)', 'give'),
221
+		'HN' => esc_html__('Honduras', 'give'),
222
+		'HK' => esc_html__('Hong Kong', 'give'),
223
+		'HU' => esc_html__('Hungary', 'give'),
224
+		'IS' => esc_html__('Iceland', 'give'),
225
+		'IN' => esc_html__('India', 'give'),
226
+		'ID' => esc_html__('Indonesia', 'give'),
227
+		'IR' => esc_html__('Iran', 'give'),
228
+		'IQ' => esc_html__('Iraq', 'give'),
229
+		'IE' => esc_html__('Ireland', 'give'),
230
+		'IM' => esc_html__('Isle of Man', 'give'),
231
+		'IL' => esc_html__('Israel', 'give'),
232
+		'IT' => esc_html__('Italy', 'give'),
233
+		'JM' => esc_html__('Jamaica', 'give'),
234
+		'JP' => esc_html__('Japan', 'give'),
235
+		'JE' => esc_html__('Jersey', 'give'),
236
+		'JO' => esc_html__('Jordan', 'give'),
237
+		'KZ' => esc_html__('Kazakhstan', 'give'),
238
+		'KE' => esc_html__('Kenya', 'give'),
239
+		'KI' => esc_html__('Kiribati', 'give'),
240
+		'KW' => esc_html__('Kuwait', 'give'),
241
+		'KG' => esc_html__('Kyrgyzstan', 'give'),
242
+		'LA' => esc_html__('Lao People\'s Democratic Republic', 'give'),
243
+		'LV' => esc_html__('Latvia', 'give'),
244
+		'LB' => esc_html__('Lebanon', 'give'),
245
+		'LS' => esc_html__('Lesotho', 'give'),
246
+		'LR' => esc_html__('Liberia', 'give'),
247
+		'LY' => esc_html__('Libyan Arab Jamahiriya', 'give'),
248
+		'LI' => esc_html__('Liechtenstein', 'give'),
249
+		'LT' => esc_html__('Lithuania', 'give'),
250
+		'LU' => esc_html__('Luxembourg', 'give'),
251
+		'MO' => esc_html__('Macau', 'give'),
252
+		'MK' => esc_html__('Macedonia', 'give'),
253
+		'MG' => esc_html__('Madagascar', 'give'),
254
+		'MW' => esc_html__('Malawi', 'give'),
255
+		'MY' => esc_html__('Malaysia', 'give'),
256
+		'MV' => esc_html__('Maldives', 'give'),
257
+		'ML' => esc_html__('Mali', 'give'),
258
+		'MT' => esc_html__('Malta', 'give'),
259
+		'MH' => esc_html__('Marshall Islands', 'give'),
260
+		'MQ' => esc_html__('Martinique', 'give'),
261
+		'MR' => esc_html__('Mauritania', 'give'),
262
+		'MU' => esc_html__('Mauritius', 'give'),
263
+		'YT' => esc_html__('Mayotte', 'give'),
264
+		'MX' => esc_html__('Mexico', 'give'),
265
+		'FM' => esc_html__('Micronesia', 'give'),
266
+		'MD' => esc_html__('Moldova, Republic of', 'give'),
267
+		'MC' => esc_html__('Monaco', 'give'),
268
+		'MN' => esc_html__('Mongolia', 'give'),
269
+		'ME' => esc_html__('Montenegro', 'give'),
270
+		'MS' => esc_html__('Montserrat', 'give'),
271
+		'MA' => esc_html__('Morocco', 'give'),
272
+		'MZ' => esc_html__('Mozambique', 'give'),
273
+		'MM' => esc_html__('Myanmar', 'give'),
274
+		'NA' => esc_html__('Namibia', 'give'),
275
+		'NR' => esc_html__('Nauru', 'give'),
276
+		'NP' => esc_html__('Nepal', 'give'),
277
+		'NL' => esc_html__('Netherlands', 'give'),
278
+		'AN' => esc_html__('Netherlands Antilles', 'give'),
279
+		'NC' => esc_html__('New Caledonia', 'give'),
280
+		'NZ' => esc_html__('New Zealand', 'give'),
281
+		'NI' => esc_html__('Nicaragua', 'give'),
282
+		'NE' => esc_html__('Niger', 'give'),
283
+		'NG' => esc_html__('Nigeria', 'give'),
284
+		'NU' => esc_html__('Niue', 'give'),
285
+		'NF' => esc_html__('Norfolk Island', 'give'),
286
+		'KP' => esc_html__('North Korea', 'give'),
287
+		'MP' => esc_html__('Northern Mariana Islands', 'give'),
288
+		'NO' => esc_html__('Norway', 'give'),
289
+		'OM' => esc_html__('Oman', 'give'),
290
+		'PK' => esc_html__('Pakistan', 'give'),
291
+		'PW' => esc_html__('Palau', 'give'),
292
+		'PS' => esc_html__('Palestinian Territories', 'give'),
293
+		'PA' => esc_html__('Panama', 'give'),
294
+		'PG' => esc_html__('Papua New Guinea', 'give'),
295
+		'PY' => esc_html__('Paraguay', 'give'),
296
+		'PE' => esc_html__('Peru', 'give'),
297
+		'PH' => esc_html__('Phillipines', 'give'),
298
+		'PN' => esc_html__('Pitcairn Island', 'give'),
299
+		'PL' => esc_html__('Poland', 'give'),
300
+		'PT' => esc_html__('Portugal', 'give'),
301
+		'PR' => esc_html__('Puerto Rico', 'give'),
302
+		'QA' => esc_html__('Qatar', 'give'),
303
+		'RE' => esc_html__('Reunion Island', 'give'),
304
+		'RO' => esc_html__('Romania', 'give'),
305
+		'RU' => esc_html__('Russian Federation', 'give'),
306
+		'RW' => esc_html__('Rwanda', 'give'),
307
+		'SH' => esc_html__('Saint Helena', 'give'),
308
+		'KN' => esc_html__('Saint Kitts and Nevis', 'give'),
309
+		'LC' => esc_html__('Saint Lucia', 'give'),
310
+		'PM' => esc_html__('Saint Pierre and Miquelon', 'give'),
311
+		'VC' => esc_html__('Saint Vincent and the Grenadines', 'give'),
312
+		'SM' => esc_html__('San Marino', 'give'),
313
+		'ST' => esc_html__('Sao Tome and Principe', 'give'),
314
+		'SA' => esc_html__('Saudi Arabia', 'give'),
315
+		'SN' => esc_html__('Senegal', 'give'),
316
+		'RS' => esc_html__('Serbia', 'give'),
317
+		'SC' => esc_html__('Seychelles', 'give'),
318
+		'SL' => esc_html__('Sierra Leone', 'give'),
319
+		'SG' => esc_html__('Singapore', 'give'),
320
+		'SK' => esc_html__('Slovak Republic', 'give'),
321
+		'SI' => esc_html__('Slovenia', 'give'),
322
+		'SB' => esc_html__('Solomon Islands', 'give'),
323
+		'SO' => esc_html__('Somalia', 'give'),
324
+		'ZA' => esc_html__('South Africa', 'give'),
325
+		'GS' => esc_html__('South Georgia', 'give'),
326
+		'KR' => esc_html__('South Korea', 'give'),
327
+		'ES' => esc_html__('Spain', 'give'),
328
+		'LK' => esc_html__('Sri Lanka', 'give'),
329
+		'SD' => esc_html__('Sudan', 'give'),
330
+		'SR' => esc_html__('Suriname', 'give'),
331
+		'SJ' => esc_html__('Svalbard and Jan Mayen Islands', 'give'),
332
+		'SZ' => esc_html__('Swaziland', 'give'),
333
+		'SE' => esc_html__('Sweden', 'give'),
334
+		'CH' => esc_html__('Switzerland', 'give'),
335
+		'SY' => esc_html__('Syrian Arab Republic', 'give'),
336
+		'TW' => esc_html__('Taiwan', 'give'),
337
+		'TJ' => esc_html__('Tajikistan', 'give'),
338
+		'TZ' => esc_html__('Tanzania', 'give'),
339
+		'TG' => esc_html__('Togo', 'give'),
340
+		'TK' => esc_html__('Tokelau', 'give'),
341
+		'TO' => esc_html__('Tonga', 'give'),
342
+		'TH' => esc_html__('Thailand', 'give'),
343
+		'TT' => esc_html__('Trinidad and Tobago', 'give'),
344
+		'TN' => esc_html__('Tunisia', 'give'),
345
+		'TR' => esc_html__('Turkey', 'give'),
346
+		'TM' => esc_html__('Turkmenistan', 'give'),
347
+		'TC' => esc_html__('Turks and Caicos Islands', 'give'),
348
+		'TV' => esc_html__('Tuvalu', 'give'),
349
+		'UG' => esc_html__('Uganda', 'give'),
350
+		'UA' => esc_html__('Ukraine', 'give'),
351
+		'AE' => esc_html__('United Arab Emirates', 'give'),
352
+		'UY' => esc_html__('Uruguay', 'give'),
353
+		'UM' => esc_html__('US Minor Outlying Islands', 'give'),
354
+		'UZ' => esc_html__('Uzbekistan', 'give'),
355
+		'VU' => esc_html__('Vanuatu', 'give'),
356
+		'VE' => esc_html__('Venezuela', 'give'),
357
+		'VN' => esc_html__('Vietnam', 'give'),
358
+		'VG' => esc_html__('Virgin Islands (British)', 'give'),
359
+		'VI' => esc_html__('Virgin Islands (USA)', 'give'),
360
+		'WF' => esc_html__('Wallis and Futuna Islands', 'give'),
361
+		'EH' => esc_html__('Western Sahara', 'give'),
362
+		'WS' => esc_html__('Western Samoa', 'give'),
363
+		'YE' => esc_html__('Yemen', 'give'),
364
+		'YU' => esc_html__('Yugoslavia', 'give'),
365
+		'ZM' => esc_html__('Zambia', 'give'),
366
+		'ZW' => esc_html__('Zimbabwe', 'give')
367 367
 	);
368 368
 
369
-	return apply_filters( 'give_countries', $countries );
369
+	return apply_filters('give_countries', $countries);
370 370
 }
371 371
 
372 372
 /**
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 		'AP' => 'Armed Forces - Pacific'
448 448
 	);
449 449
 
450
-	return apply_filters( 'give_us_states', $states );
450
+	return apply_filters('give_us_states', $states);
451 451
 }
452 452
 
453 453
 /**
@@ -460,22 +460,22 @@  discard block
 block discarded – undo
460 460
 function give_get_provinces_list() {
461 461
 	$provinces = array(
462 462
 		''   => '',
463
-		'AB' => esc_html__('Alberta', 'give' ),
464
-		'BC' => esc_html__('British Columbia', 'give' ),
465
-		'MB' => esc_html__('Manitoba', 'give' ),
466
-		'NB' => esc_html__('New Brunswick', 'give' ),
467
-		'NL' => esc_html__('Newfoundland and Labrador', 'give' ),
468
-		'NS' => esc_html__('Nova Scotia', 'give' ),
469
-		'NT' => esc_html__('Northwest Territories', 'give' ),
470
-		'NU' => esc_html__('Nunavut', 'give' ),
471
-		'ON' => esc_html__('Ontario', 'give' ),
472
-		'PE' => esc_html__('Prince Edward Island', 'give' ),
473
-		'QC' => esc_html__('Quebec', 'give' ),
474
-		'SK' => esc_html__('Saskatchewan', 'give' ),
475
-		'YT' => esc_html__('Yukon', 'give' )
463
+		'AB' => esc_html__('Alberta', 'give'),
464
+		'BC' => esc_html__('British Columbia', 'give'),
465
+		'MB' => esc_html__('Manitoba', 'give'),
466
+		'NB' => esc_html__('New Brunswick', 'give'),
467
+		'NL' => esc_html__('Newfoundland and Labrador', 'give'),
468
+		'NS' => esc_html__('Nova Scotia', 'give'),
469
+		'NT' => esc_html__('Northwest Territories', 'give'),
470
+		'NU' => esc_html__('Nunavut', 'give'),
471
+		'ON' => esc_html__('Ontario', 'give'),
472
+		'PE' => esc_html__('Prince Edward Island', 'give'),
473
+		'QC' => esc_html__('Quebec', 'give'),
474
+		'SK' => esc_html__('Saskatchewan', 'give'),
475
+		'YT' => esc_html__('Yukon', 'give')
476 476
 	);
477 477
 
478
-	return apply_filters( 'give_canada_provinces', $provinces );
478
+	return apply_filters('give_canada_provinces', $provinces);
479 479
 }
480 480
 
481 481
 /**
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
 		'WA'  => 'Western Australia'
498 498
 	);
499 499
 
500
-	return apply_filters( 'give_australian_states', $states );
500
+	return apply_filters('give_australian_states', $states);
501 501
 }
502 502
 
503 503
 /**
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
 		'TO' => 'Tocantins'
539 539
 	);
540 540
 
541
-	return apply_filters( 'give_brazil_states', $states );
541
+	return apply_filters('give_brazil_states', $states);
542 542
 }
543 543
 
544 544
 /**
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 		'NEW TERRITORIES' => 'New Territories'
556 556
 	);
557 557
 
558
-	return apply_filters( 'give_hong_kong_states', $states );
558
+	return apply_filters('give_hong_kong_states', $states);
559 559
 }
560 560
 
561 561
 /**
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
 		'ZA' => 'Zala'
590 590
 	);
591 591
 
592
-	return apply_filters( 'give_hungary_states', $states );
592
+	return apply_filters('give_hungary_states', $states);
593 593
 }
594 594
 
595 595
 /**
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
 		'CN32' => 'Xinjiang / &#26032;&#30086;'
636 636
 	);
637 637
 
638
-	return apply_filters( 'give_chinese_states', $states );
638
+	return apply_filters('give_chinese_states', $states);
639 639
 }
640 640
 
641 641
 /**
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
 		'WC' => 'West Coast'
665 665
 	);
666 666
 
667
-	return apply_filters( 'give_new_zealand_states', $states );
667
+	return apply_filters('give_new_zealand_states', $states);
668 668
 }
669 669
 
670 670
 /**
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
 		'PB' => 'Papua Barat'
713 713
 	);
714 714
 
715
-	return apply_filters( 'give_indonesia_states', $states );
715
+	return apply_filters('give_indonesia_states', $states);
716 716
 }
717 717
 
718 718
 /**
@@ -762,7 +762,7 @@  discard block
 block discarded – undo
762 762
 		'PY' => 'Pondicherry (Puducherry)'
763 763
 	);
764 764
 
765
-	return apply_filters( 'give_indian_states', $states );
765
+	return apply_filters('give_indian_states', $states);
766 766
 }
767 767
 
768 768
 /**
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 		'PJY' => 'W.P. Putrajaya'
793 793
 	);
794 794
 
795
-	return apply_filters( 'give_malaysian_states', $states );
795
+	return apply_filters('give_malaysian_states', $states);
796 796
 }
797 797
 
798 798
 /**
@@ -815,7 +815,7 @@  discard block
 block discarded – undo
815 815
 		'WC'  => 'Western Cape'
816 816
 	);
817 817
 
818
-	return apply_filters( 'give_south_african_states', $states );
818
+	return apply_filters('give_south_african_states', $states);
819 819
 }
820 820
 
821 821
 /**
@@ -906,7 +906,7 @@  discard block
 block discarded – undo
906 906
 		'TH-35' => 'Yasothon (&#3618;&#3650;&#3626;&#3608;&#3619;)'
907 907
 	);
908 908
 
909
-	return apply_filters( 'give_thailand_states', $states );
909
+	return apply_filters('give_thailand_states', $states);
910 910
 }
911 911
 
912 912
 /**
@@ -918,59 +918,59 @@  discard block
 block discarded – undo
918 918
 function give_get_spain_states_list() {
919 919
 	$states = array(
920 920
 		''   => '',
921
-		'C'  => esc_html__( 'A Coru&ntilde;a', 'give' ),
922
-		'VI' => esc_html__( 'Araba', 'give' ),
923
-		'AB' => esc_html__( 'Albacete', 'give' ),
924
-		'A'  => esc_html__( 'Alicante', 'give' ),
925
-		'AL' => esc_html__( 'Almer&iacute;a', 'give' ),
926
-		'O'  => esc_html__( 'Asturias', 'give' ),
927
-		'AV' => esc_html__( '&Aacute;vila', 'give' ),
928
-		'BA' => esc_html__( 'Badajoz', 'give' ),
929
-		'PM' => esc_html__( 'Baleares', 'give' ),
930
-		'B'  => esc_html__( 'Barcelona', 'give' ),
931
-		'BU' => esc_html__( 'Burgos', 'give' ),
932
-		'CC' => esc_html__( 'C&aacute;ceres', 'give' ),
933
-		'CA' => esc_html__( 'C&aacute;diz', 'give' ),
934
-		'S'  => esc_html__( 'Cantabria', 'give' ),
935
-		'CS' => esc_html__( 'Castell&oacute;n', 'give' ),
936
-		'CE' => esc_html__( 'Ceuta', 'give' ),
937
-		'CR' => esc_html__( 'Ciudad Real', 'give' ),
938
-		'CO' => esc_html__( 'C&oacute;rdoba', 'give' ),
939
-		'CU' => esc_html__( 'Cuenca', 'give' ),
940
-		'GI' => esc_html__( 'Girona', 'give' ),
941
-		'GR' => esc_html__( 'Granada', 'give' ),
942
-		'GU' => esc_html__( 'Guadalajara', 'give' ),
943
-		'SS' => esc_html__( 'Gipuzkoa', 'give' ),
944
-		'H'  => esc_html__( 'Huelva', 'give' ),
945
-		'HU' => esc_html__( 'Huesca', 'give' ),
946
-		'J'  => esc_html__( 'Ja&eacute;n', 'give' ),
947
-		'LO' => esc_html__( 'La Rioja', 'give' ),
948
-		'GC' => esc_html__( 'Las Palmas', 'give' ),
949
-		'LE' => esc_html__( 'Le&oacute;n', 'give' ),
950
-		'L'  => esc_html__( 'Lleida', 'give' ),
951
-		'LU' => esc_html__( 'Lugo', 'give' ),
952
-		'M'  => esc_html__( 'Madrid', 'give' ),
953
-		'MA' => esc_html__( 'M&aacute;laga', 'give' ),
954
-		'ML' => esc_html__( 'Melilla', 'give' ),
955
-		'MU' => esc_html__( 'Murcia', 'give' ),
956
-		'NA' => esc_html__( 'Navarra', 'give' ),
957
-		'OR' => esc_html__( 'Ourense', 'give' ),
958
-		'P'  => esc_html__( 'Palencia', 'give' ),
959
-		'PO' => esc_html__( 'Pontevedra', 'give' ),
960
-		'SA' => esc_html__( 'Salamanca', 'give' ),
961
-		'TF' => esc_html__( 'Santa Cruz de Tenerife', 'give' ),
962
-		'SG' => esc_html__( 'Segovia', 'give' ),
963
-		'SE' => esc_html__( 'Sevilla', 'give' ),
964
-		'SO' => esc_html__( 'Soria', 'give' ),
965
-		'T'  => esc_html__( 'Tarragona', 'give' ),
966
-		'TE' => esc_html__( 'Teruel', 'give' ),
967
-		'TO' => esc_html__( 'Toledo', 'give' ),
968
-		'V'  => esc_html__( 'Valencia', 'give' ),
969
-		'VA' => esc_html__( 'Valladolid', 'give' ),
970
-		'BI' => esc_html__( 'Bizkaia', 'give' ),
971
-		'ZA' => esc_html__( 'Zamora', 'give' ),
972
-		'Z'  => esc_html__( 'Zaragoza', 'give' )
921
+		'C'  => esc_html__('A Coru&ntilde;a', 'give'),
922
+		'VI' => esc_html__('Araba', 'give'),
923
+		'AB' => esc_html__('Albacete', 'give'),
924
+		'A'  => esc_html__('Alicante', 'give'),
925
+		'AL' => esc_html__('Almer&iacute;a', 'give'),
926
+		'O'  => esc_html__('Asturias', 'give'),
927
+		'AV' => esc_html__('&Aacute;vila', 'give'),
928
+		'BA' => esc_html__('Badajoz', 'give'),
929
+		'PM' => esc_html__('Baleares', 'give'),
930
+		'B'  => esc_html__('Barcelona', 'give'),
931
+		'BU' => esc_html__('Burgos', 'give'),
932
+		'CC' => esc_html__('C&aacute;ceres', 'give'),
933
+		'CA' => esc_html__('C&aacute;diz', 'give'),
934
+		'S'  => esc_html__('Cantabria', 'give'),
935
+		'CS' => esc_html__('Castell&oacute;n', 'give'),
936
+		'CE' => esc_html__('Ceuta', 'give'),
937
+		'CR' => esc_html__('Ciudad Real', 'give'),
938
+		'CO' => esc_html__('C&oacute;rdoba', 'give'),
939
+		'CU' => esc_html__('Cuenca', 'give'),
940
+		'GI' => esc_html__('Girona', 'give'),
941
+		'GR' => esc_html__('Granada', 'give'),
942
+		'GU' => esc_html__('Guadalajara', 'give'),
943
+		'SS' => esc_html__('Gipuzkoa', 'give'),
944
+		'H'  => esc_html__('Huelva', 'give'),
945
+		'HU' => esc_html__('Huesca', 'give'),
946
+		'J'  => esc_html__('Ja&eacute;n', 'give'),
947
+		'LO' => esc_html__('La Rioja', 'give'),
948
+		'GC' => esc_html__('Las Palmas', 'give'),
949
+		'LE' => esc_html__('Le&oacute;n', 'give'),
950
+		'L'  => esc_html__('Lleida', 'give'),
951
+		'LU' => esc_html__('Lugo', 'give'),
952
+		'M'  => esc_html__('Madrid', 'give'),
953
+		'MA' => esc_html__('M&aacute;laga', 'give'),
954
+		'ML' => esc_html__('Melilla', 'give'),
955
+		'MU' => esc_html__('Murcia', 'give'),
956
+		'NA' => esc_html__('Navarra', 'give'),
957
+		'OR' => esc_html__('Ourense', 'give'),
958
+		'P'  => esc_html__('Palencia', 'give'),
959
+		'PO' => esc_html__('Pontevedra', 'give'),
960
+		'SA' => esc_html__('Salamanca', 'give'),
961
+		'TF' => esc_html__('Santa Cruz de Tenerife', 'give'),
962
+		'SG' => esc_html__('Segovia', 'give'),
963
+		'SE' => esc_html__('Sevilla', 'give'),
964
+		'SO' => esc_html__('Soria', 'give'),
965
+		'T'  => esc_html__('Tarragona', 'give'),
966
+		'TE' => esc_html__('Teruel', 'give'),
967
+		'TO' => esc_html__('Toledo', 'give'),
968
+		'V'  => esc_html__('Valencia', 'give'),
969
+		'VA' => esc_html__('Valladolid', 'give'),
970
+		'BI' => esc_html__('Bizkaia', 'give'),
971
+		'ZA' => esc_html__('Zamora', 'give'),
972
+		'Z'  => esc_html__('Zaragoza', 'give')
973 973
 	);
974 974
 
975
-	return apply_filters( 'give_spain_states', $states );
975
+	return apply_filters('give_spain_states', $states);
976 976
 }
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-login.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -42,16 +42,16 @@
 block discarded – undo
42 42
 				'minWidth' => 320,
43 43
 				'tooltip'  => esc_attr__( 'Enter an URL here to redirect to after login.', 'give' ),
44 44
 			),
45
-            array(
46
-                'type' => 'container',
47
-                'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Logout Redirect URL (optional):', 'give' ) ),
48
-            ),
49
-            array(
50
-                'type'     => 'textbox',
51
-                'name'     => 'logout-redirect',
52
-                'minWidth' => 320,
53
-                'tooltip'  => esc_attr__( 'Enter an URL here to redirect to after logout.', 'give' ),
54
-            ),
45
+			array(
46
+				'type' => 'container',
47
+				'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Logout Redirect URL (optional):', 'give' ) ),
48
+			),
49
+			array(
50
+				'type'     => 'textbox',
51
+				'name'     => 'logout-redirect',
52
+				'minWidth' => 320,
53
+				'tooltip'  => esc_attr__( 'Enter an URL here to redirect to after logout.', 'give' ),
54
+			),
55 55
 		);
56 56
 	}
57 57
 }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @since       1.3.0
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) or exit;
12
+defined('ABSPATH') or exit;
13 13
 
14 14
 class Give_Shortcode_Login extends Give_Shortcode_Generator {
15 15
 
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	public function __construct() {
20 20
 
21
-		$this->shortcode['title'] = esc_html__( 'Login', 'give' );
22
-		$this->shortcode['label'] = esc_html__( 'Login', 'give' );
21
+		$this->shortcode['title'] = esc_html__('Login', 'give');
22
+		$this->shortcode['label'] = esc_html__('Login', 'give');
23 23
 
24
-		parent::__construct( 'give_login' );
24
+		parent::__construct('give_login');
25 25
 	}
26 26
 
27 27
 	/**
@@ -34,23 +34,23 @@  discard block
 block discarded – undo
34 34
 		return array(
35 35
 			array(
36 36
 				'type' => 'container',
37
-				'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Login Redirect URL (optional):', 'give' ) ),
37
+				'html' => sprintf('<p class="no-margin">%s</p>', esc_html__('Login Redirect URL (optional):', 'give')),
38 38
 			),
39 39
 			array(
40 40
 				'type'     => 'textbox',
41 41
 				'name'     => 'login-redirect',
42 42
 				'minWidth' => 320,
43
-				'tooltip'  => esc_attr__( 'Enter an URL here to redirect to after login.', 'give' ),
43
+				'tooltip'  => esc_attr__('Enter an URL here to redirect to after login.', 'give'),
44 44
 			),
45 45
             array(
46 46
                 'type' => 'container',
47
-                'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Logout Redirect URL (optional):', 'give' ) ),
47
+                'html' => sprintf('<p class="no-margin">%s</p>', esc_html__('Logout Redirect URL (optional):', 'give')),
48 48
             ),
49 49
             array(
50 50
                 'type'     => 'textbox',
51 51
                 'name'     => 'logout-redirect',
52 52
                 'minWidth' => 320,
53
-                'tooltip'  => esc_attr__( 'Enter an URL here to redirect to after logout.', 'give' ),
53
+                'tooltip'  => esc_attr__('Enter an URL here to redirect to after logout.', 'give'),
54 54
             ),
55 55
 		);
56 56
 	}
Please login to merge, or discard this patch.
includes/admin/shortcodes/abstract-shortcode-generator.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -248,8 +248,8 @@
 block discarded – undo
248 248
 
249 249
 			// do not reindex array!
250 250
 			$field['options'] = array(
251
-				                    '' => ( $field['placeholder'] ? $field['placeholder'] : esc_attr__( '- Select -', 'give' ) ),
252
-			                    ) + $field['options'];
251
+									'' => ( $field['placeholder'] ? $field['placeholder'] : esc_attr__( '- Select -', 'give' ) ),
252
+								) + $field['options'];
253 253
 
254 254
 			foreach ( $field['options'] as $value => $text ) {
255 255
 				$new_listbox['values'][] = array(
Please login to merge, or discard this patch.
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  * @since       1.3
11 11
  */
12 12
 
13
-defined( 'ABSPATH' ) or exit;
13
+defined('ABSPATH') or exit;
14 14
 
15 15
 /**
16 16
  * Class Give_Shortcode_Generator
@@ -59,12 +59,12 @@  discard block
 block discarded – undo
59 59
 	 *
60 60
 	 * @since 1.0
61 61
 	 */
62
-	public function __construct( $shortcode ) {
62
+	public function __construct($shortcode) {
63 63
 
64 64
 
65 65
 		$this->shortcode_tag = $shortcode;
66 66
 
67
-		add_action( 'admin_init', array( $this, 'init' ) );
67
+		add_action('admin_init', array($this, 'init'));
68 68
 
69 69
 	}
70 70
 
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
 	 */
76 76
 	public function init() {
77 77
 
78
-		if ( $this->shortcode_tag ) {
78
+		if ($this->shortcode_tag) {
79 79
 
80
-			$this->self = get_class( $this );
80
+			$this->self = get_class($this);
81 81
 
82 82
 			$this->errors   = array();
83 83
 			$this->required = array();
@@ -86,18 +86,18 @@  discard block
 block discarded – undo
86 86
 			$fields = $this->get_fields();
87 87
 
88 88
 			$defaults = array(
89
-				'btn_close' => esc_html__( 'Close', 'give' ),
90
-				'btn_okay'  => esc_html__( 'Insert Shortcode', 'give' ),
89
+				'btn_close' => esc_html__('Close', 'give'),
90
+				'btn_okay'  => esc_html__('Insert Shortcode', 'give'),
91 91
 				'errors'    => $this->errors,
92 92
 				'fields'    => $fields,
93
-				'label'     => '[' . $this->shortcode_tag . ']',
93
+				'label'     => '['.$this->shortcode_tag.']',
94 94
 				'required'  => $this->required,
95
-				'title'     => esc_html__( 'Insert Shortcode', 'give' ),
95
+				'title'     => esc_html__('Insert Shortcode', 'give'),
96 96
 			);
97 97
 
98
-			if ( user_can_richedit() ) {
98
+			if (user_can_richedit()) {
99 99
 
100
-				Give_Shortcode_Button::$shortcodes[ $this->shortcode_tag ] = wp_parse_args( $this->shortcode, $defaults );
100
+				Give_Shortcode_Button::$shortcodes[$this->shortcode_tag] = wp_parse_args($this->shortcode, $defaults);
101 101
 
102 102
 			}
103 103
 		}
@@ -126,13 +126,13 @@  discard block
 block discarded – undo
126 126
 	 *
127 127
 	 * @since 1.0
128 128
 	 */
129
-	protected function generate_fields( $defined_fields ) {
129
+	protected function generate_fields($defined_fields) {
130 130
 
131 131
 		$fields = array();
132 132
 
133
-		if ( is_array( $defined_fields ) ) {
133
+		if (is_array($defined_fields)) {
134 134
 
135
-			foreach ( $defined_fields as $field ) {
135
+			foreach ($defined_fields as $field) {
136 136
 
137 137
 				$defaults = array(
138 138
 					'label'       => false,
@@ -143,14 +143,14 @@  discard block
 block discarded – undo
143 143
 					'type'        => '',
144 144
 				);
145 145
 
146
-				$field  = wp_parse_args( (array) $field, $defaults );
147
-				$method = 'generate_' . strtolower( $field['type'] );
146
+				$field  = wp_parse_args((array) $field, $defaults);
147
+				$method = 'generate_'.strtolower($field['type']);
148 148
 
149
-				if ( method_exists( $this, $method ) ) {
149
+				if (method_exists($this, $method)) {
150 150
 
151
-					$field = call_user_func( array( $this, $method ), $field );
151
+					$field = call_user_func(array($this, $method), $field);
152 152
 
153
-					if ( $field ) {
153
+					if ($field) {
154 154
 						$fields[] = $field;
155 155
 					}
156 156
 				}
@@ -170,22 +170,22 @@  discard block
 block discarded – undo
170 170
 	protected function get_fields() {
171 171
 
172 172
 		$defined_fields   = $this->define_fields();
173
-		$generated_fields = $this->generate_fields( $defined_fields );
173
+		$generated_fields = $this->generate_fields($defined_fields);
174 174
 
175 175
 		$errors = array();
176 176
 
177
-		if ( ! empty( $this->errors ) ) {
178
-			foreach ( $this->required as $name => $alert ) {
179
-				if ( false === array_search( $name, array_column( $generated_fields, 'name' ) ) ) {
177
+		if ( ! empty($this->errors)) {
178
+			foreach ($this->required as $name => $alert) {
179
+				if (false === array_search($name, array_column($generated_fields, 'name'))) {
180 180
 
181
-					$errors[] = $this->errors[ $name ];
181
+					$errors[] = $this->errors[$name];
182 182
 				}
183 183
 			}
184 184
 
185 185
 			$this->errors = $errors;
186 186
 		}
187 187
 
188
-		if ( ! empty( $errors ) ) {
188
+		if ( ! empty($errors)) {
189 189
 
190 190
 			return $errors;
191 191
 		}
@@ -202,9 +202,9 @@  discard block
 block discarded – undo
202 202
 	 *
203 203
 	 * @since 1.0
204 204
 	 */
205
-	protected function generate_container( $field ) {
205
+	protected function generate_container($field) {
206 206
 
207
-		if ( array_key_exists( 'html', $field ) ) {
207
+		if (array_key_exists('html', $field)) {
208 208
 
209 209
 			return array(
210 210
 				'type' => $field['type'],
@@ -224,36 +224,36 @@  discard block
 block discarded – undo
224 224
 	 *
225 225
 	 * @since 1.0
226 226
 	 */
227
-	protected function generate_listbox( $field ) {
227
+	protected function generate_listbox($field) {
228 228
 
229
-		$listbox = shortcode_atts( array(
229
+		$listbox = shortcode_atts(array(
230 230
 			'label'    => '',
231 231
 			'minWidth' => '',
232 232
 			'name'     => false,
233 233
 			'tooltip'  => '',
234 234
 			'type'     => '',
235 235
 			'value'    => '',
236
-		), $field );
236
+		), $field);
237 237
 
238
-		if ( $this->validate( $field ) ) {
238
+		if ($this->validate($field)) {
239 239
 
240 240
 			$new_listbox = array();
241 241
 
242
-			foreach ( $listbox as $key => $value ) {
242
+			foreach ($listbox as $key => $value) {
243 243
 
244
-				if ( $key == 'value' && empty( $value ) ) {
245
-					$new_listbox[ $key ] = $listbox['name'];
246
-				} else if ( $value ) {
247
-					$new_listbox[ $key ] = $value;
244
+				if ($key == 'value' && empty($value)) {
245
+					$new_listbox[$key] = $listbox['name'];
246
+				} else if ($value) {
247
+					$new_listbox[$key] = $value;
248 248
 				}
249 249
 			}
250 250
 
251 251
 			// do not reindex array!
252 252
 			$field['options'] = array(
253
-				                    '' => ( $field['placeholder'] ? $field['placeholder'] : esc_attr__( '- Select -', 'give' ) ),
253
+				                    '' => ($field['placeholder'] ? $field['placeholder'] : esc_attr__('- Select -', 'give')),
254 254
 			                    ) + $field['options'];
255 255
 
256
-			foreach ( $field['options'] as $value => $text ) {
256
+			foreach ($field['options'] as $value => $text) {
257 257
 				$new_listbox['values'][] = array(
258 258
 					'text'  => $text,
259 259
 					'value' => $value,
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 	 *
276 276
 	 * @since 1.0
277 277
 	 */
278
-	protected function generate_post( $field ) {
278
+	protected function generate_post($field) {
279 279
 
280 280
 		$args = array(
281 281
 			'post_type'      => 'post',
@@ -284,23 +284,23 @@  discard block
 block discarded – undo
284 284
 			'posts_per_page' => 30,
285 285
 		);
286 286
 
287
-		$args    = wp_parse_args( (array) $field['query_args'], $args );
288
-		$posts   = get_posts( $args );
287
+		$args    = wp_parse_args((array) $field['query_args'], $args);
288
+		$posts   = get_posts($args);
289 289
 		$options = array();
290 290
 
291
-		if ( $posts ) {
292
-			foreach ( $posts as $post ) {
293
-				$options[ absint( $post->ID ) ] = esc_html( $post->post_title );
291
+		if ($posts) {
292
+			foreach ($posts as $post) {
293
+				$options[absint($post->ID)] = esc_html($post->post_title);
294 294
 			}
295 295
 
296 296
 			$field['type']    = 'listbox';
297 297
 			$field['options'] = $options;
298 298
 
299
-			return $this->generate_listbox( $field );
299
+			return $this->generate_listbox($field);
300 300
 		}
301 301
 
302 302
 		// perform validation here before returning false
303
-		$this->validate( $field );
303
+		$this->validate($field);
304 304
 
305 305
 		return false;
306 306
 	}
@@ -314,9 +314,9 @@  discard block
 block discarded – undo
314 314
 	 *
315 315
 	 * @since 1.0
316 316
 	 */
317
-	protected function generate_textbox( $field ) {
317
+	protected function generate_textbox($field) {
318 318
 
319
-		$textbox = shortcode_atts( array(
319
+		$textbox = shortcode_atts(array(
320 320
 			'label'     => '',
321 321
 			'maxLength' => '',
322 322
 			'minHeight' => '',
@@ -326,10 +326,10 @@  discard block
 block discarded – undo
326 326
 			'tooltip'   => '',
327 327
 			'type'      => '',
328 328
 			'value'     => '',
329
-		), $field );
329
+		), $field);
330 330
 
331
-		if ( $this->validate( $field ) ) {
332
-			return array_filter( $textbox, array( $this, 'return_textbox_value' ) );
331
+		if ($this->validate($field)) {
332
+			return array_filter($textbox, array($this, 'return_textbox_value'));
333 333
 		}
334 334
 
335 335
 		return false;
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 	 *
343 343
 	 * @return bool
344 344
 	 */
345
-	function return_textbox_value( $value ) {
345
+	function return_textbox_value($value) {
346 346
 		return $value !== '';
347 347
 	}
348 348
 
@@ -358,9 +358,9 @@  discard block
 block discarded – undo
358 358
 	 *
359 359
 	 * @since 1.0
360 360
 	 */
361
-	protected function validate( $field ) {
361
+	protected function validate($field) {
362 362
 
363
-		extract( shortcode_atts(
363
+		extract(shortcode_atts(
364 364
 				array(
365 365
 					'name'     => false,
366 366
 					'required' => false,
@@ -368,36 +368,36 @@  discard block
 block discarded – undo
368 368
 				), $field )
369 369
 		);
370 370
 
371
-		if ( $name ) {
371
+		if ($name) {
372 372
 
373
-			if ( isset( $required['error'] ) ) {
373
+			if (isset($required['error'])) {
374 374
 
375 375
 				$error = array(
376 376
 					'type' => 'container',
377 377
 					'html' => $required['error'],
378 378
 				);
379 379
 
380
-				$this->errors[ $name ] = $this->generate_container( $error );
380
+				$this->errors[$name] = $this->generate_container($error);
381 381
 			}
382 382
 
383
-			if ( ! ! $required || is_array( $required ) ) {
383
+			if ( ! ! $required || is_array($required)) {
384 384
 
385
-				$alert = esc_html__( 'Some of the shortcode options are required.', 'give' );
385
+				$alert = esc_html__('Some of the shortcode options are required.', 'give');
386 386
 
387
-				if ( isset( $required['alert'] ) ) {
387
+				if (isset($required['alert'])) {
388 388
 
389 389
 					$alert = $required['alert'];
390 390
 
391
-				} else if ( ! empty( $label ) ) {
391
+				} else if ( ! empty($label)) {
392 392
 
393 393
 					$alert = sprintf(
394 394
 					/* translators: %s: option label */
395
-						esc_html__( 'The "%s" option is required.', 'give' ),
396
-						str_replace( ':', '', $label )
395
+						esc_html__('The "%s" option is required.', 'give'),
396
+						str_replace(':', '', $label)
397 397
 					);
398 398
 				}
399 399
 
400
-				$this->required[ $name ] = $alert;
400
+				$this->required[$name] = $alert;
401 401
 			}
402 402
 
403 403
 			return true;
Please login to merge, or discard this patch.
includes/admin/reporting/class-form-reports-table.php 1 patch
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
17 17
 // Load WP_List_Table if not loaded
18
-if ( ! class_exists( 'WP_List_Table' ) ) {
19
-	require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
18
+if ( ! class_exists('WP_List_Table')) {
19
+	require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php';
20 20
 }
21 21
 
22 22
 /**
@@ -50,13 +50,13 @@  discard block
 block discarded – undo
50 50
 		global $status, $page;
51 51
 
52 52
 		// Set parent defaults
53
-		parent::__construct( array(
54
-			'singular' => give_get_forms_label_singular(),    // Singular name of the listed records
55
-			'plural'   => give_get_forms_label_plural(),        // Plural name of the listed records
53
+		parent::__construct(array(
54
+			'singular' => give_get_forms_label_singular(), // Singular name of the listed records
55
+			'plural'   => give_get_forms_label_plural(), // Plural name of the listed records
56 56
 			'ajax'     => false                        // Does this table support ajax?
57
-		) );
57
+		));
58 58
 
59
-		add_action( 'give_report_view_actions', array( $this, 'category_filter' ) );
59
+		add_action('give_report_view_actions', array($this, 'category_filter'));
60 60
 		$this->query();
61 61
 
62 62
 	}
@@ -72,18 +72,18 @@  discard block
 block discarded – undo
72 72
 	 *
73 73
 	 * @return string Column Name
74 74
 	 */
75
-	public function column_default( $item, $column_name ) {
76
-		switch ( $column_name ) {
75
+	public function column_default($item, $column_name) {
76
+		switch ($column_name) {
77 77
 			case 'earnings' :
78
-				return give_currency_filter( give_format_amount( $item[ $column_name ] ) );
78
+				return give_currency_filter(give_format_amount($item[$column_name]));
79 79
 			case 'average_sales' :
80
-				return round( $item[ $column_name ] );
80
+				return round($item[$column_name]);
81 81
 			case 'average_earnings' :
82
-				return give_currency_filter( give_format_amount( $item[ $column_name ] ) );
82
+				return give_currency_filter(give_format_amount($item[$column_name]));
83 83
 			case 'details' :
84
-				return '<a href="' . admin_url( 'edit.php?post_type=give_forms&page=give-reports&view=forms&form-id=' . $item['ID'] ) . '">' . esc_html__( 'View Detailed Report', 'give' ) . '</a>';
84
+				return '<a href="'.admin_url('edit.php?post_type=give_forms&page=give-reports&view=forms&form-id='.$item['ID']).'">'.esc_html__('View Detailed Report', 'give').'</a>';
85 85
 			default:
86
-				return $item[ $column_name ];
86
+				return $item[$column_name];
87 87
 		}
88 88
 	}
89 89
 
@@ -97,11 +97,11 @@  discard block
 block discarded – undo
97 97
 	public function get_columns() {
98 98
 		$columns = array(
99 99
 			'title'            => give_get_forms_label_singular(),
100
-			'sales'            => esc_html__( 'Donations', 'give' ),
101
-			'earnings'         => esc_html__( 'Income', 'give' ),
102
-			'average_sales'    => esc_html__( 'Monthly Average Donations', 'give' ),
103
-			'average_earnings' => esc_html__( 'Monthly Average Income', 'give' ),
104
-			'details'          => esc_html__( 'Detailed Report', 'give' )
100
+			'sales'            => esc_html__('Donations', 'give'),
101
+			'earnings'         => esc_html__('Income', 'give'),
102
+			'average_sales'    => esc_html__('Monthly Average Donations', 'give'),
103
+			'average_earnings' => esc_html__('Monthly Average Income', 'give'),
104
+			'details'          => esc_html__('Detailed Report', 'give')
105 105
 		);
106 106
 
107 107
 		return $columns;
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
 	 */
117 117
 	public function get_sortable_columns() {
118 118
 		return array(
119
-			'title'    => array( 'title', true ),
120
-			'sales'    => array( 'sales', false ),
121
-			'earnings' => array( 'earnings', false ),
119
+			'title'    => array('title', true),
120
+			'sales'    => array('sales', false),
121
+			'earnings' => array('earnings', false),
122 122
 		);
123 123
 	}
124 124
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	 * @return int Current page number
131 131
 	 */
132 132
 	public function get_paged() {
133
-		return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1;
133
+		return isset($_GET['paged']) ? absint($_GET['paged']) : 1;
134 134
 	}
135 135
 
136 136
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	 * @return int Category ID
143 143
 	 */
144 144
 	public function get_category() {
145
-		return isset( $_GET['category'] ) ? absint( $_GET['category'] ) : 0;
145
+		return isset($_GET['category']) ? absint($_GET['category']) : 0;
146 146
 	}
147 147
 
148 148
 
@@ -155,8 +155,8 @@  discard block
 block discarded – undo
155 155
 	 */
156 156
 	public function get_total_forms() {
157 157
 		$total  = 0;
158
-		$counts = wp_count_posts( 'give_forms', 'readable' );
159
-		foreach ( $counts as $status => $count ) {
158
+		$counts = wp_count_posts('give_forms', 'readable');
159
+		foreach ($counts as $status => $count) {
160 160
 			$total += $count;
161 161
 		}
162 162
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 	 * @since  1.0
171 171
 	 * @return void
172 172
 	 */
173
-	public function bulk_actions( $which = '' ) {
173
+	public function bulk_actions($which = '') {
174 174
 		// These aren't really bulk actions but this outputs the markup in the right place
175 175
 		give_report_views();
176 176
 	}
@@ -183,23 +183,23 @@  discard block
 block discarded – undo
183 183
 	 *
184 184
 	 * @param string $which
185 185
 	 */
186
-	protected function display_tablenav( $which ) {
186
+	protected function display_tablenav($which) {
187 187
 
188
-		if ( 'top' == $which ) {
189
-			wp_nonce_field( 'bulk-' . $this->_args['plural'] );
188
+		if ('top' == $which) {
189
+			wp_nonce_field('bulk-'.$this->_args['plural']);
190 190
 		}
191 191
 		?>
192
-		<div class="tablenav give-clearfix <?php echo esc_attr( $which ); ?>">
192
+		<div class="tablenav give-clearfix <?php echo esc_attr($which); ?>">
193 193
 
194
-			<h3 class="alignleft reports-earnings-title"><span><?php esc_html_e( 'Donation Forms Report', 'give' ); ?></span></h3>
194
+			<h3 class="alignleft reports-earnings-title"><span><?php esc_html_e('Donation Forms Report', 'give'); ?></span></h3>
195 195
 
196 196
 			<div class="alignright tablenav-right">
197 197
 				<div class="actions bulkactions">
198
-					<?php $this->bulk_actions( $which ); ?>
198
+					<?php $this->bulk_actions($which); ?>
199 199
 				</div>
200 200
 				<?php
201
-				$this->extra_tablenav( $which );
202
-				$this->pagination( $which );
201
+				$this->extra_tablenav($which);
202
+				$this->pagination($which);
203 203
 				?>
204 204
 			</div>
205 205
 
@@ -219,9 +219,9 @@  discard block
 block discarded – undo
219 219
 	 */
220 220
 	public function category_filter() {
221 221
 
222
-		$categories = get_terms( 'form_category' );
223
-		if ( $categories && ! is_wp_error( $categories ) ) {
224
-			echo Give()->html->category_dropdown( 'category', $this->get_category() );
222
+		$categories = get_terms('form_category');
223
+		if ($categories && ! is_wp_error($categories)) {
224
+			echo Give()->html->category_dropdown('category', $this->get_category());
225 225
 		}
226 226
 	}
227 227
 
@@ -235,8 +235,8 @@  discard block
 block discarded – undo
235 235
 	 */
236 236
 	public function query() {
237 237
 
238
-		$orderby  = isset( $_GET['orderby'] ) ? $_GET['orderby'] : 'title';
239
-		$order    = isset( $_GET['order'] ) ? $_GET['order'] : 'DESC';
238
+		$orderby  = isset($_GET['orderby']) ? $_GET['orderby'] : 'title';
239
+		$order    = isset($_GET['order']) ? $_GET['order'] : 'DESC';
240 240
 		$category = $this->get_category();
241 241
 
242 242
 		$args = array(
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 			'suppress_filters' => true
250 250
 		);
251 251
 
252
-		if ( ! empty( $category ) ) {
252
+		if ( ! empty($category)) {
253 253
 			$args['tax_query'] = array(
254 254
 				array(
255 255
 					'taxonomy' => 'form_category',
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 			);
259 259
 		}
260 260
 
261
-		switch ( $orderby ) :
261
+		switch ($orderby) :
262 262
 			case 'title' :
263 263
 				$args['orderby'] = 'title';
264 264
 				break;
@@ -274,9 +274,9 @@  discard block
 block discarded – undo
274 274
 				break;
275 275
 		endswitch;
276 276
 
277
-		$args = apply_filters( 'give_form_reports_prepare_items_args', $args, $this );
277
+		$args = apply_filters('give_form_reports_prepare_items_args', $args, $this);
278 278
 
279
-		$this->products = new WP_Query( $args );
279
+		$this->products = new WP_Query($args);
280 280
 
281 281
 	}
282 282
 
@@ -292,15 +292,15 @@  discard block
 block discarded – undo
292 292
 
293 293
 		$give_forms = $this->products->posts;
294 294
 
295
-		if ( $give_forms ) {
296
-			foreach ( $give_forms as $form ) {
295
+		if ($give_forms) {
296
+			foreach ($give_forms as $form) {
297 297
 				$reports_data[] = array(
298 298
 					'ID'               => $form,
299
-					'title'            => get_the_title( $form ),
300
-					'sales'            => give_get_form_sales_stats( $form ),
301
-					'earnings'         => give_get_form_earnings_stats( $form ),
302
-					'average_sales'    => give_get_average_monthly_form_sales( $form ),
303
-					'average_earnings' => give_get_average_monthly_form_earnings( $form )
299
+					'title'            => get_the_title($form),
300
+					'sales'            => give_get_form_sales_stats($form),
301
+					'earnings'         => give_get_form_earnings_stats($form),
302
+					'average_sales'    => give_get_average_monthly_form_sales($form),
303
+					'average_earnings' => give_get_average_monthly_form_earnings($form)
304 304
 				);
305 305
 			}
306 306
 		}
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 
329 329
 		$sortable = $this->get_sortable_columns();
330 330
 
331
-		$this->_column_headers = array( $columns, $hidden, $sortable );
331
+		$this->_column_headers = array($columns, $hidden, $sortable);
332 332
 
333 333
 		$data = $this->reports_data();
334 334
 
@@ -336,10 +336,10 @@  discard block
 block discarded – undo
336 336
 
337 337
 		$this->items = $data;
338 338
 
339
-		$this->set_pagination_args( array(
339
+		$this->set_pagination_args(array(
340 340
 				'total_items' => $total_items,
341 341
 				'per_page'    => $this->per_page,
342
-				'total_pages' => ceil( $total_items / $this->per_page )
342
+				'total_pages' => ceil($total_items / $this->per_page)
343 343
 			)
344 344
 		);
345 345
 	}
Please login to merge, or discard this patch.