WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Edit
[resolved] WP 3.5 update broke WP Super Edit :( (23 posts)

  1. inge12
    Member
    Posted 1 year ago #

    Error message with WP 3.5 Update:

    Warning: Missing argument 2 for wpdb::prepare(), called in /home/ssnet/public_html/wp-content/plugins/wp-super-edit/wp-super-edit.core.class.php on line 114 and defined in /home/ssnet/public_html/wp-includes/wp-db.php on line 990

    Warning: Missing argument 2 for wpdb::prepare(), called in /home/ssnet/public_html/wp-content/plugins/wp-super-edit/wp-super-edit.core.class.php on line 139 and defined in /home/ssnet/public_html/wp-includes/wp-db.php on line 990

    I deactivated WP Super Edit and activated it again, but it is still broken.

    Tiny MCE remains functional, but without the Super Edit functions. :(

    It would be really nice if this could be fixed. Perhaps it's a simple thing?

    http://wordpress.org/extend/plugins/wp-super-edit/

  2. WpThemesPlanet
    Member
    Posted 1 year ago #

    There are lots of plugins affected by the new update.

    Just did a google search for "wp-includes/wp-db.php on line 990" and only list the sites in the last 24 hours, and already thousands of sites show up with problems in different plugins.

    So, I guess that probably 100+ plugins were affected by this update, and probably much more.

    Now, chaging so many plugins would take very very long.

    Is there a way to fix this in WP ?

  3. inge12
    Member
    Posted 1 year ago #

    Note that the error message I got is specific for WP Super Edit. Did you find any other plugins named?

    I imagine there are a lot of WP Super Edit users.

  4. inge12
    Member
    Posted 1 year ago #

    One person suggests the following:

    Contact the plugin creator. They need to update their prepare statement with a 2nd argument.

    Sounds simple enough ...

  5. inge12
    Member
    Posted 1 year ago #

    On another blog WP ThemesPlanet suggested:

    $results = $wpdb->get_results($wpdb->prepare($query));

    with this one:

    $results = $wpdb->get_results($wpdb->prepare($query, $args=null));

    I replaced
    ($query)
    with
    ($query, $args=null)
    in both lines specified.

    And it worked, because the error message went away and WP Super Edit actually seemed to be called for the editing window. (Before the edit it was just ignored.)

    But now I'm getting new messages:

    Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/ssnet/public_html/wp-content/plugins/wp-super-edit/wp-super-edit.php on line 152

    Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/ssnet/public_html/wp-content/plugins/wp-super-edit/wp-super-edit.php on line 217

    And I'm stumped again. Need to disable plugin.

    No error messages for other plugins so far ..

  6. inge12
    Member
    Posted 1 year ago #

    Information for the plugin author re the first error message is here:
    http://make.wordpress.org/core/2012/12/12/php-warning-missing-argument-2-for-wpdb-prepare/

  7. reales
    Member
    Posted 1 year ago #

    -- Sorry this was posted too quick there are more instances of wpdb-> prepare in the code and all need to be fixed --

    Thanks for that link inge12. From the link and looking at the code I made these changes (see below) from line 103 to 114 in the file
    wp-super-edit.core.class.php.

    Basically I changed the code so that the variable is replaced in $plugin_query by %d as detailed by that post. The variable is then put into the wpdb->prepare as the second argument and the problem is fixed!

    $plugin_query = "SELECT name, url, status, provider, callbacks FROM %d
    		";
    
    if ( $this->ui == 'plugins' ) {
    	$plugin_query = "
    		SELECT name, nicename, description, provider, status
    					FROM %d ORDER BY name
    				";
    			}
    
    $plugin_result = $wpdb->get_results( $wpdb->prepare( $plugin_query, $this->db_plugins ) );
  8. reales
    Member
    Posted 1 year ago #

    Ah ignore that post above I've not got that right at all. The post is very useful but I wasn't able to fix the plugin at all. Apologies for any misunderstanding.

  9. Samuel Wood (Otto)
    Tech Ninja
    Posted 1 year ago #

    To all in this thread: *this is not a bug in WordPress*.

    WordPress 3.5 is giving you this warning because this is a bug in a plugin that is a possible security risk.

    More information on the problem is here. There is information in the following post that will let you disable the warning, and make your site more secure.

    Please also pass this link along to the plugin's author so that they can fix their plugin so as to not cause this warning in the first place, as well as potentially patch any security problems with the plugin.

    http://make.wordpress.org/core/2012/12/12/php-warning-missing-argument-2-for-wpdb-prepare/

    Please, read the post.

  10. gruberj
    Member
    Posted 1 year ago #

    Hello Otto,

    I am getting a one line error message:

    Warning: Missing argument 2 for wpdb::prepare(), called in /home/asiaconf/public_html/wp-content/plugins/wp-super-edit/wp-super-edit.core.class.php on line 114 and defined in /home/asiaconf/public_html/wp-includes/wp-db.php on line 990

    And the relevant code reads:

    function prepare( $query, $args ) {

    How do I fix this code to remove the error?

    Thanks

  11. Samuel Wood (Otto)
    Tech Ninja
    Posted 1 year ago #

    gruberj: That's not the relevant code, that is the prepare() function which the plugin is using incorrectly.

    Look closer at the error message. Notice how it mentions the problem on line 114 of the wp-super-edit plugin file? That's the line with the problem that needs to be fixed.

  12. gruberj
    Member
    Posted 1 year ago #

    ok thanks

  13. niddler.wordpress
    Member
    Posted 1 year ago #

    Can anyone confirm if they've contacted the plugin author? I'm getting the problem and happy to do so, but equally don't want to spam them.

    Cheers (hoping the author posts here when it's fixed too).

  14. Samuel Wood (Otto)
    Tech Ninja
    Posted 1 year ago #

    This is the fix. In wp-super-edit.core.class.php, change this line:

    $buttons = $wpdb->get_results( $wpdb->prepare( $button_query ) );

    To this:

    $buttons = $wpdb->get_results( $button_query );

    Similarly, change this line:

    $plugin_result = $wpdb->get_results( $wpdb->prepare( $plugin_query ) );

    To this:

    $plugin_result = $wpdb->get_results( $plugin_query );
  15. inge12
    Member
    Posted 1 year ago #

    I contacted the plugin author at least 2 ways but got no response.

    I suspect that this plugin is abandoned.

    Too bad ...

  16. Micheal
    Member
    Posted 1 year ago #

    I replaced WP Super Edit with CKeditor and it works just fine.

  17. inge12
    Member
    Posted 1 year ago #

    I replaced it with Ultimate TinyMCE, and it also works fine, even in its free version.

  18. nathair
    Member
    Posted 1 year ago #

    Still broken (januari 8th 2012)
    strangely enough in one of my updated WP versions there is no problem. I think I will now have to replace wp superedit with CKeditor :(

  19. apautz22
    Member
    Posted 1 year ago #

    Samuel Wood (Otto)'s post worked great for me.
    Thanks

  20. mdthomann
    Member
    Posted 1 year ago #

    Ditto... Samuel Wood's fix worked on my sites also.

    Thank you!

  21. Jess Planck
    Member
    Plugin Author

    Posted 1 year ago #

    Apologies about the delay folks. Large ugly chains of reality have kept me in a state of near isolated creativity for over a year. I hope the light at the end of my tunnel is NOT a train, so I can do more this year.

    WP Super Edit 2.4.6 should fix the prepare notices. I have not merged in updates from TinyMCE, but things should be mostly working.

  22. hommealone
    Member
    Posted 1 year ago #

    Sorry I am coming into this late. I just (Feb 24 2013) updated a WP site to 3.5, and WP Super Edit (2.4.6) is still broken. Is this issue still unresolved?

    If this issue has been resolved for everyone else, how can I fix my version?

    (I tried Samuel Wood's suggestion above but it did not work.)

  23. Jess Planck
    Member
    Plugin Author

    Posted 1 year ago #

    hommealone, this thread was specifically for the "Missing Argument" error warnings that should be fixed now.

    Since you appear to have a separate issue, I would invite you to open a new discussion thread about your problem. You may try to reinstall WP Super Edit by pressing the "Uninstall WP Super Edit Tables" button under the WordPress admin at Settings > WP Super Edit and then reinstall by pressing the "Install WP Super Edit" button.

    If you do not see options, have errors, or still don't have things working, please open a new support topic so I can focus on your problem.

    Since I haven't seen more reports related to the issue for this topic, I'm going to resolve this thread.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic