WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: AddThis] Parse error / syntax error (25 posts)

  1. ljmac
    Member
    Posted 5 years ago #

    Hi,

    Whe I try to activate this plugin in WordPress 2.6.5, I get the following error:

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /wp-content/plugins/addthis/addthis_social_widget.php on line 35

    Also, does it have a feature to allow you to disable it on certain pages yet?

  2. journauto
    Member
    Posted 5 years ago #

    This also happened to me after updating to the latest version (1.5 I believe). I've disabled this plugin until a fix is available. Can anyone help?

  3. ljmac
    Member
    Posted 5 years ago #

    Oh yes, I forgot to mention that - I'm talking about version 1.5 (earlier versions don't produce this error).

  4. golan7m
    Member
    Posted 5 years ago #

    I have the same error............. ((

  5. cxoadvisor
    Member
    Posted 5 years ago #

    I get this error using version 1.5 of the plugin and WordPress 2.7/

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /homepages/44/d92908046/htdocs/cxoblog/wp-content/plugins/addthis/addthis_social_widget.php on line 35

  6. _mjk_
    AddThis Samurai
    Posted 5 years ago #

    Hey, so sorry guys! This is Matt from AddThis. We wrote this for PHP 5 only, not PHP 4. However, it seems like despite the official end-of-lifing last year, it's still one of the most dominant flavors, so we're going to make a backport soon. Sorry for the trouble!

    Best,
    Matt

  7. wordpresspodcast
    Member
    Posted 5 years ago #

    _mjk_,

    May we have a link to the older version to use until the backport is available?

  8. _mjk_
    AddThis Samurai
    Posted 5 years ago #

    Our older plugin also only supported PHP 5, unfortunately. But I ported it over the holiday and we'll be formally testing it in PHP4 this week.

    Best,
    Matt

  9. _mjk_
    AddThis Samurai
    Posted 5 years ago #

    Okay, the PHP4 version has been added to the plugin zip in its own special /php4 directory. It seemed okay in our local testing -- can one of you PHP 4 users try it out and let me know?

    Best,
    Matt

  10. journauto
    Member
    Posted 5 years ago #

    It activated for me in 2.6.2. Working fine. Thank you.

  11. Haroldf
    Member
    Posted 5 years ago #

    I click the button and get a page full of icons with this headline: "Bookmark & Share"
    When I click an icon (I've tried several), I get a page like this one:
    http://www.addthis.com/ask, with this text:

    "Sorry, the page you were trying to get to, ask, doesn't exist.
    Since you came from one of our own pages, we must have a bad link. Yikes! We'll correct this ASAP."

    This behavior occurred with the Addit WordPress plugin from the php4 subdirectory, as downloaded a few minutes ago. (The default version results in the "Parse error: syntax error, unexpected T_STRING..." mess.)

    I've tried this with two WordPress installations, versions 2.7 and 2.6.3.

    Not good.

  12. Haroldf
    Member
    Posted 5 years ago #

    Problem identified: I suggest that you change the "Sorry..." message to suggest that Javascript must be enabled (for Addthis.com; the Noscript Firefox plugin can block it).

  13. _mjk_
    AddThis Samurai
    Posted 5 years ago #

    Oh, interesting. Unrelated to the plugin itself, but we'll look into changing that -- the bookmark page ought to support JavaScriptless environments.

    I'll also note in the readme that JavaScript is required.

  14. ljmac
    Member
    Posted 5 years ago #

    Yep, the PHP4 version does work!

    However, in common with the old drop down version of the plug-in, it has a bizarre problem - the second post on each page disappears!

    This problem goes away if I dsiable the drop-down menu, but I'd really like to use the drop-down menu if possible.

    I am using WordPress 2.6.5, with the Tarski 2.3 theme.

  15. _mjk_
    AddThis Samurai
    Posted 5 years ago #

    Hm, does the problem occur if you use the default theme?

  16. ljmac
    Member
    Posted 5 years ago #

    Sorry, I already reverted back to 1.0 before trying that!

    What I did find though is that if I reload the page in my browser, the post can sometimes reappear. Or sometimes more of them can disappear!

    I've also found that it doesn't happen in all browsers - I use Mac OS 9, so my browsers are all pretty old. Mozilla 1.3 (the latest version for my OS) has the problem, but Internet Explorer doesn't.

    Perhaps it is just some JavaScript issue or something with old browsers - I would be intrigued to learn if anyone else has experienced the same problem. A very strange one to be sure!

  17. _mjk_
    AddThis Samurai
    Posted 5 years ago #

    Mac OS 9? I'm impressed. I thought I was cool for using lynx!

    I don't know if we can support your browser -- could very well be a JS problem. I can't even believe the menu works, really. Amazing.

    Can you check out our blog (on PHP5, etc.) in a browser that exhibits the problem, and let me know if it still occurs there?

    http://www.addthis.com/blog/

    Best,
    Matt

  18. _mjk_
    AddThis Samurai
    Posted 5 years ago #

    Mac OS 9? I'm impressed. I thought I was cool for using lynx!

    I don't know if we can support your browser -- could very well be a JS problem. I can't even believe the menu works, really. Amazing.

    Can you check out our blog (on PHP5, etc.) in a browser that exhibits the problem, and let me know if it still occurs there?

    http://www.addthis.com/blog/

    Best,
    Matt

  19. ljmac
    Member
    Posted 5 years ago #

    Actually, it seems the problem does occur on your site! The video tour post does not show up on the front page. Oh well, I guess it is a browser issue.

  20. ljmac
    Member
    Posted 5 years ago #

    Oh yes - your plug-in does work perfectly in every other respect (all the other social networking plug-ins have serious display issues on my browsers).

    I've found it's good to test my sites on these old browsers actually - if it works on them, it'll work on anything!

  21. lockwood77
    Member
    Posted 5 years ago #

    I get the following issue:

    Fatal error: Cannot redeclare addthis_plugin_options() (previously declared in /home/ianl/public_html/wp-content/plugins/addthis/php4/addthis_social_widget.php:173) in /home/ianl/public_html/wp-content/plugins/addthis/addthis_social_widget.php on line 261

    Running WP 2.7 and PHP5. I have tried the PHP4 version and get a similar error, but on line 92 instead.

  22. _mjk_
    AddThis Samurai
    Posted 5 years ago #

    lockwood77,

    My bad. If you delete the php4 folder, it'll be fine. But, better than that -- I've just released a tiny improvement (1.5.2) that fixes the conflict between the php4 and the php5 versions.

    Please let me know if that fixes things!

    Best,
    Matt

  23. lockwood77
    Member
    Posted 5 years ago #

    Excellent work dude, thanks! :)

  24. lockwood77
    Member
    Posted 5 years ago #

    P.S. WP plugin page still says v.1.5.0 - don't know if it's in your power to update that bit?

  25. _mjk_
    AddThis Samurai
    Posted 5 years ago #

    Heh, I couldn't figure out why, since the stable tag is set right, but when I read your post I had a flash of insight. Fixed now.

  26. willee10
    Member
    Posted 4 years ago #

    I use this plugin with 2.8.4 on my blog, works well. my blog: http://www.buzzcrunch.net

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags