mailchimp / mc-woocommerce

MailChimp for Woocommerce Integration. Syncs all data (subscriber, customers, orders, products) and enables marketing automation with email campaigns, automations, ads, postcards and more.
https://wordpress.org/plugins/mailchimp-for-woocommerce/
GNU General Public License v2.0
82 stars 66 forks source link

performance issues - access log is full of post requests to admin.ajax #158

Closed khungate-zz closed 6 years ago

khungate-zz commented 6 years ago

The access logs will almost always contain a good number of post requests, as it is the way the current queue processes jobs. In isolated cases when there may have been too many events in the queue table at once; and it may be a temporary hiccup while the server is processing everything. One possible fix would be to manually flush the queue table in phpMyAdmin to see if the problem persists.

Another more technical option would be to use the WP-CLI version of the queue and running a daemon process. That way, you will be able to run the command in the CLI version of "wp queue listen" to make sure it's working as planned before setting a background process. Also, the CLI version runs quietly in the background to handle jobs through a different pipeline. If you go this route, you'll want to add the following to your config.php file:

To use the command line version of this plugin - you have a couple options. Both of them require to first add a constant in your config file.

  1. define('DISABLE_WP_HTTP_WORKER', true);

  2. (real) cron job option ( WP_CRON is NOT compatible ):

* * * * * /usr/bin/wp --url=http://yourdomain.com --path=/full/path/to/install/ queue listen

  1. Process manager option will be to make sure that the call below is always being monitored. You can also use the same format as above if running on :

    /usr/bin/wp --url=http://yourdomain.com --path=/full/path/to/install/ queue listen

f3bruary commented 6 years ago

I have this issue since yesterday. Is this the only fix ?

khungate-zz commented 6 years ago

@f3bruary this is the recommended method for larger stores or for situations where there are sync issues. Also, in our next milestone, #201 helps with several queue optimizations. You're welcome to try out the staging branch that includes these updates. Please be advised to take recommended steps to backup your site if you decide to use that version. We hope to officially rollout 2.1.5 very soon.

f3bruary commented 6 years ago

Does it need to run every minute like in the example above ? Siteground doesn't allow it apparently. Needs to be every 30 minutes at the most.

I'm running 2.1.5 right now and still seem to have issues.

ryanhungate commented 6 years ago

@f3bruary no the cron does not need to be every minute but there would be a possibility that things might not be running sometimes in the event that the process was halted - which is the reason we suggest the every minute cron. It checks to make sure the process is running - if it isn't it starts it again.

What WooCommerce version are you on? Have you checked your queue table to see if there was a lot of records in there?

The queue records may need to be flushed before you start the resync process. Have you enabled your logs for the MailChimp plugin yet?

Any chance you could check those first and post something back?

f3bruary commented 6 years ago

@ryanhungate I'm using WC 3.3.3

The queue table only has one entry and it's for the mailchimp-for-woocommerce plugin.

The failed_jobs table however, has almost 25K entries, all for the mailchimp-for-woocommerce.

I have disabled the plugin for now, cause the whole site becomes unresponsive when it's active. I also can't disable it. I have to SSH in and manually rename/move the plugin in order to deactivate it.

f3bruary commented 6 years ago

Ok, I think I got something interesting.

I cleared the failed_jobs table and activated the plugin again. Site got slow again and I checked the debug logs. I got a lot of these errors:

2018-03-24T20:12:46+00:00 ERROR order_submit.error :: addStoreOrder :: 22192 :: <p>customer.email_address: An email address is required to create a customer.</p> on 1310 in /home/user/public_html/wp-content/plugins/mailchimp-for-woocommerce/includes/api/class-mailchimp-api.php

And I think I know why. I also use a Point of Sale plugin because I have a brick&mortar store as well. This plugin creates orders for the offline sales which don't have an email addresses.

Maybe a check can be placed that can skip these kinds of orders ?

ryanhungate commented 6 years ago

