/**
  * Register scripts and styles for Import Controller
  *
  * @return void
  */
 public function register_import_scripts_and_styles()
 {
     do_action('ai1mw-register-import-scripts-and-styles');
     // we don't want heartbeat to occur when importing
     wp_deregister_script('heartbeat');
     wp_enqueue_script('ai1wm-js-import', Ai1wm_Template::asset_link('javascript/import.min.js'), array('plupload-all', 'jquery'));
     wp_enqueue_style('ai1wm-css-import', Ai1wm_Template::asset_link('css/import.min.css'));
     wp_localize_script('ai1wm-js-import', 'ai1wm_uploader', array('runtimes' => 'html5,silverlight,flash,html4', 'browse_button' => 'ai1wm-import-file', 'container' => 'ai1wm-plupload-upload-ui', 'drop_element' => 'ai1wm-drag-drop-area', 'file_data_name' => 'upload-file', 'chunk_size' => apply_filters('ai1wm_max_chunk_size', AI1WM_MAX_CHUNK_SIZE), 'max_retries' => apply_filters('ai1wm_max_chunk_retries', AI1WM_MAX_CHUNK_RETRIES), 'url' => admin_url('admin-ajax.php?action=ai1wm_import'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), 'multiple_queues' => false, 'multi_selection' => false, 'urlstream_upload' => true, 'unique_names' => true, 'multipart' => true, 'multipart_params' => array('provider' => 'file', 'method' => 'import', 'secret_key' => get_site_option(AI1WM_SECRET_KEY, false, false)), 'filters' => array('ai1wm_archive_extension' => 'wpress', 'ai1wm_archive_size' => apply_filters('ai1wm_max_file_size', AI1WM_MAX_FILE_SIZE))));
     wp_localize_script('ai1wm-js-import', 'ai1wm_feedback', array('ajax' => array('url' => admin_url('admin-ajax.php?action=ai1wm_leave_feedback'))));
     wp_localize_script('ai1wm-js-import', 'ai1wm_report', array('ajax' => array('url' => admin_url('admin-ajax.php?action=ai1wm_report_problem'))));
     wp_localize_script('ai1wm-js-import', 'ai1wm_maintenance', array('ajax' => array('url' => admin_url('admin-ajax.php?action=ai1wm_disable_maintenance'))));
     wp_localize_script('ai1wm-js-import', 'ai1wm_import', array('ajax' => array('url' => admin_url('admin-ajax.php?action=ai1wm_import')), 'status' => array('url' => AI1WM_STORAGE_URL), 'secret_key' => get_site_option(AI1WM_SECRET_KEY, false, false), 'oversize' => sprintf(__('The file that you are trying to import is over the maximum upload file size limit of <strong>%s</strong>.' . '<br />You can remove this restriction by purchasing our ' . '<a href="https://servmask.com/products/unlimited-extension" target="_blank">Unlimited Extension</a>.', AI1WM_PLUGIN_NAME), size_format(apply_filters('ai1wm_max_file_size', AI1WM_MAX_FILE_SIZE))), 'invalid_extension' => sprintf(__('Version 2.1.1 of All in One WP Migration introduces new compression algorithm. ' . 'It makes exporting and importing 10 times faster.' . '<br />Unfortunately, the new format is not back compatible with backups made with earlier ' . 'versions of the plugin.' . '<br />You can either create a new backup with the latest version of the ' . 'plugin, or convert the archive to the new format using our tools ' . '<a href="%s" target="_blank">here</a>.', AI1WM_PLUGIN_NAME), AI1WM_ARCHIVE_TOOLS_URL)));
 }
 /**
  * Register scripts and styles for Import Controller
  */
 public function register_import_scripts_and_styles()
 {
     wp_enqueue_script('ai1wm-js-import', Ai1wm_Template::asset_link('javascript/import.min.js'), array('plupload-all', 'jquery'));
     wp_enqueue_style('ai1wm-css-import', Ai1wm_Template::asset_link('css/import.min.css'));
     $plupload_init = array('runtimes' => 'html5,silverlight,flash,html4', 'browse_button' => 'ai1wm-browse-button', 'container' => 'ai1wm-plupload-upload-ui', 'drop_element' => 'ai1wm-drag-drop-area', 'file_data_name' => 'upload-file', 'max_file_size' => apply_filters('ai1wm_max_file_size', AI1WM_MAX_FILE_SIZE), 'chunk_size' => apply_filters('ai1wm_max_chunk_size', AI1WM_MAX_CHUNK_SIZE), 'max_retries' => apply_filters('ai1wm_max_chunk_retries', AI1WM_MAX_CHUNK_RETRIES), 'url' => admin_url('admin-ajax.php'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), 'multiple_queues' => false, 'urlstream_upload' => true, 'unique_names' => true, 'multipart' => true, 'multipart_params' => array('action' => 'import'), 'filters' => array(array('title' => __('Allowed Files'), 'extensions' => 'zip')));
     wp_localize_script('ai1wm-js-import', 'ai1wm_uploader', $plupload_init);
     $feedback_init = array('ajax' => array('url' => admin_url('admin-ajax.php') . '?action=leave_feedback'));
     wp_localize_script('ai1wm-js-import', 'ai1wm_feedback', $feedback_init);
     $report_init = array('ajax' => array('url' => admin_url('admin-ajax.php') . '?action=report_problem'));
     wp_localize_script('ai1wm-js-import', 'ai1wm_report', $report_init);
     $maintenance_init = array('ajax' => array('url' => admin_url('admin-ajax.php') . '?action=disable_maintenance'));
     wp_localize_script('ai1wm-js-import', 'ai1wm_maintenance', $maintenance_init);
     $import_init = array('ajax' => array('url' => admin_url('admin-ajax.php') . '?action=import'));
     wp_localize_script('ai1wm-js-import', 'ai1wm_import', $import_init);
 }
	/**
	 * Register scripts and styles for Updater Controller
	 *
	 * @return void
	 */
	public function register_updater_scripts_and_styles( $hook ) {
		if ( 'plugins.php' !== $hook ) {
			return;
		}

		do_action( 'ai1mw-register-updater-scripts-and-styles' );

		wp_enqueue_style(
			'ai1wm-css-updater',
			Ai1wm_Template::asset_link( 'css/updater.min.css' )
		);
		wp_enqueue_script(
			'ai1wm-js-updater',
			Ai1wm_Template::asset_link( 'javascript/updater.min.js' ),
			array( 'jquery' )
		);
		wp_localize_script( 'ai1wm-js-updater', 'ai1wm_updater', array(
			'ajax' => array(
				'url' => admin_url( 'admin-ajax.php?action=ai1wm_updater' ),
			),
		) );
	}
	/**
	 * Register scripts and styles for Settings Controller
	 *
	 * @return void
	 */
	public function register_settings_scripts_and_styles() {
		wp_enqueue_script(
			'ai1wmge-js-settings',
			Ai1wm_Template::asset_link( 'javascript/settings.min.js', 'AI1WMGE' ),
			array( 'jquery' )
		);
		wp_enqueue_style(
			'ai1wm-css-export',
			Ai1wm_Template::asset_link( 'css/export.min.css' )
		);
		wp_enqueue_style(
			'ai1wmge-css-settings',
			Ai1wm_Template::asset_link( 'css/settings.min.css', 'AI1WMGE' )
		);
		wp_localize_script( 'ai1wmge-js-settings', 'ai1wmge_settings', array(
			'token' => get_option( 'ai1wmge_gdrive_token' ),
			'ajax'  => array(
				'account_url' => admin_url( 'admin-ajax.php?action=ai1wmge_gdrive_account' ),
			),
		) );
		wp_localize_script( 'ai1wmge-js-settings', 'ai1wm_feedback', array(
			'ajax' => array(
				'url' => admin_url( 'admin-ajax.php?action=ai1wm_feedback' ),
			),
		) );
	}