• Resolved infinitejake

    (@infinitejake)


    While looking through the error logs today due to an issue with our checkout process not working or working but being incredibly slow I noticed that we are getting this error reported twice a second every second:

    PHP Warning:  array_flip(): Can only flip STRING and INTEGER values! in /home/infin240/public_html/wp-content/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-posts-controller.php on line 512

    It seems like this might have to do with the REST API being discontinued. I activated the new REST API plugin and the error continues twice every second. Any assistance in figuring this out would be greatly appreciate. I am relatively new to WooCommerce and I see a lot of changes happening as version 9 is getting closer. Would love to get this figured out before even more changes!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support omarfpg a11n

    (@omarfpg)

    Hi @infinitejake,

    This is unusual and it may mean something else is interferring with your set up. I see you had a couple of support requests open about this: 8229657, and 8274336. As mentioned in one over tickets, this most likely is related to a plugin conflict. I see there are 51 active plugins on your site.

    Can you please run a conflict test to determine if one of those plugins is interfering?

    To test, you’ll first want to change the theme on your site to Storefront, then check to see if the issue is still present. If that resolves the issue, you’ll want to get in touch with your theme’s developer and see if they have an update or fix for you.

    If changing the theme doesn’t help, you’ll want to deactivate all plugins except for WooCommerce and take a look. If that fixes the problem, re-enable the other plugins one by one (gradually), checking after each to see where the issue is coming from.

    Some important considerations
    — Be sure you have a good backup in place of your full site and database. You can ask your host for backup functionality, or you can consider using a service like Jetpack. If something goes wrong, you will be able to restore it.

    — Also, you can consider using a plugin like Health Check & Troubleshooting. This is a plugin developed by the WordPress community, and it is helpful to disable plugins without affecting your current site visitors.

    — It is also important to consider staging functionality in case you would not like to touch your production site (you can ask your host if they offer this service), or you can use WP Staging to spin up a new test site quickly.

    You can find more about this in this guide.

    Please let us know about your findings.

    PS: We just released WooCommerce 9.0 earlier today!

    Cheers!
    -OP

    Thread Starter infinitejake

    (@infinitejake)

    The issue we are running into is that, yes we have a ton of plugins on the site which I am working to remove unnecessary ones, but we have an active site that has users on it at most times so switching to a theme that doesn’t work for us and disabling all of the plugins would be bad. The issue is not happening on our staging site either so that doesn’t help.

    I looked into the Health Check plugin but there are a ton of reviews saying that it completely ruins websites to the point that they need to be restored from a backup. A plugin like health check would be amazing but I’m not finding any other good ones either.

    Plugin Support Shameem – a11n

    (@shameemreza)

    Hi @infinitejake

    When dealing with a live site, it’s indeed challenging to troubleshoot without causing potential disruptions. However, it’s important to isolate the issue to be able to resolve it effectively.

    Given your concerns about the Health Check plugin, another approach could be to create a clone of your site and troubleshoot on the cloned version. This way, your live site remains unaffected. More info: https://woocommerce.com/posts/what-is-staging-site-wordpress-how-to-set-one-up/

    Once you have a cloned site, you can safely run the conflict test, as suggested earlier. If the issue doesn’t appear on the cloned site, it could be related to server-specific issues, and you may need to get in touch with your hosting provider.

    As for the REST API error, it’s unlikely related to the API being discontinued. Instead, it’s more likely due to how a specific plugin or theme is interacting with the API. Hence, the conflict test should help identify the source of this issue.

    Looking forward to hearing from you soon.

    Thread Starter infinitejake

    (@infinitejake)

    Hello @shameemreza,

    Sorry for the delay but I cloned our entire site and have been using it for the past 4-5 days and the error is not showing up at all so I’m still unsure how to tackle this without disabling the live plugins on production. I turned the theme off on our cloned site too and none of the ecommerce stuff works so

    A: I’m worried the error will stop anyway since no one can do anything on the website
    B: I can’t test any of this on the cloned site since the error isn’t happening
    C: We can’t even put up a screen saying we are working on things since we apparently need people using the site to trigger the error.

    Any other ideas on how to figure this out?

    Plugin Support Shameem – a11n

    (@shameemreza)

    Hi @infinitejake

    It’s great to hear that you’ve cloned your site for testing, but it’s indeed puzzling that the error isn’t showing up on the cloned site. This suggests that the issue could be related to your hosting environment or a specific setting on your live site.

    Here are a few additional steps you could take:

    1. Check for differences between your live and cloned site’s server environments, including PHP versions and server configurations.
    2. Keep monitoring the error logs on your live site. If the error is still occurring, it might give us a clue about what’s causing it.
    3. If possible, consider performing the conflict test during off-peak hours. While not ideal, it could help identify the problematic plugin or theme without affecting too many users.
    4. Since the issue isn’t replicating on the cloned site, it might be worthwhile to get in touch with your hosting provider. They might be able to provide insights or detect issues on their end.

    Remember, it’s crucial to have a recent backup of your site before making any changes.

    Additionally, are you still experiencing this error with the latest version of WooCommerce? Have you updated all your plugins and theme? Can you head over to WooCommerce → Status → Tools, and do the following:

    • WooCommerce transients – Clear
    • Expired transients – Clear
    • Clear template cache – Clear
    • Capabilities – Reset Capabilities
    • Clear customer sessions -Clear

    Please let us know how these steps work out, or if you have any other questions. We’re here to help!

    Plugin Support omarfpg a11n

    (@omarfpg)

    Hi there 👋 ,

    We haven’t heard from you in a while; this is to check if you’ve been able to proceed with the troubleshooting steps provided before and if you still need help.

    Thanks!
    -OP

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

The topic ‘Constant array_flip() Error in Error Logs’ is closed to new replies.