Test Failed
Pull Request — master (#1972)
by Ravinder
05:01
created
includes/admin/settings/class-settings-email.php 2 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -79,13 +79,13 @@  discard block
 block discarded – undo
79 79
 							'default' => get_bloginfo( 'admin_email' ),
80 80
 							'type'    => 'text'
81 81
 						),
82
-                        array(
83
-                            'name'  => esc_html__( 'Email Settings Docs Link', 'give' ),
84
-                            'id'    => 'email_settings_docs_link',
85
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-emails' ),
86
-                            'title' => __( 'Email Settings', 'give' ),
87
-                            'type'  => 'give_docs_link',
88
-                        ),
82
+						array(
83
+							'name'  => esc_html__( 'Email Settings Docs Link', 'give' ),
84
+							'id'    => 'email_settings_docs_link',
85
+							'url'   => esc_url( 'http://docs.givewp.com/settings-emails' ),
86
+							'title' => __( 'Email Settings', 'give' ),
87
+							'type'  => 'give_docs_link',
88
+						),
89 89
 						array(
90 90
 							'id'   => 'give_title_email_settings_1',
91 91
 							'type' => 'sectionend'
@@ -118,13 +118,13 @@  discard block
 block discarded – undo
118 118
 							'type'    => 'wysiwyg',
119 119
 							'default' => give_get_default_donation_receipt_email()
120 120
 						),
121
-                        array(
122
-                            'name'  => esc_html__( 'Donation Receipt Settings Docs Link', 'give' ),
123
-                            'id'    => 'donation_receipt_settings_docs_link',
124
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-donation-receipt' ),
125
-                            'title' => __( 'Donation Receipt Settings', 'give' ),
126
-                            'type'  => 'give_docs_link',
127
-                        ),
121
+						array(
122
+							'name'  => esc_html__( 'Donation Receipt Settings Docs Link', 'give' ),
123
+							'id'    => 'donation_receipt_settings_docs_link',
124
+							'url'   => esc_url( 'http://docs.givewp.com/settings-donation-receipt' ),
125
+							'title' => __( 'Donation Receipt Settings', 'give' ),
126
+							'type'  => 'give_docs_link',
127
+						),
128 128
 						array(
129 129
 							'id'   => 'give_title_email_settings_2',
130 130
 							'type' => 'sectionend'
@@ -175,13 +175,13 @@  discard block
 block discarded – undo
175 175
 							'type'    => 'textarea',
176 176
 							'default' => get_bloginfo( 'admin_email' )
177 177
 						),
