When I activate Google Maps I get: PHP Notice: The called

When I activate Google Maps I get:

PHP Notice: The called constructor method for WP_Widget in AgmMapsWidget is deprecated since version 4.3.0! Use

__construct()
instead. in /nas/content/live/disasterelief/wp-includes/functions.php on line 3718

The error goes away as soon as I deactivate the plugin.

I'm surprised that a company like wpmudev would have deprecated code in your plugins. Don't you run PHPUnit?

  • Nastia
    • Support Rock Star

    Hello Nick

    I hope you are doing well today!

    I can confirm the same Notice is shown on my installation and I have flagged this for our developers to have a look. Thank you for letting us know.

    Please note, that this is a notice and it does not affect the functions of the plugin. You can hide them by changing the code in the wp-config.php file.
    Locate this line:
    define( 'WP_DEBUG', true );
    and replace it with this:
    define( 'WP_DEBUG', false );

    This will stop the message form showing up.

    Have a nice day and take care!

    Cheers,
    Nastia

  • Graham
    • Site Builder, Child of Zeus

    Any update to this? I'm getting this PHP notice every 3-8 seconds so it's calling the method regular enough.

    I can't turn off the wp_debug as I'm monitoring any other errors. That's a bit hard when your drowning in this error.

  • Sajid
    • DEV MAN’s Sidekick

    Hi Graham,
    Hope you are doing good today :slight_smile:

    We have not heard back from the developer yet. I have pinged the developer again, as soon as we will have any update from dev side, we will update this thread.

    Thanks for your patience and have a nice day :slight_smile:
    Cheers, Sajid

  • Graham
    • Site Builder, Child of Zeus

    Many thanks Sajid, any idea if this constantly polling for the agm_maps could cause any bottlenecks or server 500 errors? Or it is simply an advisery/notice? It just seems to be in my debug.log every 5-15 seconds.

  • Nick
    • WPMU DEV Initiate

    Hi Nastia and Sajid,

    I am disappointed in the response, for several reasons:

    1. Apparently you have developers who go weeks at a time without looking at trouble tickets.

    2. The code was deprecated in version 4.3. We are now at 4.5. It would seem the "developer" hasn't looked at his code since August 2015 when 4.3 was released.

    3. What's worse, your developer is using PHP 4 style constructors. PHP 5 which was released in 2005 preserves the use of them but recommends against them. Any decent IDE shows them as deprecated.

    4. The code itself is easy to fix, requiring typically a one-line change (see: https://gist.github.com/chriscct7/d7d077afb01011b1839d) so even if the developer has not responded, surely someone at WPMUdev can make a well-documented one line change.

    As a whole, this does not reflect well on WPMUdev, or the quality of your code in your "premium" plugins, or your procedures for code testing and validation.

  • Swing Graphics
    • Flash Drive

    This has been open since May and is still unpatched? You have "Dev" right in the name of your site. As developers, we cannot be turning off debugging. I am grateful for the linked file that has the fix. Literally one word. Probably ought to role that into the official version.

  • Nastia
    • Support Rock Star

    Hello Swing Graphics , I trust you are doing well.

    My appologies for the delay, the fficial version of the Google Map plugin is not out yet.

    If you wish to try it, I've attached the beta version of the plugin here. Please, because it's a beta, create a backup of your site before installing the plugin. You can try Snapshot plugin for backup.

    Have a nice day and take care.

    Cheers,
    Nastia

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.