rrors() { $notification = Models\Notification::getNotificationByName( 'search-console-sitemap-has-errors' ); if ( ! aioseo()->searchStatistics->api->auth->isConnected() || ! aioseo()->internalOptions->searchStatistics->site->verified || 0 === aioseo()->internalOptions->searchStatistics->sitemap->lastFetch || // Not fetched yet. ! aioseo()->searchStatistics->sitemap->getSitemapsWithErrors() ) { if ( $notification->exists() ) { Models\Notification::deleteNotificationByName( 'search-console-sitemap-has-errors' ); } return; } if ( $notification->exists() ) { return; } $lastFetch = aioseo()->internalOptions->searchStatistics->sitemap->lastFetch; $lastFetch = date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $lastFetch ); Models\Notification::addNotification( [ 'slug' => uniqid(), 'notification_name' => 'search-console-sitemap-has-errors', 'title' => __( 'Your sitemap has errors.', 'all-in-one-seo-pack' ), 'content' => sprintf( // Translators: 1 - Last fetch date. __( 'We detected that your sitemap has errors. The last fetch was on %1$s. Click below to resolve this issue.', 'all-in-one-seo-pack' ), // phpcs:ignore Generic.Files.LineLength.MaxExceeded $lastFetch ), 'type' => 'warning', 'level' => [ 'all' ], 'button1_label' => __( 'Fix Sitemap Errors', 'all-in-one-seo-pack' ), 'button1_action' => 'https://route#aioseo-sitemaps&open-modal=true:general-sitemap', // phpcs:ignore Generic.Files.LineLength.MaxExceeded 'start' => gmdate( 'Y-m-d H:i:s' ) ] ); } }