Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class 'WP_Import' not found #15

Closed
drebbits opened this issue Nov 18, 2015 · 16 comments
Closed

Class 'WP_Import' not found #15

drebbits opened this issue Nov 18, 2015 · 16 comments
Labels
Milestone

Comments

@drebbits
Copy link

Getting this error somewhere in the plugin.php line 33. I believe it should be WP_Importer?

@drebbits
Copy link
Author

Also - i'm testing this on VIPQS :)

@danielbachhuber
Copy link

Is the WordPress Importer plugin installed and activated?

@danielbachhuber
Copy link

Is the WordPress Importer plugin installed and activated?

Sorry, this might be an erroneous suggestion. Testing.

@drebbits
Copy link
Author

VIPQS is on WP v4.4 beta4

@danielbachhuber
Copy link

I can reproduce. I'm not sure of the history though (as the code was introduced in a massive commit 73da8c4), so we'll need to wait to hear of @rmccue's intensions.

@rmccue rmccue modified the milestone: Beta 1 Nov 19, 2015
@szaqal83
Copy link

I think line 33 should be:

$GLOBALS['wp_import_v2'] = new WXR_Importer();

doing so results: Undefined index: wp_import. So this should also be fixed.

Whole function should look like this:

function wpimportv2_init() {
    /**
     * WordPress Importer object for registering the import callback
     * @global WP_Import $wp_import
     */
    $GLOBALS['wp_import_v2'] = new WXR_Importer();
    register_importer(
        'wordpress-v2',
        'WordPress (v2)',
        __('Import <strong>posts, pages, comments, custom fields, categories, and tags</strong> from a WordPress export file.', 'wordpress-importer'),
        array( $GLOBALS['wp_import_v2'], 'dispatch' )
    );
}

@rmccue
Copy link
Member

rmccue commented Nov 25, 2015

If you're hitting this on the admin import screen, then yeah, see #1 (the admin hasn't been touched at all yet). I think that's the only time this mistake is made?

@szaqal83
Copy link

No I was runing it from WP CLI.

@rmccue
Copy link
Member

rmccue commented Nov 25, 2015

@szaqal83 Thanks for clarifying, will investigate. Are you running the wp wxr-importer import command here, or a different command?

@szaqal83
Copy link

Yes, exactly.

@rlaan
Copy link

rlaan commented Nov 25, 2015

Hi all,

I got the same error and solved it with also installing the former wp-importer plugin.
I am not sure at all if that was how it should work (probably not), but I was just guessing the new version was like a 'on-top-of' kind a plugin.

@lkraav
Copy link

lkraav commented Dec 18, 2015

Also hitting this. Network-activating old Importer doesn't seem to help.

EDIT but activating Importer on subsite, then subsequently activating Importer v2, works.

@ManiKumar01
Copy link

Fatal error: Class 'WP_Import'

WordPress-Importer-master\plugin.php on line 33

@ptasker
Copy link

ptasker commented Mar 14, 2016

Added a PR that wraps the WP_Import call in a class_exists check.

@dimbak
Copy link

dimbak commented Apr 16, 2016

I think this is now fixed in this branch https://github.com/humanmade/WordPress-Importer/tree/admin-ui

@rmccue
Copy link
Member

rmccue commented Jun 13, 2016

This is totally fixed now. :)

@rmccue rmccue closed this as completed Jun 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants