Hướng dẫn Activate và tắt thông báo kích hoạt plugin WordPress Yoast SEO Premium

11

Yoast SEO có lẽ đối với những người sử dụng nền tảng Website WordPress không còn xa lạ. Đây hiện tại được coi là một trong những công cụ hỗ trợ SEO cho WordPress tốt nhất.

Kích hoạt Plugin Yoast SEO Premium

Để kích hoạt Plugin Yoast SEO Premium mà không mất xu nào, hãy làm theo hướng dẫn bên dưới.

Đầu tiên, các bạn truy cập và mở file theo đường dẫn sau: (Nên sửa bằng Notepad++)
wp-content/plugins/wordpress-seo-premium/wordpress-seo-premium/premium/premium.php

Tìm: (dòng 238 -> 242)

	private function is_yoast_seo_premium_page( $page ) {
		$premium_pages = array( 'wpseo_redirects' );

		return in_array( $page, $premium_pages, true );
	}

Thay thế bằng:

	private function is_yoast_seo_premium_page( $page ) {
		$premium_pages = array( 'wpseo_redirects' );

		return true;
	}

Mở tiếp File:
wp-content/plugins/wordpress-seo-premium/wordpress-seo-premium/inc/class-wpseo-features.php

Tìm: (dòng 18 -> 20)

	public function is_premium() {
		return ( defined( 'WPSEO_PREMIUM_FILE' ) );
	}

Thay thế bằng:

	public function is_premium() {
		return true;
	}

Mở wp-content/plugins/wordpress-seo-premium/wordpress-seo-premium/inc/class-wpseo-utils.php

Tìm: (dòng 821 -> 823)

	public static function is_yoast_seo_premium() {
		return defined( 'WPSEO_PREMIUM_PLUGIN_FILE' );
	}

Thay thế bằng:

	public static function is_yoast_seo_premium() {
		return true;
	}

Mở wp-content/plugins/wordpress-seo-premium/wordpress-seo-premium/inc/class-addon-manager.php

Tìm: (dòng  244 -> 254)

	public function has_valid_subscription( $slug ) {
		$subscription = $this->get_subscription( $slug );

		// An non-existing subscription is never valid.
		if ( $subscription === false ) {
			return false;
		}

		return ! $this->has_subscription_expired( $subscription );
	}

Thay thế bằng:

	public function has_valid_subscription( $slug ) {
		return true;
	}

Mở wp-content/plugins/wordpress-seo-premium/wordpress-seo-premium/frontend/class-frontend.php

Tìm: (dòng 1606 -> 1608)

	protected function is_premium() {
		return WPSEO_Utils::is_yoast_seo_premium();
	}

Thay thế bằng:

	protected function is_premium() {
		return true;
	}

Mở wp-content/plugins/wordpress-seo-premium/wordpress-seo-premium/admin/class-license-page-manager.php

Tìm: (dòng 30 -> 41)

	public function register_hooks() {
		add_filter( 'http_response', array( $this, 'handle_response' ), 10, 3 );

		if ( $this->get_version() === self::VERSION_BACKWARDS_COMPATIBILITY ) {
			add_filter( 'yoast-license-valid', '__return_true' );
			add_filter( 'yoast-show-license-notice', '__return_false' );
			add_action( 'admin_init', array( $this, 'validate_extensions' ), 15 );
		}
		else {
			add_action( 'admin_init', array( $this, 'remove_faulty_notifications' ), 15 );
		}
	}

Thay thế bằng:

	public function register_hooks() {
		add_filter( 'http_response', array( $this, 'handle_response' ), 10, 3 );

		//if ( $this->get_version() === self::VERSION_BACKWARDS_COMPATIBILITY ) {
			add_filter( 'yoast-license-valid', '__return_true' );
			add_filter( 'yoast-show-license-notice', '__return_false' );
			add_action( 'admin_init', array( $this, 'validate_extensions' ), 15 );
		//}
		//else {
			add_action( 'admin_init', array( $this, 'remove_faulty_notifications' ), 15 );
		//}
	}

Mở wp-content/plugins/wordpress-seo-premium/wordpress-seo-premium/admin/views/licenses.php

Tìm: (dòng  106 )

$has_valid_premium_subscription = WPSEO_Utils::is_yoast_seo_premium() && $addon_manager->has_valid_subscription( WPSEO_Addon_Manager::PREMIUM_SLUG );

Thay thế bằng:

$has_valid_premium_subscription = true;

Mở wp-content/plugins/wordpress-seo-premium/wordpress-seo-premium/admin/class-plugin-availability.php

