log( $msg ); return; } /** Run the controller */ $ins = new BWFAN_Automation_Controller(); $ins->set_automation_data( $result ); $ins->start(); } catch ( Error $e ) { $msg = "Error occurred with message {$e->getMessage()} for action id {$action_id}"; BWFAN_Common::log_test_data( $msg, 'automation_contact_execution_fail', true ); throw new Exception( wp_strip_all_tags( $msg ), 1 ); //phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped } } public function log( $msg ) { if ( empty( $msg ) ) { return; } if ( false === apply_filters( 'bwfan_allow_automation_contact_logging', true ) ) { return; } $msg = is_array( $msg ) ? print_r( $msg, true ) : $msg; BWFAN_Common::log_test_data( $msg, 'automation_contact_execution', true ); } } BWFAN_Core::register( 'automations_v2_contact', 'BWFAN_Automation_V2_Contact' );