• Resolved steve1200

    (@steve1200)


    After the last upgrade I get this error which has never occurred before;
    Fatal error: Uncaught Error: Call to a member function get_option() on null in /volume1/web/genealogy/wp-content/plugins/wp-statistics/includes/classes/class-wp-statistics-bootstrap.php:160 Stack trace: #0 /volume1/web/genealogy/wp-includes/class-wp-hook.php(286): WP_Statistics_Bootstrap::footer_action(”) #1 /volume1/web/genealogy/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(”, Array) #2 /volume1/web/genealogy/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #3 /volume1/web/genealogy/wp-includes/general-template.php(2630): do_action(‘wp_footer’) #4 /volume1/web/genealogy/wp-content/themes/atahualpa/footer.php(110): wp_footer() #5 /volume1/web/genealogy/wp-includes/template.php(688): require_once(‘/volume1/web/ge…’) #6 /volume1/web/genealogy/wp-includes/template.php(647): load_template(‘/volume1/web/ge…’, true) #7 /volume1/web/genealogy/wp-includes/general-template.php(76): locate_template(Array, true) #8 /volume1/web/genealogy/familytree/wp-footer.php(5): get_footer() #9 /volume1/web/genealogy/fa in /volume1/web/genealogy/wp-content/plugins/wp-statistics/includes/classes/class-wp-statistics-bootstrap.php on line 160

    When I disable WP-Stastics this error goes away. This page loads another php program using the WP header and footer but is not a widget or part of WordPress.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi,

    Could you please let me know which version of PHP you are running?

    Thread Starter steve1200

    (@steve1200)

    WordPress 4.9
    PHP 7.0
    Apache 2.4

    I am loading a stand alone php program by using a WP permalink. I have been running this php program for two years. After some looking I found the php program does not provide info to the WP get_option() wp-statistics uses. I can add code to the program’s footer.php file but I do not know what to add. For now I commented out lines 160 thru 163 in class-wp-statistics-bootstrap.php instead of disabling the plugin so my site does not generate the errors.

    Hi,

    Please download the dev package here and test again:
    https://github.com/wp-statistics/wp-statistics/archive/master.zip

    Let me know the result

    Thread Starter steve1200

    (@steve1200)

    I just installed your package and there are no errors. However, using a mobile device I visited my site and WP-Statistics did not show anyone online. I viewed the help page and when I refreshed WP-Statistics the help page number views did not change.

    What might offer more functionality and not cause errors, for third party programs, would be to create a small php file and then let users add code in the program’s head or footer file like Google uses. Then WP-Statistics would catch all pages viewed without altering your main program.

    • This reply was modified 7 years, 4 months ago by steve1200.
    Thread Starter steve1200

    (@steve1200)

    When I reinstalled the prior version, even with some lines of code commented out, the online user displayed and the viewed page incremented correctly.

    In case you are wondering, I removed my network from exclusions to run the tests.

    Please visit your site through your mobile browser as guest, Not logged in user
    And test again

    What might offer more functionality and not cause errors, for third party programs, would be to create a small php file and then let users add code in the program’s head or footer file like Google uses. Then WP-Statistics would catch all pages viewed without altering your main program.

    This will be able in future releases

    Thread Starter steve1200

    (@steve1200)

    I did not login for any tests using the mobile device. The wp-login is disabled on my site so I am never logged in by default.

    FWIW: In my case the error was not generated by WP Statistics, but by the “Cookie Notice” plugin by dFactory. Apparently the Cookie Notice Plugin tries to hook into some bootstrap process, and when WP Statistics was updated from 11.x to 12.x things failed. Maybe it was also because I’m using the PHP cache.

    Long story short: I disabled the Cookie Notice plugin, updated WP Statistics, and when the updated WP Statistics version was running correctly I re-enabled the Cookie Notice plugin.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Page errors’ is closed to new replies.