Tìm: (dòng 344 -> 246)

	public function is_premium( $plugin ) {
		return isset( $plugin['premium'] ) && $plugin['premium'] === true;
	}

Thay thế bằng:

	public function is_premium( $plugin ) {
		return true;
	}

Với phiên bản cũ hơn 11.x

Mở file theo đường dẫn sau:
wp-content/plugins/wordpress-seo-premium/vendor/yoast/license-manager/class-license-manager.php

Tắt thông báo:

Warning! You didn’t set your Yoast SEO Premium license key yet, which means you’re missing out on updates and support! Enter your license key or get a license here.
Tìm (Crtl + F) đoạn code bên dưới và xóa đi.

			// show notice if license is invalid
			if ( $this->show_license_notice() && ! $this->license_is_valid() ) {
				if ( $this->get_license_key() == '' ) {
					$message = __( '<b>Warning!</b> You didn\'t set your %s license key yet, which means you\'re missing out on updates and support! <a href="%s">Enter your license key</a> or <a href="%s" target="_blank">get a license here</a>.' );
				} else {
					$message = __( '<b>Warning!</b> Your %s license is inactive which means you\'re missing out on updates and support! <a href="%s">Activate your license</a> or <a href="%s" target="_blank">get a license here</a>.' );
				}
				?>
                <div class="notice notice-error yoast-notice-error">
                    <p><?php printf( __( $message, $this->product->get_text_domain() ), $this->product->get_item_name(), $this->product->get_license_page_url(), $this->product->get_tracking_url( 'activate-license-notice' ) ); ?></p>
                </div>
				<?php
			}

Đoạn code trên nằm ở dòng 131 -> 143

Hoặc các bạn có thể thực hiên crack Plugin theo cách sau:
Vẫn mở file trên và tìm dòng 374:

		public function license_is_valid() {
			return ( $this->get_license_status() === 'valid' );
		}

Thay thế bằng:

		public function license_is_valid() {
			return true;
		}

