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 to include PHP files in plugins the correct way
- 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?
- Passing arguments to a admin menu page callback?
- function deactivate_plugins does not exist
- How to properly validate data from $_GET or $_REQUEST using WordPress functions?
- Nonces can be reused multiple times? Bug / Security issue?
- Can someone explain what wp_session_tokens are, and what are they used for?
- What is an alternative method to the WordPress private _doing_it_wrong() function
- WordPress and PHP Sessions – Security and Performance
- Understanding WordPress functions’ naming conventions
- What is the difference between esc_html and wp_filter_nohtml_kses?
- Using OOP plugin’s methods throughout the website
- Nonce in settings API with tabbed navigation
- Log in from one wordpress website to another wordpress website
- function triggered by “manage_users_custom_column” filter not working
- How can I change the frequency of a scheduled event?
- WordPress plugin how to run function when button is clicked
- Escaping built-in WP function return strings
- When is it appropriate to put functions on page template vs. functions.php?
- What is the difference between strip_tags and wp_filter_nohtml_kses?
- WP Cron doesn’t save or in post body
- Shortcodes, output buffering, and WordPress functions
- How can i list current author’s categories?
- Determine which theme location a wp_get_nav_menu_items is for
- When to check if a function exists
- Checking for existence of a page by title?
- Dynamically Override Fancy Title
- Problems with removing admin bar
- Problem with `wp_mail()`
- Calling a function from functions.php in custom page/ blog post
- Check if I am in the Admin Panel (wp-admin)?
- What is the Difference between directly call a function and call a function using add_action?
- Call to undefined function get_blog_option()
- WordPress restrict plugin file direct access
- 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
- Does add_filter work outside functions.php
- What function to hook for changes made in status and visibility of a post
- how to use preg_replace for wordpress video?
- Plugin Uninstall and Deactivate via Options Menu
- Coding a plugin on WordPress; when should I sanitize? [duplicate]
- Correct way check nonce (security) using old Options API
- How can I add a CSS rule to edit.php?
- Why do I need to check if wp_nonce_field() exists before using it
- wp_enqueue_script + wp_enqueue_style Since When
- 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
- $content variable – Is this a reserved variable for a WordPress function? – php / wordpress
- 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
- Retrieve contents/page names of various pages for use in a plugin
- Can wp_list_comments output into variable?
- is user logged in not working
- Can I change header.php of current theme through a plugin function?
- get_current_screen() return null
- 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
- Verify if user is wordpress logged in from another app since wordpress 4.0
- Where can i find wordpress auto update code flows?
- Secure Pages Best Practice
- Adding option to Gallery shortcode
- correct way to call javascript into hook function
- Securing/Escaping Output of file content – reading via fread() in PHP
- How to change the hover content of a specific menu item on WordPress?
- how to search users by ajax live search
- Remove unwanted elements for a wp_nav_menu
- How do I update a field of a meta box?
- 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
- WordPress function get_the_terms() returns ‘Invalid taxonomy’ error
- Ajax not working to insert, query and result data
- What is more secure checking capabilities of user or checking role of user in WordPress plugin development
- Template file structure , wordpress hook for altering the template
- WordPress permalink setting
- 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?
- Dynamic banner for use on external sites
- Data Validation, dynamically generated fields (select for example)
- How can i call from custom fields to the category editor?
- 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
- get_term_by() returning null on plugin
- esc_url, esc_url_raw or sanitize_url?
- Sticky bar with filter button and product count