@f3bruary so the site being slow is probably just due to the fact you're syncing historical orders and customers and products in your store during the initial install/activation process. That should eventually calm down once you're fully synced and then will be business as usual where it's just 'live activity' happening.

What type of server are you running the site with? Is it a shared host, or is this your own server that you control the resources on?

The POS plugin - yes that would actually make sense as to how it's creating invalid customers - and you're right that should be stopped before the submission ever tries to go through - I can tell that's an error coming through the MailChimp API. We will look into a patch for this because it's hitting the API for no reason when we could at least do a pre-check on a valid email address, but the reality is it would still generate the same log because we're trying to tell you 'this order does not have a valid email' and want you to know why it didn't make it over to MailChimp.

Just so we know - after you re-installed the plugin and let it run, has it finished yet? Any improvements on the site speed? Are you running the command line version of the queue or just using the defaults? Is this a very busy store? Would be nice to know a few metrics on what you're currently doing so we can give some advice.

f3bruary commented 6 years ago

It's a shared hosting environment at Siteground (GoGeek package).

I'm not sure it is indeed caused by the initial install, because it first occurred randomly after having used the plugin for several months (perhaps a year).

Last time I enabled the plugin I'm not sure it finished syncing. I disabled the command line feature that's mentioned above. I thought 2.1.5 maybe fixed it. I also tried with the command line queue, but like I said earlier Siteground might have prevented the cronjob from running cause it doesn't allow *. Has to be twice an hour at most, but I don't know if that's gonna cause other issues with other plugins.

It's not a very busy store, but to prevent people from leaving I'll have to test the plugin late at night. I'll see if I can do that tonight.

themanchev commented 6 years ago

Hello,

I am trying to sync my store since last summer but it won't work. As of now there are 222products/2.1k orders and after all the products sync the process stops and not even a single order will pass. What could be causing this? I've updated to 2.1.5 and still nothing happens, my woocommerce status in in Bulgarian but I can post it if it will help.

In case I have to do the via WP-CLI where exactly do I paste the code and everything? (kind of really low tech knowledge).

Thank you!

hasanhalabi commented 6 years ago

Hello,

I have a store hosted on WordPress.com, the first time I tried to connect the store was on April 11th, 2018, but with no luck. No products or orders have been synced.

I tried today another time with no luck too. I enabled the logs in debug mode since last time, but it totally empty! And on WordPress.com we don't have direct access to the database. So what we could do?

image image

f3bruary commented 6 years ago

I deleted the plugin and disconnected the store from mailchimp. Then re-installed it and set it up. It seems to be working better now. It synced 9 products (I have a few hundred), and then it just moved on to syncing coupons. BTW, is this really necessary ? I've got over 1000 coupons, and I don't see why they need to be synced with mailchimp.

Anyways, I'll keep you posted on the progress.

NiftyMaker commented 6 years ago

Uninstalling the plugin didn't work for me... I have a question regarding the suggested cron job: * * * * * /usr/bin/wp --url=http://yourdomain.com --path=/full/path/to/install/ queue listen where path should be the path in my hosting up to the mailchimp plugin? Something like --path=/whatever/wp-content/plugins/mailchimp-for-woocommerce

is that ok?

ghost commented 6 years ago

my plugin also not working. any expert who can guide me

how to define this cron job in cpanel ?

Thanks in advance,

entreprenny commented 6 years ago

@khungate Another case here of being unable to complete my initial customer/order sync. I keep hitting server limits which eventually causes the plugin to stop the sync. (~40 products ~5,500 orders)

The website is hosted with SiteGround on a shared server, just as others have mentioned. I spoke with SG support & they temporarily doubled my account limits, but I still cannot get the plugin to sync more than 1/4th of my store.

PLEASE post step-by-step instructions on how to implement this WP-CLI fix!

If there's a possibility that this can help all of us, why the heck wouldn't you publish a detailed instruction document, rather than commenting on a GitHub post and providing information only a database/coding expert would comprehend..?

C'mon MailChimp... You're better than this...

ryanhungate commented 6 years ago