Hoặc tìm:

			if ( ! $this->license_is_valid() ) {

Thay thế bằng:

			if ($this->license_is_valid() ) {

Xoá thông báo kích hoạt

Mở file theo đường dẫn:

wordpress-seo-premium/premium/assets/js/dist/wp-seo-premium-metabox-1000.min.js

Tìm:

if(403===t.status

Thay thế bằng:

if(403!=t.status

Xoá quảng cáo ở sidebar bên phải

Mở wp-content/plugins/wordpress-seo-premium/wordpress-seo-premium/admin/views/sidebar.php

Tìm và xoá từ dòng 12 cho đến hết.

<div class="wpseo_content_cell" id="sidebar-container">
	<div id="sidebar" class="yoast-sidebar">
		<div class="wpseo_content_cell_title yoast-sidebar__title">
			<?php
			/* translators: %1$s expands to Yoast */
			printf( esc_html__( '%1$s recommendations for you', 'wordpress-seo' ), 'Yoast' );
			?>
		</div>
		<div class="yoast-sidebar__section">
			<h2>
				<?php
				/* translators: %s expands to Yoast SEO Premium */
				printf( esc_html__( 'Upgrade to %s', 'wordpress-seo' ), 'Yoast SEO Premium' );
				?>
			</h2>
			<ul>
				<li><strong><?php esc_html_e( 'Rank better with synonyms & related keyphrases', 'wordpress-seo' ); ?></strong></li>
				<li><strong><?php esc_html_e( 'Preview your page in Facebook and Twitter', 'wordpress-seo' ); ?></strong></li>
				<li><strong><?php esc_html_e( 'Get real-time suggestions for internal links', 'wordpress-seo' ); ?></strong></li>
				<li><strong><?php esc_html_e( 'No more dead links a.k.a. 404 pages', 'wordpress-seo' ); ?></strong></li>
				<li><strong><?php esc_html_e( '24/7 email support', 'wordpress-seo' ); ?></strong></li>
				<li><strong><?php esc_html_e( 'No ads!', 'wordpress-seo' ); ?></strong></li>
			</ul>

			<a id="wpseo-premium-button" class="yoast-button-upsell" href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jj' ); ?>" target="_blank">
				<?php
				/* translators: %s expands to Yoast SEO Premium */
				printf( esc_html__( 'Get %s', 'wordpress-seo' ), 'Yoast SEO Premium' );
				echo $new_tab_message;
				echo '<span aria-hidden="true" class="yoast-button-upsell__caret"></span>';
				?>
			</a><br>
		</div>
		<div class="yoast-sidebar__section">
			<h2><?php esc_html_e( 'Improve your SEO skills', 'wordpress-seo' ); ?></h2>
			<div class="wp-clearfix">
				<p>
					<strong><?php echo esc_html_x( 'Free:', 'course', 'wordpress-seo' ); ?></strong>
					<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/2oi' ); ?>" target="_blank">
						<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/SEO_for_beginners.svg' ); ?>" alt="">
						<strong><?php esc_html_e( 'SEO for Beginners training', 'wordpress-seo' ); ?></strong>
						<?php echo $new_tab_message; ?>
					</a><br>
					<?php esc_html_e( 'Get quick wins to make your site rank higher in search engines.', 'wordpress-seo' ); ?>
				</p>
			</div>
			<div class="wp-clearfix">
				<p>
					<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jv' ); ?>" target="_blank">
						<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/yoast_seo_for_wp_2.svg' ); ?>" alt="">
						<strong>
							<?php
								/* translators: %s expands to Yoast SEO */
								printf( esc_html__( '%s for WordPress training', 'wordpress-seo' ), 'Yoast SEO' );
							?>
						</strong>
						<?php echo $new_tab_message; ?>
					</a><br>
					<?php esc_html_e( 'Don’t waste time figuring out the best settings yourself.', 'wordpress-seo' ); ?>
				</p>
			</div>
			<div class="wp-clearfix">
				<p>
					<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/3lj' ); ?>" target="_blank">
						<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/all-round-SEO.svg' ); ?>" alt="">
						<strong><?php esc_html_e( 'All-around SEO training', 'wordpress-seo' ); ?></strong>
						<?php echo $new_tab_message; ?>
					</a><br>
					<?php esc_html_e( 'Learn practical SEO skills to rank higher in Google.', 'wordpress-seo' ); ?>
				</p>
			</div>
		</div>
		<div class="yoast-sidebar__section">
			<h2>
				<?php
					/* translators: %s expands to Yoast SEO */
					printf( esc_html__( 'Extend %s', 'wordpress-seo' ), 'Yoast SEO' );
				?>
			</h2>
			<div class="wp-clearfix">
				<p>
					<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jq' ); ?>" target="_blank">
						<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/Local_SEO_Icon.svg' ); ?>" alt="">
						<strong>Local SEO</strong>
						<?php echo $new_tab_message; ?>
					</a><br>
					<?php esc_html_e( 'Be found in Google Maps and local results.', 'wordpress-seo' ); ?>
				</p>
			</div>
			<div class="wp-clearfix">
				<p>
					<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jo' ); ?>" target="_blank">
						<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/Video_SEO_Icon.svg' ); ?>" alt="">
						<strong>Video SEO</strong>
						<?php echo $new_tab_message; ?>
					</a><br>
					<?php esc_html_e( 'Be found in Google Video search and enhance your video sharing on social media.', 'wordpress-seo' ); ?>
				</p>
			</div>
			<div class="wp-clearfix">
				<p>
					<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jp' ); ?>" target="_blank">
						<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/Woo_SEO_Icon.svg' ); ?>" alt="">
						<strong>WooCommerce SEO</strong>
						<?php echo $new_tab_message; ?>
					</a><br>
					<?php esc_html_e( 'Optimize your shop\'s SEO and sell more products!', 'wordpress-seo' ); ?>
				</p>
			</div>
			<div class="wp-clearfix">
				<p>
					<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jr' ); ?>" target="_blank">
						<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/News_SEO_Icon.svg' ); ?>" alt="">
						<strong>News SEO</strong>
						<?php echo $new_tab_message; ?>
					</a><br>
					<?php esc_html_e( 'Optimize your site for Google News.', 'wordpress-seo' ); ?>
				</p>
			</div>
		</div>
		<div class="yoast-sidebar__section">
			<strong><?php esc_html_e( 'Remove these ads?', 'wordpress-seo' ); ?></strong>
			<p>
				<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jy' ); ?>" target="_blank">
					<?php
						/* translators: %s expands to Yoast SEO Premium */
						printf( esc_html__( 'Upgrade to %s', 'wordpress-seo' ), 'Yoast SEO Premium' );
						echo $new_tab_message;
					?>
				</a>
			</p>
		</div>
	</div>
</div>

 

Bên trên là hướng dẫn tổng hợp các cách vô hiệu hóa yêu cầu kích hoạt Plugins Yoast SEO Premium.

Chúc các bạn thành công!

Để lại bình luận

avatar
  Nhận thông báo qua Email  
Nhận thông báo cho