No, they should not. If a plugin has vulnerabilities just because someone might see its directory structure it is broken. These bugs should be fixed.
Security through obscurity is a bug for itself.
It’s up to the site owner to allow or forbid directory browsing.
A second issue is performance: WordPress scans all PHP files in a plugin’s root directory to find plugin headers. This allows you to have multiple plugins under the same directory, eg /wp-content/plugins/wpse-examples/
.
It also means that unused PHP files in that directory are wasting time and memory when WordPress is searching for plugins. One file will not do much harm, but imagine this is getting a common practice. You are creating a real problem in an attempt to fix a fictional.
Related Posts:
- ajaxurl not defined on front end
- How to include jQuery and JavaScript files correctly?
- Single functions.php or split into many small files?
- How can I configure Docker for developing and deploying a custom theme?
- How to post data to same page in wordpress
- Understanding WordPress functions’ naming conventions
- What is the difference between esc_html and wp_filter_nohtml_kses?
- jQuery in header or footer
- Show a user their recently viewed posts
- Escaping built-in WP function return strings
- What’s the difference between hooks, filters and actions? [duplicate]
- Add new user and add meta at once
- How to Display Custom Post Type’s Gallery (images ) in Through WP_Query
- Customizer Not Saving Options
- How to add Font Awesome 5 icons in WP Admin dashboard menu?
- Error : “Updating failed: The response is not a valid JSON response” with custom shortcode
- What’s the better way to add an inline script?
- What function to hook for changes made in status and visibility of a post
- Example of uninstaller routine to remove all custom theme options from wp_options
- Metabox Not Showing on Custom Post Type But On Pages and Post
- Execution limit and Memory limit errors even i changed to 1024M and 600(cache.php,load.php)?
- Are we allowed to use the Allman (BSD) indent style when coding WordPress plugins and themes?
- Backslashes being stripped from CSS
- How to determine if the current file is loaded in a plugin or in a theme?
- Filter, or any way to dynamically change theme screenshot image?
- Finding the paragraphs in content
- How to avoid loading same script twice?
- Can I individually style items in the backend widget list?
- WP_Query returns no results
- Finding posts containing matching array elements in a meta field usign WP_Query
- Should action callbacks start with a verb?
- WordPress not working on localhost
- How to Create Custom HTML Tag on Editor in `Text(HTML)` mode
- Is It Always a Best Practice to Decouple the Frontend from the Admin Area When Developing a WordPress Application?
- Beginner advice
- How to render a time-of-day string like ’16:42′ with a site’s chosen time format?
- Are block templates incompatible with serialize_blocks?
- How to filter users list on user_status field with get_users()
- SQL query for custom taxonomy slugs
- Can Page Templates be Applied to Archive and Post Templates?
- Is there some way to provide the user a list of existing content in a CPT
- Change the look and feel of admin pages
- Form doesnt save to database
- Notice: Trying to get property ‘term_id’ of non-object
- What is the proper method of using global $post?
- How to change title tag at page after loaded post?
- WordPress custom taxonomy check box to dropdown
- Selectively update themes in WordPress multisite
- How to Control CSS of Admin On Creating only a Specific Custom Post Type
- Template directory in plugin
- Getting a WordPress Debug Strategy
- unable to wp_enqueue_script(‘suggest’);
- Drawing the line between theme & plugin on large scale bespoke projects
- Apply styles to blockquote element with the WYSIWYG editor
- Conditional Generation of Image Sizes using add_image_size
- How to add plugin options in wp editor page
- WP Still Generating 150×150 Thumbnail Size Even After Un-Setting Small Size in Functions.php
- Does WordPress default CSS have Grids?
- How to resize WordPress images on upload to specific height and width without cropping it
- Create fixed static pages
- rewrite_rules problem
- Why does website stretch and white space on load? [duplicate]
- Why my theme’s css not working on another site
- Pass custom props to
- Include external po file for 3th party plugin to theme
- How to make premium plugin? I want to limit it until verification
- Google Web Core Vitals – management, how to in wordpress and advice
- How to add quick edit on the list of users to edit custom fields?
- Impossible to declare box-shadow with wp.customize?
- Override category archive page title (not the head title)
- 400 Bad Request and illegal invocation in wp_ajax based on processData set to false or true
- Rate limiting ajax requests in WordPress
- How to hide/remvoe unnecessary field/section in post edit section ( Dashboard )
- Scripts/styles not loading on cloned WP Site when logged in
- redirect_to how to make it simply work with get parameter or similar?
- Determine if the current page, is being edited
- Is it possible to modify an Elated plugin portfolio-list template in such a way that it will not conflict with future plugin updates?
- Woocommerce Custom Checkout
- Dynamic sidebar areas not working on the Theme Customizer
- Looping single post in a theme
- Merge Codes using redux framework
- WordPress permalink setting
- Custom theme and plugin updating
- Issue on Getting Images URL of the Post Gallery
- Best practice: What belongs in theme and what in plugin for large eCommerce website
- Adding class to the parent of current-post-ancestor / current-menu-parent / current-post-parent
- problem with blank page
- grouping my widgets wordpress
- Updating Style From WP Options Setting Page
- Create and style menu
- If I want to create new taxonomies (e.g. Project / Documents / Etc…) is it better to create them in the theme’s functions.php or within a plugin? [duplicate]
- How to add something after a function
- append code after the_content not working
- Problem with Poedit [closed]
- how many rupee or dollar charge to client to make theme [closed]
- how to catch a data from a array in WordPress
- How react js and other Javascript Technologies works on WordPress plugin?
- Is there any other ways to replicating changes on live from staging without pushing from git
- Fetch Custom Woocomerce filed data and check the data avialble in Wp-user table as nicname or username using function.php
- Remove Gutenberg Buttons Block