• Dear Open Graph team,

    After reviewing all the comments here I can see the theme is the same, anytime there is an update there seems to be PHP errors.
    Our site is the same, we have been going back and forth with the server provider for 3 days now but they cant find a solution. They said the only way to solve this issue is to reach out to you. Judging by the lack of responses on other questions for the same issue I’m not sure that this will ever be resolved but here is the error anyway:

    : getimagesize (): Filename cannot be empty in /xxx/xxxxxx/xxxxxx/wp-content/plugins/wp-open-graph/output.class.php on line 306

    I will wait for a few more days, if this is not possible to resolve we will have to, unfortunately, find a replacement plugin. Please do let me know if you can assist,

    -R

Viewing 2 replies - 1 through 2 (of 2 total)
  • Try this.

    Edit file wp-content/plugins/wp-open-graph/output.class.php

    Change from

        protected function get_image_size_tags( $image_thumb_src ) {
    
            $image_path = $image_thumb_src;
    
            if ( true == empty( $image_thumb_src ) ) {
                $post = get_queried_object();
                //$image_thumb_src = wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) );
                //$image_path      = get_option( 'wpog_options', 'image' );
    
                if ( preg_match( '/<img [^>]+>/', $post->post_content, $match ) ) {
                    if ( preg_match( '/src=([\"\'])(.*?)\1/', $match[0], $source ) ) {
                        $image_path = trim( str_replace( "src=", "", $source[0] ), '\"\'' );
                    } else {
                        $image_path = '';
                    }
                } else {
                    $image_path = NY_OG_Main_Admin::option( 'image' );
                }
            }
    
            $size = getimagesize( $image_path );
    
            return array( 'path' => $image_path, 'size' => $size );
        }
    

    to

    
        protected function get_image_size_tags( $image_thumb_src ) {
    
            $image_path = $image_thumb_src;
    
                $post = get_queried_object();
                //$image_thumb_src = wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) );
                //$image_path      = get_option( 'wpog_options', 'image' );
    
                if ( preg_match( '/<img [^>]+>/', $post->post_content, $match ) ) {
                    if ( preg_match( '/src=([\"\'])(.*?)\1/', $match[0], $source ) ) {
                        $image_path = trim( str_replace( "src=", "", $source[0] ), '\"\'' );
                    } else {
                        $image_path = '';
                    }
                } else {
                    $image_path = NY_OG_Main_Admin::option( 'image' );
                }
    
            $size = getimagesize( $image_path );
    
            return array( 'path' => $image_path, 'size' => $size );
        }
    

    Hello Rage_zi,

    I had the same issue today and found the following solution

    ERROR shown on my pages and posts
    : getimagesize (): Filename cannot be empty in /xxx/xxxxxx/xxxxxx/wp-content/plugins/wp-open-graph/output.class.php on line 306

    SOLUTION
    1: Go to SETTINGS >> WP OPEN GRAPH
    2: Make sure you have a link put in the three image fields. Also when adding links in the fields provided make sure to use https:// and not https:// or you will get another error like 403 access denied

    All the best,
    JohnO

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Not compatible with latest wp? PHP’ is closed to new replies.