WordPress.org

Ready to get started?Download WordPress

Forums

SEO Ultimate
[resolved] Syntax error ver. 7.5.7 (18 posts)

  1. Mary B.
    Member
    Posted 2 years ago #

    Installing version 7.5.7 produced the following error:

    Parse error: syntax error, unexpected T_IF in /home/xxx/public_html/wp-content/plugins/seo-ultimate/modules/author-links/author-links.php on line 1

    Deleting the author-links.php file worked as a temporary fix, but that's not a very good solution. I would imagine that deleting the file will probably break something in the plugin functions.

    I also tried increasing the site memory allocation by editing wp-config.php, to no avail.

    Assistance would be appreciated!

    http://wordpress.org/extend/plugins/seo-ultimate/

  2. John
    Member
    Plugin Contributor

    Posted 2 years ago #

    It sounds like there was a plugin installation failure and the author-links.php file was not downloaded correctly. Try going to Settings > SEO Ultimate > Reinstall and reinstalling the plugin.

  3. Mary B.
    Member
    Posted 2 years ago #

    Nope, that wasn't it. I downloaded the plugin zip file again, and uploaded the new author-links.php file from the fresh download. I'm getting the same error message in my admin as I posted above. So I deleted the author-links.php file again. A line-by-line comparison of the author-links.php file I just downloaded, and the one I had trouble with 2 days ago shows them to be identical.

    Then I tried deactivating the plugin, re-uploading the fresh author-links.php, and reactivating the plugin. "The plugin could not be activated because it triggered a fatal error: Parse error: syntax error, unexpected T_IF in /home/xxxxxxxx/public_html/wp-content/plugins/seo-ultimate/modules/author-links/author-links.php on line 1"

    This installation is not on wordpress.com. I have updated the WordPress core to version 3.4.1, just before I updated the SEO Ultimate plugin.

  4. John
    Member
    Plugin Contributor

    Posted 1 year ago #

    Hmm, that's very odd, for two reasons. The first reason is that line 1 of that file is this:

    /**

    ...and obviously, that's not an "if" statement. The first line of actual code (i.e. code that's not a comment) does include an "if" statement, but it's this one:

    if (class_exists('SU_Module')) {

    This is also odd because that same line exists at the beginning of every other module file too, so if that line was truly breaking author-links.php, then it should be breaking every other module as well. (In other words, if that line of code is the problem, then deleting author-links.php would not be effective at getting rid of the error.)

    Not to alarm you or anything, but is there perhaps a virus on your site that could be adding code to the beginning of author-links.php? If you were to re-upload the file, and if your site were to crash again, would you be able to perhaps re-download it from your site, or else use a file editor in your web host's control panel, to view the contents of the author-links.php and see if there's any code added to the beginning? (or perhaps even code removed from the beginning?)

  5. Mary B.
    Member
    Posted 1 year ago #

    Well, I've solved the mystery...almost. Your response gave me the clue. For some as yet unknown reason, my FTP program is changing that file on upload so all the code is on one line. PHP on our server clearly can't parse the file properly like that. None of the other plugin files are affected that way, nor are any of the files for the latest WordPress core update.

    I logged into the control panel file editor and copied/pasted the original code into author-links.php, and the plugin works just fine now. Now I will have fun figuring out why my FTP program messes up ONLY that file.

    Thanks, John, for your perseverance in helping me to figure out the problem.

  6. javierojuel
    Member
    Posted 1 year ago #

    Hey! I get the same error. I am using Filezilla and I found what's going wrong. Under the menu of "Transfer", you go to "type of transfer" and change it from "Automatic" to "Binary".
    In this way, the FTP program does not change the file when is uploaded.

  7. linuxguy
    Member
    Posted 1 year ago #

    I ran into this problem today while launching a client's web site. You all saved me a ton of work trying to figure it out. Thanks for posting!

  8. ElJuano
    Member
    Posted 1 year ago #

    The solution posted by Javier fixed the issue for me too. Thanks!

  9. Ryan Hendra
    Member
    Posted 1 year ago #

    Thanks Mary & Javier for saving me hours of head-scratching.

  10. facefirstbecca
    Member
    Posted 1 year ago #

    Thanks Mary and javierojuel for sharing the solution!

  11. tmdabc
    Member
    Posted 1 year ago #

    ok,
    thanks to
    Mary B.

  12. bomren
    Member
    Posted 1 year ago #

    Ok, thanks too to Mary and Javierojuel, the solution works just fine !

    (wp 3.5.1 + seo ultimate 7.6.1 + filezilla)

  13. Mauri
    Member
    Posted 1 year ago #

    Mary and Javier,
    Thanks for solving this issue.

  14. ajamm
    Member
    Posted 1 year ago #

    Odd, I have this issue, and I installed from WP.org...

  15. ajamm
    Member
    Posted 1 year ago #

    and... delete and reinstall fixed it :-)

  16. redsoxburns
    Member
    Posted 1 year ago #

    Thank you, this was a great fix to a very annoying problem! :-)

  17. toddbenton
    Member
    Posted 1 year ago #

    Thanks Mary and Javier! That worked for me also.

  18. ccalvert
    Member
    Posted 1 year ago #

    FYI, the issue is that this file has Mac line endings (CR), while the others have UNIX line endings (LF). If the author changes the file format, it will resolve these issues.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.