#2944
Jonathan Moore
Participant

There are 36 coupons and 1,411 products so I’m more wondering about the product wrapping.
The single use free gift coupon has been auto-applied and used 217 times.

I had reduced the PHP memory limit from 300MB to 192MB and the timeout from 120s to 90s, everything running fine for >12 hours including new orders received with this plugin turned off. (I’m thinking about reducing it further to fail faster)
But when I turn this plugin back on again the errors recur.

I’m not able to cause a hang interactively which is why I think one of the cron jobs must be causing it.
Server load is fairly low and Apache/PHP-FPM load is mitigated by using nginx in front, supercache generated pages processed via .htaccess and redis cache. but when these problems occur php-fpm uses up max cpu and also blows memory limit – at least if allowed to run for long enough.

This is this morning – interactively auto-coupons etc are working correctly and this plugin log seems ok, but then in the background something else is happening:
[09-Apr-2018 06:06:09 UTC] PHP Fatal error: Maximum execution time of 90 seconds exceeded in /wp-content/plugins/woocommerce-auto-added-coupons-pro/includes/WJECF_WC.php on line 24
[09-Apr-2018 06:07:39 UTC] PHP Fatal error: Maximum execution time of 90 seconds exceeded in /wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-data.php on line 586
[09-Apr-2018 06:09:09 UTC] PHP Fatal error: Maximum execution time of 90 seconds exceeded in /wp-content/object-cache.php on line 965
[09-Apr-2018 06:10:40 UTC] PHP Fatal error: Maximum execution time of 90 seconds exceeded in /wp-includes/class-wp-list-util.php on line 166
[09-Apr-2018 06:10:56 UTC] PHP Fatal error: Maximum execution time of 90 seconds exceeded in /wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-data.php on line 678
[09-Apr-2018 06:10:56 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-includes/class-wp-hook.php on line 277
[09-Apr-2018 06:10:56 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-includes/class-wp-hook.php on line 277
[09-Apr-2018 06:10:56 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-includes/class-wp-hook.php on line 277
[09-Apr-2018 06:10:56 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-includes/class-wp-hook.php on line 277
[09-Apr-2018 06:10:56 UTC] PHP Warning: Invalid argument supplied for foreach() in /wp-includes/class-wp-hook.php on line 277
[09-Apr-2018 06:12:26 UTC] PHP Fatal error: Maximum execution time of 90 seconds exceeded in /wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-data.php on line 554
[09-Apr-2018 06:13:56 UTC] PHP Fatal error: Maximum execution time of 90 seconds exceeded in /wp-includes/plugin.php on line 191
[09-Apr-2018 06:15:27 UTC] PHP Fatal error: Maximum execution time of 90 seconds exceeded in /wp-includes/taxonomy.php on line 1392
[09-Apr-2018 06:16:59 UTC] PHP Fatal error: Maximum execution time of 90 seconds exceeded in /wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-product.php on line 1120
[09-Apr-2018 06:50:56 UTC] PHP Fatal error: Maximum execution time of 90 seconds exceeded in /wp-content/plugins/woocommerce-auto-added-coupons-pro/includes/WJECF_Wrap.php on line 26

Running on PHP7, does Polylang which has the WPML capable api which has been working fine with this plugin, I haven’t updated woocommerce recently (3.1.2) but there have been updates to WP and Polylang.
But what is coming up consistently in the logs is the woocommerce product data and the WJECF wrap.
I’ve used this plugin for over a year without noticing major problem until recent months.
I do note this plugin is generally well defensively coded with use of safe_add_action to avoid recursion.
And in some place tests for: WJECF()->is_request( ‘frontend’ )

But some combination of factors is triggering an infinite loop until out of memory or execution time or both.