• Resolved efeb

    (@efeb)


    when publishing post i’m getting this:

    Fatal error: Cannot redeclare wpbook_safe_publish_to_facebook() (previously declared in /home/krakoff/ftp/krakoff.info/wp-content/plugins/wpbook/publish_to_facebook.php:6) in /home/krakoff/ftp/krakoff.info/wp-content/plugins/wpbook/publish_to_facebook.php on line 179

    except that message plugin works.

Viewing 15 replies - 16 through 30 (of 35 total)
  • I just got a similar error:

    Fatal error: Cannot redeclare wpbook_safe_publish_to_facebook() (previously declared in /home/tracibu/public_html/blog/wp-content/plugins/wpbook/includes/publish_to_facebook.php:6) in /home/tracibu/public_html/blog/wp-content/plugins/wpbook/includes/publish_to_facebook.php on line 403

    This happened when I tried saving a slideshow using the SlideDeck plugin. I’m using WPBook version 2.2.3.

    Plugin Author John Eckman

    (@johneckman)

    Traci – you can grab the development version from http://wordpress.org/extend/plugins/wpbook/download/ (at the bottom of the page).

    Or you can make the change described by dasfisch above – checking to see if wpbook_safe_publish_to_facebook() already exists before importing it.

    What concerns me though is why this is happening – it happens when multiple posts are being published at the same time – does the SlideDeck plugin make multiple posts for each “deck”?

    I tried to make the change that dasfisch suggested–but for me, it was around line 2059 that I had to add in if(!function_exists(‘wpbook_publish_to_facebook’)) {

    plus, mine had some code that his didn’t, so I’m not sure if I needed to do something else. Here’s what I had after add that line:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Then when I tried to save the slide show, I would get the message “Sorry, but you can’t run this plugin, it requires PHP 5 or higher.” But I do have PHP5.2.15. If I deactivated WPBook, it didn’t happen and I could save the slide show. After saving it, I realized the slideshow plugin didn’t do what I wanted, so I deactivated it.

    I don’t believe slidedeck is even making posts because you create a slideshow, then you can insert it into a post. But maybe for each “slide” that it creates for the slideshow (each photo is a slide), it acts as a post?

    Aside from SlideDeck, I’m not sure if the error had anything to do with other issues I have with WPBook (I’ve posted a question about it, and you replied) where at first it was cutting off the post when it posted to my page, but not on my profile (which was posted as a note). Without me changing anything (that I can remember) it stopped doing that, but if you click on “read more”, it takes you to my blog–so no comments can be left on FB for it. I’m not sure if I have something set up wrong or not.

    Today I tried publishing a new post, and I got the same error “Sorry, but you can’t run this plugin, it requires PHP 5 or higher.” This time it’s not due to SlideDeck because I deleted it. All I was doing was publishing a post with some photos. I removed the code I had added (listed above in a previous comment here), and was able to publish. But lately, since WPBook isn’t posting to Facebook, it’s not doing anything.

    The code you have is slightly wrong.

    Here’s what you have:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    The if statement was in the wrong position. I very well might have done that myself. If I did, I apologize. The code should be good to go! PM me if you have any questions. I’d be happy to help you out.

    dasfisch: thanks for your help! I deleted the plugin, and just reinstalled it. I deleted it because it had stopped publishing to my facebook, and it hadn’t been behaving properly before that. Facebook has changed the app set-up, so it took me awhile to get it set back up again. Hopefully I’ve got it right. Then I made the change like you gave. I’ll have to wait until I post something to see if everything is working correctly. I would do a test post, but I have a bunch of subscribers and don’t want to annoy them. I’ll let you know if I need any help. Thanks so much!

    I am working on a post for tomorrow. When I tried to save it as a draft, I got this error:

    Warning: Cannot modify header information – headers already sent by (output started at /home/tracibu/public_html/blog/wp-content/plugins/wpbook/wpbook.php:2756) in /home/tracibu/public_html/blog/wp-includes/pluggable.php on line 934

    Here’s that section of pluggable.php (click on the pastebin link to see)

    http://pastebin.com/Q7RKF1ff

    line 934 is header(“Location: $location”, true, $status);

    Okay, I deleted the plug-in again, and uploaded the development version. With it activated, I was able to save the draft. Tomorrow when I finish the post and post it, I’ll see if it posts it to my facebook page & profile.

    I just tried publishing my post, and got this error:

    Caught exception in stream publish for user: Error validating application.Error code: 0

    I’ll have to deactivate WPBook in order to publish it.

    Edit: Even though I got the error, it did publish my post, but only on my blog, not FB. I’ve deleted the developer’s version, and reinstalled the most recent version. I’m about to give up.

    Plugin Author John Eckman

    (@johneckman)

    Tracibunkers – sorry to hear you’re having trouble – just haven’t been able to keep up with support in the forums lately.

    When you had the development version installed, did you re-grant permissions?

    Sounds like a configuration error, but those are very difficult to track down. The “Error validating application” comes from Facebook, and likely means some kind of OAuth error.

    John, I “think” I regranted permissions, but I might not have. When I reinstalled the most recent version, I did. Do you suggest I reinstall the development version, and regrant permissions? The posts show up fine on my canvas, and aren’t cut off anymore, but they aren’t posting to my FB wall.

    Plugin Author John Eckman

    (@johneckman)

    Yes – reinstall the development version, and regrant permissions.

    Then let me know what the “check permissions” link shows – exactly what it says – that’s the only way I can debug what’s going on here.

    Okay, done & done. Here’s what it says, and I replaced my ID with XXX:

    This page is where you can check and grant extended permissions, which enable WPBook to publish to your personal wall and/or to the walls of fan pages.

    The Facebook profile ID you are currently logged in to Facebook as is XXX. You have defined XXX as your Facebook user id in WPBook Settings.

    FB profile XXX has granted these permissions:

    offline_access – yes
    read_stream – yes
    publish_stream – yes
    manage_pages – yes

    An access token for this user has been stored.

    You’ve indicated you wish to publish to this page: 373353135887

    An access token corresponding to this page has been stored.

    To correct any of these, Grant or re-grant permissions for your userid. (This is required if you intend to publish to your personal wall OR any fan pages.)

    Okay, I just created a post to test it out. I was able to publish the post just fine, and it posted to both my facebook profile & fan page. On my fan page, to read more, it takes you to my blog–and that’s fine. On the post on my profile (posted as a note), I wrote a comment to test it out. I also wrote a comment on my blog to see if the comments would show up in both places. They don’t, or haven’t–maybe it takes awhile? But this is what was happening before. It would be great for the comments to be shared in both places, but maybe I should just change it so that it doesn’t post as a note to my profile, and posts through the app. Then when anyone clicks on it to read more, it just takes them to my blog?

    Plugin Author John Eckman

    (@johneckman)

    Ok, so publishing is working?

    On your profile, clicking read more takes you into the app, but on your fan page, read more goes to the blog?

    Comments made against the post on your profile should get imported, but that task only checks once an hour.

    Comments written on your blog should be immediately visible in FB (on the canvas page) once they are visible in WordPress (that is, unless they are waiting for approval).

    The “read more” will go to your blog if you have “use external permalinks” enabled, otherwise it should point to the canvas page (apps.facebook.com/whatver/)

Viewing 15 replies - 16 through 30 (of 35 total)

The topic ‘[Plugin: WPBook] Fatal Error when publishing post’ is closed to new replies.