diff --git a/src/load.php b/src/load.php index b03a4145..ecaa7f1b 100644 --- a/src/load.php +++ b/src/load.php @@ -43,6 +43,16 @@ * Init function of the plugin */ function init() { + $disallow_ajax = apply_filters( 'antispam_bee_disallow_ajax_calls', true ); + + if ( defined( 'DOING_AJAX' ) && DOING_AJAX && $disallow_ajax ) { + return; + } + + if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { + return; + } + // Construct all modules to initialize. $modules = array( DashboardWidgets::class,