Completed
Push — master ( c22bd5...1ffdfe )
by Devin
13s
created
includes/admin/tools/class-settings-api.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_API' ) ) :
16
+if ( ! class_exists('Give_Settings_API')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_API.
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
 		 */
44 44
 		public function __construct() {
45 45
 			$this->id    = 'api';
46
-			$this->label = esc_html__( 'API', 'give' );
46
+			$this->label = esc_html__('API', 'give');
47 47
 
48
-			add_filter( 'give-tools_tabs_array', array( $this, 'add_settings_page' ), 20 );
49
-			add_action( "give-tools_settings_{$this->id}_page", array( $this, 'output' ) );
48
+			add_filter('give-tools_tabs_array', array($this, 'add_settings_page'), 20);
49
+			add_action("give-tools_settings_{$this->id}_page", array($this, 'output'));
50 50
 		}
51 51
 
52 52
 		/**
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
 		 * @param  array $pages Lst of pages.
57 57
 		 * @return array
58 58
 		 */
59
-		public function add_settings_page( $pages ) {
60
-			$pages[ $this->id ] = $this->label;
59
+		public function add_settings_page($pages) {
60
+			$pages[$this->id] = $this->label;
61 61
 
62 62
 			return $pages;
63 63
 		}
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 			$GLOBALS['give_hide_save_button'] = true;
74 74
 
75 75
 			// Get settings.
76
-			$settings = apply_filters( 'give_settings_api', array(
76
+			$settings = apply_filters('give_settings_api', array(
77 77
 				array(
78 78
 					'id'   => 'give_tools_api',
79 79
 					'type' => 'title',
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 				),
82 82
 				array(
83 83
 					'id'   => 'api',
84
-					'name' => esc_html__( 'API', 'give' ),
84
+					'name' => esc_html__('API', 'give'),
85 85
 					'type' => 'api',
86 86
 				),
87 87
 				array(
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 			 * @since  1.8
98 98
 			 * @param  array $settings
99 99
 			 */
100
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
100
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
101 101
 
102 102
 			// Output.
103 103
 			return $settings;
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 		public function output() {
113 113
 			$settings = $this->get_settings();
114 114
 
115
-			Give_Admin_Settings::output_fields( $settings, 'give_settings' );
115
+			Give_Admin_Settings::output_fields($settings, 'give_settings');
116 116
 		}
117 117
 	}
118 118
 
Please login to merge, or discard this patch.
includes/admin/tools/class-settings-data.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_Data' ) ) :
16
+if ( ! class_exists('Give_Settings_Data')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Data.
@@ -43,15 +43,15 @@  discard block
 block discarded – undo
43 43
 		 */
44 44
 		public function __construct() {
45 45
 			$this->id    = 'data';
46
-			$this->label = esc_html__( 'Data', 'give' );
46
+			$this->label = esc_html__('Data', 'give');
47 47
 
48
-			add_filter( 'give-tools_tabs_array', array( $this, 'add_settings_page' ), 20 );
49
-			add_action( "give-tools_settings_{$this->id}_page", array( $this, 'output' ) );
48
+			add_filter('give-tools_tabs_array', array($this, 'add_settings_page'), 20);
49
+			add_action("give-tools_settings_{$this->id}_page", array($this, 'output'));
50 50
 
51 51
 			// Do not use main form for this tab.
52
-			if( give_get_current_setting_tab() === $this->id ) {
53
-				add_action( "give-tools_open_form", '__return_empty_string' );
54
-				add_action( "give-tools_close_form", '__return_empty_string' );
52
+			if (give_get_current_setting_tab() === $this->id) {
53
+				add_action("give-tools_open_form", '__return_empty_string');
54
+				add_action("give-tools_close_form", '__return_empty_string');
55 55
 			}
56 56
 		}
57 57
 
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 		 * @param  array $pages Lst of pages.
63 63
 		 * @return array
64 64
 		 */
65
-		public function add_settings_page( $pages ) {
66
-			$pages[ $this->id ] = $this->label;
65
+		public function add_settings_page($pages) {
66
+			$pages[$this->id] = $this->label;
67 67
 
68 68
 			return $pages;
69 69
 		}
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 			$GLOBALS['give_hide_save_button'] = true;
80 80
 
81 81
 			// Get settings.
82
-			$settings = apply_filters( 'give_settings_data', array(
82
+			$settings = apply_filters('give_settings_data', array(
83 83
 				array(
84 84
 					'id'   => 'give_tools_tools',
85 85
 					'type' => 'title',
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 				),
88 88
 				array(
89 89
 					'id'   => 'api',
90
-					'name' => esc_html__( 'Tools', 'give' ),
90
+					'name' => esc_html__('Tools', 'give'),
91 91
 					'type' => 'data',
92 92
 				),
93 93
 				array(
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 			 * @since  1.8
104 104
 			 * @param  array $settings
105 105
 			 */
106
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
106
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
107 107
 
108 108
 			// Output.
109 109
 			return $settings;
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 		public function output() {
119 119
 			$settings = $this->get_settings();
120 120
 
121
-			Give_Admin_Settings::output_fields( $settings, 'give_settings' );
121
+			Give_Admin_Settings::output_fields($settings, 'give_settings');
122 122
 		}
123 123
 	}
124 124
 
Please login to merge, or discard this patch.
includes/scripts.php 1 patch
Spacing   +153 added lines, -153 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -25,25 +25,25 @@  discard block
 block discarded – undo
25 25
  */
26 26
 function give_load_scripts() {
27 27
 
28
-	$js_dir         = GIVE_PLUGIN_URL . 'assets/js/frontend/';
29
-	$js_plugins     = GIVE_PLUGIN_URL . 'assets/js/plugins/';
30
-	$scripts_footer = ( give_is_setting_enabled( give_get_option( 'scripts_footer' ) ) ) ? true : false;
28
+	$js_dir         = GIVE_PLUGIN_URL.'assets/js/frontend/';
29
+	$js_plugins     = GIVE_PLUGIN_URL.'assets/js/plugins/';
30
+	$scripts_footer = (give_is_setting_enabled(give_get_option('scripts_footer'))) ? true : false;
31 31
 
32 32
 	// Use minified libraries if SCRIPT_DEBUG is turned off.
33
-	$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
33
+	$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
34 34
 
35 35
 	// Localize / PHP to AJAX vars.
36
-	$localize_give_vars = apply_filters( 'give_global_script_vars', array(
36
+	$localize_give_vars = apply_filters('give_global_script_vars', array(
37 37
 		'ajaxurl'             => give_get_ajax_url(),
38
-		'checkout_nonce'      => wp_create_nonce( 'give_checkout_nonce' ),
39
-		'currency_sign'       => give_currency_filter( '' ),
38
+		'checkout_nonce'      => wp_create_nonce('give_checkout_nonce'),
39
+		'currency_sign'       => give_currency_filter(''),
40 40
 		'currency_pos'        => give_get_currency_position(),
41 41
 		'thousands_separator' => give_get_price_thousand_separator(),
42 42
 		'decimal_separator'   => give_get_price_decimal_separator(),
43
-		'no_gateway'          => __( 'Please select a payment method.', 'give' ),
44
-		'bad_minimum'         => __( 'The minimum donation amount for this form is', 'give' ),
45
-		'general_loading'     => __( 'Loading...', 'give' ),
46
-		'purchase_loading'    => __( 'Please Wait...', 'give' ),
43
+		'no_gateway'          => __('Please select a payment method.', 'give'),
44
+		'bad_minimum'         => __('The minimum donation amount for this form is', 'give'),
45
+		'general_loading'     => __('Loading...', 'give'),
46
+		'purchase_loading'    => __('Please Wait...', 'give'),
47 47
 		'number_decimals'     => give_get_price_decimals(),
48 48
 		'give_version'        => GIVE_VERSION,
49 49
 		'magnific_options'    => apply_filters(
@@ -57,81 +57,81 @@  discard block
 block discarded – undo
57 57
 			'give_form_translation_js',
58 58
 			array(
59 59
 				// Field name               Validation message.
60
-				'payment-mode'           => __( 'Please select payment mode.', 'give' ),
61
-				'give_first'             => __( 'Please enter your first name.', 'give' ),
62
-				'give_email'             => __( 'Please enter a valid email address.', 'give' ),
63
-				'give_user_login'        => __( 'Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give' ),
64
-				'give_user_pass'         => __( 'Enter a password.', 'give' ),
65
-				'give_user_pass_confirm' => __( 'Enter the password confirmation.', 'give' ),
66
-				'give_agree_to_terms'    => __( 'You must agree to the terms and conditions.', 'give' ),
60
+				'payment-mode'           => __('Please select payment mode.', 'give'),
61
+				'give_first'             => __('Please enter your first name.', 'give'),
62
+				'give_email'             => __('Please enter a valid email address.', 'give'),
63
+				'give_user_login'        => __('Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give'),
64
+				'give_user_pass'         => __('Enter a password.', 'give'),
65
+				'give_user_pass_confirm' => __('Enter the password confirmation.', 'give'),
66
+				'give_agree_to_terms'    => __('You must agree to the terms and conditions.', 'give'),
67 67
 			)
68 68
 		),
69
-	) );
69
+	));
70 70
 
71
-	$localize_give_ajax = apply_filters( 'give_global_ajax_vars', array(
71
+	$localize_give_ajax = apply_filters('give_global_ajax_vars', array(
72 72
 		'ajaxurl'         => give_get_ajax_url(),
73
-		'loading'         => __( 'Loading', 'give' ),
73
+		'loading'         => __('Loading', 'give'),
74 74
 		// General loading message.
75
-		'select_option'   => __( 'Please select an option', 'give' ),
75
+		'select_option'   => __('Please select an option', 'give'),
76 76
 		// Variable pricing error with multi-donation option enabled.
77
-		'default_gateway' => give_get_default_gateway( null ),
78
-		'permalinks'      => get_option( 'permalink_structure' ) ? '1' : '0',
77
+		'default_gateway' => give_get_default_gateway(null),
78
+		'permalinks'      => get_option('permalink_structure') ? '1' : '0',
79 79
 		'number_decimals' => give_get_price_decimals(),
80
-	) );
80
+	));
81 81
 
82 82
 	// DEBUG is On.
83
-	if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
83
+	if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) {
84 84
 
85
-		if ( give_is_cc_verify_enabled() ) {
86
-			wp_register_script( 'give-cc-validator', $js_plugins . 'jquery.payment' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
87
-			wp_enqueue_script( 'give-cc-validator' );
85
+		if (give_is_cc_verify_enabled()) {
86
+			wp_register_script('give-cc-validator', $js_plugins.'jquery.payment'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
87
+			wp_enqueue_script('give-cc-validator');
88 88
 		}
89 89
 
90
-		wp_register_script( 'give-float-labels', $js_plugins . 'float-labels' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
91
-		wp_enqueue_script( 'give-float-labels' );
90
+		wp_register_script('give-float-labels', $js_plugins.'float-labels'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
91
+		wp_enqueue_script('give-float-labels');
92 92
 
93
-		wp_register_script( 'give-blockui', $js_plugins . 'jquery.blockUI' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
94
-		wp_enqueue_script( 'give-blockui' );
93
+		wp_register_script('give-blockui', $js_plugins.'jquery.blockUI'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
94
+		wp_enqueue_script('give-blockui');
95 95
 
96
-		wp_register_script( 'give-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
97
-		wp_enqueue_script( 'give-qtip' );
96
+		wp_register_script('give-qtip', $js_plugins.'jquery.qtip'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
97
+		wp_enqueue_script('give-qtip');
98 98
 
99
-		wp_register_script( 'give-accounting', $js_plugins . 'accounting' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
100
-		wp_enqueue_script( 'give-accounting' );
99
+		wp_register_script('give-accounting', $js_plugins.'accounting'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
100
+		wp_enqueue_script('give-accounting');
101 101
 
102
-		wp_register_script( 'give-magnific', $js_plugins . 'jquery.magnific-popup' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
103
-		wp_enqueue_script( 'give-magnific' );
102
+		wp_register_script('give-magnific', $js_plugins.'jquery.magnific-popup'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
103
+		wp_enqueue_script('give-magnific');
104 104
 
105
-		wp_register_script( 'give-checkout-global', $js_dir . 'give-checkout-global' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
106
-		wp_enqueue_script( 'give-checkout-global' );
105
+		wp_register_script('give-checkout-global', $js_dir.'give-checkout-global'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
106
+		wp_enqueue_script('give-checkout-global');
107 107
 
108 108
 		// General scripts.
109
-		wp_register_script( 'give-scripts', $js_dir . 'give' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
110
-		wp_enqueue_script( 'give-scripts' );
109
+		wp_register_script('give-scripts', $js_dir.'give'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
110
+		wp_enqueue_script('give-scripts');
111 111
 
112 112
 		// Load AJAX scripts, if enabled.
113
-		wp_register_script( 'give-ajax', $js_dir . 'give-ajax' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
114
-		wp_enqueue_script( 'give-ajax' );
113
+		wp_register_script('give-ajax', $js_dir.'give-ajax'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer);
114
+		wp_enqueue_script('give-ajax');
115 115
 
116 116
 		// Localize / Pass AJAX vars from PHP,
117
-		wp_localize_script( 'give-checkout-global', 'give_global_vars', $localize_give_vars );
118
-		wp_localize_script( 'give-ajax', 'give_scripts', $localize_give_ajax );
117
+		wp_localize_script('give-checkout-global', 'give_global_vars', $localize_give_vars);
118
+		wp_localize_script('give-ajax', 'give_scripts', $localize_give_ajax);
119 119
 
120 120
 	} else {
121 121
 
122 122
 		// DEBUG is OFF (one JS file to rule them all!).
123
-		wp_register_script( 'give', $js_dir . 'give.all.min.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer );
124
-		wp_enqueue_script( 'give' );
123
+		wp_register_script('give', $js_dir.'give.all.min.js', array('jquery'), GIVE_VERSION, $scripts_footer);
124
+		wp_enqueue_script('give');
125 125
 
126 126
 		// Localize / Pass AJAX vars from PHP.
127
-		wp_localize_script( 'give', 'give_global_vars', $localize_give_vars );
128
-		wp_localize_script( 'give', 'give_scripts', $localize_give_ajax );
127
+		wp_localize_script('give', 'give_global_vars', $localize_give_vars);
128
+		wp_localize_script('give', 'give_scripts', $localize_give_ajax);
129 129
 
130 130
 	}
131 131
 
132 132
 }
133 133
 
134
-add_action( 'wp_enqueue_scripts', 'give_load_scripts' );
134
+add_action('wp_enqueue_scripts', 'give_load_scripts');
135 135
 
136 136
 /**
137 137
  * Register styles.
@@ -144,16 +144,16 @@  discard block
 block discarded – undo
144 144
  */
145 145
 function give_register_styles() {
146 146
 
147
-	if ( ! give_is_setting_enabled( give_get_option( 'css' ) ) ) {
147
+	if ( ! give_is_setting_enabled(give_get_option('css'))) {
148 148
 		return;
149 149
 	}
150 150
 
151
-	wp_register_style( 'give-styles', give_get_stylesheet_uri(), array(), GIVE_VERSION, 'all' );
152
-	wp_enqueue_style( 'give-styles' );
151
+	wp_register_style('give-styles', give_get_stylesheet_uri(), array(), GIVE_VERSION, 'all');
152
+	wp_enqueue_style('give-styles');
153 153
 
154 154
 }
155 155
 
156
-add_action( 'wp_enqueue_scripts', 'give_register_styles' );
156
+add_action('wp_enqueue_scripts', 'give_register_styles');
157 157
 
158 158
 
159 159
 /**
@@ -166,19 +166,19 @@  discard block
 block discarded – undo
166 166
 function give_get_stylesheet_uri() {
167 167
 
168 168
 	// Use minified libraries if SCRIPT_DEBUG is turned off.
169
-	$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
169
+	$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
170 170
 
171 171
 	// LTR or RTL files.
172
-	$direction = ( is_rtl() ) ? '-rtl' : '';
172
+	$direction = (is_rtl()) ? '-rtl' : '';
173 173
 
174
-	$file          = 'give' . $direction . $suffix . '.css';
174
+	$file          = 'give'.$direction.$suffix.'.css';
175 175
 	$templates_dir = give_get_theme_template_dir_name();
176 176
 
177
-	$child_theme_style_sheet    = trailingslashit( get_stylesheet_directory() ) . $templates_dir . $file;
178
-	$child_theme_style_sheet_2  = trailingslashit( get_stylesheet_directory() ) . $templates_dir . 'give' . $direction . '.css';
179
-	$parent_theme_style_sheet   = trailingslashit( get_template_directory() ) . $templates_dir . $file;
180
-	$parent_theme_style_sheet_2 = trailingslashit( get_template_directory() ) . $templates_dir . 'give' . $direction . '.css';
181
-	$give_plugin_style_sheet    = trailingslashit( give_get_templates_dir() ) . $file;
177
+	$child_theme_style_sheet    = trailingslashit(get_stylesheet_directory()).$templates_dir.$file;
178
+	$child_theme_style_sheet_2  = trailingslashit(get_stylesheet_directory()).$templates_dir.'give'.$direction.'.css';
179
+	$parent_theme_style_sheet   = trailingslashit(get_template_directory()).$templates_dir.$file;
180
+	$parent_theme_style_sheet_2 = trailingslashit(get_template_directory()).$templates_dir.'give'.$direction.'.css';
181
+	$give_plugin_style_sheet    = trailingslashit(give_get_templates_dir()).$file;
182 182
 
183 183
 	$uri = false;
184 184
 
@@ -188,23 +188,23 @@  discard block
 block discarded – undo
188 188
 	 * followed by non minified version, even if SCRIPT_DEBUG is not enabled.
189 189
 	 * This allows users to copy just give.css to their theme.
190 190
 	 */
191
-	if ( file_exists( $child_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $child_theme_style_sheet_2 ) ) ) ) {
192
-		if ( ! empty( $nonmin ) ) {
193
-			$uri = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . 'give' . $direction . '.css';
191
+	if (file_exists($child_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($child_theme_style_sheet_2)))) {
192
+		if ( ! empty($nonmin)) {
193
+			$uri = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.'give'.$direction.'.css';
194 194
 		} else {
195
-			$uri = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . $file;
195
+			$uri = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.$file;
196 196
 		}
197
-	} elseif ( file_exists( $parent_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $parent_theme_style_sheet_2 ) ) ) ) {
198
-		if ( ! empty( $nonmin ) ) {
199
-			$uri = trailingslashit( get_template_directory_uri() ) . $templates_dir . 'give' . $direction . '.css';
197
+	} elseif (file_exists($parent_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($parent_theme_style_sheet_2)))) {
198
+		if ( ! empty($nonmin)) {
199
+			$uri = trailingslashit(get_template_directory_uri()).$templates_dir.'give'.$direction.'.css';
200 200
 		} else {
201
-			$uri = trailingslashit( get_template_directory_uri() ) . $templates_dir . $file;
201
+			$uri = trailingslashit(get_template_directory_uri()).$templates_dir.$file;
202 202
 		}
203
-	} elseif ( file_exists( $give_plugin_style_sheet ) || file_exists( $give_plugin_style_sheet ) ) {
204
-		$uri = trailingslashit( give_get_templates_url() ) . $file;
203
+	} elseif (file_exists($give_plugin_style_sheet) || file_exists($give_plugin_style_sheet)) {
204
+		$uri = trailingslashit(give_get_templates_url()).$file;
205 205
 	}
206 206
 
207
-	return apply_filters( 'give_get_stylesheet_uri', $uri );
207
+	return apply_filters('give_get_stylesheet_uri', $uri);
208 208
 
209 209
 }
210 210
 
@@ -221,76 +221,76 @@  discard block
 block discarded – undo
221 221
  *
222 222
  * @return void
223 223
  */
224
-function give_load_admin_scripts( $hook ) {
224
+function give_load_admin_scripts($hook) {
225 225
 
226 226
 	global $post, $post_type;
227 227
 
228 228
 	$give_options = give_get_settings();
229 229
 
230 230
 	// Directories of assets.
231
-	$js_dir     = GIVE_PLUGIN_URL . 'assets/js/admin/';
232
-	$js_plugins = GIVE_PLUGIN_URL . 'assets/js/plugins/';
233
-	$css_dir    = GIVE_PLUGIN_URL . 'assets/css/';
231
+	$js_dir     = GIVE_PLUGIN_URL.'assets/js/admin/';
232
+	$js_plugins = GIVE_PLUGIN_URL.'assets/js/plugins/';
233
+	$css_dir    = GIVE_PLUGIN_URL.'assets/css/';
234 234
 
235 235
 	// Use minified libraries if SCRIPT_DEBUG is turned off.
236
-	$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
236
+	$suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min';
237 237
 
238 238
 	// LTR or RTL files.
239
-	$direction = ( is_rtl() ) ? '-rtl' : '';
239
+	$direction = (is_rtl()) ? '-rtl' : '';
240 240
 
241 241
 	// Global Admin.
242
-	wp_register_style( 'give-admin-bar-notification', $css_dir . 'adminbar-style.css' );
243
-	wp_enqueue_style( 'give-admin-bar-notification' );
242
+	wp_register_style('give-admin-bar-notification', $css_dir.'adminbar-style.css');
243
+	wp_enqueue_style('give-admin-bar-notification');
244 244
 
245 245
 	// Give Admin Only.
246
-	if ( ! apply_filters( 'give_load_admin_scripts', give_is_admin_page(), $hook ) ) {
246
+	if ( ! apply_filters('give_load_admin_scripts', give_is_admin_page(), $hook)) {
247 247
 		return;
248 248
 	}
249 249
 
250 250
 	// CSS.
251
-	wp_register_style( 'jquery-ui-css', $css_dir . 'jquery-ui-fresh' . $suffix . '.css' );
252
-	wp_enqueue_style( 'jquery-ui-css' );
253
-	wp_register_style( 'give-admin', $css_dir . 'give-admin' . $direction . $suffix . '.css', array(), GIVE_VERSION );
254
-	wp_enqueue_style( 'give-admin' );
255
-	wp_register_style( 'jquery-chosen', $css_dir . 'chosen' . $suffix . '.css', array(), GIVE_VERSION );
256
-	wp_enqueue_style( 'jquery-chosen' );
257
-	wp_enqueue_style( 'thickbox' );
258
-	wp_enqueue_style( 'wp-color-picker' );
251
+	wp_register_style('jquery-ui-css', $css_dir.'jquery-ui-fresh'.$suffix.'.css');
252
+	wp_enqueue_style('jquery-ui-css');
253
+	wp_register_style('give-admin', $css_dir.'give-admin'.$direction.$suffix.'.css', array(), GIVE_VERSION);
254
+	wp_enqueue_style('give-admin');
255
+	wp_register_style('jquery-chosen', $css_dir.'chosen'.$suffix.'.css', array(), GIVE_VERSION);
256
+	wp_enqueue_style('jquery-chosen');
257
+	wp_enqueue_style('thickbox');
258
+	wp_enqueue_style('wp-color-picker');
259 259
 
260 260
 
261 261
 	// JS.
262
-	wp_register_script( 'jquery-chosen', $js_plugins . 'chosen.jquery' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION );
263
-	wp_enqueue_script( 'jquery-chosen' );
262
+	wp_register_script('jquery-chosen', $js_plugins.'chosen.jquery'.$suffix.'.js', array('jquery'), GIVE_VERSION);
263
+	wp_enqueue_script('jquery-chosen');
264 264
 
265
-	wp_register_script( 'give-accounting', $js_plugins . 'accounting' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
266
-	wp_enqueue_script( 'give-accounting' );
265
+	wp_register_script('give-accounting', $js_plugins.'accounting'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
266
+	wp_enqueue_script('give-accounting');
267 267
 
268
-	wp_enqueue_script( 'wp-color-picker' );
269
-	wp_enqueue_script( 'jquery-ui-datepicker' );
270
-	wp_enqueue_script( 'thickbox' );
268
+	wp_enqueue_script('wp-color-picker');
269
+	wp_enqueue_script('jquery-ui-datepicker');
270
+	wp_enqueue_script('thickbox');
271 271
 
272
-	wp_register_script( 'give-admin-scripts', $js_dir . 'admin-scripts' . $suffix . '.js', array( 'jquery', 'jquery-ui-datepicker', 'wp-color-picker' ), GIVE_VERSION, false );
273
-	wp_enqueue_script( 'give-admin-scripts' );
272
+	wp_register_script('give-admin-scripts', $js_dir.'admin-scripts'.$suffix.'.js', array('jquery', 'jquery-ui-datepicker', 'wp-color-picker'), GIVE_VERSION, false);
273
+	wp_enqueue_script('give-admin-scripts');
274 274
 
275
-	wp_register_script( 'jquery-flot', $js_plugins . 'jquery.flot' . $suffix . '.js' );
276
-	wp_enqueue_script( 'jquery-flot' );
275
+	wp_register_script('jquery-flot', $js_plugins.'jquery.flot'.$suffix.'.js');
276
+	wp_enqueue_script('jquery-flot');
277 277
 
278
-	wp_register_script( 'give-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
279
-	wp_enqueue_script( 'give-qtip' );
278
+	wp_register_script('give-qtip', $js_plugins.'jquery.qtip'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
279
+	wp_enqueue_script('give-qtip');
280 280
 
281
-	wp_register_script( 'give-repeatable-fields', $js_plugins . 'repeatable-fields' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
282
-	wp_enqueue_script( 'give-repeatable-fields' );
281
+	wp_register_script('give-repeatable-fields', $js_plugins.'repeatable-fields'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
282
+	wp_enqueue_script('give-repeatable-fields');
283 283
 
284 284
 	// Forms CPT Script.
285
-	if ( $post_type === 'give_forms' ) {
286
-		wp_register_script( 'give-admin-forms-scripts', $js_dir . 'admin-forms' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
287
-		wp_enqueue_script( 'give-admin-forms-scripts' );
285
+	if ($post_type === 'give_forms') {
286
+		wp_register_script('give-admin-forms-scripts', $js_dir.'admin-forms'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
287
+		wp_enqueue_script('give-admin-forms-scripts');
288 288
 	}
289 289
 
290 290
 	// Settings Scripts.
291
-	if ( isset( $_GET['page'] ) && $_GET['page'] == 'give-settings' ) {
292
-		wp_register_script( 'give-admin-settings-scripts', $js_dir . 'admin-settings' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false );
293
-		wp_enqueue_script( 'give-admin-settings-scripts' );
291
+	if (isset($_GET['page']) && $_GET['page'] == 'give-settings') {
292
+		wp_register_script('give-admin-settings-scripts', $js_dir.'admin-settings'.$suffix.'.js', array('jquery'), GIVE_VERSION, false);
293
+		wp_enqueue_script('give-admin-settings-scripts');
294 294
 	}
295 295
 
296 296
 	// Price Separators.
@@ -298,59 +298,59 @@  discard block
 block discarded – undo
298 298
 	$decimal_separator  = give_get_price_decimal_separator();
299 299
 
300 300
 	// Localize strings & variables for JS.
301
-	wp_localize_script( 'give-admin-scripts', 'give_vars', array(
302
-		'post_id'                        => isset( $post->ID ) ? $post->ID : null,
301
+	wp_localize_script('give-admin-scripts', 'give_vars', array(
302
+		'post_id'                        => isset($post->ID) ? $post->ID : null,
303 303
 		'give_version'                   => GIVE_VERSION,
304 304
 		'thousands_separator'            => $thousand_separator,
305 305
 		'decimal_separator'              => $decimal_separator,
306
-		'quick_edit_warning'             => __( 'Not available for variable priced forms.', 'give' ),
307
-		'delete_payment'                 => __( 'Are you sure you wish to delete this payment?', 'give' ),
308
-		'delete_payment_note'            => __( 'Are you sure you wish to delete this note?', 'give' ),
309
-		'revoke_api_key'                 => __( 'Are you sure you wish to revoke this API key?', 'give' ),
310
-		'regenerate_api_key'             => __( 'Are you sure you wish to regenerate this API key?', 'give' ),
311
-		'resend_receipt'                 => __( 'Are you sure you wish to resend the donation receipt?', 'give' ),
312
-		'logo'                           => __( 'Logo', 'give' ),
313
-		'use_this_image'                 => __( 'Use this image', 'give' ),
314
-		'one_option'                     => __( 'Choose a form', 'give' ),
315
-		'one_or_more_option'             => __( 'Choose one or more forms', 'give' ),
316
-		'currency_sign'                  => give_currency_filter( '' ),
317
-		'currency_pos'                   => isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before',
318
-		'currency_decimals'              => give_currency_decimal_filter( give_get_price_decimals() ),
319
-		'batch_export_no_class'          => __( 'You must choose a method.', 'give' ),
320
-		'batch_export_no_reqs'           => __( 'Required fields not completed.', 'give' ),
321
-		'reset_stats_warn'               => __( 'Are you sure you want to reset Give? This process is <strong><em>not reversible</em></strong> and will delete all data regardless of test or live mode. Please be sure you have a recent backup before proceeding.', 'give' ),
322
-		'price_format_guide'             => sprintf( __( 'Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give' ), $decimal_separator, $thousand_separator ),
306
+		'quick_edit_warning'             => __('Not available for variable priced forms.', 'give'),
307
+		'delete_payment'                 => __('Are you sure you wish to delete this payment?', 'give'),
308
+		'delete_payment_note'            => __('Are you sure you wish to delete this note?', 'give'),
309
+		'revoke_api_key'                 => __('Are you sure you wish to revoke this API key?', 'give'),
310
+		'regenerate_api_key'             => __('Are you sure you wish to regenerate this API key?', 'give'),
311
+		'resend_receipt'                 => __('Are you sure you wish to resend the donation receipt?', 'give'),
312
+		'logo'                           => __('Logo', 'give'),
313
+		'use_this_image'                 => __('Use this image', 'give'),
314
+		'one_option'                     => __('Choose a form', 'give'),
315
+		'one_or_more_option'             => __('Choose one or more forms', 'give'),
316
+		'currency_sign'                  => give_currency_filter(''),
317
+		'currency_pos'                   => isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before',
318
+		'currency_decimals'              => give_currency_decimal_filter(give_get_price_decimals()),
319
+		'batch_export_no_class'          => __('You must choose a method.', 'give'),
320
+		'batch_export_no_reqs'           => __('Required fields not completed.', 'give'),
321
+		'reset_stats_warn'               => __('Are you sure you want to reset Give? This process is <strong><em>not reversible</em></strong> and will delete all data regardless of test or live mode. Please be sure you have a recent backup before proceeding.', 'give'),
322
+		'price_format_guide'             => sprintf(__('Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give'), $decimal_separator, $thousand_separator),
323 323
 		/* translators : %s: Donation form options metabox */
324
-		'confirm_before_remove_row_text' => __( 'Do you want to delete this level?', 'give' ),
325
-		'matched_success_failure_page'   => __( 'You cannot set the success and failed pages to the same page', 'give' ),
326
-		'dismiss_notice_text'            => __( 'Dismiss this notice.', 'give' ),
324
+		'confirm_before_remove_row_text' => __('Do you want to delete this level?', 'give'),
325
+		'matched_success_failure_page'   => __('You cannot set the success and failed pages to the same page', 'give'),
326
+		'dismiss_notice_text'            => __('Dismiss this notice.', 'give'),
327 327
 		'bulk_action' => array(
328 328
 			'delete'         => array(
329
-				'zero_payment_selected' => __( 'You must choose at least one or more payments to delete.', 'give' ),
330
-				'delete_payment'        => __( 'Are you sure you want to permanently delete this donation?', 'give' ),
331
-				'delete_payments'       => __( 'Are you sure you want to permanently delete the selected {payment_count} donations?', 'give' ),
329
+				'zero_payment_selected' => __('You must choose at least one or more payments to delete.', 'give'),
330
+				'delete_payment'        => __('Are you sure you want to permanently delete this donation?', 'give'),
331
+				'delete_payments'       => __('Are you sure you want to permanently delete the selected {payment_count} donations?', 'give'),
332 332
 			),
333 333
 			'resend_receipt' => array(
334
-				'zero_recipient_selected' => __( 'You must choose at least one or more recipients to resend the email receipt.', 'give' ),
335
-				'resend_receipt'          => __( 'Are you sure you want to resend the email receipt to this recipient?', 'give' ),
336
-				'resend_receipts'         => __( 'Are you sure you want to resend the emails receipt to {payment_count} recipients?', 'give' ),
334
+				'zero_recipient_selected' => __('You must choose at least one or more recipients to resend the email receipt.', 'give'),
335
+				'resend_receipt'          => __('Are you sure you want to resend the email receipt to this recipient?', 'give'),
336
+				'resend_receipts'         => __('Are you sure you want to resend the emails receipt to {payment_count} recipients?', 'give'),
337 337
 			),
338 338
 		),
339 339
 		'metabox_fields' => array(
340 340
 			'media' => array(
341
-				'button_title' => esc_html__( 'Choose Attachment', 'give' ),
341
+				'button_title' => esc_html__('Choose Attachment', 'give'),
342 342
 			)
343 343
 		)
344
-	) );
344
+	));
345 345
 
346
-	if ( function_exists( 'wp_enqueue_media' ) && version_compare( get_bloginfo( 'version' ), '3.5', '>=' ) ) {
346
+	if (function_exists('wp_enqueue_media') && version_compare(get_bloginfo('version'), '3.5', '>=')) {
347 347
 		// call for new media manager.
348 348
 		wp_enqueue_media();
349 349
 	}
350 350
 
351 351
 }
352 352
 
353
-add_action( 'admin_enqueue_scripts', 'give_load_admin_scripts', 100 );
353
+add_action('admin_enqueue_scripts', 'give_load_admin_scripts', 100);
354 354
 
355 355
 /**
356 356
  * Admin Give Icon
@@ -365,13 +365,13 @@  discard block
 block discarded – undo
365 365
 	?>
366 366
     <style type="text/css" media="screen">
367 367
 
368
-        <?php if ( version_compare( get_bloginfo( 'version' ), '3.8-RC', '>=' ) || version_compare( get_bloginfo( 'version' ), '3.8', '>=' ) ) { ?>
368
+        <?php if (version_compare(get_bloginfo('version'), '3.8-RC', '>=') || version_compare(get_bloginfo('version'), '3.8', '>=')) { ?>
369 369
         @font-face {
370 370
             font-family: 'give-icomoon';
371
-            src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?ngjl88'; ?>');
372
-            src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?#iefixngjl88'?>') format('embedded-opentype'),
373
-            url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.woff?ngjl88'; ?>') format('woff'),
374
-            url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.svg?ngjl88#icomoon'; ?>') format('svg');
371
+            src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?ngjl88'; ?>');
372
+            src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?#iefixngjl88'?>') format('embedded-opentype'),
373
+            url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.woff?ngjl88'; ?>') format('woff'),
374
+            url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.svg?ngjl88#icomoon'; ?>') format('svg');
375 375
             font-weight: normal;
376 376
             font-style: normal;
377 377
         }
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 	<?php
391 391
 }
392 392
 
393
-add_action( 'admin_head', 'give_admin_icon' );
393
+add_action('admin_head', 'give_admin_icon');
394 394
 
395 395
 /**
396 396
  * Admin js code
@@ -420,4 +420,4 @@  discard block
 block discarded – undo
420 420
 	<?php
421 421
 }
422 422
 
423
-add_action( 'admin_head', 'give_admin_hide_notice_shortly_js' );
423
+add_action('admin_head', 'give_admin_hide_notice_shortly_js');
Please login to merge, or discard this patch.
includes/admin/payments/view-order-details.php 1 patch
Spacing   +140 added lines, -140 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -20,27 +20,27 @@  discard block
 block discarded – undo
20 20
  * @since 1.0
21 21
  * @return void
22 22
  */
23
-if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) {
24
-	wp_die( esc_html__( 'Donation ID not supplied. Please try again.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) );
23
+if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) {
24
+	wp_die(esc_html__('Donation ID not supplied. Please try again.', 'give'), esc_html__('Error', 'give'), array('response' => 400));
25 25
 }
26 26
 
27 27
 // Setup the variables
28
-$payment_id = absint( $_GET['id'] );
29
-$payment    = new Give_Payment( $payment_id );
28
+$payment_id = absint($_GET['id']);
29
+$payment    = new Give_Payment($payment_id);
30 30
 
31 31
 // Sanity check... fail if donation ID is invalid
32 32
 $payment_exists = $payment->ID;
33
-if ( empty( $payment_exists ) ) {
34
-	wp_die( esc_html__( 'The specified ID does not belong to a donation. Please try again.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) );
33
+if (empty($payment_exists)) {
34
+	wp_die(esc_html__('The specified ID does not belong to a donation. Please try again.', 'give'), esc_html__('Error', 'give'), array('response' => 400));
35 35
 }
36 36
 
37 37
 $number         = $payment->number;
38 38
 $payment_meta   = $payment->get_meta();
39
-$transaction_id = esc_attr( $payment->transaction_id );
39
+$transaction_id = esc_attr($payment->transaction_id);
40 40
 $user_id        = $payment->user_id;
41 41
 $customer_id    = $payment->customer_id;
42
-$payment_date   = strtotime( $payment->date );
43
-$user_info      = give_get_payment_meta_user_info( $payment_id );
42
+$payment_date   = strtotime($payment->date);
43
+$user_info      = give_get_payment_meta_user_info($payment_id);
44 44
 $address        = $payment->address;
45 45
 $currency_code  = $payment->currency;
46 46
 $gateway        = $payment->gateway;
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
 	<h1 id="transaction-details-heading"><?php
53 53
 		printf(
54 54
 			/* translators: %s: donation number */
55
-			esc_html__( 'Donation %s', 'give' ),
55
+			esc_html__('Donation %s', 'give'),
56 56
 			$number
57 57
 		);
58
-		if ( $payment_mode == 'test' ) {
59
-			echo '<span id="test-payment-label" class="give-item-label give-item-label-orange" data-tooltip="' . esc_attr__( 'This donation was made in test mode.', 'give' ) . '" data-tooltip-my-position="center left" data-tooltip-target-position="center right">' . esc_html__( 'Test Donation', 'give' ) . '</span>';
58
+		if ($payment_mode == 'test') {
59
+			echo '<span id="test-payment-label" class="give-item-label give-item-label-orange" data-tooltip="'.esc_attr__('This donation was made in test mode.', 'give').'" data-tooltip-my-position="center left" data-tooltip-target-position="center right">'.esc_html__('Test Donation', 'give').'</span>';
60 60
 		}
61 61
 		?></h1>
62 62
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 *
69 69
 	 * @param int $payment_id Payment id.
70 70
 	 */
71
-	do_action( 'give_view_order_details_before', $payment_id );
71
+	do_action('give_view_order_details_before', $payment_id);
72 72
 	?>
73 73
 	<form id="give-edit-order-form" method="post">
74 74
 		<?php
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 		 *
80 80
 		 * @param int $payment_id Payment id.
81 81
 		 */
82
-		do_action( 'give_view_order_details_form_top', $payment_id );
82
+		do_action('give_view_order_details_form_top', $payment_id);
83 83
 		?>
84 84
 		<div id="poststuff">
85 85
 			<div id="give-dashboard-widgets-wrap">
@@ -95,12 +95,12 @@  discard block
 block discarded – undo
95 95
 							 *
96 96
 							 * @param int $payment_id Payment id.
97 97
 							 */
98
-							do_action( 'give_view_order_details_sidebar_before', $payment_id );
98
+							do_action('give_view_order_details_sidebar_before', $payment_id);
99 99
 							?>
100 100
 
101 101
 							<div id="give-order-update" class="postbox give-order-data">
102 102
 
103
-								<h3 class="hndle"><?php esc_html_e( 'Update Donation', 'give' ); ?></h3>
103
+								<h3 class="hndle"><?php esc_html_e('Update Donation', 'give'); ?></h3>
104 104
 
105 105
 								<div class="inside">
106 106
 									<div class="give-admin-box">
@@ -113,33 +113,33 @@  discard block
 block discarded – undo
113 113
 										 *
114 114
 										 * @param int $payment_id Payment id.
115 115
 										 */
116
-										do_action( 'give_view_order_details_totals_before', $payment_id );
116
+										do_action('give_view_order_details_totals_before', $payment_id);
117 117
 										?>
118 118
 
119 119
 										<div class="give-admin-box-inside">
120 120
 											<p>
121
-												<label for="give-payment-status" class="strong"><?php esc_html_e( 'Status:', 'give' ); ?></label>&nbsp;
121
+												<label for="give-payment-status" class="strong"><?php esc_html_e('Status:', 'give'); ?></label>&nbsp;
122 122
 												<select id="give-payment-status" name="give-payment-status" class="medium-text">
123
-													<?php foreach ( give_get_payment_statuses() as $key => $status ) : ?>
124
-														<option value="<?php echo esc_attr( $key ); ?>"<?php selected( $payment->status, $key, true ); ?>><?php echo esc_html( $status ); ?></option>
123
+													<?php foreach (give_get_payment_statuses() as $key => $status) : ?>
124
+														<option value="<?php echo esc_attr($key); ?>"<?php selected($payment->status, $key, true); ?>><?php echo esc_html($status); ?></option>
125 125
 													<?php endforeach; ?>
126 126
 												</select>
127
-												<span class="give-donation-status status-<?php echo sanitize_title( $payment->status ); ?>"><span class="give-donation-status-icon"></span></span>
127
+												<span class="give-donation-status status-<?php echo sanitize_title($payment->status); ?>"><span class="give-donation-status-icon"></span></span>
128 128
 											</p>
129 129
 										</div>
130 130
 
131 131
 										<div class="give-admin-box-inside">
132 132
 											<p>
133
-												<label for="give-payment-date" class="strong"><?php esc_html_e( 'Date:', 'give' ); ?></label>&nbsp;
134
-												<input type="text" id="give-payment-date" name="give-payment-date" value="<?php echo esc_attr( date( 'm/d/Y', $payment_date ) ); ?>" class="medium-text give_datepicker"/>
133
+												<label for="give-payment-date" class="strong"><?php esc_html_e('Date:', 'give'); ?></label>&nbsp;
134
+												<input type="text" id="give-payment-date" name="give-payment-date" value="<?php echo esc_attr(date('m/d/Y', $payment_date)); ?>" class="medium-text give_datepicker"/>
135 135
 											</p>
136 136
 										</div>
137 137
 
138 138
 										<div class="give-admin-box-inside">
139 139
 											<p>
140
-												<label for="give-payment-time-hour" class="strong"><?php esc_html_e( 'Time:', 'give' ); ?></label>&nbsp;
141
-												<input type="number" step="1" max="24" id="give-payment-time-hour" name="give-payment-time-hour" value="<?php echo esc_attr( date_i18n( 'H', $payment_date ) ); ?>" class="small-text give-payment-time-hour"/>&nbsp;:&nbsp;
142
-												<input type="number" step="1" max="59" id="give-payment-time-min" name="give-payment-time-min" value="<?php echo esc_attr( date( 'i', $payment_date ) ); ?>" class="small-text give-payment-time-min"/>
140
+												<label for="give-payment-time-hour" class="strong"><?php esc_html_e('Time:', 'give'); ?></label>&nbsp;
141
+												<input type="number" step="1" max="24" id="give-payment-time-hour" name="give-payment-time-hour" value="<?php echo esc_attr(date_i18n('H', $payment_date)); ?>" class="small-text give-payment-time-hour"/>&nbsp;:&nbsp;
142
+												<input type="number" step="1" max="59" id="give-payment-time-min" name="give-payment-time-min" value="<?php echo esc_attr(date('i', $payment_date)); ?>" class="small-text give-payment-time-min"/>
143 143
 											</p>
144 144
 										</div>
145 145
 
@@ -153,18 +153,18 @@  discard block
 block discarded – undo
153 153
 										 *
154 154
 										 * @param int $payment_id Payment id.
155 155
 										 */
156
-										do_action( 'give_view_order_details_update_inner', $payment_id );
156
+										do_action('give_view_order_details_update_inner', $payment_id);
157 157
 
158 158
 										// @TODO: Fees
159
-										$fees = give_get_payment_fees( $payment_id );
160
-										if ( ! empty( $fees ) ) : ?>
159
+										$fees = give_get_payment_fees($payment_id);
160
+										if ( ! empty($fees)) : ?>
161 161
 											<div class="give-order-fees give-admin-box-inside">
162
-												<p class="strong"><?php esc_html_e( 'Fees:', 'give' ); ?></p>
162
+												<p class="strong"><?php esc_html_e('Fees:', 'give'); ?></p>
163 163
 												<ul class="give-payment-fees">
164
-													<?php foreach ( $fees as $fee ) : ?>
164
+													<?php foreach ($fees as $fee) : ?>
165 165
 														<li>
166 166
 															<span class="fee-label"><?php echo $fee['label']; ?>:</span>
167
-															<span class="fee-amount" data-fee="<?php echo esc_attr( $fee['amount'] ); ?>"><?php echo give_currency_filter( $fee['amount'], $currency_code ); ?></span>
167
+															<span class="fee-amount" data-fee="<?php echo esc_attr($fee['amount']); ?>"><?php echo give_currency_filter($fee['amount'], $currency_code); ?></span>
168 168
 														</li>
169 169
 													<?php endforeach; ?>
170 170
 												</ul>
@@ -173,9 +173,9 @@  discard block
 block discarded – undo
173 173
 
174 174
 										<div class="give-order-payment give-admin-box-inside">
175 175
 											<p>
176
-												<label for="give-payment-total" class="strong"><?php esc_html_e( 'Total Donation:', 'give' ); ?></label>&nbsp;
177
-												<?php echo give_currency_symbol( $payment->currency ); ?>
178
-												&nbsp;<input id="give-payment-total" name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr( give_format_decimal( give_get_payment_amount( $payment_id ) ) ); ?>"/>
176
+												<label for="give-payment-total" class="strong"><?php esc_html_e('Total Donation:', 'give'); ?></label>&nbsp;
177
+												<?php echo give_currency_symbol($payment->currency); ?>
178
+												&nbsp;<input id="give-payment-total" name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr(give_format_decimal(give_get_payment_amount($payment_id))); ?>"/>
179 179
 											</p>
180 180
 										</div>
181 181
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 										 *
188 188
 										 * @param int $payment_id Payment id.
189 189
 										 */
190
-										do_action( 'give_view_order_details_totals_after', $payment_id );
190
+										do_action('give_view_order_details_totals_after', $payment_id);
191 191
 										?>
192 192
 
193 193
 									</div>
@@ -205,17 +205,17 @@  discard block
 block discarded – undo
205 205
 									 *
206 206
 									 * @param int $payment_id Payment id.
207 207
 									 */
208
-									do_action( 'give_view_order_details_update_before', $payment_id );
208
+									do_action('give_view_order_details_update_before', $payment_id);
209 209
 									?>
210 210
 
211 211
 									<div id="major-publishing-actions">
212 212
 										<div id="publishing-action">
213
-											<input type="submit" class="button button-primary right" value="<?php esc_attr_e( 'Save Donation', 'give' ); ?>"/>
214
-											<?php if ( give_is_payment_complete( $payment_id ) ) : ?>
215
-												<a href="<?php echo esc_url( add_query_arg( array(
213
+											<input type="submit" class="button button-primary right" value="<?php esc_attr_e('Save Donation', 'give'); ?>"/>
214
+											<?php if (give_is_payment_complete($payment_id)) : ?>
215
+												<a href="<?php echo esc_url(add_query_arg(array(
216 216
 													'give-action' => 'email_links',
217 217
 													'purchase_id' => $payment_id,
218
-												) ) ); ?>" id="give-resend-receipt" class="button-secondary right"><?php esc_html_e( 'Resend Receipt', 'give' ); ?></a>
218
+												))); ?>" id="give-resend-receipt" class="button-secondary right"><?php esc_html_e('Resend Receipt', 'give'); ?></a>
219 219
 											<?php endif; ?>
220 220
 										</div>
221 221
 										<div class="clear"></div>
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 									 *
230 230
 									 * @param int $payment_id Payment id.
231 231
 									 */
232
-									do_action( 'give_view_order_details_update_after', $payment_id );
232
+									do_action('give_view_order_details_update_after', $payment_id);
233 233
 									?>
234 234
 
235 235
 								</div>
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 
241 241
 							<div id="give-order-details" class="postbox give-order-data">
242 242
 
243
-								<h3 class="hndle"><?php esc_html_e( 'Donation Meta', 'give' ); ?></h3>
243
+								<h3 class="hndle"><?php esc_html_e('Donation Meta', 'give'); ?></h3>
244 244
 
245 245
 								<div class="inside">
246 246
 									<div class="give-admin-box">
@@ -253,44 +253,44 @@  discard block
 block discarded – undo
253 253
 										 *
254 254
 										 * @param int $payment_id Payment id.
255 255
 										 */
256
-										do_action( 'give_view_order_details_payment_meta_before', $payment_id );
256
+										do_action('give_view_order_details_payment_meta_before', $payment_id);
257 257
 
258
-										$gateway = give_get_payment_gateway( $payment_id );
259
-										if ( $gateway ) : ?>
258
+										$gateway = give_get_payment_gateway($payment_id);
259
+										if ($gateway) : ?>
260 260
 											<div class="give-order-gateway give-admin-box-inside">
261 261
 												<p>
262
-													<strong><?php esc_html_e( 'Gateway:', 'give' ); ?></strong>&nbsp;
263
-													<?php echo give_get_gateway_admin_label( $gateway ); ?>
262
+													<strong><?php esc_html_e('Gateway:', 'give'); ?></strong>&nbsp;
263
+													<?php echo give_get_gateway_admin_label($gateway); ?>
264 264
 												</p>
265 265
 											</div>
266 266
 										<?php endif; ?>
267 267
 
268 268
 										<div class="give-order-payment-key give-admin-box-inside">
269 269
 											<p>
270
-												<strong><?php esc_html_e( 'Key:', 'give' ); ?></strong>&nbsp;
271
-												<?php echo give_get_payment_key( $payment_id ); ?>
270
+												<strong><?php esc_html_e('Key:', 'give'); ?></strong>&nbsp;
271
+												<?php echo give_get_payment_key($payment_id); ?>
272 272
 											</p>
273 273
 										</div>
274 274
 
275 275
 										<div class="give-order-ip give-admin-box-inside">
276 276
 											<p>
277
-												<strong><?php esc_html_e( 'IP:', 'give' ); ?></strong>&nbsp;
278
-												<?php echo esc_html( give_get_payment_user_ip( $payment_id ) ); ?>
277
+												<strong><?php esc_html_e('IP:', 'give'); ?></strong>&nbsp;
278
+												<?php echo esc_html(give_get_payment_user_ip($payment_id)); ?>
279 279
 											</p>
280 280
 										</div>
281 281
 
282
-										<?php if ( $transaction_id ) : ?>
282
+										<?php if ($transaction_id) : ?>
283 283
 											<div class="give-order-tx-id give-admin-box-inside">
284 284
 												<p>
285
-													<strong><?php esc_html_e( 'Donation ID:', 'give' ); ?></strong>&nbsp;
286
-													<?php echo apply_filters( "give_payment_details_transaction_id-{$gateway}", $transaction_id, $payment_id ); ?>
285
+													<strong><?php esc_html_e('Donation ID:', 'give'); ?></strong>&nbsp;
286
+													<?php echo apply_filters("give_payment_details_transaction_id-{$gateway}", $transaction_id, $payment_id); ?>
287 287
 												</p>
288 288
 											</div>
289 289
 										<?php endif; ?>
290 290
 
291 291
 										<div class="give-admin-box-inside">
292
-											<p><?php $purchase_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( esc_attr( give_get_payment_user_email( $payment_id ) ) ) ); ?>
293
-												<a href="<?php echo $purchase_url; ?>"><?php esc_html_e( 'View all donations for this donor &raquo;', 'give' ); ?></a>
292
+											<p><?php $purchase_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history&user='.urlencode(esc_attr(give_get_payment_user_email($payment_id)))); ?>
293
+												<a href="<?php echo $purchase_url; ?>"><?php esc_html_e('View all donations for this donor &raquo;', 'give'); ?></a>
294 294
 											</p>
295 295
 										</div>
296 296
 
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 										 *
303 303
 										 * @param int $payment_id Payment id.
304 304
 										 */
305
-										do_action( 'give_view_order_details_payment_meta_after', $payment_id );
305
+										do_action('give_view_order_details_payment_meta_after', $payment_id);
306 306
 										?>
307 307
 
308 308
 									</div>
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 							 *
323 323
 							 * @param int $payment_id Payment id.
324 324
 							 */
325
-							do_action( 'give_view_order_details_sidebar_after', $payment_id );
325
+							do_action('give_view_order_details_sidebar_after', $payment_id);
326 326
 							?>
327 327
 
328 328
 						</div>
@@ -342,55 +342,55 @@  discard block
 block discarded – undo
342 342
 							 *
343 343
 							 * @param int $payment_id Payment id.
344 344
 							 */
345
-							do_action( 'give_view_order_details_main_before', $payment_id );
345
+							do_action('give_view_order_details_main_before', $payment_id);
346 346
 							?>
347 347
 
348 348
 							<?php $column_count = 'columns-3'; ?>
349 349
 							<div id="give-donation-overview" class="postbox <?php echo $column_count; ?>">
350
-								<h3 class="hndle"><?php esc_html_e( 'Donation Information', 'give' ); ?></h3>
350
+								<h3 class="hndle"><?php esc_html_e('Donation Information', 'give'); ?></h3>
351 351
 
352 352
 								<div class="inside">
353 353
 
354 354
 									<div class="column-container">
355 355
 										<div class="column">
356 356
 											<p>
357
-												<strong><?php esc_html_e( 'Donation Form ID:', 'give' ); ?></strong><br>
357
+												<strong><?php esc_html_e('Donation Form ID:', 'give'); ?></strong><br>
358 358
 												<?php
359
-												if ( $payment_meta['form_id'] ) :
359
+												if ($payment_meta['form_id']) :
360 360
 													printf(
361 361
 														'<a href="%1$s" target="_blank">#%2$s</a>',
362
-														admin_url( 'post.php?action=edit&post=' . $payment_meta['form_id'] ),
362
+														admin_url('post.php?action=edit&post='.$payment_meta['form_id']),
363 363
 														$payment_meta['form_id']
364 364
 													);
365 365
 												endif;
366 366
 												?>
367 367
 											</p>
368 368
 											<p>
369
-												<strong><?php esc_html_e( 'Donation Form Title:', 'give' ); ?></strong><br>
370
-												<?php give_get_form_dropdown( array(
369
+												<strong><?php esc_html_e('Donation Form Title:', 'give'); ?></strong><br>
370
+												<?php give_get_form_dropdown(array(
371 371
 													'id'       => $payment_meta['form_id'],
372 372
 													'selected' => $payment_meta['form_id'],
373 373
 													'chosen'   => true,
374
-												), true ); ?>
374
+												), true); ?>
375 375
 											</p>
376 376
 										</div>
377 377
 										<div class="column">
378 378
 											<p>
379
-												<strong><?php esc_html_e( 'Donation Date:', 'give' ); ?></strong><br>
380
-												<?php echo date_i18n( give_date_format(), $payment_date ); ?>
379
+												<strong><?php esc_html_e('Donation Date:', 'give'); ?></strong><br>
380
+												<?php echo date_i18n(give_date_format(), $payment_date); ?>
381 381
 											</p>
382 382
 											<p>
383
-												<strong><?php esc_html_e( 'Donation Level:', 'give' ); ?></strong><br>
383
+												<strong><?php esc_html_e('Donation Level:', 'give'); ?></strong><br>
384 384
 												<span class="give-donation-level">
385 385
 													<?php
386
-													$var_prices = give_has_variable_prices( $payment_meta['form_id'] );
387
-													if ( empty( $var_prices ) ) {
388
-														esc_html_e( 'n/a', 'give' );
386
+													$var_prices = give_has_variable_prices($payment_meta['form_id']);
387
+													if (empty($var_prices)) {
388
+														esc_html_e('n/a', 'give');
389 389
 													} else {
390 390
 														$prices_atts = '';
391
-														if( $variable_prices = give_get_variable_prices( $payment_meta['form_id'] ) ) {
392
-															foreach ( $variable_prices as $variable_price ) {
393
-																$prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount( $variable_price['_give_amount'] );
391
+														if ($variable_prices = give_get_variable_prices($payment_meta['form_id'])) {
392
+															foreach ($variable_prices as $variable_price) {
393
+																$prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount($variable_price['_give_amount']);
394 394
 															}
395 395
 														}
396 396
 														// Variable price dropdown options.
@@ -400,11 +400,11 @@  discard block
 block discarded – undo
400 400
 															'chosen'           => true,
401 401
 															'show_option_all'  => '',
402 402
 															'show_option_none' => '',
403
-															'select_atts'      => 'data-prices=' . esc_attr( json_encode( $prices_atts ) ),
403
+															'select_atts'      => 'data-prices='.esc_attr(json_encode($prices_atts)),
404 404
 															'selected'         => $payment_meta['price_id'],
405 405
 														);
406 406
 														// Render variable prices select tag html.
407
-														give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true );
407
+														give_get_form_variable_price_dropdown($variable_price_dropdown_option, true);
408 408
 													}
409 409
 													?>
410 410
 												</span>
@@ -412,8 +412,8 @@  discard block
 block discarded – undo
412 412
 										</div>
413 413
 										<div class="column">
414 414
 											<p>
415
-												<strong><?php esc_html_e( 'Total Donation:', 'give' ); ?></strong><br>
416
-												<?php echo esc_html( give_currency_filter( give_format_amount( give_get_payment_amount( $payment_id ) ) ) ); ?>
415
+												<strong><?php esc_html_e('Total Donation:', 'give'); ?></strong><br>
416
+												<?php echo esc_html(give_currency_filter(give_format_amount(give_get_payment_amount($payment_id)))); ?>
417 417
 											</p>
418 418
 											<p>
419 419
 												<?php
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 												 *
427 427
 												 * @param int $payment_id Payment id.
428 428
 												 */
429
-												do_action( 'give_donation_details_thead_before', $payment_id );
429
+												do_action('give_donation_details_thead_before', $payment_id);
430 430
 
431 431
 
432 432
 												/**
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 												 *
439 439
 												 * @param int $payment_id Payment id.
440 440
 												 */
441
-												do_action( 'give_donation_details_thead_after', $payment_id );
441
+												do_action('give_donation_details_thead_after', $payment_id);
442 442
 
443 443
 												/**
444 444
 												 * Fires in order details page, in the donation-information metabox, before the body elements.
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 												 *
450 450
 												 * @param int $payment_id Payment id.
451 451
 												 */
452
-												do_action( 'give_donation_details_tbody_before', $payment_id );
452
+												do_action('give_donation_details_tbody_before', $payment_id);
453 453
 
454 454
 												/**
455 455
 												 * Fires in order details page, in the donation-information metabox, after the body elements.
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 												 *
461 461
 												 * @param int $payment_id Payment id.
462 462
 												 */
463
-												do_action( 'give_donation_details_tbody_after', $payment_id );
463
+												do_action('give_donation_details_tbody_after', $payment_id);
464 464
 												?>
465 465
 											</p>
466 466
 										</div>
@@ -480,57 +480,57 @@  discard block
 block discarded – undo
480 480
 							 *
481 481
 							 * @param int $payment_id Payment id.
482 482
 							 */
483
-							do_action( 'give_view_order_details_files_after', $payment_id );
483
+							do_action('give_view_order_details_files_after', $payment_id);
484 484
 							?>
485 485
 
486 486
 							<div id="give-donor-details" class="postbox">
487
-								<h3 class="hndle"><?php esc_html_e( 'Donor Details', 'give' ); ?></h3>
487
+								<h3 class="hndle"><?php esc_html_e('Donor Details', 'give'); ?></h3>
488 488
 
489 489
 								<div class="inside">
490 490
 
491
-									<?php $customer = new Give_Customer( $customer_id ); ?>
491
+									<?php $customer = new Give_Customer($customer_id); ?>
492 492
 
493 493
 									<div class="column-container customer-info">
494 494
 										<div class="column">
495 495
 											<p>
496
-												<strong><?php esc_html_e( 'Donor ID:', 'give' ); ?></strong><br>
496
+												<strong><?php esc_html_e('Donor ID:', 'give'); ?></strong><br>
497 497
 												<?php
498
-												if ( ! empty( $customer->id ) ) {
498
+												if ( ! empty($customer->id)) {
499 499
 													printf(
500 500
 														'<a href="%1$s" target="_blank">#%2$s</a>',
501
-														admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $customer->id ),
501
+														admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$customer->id),
502 502
 														$customer->id
503 503
 													);
504 504
 												}
505 505
 												?>
506 506
 											</p>
507 507
 											<p>
508
-												<strong><?php esc_html_e( 'Donor Since:', 'give' ); ?></strong><br>
509
-												<?php echo date_i18n( give_date_format(), strtotime( $customer->date_created ) ) ?>
508
+												<strong><?php esc_html_e('Donor Since:', 'give'); ?></strong><br>
509
+												<?php echo date_i18n(give_date_format(), strtotime($customer->date_created)) ?>
510 510
 											</p>
511 511
 										</div>
512 512
 										<div class="column">
513 513
 											<p>
514
-												<strong><?php esc_html_e( 'Donor Name:', 'give' ); ?></strong><br>
514
+												<strong><?php esc_html_e('Donor Name:', 'give'); ?></strong><br>
515 515
 												<?php echo $customer->name; ?>
516 516
 											</p>
517 517
 											<p>
518
-												<strong><?php esc_html_e( 'Donor Email:', 'give' ); ?></strong><br>
518
+												<strong><?php esc_html_e('Donor Email:', 'give'); ?></strong><br>
519 519
 												<?php echo $customer->email; ?>
520 520
 											</p>
521 521
 										</div>
522 522
 										<div class="column">
523 523
 											<p>
524
-												<strong><?php esc_html_e( 'Change Donor:', 'give' ); ?></strong><br>
524
+												<strong><?php esc_html_e('Change Donor:', 'give'); ?></strong><br>
525 525
 												<?php
526
-												echo Give()->html->donor_dropdown( array(
526
+												echo Give()->html->donor_dropdown(array(
527 527
 													'selected' => $customer->id,
528 528
 													'name'     => 'customer-id',
529
-												) );
529
+												));
530 530
 												?>
531 531
 											</p>
532 532
 											<p>
533
-												<a href="#new" class="give-payment-new-customer"><?php esc_html_e( 'Create New Donor', 'give' ); ?></a>
533
+												<a href="#new" class="give-payment-new-customer"><?php esc_html_e('Create New Donor', 'give'); ?></a>
534 534
 											</p>
535 535
 										</div>
536 536
 									</div>
@@ -538,13 +538,13 @@  discard block
 block discarded – undo
538 538
 									<div class="column-container new-customer" style="display: none">
539 539
 										<div class="column">
540 540
 											<p>
541
-												<label for="give-new-customer-name"><?php esc_html_e( 'New Donor Name:', 'give' ); ?></label>
541
+												<label for="give-new-customer-name"><?php esc_html_e('New Donor Name:', 'give'); ?></label>
542 542
 												<input id="give-new-customer-name" type="text" name="give-new-customer-name" value="" class="medium-text"/>
543 543
 											</p>
544 544
 										</div>
545 545
 										<div class="column">
546 546
 											<p>
547
-												<label for="give-new-customer-email"><?php esc_html_e( 'New Donor Email:', 'give' ); ?></label>
547
+												<label for="give-new-customer-email"><?php esc_html_e('New Donor Email:', 'give'); ?></label>
548 548
 												<input id="give-new-customer-email" type="email" name="give-new-customer-email" value="" class="medium-text"/>
549 549
 											</p>
550 550
 										</div>
@@ -552,9 +552,9 @@  discard block
 block discarded – undo
552 552
 											<p>
553 553
 												<input type="hidden" name="give-current-customer" value="<?php echo $customer->id; ?>"/>
554 554
 												<input type="hidden" id="give-new-customer" name="give-new-customer" value="0"/>
555
-												<a href="#cancel" class="give-payment-new-customer-cancel give-delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a>
555
+												<a href="#cancel" class="give-payment-new-customer-cancel give-delete"><?php esc_html_e('Cancel', 'give'); ?></a>
556 556
 												<br>
557
-												<em><?php esc_html_e( 'Click "Save Donation" to create new donor.', 'give' ); ?></em>
557
+												<em><?php esc_html_e('Click "Save Donation" to create new donor.', 'give'); ?></em>
558 558
 											</p>
559 559
 										</div>
560 560
 									</div>
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
 									 * @param array $payment_meta Payment meta.
571 571
 									 * @param array $user_info    User information.
572 572
 									 */
573
-									do_action( 'give_payment_personal_details_list', $payment_meta, $user_info );
573
+									do_action('give_payment_personal_details_list', $payment_meta, $user_info);
574 574
 
575 575
 									/**
576 576
 									 * Fires in order details page, in the donor-details metabox.
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
 									 *
580 580
 									 * @param int $payment_id Payment id.
581 581
 									 */
582
-									do_action( 'give_payment_view_details', $payment_id );
582
+									do_action('give_payment_view_details', $payment_id);
583 583
 									?>
584 584
 
585 585
 								</div>
@@ -595,11 +595,11 @@  discard block
 block discarded – undo
595 595
 							 *
596 596
 							 * @param int $payment_id Payment id.
597 597
 							 */
598
-							do_action( 'give_view_order_details_billing_before', $payment_id );
598
+							do_action('give_view_order_details_billing_before', $payment_id);
599 599
 							?>
600 600
 
601 601
 							<div id="give-billing-details" class="postbox">
602
-								<h3 class="hndle"><?php esc_html_e( 'Billing Address', 'give' ); ?></h3>
602
+								<h3 class="hndle"><?php esc_html_e('Billing Address', 'give'); ?></h3>
603 603
 
604 604
 								<div class="inside">
605 605
 
@@ -609,57 +609,57 @@  discard block
 block discarded – undo
609 609
 											<div class="data column-container">
610 610
 												<div class="column">
611 611
 													<div class="give-wrap-address-line1">
612
-														<label for="give-payment-address-line1" class="order-data-address"><?php esc_html_e( 'Address 1:', 'give' ); ?></label>
613
-														<input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr( $address['line1'] ); ?>" class="medium-text"/>
612
+														<label for="give-payment-address-line1" class="order-data-address"><?php esc_html_e('Address 1:', 'give'); ?></label>
613
+														<input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr($address['line1']); ?>" class="medium-text"/>
614 614
 													</div>
615 615
 													<div class="give-wrap-address-line2">
616
-														<label for="give-payment-address-line2" class="order-data-address-line"><?php esc_html_e( 'Address 2:', 'give' ); ?></label>
617
-														<input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr( $address['line2'] ); ?>" class="medium-text"/>
616
+														<label for="give-payment-address-line2" class="order-data-address-line"><?php esc_html_e('Address 2:', 'give'); ?></label>
617
+														<input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr($address['line2']); ?>" class="medium-text"/>
618 618
 													</div>
619 619
 												</div>
620 620
 												<div class="column">
621 621
 													<div class="give-wrap-address-city">
622
-														<label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e( 'City:', 'give' ); ?></label>
623
-														<input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr( $address['city'] ); ?>" class="medium-text"/>
622
+														<label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e('City:', 'give'); ?></label>
623
+														<input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr($address['city']); ?>" class="medium-text"/>
624 624
 													</div>
625 625
 													<div class="give-wrap-address-zip">
626
-														<label for="give-payment-address-zip" class="order-data-address-line"><?php esc_html_e( 'Zip / Postal Code:', 'give' ); ?></label>
627
-														<input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr( $address['zip'] ); ?>" class="medium-text"/>
626
+														<label for="give-payment-address-zip" class="order-data-address-line"><?php esc_html_e('Zip / Postal Code:', 'give'); ?></label>
627
+														<input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr($address['zip']); ?>" class="medium-text"/>
628 628
 
629 629
 													</div>
630 630
 												</div>
631 631
 												<div class="column">
632 632
 													<div id="give-order-address-country-wrap">
633
-														<label class="order-data-address-line"><?php esc_html_e( 'Country:', 'give' ); ?></label>
633
+														<label class="order-data-address-line"><?php esc_html_e('Country:', 'give'); ?></label>
634 634
 														<?php
635
-														echo Give()->html->select( array(
635
+														echo Give()->html->select(array(
636 636
 															'options'          => give_get_country_list(),
637 637
 															'name'             => 'give-payment-address[0][country]',
638 638
 															'selected'         => $address['country'],
639 639
 															'show_option_all'  => false,
640 640
 															'show_option_none' => false,
641 641
 															'chosen'           => true,
642
-															'placeholder'      => esc_attr__( 'Select a country', 'give' ),
643
-														) );
642
+															'placeholder'      => esc_attr__('Select a country', 'give'),
643
+														));
644 644
 														?>
645 645
 													</div>
646 646
 													<div id="give-order-address-state-wrap">
647
-														<label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e( 'State / Province:', 'give' ); ?></label>
647
+														<label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e('State / Province:', 'give'); ?></label>
648 648
 														<?php
649
-														$states = give_get_states( $address['country'] );
650
-														if ( ! empty( $states ) ) {
651
-															echo Give()->html->select( array(
649
+														$states = give_get_states($address['country']);
650
+														if ( ! empty($states)) {
651
+															echo Give()->html->select(array(
652 652
 																'options'          => $states,
653 653
 																'name'             => 'give-payment-address[0][state]',
654 654
 																'selected'         => $address['state'],
655 655
 																'show_option_all'  => false,
656 656
 																'show_option_none' => false,
657 657
 																'chosen'           => true,
658
-																'placeholder'      => esc_attr__( 'Select a state', 'give' ),
659
-															) );
658
+																'placeholder'      => esc_attr__('Select a state', 'give'),
659
+															));
660 660
 														} else {
661 661
 															?>
662
-															<input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr( $address['state'] ); ?>" class="medium-text"/>
662
+															<input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr($address['state']); ?>" class="medium-text"/>
663 663
 															<?php
664 664
 														} ?>
665 665
 													</div>
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
 									 *
680 680
 									 * @param int $payment_id Payment id.
681 681
 									 */
682
-									do_action( 'give_payment_billing_details', $payment_id );
682
+									do_action('give_payment_billing_details', $payment_id);
683 683
 									?>
684 684
 
685 685
 								</div>
@@ -695,32 +695,32 @@  discard block
 block discarded – undo
695 695
 							 *
696 696
 							 * @param int $payment_id Payment id.
697 697
 							 */
698
-							do_action( 'give_view_order_details_billing_after', $payment_id );
698
+							do_action('give_view_order_details_billing_after', $payment_id);
699 699
 							?>
700 700
 
701 701
 							<div id="give-payment-notes" class="postbox">
702
-								<h3 class="hndle"><?php esc_html_e( 'Donation Notes', 'give' ); ?></h3>
702
+								<h3 class="hndle"><?php esc_html_e('Donation Notes', 'give'); ?></h3>
703 703
 
704 704
 								<div class="inside">
705 705
 									<div id="give-payment-notes-inner">
706 706
 										<?php
707
-										$notes = give_get_payment_notes( $payment_id );
708
-										if ( ! empty( $notes ) ) {
707
+										$notes = give_get_payment_notes($payment_id);
708
+										if ( ! empty($notes)) {
709 709
 											$no_notes_display = ' style="display:none;"';
710
-											foreach ( $notes as $note ) :
710
+											foreach ($notes as $note) :
711 711
 
712
-												echo give_get_payment_note_html( $note, $payment_id );
712
+												echo give_get_payment_note_html($note, $payment_id);
713 713
 
714 714
 											endforeach;
715 715
 										} else {
716 716
 											$no_notes_display = '';
717 717
 										}
718
-										echo '<p class="give-no-payment-notes"' . $no_notes_display . '>' . esc_html__( 'No donation notes.', 'give' ) . '</p>'; ?>
718
+										echo '<p class="give-no-payment-notes"'.$no_notes_display.'>'.esc_html__('No donation notes.', 'give').'</p>'; ?>
719 719
 									</div>
720 720
 									<textarea name="give-payment-note" id="give-payment-note" class="large-text"></textarea>
721 721
 
722 722
 									<div class="give-clearfix">
723
-										<button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint( $payment_id ); ?>"><?php esc_html_e( 'Add Note', 'give' ); ?></button>
723
+										<button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint($payment_id); ?>"><?php esc_html_e('Add Note', 'give'); ?></button>
724 724
 									</div>
725 725
 
726 726
 								</div>
@@ -736,7 +736,7 @@  discard block
 block discarded – undo
736 736
 							 *
737 737
 							 * @param int $payment_id Payment id.
738 738
 							 */
739
-							do_action( 'give_view_order_details_main_after', $payment_id );
739
+							do_action('give_view_order_details_main_after', $payment_id);
740 740
 							?>
741 741
 
742 742
 						</div>
@@ -758,11 +758,11 @@  discard block
 block discarded – undo
758 758
 		 *
759 759
 		 * @param int $payment_id Payment id.
760 760
 		 */
761
-		do_action( 'give_view_order_details_form_bottom', $payment_id );
761
+		do_action('give_view_order_details_form_bottom', $payment_id);
762 762
 
763
-		wp_nonce_field( 'give_update_payment_details_nonce' );
763
+		wp_nonce_field('give_update_payment_details_nonce');
764 764
 		?>
765
-		<input type="hidden" name="give_payment_id" value="<?php echo esc_attr( $payment_id ); ?>"/>
765
+		<input type="hidden" name="give_payment_id" value="<?php echo esc_attr($payment_id); ?>"/>
766 766
 		<input type="hidden" name="give_action" value="update_payment_details"/>
767 767
 	</form>
768 768
 	<?php
@@ -773,6 +773,6 @@  discard block
 block discarded – undo
773 773
 	 *
774 774
 	 * @param int $payment_id Payment id.
775 775
 	 */
776
-	do_action( 'give_view_order_details_after', $payment_id );
776
+	do_action('give_view_order_details_after', $payment_id);
777 777
 	?>
778 778
 </div><!-- /.wrap -->
Please login to merge, or discard this patch.
includes/admin/reporting/export/export-actions.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  * @license     https://opensource.org/licenses/gpl-license GNU Public License
11 11
  */
12 12
 
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
  */
23 23
 function give_process_batch_export_form() {
24 24
 
25
-	if ( ! wp_verify_nonce( $_REQUEST['nonce'], 'give-batch-export' ) ) {
26
-		wp_die( esc_html__( 'Nonce verification failed.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
25
+	if ( ! wp_verify_nonce($_REQUEST['nonce'], 'give-batch-export')) {
26
+		wp_die(esc_html__('Nonce verification failed.', 'give'), esc_html__('Error', 'give'), array('response' => 403));
27 27
 	}
28 28
 
29
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export.php';
29
+	require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export.php';
30 30
 
31 31
 	/**
32 32
 	 * Fires before batch export.
@@ -35,14 +35,14 @@  discard block
 block discarded – undo
35 35
 	 *
36 36
 	 * @param string $class Export class.
37 37
 	 */
38
-	do_action( 'give_batch_export_class_include', $_REQUEST['class'] );
38
+	do_action('give_batch_export_class_include', $_REQUEST['class']);
39 39
 
40 40
 	$export = new $_REQUEST['class'];
41 41
 	$export->export();
42 42
 
43 43
 }
44 44
 
45
-add_action( 'give_form_batch_export', 'give_process_batch_export_form' );
45
+add_action('give_form_batch_export', 'give_process_batch_export_form');
46 46
 
47 47
 /**
48 48
  * Exports earnings for a specified time period
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
  * @return void
54 54
  */
55 55
 function give_export_earnings() {
56
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-export-earnings.php';
56
+	require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/class-export-earnings.php';
57 57
 
58 58
 	$earnings_export = new Give_Earnings_Export();
59 59
 
60 60
 	$earnings_export->export();
61 61
 }
62 62
 
63
-add_action( 'give_earnings_export', 'give_export_earnings' );
63
+add_action('give_earnings_export', 'give_export_earnings');
64 64
 
65 65
 
66 66
 /**
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
  * @return void
71 71
  */
72 72
 function give_register_batch_exporters() {
73
-	if ( is_admin() ) {
73
+	if (is_admin()) {
74 74
 		/**
75 75
 		 * Fires in the admin, while plugins loaded.
76 76
 		 *
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
 		 *
81 81
 		 * @param string $class Export class.
82 82
 		 */
83
-		do_action( 'give_register_batch_exporter' );
83
+		do_action('give_register_batch_exporter');
84 84
 	}
85 85
 }
86 86
 
87
-add_action( 'plugins_loaded', 'give_register_batch_exporters' );
87
+add_action('plugins_loaded', 'give_register_batch_exporters');
88 88
 
89 89
 /**
90 90
  * Register the payments batch exporter
@@ -92,10 +92,10 @@  discard block
 block discarded – undo
92 92
  * @since  1.5
93 93
  */
94 94
 function give_register_payments_batch_export() {
95
-	add_action( 'give_batch_export_class_include', 'give_include_payments_batch_processor', 10, 1 );
95
+	add_action('give_batch_export_class_include', 'give_include_payments_batch_processor', 10, 1);
96 96
 }
97 97
 
98
-add_action( 'give_register_batch_exporter', 'give_register_payments_batch_export', 10 );
98
+add_action('give_register_batch_exporter', 'give_register_payments_batch_export', 10);
99 99
 
100 100
 /**
101 101
  * Loads the payments batch process if needed
@@ -106,10 +106,10 @@  discard block
 block discarded – undo
106 106
  *
107 107
  * @return void
108 108
  */
109
-function give_include_payments_batch_processor( $class ) {
109
+function give_include_payments_batch_processor($class) {
110 110
 
111
-	if ( 'Give_Batch_Payments_Export' === $class ) {
112
-		require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-payments.php';
111
+	if ('Give_Batch_Payments_Export' === $class) {
112
+		require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export-payments.php';
113 113
 	}
114 114
 
115 115
 }
@@ -120,10 +120,10 @@  discard block
 block discarded – undo
120 120
  * @since  1.5.2
121 121
  */
122 122
 function give_register_customers_batch_export() {
123
-	add_action( 'give_batch_export_class_include', 'give_include_customers_batch_processor', 10, 1 );
123
+	add_action('give_batch_export_class_include', 'give_include_customers_batch_processor', 10, 1);
124 124
 }
125 125
 
126
-add_action( 'give_register_batch_exporter', 'give_register_customers_batch_export', 10 );
126
+add_action('give_register_batch_exporter', 'give_register_customers_batch_export', 10);
127 127
 
128 128
 /**
129 129
  * Loads the customers batch process if needed
@@ -134,10 +134,10 @@  discard block
 block discarded – undo
134 134
  *
135 135
  * @return void
136 136
  */
137
-function give_include_customers_batch_processor( $class ) {
137
+function give_include_customers_batch_processor($class) {
138 138
 
139
-	if ( 'Give_Batch_Customers_Export' === $class ) {
140
-		require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-customers.php';
139
+	if ('Give_Batch_Customers_Export' === $class) {
140
+		require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export-customers.php';
141 141
 	}
142 142
 
143 143
 }
@@ -148,10 +148,10 @@  discard block
 block discarded – undo
148 148
  * @since  1.5
149 149
  */
150 150
 function give_register_forms_batch_export() {
151
-	add_action( 'give_batch_export_class_include', 'give_include_forms_batch_processor', 10, 1 );
151
+	add_action('give_batch_export_class_include', 'give_include_forms_batch_processor', 10, 1);
152 152
 }
153 153
 
154
-add_action( 'give_register_batch_exporter', 'give_register_forms_batch_export', 10 );
154
+add_action('give_register_batch_exporter', 'give_register_forms_batch_export', 10);
155 155
 
156 156
 /**
157 157
  * Loads the file downloads batch process if needed
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
  *
163 163
  * @return void
164 164
  */
165
-function give_include_forms_batch_processor( $class ) {
165
+function give_include_forms_batch_processor($class) {
166 166
 
167
-	if ( 'Give_Batch_Forms_Export' === $class ) {
168
-		require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-forms.php';
167
+	if ('Give_Batch_Forms_Export' === $class) {
168
+		require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export-forms.php';
169 169
 	}
170 170
 
171 171
 }
Please login to merge, or discard this patch.
includes/admin/payments/class-payments-table.php 1 patch
Spacing   +188 added lines, -188 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
 /**
@@ -118,15 +118,15 @@  discard block
 block discarded – undo
118 118
 	public function __construct() {
119 119
 
120 120
 		// Set parent defaults.
121
-		parent::__construct( array(
122
-			'singular' => give_get_forms_label_singular(),    // Singular name of the listed records.
123
-			'plural'   => give_get_forms_label_plural(),      // Plural name of the listed records.
124
-			'ajax'     => false,                              // Does this table support ajax?
125
-		) );
121
+		parent::__construct(array(
122
+			'singular' => give_get_forms_label_singular(), // Singular name of the listed records.
123
+			'plural'   => give_get_forms_label_plural(), // Plural name of the listed records.
124
+			'ajax'     => false, // Does this table support ajax?
125
+		));
126 126
 
127 127
 		$this->get_payment_counts();
128 128
 		$this->process_bulk_action();
129
-		$this->base_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' );
129
+		$this->base_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history');
130 130
 	}
131 131
 
132 132
 	/**
@@ -135,29 +135,29 @@  discard block
 block discarded – undo
135 135
 	 * @return void
136 136
 	 */
137 137
 	public function advanced_filters() {
138
-		$start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null;
139
-		$end_date   = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : null;
140
-		$status     = isset( $_GET['status'] ) ? $_GET['status'] : '';
138
+		$start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null;
139
+		$end_date   = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : null;
140
+		$status     = isset($_GET['status']) ? $_GET['status'] : '';
141 141
 		?>
142 142
         <div id="give-payment-filters">
143 143
 			<span id="give-payment-date-filters">
144 144
 				<label for="start-date"
145
-                       class="give-start-date-label"><?php esc_html_e( 'Start Date:', 'give' ); ?></label>
145
+                       class="give-start-date-label"><?php esc_html_e('Start Date:', 'give'); ?></label>
146 146
 				<input type="text" id="start-date" name="start-date" class="give_datepicker"
147 147
                        value="<?php echo $start_date; ?>" placeholder="mm/dd/yyyy"/>
148
-				<label for="end-date" class="give-end-date-label"><?php esc_html_e( 'End Date:', 'give' ); ?></label>
148
+				<label for="end-date" class="give-end-date-label"><?php esc_html_e('End Date:', 'give'); ?></label>
149 149
 				<input type="text" id="end-date" name="end-date" class="give_datepicker"
150 150
                        value="<?php echo $end_date; ?>" placeholder="mm/dd/yyyy"/>
151
-				<input type="submit" class="button-secondary" value="<?php esc_attr_e( 'Apply', 'give' ); ?>"/>
151
+				<input type="submit" class="button-secondary" value="<?php esc_attr_e('Apply', 'give'); ?>"/>
152 152
 			</span>
153
-			<?php if ( ! empty( $status ) ) : ?>
154
-                <input type="hidden" name="status" value="<?php echo esc_attr( $status ); ?>"/>
153
+			<?php if ( ! empty($status)) : ?>
154
+                <input type="hidden" name="status" value="<?php echo esc_attr($status); ?>"/>
155 155
 			<?php endif; ?>
156
-			<?php if ( ! empty( $start_date ) || ! empty( $end_date ) ) : ?>
157
-                <a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); ?>"
158
-                   class="button-secondary"><?php esc_html_e( 'Clear Filter', 'give' ); ?></a>
156
+			<?php if ( ! empty($start_date) || ! empty($end_date)) : ?>
157
+                <a href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history'); ?>"
158
+                   class="button-secondary"><?php esc_html_e('Clear Filter', 'give'); ?></a>
159 159
 			<?php endif; ?>
160
-			<?php $this->search_box( esc_html__( 'Search', 'give' ), 'give-payments' ); ?>
160
+			<?php $this->search_box(esc_html__('Search', 'give'), 'give-payments'); ?>
161 161
         </div>
162 162
 
163 163
 		<?php
@@ -174,18 +174,18 @@  discard block
 block discarded – undo
174 174
 	 *
175 175
 	 * @return void
176 176
 	 */
177
-	public function search_box( $text, $input_id ) {
178
-		if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) {
177
+	public function search_box($text, $input_id) {
178
+		if (empty($_REQUEST['s']) && ! $this->has_items()) {
179 179
 			return;
180 180
 		}
181 181
 
182
-		$input_id = $input_id . '-search-input';
182
+		$input_id = $input_id.'-search-input';
183 183
 
184
-		if ( ! empty( $_REQUEST['orderby'] ) ) {
185
-			echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
184
+		if ( ! empty($_REQUEST['orderby'])) {
185
+			echo '<input type="hidden" name="orderby" value="'.esc_attr($_REQUEST['orderby']).'" />';
186 186
 		}
187
-		if ( ! empty( $_REQUEST['order'] ) ) {
188
-			echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
187
+		if ( ! empty($_REQUEST['order'])) {
188
+			echo '<input type="hidden" name="order" value="'.esc_attr($_REQUEST['order']).'" />';
189 189
 		}
190 190
 		?>
191 191
         <p class="search-box" role="search">
@@ -197,11 +197,11 @@  discard block
 block discarded – undo
197 197
 			 *
198 198
 			 * @since 1.7
199 199
 			 */
200
-			do_action( 'give_payment_history_search' );
200
+			do_action('give_payment_history_search');
201 201
 			?>
202 202
             <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
203 203
             <input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>"/>
204
-			<?php submit_button( $text, 'button', false, false, array( 'ID' => 'search-submit' ) ); ?><br/>
204
+			<?php submit_button($text, 'button', false, false, array('ID' => 'search-submit')); ?><br/>
205 205
         </p>
206 206
 		<?php
207 207
 	}
@@ -215,52 +215,52 @@  discard block
 block discarded – undo
215 215
 	 */
216 216
 	public function get_views() {
217 217
 
218
-		$current         = isset( $_GET['status'] ) ? $_GET['status'] : '';
219
-		$total_count     = '&nbsp;<span class="count">(' . $this->total_count . ')</span>';
220
-		$complete_count  = '&nbsp;<span class="count">(' . $this->complete_count . ')</span>';
221
-		$cancelled_count = '&nbsp;<span class="count">(' . $this->cancelled_count . ')</span>';
222
-		$pending_count   = '&nbsp;<span class="count">(' . $this->pending_count . ')</span>';
223
-		$refunded_count  = '&nbsp;<span class="count">(' . $this->refunded_count . ')</span>';
224
-		$failed_count    = '&nbsp;<span class="count">(' . $this->failed_count . ')</span>';
225
-		$abandoned_count = '&nbsp;<span class="count">(' . $this->abandoned_count . ')</span>';
226
-		$revoked_count   = '&nbsp;<span class="count">(' . $this->revoked_count . ')</span>';
218
+		$current         = isset($_GET['status']) ? $_GET['status'] : '';
219
+		$total_count     = '&nbsp;<span class="count">('.$this->total_count.')</span>';
220
+		$complete_count  = '&nbsp;<span class="count">('.$this->complete_count.')</span>';
221
+		$cancelled_count = '&nbsp;<span class="count">('.$this->cancelled_count.')</span>';
222
+		$pending_count   = '&nbsp;<span class="count">('.$this->pending_count.')</span>';
223
+		$refunded_count  = '&nbsp;<span class="count">('.$this->refunded_count.')</span>';
224
+		$failed_count    = '&nbsp;<span class="count">('.$this->failed_count.')</span>';
225
+		$abandoned_count = '&nbsp;<span class="count">('.$this->abandoned_count.')</span>';
226
+		$revoked_count   = '&nbsp;<span class="count">('.$this->revoked_count.')</span>';
227 227
 
228 228
 		$views = array(
229
-			'all'       => sprintf( '<a href="%s"%s>%s</a>', remove_query_arg( array(
229
+			'all'       => sprintf('<a href="%s"%s>%s</a>', remove_query_arg(array(
230 230
 				'status',
231 231
 				'paged',
232
-			) ), $current === 'all' || $current == '' ? ' class="current"' : '', esc_html__( 'All', 'give' ) . $total_count ),
233
-			'publish'   => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
232
+			)), $current === 'all' || $current == '' ? ' class="current"' : '', esc_html__('All', 'give').$total_count),
233
+			'publish'   => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
234 234
 				'status' => 'publish',
235 235
 				'paged'  => false,
236
-			) ) ), $current === 'publish' ? ' class="current"' : '', esc_html__( 'Completed', 'give' ) . $complete_count ),
237
-			'pending'   => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
236
+			))), $current === 'publish' ? ' class="current"' : '', esc_html__('Completed', 'give').$complete_count),
237
+			'pending'   => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
238 238
 				'status' => 'pending',
239 239
 				'paged'  => false,
240
-			) ) ), $current === 'pending' ? ' class="current"' : '', esc_html__( 'Pending', 'give' ) . $pending_count ),
241
-			'refunded'  => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
240
+			))), $current === 'pending' ? ' class="current"' : '', esc_html__('Pending', 'give').$pending_count),
241
+			'refunded'  => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
242 242
 				'status' => 'refunded',
243 243
 				'paged'  => false,
244
-			) ) ), $current === 'refunded' ? ' class="current"' : '', esc_html__( 'Refunded', 'give' ) . $refunded_count ),
245
-			'revoked'   => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
244
+			))), $current === 'refunded' ? ' class="current"' : '', esc_html__('Refunded', 'give').$refunded_count),
245
+			'revoked'   => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
246 246
 				'status' => 'revoked',
247 247
 				'paged'  => false,
248
-			) ) ), $current === 'revoked' ? ' class="current"' : '', esc_html__( 'Revoked', 'give' ) . $revoked_count ),
249
-			'failed'    => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
248
+			))), $current === 'revoked' ? ' class="current"' : '', esc_html__('Revoked', 'give').$revoked_count),
249
+			'failed'    => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
250 250
 				'status' => 'failed',
251 251
 				'paged'  => false,
252
-			) ) ), $current === 'failed' ? ' class="current"' : '', esc_html__( 'Failed', 'give' ) . $failed_count ),
253
-			'cancelled' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
252
+			))), $current === 'failed' ? ' class="current"' : '', esc_html__('Failed', 'give').$failed_count),
253
+			'cancelled' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
254 254
 				'status' => 'cancelled',
255 255
 				'paged'  => false,
256
-			) ) ), $current === 'cancelled' ? ' class="current"' : '', esc_html__( 'Cancelled', 'give' ) . $cancelled_count ),
257
-			'abandoned' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
256
+			))), $current === 'cancelled' ? ' class="current"' : '', esc_html__('Cancelled', 'give').$cancelled_count),
257
+			'abandoned' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
258 258
 				'status' => 'abandoned',
259 259
 				'paged'  => false,
260
-			) ) ), $current === 'abandoned' ? ' class="current"' : '', esc_html__( 'Abandoned', 'give' ) . $abandoned_count ),
260
+			))), $current === 'abandoned' ? ' class="current"' : '', esc_html__('Abandoned', 'give').$abandoned_count),
261 261
 		);
