PluginProbe
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization / trunk
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization vtrunk
4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 2.5.5 2.5.6 2.5.7 3.0.0 3.0.1 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.11.0 3.11.1 3.11.2 3.11.3 3.12.0 All 135 releases
← All changes | inc/rest.php +1 -1 4.2.11 → trunk View file →
@@ -708,9 +708,9 @@
708 708 public function poll_optimized_images( WP_REST_Request $request ) {
709 709 $api_key = $request->get_param( 'api_key' );
710 710 $request = new Optml_Api();
711 711 $images = $request->get_optimized_images( $api_key );
712 - if ( ! isset( $images['list'] ) || empty( $images['list'] ) ) {
712 + if ( is_wp_error( $images ) || ! is_array( $images ) || empty( $images['list'] ) ) {
713 713 return $this->response( [] );
714 714 }
715 715
716 716 $final_images = array_splice( $images['list'], 0, 10 );