Skip to content

Commit f9362ba

Browse files
committed
Skip plugin auto-activation if plugin file doesn't exist
1 parent 7be6b9c commit f9362ba

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

db.copy

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ add_action(
4646
if ( ! function_exists( 'activate_plugin' ) ) {
4747
require_once ABSPATH . 'wp-admin/includes/plugin.php';
4848
}
49-
if ( is_plugin_inactive( '{SQLITE_PLUGIN}' ) ) {
49+
50+
$plugin_path = WP_PLUGIN_DIR . '/' . '{SQLITE_PLUGIN}';
51+
52+
if ( file_exists( $plugin_path ) && is_plugin_inactive( '{SQLITE_PLUGIN}' ) ) {
5053
// If `activate_plugin()` returns a value other than null (like WP_Error),
5154
// the plugin could not be found. Try with a hardcoded string,
5255
// because that probably means the file was directly copy-pasted.

0 commit comments

Comments
 (0)