Dear @dudo,
I was talking from my experience, not guessing. After disabling the plugin the CPU load on the VPS dropped several times.
I saw load on the CPU for the following reasons:
1. The error should logged in the log file – CPU/IO load
2. The Sentry monitoring system should processes, prepare and report the error to the Sentry servers
3. The newrelic php-module also should processes the warning, log the data, the call stack, the context etc. and report it to the server
Please note that some of the error reporting above (p.2 and p.3) is happening in real-time. This means that several API calls are made in the same request cycle. The API calls themselves require several hundred milliseconds and are “blocking” the child php-fpm process during this time. For this reason a new child php-fpm processes must be spawn to accept the next requests.
Of course a php Notice/Warning/Error leads to CPU load in any system that has some type of error reporting, which is most hosting providers and most of the managed or self managed VPS servers.
Please note, that it took minutes the plugin to deplete my monitoring quota on both platforms… Quota, which in normal usage lasts a whole month ??
The problem:
From the dump below it is clear that the warning comes from the
includes/shortcodes/classes/YasrShortcode.php
and not from the yasr-includes-init.php
. I suppose that the yasr-includes-init.php
file is never included/required in this execution path.
E_WARNING: Use of undefined constant YASR_FIRST_SETID - assumed 'YASR_FIRST_SETID' (this will throw an Error in a future version of PHP)
in YasrShortcode::__construct called at WEBROOT/wp-content/plugins/yet-another-stars-rating/includes/shortcodes/classes/YasrVisitorVotes.php (35)
in YasrVisitorVotes::__construct called at WEBROOT/wp-content/plugins/yet-another-stars-rating/includes/shortcodes/yasr-shortcode-functions.php (88)
in shortcode_visitor_votes_callback called at WEBROOT/wp-includes/shortcodes.php (343)
in do_shortcode_tag called at ? (?)
in preg_replace_callback called at WEBROOT/wp-includes/shortcodes.php (218)
in do_shortcode called at WEBROOT/wp-content/themes/THEME/inc/helpers/helpers-shortcode.php (203)
in flatsome_contentfix called at WEBROOT/wp-includes/class-wp-hook.php (292)
in WP_Hook::apply_filters called at WEBROOT/wp-includes/plugin.php (212)
in apply_filters called at WEBROOT/wp-includes/post-template.php (253)
in the_content called at WEBROOT/wp-content/themes/CHILD_THEME/template-parts/posts/content-single.php (3)
in require called at WEBROOT/wp-includes/template.php (732)
in load_template called at WEBROOT/wp-includes/template.php (676)
in locate_template called at WEBROOT/wp-includes/general-template.php (204)
in get_template_part called at WEBROOT/wp-content/themes/THEME/template-parts/posts/single.php (14)
in require called at WEBROOT/wp-includes/template.php (732)
in load_template called at WEBROOT/wp-includes/template.php (676)
in locate_template called at WEBROOT/wp-includes/general-template.php (204)
in get_template_part called at WEBROOT/wp-content/themes/THEME/template-parts/posts/layout.php (12)
in require called at WEBROOT/wp-includes/template.php (732)
in load_template called at WEBROOT/wp-includes/template.php (676)
I hope this helps to fix the problem.
Kind regards
Svet