$data ) {
$slug = dirname( $file );
if ( '.' === $slug ) {
$slug = basename( $file, '.php' );
}
if ( 'robotstxt-manager' === $slug ) {
return is_plugin_active( $file );
}
}
return false;
}
/**
* Render the dismissible notice on the plugins list page.
*
* @since 1.4.2
*
* @return void
*/
public function render_plugins_page_notice(): void {
global $pagenow;
$current_page = isset( $pagenow ) && is_string( $pagenow ) ? $pagenow : '';
if ( 'plugins.php' !== $current_page ) {
return;
}
if ( ! current_user_can( 'manage_options' ) ) {
return;
}
if ( self::is_manager_active() ) {
return;
}
printf(
'
',
wp_kses_post( self::message_html() )
);
}
/**
* Render the persistent notice for the plugin settings page.
*
* @since 1.4.2
*
* @return void
*/
public static function render_settings_notice(): void {
if ( self::is_manager_active() ) {
return;
}
printf(
'',
wp_kses_post( self::message_html() )
);
}
/**
* Build the shared warning message HTML.
*
* @since 1.4.2
*
* @return string Message HTML with an escaped link.
*/
private static function message_html(): string {
return sprintf(
/* translators: %s: link to the ROBOTSTXT Manager plugin page. */
esc_html__( 'To receive plugin updates, the ROBOTSTXT Manager plugin must be installed and active. Download it from %s.', 'idrivee2-media-upload' ),
'ROBOTSTXT Manager'
);
}
}