WordPress.org

Ready to get started?Download WordPress

Forums

Google XML Sitemaps
Error: Non static method being called statically (12 posts)

  1. djeyewater
    Member
    Posted 1 year ago #

    I am getting the following error on my site:

    Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GoogleSitemapGeneratorLoader::Enable() should not be called statically in /wp-includes/plugin.php on line 403

    Either Enable needs to be declared as a static method, or it should not be called statically. (I am not sure which one is correct).

    http://wordpress.org/extend/plugins/google-sitemap-generator/

  2. djeyewater
    Member
    Posted 1 year ago #

    Getting these errors as well:

    Strict standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GoogleSitemapGeneratorLoader::KillFrontpageQuery() should not be called statically in /wp-includes/plugin.php on line 484
    Strict standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GoogleSitemapGeneratorLoader::KillFrontpagePosts() should not be called statically in /wp-includes/plugin.php on line 227

    sitemap-loader.php line 125 and 129

  3. goldpups
    Member
    Posted 1 year ago #

    Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GoogleSitemapGeneratorLoader::Enable() should not be called statically in /wp-includes/plugin.php on line 403

    try this:
    1. open file /wp-content/plugins/google-sitemap-generator/sitemap.php
    2. find line: function Enable() {
    3. replace this line with: public static function Enable() {

  4. AltIvan
    Member
    Posted 1 year ago #

    Thank you goldpups, that was enough to stop showing the warning in the homepage.

    In case you are seeing similar errors in other parts just change all the other functions to start with public static function instead of just function inside sitemap.php

  5. J.D. Grimes
    Member
    Posted 11 months ago #

    Yes, I've had this as well:

    PHP Strict Standards:  call_user_func_array() expects parameter 1 to be a valid callback, non-static method GoogleSitemapGeneratorLoader::Enable() should not be called statically in /home/efield5/public_html/.codesymphony.co/wp-includes/plugin.php on line 406
    [17-Aug-2013 13:44:07 UTC] PHP Strict Standards:  call_user_func_array() expects parameter 1 to be a valid callback, non-static method GoogleSitemapGeneratorLoader::RegisterAdminPage() should not be called statically in /home/efield5/public_html/.codesymphony.co/wp-includes/plugin.php on line 406
    [17-Aug-2013 13:44:07 UTC] PHP Strict Standards:  Non-static method GoogleSitemapGeneratorLoader::GetBaseName() should not be called statically in /home/efield5/public_html/.codesymphony.co/wp-content/plugins/google-sitemap-generator/sitemap.php on line 114
    [17-Aug-2013 13:44:07 UTC] PHP Strict Standards:  call_user_func_array() expects parameter 1 to be a valid callback, non-static method GoogleSitemapGeneratorLoader::CallHtmlShowHelpList() should not be called statically in /home/efield5/public_html/.codesymphony.co/wp-includes/plugin.php on line 173
    [17-Aug-2013 13:44:07 UTC] PHP Strict Standards:  Non-static method GoogleSitemapGeneratorLoader::GetBaseName() should not be called statically in /home/efield5/public_html/.codesymphony.co/wp-content/plugins/google-sitemap-generator/sitemap.php on line 199

    I hope this will be fixed in the next release.

  6. Lanceosaurus
    Member
    Posted 8 months ago #

    Thanks goldpups!

  7. Till Kr├╝ss
    Member
    Posted 8 months ago #

    I'm getting the same errors.

  8. conservativeread
    Member
    Posted 8 months ago #

    I am still getting errors with php 5.4 I had to remove plugin until it is fixed/updated errors in php. 55 as well,fyi

  9. leejosepho
    Member
    Posted 8 months ago #

    In case you are seeing similar errors in other parts just change all the other functions to start with public static function instead of just function inside sitemap.php

    I have done that, and I have also changed all of these in sitemap-core.php:
    function GetName() -to- public static function GetName()
    function GetDescription() -to- public static function GetDescription()

    However, changing these definitely breaks the plugin:
    Non-static method GoogleSitemapGenerator::Enable() should not be called statically
    /wp-content/plugins/google-sitemap-generator/sitemap.php(250)
    Non-static method GoogleSitemapGenerator::GetInstance() should not be called statically
    /wp-content/plugins/google-sitemap-generator/sitemap.php(141)
    Non-static method GoogleSitemapGeneratorStatus::Load() should not be called statically,
    assuming $this from incompatible context
    /wp-content/plugins/google-sitemap-generator/sitemap-ui.php(684)

  10. conservativeread
    Member
    Posted 8 months ago #

    using php 5.4 and plugin version 4.0b11 solved the problem for me for now until this is updated I will use that beta.

  11. conservativeread
    Member
    Posted 8 months ago #

    still no help from author so I am using BWP Google XML Sitemaps v1.2.2 it works as good or better no errors on php5.3 or 5.4 im getting more traffic too. so until I hear better I wil use this http://wordpress.org/plugins/bwp-google-xml-sitemaps/

  12. djeyewater
    Member
    Posted 8 months ago #

    The error messages are only strict standards messages, the plugin should still work fine. If you're seeing the error messages on your live website, then the issue is with your PHP configuration.

    Try adding ini_set('display_errors', 0); to your wp-config.php file. (Or better yet, turn off display_errors in your php.ini). It won't fix the errors, but it will hide them.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.