@entreprenny sorry to hear you're having issues with your host machine - I would like to know more about that if at all possible. What exactly did SitePoint have to 'double' for you? Memory? CPU? Script timeouts? Did they provide you with the error on why this just could not complete? Typically what would happen is it would try it again on its own. I would like to know more about your 'failed_jobs' table and what's currently in your 'queue' table too.

We apologize for the confusion and will work on providing a better 'how-to' for the WP CLI configuration - but it's quite simple really.

If you have WP CLI installed on your server - you would just need to do this - anywhere you define your constants ( typically wp-config.php ) define('DISABLE_WP_HTTP_WORKER', true);

Then in the command line run: wp queue listen It will start processing things right away and you'll actually see feedback in the command line. To automate this - you would either set up a cron job - or use a process manager.

  1. Use a process manager like monit, or supervisord etc. to keep this wp queue listen command running at all times.
  2. Set up a cron schedule to run it every minute - like: * * * * * /path/to/wp_cron --url=http://yourdomain.com --path=/path/to/domain/ queue listen

Let us know if that helps you get set up. The other thing I wanted to point out is that it could just be the initial sync that's causing too much load on the server - but once it completes - you could probably use the standard queue system. Maybe just to keep it simple - you could run wp queue listen manually to get your sync done - and then let it do what it normally does after it's complete? Just an idea so you don't have to force yourself into a process monitor or a cron schedule if you don't have to. Also - if you go that route - just make sure to remove the constant DISABLE_WP_HTTP_WORKER so the normal queue picks up again.

Hope this helps a little!

ghost commented 6 years ago

there is no error even on wp-admin debugger it says started and nothing come after that here is command that i am using [cid:5b7150a4-2700-4d73-9abc-e2b2671efdb5]


