WordPress.org

Forums

Google Analytics Post Pageviews
[resolved] Cannot use object of type WP_Error as array (15 posts)

  1. AngieP
    Member
    Posted 1 year ago #

    Dear Maxime,

    Lately we are experiencing page-load- and server errors.
    When debugging we get the following prompt:
    ====================
    Cannot use object of type WP_Error as array
    /wp-content/plugins/google-analytics-post-pageviews/google-analytics-post-pageviews.php(59)
    ====================

    I would appreciate any ideas or tips to resolve this issue, as I really want to keep on using your great plugin.

    Please advise,
    Thank you in advance.

    Warmly,
    Angie

    https://wordpress.org/plugins/google-analytics-post-pageviews/

  2. maximevalette
    Member
    Plugin Author

    Posted 1 year ago #

    Hello Angie,

    Thanks for your message. It looks like the Google API token didn't succeed to be refreshed and was triggered on every request.

    I just issued version 1.2.7 when I added an anti-flood system to avoid this, let me know if it's working — Also try to disconnect and reconnect your Google account in the plugin settings.

    Thanks!

  3. maximevalette
    Member
    Plugin Author

    Posted 1 year ago #

    Hello Angie,

    Any news about the plugin? Let me know if I can help!

  4. AngieP
    Member
    Posted 11 months ago #

    Dear Maxime,

    We tried out your version 1.2.7, as well as 1.2.8, but unfortunately to no avail...

    We also did a disconnect and reconnect to our Google account in the plugin settings, and even created a brand-new API.

    As a result we returned to 1.2.6 which renders the views, but gives the error: "Cannot use object of type WP_Error as array"

    We haven't tried the latest version with WordPress 4.0.
    Do you suggest we should?

    Warm regards,
    Angie

  5. maximevalette
    Member
    Plugin Author

    Posted 11 months ago #

    Hello Angie,

    Sorry, I don't understand why you got back to 1.2.6 — This one has bug fixed in the last version so obviously you have this error :)

    Can you update to 1.28 and tell me what's the error you're having?

    Thanks!

  6. AngieP
    Member
    Posted 11 months ago #

    Dear Maxime,

    I installed 1.2.8 again, and these are my findings:
    A. In the post pageview screen in the dashboard it showed two links:
    1. Connect to Google Analytics
    2. Clear the API keys

    Connecting to Google gives an agreement screen to connect - clicked OK
    Now the page shows with all the details as I am accustomed - everything seems to work - no error messages.

    However...
    Refreshing the page returns to the initial message of A (above), showing only the two links.
    The page count on all posts remains 0

    B. Clearing the API keys
    1. Cleared the API keys and reset to new values.
    2. Again, the dashboard page shows with all the details as I am accustomed - everything seems to work - no error messages.

    However...
    Refreshing the page returns to the initial message of A (above), showing only the two links.
    The page count on all posts remains 0

    I had similar issues with your 1.2.7 - that was the reason I re-installed 1.2.6. I prefer seeing the error and have correct page view counts, instead of no error but 0 views showing.

    De-activated the plugin and re-activated it - same results.

    I'm going back to 1.2.6 now... :(

    Thank you for your efforts, much appreciated.

    Warmly,
    Angie

  7. maximevalette
    Member
    Plugin Author

    Posted 11 months ago #

    Hello Angie,

    Just after the Google connection if you refresh the settings page it loses the connection because of a URL bug. I just updated the plugin with a better redirection after the Google connection, so you won't have this bug if you refresh the page.

    Let me know if that works for you — version 1.2.9 :)

  8. AngieP
    Member
    Posted 11 months ago #

    Dear Maxime,

    First of all, thank you for all your efforts; they are much appreciated.

    All the versions after 1.2.6, and yes, I just tried 1.3, are disconnecting from Google after working perfectly for a few minutes. As soon as it stops working, all views are showing 0.

    Do you have any suggestions, as I suspect the wp cron system might be causing the trouble, but of course, I can't be sure.

    To date, the only version that works for me is 1.2.6 (although with errors).

    Have a great day,
    My best,
    Angie

  9. maximevalette
    Member
    Plugin Author

    Posted 11 months ago #

    Hello Angie,

    I fixed the issue with the Google auth — can you update to version 1.3.1 and let me know? Thanks!

  10. Azimuth Ninja
    Member
    Posted 11 months ago #

    Hey, I started using this plugin this morning, didn't work so I tried some other solutions that were no good. Now I look and it's been updated an hour ago, woo hoo! Thanks, maxime, really appreciate it!!

  11. maximevalette
    Member
    Plugin Author

    Posted 11 months ago #

    Awesome! Thanks for your feedback. Don't hesitate to rate the plugin :)

  12. AngieP
    Member
    Posted 11 months ago #

    Dear Maxime,

    You know I appreciate your time and concern.
    I really would have liked to be as ecstatic as Azimuth, but it takes exactly five minutes of correct operation before something makes the plugin (versions 1.2.7 through 1.3.1) disconnect.

    Of course it may be some process (cron?) that makes it stop working. The question remains: "what does version 1.2.6 contain that makes it continue to work, and makes all the newer versions disconnect after five minutes?"

    All my best,
    Angie

  13. maximevalette
    Member
    Plugin Author

    Posted 11 months ago #

    Hi Angie,

    As I said earlier, the 1.2.6 just doesn't display the auth error, so you think it's working but it's not. Even if numbers are here they won't be updated.

    Please, try 1.3.1 by removing everything, clear the API keys, disconnect from Google, and do everything. I really don't know what could go wrong with this version as it's working for everyone. I'd be happy to debug it on your own WP install if it's still not working.

  14. AngieP
    Member
    Posted 11 months ago #

    Dear Maxime,

    I just did exactly as you suggested.
    Removed everything, created new keys, and reconnected to the API.

    This time it took 20 minutes before the plugin disconnected.
    I suppose there is progress :)

    If you send me an email address where I can send your login credentials, I would love for you to investigate further.

    Thank you in advance.
    Warmest regards,
    Angie

  15. maximevalette
    Member
    Plugin Author

    Posted 11 months ago #

    Dear Angie,

    Just sent you an email through your contact form :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Google Analytics Post Pageviews
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic