WordPress.org

Make WordPress Core

Opened 19 months ago

Last modified 7 months ago

#49143 reopened defect (bug)

Deprecated constructor warning in Blogger Importer

Reported by: leemon Owned by:
Milestone: WordPress.org Priority: normal
Severity: normal Version: 5.3.2
Component: Import Keywords:
Focuses: Cc:

Description

Running the Blogger Importer in PHP 7 throws the following warning:

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Blogger_Importer has a deprecated constructor in /xxxxxx/wp-content/plugins/blogger-importer/blogger-importer.php on line 44

Change History (12)

#1 @dkarfa
19 months ago

  • Keywords close added

Hi @leemon,
I'm sorry to hear that you are having issues with your WordPress site.

Unfortunately, this is not the right place to post.

This Trac instance is for the development of the core WordPress software and not general user support.

For support, please open a ticket in the WordPress.org Support Forums.

Thank you
Debabrata Karfa

#2 @leemon
19 months ago

The Blogger Importer is the one that comes with core WordPress. This is not a third-party plugin.

#3 @desrosj
19 months ago

  • Keywords close removed
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

@leemon While the Blogger importer is mentioned on the Tools page shipped in WordPress Core, the importer itself is a plugin (https://wordpress.org/plugins/blogger-importer/). Please report the issue in the plugin's support forums.

#4 @SergeyBiryukov
19 months ago

  • Milestone set to WordPress.org
  • Resolution invalid deleted
  • Status changed from closed to reopened

Importer plugins are actually still supported here on Core Trac.

Per https://make.wordpress.org/core/handbook/contribute/trac/:

Tickets for core plugins, such as the importers, are managed under the Plugins or Import components, and current and former default themes are managed under the Bundled Theme component.

Per https://core.trac.wordpress.org/report/26:

The following components are tracked here:

  • Import: The core importers, now in the plugins repository
  • Themes: previously bundled themes (Kubrick, Classic), now in the themes repository

Thanks for the report, sorry for the confusion :)

This ticket was mentioned in Slack in #core by pbiron. View the logs.


14 months ago

#6 @Howdy_McGee
12 months ago

It looks like this issue also conflicts with other plugins such as Beaver Builder.

#7 @iandunn
7 months ago

  • Keywords php8 added
  • Priority changed from normal to high
  • Severity changed from normal to blocker

A similar error is now a fatal in PHP8.

Fatal error: Declaration of WP_SimplePie_Blog_Item::get_id($hash = false) must be compatible with SimplePie_Item::get_id($hash = false, $fn = 'md5') in plugins/blogger-importer/blogger-importer-blogitem.php on line 111

#8 follow-up: @jrf
7 months ago

  • Keywords php8 removed

A similar error is now a fatal in PHP8.

@iandunn Sorry, but that is a completely unrelated error and should have its own ticket.

A deprecated PHP 4 constructor method is (silently) treated like a normal method in PHP 8 and will not cause a fatal error.

This issue is talking about this code pattern:

<?php
class Blogger_Importer {
    function __construct() {}

    function Blogger_Importer() {
        self::__construct();
    }
}

If the class (still) does not contain a __construct() method, the Blogger_Importer() method should be renamed to __construct().

Otherwise, unless called directly, the Blogger_Importer() method will just be an unused method, which can be removed.

The fatal error mentioned by @iandunn is about one class extending another class and overloading an arbitrary method in that class using a different, incompatible function signature.
That will cause a fatal error in PHP 8, but is a completely different issue.

@SergeyBiryukov The base importer code seems to be maintained here: https://github.com/WordPress/wordpress-importer/ but that repo doesn't appear to contain the code for platform specific importers. Where is that code maintained ? In SVN ? Or are there git repos somewhere for these ?

#9 in reply to: ↑ 8 @SergeyBiryukov
7 months ago

Replying to jrf:

The base importer code seems to be maintained here: https://github.com/WordPress/wordpress-importer/ but that repo doesn't appear to contain the code for platform specific importers. Where is that code maintained ? In SVN ? Or are there git repos somewhere for these ?

Yes, as far as I know, only the WordPress Importer plugin has a GitHub repo, the others are still maintained in SVN on the Plugin Directory.

Would you like to be added as a committer to Blogger Importer or any of the other importers?

#10 @iandunn
7 months ago

  • Priority changed from high to normal
  • Severity changed from blocker to normal

Ah, you're right. I was thinking this one was elevated in PHP8 too, and it'd be easier to just fix them both in the same ticket. I'll open another ticket since this isn't an issue in 8.

#11 follow-up: @jrf
7 months ago

Yes, as far as I know, only the WordPress Importer plugin has a GitHub repo, the others are still maintained in SVN on the Plugin Directory.

Would you like to be added as a committer to Blogger Importer or any of the other importers?

I'd be happy to scan the plugins for this and other incompatibilities and do a quick update round of anything I come across, but you know me, SVN is not my comfort zone.

Would it make sense to add a repo in the GH organization with each of the importers in a separate folder ? or to possibly add them to the existing WordPress Importer repo in a separate importers folder with a separate subfolder for each of the add-on plugins ?
This might make contributions now and in the future easier ?

I'd be happy enough to set that up via PRs.

/cc @ocean90

#12 in reply to: ↑ 11 @SergeyBiryukov
7 months ago

Replying to jrf:

Would it make sense to add a repo in the GH organization with each of the importers in a separate folder ? or to possibly add them to the existing WordPress Importer repo in a separate importers folder with a separate subfolder for each of the add-on plugins ?
This might make contributions now and in the future easier ?

Yes, I think it's a great idea that would make them easier to maintain. Created a Meta ticket: #meta5550.

Note: See TracTickets for help on using tickets.