[wp-trac] [WordPress Trac] #56606: PHP Warning in /wp-includes/blocks/index.php
WordPress Trac
noreply at wordpress.org
Fri Aug 22 22:04:58 UTC 2025
#56606: PHP Warning in /wp-includes/blocks/index.php
-------------------------+-----------------------
Reporter: isrgrajan | Owner: (none)
Type: enhancement | Status: reopened
Priority: normal | Milestone:
Component: General | Version: trunk
Severity: normal | Resolution:
Keywords: | Focuses:
-------------------------+-----------------------
Changes (by jerclarke):
* status: closed => reopened
* version: => trunk
* resolution: invalid =>
Comment:
This is happening on our server as well, very annoying to see these in the
logs.
Why not fix it by exiting if the constants aren't defined?
This support ticket documents the issue very well:
https://wordpress.org/support/topic/is-it-safe-to-block-direct-access-to-
wp-includes-blocks-index-php-causes-fatal/
It seems that `/wp-admin/edit-link-form.php` solves this exact same issue
with the following code:
{{{
// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
}}}
**Why not apply this same solution to `/wp-includes/blocks/index.php`?**
Seems like a harmless solution and worth doing, considering there are
clearly bots out there annoying many admins, and the URL is useless
without those constants.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56606#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list