| @@ -7,8 +7,12 @@ | ||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | namespace SRFM; |
| 10 | 10 | |
| 11 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 12 | + exit; // Exit if accessed directly. | |
| 13 | +} | |
| 14 | + | |
| 11 | 15 | use SRFM\Admin\Admin; |
| 12 | 16 | use SRFM\Admin\Analytics; |
| 13 | 17 | use SRFM\Admin\Notice_Manager; |
| 14 | 18 | use SRFM\Inc\Abilities\Abilities_Registrar; |
| @@ -13,8 +17,9 @@ | ||
| 13 | 17 | use SRFM\Admin\Notice_Manager; |
| 14 | 18 | use SRFM\Inc\Abilities\Abilities_Registrar; |
| 15 | 19 | use SRFM\Inc\Activator; |
| 16 | 20 | use SRFM\Inc\Admin\Editor_Nudge; |
| 21 | +use SRFM\Inc\Admin\Html_Form_Detector; | |
| 17 | 22 | use SRFM\Inc\Admin_Ajax; |
| 18 | 23 | use SRFM\Inc\AI_Form_Builder\AI_Auth; |
| 19 | 24 | use SRFM\Inc\AI_Form_Builder\AI_Form_Builder; |
| 20 | 25 | use SRFM\Inc\AI_Form_Builder\AI_Helper; |
| @@ -20,8 +25,11 @@ | ||
| 20 | 25 | use SRFM\Inc\AI_Form_Builder\AI_Helper; |
| 21 | 26 | use SRFM\Inc\AI_Form_Builder\Field_Mapping; |
| 22 | 27 | use SRFM\Inc\Background_Process; |
| 23 | 28 | use SRFM\Inc\Blocks\Register; |
| 29 | +use SRFM\Inc\Compatibility\Multilingual\Multilingual_Manager; | |
| 30 | +use SRFM\Inc\Compatibility\Multilingual\String_Backfill; | |
| 31 | +use SRFM\Inc\Compatibility\Multilingual\String_Collector; | |
| 24 | 32 | use SRFM\Inc\Compatibility\Themes\Astra; |
| 25 | 33 | use SRFM\Inc\Create_New_Form; |
| 26 | 34 | use SRFM\Inc\Database\Register as DatabaseRegister; |
| 27 | 35 | use SRFM\Inc\Duplicate_Form; |
| @@ -33,11 +41,15 @@ | ||
| 33 | 41 | use SRFM\Inc\Frontend_Assets; |
| 34 | 42 | use SRFM\Inc\Generate_Form_Markup; |
| 35 | 43 | use SRFM\Inc\Global_Settings\Email_Summary; |
| 36 | 44 | use SRFM\Inc\Global_Settings\Global_Settings; |
| 45 | +use SRFM\Inc\Global_Settings\Global_Settings_Defaults; | |
| 37 | 46 | use SRFM\Inc\Gutenberg_Hooks; |
| 38 | 47 | use SRFM\Inc\Helper; |
| 39 | 48 | use SRFM\Inc\Learn; |
| 49 | +// region: form-migration — Phase P1 foundation. | |
| 50 | +use SRFM\Inc\Migrator\Bootstrap as Migrator_Bootstrap; | |
| 51 | +// endregion: form-migration. | |
| 40 | 52 | use SRFM\Inc\Onboarding; |
| 41 | 53 | use SRFM\Inc\Page_Builders\Page_Builders; |
| 42 | 54 | use SRFM\Inc\Payments\Payments; |
| 43 | 55 | use SRFM\Inc\Post_Types; |
| @@ -42,15 +54,12 @@ | ||
| 42 | 54 | use SRFM\Inc\Payments\Payments; |
| 43 | 55 | use SRFM\Inc\Post_Types; |
| 44 | 56 | use SRFM\Inc\Rest_Api; |
| 45 | 57 | use SRFM\Inc\Single_Form_Settings\Compliance_Settings; |
| 58 | +use SRFM\Inc\Single_Form_Settings\Form_Settings_Api; | |
| 46 | 59 | use SRFM\Inc\Smart_Tags; |
| 47 | 60 | use SRFM\Inc\Updater; |
| 48 | 61 | |
| 49 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 50 | - exit; // Exit if accessed directly. | |
| 51 | -} | |
| 52 | - | |
| 53 | 62 | /** |
| 54 | 63 | * Plugin_Loader |
| 55 | 64 | * |
| 56 | 65 | * @since 0.0.1 |
| @@ -214,8 +223,13 @@ | ||
| 214 | 223 | // phpcs:ignore /** @phpstan-ignore-next-line */ -- Class is loaded dynamically in WordPress |
| 215 | 224 | Notice_Manager::get_instance(); |
| 216 | 225 | Editor_Nudge::get_instance(); |
| 217 | 226 | } |
| 227 | + // Always instantiate — script enqueue is self-gated by `allow_load()`, | |
| 228 | + // while the REST endpoint for converting HTML forms must register | |
| 229 | + // outside the admin context (REST dispatch runs with `is_admin()` === | |
| 230 | + // false, so admin-only instantiation would 404 the endpoint). | |
| 231 | + Html_Form_Detector::get_instance(); | |
| 218 | 232 | Payments::get_instance(); |
| 219 | 233 | Duplicate_Form::get_instance(); |
| 220 | 234 | Learn::get_instance(); |
| 221 | 235 | } |
| @@ -269,8 +283,9 @@ | ||
| 269 | 283 | // Look in local /wp-content/plugins/sureforms/languages/ folder. |
| 270 | 284 | load_textdomain( 'sureforms', $mofile_local ); |
| 271 | 285 | } else { |
| 272 | 286 | // Load the default language files. |
| 287 | + // phpcs:ignore PluginCheck.CodeAnalysis.DiscouragedFunctions.load_plugin_textdomainFound -- Fallback when no global/local .mo override is present. | |
| 273 | 288 | load_plugin_textdomain( 'sureforms', false, $lang_dir ); |
| 274 | 289 | } |
| 275 | 290 | } |
| 276 | 291 | |
| @@ -294,10 +309,12 @@ | ||
| 294 | 309 | Smart_Tags::get_instance(); |
| 295 | 310 | Generate_Form_Markup::get_instance(); |
| 296 | 311 | Create_New_Form::get_instance(); |
| 297 | 312 | Global_Settings::get_instance(); |
| 313 | + Global_Settings_Defaults::get_instance(); | |
| 298 | 314 | Email_Summary::get_instance(); |
| 299 | 315 | Compliance_Settings::get_instance(); |
| 316 | + Form_Settings_Api::get_instance(); | |
| 300 | 317 | Events_Scheduler::get_instance(); |
| 301 | 318 | AI_Form_Builder::get_instance(); |
| 302 | 319 | Field_Mapping::get_instance(); |
| 303 | 320 | Background_Process::get_instance(); |
| @@ -302,8 +319,11 @@ | ||
| 302 | 319 | Field_Mapping::get_instance(); |
| 303 | 320 | Background_Process::get_instance(); |
| 304 | 321 | Page_Builders::get_instance(); |
| 305 | 322 | Rest_Api::get_instance(); |
| 323 | + // region: form-migration — Phase P1 foundation. | |
| 324 | + Migrator_Bootstrap::get_instance(); | |
| 325 | + // endregion: form-migration. | |
| 306 | 326 | AI_Helper::get_instance(); |
| 307 | 327 | AI_Auth::get_instance(); |
| 308 | 328 | Updater::get_instance(); |
| 309 | 329 | Onboarding::get_instance(); |
| @@ -311,8 +331,11 @@ | ||
| 311 | 331 | Form_Restriction::get_instance(); |
| 312 | 332 | Abilities_Registrar::get_instance(); |
| 313 | 333 | // Initializing Compatibilities. |
| 314 | 334 | Astra::get_instance(); |
| 335 | + Multilingual_Manager::get_instance(); | |
| 336 | + String_Collector::get_instance(); | |
| 337 | + String_Backfill::get_instance(); | |
| 315 | 338 | |
| 316 | 339 | /** |
| 317 | 340 | * Load core files necessary for the Spectra block. |
| 318 | 341 | * This method is called in the Spectra block loader to ensure core files are loaded during the 'plugins_loaded' action. |