WCP OpenWeather breaks WP Smush Pro

If the WCP OpenWeather plugin is active on the site, bulk smush cannot be run. The Smush button doesn't do anything and there are "undefined" JS errors in a browser console. Switching off the plugin solves the issue.

  • Katya Tsihotska

    Hi Boris Pavlekovic

    Hope you're fine today!

    This issue has been flagged for our SLS Team (code experts) so that they can dig into this issue further for you. An update will be posted here as soon as more information is available. Thank you for your patience while we sort through this issue.

    Just in case, could you also contact the WCP OpenWeather plugin's support team in order if they can suggest a solution for this issue?
    https://wordpress.org/support/plugin/wcp-openweather

    Kind regards,
    Katya

  • Panos

    Hi there Boris Pavlekovic ,

    It seems that the opc openweather plugin is adding some scripts in that page which causes these js errors.

    As Katya suggested you can contact the opc-openweather support regarding this.

    For now you can try following snippet in a mu-plugin which should be doing the trick:

    add_action( 'admin_footer', function(){
    
    	$screen = get_current_screen();
    
    	if( 'media_page_wp-smush-bulk' != $screen->id ){
    		return;
    	}
    
    	global $wp_filter;
    
    	if( isset( $wp_filter['admin_footer'] ) && $wp_filter['admin_footer'] instanceof WP_Hook ){
    		$admin_filters = $wp_filter['admin_footer'];
    		if( isset( $admin_filters->callbacks ) ){
    
    			foreach( $admin_filters->callbacks as $c_key_wrap => $callback ){
    
    				foreach( $callback as $c_key => $callback_opts ){
    					if ( strpos( $c_key, 'createConstructorForm' ) !== false) {
    						unset( $wp_filter['admin_footer']->callbacks[$c_key_wrap][$c_key] );
    					}
    				}
    
    			}
    		}
    	}
    
    }, 0 );

    Hope this helps :slight_smile:

    Cheers!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.