[wp-trac] [WordPress Trac] #55415: Pluggable.php file is causing Fatal Errors
WordPress Trac
noreply at wordpress.org
Thu Mar 17 18:46:14 UTC 2022
#55415: Pluggable.php file is causing Fatal Errors
-------------------------------+------------------------------
Reporter: ceceet | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Plugins | Version:
Severity: major | Resolution:
Keywords: reporter-feedback | Focuses:
-------------------------------+------------------------------
Changes (by costdev):
* keywords: => reporter-feedback
* component: Upgrade/Install => Plugins
Comment:
Hi @ceceet! Welcome to Trac and thanks for opening this ticket.
Some additional info:
- The UpdraftCentral plugin calls `wp_get_current_user()` in a `shutdown`
callback.
- See [https://plugins.trac.wordpress.org/browser/updraftcentral/trunk
/site-management.php#L484 here for the call] and
[https://plugins.trac.wordpress.org/browser/updraftcentral/trunk/site-
management.php#L136here for the hook].
- This has existed within the plugin for quite a long time.
-----
I created a small plugin to test calling `wp_get_current_user()` in a
`shutdown` callback:
{{{#!php
<?php
/**
* Plugin Name: #55415 - `wp_get_current_user()` in a `shutdown` callback.
* Description: Runs `wp_get_current_user()` in a `shutdown` callback.
* Author: WordPress Contributors
*/
add_action( 'shutdown', 'try_wp_get_current_user' );
function try_wp_get_current_user() {
wp_get_current_user();
}
}}}
There was no Fatal Error on PHP 7.4 or PHP 8.0.
-----
@ceceet if you have any additional information from the plugin developers
about how they determined that this is an issue within WordPress Core
rather than the plugin, that would be a big help in determining how best
to resolve this issue.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55415#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list