• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / wordpress-seo / 5066322038

pending completion
5066322038

push

github

GitHub
Merge pull request #20316 from Yoast/JRF/ghactions-run-more-selectively

2550 of 29012 relevant lines covered (8.79%)

0.32 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/presenters/admin/migration-error-presenter.php
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
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc