rl( 'options-reading.php' ), 'button2_label' => __( 'Remind Me Later', 'all-in-one-seo-pack' ), 'button2_action' => 'http://action#notification/blog-visibility-reminder', 'start' => gmdate( 'Y-m-d H:i:s' ) ] ); } /** * Add a notice if the description format is missing the Description tag. * * @since 4.0.5 * * @return void */ private function descriptionFormat() { $notification = Models\Notification::getNotificationByName( 'description-format' ); if ( ! in_array( 'descriptionFormat', aioseo()->internalOptions->deprecatedOptions, true ) ) { if ( $notification->exists() ) { Models\Notification::deleteNotificationByName( 'description-format' ); } return; } $descriptionFormat = aioseo()->options->deprecated->searchAppearance->global->descriptionFormat; if ( false !== strpos( $descriptionFormat, '#description' ) ) { if ( $notification->exists() ) { Models\Notification::deleteNotificationByName( 'description-format' ); } return; } if ( $notification->exists() ) { return; } Models\Notification::addNotification( [ 'slug' => uniqid(), 'notification_name' => 'description-format', 'title' => __( 'Invalid Description Format', 'all-in-one-seo-pack' ), 'content' => sprintf( // Translators: 1 - The plugin short name ("AIOSEO"). __( 'Warning: %1$s has detected that you may have an invalid description format. This could lead to descriptions not being properly applied to your content.', 'all-in-one-seo-pack' ), AIOSEO_PLUGIN_SHORT_NAME ) . ' ' . __( 'A Description tag is required in order to properly display your meta descriptions on your site.', 'all-in-one-seo-pack' ), 'type' => 'error', 'level' => [ 'all' ], 'button1_label' => __( 'Fix Now', 'all-in-one-seo-pack' ), 'button1_action' => 'http://route#aioseo-search-appearance&aioseo-scroll=description-format&aioseo-highlight=description-format:advanced', 'button2_label' => __( 'Remind Me Later', 'all-in-one-seo-pack' ), 'button2_action' => 'http://action#notification/description-format-reminder', 'start' => gmdate( 'Y-m-d H:i:s' ) ] ); } /** * Check if blog visibility is changing and add/delete the appropriate notification. * * @since 4.0.0 * * @param string $optionName The name of the option we are checking. * @param mixed $oldValue The old value. * @param mixed $newValue The new value. * @return void */ public function maybeResetBlogVisibility( $optionName, $oldValue = '', $newValue = '' ) { if ( 'blog_public' === $optionName ) { if ( 1 === intval( $newValue ) ) { $notification = Models\Notification::getNotificationByName( 'blog-visibility' ); if ( ! $notification->exists() ) { return; } Models\Notification::deleteNotificationByName( 'blog-visibility' ); return; } $this->blogVisibility(); } } /** * Add a notice if the blog is set to hidden. * * @since 4.0.0 * * @return void */ public function conflictingPlugins( $plugins = [] ) { if ( empty( $plugins ) ) { return; } $content = sprintf( // Translators: 1 - The plugin short name ("AIOSEO"). __( 'Warning: %1$s has detected other active SEO or sitemap plugins. We recommend that you deactivate the following plugins to prevent any conflicts:', 'all-in-one-seo-pack' ), AIOSEO_PLUGIN_SHORT_NAME ) . ''; // Update an existing notice. $notification = Models\Notification::getNotificationByName( 'conflicting-plugins' ); if ( $notification->exists() ) { $notification->content = $content; $notification->save(); return; } // Create a new one if it doesn't exist. Models\Notification::addNotification( [ 'slug' => uniqid(), 'notification_name' => 'conflicting-plugins', 'title' => __( 'Conflicting Plugins Detected', 'all-in-one-seo-pack' ), 'content' => $content, 'type' => 'error', 'level' => [ 'all' ], 'button1_label' => __( 'Fix Now', 'all-in-one-seo-pack' ), 'button1_action' => 'http://action#sitemap/deactivate-conflicting-plugins?refresh', 'button2_label' => __( 'Remind Me Later', 'all-in-one-seo-pack' ), 'button2_action' => 'http://action#notification/conflicting-plugins-reminder', 'start' => gmdate( 'Y-m-d H:i:s' ) ] ); } }