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
#6101Open Graph9574810k+wp function not compatible with requires wp
#6102PayHere Payment Gateway95682k+Non-prefixed class
#6103PDF Viewer Block for Gutenberg9539310k+badly named files
#6104Post Lockdown95531k+Missing direct file access protection
#6105Postname Permalink Auto Redirect9523600Missing direct file access protection
#6106Posts in Page95101210k+date date
#6107Preenche endereço CEP para Woocommerce95551k+Missing Version
#6108Quick remove menu item95733k+Missing Version
#6109Seriously Simple Speakers9519131k+Missing Translators Comment
#6110ShortBuild952641k+Missing direct file access protection
#6111Simple No Comments95781k+Direct Query
#6112Simple Pull Quote951821k+wp function not compatible with requires wp
#6113Smart Custom Fields9582850k+Dynamic hook name
#6114Spreaker Shortcode952334k+Text Domain Mismatch
#6115Supreme Maps9538152k+Text Domain Mismatch
#6116Table of Contents Plus95299200k+wp function not compatible with requires wp
#6117Timeline Module for Beaver Builder95217292k+Text Domain Mismatch
#6118TinyMCE Table9561700Missing direct file access protection
#6119Simla.com952258400Non-prefixed class
#6120WP API Yoast SEO9584400trademarked term
#6121WP Approve User9520113k+Text Domain Mismatch
#6122SNY Auto Featured Image954151k+Text Domain Mismatch
#6123WP Calameo951633k+wp function not compatible with requires wp
#6124WP HTTP Compression9556500trademarked term
#6125LiveChat – Live Chat Plugin for WP Websites9562910k+Text Domain Mismatch
#6126WPGlobus953839k+Non-prefixed global variable
#6127WPHindi – Type in Hindi in WordPress95791k+Not In Footer
#6128WP Telegram (Auto Post and Notifications)9581530k+Non-prefixed function
#6129WP Telegram Login & Register9511211k+Non-prefixed global variable
#6130WP Telegram Widget and Join Link9513184k+Missing direct file access protection
#6131Yoast Test Helper9524360k+Direct Query
#6132ACF to WP-API96115400wp function not compatible with requires wp
#6133WebberZone Snippetz – Header, Body and Footer manager961532k+Dynamic hook name
#6134Addonify – Compare Products For WooCommerce9616251k+Non-prefixed global variable
#6135Addonify – Quick View For WooCommerce9615211k+Non-prefixed global variable
#6136Directorist AddonsKit for Elementor9643310k+Non-prefixed global variable
#6137Admin Bar Position96536k+Missing Version
#6138Admin Notices Manager9670310k+Missing Arg Domain
#6139Admin Page Spider9610271k+Non-prefixed global variable
#6140Portfolio Grid – Filterable Gallery, Grid & Slider Showcase96350900Non-prefixed function
#6141AI Bud – AI Content Generator, AI Chatbot, ChatGPT, Gemini, GPT-4o965542k+Non-prefixed global variable
#6142Allow Numeric Slugs9652900Direct Query
#6143WP Offload Media Lite for Amazon S3, DigitalOcean Spaces, and Google Cloud Storage9681230k+Missing direct file access protection
#6144Amelia Calendar Essential Shortcodes9629500Not In Footer
#6145Astra Hooks969020k+Missing direct file access protection
#6146Auto Delete Applications – Add-on for WP Job Openings9619141k+Text Domain Mismatch
#6147AutoCEP96781k+error log error log
#6148Bit SMTP – Easy SMTP Solution with Email Logs966132k+Missing Version
#6149Blank9660900Missing direct file access protection
#6150Blank Slate968310k+Missing direct file access protection