PHP error: Array to string conversion

#1377
  • Resolved nyssa1
    Rank Math free

    I’m getting a constant error which appears to be generated by bots hitting my archives:

    Array to string conversion in [redacted]/wp-includes/functions.php on line 110

    I tried to trace when the error occurs; I saw results such as below:

    (
    [public_query_vars] => Array
    (
    [0] => m
    [1] => p
    [2] => posts
    [3] => w
    [4] => cat
    [5] => withcomments
    [6] => withoutcomments
    [7] => s
    [8] => search
    [9] => exact
    [10] => sentence
    [11] => calendar
    [12] => page
    [13] => paged
    [14] => more
    [15] => tb
    [16] => pb
    [17] => author
    [18] => order
    [19] => orderby
    [20] => year
    [21] => monthnum
    [22] => day
    [23] => hour
    [24] => minute
    [25] => second
    [26] => name
    [27] => category_name
    [28] => tag
    [29] => feed
    [30] => author_name
    [31] => static
    [32] => pagename
    [33] => page_id
    [34] => error
    [35] => attachment
    [36] => attachment_id
    [37] => subpost
    [38] => subpost_id
    [39] => preview
    [40] => robots
    [41] => taxonomy
    [42] => term
    [43] => cpage
    [44] => post_type
    [45] => embed
    [46] => post_format
    [47] => sitemap
    [48] => sitemap_n
    [49] => xsl
    [50] => rest_route
    [51] => link_library_category
    [52] => link_library_tags
    [53] => cat_name
    [54] => qppr-file-type
    )

    [private_query_vars] => Array
    (
    [0] => offset
    [1] => posts_per_page
    [2] => posts_per_archive_page
    [3] => showposts
    [4] => nopaging
    [5] => post_type
    [6] => post_status
    [7] => category__in
    [8] => category__not_in
    [9] => category__and
    [10] => tag__in
    [11] => tag__not_in
    [12] => tag__and
    [13] => tag_slug__in
    [14] => tag_slug__and
    [15] => tag_id
    [16] => post_mime_type
    [17] => perm
    [18] => comments_per_page
    [19] => post__in
    [20] => post__not_in
    [21] => post_parent
    [22] => post_parent__in
    [23] => post_parent__not_in
    [24] => title
    [25] => fields
    )

    [extra_query_vars] => Array
    (
    )

    [query_vars] => Array
    (
    [paged] => 4
    [year] => 2013
    [monthnum] => 07
    )

    [query_string] => paged=4&year=2013&monthnum=07
    [request] => 2013/07/page/4
    [matched_rule] => ([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$
    [matched_query] => year=2013&monthnum=07&paged=4
    [did_permalink] => 1
    )

    • This topic was modified 5 years, 9 months ago by nyssa1.
Viewing 15 replies - 1 through 15 (of 25 total)
  • Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    I am not sure if Rank Math is the cause of this error. Do you see this error on the frontend? You can check the source of the error by setting WP_DEBUG to true in wp-config.php file in your root directory.

    If you see the error on frontend then please share a link of the page in the Sensitive Data Section.

    Looking forward to helping you. Thank you.

    nyssa1
    Rank Math free

    The error in my debug file is Array to string conversion in /[redacted]/main/wp-includes/functions.php on line 110

    I submitted a sample of what my oik-bwtrace plugin captured when some of these errors came in. From what I can see, a bot hits my site and there is some kind of trouble with the date/time. It only shows up in the debug file; I don’t see anything going on with the site itself.

    Hello,

    I don’t see any reference to the Rank Math plugin in the error info you added in the Sensitive Data Section.

    Also, if Google bot encounters any errors while crawling the site, then those errors are added in the Crawl errors sections. Do you see any Crawl errors in the Google Search Console?

    Looking forward to helping you. Thank you.

    nyssa1
    Rank Math free

    I don’t see any crawl errors that would apply to this. Basically, 404 errors when a page no longer exists.

    I thought it was Rank Math because it controls the archives and this happens when bots hit the archives. What could it be, then? Theme? Some other plugin? Core?

    Hello,

    Thank you for contacting Rank Math today.

    You mentioned in an earlier comment that the error is referencing your theme’s functions.php file (/[redacted]/main/wp-includes/functions.php on line 110) which could mean that the conflict is arising from your theme.
    I would suggest that you temporarily switch to one of the stock WP themes and check if the issue is still reproduced.

    Looking forward to helping you. Thank you.

    ​​​​​​

    Hello,

    Thank you for contacting Rank Math today.

    You mentioned in an earlier comment that the error is referencing your theme’s functions.php file (/[redacted]/main/wp-includes/functions.php on line 110) which could mean that the conflict is arising from your theme.
    I would suggest that you temporarily switch to one of the stock WP themes and check if the issue is still reproduced.

    Looking forward to helping you. Thank you.

    ​​​​​​

    nyssa1
    Rank Math free

    I got the same error on all my themes, including the default 2019.

    Hello,

    Thank you for the follow up.

    Would you mind sharing some temporary wp-admin and FTP access to your site so that I can be able to help further? You can do this by editing the sensitive data area and adding the username and password along with your site URL.

    Looking forward to helping you. Thank you.

    ​​​​​​

    nyssa1
    Rank Math free

    I’d like to use the Temp Login Without Password plugin; looks like I need an e-mail to set up access. Which one should I use?

    Hello,

    Thank you for contacting Rank Math today.

    You can use this email address s******@m************** but please remember to share some FTP access as well in the sensitive data section since this is not covered in the Temporary login without password plugin access.

    Looking forward to helping you. Thank you.

    ​​​​​​

    nyssa1
    Rank Math free

    Okay, I put them in the sensitive data.

    I also want to note the research I did last night: I spent last night testing each plugin–I got those array errors every 1 to 15 minutes. Then I turned off Rank Math for half an hour, and they stopped. I turned it back on and they started up again, every 1 – 15 minutes.

    I tried FTP’ing two fresh versions of the named functions file (first an earlier version, then the new one), but no change. I also tried deleting Rank Math and tables, then re-installing, but got the same errors.

    The problem started when Rank Math updated on 3-13, so I tried rolling back to a previous version, but that didn’t fix it, either. This is also odd because I have two Classic Press installations with similar setups, but only one has this problem.

    Hello,

    I see the errors in the debug.log file of your site, although I don’t think those errors are caused during crawling. Like I mentioned before, if Google bot encounters any error when crawling then those errors are shown in the Crawl errors section.

    Something else is causing this problem which I am not sure what it is. Can you create a staging environment and see if the same errors occur their too?

    Looking forward to helping you. Thank you.

    nyssa1
    Rank Math free

    Okay, I have set up a staging environment and will wait to see what comes up.

    nyssa1
    Rank Math free

    The staging environment, after running for hours, shows zero errors.

    Meanwhile, I’ve tried everything–repeatedly deleting and re-installing Rank Math, fresh Rank Math and core files via FTP, rolling back to previous versions, testing other plugins–Nothing is getting rid of the errors. And they only come when Rank Math is active. None of the other plugins have any effect.

    It’s especially frustrating because I like this plugin–it’s doing great things for my SEO–and I don’t want to turn it off. It also does not appear to be affecting the functioning of the site. But the errors are clogging up my debug file.

    Could something be in the database making this happen? I’ve noticed that I can’t fully remove the plugin; when I re-install, it always “remembers” me, even though I try to delete it from my tables.

    • This reply was modified 5 years, 9 months ago by nyssa1.

    Hello,

    The conversion error is just a warning which will not affect anything on your site. Having said so, it should be addressed, but sadly the issue is specific to your site and we could not reproduce it on our setup even with all the theme and plugins which are active on your site.

    To remove Rank Math data completely, please add below filter code to your theme’s functions.php file and then uninstall the plugin:

    
    add_filter( 'rank_math_clear_data_on_uninstall', '__return_true' );
    

    That will remove all the data added by Rank Math. You can then check with the fresh installation of Rank Math.

    Hope that helps. 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 15 replies - 1 through 15 (of 25 total)

The ticket ‘PHP error: Array to string conversion’ is closed to new replies.