Passed
Push — add/multiplan ( 93f1e2...30efbe )
by Warwick
05:04
created
classes/class-frontend.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
 	 * Contructor
47 47
 	 */
48 48
 	public function __construct() {
49
-		if ( ! is_admin() ) {
49
+		if ( ! is_admin()) {
50 50
 			$this->load_classes();
51
-			add_action( 'template_redirect', array( $this, 'redirect' ) );
51
+			add_action('template_redirect', array($this, 'redirect'));
52 52
 			
53 53
 		}	
54 54
 	}
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public static function get_instance() {
64 64
 		// If the single instance hasn't been set, set it now.
65
-		if ( null === self::$instance ) {
65
+		if (null === self::$instance) {
66 66
 			self::$instance = new self();
67 67
 		}
68 68
 		return self::$instance;
@@ -97,17 +97,17 @@  discard block
 block discarded – undo
97 97
 	 * @return void
98 98
 	 */
99 99
 	public function redirect() {
100
-		if ( ! is_user_logged_in() || ! function_exists( 'wc_get_page_id' ) || is_home() ) {
100
+		if ( ! is_user_logged_in() || ! function_exists('wc_get_page_id') || is_home()) {
101 101
 			return;
102 102
 		}
103
-		if ( lsx_health_plan_user_has_purchase() && ( is_page( wc_get_page_id( 'cart' ) ) || is_page( wc_get_page_id( 'checkout' ) ) ) ) {
104
-			wp_redirect( get_permalink( wc_get_page_id( 'myaccount' ) ) );
103
+		if (lsx_health_plan_user_has_purchase() && (is_page(wc_get_page_id('cart')) || is_page(wc_get_page_id('checkout')))) {
104
+			wp_redirect(get_permalink(wc_get_page_id('myaccount')));
105 105
 			die;
106 106
 		}
107 107
 
108
-		$product_id = \lsx_health_plan\functions\get_option( 'membership_product', false );
109
-		if ( false !== $product_id && is_single( $product_id ) ) {
110
-			wp_redirect( home_url() );
108
+		$product_id = \lsx_health_plan\functions\get_option('membership_product', false);
109
+		if (false !== $product_id && is_single($product_id)) {
110
+			wp_redirect(home_url());
111 111
 			die;
112 112
 		}
113 113
 	}
Please login to merge, or discard this patch.