WordPress.org

Support

Support » Plugins and Hacks » WP Super Edit » [Resolved] WP 3.5 update broke WP Super Edit :(

[Resolved] WP 3.5 update broke WP Super Edit :(

  • 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/

Viewing 15 replies - 1 through 15 (of 22 total)
  • 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 ?

    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.

    One person suggests the following:

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

    Sounds simple enough …

    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 ..

    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/

    — 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 ) );

    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.

    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.

    PHP Warning: Missing argument 2 for wpdb::prepare()

    Please, read the post.

    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

    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.

    ok thanks

    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).

    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 );

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

    I suspect that this plugin is abandoned.

    Too bad …

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

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘[Resolved] WP 3.5 update broke WP Super Edit :(’ is closed to new replies.
Skip to toolbar