Make WordPress Core

Opened 8 years ago

Last modified 2 days ago

#39802 reopened defect (bug)

Multisite: "No importers are available" error message shown to site admins, but not to network admins

Reported by: thomaswm's profile thomaswm Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.7.2
Component: Import Keywords: has-patch
Focuses: multisite Cc:

Description

Steps to reproduce:

  • Consider one site in a WordPress multisite install.
  • Verify that the "WordPress Importer" plugin is installed in the network, but disabled on this specific site.
  • Log in as a site administrator.
  • Click on "Tools" and "Import".
  • You'll see the message "No importers are available."

If, however, you open the same screen as a network admin, WordPress will show a link "Run importer". If you click it, WP will activate the "WordPress Importer" plugin and proceed with the import process.

This inconsistency is confusing to users. It does not really make sense because both site admins and network admins have the necessary capabilities to activate the importer plugin (provided that it is installed).

Attachments (1)

39802.diff (526 bytes) - added by sabernhardt 11 months ago.
change from PR 794

Download all attachments as: .zip

Change History (10)

#1 @thomaswm
8 years ago

It seems that lines 33ff. in wp-admin/import.php are responsible for this behaviour:

if ( current_user_can( 'install_plugins' ) ) {
        // List of popular importer plugins from the WordPress.org API.
        $popular_importers = wp_get_popular_importers();
} else {
        $popular_importers = array();
}

Site administrators do not have the install_plugins capability, but they do have the activate_plugins capability, which is sufficient if the specific importer plugin is already installed.

#2 @vhmarkgmailcom
7 years ago

This problem still exists in 4.8.1

#3 @vhmarkgmailcom
7 years ago

  • Keywords needs-patch added

This would be a good first bug fix

#4 @vhmarkgmailcom
7 years ago

Due to this same problem, the WordPress importer is also not available to network admins if you've disallowed plugin updates in wp-config.php

define('DISALLOW_FILE_MODS', 1);

#5 @vhmarkgmailcom
4 years ago

  • Keywords has-patch added; needs-patch removed

This is still an issue in v 5.5. Proposed a patch at https://github.com/WordPress/wordpress-develop/pull/794

#6 @lausianne
11 months ago

Same issue still in 6.4.3. Patch closed without explanation. What is happening?

@sabernhardt
11 months ago

change from PR 794

#7 @sabernhardt
11 months ago

The ticket description mentions that the plugin is "disabled on this specific site." The current patch does not add a link to activate the plugin, but it can show site administrators the "Run Importer" link when the plugin is activated on that site.

[14759] added the install_plugins condition (for two items, and the other involves installation).

#8 @OndrejM
3 days ago

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

I installed and activated the WordPress Importer plugin and then I could run the import: https://wordpress.org/plugins/wordpress-importer/

#9 @sabernhardt
2 days ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

If you installed and activated a plugin, then you had both capabilities.

Note: See TracTickets for help on using tickets.