From: Ryan Hungate notifications@github.com Sent: Monday, May 21, 2018 3:36 AM To: mailchimp/mc-woocommerce Cc: saadrashad; Comment Subject: Re: [mailchimp/mc-woocommerce] performance issues - access log is full of post requests to admin.ajax (#158)

@entreprennyhttps://github.com/entreprenny sorry to hear you're having issues with your host machine - I would like to know more about that if at all possible. What exactly did SitePoint have to 'double' for you? Memory? CPU? Script timeouts? Did they provide you with the error on why this just could not complete? Typically what would happen is it would try it again on its own. I would like to know more about your 'failed_jobs' table and what's currently in your 'queue' table too.

We apologize for the confusion and will work on providing a better 'how-to' for the WP CLI configuration - but it's quite simple really.

If you have WP CLI installed on your server - you would just need to do this - anywhere you define your constants ( typically wp-config.php ) define('DISABLE_WP_HTTP_WORKER', true);

Then in the command line run: wp queue listen It will start processing things right away and you'll actually see feedback in the command line. To automate this - you would either set up a cron job - or use a process manager.

  1. Use a process manager like monit, or supervisord etc. to keep this wp queue listen command running at all times.
  2. Set up a cron schedule to run it every minute - like:

Let us know if that helps you get set up. The other thing I wanted to point out is that it could just be the initial sync that's causing too much load on the server - but once it completes - you could probably use the standard queue system. Maybe just to keep it simple - you could run wp queue listen manually to get your sync done - and then let it do what it normally does after it's complete? Just an idea so you don't have to force yourself into a process monitor or a cron schedule if you don't have to. Also - if you go that route - just make sure to remove the constant DISABLE_WP_HTTP_WORKER so the normal queue picks up again.

Hope this helps a little!

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/mailchimp/mc-woocommerce/issues/158#issuecomment-390518160, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AD_EhER51LvmevZCwvhL1NNM655UlXo-ks5t0e_zgaJpZM4P-Xn8.

ghost commented 6 years ago

ausinchies@syd-s32b [~/public_html]# wp --version WP-CLI 1.5.1

It seems to be throwing the following error:

Error: Callable "Queue_Command" does not exist, and cannot be registered as `wp queue`.

It seems to be a known issue caused by Mailchimp for WooCommerce.

https://wordpress.org/support/topic/cron-error-10/

Please let me know if you have any further questions.

Kind Regards, Adrian Acosta Net Virtue Customer Service


From: Ryan Hungate notifications@github.com Sent: Monday, May 21, 2018 3:36 AM To: mailchimp/mc-woocommerce Cc: saadrashad; Comment Subject: Re: [mailchimp/mc-woocommerce] performance issues - access log is full of post requests to admin.ajax (#158)

@entreprennyhttps://github.com/entreprenny sorry to hear you're having issues with your host machine - I would like to know more about that if at all possible. What exactly did SitePoint have to 'double' for you? Memory? CPU? Script timeouts? Did they provide you with the error on why this just could not complete? Typically what would happen is it would try it again on its own. I would like to know more about your 'failed_jobs' table and what's currently in your 'queue' table too.

We apologize for the confusion and will work on providing a better 'how-to' for the WP CLI configuration - but it's quite simple really.

If you have WP CLI installed on your server - you would just need to do this - anywhere you define your constants ( typically wp-config.php ) define('DISABLE_WP_HTTP_WORKER', true);

Then in the command line run: wp queue listen It will start processing things right away and you'll actually see feedback in the command line. To automate this - you would either set up a cron job - or use a process manager.

  1. Use a process manager like monit, or supervisord etc. to keep this wp queue listen command running at all times.
  2. Set up a cron schedule to run it every minute - like:

Let us know if that helps you get set up. The other thing I wanted to point out is that it could just be the initial sync that's causing too much load on the server - but once it completes - you could probably use the standard queue system. Maybe just to keep it simple - you could run wp queue listen manually to get your sync done - and then let it do what it normally does after it's complete? Just an idea so you don't have to force yourself into a process monitor or a cron schedule if you don't have to. Also - if you go that route - just make sure to remove the constant DISABLE_WP_HTTP_WORKER so the normal queue picks up again.

Hope this helps a little!

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/mailchimp/mc-woocommerce/issues/158#issuecomment-390518160, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AD_EhER51LvmevZCwvhL1NNM655UlXo-ks5t0e_zgaJpZM4P-Xn8.

ryanhungate commented 6 years ago

@saadrashad are you currently on the 2.1.7 build? That should have taken care of that error.

MarcusFuto commented 6 years ago

The questions above should not be so hard to answer. Please just give us an example of there the different paths lead. Is it to the /public_html/wp-content/plugins/mailchimp-for-woocommerce/mailchimp-woocommerce.php file for the cron?

What is the path to /full/path/to/install/ ???

So for instance for me, would this be correct?

An example would be great.

ryanhungate commented 6 years ago

@MarcusFuto above I had given a reference to how this should be set up - the example was generic but should certainly give you enough context to run the command...

* * * * * /path/to/wp_cron --url=http://yourdomain.com --path=/path/to/domain/ queue listen

So in your example - you would do this:

/usr/bin/wp --url=https://www.ringsofsweden.com --path=/public_html/ queue listen

But to make sure you're getting the expected results first - I would run that command manually while in the CLI. See if that works first before scheduling the cron. Make sense?

MarcusFuto commented 6 years ago

Alright! That is straight forward! Thanks!

However, Is this part variable depending on my host: /usr/bin/wp ???

ghost commented 6 years ago

no error have been take care the plugin not working. seems to much buggy

ghost commented 6 years ago

@MarcusFuto not every 1 is a geneous like you are. . also a lot of sites using shared hosting without that much facility to sun SSH. you are requested to provide a solution which works on shared hosting and is bug free

Winsa commented 6 years ago

Hello @ryanhungate

We're a big woocommerce store and we're expericing the following issue:

2018-08-25T23:49:12+00:00 ERROR order_submit.error :: addStoreOrder :: 8880 :: <p>: Required fields were not provided: lines</p> on 1455 in /nas/content/live/havemekka/wp-content/plugins/mailchimp-for-woocommerce/includes/api/class-mailchimp-api.php

We're self hosted on a dedicated enviroment with PHP 7, WooCoommerce 3.4.4 & wordpress 4.9.8.

markbond1007 commented 6 years ago

I think the confusion is that this:

Note the wp cli rather than wp cron

ElisaCreative commented 5 years ago

Hello, having same issue and I can't find any solution. I have just two products, one customer. I also have PHP 7 and latest version of Woocommerce and Mailchimp for Woocommerce versions... I don't know what to do to solve this. Any help??

LiamMcArthur commented 5 years ago

I'm also having a lot of trouble with this plugin. It's trying to perform the initial sync of around 6,000 orders. It's got to around 1,000 and completely crashes the website, making it inaccessible. Restarting the MySQL process temporarily fixes the issue, until it gets stuck again.

khungate-zz commented 5 years ago

@ElisaCreative @LiamMcArthur it may be best to create new issues since this one has been closed for a while. We've found syncing issues can be related to various server, plugin or caching problems. However, here are some basic questions we ask when there are syncing issues to include with your new ticket; most of these are relevant to both of questions:

millionleaves commented 5 years ago

I ran the wp cli command manually for the first sync on a store. It returned this:

Warning: The `wp queue listen` command has an invalid synopsis part: [--force=<0>]
Warning: The `wp queue listen` command has an invalid synopsis part: [--daemon=<0>]
Warning: The `wp queue listen` command has an invalid synopsis part: [--multiple=<0>]
Warning: The `wp queue listen` command has an invalid synopsis part: [--sleep_processing=<1>]
Warning: The `wp queue listen` command has an invalid synopsis part: [--sleep_empty=<5>]

However, the syncing appears to be working with no problems.

UPDATE a few days later. I added the command to cron for ongoing syncing, but it started sending me these warnings via email every minute. I can't find any documentation on these other than this post, so I assume it's something wrong with this plugin?

ElisaCreative commented 5 years ago

It finally worked for me.

I asked for my hosting supplier that check for me the access to the admin-ajax.php. It was blocked. So now it runs perfectly,

Elisa

El mié., 31 oct. 2018 a las 1:33, millionleaves (notifications@github.com) escribió:

I ran the wp cli command manually for the first sync on a store. It returned this:

Warning: The wp queue listen command has an invalid synopsis part: [--force=<0>] Warning: The wp queue listen command has an invalid synopsis part: [--daemon=<0>] Warning: The wp queue listen command has an invalid synopsis part: [--multiple=<0>] Warning: The wp queue listen command has an invalid synopsis part: [--sleep_processing=<1>] Warning: The wp queue listen command has an invalid synopsis part: [--sleep_empty=<5>]

However, the syncing appears to be working with no problems.

I'm going to add the command to cron for ongoing syncing, but it would be good to know whether these warnings are anything to worry about, or whether I should be providing values for each of these parts?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mailchimp/mc-woocommerce/issues/158#issuecomment-434519645, or mute the thread https://github.com/notifications/unsubscribe-auth/AqPPs1lDL75a_mRu9lVpB2RhM12PUIFnks5uqO_FgaJpZM4P-Xn8 .

Jordane20 commented 5 years ago

@ElisaCreative , what all steps did you do to get this to work? I have a client's site that is having the same syncing issue?

ryanhungate commented 5 years ago

@millionleaves you probably have something wrong with the way the cron is written. Can you paste it here?

@ElisaCreative that's great to know you had that done and it works. Can you please say who you're hosting with and the steps required to turn that on? That would be very beneficial for other folks running into the same problem :)

millionleaves commented 5 years ago

@ryanhungate It's not just cron. I've found that running this command manually works OK:

wp --url=https://www.example.com--allow-root --path=/var/www/html/example queue listen

but this doesn't:

/usr/bin/wp --url=https://www.example.com--allow-root --path=/var/www/html/example queue listen

Both seem to sync the site with Mailchimp OK, but the second version generates the additional warnings I described above.

I've tried various versions of both of these lines in cron, but the fact that they happen outside cron suggests it's not a cron problem.

ElisaCreative commented 5 years ago

@millionleaves https://github.com/millionleaves Sorry for the delay!

As I said before, I just got in contact with my hosting supplier (webempresa from spain) and asked them if they could check the access to the admin-ajax.php. They made the rest. It seamed to be blocked.

*Elisa Aguilar | *Consultora de marca y Fotógrafa

www.elisacreative.com | elisacreative@gmail.com

Tel. +34 645 865 581 | Sígueme: @elisacreative <https://www.instagram.com/elisacreative/>

Subscríbete a mi newsletter http://eepurl.com/cSUh19

El jue., 8 nov. 2018 a las 2:42, millionleaves (notifications@github.com) escribió:

@ryanhungate https://github.com/ryanhungate It's not just cron. I've found that running this command manually works OK:

wp --url=https://www.example.com--allow-root --path=/var/www/html/example queue listen

but this doesn't:

/usr/bin/wp --url=https://www.example.com--allow-root --path=/var/www/html/example queue listen

Both seem to sync the site with Mailchimp OK, but the second version generates the additional warnings I described above.

I've tried various versions of both of these lines in cron, but the fact that they happen outside cron suggests it's not a cron problem.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mailchimp/mc-woocommerce/issues/158#issuecomment-436842717, or mute the thread https://github.com/notifications/unsubscribe-auth/AqPPs9X5ggOcgibU2RHXdDOHwRytJD55ks5us4wIgaJpZM4P-Xn8 .

sidedwards commented 5 years ago

@ryanhungate I'm having the same issue as @LiamMcArthur I have a store with 11k orders and it becomes extremely slow after syncing 100 orders or so. My CPU % also jumps 60% during the attempted initial sync. I have setup the cron as you mentioned with the define('DISABLE_WP_HTTP_WORKER', true); option added to wp-config.php.

What plugin version are you using?

2.1.11

Who is your hosting provider and can you check to see if they block access to the admin-ajax.php file for any reason?

Google Cloud Compute and no

Are you using a shared hosting environment?

No, we are on a dedicated server (2 vCPUs, 13 GB memory, 50 GB SSD)

What PHP version are you using and what is the memory limit is set to?

7.2.11

Is there any logging errors in the plugin’s logs tab (when it’s set to standard or debug)?

Here is an error that is repeated throughout the logs ERROR order_submit.error :: addStoreOrder :: 32382 :: A product with the provided ID does not exist in the account for this list. on 1498 in /var/www/html/wp-content/plugins/mailchimp-for-woocommerce/includes/api/class-mailchimp-api.php

Do you have any caching plugins or services running?

No.

Have you tried a fresh uninstall or reinstall?

Yes, I've removed the plugin completely and restarted the sync process. It moved fairly quickly at first but slowed down exponentially ~100 orders. Due to the MASSIVE impact CPU resources I'm considering building my own MailChimp integration. It's taken several hours to sync just a few hundred with huge CPU impact so I can't imagine it being able to get through 11k.

Any additional advice is appreciated. Thanks.

Jordane20 commented 5 years ago

We made all of the changes listed on here (changing PHP version, upload max time, cURLs, and some other changes) this didn't seem to work/take affect, until we disabled the plugin, disconnected from MailChimp, then reinstalled the plugin and reconnected and everything worked after! Thanks for the thread everyone.

MrNeedSomeHelp commented 5 years ago

12k Product, have disscounted from mailchimp reinstalled reconnected but nothing syncing at all

biolaojo commented 5 years ago

My Woocomerce store is not connecting to Mailchimp

After connecting with my API it refuses to sync to my mailChimp still and I get this:

Sync Information Account Connected: n/a

List Connected: n/a

Products Synced: 0

Orders Synced: 0

My debug log shows this error

ERROR product_sync.error :: addStoreProduct :: 595 :: Resource Not Found :: The requested resource could not be found. on 1470 in /home/mahogany/public_html/shop_mahogany/wp-content/plugins/mailchimp-for-woocommerce/includes/api/class-mailchimp-api.php

Jadedeverill commented 5 years ago

I'm having the same issue as above.

Nothing is syncing across, I have less than 100 orders.

Sync Information Account Connected: n/a

List Connected: n/a

Products Synced: 0

Orders Synced: 0

2019-01-09T19:38:11+00:00 NOTICE sync.started :: Starting Sync :: Wed, Jan 9, 2019 7:38 PM 2019-01-09T19:38:13+00:00 ERROR product_sync.error :: addStoreProduct :: 30 :: Resource Not Found :: The requested resource could not be found. on 1470 in /home/playful1/public_html/wp-content/plugins/mailchimp-for-woocommerce/includes/api/class-mailchimp-api.php

This repeats a lot.

Please help.

khungate-zz commented 5 years ago

@biolaojo, @Jadedeverill sorry to hear you're having issues with the plugin, we definitely want to try to help out. What may be happening is that site options table might not be getting cleared correctly when you've tried to uninstall, and then reinstalled the plugin. This is an edge-case, but we've seen this happen before with various caching plugins that sometimes get in the way of the options table getting cleared. Another potential issue is if you deleted the plugin manually; the uninstaller would have never been able run and that could be why you're seeing those errors.

To troubleshoot:

  1. Uninstall the plugin through the Wordpress admin area (if applicable).
  2. After the uninstall completes, stay in the admin area and enter https://yoursite.com/wp-admin/options.php. Here, it will display many options and the values about the site.
  3. Do a quick search (Ctrl-F) for mailchimp-woocommerce-store_id . Confirm that this is either empty or not there at all.
  4. After that's confirmed, go to Mailchimp and confirm you do not have the website listed in the "Connected Sites" area of Mailchimp.
  5. Re-install the plugin.

Give that a try and let us know if it solved the issue. I look forward to hearing back from you.

Jadedeverill commented 5 years ago

I managed to sort this after some digging around. My store id was wrong for some reason. I followed instructions in another post on the web. Thanks!

ryanhungate commented 5 years ago

Thanks for the follow up @Jadedeverill - glad you got it handled. The store ID being incorrect can sometimes be related to the plugin not being uninstalled properly - or sometimes caching plugins as well. @biolaojo let us know if you get the same results as well when you get a minute.

carlarumsey commented 5 years ago

I'm having the same issue as stated by others in here.

Sync Information Initial Sync: In Progress Last Updated: Fri, Feb 22, 2019 5:09 PM Products Synced: 11 Orders Synced: 306

Initially when I synced the store, only half of the orders synced. When I tried again I received a 503 API error. I've disconnected, deleted, and reinstalled the plugin numerous times. Sometimes it syncs, other times it doesn't.

I then added the suggested coding to my config file and created the cron job. It no longer gives the API error message, but my MailChimp list is still not showing any data even though it says it's connected. Now the sync is in progress, but this has been since late last night. I only have 11 products in the store and 308 orders.

I've contacted Siteground and yesterday morning they showed there was something blocking the API, but pushed my ticket to their senior tech support. When their tech support looked at it, they said everything shows that it's going through on their end, yet my MailChimp account still shows no data with the connected store.

Any help is greatly appreciated.

imohweb commented 5 years ago

Mailchimp won't connect for my Wordpress blog and my WooCommerce - Error connecting to Mailchimp: 503 Service Unavailable

khungate-zz commented 5 years ago

@imoh918 thanks for reaching out. Since you're currently receiving a 503 error code, that's coming from Mailchimp's API gateway service (Akamai). The quick and easy way to see if the problem was temporary is to perform a fresh uninstall and install. If the problem persists, troubleshooting something like this is can be technical in nature and we suggest asking your host or a 3rd party developer for help if you're not comfortable running the following commands:

The first step is to see if your server can communicate directly with the Mailchimp API using the CURL command below: curl -v -X GET https://{$DATA_CENTER}.api.mailchimp.com/3.0/ecommerce/stores?apikey={$API_KEY}

Please replace the $DATA_CENTER and the $API_KEY with your credentials. You can locate the $DATA_CENTER number in the URL, for example us19. If you receive a valid response from the Mailchimp API, that helps us solve the first step of determining whether or not your server has been IP Blacklisted by the API gateway.

Once we've verified that you are able to make calls directly using CURL - we can then see if there might be another SSL handshake issue / OpenSSL / libCURL issue that might need to be addressed by your server admins.

Give that a try and let us know if it solved the issue. If it doesn't, please create a new Github issue as this one does not relate to the original one. I look forward to hearing back from you.

shymu commented 5 years ago

I'm having the same problem as others. I've installed WP-CLI, added the constant to my config file, and set up the cron job.

When I run the WP-CLI command manually, things look fine: $ /home/[site]/usr/bin/wp --url=http://[site].com --path=/home/[site]/public_html queue listen [start] queue listen process_id [18947] :: max_time [1800] :: memory limit [33554432000] Success: Processed: MailChimp_WooCommerce_Cart_Update

Success: Processed: MailChimp_WooCommerce_Cart_Update Success: Processed: MailChimp_WooCommerce_User_Submit process id 18947 :: loop #20 Success: Processed: MailChimp_WooCommerce_User_Submit Success: Processed: MailChimp_WooCommerce_User_Submit Success: Processed: MailChimp_WooCommerce_Cart_Update Success: Processed: MailChimp_WooCommerce_Cart_Update process id 18947 :: loop #40 process id 18947 :: loop #60

But on the Wordpress end, all that has changed is the number of products sync'd has gone up from 17 to 33. No orders have synced and Abandoned Cart emails aren't going out. Here's what I see on the backend:

Initial Sync: In Progress Last Updated: Fri, Jul 19, 2019 9:42 PM Account Connected: [email]@[site].com Audience Connected: [site] Newsletter Products Synced: 33 Orders Synced: 0

This has been running for almost 2 weeks and it seems like way more should have sync'd by now. Is the only possible next step deleting the plugin and trying again? I don't particularly understand how that's supposed to fix things, but I'm not seeing any other suggestions in this thread that would help me.

shymu commented 5 years ago

I have deleted the plugin and reinstalled it. Now I am seeing this in my error logs:

2019-07-23T01:57:01+00:00 DEBUG order_sync.transient :: transient set for order 18060 2019-07-23T01:57:01+00:00 DEBUG order_sync.abort :: transient true for order 18060. Skipping queue item addition. 2019-07-23T01:57:01+00:00 DEBUG order_sync.abort :: transient true for order 18060. Skipping queue item addition. 2019-07-23T01:59:54+00:00 DEBUG order_sync.transient :: transient set for order 18060 2019-07-23T01:59:54+00:00 DEBUG order_sync.abort :: transient true for order 18060. Skipping queue item addition. 2019-07-23T16:34:05+00:00 DEBUG order_sync.transient :: transient set for order 18137 2019-07-23T16:34:06+00:00 DEBUG order_sync.abort :: transient true for order 18137. Skipping queue item addition. 2019-07-23T16:34:06+00:00 DEBUG order_sync.abort :: transient true for order 18137. Skipping queue item addition. 2019-07-23T16:55:06+00:00 DEBUG order_sync.transient :: transient set for order 18037 2019-07-23T16:55:06+00:00 DEBUG order_sync.abort :: transient true for order 18037. Skipping queue item addition. 2019-07-23T16:57:00+00:00 DEBUG order_sync.transient :: transient set for order 18060 2019-07-23T16:57:00+00:00 DEBUG order_sync.abort :: transient true for order 18060. Skipping queue item addition. 2019-07-23T19:56:53+00:00 NOTICE sync.started :: Starting Sync :: Tue, Jul 23, 2019 7:56 PM

Edit: Still no progress syncing anything:

Initial Sync: In Progress Last Updated: Thu, Jul 18, 2019 7:15 PM Account Connected: [email] Audience Connected: [site] Newsletter Products Synced: 0 Orders Synced: 0