WordPress.org

Ready to get started?Download WordPress

Forums

Wordbooker
php error at line wordbooker.php on line 2741 (21 posts)

  1. Kchun
    Member
    Posted 1 year ago #

    2 (not all) of my blogs must have some old settings that cause line 2741 to throw an error:

    Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /home/tomorrow/public_html/wp-content/plugins/wordbooker/wordbooker.php on line 2741

    , '" .mysql_real_escape_string($error_msg) . "'

    If you add a cast to it, it stops the error. But something else must be going on to make php think that $error_msg is an array

    , '" . mysql_real_escape_string( (string ) $error_msg) . "'

    http://wordpress.org/extend/plugins/wordbooker/

  2. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    Which version are you using?

    I'm replacing all the mysql_ calls in 2.2 to make it future proof but if this is happening I need to work out why?

    Its not actually an error - its just a warning.

  3. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    When is it happening? Is It happening when you publish a post? I've got another user reporting a similar issue.

    Can you post your support information?

  4. Kchun
    Member
    Posted 1 year ago #

    Yes. It happens right after I publish a post and Wordbooker tries to post it to Facebook.

    By support information, you mean....?

  5. Kchun
    Member
    Posted 1 year ago #

    The weird thing is that I have Wordbooker on maybe 10 of my blogs and only 2 are throwing this error. These are the ones who've had Wordbooker longest...could they have some old setting?

  6. Kchun
    Member
    Posted 1 year ago #

    What I can't understand, reading through the code, is what call to the debug routine is passing $error_msg as an array and not a string. That appears to be what is causing the error.

    I'll go check all the calls to that debug routine and see if any might be accidentally sending it an array and not a string

  7. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    No - is it dumping anything else - like any of the data? I suspect its to do with the image handling ending up with an array coming into it rather than a string. But I've no idea why - I've got another user with the same problem:

    http://wordbooker.tty.org.uk/supportforums/topic/new-error-messages-right-after-publishing-new-posts/#post-11761

    The support info is the bit that lists the Wordbooker version and lots of other things along with your active plugins. Do the blogs that it happens on have different plugins to the ones that dont?

  8. Kchun
    Member
    Posted 1 year ago #

    Here's some possibilities

    Line: 1019 unserialize CAN sometimes return an array
    wordbooker_debugger("Access token was ",unserialize($user_row->access_token),-5,88) ;

    Line 1029 If you trace $ret_code it is unserialize of a value that could well be an array (and thus still be an array)
    wordbooker_debugger("Return code is ",$ret_code,-5,88) ;

    There are a few other variables that come from unserialize of what may or may not be an array

  9. Kchun
    Member
    Posted 1 year ago #

    aha! I looked at support and saw this:

    ERROR : table 'wp_wordbooker_postcomments' is missing ! - Please Deactivate and Re-activate the plugin from the Plugin Options Page

    I'll undo my hacked fix, redo wordbooker and see if that solves the problem.

    Here's the rest:

    Wordbooker: 2.1.25
    Wordbooker Code Base: 2.1.25 R00 - All Of This Has To End
    Wordbooker ID: 254577506873
    Wordbooker Schema: 5.6
    WordPress: 3.5.1
    Table prefix: wp_
    PHP: 5.2.17
    PHP Memory Limit: 256M
    PHP Memory Usage (MB): 34.5
    JSON Encode: PHP
    JSON Decode: PHP
    Curl Status: Curl is available and can access Facebook - All is OK ( Response Time was : 0.494198083878 seconds )
    Curl Version: 7.24.0
    JSON Version: 1.2.1
    SimpleXML library: 0.1 (provided by PHP)
    HTTP Output Character Encoding: pass
    Internal PHP Character Encoding: UTF-8
    MySQL: 5.5.23-55
    Database character_set_client : utf8
    Database character_set_connection : utf8
    Database character_set_database : utf8
    Database character_set_filesystem : binary
    Database character_set_results : utf8
    Database character_set_server : utf8
    Database character_set_system : utf8
    Database character_sets_dir : /usr/share/mysql/charsets/
    Database collation_connection : utf8_general_ci
    Database collation_database : utf8_unicode_ci
    Database collation_server : utf8_unicode_ci
    Server : Apache
    Active Plugins :
    Akismet ( 2.5.7 )
    Annual Archive ( 1.3 )
    Category Posts Widget ( 3.3 )
    Custom Post Templates ( 1.5 )
    Event Calendar 3 for PHP 5.3 ( 3.1.5 )
    Event Calendar 3 for PHP 5.3 Widget ( 3.1.5 )
    Flexi Pages Widget ( 1.6.11.1 )
    Google Doc Embedder ( 2.5.4 )
    IFRAME Embed For YouTube ( 1.0 )
    Limit Login Attempts ( 1.7.1 )
    List Sub Categories Sidebar Widget ( 1.0 )
    Socialize This ( 2.2.4 )
    TinyMCE Advanced ( 3.5.8 )
    TinyMCE Valid Elements ( 0.3 )
    Form Manager ( 1.6.40 )
    Worpress Video ( 1.0 )
    WordPress Category Archive ( 1.3.0 )
    WP Issuu ( 2.15 )
    Artiss YouTube Embed ( 2.7 )
    Promotion Slider ( 3.3.1 )

    Wordbooker Table Status :
    Table 'wp_wordbooker_errorlogs' is present and contains 164 rows
    Table 'wp_wordbooker_postlogs' is present and contains 268 rows
    Table 'wp_wordbooker_userdata' is present and contains 1 rows
    Table 'wp_wordbooker_userstatus' is present and contains 1 rows
    ERROR : table 'wp_wordbooker_postcomments' is missing ! - Please Deactivate and Re-activate the plugin from the Plugin Options Page
    Table 'wp_wordbooker_process_queue' is present and contains 0 rows
    Table 'wp_wordbooker_fb_friends' is present and contains 0 rows
    Table 'wp_wordbooker_fb_friend_lists' is present and contains 0 rows

  10. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    Yes but that code only fires on access token refresh and only happens when token swapping logging is enabled. Also if the unserialize of the access token was failing because it was an array then nothing would be working at all as Wordbooker would never find a valid access token

    When is your error occurring - that will tell us more about where its happening. Wading at random through all the calls to wordbooker_debugger is not going to be efficient.

  11. Kchun
    Member
    Posted 1 year ago #

    rats....still throws error
    Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /home/tomorrow/public_html/wp-content/plugins/wordbooker/wordbooker.php on line 2741

    But the error in status is gone. Let me know if you want me to try anything else before I put the (string) case back into line 2741

  12. Kchun
    Member
    Posted 1 year ago #

    After I hit "UPDATE" on the post, it goes to the blank page, prints the above error about line 2741.

    Next I get a headers already sent message so I'm left with the original error, the headers error and an otherwise blank screen.

    However Wordbooker has successfully posted the update to facebook and everything else appears to have worked.

  13. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    So its happening on the image handing for that post at a guess which is exactly what the other person reports in the thread I linked to.

    As the code is the same on all your blogs can you check to see if any of the plugins OR Wordbooker configuration options are different (specifically the "Check the following Custom Post Meta tags for images " option ) on the blogs it doesn't work on.

    If you publish a simple post with no images in it does it do it?

  14. Kchun
    Member
    Posted 1 year ago #

    Here's the diagnostics:

    Post Time Action Message Error Code
    Testing 2013-01-27 15:50:08 Image URL http://maui-tomorrow.org ( org ) not valid -
    Testing 2013-01-27 15:50:08 Calling Wordbooker publishing function -
    Testing 2013-01-27 15:50:08 Commence Publish -
    Testing 2013-01-27 15:50:08 Author of this post is the Post Author -
    Testing 2013-01-27 15:50:08 Options Set - call transition -
    Testing 2013-01-27 15:50:08 Post option : wordbooker_noncename 22b06788b5 -
    Testing 2013-01-27 15:50:08 Post option : wordbooker_publish_default on -
    Testing 2013-01-27 15:50:08 Post option : wordbooker_primary_target FW:489942260654 -
    Testing 2013-01-27 15:50:08 Post option : wordbooker_primary_type 1 -
    Testing 2013-01-27 15:50:08 Post option : wordbooker_primary_active on -
    Testing 2013-01-27 15:50:08 Post option : wordbooker_secondary_target FW:112103508898888 -
    Testing 2013-01-27 15:50:08 Post option : wordbooker_secondary_type 1 -
    Testing 2013-01-27 15:50:08 Post option : wordbooker_extract_length 256 -
    Testing 2013-01-27 15:50:08 Post option : wordbooker_actionlink 300 -
    Testing 2013-01-27 15:50:08 Post option : wordbooker_thumb_only on -
    Testing 2013-01-27 15:50:08 Post option : wordbooker_use_excerpt on -
    Testing 2013-01-27 15:50:08 Post option : wordbooker_attribute Posted a new post on their blog -
    Testing 2013-01-27 15:50:08 Post option : wordbooker_status_update_text : New blog post : %title% - %link% -
    Testing 2013-01-27 15:50:08 Post option : wordbooker_like_button_post 1 -
    Testing 2013-01-27 15:50:08 Post option : wordbooker_publish_page_default on -
    Testing 2013-01-27 15:50:08 Post option : wordbooker_publish_post_default on -
    Testing 2013-01-27 15:50:08 Post option : wordbooker_post_edited yes -
    Testing 2013-01-27 15:50:08 Post option : wordbooker_override_id 1 -
    Testing 2013-01-27 15:50:08 User has been set to : 1 -
    Testing 2013-01-27 15:50:08 Posting as user : 1 -
    Testing 2013-01-27 15:50:08 Calling wordbooker_fbclient_publishaction -
    Testing 2013-01-27 15:50:08 Getting the Excerpt -
    Testing 2013-01-27 15:50:08 Getting the thumnail image -
    Testing 2013-01-27 15:50:08 Getting image from custom meta : -
    Testing 2013-01-27 15:50:08 Setting image array to be just thumb -
    Testing 2013-01-27 15:50:08 Setting image array to be post and thumb images. -
    Testing 2013-01-27 15:50:08 No Post images found so loading blank to keep Facebook happy -
    Testing 2013-01-27 15:50:08 Post Images : http://Maui-Tomorrow.org/wp-content/plugins/wordbooker/includes/wordbooker_blank.jpg -
    Testing 2013-01-27 15:50:08 Getting the Excerpt -
    Testing 2013-01-27 15:50:08 Post Titled : Testing -
    Testing 2013-01-27 15:50:08 Post URL : http://Maui-Tomorrow.org/?p=3793 -
    Testing 2013-01-27 15:50:08 Post Caption : Protecting Maui -
    Testing 2013-01-27 15:50:08 Read Full link being used -
    Testing 2013-01-27 15:50:08 Posting to Fan Wall Maui Tomorrow (Primary) as a Wall Post -
    Testing 2013-01-27 15:50:08 Wall Post to Maui Tomorrow Test Only No Post Made -
    Testing 2013-01-27 15:50:08 Posting to Secondary target (Occupy Maui) not active -

  15. Kchun
    Member
    Posted 1 year ago #

    Is it throwing an error because there's not a valid image?

  16. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    Did that throw the error?

    Its throwing the error because:

    else { wordbooker_debugger("Found a match so dump the image",$single,$post->ID,80); }

    seems to somehow end up with $single as an array

    I'm also confused as to why its telling me that "Image URL http://maui-tomorrow.org ( org ) not valid" That would imply that somewhere you've got an image url which contains no image.

  17. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    You could try changing the first foreach in the wordbooker_strip_images function so it looks like:

    foreach($images as $single){
    	if (is_array($single)) {break;}
  18. Kchun
    Member
    Posted 1 year ago #

    Yes - the test post ONLY has a title, no body, no images

  19. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    OK if it threw the error with no images then its something odd going on with a plugin or something screwed in the search Meta tag option as I mentioned.

  20. Kchun
    Member
    Posted 1 year ago #

    The following did NOT fix the error.

    You could try changing the first foreach in the wordbooker_strip_images function so it looks like:

    foreach($images as $single){
    if (is_array($single)) {break;}

  21. Steve
    Member
    Plugin Author

    Posted 1 year ago #

    What you need to do is put the debug on the $message line in the wordbooker_debugger:

    if (is_array($message)) { var_dump($message); echo "

    ";}

    and then we can see what is causing it to blow up...

    I have not been able to work out what is causing this on the other site either.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic