| @@ -29,8 +29,10 @@ | ||
| 29 | 29 | use SRFM\Inc\Global_Settings\Email_Summary; |
| 30 | 30 | use SRFM\Inc\Global_Settings\Global_Settings; |
| 31 | 31 | use SRFM\Inc\Gutenberg_Hooks; |
| 32 | 32 | use SRFM\Inc\Helper; |
| 33 | +use SRFM\Inc\Lib\SRFM_Nps_Survey; | |
| 34 | +use SRFM\Inc\Nps_Notice; | |
| 33 | 35 | use SRFM\Inc\Page_Builders\Page_Builders; |
| 34 | 36 | use SRFM\Inc\Post_Types; |
| 35 | 37 | use SRFM\Inc\Rest_Api; |
| 36 | 38 | use SRFM\Inc\Single_Form_Settings\Compliance_Settings; |
| @@ -286,8 +288,18 @@ | ||
| 286 | 288 | AI_Helper::get_instance(); |
| 287 | 289 | AI_Auth::get_instance(); |
| 288 | 290 | Updater::get_instance(); |
| 289 | 291 | DatabaseRegister::init(); |
| 292 | + | |
| 293 | + /** | |
| 294 | + * Required to add the if check for the class existence to resolve phpstan error, | |
| 295 | + * as the phpstan configuration ignores the inc/lib directory which gives error | |
| 296 | + * unknown class. | |
| 297 | + */ | |
| 298 | + if ( class_exists( 'SRFM\Inc\Lib\SRFM_Nps_Survey' ) && ! apply_filters( 'srfm_disable_nps_survey', true ) ) { | |
| 299 | + SRFM_Nps_Survey::get_instance(); // Inits the NPS Survey class for which inits the NPS Survey plugin. | |
| 300 | + Nps_Notice::get_instance(); // Responsible for displaying the NPS Survey: keeping the line out of the check will also work. | |
| 301 | + } | |
| 290 | 302 | |
| 291 | 303 | /** |
| 292 | 304 | * Load core files necessary for the Spectra block. |
| 293 | 305 | * This method is called in the Spectra block loader to ensure core files are loaded during the 'plugins_loaded' action. |