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