https, breaks theme
-
Once we configured our SSL cert. we Set “Force SSL” and
visited the store, added a product to the cart, then proceeded to checkout. That’s when we get this error:
“Fatal error: Cannot use object of type WP_Error as array in /home/rehadden1957/contentedcows.com/content/wp-content/themes/madrid/library/includes/wp-image.php on line 465Code from that Theme file:
$base_url = wp_upload_dir();
$url = str_replace($base_url[‘baseurl’],$base_url[‘basedir’],$image_url[0]);
$image = wp_get_image_editor($url );
if ( ! is_wp_error( $image ) ) {if( !file_exists($image->generate_filename($width .’x’ . $height))){
$image->resize($width, $height, $crop);
$image->set_quality(80);
$saved_file = $image->save();
[here is line 465] $new_image_url = str_replace($base_url[‘basedir’],$base_url[‘baseurl’],$saved_file[‘path’] );}else {
$new_image_url = str_replace($base_url[‘basedir’],$base_url[‘baseurl’], $image->generate_filename($width .’x’ . $height) );
}
if($retina){
return array($new_image_url, $width/2, $height/2,$retina);}else{
return array($new_image_url, $width, $height,$retina);
}https://www.contentedcows.com/content/store/
https://www.contentedcows.com/content/cart/
https://www.contentedcows.com/content/checkout/Have you run into this before? Suggestions?
- The topic ‘https, breaks theme’ is closed to new replies.