PageRenderTime 28ms CodeModel.GetById 19ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/wp-content/plugins/wordpress-seo/admin/class-unsupported-php-message.php

https://bitbucket.org/carloskikea/helpet
PHP | 68 lines | 44 code | 7 blank | 17 comment | 0 complexity | 2bddee251a7ff038b5aa5fc5f70a3cc6 MD5 | raw file
 1<?php
 2/**
 3 * WPSEO plugin file.
 4 *
 5 * @package WPSEO\Admin
 6 */
 7
 8/**
 9 * Class that creates the PHP 5.2 support message.
10 */
11class WPSEO_Unsupported_PHP_Message implements Whip_Message {
12
13	/**
14	 * Composes the body of the message to display.
15	 *
16	 * @return string The message to display.
17	 */
18	public function body() {
19		$message = array();
20
21		$message[] = Whip_MessageFormatter::strongParagraph( __( 'PHP update required.', 'wordpress-seo' ) ) . '<br />';
22		$message[] = Whip_MessageFormatter::paragraph(
23				sprintf(
24					/* translators: 1: The strong opening tag; 2: The strong closing tag; 3: the Yoast SEO version that is dropping support; 4: The release date of the version of Yoast SEO that is dropping support; 5: The PHP version no longer being supported; */
25					__( '%1$sAction is needed%2$s: As of version %3$s, due to be released on %4$s, Yoast SEO will no longer work with PHP %5$s. Unfortunately, your site is running on PHP %5$s right now, so action is needed. Thankfully, you can update your PHP yourself.', 'wordpress-seo' ),
26					'<strong>',
27					'</strong>',
28					'7.5',
29					date_i18n( get_option( 'date_format' ), strtotime( '15-05-2018' ) ),
30					'5.2'
31				)
32			) . '<br />';
33
34		$message[] = Whip_MessageFormatter::strongParagraph( __( 'Why?', 'wordpress-seo' ) ) . '<br />';
35		$message[] = Whip_MessageFormatter::paragraph(
36			sprintf(
37				/* translators: 1: the PHP version that will no longer be supported; 2: The year the unsupported PHP version was released; 3: The minimal PHP version that will be supported; 4: The year the minimally supported version of PHP was released; */
38				__( 'PHP is the programming language WordPress is developed in and your site runs on. PHP %1$s was released in %2$s and was replaced by PHP %3$s in %4$s. Newer versions of PHP are both faster and more secure, so updating will have a positive effect on your site. Plus, it it enables our developers to use the latest technologies to make Yoast SEO even better.', 'wordpress-seo' ),
39				'5.2',
40				'2006',
41				'5.3',
42				'2009'
43			)
44		) . '<br />';
45
46		$message[] = Whip_MessageFormatter::strongParagraph( __( 'How?', 'wordpress-seo' ) ) . '<br />';
47		$message[] = Whip_MessageFormatter::paragraph(
48			sprintf(
49				/* translators: 1: The link tag to the  WordPress instructions page for upgrading to newer versions of PHP; 2: The link closing tag; 3: The recommended PHP version; 4: The Yoast article about testing plugin compatibility with newer PHP versions; */
50				__( 'For any questions you may have about updating your PHP version, WordPress %1$shas a great page with instructions here%2$s. We recommend going up to version %3$s. Not all plugins may be ready for PHP 7 though, so %4$swe wrote an article on how to test them before you update here%2$s.', 'wordpress-seo' ),
51				'<a href="https://wordpress.org/support/upgrade-php/" target="_blank" rel="noopener noreferrer">',
52				'</a>',
53				'7.2',
54				'<a href="' . WPSEO_Shortlinker::get( 'https://yoa.st/wg' ) . '" target="_blank">'
55			) ) . '<br />';
56
57		$message[] = Whip_MessageFormatter::paragraph(
58			sprintf(
59				/* translators: 1: The link tag to email examples page; 2: The link closing tag; 3: The link tag for the list of recommended WordPress hosting partners; */
60				__( 'If you cannot update your PHP yourself, you can send an email to your host. We have %1$sexamples%2$s here. If they don\'t want to upgrade your PHP version, we recommend switching hosts. Take a look at our list of %3$srecommended WordPress hosting partners%2$s, they\'ve been vetted by the Yoast support team and offer all the features a modern host should have.', 'wordpress-seo' ),
61				'<a href="' . WPSEO_Shortlinker::get( 'https://yoa.st/wh' ) . '" target="_blank">',
62				'</a>',
63				sprintf( '<a href="%1$s" target="_blank">', esc_url( Whip_Host::hostingPageUrl() ) )
64				) ) . '<br />';
65
66		return implode( $message, "\n" );
67	}
68}