WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#16143 closed defect (bug) (fixed)

PHP notices when deleting plugins and themes via FTP

Reported by: ryan Owned by: nacin
Milestone: 3.3 Priority: normal
Severity: normal Version: 3.0.4
Component: Warnings/Notices Keywords: has-patch
Focuses: Cc:

Description

During plugin and theme delete over FTP, the Connection Information page output many notices.

[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined variable: title in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/admin-header.php on line 14, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined variable: hook_suffix in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/admin-header.php on line 33, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined variable: current_screen in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/admin-header.php on line 44, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Trying to get property of non-object in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/admin-header.php on line 44, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined variable: wp_locale in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/admin-header.php on line 47, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Trying to get property of non-object in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/admin-header.php on line 47, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined variable: wp_locale in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/admin-header.php on line 48, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Trying to get property of non-object in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/admin-header.php on line 48, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined variable: pagenow in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/admin-header.php on line 54, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined variable: hook_suffix in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/admin-header.php on line 59, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined variable: hook_suffix in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/admin-header.php on line 60, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined variable: hook_suffix in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/admin-header.php on line 62, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined variable: hook_suffix in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/admin-header.php on line 64, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined variable: is_iphone in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/admin-header.php on line 70, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined variable: user_identity in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/admin-header.php on line 125, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined variable: current_screen in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/admin-header.php on line 135, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Trying to get property of non-object in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/includes/template.php on line 3329, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined property: stdClass::$id in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/includes/template.php on line 684, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined property: stdClass::$base in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/includes/template.php on line 687, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined property: stdClass::$id in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/includes/template.php on line 758, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined property: stdClass::$id in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/includes/template.php on line 761, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined property: stdClass::$id in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/includes/template.php on line 761, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined property: stdClass::$id in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/includes/template.php on line 761, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined property: stdClass::$id in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/includes/template.php on line 762, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined property: stdClass::$id in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/includes/template.php on line 3562, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined property: stdClass::$id in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/includes/template.php on line 3568, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined property: stdClass::$base in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/includes/template.php on line 3733, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined property: stdClass::$id in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/includes/template.php on line 3580, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined property: stdClass::$id in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/includes/template.php on line 3628, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3
[Fri Jan 07 13:57:04 2011] [error] [client ::1] PHP Notice:  Undefined property: stdClass::$id in /Applications/XAMPP/xamppfiles/htdocs/wp30/wp-admin/includes/template.php on line 3639, referer: http://localhost/wp30/wp-admin/plugins.php?action=delete-selected&checked%5B0%5D=dump_queries.php&plugin_status=all&paged=1&_wpnonce=5b06b1e7c3

Attachments (5)

16143.patch (982 bytes) - added by SergeyBiryukov 5 years ago.
garyc40.16143.diff (528 bytes) - added by garyc40 5 years ago.
did another round of check in admin-header.php, declare global variables in admin-header.php instead of inside functions
16143.2.patch (675 bytes) - added by SergeyBiryukov 4 years ago.
16143.3.patch (595 bytes) - added by SergeyBiryukov 4 years ago.
16143.4.patch (586 bytes) - added by SergeyBiryukov 4 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 @ryan5 years ago

Discovered during investigation of #16117. See that ticket for more comments.

comment:2 @SergeyBiryukov5 years ago

Actually this seems to be lasting since 2.8, when delete_theme() was introduced.

So far as wp-admin/admin-header.php is included from inside a function, these variables lack global scope. Attached patch works for me, however it doesn't look solid. If there's a better approach, I'd like to know.

@SergeyBiryukov5 years ago

@garyc405 years ago

did another round of check in admin-header.php, declare global variables in admin-header.php instead of inside functions

comment:3 @SergeyBiryukov5 years ago

garyc40's patch makes more sense.

comment:4 @SergeyBiryukov5 years ago

  • Keywords has-patch 3.2-early added

comment:5 @ocean905 years ago

  • Component changed from General to Warnings/Notices
  • Keywords needs-refresh added

Related: #16333

@SergeyBiryukov4 years ago

comment:6 @SergeyBiryukov4 years ago

  • Keywords 3.2-early needs-refresh removed
  • Milestone changed from Future Release to 3.3

Refreshed for 3.3.

comment:7 @nacin4 years ago

We can pull those into a single global declaration.

@SergeyBiryukov4 years ago

@SergeyBiryukov4 years ago

comment:8 @SergeyBiryukov4 years ago

Done, in 16143.4.patch.

In 16143.3.patch the list is split into two lines, which seems more readable.

comment:9 @nacin4 years ago

I would probably do one line of code but with a line break. I can clean that up on commit.

comment:10 @nacin4 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In [18526]:

Globalize variables used in admin-header in case it is used in a function. props SergeyBiryukov, fixes #16143.

Note: See TracTickets for help on using tickets.