: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* @package WPSEO\Admin\Import
* Class WPSEO_ImportStatus.
* Holds the status of and message about imports.
class WPSEO_Import_Status {
* The type of action performed.
* WPSEO_Import_Status constructor.
* @param string $action The type of import action.
* @param bool $status The status of the import.
* @param string $msg Extra messages about the status.
public function __construct( $action, $status, $msg = '' ) {
* Get the import message.
* @return string Message about current status.
public function get_msg() {
if ( $this->msg !== '' ) {
if ( $this->status === false ) {
/* translators: %s is replaced with the name of the plugin we're trying to find data from. */
return __( '%s data not found.', 'wordpress-seo' );
return $this->get_default_success_message();
* @return string Import action type.
public function get_action() {
* Set the import action, set status to false.
* @param string $action The type of action to set as import action.
public function set_action( $action ) {
* Sets the importer status message.
* @param string $msg The message to set.
public function set_msg( $msg ) {
* Sets the importer status.
* @param bool $status The status to set.
* @return WPSEO_Import_Status The current object.
public function set_status( $status ) {
$this->status = (bool) $status;
* Returns a success message depending on the action.
* @return string Returns a success message for the current action.
private function get_default_success_message() {
switch ( $this->action ) {
/* translators: %s is replaced with the name of the plugin we're importing data from. */
return __( '%s data successfully imported.', 'wordpress-seo' );
/* translators: %s is replaced with the name of the plugin we're removing data from. */
return __( '%s data successfully removed.', 'wordpress-seo' );
/* translators: %s is replaced with the name of the plugin we've found data from. */
return __( '%s data found.', 'wordpress-seo' );