It is a good practice to include index.php, with and without a wordpress context. Appach 2.4+ IIRC will add a log message about a missing file if someone access the directory itself, which makes reading the error log more annoying.
As for the reason you quote, obviously this do not have any security related impact, and the “wordpress will have to parse one more file once a year”…. you are a great developer if that is the only performance issue you have in your code, and with php 5.6 code caching even that claim might not be true any longer.
You can put your code in the index.php file but by now people have expectations about the naming of the “main” plugin file, and therefor it might create pointless confusion as most people will assume index.php is an empty file
Related Posts:
- How can you check if you are in a particular page in the WP Admin section? For example how can I check if I am in the Users > Your Profile page?
- How to store username and password to API in wordpress option DB?
- Why does WordPress add 0 (zero) to an Ajax response?
- In Which Contexts are Plugins Responsible for Data Validation/Sanitization?
- function deactivate_plugins does not exist
- Nonces can be reused multiple times? Bug / Security issue?
- Understanding WordPress functions’ naming conventions
- function triggered by “manage_users_custom_column” filter not working
- WordPress plugin how to run function when button is clicked
- When is it appropriate to put functions on page template vs. functions.php?
- Shortcodes, output buffering, and WordPress functions
- How can i list current author’s categories?
- When to check if a function exists
- Dynamically Override Fancy Title
- Problems with removing admin bar
- Problem with `wp_mail()`
- Calling a function from functions.php in custom page/ blog post
- What is the Difference between directly call a function and call a function using add_action?
- Call to undefined function get_blog_option()
- What is the difference between current_page_parent and current_page_ancestor?
- Confusion on WP Nonce usage in my Plugin
- Undefined function wp_set_password
- Plugin Uninstall and Deactivate via Options Menu
- How can I add a CSS rule to edit.php?
- Why do I need to check if wp_nonce_field() exists before using it
- Is there any way to check for user login and send him to login?
- WordPress security issue to output data from user input from theme option form
- Widget update function not saving values
- add more custom post types and custom role to the code
- How to use WP_Term with (menu) argument in the wp_nav_menu?
- WordPress after content Hook & external template part
- Enqueue scripts in footer
- override pluggable.php functions
- is user logged in not working
- Override class inside $atts shortcode_atts in WordPress
- creating custom function to log actions in plugin
- add_rewrite_rule works in themes function php but when moved into plugin it stops working
- Maximum lifetime for nonce
- Where can i find wordpress auto update code flows?
- Secure Pages Best Practice
- Adding option to Gallery shortcode
- how to search users by ajax live search
- Remove unwanted elements for a wp_nav_menu
- best way to make a WordPresss multisite that is secure but at the same time supporting my plugin development efforts
- Video Security just like facebook [closed]
- How to add user details to different tables immediately after user registration
- mysql_real_escape_string() vs. esc_sql() in WordPress
- Checking for existence of a page by title?
- how to get context information inside my funcion
- Is disabling test_form in wp_handle_upload a security concern?
- How to connect my wordpress plugin to a remote database securely?
- wp_nonce_field displaying twice
- WordPress class, using add_action to call member function does not work
- Is it necessary to do validation again when retrieving data from database?
- Function/Class to list categories with checkboxes
- Checking a WordPress for OWASP top 10 vulnerabilities [closed]
- How do I have now a duplicated user entry if this is not allowed (and I cannot replicate it)?
- Warning: call_user_func_array() expects parameter 1 to be a valid callback
- Print Dashboard submenu name and filename
- Are there any security risks when submitting data-attribute data through AJAX?
- Autogenerate a Table of Contents
- Alternative functions for mysql_free_result and mysql_ping in wordpress functions
- WordPress multisite,use same cookies across all website?
- Why would you use esc_attr() on internal functions?
- Call to undefined function is_home() or any conditional tags
- unregister_setting() vs delete_option() for plugin update
- How to change WooCommerce loop product title HTML output in single product page and archive page
- Is it possible to use WP-CLI in a plugin (or theme)?
- Secruity Questions on a timer
- wp_schedule_event is registered but function isn’t running
- Using HTML links within translatable string
- Remove Permalink Meta Box not working?
- Setting post_id for single.php based on URL without a redirect
- using admin functions on frontend
- Javascript Function Called Too Early in PHP Script
- Using password protection to load different page elements?
- WP 3-way voting system: On to something! Please help!
- Change the behaviour of a button
- HTML Elements in my WP Plugin being generated in JS. Security and Translated Text Question about this method being used
- function add custom fields to media gallery
- How to store sensitive user data (passwords)
- Redirection from a specific page for users logged in but not with membership
- WordPress: I wanted to use Add rewrite rule multiple times for multiple CPT in my plugin
- WordPress Ajax not returning Response
- how to add security questions on wp-registration page and validate it
- Remove tag from all posts when publishing new post
- wp_ajax add_action fuction won’t fire on custom jQuery action
- foreach argument to get specific file types getting too many returns
- Remove from a div by class name from post page if post author role is not administrator
- Building WordPress Themes With Bootstrap with Adi Purdila → TutsPlus
- Ajax not working to insert, query and result data
- Template file structure , wordpress hook for altering the template
- How can I see a varibles value when my plugin runs?
- How can I add recent posts to menu like mashable
- Why is ‘register_activation_hook’ undefined?
- Custom options page for themes
- Why does this fail: Disabling plugins enqueue_script() in functions.php
- Call do_action() within WordPress cronjob
- How to plugin function code move to theme function.php ? I’ve tried below code but not working [closed]
- WordPress simple ‘Hello World’ plugin – problems