PageRenderTime 20ms CodeModel.GetById 15ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/plugins/wordpress-seo/admin/metabox/class-metabox-add-keyword-tab.php

https://bitbucket.org/carloskikea/helpet
PHP | 69 lines | 39 code | 7 blank | 23 comment | 0 complexity | ee39b0d67ede4d437c5af7fa08240b7a MD5 | raw file
 1<?php
 2/**
 3 * WPSEO plugin file.
 4 *
 5 * @package WPSEO\Admin\Metabox
 6 */
 7
 8/**
 9 * Tab to add a keyword to analyze
10 */
11class WPSEO_Metabox_Add_Keyword_Tab implements WPSEO_Metabox_Tab {
12
13	/**
14	 * Returns a button because a link is inappropriate here
15	 *
16	 * @return string
17	 */
18	public function link() {
19
20		// Ensure thickbox is enqueued.
21		add_thickbox();
22
23		ob_start();
24		?>
25		<li class="wpseo-tab-add-keyword">
26			<button type="button" class="wpseo-add-keyword button button-link">
27				<span class="wpseo-add-keyword-plus" aria-hidden="true">+</span>
28				<?php esc_html_e( 'Add keyword', 'wordpress-seo' ); ?>
29			</button>
30		</li>
31
32		<?php
33		$popup_title = __( 'Want to add more than one keyword?', 'wordpress-seo' );
34		/* translators: %1$s expands to a 'Yoast SEO Premium' text linked to the yoast.com website. */
35		$popup_content  = '<p>' . sprintf( __( 'Great news: you can, with %1$s!', 'wordpress-seo' ),
36				'<a href="' . WPSEO_Shortlinker::get( 'https://yoa.st/pe-premium-page' ) . '">Yoast SEO Premium</a>'
37				) . '</p>';
38		$popup_content .= '<p>' . sprintf(
39			/* translators: %s expands to 'Yoast SEO Premium'. */
40			__( 'Other benefits of %s for you:', 'wordpress-seo' ), 'Yoast SEO Premium'
41			) . '</p>';
42		$popup_content .= '<ul>';
43		$popup_content .= '<li>' . sprintf(
44			/* translators: %1$s expands to a 'strong' start tag, %2$s to a 'strong' end tag. */
45			__( '%1$sNo more dead links%2$s: easy redirect manager', 'wordpress-seo' ), '<strong>', '</strong>'
46		) . '</li>';
47		$popup_content .= '<li><strong>' . __( 'Superfast internal links suggestions', 'wordpress-seo' ) . '</strong></li>';
48		$popup_content .= '<li>' . sprintf(
49			/* translators: %1$s expands to a 'strong' start tag, %2$s to a 'strong' end tag. */
50			__( '%1$sSocial media preview%2$s: Facebook &amp; Twitter', 'wordpress-seo' ), '<strong>', '</strong>'
51		) . '</li>';
52		$popup_content .= '<li><strong>' . __( '24/7 support', 'wordpress-seo' ) . '</strong></li>';
53		$popup_content .= '<li><strong>' . __( 'No ads!', 'wordpress-seo' ) . '</strong></li>';
54		$popup_content .= '</ul>';
55		$premium_popup  = new WPSEO_Premium_Popup( 'add-keyword', 'h1', $popup_title, $popup_content, WPSEO_Shortlinker::get( 'https://yoa.st/add-keywords-popup' ) );
56		echo $premium_popup->get_premium_message();
57
58		return ob_get_clean();
59	}
60
61	/**
62	 * Returns an empty string because this tab has no content
63	 *
64	 * @return string
65	 */
66	public function content() {
67		return '';
68	}
69}