PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 18.8
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v18.8
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / presenters / admin / migration-error-presenter.php

migration-error-presenter.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 18.8, at src/presenters/admin/migration-error-presenter.php

72 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yoast\WP\SEO\Presenters\Admin;
4
5 use WPSEO_Shortlinker;
6 use Yoast\WP\SEO\Presenters\Abstract_Presenter;
7
8 /**
9 * Presenter class for the migration error.
10 */
11 class Migration_Error_Presenter extends Abstract_Presenter {
12
13 /**
14 * Holds the migration error.
15 *
16 * The array holds the following values if filled:
17 * - int|false $time The timestamp.
18 * - string $version The Yoast SEO version.
19 * - string $message The error message.
20 *
21 * @var array
22 */
23 protected $migration_error;
24
25 /**
26 * Migration_Error_Presenter constructor.
27 *
28 * @param array $migration_error The migration error.
29 */
30 public function __construct( $migration_error ) {
31 $this->migration_error = $migration_error;
32 }
33
34 /**
35 * Presents the migration error that occurred.
36 *
37 * @return string The error HTML.
38 */
39 public function present() {
40 $message = \sprintf(
41 /* translators: %s: Yoast SEO. */
42 \esc_html__( '%s had problems creating the database tables needed to speed up your site.', 'wordpress-seo' ),
43 'Yoast SEO'
44 );
45 $support = \sprintf(
46 /* translators: %1$s: link to help article about solving table issue. %2$s: is anchor closing. */
47 \esc_html__( 'Please read %1$sthis help article%2$s to find out how to resolve this problem.', 'wordpress-seo' ),
48 '<a href="' . WPSEO_Shortlinker::get( 'https://yoa.st/3-6' ) . '">',
49 '</a>'
50 );
51 $reassurance = \sprintf(
52 /* translators: %s: Yoast SEO. */
53 \esc_html__( 'Your site will continue to work normally, but won\'t take full advantage of %s.', 'wordpress-seo' ),
54 'Yoast SEO'
55 );
56
57 $debug_info = \sprintf(
58 '<details><summary>%1$s</summary><p>%2$s</p></details>',
59 \esc_html__( 'Show debug information', 'wordpress-seo' ),
60 \esc_html( $this->migration_error['message'] )
61 );
62
63 return \sprintf(
64 '<div class="notice notice-error"><p>%1$s</p><p>%2$s</p><p>%3$s</p>%4$s</div>',
65 $message,
66 $support,
67 $reassurance,
68 $debug_info
69 );
70 }
71 }
72