WordPress.org

Ready to get started?Download WordPress

Forums

metar-widget
[resolved] Can't activate plugin (8 posts)

  1. bouncebackdata1
    Member
    Posted 1 year ago #

    When I try to activate the plugin, I get the following error:

    Cannot activate plugin due to fatal error:

    Parse error: syntax error, unexpected T_FUNCTION in /home/content/63/8624163/html/wp-content/plugins/metar-widget/metar-widget.php on line 62

    The site is http://www.stlouishelicopters.com

    http://wordpress.org/extend/plugins/metar-widget/

  2. bouncebackdata1
    Member
    Posted 1 year ago #

    I just discovered it's the pgi inventory plugin that's doing it. It works again once I deactivate it. Any idea what could be causing it or how I can fix it?

  3. mcantsin
    Member
    Plugin Author

    Posted 1 year ago #

    It looks like there is a conflict with another plugin you are using. Try to rename the function in line 62, which might work...

    Let me know if you could debug it, so I will consider fixing it in the next release.

  4. Ivanluisky
    Member
    Posted 1 year ago #

    I was having the same problem. Got if fixed by this below:

    Changes on the line 62 from add_action("widgets_init", function () { register_widget("MetarWidget"); });

    to: `add_action('widgets_init', register_metarwidget');
    function register_metarwidget() {
    register_widget("metarwidget");
    }`

  5. mcantsin
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks, Ivan.
    Applied your fix and submitted the corrected file.

  6. mcantsin
    Member
    Plugin Author

    Posted 1 year ago #

    *solved*

  7. bouncebackdata1
    Member
    Posted 1 year ago #

    yes, I fixed it by changing the last line to:

    add_action( 'widgets_init', create_function( '', 'register_widget( "MetarWidget" );' ) );

    I'm trying to format the function so it looks like other widgets with a title, etc. now.

  8. mcantsin
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks. - Will look into it as soon as I find time.

    Meanwhile kind regards

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic