From efc4882f77671d059d46117d4a5f8fd08a398c2d Mon Sep 17 00:00:00 2001 From: Deepak rohilla Date: Wed, 15 May 2024 12:13:33 +0530 Subject: [PATCH 01/13] Fix Uncaught exception Error with message 'Call to undefined function add_action() `error.message` LIKE 'Uncaught exception 'Error' with message 'Call to undefined function add_action()' in /var/www/wp-content/plugins/hello.php:69%' AND `error.class` = 'Error' AND transactionUiName = '/wp-content/plugins/hello.php' 'request_uri': '/wp-content/plugins/hello.php' --- src/wp-content/plugins/hello.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-content/plugins/hello.php b/src/wp-content/plugins/hello.php index ff55908342290..dc870feed7cf6 100644 --- a/src/wp-content/plugins/hello.php +++ b/src/wp-content/plugins/hello.php @@ -11,7 +11,7 @@ Version: 1.7.2 Author URI: http://ma.tt/ */ - +if ( ! defined( 'ABSPATH' ) ) exit; function hello_dolly_get_lyric() { /** These are the lyrics to Hello Dolly */ $lyrics = "Hello, Dolly From 9c32016be12352ace93225991c3d2a41b5e23302 Mon Sep 17 00:00:00 2001 From: Deepak rohilla Date: Thu, 16 May 2024 18:05:15 +0530 Subject: [PATCH 02/13] Fix Hello Dolly : Uncaught exception 'Error' with message ' suggested changes Trac ticket: https://core.trac.wordpress.org/ticket/61214 --- src/wp-content/plugins/hello.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wp-content/plugins/hello.php b/src/wp-content/plugins/hello.php index dc870feed7cf6..45a08de2cedcd 100644 --- a/src/wp-content/plugins/hello.php +++ b/src/wp-content/plugins/hello.php @@ -11,7 +11,9 @@ Version: 1.7.2 Author URI: http://ma.tt/ */ -if ( ! defined( 'ABSPATH' ) ) exit; +if ( ! defined( 'ABSPATH' ) ) { + exit; +} function hello_dolly_get_lyric() { /** These are the lyrics to Hello Dolly */ $lyrics = "Hello, Dolly From b542011b6fae94df3b909f9c7f7caed968ff2479 Mon Sep 17 00:00:00 2001 From: Deepak rohilla Date: Thu, 23 May 2024 11:52:18 +0530 Subject: [PATCH 03/13] PHP message: PHP Fatal error: Uncaught Error: Undefined constant "ABSPATH direct access to wp-includes/rss.php on line 19 https://core.trac.wordpress.org/ticket/61277 --- src/wp-includes/rss.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/rss.php b/src/wp-includes/rss.php index 4d3f35e5cb547..3b1c925154894 100644 --- a/src/wp-includes/rss.php +++ b/src/wp-includes/rss.php @@ -12,7 +12,9 @@ * @subpackage MagpieRSS * @deprecated 3.0.0 Use SimplePie instead. */ - +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly +} /** * Deprecated. Use SimplePie (class-simplepie.php) instead. */ From e9bfe06d1645388d148382f0c445165c3a39f622 Mon Sep 17 00:00:00 2001 From: Deepak rohilla Date: Thu, 23 May 2024 12:09:46 +0530 Subject: [PATCH 04/13] remove changes --- src/wp-includes/rss.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/wp-includes/rss.php b/src/wp-includes/rss.php index 3b1c925154894..4d3f35e5cb547 100644 --- a/src/wp-includes/rss.php +++ b/src/wp-includes/rss.php @@ -12,9 +12,7 @@ * @subpackage MagpieRSS * @deprecated 3.0.0 Use SimplePie instead. */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly -} + /** * Deprecated. Use SimplePie (class-simplepie.php) instead. */ From 0bb77bc67fd98daf756b66e9dc2fd0ebda1252f6 Mon Sep 17 00:00:00 2001 From: Deepak rohilla Date: Mon, 27 May 2024 15:29:53 +0530 Subject: [PATCH 05/13] Update hello.php --- src/wp-content/plugins/hello.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wp-content/plugins/hello.php b/src/wp-content/plugins/hello.php index 45a08de2cedcd..84b8c9bfceac9 100644 --- a/src/wp-content/plugins/hello.php +++ b/src/wp-content/plugins/hello.php @@ -11,9 +11,12 @@ Version: 1.7.2 Author URI: http://ma.tt/ */ + +// Don't load directly. if ( ! defined( 'ABSPATH' ) ) { - exit; + die( '-1' ); } + function hello_dolly_get_lyric() { /** These are the lyrics to Hello Dolly */ $lyrics = "Hello, Dolly From 5bc55f37daebeaaa9fffa9702d6fbcbed95d4b39 Mon Sep 17 00:00:00 2001 From: deepakrohillas Date: Wed, 29 May 2024 09:15:23 +0530 Subject: [PATCH 06/13] uncaught_exception_error_in_wp-includes --- src/wp-includes/class-IXR.php | 5 +++++ src/wp-includes/class-wp-customize-control.php | 5 +++++ src/wp-includes/class-wp-customize-panel.php | 5 +++++ src/wp-includes/class-wp-customize-setting.php | 7 ++++++- src/wp-includes/class-wp-http.php | 5 +++++ src/wp-includes/class-wp-simplepie-sanitize-kses.php | 5 +++++ src/wp-includes/class-wp-text-diff-renderer-table.php | 5 +++++ src/wp-includes/default-filters.php | 5 +++++ src/wp-includes/default-widgets.php | 5 +++++ src/wp-includes/feed-atom.php | 5 +++++ src/wp-includes/functions.php | 5 +++++ src/wp-includes/media.php | 5 +++++ src/wp-includes/ms-blogs.php | 5 +++++ src/wp-includes/ms-settings.php | 7 ++++++- src/wp-includes/nav-menu-template.php | 5 +++++ src/wp-includes/update.php | 6 ++++++ src/wp-includes/vars.php | 5 +++++ src/wp-includes/wp-diff.php | 5 +++++ 18 files changed, 93 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/class-IXR.php b/src/wp-includes/class-IXR.php index 0cd72df20e895..35657c7c7378f 100644 --- a/src/wp-includes/class-IXR.php +++ b/src/wp-includes/class-IXR.php @@ -39,6 +39,11 @@ * @license http://www.opensource.org/licenses/bsd-license.php BSD */ +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} + require_once ABSPATH . WPINC . '/IXR/class-IXR-server.php'; require_once ABSPATH . WPINC . '/IXR/class-IXR-base64.php'; diff --git a/src/wp-includes/class-wp-customize-control.php b/src/wp-includes/class-wp-customize-control.php index 596c6e3723c8e..1108c94106d6f 100644 --- a/src/wp-includes/class-wp-customize-control.php +++ b/src/wp-includes/class-wp-customize-control.php @@ -7,6 +7,11 @@ * @since 3.4.0 */ +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} + /** * Customize Control class. * diff --git a/src/wp-includes/class-wp-customize-panel.php b/src/wp-includes/class-wp-customize-panel.php index 95b7aed468814..3c48767fc4499 100644 --- a/src/wp-includes/class-wp-customize-panel.php +++ b/src/wp-includes/class-wp-customize-panel.php @@ -6,6 +6,11 @@ * @subpackage Customize * @since 4.0.0 */ + +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} /** * Customize Panel class. diff --git a/src/wp-includes/class-wp-customize-setting.php b/src/wp-includes/class-wp-customize-setting.php index 99d0d2e51f199..a35cbdf3bf90c 100644 --- a/src/wp-includes/class-wp-customize-setting.php +++ b/src/wp-includes/class-wp-customize-setting.php @@ -6,7 +6,12 @@ * @subpackage Customize * @since 3.4.0 */ - + +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} + /** * Customize Setting class. * diff --git a/src/wp-includes/class-wp-http.php b/src/wp-includes/class-wp-http.php index ea8adde0ba7c7..9e912858a0efc 100644 --- a/src/wp-includes/class-wp-http.php +++ b/src/wp-includes/class-wp-http.php @@ -7,6 +7,11 @@ * @since 2.7.0 */ +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} + if ( ! class_exists( 'WpOrg\Requests\Autoload' ) ) { require ABSPATH . WPINC . '/Requests/src/Autoload.php'; diff --git a/src/wp-includes/class-wp-simplepie-sanitize-kses.php b/src/wp-includes/class-wp-simplepie-sanitize-kses.php index c300cf2280762..c644b1748fcb5 100644 --- a/src/wp-includes/class-wp-simplepie-sanitize-kses.php +++ b/src/wp-includes/class-wp-simplepie-sanitize-kses.php @@ -7,6 +7,11 @@ * @since 4.7.0 */ +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} + /** * Core class used to implement SimplePie feed sanitization. * diff --git a/src/wp-includes/class-wp-text-diff-renderer-table.php b/src/wp-includes/class-wp-text-diff-renderer-table.php index 4fa3d414d2401..dd29da2c3d837 100644 --- a/src/wp-includes/class-wp-text-diff-renderer-table.php +++ b/src/wp-includes/class-wp-text-diff-renderer-table.php @@ -6,6 +6,11 @@ * @subpackage Diff * @since 4.7.0 */ + +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} /** * Table renderer to display the diff lines. diff --git a/src/wp-includes/default-filters.php b/src/wp-includes/default-filters.php index 1bcd85e79aaf5..cfe5a6bd5fc6f 100644 --- a/src/wp-includes/default-filters.php +++ b/src/wp-includes/default-filters.php @@ -17,6 +17,11 @@ * @package WordPress */ +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} + // Strip, trim, kses, special chars for string saves. foreach ( array( 'pre_term_name', 'pre_comment_author_name', 'pre_link_name', 'pre_link_target', 'pre_link_rel', 'pre_user_display_name', 'pre_user_first_name', 'pre_user_last_name', 'pre_user_nickname' ) as $filter ) { add_filter( $filter, 'sanitize_text_field' ); diff --git a/src/wp-includes/default-widgets.php b/src/wp-includes/default-widgets.php index f8f3c4d141535..cbb25de8f0a4e 100644 --- a/src/wp-includes/default-widgets.php +++ b/src/wp-includes/default-widgets.php @@ -7,6 +7,11 @@ * @since 2.8.0 */ +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} + /** WP_Widget_Pages class */ require_once ABSPATH . WPINC . '/widgets/class-wp-widget-pages.php'; diff --git a/src/wp-includes/feed-atom.php b/src/wp-includes/feed-atom.php index e9e3f49528065..8f5f0bc038f5d 100644 --- a/src/wp-includes/feed-atom.php +++ b/src/wp-includes/feed-atom.php @@ -4,6 +4,11 @@ * * @package WordPress */ + +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} header( 'Content-Type: ' . feed_content_type( 'atom' ) . '; charset=' . get_option( 'blog_charset' ), true ); $more = 1; diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 6e6f085d3454f..b2661962cefc0 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -5,6 +5,11 @@ * @package WordPress */ +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} + require ABSPATH . WPINC . '/option.php'; /** diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php index 0a8621d209815..9e9d845da4720 100644 --- a/src/wp-includes/media.php +++ b/src/wp-includes/media.php @@ -5,6 +5,11 @@ * @package WordPress * @subpackage Media */ + +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} /** * Retrieves additional image sizes. diff --git a/src/wp-includes/ms-blogs.php b/src/wp-includes/ms-blogs.php index 2cf6d2390aab7..ae642282d097c 100644 --- a/src/wp-includes/ms-blogs.php +++ b/src/wp-includes/ms-blogs.php @@ -8,6 +8,11 @@ * @since MU (3.0.0) */ +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} + require_once ABSPATH . WPINC . '/ms-site.php'; require_once ABSPATH . WPINC . '/ms-network.php'; diff --git a/src/wp-includes/ms-settings.php b/src/wp-includes/ms-settings.php index 27dc1337f5fd0..7758e84a9d95a 100644 --- a/src/wp-includes/ms-settings.php +++ b/src/wp-includes/ms-settings.php @@ -9,7 +9,12 @@ * @subpackage Multisite * @since 3.0.0 */ - + +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} + /** * Objects representing the current network and current site. * diff --git a/src/wp-includes/nav-menu-template.php b/src/wp-includes/nav-menu-template.php index 860efa92d3377..d90fdfa8061ab 100644 --- a/src/wp-includes/nav-menu-template.php +++ b/src/wp-includes/nav-menu-template.php @@ -7,6 +7,11 @@ * @since 3.0.0 */ +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} + /** Walker_Nav_Menu class */ require_once ABSPATH . WPINC . '/class-walker-nav-menu.php'; diff --git a/src/wp-includes/update.php b/src/wp-includes/update.php index e2ac6b8b54dbc..2b748404a4652 100644 --- a/src/wp-includes/update.php +++ b/src/wp-includes/update.php @@ -24,6 +24,12 @@ * @param bool $force_check Whether to bypass the transient cache and force a fresh update check. * Defaults to false, true if $extra_stats is set. */ + +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} + function wp_version_check( $extra_stats = array(), $force_check = false ) { global $wpdb, $wp_local_package; diff --git a/src/wp-includes/vars.php b/src/wp-includes/vars.php index b719b48d2e87f..22496330c33ff 100644 --- a/src/wp-includes/vars.php +++ b/src/wp-includes/vars.php @@ -15,6 +15,11 @@ * @package WordPress */ +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} + global $pagenow, $is_lynx, $is_gecko, $is_winIE, $is_macIE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone, $is_IE, $is_edge, $is_apache, $is_IIS, $is_iis7, $is_nginx, $is_caddy; diff --git a/src/wp-includes/wp-diff.php b/src/wp-includes/wp-diff.php index 235b04b4bed08..24b0bb41a44a5 100644 --- a/src/wp-includes/wp-diff.php +++ b/src/wp-includes/wp-diff.php @@ -8,6 +8,11 @@ * @subpackage Diff */ +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} + if ( ! class_exists( 'Text_Diff', false ) ) { /** Text_Diff class */ require ABSPATH . WPINC . '/Text/Diff.php'; From d78ebddf91e60d5488d21d2cd5a72e10f9e527ae Mon Sep 17 00:00:00 2001 From: Deepak rohilla Date: Wed, 29 May 2024 12:36:01 +0530 Subject: [PATCH 07/13] Update hello.php --- src/wp-content/plugins/hello.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/wp-content/plugins/hello.php b/src/wp-content/plugins/hello.php index 84b8c9bfceac9..ff55908342290 100644 --- a/src/wp-content/plugins/hello.php +++ b/src/wp-content/plugins/hello.php @@ -12,11 +12,6 @@ Author URI: http://ma.tt/ */ -// Don't load directly. -if ( ! defined( 'ABSPATH' ) ) { - die( '-1' ); -} - function hello_dolly_get_lyric() { /** These are the lyrics to Hello Dolly */ $lyrics = "Hello, Dolly From 831381d37a66113e807b6383fecdbe485a8a9424 Mon Sep 17 00:00:00 2001 From: deepakrohillas Date: Thu, 30 May 2024 23:05:01 +0530 Subject: [PATCH 08/13] 55944 issue fix --- src/wp-admin/menu-header.php | 5 +++++ src/wp-admin/menu.php | 5 +++++ src/wp-admin/network/menu.php | 5 +++++ src/wp-admin/user/menu.php | 5 +++++ src/wp-includes/class-wp-customize-setting.php | 2 +- 5 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/menu-header.php b/src/wp-admin/menu-header.php index 9b38e6f77d9d0..caf7d8f4877f4 100644 --- a/src/wp-admin/menu-header.php +++ b/src/wp-admin/menu-header.php @@ -6,6 +6,11 @@ * @subpackage Administration */ +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} + /** * The current page. * diff --git a/src/wp-admin/menu.php b/src/wp-admin/menu.php index 8076479220bec..18ec4f1dde599 100644 --- a/src/wp-admin/menu.php +++ b/src/wp-admin/menu.php @@ -6,6 +6,11 @@ * @subpackage Administration */ +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} + /** * Constructs the admin menu. * diff --git a/src/wp-admin/network/menu.php b/src/wp-admin/network/menu.php index 73cc86b23484d..852c36004cbab 100644 --- a/src/wp-admin/network/menu.php +++ b/src/wp-admin/network/menu.php @@ -7,6 +7,11 @@ * @since 3.1.0 */ +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} + /* translators: Network menu item. */ $menu[2] = array( __( 'Dashboard' ), 'manage_network', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' ); diff --git a/src/wp-admin/user/menu.php b/src/wp-admin/user/menu.php index 23e81a892c273..587d0ec1762dc 100644 --- a/src/wp-admin/user/menu.php +++ b/src/wp-admin/user/menu.php @@ -7,6 +7,11 @@ * @since 3.1.0 */ +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} + $menu[2] = array( __( 'Dashboard' ), 'exist', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' ); $menu[4] = array( '', 'exist', 'separator1', '', 'wp-menu-separator' ); diff --git a/src/wp-includes/class-wp-customize-setting.php b/src/wp-includes/class-wp-customize-setting.php index a35cbdf3bf90c..bdfac13db9d93 100644 --- a/src/wp-includes/class-wp-customize-setting.php +++ b/src/wp-includes/class-wp-customize-setting.php @@ -11,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } - + /** * Customize Setting class. * From 4426cc8ed97bc176672076d65c89068a953d03b6 Mon Sep 17 00:00:00 2001 From: deepakrohillas Date: Thu, 27 Jun 2024 01:12:19 +0530 Subject: [PATCH 09/13] few more file checked and found same issue --- src/wp-admin/admin-functions.php | 5 +++++ src/wp-admin/admin-header.php | 5 +++++ src/wp-admin/custom-background.php | 5 +++++ src/wp-admin/custom-header.php | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/src/wp-admin/admin-functions.php b/src/wp-admin/admin-functions.php index a9ff3f44b99f7..70643e0334d55 100644 --- a/src/wp-admin/admin-functions.php +++ b/src/wp-admin/admin-functions.php @@ -8,6 +8,11 @@ * @package WordPress * @subpackage Administration */ + +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} _deprecated_file( basename( __FILE__ ), '2.5.0', 'wp-admin/includes/admin.php' ); diff --git a/src/wp-admin/admin-header.php b/src/wp-admin/admin-header.php index fc836c20a2c1d..9e798de5580db 100644 --- a/src/wp-admin/admin-header.php +++ b/src/wp-admin/admin-header.php @@ -5,6 +5,11 @@ * @package WordPress * @subpackage Administration */ + +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) ); if ( ! defined( 'WP_ADMIN' ) ) { diff --git a/src/wp-admin/custom-background.php b/src/wp-admin/custom-background.php index 37b8c3d8b8403..185ba466fdf3f 100644 --- a/src/wp-admin/custom-background.php +++ b/src/wp-admin/custom-background.php @@ -8,6 +8,11 @@ * @package WordPress * @subpackage Administration */ + +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} _deprecated_file( basename( __FILE__ ), '5.3.0', 'wp-admin/includes/class-custom-background.php' ); diff --git a/src/wp-admin/custom-header.php b/src/wp-admin/custom-header.php index d89f03bbaab2a..19e34fe48ead2 100644 --- a/src/wp-admin/custom-header.php +++ b/src/wp-admin/custom-header.php @@ -8,6 +8,11 @@ * @package WordPress * @subpackage Administration */ + +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} _deprecated_file( basename( __FILE__ ), '5.3.0', 'wp-admin/includes/class-custom-image-header.php' ); From b40d3f384e60a0d3d1f4571b5c2237b50085431d Mon Sep 17 00:00:00 2001 From: deepakrohillas Date: Thu, 27 Jun 2024 01:13:59 +0530 Subject: [PATCH 10/13] few more file checked and found same issue --- src/wp-admin/admin-functions.php | 2 +- src/wp-admin/admin-header.php | 2 +- src/wp-admin/custom-background.php | 2 +- src/wp-admin/custom-header.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wp-admin/admin-functions.php b/src/wp-admin/admin-functions.php index 70643e0334d55..6ce4e06c47007 100644 --- a/src/wp-admin/admin-functions.php +++ b/src/wp-admin/admin-functions.php @@ -8,7 +8,7 @@ * @package WordPress * @subpackage Administration */ - + // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); diff --git a/src/wp-admin/admin-header.php b/src/wp-admin/admin-header.php index 9e798de5580db..f86a0fadde085 100644 --- a/src/wp-admin/admin-header.php +++ b/src/wp-admin/admin-header.php @@ -5,7 +5,7 @@ * @package WordPress * @subpackage Administration */ - + // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); diff --git a/src/wp-admin/custom-background.php b/src/wp-admin/custom-background.php index 185ba466fdf3f..bbd56bdb6cee2 100644 --- a/src/wp-admin/custom-background.php +++ b/src/wp-admin/custom-background.php @@ -8,7 +8,7 @@ * @package WordPress * @subpackage Administration */ - + // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); diff --git a/src/wp-admin/custom-header.php b/src/wp-admin/custom-header.php index 19e34fe48ead2..31c78dcb5b372 100644 --- a/src/wp-admin/custom-header.php +++ b/src/wp-admin/custom-header.php @@ -8,7 +8,7 @@ * @package WordPress * @subpackage Administration */ - + // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); From 7ba1016183ae7cdfe94dfe6211b7f8d5c88e040f Mon Sep 17 00:00:00 2001 From: deepakrohillas Date: Thu, 27 Jun 2024 01:23:11 +0530 Subject: [PATCH 11/13] PHP CS fixes --- src/wp-includes/media.php | 1 - src/wp-includes/ms-settings.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php index 9e9d845da4720..abedc2d391fde 100644 --- a/src/wp-includes/media.php +++ b/src/wp-includes/media.php @@ -10,7 +10,6 @@ if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } - /** * Retrieves additional image sizes. * diff --git a/src/wp-includes/ms-settings.php b/src/wp-includes/ms-settings.php index 7758e84a9d95a..f569ac9697082 100644 --- a/src/wp-includes/ms-settings.php +++ b/src/wp-includes/ms-settings.php @@ -14,7 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } - + /** * Objects representing the current network and current site. * From 7acd8c66ea2139f92dc1119ada0a9e3d71a0be0b Mon Sep 17 00:00:00 2001 From: deepakrohillas Date: Thu, 27 Jun 2024 02:14:15 +0530 Subject: [PATCH 12/13] PHP CS fixes --- src/wp-includes/class-wp-customize-panel.php | 2 +- src/wp-includes/class-wp-customize-setting.php | 2 +- src/wp-includes/class-wp-text-diff-renderer-table.php | 2 +- src/wp-includes/feed-atom.php | 2 +- src/wp-includes/media.php | 2 +- src/wp-includes/ms-settings.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wp-includes/class-wp-customize-panel.php b/src/wp-includes/class-wp-customize-panel.php index 3c48767fc4499..d1dc386d31b98 100644 --- a/src/wp-includes/class-wp-customize-panel.php +++ b/src/wp-includes/class-wp-customize-panel.php @@ -6,7 +6,7 @@ * @subpackage Customize * @since 4.0.0 */ - + // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); diff --git a/src/wp-includes/class-wp-customize-setting.php b/src/wp-includes/class-wp-customize-setting.php index bdfac13db9d93..95f6b26972682 100644 --- a/src/wp-includes/class-wp-customize-setting.php +++ b/src/wp-includes/class-wp-customize-setting.php @@ -6,7 +6,7 @@ * @subpackage Customize * @since 3.4.0 */ - + // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); diff --git a/src/wp-includes/class-wp-text-diff-renderer-table.php b/src/wp-includes/class-wp-text-diff-renderer-table.php index dd29da2c3d837..25272265e261b 100644 --- a/src/wp-includes/class-wp-text-diff-renderer-table.php +++ b/src/wp-includes/class-wp-text-diff-renderer-table.php @@ -6,7 +6,7 @@ * @subpackage Diff * @since 4.7.0 */ - + // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); diff --git a/src/wp-includes/feed-atom.php b/src/wp-includes/feed-atom.php index 8f5f0bc038f5d..9ee70f895a4c9 100644 --- a/src/wp-includes/feed-atom.php +++ b/src/wp-includes/feed-atom.php @@ -4,7 +4,7 @@ * * @package WordPress */ - + // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php index abedc2d391fde..e3474bbeb4ccf 100644 --- a/src/wp-includes/media.php +++ b/src/wp-includes/media.php @@ -5,7 +5,7 @@ * @package WordPress * @subpackage Media */ - + // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); diff --git a/src/wp-includes/ms-settings.php b/src/wp-includes/ms-settings.php index f569ac9697082..c665da17e3aeb 100644 --- a/src/wp-includes/ms-settings.php +++ b/src/wp-includes/ms-settings.php @@ -9,7 +9,7 @@ * @subpackage Multisite * @since 3.0.0 */ - + // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); From 8e7772cd0bb4e6e7442123035692ed6f72d9f5e0 Mon Sep 17 00:00:00 2001 From: deepakrohillas Date: Fri, 19 Jul 2024 23:41:18 +0530 Subject: [PATCH 13/13] Fatal error: Uncaught Error: Call to undefined function settings_errors() --- src/wp-admin/options-head.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wp-admin/options-head.php b/src/wp-admin/options-head.php index 9dba3703c5ad7..ce5e1a26cb7c6 100644 --- a/src/wp-admin/options-head.php +++ b/src/wp-admin/options-head.php @@ -8,6 +8,11 @@ * @subpackage Administration */ +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die(); +} + $action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : ''; if ( isset( $_GET['updated'] ) && isset( $_GET['page'] ) ) {