1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Bug CRON throwing Exception errors

Discussion in 'Better Analytics' started by TheLimeDesign, Sep 28, 2017.

  1. #1
    Hi there,

    I'm getting the following errors reported by the cron (pasted word by word, edited private details):

    <br />
    <b>Fatal error</b>: Uncaught exception 'Exception' with message 'DateTimeZone::__construct(): Unknown or bad timezone ()' in /home/XXXXXXXX/public_html/assets/plugins/better-analytics/library/DigitalPointBetterAnalytics/Model/Widget.php:111
    Stack trace:
    #0 /home/XXXXXXXX/public_html/assets/plugins/better-analytics/library/DigitalPointBetterAnalytics/Model/Widget.php(111): DateTimeZone-&gt;__construct('')
    #1 /home/XXXXXXXX/public_html/assets/plugins/better-analytics/library/DigitalPointBetterAnalytics/Model/Widget.php(83): DigitalPointBetterAnalytics_Model_Widget::getStatsWidgetStart(Array)
    #2 /home/XXXXXXXX/public_html/assets/plugins/better-analytics/library/DigitalPointBetterAnalytics/CronEntry/Jobs.php(15): DigitalPointBetterAnalytics_Model_Widget::getStatsWidgetData()
    #3 [internal function]: DigitalPointBetterAnalytics_CronEntry_Jobs::hour()
    #4 /home/XXXXXXXX/public_html/wp-includes/class-wp-hook.php(298): call_user_func_array(Array, Array)
    #5 /home/XXXXXXXX/public_html/wp-includes/class-wp-hook.php(323): WP_Hook-&gt;apply_filters('', Array)
    #6 /hom in <b>/home/XXXXXXXX/public_html/assets/plugins/better-analytics/library/DigitalPointBetterAnalytics/Model/Widget.php</b> on line <b>111</b><br />
    SEMrush
    I'm using PHP5.6 and plugin is at version 1.2.3

    Any idea how to fix this?
     
    TheLimeDesign, Sep 28, 2017 IP
    SEMrush
  2. WebDeveloperSahil

    WebDeveloperSahil Active Member

    Messages:
    289
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    55
    #2
    WebDeveloperSahil, Sep 28, 2017 IP
  3. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,099
    Likes Received:
    2,575
    Best Answers:
    457
    Trophy Points:
    710
    Digital Goods:
    29
    #3
    What is your timezone set to under your WordPress settings?
     
    digitalpoint, Sep 28, 2017 IP
  4. TheLimeDesign

    TheLimeDesign Active Member

    Messages:
    497
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    60
    #4
    Here's the code at public_html/assets/plugins/better-analytics/library/DigitalPointBetterAnalytics/Model/Widget.php : https://pastebin.com/UH4bSyrV

    And I can't see how that problem that you shared is related to mine.

    It's set at UTC+8
     
    TheLimeDesign, Sep 29, 2017 IP
  5. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,099
    Likes Received:
    2,575
    Best Answers:
    457
    Trophy Points:
    710
    Digital Goods:
    29
    #5
    Do you have access to upload individual files to your server via FTP by chance?
     
    digitalpoint, Sep 30, 2017 IP
  6. TheLimeDesign

    TheLimeDesign Active Member

    Messages:
    497
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    60
    #6
    Indeed I do. May I know which files would you like to have? I have the PRO version too, if that matters :)
     
    TheLimeDesign, Oct 1, 2017 IP
  7. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,099
    Likes Received:
    2,575
    Best Answers:
    457
    Trophy Points:
    710
    Digital Goods:
    29
    #7
    Can you grab this version, install it and see if the error goes away? A bit difficult to debug on this end since I'm not seeing the error, but hopefully this will take care of it:

    http://www.digitalpoint.com/better-analytics.zip

    (it's just a replacement for the normal version, not the Pro version)

    Let me know if that works please.
     
    digitalpoint, Oct 2, 2017 IP
  8. TheLimeDesign

    TheLimeDesign Active Member

    Messages:
    497
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    60
    #8
    Hi there,

    Thanks for this! It's been a couple of hours now and there has been not a single occurrence of the error :D Seems like it's solved~
    I'll monitor it closely for awhile longer.
     
    TheLimeDesign, Oct 3, 2017 IP
    digitalpoint likes this.
  9. TheLimeDesign

    TheLimeDesign Active Member

    Messages:
    497
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    60
    #9
    Hi there,
    There is another error that is occurring now, also thrown by the cron. Any idea on this?

    <br />
    <b>Notice</b>: Undefined index: metric in <b>/home/xxxxx/public_html/assets/plugins/better-analytics/library/DigitalPointBetterAnalytics/Model/Widget.php</b> on line <b>155</b><br />
    <br />
    <b>Notice</b>: Undefined index: days in <b>/home/xxxxx/public_html/assets/plugins/better-analytics/library/DigitalPointBetterAnalytics/Model/Widget.php</b> on line <b>160</b><br />
     
    TheLimeDesign, Oct 9, 2017 IP
  10. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,099
    Likes Received:
    2,575
    Best Answers:
    457
    Trophy Points:
    710
    Digital Goods:
    29
    #10
    Hmmm, that looks like a widget that somehow lost it's settings. Can you go in and edit the widget and make sure it *has* settings (specifically metric and days)?
     
    digitalpoint, Oct 10, 2017 IP
  11. TheLimeDesign

    TheLimeDesign Active Member

    Messages:
    497
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    60
    #11
    How do I edit the widget (and what do I edit)? This is the widget on the admin dashboard, isn't it?
    It is pulling the data fine from analytics though. Everything is showing perfectly, I can even view realtime data, switch the metrics, but I'm still getting the cron error.
     
    TheLimeDesign, Oct 10, 2017 IP
  12. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,099
    Likes Received:
    2,575
    Best Answers:
    457
    Trophy Points:
    710
    Digital Goods:
    29
    #12
    No, that should be from a public facing widget under Admin -> Appearance -> Widgets

    You'll be looking for one who's name starts with "Better Analytics".
     
    digitalpoint, Oct 11, 2017 IP
  13. TheLimeDesign

    TheLimeDesign Active Member

    Messages:
    497
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    60
    #13
    Hi digitalpoint,

    When I add the better analytics: popular widget, it doesn't appear. But when I drag the better analytics: stats widget, it works fine.

    Maybe this is causing the problem. How do I fix this?
     
    TheLimeDesign, Oct 12, 2017 at 1:17 AM IP
  14. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,099
    Likes Received:
    2,575
    Best Answers:
    457
    Trophy Points:
    710
    Digital Goods:
    29
    #14
    Just as a test if you delete the existing Better Analytics widgets, does the error stop?
     
    digitalpoint, Oct 12, 2017 at 2:38 PM IP
  15. TheLimeDesign

    TheLimeDesign Active Member

    Messages:
    497
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    60
    #15
    It doesn't. I'm not really using the widget at all actually. I only added it for this testing. Something seems not right.
     
    TheLimeDesign, Oct 12, 2017 at 11:23 PM IP
  16. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,099
    Likes Received:
    2,575
    Best Answers:
    457
    Trophy Points:
    710
    Digital Goods:
    29
    #16
    Is it on specific pages? Public facing ones or admin?
     
    digitalpoint, Oct 13, 2017 at 11:31 AM IP
  17. TheLimeDesign

    TheLimeDesign Active Member

    Messages:
    497
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    60
    #17
    U mean the widget? I don't have it enabled anywhere. The only widget that I use is the admin dashboard and it works perfectly fine.
     
    TheLimeDesign, Oct 14, 2017 at 1:18 AM IP
  18. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,099
    Likes Received:
    2,575
    Best Answers:
    457
    Trophy Points:
    710
    Digital Goods:
    29
    #18
    Ya... but when you are in your browser, what page(s) are you visiting when you are getting the error?
     
    digitalpoint, Oct 15, 2017 at 10:17 AM IP
  19. TheLimeDesign

    TheLimeDesign Active Member

    Messages:
    497
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    60
    #19
    The error was getting thrown by Cron actually..It was not appearing on any page..
    However, it has mysteriously disappeared for the past 2 days over the weekend..
     
    TheLimeDesign, Oct 15, 2017 at 11:40 PM IP
  20. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,099
    Likes Received:
    2,575
    Best Answers:
    457
    Trophy Points:
    710
    Digital Goods:
    29
    #20
    Hmmm... strange... maybe there's some caching issue or something going on. I guess let me know if it pops back up. Really hard to debug on this end since I can't replicate it.
     
    digitalpoint, Oct 16, 2017 at 4:23 PM IP