Skip to content

Commit eefe318

Browse files
committed
Remove obsolete Performance Lab migration
The migration path has been broken since 2023, when direct file deletion was replaced with $wp_filesystem->delete() without initializing the WordPress filesystem. Remove its upgrade handler, UI, and notice compatibility now that the former module is obsolete.
1 parent d6d2f1c commit eefe318

4 files changed

Lines changed: 6 additions & 54 deletions

File tree

‎packages/plugin-sqlite-database-integration/activate.php‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,6 @@ function sqlite_activation() {
5353

5454
check_admin_referer( 'sqlite-install' );
5555

56-
// Handle upgrading from the performance-lab plugin.
57-
if ( isset( $_GET['upgrade-from-pl'] ) ) {
58-
global $wp_filesystem;
59-
require_once ABSPATH . '/wp-admin/includes/file.php';
60-
// Delete the previous db.php file.
61-
$wp_filesystem->delete( WP_CONTENT_DIR . '/db.php' );
62-
// Deactivate the performance-lab SQLite module.
63-
$pl_option_name = defined( 'PERFLAB_MODULES_SETTING' ) ? PERFLAB_MODULES_SETTING : 'perflab_modules_settings';
64-
$pl_option = get_option( $pl_option_name, array() );
65-
unset( $pl_option['database/sqlite'] );
66-
update_option( $pl_option_name, $pl_option );
67-
}
68-
6956
sqlite_plugin_copy_db_file();
7057

7158
// WordPress will automatically redirect to the install screen here.

‎packages/plugin-sqlite-database-integration/admin-notices.php‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,3 @@ function sqlite_plugin_admin_notice() {
7474
);
7575
}
7676
add_action( is_multisite() ? 'network_admin_notices' : 'admin_notices', 'sqlite_plugin_admin_notice' ); // Add the admin notices.
77-
78-
// Remove the PL-plugin admin notices for SQLite.
79-
remove_action( 'admin_notices', 'perflab_sqlite_plugin_admin_notice' );

‎packages/plugin-sqlite-database-integration/admin-page.php‎

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -76,49 +76,17 @@ function sqlite_integration_admin_screen() {
7676
<p><?php esc_html_e( 'We detected that the PDO SQLite driver is missing from your server (the pdo_sqlite extension is not loaded). Please make sure that SQLite is enabled in your PHP installation before proceeding.', 'sqlite-database-integration' ); ?></p>
7777
</div>
7878
<?php elseif ( file_exists( $db_dropin_path ) && ! defined( 'SQLITE_DB_DROPIN_VERSION' ) && ! $override_db_dropin ) : ?>
79-
<?php if ( defined( 'PERFLAB_SQLITE_DB_DROPIN_VERSION' ) ) : ?>
80-
<div class="notice notice-warning">
81-
<p>
82-
<?php
83-
printf(
84-
/* translators: %s: db.php drop-in path */
85-
esc_html__( 'An older %s file was detected. Please click the button below to update the file.', 'sqlite-database-integration' ),
86-
'<code>' . esc_html( basename( WP_CONTENT_DIR ) ) . '/db.php</code>'
87-
);
88-
?>
89-
</p>
90-
</div>
91-
<?php
92-
$upgrade_url = add_query_arg(
93-
array(
94-
'confirm-install' => '1',
95-
'upgrade-from-pl' => '1',
96-
),
97-
sqlite_plugin_get_admin_page_url()
98-
);
99-
?>
100-
<a class="button button-primary" href="<?php echo esc_url( wp_nonce_url( $upgrade_url, 'sqlite-install' ) ); ?>">
79+
<div class="notice notice-error">
80+
<p>
10181
<?php
10282
printf(
10383
/* translators: %s: db.php drop-in path */
104-
esc_html__( 'Update %s file', 'sqlite-database-integration' ),
84+
esc_html__( 'The SQLite plugin cannot be activated because a different %s drop-in already exists.', 'sqlite-database-integration' ),
10585
'<code>' . esc_html( basename( WP_CONTENT_DIR ) ) . '/db.php</code>'
10686
);
10787
?>
108-
</a>
109-
<?php else : ?>
110-
<div class="notice notice-error">
111-
<p>
112-
<?php
113-
printf(
114-
/* translators: %s: db.php drop-in path */
115-
esc_html__( 'The SQLite plugin cannot be activated because a different %s drop-in already exists.', 'sqlite-database-integration' ),
116-
'<code>' . esc_html( basename( WP_CONTENT_DIR ) ) . '/db.php</code>'
117-
);
118-
?>
119-
</p>
120-
</div>
121-
<?php endif; ?>
88+
</p>
89+
</div>
12290
<?php elseif ( ! is_writable( WP_CONTENT_DIR ) ) : ?>
12391
<div class="notice notice-error">
12492
<p>

‎packages/plugin-sqlite-database-integration/db.copy‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ if ( ! defined( 'DB_ENGINE' ) ) {
3636
// Require the implementation from the plugin.
3737
require_once $sqlite_plugin_implementation_folder_path . '/wp-includes/sqlite/db.php';
3838

39-
// Activate the performance-lab plugin if it is not already activated.
39+
// Activate the SQLite Database Integration plugin if it is not already activated.
4040
add_action(
4141
'admin_footer',
4242
function() {

0 commit comments

Comments
 (0)