WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#13117 closed defect (bug) (fixed)

Plugin editor falls over if no plugins are installed

Reported by: solarissmoke Owned by: westi
Milestone: 3.0 Priority: lowest
Severity: minor Version: 3.0
Component: Plugins Keywords: has-patch
Focuses: Cc:
PR Number:

Description

To reproduce:
Delete all plugins and then try to visit plugin editor.

Attachments (4)

13117.patch (761 bytes) - added by solarissmoke 10 years ago.
wp-die if no plugins installed. Also removed some superfluous <p> tags from another wp-die statement
13117-v2.patch (1.4 KB) - added by solarissmoke 10 years ago.
Don't display plugin editor link when no plugins installed; wp-die plugin editor when no plugins installed; change "blog" -> "site"
13117-with-transient.patch (769 bytes) - added by solarissmoke 10 years ago.
13117-with-transient.2.patch (796 bytes) - added by solarissmoke 10 years ago.

Download all attachments as: .zip

Change History (19)

@solarissmoke
10 years ago

wp-die if no plugins installed. Also removed some superfluous <p> tags from another wp-die statement

#1 @solarissmoke
10 years ago

  • Keywords has-patch added

#2 follow-up: @nacin
10 years ago

In addition to the wp_die(), maybe we should hide the Editor menu item if no plugins are installed?

Also, terminology change in 3.0: blog => site. Clearly we haven't gotten to the other wp_die either.

@solarissmoke
10 years ago

Don't display plugin editor link when no plugins installed; wp-die plugin editor when no plugins installed; change "blog" -> "site"

#3 in reply to: ↑ 2 @solarissmoke
10 years ago

Replying to nacin:

maybe we should hide the Editor menu item if no plugins are installed?

I agree - changed the patch. Changed "blog" to "site" also.

#4 @nacin
10 years ago

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

#5 @ryan
10 years ago

Do we really want to run get_plugins() on every admin page load? It can be really slow.

#6 @ryan
10 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#7 @ryan
10 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [14299]) Don't call get_plugins() in menu.php. It is too slow to call on every admin page load. fixes #13117

#8 @ryan
10 years ago

Reverted the get_plugins() call. In the past it has caused notable slowness when called for every page load.

#9 follow-up: @dd32
10 years ago

Don't we have a Transient with the Slugs of installed plugins that we could use here?

#10 in reply to: ↑ 9 @solarissmoke
10 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Replying to dd32:

Don't we have a Transient with the Slugs of installed plugins that we could use here?

Indeed we do!

#11 @solarissmoke
10 years ago

Hopefully this will be better?

#12 @nacin
10 years ago

If we're going to do that, then if the transient === false, we should assume the blog has plugins. A) The transient may be expired, B) there is no guarantee the dashboard widget that controls it is registered.

#13 @solarissmoke
10 years ago

Yeah I realised that that could be a problem just after uploading the patch. I've changed it to check for === false.

#14 @solarissmoke
10 years ago

On the other hand, I'm beginning to think that it's not worth adding extra overhead just to show/hide the plugin editor link. Maybe it's better just left at [14299].

#15 @nacin
10 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.