þÿÿÿ( FC @*P½šU ðÿÿÿ £ãEC €@*P½šU ðÿÿÿ@¤ãEC @*P½šU ðÿÿÿ€¥ãEC €@*P½šU þÿÿÿhFC @*P½šU ðÿÿÿÀ¦ãEC €@*P½šU ðÿÿÿ ¨ãEC @*P½šU ðÿÿÿ@©ãEC €@*P½šU þÿÿÿðãEC @*P½šU ðÿÿÿ€ªãEC €@*P½šU ðÿÿÿÀ«ãEC @*P½šU ðÿÿÿ ãEC €@*P½šU þÿÿÿHñãEC @*P½šU ðÿÿÿ@®ãEC €@*P½šU ðÿÿÿ€¯ãEC @*P½šU ðÿÿÿÀ°ãEC €@*P½šU þÿÿÿˆòãEC @*P½šU ðÿÿÿ ²ãEC €@*P½šU ðÿÿÿ@³ãEC @*P½šU ðÿÿÿ€´ãEC €@*P½šU þÿÿÿÈóãEC @*P½šU ðÿÿÿÀµãEC €@*P½šU ðÿÿÿ ·ãEC @*P½šU ðÿÿÿ@¸ãEC €@*P½šU þÿÿÿõãEC @*P½šU ðÿÿÿ€¹ãEC €@*P½šU ðÿÿÿÀºãEC @*P½šU ðÿÿÿ ¼ãEC €@*P½šU þÿÿÿHöãEC @*P½šU ðÿÿÿ@½ãEC €@*P½šU ðÿÿÿ€¾ãEC @*P½šU ðÿÿÿÀ¿ãEC €@*P½šU þÿÿÿˆ÷ãEC @*P½šU ðÿÿÿ ÁãEC €@*P½šU ðÿÿÿ@ÂãEC @*P½šU ðÿÿÿ€ÃãEC €@*P½šU þÿÿÿÈøãEC @*P½šU ðÿÿÿÀÄãEC €@*P½šU ðÿÿÿ ÆãEC @*P½šU ðÿÿÿ@ÇãEC €@*P½šU þÿÿÿúãEC @*P½šU ðÿÿÿ€ÈãEC €@*P½šU ðÿÿÿÀÉãEC @*P½šU ðÿÿÿ ËãEC €@*P½šU þÿÿÿHûãEC @*P½šU ðÿÿÿ@ÌãEC €@*P½šU ðÿÿÿ€ÍãEC @*P½šU ðÿÿÿÀÎãEC €@*P½šU þÿÿÿˆüãEC @*P½šU ðÿÿÿ ÐãEC €@*P½šU ðÿÿÿ@ÑãEC @*P½šU ðÿÿÿ€ÒãEC €@*P½šU þÿÿÿÈýãEC @*P½šU ðÿÿÿÀÓãEC €@*P½šU ðÿÿÿ ÕãEC @*P½šU ðÿÿÿ@ÖãEC €@*P½šU þÿÿÿÿãEC @*P½šU ðÿÿÿ€×ãEC €@*P½šU ðÿÿÿÀØãEC @*P½šU ðÿÿÿ ÚãEC €@*P½šU XÀ þÿÿÿ¨ äEC @*P½šU ðÿÿÿ@ÛãEC €@*P½šU ðÿÿÿ€ÜãEC @*P½šU ðÿÿÿÀÝãEC €@*P½šU þÿÿÿèäEC @*P½šU ðÿÿÿ ßãEC €@*P½šU ðÿÿÿ@0äEC @*P½šU ðÿÿÿ€1äEC €@*P½šU þÿÿÿ(äEC @*P½šU ðÿÿÿÀ2äEC €@*P½šU ðÿÿÿ 4äEC @*P½šU ðÿÿÿ@5äEC €@*P½šU þÿÿÿhäEC @*P½šU tion( 'i'admin.php?page=wpseo_tools' ) ), 'usersPageUrl' => \esc_url( \admin_url( 'users.php' ) ), 'firstTimeConfigurationUrl' => \esc_url( \admin_url( 'admin.php?page=wpseo_dashboard#top#first-time-configuration' ) ), 'isPremium' => $this->product_helper->is_premium(), 'shouldUpdatePremium' => $this->should_update_premium(), 'upsellText' => $this->get_upsell_text(), 'upsellLink' => $this->get_upsell_link(), ] ); } /** * Renders the target for the React to mount to. */ public function render_target() { if ( $this->should_update_premium() ) { // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output escaped in get_update_premium_notice. echo $this->get_update_premium_notice(); } echo '
'; } /** * Gets the workouts option. * * @return mixed|null Returns workouts option if found, null if not. */ private function get_workouts_option() { $workouts_option = $this->options_helper->get( 'workouts_data' ); // This filter is documented in src/routes/workouts-route.php. return \apply_filters( 'Yoast\WP\SEO\workouts_options', $workouts_option ); } /** * Returns the notification to show when Premium needs to be updated. * * @return string The notification to update Premium. */ private function get_update_premium_notice() { $url = $this->get_upsell_link(); if ( $this->has_premium_subscription_expired() ) { /* translators: %s: expands to 'Yoast SEO Premium'. */ $title = \sprintf( \__( 'Renew your subscription of %s', 'wordpress-seo' ), 'Yoast SEO Premium' ); $copy = \sprintf( /* translators: %s: expands to 'Yoast SEO Premium'. */ \esc_html__( 'Accessing the latest workouts requires an updated version of %s (at least 17.7), but it looks like your subscription has expired. Please renew your subscription to update and gain access to all the latest features.', 'wordpress-seo' ), 'Yoast SEO Premium' ); $button = '' . \esc_html__( 'Renew your subscription', 'wordpress-seo' ) . '' . \__( '(Opens in a new browser tab)', 'wordpress-seo' ) . '' . '' . ''; } elseif ( $this->has_premium_subscription_activated() ) { /* translators: %s: expands to 'Yoast SEO Premium'. */ $title = \sprintf( \__( 'Update to the latest version of %s', 'wordpress-seo' ), 'Yoast SEO Premium' ); $copy = \sprintf( /* translators: 1: expands to 'Yoast SEO Premium', 2: Link start tag to the page to update Premium, 3: Link closing tag. */ \esc_html__( 'It looks like you\'re running an outdated version of %1$s, please %2$supdate to the latest version (at least 17.7)%3$s to gain access to our updated workouts section.', 'wordpress-seo' ), 'Yoast SEO Premium', '', '' ); $button = null; } else { /* translators: %s: expands to 'Yoast SEO Premium'. */ $title = \sprintf( \__( 'Activate your subscription of %s', 'wordpress-seo' ), 'Yoast SEO Premium' ); $url_button = 'https://yoa.st/workouts-activate-notice-help'; $copy = \sprintf( /* translators: 1: expands to 'Yoast SEO Premium', 2: Link start tag to the page to update Premium, 3: Link closing tag. */ \esc_html__( 'It looks like you’re running an outdated and unactivated version of %1$s, please activate your subscription in %2$sMyYoast%3$s and update to the latest version (at least 17.7) to gain access to our updated workouts section.', 'wordpress-seo' ), 'Yoast SEO Premium', '', '' ); $button = '' . \esc_html__( 'Get help activating your subscription', 'wordpress-seo' ) . '' . \__( '(Opens in a new browser tab)', 'wordpress-seo' ) . '' . ''; } $notice = new Notice_Presenter( $title, $copy, 'Assistent_Time_bubble_500x570.png', $button ); return $notice->present(); } /** * Check whether Premium should be updated. * * @return bool Returns true when Premium is enabled and the version is below 17.7. */ private function should_update_premium() { $premium_version = $this->product_helper->get_premium_version(); return $premium_version !== null && \version_compare( $premium_version, '17.7-RC1', '<' ); } /** * Check whether the Premium subscription has expired. * * @return bool Returns true when Premium subscription has expired. */ private function has_premium_subscription_expired() { $subscription = $this->addon_manager->get_subscription( WPSEO_Addon_Manager::PREMIUM_SLUG ); return ( isset( $subscription->expiry_date ) && ( \strtotime( $subscription->expiry_date ) - \time() ) < 0 ); } /** * Check whether the Premium subscription is activated. * * @return bool Returns true when Premium subscription is activated. */ private function has_premium_subscription_activated() { return $this->addon_manager->has_valid_subscription( WPSEO_Addon_Manager::PREMIUM_SLUG ); } /** * Returns the upsell/update copy to show in the card buttons. * * @return string Returns a string with the upsell/update copy for the card buttons. */ private function get_upsell_text() { if ( ! $this->product_helper->is_premium() || ! $this->should_update_premium() ) { // Use the default defined in the component. return ''; } if ( $this->has_premium_subscription_expired() ) { return \sprintf( /* translators: %s: expands to 'Yoast SEO Premium'. */ \__( 'Renew %s', 'wordpress-seo' ), 'Yoast SEO Premium' ); } if ( $this->has_premium_subscription_activated() ) { return \sprintf( /* translators: %s: expands to 'Yoast SEO Premium'. */ \__( 'Update %s', 'wordpress-seo' ), 'Yoast SEO Premium' ); } return \sprintf( /* translators: %s: expands to 'Yoast SEO Premium'. */ \__( 'Activate %s', 'wordpress-seo' ), 'Yoast SEO Premium' ); } /** * Returns the upsell/update link to show in the card buttons. * * @return string Returns a string with the upsell/update link for the card buttons. */ private function get_upsell_link() { if ( ! $this->product_helper->is_premium() || ! $this->should_update_premium() ) { // Use the default defined in the component. return ''; } if ( $this->has_premium_subscription_expired() ) { return 'https://yoa.st/workout-renew-notice'; } if ( $this->has_premium_subscription_activated() ) { return \wp_nonce_url( \self_admin_url( 'update.php?action=upgrade-plugin&plugin=wordpress-seo-premium/wp-seo-premium.php' ), 'upgrade-plugin_wordpress-seo-premium/wp-seo-premium.php' ); } return 'https://yoa.st/workouts-activate-notice-myyoast'; } }