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

Yoast / wordpress-seo / dd6e866a9e6d253114633104d9e3858d807178ba

19 Jun 2024 10:03AM UTC coverage: 48.628% (-4.3%) from 52.936%
dd6e866a9e6d253114633104d9e3858d807178ba

push

github

web-flow
Merge pull request #21431 from Yoast/21429-update-copy-in-the-introduction-and-consent-modals

Updates the copy for the introduction and consent modals

7441 of 13454 branches covered (55.31%)

Branch coverage included in aggregate %.

0 of 3 new or added lines in 2 files covered. (0.0%)

3718 existing lines in 107 files now uncovered.

25100 of 53464 relevant lines covered (46.95%)

62392.47 hits per line

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

0.0
/admin/import/class-import-status.php
1
<?php
2
/**
3
 * WPSEO plugin file.
4
 *
5
 * @package WPSEO\Admin\Import
6
 */
7

8
/**
9
 * Class WPSEO_ImportStatus.
10
 *
11
 * Holds the status of and message about imports.
12
 */
13
class WPSEO_Import_Status {
14

15
        /**
16
         * The import status.
17
         *
18
         * @var bool
19
         */
20
        public $status = false;
21

22
        /**
23
         * The import message.
24
         *
25
         * @var string
26
         */
27
        private $msg = '';
28

29
        /**
30
         * The type of action performed.
31
         *
32
         * @var string
33
         */
34
        private $action;
35

36
        /**
37
         * WPSEO_Import_Status constructor.
38
         *
39
         * @param string $action The type of import action.
40
         * @param bool   $status The status of the import.
41
         * @param string $msg    Extra messages about the status.
42
         */
UNCOV
43
        public function __construct( $action, $status, $msg = '' ) {
×
UNCOV
44
                $this->action = $action;
×
UNCOV
45
                $this->status = $status;
×
UNCOV
46
                $this->msg    = $msg;
×
47
        }
48

49
        /**
50
         * Get the import message.
51
         *
52
         * @return string Message about current status.
53
         */
UNCOV
54
        public function get_msg() {
×
UNCOV
55
                if ( $this->msg !== '' ) {
×
UNCOV
56
                        return $this->msg;
×
57
                }
58

UNCOV
59
                if ( $this->status === false ) {
×
60
                        /* translators: %s is replaced with the name of the plugin we're trying to find data from. */
UNCOV
61
                        return __( '%s data not found.', 'wordpress-seo' );
×
62
                }
63

UNCOV
64
                return $this->get_default_success_message();
×
65
        }
66

67
        /**
68
         * Get the import action.
69
         *
70
         * @return string Import action type.
71
         */
UNCOV
72
        public function get_action() {
×
UNCOV
73
                return $this->action;
×
74
        }
75

76
        /**
77
         * Set the import action, set status to false.
78
         *
79
         * @param string $action The type of action to set as import action.
80
         *
81
         * @return void
82
         */
UNCOV
83
        public function set_action( $action ) {
×
UNCOV
84
                $this->action = $action;
×
UNCOV
85
                $this->status = false;
×
86
        }
87

88
        /**
89
         * Sets the importer status message.
90
         *
91
         * @param string $msg The message to set.
92
         *
93
         * @return void
94
         */
UNCOV
95
        public function set_msg( $msg ) {
×
UNCOV
96
                $this->msg = $msg;
×
97
        }
98

99
        /**
100
         * Sets the importer status.
101
         *
102
         * @param bool $status The status to set.
103
         *
104
         * @return WPSEO_Import_Status The current object.
105
         */
UNCOV
106
        public function set_status( $status ) {
×
UNCOV
107
                $this->status = (bool) $status;
×
108

UNCOV
109
                return $this;
×
110
        }
111

112
        /**
113
         * Returns a success message depending on the action.
114
         *
115
         * @return string Returns a success message for the current action.
116
         */
UNCOV
117
        private function get_default_success_message() {
×
UNCOV
118
                switch ( $this->action ) {
×
UNCOV
119
                        case 'import':
×
120
                                /* translators: %s is replaced with the name of the plugin we're importing data from. */
UNCOV
121
                                return __( '%s data successfully imported.', 'wordpress-seo' );
×
UNCOV
122
                        case 'cleanup':
×
123
                                /* translators: %s is replaced with the name of the plugin we're removing data from. */
UNCOV
124
                                return __( '%s data successfully removed.', 'wordpress-seo' );
×
UNCOV
125
                        case 'detect':
×
126
                        default:
127
                                /* translators: %s is replaced with the name of the plugin we've found data from. */
UNCOV
128
                                return __( '%s data found.', 'wordpress-seo' );
×
129
                }
130
        }
131
}
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

© 2025 Coveralls, Inc