PHP Fatal error when attempting resize new image format


I’ve installed Smush Pro and Optimize Images Resizing for custom image formats:

When uploading a new image and attempting to load a new image resize format on the front-end of my theme the plugin generates a PHP error on the first try. If I refresh the page after that the image has been resized properly and the error is no longer there.

Here is the stack trace for the error:

2017/09/01 13:25:16 [error] 18997#0: *19195511 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught Error: Call to undefined function get_current_screen() in /home/motor/domains/

Stack trace:

#0 /home/motor/domains/ WpSmushResize->initialize(true)

#1 /home/motor/domains/ WpSmush->smush_image(Array, 3972)

#2 /home/motor/domains/ WP_Hook->apply_filters(Array, Array)

#3 /home/motor/domains/ apply_filters(‘wp_update_attac…’, Array, 3972)

#4 /home/motor/domains/ wp_update_attachment_metadata(3972, Array)

#5 /home/motor/domains/” while reading upstream, client:, server:, request: “GET / HTTP/1.1”, upstream: “fastcgi://unix:disappointed:usr/local/php70/sockets/motor.sock:”, host: “”, referrer: “”