• Resolved marjanparfumika

    (@marjanparfumika)


    Hi,

    Im very satisfied with that simple plugin. Today I noticed one issue.

    Yesterday evening a few customers placed their orders but did not receive a confirmation / welcome email (not even we, admins). It felt weird and I created a test order this morning (in incognito) and got an email. Also, this morning they sent all the back emails for all the orders that were not sent before.

    My question: Is it possible that because of the “defer” command, the emails are not sent or do they get stuck?

    Idea for a solution: Because the system now has a “defer” command, but it is not specified exactly how much later this command should be executed. Maybe it would make sense to set and specify when exactly after click on “order now” these emails should be sent?

    • Maybe 10 seconds? or 15?
    • Or we should specify that the emails are sent as soon as the order is accepted in the database, then the emails are sent immediately.

    How do you think we could fix this problem?

    PS:
    We use the WP mail SMTP plugin for smtp

    Thank you,
    Sincerely,
    Marjan

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jose

    (@giuse)

    Hi @marjanparfumika

    When you activate the plugin WooCommerce doesn’t send the email immediately after the order is placed, but it’s added to the scheduled cron jobs.

    The default cron jobs fire only if your website is visited.
    If an email is scheduled after placing the order, and nobody visits your site for a period of time, until the next visit the email will not be sent.
    I suspect your issue has something to do with low traffic.
    What’s the level of traffic of your website.
    Take also into account that when the pages are served by the cache, they don’t trigger the cron jobs. So, your website may also have enough traffic, but the pages are always served by the cache.

    To solve this issue I suggest you create a cron on your server that calls https://yoursite.com/wp-cron.php. You can call it e.g. every 15 minutes, so you are sure the emails will not be sent later than 15 minutes.

    Here you have as an example a tutorial about the cron jobs for Hostgator: https://www.damiencarbery.com/2020/04/defer-woocommerce-emails-for-a-few-minutes/. I suggest you look for a tutorial about cron jobs written by your hosting provider.

    Unfortunately, the current version of the plugin doesn’t give you the possibility to define the delay. But even if it did it, you would always have the problem with the cron jobs if the inbuilt WP cron jobs system is not triggered in time.
    A future PRO version will give the possibility to define the time, but at the moment I haven’t the time for the development. When it’s ready I will provide it to you for free if you are still interested. So, you will tell me if it works. I may have time for the PRO version in a couple of months.

    Another way to solve the issue is not using this plugin, but speed up the checkout in a different way. Your final goal isn’t delaying the email, but speeding up the checkout. So, if you can reach the same goal in a different way, it would also be fine.
    I suggest you try Freesoul Deactivate Plugins.

    With FDP you can disable all the plugin that you don’t need during the checkout process.
    After activation you can go to Freesoul Deactivate Plugins => Plugin Manager => Actions => WooCommerce and disable all those plugins that you don’t need during the actions that WooCommerce does when you place the order. Read here for more details: https://freesoul-deactivate-plugins.com/how-deactivate-plugiins-on-specific-pages/actions/

    Maybe this will be enough to speed up the checkout without the need to defer the emails.

    Usually, if you have WP Mail SMTP, by deactivating all the other plugins you see a noticeable improvement. I would keep active only WP Mail SMTP and the WooCommerce add-ons that are needed.
    In any case, I suggest you do enough testing. Disabling plugins can be very effective, but you need to test and check that all works as expected.

    I hope it helps

    Have a great day!

    Jose

    Thread Starter marjanparfumika

    (@marjanparfumika)

    Dear Jose,

    Thank you for your long answer. I appreciate your effort. I forward your answer to our developer and he will figure out how to solve that issue/ find a solution.

    I will forward that solution (probably the code) to you, so you can add it to your plugin. So plugin can be even more complete and better.

    2) I read about the plugin Freesoul Deactivate plugins. But I already have plugin Perfmatters. Does that plugin (Freesoul) do the same or have better features? With parfmatters you can also disable scripts on selected page.


    Have a great weekend,
    Sincerely
    Marjan

    Plugin Author Jose

    (@giuse)

    Hi @marjanparfumika

    you are welcome!

    Thank you for forwarding my answer to your developer.

    Freesoul Deactivate Plugins has a free and a PRO version. With the free version you can only disable entire plugins (PHP, DB queries, scripts and CSS all together). With the PRO version you can also disable only scripts and/or CSS and keep a part of the plugins still active. Moreover, the PRO version of FDP can automatically suggest the unneeded plugins.

    In your specific case, I don’t think with Perfmatters you can disable plugins during the actions that take place after you submit the order. I think you can only disable plugins, or part of plugins on normal page loading. But honestly, I’m not sure. I suggest you check.
    With Freesoul Deactivate Plugins you can disable the plugins during the actions triggered by the checkout already with the free version.

    I’m the author of Freesoul Deactivate Plugins, so you have to take it into account 🙂 Of course, I like my plugin 🙂 But I know Perfmatters is also an amazing plugin.

    I think you can’t say Perfmatters is better than FDP, or FDP is better than Perfmatters. Even though they both disable plugins, they are totally different in terms of how they do it. And it really depends on your tastes and situation.
    In my opinion, you may prefer FDP if you have dozen of plugins, and you may prefer Perfmatters if you have fewer plugins but that load many scripts and stylesheets. You will prefer Perfmatters instead of the free version of FDP if you have a theme that loads heavy scripts and stylesheets because FDP free works only with plugins on the frontend.
    FDP has a totally different backend interface that you may love or hate, depending on your tastes, but also on the number of plugins. It works with matrices, which for me gives an easier overview of the disabled plugins when you have many of them. There are users who love it, and others are very disoriented in seeing those matrices, especially in the beginning.
    Maybe if you have a staging environment you can give it a try with the free version.

    Have a great day!

    Jose

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Sometimes emails get stuck – version 0.0.1’ is closed to new replies.