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
#5251Interact: Embed A Quiz On Your Site786133k+Request data is not unslashed
#5252Login Widget for Ultimate Member781010600Input is not sanitized
#5253Maintenance Notice782671800Non-prefixed global variable
#5254More Mails for CF778136500Text Domain Mismatch
#5255Coming Soon & Maintenance Mode Page & Under Construction78356710k+Non-prefixed global variable
#5256One Time Login787840k+Nonce verification recommended
#5257PushCrew78100400Missing Arg Domain
#5258Recent Posts7872400Database parameter is not escaped
#5259Rename XMLRPC78731k+Output is not escaped
#5260Run SQL Query78138600Non-prefixed global variable
#5261Animator – Scroll Triggered Animations7816241k+Missing direct file access protection
#5262SearchWP Live Ajax Search7882350k+Non-prefixed global variable
#5263Sendy78112500Output is not escaped
#5264Sheet2Site78213400Output is not escaped
#5265Simple Maintenance781151k+Non-prefixed global variable
#5266Yandex Mail SMTP Server for WordPress781652k+Text Domain Mismatch
#5267Spider Blocker7819920k+Missing Translators Comment
#5268History Timeline for Biography, Company History & Event Timeline7829371k+Non-prefixed global variable
#5269Tock Widget7869400Missing direct file access protection
#5270Tuxedo Responsive Widget Columns78193400Output is not escaped
#5271Twenty20 Image Before-After781041420k+Text Domain Mismatch
#5272WEN Responsive Columns78136800Unsafe printing function
#5273Exclude Category from Blog781021k+Output is not escaped
#5274WooCommerce Square78626680k+Non-prefixed hook name
#5275Feed Post Thumbnail78932k+Unsafe printing function
#5276WP Simple Mail Sender782163k+Non Singular String Literal Domain
#5277WPC Smart Messages for WooCommerce781581k+Non-prefixed global variable
#5278AffiliateWP – Affiliate Info792771k+Text Domain Mismatch
#5279AffiliateWP – Force Pending Referrals793512500Text Domain Mismatch
#5280AffiliateWP – WooCommerce Redirect Affiliates792771k+Text Domain Mismatch
#5281Alx Extensions7911348k+Text Domain Mismatch
#5282Import / Export Customizer Settings7951350k+Input is not sanitized
#5283Better Font Awesome796970k+Input is not sanitized
#5284Blocks for Products791813400Non Singular String Literal Domain
#5285Bitly URL Shortener796522600Text Domain Mismatch
#5286Contact Form 7 Get and Show Parameter from URL79310800Input is not sanitized
#5287CoolClock – a Javascript Analog Clock792192k+Output is not escaped
#5288Disable Theme and Plugin Auto-Update Emails7921510k+Text Domain Mismatch
#5289Display Post Metadata79124500Output is not escaped
#5290Grabber for QQWorld Auto Save Images79173600Non Singular String Literal Domain
#5291JSON API Auth79511700Non-prefixed function
#5292Klaviyo792686100k+Non-prefixed function
#5293Last Name First Name7995500Non-prefixed function
#5294Manage Privacy Options Page793111k+Input is not validated
#5295Meks ThemeForest Smart Widget7912410k+Output is not escaped
#5296Weight/Country Shipping for WooCommerce79102900Unsafe printing function
#5297Popupsmart79282600Output is not escaped
#5298Qi Addons For Elementor7933339200k+Non-prefixed global variable
#5299Flutterwave Payments79839600Non-prefixed global variable
#5300Real Category Management: Content Management in Category Folders794732k+Non-prefixed constant