WordPress.org

Ready to get started?Download WordPress

Forums

Google Pagespeed Insights for WordPress
[resolved] Can't active this plugin! (19 posts)

  1. haminhgiap
    Member
    Posted 8 months ago #

    The message appear when active:

    Parse error: syntax error, unexpected $end in ../public_html/wp-content/plugins/google-pagespeed-insights/core/admin.php on line 872

    I've open file admin.php and go to line 872, but this file only have 871 line.

    My server had already installed PHP 5.3.x and Curl extension, JSON extension.

    Any help me?

    http://wordpress.org/plugins/google-pagespeed-insights/

  2. mattkeys
    Member
    Plugin Author

    Posted 8 months ago #

    That is a very strange error that you are getting. the end of the file in question should be a } bracket.

    How are you installing the plugin? If you haven't already done so, I would remove the plugin, and reinstall it from within WordPress so that it will download a fresh copy from the plugin codex.

  3. haminhgiap
    Member
    Posted 8 months ago #

    I've reinstall many times, but still not resolved.

    And this is your admin.php code:

    http://pastebin.com/0sgE6k6n

  4. WPyogi
    Volunteer Moderator
    Posted 8 months ago #

    Sorry, but 800+ lines of code is way too much to post on these forums - you need to use a pastebin -

    http://codex.wordpress.org/Forum_Welcome#Posting_Code

  5. mattkeys
    Member
    Plugin Author

    Posted 8 months ago #

    No need to post the code anyways, I have seen it many times :)

    Unfortunately I am not sure what steps to recommend for you. The only times I see the type of error that you are reporting is when there is a syntax error. However a syntax error of that sort should effect everyone equally, and you are the first person to report this issue.

    Does anyone else have experiences with this type of error that would be helpful?

  6. mattkeys
    Member
    Plugin Author

    Posted 8 months ago #

    I just came across a suggestion from a google search:

    http://stackoverflow.com/questions/3819487/syntax-error-on-closing-brace-after-opening-a-php-tag

    The bottom answer suggested putting a comment // after the opening of the <?php at the end of the file.

    This makes no sense to me, and I have no way of testing it, but if it works for you let me know.

  7. haminhgiap
    Member
    Posted 8 months ago #

    This error is not same [http://stackoverflow.com/questions/3819487/syntax-error-on-closing-brace-after-opening-a-php-tag]

    Please to see http://pastebin.com/0sgE6k6n at the line 871 and 872, something wrong

    869: <?php
    870:
    871:}
    872:

  8. mattkeys
    Member
    Plugin Author

    Posted 8 months ago #

    You can try erasing the 'whitespace' on line 872.

    If that doesnt work you could try adding a close to the PHP line on 872: ?>

  9. haminhgiap
    Member
    Posted 8 months ago #

    Of course, I've tried to adding a close to the PHP line on 872: ?>

    Like this: <?php } ?>, fix not yet.

    Anyone open this file?

  10. haminhgiap
    Member
    Posted 8 months ago #

    Hey, Matt Keys

    You disclaim your brainchild?

  11. mattkeys
    Member
    Plugin Author

    Posted 8 months ago #

    haminhgiap,

    It may just be a language barrier, but your posts are coming across as a bit disrespectful. I would like to remind you that this plugin has been provided to you free of charge, and that any time I spend supporting you is also provided free of charge.

    With that said, you are the only one reporting this issue, and I have been unable to reproduce your problem locally. I am not able to further troubleshoot your issue without looking at your site.

    If you would like to send me access to your wordpress administration area and FTP, I would be willing to take a quick look and see if there is anything obvious that would be causing the problem.

    You can send me that information through my sites contact form if you chose to do so: http://mattkeys.me/about/

  12. bekar09
    Member
    Posted 7 months ago #

    Hi Matt,

    Firstly thanks for this awesome plugin.

    Well your plugin has indeed problems while activation. This is because of php short tags used in a couple of places. I would suggest it to replace "<?" with "<?php" for compatibility in various php environments.

    or the other solution would be to enable php short tags short_open_tag=On in php.ini file and restart Apache.

    Hope that helps.

    Thanks.

  13. mattkeys
    Member
    Plugin Author

    Posted 7 months ago #

    Bekar09,

    Thank you so much for posting, this was driving me crazy. I must have accidentally slipped in the use of these short-tags while coding and never noticed because my environment supports them.

    I will fix this in the next release.

  14. bekar09
    Member
    Posted 7 months ago #

    My pleasure Matt. Keep up the good job.

  15. Sean Hayes
    Member
    Posted 6 months ago #

    Hi Matt,

    I've just downloaded the plugin (it was linked to here in 7 Top WordPress plugins) and found this issue in 3 places in the same file.

    core/admin.php lines 382, 385, 388.

    I've made the change from "<?" to "<?php" and the plugin activates.

    Hope that helps.

    Sean

  16. mattkeys
    Member
    Plugin Author

    Posted 6 months ago #

    Thanks Sean,

    This fix is coming soon along with some minor bug fixes and enhancements, as well as some CSS tweaks to make the plugin look nicer in the new WordPress 3.8 admin interface.

    It is a busier time of the year for me with the holidays, but I hope to have this out soon anyways.

    Also, thanks for pointing out the article that lead you here, I had not seen it yet.

  17. Sean Hayes
    Member
    Posted 6 months ago #

    NP.

    There was also a slight issue displaying the PageSpeed API key in the admin - PHP shortcode related as well.

    Nonetheless I found the plugin useful.

  18. mattkeys
    Member
    Plugin Author

    Posted 6 months ago #

    Sean,

    I am working on the new release for today which will include fixes for these shortcodes.

    Thanks,

    Matt

  19. mattkeys
    Member
    Plugin Author

    Posted 6 months ago #

    New version is out!

    I believe WordPress checks for plugin updates every 12 hours or so, it should be popping up in the plugin area as "update available" soon.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.