PluginProbe
SQLite Database Integration / 3.0.2
SQLite Database Integration v3.0.2
3.0.2 3.0.1 trunk 2.1.13 2.1.14 2.1.15 2.1.16 2.2.0 2.2.1 2.2.10 2.2.11 2.2.12 2.2.13 2.2.14 2.2.15 2.2.16 2.2.17 2.2.18 2.2.19 2.2.2 2.2.20 2.2.21 2.2.22 2.2.23 2.2.3 All 32 releases
← All changes | admin-notices.php +7 -10 2.2.33.0.2 View file →
@@ -1,10 +1,7 @@
1 1 <?php
2 2 /**
3 3 * Functions to add admin notices if necessary.
4 - *
5 - * @since 1.0.0
6 - * @package wp-sqlite-integration
7 4 */
8 5
9 6 /**
10 7 * Add admin notices.
@@ -11,8 +8,11 @@
11 8 *
12 9 * When the plugin gets merged in wp-core, this is not to be ported.
13 10 */
14 11 function sqlite_plugin_admin_notice() {
12 + if ( ! current_user_can( sqlite_plugin_get_manage_capability() ) ) {
13 + return;
14 + }
15 15
16 16 // Don't print notices in the plugin's admin screen.
17 17 global $current_screen;
18 18 if ( isset( $current_screen->base ) && 'settings_page_sqlite-integration' === $current_screen->base ) {
@@ -18,13 +18,13 @@
18 18 if ( isset( $current_screen->base ) && 'settings_page_sqlite-integration' === $current_screen->base ) {
19 19 return;
20 20 }
21 21
22 - // If PDO SQLite is not loaded, bail early.
22 + // Bail early if the pdo_sqlite extension is not loaded.
23 23 if ( ! extension_loaded( 'pdo_sqlite' ) ) {
24 24 printf(
25 25 '<div class="notice notice-error"><p>%s</p></div>',
26 - esc_html__( 'The SQLite Integration plugin is active, but the PDO SQLite extension is missing from your server. Please make sure that PDO SQLite is enabled in your PHP installation.', 'sqlite-database-integration' )
26 + esc_html__( 'The SQLite Integration plugin is active, but the pdo_sqlite extension is missing from your server. Please make sure that pdo_sqlite is enabled in your PHP installation.', 'sqlite-database-integration' )
27 27 );
28 28 return;
29 29 }
30 30
@@ -65,12 +65,9 @@
65 65 sprintf(
66 66 /* translators: 1: db.php drop-in path, 2: Admin URL to deactivate the module */
67 67 __( '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-database-integration' ),
68 68 '<code>' . esc_html( basename( WP_CONTENT_DIR ) ) . '/db.php</code>',
69 - esc_url( admin_url( 'plugins.php' ) )
69 + esc_url( self_admin_url( 'plugins.php' ) )
70 70 )
71 71 );
72 72 }
73 -add_action( 'admin_notices', 'sqlite_plugin_admin_notice' ); // Add the admin notices.
74 -
75 -// Remove the PL-plugin admin notices for SQLite.
76 -remove_action( 'admin_notices', 'perflab_sqlite_plugin_admin_notice' );
73 +add_action( is_multisite() ? 'network_admin_notices' : 'admin_notices', 'sqlite_plugin_admin_notice' ); // Add the admin notices.