Best practice for Designing a Plugin with this scenario

You can create a page after your plugin is activated. Take a look at this: register_activation_hook( __FILE__, ‘insert_page’ ); function insert_page(){ $my_page = array( ‘post_title’ => ‘My Page’, ‘post_name’ => ‘MyPage’, ‘post_content’ => ‘My page’s content.’, ‘post_status’ => ‘publish’, ‘post_author’ => get_current_user_id(), ‘post_type’ => ‘page’, ); wp_insert_post( $my_page, ” ); } Then assign your template … Read more

get_plugins() is not give plugin list after performed delete_plugins()

To answer your main question, you are missing one line before calling get_plugins(). Without it, the list of plugins will come from cache. You can use the following sequence: delete_plugins( array( ‘akismet/akismet.php’ ) ); wp_clean_plugins_cache( false ); get_plugins(); WARNING: it is not recommended using delete_plugins() in scripts, unless it is a part of complete procedure … Read more

Upload files to the plugin menu

I think I’ve been down that road. Take a look at wp_handle_upload, which will upload your file to the /uploads directory and then wp_insert_attachment and wp_generate_attachment_metadata to list said upload in the media library as an attachment which will ‘register it in the wordpress database’. Then you can query attachments like this: $attachments = get_posts( … Read more