php error message

#699155
  • Resolved Anonymous
    Rank Math free

    Hi, I’m using the latest version of the free version 1.0.208.1. I have this error message appearing on a page : Warning : Array to string conversion in /home/customer/www/***.com/public_html/wp-content/plugins/seo-by-rank-math/includes/opengraph/class-image.php on line 606.

    It seems to be displayed only on one page, which is a cpt archive from ACF. In Rank Math Titles & Meta settings, I have an image set for the Opengraph Thumbnail.

    Could you help resolve the issue ?
    Regards,
    Patrick.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hello,

    I apologize for the inconvenience you’re experiencing with the error message on your website. The warning message you’re seeing is likely due to a conflict with another plugin or theme.

    To resolve this issue, I recommend following these steps:

    1. Deactivate all your plugins and reactivate them one by one to identify the one causing the warning message.
    2. If the issue persists, you can reach out to the support team of the plugin or theme that’s causing the conflict for further assistance.

    If the problem persists after following these steps, please feel free to reply to this ticket, and a human agent from the Rank Math support team will be able to provide you with more specific guidance based on your website’s configuration.

    Thank you for bringing this to our attention, and we appreciate your patience as we work to resolve this issue for you.

    Best regards.

    Sources:
    How to Fix Undefined Offset: 0 Warning » Rank Math
    How to Fix the ‘og: image’ Property Should Be Explicitly Provided » Rank Math
    Fatal Error Happening on Some Installations After 1.0.49 Update » Rank Math

    Anonymous
    Rank Math free

    Hi,

    Thank you for the reply and the links, unfortunately, nothing resolved the issue.
    Regards,
    Patrick.

    Anonymous
    Rank Math free

    Update on this.
    When I switch to php version 7.4.33, the problem goes away. As soon as I set a php 8.* version, the problem occurs.
    Thanks,
    Patrick.

    Hello,

    Thank you for your patience.

    This happens when the archive page is not able to fetch the image from the first post/product of that archive to set it as the og:image.

    Please make sure that the custom post type on your website has a thumbnail image under WordPress Dashboard > Rank Math > Titles & Meta > CPT > Thumbnail Fo Facebook to get rid of this warning.

    Let us know how this goes.

    Anonymous
    Rank Math free

    Hello and thank you for your reply.

    I’ve added a custom image for the CPT as per your advice, which wasn’t set. I’ve tried with php version 8.0.30, 8.1.26 and 8.2.13 and unfortunately, I still have the error message, even after purging the cache.
    For now, I reverted to php version 7.4.33, though I will need to switch to a 8.* version as I have a plugin which won’t support php v7.* any time soon.

    Any help will be much appreciated.
    Best regards,
    Patrick.

    Hello,

    Please try to use the following filter on your website and see if that works for you:

    add_filter( 'rank_math/opengraph/pre_set_content_image', function( $return ) {
        $url = home_url( $_SERVER['REQUEST_URI'] );
        if( (strpos($url,'your_page_slug_here') !== false) ) // replace with your actual page slug
        {
            return true; 
        }
    });
    

    Make sure to replace the your_page_slug_here with your actual affected page slug.

    Here’s how you can add filter/hook to your WordPress site: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Let us know how it goes. Looking forward to helping you.

    Thank you.

    Anonymous
    Rank Math free

    Hello and thank you for your reply and code.

    I’ve tried two different places for the code, in a plugin and in the functions.php file, and unfortunately I get the same error message.
    I will create a page instead of using the archives directly generated from ACF to see if it could resolve the issue. I’ll let you know how it goes in a few days.
    Thank you for your time on this.

    Best regards,
    Patrick.

    Anonymous
    Rank Math free

    Update.

    I actually have created a test page with the same content inside. Changing to php v8.1.26 shows no error this time, though the page is set to noindex. I am not ready to mess up with the sitemap yet so I’ll let the page like this, but I suspect this is a problem with the archive option from ACF.

    If you want to do your own test to replicate this, this is my setup : a cpt created with acf, the archive option is ticked. A template in Bricks Builder to be displayed with the archive. The template is a simple query loop for the posts from the cpt.

    Best regards,
    Patrick.

    Hello,

    Can you please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section so that we can check the issue further for you?

    Please do take a complete backup of your website before sharing the information with us.

    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    Looking forward to helping you.

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 9 replies - 1 through 9 (of 9 total)

The ticket ‘php error message’ is closed to new replies.