From efc4882f77671d059d46117d4a5f8fd08a398c2d Mon Sep 17 00:00:00 2001 From: Deepak rohilla Date: Wed, 15 May 2024 12:13:33 +0530 Subject: [PATCH 1/9] 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 2/9] 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 3/9] 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 4/9] 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 5/9] 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 e84371ad3b97a51d24712342a50af2426576e84a Mon Sep 17 00:00:00 2001 From: Deepak rohilla Date: Tue, 4 Jun 2024 11:03:13 +0530 Subject: [PATCH 6/9] Added New Hook for Paginated link Added New Hook for Paginated link --- src/wp-includes/general-template.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index 1c795b06ca1cf..c96cd05fb34f5 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -4624,7 +4624,11 @@ function paginate_links( $args = '' ) { switch ( $args['type'] ) { case 'array': - return $page_links; + ** + * Fitler The Page Link Array. + * @param array page_link_array. + */ + return apply_filter( 'filter_page_links_array', $page_links ); case 'list': $r .= "
    \n\t
  • "; From b433bde80c2a2e9f822bea020342a4023e55ee13 Mon Sep 17 00:00:00 2001 From: Deepak rohilla Date: Tue, 4 Jun 2024 11:05:00 +0530 Subject: [PATCH 7/9] 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 63037f29039cc374b3f5ccf0224b60ba1d2ad0e3 Mon Sep 17 00:00:00 2001 From: Deepak rohilla Date: Tue, 4 Jun 2024 11:06:07 +0530 Subject: [PATCH 8/9] Update general-template.php --- src/wp-includes/general-template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index c96cd05fb34f5..9856789609110 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -4625,7 +4625,7 @@ function paginate_links( $args = '' ) { switch ( $args['type'] ) { case 'array': ** - * Fitler The Page Link Array. + * Filter The Page Link Array. * @param array page_link_array. */ return apply_filter( 'filter_page_links_array', $page_links ); From 0d4ea2fca0ff093206529a03357cd7c5012d634f Mon Sep 17 00:00:00 2001 From: Deepak rohilla Date: Tue, 4 Jun 2024 18:57:24 +0530 Subject: [PATCH 9/9] Update general-template.php --- src/wp-includes/general-template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index 9856789609110..2614cdd3e99d1 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -4624,7 +4624,7 @@ function paginate_links( $args = '' ) { switch ( $args['type'] ) { case 'array': - ** + /** * Filter The Page Link Array. * @param array page_link_array. */