Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
38 | function email_log_delete_table() { |
||
39 | global $wpdb; |
||
40 | $table_name = $wpdb->prefix . "email_log"; // This is hardcoded on purpose |
||
41 | |||
42 | if( $wpdb->get_var( "SHOW TABLES LIKE '{$table_name}'" ) == $table_name ) { |
||
1 ignored issue
–
show
|
|||
43 | // If table is present, drop it |
||
44 | $wpdb->query( "DROP TABLE $table_name" ); |
||
1 ignored issue
–
show
|
|||
45 | } |
||
46 | |||
47 | // Delete the option |
||
48 | delete_option('email-log-db'); |
||
49 | } |
||
50 | ?> |
||
51 |
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.