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