Skip to content

Commit 09d7605

Browse files
committed
more tweaks for admin notices
1 parent 5b836ba commit 09d7605

1 file changed

Lines changed: 17 additions & 12 deletions

File tree

admin-notices.php

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,28 @@ function sqlite_plugin_admin_notice() {
4545
);
4646

4747
return;
48-
} elseif ( ! file_exists( WP_CONTENT_DIR . '/db.php' ) && ! wp_is_writable( WP_CONTENT_DIR ) ) {
48+
}
49+
50+
if ( file_exists( WP_CONTENT_DIR . '/db.php' ) ) {
51+
return;
52+
}
53+
54+
if ( ! wp_is_writable( WP_CONTENT_DIR ) ) {
4955
printf(
5056
'<div class="notice notice-error"><p>%s</p></div>',
5157
esc_html__( 'The SQLite Integration plugin is active, but the wp-content/db.php file is missing and the wp-content directory is not writable. Please ensure the wp-content folder is writable, then deactivate the plugin and try again.', 'sqlite' )
5258
);
5359
return;
54-
} elseif ( ! file_exists( WP_CONTENT_DIR . '/db.php' ) ) {
55-
// The dropin db.php is missing.
56-
printf(
57-
'<div class="notice notice-error"><p>%s</p></div>',
58-
sprintf(
59-
/* translators: 1: db.php drop-in path, 2: Admin URL to deactivate the module */
60-
__( 'The SQLite Integration plugin is active, but the %1$s file is missing. Please <a href="%2$s">deactivate the plugin</a> and re-activate it to try again.', 'sqlite' ),
61-
'<code>' . esc_html( basename( WP_CONTENT_DIR ) ) . '/db.php</code>',
62-
esc_url( admin_url( 'plugins.php' ) )
63-
)
64-
);
6560
}
61+
// The dropin db.php is missing.
62+
printf(
63+
'<div class="notice notice-error"><p>%s</p></div>',
64+
sprintf(
65+
/* translators: 1: db.php drop-in path, 2: Admin URL to deactivate the module */
66+
__( 'The SQLite Integration plugin is active, but the %1$s file is missing. Please <a href="%2$s">deactivate the plugin</a> and re-activate it to try again.', 'sqlite' ),
67+
'<code>' . esc_html( basename( WP_CONTENT_DIR ) ) . '/db.php</code>',
68+
esc_url( admin_url( 'plugins.php' ) )
69+
)
70+
);
6671
}
6772
add_action( 'admin_notices', 'sqlite_plugin_admin_notice' ); // Add the admin notices.

0 commit comments

Comments
 (0)