WordPress.org

Ready to get started?Download WordPress

Forums

Google Analytics by Yoast
Fatal error: Cannot use string offset as an array (33 posts)

  1. eharris
    Member
    Posted 1 year ago #

    This is strange... I've got this plugin installed on two sites installed on the same server. On my wife's site, it works fine. I had trouble with another Analytics plugin not working, so I nuked it and installed this one, since it's working for my wife. However, when I go to the plugin's config page, I get this error:

    Fatal error: Cannot use string offset as an array in /(wp_content_path)/plugins/google-analytics-for-wordpress/admin/class-admin.php on line 323

    Even more strange - when I log into my FTP server and look at my wife's site, her "google-analytics-for-wordpress" directory contains only two subdirectories (images and wp-data) and nine files. My site's non-functional "google-analytics-for-wordpress" directory, on the other hand, has SIX subdirectories (admin, frontend, images, inc, js, and languages) and only four files.

    Version 4.3.1 is installed on both sites (and both sites are using WP 3.5.1) though they have completely different sets of files, and only one of them works. Why the very different sets of files, and what might be causing the problem on my site?

    Possibly relevant: my site's 4.3.1 is a fresh install of the plugin. My wife has been using the plugin for awhile, so hers is an upgrade from a prior version of the plugin.

    http://wordpress.org/extend/plugins/google-analytics-for-wordpress/

  2. dieselops
    Member
    Posted 1 year ago #

    I am having the exact same issue. I hope to see a solution.

  3. le.gentleman
    Member
    Posted 1 year ago #

    I have the same issue after I upgraded to 4.31 . Of course the rest of wordpress is all up to date.
    :
    Fatal error: Cannot use string offset as an array in .../wp-content/plugins/google-analytics-for-wordpress/admin/class-admin.php on line 332

  4. BigEfromDaBx
    Member
    Posted 1 year ago #

    I have the same error and I think its affecting my WP to twitter plugin.

    Fatal error: Cannot use string offset as an array in /home/fu2clan/public_html/wp-content/plugins/google-analytics-for-wordpress/admin/class-admin.php on line 332

  5. xxsemmiexx
    Member
    Posted 1 year ago #

    Same issue

  6. Yannick
    Member
    Posted 1 year ago #

    Same issue after upgrade from 4.2.8...

  7. clubmango
    Member
    Posted 1 year ago #

    I'm also getting the very same error.

  8. tmusbach
    Member
    Posted 1 year ago #

    I believe I may have the same issue, but I'm not sure. I tried to install 3 plugin "updates" last night, including Google Analytics and social sharing (but I didn't write down the exact version IDs).

    But now I'm getting a blank screen when I try to login to my blog! So I can't even find if there's an "undo" button.

    My blog is http://thecareerbeat.com and the site appears to show up. But when you click on an actual headline to get to the post, it goes blank.

    I've had this site for years and never had this kind of problem. Any suggestions of what I can do to get basic admin functions back?

    Thanks for any help!

  9. le.gentleman
    Member
    Posted 1 year ago #

    After the update to 4.32 I still get this message. It seems like just the line of the error changed.
    Fatal error: Cannot use string offset as an array in .../wp-content/plugins/google-analytics-for-wordpress/admin/class-admin.php on line 344

  10. othanash
    Member
    Posted 1 year ago #

    Same here: Fatal error: Cannot use string offset as an array in /homepages/. . ./htdocs/wp-content/plugins/google-analytics-for-wordpress/admin/class-admin.php on line 344

  11. eliddon
    Member
    Posted 1 year ago #

    So I had a similar issue. Everything worked fine on 4.2.8 Then I upgraded PHP to 5.3 (from 5.2.17) and I recieved this error:

    Warning: Parameter 2 to add_ga_custom_vars() expected to be a reference, value given in .../wp-includes/plugin.php on line 173

    So I tried upgrading to 4.3.2 of the plugin and I received the error:
    Fatal error: Cannot use string offset as an array in .../wp-content/plugins/google-analytics-for-wordpress/admin/class-admin.php on line 344

    I had a custom filter to add custom vars using the following in my functions.php in my theme folder:
    add_filter('yoast-ga-custom-vars','add_ga_custom_vars',10,2);

    (I didn't include function yet).

    Once I disabled this filter I had neither error mentioned above...

  12. eliddon
    Member
    Posted 1 year ago #

    So figured my issue, In my filter:

    add_filter('yoast-ga-custom-vars','add_ga_custom_vars',10,2);

    I had the following for my function declaration:
    function add_ga_custom_vars($push, &$customvarslot) {

    Passing by reference was depreciated in php 5.3 and removed in 5.4 (see Here

  13. BigEfromDaBx
    Member
    Posted 1 year ago #

    got message of new update today. When I updated I still have issues. Getting the following error.

    Cannot use string offset as an array in /home/fu2clan/public_html/wp-content/plugins/google-analytics-for-wordpress/admin/class-admin.php on line 344

  14. Kerry Adams
    Member
    Posted 1 year ago #

    Same error here. :(

  15. mikaelhm
    Member
    Posted 1 year ago #

    I have the same error, on some of my client sites, but others not. They run on the same server with same PHP 5.3.10 and WP 3.5.1

    - mikaelhm

  16. odysseyschool
    Member
    Posted 1 year ago #

    Also having the same issue. Does anyone know if and what earlier versions are working?

  17. Yannick
    Member
    Posted 1 year ago #

    4.2.8 was working very well...

  18. zepolo
    Member
    Posted 1 year ago #

    I have the same error

  19. Marc
    Member
    Posted 1 year ago #

    Is this fixed in 4.3.2?

  20. eliddon
    Member
    Posted 1 year ago #

    Not sure if this will resolve anyone's issue, but I upgraded from 4.2.8 to 4.3.2, had the issue, then uploaded 4.2.8 back over top and then re-did the upgrade and the error went away...

  21. zepolo
    Member
    Posted 1 year ago #

    No sorry

  22. kate.neale
    Member
    Posted 1 year ago #

    Hi guys, brand new to this forum - wondering if anyone knows anything new about this error? Still getting the fatal error listed above but with "line 344" - even after a delete and fresh install of the plugin. If not, can anyone tell me how to revert back to 4.2.8? I didn't have the folders on file, I downloaded them through the plugins search. Thanks everyone.

  23. wesmcdermott
    Member
    Posted 1 year ago #

    I've been in touch with Joost and he's trying to replicate the error but isn't having any luck. Continuing to work on it, so should hopefully be something soon!

  24. Gary
    Member
    Posted 1 year ago #

    Same error with "line 344." Has anyone else had luck reverting to 4.2.8 and then reloading 4.3.2?

  25. eliddon
    Member
    Posted 1 year ago #

    I was able to, although when I reverted back to 4.2.8 I tried to reset the Analytics Profile using the automatic method (in which it failed - not sure what the error message was), so I entered my UA code in manually then did the upgrade and I didn't have an issue after that...

  26. sleinen
    Member
    Posted 1 year ago #

    Having this issue as well.

  27. BigEfromDaBx
    Member
    Posted 1 year ago #

    Even with the new update, I am still having issues.

  28. stoutyhk
    Member
    Posted 1 year ago #

  29. hehafner
    Member
    Posted 8 months ago #

    I'm getting similar error:
    Fatal error: Cannot use string offset as an array in /home/daddyhow/public_html/wp-content/plugins/google-analytics-for-wordpress/admin/class-admin.php on line 342

    I've clicked stoutyhk's link but the fix is no longer available.

    I am using Version 4.3.3 & WP 3.8.

    Thanks

  30. stoutyhk
    Member
    Posted 8 months ago #

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic