get_option( $this->wishlist_db_key, get_option( $this->wishlist_db_key, false ) ) ){ add_action( 'wp_loaded', [ $this, 'activate' ] ); ExtraSettings::instance()->set_option( $this->wishlist_db_key, $this->wishlist_db_version ); } //if ( ! get_option( $this->wishlist_db_key, '' ) ) { // add_action( 'wp_loaded', [ $this, 'activate' ] ); // update_option( $this->wishlist_db_key, $this->wishlist_db_version ); //} new WishlistRouteV1(); WishlistFrontEnd::instance(); if ( is_user_logged_in() ) { $cookie_name = WishlistFns::instance()->get_cookie_name(); if ( isset( $_COOKIE[ $cookie_name ] ) && is_array( json_decode( wp_unslash( $_COOKIE[ $cookie_name ] ), true ) ) ) { $ids = WishlistFns::instance()->get_wishlist_ids(); $product_ids = []; foreach ( $ids as $pid ) { $product_ids[ $pid ] = $pid; } WishlistFns::instance()->update_user_wishlist_ids( $product_ids ); setcookie( self::KEY, '', time() - 3600, '/' ); } } if ( is_admin() ) { WishlistAdmin::instance(); } do_action( 'rtsb/module/wishlist/loaded' ); } /** * Do stuff upon plugin activation * * @return void */ public function activate() { ( new WishlistInstaller() )->run(); } }