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 to properly validate data from $_GET or $_REQUEST using WordPress functions?
- 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
- 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
- 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
- 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
- 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?
- 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)?
- WordPress restrict plugin file direct access
- What is the difference between current_page_parent and current_page_ancestor?
- 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?
- Coding a plugin on WordPress; when should I sanitize? [duplicate]
- Correct way check nonce (security) using old Options API
- Why do I need to check if wp_nonce_field() exists before using it
- wp_enqueue_script + wp_enqueue_style Since When
- Widget update function not saving values
- $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
- override pluggable.php functions
- Retrieve contents/page names of various pages for use in a plugin
- Can wp_list_comments output into variable?
- Can I change header.php of current theme through a plugin function?
- get_current_screen() return null
- 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
- Adding option to Gallery shortcode
- 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 do I update a field of a meta box?
- Video Security just like facebook [closed]
- WordPress function get_the_terms() returns ‘Invalid taxonomy’ error
- 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?
- WordPress class, using add_action to call member function does not work
- Is it necessary to do validation again when retrieving data from database?
- wp_get_theme Warning: Illegal offset type
- Checking a WordPress for OWASP top 10 vulnerabilities [closed]
- 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
- Apply styles to blockquote element with the WYSIWYG editor
- Why would you use esc_attr() on internal functions?
- Call to undefined function is_home() or any conditional tags
- How to output functions from plugin inside theme
- wp_schedule_event is registered but function isn’t running
- 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
- Modify code for functions.php with specific twitter user url and hashtags
- Using password protection to load different page elements?
- can’t access some WordPress function from my plugin
- Customise Grouped Product display in Woocommerce with custom column
- Change the behaviour of a button
- Can someone explain what’s the use of parse request function in WordPress?
- Add default value from selection
- HTML Elements in my WP Plugin being generated in JS. Security and Translated Text Question about this method being used
- Override category archive page title (not the head title)
- How to store sensitive user data (passwords)
- Redirection from a specific page for users logged in but not with membership
- Why would one specify multiple arguments when using get_previous_posts_link() which takes only one parameter?
- I cant add is_admin control to plugin
- How do I make secure API calls from my WordPress plugin?
- esc_attr() on hard coded string
- how to add security questions on wp-registration page and validate it
- wp_ajax add_action fuction won’t fire on custom jQuery action
- Add function to Dokan ajax class
- foreach argument to get specific file types getting too many returns
- Experts opinions needed: How (in)secure is this approach?
- Function not working on any file other than the main plugin file
- Building WordPress Themes With Bootstrap with Adi Purdila → TutsPlus
- 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
- Data Validation, dynamically generated fields (select for example)
- Custom options page for themes
- 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]
- get_term_by() returning null on plugin
- esc_url, esc_url_raw or sanitize_url?