Completed
Pull Request — master (#1012)
by Radoslav
01:31
created
includes/admin/class-wc-stripe-admin-notices.php 1 patch
Spacing   +94 added lines, -94 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) {
2
+if ( ! defined('ABSPATH')) {
3 3
 	exit;
4 4
 }
5 5
 
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
 	 * @since 4.1.0
22 22
 	 */
23 23
 	public function __construct() {
24
-		add_action( 'admin_notices', array( $this, 'admin_notices' ) );
25
-		add_action( 'wp_loaded', array( $this, 'hide_notices' ) );
26
-		add_action( 'woocommerce_stripe_updated', array( $this, 'stripe_updated' ) );
24
+		add_action('admin_notices', array($this, 'admin_notices'));
25
+		add_action('wp_loaded', array($this, 'hide_notices'));
26
+		add_action('woocommerce_stripe_updated', array($this, 'stripe_updated'));
27 27
 	}
28 28
 
29 29
 	/**
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
 	 * @since 1.0.0
33 33
 	 * @version 4.0.0
34 34
 	 */
35
-	public function add_admin_notice( $slug, $class, $message, $dismissible = false ) {
36
-		$this->notices[ $slug ] = array(
35
+	public function add_admin_notice($slug, $class, $message, $dismissible = false) {
36
+		$this->notices[$slug] = array(
37 37
 			'class'       => $class,
38 38
 			'message'     => $message,
39 39
 			'dismissible' => $dismissible,
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	 * @version 4.0.0
48 48
 	 */
49 49
 	public function admin_notices() {
50
-		if ( ! current_user_can( 'manage_woocommerce' ) ) {
50
+		if ( ! current_user_can('manage_woocommerce')) {
51 51
 			return;
52 52
 		}
53 53
 
@@ -57,17 +57,17 @@  discard block
 block discarded – undo
57 57
 		// All other payment methods.
58 58
 		$this->payment_methods_check_environment();
59 59
 
60
-		foreach ( (array) $this->notices as $notice_key => $notice ) {
61
-			echo '<div class="' . esc_attr( $notice['class'] ) . '" style="position:relative;">';
60
+		foreach ((array) $this->notices as $notice_key => $notice) {
61
+			echo '<div class="' . esc_attr($notice['class']) . '" style="position:relative;">';
62 62
 
63
-			if ( $notice['dismissible'] ) {
63
+			if ($notice['dismissible']) {
64 64
 				?>
65
-				<a href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc-stripe-hide-notice', $notice_key ), 'wc_stripe_hide_notices_nonce', '_wc_stripe_notice_nonce' ) ); ?>" class="woocommerce-message-close notice-dismiss" style="position:relative;float:right;padding:9px 0px 9px 9px 9px;text-decoration:none;"></a>
65
+				<a href="<?php echo esc_url(wp_nonce_url(add_query_arg('wc-stripe-hide-notice', $notice_key), 'wc_stripe_hide_notices_nonce', '_wc_stripe_notice_nonce')); ?>" class="woocommerce-message-close notice-dismiss" style="position:relative;float:right;padding:9px 0px 9px 9px 9px;text-decoration:none;"></a>
66 66
 				<?php
67 67
 			}
68 68
 
69 69
 			echo '<p>';
70
-			echo wp_kses( $notice['message'], array( 'a' => array( 'href' => array(), 'target' => array() ) ) );
70
+			echo wp_kses($notice['message'], array('a' => array('href' => array(), 'target' => array())));
71 71
 			echo '</p></div>';
72 72
 		}
73 73
 	}
@@ -100,104 +100,104 @@  discard block
 block discarded – undo
100 100
 	 * @version 4.0.0
101 101
 	 */
102 102
 	public function stripe_check_environment() {
103
-		$show_style_notice  = get_option( 'wc_stripe_show_style_notice' );
104
-		$show_ssl_notice    = get_option( 'wc_stripe_show_ssl_notice' );
105
-		$show_keys_notice   = get_option( 'wc_stripe_show_keys_notice' );
106
-		$show_3ds_notice    = get_option( 'wc_stripe_show_3ds_notice' );
107
-		$show_phpver_notice = get_option( 'wc_stripe_show_phpver_notice' );
108
-		$show_wcver_notice  = get_option( 'wc_stripe_show_wcver_notice' );
109
-		$show_curl_notice   = get_option( 'wc_stripe_show_curl_notice' );
110
-		$options            = get_option( 'woocommerce_stripe_settings' );
111
-		$testmode           = ( isset( $options['testmode'] ) && 'yes' === $options['testmode'] ) ? true : false;
112
-		$test_pub_key       = isset( $options['test_publishable_key'] ) ? $options['test_publishable_key'] : '';
113
-		$test_secret_key    = isset( $options['test_secret_key'] ) ? $options['test_secret_key'] : '';
114
-		$live_pub_key       = isset( $options['publishable_key'] ) ? $options['publishable_key'] : '';
115
-		$live_secret_key    = isset( $options['secret_key'] ) ? $options['secret_key'] : '';
116
-		$three_d_secure     = isset( $options['three_d_secure'] ) && 'yes' === $options['three_d_secure'];
117
-
118
-		if ( isset( $options['enabled'] ) && 'yes' === $options['enabled'] ) {
119
-			if ( empty( $show_3ds_notice ) && $three_d_secure ) {
103
+		$show_style_notice  = get_option('wc_stripe_show_style_notice');
104
+		$show_ssl_notice    = get_option('wc_stripe_show_ssl_notice');
105
+		$show_keys_notice   = get_option('wc_stripe_show_keys_notice');
106
+		$show_3ds_notice    = get_option('wc_stripe_show_3ds_notice');
107
+		$show_phpver_notice = get_option('wc_stripe_show_phpver_notice');
108
+		$show_wcver_notice  = get_option('wc_stripe_show_wcver_notice');
109
+		$show_curl_notice   = get_option('wc_stripe_show_curl_notice');
110
+		$options            = get_option('woocommerce_stripe_settings');
111
+		$testmode           = (isset($options['testmode']) && 'yes' === $options['testmode']) ? true : false;
112
+		$test_pub_key       = isset($options['test_publishable_key']) ? $options['test_publishable_key'] : '';
113
+		$test_secret_key    = isset($options['test_secret_key']) ? $options['test_secret_key'] : '';
114
+		$live_pub_key       = isset($options['publishable_key']) ? $options['publishable_key'] : '';
115
+		$live_secret_key    = isset($options['secret_key']) ? $options['secret_key'] : '';
116
+		$three_d_secure     = isset($options['three_d_secure']) && 'yes' === $options['three_d_secure'];
117
+
118
+		if (isset($options['enabled']) && 'yes' === $options['enabled']) {
119
+			if (empty($show_3ds_notice) && $three_d_secure) {
120 120
 				$url = 'https://stripe.com/docs/payments/3d-secure#three-ds-radar';
121 121
 
122 122
 				/* translators: 1) A URL that explains Stripe Radar. */
123
-				$message = __( 'WooCommerce Stripe - We see that you had the "Require 3D secure when applicable" setting turned on. This setting is not available here anymore, because it is now replaced by Stripe Radar. You can learn more about it <a href="%s" target="_blank">here</a>.', 'woocommerce-gateway-stripe' );
123
+				$message = __('WooCommerce Stripe - We see that you had the "Require 3D secure when applicable" setting turned on. This setting is not available here anymore, because it is now replaced by Stripe Radar. You can learn more about it <a href="%s" target="_blank">here</a>.', 'woocommerce-gateway-stripe');
124 124
 
125
-				$this->add_admin_notice( '3ds', 'notice notice-warning', sprintf( $message, $url ), true );
125
+				$this->add_admin_notice('3ds', 'notice notice-warning', sprintf($message, $url), true);
126 126
 			}
127 127
 
128
-			if ( empty( $show_style_notice ) ) {
128
+			if (empty($show_style_notice)) {
129 129
 				/* translators: 1) int version 2) int version */
130
-				$message = __( 'WooCommerce Stripe - We recently made changes to Stripe that may impact the appearance of your checkout. If your checkout has changed unexpectedly, please follow these <a href="https://docs.woocommerce.com/document/stripe/#section-45" target="_blank">instructions</a> to fix.', 'woocommerce-gateway-stripe' );
130
+				$message = __('WooCommerce Stripe - We recently made changes to Stripe that may impact the appearance of your checkout. If your checkout has changed unexpectedly, please follow these <a href="https://docs.woocommerce.com/document/stripe/#section-45" target="_blank">instructions</a> to fix.', 'woocommerce-gateway-stripe');
131 131
 
132
-				$this->add_admin_notice( 'style', 'notice notice-warning', $message, true );
132
+				$this->add_admin_notice('style', 'notice notice-warning', $message, true);
133 133
 
134 134
 				return;
135 135
 			}
136 136
 
137
-			if ( empty( $show_phpver_notice ) ) {
138
-				if ( version_compare( phpversion(), WC_STRIPE_MIN_PHP_VER, '<' ) ) {
137
+			if (empty($show_phpver_notice)) {
138
+				if (version_compare(phpversion(), WC_STRIPE_MIN_PHP_VER, '<')) {
139 139
 					/* translators: 1) int version 2) int version */
140
-					$message = __( 'WooCommerce Stripe - The minimum PHP version required for this plugin is %1$s. You are running %2$s.', 'woocommerce-gateway-stripe' );
140
+					$message = __('WooCommerce Stripe - The minimum PHP version required for this plugin is %1$s. You are running %2$s.', 'woocommerce-gateway-stripe');
141 141
 
142
-					$this->add_admin_notice( 'phpver', 'error', sprintf( $message, WC_STRIPE_MIN_PHP_VER, phpversion() ), true );
142
+					$this->add_admin_notice('phpver', 'error', sprintf($message, WC_STRIPE_MIN_PHP_VER, phpversion()), true);
143 143
 
144 144
 					return;
145 145
 				}
146 146
 			}
147 147
 
148
-			if ( empty( $show_wcver_notice ) ) {
149
-				if ( version_compare( WC_VERSION, WC_STRIPE_MIN_WC_VER, '<' ) ) {
148
+			if (empty($show_wcver_notice)) {
149
+				if (version_compare(WC_VERSION, WC_STRIPE_MIN_WC_VER, '<')) {
150 150
 					/* translators: 1) int version 2) int version */
151
-					$message = __( 'WooCommerce Stripe - The minimum WooCommerce version required for this plugin is %1$s. You are running %2$s.', 'woocommerce-gateway-stripe' );
151
+					$message = __('WooCommerce Stripe - The minimum WooCommerce version required for this plugin is %1$s. You are running %2$s.', 'woocommerce-gateway-stripe');
152 152
 
153
-					$this->add_admin_notice( 'wcver', 'notice notice-warning', sprintf( $message, WC_STRIPE_MIN_WC_VER, WC_VERSION ), true );
153
+					$this->add_admin_notice('wcver', 'notice notice-warning', sprintf($message, WC_STRIPE_MIN_WC_VER, WC_VERSION), true);
154 154
 
155 155
 					return;
156 156
 				}
157 157
 			}
158 158
 
159
-			if ( empty( $show_curl_notice ) ) {
160
-				if ( ! function_exists( 'curl_init' ) ) {
161
-					$this->add_admin_notice( 'curl', 'notice notice-warning', __( 'WooCommerce Stripe - cURL is not installed.', 'woocommerce-gateway-stripe' ), true );
159
+			if (empty($show_curl_notice)) {
160
+				if ( ! function_exists('curl_init')) {
161
+					$this->add_admin_notice('curl', 'notice notice-warning', __('WooCommerce Stripe - cURL is not installed.', 'woocommerce-gateway-stripe'), true);
162 162
 				}
163 163
 			}
164 164
 
165
-			if ( empty( $show_keys_notice ) ) {
165
+			if (empty($show_keys_notice)) {
166 166
 				$secret = WC_Stripe_API::get_secret_key();
167 167
 
168
-				if ( empty( $secret ) && ! ( isset( $_GET['page'], $_GET['section'] ) && 'wc-settings' === $_GET['page'] && 'stripe' === $_GET['section'] ) ) {
168
+				if (empty($secret) && ! (isset($_GET['page'], $_GET['section']) && 'wc-settings' === $_GET['page'] && 'stripe' === $_GET['section'])) {
169 169
 					$setting_link = $this->get_setting_link();
170 170
 					/* translators: 1) link */
171
-					$this->add_admin_notice( 'keys', 'notice notice-warning', sprintf( __( 'Stripe is almost ready. To get started, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe' ), $setting_link ), true );
171
+					$this->add_admin_notice('keys', 'notice notice-warning', sprintf(__('Stripe is almost ready. To get started, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe'), $setting_link), true);
172 172
 				}
173 173
 
174 174
 				// Check if keys are entered properly per live/test mode.
175
-				if ( $testmode ) {
175
+				if ($testmode) {
176 176
 					if (
177
-						! empty( $test_pub_key ) && ! preg_match( '/^pk_test_/', $test_pub_key )
178
-						|| ( ! empty( $test_secret_key ) && ! preg_match( '/^sk_test_/', $test_secret_key )
179
-						&& ! empty( $test_secret_key ) && ! preg_match( '/^rk_test_/', $test_secret_key ) ) ) {
177
+						! empty($test_pub_key) && ! preg_match('/^pk_test_/', $test_pub_key)
178
+						|| ( ! empty($test_secret_key) && ! preg_match('/^sk_test_/', $test_secret_key)
179
+						&& ! empty($test_secret_key) && ! preg_match('/^rk_test_/', $test_secret_key)) ) {
180 180
 						$setting_link = $this->get_setting_link();
181 181
 						/* translators: 1) link */
182
-						$this->add_admin_notice( 'keys', 'notice notice-error', sprintf( __( 'Stripe is in test mode however your test keys may not be valid. Test keys start with pk_test and sk_test or rk_test. Please go to your settings and, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe' ), $setting_link ), true );
182
+						$this->add_admin_notice('keys', 'notice notice-error', sprintf(__('Stripe is in test mode however your test keys may not be valid. Test keys start with pk_test and sk_test or rk_test. Please go to your settings and, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe'), $setting_link), true);
183 183
 					}
184 184
 				} else {
185 185
 					if (
186
-						! empty( $live_pub_key ) && ! preg_match( '/^pk_live_/', $live_pub_key )
187
-						|| ( ! empty( $live_secret_key ) && ! preg_match( '/^sk_live_/', $live_secret_key )
188
-						&& ! empty( $live_secret_key ) && ! preg_match( '/^rk_live_/', $live_secret_key ) ) ) {
186
+						! empty($live_pub_key) && ! preg_match('/^pk_live_/', $live_pub_key)
187
+						|| ( ! empty($live_secret_key) && ! preg_match('/^sk_live_/', $live_secret_key)
188
+						&& ! empty($live_secret_key) && ! preg_match('/^rk_live_/', $live_secret_key)) ) {
189 189
 						$setting_link = $this->get_setting_link();
190 190
 						/* translators: 1) link */
191
-						$this->add_admin_notice( 'keys', 'notice notice-error', sprintf( __( 'Stripe is in live mode however your test keys may not be valid. Live keys start with pk_live and sk_live or rk_live. Please go to your settings and, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe' ), $setting_link ), true );
191
+						$this->add_admin_notice('keys', 'notice notice-error', sprintf(__('Stripe is in live mode however your test keys may not be valid. Live keys start with pk_live and sk_live or rk_live. Please go to your settings and, <a href="%s">set your Stripe account keys</a>.', 'woocommerce-gateway-stripe'), $setting_link), true);
192 192
 					}
193 193
 				}
194 194
 			}
195 195
 
196
-			if ( empty( $show_ssl_notice ) ) {
196
+			if (empty($show_ssl_notice)) {
197 197
 				// Show message if enabled and FORCE SSL is disabled and WordpressHTTPS plugin is not detected.
198
-				if ( ! wc_checkout_is_https() ) {
198
+				if ( ! wc_checkout_is_https()) {
199 199
 					/* translators: 1) link */
200
-					$this->add_admin_notice( 'ssl', 'notice notice-warning', sprintf( __( 'Stripe is enabled, but a SSL certificate is not detected. Your checkout may not be secure! Please ensure your server has a valid <a href="%1$s" target="_blank">SSL certificate</a>', 'woocommerce-gateway-stripe' ), 'https://en.wikipedia.org/wiki/Transport_Layer_Security' ), true );
200
+					$this->add_admin_notice('ssl', 'notice notice-warning', sprintf(__('Stripe is enabled, but a SSL certificate is not detected. Your checkout may not be secure! Please ensure your server has a valid <a href="%1$s" target="_blank">SSL certificate</a>', 'woocommerce-gateway-stripe'), 'https://en.wikipedia.org/wiki/Transport_Layer_Security'), true);
201 201
 				}
202 202
 			}
203 203
 		}
@@ -211,17 +211,17 @@  discard block
 block discarded – undo
211 211
 	public function payment_methods_check_environment() {
212 212
 		$payment_methods = $this->get_payment_methods();
213 213
 
214
-		foreach ( $payment_methods as $method => $class ) {
215
-			$show_notice = get_option( 'wc_stripe_show_' . strtolower( $method ) . '_notice' );
214
+		foreach ($payment_methods as $method => $class) {
215
+			$show_notice = get_option('wc_stripe_show_' . strtolower($method) . '_notice');
216 216
 			$gateway     = new $class();
217 217
 
218
-			if ( 'yes' !== $gateway->enabled || 'no' === $show_notice ) {
218
+			if ('yes' !== $gateway->enabled || 'no' === $show_notice) {
219 219
 				continue;
220 220
 			}
221 221
 
222
-			if ( ! in_array( get_woocommerce_currency(), $gateway->get_supported_currency() ) ) {
222
+			if ( ! in_array(get_woocommerce_currency(), $gateway->get_supported_currency())) {
223 223
 				/* translators: %1$s Payment method, %2$s List of supported currencies */
224
-				$this->add_admin_notice( $method, 'notice notice-error', sprintf( __( '%1$s is enabled - it requires store currency to be set to %2$s', 'woocommerce-gateway-stripe' ), $method, implode( ', ', $gateway->get_supported_currency() ) ), true );
224
+				$this->add_admin_notice($method, 'notice notice-error', sprintf(__('%1$s is enabled - it requires store currency to be set to %2$s', 'woocommerce-gateway-stripe'), $method, implode(', ', $gateway->get_supported_currency())), true);
225 225
 			}
226 226
 		}
227 227
 	}
@@ -233,65 +233,65 @@  discard block
 block discarded – undo
233 233
 	 * @version 4.0.0
234 234
 	 */
235 235
 	public function hide_notices() {
236
-		if ( isset( $_GET['wc-stripe-hide-notice'] ) && isset( $_GET['_wc_stripe_notice_nonce'] ) ) {
237
-			if ( ! wp_verify_nonce( $_GET['_wc_stripe_notice_nonce'], 'wc_stripe_hide_notices_nonce' ) ) {
238
-				wp_die( __( 'Action failed. Please refresh the page and retry.', 'woocommerce-gateway-stripe' ) );
236
+		if (isset($_GET['wc-stripe-hide-notice']) && isset($_GET['_wc_stripe_notice_nonce'])) {
237
+			if ( ! wp_verify_nonce($_GET['_wc_stripe_notice_nonce'], 'wc_stripe_hide_notices_nonce')) {
238
+				wp_die(__('Action failed. Please refresh the page and retry.', 'woocommerce-gateway-stripe'));
239 239
 			}
240 240
 
241
-			if ( ! current_user_can( 'manage_woocommerce' ) ) {
242
-				wp_die( __( 'Cheatin&#8217; huh?', 'woocommerce-gateway-stripe' ) );
241
+			if ( ! current_user_can('manage_woocommerce')) {
242
+				wp_die(__('Cheatin&#8217; huh?', 'woocommerce-gateway-stripe'));
243 243
 			}
244 244
 
245
-			$notice = wc_clean( $_GET['wc-stripe-hide-notice'] );
245
+			$notice = wc_clean($_GET['wc-stripe-hide-notice']);
246 246
 
247
-			switch ( $notice ) {
247
+			switch ($notice) {
248 248
 				case 'style':
249
-					update_option( 'wc_stripe_show_style_notice', 'no' );
249
+					update_option('wc_stripe_show_style_notice', 'no');
250 250
 					break;
251 251
 				case 'phpver':
252
-					update_option( 'wc_stripe_show_phpver_notice', 'no' );
252
+					update_option('wc_stripe_show_phpver_notice', 'no');
253 253
 					break;
254 254
 				case 'wcver':
255
-					update_option( 'wc_stripe_show_wcver_notice', 'no' );
255
+					update_option('wc_stripe_show_wcver_notice', 'no');
256 256
 					break;
257 257
 				case 'curl':
258
-					update_option( 'wc_stripe_show_curl_notice', 'no' );
258
+					update_option('wc_stripe_show_curl_notice', 'no');
259 259
 					break;
260 260
 				case 'ssl':
261
-					update_option( 'wc_stripe_show_ssl_notice', 'no' );
261
+					update_option('wc_stripe_show_ssl_notice', 'no');
262 262
 					break;
263 263
 				case 'keys':
264
-					update_option( 'wc_stripe_show_keys_notice', 'no' );
264
+					update_option('wc_stripe_show_keys_notice', 'no');
265 265
 					break;
266 266
 				case '3ds':
267
-					update_option( 'wc_stripe_show_3ds_notice', 'no' );
267
+					update_option('wc_stripe_show_3ds_notice', 'no');
268 268
 					break;
269 269
 				case 'Alipay':
270
-					update_option( 'wc_stripe_show_alipay_notice', 'no' );
270
+					update_option('wc_stripe_show_alipay_notice', 'no');
271 271
 					break;
272 272
 				case 'Bancontact':
273
-					update_option( 'wc_stripe_show_bancontact_notice', 'no' );
273
+					update_option('wc_stripe_show_bancontact_notice', 'no');
274 274
 					break;
275 275
 				case 'EPS':
276
-					update_option( 'wc_stripe_show_eps_notice', 'no' );
276
+					update_option('wc_stripe_show_eps_notice', 'no');
277 277
 					break;
278 278
 				case 'Giropay':
279
-					update_option( 'wc_stripe_show_giropay_notice', 'no' );
279
+					update_option('wc_stripe_show_giropay_notice', 'no');
280 280
 					break;
281 281
 				case 'iDeal':
282
-					update_option( 'wc_stripe_show_ideal_notice', 'no' );
282
+					update_option('wc_stripe_show_ideal_notice', 'no');
283 283
 					break;
284 284
 				case 'Multibanco':
285
-					update_option( 'wc_stripe_show_multibanco_notice', 'no' );
285
+					update_option('wc_stripe_show_multibanco_notice', 'no');
286 286
 					break;
287 287
 				case 'P24':
288
-					update_option( 'wc_stripe_show_p24_notice', 'no' );
288
+					update_option('wc_stripe_show_p24_notice', 'no');
289 289
 					break;
290 290
 				case 'SEPA':
291
-					update_option( 'wc_stripe_show_sepa_notice', 'no' );
291
+					update_option('wc_stripe_show_sepa_notice', 'no');
292 292
 					break;
293 293
 				case 'SOFORT':
294
-					update_option( 'wc_stripe_show_sofort_notice', 'no' );
294
+					update_option('wc_stripe_show_sofort_notice', 'no');
295 295
 					break;
296 296
 			}
297 297
 		}
@@ -305,11 +305,11 @@  discard block
 block discarded – undo
305 305
 	 * @return string Setting link
306 306
 	 */
307 307
 	public function get_setting_link() {
308
-		$use_id_as_section = function_exists( 'WC' ) ? version_compare( WC()->version, '2.6', '>=' ) : false;
308
+		$use_id_as_section = function_exists('WC') ? version_compare(WC()->version, '2.6', '>=') : false;
309 309
 
310
-		$section_slug = $use_id_as_section ? 'stripe' : strtolower( 'WC_Gateway_Stripe' );
310
+		$section_slug = $use_id_as_section ? 'stripe' : strtolower('WC_Gateway_Stripe');
311 311
 
312
-		return admin_url( 'admin.php?page=wc-settings&tab=checkout&section=' . $section_slug );
312
+		return admin_url('admin.php?page=wc-settings&tab=checkout&section=' . $section_slug);
313 313
 	}
314 314
 
315 315
 	/**
@@ -318,11 +318,11 @@  discard block
 block discarded – undo
318 318
 	 * @since 4.3.0
319 319
 	 */
320 320
 	public function stripe_updated() {
321
-		$previous_version = get_option( 'wc_stripe_version' );
321
+		$previous_version = get_option('wc_stripe_version');
322 322
 
323 323
 		// Only show the style notice if the plugin was installed and older than 4.1.4.
324
-		if ( empty( $previous_version ) || version_compare( $previous_version, '4.1.4', 'ge' ) ) {
325
-			update_option( 'wc_stripe_show_style_notice', 'no' );
324
+		if (empty($previous_version) || version_compare($previous_version, '4.1.4', 'ge')) {
325
+			update_option('wc_stripe_show_style_notice', 'no');
326 326
 		}
327 327
 	}
328 328
 }
Please login to merge, or discard this patch.