'sureforms_menu',
'srfm-activation-redirect' => true,
],
admin_url( 'admin.php' )
)
);
exit;
}
}
}
/**
* Load Classes.
*
* @return void
* @since 0.0.1
*/
public function load_classes() {
Register::get_instance();
if ( is_admin() ) {
Admin::get_instance();
// phpcs:ignore /** @phpstan-ignore-next-line */ -- Class is loaded dynamically in WordPress
Notice_Manager::get_instance();
}
Payments::get_instance();
Duplicate_Form::get_instance();
Learn::get_instance();
}
/**
* Load Plugin Text Domain.
* This will load the translation textdomain depending on the file priorities.
* 1. Global Languages /wp-content/languages/sureforms/ folder
* 2. Local directory /wp-content/plugins/sureforms/languages/ folder
*
* @since 0.0.1
* @return void
*/
public function load_textdomain() {
// Default languages directory.
$lang_dir = SRFM_DIR . 'languages/';
/**
* Filters the languages directory path to use for plugin.
*
* @param string $lang_dir The languages directory path.
*/
$lang_dir = apply_filters( 'srfm_languages_directory', $lang_dir );
// Traditional WordPress plugin locale filter.
global $wp_version;
$get_locale = get_locale();
if ( $wp_version >= 4.7 ) {
$get_locale = get_user_locale();
}
/**
* Language Locale for plugin
*
* Uses get_user_locale()` in WordPress 4.7 or greater,
* otherwise uses `get_locale()`.
*/
$locale = apply_filters( 'plugin_locale', $get_locale, 'sureforms' );//phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- wordpress hook
$mofile = sprintf( '%1$s-%2$s.mo', 'sureforms', $locale );
// Setup paths to current locale file.
$mofile_global = WP_LANG_DIR . '/plugins/' . $mofile;
$mofile_local = $lang_dir . $mofile;
if ( file_exists( $mofile_global ) ) {
// Look in global /wp-content/languages/sureforms/ folder.
load_textdomain( 'sureforms', $mofile_global );
} elseif ( file_exists( $mofile_local ) ) {
// Look in local /wp-content/plugins/sureforms/languages/ folder.
load_textdomain( 'sureforms', $mofile_local );
} else {
// Load the default language files.
load_plugin_textdomain( 'sureforms', false, $lang_dir );
}
}
/**
* Loads plugin files.
*
* @since 0.0.1
*
* @return void
*/
public function load_plugin() {
Post_Types::get_instance();
Form_Submit::get_instance();
Gutenberg_Hooks::get_instance();
Frontend_Assets::get_instance();
Helper::get_instance();
Activator::get_instance();
Admin_Ajax::get_instance();
Forms_Data::get_instance();
Export::get_instance();
Smart_Tags::get_instance();
Generate_Form_Markup::get_instance();
Create_New_Form::get_instance();
Global_Settings::get_instance();
Email_Summary::get_instance();
Compliance_Settings::get_instance();
Events_Scheduler::get_instance();
AI_Form_Builder::get_instance();
Field_Mapping::get_instance();
Background_Process::get_instance();
Page_Builders::get_instance();
Rest_Api::get_instance();
AI_Helper::get_instance();
AI_Auth::get_instance();
Updater::get_instance();
Onboarding::get_instance();
DatabaseRegister::init();
Form_Restriction::get_instance();
Abilities_Registrar::get_instance();
// Initializing Compatibilities.
Astra::get_instance();
/**
* Load core files necessary for the Spectra block.
* This method is called in the Spectra block loader to ensure core files are loaded during the 'plugins_loaded' action.
*
* Note: This code is added at the bottom to ensure the form block is loaded first,
* followed by the Spectra blocks such as heading, image, and icon blocks.
*/
$this->load_core_files();
}
/**
* Load Core Files.
*
* @since 0.0.1
*
* @return void
*/
public function load_core_files() {
include_once SRFM_DIR . 'modules/gutenberg/classes/class-spec-block-loader.php';
}
}
/**
* Kicking this off by calling 'get_instance()' method
*/
Plugin_Loader::get_instance();