Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check to avoid fatals on direct file access #584

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions mu-plugins/admin/index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php
namespace WordPressdotorg\MU_Plugins\Admin;

defined( 'WPINC' ) || die();

// Delay loading until admin_init.
add_action( 'admin_init', function() {
require_once __DIR__ . '/user-list-last-logged-in.php';
Expand Down
2 changes: 2 additions & 0 deletions mu-plugins/blocks/google-map/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace WordPressdotorg\MU_Plugins\Google_Map;

defined( 'WPINC' ) || die();

require_once __DIR__ . '/inc/event-filters.php';

add_action( 'init', __NAMESPACE__ . '\init' );
Expand Down
2 changes: 2 additions & 0 deletions mu-plugins/blocks/link-wrapper/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

use function WordPressdotorg\MU_Plugins\Helpers\register_assets_from_metadata;

defined( 'WPINC' ) || die();

add_action( 'init', __NAMESPACE__ . '\init' );

/**
Expand Down
2 changes: 2 additions & 0 deletions mu-plugins/blocks/local-navigation-bar/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

namespace WordPressdotorg\MU_Plugins\LocalNavigationBar_Block;

defined( 'WPINC' ) || die();

add_action( 'init', __NAMESPACE__ . '\init' );
add_filter( 'render_block_data', __NAMESPACE__ . '\update_block_attributes' );
add_filter( 'render_block_data', __NAMESPACE__ . '\update_child_block_attributes', 10, 3 );
Expand Down
2 changes: 2 additions & 0 deletions mu-plugins/blocks/notice/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

namespace WordPressdotorg\MU_Plugins\Notice;

defined( 'WPINC' ) || die();

// Run after `WPorg_Handbook_Callout_Boxes` registers the shortcodes.
add_action( 'init', __NAMESPACE__ . '\init', 11 );

Expand Down
2 changes: 2 additions & 0 deletions mu-plugins/blocks/query-filter/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

namespace WordPressdotorg\MU_Plugins\Filters_Block;

defined( 'WPINC' ) || die();

add_action( 'init', __NAMESPACE__ . '\init' );

/**
Expand Down
2 changes: 2 additions & 0 deletions mu-plugins/blocks/query-total/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

use WP_Query;

defined( 'WPINC' ) || die();

add_action( 'init', __NAMESPACE__ . '\init' );
add_filter( 'render_block_data', __NAMESPACE__ . '\update_block_attributes' );

Expand Down
2 changes: 2 additions & 0 deletions mu-plugins/blocks/sidebar-container/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

use function WordPressdotorg\MU_Plugins\Helpers\register_assets_from_metadata;

defined( 'WPINC' ) || die();

add_action( 'init', __NAMESPACE__ . '\init' );

/**
Expand Down
2 changes: 2 additions & 0 deletions mu-plugins/blocks/site-breadcrumbs/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

namespace WordPressdotorg\MU_Plugins\Site_Breadcrumbs;

defined( 'WPINC' ) || die();

add_action( 'init', __NAMESPACE__ . '\init' );

/**
Expand Down
2 changes: 2 additions & 0 deletions mu-plugins/blocks/table-of-contents/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

namespace WordPressdotorg\MU_Plugins\Dynamic_ToC_Block;

defined( 'WPINC' ) || die();

add_action( 'init', __NAMESPACE__ . '\init' );

/**
Expand Down
2 changes: 2 additions & 0 deletions mu-plugins/blocks/time/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

namespace WordPressdotorg\MU_Plugins\Time;

defined( 'WPINC' ) || die();

add_action( 'init', __NAMESPACE__ . '\init' );

/**
Expand Down
2 changes: 2 additions & 0 deletions mu-plugins/db-user-sessions/index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php
namespace WordPressdotorg\MU_Plugins\DB_User_Sessions;

defined( 'WPINC' ) || die();

add_filter( 'session_token_manager', function( $manager ) {
if ( in_array( wp_get_environment_type(), [ 'production', 'staging' ], true ) ) {
$manager = __NAMESPACE__ . '\Tokens';
Expand Down
2 changes: 2 additions & 0 deletions mu-plugins/encryption/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
*/
require __DIR__ . '/exports.php';

defined( 'WPINC' ) || die();

/**
* Prefix for encrypted secrets. Contains a version identifier.
*
Expand Down
2 changes: 2 additions & 0 deletions mu-plugins/global-fonts/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
// Include helper functions that exist in global-scope.
include __DIR__ . '/helper-functions.php';

defined( 'WPINC' ) || die();

add_filter( 'init', __NAMESPACE__ . '\register_style', 1 );
add_filter( 'block_editor_settings_all', __NAMESPACE__ . '\relative_to_absolute_urls' );
add_filter( 'wp_preload_resources', __NAMESPACE__ . '\maybe_preload_font' );
Expand Down
2 changes: 2 additions & 0 deletions mu-plugins/rest-api/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace WordPressdotorg\MU_Plugins\REST_API;

defined( 'WPINC' ) || die();

/**
* Actions and filters.
*/
Expand Down
Loading