• Mailgun removed the unlimited email validations and now charge 0.01 US $ per validation after the first 100. While monitoring mailgun, I witnessed approximately 50 validations with one WooCommerce transaction. Unfortunately, mailgun doesn’t provide any log of the validation api so I have no idea where they are coming from. I am using latest version of Mailgun validator that appears to exclude the woocommerce pages.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Jesin A

    (@jesin)

    Hi Eric,

    Can you provide a list of active plugins on your website?

    Thread Starter EGF

    (@ericgf)

    if I add a customer note in a woocommerce order, it will generate approximately 10 identical API requests to the same email address. Also if a new order is processed it will also generate several API requests to Mailgun.

    I added additional code for post.php and shop_order post type, but was not successful.

    	if ( "edit.php" == $pagenow && "shop_order" == $wp->query_vars['post_type'] ) {
    				return TRUE;
    			}
    			
    			if ( "post.php" == $pagenow && "shop_order" == $wp->query_vars['post_type'] ) {
    				return TRUE;
    			}

    I have approximately 30 plug ins enabled, many are woocommerce related. I can send via PM the list but if you have any ideas what to check in the meantime please let me know.

    update; it appears the following code solves the problem

    		if ( "post.php" == $pagenow ) {
    				return TRUE;
    			}
    			if ( "admin-ajax.php" == $pagenow ) {
    				return TRUE;
    			}

    but I am unsure if excluding post.php or admin-ajax.php would prevent the mailgun validator from working elsewhere.

    • This reply was modified 6 years, 9 months ago by EGF. Reason: added update; possible solution
    • This reply was modified 6 years, 9 months ago by EGF.
    Thread Starter EGF

    (@ericgf)

    I believe someone else mentioned that is_email() function is called many times in WordPress thus this is the reason for excessive (unnecessary) usage of Mailgun e-mail validation.

    The problem is not only WooCommerce. I’ve found that editing/saving/modifying a contact form in Contact Form 7 plug-in also causes dozens of unnecessary Mailgun API calls. I would assume this is the case for other plug-ins that use some sort of is_email() functionality.

    Some suggestions;

    ignore validating e-mails that belong to the site owner, for example, [email protected]

    have option to only validate e-mails that originate from a specific page(s). For example, a contact form.

    I’ve been able to eliminate most of unnecessary Mailgun API calls by preventing “admin.php”, “post.php” and “admin-ajax.php” using $pagenow conditions but a better solution could be to only allow the validation to occur on the pages you want.

    Thank you for providing this plugin but it can be a problem if no limit is set in the Mailgun account. The result could be a hefty $$$ bill for thousands of repetitive validation requests. Perhaps you can come up with an elegant solution to this problem?

    Plugin Author Jesin A

    (@jesin)

    Your could try this to exclude the whole admin area:

    if ( is_admin() ) {
        return true;
    }
    

    And sorry for the trouble, when I initially developed this plugin the validation service was completely free.

    • This reply was modified 6 years, 9 months ago by Jesin A.
    Thread Starter EGF

    (@ericgf)

    Ok, even with my additional conditions I still see many validations when an WooCommerce customer order is triggered (approx. 50 validations per order). I will try your suggestion to add the “is_admin()” condition to see if this helps eliminate them.
    Thank you

    Thread Starter EGF

    (@ericgf)

    Unfortunately, “is_admin()” does not help as there are still many duplicate validations. I believe the bulk of them are coming from WooCommerce “front-end” orders.

    Plugin Author Jesin A

    (@jesin)

    In the following link I’ve added transients to the validate_email() function. The validated email and its result would be stored in the database for 1 month.

    https://gist.github.com/jesinwp/c29dc9fe10d3ee2745724c8c45f46712

    Let me know if it makes things better.

    Thread Starter EGF

    (@ericgf)

    yes this looks like it will do the job. I will try it out.
    Thank you.

    Hi Jesin,
    First, thank you for you work!

    Is this modified function used to validate addresses from plugin settings page?
    scr: https://take.ms/sJvga

    When I try it, I get API calls incremented in the Mailgun panel every time I validate the same email again and again.

    And after several attempts this email is getting validated ??
    scr: https://take.ms/eyqIL

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Mailgun no longer free 100 validation limit’ is closed to new replies.