Passed
Push — add/multiplan ( c66000...65be00 )
by Warwick
09:50 queued 04:24
created
classes/class-frontend.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
 	 * Contructor
52 52
 	 */
53 53
 	public function __construct() {
54
-		if ( ! is_admin() ) {
54
+		if ( ! is_admin()) {
55 55
 			$this->load_classes();
56
-			add_action( 'template_redirect', array( $this, 'redirect' ) );
56
+			add_action('template_redirect', array($this, 'redirect'));
57 57
 			
58 58
 		}	
59 59
 	}
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	 */
68 68
 	public static function get_instance() {
69 69
 		// If the single instance hasn't been set, set it now.
70
-		if ( null === self::$instance ) {
70
+		if (null === self::$instance) {
71 71
 			self::$instance = new self();
72 72
 		}
73 73
 		return self::$instance;
@@ -102,17 +102,17 @@  discard block
 block discarded – undo
102 102
 	 * @return void
103 103
 	 */
104 104
 	public function redirect() {
105
-		if ( ! is_user_logged_in() || ! function_exists( 'wc_get_page_id' ) || is_home() ) {
105
+		if ( ! is_user_logged_in() || ! function_exists('wc_get_page_id') || is_home()) {
106 106
 			return;
107 107
 		}
108
-		if ( lsx_health_plan_user_has_purchase() && ( is_page( wc_get_page_id( 'cart' ) ) || is_page( wc_get_page_id( 'checkout' ) ) ) ) {
109
-			wp_redirect( get_permalink( wc_get_page_id( 'myaccount' ) ) );
108
+		if (lsx_health_plan_user_has_purchase() && (is_page(wc_get_page_id('cart')) || is_page(wc_get_page_id('checkout')))) {
109
+			wp_redirect(get_permalink(wc_get_page_id('myaccount')));
110 110
 			die;
111 111
 		}
112 112
 
113
-		$product_id = \lsx_health_plan\functions\get_option( 'membership_product', false );
114
-		if ( false !== $product_id && is_single( $product_id ) ) {
115
-			wp_redirect( home_url() );
113
+		$product_id = \lsx_health_plan\functions\get_option('membership_product', false);
114
+		if (false !== $product_id && is_single($product_id)) {
115
+			wp_redirect(home_url());
116 116
 			wp_die();
117 117
 		}
118 118
 	}
Please login to merge, or discard this patch.