262 262
 
263
-		return apply_filters( 'give_payments_table_views', $views );
263
+		return apply_filters('give_payments_table_views', $views);
264 264
 	}
265 265
 
266 266
 	/**
@@ -273,15 +273,15 @@  discard block
 block discarded – undo
273 273
 	public function get_columns() {
274 274
 		$columns = array(
275 275
 			'cb'            => '<input type="checkbox" />', // Render a checkbox instead of text.
276
-			'donation'      => esc_html__( 'Donation', 'give' ),
277
-			'donation_form' => esc_html__( 'Donation Form', 'give' ),
278
-			'status'        => esc_html__( 'Status', 'give' ),
279
-			'date'          => esc_html__( 'Date', 'give' ),
280
-			'amount'        => esc_html__( 'Amount', 'give' ),
281
-			'details'       => esc_html__( 'Details', 'give' ),
276
+			'donation'      => esc_html__('Donation', 'give'),
277
+			'donation_form' => esc_html__('Donation Form', 'give'),
278
+			'status'        => esc_html__('Status', 'give'),
279
+			'date'          => esc_html__('Date', 'give'),
280
+			'amount'        => esc_html__('Amount', 'give'),
281
+			'details'       => esc_html__('Details', 'give'),
282 282
 		);
283 283
 
284
-		return apply_filters( 'give_payments_table_columns', $columns );
284
+		return apply_filters('give_payments_table_columns', $columns);
285 285
 	}
286 286
 
287 287
 	/**
@@ -293,14 +293,14 @@  discard block
 block discarded – undo
293 293
 	 */