178
-                        array(
179
-                            'name'  => esc_html__( 'Donation Notification Settings Docs Link', 'give' ),
180
-                            'id'    => 'donation_notification_settings_docs_link',
181
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-donation-notification' ),
182
-                            'title' => __( 'Donation Notification Settings', 'give' ),
183
-                            'type'  => 'give_docs_link',
184
-                        ),
178
+						array(
179
+							'name'  => esc_html__( 'Donation Notification Settings Docs Link', 'give' ),
180
+							'id'    => 'donation_notification_settings_docs_link',
181
+							'url'   => esc_url( 'http://docs.givewp.com/settings-donation-notification' ),
182
+							'title' => __( 'Donation Notification Settings', 'give' ),
183
+							'type'  => 'give_docs_link',
184
+						),
185 185
 						array(
186 186
 							'id'   => 'give_title_email_settings_3',
187 187
 							'type' => 'sectionend'
Please login to merge, or discard this patch.
Spacing   +46 added lines, -46 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_Email' ) ) :
16
+if ( ! class_exists('Give_Settings_Email')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Email.
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		 */
28 28
 		public function __construct() {
29 29
 			$this->id    = 'emails';
30
-			$this->label = esc_html__( 'Emails', 'give' );
30
+			$this->label = esc_html__('Emails', 'give');
31 31
 
32 32
 			$this->default_tab = 'email-settings';
33 33
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			$settings = array();
45 45
 			$current_section = give_get_current_setting_section();
46 46
 
47
-			switch ( $current_section ) {
47
+			switch ($current_section) {
48 48
 				case 'email-settings' :
49 49
 					$settings = array(
50 50
 						// Section 1: Email
@@ -54,36 +54,36 @@  discard block
 block discarded – undo
54 54
 						),
55 55
 						array(
56 56
 							'id'      => 'email_template',
57
-							'name'    => esc_html__( 'Email Template', 'give' ),
58
-							'desc'    => esc_html__( 'Choose your template from the available registered template types.', 'give' ),
57
+							'name'    => esc_html__('Email Template', 'give'),
58
+							'desc'    => esc_html__('Choose your template from the available registered template types.', 'give'),
59 59
 							'type'    => 'select',
60 60
 							'options' => give_get_email_templates()
61 61
 						),
62 62
 						array(
63 63
 							'id'   => 'email_logo',
64
-							'name' => esc_html__( 'Logo', 'give' ),
65
-							'desc' => esc_html__( 'Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give' ),
64
+							'name' => esc_html__('Logo', 'give'),
65
+							'desc' => esc_html__('Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give'),
66 66
 							'type' => 'file'
67 67
 						),
68 68
 						array(
69 69
 							'id'      => 'from_name',
70
-							'name'    => esc_html__( 'From Name', 'give' ),
71
-							'desc'    => esc_html__( 'The name which appears in the "From" field in all Give donation emails.', 'give' ),
72
-							'default' => get_bloginfo( 'name' ),
70
+							'name'    => esc_html__('From Name', 'give'),
71
+							'desc'    => esc_html__('The name which appears in the "From" field in all Give donation emails.', 'give'),
72
+							'default' => get_bloginfo('name'),
73 73
 							'type'    => 'text'
74 74
 						),
75 75
 						array(
76 76
 							'id'      => 'from_email',
77
-							'name'    => esc_html__( 'From Email', 'give' ),
78
-							'desc'    => esc_html__( 'Email address from which all Give emails are sent from. This will act as the "from" and "reply-to" email address.', 'give' ),
79
-							'default' => get_bloginfo( 'admin_email' ),
77
+							'name'    => esc_html__('From Email', 'give'),
78
+							'desc'    => esc_html__('Email address from which all Give emails are sent from. This will act as the "from" and "reply-to" email address.', 'give'),
79
+							'default' => get_bloginfo('admin_email'),
80 80
 							'type'    => 'text'
81 81
 						),
82 82
                         array(
83
-                            'name'  => esc_html__( 'Email Settings Docs Link', 'give' ),
83
+                            'name'  => esc_html__('Email Settings Docs Link', 'give'),
84 84
                             'id'    => 'email_settings_docs_link',
85
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-emails' ),
86
-                            'title' => __( 'Email Settings', 'give' ),
85
+                            'url'   => esc_url('http://docs.givewp.com/settings-emails'),
86
+                            'title' => __('Email Settings', 'give'),
87 87
                             'type'  => 'give_docs_link',
88 88
                         ),
89 89
 						array(
@@ -102,27 +102,27 @@  discard block
 block discarded – undo
102 102
 						),
103 103
 						array(
104 104
 							'id'      => 'donation_subject',
105
-							'name'    => esc_html__( 'Donation Email Subject', 'give' ),
106
-							'desc'    => esc_html__( 'Enter the subject line for the donation receipt email.', 'give' ),
107
-							'default' => esc_attr__( 'Donation Receipt', 'give' ),
105
+							'name'    => esc_html__('Donation Email Subject', 'give'),
106
+							'desc'    => esc_html__('Enter the subject line for the donation receipt email.', 'give'),
107
+							'default' => esc_attr__('Donation Receipt', 'give'),
108 108
 							'type'    => 'text'
109 109
 						),
110 110
 						array(
111 111
 							'id'      => 'donation_receipt',
112
-							'name'    => esc_html__( 'Donation Receipt', 'give' ),
112
+							'name'    => esc_html__('Donation Receipt', 'give'),
113 113
 							'desc'    => sprintf(
114 114
 							/* translators: %s: emails tags list */
115
-								__( 'Enter the email that is sent to users after completing a successful donation. HTML is accepted.<br /><strong>Available template tags:</strong> %s', 'give' ),
115
+								__('Enter the email that is sent to users after completing a successful donation. HTML is accepted.<br /><strong>Available template tags:</strong> %s', 'give'),
116 116
 								'<br/>'.give_get_emails_tags_list()
117 117
 							),
118 118
 							'type'    => 'wysiwyg',
119 119
 							'default' => give_get_default_donation_receipt_email()
120 120
 						),
121 121
                         array(
122
-                            'name'  => esc_html__( 'Donation Receipt Settings Docs Link', 'give' ),
122
+                            'name'  => esc_html__('Donation Receipt Settings Docs Link', 'give'),
123 123
                             'id'    => 'donation_receipt_settings_docs_link',
124
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-donation-receipt' ),
125
-                            'title' => __( 'Donation Receipt Settings', 'give' ),
124
+                            'url'   => esc_url('http://docs.givewp.com/settings-donation-receipt'),
125
+                            'title' => __('Donation Receipt Settings', 'give'),
126 126
                             'type'  => 'give_docs_link',
127 127
                         ),
128 128
 						array(
@@ -141,28 +141,28 @@  discard block
 block discarded – undo
141 141
 						),
142 142
 						array(
143 143
 							'id'      => 'admin_notices',
144
-							'name'    => esc_html__( 'Admin Notifications', 'give' ),
145
-							'desc'    => esc_html__( 'Enable/Disable all admin notifications from Give completely.', 'give' ),
144
+							'name'    => esc_html__('Admin Notifications', 'give'),
145
+							'desc'    => esc_html__('Enable/Disable all admin notifications from Give completely.', 'give'),
146 146
 							'type'    => 'radio_inline',
147 147
 							'default' => 'enabled',
148 148
 							'options' => array(
149
-								'enabled'  => __( 'Enabled', 'give' ),
150
-								'disabled' => __( 'Disabled', 'give' ),
149
+								'enabled'  => __('Enabled', 'give'),
150
+								'disabled' => __('Disabled', 'give'),
151 151
 							)
152 152
 						),
153 153
 						array(
154 154
 							'id'      => 'donation_notification_subject',
155
-							'name'    => esc_html__( 'Donation Notification Subject', 'give' ),
156
-							'desc'    => esc_html__( 'Enter the subject line for the admin donation notification email.', 'give' ),
155
+							'name'    => esc_html__('Donation Notification Subject', 'give'),
156
+							'desc'    => esc_html__('Enter the subject line for the admin donation notification email.', 'give'),
157 157
 							'type'    => 'text',
158
-							'default' => esc_attr__( 'New Donation - #{payment_id}', 'give' )
158
+							'default' => esc_attr__('New Donation - #{payment_id}', 'give')
159 159
 						),
160 160
 						array(
161 161
 							'id'      => 'donation_notification',
162
-							'name'    => esc_html__( 'Donation Notification', 'give' ),
162
+							'name'    => esc_html__('Donation Notification', 'give'),
163 163
 							'desc'    => sprintf(
164 164
 							/* translators: %s: emails tags list */
165
-								__( 'Enter the content of the email that is sent to notify an admin of a new donation. HTML is accepted. <br /><strong>Available template tags:</strong> %s', 'give' ),
165
+								__('Enter the content of the email that is sent to notify an admin of a new donation. HTML is accepted. <br /><strong>Available template tags:</strong> %s', 'give'),
166 166
 								'<br/>'.give_get_emails_tags_list()
167 167
 							),
168 168
 							'type'    => 'wysiwyg',
@@ -170,16 +170,16 @@  discard block
 block discarded – undo
170 170
 						),
171 171
 						array(
172 172
 							'id'      => 'admin_notice_emails',
173
-							'name'    => esc_html__( 'Donation Notification Emails', 'give' ),
174
-							'desc'    => __( 'Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give' ),
173
+							'name'    => esc_html__('Donation Notification Emails', 'give'),
174
+							'desc'    => __('Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give'),
175 175
 							'type'    => 'textarea',
176
-							'default' => get_bloginfo( 'admin_email' )
176
+							'default' => get_bloginfo('admin_email')
177 177
 						),
178 178
                         array(
179
-                            'name'  => esc_html__( 'Donation Notification Settings Docs Link', 'give' ),
179
+                            'name'  => esc_html__('Donation Notification Settings Docs Link', 'give'),
180 180
                             'id'    => 'donation_notification_settings_docs_link',
181
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-donation-notification' ),
182
-                            'title' => __( 'Donation Notification Settings', 'give' ),
181
+                            'url'   => esc_url('http://docs.givewp.com/settings-donation-notification'),
182
+                            'title' => __('Donation Notification Settings', 'give'),
183 183
                             'type'  => 'give_docs_link',
184 184
                         ),
185 185
 						array(
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 			 * Filter the emails settings.
195 195
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
196 196
 			 */
197
-			$settings = apply_filters( 'give_settings_emails', $settings );
197
+			$settings = apply_filters('give_settings_emails', $settings);
198 198
 
199 199
 			/**
200 200
 			 * Filter the settings.
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 			 * @since  1.8
203 203
 			 * @param  array $settings
204 204
 			 */
205
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
205
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
206 206
 
207 207
 			// Output.
208 208
 			return $settings;
@@ -216,12 +216,12 @@  discard block
 block discarded – undo
216 216
 		 */
217 217
 		public function get_sections() {
218 218
 			$sections = array(
219
-				'email-settings'            => esc_html__( 'Email Settings', 'give' ),
220
-				'donation-receipt'          => esc_html__( 'Donation Receipt', 'give' ),
221
-				'new-donation-notification' => esc_html__( 'New Donation Notification', 'give' )
219
+				'email-settings'            => esc_html__('Email Settings', 'give'),
220
+				'donation-receipt'          => esc_html__('Donation Receipt', 'give'),
221
+				'new-donation-notification' => esc_html__('New Donation Notification', 'give')
222 222
 			);
223 223
 
224
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
224
+			return apply_filters('give_get_sections_'.$this->id, $sections);
225 225
 		}
226 226
 	}
227 227
 
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-profile-editor.php 1 patch
Spacing   +3 added lines, -3 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
 
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
 	 */
22 22
 	public function __construct() {
23 23
 
24
-		$this->shortcode['label'] = esc_html__( 'Profile Editor', 'give' );
24
+		$this->shortcode['label'] = esc_html__('Profile Editor', 'give');
25 25
 
26
-		parent::__construct( 'give_profile_editor' );
26
+		parent::__construct('give_profile_editor');
27 27
 	}
28 28
 }
29 29
 
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-receipt.php 1 patch
Spacing   +23 added lines, -23 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
 
@@ -24,10 +24,10 @@  discard block
 block discarded – undo
24 24
 	 */
25 25
 	public function __construct() {
26 26
 
27
-		$this->shortcode['title'] = esc_html__( 'Donation Receipt', 'give' );
28
-		$this->shortcode['label'] = esc_html__( 'Donation Receipt', 'give' );
27
+		$this->shortcode['title'] = esc_html__('Donation Receipt', 'give');
28
+		$this->shortcode['label'] = esc_html__('Donation Receipt', 'give');
29 29
 
30
-		parent::__construct( 'give_receipt' );
30
+		parent::__construct('give_receipt');
31 31
 	}
32 32
 
33 33
 	/**
@@ -40,60 +40,60 @@  discard block
 block discarded – undo
40 40
 		return array(
41 41
 			array(
42 42
 				'type' => 'container',
43
-				'html' => sprintf( '<p class="strong">%s</p>', esc_html__( 'Optional settings', 'give' ) ),
43
+				'html' => sprintf('<p class="strong">%s</p>', esc_html__('Optional settings', 'give')),
44 44
 			),
45 45
 			array(
46 46
 				'type'    => 'listbox',
47 47
 				'name'    => 'price',
48
-				'label'   => esc_html__( 'Show Donation Amount:', 'give' ),
48
+				'label'   => esc_html__('Show Donation Amount:', 'give'),
49 49
 				'options' => array(
50
-					'true'  => esc_html__( 'Show', 'give' ),
51
-					'false' => esc_html__( 'Hide', 'give' ),
50
+					'true'  => esc_html__('Show', 'give'),
51
+					'false' => esc_html__('Hide', 'give'),
52 52
 				),
53 53
 			),
54 54
 			array(
55 55
 				'type'    => 'listbox',
56 56
 				'name'    => 'donor',
57
-				'label'   => esc_html__( 'Show Donor Name:', 'give' ),
57
+				'label'   => esc_html__('Show Donor Name:', 'give'),
58 58
 				'options' => array(
59
-					'true'  => esc_html__( 'Show', 'give' ),
60
-					'false' => esc_html__( 'Hide', 'give' ),
59
+					'true'  => esc_html__('Show', 'give'),
60
+					'false' => esc_html__('Hide', 'give'),
61 61
 				),
62 62
 			),
63 63
 			array(
64 64
 				'type'    => 'listbox',
65 65
 				'name'    => 'date',
66
-				'label'   => esc_html__( 'Show Date:', 'give' ),
66
+				'label'   => esc_html__('Show Date:', 'give'),
67 67
 				'options' => array(
68
-					'true'  => esc_html__( 'Show', 'give' ),
69
-					'false' => esc_html__( 'Hide', 'give' ),
68
+					'true'  => esc_html__('Show', 'give'),
69
+					'false' => esc_html__('Hide', 'give'),
70 70
 				),
71 71
 			),
72 72
 			array(
73 73
 				'type'    => 'listbox',
74 74
 				'name'    => 'payment_key',
75
-				'label'   => esc_html__( 'Show Payment Key:', 'give' ),
75
+				'label'   => esc_html__('Show Payment Key:', 'give'),
76 76
 				'options' => array(
77
-					'true'  => esc_html__( 'Show', 'give' ),
78
-					'false' => esc_html__( 'Hide', 'give' ),
77
+					'true'  => esc_html__('Show', 'give'),
78
+					'false' => esc_html__('Hide', 'give'),
79 79
 				),
80 80
 			),
81 81
 			array(
82 82
 				'type'    => 'listbox',
83 83
 				'name'    => 'payment_method',
84
-				'label'   => esc_html__( 'Show Payment Method:', 'give' ),
84
+				'label'   => esc_html__('Show Payment Method:', 'give'),
85 85
 				'options' => array(
86
-					'true'  => esc_html__( 'Show', 'give' ),
87
-					'false' => esc_html__( 'Hide', 'give' ),
86
+					'true'  => esc_html__('Show', 'give'),
87
+					'false' => esc_html__('Hide', 'give'),
88 88
 				),
89 89
 			),
90 90
 			array(
91 91
 				'type'    => 'listbox',
92 92
 				'name'    => 'payment_id',
93
-				'label'   => esc_html__( 'Show Payment ID:', 'give' ),
93
+				'label'   => esc_html__('Show Payment ID:', 'give'),
94 94
 				'options' => array(
95
-					'true'  => esc_html__( 'Show', 'give' ),
96
-					'false' => esc_html__( 'Hide', 'give' ),
95
+					'true'  => esc_html__('Show', 'give'),
96
+					'false' => esc_html__('Hide', 'give'),
97 97
 				),
98 98
 			),
99 99
 		);
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-register.php 1 patch
Spacing   +6 added lines, -6 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
 
@@ -21,10 +21,10 @@  discard block
 block discarded – undo
21 21
 	 */
22 22
 	public function __construct() {
23 23
 
24
-		$this->shortcode['title'] = esc_html__( 'Register', 'give' );
25
-		$this->shortcode['label'] = esc_html__( 'Register', 'give' );
24
+		$this->shortcode['title'] = esc_html__('Register', 'give');
25
+		$this->shortcode['label'] = esc_html__('Register', 'give');
26 26
 
27
-		parent::__construct( 'give_register' );
27
+		parent::__construct('give_register');
28 28
 	}
29 29
 
30 30
 	/**
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
37 37
 		return array(
38 38
 			array(
39 39
 				'type' => 'container',
40
-				'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Redirect URL (optional):', 'give' ) ),
40
+				'html' => sprintf('<p class="no-margin">%s</p>', esc_html__('Redirect URL (optional):', 'give')),
41 41
 			),
42 42
 			array(
43 43
 				'type'     => 'textbox',
44 44
 				'name'     => 'redirect',
45 45
 				'minWidth' => 320,
46
-				'tooltip'  => esc_attr__( 'Enter an URL here to redirect to after registering.', 'give' ),
46
+				'tooltip'  => esc_attr__('Enter an URL here to redirect to after registering.', 'give'),
47 47
 			),
48 48
 		);
49 49
 	}
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-donation-history.php 1 patch
Spacing   +3 added lines, -3 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
 
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
 	 */
22 22
 	public function __construct() {
23 23
 
24
-		$this->shortcode['label'] = esc_html__( 'Donation History', 'give' );
24
+		$this->shortcode['label'] = esc_html__('Donation History', 'give');
25 25
 
26
-		parent::__construct( 'donation_history' );
26
+		parent::__construct('donation_history');
27 27
 	}
28 28
 }
29 29
 
Please login to merge, or discard this patch.
includes/misc-functions.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -812,10 +812,10 @@  discard block
 block discarded – undo
812 812
 		}
813 813
 
814 814
 		if ( ! is_int( $params[1] )
815
-		     && ! is_float( $params[1] )
816
-		     && ! is_string( $params[1] )
817
-		     && $params[1] !== null
818
-		     && ! ( is_object( $params[1] ) && method_exists( $params[1], '__toString' ) )
815
+			 && ! is_float( $params[1] )
816
+			 && ! is_string( $params[1] )
817
+			 && $params[1] !== null
818
+			 && ! ( is_object( $params[1] ) && method_exists( $params[1], '__toString' ) )
819 819
 		) {
820 820
 			trigger_error( esc_html__( 'array_column(): The column key should be either a string or an integer.', 'give' ), E_USER_WARNING );
821 821
 
@@ -823,10 +823,10 @@  discard block
 block discarded – undo
823 823
 		}
824 824
 
825 825
 		if ( isset( $params[2] )
826
-		     && ! is_int( $params[2] )
827
-		     && ! is_float( $params[2] )
828
-		     && ! is_string( $params[2] )
829
-		     && ! ( is_object( $params[2] ) && method_exists( $params[2], '__toString' ) )
826
+			 && ! is_int( $params[2] )
827
+			 && ! is_float( $params[2] )
828
+			 && ! is_string( $params[2] )
829
+			 && ! ( is_object( $params[2] ) && method_exists( $params[2], '__toString' ) )
830 830
 		) {
831 831
 			trigger_error( esc_html__( 'array_column(): The index key should be either a string or an integer.', 'give' ), E_USER_WARNING );
832 832
 
Please login to merge, or discard this patch.
Spacing   +243 added lines, -243 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
  */
24 24
 function give_is_test_mode() {
25 25
 
26
-	$ret = give_is_setting_enabled( give_get_option( 'test_mode' ) );
26
+	$ret = give_is_setting_enabled(give_get_option('test_mode'));
27 27
 
28
-	return (bool) apply_filters( 'give_is_test_mode', $ret );
28
+	return (bool) apply_filters('give_is_test_mode', $ret);
29 29
 
30 30
 }
31 31
 
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
  */
38 38
 function give_get_currency() {
39 39
 
40
-	$currency = give_get_option( 'currency', 'USD' );
40
+	$currency = give_get_option('currency', 'USD');
41 41
 
42
-	return apply_filters( 'give_currency', $currency );
42
+	return apply_filters('give_currency', $currency);
43 43
 }
44 44
 
45 45
 /**
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
  */
52 52
 function give_get_currency_position() {
53 53
 
54
-	$currency_pos = give_get_option( 'currency_position', 'before' );
54
+	$currency_pos = give_get_option('currency_position', 'before');
55 55
 
56
-	return apply_filters( 'give_currency_position', $currency_pos );
56
+	return apply_filters('give_currency_position', $currency_pos);
57 57
 }
58 58
 
59 59
 
@@ -66,39 +66,39 @@  discard block
 block discarded – undo
66 66
 
67 67
 function give_get_currencies() {
68 68
 	$currencies = array(
69
-		'USD'  => __( 'US Dollars ($)', 'give' ),
70
-		'EUR'  => __( 'Euros (€)', 'give' ),
71
-		'GBP'  => __( 'Pounds Sterling (£)', 'give' ),
72
-		'AUD'  => __( 'Australian Dollars ($)', 'give' ),
73
-		'BRL'  => __( 'Brazilian Real (R$)', 'give' ),
74
-		'CAD'  => __( 'Canadian Dollars ($)', 'give' ),
75
-		'CZK'  => __( 'Czech Koruna (Kč)', 'give' ),
76
-		'DKK'  => __( 'Danish Krone (kr.)', 'give' ),
77
-		'HKD'  => __( 'Hong Kong Dollar ($)', 'give' ),
78
-		'HUF'  => __( 'Hungarian Forint (Ft)', 'give' ),
79
-		'ILS'  => __( 'Israeli Shekel (₪)', 'give' ),
80
-		'JPY'  => __( 'Japanese Yen (¥)', 'give' ),
81
-		'MYR'  => __( 'Malaysian Ringgits (RM)', 'give' ),
82
-		'MXN'  => __( 'Mexican Peso ($)', 'give' ),
83
-		'MAD'  => __( 'Moroccan Dirham (&#x2e;&#x62f;&#x2e;&#x645;)', 'give' ),
84
-		'NZD'  => __( 'New Zealand Dollar ($)', 'give' ),
85
-		'NOK'  => __( 'Norwegian Krone (Kr.)', 'give' ),
86
-		'PHP'  => __( 'Philippine Pesos (₱)', 'give' ),
87
-		'PLN'  => __( 'Polish Zloty (zł)', 'give' ),
88
-		'SGD'  => __( 'Singapore Dollar ($)', 'give' ),
89
-		'KRW'  => __( 'South Korean Won (₩)', 'give' ),
90
-		'ZAR'  => __( 'South African Rand (R)', 'give' ),
91
-		'SEK'  => __( 'Swedish Krona (kr)', 'give' ),
92
-		'CHF'  => __( 'Swiss Franc (CHF)', 'give' ),
93
-		'TWD'  => __( 'Taiwan New Dollars (NT$)', 'give' ),
94
-		'THB'  => __( 'Thai Baht (฿)', 'give' ),
95
-		'INR'  => __( 'Indian Rupee (₹)', 'give' ),
96
-		'TRY'  => __( 'Turkish Lira (₺)', 'give' ),
97
-		'RIAL' => __( 'Iranian Rial (﷼)', 'give' ),
98
-		'RUB'  => __( 'Russian Rubles (руб)', 'give' ),
69
+		'USD'  => __('US Dollars ($)', 'give'),
70
+		'EUR'  => __('Euros (€)', 'give'),
71
+		'GBP'  => __('Pounds Sterling (£)', 'give'),
72
+		'AUD'  => __('Australian Dollars ($)', 'give'),
73
+		'BRL'  => __('Brazilian Real (R$)', 'give'),
74
+		'CAD'  => __('Canadian Dollars ($)', 'give'),
75
+		'CZK'  => __('Czech Koruna (Kč)', 'give'),
76
+		'DKK'  => __('Danish Krone (kr.)', 'give'),
77
+		'HKD'  => __('Hong Kong Dollar ($)', 'give'),
78
+		'HUF'  => __('Hungarian Forint (Ft)', 'give'),
79
+		'ILS'  => __('Israeli Shekel (₪)', 'give'),
80
+		'JPY'  => __('Japanese Yen (¥)', 'give'),
81
+		'MYR'  => __('Malaysian Ringgits (RM)', 'give'),
82
+		'MXN'  => __('Mexican Peso ($)', 'give'),
83
+		'MAD'  => __('Moroccan Dirham (&#x2e;&#x62f;&#x2e;&#x645;)', 'give'),
84
+		'NZD'  => __('New Zealand Dollar ($)', 'give'),
85
+		'NOK'  => __('Norwegian Krone (Kr.)', 'give'),
86
+		'PHP'  => __('Philippine Pesos (₱)', 'give'),
87
+		'PLN'  => __('Polish Zloty (zł)', 'give'),
88
+		'SGD'  => __('Singapore Dollar ($)', 'give'),
89
+		'KRW'  => __('South Korean Won (₩)', 'give'),
90
+		'ZAR'  => __('South African Rand (R)', 'give'),
91
+		'SEK'  => __('Swedish Krona (kr)', 'give'),
92
+		'CHF'  => __('Swiss Franc (CHF)', 'give'),
93
+		'TWD'  => __('Taiwan New Dollars (NT$)', 'give'),
94
+		'THB'  => __('Thai Baht (฿)', 'give'),
95
+		'INR'  => __('Indian Rupee (₹)', 'give'),
96
+		'TRY'  => __('Turkish Lira (₺)', 'give'),
97
+		'RIAL' => __('Iranian Rial (﷼)', 'give'),
98
+		'RUB'  => __('Russian Rubles (руб)', 'give'),
99 99
 	);
100 100
 
101
-	return apply_filters( 'give_currencies', $currencies );
101
+	return apply_filters('give_currencies', $currencies);
102 102
 }
103 103
 
104 104
 
@@ -115,12 +115,12 @@  discard block
 block discarded – undo
115 115
  *
116 116
  * @return string           The symbol to use for the currency
117 117
  */
118
-function give_currency_symbol( $currency = '', $decode_currency = false ) {
118
+function give_currency_symbol($currency = '', $decode_currency = false) {
119 119
 
120
-	if ( empty( $currency ) ) {
120
+	if (empty($currency)) {
121 121
 		$currency = give_get_currency();
122 122
 	}
123
-	switch ( $currency ) :
123
+	switch ($currency) :
124 124
 		case 'GBP' :
125 125
 			$symbol = '&pound;';
126 126
 			break;
@@ -198,9 +198,9 @@  discard block
 block discarded – undo
198 198
 			break;
199 199
 	endswitch;
200 200
 
201
-	$symbol = ( ! $decode_currency ? $symbol : html_entity_decode( $symbol ) );
201
+	$symbol = ( ! $decode_currency ? $symbol : html_entity_decode($symbol));
202 202
 
203
-	return apply_filters( 'give_currency_symbol', $symbol, $currency );
203
+	return apply_filters('give_currency_symbol', $symbol, $currency);
204 204
 }
205 205
 
206 206
 
@@ -213,16 +213,16 @@  discard block
 block discarded – undo
213 213
  *
214 214
  * @return string
215 215
  */
216
-function give_get_currency_name( $currency_code ) {
216
+function give_get_currency_name($currency_code) {
217 217
 	$currency_name  = '';
218 218
 	$currency_names = give_get_currencies();
219 219
 
220
-	if ( $currency_code && array_key_exists( $currency_code, $currency_names ) ) {
221
-		$currency_name = explode( '(', $currency_names[ $currency_code ] );
222
-		$currency_name = trim( current( $currency_name ) );
220
+	if ($currency_code && array_key_exists($currency_code, $currency_names)) {
221
+		$currency_name = explode('(', $currency_names[$currency_code]);
222
+		$currency_name = trim(current($currency_name));
223 223
 	}
224 224
 
225
-	return apply_filters( 'give_currency_name', $currency_name, $currency_code );
225
+	return apply_filters('give_currency_name', $currency_name, $currency_code);
226 226
 }
227 227
 
228 228
 
@@ -236,21 +236,21 @@  discard block
 block discarded – undo
236 236
 
237 237
 	global $wp;
238 238
 
239
-	if ( get_option( 'permalink_structure' ) ) {
240
-		$base = trailingslashit( home_url( $wp->request ) );
239
+	if (get_option('permalink_structure')) {
240
+		$base = trailingslashit(home_url($wp->request));
241 241
 	} else {
242
-		$base = add_query_arg( $wp->query_string, '', trailingslashit( home_url( $wp->request ) ) );
243
-		$base = remove_query_arg( array( 'post_type', 'name' ), $base );
242
+		$base = add_query_arg($wp->query_string, '', trailingslashit(home_url($wp->request)));
243
+		$base = remove_query_arg(array('post_type', 'name'), $base);
244 244
 	}
245 245
 
246 246
 	$scheme      = is_ssl() ? 'https' : 'http';
247
-	$current_uri = set_url_scheme( $base, $scheme );
247
+	$current_uri = set_url_scheme($base, $scheme);
248 248
 
249
-	if ( is_front_page() ) {
250
-		$current_uri = home_url( '/' );
249
+	if (is_front_page()) {
250
+		$current_uri = home_url('/');
251 251
 	}
252 252
 
253
-	return apply_filters( 'give_get_current_page_url', $current_uri );
253
+	return apply_filters('give_get_current_page_url', $current_uri);
254 254
 
255 255
 }
256 256
 
@@ -272,15 +272,15 @@  discard block
 block discarded – undo
272 272
 	 */
273 273
 	$gateways = give_get_enabled_payment_gateways();
274 274
 
275
-	if ( count( $gateways ) == 1 && ! isset( $gateways['paypal'] ) && ! isset( $gateways['manual'] ) ) {
275
+	if (count($gateways) == 1 && ! isset($gateways['paypal']) && ! isset($gateways['manual'])) {
276 276
 		$ret = true;
277
-	} elseif ( count( $gateways ) == 1 ) {
277
+	} elseif (count($gateways) == 1) {
278 278
 		$ret = false;
279
-	} elseif ( count( $gateways ) == 2 && isset( $gateways['paypal'] ) && isset( $gateways['manual'] ) ) {
279
+	} elseif (count($gateways) == 2 && isset($gateways['paypal']) && isset($gateways['manual'])) {
280 280
 		$ret = false;
281 281
 	}
282 282
 
283
-	return (bool) apply_filters( 'give_verify_credit_cards', $ret );
283
+	return (bool) apply_filters('give_verify_credit_cards', $ret);
284 284
 }
285 285
 
286 286
 /**
@@ -292,26 +292,26 @@  discard block
 block discarded – undo
292 292
 function give_get_timezone_id() {
293 293
 
294 294
 	// if site timezone string exists, return it.
295
-	if ( $timezone = get_option( 'timezone_string' ) ) {
295
+	if ($timezone = get_option('timezone_string')) {
296 296
 		return $timezone;
297 297
 	}
298 298
 
299 299
 	// get UTC offset, if it isn't set return UTC.
300
-	if ( ! ( $utc_offset = 3600 * get_option( 'gmt_offset', 0 ) ) ) {
300
+	if ( ! ($utc_offset = 3600 * get_option('gmt_offset', 0))) {
301 301
 		return 'UTC';
302 302
 	}
303 303
 
304 304
 	// attempt to guess the timezone string from the UTC offset.
305
-	$timezone = timezone_name_from_abbr( '', $utc_offset );
305
+	$timezone = timezone_name_from_abbr('', $utc_offset);
306 306
 
307 307
 	// last try, guess timezone string manually.
308
-	if ( $timezone === false ) {
308
+	if ($timezone === false) {
309 309
 
310
-		$is_dst = date( 'I' );
310
+		$is_dst = date('I');
311 311
 
312
-		foreach ( timezone_abbreviations_list() as $abbr ) {
313
-			foreach ( $abbr as $city ) {
314
-				if ( $city['dst'] == $is_dst && $city['offset'] == $utc_offset ) {
312
+		foreach (timezone_abbreviations_list() as $abbr) {
313
+			foreach ($abbr as $city) {
314
+				if ($city['dst'] == $is_dst && $city['offset'] == $utc_offset) {
315 315
 					return $city['timezone_id'];
316 316
 				}
317 317
 			}
@@ -335,17 +335,17 @@  discard block
 block discarded – undo
335 335
 
336 336
 	$ip = '127.0.0.1';
337 337
 
338
-	if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {
338
+	if ( ! empty($_SERVER['HTTP_CLIENT_IP'])) {
339 339
 		// check ip from share internet
340 340
 		$ip = $_SERVER['HTTP_CLIENT_IP'];
341
-	} elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
341
+	} elseif ( ! empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
342 342
 		// to check ip is pass from proxy
343 343
 		$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
344
-	} elseif ( ! empty( $_SERVER['REMOTE_ADDR'] ) ) {
344
+	} elseif ( ! empty($_SERVER['REMOTE_ADDR'])) {
345 345
 		$ip = $_SERVER['REMOTE_ADDR'];
346 346
 	}
347 347
 
348
-	return apply_filters( 'give_get_ip', $ip );
348
+	return apply_filters('give_get_ip', $ip);
349 349
 }
350 350
 
351 351
 
@@ -360,9 +360,9 @@  discard block
 block discarded – undo
360 360
  *
361 361
  * @uses  Give()->session->set()
362 362
  */
363
-function give_set_purchase_session( $purchase_data = array() ) {
364
-	Give()->session->set( 'give_purchase', $purchase_data );
365
-	Give()->session->set( 'give_email', $purchase_data['user_email'] );
363
+function give_set_purchase_session($purchase_data = array()) {
364
+	Give()->session->set('give_purchase', $purchase_data);
365
+	Give()->session->set('give_email', $purchase_data['user_email']);
366 366
 }
367 367
 
368 368
 /**
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
  * @return mixed array | false
377 377
  */
378 378
 function give_get_purchase_session() {
379
-	return Give()->session->get( 'give_purchase' );
379
+	return Give()->session->get('give_purchase');
380 380
 }
381 381
 
382 382
 /**
@@ -392,40 +392,40 @@  discard block
 block discarded – undo
392 392
  *
393 393
  * @return string
394 394
  */
395
-function give_payment_gateway_donation_summary( $donation_data, $name_and_email = true, $length = 255 ) {
395
+function give_payment_gateway_donation_summary($donation_data, $name_and_email = true, $length = 255) {
396 396
 
397 397
 	$summary = '';
398 398
 
399
-	$form_id = isset( $donation_data['post_data']['give-form-id'] ) ? $donation_data['post_data']['give-form-id'] : '';
399
+	$form_id = isset($donation_data['post_data']['give-form-id']) ? $donation_data['post_data']['give-form-id'] : '';
400 400
 
401 401
 	// Form title.
402
-	if ( isset( $donation_data['post_data']['give-form-title'] ) ) {
402
+	if (isset($donation_data['post_data']['give-form-title'])) {
403 403
 		$summary .= $donation_data['post_data']['give-form-title'];
404 404
 	}
405 405
 	// Form multilevel if applicable.
406
-	if ( isset( $donation_data['post_data']['give-price-id'] ) ) {
407
-		$summary .= ': ' . give_get_price_option_name( $form_id, $donation_data['post_data']['give-price-id'] );
406
+	if (isset($donation_data['post_data']['give-price-id'])) {
407
+		$summary .= ': '.give_get_price_option_name($form_id, $donation_data['post_data']['give-price-id']);
408 408
 	}
409 409
 
410 410
 	// Add Donor's name + email if requested.
411
-	if ( $name_and_email ) {
411
+	if ($name_and_email) {
412 412
 
413 413
 		// First name
414
-		if ( isset( $donation_data['user_info']['first_name'] ) && ! empty( $donation_data['user_info']['first_name'] ) ) {
415
-			$summary .= ' - ' . $donation_data['user_info']['first_name'];
414
+		if (isset($donation_data['user_info']['first_name']) && ! empty($donation_data['user_info']['first_name'])) {
415
+			$summary .= ' - '.$donation_data['user_info']['first_name'];
416 416
 		}
417 417
 
418
-		if ( isset( $donation_data['user_info']['last_name'] ) && ! empty( $donation_data['user_info']['last_name'] ) ) {
419
-			$summary .= ' ' . $donation_data['user_info']['last_name'];
418
+		if (isset($donation_data['user_info']['last_name']) && ! empty($donation_data['user_info']['last_name'])) {
419
+			$summary .= ' '.$donation_data['user_info']['last_name'];
420 420
 		}
421 421
 
422
-		$summary .= ' (' . $donation_data['user_email'] . ')';
422
+		$summary .= ' ('.$donation_data['user_email'].')';
423 423
 	}
424 424
 
425 425
 	// Cut the length
426
-	$summary = substr( $summary, 0, $length );
426
+	$summary = substr($summary, 0, $length);
427 427
 
428
-	return apply_filters( 'give_payment_gateway_donation_summary', $summary );
428
+	return apply_filters('give_payment_gateway_donation_summary', $summary);
429 429
 }
430 430
 
431 431
 
@@ -440,31 +440,31 @@  discard block
 block discarded – undo
440 440
 function give_get_host() {
441 441
 	$host = false;
442 442
 
443
-	if ( defined( 'WPE_APIKEY' ) ) {
443
+	if (defined('WPE_APIKEY')) {
444 444
 		$host = 'WP Engine';
445
-	} elseif ( defined( 'PAGELYBIN' ) ) {
445
+	} elseif (defined('PAGELYBIN')) {
446 446
 		$host = 'Pagely';
447
-	} elseif ( DB_HOST == 'localhost:/tmp/mysql5.sock' ) {
447
+	} elseif (DB_HOST == 'localhost:/tmp/mysql5.sock') {
448 448
 		$host = 'ICDSoft';
449
-	} elseif ( DB_HOST == 'mysqlv5' ) {
449
+	} elseif (DB_HOST == 'mysqlv5') {
450 450
 		$host = 'NetworkSolutions';
451
-	} elseif ( strpos( DB_HOST, 'ipagemysql.com' ) !== false ) {
451
+	} elseif (strpos(DB_HOST, 'ipagemysql.com') !== false) {
452 452
 		$host = 'iPage';
453
-	} elseif ( strpos( DB_HOST, 'ipowermysql.com' ) !== false ) {
453
+	} elseif (strpos(DB_HOST, 'ipowermysql.com') !== false) {
454 454
 		$host = 'IPower';
455
-	} elseif ( strpos( DB_HOST, '.gridserver.com' ) !== false ) {
455
+	} elseif (strpos(DB_HOST, '.gridserver.com') !== false) {
456 456
 		$host = 'MediaTemple Grid';
457
-	} elseif ( strpos( DB_HOST, '.pair.com' ) !== false ) {
457
+	} elseif (strpos(DB_HOST, '.pair.com') !== false) {
458 458
 		$host = 'pair Networks';
459
-	} elseif ( strpos( DB_HOST, '.stabletransit.com' ) !== false ) {
459
+	} elseif (strpos(DB_HOST, '.stabletransit.com') !== false) {
460 460
 		$host = 'Rackspace Cloud';
461
-	} elseif ( strpos( DB_HOST, '.sysfix.eu' ) !== false ) {
461
+	} elseif (strpos(DB_HOST, '.sysfix.eu') !== false) {
462 462
 		$host = 'SysFix.eu Power Hosting';
463
-	} elseif ( strpos( $_SERVER['SERVER_NAME'], 'Flywheel' ) !== false ) {
463
+	} elseif (strpos($_SERVER['SERVER_NAME'], 'Flywheel') !== false) {
464 464
 		$host = 'Flywheel';
465 465
 	} else {
466 466
 		// Adding a general fallback for data gathering
467
-		$host = 'DBH: ' . DB_HOST . ', SRV: ' . $_SERVER['SERVER_NAME'];
467
+		$host = 'DBH: '.DB_HOST.', SRV: '.$_SERVER['SERVER_NAME'];
468 468
 	}
469 469
 
470 470
 	return $host;
@@ -480,67 +480,67 @@  discard block
 block discarded – undo
480 480
  *
481 481
  * @return bool true if host matches, false if not
482 482
  */
483
-function give_is_host( $host = false ) {
483
+function give_is_host($host = false) {
484 484
 
485 485
 	$return = false;
486 486
 
487
-	if ( $host ) {
488
-		$host = str_replace( ' ', '', strtolower( $host ) );
487
+	if ($host) {
488
+		$host = str_replace(' ', '', strtolower($host));
489 489
 
490
-		switch ( $host ) {
490
+		switch ($host) {
491 491
 			case 'wpengine':
492
-				if ( defined( 'WPE_APIKEY' ) ) {
492
+				if (defined('WPE_APIKEY')) {
493 493
 					$return = true;
494 494
 				}
495 495
 				break;
496 496
 			case 'pagely':
497
-				if ( defined( 'PAGELYBIN' ) ) {
497
+				if (defined('PAGELYBIN')) {
498 498
 					$return = true;
499 499
 				}
500 500
 				break;
501 501
 			case 'icdsoft':
502
-				if ( DB_HOST == 'localhost:/tmp/mysql5.sock' ) {
502
+				if (DB_HOST == 'localhost:/tmp/mysql5.sock') {
503 503
 					$return = true;
504 504
 				}
505 505
 				break;
506 506
 			case 'networksolutions':
507
-				if ( DB_HOST == 'mysqlv5' ) {
507
+				if (DB_HOST == 'mysqlv5') {
508 508
 					$return = true;
509 509
 				}
510 510
 				break;
511 511
 			case 'ipage':
512
-				if ( strpos( DB_HOST, 'ipagemysql.com' ) !== false ) {
512
+				if (strpos(DB_HOST, 'ipagemysql.com') !== false) {
513 513
 					$return = true;
514 514
 				}
515 515
 				break;
516 516
 			case 'ipower':
517
-				if ( strpos( DB_HOST, 'ipowermysql.com' ) !== false ) {
517
+				if (strpos(DB_HOST, 'ipowermysql.com') !== false) {
518 518
 					$return = true;
519 519
 				}
520 520
 				break;
521 521
 			case 'mediatemplegrid':
522
-				if ( strpos( DB_HOST, '.gridserver.com' ) !== false ) {
522
+				if (strpos(DB_HOST, '.gridserver.com') !== false) {
523 523
 					$return = true;
524 524
 				}
525 525
 				break;
526 526
 			case 'pairnetworks':
527
-				if ( strpos( DB_HOST, '.pair.com' ) !== false ) {
527
+				if (strpos(DB_HOST, '.pair.com') !== false) {
528 528
 					$return = true;
529 529
 				}
530 530
 				break;
531 531
 			case 'rackspacecloud':
532
-				if ( strpos( DB_HOST, '.stabletransit.com' ) !== false ) {
532
+				if (strpos(DB_HOST, '.stabletransit.com') !== false) {
533 533
 					$return = true;
534 534
 				}
535 535
 				break;
536 536
 			case 'sysfix.eu':
537 537
 			case 'sysfix.eupowerhosting':
538
-				if ( strpos( DB_HOST, '.sysfix.eu' ) !== false ) {
538
+				if (strpos(DB_HOST, '.sysfix.eu') !== false) {
539 539
 					$return = true;
540 540
 				}
541 541
 				break;
542 542
 			case 'flywheel':
543
-				if ( strpos( $_SERVER['SERVER_NAME'], 'Flywheel' ) !== false ) {
543
+				if (strpos($_SERVER['SERVER_NAME'], 'Flywheel') !== false) {
544 544
 					$return = true;
545 545
 				}
546 546
 				break;
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
  * @param string $replacement Optional. The function that should have been called.
574 574
  * @param array  $backtrace   Optional. Contains stack backtrace of deprecated function.
575 575
  */
576
-function _give_deprecated_function( $function, $version, $replacement = null, $backtrace = null ) {
576
+function _give_deprecated_function($function, $version, $replacement = null, $backtrace = null) {
577 577
 
578 578
 	/**
579 579
 	 * Fires while give deprecated function call occurs.
@@ -586,19 +586,19 @@  discard block
 block discarded – undo
586 586
 	 * @param string $replacement Optional. The function that should have been called.
587 587
 	 * @param string $version     The plugin version that deprecated the function.
588 588
 	 */
589
-	do_action( 'give_deprecated_function_run', $function, $replacement, $version );
589
+	do_action('give_deprecated_function_run', $function, $replacement, $version);
590 590
 
591
-	$show_errors = current_user_can( 'manage_options' );
591
+	$show_errors = current_user_can('manage_options');
592 592
 
593 593
 	// Allow plugin to filter the output error trigger.
594
-	if ( WP_DEBUG && apply_filters( 'give_deprecated_function_trigger_error', $show_errors ) ) {
595
-		if ( ! is_null( $replacement ) ) {
596
-			trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since Give version %2$s! Use %3$s instead.', 'give' ), $function, $version, $replacement ) );
597
-			trigger_error( print_r( $backtrace, 1 ) ); // Limited to previous 1028 characters, but since we only need to move back 1 in stack that should be fine.
594
+	if (WP_DEBUG && apply_filters('give_deprecated_function_trigger_error', $show_errors)) {
595
+		if ( ! is_null($replacement)) {
596
+			trigger_error(sprintf(__('%1$s is <strong>deprecated</strong> since Give version %2$s! Use %3$s instead.', 'give'), $function, $version, $replacement));
597
+			trigger_error(print_r($backtrace, 1)); // Limited to previous 1028 characters, but since we only need to move back 1 in stack that should be fine.
598 598
 			// Alternatively we could dump this to a file.
599 599
 		} else {
600
-			trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since Give version %2$s with no alternative available.', 'give' ), $function, $version ) );
601
-			trigger_error( print_r( $backtrace, 1 ) );// Limited to previous 1028 characters, but since we only need to move back 1 in stack that should be fine.
600
+			trigger_error(sprintf(__('%1$s is <strong>deprecated</strong> since Give version %2$s with no alternative available.', 'give'), $function, $version));
601
+			trigger_error(print_r($backtrace, 1)); // Limited to previous 1028 characters, but since we only need to move back 1 in stack that should be fine.
602 602
 			// Alternatively we could dump this to a file.
603 603
 		}
604 604
 	}
@@ -612,8 +612,8 @@  discard block
 block discarded – undo
612 612
  * @return string $post_id
613 613
  */
614 614
 function give_get_admin_post_id() {
615
-	$post_id = isset( $_GET['post'] ) ? $_GET['post'] : null;
616
-	if ( ! $post_id && isset( $_POST['post_id'] ) ) {
615
+	$post_id = isset($_GET['post']) ? $_GET['post'] : null;
616
+	if ( ! $post_id && isset($_POST['post_id'])) {
617 617
 		$post_id = $_POST['post_id'];
618 618
 	}
619 619
 
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
  * @return string Arg separator output
628 628
  */
629 629
 function give_get_php_arg_separator_output() {
630
-	return ini_get( 'arg_separator.output' );
630
+	return ini_get('arg_separator.output');
631 631
 }
632 632
 
633 633
 
@@ -642,10 +642,10 @@  discard block
 block discarded – undo
642 642
  *
643 643
  * @return string Short month name
644 644
  */
645
-function give_month_num_to_name( $n ) {
646
-	$timestamp = mktime( 0, 0, 0, $n, 1, 2005 );
645
+function give_month_num_to_name($n) {
646
+	$timestamp = mktime(0, 0, 0, $n, 1, 2005);
647 647
 
648
-	return date_i18n( 'M', $timestamp );
648
+	return date_i18n('M', $timestamp);
649 649
 }
650 650
 
651 651
 
@@ -658,10 +658,10 @@  discard block
 block discarded – undo
658 658
  *
659 659
  * @return bool Whether or not function is disabled.
660 660
  */
661
-function give_is_func_disabled( $function ) {
662
-	$disabled = explode( ',', ini_get( 'disable_functions' ) );
661
+function give_is_func_disabled($function) {
662
+	$disabled = explode(',', ini_get('disable_functions'));
663 663
 
664
-	return in_array( $function, $disabled );
664
+	return in_array($function, $disabled);
665 665
 }
666 666
 
667 667
 
@@ -673,7 +673,7 @@  discard block
 block discarded – undo
673 673
 function give_get_newsletter() {
674 674
 	?>
675 675
 
676
-	<p class="newsletter-intro"><?php esc_html_e( 'Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give' ); ?></p>
676
+	<p class="newsletter-intro"><?php esc_html_e('Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give'); ?></p>
677 677
 
678 678
 	<div class="give-newsletter-form-wrap">
679 679
 
@@ -681,33 +681,33 @@  discard block
 block discarded – undo
681 681
 		      method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate"
682 682
 		      target="_blank" novalidate>
683 683
 			<div class="give-newsletter-confirmation">
684
-				<p><?php esc_html_e( 'Thanks for Subscribing!', 'give' ); ?> :)</p>
684
+				<p><?php esc_html_e('Thanks for Subscribing!', 'give'); ?> :)</p>
685 685
 			</div>
686 686
 
687 687
 			<table class="form-table give-newsletter-form">
688 688
 				<tr valign="middle">
689 689
 					<td>
690 690
 						<label for="mce-EMAIL"
691
-						       class="screen-reader-text"><?php esc_html_e( 'Email Address (required)', 'give' ); ?></label>
691
+						       class="screen-reader-text"><?php esc_html_e('Email Address (required)', 'give'); ?></label>
692 692
 						<input type="email" name="EMAIL" id="mce-EMAIL"
693
-						       placeholder="<?php esc_attr_e( 'Email Address (required)', 'give' ); ?>"
693
+						       placeholder="<?php esc_attr_e('Email Address (required)', 'give'); ?>"
694 694
 						       class="required email" value="">
695 695
 					</td>
696 696
 					<td>
697 697
 						<label for="mce-FNAME"
698
-						       class="screen-reader-text"><?php esc_html_e( 'First Name', 'give' ); ?></label>
698
+						       class="screen-reader-text"><?php esc_html_e('First Name', 'give'); ?></label>
699 699
 						<input type="text" name="FNAME" id="mce-FNAME"
700
-						       placeholder="<?php esc_attr_e( 'First Name', 'give' ); ?>" class="" value="">
700
+						       placeholder="<?php esc_attr_e('First Name', 'give'); ?>" class="" value="">
701 701
 					</td>
702 702
 					<td>
703 703
 						<label for="mce-LNAME"
704
-						       class="screen-reader-text"><?php esc_html_e( 'Last Name', 'give' ); ?></label>
704
+						       class="screen-reader-text"><?php esc_html_e('Last Name', 'give'); ?></label>
705 705
 						<input type="text" name="LNAME" id="mce-LNAME"
706
-						       placeholder="<?php esc_attr_e( 'Last Name', 'give' ); ?>" class="" value="">
706
+						       placeholder="<?php esc_attr_e('Last Name', 'give'); ?>" class="" value="">
707 707
 					</td>
708 708
 					<td>
709 709
 						<input type="submit" name="subscribe" id="mc-embedded-subscribe" class="button"
710
-						       value="<?php esc_attr_e( 'Subscribe', 'give' ); ?>">
710
+						       value="<?php esc_attr_e('Subscribe', 'give'); ?>">
711 711
 					</td>
712 712
 				</tr>
713 713
 			</table>
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
  *
760 760
  * @return string
761 761
  */
762
-function give_svg_icons( $icon ) {
762
+function give_svg_icons($icon) {
763 763
 
764 764
 	// Store your SVGs in an associative array
765 765
 	$svgs = array(
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
 	);
772 772
 
773 773
 	// Return the chosen icon's SVG string
774
-	return $svgs[ $icon ];
774
+	return $svgs[$icon];
775 775
 }
776 776
 
777 777
 /**
@@ -783,15 +783,15 @@  discard block
 block discarded – undo
783 783
  *
784 784
  * @return mixed
785 785
  */
786
-function modify_nav_menu_meta_box_object( $post_type ) {
787
-	if ( isset( $post_type->name ) && $post_type->name == 'give_forms' ) {
788
-		$post_type->labels->name = esc_html__( 'Donation Forms', 'give' );
786
+function modify_nav_menu_meta_box_object($post_type) {
787
+	if (isset($post_type->name) && $post_type->name == 'give_forms') {
788
+		$post_type->labels->name = esc_html__('Donation Forms', 'give');
789 789
 	}
790 790
 
791 791
 	return $post_type;
792 792
 }
793 793
 
794
-add_filter( 'nav_menu_meta_box_object', 'modify_nav_menu_meta_box_object' );
794
+add_filter('nav_menu_meta_box_object', 'modify_nav_menu_meta_box_object');
795 795
 
796 796
 /**
797 797
  * Enable 'Donation Form' meta enabled by default on Menu page.
@@ -801,22 +801,22 @@  discard block
 block discarded – undo
801 801
 function give_nav_donation_metabox_enabled() {
802 802
 
803 803
 	// Return false, if it fails to retrieve hidden meta box list and is not admin.
804
-	if ( ( ! $hidden_meta_boxes = get_user_option( 'metaboxhidden_nav-menus' ) ) || ! is_admin() ) {
804
+	if (( ! $hidden_meta_boxes = get_user_option('metaboxhidden_nav-menus')) || ! is_admin()) {
805 805
 		return false;
806 806
 	}
807 807
 
808 808
 	// Return false, In case, we don't find 'Donation Form' in hidden meta box list.
809
-	if ( ! in_array( 'add-post-type-give_forms', $hidden_meta_boxes, true ) ) {
809
+	if ( ! in_array('add-post-type-give_forms', $hidden_meta_boxes, true)) {
810 810
 		return false;
811 811
 	}
812 812
 
813 813
 	// Exclude 'Donation Form' value from hidden meta box's list.
814
-	$hidden_meta_boxes = array_diff( $hidden_meta_boxes, array( 'add-post-type-give_forms' ) );
814
+	$hidden_meta_boxes = array_diff($hidden_meta_boxes, array('add-post-type-give_forms'));
815 815
 
816 816
 	// Get current user ID.
817 817
 	$user = wp_get_current_user();
818 818
 
819
-	update_user_option( $user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes, true );
819
+	update_user_option($user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes, true);
820 820
 }
821 821
 
822 822
 /**
@@ -830,7 +830,7 @@  discard block
 block discarded – undo
830 830
  * @license    https://opensource.org/licenses/MIT MIT
831 831
  */
832 832
 
833
-if ( ! function_exists( 'array_column' ) ) {
833
+if ( ! function_exists('array_column')) {
834 834
 	/**
835 835
 	 * Returns the values from a single column of the input array, identified by
836 836
 	 * the $columnKey.
@@ -849,53 +849,53 @@  discard block
 block discarded – undo
849 849
 	 *
850 850
 	 * @return array
851 851
 	 */
852
-	function array_column( $input = null, $columnKey = null, $indexKey = null ) {
852
+	function array_column($input = null, $columnKey = null, $indexKey = null) {
853 853
 		// Using func_get_args() in order to check for proper number of
854 854
 		// parameters and trigger errors exactly as the built-in array_column()
855 855
 		// does in PHP 5.5.
856 856
 		$argc   = func_num_args();
857 857
 		$params = func_get_args();
858 858
 
859
-		if ( $argc < 2 ) {
860
-			trigger_error( sprintf( esc_html__( 'array_column() expects at least 2 parameters, %s given.', 'give' ), $argc ), E_USER_WARNING );
859
+		if ($argc < 2) {
860
+			trigger_error(sprintf(esc_html__('array_column() expects at least 2 parameters, %s given.', 'give'), $argc), E_USER_WARNING);
861 861
 
862 862
 			return null;
863 863
 		}
864 864
 
865
-		if ( ! is_array( $params[0] ) ) {
866
-			trigger_error( sprintf( esc_html__( 'array_column() expects parameter 1 to be array, %s given.', 'give' ), gettype( $params[0] ) ), E_USER_WARNING );
865
+		if ( ! is_array($params[0])) {
866
+			trigger_error(sprintf(esc_html__('array_column() expects parameter 1 to be array, %s given.', 'give'), gettype($params[0])), E_USER_WARNING);
867 867
 
868 868
 			return null;
869 869
 		}
870 870
 
871
-		if ( ! is_int( $params[1] )
872
-		     && ! is_float( $params[1] )
873
-		     && ! is_string( $params[1] )
871
+		if ( ! is_int($params[1])
872
+		     && ! is_float($params[1])
873
+		     && ! is_string($params[1])
874 874
 		     && $params[1] !== null
875
-		     && ! ( is_object( $params[1] ) && method_exists( $params[1], '__toString' ) )
875
+		     && ! (is_object($params[1]) && method_exists($params[1], '__toString'))
876 876
 		) {
877
-			trigger_error( esc_html__( 'array_column(): The column key should be either a string or an integer.', 'give' ), E_USER_WARNING );
877
+			trigger_error(esc_html__('array_column(): The column key should be either a string or an integer.', 'give'), E_USER_WARNING);
878 878
 
879 879
 			return false;
880 880
 		}
881 881
 
882
-		if ( isset( $params[2] )
883
-		     && ! is_int( $params[2] )
884
-		     && ! is_float( $params[2] )
885
-		     && ! is_string( $params[2] )
886
-		     && ! ( is_object( $params[2] ) && method_exists( $params[2], '__toString' ) )
882
+		if (isset($params[2])
883
+		     && ! is_int($params[2])
884
+		     && ! is_float($params[2])
885
+		     && ! is_string($params[2])
886
+		     && ! (is_object($params[2]) && method_exists($params[2], '__toString'))
887 887
 		) {
888
-			trigger_error( esc_html__( 'array_column(): The index key should be either a string or an integer.', 'give' ), E_USER_WARNING );
888
+			trigger_error(esc_html__('array_column(): The index key should be either a string or an integer.', 'give'), E_USER_WARNING);
889 889
 
890 890
 			return false;
891 891
 		}
892 892
 
893 893
 		$paramsInput     = $params[0];
894
-		$paramsColumnKey = ( $params[1] !== null ) ? (string) $params[1] : null;
894
+		$paramsColumnKey = ($params[1] !== null) ? (string) $params[1] : null;
895 895
 
896 896
 		$paramsIndexKey = null;
897
-		if ( isset( $params[2] ) ) {
898
-			if ( is_float( $params[2] ) || is_int( $params[2] ) ) {
897
+		if (isset($params[2])) {
898
+			if (is_float($params[2]) || is_int($params[2])) {
899 899
 				$paramsIndexKey = (int) $params[2];
900 900
 			} else {
901 901
 				$paramsIndexKey = (string) $params[2];
@@ -904,26 +904,26 @@  discard block
 block discarded – undo
904 904
 
905 905
 		$resultArray = array();
906 906
 
907
-		foreach ( $paramsInput as $row ) {
907
+		foreach ($paramsInput as $row) {
908 908
 			$key    = $value = null;
909 909
 			$keySet = $valueSet = false;
910 910
 
911
-			if ( $paramsIndexKey !== null && array_key_exists( $paramsIndexKey, $row ) ) {
911
+			if ($paramsIndexKey !== null && array_key_exists($paramsIndexKey, $row)) {
912 912
 				$keySet = true;
913
-				$key    = (string) $row[ $paramsIndexKey ];
913
+				$key    = (string) $row[$paramsIndexKey];
914 914
 			}
915 915
 
916
-			if ( $paramsColumnKey === null ) {
916
+			if ($paramsColumnKey === null) {
917 917
 				$valueSet = true;
918 918
 				$value    = $row;
919
-			} elseif ( is_array( $row ) && array_key_exists( $paramsColumnKey, $row ) ) {
919
+			} elseif (is_array($row) && array_key_exists($paramsColumnKey, $row)) {
920 920
 				$valueSet = true;
921
-				$value    = $row[ $paramsColumnKey ];
921
+				$value    = $row[$paramsColumnKey];
922 922
 			}
923 923
 
924
-			if ( $valueSet ) {
925
-				if ( $keySet ) {
926
-					$resultArray[ $key ] = $value;
924
+			if ($valueSet) {
925
+				if ($keySet) {
926
+					$resultArray[$key] = $value;
927 927
 				} else {
928 928
 					$resultArray[] = $value;
929 929
 				}
@@ -943,40 +943,40 @@  discard block
 block discarded – undo
943 943
  *
944 944
  * @return bool Whether the receipt is visible or not.
945 945
  */
946
-function give_can_view_receipt( $payment_key = '' ) {
946
+function give_can_view_receipt($payment_key = '') {
947 947
 
948 948
 	$return = false;
949 949
 
950
-	if ( empty( $payment_key ) ) {
950
+	if (empty($payment_key)) {
951 951
 		return $return;
952 952
 	}
953 953
 
954 954
 	global $give_receipt_args;
955 955
 
956
-	$give_receipt_args['id'] = give_get_purchase_id_by_key( $payment_key );
956
+	$give_receipt_args['id'] = give_get_purchase_id_by_key($payment_key);
957 957
 
958
-	$user_id = (int) give_get_payment_user_id( $give_receipt_args['id'] );
958
+	$user_id = (int) give_get_payment_user_id($give_receipt_args['id']);
959 959
 
960
-	$payment_meta = give_get_payment_meta( $give_receipt_args['id'] );
960
+	$payment_meta = give_get_payment_meta($give_receipt_args['id']);
961 961
 
962
-	if ( is_user_logged_in() ) {
963
-		if ( $user_id === (int) get_current_user_id() ) {
962
+	if (is_user_logged_in()) {
963
+		if ($user_id === (int) get_current_user_id()) {
964 964
 			$return = true;
965
-		} elseif ( wp_get_current_user()->user_email === give_get_payment_user_email( $give_receipt_args['id'] ) ) {
965
+		} elseif (wp_get_current_user()->user_email === give_get_payment_user_email($give_receipt_args['id'])) {
966 966
 			$return = true;
967
-		} elseif ( current_user_can( 'view_give_sensitive_data' ) ) {
967
+		} elseif (current_user_can('view_give_sensitive_data')) {
968 968
 			$return = true;
969 969
 		}
970 970
 	}
971 971
 
972 972
 	$session = give_get_purchase_session();
973
-	if ( ! empty( $session ) && ! is_user_logged_in() ) {
974
-		if ( $session['purchase_key'] === $payment_meta['key'] ) {
973
+	if ( ! empty($session) && ! is_user_logged_in()) {
974
+		if ($session['purchase_key'] === $payment_meta['key']) {
975 975
 			$return = true;
976 976
 		}
977 977
 	}
978 978
 
979
-	return (bool) apply_filters( 'give_can_view_receipt', $return, $payment_key );
979
+	return (bool) apply_filters('give_can_view_receipt', $return, $payment_key);
980 980
 
981 981
 }
982 982
 
@@ -985,7 +985,7 @@  discard block
 block discarded – undo
985 985
  *
986 986
  * Fallback in case the calendar extension is not loaded in PHP; Only supports Gregorian calendar
987 987
  */
988
-if ( ! function_exists( 'cal_days_in_month' ) ) {
988
+if ( ! function_exists('cal_days_in_month')) {
989 989
 	/**
990 990
 	 * cal_days_in_month
991 991
 	 *
@@ -995,8 +995,8 @@  discard block
 block discarded – undo
995 995
 	 *
996 996
 	 * @return bool|string
997 997
 	 */
998
-	function cal_days_in_month( $calendar, $month, $year ) {
999
-		return date( 't', mktime( 0, 0, 0, $month, 1, $year ) );
998
+	function cal_days_in_month($calendar, $month, $year) {
999
+		return date('t', mktime(0, 0, 0, $month, 1, $year));
1000 1000
 	}
1001 1001
 }
1002 1002
 
@@ -1015,42 +1015,42 @@  discard block
 block discarded – undo
1015 1015
  */
1016 1016
 function give_get_plugins() {
1017 1017
 	$plugins             = get_plugins();
1018
-	$active_plugin_paths = (array) get_option( 'active_plugins', array() );
1018
+	$active_plugin_paths = (array) get_option('active_plugins', array());
1019 1019
 
1020
-	if ( is_multisite() ) {
1021
-		$network_activated_plugin_paths = array_keys( get_site_option( 'active_sitewide_plugins', array() ) );
1022
-		$active_plugin_paths            = array_merge( $active_plugin_paths, $network_activated_plugin_paths );
1020
+	if (is_multisite()) {
1021
+		$network_activated_plugin_paths = array_keys(get_site_option('active_sitewide_plugins', array()));
1022
+		$active_plugin_paths            = array_merge($active_plugin_paths, $network_activated_plugin_paths);
1023 1023
 	}
1024 1024
 
1025
-	foreach ( $plugins as $plugin_path => $plugin_data ) {
1025
+	foreach ($plugins as $plugin_path => $plugin_data) {
1026 1026
 		// Is plugin active?
1027
-		if ( in_array( $plugin_path, $active_plugin_paths ) ) {
1028
-			$plugins[ $plugin_path ]['Status'] = 'active';
1027
+		if (in_array($plugin_path, $active_plugin_paths)) {
1028
+			$plugins[$plugin_path]['Status'] = 'active';
1029 1029
 		} else {
1030
-			$plugins[ $plugin_path ]['Status'] = 'inactive';
1030
+			$plugins[$plugin_path]['Status'] = 'inactive';
1031 1031
 		}
1032 1032
 
1033
-		$dirname = strtolower( dirname( $plugin_path ) );
1033
+		$dirname = strtolower(dirname($plugin_path));
1034 1034
 
1035 1035
 		// Is plugin a Give add-on by WordImpress?
1036
-		if ( strstr( $dirname, 'give-' ) && strstr( $plugin_data['AuthorURI'], 'wordimpress.com' ) ) {
1036
+		if (strstr($dirname, 'give-') && strstr($plugin_data['AuthorURI'], 'wordimpress.com')) {
1037 1037
 			// Plugin is a Give-addon.
1038
-			$plugins[ $plugin_path ]['Type'] = 'add-on';
1038
+			$plugins[$plugin_path]['Type'] = 'add-on';
1039 1039
 
1040 1040
 			// Get license info from database.
1041
-			$plugin_name    = str_replace( 'Give - ', '', $plugin_data['Name'] );
1042
-			$db_option      = 'give_' . preg_replace( '/[^a-zA-Z0-9_\s]/', '', str_replace( ' ', '_', strtolower( $plugin_name ) ) ) . '_license_active';
1043
-			$license_active = get_option( $db_option );
1041
+			$plugin_name    = str_replace('Give - ', '', $plugin_data['Name']);
1042
+			$db_option      = 'give_'.preg_replace('/[^a-zA-Z0-9_\s]/', '', str_replace(' ', '_', strtolower($plugin_name))).'_license_active';
1043
+			$license_active = get_option($db_option);
1044 1044
 
1045 1045
 			// Does a valid license exist?
1046
-			if ( ! empty( $license_active ) && 'valid' === $license_active->license ) {
1047
-				$plugins[ $plugin_path ]['License'] = true;
1046
+			if ( ! empty($license_active) && 'valid' === $license_active->license) {
1047
+				$plugins[$plugin_path]['License'] = true;
1048 1048
 			} else {
1049
-				$plugins[ $plugin_path ]['License'] = false;
1049
+				$plugins[$plugin_path]['License'] = false;
1050 1050
 			}
1051 1051
 		} else {
1052 1052
 			// Plugin is not a Give add-on.
1053
-			$plugins[ $plugin_path ]['Type'] = 'other';
1053
+			$plugins[$plugin_path]['Type'] = 'other';
1054 1054
 		}
1055 1055
 	}
1056 1056
 
@@ -1067,16 +1067,16 @@  discard block
 block discarded – undo
1067 1067
  *
1068 1068
  * @return bool
1069 1069
  */
1070
-function give_is_terms_enabled( $form_id ) {
1071
-	$form_option = give_get_meta( $form_id, '_give_terms_option', true );
1070
+function give_is_terms_enabled($form_id) {
1071
+	$form_option = give_get_meta($form_id, '_give_terms_option', true);
1072 1072
 
1073 1073
 	if (
1074
-		give_is_setting_enabled( $form_option, 'global' )
1075
-		&& give_is_setting_enabled( give_get_option( 'terms' ) )
1074
+		give_is_setting_enabled($form_option, 'global')
1075
+		&& give_is_setting_enabled(give_get_option('terms'))
1076 1076
 	) {
1077 1077
 		return true;
1078 1078
 
1079
-	} elseif ( give_is_setting_enabled( $form_option ) ) {
1079
+	} elseif (give_is_setting_enabled($form_option)) {
1080 1080
 		return true;
1081 1081
 
1082 1082
 	} else {
@@ -1100,9 +1100,9 @@  discard block
 block discarded – undo
1100 1100
  *
1101 1101
  * @return WP_Error|bool
1102 1102
  */
1103
-function give_delete_donation_stats( $date_range = '', $args = array() ) {
1103
+function give_delete_donation_stats($date_range = '', $args = array()) {
1104 1104
 	// Delete all cache.
1105
-	$status = Give_Cache::delete( Give_Cache::get_options_like( 'give_stats' ) );
1105
+	$status = Give_Cache::delete(Give_Cache::get_options_like('give_stats'));
1106 1106
 
1107 1107
 	/**
1108 1108
 	 * Fire the action when donation stats delete.
@@ -1112,7 +1112,7 @@  discard block
 block discarded – undo
1112 1112
 	 * @param string|array $date_range
1113 1113
 	 * @param array        $args
1114 1114
 	 */
1115
-	do_action( 'give_delete_donation_stats', $status, $date_range, $args );
1115
+	do_action('give_delete_donation_stats', $status, $date_range, $args);
1116 1116
 
1117 1117
 	return $status;
1118 1118
 }
@@ -1130,7 +1130,7 @@  discard block
 block discarded – undo
1130 1130
  *
1131 1131
  * @return mixed
1132 1132
  */
1133
-function give_get_meta( $id, $meta_key, $single = false, $default = false ) {
1133
+function give_get_meta($id, $meta_key, $single = false, $default = false) {
1134 1134
 	/**
1135 1135
 	 * Filter the meta value
1136 1136
 	 *
@@ -1138,14 +1138,14 @@  discard block
 block discarded – undo
1138 1138
 	 */
1139 1139
 	$meta_value = apply_filters(
1140 1140
 		'give_get_meta',
1141
-		get_post_meta( $id, $meta_key, $single ),
1141
+		get_post_meta($id, $meta_key, $single),
1142 1142
 		$id,
1143 1143
 		$meta_key,
1144 1144
 		$default
1145 1145
 	);
1146 1146
 
1147 1147
 	if (
1148
-		( empty( $meta_key ) || empty( $meta_value ) )
1148
+		(empty($meta_key) || empty($meta_value))
1149 1149
 		&& $default
1150 1150
 	) {
1151 1151
 		$meta_value = $default;
@@ -1166,15 +1166,15 @@  discard block
 block discarded – undo
1166 1166
  *
1167 1167
  * @return mixed
1168 1168
  */
1169
-function give_update_meta( $id, $meta_key, $meta_value, $prev_value = '' ) {
1170
-	$status = update_post_meta( $id, $meta_key, $meta_value, $prev_value );
1169
+function give_update_meta($id, $meta_key, $meta_value, $prev_value = '') {
1170
+	$status = update_post_meta($id, $meta_key, $meta_value, $prev_value);
1171 1171
 
1172 1172
 	/**
1173 1173
 	 * Filter the meta value update status
1174 1174
 	 *
1175 1175
 	 * @since 1.8.8
1176 1176
 	 */
1177
-	return apply_filters( 'give_update_meta', $status, $id, $meta_key, $meta_value );
1177
+	return apply_filters('give_update_meta', $status, $id, $meta_key, $meta_value);
1178 1178
 }
1179 1179
 
1180 1180
 /**
@@ -1188,15 +1188,15 @@  discard block
 block discarded – undo
1188 1188
  *
1189 1189
  * @return mixed
1190 1190
  */
1191
-function give_delete_meta( $id, $meta_key, $meta_value = '' ) {
1192
-	$status = delete_post_meta( $id, $meta_key, $meta_value );
1191
+function give_delete_meta($id, $meta_key, $meta_value = '') {
1192
+	$status = delete_post_meta($id, $meta_key, $meta_value);
1193 1193
 
1194 1194
 	/**
1195 1195
 	 * Filter the meta value delete status
1196 1196
 	 *
1197 1197
 	 * @since 1.8.8
1198 1198
 	 */
1199
-	return apply_filters( 'give_delete_meta', $status, $id, $meta_key, $meta_value );
1199
+	return apply_filters('give_delete_meta', $status, $id, $meta_key, $meta_value);
1200 1200
 }
1201 1201
 
1202 1202
 /**
@@ -1208,15 +1208,15 @@  discard block
 block discarded – undo
1208 1208
  *
1209 1209
  * @return bool                   If the action has been added to the completed actions array
1210 1210
  */
1211
-function give_has_upgrade_completed( $upgrade_action = '' ) {
1211
+function give_has_upgrade_completed($upgrade_action = '') {
1212 1212
 
1213
-	if ( empty( $upgrade_action ) ) {
1213
+	if (empty($upgrade_action)) {
1214 1214
 		return false;
1215 1215
 	}
1216 1216
 
1217 1217
 	$completed_upgrades = give_get_completed_upgrades();
1218 1218
 
1219
-	return in_array( $upgrade_action, $completed_upgrades );
1219
+	return in_array($upgrade_action, $completed_upgrades);
1220 1220
 
1221 1221
 }
1222 1222
 
@@ -1228,8 +1228,8 @@  discard block
 block discarded – undo
1228 1228
  * @return mixed   When nothing to resume returns false, otherwise starts the upgrade where it left off
1229 1229
  */
1230 1230
 function give_maybe_resume_upgrade() {
1231
-	$doing_upgrade = get_option( 'give_doing_upgrade', false );
1232
-	if ( empty( $doing_upgrade ) ) {
1231
+	$doing_upgrade = get_option('give_doing_upgrade', false);
1232
+	if (empty($doing_upgrade)) {
1233 1233
 		return false;
1234 1234
 	}
1235 1235
 
@@ -1245,9 +1245,9 @@  discard block
 block discarded – undo
1245 1245
  *
1246 1246
  * @return bool                   If the function was successfully added
1247 1247
  */
1248
-function give_set_upgrade_complete( $upgrade_action = '' ) {
1248
+function give_set_upgrade_complete($upgrade_action = '') {
1249 1249
 
1250
-	if ( empty( $upgrade_action ) ) {
1250
+	if (empty($upgrade_action)) {
1251 1251
 		return false;
1252 1252
 	}
1253 1253
 
@@ -1255,16 +1255,16 @@  discard block
 block discarded – undo
1255 1255
 	$completed_upgrades[] = $upgrade_action;
1256 1256
 
1257 1257
 	// Remove any blanks, and only show uniques.
1258
-	$completed_upgrades = array_unique( array_values( $completed_upgrades ) );
1258
+	$completed_upgrades = array_unique(array_values($completed_upgrades));
1259 1259
 
1260 1260
 	/**
1261 1261
 	 * Fire the action when any upgrade set to complete.
1262 1262
 	 *
1263 1263
 	 * @since 1.8.12
1264 1264
 	 */
1265
-	do_action( 'give_set_upgrade_completed', $upgrade_action, $completed_upgrades );
1265
+	do_action('give_set_upgrade_completed', $upgrade_action, $completed_upgrades);
1266 1266
 
1267
-	return update_option( 'give_completed_upgrades', $completed_upgrades );
1267
+	return update_option('give_completed_upgrades', $completed_upgrades);
1268 1268
 }
1269 1269
 
1270 1270
 /**
@@ -1275,7 +1275,7 @@  discard block
 block discarded – undo
1275 1275
  */
1276 1276
 function give_get_completed_upgrades() {
1277 1277
 
1278
-	return (array) get_option( 'give_completed_upgrades' );
1278
+	return (array) get_option('give_completed_upgrades');
1279 1279
 
1280 1280
 }
1281 1281
 
Please login to merge, or discard this patch.
includes/class-give-db.php 2 patches
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -111,14 +111,14 @@  discard block
 block discarded – undo
111 111
 	 * @since  1.0
112 112
 	 * @access public
113 113
 	 *
114
-     * @param  int $column Column ID.
115
-     * @param  int $row_id Row ID.
116
-     *
117
-     * @return object
114
+	 * @param  int $column Column ID.
115
+	 * @param  int $row_id Row ID.
116
+	 *
117
+	 * @return object
118 118
 	 */
119 119
 	public function get_by( $column, $row_id ) {
120
-        /* @var WPDB $wpdb */
121
-        global $wpdb;
120
+		/* @var WPDB $wpdb */
121
+		global $wpdb;
122 122
 
123 123
 		$column = esc_sql( $column );
124 124
 		return $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $this->table_name WHERE $column = %s LIMIT 1;", $row_id ) );
@@ -129,15 +129,15 @@  discard block
 block discarded – undo
129 129
 	 *
130 130
 	 * @since  1.0
131 131
 	 * @access public
132
-     *
133
-     * @param  int $column Column ID.
134
-     * @param  int $row_id Row ID.
135
-     *
132
+	 *
133
+	 * @param  int $column Column ID.
134
+	 * @param  int $row_id Row ID.
135
+	 *
136 136
 	 * @return string      Column value.
137 137
 	 */
138 138
 	public function get_column( $column, $row_id ) {
139
-        /* @var WPDB $wpdb */
140
-        global $wpdb;
139
+		/* @var WPDB $wpdb */
140
+		global $wpdb;
141 141
 
142 142
 		$column = esc_sql( $column );
143 143
 		return $wpdb->get_var( $wpdb->prepare( "SELECT $column FROM $this->table_name WHERE $this->primary_key = %s LIMIT 1;", $row_id ) );
@@ -148,16 +148,16 @@  discard block
 block discarded – undo
148 148
 	 *
149 149
 	 * @since  1.0
150 150
 	 * @access public
151
-     *
152
-     * @param  int    $column       Column ID.
153
-     * @param  string $column_where Column name.
154
-     * @param  string $column_value Column value.
155
-     *
151
+	 *
152
+	 * @param  int    $column       Column ID.
153
+	 * @param  string $column_where Column name.
154
+	 * @param  string $column_value Column value.
155
+	 *
156 156
 	 * @return string
157 157
 	 */
158 158
 	public function get_column_by( $column, $column_where, $column_value ) {
159
-        /* @var WPDB $wpdb */
160
-        global $wpdb;
159
+		/* @var WPDB $wpdb */
160
+		global $wpdb;
161 161
 
162 162
 		$column_where = esc_sql( $column_where );
163 163
 		$column       = esc_sql( $column );
@@ -169,15 +169,15 @@  discard block
 block discarded – undo
169 169
 	 *
170 170
 	 * @since  1.0
171 171
 	 * @access public
172
-     *
173
-     * @param  array  $data
174
-     * @param  string $type
175
-     *
172
+	 *
173
+	 * @param  array  $data
174
+	 * @param  string $type
175
+	 *
176 176
 	 * @return int
177 177
 	 */
178 178
 	public function insert( $data, $type = '' ) {
179
-        /* @var WPDB $wpdb */
180
-        global $wpdb;
179
+		/* @var WPDB $wpdb */
180
+		global $wpdb;
181 181
 
182 182
 		// Set default values.
183 183
 		$data = wp_parse_args( $data, $this->get_column_defaults() );
@@ -224,16 +224,16 @@  discard block
 block discarded – undo
224 224
 	 *
225 225
 	 * @since  1.0
226 226
 	 * @access public
227
-     *
228
-     * @param  int    $row_id Column ID
229
-     * @param  array  $data
230
-     * @param  string $where  Column value
231
-     *
227
+	 *
228
+	 * @param  int    $row_id Column ID
229
+	 * @param  array  $data
230
+	 * @param  string $where  Column value
231
+	 *
232 232
 	 * @return bool
233 233
 	 */
234 234
 	public function update( $row_id, $data = array(), $where = '' ) {
235
-        /* @var WPDB $wpdb */
236
-        global $wpdb;
235
+		/* @var WPDB $wpdb */
236
+		global $wpdb;
237 237
 
238 238
 		// Row ID must be positive integer
239 239
 		$row_id = absint( $row_id );
@@ -271,14 +271,14 @@  discard block
 block discarded – undo
271 271
 	 *
272 272
 	 * @since  1.0
273 273
 	 * @access public
274
-     *
275
-     * @param  int $row_id Column ID.
276
-     *
274
+	 *
275
+	 * @param  int $row_id Column ID.
276
+	 *
277 277
 	 * @return bool
278 278
 	 */
279 279
 	public function delete( $row_id = 0 ) {
280
-        /* @var WPDB $wpdb */
281
-        global $wpdb;
280
+		/* @var WPDB $wpdb */
281
+		global $wpdb;
282 282
 
283 283
 		// Row ID must be positive integer
284 284
 		$row_id = absint( $row_id );
@@ -299,13 +299,13 @@  discard block
 block discarded – undo
299 299
 	 *
300 300
 	 * @since  1.3.2
301 301
 	 * @access public
302
-     *
302
+	 *
303 303
 	 * @param  string $table The table name.
304
-     *
304
+	 *
305 305
 	 * @return bool          If the table name exists.
306 306
 	 */
307 307
 	public function table_exists( $table ) {
308
-        /* @var WPDB $wpdb */
308
+		/* @var WPDB $wpdb */
309 309
 		global $wpdb;
310 310
 
311 311
 		$table = sanitize_text_field( $table );
Please login to merge, or discard this patch.
Spacing   +42 added lines, -42 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
 
@@ -98,11 +98,11 @@  discard block
 block discarded – undo
98 98
 	 *
99 99
 	 * @return object
100 100
 	 */
101
-	public function get( $row_id ) {
101
+	public function get($row_id) {
102 102
 		/* @var WPDB $wpdb */
103 103
 		global $wpdb;
104 104
 
105
-		return $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $this->table_name WHERE $this->primary_key = %s LIMIT 1;", $row_id ) );
105
+		return $wpdb->get_row($wpdb->prepare("SELECT * FROM $this->table_name WHERE $this->primary_key = %s LIMIT 1;", $row_id));
106 106
 	}
107 107
 
108 108
 	/**
@@ -116,12 +116,12 @@  discard block
 block discarded – undo
116 116
      *
117 117
      * @return object
118 118
 	 */
119
-	public function get_by( $column, $row_id ) {
119
+	public function get_by($column, $row_id) {
120 120
         /* @var WPDB $wpdb */
121 121
         global $wpdb;
122 122
 
123
-		$column = esc_sql( $column );
124
-		return $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $this->table_name WHERE $column = %s LIMIT 1;", $row_id ) );
123
+		$column = esc_sql($column);
124
+		return $wpdb->get_row($wpdb->prepare("SELECT * FROM $this->table_name WHERE $column = %s LIMIT 1;", $row_id));
125 125
 	}
126 126
 
127 127
 	/**
@@ -135,12 +135,12 @@  discard block
 block discarded – undo
135 135
      *
136 136
 	 * @return string      Column value.
137 137
 	 */
138
-	public function get_column( $column, $row_id ) {
138
+	public function get_column($column, $row_id) {
139 139
         /* @var WPDB $wpdb */
140 140
         global $wpdb;
141 141
 
142
-		$column = esc_sql( $column );
143
-		return $wpdb->get_var( $wpdb->prepare( "SELECT $column FROM $this->table_name WHERE $this->primary_key = %s LIMIT 1;", $row_id ) );
142
+		$column = esc_sql($column);
143
+		return $wpdb->get_var($wpdb->prepare("SELECT $column FROM $this->table_name WHERE $this->primary_key = %s LIMIT 1;", $row_id));
144 144
 	}
145 145
 
146 146
 	/**
@@ -155,13 +155,13 @@  discard block
 block discarded – undo
155 155
      *
156 156
 	 * @return string
157 157
 	 */
158
-	public function get_column_by( $column, $column_where, $column_value ) {
158
+	public function get_column_by($column, $column_where, $column_value) {
159 159
         /* @var WPDB $wpdb */
160 160
         global $wpdb;
161 161
 
162
-		$column_where = esc_sql( $column_where );
163
-		$column       = esc_sql( $column );
164
-		return $wpdb->get_var( $wpdb->prepare( "SELECT $column FROM $this->table_name WHERE $column_where = %s LIMIT 1;", $column_value ) );
162
+		$column_where = esc_sql($column_where);
163
+		$column       = esc_sql($column);
164
+		return $wpdb->get_var($wpdb->prepare("SELECT $column FROM $this->table_name WHERE $column_where = %s LIMIT 1;", $column_value));
165 165
 	}
166 166
 
167 167
 	/**
@@ -175,12 +175,12 @@  discard block
 block discarded – undo
175 175
      *
176 176
 	 * @return int
177 177
 	 */
178
-	public function insert( $data, $type = '' ) {
178
+	public function insert($data, $type = '') {
179 179
         /* @var WPDB $wpdb */
180 180
         global $wpdb;
181 181
 
182 182
 		// Set default values.
183
-		$data = wp_parse_args( $data, $this->get_column_defaults() );
183
+		$data = wp_parse_args($data, $this->get_column_defaults());
184 184
 
185 185
 		/**
186 186
 		 * Fires before inserting data to the database.
@@ -189,22 +189,22 @@  discard block
 block discarded – undo
189 189
 		 *
190 190
 		 * @param array $data
191 191
 		 */
192
-		do_action( "give_pre_insert_{$type}", $data );
192
+		do_action("give_pre_insert_{$type}", $data);
193 193
 
194 194
 		// Initialise column format array
195 195
 		$column_formats = $this->get_columns();
196 196
 
197 197
 		// Force fields to lower case
198
-		$data = array_change_key_case( $data );
198
+		$data = array_change_key_case($data);
199 199
 
200 200
 		// White list columns
201
-		$data = array_intersect_key( $data, $column_formats );
201
+		$data = array_intersect_key($data, $column_formats);
202 202
 
203 203
 		// Reorder $column_formats to match the order of columns given in $data
204
-		$data_keys      = array_keys( $data );
205
-		$column_formats = array_merge( array_flip( $data_keys ), $column_formats );
204
+		$data_keys      = array_keys($data);
205
+		$column_formats = array_merge(array_flip($data_keys), $column_formats);
206 206
 
207
-		$wpdb->insert( $this->table_name, $data, $column_formats );
207
+		$wpdb->insert($this->table_name, $data, $column_formats);
208 208
 
209 209
 		/**
210 210
 		 * Fires after inserting data to the database.
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 		 * @param int   $insert_id
215 215
 		 * @param array $data
216 216
 		 */
217
-		do_action( "give_post_insert_{$type}", $wpdb->insert_id, $data );
217
+		do_action("give_post_insert_{$type}", $wpdb->insert_id, $data);
218 218
 
219 219
 		return $wpdb->insert_id;
220 220
 	}
@@ -231,18 +231,18 @@  discard block
 block discarded – undo
231 231
      *
232 232
 	 * @return bool
233 233
 	 */
234
-	public function update( $row_id, $data = array(), $where = '' ) {
234
+	public function update($row_id, $data = array(), $where = '') {
235 235
         /* @var WPDB $wpdb */
236 236
         global $wpdb;
237 237
 
238 238
 		// Row ID must be positive integer
239
-		$row_id = absint( $row_id );
239
+		$row_id = absint($row_id);
240 240
 
241
-		if ( empty( $row_id ) ) {
241
+		if (empty($row_id)) {
242 242
 			return false;
243 243
 		}
244 244
 
245
-		if ( empty( $where ) ) {
245
+		if (empty($where)) {
246 246
 			$where = $this->primary_key;
247 247
 		}
248 248
 
@@ -250,16 +250,16 @@  discard block
 block discarded – undo
250 250
 		$column_formats = $this->get_columns();
251 251
 
252 252
 		// Force fields to lower case
253
-		$data = array_change_key_case( $data );
253
+		$data = array_change_key_case($data);
254 254
 
255 255
 		// White list columns
256
-		$data = array_intersect_key( $data, $column_formats );
256
+		$data = array_intersect_key($data, $column_formats);
257 257
 
258 258
 		// Reorder $column_formats to match the order of columns given in $data
259
-		$data_keys      = array_keys( $data );
260
-		$column_formats = array_merge( array_flip( $data_keys ), $column_formats );
259
+		$data_keys      = array_keys($data);
260
+		$column_formats = array_merge(array_flip($data_keys), $column_formats);
261 261
 
262
-		if ( false === $wpdb->update( $this->table_name, $data, array( $where => $row_id ), $column_formats ) ) {
262
+		if (false === $wpdb->update($this->table_name, $data, array($where => $row_id), $column_formats)) {
263 263
 			return false;
264 264
 		}
265 265
 
@@ -276,18 +276,18 @@  discard block
 block discarded – undo
276 276
      *
277 277
 	 * @return bool
278 278
 	 */
279
-	public function delete( $row_id = 0 ) {
279
+	public function delete($row_id = 0) {
280 280
         /* @var WPDB $wpdb */
281 281
         global $wpdb;
282 282
 
283 283
 		// Row ID must be positive integer
284
-		$row_id = absint( $row_id );
284
+		$row_id = absint($row_id);
285 285
 
286
-		if ( empty( $row_id ) ) {
286
+		if (empty($row_id)) {
287 287
 			return false;
288 288
 		}
289 289
 
290
-		if ( false === $wpdb->query( $wpdb->prepare( "DELETE FROM $this->table_name WHERE $this->primary_key = %d", $row_id ) ) ) {
290
+		if (false === $wpdb->query($wpdb->prepare("DELETE FROM $this->table_name WHERE $this->primary_key = %d", $row_id))) {
291 291
 			return false;
292 292
 		}
293 293
 
@@ -304,13 +304,13 @@  discard block
 block discarded – undo
304 304
      *
305 305
 	 * @return bool          If the table name exists.
306 306
 	 */
307
-	public function table_exists( $table ) {
307
+	public function table_exists($table) {
308 308
         /* @var WPDB $wpdb */
309 309
 		global $wpdb;
310 310
 
311
-		$table = sanitize_text_field( $table );
311
+		$table = sanitize_text_field($table);
312 312
 
313
-		return $wpdb->get_var( $wpdb->prepare( "SHOW TABLES LIKE '%s'", $table ) ) === $table;
313
+		return $wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE '%s'", $table)) === $table;
314 314
 	}
315 315
 
316 316
 	/**
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 	 * @return bool Returns if the customers table was installed and upgrade routine run.
323 323
 	 */
324 324
 	public function installed() {
325
-		return $this->table_exists( $this->table_name );
325
+		return $this->table_exists($this->table_name);
326 326
 	}
327 327
 
328 328
 	/**
@@ -332,8 +332,8 @@  discard block
 block discarded – undo
332 332
 	 * @access public
333 333
 	 */
334 334
 	public function register_table() {
335
-		$current_version = get_option( $this->table_name . '_db_version' );
336
-		if ( ! $current_version || version_compare( $current_version, $this->version, '<' ) ) {
335
+		$current_version = get_option($this->table_name.'_db_version');
336
+		if ( ! $current_version || version_compare($current_version, $this->version, '<')) {
337 337
 			$this->create_table();
338 338
 		}
339 339
 	}
@@ -344,5 +344,5 @@  discard block
 block discarded – undo
344 344
 	 * @since  1.8.9
345 345
 	 * @access public
346 346
 	 */
347
-	public function create_table(){}
347
+	public function create_table() {}
348 348
 }
Please login to merge, or discard this patch.
includes/api/class-give-api-v1.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 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
 
Please login to merge, or discard this patch.
includes/filters.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -26,29 +26,29 @@  discard block
 block discarded – undo
26 26
  *
27 27
  * @return void
28 28
  */
29
-function give_set_settings_with_disable_prefix( $old_settings, $settings ) {
29
+function give_set_settings_with_disable_prefix($old_settings, $settings) {
30 30
 	// Get old setting names.
31
-	$old_settings   = array_flip( give_v18_renamed_core_settings() );
31
+	$old_settings   = array_flip(give_v18_renamed_core_settings());
32 32
 	$update_setting = false;
33 33
 
34
-	foreach ( $settings as $key => $value ) {
34
+	foreach ($settings as $key => $value) {
35 35
 
36 36
 		// Check 1. Check if new option is really updated or not.
37 37
 		// Check 2. Continue if key is not renamed.
38
-		if ( ! isset( $old_settings[ $key ] ) ) {
38
+		if ( ! isset($old_settings[$key])) {
39 39
 			continue;
40 40
 		}
41 41
 
42 42
 		// Set old setting.
43
-		$settings[ $old_settings[ $key ] ] = 'on';
43
+		$settings[$old_settings[$key]] = 'on';
44 44
 
45 45
 		// Do not need to set old setting if new setting is not set.
46 46
 		if (
47
-			( give_is_setting_enabled( $value ) && ( false !== strpos( $old_settings[ $key ], 'disable_' ) ) )
48
-			|| ( ! give_is_setting_enabled( $value ) && ( false !== strpos( $old_settings[ $key ], 'enable_' ) ) )
47
+			(give_is_setting_enabled($value) && (false !== strpos($old_settings[$key], 'disable_')))
48
+			|| ( ! give_is_setting_enabled($value) && (false !== strpos($old_settings[$key], 'enable_')))
49 49
 
50 50
 		) {
51
-			unset( $settings[ $old_settings[ $key ] ] );
51
+			unset($settings[$old_settings[$key]]);
52 52
 		}
53 53
 
54 54
 		// Tell bot to update setting.
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
 	}
57 57
 
58 58
 	// Update setting if any old setting set.
59
-	if ( $update_setting ) {
60
-		update_option( 'give_settings', $settings );
59
+	if ($update_setting) {
60
+		update_option('give_settings', $settings);
61 61
 	}
62 62
 }
63
-add_action( 'update_option_give_settings', 'give_set_settings_with_disable_prefix', 10, 2 );
63
+add_action('update_option_give_settings', 'give_set_settings_with_disable_prefix', 10, 2);
Please login to merge, or discard this patch.