function __construct($plugin_file_path)
 {
     parent::__construct($plugin_file_path);
     $this->plugin_slug = 'wp-migrate-db-pro-media-files';
     $this->plugin_version = $GLOBALS['wpmdb_meta']['wp-migrate-db-pro-media-files']['version'];
     if (!$this->meets_version_requirements('1.4.4')) {
         return;
     }
     add_action('wpmdb_after_advanced_options', array($this, 'migration_form_controls'));
     add_action('wpmdb_load_assets', array($this, 'load_assets'));
     add_action('wpmdb_js_variables', array($this, 'js_variables'));
     add_action('wpmdb_diagnostic_info', array($this, 'diagnostic_info'));
     add_filter('wpmdb_accepted_profile_fields', array($this, 'accepted_profile_fields'));
     add_filter('wpmdb_establish_remote_connection_data', array($this, 'establish_remote_connection_data'));
     add_filter('wpmdb_nonces', array($this, 'add_nonces'));
     // compatibility with CLI migraitons
     add_filter('wpmdb_cli_finalize_migration', array($this, 'cli_migration'), 10, 4);
     // internal AJAX handlers
     add_action('wp_ajax_wpmdbmf_determine_media_to_migrate', array($this, 'ajax_determine_media_to_migrate'));
     add_action('wp_ajax_wpmdbmf_migrate_media', array($this, 'ajax_migrate_media'));
     // external AJAX handlers
     add_action('wp_ajax_nopriv_wpmdbmf_get_remote_media_listing', array($this, 'respond_to_get_remote_media_listing'));
     add_action('wp_ajax_nopriv_wpmdbmf_push_request', array($this, 'respond_to_push_request'));
     add_action('wp_ajax_nopriv_wpmdbmf_remove_local_attachments', array($this, 'respond_to_remove_local_attachments'));
 }
Beispiel #2
0
 function __construct($plugin_file_path)
 {
     parent::__construct($plugin_file_path);
     $this->plugin_slug = 'wp-migrate-db-pro-cli';
     $this->plugin_version = $GLOBALS['wpmdb_meta']['wp-migrate-db-pro-cli']['version'];
     if (!$this->meets_version_requirements('1.4.4')) {
         return;
     }
 }
Beispiel #3
0
 function __construct($plugin_file_path)
 {
     parent::__construct($plugin_file_path);
     $this->plugin_slug = 'wp-migrate-db-pro-cli';
     $this->plugin_version = $GLOBALS['wpmdb_meta']['wp-migrate-db-pro-cli']['version'];
     $this->php_version_required = $GLOBALS['wpmdb_meta']['wp-migrate-db-pro-cli']['required-php-version'];
     if (!version_compare(PHP_VERSION, $this->php_version_required, '>=')) {
         return;
     }
     if (!$this->meets_version_requirements('1.5.2')) {
         return;
     }
 }
 function __construct($plugin_file_path)
 {
     parent::__construct($plugin_file_path);
     $this->plugin_slug = 'wp-migrate-db-pro-media-files';
     $this->plugin_version = $GLOBALS['wpmdb_meta']['wp-migrate-db-pro-media-files']['version'];
     if (!$this->meets_version_requirements('1.6.1')) {
         return;
     }
     add_action('wpmdb_after_advanced_options', array($this, 'migration_form_controls'));
     add_action('wpmdb_load_assets', array($this, 'load_assets'));
     add_action('wpmdb_diagnostic_info', array($this, 'diagnostic_info'));
     add_action('wpmdbmf_after_migration_options', array($this, 'after_migration_options_template'));
     add_filter('wpmdb_establish_remote_connection_data', array($this, 'establish_remote_connection_data'));
     add_filter('wpmdb_nonces', array($this, 'add_nonces'));
     add_filter('wpmdb_data', array($this, 'js_variables'));
     $this->media_files_local = new WPMDBPro_Media_Files_Local($plugin_file_path);
     $this->media_files_remote = new WPMDBPro_Media_Files_Remote($plugin_file_path);
 }
 function __construct($plugin_file_path)
 {
     parent::__construct($plugin_file_path);
     $this->plugin_slug = 'wp-migrate-db-pro-media-files';
     $this->plugin_version = $GLOBALS['wpmdb_meta']['wp-migrate-db-pro-media-files']['version'];
     if (!$this->meets_version_requirements('1.4.6')) {
         return;
     }
     $this->media_diff_batch_time = apply_filters('wpmdb_media_diff_batch_time', 10);
     //seconds
     $this->media_diff_batch_limit = apply_filters('wpmdb_media_diff_batch_limit', 500);
     //number of attachments
     $this->media_files_batch_time_limit = apply_filters('wpmdb_media_files_batch_time_limit', 15);
     //seconds
     add_action('wpmdb_after_advanced_options', array($this, 'migration_form_controls'));
     add_action('wpmdb_load_assets', array($this, 'load_assets'));
     add_action('wpmdb_js_variables', array($this, 'js_variables'));
     add_action('wpmdb_diagnostic_info', array($this, 'diagnostic_info'));
     add_action('wpmdb_template_progress_after_bar', array($this, 'progress_template'));
     add_filter('wpmdb_accepted_profile_fields', array($this, 'accepted_profile_fields'));
     add_filter('wpmdb_establish_remote_connection_data', array($this, 'establish_remote_connection_data'));
     add_filter('wpmdb_nonces', array($this, 'add_nonces'));
     // internal AJAX handlers
     add_action('wp_ajax_wpmdbmf_remove_files_recursive', array($this, 'ajax_remove_files_recursive'));
     add_action('wp_ajax_wpmdbmf_prepare_determine_media', array($this, 'ajax_prepare_determine_media'));
     add_action('wp_ajax_wpmdbmf_determine_media_to_migrate_recursive', array($this, 'ajax_determine_media_to_migrate_recursive'));
     add_action('wp_ajax_wpmdbmf_migrate_media', array($this, 'ajax_migrate_media'));
     // external AJAX handlers
     add_action('wp_ajax_nopriv_wpmdbmf_get_remote_media_info', array($this, 'respond_to_get_remote_media_info'));
     add_action('wp_ajax_nopriv_wpmdbmf_get_remote_attachment_batch', array($this, 'respond_to_get_remote_attachment_batch'));
     add_action('wp_ajax_nopriv_wpmdbmf_compare_remote_attachments', array($this, 'respond_to_compare_remote_attachments'));
     add_action('wp_ajax_nopriv_wpmdbmf_push_request', array($this, 'respond_to_push_request'));
     add_action('wp_ajax_nopriv_wpmdbmf_get_local_media_files_batch', array($this, 'respond_to_get_local_media_files_batch'));
     add_action('wp_ajax_nopriv_wpmdbmf_compare_local_media_files', array($this, 'respond_to_compare_local_media_files'));
     add_action('wp_ajax_nopriv_wpmdbmf_remove_local_media_files', array($this, 'respond_to_remove_local_media_files'));
 }
 /**
  * Returns validated and sanitized form data.
  *
  * @param array|string $data
  *
  * @return array|string
  */
 function parse_migration_form_data($data)
 {
     $form_data = parent::parse_migration_form_data($data);
     $form_data = array_intersect_key($form_data, array_flip($this->accepted_fields));
     return $form_data;
 }