Create tables during plugin activation
-
According to https://codex.ww.wp.xz.cn/Creating_Tables_with_Plugins plugins should create tables during plugin activation.
However, this plugin doesn’t do that.
In lib/class-wp-smush-dir.php, create_table() creates the table. This function starts with:
// Run the query only on directory smush page. if ( ! isset( $_GET['page'] ) || 'smush' !== $_GET['page'] ) { return null; }I suggest that, in order to comply with WordPress best practices:
1. A call to register_activation_hook be added which calls create_table()
2. Theifcondition checking the page be removed fromcreate_table()
3. All other calls to create_table be removed
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Create tables during plugin activation’ is closed to new replies.