294 294
 	public function get_sortable_columns() {
295 295
 		$columns = array(
296
-			'donation'      => array( 'ID', true ),
297
-			'donation_form' => array( 'donation_form', false ),
298
-			'status'        => array( 'status', false ),
299
-			'amount'        => array( 'amount', false ),
300
-			'date'          => array( 'date', false ),
296
+			'donation'      => array('ID', true),
297
+			'donation_form' => array('donation_form', false),
298
+			'status'        => array('status', false),
299
+			'amount'        => array('amount', false),
300
+			'date'          => array('date', false),
301 301
 		);
302 302
 
303
-		return apply_filters( 'give_payments_table_sortable_columns', $columns );
303
+		return apply_filters('give_payments_table_sortable_columns', $columns);
304 304
 	}
305 305
 
306 306
 	/**
@@ -326,65 +326,65 @@  discard block
 block discarded – undo
326 326
 	 *
327 327
 	 * @return string Column Name
328 328
 	 */
329
-	public function column_default( $payment, $column_name ) {
329
+	public function column_default($payment, $column_name) {
330 330
 
331
-		$single_donation_url = esc_url( add_query_arg( 'id', $payment->ID, admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details' ) ) );
332
-		$row_actions         = $this->get_row_actions( $payment );
331
+		$single_donation_url = esc_url(add_query_arg('id', $payment->ID, admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details')));
332
+		$row_actions         = $this->get_row_actions($payment);
333 333
 
334
-		switch ( $column_name ) {
334
+		switch ($column_name) {
335 335
 			case 'donation' :
336 336
 				$value = sprintf(
337 337
 					'<a href="%1$s" data-tooltip="%2$s">#%3$s</a>&nbsp;%4$s&nbsp;%5$s<br>',
338 338
 					$single_donation_url,
339
-					sprintf( esc_attr__( 'View Donation %s', 'give' ), $payment->ID ),
339
+					sprintf(esc_attr__('View Donation %s', 'give'), $payment->ID),
340 340
 					$payment->ID,
341
-					esc_html__( 'by', 'give' ),
342
-					$this->get_donor( $payment )
341
+					esc_html__('by', 'give'),
342
+					$this->get_donor($payment)
343 343
 				);
344
-				$value .= $this->get_donor_email( $payment );
345
-				$value .= $this->row_actions( $row_actions );
344
+				$value .= $this->get_donor_email($payment);
345
+				$value .= $this->row_actions($row_actions);
346 346
 				break;
347 347
 
348 348
 			case 'amount' :
349
-				$amount = ! empty( $payment->total ) ? $payment->total : 0;
350
-				$value  = give_currency_filter( give_format_amount( $amount ), give_get_payment_currency_code( $payment->ID ) );
349
+				$amount = ! empty($payment->total) ? $payment->total : 0;
350
+				$value  = give_currency_filter(give_format_amount($amount), give_get_payment_currency_code($payment->ID));
351 351
 				break;
352 352
 
353 353
 			case 'donation_form' :
354
-				$form_title = empty( $payment->form_title ) ? sprintf( __( 'Untitled (#%s)', 'give' ), $payment->form_id ) : $payment->form_title;
355
-				$value      = '<a href="' . admin_url( 'post.php?post=' . $payment->form_id . '&action=edit' ) . '">' . $form_title . '</a>';
356
-				$level      = give_get_payment_form_title( $payment->meta, true );
354
+				$form_title = empty($payment->form_title) ? sprintf(__('Untitled (#%s)', 'give'), $payment->form_id) : $payment->form_title;
355
+				$value      = '<a href="'.admin_url('post.php?post='.$payment->form_id.'&action=edit').'">'.$form_title.'</a>';
356
+				$level      = give_get_payment_form_title($payment->meta, true);
357 357
 
358
-				if ( ! empty( $level ) ) {
358
+				if ( ! empty($level)) {
359 359
 					$value .= $level;
360 360
 				}
361 361
 
362 362
 				break;
363 363
 
364 364
 			case 'date' :
365
-				$date  = strtotime( $payment->date );
366
-				$value = date_i18n( give_date_format(), $date );
365
+				$date  = strtotime($payment->date);
366
+				$value = date_i18n(give_date_format(), $date);
367 367
 				break;
368 368
 
369 369
 			case 'status' :
370
-				$value = $this->get_payment_status( $payment );
370
+				$value = $this->get_payment_status($payment);
371 371
 				break;
372 372
 
373 373
 			case 'details' :
374 374
 				$value = sprintf(
375 375
 					'<div class="give-payment-details-link-wrap"><a href="%1$s" class="give-payment-details-link button button-small" data-tooltip="%2$s" aria-label="%2$s"><span class="dashicons dashicons-visibility"></span></a></div>',
376 376
 					$single_donation_url,
377
-					sprintf( esc_attr__( 'View Donation %s', 'give' ), $payment->ID )
377
+					sprintf(esc_attr__('View Donation %s', 'give'), $payment->ID)
378 378
 				);
379 379
 				break;
380 380
 
381 381
 			default:
382
-				$value = isset( $payment->$column_name ) ? $payment->$column_name : '';
382
+				$value = isset($payment->$column_name) ? $payment->$column_name : '';
383 383
 				break;
384 384
 
385 385
 		}
386 386
 
387
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, $column_name );
387
+		return apply_filters('give_payments_table_column', $value, $payment->ID, $column_name);
388 388
 	}
389 389
 
390 390
 	/**
@@ -397,17 +397,17 @@  discard block
 block discarded – undo
397 397
 	 *
398 398
 	 * @return string                Data shown in the Email column
399 399
 	 */
400
-	public function get_donor_email( $payment ) {
400
+	public function get_donor_email($payment) {
401 401
 
402
-		$email = give_get_payment_user_email( $payment->ID );
402
+		$email = give_get_payment_user_email($payment->ID);
403 403
 
404
-		if ( empty( $email ) ) {
405
-			$email = esc_html__( '(unknown)', 'give' );
404
+		if (empty($email)) {
405
+			$email = esc_html__('(unknown)', 'give');
406 406
 		}
407 407
 
408
-		$value = '<a href="mailto:' . $email . '" data-tooltip="' . esc_attr__( 'Email donor', 'give' ) . '">' . $email . '</a>';
408
+		$value = '<a href="mailto:'.$email.'" data-tooltip="'.esc_attr__('Email donor', 'give').'">'.$email.'</a>';
409 409
 
410
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'email' );
410
+		return apply_filters('give_payments_table_column', $value, $payment->ID, 'email');
411 411
 	}
412 412
 
413 413
 	/**
@@ -419,18 +419,18 @@  discard block
 block discarded – undo
419 419
 	 *
420 420
 	 * @return array $actions
421 421
 	 */
422
-	function get_row_actions( $payment ) {
422
+	function get_row_actions($payment) {
423 423
 
424 424
 		$actions = array();
425
-		$email   = give_get_payment_user_email( $payment->ID );
425
+		$email   = give_get_payment_user_email($payment->ID);
426 426
 
427 427
 		// Add search term string back to base URL.
428
-		$search_terms = ( isset( $_GET['s'] ) ? trim( $_GET['s'] ) : '' );
429
-		if ( ! empty( $search_terms ) ) {
430
-			$this->base_url = add_query_arg( 's', $search_terms, $this->base_url );
428
+		$search_terms = (isset($_GET['s']) ? trim($_GET['s']) : '');
429
+		if ( ! empty($search_terms)) {
430
+			$this->base_url = add_query_arg('s', $search_terms, $this->base_url);
431 431
 		}
432 432
 
433
-		if ( give_is_payment_complete( $payment->ID ) && ! empty( $email ) ) {
433
+		if (give_is_payment_complete($payment->ID) && ! empty($email)) {
434 434
 
435 435
 			$actions['email_links'] = sprintf(
436 436
 				'<a href="%1$s" aria-label="%2$s">%3$s</a>',
@@ -444,8 +444,8 @@  discard block
 block discarded – undo
444 444
 					),
445 445
 					'give_payment_nonce'
446 446
 				),
447
-				sprintf( esc_attr__( 'Resend Donation %s Receipt', 'give' ), $payment->ID ),
448
-				esc_html__( 'Resend Receipt', 'give' )
447
+				sprintf(esc_attr__('Resend Donation %s Receipt', 'give'), $payment->ID),
448
+				esc_html__('Resend Receipt', 'give')
449 449
 			);
450 450
 
451 451
 		}
@@ -462,11 +462,11 @@  discard block
 block discarded – undo
462 462
 				),
463 463
 				'give_donation_nonce'
464 464
 			),
465
-			sprintf( esc_attr__( 'Delete Donation %s', 'give' ), $payment->ID ),
466
-			esc_html__( 'Delete', 'give' )
465
+			sprintf(esc_attr__('Delete Donation %s', 'give'), $payment->ID),
466
+			esc_html__('Delete', 'give')
467 467
 		);
468 468
 
469
-		return apply_filters( 'give_payment_row_actions', $actions, $payment );
469
+		return apply_filters('give_payment_row_actions', $actions, $payment);
470 470
 	}
471 471
 
472 472
 
@@ -480,10 +480,10 @@  discard block
 block discarded – undo
480 480
 	 *
481 481
 	 * @return string                Data shown in the Email column
482 482
 	 */
483
-	function get_payment_status( $payment ) {
484
-		$value = '<div class="give-donation-status status-' . sanitize_title( give_get_payment_status( $payment, true ) ) . '"><span class="give-donation-status-icon"></span> ' . give_get_payment_status( $payment, true ) . '</div>';
485
-		if ( $payment->mode == 'test' ) {
486
-			$value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="' . esc_attr__( 'This donation was made in test mode.', 'give' ) . '">' . esc_html__( 'Test', 'give' ) . '</span>';
483
+	function get_payment_status($payment) {
484
+		$value = '<div class="give-donation-status status-'.sanitize_title(give_get_payment_status($payment, true)).'"><span class="give-donation-status-icon"></span> '.give_get_payment_status($payment, true).'</div>';
485
+		if ($payment->mode == 'test') {
486
+			$value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="'.esc_attr__('This donation was made in test mode.', 'give').'">'.esc_html__('Test', 'give').'</span>';
487 487
 		}
488 488
 
489 489
 		return $value;
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
 	 *
500 500
 	 * @return string Displays a checkbox.
501 501
 	 */
502
-	public function column_cb( $payment ) {
502
+	public function column_cb($payment) {
503 503
 		return sprintf(
504 504
 			'<input type="checkbox" name="%1$s[]" value="%2$s" />',
505 505
 			'payment',
@@ -517,8 +517,8 @@  discard block
 block discarded – undo
517 517
 	 *
518 518
 	 * @return string Displays a checkbox.
519 519
 	 */
520
-	public function get_payment_id( $payment ) {
521
-		return '<span class="give-payment-id">' . give_get_payment_number( $payment->ID ) . '</span>';
520
+	public function get_payment_id($payment) {
521
+		return '<span class="give-payment-id">'.give_get_payment_number($payment->ID).'</span>';
522 522
 	}
523 523
 
524 524
 	/**
@@ -531,19 +531,19 @@  discard block
 block discarded – undo
531 531
 	 *
532 532
 	 * @return string Data shown in the User column
533 533
 	 */
534
-	public function get_donor( $payment ) {
534
+	public function get_donor($payment) {
535 535
 
536
-		$customer_id = give_get_payment_customer_id( $payment->ID );
536
+		$customer_id = give_get_payment_customer_id($payment->ID);
537 537
 
538
-		if ( ! empty( $customer_id ) ) {
539
-			$customer = new Give_Customer( $customer_id );
540
-			$value    = '<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id=$customer_id" ) ) . '">' . $customer->name . '</a>';
538
+		if ( ! empty($customer_id)) {
539
+			$customer = new Give_Customer($customer_id);
540
+			$value    = '<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-donors&view=overview&id=$customer_id")).'">'.$customer->name.'</a>';
541 541
 		} else {
542
-			$email = give_get_payment_user_email( $payment->ID );
543
-			$value = '<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-payment-history&s=$email" ) ) . '">' . esc_html__( '(donor missing)', 'give' ) . '</a>';
542
+			$email = give_get_payment_user_email($payment->ID);
543
+			$value = '<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-payment-history&s=$email")).'">'.esc_html__('(donor missing)', 'give').'</a>';
544 544
 		}
545 545
 
546
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'donor' );
546
+		return apply_filters('give_payments_table_column', $value, $payment->ID, 'donor');
547 547
 	}
548 548
 
549 549
 	/**
@@ -555,18 +555,18 @@  discard block
 block discarded – undo
555 555
 	 */
556 556
 	public function get_bulk_actions() {
557 557
 		$actions = array(
558
-			'delete'               => esc_html__( 'Delete', 'give' ),
559
-			'set-status-publish'   => esc_html__( 'Set To Completed', 'give' ),
560
-			'set-status-pending'   => esc_html__( 'Set To Pending', 'give' ),
561
-			'set-status-refunded'  => esc_html__( 'Set To Refunded', 'give' ),
562
-			'set-status-revoked'   => esc_html__( 'Set To Revoked', 'give' ),
563
-			'set-status-failed'    => esc_html__( 'Set To Failed', 'give' ),
564
-			'set-status-cancelled' => esc_html__( 'Set To Cancelled', 'give' ),
565
-			'set-status-abandoned' => esc_html__( 'Set To Abandoned', 'give' ),
566
-			'resend-receipt'       => esc_html__( 'Resend Email Receipts', 'give' ),
558
+			'delete'               => esc_html__('Delete', 'give'),
559
+			'set-status-publish'   => esc_html__('Set To Completed', 'give'),
560
+			'set-status-pending'   => esc_html__('Set To Pending', 'give'),
561
+			'set-status-refunded'  => esc_html__('Set To Refunded', 'give'),
562
+			'set-status-revoked'   => esc_html__('Set To Revoked', 'give'),
563
+			'set-status-failed'    => esc_html__('Set To Failed', 'give'),
564
+			'set-status-cancelled' => esc_html__('Set To Cancelled', 'give'),
565
+			'set-status-abandoned' => esc_html__('Set To Abandoned', 'give'),
566
+			'resend-receipt'       => esc_html__('Resend Email Receipts', 'give'),
567 567
 		);
568 568
 
569
-		return apply_filters( 'give_payments_table_bulk_actions', $actions );
569
+		return apply_filters('give_payments_table_bulk_actions', $actions);
570 570
 	}
571 571
 
572 572
 	/**
@@ -577,59 +577,59 @@  discard block
 block discarded – undo
577 577
 	 * @return void
578 578
 	 */
579 579
 	public function process_bulk_action() {
580
-		$ids    = isset( $_GET['payment'] ) ? $_GET['payment'] : false;
580
+		$ids    = isset($_GET['payment']) ? $_GET['payment'] : false;
581 581
 		$action = $this->current_action();
582 582
 
583
-		if ( ! is_array( $ids ) ) {
584
-			$ids = array( $ids );
583
+		if ( ! is_array($ids)) {
584
+			$ids = array($ids);
585 585
 		}
586 586
 
587
-		if ( empty( $action ) ) {
587
+		if (empty($action)) {
588 588
 			return;
589 589
 		}
590 590
 
591
-		foreach ( $ids as $id ) {
591
+		foreach ($ids as $id) {
592 592
 
593 593
 			// Detect when a bulk action is being triggered.
594
-			switch ( $this->current_action() ) {
594
+			switch ($this->current_action()) {
595 595
 
596 596
 				case'delete':
597
-					give_delete_purchase( $id );
597
+					give_delete_purchase($id);
598 598
 					break;
599 599
 
600 600
 				case 'set-status-publish':
601
-					give_update_payment_status( $id, 'publish' );
601
+					give_update_payment_status($id, 'publish');
602 602
 					break;
603 603
 
604 604
 				case 'set-status-pending':
605
-					give_update_payment_status( $id, 'pending' );
605
+					give_update_payment_status($id, 'pending');
606 606
 					break;
607 607
 
608 608
 				case 'set-status-refunded':
609
-					give_update_payment_status( $id, 'refunded' );
609
+					give_update_payment_status($id, 'refunded');
610 610
 					break;
611 611
 				case 'set-status-revoked':
612
-					give_update_payment_status( $id, 'revoked' );
612
+					give_update_payment_status($id, 'revoked');
613 613
 					break;
614 614
 
615 615
 				case 'set-status-failed':
616
-					give_update_payment_status( $id, 'failed' );
616
+					give_update_payment_status($id, 'failed');
617 617
 					break;
618 618
 
619 619
 				case 'set-status-cancelled':
620
-					give_update_payment_status( $id, 'cancelled' );
620
+					give_update_payment_status($id, 'cancelled');
621 621
 					break;
622 622
 
623 623
 				case 'set-status-abandoned':
624
-					give_update_payment_status( $id, 'abandoned' );
624
+					give_update_payment_status($id, 'abandoned');
625 625
 					break;
626 626
 
627 627
 				case 'set-status-preapproval':
628
-					give_update_payment_status( $id, 'preapproval' );
628
+					give_update_payment_status($id, 'preapproval');
629 629
 					break;
630 630
 
631 631
 				case 'resend-receipt':
632
-					give_email_donation_receipt( $id, false );
632
+					give_email_donation_receipt($id, false);
633 633
 					break;
634 634
 			}
635 635
 
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
 			 * @param int    $id             The ID of the payment.
642 642
 			 * @param string $current_action The action that is being triggered.
643 643
 			 */
644
-			do_action( 'give_payments_table_do_bulk_action', $id, $this->current_action() );
644
+			do_action('give_payments_table_do_bulk_action', $id, $this->current_action());
645 645
 		}
646 646
 
647 647
 	}
@@ -657,27 +657,27 @@  discard block
 block discarded – undo
657 657
 
658 658
 		$args = array();
659 659
 
660
-		if ( isset( $_GET['user'] ) ) {
661
-			$args['user'] = urldecode( $_GET['user'] );
662
-		} elseif ( isset( $_GET['s'] ) ) {
663
-			$is_user = strpos( $_GET['s'], strtolower( 'user:' ) ) !== false;
664
-			if ( $is_user ) {
665
-				$args['user'] = absint( trim( str_replace( 'user:', '', strtolower( $_GET['s'] ) ) ) );
666
-				unset( $args['s'] );
660
+		if (isset($_GET['user'])) {
661
+			$args['user'] = urldecode($_GET['user']);
662
+		} elseif (isset($_GET['s'])) {
663
+			$is_user = strpos($_GET['s'], strtolower('user:')) !== false;
664
+			if ($is_user) {
665
+				$args['user'] = absint(trim(str_replace('user:', '', strtolower($_GET['s']))));
666
+				unset($args['s']);
667 667
 			} else {
668
-				$args['s'] = sanitize_text_field( $_GET['s'] );
668
+				$args['s'] = sanitize_text_field($_GET['s']);
669 669
 			}
670 670
 		}
671 671
 
672
-		if ( ! empty( $_GET['start-date'] ) ) {
673
-			$args['start-date'] = urldecode( $_GET['start-date'] );
672
+		if ( ! empty($_GET['start-date'])) {
673
+			$args['start-date'] = urldecode($_GET['start-date']);
674 674
 		}
675 675
 
676
-		if ( ! empty( $_GET['end-date'] ) ) {
677
-			$args['end-date'] = urldecode( $_GET['end-date'] );
676
+		if ( ! empty($_GET['end-date'])) {
677
+			$args['end-date'] = urldecode($_GET['end-date']);
678 678
 		}
679 679
 
680
-		$payment_count         = give_count_payments( $args );
680
+		$payment_count         = give_count_payments($args);
681 681
 		$this->complete_count  = $payment_count->publish;
682 682
 		$this->pending_count   = $payment_count->pending;
683 683
 		$this->refunded_count  = $payment_count->refunded;
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
 		$this->cancelled_count = $payment_count->cancelled;
687 687
 		$this->abandoned_count = $payment_count->abandoned;
688 688
 
689
-		foreach ( $payment_count as $count ) {
689
+		foreach ($payment_count as $count) {
690 690
 			$this->total_count += $count;
691 691
 		}
692 692
 	}
@@ -701,26 +701,26 @@  discard block
 block discarded – undo
701 701
 	public function payments_data() {
702 702
 
703 703
 		$per_page   = $this->per_page;
704
-		$orderby    = isset( $_GET['orderby'] ) ? urldecode( $_GET['orderby'] ) : 'ID';
705
-		$order      = isset( $_GET['order'] ) ? $_GET['order'] : 'DESC';
706
-		$user       = isset( $_GET['user'] ) ? $_GET['user'] : null;
707
-		$status     = isset( $_GET['status'] ) ? $_GET['status'] : give_get_payment_status_keys();
708
-		$meta_key   = isset( $_GET['meta_key'] ) ? $_GET['meta_key'] : null;
709
-		$year       = isset( $_GET['year'] ) ? $_GET['year'] : null;
710
-		$month      = isset( $_GET['m'] ) ? $_GET['m'] : null;
711
-		$day        = isset( $_GET['day'] ) ? $_GET['day'] : null;
712
-		$search     = isset( $_GET['s'] ) ? sanitize_text_field( $_GET['s'] ) : null;
713
-		$start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null;
714
-		$end_date   = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : $start_date;
715
-
716
-		if ( ! empty( $search ) ) {
704
+		$orderby    = isset($_GET['orderby']) ? urldecode($_GET['orderby']) : 'ID';
705
+		$order      = isset($_GET['order']) ? $_GET['order'] : 'DESC';
706
+		$user       = isset($_GET['user']) ? $_GET['user'] : null;
707
+		$status     = isset($_GET['status']) ? $_GET['status'] : give_get_payment_status_keys();
708
+		$meta_key   = isset($_GET['meta_key']) ? $_GET['meta_key'] : null;
709
+		$year       = isset($_GET['year']) ? $_GET['year'] : null;
710
+		$month      = isset($_GET['m']) ? $_GET['m'] : null;
711
+		$day        = isset($_GET['day']) ? $_GET['day'] : null;
712
+		$search     = isset($_GET['s']) ? sanitize_text_field($_GET['s']) : null;
713
+		$start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null;
714
+		$end_date   = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : $start_date;
715
+
716
+		if ( ! empty($search)) {
717 717
 			$status = 'any'; // Force all payment statuses when searching.
718 718
 		}
719 719
 
720 720
 		$args = array(
721 721
 			'output'     => 'payments',
722 722
 			'number'     => $per_page,
723
-			'page'       => isset( $_GET['paged'] ) ? $_GET['paged'] : null,
723
+			'page'       => isset($_GET['paged']) ? $_GET['paged'] : null,
724 724
 			'orderby'    => $orderby,
725 725
 			'order'      => $order,
726 726
 			'user'       => $user,
@@ -734,12 +734,12 @@  discard block
 block discarded – undo
734 734
 			'end_date'   => $end_date,
735 735
 		);
736 736
 
737
-		if ( is_string( $search ) && false !== strpos( $search, 'txn:' ) ) {
737
+		if (is_string($search) && false !== strpos($search, 'txn:')) {
738 738
 			$args['search_in_notes'] = true;
739
-			$args['s']               = trim( str_replace( 'txn:', '', $args['s'] ) );
739
+			$args['s']               = trim(str_replace('txn:', '', $args['s']));
740 740
 		}
741 741
 
742
-		$p_query = new Give_Payments_Query( $args );
742
+		$p_query = new Give_Payments_Query($args);
743 743
 
744 744
 		return $p_query->get_payments();
745 745
 
@@ -759,17 +759,17 @@  discard block
 block discarded – undo
759 759
 	 */
760 760
 	public function prepare_items() {
761 761
 
762
-		wp_reset_vars( array( 'action', 'payment', 'orderby', 'order', 's' ) );
762
+		wp_reset_vars(array('action', 'payment', 'orderby', 'order', 's'));
763 763
 
764 764
 		$columns  = $this->get_columns();
765 765
 		$hidden   = array(); // No hidden columns.
766 766
 		$sortable = $this->get_sortable_columns();
767 767
 		$data     = $this->payments_data();
768
-		$status   = isset( $_GET['status'] ) ? $_GET['status'] : 'any';
768
+		$status   = isset($_GET['status']) ? $_GET['status'] : 'any';
769 769
 
770
-		$this->_column_headers = array( $columns, $hidden, $sortable );
770
+		$this->_column_headers = array($columns, $hidden, $sortable);
771 771
 
772
-		switch ( $status ) {
772
+		switch ($status) {
773 773
 			case 'publish':
774 774
 				$total_items = $this->complete_count;
775 775
 				break;
@@ -796,19 +796,19 @@  discard block
 block discarded – undo
796 796
 				break;
797 797
 			default:
798 798
 				// Retrieve the count of the non-default-Give status.
799
-				$count       = wp_count_posts( 'give_payment' );
800
-				$total_items = isset( $count->{$status} ) ? $count->{$status} : 0;
799
+				$count       = wp_count_posts('give_payment');
800
+				$total_items = isset($count->{$status} ) ? $count->{$status} : 0;
801 801
 				break;
802 802
 		}
803 803
 
804 804
 		$this->items = $data;
805 805
 
806
-		$this->set_pagination_args( array(
806
+		$this->set_pagination_args(array(
807 807
 				'total_items' => $total_items,
808 808
 				// We have to calculate the total number of items.
809 809
 				'per_page'    => $this->per_page,
810 810
 				// We have to determine how many items to show on a page.
811
-				'total_pages' => ceil( $total_items / $this->per_page ),
811
+				'total_pages' => ceil($total_items / $this->per_page),
812 812
 				// We have to calculate the total number of pages.
813 813
 			)
814 814
 		);
Please login to merge, or discard this patch.
includes/class-give-cache.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -205,7 +205,7 @@
 block discarded – undo
205 205
 	 *
206 206
 	 * @param bool $force If set to true then all cached values will be delete instead of only expired
207 207
 	 *
208
-	 * @return bool
208
+	 * @return false|null
209 209
 	 */
210 210
 	public static function delete_all_expired( $force = false ) {
211 211
 		global $wpdb;
Please login to merge, or discard this patch.
Spacing   +51 added lines, -51 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
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 * @return static
44 44
 	 */
45 45
 	public static function get_instance() {
46
-		if ( null === static::$instance ) {
46
+		if (null === static::$instance) {
47 47
 			self::$instance = new static();
48 48
 		}
49 49
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	 */
59 59
 	public function setup_hooks() {
60 60
 		// weekly delete all expired cache.
61
-		add_action( 'give_weekly_scheduled_events', array( $this, 'delete_all_expired' ) );
61
+		add_action('give_weekly_scheduled_events', array($this, 'delete_all_expired'));
62 62
 	}
63 63
 
64 64
 	/**
@@ -72,12 +72,12 @@  discard block
 block discarded – undo
72 72
 	 * @return string
73 73
 	 */
74 74
 
75
-	public static function get_key( $action, $query_args = null ) {
75
+	public static function get_key($action, $query_args = null) {
76 76
 		$cache_key = "give_cache_{$action}";
77 77
 
78 78
 		// Bailout.
79
-		if ( ! empty( $query_args ) ) {
80
-			$cache_key = "{$cache_key}_" . substr( md5( serialize( $query_args ) ), 0, 15 );
79
+		if ( ! empty($query_args)) {
80
+			$cache_key = "{$cache_key}_".substr(md5(serialize($query_args)), 0, 15);
81 81
 		}
82 82
 
83 83
 		return $cache_key;
@@ -95,26 +95,26 @@  discard block
 block discarded – undo
95 95
 	 * @return mixed
96 96
 	 */
97 97
 
98
-	public static function get( $cache_key, $custom_key = false, $query_args = array() ) {
99
-		if ( ! self::is_valid_cache_key( $cache_key ) ) {
100
-			if ( ! $custom_key ) {
101
-				return new WP_Error( 'give_invalid_cache_key', __( 'Cache key format should be give_cache_*', 'give' ) );
98
+	public static function get($cache_key, $custom_key = false, $query_args = array()) {
99
+		if ( ! self::is_valid_cache_key($cache_key)) {
100
+			if ( ! $custom_key) {
101
+				return new WP_Error('give_invalid_cache_key', __('Cache key format should be give_cache_*', 'give'));
102 102
 			}
103 103
 
104
-			$cache_key = self::get_key( $cache_key, $query_args );
104
+			$cache_key = self::get_key($cache_key, $query_args);
105 105
 		}
106 106
 
107
-		$option = get_option( $cache_key );
107
+		$option = get_option($cache_key);
108 108
 
109 109
 		// Backward compatibility (<1.8.7).
110
-		if ( ! is_array( $option ) || empty( $option ) || ! array_key_exists( 'expiration', $option ) ) {
110
+		if ( ! is_array($option) || empty($option) || ! array_key_exists('expiration', $option)) {
111 111
 			return $option;
112 112
 		}
113 113
 
114 114
 		// Get current time.
115
-		$current_time = current_time( 'timestamp', 1 );
115
+		$current_time = current_time('timestamp', 1);
116 116
 
117
-		if ( empty( $option['expiration'] ) || ( $current_time < $option['expiration'] ) ) {
117
+		if (empty($option['expiration']) || ($current_time < $option['expiration'])) {
118 118
 			$option = $option['data'];
119 119
 		} else {
120 120
 			$option = false;
@@ -137,23 +137,23 @@  discard block
 block discarded – undo
137 137
 	 * @return mixed
138 138
 	 */
139 139
 
140
-	public static function set( $cache_key, $data, $expiration = null, $custom_key = false, $query_args = array() ) {
141
-		if ( ! self::is_valid_cache_key( $cache_key ) ) {
142
-			if ( ! $custom_key ) {
143
-				return new WP_Error( 'give_invalid_cache_key', __( 'Cache key format should be give_cache_*', 'give' ) );
140
+	public static function set($cache_key, $data, $expiration = null, $custom_key = false, $query_args = array()) {
141
+		if ( ! self::is_valid_cache_key($cache_key)) {
142
+			if ( ! $custom_key) {
143
+				return new WP_Error('give_invalid_cache_key', __('Cache key format should be give_cache_*', 'give'));
144 144
 			}
145 145
 
146
-			$cache_key = self::get_key( $cache_key, $query_args );
146
+			$cache_key = self::get_key($cache_key, $query_args);
147 147
 		}
148 148
 
149 149
 		$option_value = array(
150 150
 			'data'       => $data,
151
-			'expiration' => ! is_null( $expiration )
152
-				? ( $expiration + current_time( 'timestamp', 1 ) )
151
+			'expiration' => ! is_null($expiration)
152
+				? ($expiration + current_time('timestamp', 1))
153 153
 				: null,
154 154
 		);
155 155
 
156
-		$result = update_option( $cache_key, $option_value, 'no' );
156
+		$result = update_option($cache_key, $option_value, 'no');
157 157
 
158 158
 		return $result;
159 159
 	}
@@ -168,27 +168,27 @@  discard block
 block discarded – undo
168 168
 	 * @return bool|WP_Error
169 169
 	 */
170 170
 
171
-	public static function delete( $cache_keys ) {
171
+	public static function delete($cache_keys) {
172 172
 		$result = true;
173 173
 		$invalid_keys = array();
174 174
 
175
-		if ( ! empty( $cache_keys ) ) {
176
-			$cache_keys = is_array( $cache_keys ) ? $cache_keys : array( $cache_keys );
175
+		if ( ! empty($cache_keys)) {
176
+			$cache_keys = is_array($cache_keys) ? $cache_keys : array($cache_keys);
177 177
 
178
-			foreach ( $cache_keys as $cache_key ) {
179
-				if ( ! self::is_valid_cache_key( $cache_key ) ) {
178
+			foreach ($cache_keys as $cache_key) {
179
+				if ( ! self::is_valid_cache_key($cache_key)) {
180 180
 					$invalid_keys[] = $cache_key;
181 181
 					$result = false;
182 182
 				}
183 183
 
184
-				delete_option( $cache_key );
184
+				delete_option($cache_key);
185 185
 			}
186 186
 		}
187 187
 
188
-		if( ! $result ) {
188
+		if ( ! $result) {
189 189
 			$result = new WP_Error(
190 190
 				'give_invalid_cache_key',
191
-					__( 'Cache key format should be give_cache_*', 'give' ),
191
+					__('Cache key format should be give_cache_*', 'give'),
192 192
 					$invalid_keys
193 193
 			);
194 194
 		}
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	 *
208 208
 	 * @return bool
209 209
 	 */
210
-	public static function delete_all_expired( $force = false ) {
210
+	public static function delete_all_expired($force = false) {
211 211
 		global $wpdb;
212 212
 		$options = $wpdb->get_results(
213 213
 			$wpdb->prepare(
@@ -221,30 +221,30 @@  discard block
 block discarded – undo
221 221
 		);
222 222
 
223 223
 		// Bailout.
224
-		if ( empty( $options ) ) {
224
+		if (empty($options)) {
225 225
 			return false;
226 226
 		}
227 227
 
228
-		$current_time = current_time( 'timestamp', 1 );
228
+		$current_time = current_time('timestamp', 1);
229 229
 
230 230
 		// Delete log cache.
231
-		foreach ( $options as $option ) {
232
-			$option['option_value'] = maybe_unserialize( $option['option_value'] );
231
+		foreach ($options as $option) {
232
+			$option['option_value'] = maybe_unserialize($option['option_value']);
233 233
 
234 234
 			if (
235 235
 				(
236
-					! self::is_valid_cache_key( $option['option_name'] )
237
-					|| ! is_array( $option['option_value'] ) // Backward compatibility (<1.8.7).
238
-					|| ! array_key_exists( 'expiration', $option['option_value'] ) // Backward compatibility (<1.8.7).
239
-					|| empty( $option['option_value']['expiration'] )
240
-					|| ( $current_time < $option['option_value']['expiration'] )
236
+					! self::is_valid_cache_key($option['option_name'])
237
+					|| ! is_array($option['option_value']) // Backward compatibility (<1.8.7).
238
+					|| ! array_key_exists('expiration', $option['option_value']) // Backward compatibility (<1.8.7).
239
+					|| empty($option['option_value']['expiration'])
240
+					|| ($current_time < $option['option_value']['expiration'])
241 241
 				)
242 242
 				&& ! $force
243 243
 			) {
244 244
 				continue;
245 245
 			}
246 246
 
247
-			self::delete( $option['option_name'] );
247
+			self::delete($option['option_name']);
248 248
 		}
249 249
 	}
250 250
 
@@ -260,16 +260,16 @@  discard block
 block discarded – undo
260 260
 	 *
261 261
 	 * @return array
262 262
 	 */
263
-	public static function get_options_like( $option_name, $fields = false ) {
263
+	public static function get_options_like($option_name, $fields = false) {
264 264
 		global $wpdb;
265 265
 
266
-		if ( empty( $option_name ) ) {
266
+		if (empty($option_name)) {
267 267
 			return array();
268 268
 		}
269 269
 
270 270
 		$field_names = $fields ? 'option_name, option_value' : 'option_name';
271 271
 
272
-		if ( $fields ) {
272
+		if ($fields) {
273 273
 			$options = $wpdb->get_results(
274 274
 				$wpdb->prepare(
275 275
 					"SELECT {$field_names }
@@ -293,10 +293,10 @@  discard block
 block discarded – undo
293 293
 			);
294 294
 		}
295 295
 
296
-		if ( ! empty( $options ) && $fields ) {
297
-			foreach ( $options as $index => $option ) {
298
-				$option['option_value'] = maybe_unserialize( $option['option_value'] );
299
-				$options[ $index ]      = $option;
296
+		if ( ! empty($options) && $fields) {
297
+			foreach ($options as $index => $option) {
298
+				$option['option_value'] = maybe_unserialize($option['option_value']);
299
+				$options[$index]      = $option;
300 300
 			}
301 301
 		}
302 302
 
@@ -313,8 +313,8 @@  discard block
 block discarded – undo
313 313
 	 *
314 314
 	 * @return bool|int
315 315
 	 */
316
-	public static function is_valid_cache_key( $cache_key ) {
317
-		return ( false !== strpos( $cache_key, 'give_cache_' ) );
316
+	public static function is_valid_cache_key($cache_key) {
317
+		return (false !== strpos($cache_key, 'give_cache_'));
318 318
 	}
319 319
 }
320 320
 
Please login to merge, or discard this patch.
uninstall.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -10,61 +10,61 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
13
+if ( ! defined('WP_UNINSTALL_PLUGIN')) {
14 14
 	exit;
15 15
 }
16 16
 
17 17
 // Load Give file.
18
-include_once( 'give.php' );
18
+include_once('give.php');
19 19
 
20 20
 global $wpdb, $wp_roles;
21 21
 
22 22
 
23
-if ( give_is_setting_enabled( give_get_option( 'uninstall_on_delete' ) ) ) {
23
+if (give_is_setting_enabled(give_get_option('uninstall_on_delete'))) {
24 24
 
25 25
 	// Delete All the Custom Post Types.
26
-	$give_taxonomies = array( 'form_category', 'form_tag', 'give_log_type' );
27
-	$give_post_types = array( 'give_forms', 'give_payment', 'give_log' );
28
-	foreach ( $give_post_types as $post_type ) {
26
+	$give_taxonomies = array('form_category', 'form_tag', 'give_log_type');
27
+	$give_post_types = array('give_forms', 'give_payment', 'give_log');
28
+	foreach ($give_post_types as $post_type) {
29 29
 
30
-		$give_taxonomies = array_merge( $give_taxonomies, get_object_taxonomies( $post_type ) );
31
-		$items           = get_posts( array(
30
+		$give_taxonomies = array_merge($give_taxonomies, get_object_taxonomies($post_type));
31
+		$items           = get_posts(array(
32 32
 			'post_type'   => $post_type,
33 33
 			'post_status' => 'any',
34
-			'numberposts' => - 1,
34
+			'numberposts' => -1,
35 35
 			'fields'      => 'ids',
36
-		) );
36
+		));
37 37
 
38
-		if ( $items ) {
39
-			foreach ( $items as $item ) {
40
-				wp_delete_post( $item, true );
38
+		if ($items) {
39
+			foreach ($items as $item) {
40
+				wp_delete_post($item, true);
41 41
 			}
42 42
 		}
43 43
 	}
44 44
 
45 45
 	// Delete All the Terms & Taxonomies.
46
-	foreach ( array_unique( array_filter( $give_taxonomies ) ) as $taxonomy ) {
46
+	foreach (array_unique(array_filter($give_taxonomies)) as $taxonomy) {
47 47
 
48
-		$terms = $wpdb->get_results( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('%s') ORDER BY t.name ASC", $taxonomy ) );
48
+		$terms = $wpdb->get_results($wpdb->prepare("SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('%s') ORDER BY t.name ASC", $taxonomy));
49 49
 
50 50
 		// Delete Terms.
51
-		if ( $terms ) {
52
-			foreach ( $terms as $term ) {
53
-				$wpdb->delete( $wpdb->term_taxonomy, array( 'term_taxonomy_id' => $term->term_taxonomy_id ) );
54
-				$wpdb->delete( $wpdb->terms, array( 'term_id' => $term->term_id ) );
51
+		if ($terms) {
52
+			foreach ($terms as $term) {
53
+				$wpdb->delete($wpdb->term_taxonomy, array('term_taxonomy_id' => $term->term_taxonomy_id));
54
+				$wpdb->delete($wpdb->terms, array('term_id' => $term->term_id));
55 55
 			}
56 56
 		}
57 57
 
58 58
 		// Delete Taxonomies.
59
-		$wpdb->delete( $wpdb->term_taxonomy, array( 'taxonomy' => $taxonomy ), array( '%s' ) );
59
+		$wpdb->delete($wpdb->term_taxonomy, array('taxonomy' => $taxonomy), array('%s'));
60 60
 	}
61 61
 
62 62
 	// Delete the Plugin Pages.
63
-	$give_created_pages = array( 'success_page', 'failure_page', 'history_page' );
64
-	foreach ( $give_created_pages as $p ) {
65
-		$page = give_get_option( $p, false );
66
-		if ( $page ) {
67
-			wp_delete_post( $page, true );
63
+	$give_created_pages = array('success_page', 'failure_page', 'history_page');
64
+	foreach ($give_created_pages as $p) {
65
+		$page = give_get_option($p, false);
66
+		if ($page) {
67
+			wp_delete_post($page, true);
68 68
 		}
69 69
 	}
70 70
 
@@ -72,20 +72,20 @@  discard block
 block discarded – undo
72 72
 	Give()->roles->remove_caps();
73 73
 
74 74
 	// Delete the Roles.
75
-	$give_roles = array( 'give_manager', 'give_accountant', 'give_worker' );
76
-	foreach ( $give_roles as $role ) {
77
-		remove_role( $role );
75
+	$give_roles = array('give_manager', 'give_accountant', 'give_worker');
76
+	foreach ($give_roles as $role) {
77
+		remove_role($role);
78 78
 	}
79 79
 
80 80
 	// Remove all database tables.
81
-	$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_donors' );
82
-	$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_customers' );
83
-	$wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . 'give_customermeta' );
81
+	$wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_donors');
82
+	$wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_customers');
83
+	$wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'give_customermeta');
84 84
 
85 85
 	// Cleanup Cron Events.
86
-	wp_clear_scheduled_hook( 'give_daily_scheduled_events' );
87
-	wp_clear_scheduled_hook( 'give_daily_cron' );
88
-	wp_clear_scheduled_hook( 'give_weekly_cron' );
86
+	wp_clear_scheduled_hook('give_daily_scheduled_events');
87
+	wp_clear_scheduled_hook('give_daily_cron');
88
+	wp_clear_scheduled_hook('give_weekly_cron');
89 89
 
90 90
 	// Get all options.
91 91
 	$give_option_names = $wpdb->get_col(
@@ -95,16 +95,16 @@  discard block
 block discarded – undo
95 95
 		)
96 96
 	);
97 97
 
98
-	if ( ! empty( $give_option_names ) ) {
98
+	if ( ! empty($give_option_names)) {
99 99
 		// Convert option name to transient or option name.
100 100
 		$new_give_option_names = array();
101 101
 
102 102
 		// Delete all the Plugin Options.
103
-		foreach ( $give_option_names as $option ) {
104
-			if ( false !== strpos( $option, 'give_cache' ) ) {
105
-				Give_Cache::delete( $option );
103
+		foreach ($give_option_names as $option) {
104
+			if (false !== strpos($option, 'give_cache')) {
105
+				Give_Cache::delete($option);
106 106
 			} else {
107
-				delete_option( $option );
107
+				delete_option($option);
108 108
 			}
109 109
 		}
110 110
 	}
Please login to merge, or discard this patch.
includes/ajax-functions.php 1 patch
Spacing   +106 added lines, -106 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
 
@@ -26,26 +26,26 @@  discard block
 block discarded – undo
26 26
 function give_test_ajax_works() {
27 27
 
28 28
 	// Check if the Airplane Mode plugin is installed
29
-	if ( class_exists( 'Airplane_Mode_Core' ) ) {
29
+	if (class_exists('Airplane_Mode_Core')) {
30 30
 
31 31
 		$airplane = Airplane_Mode_Core::getInstance();
32 32
 
33
-		if ( method_exists( $airplane, 'enabled' ) ) {
33
+		if (method_exists($airplane, 'enabled')) {
34 34
 
35
-			if ( $airplane->enabled() ) {
35
+			if ($airplane->enabled()) {
36 36
 				return true;
37 37
 			}
38 38
 		} else {
39 39
 
40
-			if ( $airplane->check_status() == 'on' ) {
40
+			if ($airplane->check_status() == 'on') {
41 41
 				return true;
42 42
 			}
43 43
 		}
44 44
 	}
45 45
 
46
-	add_filter( 'block_local_requests', '__return_false' );
46
+	add_filter('block_local_requests', '__return_false');
47 47
 
48
-	if ( Give_Cache::get( '_give_ajax_works', true ) ) {
48
+	if (Give_Cache::get('_give_ajax_works', true)) {
49 49
 		return true;
50 50
 	}
51 51
 
@@ -57,35 +57,35 @@  discard block
 block discarded – undo
57 57
 		),
58 58
 	);
59 59
 
60
-	$ajax = wp_remote_post( give_get_ajax_url(), $params );
60
+	$ajax = wp_remote_post(give_get_ajax_url(), $params);
61 61
 
62 62
 	$works = true;
63 63
 
64
-	if ( is_wp_error( $ajax ) ) {
64
+	if (is_wp_error($ajax)) {
65 65
 
66 66
 		$works = false;
67 67
 
68 68
 	} else {
69 69
 
70
-		if ( empty( $ajax['response'] ) ) {
70
+		if (empty($ajax['response'])) {
71 71
 			$works = false;
72 72
 		}
73 73
 
74
-		if ( empty( $ajax['response']['code'] ) || 200 !== (int) $ajax['response']['code'] ) {
74
+		if (empty($ajax['response']['code']) || 200 !== (int) $ajax['response']['code']) {
75 75
 			$works = false;
76 76
 		}
77 77
 
78
-		if ( empty( $ajax['response']['message'] ) || 'OK' !== $ajax['response']['message'] ) {
78
+		if (empty($ajax['response']['message']) || 'OK' !== $ajax['response']['message']) {
79 79
 			$works = false;
80 80
 		}
81 81
 
82
-		if ( ! isset( $ajax['body'] ) || 0 !== (int) $ajax['body'] ) {
82
+		if ( ! isset($ajax['body']) || 0 !== (int) $ajax['body']) {
83 83
 			$works = false;
84 84
 		}
85 85
 	}
86 86
 
87
-	if ( $works ) {
88
-		Give_Cache::set( '_give_ajax_works', '1', DAY_IN_SECONDS, true );
87
+	if ($works) {
88
+		Give_Cache::set('_give_ajax_works', '1', DAY_IN_SECONDS, true);
89 89
 	}
90 90
 
91 91
 	return $works;
@@ -100,16 +100,16 @@  discard block
 block discarded – undo
100 100
  * @return string
101 101
  */
102 102
 function give_get_ajax_url() {
103
-	$scheme = defined( 'FORCE_SSL_ADMIN' ) && FORCE_SSL_ADMIN ? 'https' : 'admin';
103
+	$scheme = defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN ? 'https' : 'admin';
104 104
 
105 105
 	$current_url = give_get_current_page_url();
106
-	$ajax_url    = admin_url( 'admin-ajax.php', $scheme );
106
+	$ajax_url    = admin_url('admin-ajax.php', $scheme);
107 107
 
108
-	if ( preg_match( '/^https/', $current_url ) && ! preg_match( '/^https/', $ajax_url ) ) {
109
-		$ajax_url = preg_replace( '/^http/', 'https', $ajax_url );
108
+	if (preg_match('/^https/', $current_url) && ! preg_match('/^https/', $ajax_url)) {
109
+		$ajax_url = preg_replace('/^http/', 'https', $ajax_url);
110 110
 	}
111 111
 
112
-	return apply_filters( 'give_ajax_url', $ajax_url );
112
+	return apply_filters('give_ajax_url', $ajax_url);
113 113
 }
114 114
 
115 115
 /**
@@ -125,12 +125,12 @@  discard block
 block discarded – undo
125 125
 	 *
126 126
 	 * @since 1.7
127 127
 	 */
128
-	do_action( 'give_donation_form_login_fields' );
128
+	do_action('give_donation_form_login_fields');
129 129
 
130 130
 	give_die();
131 131
 }
132 132
 
133
-add_action( 'wp_ajax_nopriv_give_checkout_login', 'give_load_checkout_login_fields' );
133
+add_action('wp_ajax_nopriv_give_checkout_login', 'give_load_checkout_login_fields');
134 134
 
135 135
 /**
136 136
  * Load Checkout Fields
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
  * @return void
141 141
  */
142 142
 function give_load_checkout_fields() {
143
-	$form_id = isset( $_POST['form_id'] ) ? $_POST['form_id'] : '';
143
+	$form_id = isset($_POST['form_id']) ? $_POST['form_id'] : '';
144 144
 
145 145
 	ob_start();
146 146
 
@@ -149,18 +149,18 @@  discard block
 block discarded – undo
149 149
 	 *
150 150
 	 * @since 1.7
151 151
 	 */
152
-	do_action( 'give_donation_form_register_login_fields', $form_id );
152
+	do_action('give_donation_form_register_login_fields', $form_id);
153 153
 
154 154
 	$fields = ob_get_clean();
155 155
 
156
-	wp_send_json( array(
157
-		'fields' => wp_json_encode( $fields ),
158
-		'submit' => wp_json_encode( give_checkout_button_purchase( $form_id ) ),
159
-	) );
156
+	wp_send_json(array(
157
+		'fields' => wp_json_encode($fields),
158
+		'submit' => wp_json_encode(give_checkout_button_purchase($form_id)),
159
+	));
160 160
 }
161 161
 
162
-add_action( 'wp_ajax_nopriv_give_cancel_login', 'give_load_checkout_fields' );
163
-add_action( 'wp_ajax_nopriv_give_checkout_register', 'give_load_checkout_fields' );
162
+add_action('wp_ajax_nopriv_give_cancel_login', 'give_load_checkout_fields');
163
+add_action('wp_ajax_nopriv_give_checkout_register', 'give_load_checkout_fields');
164 164
 
165 165
 /**
166 166
  * Get Form Title via AJAX (used only in WordPress Admin)
@@ -170,9 +170,9 @@  discard block
 block discarded – undo
170 170
  * @return void
171 171
  */
172 172
 function give_ajax_get_form_title() {
173
-	if ( isset( $_POST['form_id'] ) ) {
174
-		$title = get_the_title( $_POST['form_id'] );
175
-		if ( $title ) {
173
+	if (isset($_POST['form_id'])) {
174
+		$title = get_the_title($_POST['form_id']);
175
+		if ($title) {
176 176
 			echo $title;
177 177
 		} else {
178 178
 			echo 'fail';
@@ -181,8 +181,8 @@  discard block
 block discarded – undo
181 181
 	give_die();
182 182
 }
183 183
 
184
-add_action( 'wp_ajax_give_get_form_title', 'give_ajax_get_form_title' );
185
-add_action( 'wp_ajax_nopriv_give_get_form_title', 'give_ajax_get_form_title' );
184
+add_action('wp_ajax_give_get_form_title', 'give_ajax_get_form_title');
185
+add_action('wp_ajax_nopriv_give_get_form_title', 'give_ajax_get_form_title');
186 186
 
187 187
 /**
188 188
  * Retrieve a states drop down
@@ -193,23 +193,23 @@  discard block
 block discarded – undo
193 193
  */
194 194
 function give_ajax_get_states_field() {
195 195
 
196
-	if ( empty( $_POST['country'] ) ) {
196
+	if (empty($_POST['country'])) {
197 197
 		$_POST['country'] = give_get_country();
198 198
 	}
199
-	$states = give_get_states( $_POST['country'] );
199
+	$states = give_get_states($_POST['country']);
200 200
 
201
-	if ( ! empty( $states ) ) {
201
+	if ( ! empty($states)) {
202 202
 
203 203
 		$args = array(
204 204
 			'name'             => $_POST['field_name'],
205 205
 			'id'               => $_POST['field_name'],
206
-			'class'            => $_POST['field_name'] . '  give-select',
207
-			'options'          => give_get_states( $_POST['country'] ),
206
+			'class'            => $_POST['field_name'].'  give-select',
207
+			'options'          => give_get_states($_POST['country']),
208 208
 			'show_option_all'  => false,
209 209
 			'show_option_none' => false,
210 210
 		);
211 211
 
212
-		$response = Give()->html->select( $args );
212
+		$response = Give()->html->select($args);
213 213
 
214 214
 	} else {
215 215
 
@@ -221,8 +221,8 @@  discard block
 block discarded – undo
221 221
 	give_die();
222 222
 }
223 223
 
224
-add_action( 'wp_ajax_give_get_states', 'give_ajax_get_states_field' );
225
-add_action( 'wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field' );
224
+add_action('wp_ajax_give_get_states', 'give_ajax_get_states_field');
225
+add_action('wp_ajax_nopriv_give_get_states', 'give_ajax_get_states_field');
226 226
 
227 227
 /**
228 228
  * Retrieve a states drop down
@@ -234,17 +234,17 @@  discard block
 block discarded – undo
234 234
 function give_ajax_form_search() {
235 235
 	global $wpdb;
236 236
 
237
-	$search  = esc_sql( sanitize_text_field( $_GET['s'] ) );
237
+	$search  = esc_sql(sanitize_text_field($_GET['s']));
238 238
 	$results = array();
239
-	if ( current_user_can( 'edit_give_forms' ) ) {
240
-		$items = $wpdb->get_results( "SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50" );
239
+	if (current_user_can('edit_give_forms')) {
240
+		$items = $wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_title` LIKE '%$search%' LIMIT 50");
241 241
 	} else {
242
-		$items = $wpdb->get_results( "SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_status` = 'publish' AND `post_title` LIKE '%$search%' LIMIT 50" );
242
+		$items = $wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts WHERE `post_type` = 'give_forms' AND `post_status` = 'publish' AND `post_title` LIKE '%$search%' LIMIT 50");
243 243
 	}
244 244
 
245
-	if ( $items ) {
245
+	if ($items) {
246 246
 
247
-		foreach ( $items as $item ) {
247
+		foreach ($items as $item) {
248 248
 
249 249
 			$results[] = array(
250 250
 				'id'   => $item->ID,
@@ -255,18 +255,18 @@  discard block
 block discarded – undo
255 255
 
256 256
 		$items[] = array(
257 257
 			'id'   => 0,
258
-			'name' => esc_html__( 'No forms found.', 'give' ),
258
+			'name' => esc_html__('No forms found.', 'give'),
259 259
 		);
260 260
 
261 261
 	}
262 262
 
263
-	echo json_encode( $results );
263
+	echo json_encode($results);
264 264
 
265 265
 	give_die();
266 266
 }
267 267
 
268
-add_action( 'wp_ajax_give_form_search', 'give_ajax_form_search' );
269
-add_action( 'wp_ajax_nopriv_give_form_search', 'give_ajax_form_search' );
268
+add_action('wp_ajax_give_form_search', 'give_ajax_form_search');
269
+add_action('wp_ajax_nopriv_give_form_search', 'give_ajax_form_search');
270 270
 
271 271
 /**
272 272
  * Search the donors database via Ajax
@@ -278,38 +278,38 @@  discard block
 block discarded – undo
278 278
 function give_ajax_donor_search() {
279 279
 	global $wpdb;
280 280
 
281
-	$search  = esc_sql( sanitize_text_field( $_GET['s'] ) );
281
+	$search  = esc_sql(sanitize_text_field($_GET['s']));
282 282
 	$results = array();
283
-	if ( ! current_user_can( 'view_give_reports' ) ) {
283
+	if ( ! current_user_can('view_give_reports')) {
284 284
 		$donors = array();
285 285
 	} else {
286
-		$donors = $wpdb->get_results( "SELECT id,name,email FROM {$wpdb->prefix}give_donors WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50" );
286
+		$donors = $wpdb->get_results("SELECT id,name,email FROM {$wpdb->prefix}give_donors WHERE `name` LIKE '%$search%' OR `email` LIKE '%$search%' LIMIT 50");
287 287
 	}
288 288
 
289
-	if ( $donors ) {
289
+	if ($donors) {
290 290
 
291
-		foreach ( $donors as $donor ) {
291
+		foreach ($donors as $donor) {
292 292
 
293 293
 			$results[] = array(
294 294
 				'id'   => $donor->id,
295
-				'name' => $donor->name . '(' . $donor->email . ')',
295
+				'name' => $donor->name.'('.$donor->email.')',
296 296
 			);
297 297
 		}
298 298
 	} else {
299 299
 
300 300
 		$donors[] = array(
301 301
 			'id'   => 0,
302
-			'name' => esc_html__( 'No donors found.', 'give' ),
302
+			'name' => esc_html__('No donors found.', 'give'),
303 303
 		);
304 304
 
305 305
 	}
306 306
 
307
-	echo json_encode( $results );
307
+	echo json_encode($results);
308 308
 
309 309
 	give_die();
310 310
 }
311 311
 
312
-add_action( 'wp_ajax_give_donor_search', 'give_ajax_donor_search' );
312
+add_action('wp_ajax_give_donor_search', 'give_ajax_donor_search');
313 313
 
314 314
 
315 315
 /**
@@ -321,42 +321,42 @@  discard block
 block discarded – undo
321 321
  */
322 322
 function give_ajax_search_users() {
323 323
 
324
-	if ( current_user_can( 'manage_give_settings' ) ) {
324
+	if (current_user_can('manage_give_settings')) {
325 325
 
326
-		$search_query = trim( $_POST['user_name'] );
327
-		$exclude      = trim( $_POST['exclude'] );
326
+		$search_query = trim($_POST['user_name']);
327
+		$exclude      = trim($_POST['exclude']);
328 328
 
329 329
 		$get_users_args = array(
330 330
 			'number' => 9999,
331
-			'search' => $search_query . '*',
331
+			'search' => $search_query.'*',
332 332
 		);
333 333
 
334
-		if ( ! empty( $exclude ) ) {
335
-			$exclude_array             = explode( ',', $exclude );
334
+		if ( ! empty($exclude)) {
335
+			$exclude_array             = explode(',', $exclude);
336 336
 			$get_users_args['exclude'] = $exclude_array;
337 337
 		}
338 338
 
339
-		$get_users_args = apply_filters( 'give_search_users_args', $get_users_args );
339
+		$get_users_args = apply_filters('give_search_users_args', $get_users_args);
340 340
 
341
-		$found_users = apply_filters( 'give_ajax_found_users', get_users( $get_users_args ), $search_query );
341
+		$found_users = apply_filters('give_ajax_found_users', get_users($get_users_args), $search_query);
342 342
 
343 343
 		$user_list = '<ul>';
344
-		if ( $found_users ) {
345
-			foreach ( $found_users as $user ) {
346
-				$user_list .= '<li><a href="#" data-userid="' . esc_attr( $user->ID ) . '" data-login="' . esc_attr( $user->user_login ) . '">' . esc_html( $user->user_login ) . '</a></li>';
344
+		if ($found_users) {
345
+			foreach ($found_users as $user) {
346
+				$user_list .= '<li><a href="#" data-userid="'.esc_attr($user->ID).'" data-login="'.esc_attr($user->user_login).'">'.esc_html($user->user_login).'</a></li>';
347 347
 			}
348 348
 		} else {
349
-			$user_list .= '<li>' . esc_html__( 'No users found.', 'give' ) . '</li>';
349
+			$user_list .= '<li>'.esc_html__('No users found.', 'give').'</li>';
350 350
 		}
351 351
 		$user_list .= '</ul>';
352 352
 
353
-		echo json_encode( array( 'results' => $user_list ) );
353
+		echo json_encode(array('results' => $user_list));
354 354
 
355 355
 	}
356 356
 	die();
357 357
 }
358 358
 
359
-add_action( 'wp_ajax_give_search_users', 'give_ajax_search_users' );
359
+add_action('wp_ajax_give_search_users', 'give_ajax_search_users');
360 360
 
361 361
 
362 362
 /**
@@ -368,32 +368,32 @@  discard block
 block discarded – undo
368 368
  */
369 369
 function give_check_for_form_price_variations() {
370 370
 
371
-	if ( ! current_user_can( 'edit_give_forms', get_current_user_id() ) ) {
372
-		die( '-1' );
371
+	if ( ! current_user_can('edit_give_forms', get_current_user_id())) {
372
+		die('-1');
373 373
 	}
374 374
 
375
-	$form_id = intval( $_POST['form_id'] );
376
-	$form    = get_post( $form_id );
375
+	$form_id = intval($_POST['form_id']);
376
+	$form    = get_post($form_id);
377 377
 
378
-	if ( 'give_forms' != $form->post_type ) {
379
-		die( '-2' );
378
+	if ('give_forms' != $form->post_type) {
379
+		die('-2');
380 380
 	}
381 381
 
382
-	if ( give_has_variable_prices( $form_id ) ) {
383
-		$variable_prices = give_get_variable_prices( $form_id );
382
+	if (give_has_variable_prices($form_id)) {
383
+		$variable_prices = give_get_variable_prices($form_id);
384 384
 
385
-		if ( $variable_prices ) {
385
+		if ($variable_prices) {
386 386
 			$ajax_response = '<select class="give_price_options_select give-select give-select" name="give_price_option">';
387 387
 
388
-			if ( isset( $_POST['all_prices'] ) ) {
389
-				$ajax_response .= '<option value="all">' . esc_html__( 'All Levels', 'give' ) . '</option>';
388
+			if (isset($_POST['all_prices'])) {
389
+				$ajax_response .= '<option value="all">'.esc_html__('All Levels', 'give').'</option>';
390 390
 			}
391 391
 
392
-			foreach ( $variable_prices as $key => $price ) {
392
+			foreach ($variable_prices as $key => $price) {
393 393
 
394
-				$level_text = ! empty( $price['_give_text'] ) ? esc_html( $price['_give_text'] ) : give_currency_filter( give_format_amount( $price['_give_amount'] ) );
394
+				$level_text = ! empty($price['_give_text']) ? esc_html($price['_give_text']) : give_currency_filter(give_format_amount($price['_give_amount']));
395 395
 
396
-				$ajax_response .= '<option value="' . esc_attr( $price['_give_id']['level_id'] ) . '">' . $level_text . '</option>';
396
+				$ajax_response .= '<option value="'.esc_attr($price['_give_id']['level_id']).'">'.$level_text.'</option>';
397 397
 			}
398 398
 			$ajax_response .= '</select>';
399 399
 			echo $ajax_response;
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 	give_die();
404 404
 }
405 405
 
406
-add_action( 'wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations' );
406
+add_action('wp_ajax_give_check_for_form_price_variations', 'give_check_for_form_price_variations');
407 407
 
408 408
 
409 409
 /**
@@ -414,25 +414,25 @@  discard block
 block discarded – undo
414 414
  * @return void
415 415
  */
416 416
 function give_check_for_form_price_variations_html() {
417
-	if ( ! current_user_can( 'edit_give_payments', get_current_user_id() ) ) {
417
+	if ( ! current_user_can('edit_give_payments', get_current_user_id())) {
418 418
 		wp_die();
419 419
 	}
420 420
 
421
-	$form_id    = ! empty( $_POST['form_id']  ) ? intval( $_POST['form_id'] ) : 0;
422
-	$payment_id = ! empty( $_POST['payment_id'] ) ? intval( $_POST['payment_id'] ) : 0;
423
-	$form       = get_post( $form_id );
421
+	$form_id    = ! empty($_POST['form_id']) ? intval($_POST['form_id']) : 0;
422
+	$payment_id = ! empty($_POST['payment_id']) ? intval($_POST['payment_id']) : 0;
423
+	$form       = get_post($form_id);
424 424
 
425
-	if ( 'give_forms' != $form->post_type ) {
425
+	if ('give_forms' != $form->post_type) {
426 426
 		wp_die();
427 427
 	}
428 428
 
429
-	if ( ! give_has_variable_prices( $form_id ) || ! $form_id ) {
430
-		esc_html_e( 'n/a', 'give' );
429
+	if ( ! give_has_variable_prices($form_id) || ! $form_id) {
430
+		esc_html_e('n/a', 'give');
431 431
 	} else {
432 432
 		$prices_atts = '';
433
-		if( $variable_prices = give_get_variable_prices( $form_id ) ) {
434
-			foreach ( $variable_prices as $variable_price ) {
435
-				$prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount( $variable_price['_give_amount'] );
433
+		if ($variable_prices = give_get_variable_prices($form_id)) {
434
+			foreach ($variable_prices as $variable_price) {
435
+				$prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount($variable_price['_give_amount']);
436 436
 			}
437 437
 		}
438 438
 
@@ -443,12 +443,12 @@  discard block
 block discarded – undo
443 443
 			'chosen'           => true,
444 444
 			'show_option_all'  => '',
445 445
 			'show_option_none' => '',
446
-			'select_atts'      => 'data-prices=' . esc_attr( json_encode( $prices_atts ) ),
446
+			'select_atts'      => 'data-prices='.esc_attr(json_encode($prices_atts)),
447 447
 		);
448 448
 
449
-		if( $payment_id ) {
449
+		if ($payment_id) {
450 450
 			// Payment object.
451
-			$payment = new Give_Payment( $payment_id );
451
+			$payment = new Give_Payment($payment_id);
452 452
 
453 453
 			// Payment meta.
454 454
 			$payment_meta = $payment->get_meta();
@@ -456,10 +456,10 @@  discard block
 block discarded – undo
456 456
 		}
457 457
 
458 458
 		// Render variable prices select tag html.
459
-		give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true );
459
+		give_get_form_variable_price_dropdown($variable_price_dropdown_option, true);
460 460
 	}
461 461
 
462 462
 	give_die();
463 463
 }
464 464
 
465
-add_action( 'wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html' );
465
+add_action('wp_ajax_give_check_for_form_price_variations_html', 'give_check_for_form_price_variations_html');
Please login to merge, or discard this patch.