Skip to content

Commit d980f23

Browse files
committed
"Install::verify_db()" removed.
1 parent 2569ec8 commit d980f23

File tree

2 files changed

+0
-85
lines changed

2 files changed

+0
-85
lines changed

classes/class-install.php

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@ public function __construct( $plugin ) {
7171
$this->db_version = $this->get_db_version();
7272
$this->stream_url = self_admin_url( $this->plugin->admin->admin_parent_page . '&page=' . $this->plugin->admin->settings_page_slug );
7373

74-
// Check DB and display an admin notice if there are tables missing.
75-
add_action( 'init', array( $this, 'verify_db' ) );
76-
7774
// Install the plugin.
7875
add_action( 'wp_stream_before_db_notices', array( $this, 'check' ) );
7976

@@ -137,87 +134,6 @@ public function check() {
137134
$this->update_db_option();
138135
}
139136

140-
/**
141-
* Verify that the required DB tables exists
142-
*
143-
* @return void
144-
*/
145-
public function verify_db() {
146-
/**
147-
* Filter will halt install() if set to true
148-
*
149-
* @param bool
150-
*
151-
* @return bool
152-
*/
153-
if ( apply_filters( 'wp_stream_no_tables', false ) ) {
154-
return;
155-
}
156-
157-
if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
158-
require_once ABSPATH . '/wp-admin/includes/plugin.php';
159-
}
160-
161-
/**
162-
* Fires before admin notices are triggered for missing database tables.
163-
*/
164-
do_action( 'wp_stream_before_db_notices' );
165-
166-
global $wpdb;
167-
168-
$database_message = '';
169-
$uninstall_message = '';
170-
171-
// Check if all needed DB is present.
172-
$missing_tables = array();
173-
174-
foreach ( $this->plugin->db->get_table_names() as $table_name ) {
175-
$table_search = $wpdb->get_var(
176-
$wpdb->prepare( 'SHOW TABLES LIKE %s', $table_name )
177-
);
178-
if ( $table_search !== $table_name ) {
179-
$missing_tables[] = $table_name;
180-
}
181-
}
182-
183-
if ( $missing_tables ) {
184-
$database_message .= sprintf(
185-
'%s <strong>%s</strong>',
186-
_n(
187-
'The following table is not present in the WordPress database:',
188-
'The following tables are not present in the WordPress database:',
189-
count( $missing_tables ),
190-
'stream'
191-
),
192-
esc_html( implode( ', ', $missing_tables ) )
193-
);
194-
}
195-
196-
if ( $this->plugin->is_network_activated() && current_user_can( 'manage_network_plugins' ) ) {
197-
$uninstall_message = sprintf(
198-
/* translators: %#$s: HTML Link tags (e.g. "<a href="https://foo.com/wp-admin/">") */
199-
__( 'Please %1$suninstall%2$s the Stream plugin and activate it again.', 'stream' ),
200-
'<a href="' . network_admin_url( 'plugins.php#stream' ) . '">',
201-
'</a>'
202-
);
203-
} elseif ( current_user_can( 'activate_plugins' ) ) {
204-
$uninstall_message = sprintf(
205-
/* translators: %#$s: HTML Link tags (e.g. "<a href="https://foo.com/wp-admin/">") */
206-
__( 'Please %1$suninstall%2$s the Stream plugin and activate it again.', 'stream' ),
207-
'<a href="' . admin_url( 'plugins.php#stream' ) . '">',
208-
'</a>'
209-
);
210-
}
211-
212-
if ( ! empty( $database_message ) ) {
213-
$this->plugin->admin->notice( $database_message );
214-
215-
if ( ! empty( $uninstall_message ) ) {
216-
$this->plugin->admin->notice( $uninstall_message );
217-
}
218-
}
219-
}
220-
221137
/**
222138
* Register a routine to be called when stream or a stream connector has been updated
223139
* It works by comparing the current version with the version previously stored in the database.

tests/tests/connectors/test-class-connector-edd.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ public function test_check() {
178178
edd_update_option( 'thousands_separator' );
179179

180180
// Check callback test action.
181-
$this->assertGreaterThan( 0, did_action( $this->action_prefix . 'callback_add_option' ) );
182181
$this->assertGreaterThan( 0, did_action( $this->action_prefix . 'callback_update_option' ) );
183182
}
184183

0 commit comments

Comments
 (0)