WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Last.fm For Artists] Plugin could not be activated because of a fatal error (10 posts)

  1. thehaircut
    Member
    Posted 5 years ago #

    Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/j12bunk/public_html/hexicon/wp-content/plugins/lastfm-for-artists/lastfm-for-artists.php on line 376

    Any ideas much appreciated! Brand new installation of wordpress, this is the first thing I did!

    http://wordpress.org/extend/plugins/lastfm-for-artists/

  2. j.org
    Member
    Posted 5 years ago #

    Hi thehaircut,

    it seems you've tried to run the plugin under php 4. There are certain syntactic restrictions on how to program object-oriented in php 4, where in php 5 one can shorten the code quite a bit. It's just a matter of a simple edit to fix this particular error, but there will be further errors like this on many other lines.

    So the only way this can be fixed immediately is to switch to a more recent version of php, which is always a good idea.

    If you run your website on a shared webhosting provider, there might be an option to use php 5 by default somewhere in your admin area.

    If you don't know how to check you version of php just create a empty textfile named phpinfo.php and put this single line of code into it:
    <?php phpinfo() ?>
    Then upload it and view this file in your browser. This will reveal a huge insight in the php configuration of your web hosting, including the php version number.

    If you've got further problems regarding the plugin a link to this file will help me a lot tackling the problem.

    Cheers, j.org.

    ps. I appreciate every single vote on my plugin - once you get it to function, of course.

  3. selbic
    Member
    Posted 5 years ago #

    I've got the same problem. this is my php info:
    http://comeus.de/phpinfo.php

    i cannot - under no circumstances - update to php5. with these premises, can i use your plugin somehow. its just what I am looking for...

    s

  4. j.org
    Member
    Posted 5 years ago #

    Hi selbic,

    yeah - you found the right thread, the php version is the reason for the failure.

    Mmhh... is there really such a great demand for using the plugin with php4? Then I maybe have to dig into this and release the next version compatible with php 4. But I guess this won't be that easy.

    Anybody also interested in using this plugin with php4, pleasy reply here!

    Cheers!

  5. j.org
    Member
    Posted 5 years ago #

    Hi everybody,

    I looked into this last night and I've got bad news. It's not just about some shorthand coding style, there are also some php5 features which are used in the core of my plugin, namely the new built-in dom-xml functions, which are quite easy to use for someone who has developed with the Domcument Object Model before.

    For supporting php before version 5 I would have to do massive modifications which would certainly result in a much heavier plugin. So my honest apologies for you all, but I can't support anything before php 5.

    But if you are interested only the event lists, give Simon Wheatleys Last.FM Events a try. I used his plugin as a starting point 'cause I wanted more customization possibilities. Unfortunately you have to edit the code to retrieve artist events and not user events but it's as simple as searching in lfm_events.php for ws.audioscrobbler.com/1.0/user/$username/events.ics and replacing with ws.audioscrobbler.com/1.0/artist/$username/events.ics.

    Hope this helps a little,
    ~~~Cheers!

  6. selbic
    Member
    Posted 5 years ago #

    that helps a lot. especially the hint how to change user to artist. thank you so much, iLL try it immediately. though iLL miss the fancy googlemapFeature. but in 2 or months i can change to php5 and then go back to your plugin.

  7. selbic
    Member
    Posted 5 years ago #

    hmpf. thats what it says after i "save changes" to update the new widget. there is something about "snoopy"... is it php5 problem again??? (plugin activation worked out nicely)

    Fatal error: Cannot instantiate non-existent class: snoopy in /home/c/comeus.de/public_html/blog/wp-content/plugins/lastfm-events/lfm_events.php on line 32

  8. j.org
    Member
    Posted 5 years ago #

    Sorry I didn't reply earlier, many thing to care about currently...

    Your problem is weird: snoopy is a wordpress component, which is used to retrieve remote files. WordPress itself uses it to retrieve the feeds displayed on the dashboard, so it really SHOULD be there...

    I took another look in the plugin file and actually the error should occur on line 48...

    Are you sure you installed the most recent version? Did the plugin work before my suggested modification?

    The plugin requires a wordpress file called rss.php to get access to the mentioned component. This requirement is stated on line 43, so everything should be fine. You might want to check if there is something messed up with your copy of the file.

    I suggest the following:

    1. re-install the original plugin and try if it works out of the box
    2. if not, you maybe should contact the author, but I used this plugin myself, I swear! And as far as I know, there are no php5 dependencies.
    3. if it works, try to do change the mentioned url, and really nothing else, on one single line of the file.
    4. still no luck? reply here again (and prepare an email with the changed plugin file)

    I'm sorry you've got no luck with this, but I doubt we won't get to work!

    ~~~Cheers!

  9. marcel9
    Member
    Posted 5 years ago #

    I managed to get rid of the Snoopy error by adding the following like after the comments section:

    include "/path on your webserver/wp-includes/class-snoopy.php";

    replace path on your webserver with the right path.

    Marcel.

  10. j.org
    Member
    Posted 5 years ago #

    Hi Folks,

    props to marcel - even if this doesn't fix the cause of the error, it fixes its symptoms. Well done, I recommend this hack to everybody having problems here.

    btw - you can expect a new version of the last.fm for artists in the near future.

    regards

Topic Closed

This topic has been closed to new replies.

About this Topic