Make WordPress Core

Opened 14 years ago

Closed 13 years ago

#16143 closed defect (bug) (fixed)

PHP notices when deleting plugins and themes via FTP

Reported by: ryan's profile ryan Owned by: nacin's profile 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 14 years ago.
garyc40.16143.diff (528 bytes) - added by garyc40 14 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 13 years ago.
16143.3.patch (595 bytes) - added by SergeyBiryukov 13 years ago.
16143.4.patch (586 bytes) - added by SergeyBiryukov 13 years ago.

Download all attachments as: .zip

Change History (15)

#1 @ryan
14 years ago

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

#2 @SergeyBiryukov
14 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.

@garyc40
14 years ago

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

#3 @SergeyBiryukov
14 years ago

garyc40's patch makes more sense.

#4 @SergeyBiryukov
14 years ago

  • Keywords has-patch 3.2-early added

#5 @ocean90
14 years ago

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

Related: #16333

#6 @SergeyBiryukov
13 years ago

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

Refreshed for 3.3.

#7 @nacin
13 years ago

We can pull those into a single global declaration.

#8 @SergeyBiryukov
13 years ago

Done, in 16143.4.patch.

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

#9 @nacin
13 years ago

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

#10 @nacin
13 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.