missing_direct_file_access_protection

Missing direct file access protection

A PHP file in the plugin can be loaded directly instead of through WordPress.

medium weight

Why It Shows Up

Plugin Check found a PHP file without an early guard such as an ABSPATH check. Without that guard, a browser or script can request the file by path.

Why It Matters

Direct access can run code outside the normal WordPress bootstrap, expose output, or trigger assumptions about loaded functions, permissions, and request context.

How to Fix

  • Add a guard near the top of PHP files that are not intended to be requested directly.
  • Use `if ( ! defined( 'ABSPATH' ) ) { exit; }` before the file performs work or sends output.
  • Keep template partials and bootstrap files protected too, not only the main plugin file.

Notes

  • Files that are deliberately public endpoints should route through WordPress APIs or explicitly validate the request before doing work.

Affected Plugins

RankPluginScoreErrorsWarningsInstallsAddedUpdatedTop Issue
#4051Mime Types Plus9811210k+Non-prefixed global variable
#4052Multi Device Switcher982920k+Non-prefixed function
#4053Multisite Language Switcher984214k+Dynamic hook name
#4054Native Lazyload98225k+Missing Version
#4055Nested Shortcodes by Outerbridge98401k+Missing direct file access protection
#4056News Ticker Widget for Elementor98224k+Non-prefixed constant
#4057oEmbed Plus98314k+Missing direct file access protection
#4058External Links in New Window / New Tab9821330k+Non-prefixed global variable
#4059OTF Regenerate Thumbnails98314k+Missing direct file access protection
#4060Paste as Plain Text98211k+Missing direct file access protection
#4061WebSub (FKA. PubSubHubbub)9854100k+Non-prefixed hook name
#4062Quicklink for WordPress98321k+trademarked term
#4063Re-Add Text Justify Button983020k+Missing direct file access protection
#4064Really Simple CAPTCHA9822300k+Non-prefixed constant
#4065Remove Author Pages98303k+Missing direct file access protection
#4066Responsive Image Maps98314k+Missing direct file access protection
#4067Restore Link Title Field98403k+Missing Arg Domain
#4068Safe SVG98741m+Missing Arg Domain
#4069Save with keyboard98223k+Missing direct file access protection
#4070Seed Buddhist Year98313k+Missing direct file access protection
#4071Shortcodes for Elementor98535k+Missing direct file access protection
#4072Shortcodes for Divi982310k+Discouraged text-domain loading
#4073Simple Admin Language Change984210k+Missing direct file access protection
#4074Tableberg – Simple Gutenberg Table Block98343k+date date
#4075Tag Pages983010k+Missing direct file access protection
#4076Toggles98302k+Missing direct file access protection
#4077Unplug Jetpack98401k+Missing direct file access protection
#4078Users Registration Date98302k+Missing direct file access protection
#4079WebFinger98381k+Non-prefixed function
#4080Which Template98411k+wp function not compatible with requires wp
#4081Align Woo Buttons98363k+Non-prefixed function
#4082Database Reset9814310k+Missing direct file access protection
#4083WP Display Header981537k+Text Domain Mismatch
#4084WP Document Revisions98772k+wp function not compatible with requires wp
#4085WP Edit Username981142k+Non-prefixed hook name
#4086WP Last Login982410k+trademarked term
#4087WP Links Page98233k+trademarked term
#4088WP Menu Image98242k+trademarked term
#4089Wp Post Views – WordPress Post views counter983104k+Non-prefixed class
#4090WP Remove Query Strings From Static Resources98253k+trademarked term
#4091WP Robots Txt982350k+trademarked term
#4092WP Scraper98242k+trademarked term
#4093WP Snow Effect98541k+Missing direct file access protection
#4094WPB Addons for Elementor – News Ticker, Timeline, Team & More Widgets981173k+Post Not In exclude
#4095Show IDs by DraftPress982310k+Missing direct file access protection
#4096Zenchef widget integration981801k+Missing direct file access protection
#4097Add From Server Reloaded99212k+Missing direct file access protection
#4098AntiVirus992130k+Missing direct file access protection
#4099Audio Album99214k+Discouraged text-domain loading
#4100Auto Hide Admin Bar99204k+Missing direct file access protection