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, 1 month ago by nyssa1.
Viewing 10 replies - 16 through 25 (of 25 total)
  • nyssa1
    Rank Math free

    Thanks! Unfortunately, that didn’t fix it, either.

    Hello,

    The filter code I gave you is to remove all Rank Math data on uninstallation. Using that filter you can remove all the data added by the Rank Math plugin and then you can activate the plugin again.

    Hope that helps. Thank you.

    nyssa1
    Rank Math free

    After a lot of time spent investigating and tweaking and deleting caches and FTPing fresh files and cleaning out my htaccess file and trying to figure out what’s going on–

    I can’t get a proper stack trace for some reason, *but* I’ve been able to track down that it only happens when a visitor hits a date archive page with the format year/month/date (https://nyssashobbithole.com/main/2012/03/12/) . So far I don’t see the error produced when a bot hits a monthly archive. It also does not occur for, say, page 2 (https://nyssashobbithole.com/main/2018/07/page/2/).

    I turned on Wordfence’s Live Traffic and was able to verify that the error DOES NOT OCCUR when Rank Math is shut off, even though the bots still check the date archive pages. When I turn Rank Math back on, the error starts to occur again.

    I opened up one such page with Chrome developer tools; this caused the same error in my debug file, but I couldn’t find an error in my browser connected to it. I don’t know if there’s some particular setting I need to turn on to find it.

    • This reply was modified 5 years ago by nyssa1.

    Hello,

    I opened up one such page with Chrome developer tools; this caused the same error in my debug file, but I couldn’t find an error in my browser connected to it. I don’t know if there’s some particular setting I need to turn on to find it.

    Can you please add link of the archive page and error detail you see in the Sensitive Data Section? You can also remove the existing error information from the Sensitive Data Section as it would be irrelevant now.

    Looking forward to helping you. Thank you.

    nyssa1
    Rank Math free

    Okay, I updated the sensitive data.

    nyssa1
    Rank Math free

    I just discovered that I can also make the same error happen on my other site as well. Apparently the bots haven’t been visiting the date archives there.

    I discovered that when Rank Math is turned on, it changes the Title Tag. For example, instead of “September 30, 2013 – Nyssa’s Hobbit Hole” it reads, “PMMon, 30 Sep 2013 15:44:45 +0000Mon, 30 Sep 2013 15:44:45 +0000pm13 – Nyssa’s Hobbit Hole”

    Both sites are running on ClassicPress v 1.0.1.

    When I go into Titles and Meta and change the setting for Date Archives, removing the date from the title tag, the error goes away.

    • This reply was modified 5 years ago by nyssa1.
    • This reply was modified 5 years ago by nyssa1.
    • This reply was modified 5 years ago by nyssa1.

    Hello,

    Can you please add your site’s login details in the Sensitive Data Section?

    Looking forward to helping you. Thank you.

    nyssa1
    Rank Math free

    Updated.

    Hello,

    Can you also add your site’s FTP details in the Sensitive Data Section so we could try changing some code?

    Looking forward to helping you. Thank you.

    nyssa1
    Rank Math free

    Okay, updated.

    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 10 replies - 16 through 25 (of 25 total)

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