@@ -51,14 +51,12 @@
} else {
$value = esc_html( $value );
}
-
-
}
// Rename some fields.
- if ( '_subscriber_via' == $key ) {
+ if ( '_subscriber_via' === $key ) {
if ( is_numeric( $value ) ) {
$form = noptin_get_optin_form( $value );
diff --git a/uninstall.php b/uninstall.php
index b697ff76..b8a5c742 100644
--- a/uninstall.php
+++ b/uninstall.php
@@ -11,14 +11,12 @@
// Delete subscribers table.
$table = $wpdb->prefix . 'noptin_subscribers';
-if ( $wpdb->get_var( "SHOW TABLES LIKE '$table'" ) == $table ) {
- $sql = "DROP TABLE $table";
- $wpdb->query( $sql );
+if ( $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $table ) ) === $table ) {
+ $wpdb->query( $wpdb->prepare( 'DROP TABLE %s', $table ) );
}
// Delete subscribers meta table.
$table = $wpdb->prefix . 'noptin_subscriber_meta';
-if ( $wpdb->get_var( "SHOW TABLES LIKE '$table'" ) == $table ) {
- $sql = "DROP TABLE $table";
- $wpdb->query( $sql );
+if ( $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $table ) ) === $table ) {
+ $wpdb->query( $wpdb->prepare( 'DROP TABLE %s', $table ) );
}