All-in-One WP Migration - Version 4.15

Version Description

  • Fix an issue with resovling mechanism on export/import
Download this release

Release Info

Developer bangelov
Plugin Icon 128x128 All-in-One WP Migration
Version 4.15
Comparing to
See all releases

Code changes from version 4.14 to 4.15

all-in-one-wp-migration.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Migration tool for all your blog data. Import or Export your blog content with a single click.
6
  * Author: ServMask
7
  * Author URI: https://servmask.com/
8
- * Version: 4.14
9
  * Text Domain: all-in-one-wp-migration
10
  * Domain Path: /languages
11
  * Network: True
5
  * Description: Migration tool for all your blog data. Import or Export your blog content with a single click.
6
  * Author: ServMask
7
  * Author URI: https://servmask.com/
8
+ * Version: 4.15
9
  * Text Domain: all-in-one-wp-migration
10
  * Domain Path: /languages
11
  * Network: True
constants.php CHANGED
@@ -38,7 +38,7 @@ if ( function_exists( 'gethostname' ) && in_array( gethostname(), $local ) ) {
38
  // ==================
39
  // = Plugin Version =
40
  // ==================
41
- define( 'AI1WM_VERSION', '4.14' );
42
 
43
  // ===============
44
  // = Plugin Name =
@@ -63,7 +63,7 @@ define( 'AI1WM_LOG_FILE', AI1WM_STORAGE_PATH . DIRECTORY_SEPARATOR . 'error.log'
63
  // ===============
64
  // = Status Path =
65
  // ===============
66
- define( 'AI1WM_STATUS_FILE', AI1WM_STORAGE_PATH . DIRECTORY_SEPARATOR . 'status.html' );
67
 
68
  // ============
69
  // = Lib Path =
@@ -138,7 +138,7 @@ define( 'AI1WM_PACKAGE_NAME', 'package.json' );
138
  // ========================
139
  // = Archive Status Name =
140
  // ========================
141
- define( 'AI1WM_STATUS_NAME', 'status.html' );
142
 
143
  // ========================
144
  // = Archive FileMap Name =
38
  // ==================
39
  // = Plugin Version =
40
  // ==================
41
+ define( 'AI1WM_VERSION', '4.15' );
42
 
43
  // ===============
44
  // = Plugin Name =
63
  // ===============
64
  // = Status Path =
65
  // ===============
66
+ define( 'AI1WM_STATUS_FILE', AI1WM_STORAGE_PATH . DIRECTORY_SEPARATOR . 'status.js' );
67
 
68
  // ============
69
  // = Lib Path =
138
  // ========================
139
  // = Archive Status Name =
140
  // ========================
141
+ define( 'AI1WM_STATUS_NAME', 'status.js' );
142
 
143
  // ========================
144
  // = Archive FileMap Name =
lib/model/class-ai1wm-export-file.php CHANGED
@@ -56,7 +56,7 @@ class Ai1wm_Export_File extends Ai1wm_Export_Abstract {
56
  size_format( filesize( $this->storage()->backup() ) )
57
  )
58
  ),
59
- $this->storage()->status() // status.html file
60
  );
61
  }
62
  }
56
  size_format( filesize( $this->storage()->backup() ) )
57
  )
58
  ),
59
+ $this->storage()->status() // status.js file
60
  );
61
  }
62
  }
lib/model/class-ai1wm-http.php CHANGED
@@ -25,6 +25,8 @@
25
 
26
  class Ai1wm_Http {
27
 
 
 
28
  public static function get( $url, $params = array() ) {
29
 
30
  // Get IP address
@@ -65,6 +67,9 @@ class Ai1wm_Http {
65
  foreach ( array( 'ai1wm', 'curl' ) as $transport ) {
66
  foreach ( array( $ip, $domain, $host ) as $ip ) {
67
 
 
 
 
68
  // HTTP request
69
  Ai1wm_Http::request( $url, $ip, array(
70
  'secret_key' => $secret_key,
@@ -75,6 +80,9 @@ class Ai1wm_Http {
75
  // HTTP response
76
  for ( $i = 0; $i < 5; $i++, sleep( 1 ) ) {
77
 
 
 
 
78
  // Clear WP options cache
79
  wp_cache_flush();
80
 
@@ -142,6 +150,6 @@ class Ai1wm_Http {
142
  }
143
 
144
  public static function transports( $transports ) {
145
- return get_site_option( AI1WM_URL_TRANSPORT, array( 'ai1wm', 'curl' ), false );
146
  }
147
  }
25
 
26
  class Ai1wm_Http {
27
 
28
+ public static $transports = array( 'ai1wm', 'curl' );
29
+
30
  public static function get( $url, $params = array() ) {
31
 
32
  // Get IP address
67
  foreach ( array( 'ai1wm', 'curl' ) as $transport ) {
68
  foreach ( array( $ip, $domain, $host ) as $ip ) {
69
 
70
+ // Set transport
71
+ Ai1wm_Http::$transports = array( $transport );
72
+
73
  // HTTP request
74
  Ai1wm_Http::request( $url, $ip, array(
75
  'secret_key' => $secret_key,
80
  // HTTP response
81
  for ( $i = 0; $i < 5; $i++, sleep( 1 ) ) {
82
 
83
+ // Clear WP notoptions cache
84
+ wp_cache_delete( 'notoptions', 'options' );
85
+
86
  // Clear WP options cache
87
  wp_cache_flush();
88
 
150
  }
151
 
152
  public static function transports( $transports ) {
153
+ return get_site_option( AI1WM_URL_TRANSPORT, Ai1wm_Http::$transports, false );
154
  }
155
  }
lib/view/assets/javascript/export.min.js CHANGED
@@ -1 +1 @@
1
- !function e(t,a,i){function s(o,n){if(!a[o]){if(!t[o]){var c="function"==typeof require&&require;if(!n&&c)return c(o,!0);if(r)return r(o,!0);throw new Error("Cannot find module '"+o+"'")}var m=a[o]={exports:{}};t[o][0].call(m.exports,function(e){var a=t[o][1][e];return s(a?a:e)},m,m.exports,e,t,a,i)}return a[o].exports}for(var r="function"==typeof require&&require,o=0;o<i.length;o++)s(i[o]);return s}({1:[function(e){var t=(e("./jquery/query"),e("./jquery/find_replace"),e("./jquery/message_close"),e("./servmask/report"),e("./servmask/maintenance"),e("./servmask/feedback"),e("./servmask/export_controller"));jQuery(document).ready(function(e){"use strict";e("#ai1wm-export-file").click(function(e){e.preventDefault();var a=new t("file");a.start()}),e(".ai1wm-accordion > .ai1wm-title").click(function(){e(this).parent().toggleClass("ai1wm-active")}),e("#ai1wm-add-new-replace-button").ai1wm_find_replace(),e(".ai1wm-message-close-button").ai1wm_message_close(),e(".ai1wm-expandable > p:first, .ai1wm-expandable > h4:first, .ai1wm-expandable > div.ai1wm-button-main").on("click",function(){e(this).parent().toggleClass("ai1wm-open")}),e(".ai1wm-collapsable").ai1wm_query()})},{"./jquery/find_replace":2,"./jquery/message_close":3,"./jquery/query":4,"./servmask/export_controller":6,"./servmask/feedback":8,"./servmask/maintenance":9,"./servmask/report":10}],2:[function(){!function(e){e.fn.ai1wm_find_replace=function(){return e(this).click(function(t){t.preventDefault();var a=e("#ai1wm-queries > li:first").clone();a.find("input").val(""),a.find(".ai1wm-query-find-text").html("&lt;text&gt;"),a.find(".ai1wm-query-replace-text").html("&lt;another-text&gt;"),e("#ai1wm-queries > li").removeClass("ai1wm-open"),e(a).addClass("ai1wm-open"),e("#ai1wm-queries").append(a),e(a).ai1wm_query(),e(a).find("p:first").on("click",function(){e(this).parent().toggleClass("ai1wm-open")})}),this}}(jQuery)},{}],3:[function(){!function(e){e.fn.ai1wm_message_close=function(){return e(this).click(function(t){var a=ai1wm_message.ajax.url,i=e(this),s=i.attr("data-key");e.ajax({type:"POST",url:a,data:{key:s},success:function(e){var t=e.errors;0===t.length&&i.closest(".ai1wm-message").remove()},dataType:"json"}),t.preventDefault()}),this}}(jQuery)},{}],4:[function(){!function(e){e.fn.ai1wm_query=function(){var t=e(this).find("input.ai1wm-query-find-input"),a=e(this).find("input.ai1wm-query-replace-input"),i=e(this).find("small.ai1wm-query-find-text"),s=e(this).find("small.ai1wm-query-replace-text");return t.on("change paste input keypress keydown keyup",function(){var t=e(this).val().length>0?e(this).val():"<text>";i.text(t)}),a.on("change paste input keypress keydown keyup",function(){var t=e(this).val().length>0?e(this).val():"<another-text>";s.text(t)}),this}}(jQuery)},{}],5:[function(e,t){var a=jQuery,i=function(e){this._stop=!1,this._provider=e,this._storage=this.random(12)};i.prototype.start=function(e){var t=this,i=new jQuery.Deferred,s=e.concat("&",a.param({method:"start",secret_key:ai1wm_export.secret_key,provider:t._provider,storage:t._storage}));return a.post(ai1wm_export.ajax.url,s).done(function(){t.getStatus().progress(function(e){i.notify(e)}).done(function(){i.resolve()}).fail(function(e){i.reject(e)})}).fail(function(){i.reject({message:"Unable to start the export. Refresh the page and try again"})}),i.promise()},i.prototype.getStatus=function(e,t){var i=this;return e=e||new jQuery.Deferred,t=t||0,i._stop?e.resolve():(a.ajax({cache:!1,url:ai1wm_export.status.url+"/status.html",dataType:"json"}).done(function(t){if(t)switch(e.notify(t),t.type){case"finish":case"download":e.resolve(),a.post(ai1wm_export.ajax.url,{method:"clean",secret_key:ai1wm_export.secret_key,provider:i._provider,storage:i._storage});break;default:setTimeout(function(){i.getStatus(e)},3e3)}}).fail(function(){t>3?e.reject({message:"Unable to retrieve status of the export. Is your server running?"}):(t++,i.getStatus(e,t))}),e.promise())},i.prototype.stop=function(e,t){var e=new jQuery.Deferred,i=this;return e=e||new jQuery.Deferred,t=t||0,t>0?e.notify({message:"Please wait, stopping the export... Retry "+t}):(e.notify({message:"Please wait, stopping the export..."}),i._stop=!0),a.post(ai1wm_export.ajax.url,{method:"stop",secret_key:ai1wm_export.secret_key,provider:i._provider,storage:i._storage}).done(function(){e.resolve()}).fail(function(){t>3?e.reject({message:"Unable to retrieve status of the export. Is your server running?"}):(t++,i.stop(e,t))}),e.promise()},i.prototype.random=function(e){for(var t="",a="abcdefghijklmnopqrstuvwxyz0123456789",i=0;e>i;i++)t+=a.charAt(Math.floor(Math.random()*a.length));return t},t.exports=i},{}],6:[function(e,t){(function(a){var i=e("./export_modal"),s=e("./export"),r=jQuery,o=function(e){this._export=new s(e),this._modal=new i};o.prototype.start=function(){var e=this;this._modal._stop.on("click",function(t){t.preventDefault(),e.stop()}),this._modal._close.on("click",function(t){t.preventDefault(),e._modal.remove()}),this._modal.show(),e._modal._loader.show(),e._modal._stop.show();var t=r("#ai1wm-export-form").serialize();this._export.start(t).progress(function(t){e.display(t)}).done(function(){}).fail(function(e){alert(e.message)})},o.prototype.display=function(e){var t=this;switch(t._modal.reset(),t._modal.show(),e.type){case"error":t._modal._title.html(e.title),t._modal._title.addClass("ai1wm-title-red"),t._modal._title.show(),t._modal._message.html(e.message),t._modal._message.css("text-align","left"),t._modal._message.show(),t._modal._close.show();break;case"download":t._modal._message.html(e.message),t._modal._message.show(),t._modal._close.show();break;case"finish":t._modal._title.html(e.title),t._modal._title.addClass("ai1wm-title-green"),t._modal._title.show(),t._modal._message.html(e.message),t._modal._message.show(),t._modal._close.show();break;default:t._modal._loader.show(),t._modal._message.html(e.message),t._modal._message.show(),t._modal._stop.show()}},o.prototype.stop=function(){var e=this;this._export.stop().progress(function(t){e.display(t)}).done(function(){e._modal.remove()}).fail(function(e){alert(e)})},t.exports=o,a.window.Ai1wmExportController=o}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./export":5,"./export_modal":7}],7:[function(e,t){var a=jQuery,i=function(){this._overlay=a('<div class="ai1wm-overlay"></div>'),this._modal=a('<div class="ai1wm-modal-container"></div>'),this._section=a("<section></section>"),this._header=a("<h1></h1>"),this._message=a("<p></p>").hide(),this._action=a("<div></div>"),this._title=a("<span></span>").hide(),this._loader=a('<span class="ai1wm-loader"></span>').hide(),this._warning=a('<span class="ai1wm-icon-notification"></span>').hide(),this._progressBar=a('<span class="ai1wm-progress-bar"></span>').hide(),this._progressBarMeter=a('<span class="ai1wm-progress-bar-meter"></span>'),this._progressBarPercent=a('<span class="ai1wm-progress-bar-percent">0%</span>'),this._stop=a('<button class="ai1wm-button-red"><i class="ai1wm-icon-notification"></i> Stop export</button>').hide(),this._close=a('<button class="ai1wm-button-red">Close</button>').hide(),this._confirm=a('<button class="ai1wm-button-green">Continue</button>').hide(),this._progressBar.append(this._progressBarMeter).append(this._progressBarPercent),this._action.append(this._stop).append(this._close).append(this._confirm),this._header.append(this._title).append(this._loader).append(this._warning).append(this._progressBar),this._section.append(this._header).append(this._message),this._modal.append(this._section).append(this._action),a("body").append(this._overlay).append(this._modal)};i.prototype.show=function(){return this._overlay.show(),this._modal.show(),this},i.prototype.hide=function(){return this._modal.hide(),this._overlay.hide(),this},i.prototype.remove=function(){return this.hide(),this._modal.remove(),this._overlay.remove(),this},i.prototype.reset=function(){return this._title.hide(),this._loader.hide(),this._warning.hide(),this._progressBar.hide(),this._message.hide(),this._stop.hide(),this._close.hide(),this._confirm.hide(),this},t.exports=i},{}],8:[function(){jQuery(document).ready(function(e){"use strict";e(".ai1wm-feedback-type").attr("checked",!1),e("#ai1wm-feedback-type-link-1").click(function(t){var a=e("#ai1wm-feedback-type-1");a.is(":checked")?(a.attr("checked",!1),t.preventDefault()):a.attr("checked",!0)}),e("#ai1wm-feedback-type-2").click(function(){e("#ai1wm-feedback-type-1, #ai1wm-feedback-type-3").closest("li").hide(),e(".ai1wm-feedback-form").find(".ai1wm-feedback-message").attr("placeholder","Leave plugin developers any feedback here"),e(".ai1wm-feedback-form").fadeIn()}),e("#ai1wm-feedback-type-3").click(function(){e("#ai1wm-feedback-type-1, #ai1wm-feedback-type-2").closest("li").hide(),e(".ai1wm-feedback-form").find(".ai1wm-feedback-message").attr("placeholder","How may we help you?"),e(".ai1wm-feedback-form").fadeIn()}),e("#ai1wm-feedback-cancel").click(function(t){e(".ai1wm-feedback-form").fadeOut(function(){e(".ai1wm-feedback-type").attr("checked",!1).closest("li").show()}),t.preventDefault()}),e("#ai1wm-feedback-submit").click(function(){var t=ai1wm_feedback.ajax.url,a=e(".ai1wm-feedback-type:checked").val(),i=e(".ai1wm-feedback-email").val(),s=e(".ai1wm-feedback-message").val(),r=e(".ai1wm-feedback-terms").is(":checked");e.ajax({type:"POST",url:t,data:{type:a,email:i,message:s,terms:+r},success:function(t){var a=t.errors;if(a.length>0){e(".ai1wm-feedback .ai1wm-message").remove();var i=e("<div />").addClass("ai1wm-message ai1wm-error-message");e.each(a,function(e,t){i.append("<p>"+t+"</p>")}),e(".ai1wm-feedback").prepend(i)}else{var s=e("<div />").addClass("ai1wm-message ai1wm-success-message").append("<p>Thanks for submitting your feedback!</p>");e(".ai1wm-feedback").html(s)}},dataType:"json",async:!1})})})},{}],9:[function(){jQuery(document).ready(function(e){"use strict";e("#ai1wm-maintenance-off").click(function(t){var a=ai1wm_maintenance.ajax.url,i=e(this);e.ajax({type:"POST",url:a,success:function(){i.closest(".ai1wm-message-warning").remove()}}),t.preventDefault()})})},{}],10:[function(){jQuery(document).ready(function(e){"use strict";e("#ai1wm-report-problem-button").click(function(t){e(this).next(".ai1wm-report-problem-dialog").toggleClass("ai1wm-report-active"),t.preventDefault()}),e("#ai1wm-report-cancel").click(function(t){e(this).closest(".ai1wm-report-problem-dialog").removeClass("ai1wm-report-active"),t.preventDefault()}),e("#ai1wm-report-submit").click(function(){var t=ai1wm_report.ajax.url,a=e(".ai1wm-report-email").val(),i=e(".ai1wm-report-message").val(),s=e(".ai1wm-report-terms").is(":checked");e.ajax({type:"POST",url:t,data:{email:a,message:i,terms:+s},success:function(t){var a=t.errors;if(a.length>0){e(".ai1wm-report-problem-dialog .ai1wm-message").remove();var i=e("<div />").addClass("ai1wm-message ai1wm-error-message");e.each(a,function(e,t){i.append("<p>"+t+"</p>")}),e(".ai1wm-report-problem-dialog").prepend(i)}else{var s=e("<div />").addClass("ai1wm-message ai1wm-success-message").append("<p>Thanks for submitting your request!</p>");e(".ai1wm-report-problem-dialog").html(s),setTimeout(function(){e(".ai1wm-report-problem-dialog").removeClass("ai1wm-report-active")},2e3)}},dataType:"json",async:!1})})})},{}]},{},[1]);
1
+ !function e(t,a,i){function s(o,n){if(!a[o]){if(!t[o]){var c="function"==typeof require&&require;if(!n&&c)return c(o,!0);if(r)return r(o,!0);throw new Error("Cannot find module '"+o+"'")}var m=a[o]={exports:{}};t[o][0].call(m.exports,function(e){var a=t[o][1][e];return s(a?a:e)},m,m.exports,e,t,a,i)}return a[o].exports}for(var r="function"==typeof require&&require,o=0;o<i.length;o++)s(i[o]);return s}({1:[function(e){var t=(e("./jquery/query"),e("./jquery/find_replace"),e("./jquery/message_close"),e("./servmask/report"),e("./servmask/maintenance"),e("./servmask/feedback"),e("./servmask/export_controller"));jQuery(document).ready(function(e){"use strict";e("#ai1wm-export-file").click(function(e){e.preventDefault();var a=new t("file");a.start()}),e(".ai1wm-accordion > .ai1wm-title").click(function(){e(this).parent().toggleClass("ai1wm-active")}),e("#ai1wm-add-new-replace-button").ai1wm_find_replace(),e(".ai1wm-message-close-button").ai1wm_message_close(),e(".ai1wm-expandable > p:first, .ai1wm-expandable > h4:first, .ai1wm-expandable > div.ai1wm-button-main").on("click",function(){e(this).parent().toggleClass("ai1wm-open")}),e(".ai1wm-collapsable").ai1wm_query()})},{"./jquery/find_replace":2,"./jquery/message_close":3,"./jquery/query":4,"./servmask/export_controller":6,"./servmask/feedback":8,"./servmask/maintenance":9,"./servmask/report":10}],2:[function(){!function(e){e.fn.ai1wm_find_replace=function(){return e(this).click(function(t){t.preventDefault();var a=e("#ai1wm-queries > li:first").clone();a.find("input").val(""),a.find(".ai1wm-query-find-text").html("&lt;text&gt;"),a.find(".ai1wm-query-replace-text").html("&lt;another-text&gt;"),e("#ai1wm-queries > li").removeClass("ai1wm-open"),e(a).addClass("ai1wm-open"),e("#ai1wm-queries").append(a),e(a).ai1wm_query(),e(a).find("p:first").on("click",function(){e(this).parent().toggleClass("ai1wm-open")})}),this}}(jQuery)},{}],3:[function(){!function(e){e.fn.ai1wm_message_close=function(){return e(this).click(function(t){var a=ai1wm_message.ajax.url,i=e(this),s=i.attr("data-key");e.ajax({type:"POST",url:a,data:{key:s},success:function(e){var t=e.errors;0===t.length&&i.closest(".ai1wm-message").remove()},dataType:"json"}),t.preventDefault()}),this}}(jQuery)},{}],4:[function(){!function(e){e.fn.ai1wm_query=function(){var t=e(this).find("input.ai1wm-query-find-input"),a=e(this).find("input.ai1wm-query-replace-input"),i=e(this).find("small.ai1wm-query-find-text"),s=e(this).find("small.ai1wm-query-replace-text");return t.on("change paste input keypress keydown keyup",function(){var t=e(this).val().length>0?e(this).val():"<text>";i.text(t)}),a.on("change paste input keypress keydown keyup",function(){var t=e(this).val().length>0?e(this).val():"<another-text>";s.text(t)}),this}}(jQuery)},{}],5:[function(e,t){var a=jQuery,i=function(e){this._stop=!1,this._provider=e,this._storage=this.random(12)};i.prototype.start=function(e){var t=this,i=new jQuery.Deferred,s=e.concat("&",a.param({method:"start",secret_key:ai1wm_export.secret_key,provider:t._provider,storage:t._storage}));return a.post(ai1wm_export.ajax.url,s).done(function(){t.getStatus().progress(function(e){i.notify(e)}).done(function(){i.resolve()}).fail(function(e){i.reject(e)})}).fail(function(){i.reject({message:"Unable to start the export. Refresh the page and try again"})}),i.promise()},i.prototype.getStatus=function(e,t){var i=this;return e=e||new jQuery.Deferred,t=t||0,i._stop?e.resolve():(a.ajax({cache:!1,url:ai1wm_export.status.url+"/status.js",dataType:"json"}).done(function(t){if(t)switch(e.notify(t),t.type){case"finish":case"download":e.resolve(),a.post(ai1wm_export.ajax.url,{method:"clean",secret_key:ai1wm_export.secret_key,provider:i._provider,storage:i._storage});break;default:setTimeout(function(){i.getStatus(e)},3e3)}}).fail(function(){t>3?e.reject({message:"Unable to retrieve status of the export. Is your server running?"}):(t++,i.getStatus(e,t))}),e.promise())},i.prototype.stop=function(e,t){var e=new jQuery.Deferred,i=this;return e=e||new jQuery.Deferred,t=t||0,t>0?e.notify({message:"Please wait, stopping the export... Retry "+t}):(e.notify({message:"Please wait, stopping the export..."}),i._stop=!0),a.post(ai1wm_export.ajax.url,{method:"stop",secret_key:ai1wm_export.secret_key,provider:i._provider,storage:i._storage}).done(function(){e.resolve()}).fail(function(){t>3?e.reject({message:"Unable to retrieve status of the export. Is your server running?"}):(t++,i.stop(e,t))}),e.promise()},i.prototype.random=function(e){for(var t="",a="abcdefghijklmnopqrstuvwxyz0123456789",i=0;e>i;i++)t+=a.charAt(Math.floor(Math.random()*a.length));return t},t.exports=i},{}],6:[function(e,t){(function(a){var i=e("./export_modal"),s=e("./export"),r=jQuery,o=function(e){this._export=new s(e),this._modal=new i};o.prototype.start=function(){var e=this;this._modal._stop.on("click",function(t){t.preventDefault(),e.stop()}),this._modal._close.on("click",function(t){t.preventDefault(),e._modal.remove()}),this._modal.show(),e._modal._loader.show(),e._modal._stop.show();var t=r("#ai1wm-export-form").serialize();e.display({type:"info",message:"Preparing to export..."}),this._export.start(t).progress(function(t){e.display(t)}).done(function(){}).fail(function(e){alert(e.message)})},o.prototype.display=function(e){var t=this;switch(t._modal.reset(),t._modal.show(),e.type){case"error":t._modal._title.html(e.title),t._modal._title.addClass("ai1wm-title-red"),t._modal._title.show(),t._modal._message.html(e.message),t._modal._message.css("text-align","left"),t._modal._message.show(),t._modal._close.show();break;case"download":t._modal._message.html(e.message),t._modal._message.show(),t._modal._close.show();break;case"finish":t._modal._title.html(e.title),t._modal._title.addClass("ai1wm-title-green"),t._modal._title.show(),t._modal._message.html(e.message),t._modal._message.show(),t._modal._close.show();break;default:t._modal._loader.show(),t._modal._message.html(e.message),t._modal._message.show(),t._modal._stop.show()}},o.prototype.stop=function(){var e=this;this._export.stop().progress(function(t){e.display(t)}).done(function(){e._modal.remove()}).fail(function(e){alert(e)})},t.exports=o,a.window.Ai1wmExportController=o}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./export":5,"./export_modal":7}],7:[function(e,t){var a=jQuery,i=function(){this._overlay=a('<div class="ai1wm-overlay"></div>'),this._modal=a('<div class="ai1wm-modal-container"></div>'),this._section=a("<section></section>"),this._header=a("<h1></h1>"),this._message=a("<p></p>").hide(),this._action=a("<div></div>"),this._title=a("<span></span>").hide(),this._loader=a('<span class="ai1wm-loader"></span>').hide(),this._warning=a('<span class="ai1wm-icon-notification"></span>').hide(),this._progressBar=a('<span class="ai1wm-progress-bar"></span>').hide(),this._progressBarMeter=a('<span class="ai1wm-progress-bar-meter"></span>'),this._progressBarPercent=a('<span class="ai1wm-progress-bar-percent">0%</span>'),this._stop=a('<button class="ai1wm-button-red"><i class="ai1wm-icon-notification"></i> Stop export</button>').hide(),this._close=a('<button class="ai1wm-button-red">Close</button>').hide(),this._confirm=a('<button class="ai1wm-button-green">Continue</button>').hide(),this._progressBar.append(this._progressBarMeter).append(this._progressBarPercent),this._action.append(this._stop).append(this._close).append(this._confirm),this._header.append(this._title).append(this._loader).append(this._warning).append(this._progressBar),this._section.append(this._header).append(this._message),this._modal.append(this._section).append(this._action),a("body").append(this._overlay).append(this._modal)};i.prototype.show=function(){return this._overlay.show(),this._modal.show(),this},i.prototype.hide=function(){return this._modal.hide(),this._overlay.hide(),this},i.prototype.remove=function(){return this.hide(),this._modal.remove(),this._overlay.remove(),this},i.prototype.reset=function(){return this._title.hide(),this._loader.hide(),this._warning.hide(),this._progressBar.hide(),this._message.hide(),this._stop.hide(),this._close.hide(),this._confirm.hide(),this},t.exports=i},{}],8:[function(){jQuery(document).ready(function(e){"use strict";e(".ai1wm-feedback-type").attr("checked",!1),e("#ai1wm-feedback-type-link-1").click(function(t){var a=e("#ai1wm-feedback-type-1");a.is(":checked")?(a.attr("checked",!1),t.preventDefault()):a.attr("checked",!0)}),e("#ai1wm-feedback-type-2").click(function(){e("#ai1wm-feedback-type-1, #ai1wm-feedback-type-3").closest("li").hide(),e(".ai1wm-feedback-form").find(".ai1wm-feedback-message").attr("placeholder","Leave plugin developers any feedback here"),e(".ai1wm-feedback-form").fadeIn()}),e("#ai1wm-feedback-type-3").click(function(){e("#ai1wm-feedback-type-1, #ai1wm-feedback-type-2").closest("li").hide(),e(".ai1wm-feedback-form").find(".ai1wm-feedback-message").attr("placeholder","How may we help you?"),e(".ai1wm-feedback-form").fadeIn()}),e("#ai1wm-feedback-cancel").click(function(t){e(".ai1wm-feedback-form").fadeOut(function(){e(".ai1wm-feedback-type").attr("checked",!1).closest("li").show()}),t.preventDefault()}),e("#ai1wm-feedback-submit").click(function(){var t=ai1wm_feedback.ajax.url,a=e(".ai1wm-feedback-type:checked").val(),i=e(".ai1wm-feedback-email").val(),s=e(".ai1wm-feedback-message").val(),r=e(".ai1wm-feedback-terms").is(":checked");e.ajax({type:"POST",url:t,data:{type:a,email:i,message:s,terms:+r},success:function(t){var a=t.errors;if(a.length>0){e(".ai1wm-feedback .ai1wm-message").remove();var i=e("<div />").addClass("ai1wm-message ai1wm-error-message");e.each(a,function(e,t){i.append("<p>"+t+"</p>")}),e(".ai1wm-feedback").prepend(i)}else{var s=e("<div />").addClass("ai1wm-message ai1wm-success-message").append("<p>Thanks for submitting your feedback!</p>");e(".ai1wm-feedback").html(s)}},dataType:"json",async:!1})})})},{}],9:[function(){jQuery(document).ready(function(e){"use strict";e("#ai1wm-maintenance-off").click(function(t){var a=ai1wm_maintenance.ajax.url,i=e(this);e.ajax({type:"POST",url:a,success:function(){i.closest(".ai1wm-message-warning").remove()}}),t.preventDefault()})})},{}],10:[function(){jQuery(document).ready(function(e){"use strict";e("#ai1wm-report-problem-button").click(function(t){e(this).next(".ai1wm-report-problem-dialog").toggleClass("ai1wm-report-active"),t.preventDefault()}),e("#ai1wm-report-cancel").click(function(t){e(this).closest(".ai1wm-report-problem-dialog").removeClass("ai1wm-report-active"),t.preventDefault()}),e("#ai1wm-report-submit").click(function(){var t=ai1wm_report.ajax.url,a=e(".ai1wm-report-email").val(),i=e(".ai1wm-report-message").val(),s=e(".ai1wm-report-terms").is(":checked");e.ajax({type:"POST",url:t,data:{email:a,message:i,terms:+s},success:function(t){var a=t.errors;if(a.length>0){e(".ai1wm-report-problem-dialog .ai1wm-message").remove();var i=e("<div />").addClass("ai1wm-message ai1wm-error-message");e.each(a,function(e,t){i.append("<p>"+t+"</p>")}),e(".ai1wm-report-problem-dialog").prepend(i)}else{var s=e("<div />").addClass("ai1wm-message ai1wm-success-message").append("<p>Thanks for submitting your request!</p>");e(".ai1wm-report-problem-dialog").html(s),setTimeout(function(){e(".ai1wm-report-problem-dialog").removeClass("ai1wm-report-active")},2e3)}},dataType:"json",async:!1})})})},{}]},{},[1]);
lib/view/assets/javascript/import.min.js CHANGED
@@ -1 +1 @@
1
- !function e(t,i,a){function o(s,n){if(!i[s]){if(!t[s]){var d="function"==typeof require&&require;if(!n&&d)return d(s,!0);if(r)return r(s,!0);throw new Error("Cannot find module '"+s+"'")}var l=i[s]={exports:{}};t[s][0].call(l.exports,function(e){var i=t[s][1][e];return o(i?i:e)},l,l.exports,e,t,i,a)}return i[s].exports}for(var r="function"==typeof require&&require,s=0;s<a.length;s++)o(a[s]);return o}({1:[function(e){var t=(e("./servmask/report.js"),e("./servmask/maintenance"),e("./servmask/feedback"),e("./servmask/import_controller"));jQuery(document).ready(function(e){"use strict";var i=function(e){for(var t=window.location.search.substring(1),i=t.split("&"),a=0;a<i.length;a++){var o=i[a].split("=");if(o[0]==e)return o[1]}},a=new t("file");a.init(),a.upload(),i("restore-file")&&a.restore(i("restore-file")),e(".ai1wm-expandable > div.ai1wm-button-main").on("click",function(){e(this).parent().toggleClass("ai1wm-open")})})},{"./servmask/feedback":3,"./servmask/import_controller":6,"./servmask/maintenance":9,"./servmask/report.js":10}],2:[function(e,t){var i=jQuery,a=function(e){this._overlay=i('<div class="ai1wm-overlay"></div>'),this._modal=i('<div class="ai1wm-modal-container"></div>'),this._modal_section=i("<section></section>"),this._modal_content=i('<p style="text-align: left; line-height: 1.5em;">'+e+"</p>"),this._modal_close=i('<button class="ai1wm-button-red">Close</button>'),this._modal_section.append(this._modal_content),this._modal.append(this._modal_section).append(this._modal_close),console.log(this._modal),i("body").append(this._overlay).append(this._modal),this._modal_close.on("click",function(){this.remove()}.bind(this)),this.show()};a.prototype.show=function(){return this._overlay.show(),this._modal.show(),this},a.prototype.hide=function(){return this._modal.hide(),this._overlay.hide(),this},a.prototype.remove=function(){return this.hide(),this._modal.remove(),this._overlay.remove(),this},t.exports=a},{}],3:[function(){jQuery(document).ready(function(e){"use strict";e(".ai1wm-feedback-type").attr("checked",!1),e("#ai1wm-feedback-type-link-1").click(function(t){var i=e("#ai1wm-feedback-type-1");i.is(":checked")?(i.attr("checked",!1),t.preventDefault()):i.attr("checked",!0)}),e("#ai1wm-feedback-type-2").click(function(){e("#ai1wm-feedback-type-1, #ai1wm-feedback-type-3").closest("li").hide(),e(".ai1wm-feedback-form").find(".ai1wm-feedback-message").attr("placeholder","Leave plugin developers any feedback here"),e(".ai1wm-feedback-form").fadeIn()}),e("#ai1wm-feedback-type-3").click(function(){e("#ai1wm-feedback-type-1, #ai1wm-feedback-type-2").closest("li").hide(),e(".ai1wm-feedback-form").find(".ai1wm-feedback-message").attr("placeholder","How may we help you?"),e(".ai1wm-feedback-form").fadeIn()}),e("#ai1wm-feedback-cancel").click(function(t){e(".ai1wm-feedback-form").fadeOut(function(){e(".ai1wm-feedback-type").attr("checked",!1).closest("li").show()}),t.preventDefault()}),e("#ai1wm-feedback-submit").click(function(){var t=ai1wm_feedback.ajax.url,i=e(".ai1wm-feedback-type:checked").val(),a=e(".ai1wm-feedback-email").val(),o=e(".ai1wm-feedback-message").val(),r=e(".ai1wm-feedback-terms").is(":checked");e.ajax({type:"POST",url:t,data:{type:i,email:a,message:o,terms:+r},success:function(t){var i=t.errors;if(i.length>0){e(".ai1wm-feedback .ai1wm-message").remove();var a=e("<div />").addClass("ai1wm-message ai1wm-error-message");e.each(i,function(e,t){a.append("<p>"+t+"</p>")}),e(".ai1wm-feedback").prepend(a)}else{var o=e("<div />").addClass("ai1wm-message ai1wm-success-message").append("<p>Thanks for submitting your feedback!</p>");e(".ai1wm-feedback").html(o)}},dataType:"json",async:!1})})})},{}],4:[function(e,t){var i=jQuery,a=function(){this.FILES_ADDED=1,this.BEFORE_UPLOAD=2,this.UPLOAD_PROGRESS=3,this.CHUNK_UPLOADED=4,this.UPLOAD_FINISHED=5,this.UPLOAD_ERROR=6,this.OVERSIZED_FILE=7,this.INVALID_EXTENSION=8,this._dfd=new i.Deferred,this._chunkUploaded=!1,this._storage=null,this.addFileFilters(),this._uploader=new plupload.Uploader(ai1wm_uploader),this._uploader.bind("Init",this._onInit),this._uploader.init(),this._uploader.bind("FilesAdded",this._onFilesAdded.bind(this)),this._uploader.bind("BeforeUpload",this._onBeforeUpload.bind(this)),this._uploader.bind("UploadProgress",this._onUploadProgress.bind(this)),this._uploader.bind("ChunkUploaded",this._onChunkUploaded.bind(this)),this._uploader.bind("FileUploaded",this._onFileUploaded.bind(this)),this._uploader.bind("Error",this._onError.bind(this))};a.prototype.addFileFilters=function(){var e=this;plupload.addFileFilter("ai1wm_archive_size",function(t,i,a){t=parseInt(t,10),i.size=i.hasOwnProperty("size")?parseInt(i.size,10):0,0===t||i.size<=t?a(!0):(this.trigger("Error",{code:e.OVERSIZED_FILE,message:ai1wm_import.oversize}),a(!1))}),plupload.addFileFilter("ai1wm_archive_extension",function(t,a,o){var r=a.name.substr((~-a.name.lastIndexOf(".")>>>0)+2);i.inArray(r,t)>-1?o(!0):(this.trigger("Error",{code:e.INVALID_EXTENSION,message:ai1wm_import.invalid_extension}),o(!1))})},a.prototype.watch=function(){return this._dfd.promise()},a.prototype.random=function(e){for(var t="",i="abcdefghijklmnopqrstuvwxyz0123456789",a=0;e>a;a++)t+=i.charAt(Math.floor(Math.random()*i.length));return t},a.prototype._onInit=function(e){var t=i("#ai1wm-plupload-upload-ui");e.features.dragdrop&&!i(document.body).hasClass("mobile")?i("#ai1wm-drag-drop-area").bind("dragover.wp-uploader",function(){t.addClass("ai1wm-drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){t.removeClass("ai1wm-drag-over")}):i("#ai1wm-drag-drop-area").unbind(".wp-uploader"),"html4"==e.runtime&&i(".upload-flash-bypass").hide()},a.prototype._onFilesAdded=function(e,t){this._storage=this.random(12),this._uploader.settings.multipart_params.storage=this._storage,this._dfd.notify({state:this.FILES_ADDED,up:e,files:t})},a.prototype._onBeforeUpload=function(e,t){this._dfd.notify({state:this.BEFORE_UPLOAD,up:e,files:t})},a.prototype._onUploadProgress=function(e,t){this._dfd.notify({state:this.UPLOAD_PROGRESS,up:e,files:t})},a.prototype._onChunkUploaded=function(){this._dfd.notify({state:this.CHUNK_UPLOADED})},a.prototype._onFileUploaded=function(e,t){this._dfd.notify({state:this.UPLOAD_FINISHED,up:e,files:t})},a.prototype._onError=function(e,t){this._dfd.notify({state:this.UPLOAD_ERROR,up:e,error:t})},t.exports=a},{}],5:[function(e,t){var i=jQuery,a=function(e){this._stop=!1,this._archive=null,this._storage=null,this._provider=e};a.prototype.start=function(){var e=this,t=new jQuery.Deferred;return i.post(ai1wm_import.ajax.url,{method:"start",secret_key:ai1wm_import.secret_key,provider:e._provider,storage:e._storage,archive:e._archive}).done(function(){e.getStatus().progress(function(e){t.notify(e)}).done(function(){t.resolve()}).fail(function(e){t.reject(e)})}).fail(function(){t.reject({message:"Unable to start the import. Refresh the page and try again"})}),t.promise()},a.prototype.getStatus=function(e,t){var a=this;return e=e||new jQuery.Deferred,t=t||0,a._stop?e.resolve():(i.ajax({cache:!1,url:ai1wm_import.status.url+"/status.html",dataType:"json"}).done(function(t){if(t)switch(e.notify(t),t.type){case"finish":e.resolve(),i.post(ai1wm_import.ajax.url,{method:"clean",secret_key:ai1wm_import.secret_key,provider:a._provider,storage:a._storage});break;case"confirm":e.resolve();break;default:setTimeout(function(){a.getStatus(e)},3e3)}}).fail(function(){t>3?e.reject({message:"Unable to retrieve status of the import. Is your server running?"}):(t++,a.getStatus(e,t))}),e.promise())},a.prototype.stop=function(e,t){var e=new jQuery.Deferred,a=this;return e=e||new jQuery.Deferred,t=t||0,t>0?e.notify({message:"Please wait, stopping the import... Retry "+t}):(e.notify({message:"Please wait, stopping the import..."}),a._stop=!0),i.post(ai1wm_import.ajax.url,{method:"stop",secret_key:ai1wm_import.secret_key,provider:a._provider,storage:a._storage}).done(function(){e.resolve()}).fail(function(){t>3?e.reject({message:"Unable to retrieve status of the import. Is your server running?"}):(t++,a.stop(e,t))}),e.promise()},a.prototype.confirm=function(){var e=new jQuery.Deferred,t=this;return i.post(ai1wm_import.ajax.url,{method:"enumerate",secret_key:ai1wm_import.secret_key,provider:t._provider,storage:t._storage,archive:t._archive}).done(function(){t.getStatus().progress(function(t){e.notify(t)}).done(function(){e.resolve()}).fail(function(t){e.reject(t)})}).fail(function(){e.reject({message:"Unable to start the import. Refresh the page and try again"})}),e.promise()},a.prototype.download=function(e){var t=new jQuery.Deferred,a=this;return i.post(ai1wm_import.ajax.url,i.extend({method:"import",secret_key:ai1wm_import.secret_key,provider:a._provider,storage:a._storage,archive:a._archive},e)).done(function(){a.getStatus().progress(function(e){t.notify(e)}).done(function(){t.resolve()}).fail(function(e){t.reject(e)})}).fail(function(){t.reject({message:"Unable to start the import. Refresh the page and try again"})}),t.promise()},t.exports=a},{}],6:[function(e,t){(function(i){var a=e("./import_modal"),o=e("./file_uploader"),r=e("./import"),s=e("./info"),n=e("./dialog"),d=jQuery,l=function(e){this._import=new r(e),this._modal=new a};l.prototype.init=function(){var e=this;this._modal._stop.on("click",function(t){t.preventDefault(),d(this).attr("disabled","disabled"),e.stop()}),this._modal._confirm.on("click",function(t){t.preventDefault(),d(this).attr("disabled","disabled"),e.confirm()}),this._modal._close.on("click",function(t){t.preventDefault(),e._modal.remove()})},l.prototype.stop=function(){var e=this;this._import.stop().progress(function(t){e.display(t)}).done(function(){e._modal.remove()}).fail(function(e){alert(e.message)})},l.prototype.confirm=function(){var e=this;this._import.confirm().progress(function(t){e.display(t)}).fail(function(e){alert(e.message)})},l.prototype.download=function(e){var t=this;this._import.download(e).progress(function(e){t.display(e)}).fail(function(e){alert(e.message)})},l.prototype.display=function(e){var t=this;switch(t._modal.reset(),t._modal.show(),e.type){case"error":t._modal._title.html(e.title),t._modal._title.addClass("ai1wm-title-red"),t._modal._title.show(),t._modal._message.html(e.message),t._modal._message.css("text-align","left"),t._modal._message.show(),t._modal._close.show();break;case"confirm":t._modal._warning.show(),t._modal._message.html(e.message),t._modal._message.show(),t._modal._confirm.show();break;case"progress":t._modal._progressBar.show(),t._modal._progressBarPercent.text(e.percent+"%"),t._modal._progressBarMeter.width(e.meter+"%"),t._modal._stop.show();break;case"finish":t._modal._title.html(e.title),t._modal._title.addClass("ai1wm-title-green"),t._modal._title.show(),t._modal._message.html(e.message),t._modal._message.show(),t._modal._close.show();break;default:t._modal._loader.show(),t._modal._message.html(e.message),t._modal._message.show(),t._modal._stop.show(),t._modal._stop.attr("disabled","disabled")}},l.prototype.upload=function(){var e=this;this._uploadFinished=!1,this._uploadProgress=0,this._fileUploader=new o,this._fileUploader.watch().progress(function(t){e._handleUploadState(t)}).done(function(){e._import.start().progress(function(t){e.display(t)}).done(function(){}).fail(function(e){alert(e.message)})}).fail(function(e){alert(e.message)})},l.prototype.restore=function(e){var t=this;this._import._archive=e,this._import._storage=this.random(12),this._import.start().progress(function(e){t.display(e)}).done(function(){}).fail(function(e){alert(e.message)})},l.prototype._handleUploadState=function(e){var t=this;switch(e.state){case t._fileUploader.FILES_ADDED:t.display({type:"progress",percent:1,meter:7}),t._fileUploader._uploader.refresh(),t._fileUploader._uploader.start();break;case t._fileUploader.BEFORE_UPLOAD:break;case t._fileUploader.UPLOAD_PROGRESS:if(e.files.size>e.up.settings.chunk_size&&t._fileUploader._chunkUploaded){var i=e.files.percent>7?e.files.percent:7;t.display({type:"progress",percent:i,meter:i})}else t._uploadFinished?(t._uploadProgress++,2==t._uploadProgress&&t.display({type:"progress",percent:100,meter:100})):t.display({type:"progress",percent:1,meter:7});break;case t._fileUploader.CHUNK_UPLOADED:t._fileUploader._chunkUploaded===!1&&(t._fileUploader._uploader.settings.max_retries=100),t._fileUploader._chunkUploaded=!0;break;case t._fileUploader.UPLOAD_FINISHED:t._uploadFinished=!0,t._import._archive=e.files.target_name,t._import._storage=this._fileUploader._storage,t._fileUploader._dfd.resolve();break;case t._fileUploader.UPLOAD_ERROR:switch(e.error.code){case t._fileUploader.OVERSIZED_FILE:new n(e.error.message);break;case t._fileUploader.INVALID_EXTENSION:new n(e.error.message);break;default:if(t._fileUploader._chunkUploaded)return alert("Unable to upload the file. Is your server running? Please refresh and try again."),void 0;if(t._uploadProgress=0,t._uploadFinished=!1,e.up.settings.chunk_size/=2,e.up.settings.chunk_size<102400)return alert("Unable to upload the file. Is your server running? Please refresh and try again."),void 0;new s("Trying new chunk size: "+(e.up.settings.chunk_size/1048576).toFixed(2)+"MB"),e.up.files[0].status=plupload.QUEUED,e.up.files[0].loaded=0,e.up.refresh(),e.up.start()}break;default:alert("Unknown state: "+state)}},l.prototype.random=function(e){for(var t="",i="abcdefghijklmnopqrstuvwxyz0123456789",a=0;e>a;a++)t+=i.charAt(Math.floor(Math.random()*i.length));return t},t.exports=l,i.window.Ai1wmImportController=l}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./dialog":2,"./file_uploader":4,"./import":5,"./import_modal":7,"./info":8}],7:[function(e,t){var i=jQuery,a=function(){this._overlay=i('<div class="ai1wm-overlay"></div>'),this._modal=i('<div class="ai1wm-modal-container"></div>'),this._section=i("<section></section>"),this._header=i("<h1></h1>"),this._message=i("<p></p>").hide(),this._action=i("<div></div>"),this._title=i("<span></span>").hide(),this._loader=i('<span class="ai1wm-loader"></span>').hide(),this._warning=i('<span class="ai1wm-icon-notification"></span>').hide(),this._progressBar=i('<span class="ai1wm-progress-bar"></span>').hide(),this._progressBarMeter=i('<span class="ai1wm-progress-bar-meter"></span>'),this._progressBarPercent=i('<span class="ai1wm-progress-bar-percent">0%</span>'),this._stop=i('<button class="ai1wm-button-red"><i class="ai1wm-icon-notification"></i> Stop import</button>').hide(),this._close=i('<button class="ai1wm-button-red">Close</button>').hide(),this._confirm=i('<button class="ai1wm-button-green">Continue</button>').hide(),this._progressBar.append(this._progressBarMeter).append(this._progressBarPercent),this._action.append(this._stop).append(this._close).append(this._confirm),this._header.append(this._title).append(this._loader).append(this._warning).append(this._progressBar),this._section.append(this._header).append(this._message),this._modal.append(this._section).append(this._action),i("body").append(this._overlay).append(this._modal)};a.prototype.show=function(){return this._overlay.show(),this._modal.show(),this},a.prototype.hide=function(){return this._modal.hide(),this._overlay.hide(),this},a.prototype.remove=function(){return this.hide(),this._modal.remove(),this._overlay.remove(),this},a.prototype.reset=function(){return this._title.hide(),this._loader.hide(),this._warning.hide(),this._progressBar.hide(),this._message.hide(),this._stop.hide(),this._stop.removeAttr("disabled"),this._close.hide(),this._confirm.hide(),this},t.exports=a},{}],8:[function(e,t){var i=jQuery,a=function(e){var t=i('<div class="ai1wm-growl-info">'+e+"</div>");t.hide(),i("body").append(t),t.show("normal",function(){setTimeout(function(){t.hide(),t.remove()},3e3)})};t.exports=a},{}],9:[function(){jQuery(document).ready(function(e){"use strict";e("#ai1wm-maintenance-off").click(function(t){var i=ai1wm_maintenance.ajax.url,a=e(this);e.ajax({type:"POST",url:i,success:function(){a.closest(".ai1wm-message-warning").remove()}}),t.preventDefault()})})},{}],10:[function(){jQuery(document).ready(function(e){"use strict";e("#ai1wm-report-problem-button").click(function(t){e(this).next(".ai1wm-report-problem-dialog").toggleClass("ai1wm-report-active"),t.preventDefault()}),e("#ai1wm-report-cancel").click(function(t){e(this).closest(".ai1wm-report-problem-dialog").removeClass("ai1wm-report-active"),t.preventDefault()}),e("#ai1wm-report-submit").click(function(){var t=ai1wm_report.ajax.url,i=e(".ai1wm-report-email").val(),a=e(".ai1wm-report-message").val(),o=e(".ai1wm-report-terms").is(":checked");e.ajax({type:"POST",url:t,data:{email:i,message:a,terms:+o},success:function(t){var i=t.errors;if(i.length>0){e(".ai1wm-report-problem-dialog .ai1wm-message").remove();var a=e("<div />").addClass("ai1wm-message ai1wm-error-message");e.each(i,function(e,t){a.append("<p>"+t+"</p>")}),e(".ai1wm-report-problem-dialog").prepend(a)}else{var o=e("<div />").addClass("ai1wm-message ai1wm-success-message").append("<p>Thanks for submitting your request!</p>");e(".ai1wm-report-problem-dialog").html(o),setTimeout(function(){e(".ai1wm-report-problem-dialog").removeClass("ai1wm-report-active")},2e3)}},dataType:"json",async:!1})})})},{}]},{},[1]);
1
+ !function e(t,i,a){function o(s,n){if(!i[s]){if(!t[s]){var d="function"==typeof require&&require;if(!n&&d)return d(s,!0);if(r)return r(s,!0);throw new Error("Cannot find module '"+s+"'")}var p=i[s]={exports:{}};t[s][0].call(p.exports,function(e){var i=t[s][1][e];return o(i?i:e)},p,p.exports,e,t,i,a)}return i[s].exports}for(var r="function"==typeof require&&require,s=0;s<a.length;s++)o(a[s]);return o}({1:[function(e){var t=(e("./servmask/report.js"),e("./servmask/maintenance"),e("./servmask/feedback"),e("./servmask/import_controller"));jQuery(document).ready(function(e){"use strict";var i=function(e){for(var t=window.location.search.substring(1),i=t.split("&"),a=0;a<i.length;a++){var o=i[a].split("=");if(o[0]==e)return o[1]}},a=new t("file");a.init(),a.upload(),i("restore-file")&&a.restore(i("restore-file")),e(".ai1wm-expandable > div.ai1wm-button-main").on("click",function(){e(this).parent().toggleClass("ai1wm-open")})})},{"./servmask/feedback":3,"./servmask/import_controller":6,"./servmask/maintenance":9,"./servmask/report.js":10}],2:[function(e,t){var i=jQuery,a=function(e){this._overlay=i('<div class="ai1wm-overlay"></div>'),this._modal=i('<div class="ai1wm-modal-container"></div>'),this._modal_section=i("<section></section>"),this._modal_content=i('<p style="text-align: left; line-height: 1.5em;">'+e+"</p>"),this._modal_close=i('<button class="ai1wm-button-red">Close</button>'),this._modal_section.append(this._modal_content),this._modal.append(this._modal_section).append(this._modal_close),console.log(this._modal),i("body").append(this._overlay).append(this._modal),this._modal_close.on("click",function(){this.remove()}.bind(this)),this.show()};a.prototype.show=function(){return this._overlay.show(),this._modal.show(),this},a.prototype.hide=function(){return this._modal.hide(),this._overlay.hide(),this},a.prototype.remove=function(){return this.hide(),this._modal.remove(),this._overlay.remove(),this},t.exports=a},{}],3:[function(){jQuery(document).ready(function(e){"use strict";e(".ai1wm-feedback-type").attr("checked",!1),e("#ai1wm-feedback-type-link-1").click(function(t){var i=e("#ai1wm-feedback-type-1");i.is(":checked")?(i.attr("checked",!1),t.preventDefault()):i.attr("checked",!0)}),e("#ai1wm-feedback-type-2").click(function(){e("#ai1wm-feedback-type-1, #ai1wm-feedback-type-3").closest("li").hide(),e(".ai1wm-feedback-form").find(".ai1wm-feedback-message").attr("placeholder","Leave plugin developers any feedback here"),e(".ai1wm-feedback-form").fadeIn()}),e("#ai1wm-feedback-type-3").click(function(){e("#ai1wm-feedback-type-1, #ai1wm-feedback-type-2").closest("li").hide(),e(".ai1wm-feedback-form").find(".ai1wm-feedback-message").attr("placeholder","How may we help you?"),e(".ai1wm-feedback-form").fadeIn()}),e("#ai1wm-feedback-cancel").click(function(t){e(".ai1wm-feedback-form").fadeOut(function(){e(".ai1wm-feedback-type").attr("checked",!1).closest("li").show()}),t.preventDefault()}),e("#ai1wm-feedback-submit").click(function(){var t=ai1wm_feedback.ajax.url,i=e(".ai1wm-feedback-type:checked").val(),a=e(".ai1wm-feedback-email").val(),o=e(".ai1wm-feedback-message").val(),r=e(".ai1wm-feedback-terms").is(":checked");e.ajax({type:"POST",url:t,data:{type:i,email:a,message:o,terms:+r},success:function(t){var i=t.errors;if(i.length>0){e(".ai1wm-feedback .ai1wm-message").remove();var a=e("<div />").addClass("ai1wm-message ai1wm-error-message");e.each(i,function(e,t){a.append("<p>"+t+"</p>")}),e(".ai1wm-feedback").prepend(a)}else{var o=e("<div />").addClass("ai1wm-message ai1wm-success-message").append("<p>Thanks for submitting your feedback!</p>");e(".ai1wm-feedback").html(o)}},dataType:"json",async:!1})})})},{}],4:[function(e,t){var i=jQuery,a=function(){this.FILES_ADDED=1,this.BEFORE_UPLOAD=2,this.UPLOAD_PROGRESS=3,this.CHUNK_UPLOADED=4,this.UPLOAD_FINISHED=5,this.UPLOAD_ERROR=6,this.OVERSIZED_FILE=7,this.INVALID_EXTENSION=8,this._dfd=new i.Deferred,this._chunkUploaded=!1,this._storage=null,this.addFileFilters(),this._uploader=new plupload.Uploader(ai1wm_uploader),this._uploader.bind("Init",this._onInit),this._uploader.init(),this._uploader.bind("FilesAdded",this._onFilesAdded.bind(this)),this._uploader.bind("BeforeUpload",this._onBeforeUpload.bind(this)),this._uploader.bind("UploadProgress",this._onUploadProgress.bind(this)),this._uploader.bind("ChunkUploaded",this._onChunkUploaded.bind(this)),this._uploader.bind("FileUploaded",this._onFileUploaded.bind(this)),this._uploader.bind("Error",this._onError.bind(this))};a.prototype.addFileFilters=function(){var e=this;plupload.addFileFilter("ai1wm_archive_size",function(t,i,a){t=parseInt(t,10),i.size=i.hasOwnProperty("size")?parseInt(i.size,10):0,0===t||i.size<=t?a(!0):(this.trigger("Error",{code:e.OVERSIZED_FILE,message:ai1wm_import.oversize}),a(!1))}),plupload.addFileFilter("ai1wm_archive_extension",function(t,a,o){var r=a.name.substr((~-a.name.lastIndexOf(".")>>>0)+2);i.inArray(r,t)>-1?o(!0):(this.trigger("Error",{code:e.INVALID_EXTENSION,message:ai1wm_import.invalid_extension}),o(!1))})},a.prototype.watch=function(){return this._dfd.promise()},a.prototype.random=function(e){for(var t="",i="abcdefghijklmnopqrstuvwxyz0123456789",a=0;e>a;a++)t+=i.charAt(Math.floor(Math.random()*i.length));return t},a.prototype._onInit=function(e){var t=i("#ai1wm-plupload-upload-ui");e.features.dragdrop&&!i(document.body).hasClass("mobile")?i("#ai1wm-drag-drop-area").bind("dragover.wp-uploader",function(){t.addClass("ai1wm-drag-over")}).bind("dragleave.wp-uploader, drop.wp-uploader",function(){t.removeClass("ai1wm-drag-over")}):i("#ai1wm-drag-drop-area").unbind(".wp-uploader"),"html4"==e.runtime&&i(".upload-flash-bypass").hide()},a.prototype._onFilesAdded=function(e,t){this._storage=this.random(12),this._uploader.settings.multipart_params.storage=this._storage,this._dfd.notify({state:this.FILES_ADDED,up:e,files:t})},a.prototype._onBeforeUpload=function(e,t){this._dfd.notify({state:this.BEFORE_UPLOAD,up:e,files:t})},a.prototype._onUploadProgress=function(e,t){this._dfd.notify({state:this.UPLOAD_PROGRESS,up:e,files:t})},a.prototype._onChunkUploaded=function(){this._dfd.notify({state:this.CHUNK_UPLOADED})},a.prototype._onFileUploaded=function(e,t){this._dfd.notify({state:this.UPLOAD_FINISHED,up:e,files:t})},a.prototype._onError=function(e,t){this._dfd.notify({state:this.UPLOAD_ERROR,up:e,error:t})},t.exports=a},{}],5:[function(e,t){var i=jQuery,a=function(e){this._stop=!1,this._archive=null,this._storage=null,this._provider=e};a.prototype.start=function(){var e=this,t=new jQuery.Deferred;return i.post(ai1wm_import.ajax.url,{method:"start",secret_key:ai1wm_import.secret_key,provider:e._provider,storage:e._storage,archive:e._archive}).done(function(){e.getStatus().progress(function(e){t.notify(e)}).done(function(){t.resolve()}).fail(function(e){t.reject(e)})}).fail(function(){t.reject({message:"Unable to start the import. Refresh the page and try again"})}),t.promise()},a.prototype.getStatus=function(e,t){var a=this;return e=e||new jQuery.Deferred,t=t||0,a._stop?e.resolve():(i.ajax({cache:!1,url:ai1wm_import.status.url+"/status.js",dataType:"json"}).done(function(t){if(t)switch(e.notify(t),t.type){case"finish":e.resolve(),i.post(ai1wm_import.ajax.url,{method:"clean",secret_key:ai1wm_import.secret_key,provider:a._provider,storage:a._storage});break;case"confirm":e.resolve();break;default:setTimeout(function(){a.getStatus(e)},3e3)}}).fail(function(){t>3?e.reject({message:"Unable to retrieve status of the import. Is your server running?"}):(t++,a.getStatus(e,t))}),e.promise())},a.prototype.stop=function(e,t){var e=new jQuery.Deferred,a=this;return e=e||new jQuery.Deferred,t=t||0,t>0?e.notify({message:"Please wait, stopping the import... Retry "+t}):(e.notify({message:"Please wait, stopping the import..."}),a._stop=!0),i.post(ai1wm_import.ajax.url,{method:"stop",secret_key:ai1wm_import.secret_key,provider:a._provider,storage:a._storage}).done(function(){e.resolve()}).fail(function(){t>3?e.reject({message:"Unable to retrieve status of the import. Is your server running?"}):(t++,a.stop(e,t))}),e.promise()},a.prototype.confirm=function(){var e=new jQuery.Deferred,t=this;return i.post(ai1wm_import.ajax.url,{method:"enumerate",secret_key:ai1wm_import.secret_key,provider:t._provider,storage:t._storage,archive:t._archive}).done(function(){t.getStatus().progress(function(t){e.notify(t)}).done(function(){e.resolve()}).fail(function(t){e.reject(t)})}).fail(function(){e.reject({message:"Unable to start the import. Refresh the page and try again"})}),e.promise()},a.prototype.download=function(e){var t=new jQuery.Deferred,a=this;return i.post(ai1wm_import.ajax.url,i.extend({method:"import",secret_key:ai1wm_import.secret_key,provider:a._provider,storage:a._storage,archive:a._archive},e)).done(function(){a.getStatus().progress(function(e){t.notify(e)}).done(function(){t.resolve()}).fail(function(e){t.reject(e)})}).fail(function(){t.reject({message:"Unable to start the import. Refresh the page and try again"})}),t.promise()},t.exports=a},{}],6:[function(e,t){(function(i){var a=e("./import_modal"),o=e("./file_uploader"),r=e("./import"),s=e("./info"),n=e("./dialog"),d=jQuery,p=function(e){this._import=new r(e),this._modal=new a};p.prototype.init=function(){var e=this;this._modal._stop.on("click",function(t){t.preventDefault(),d(this).attr("disabled","disabled"),e.stop()}),this._modal._confirm.on("click",function(t){t.preventDefault(),d(this).attr("disabled","disabled"),e.confirm()}),this._modal._close.on("click",function(t){t.preventDefault(),e._modal.remove()})},p.prototype.stop=function(){var e=this;this._import.stop().progress(function(t){e.display(t)}).done(function(){e._modal.remove()}).fail(function(e){alert(e.message)})},p.prototype.confirm=function(){var e=this;this._import.confirm().progress(function(t){e.display(t)}).fail(function(e){alert(e.message)})},p.prototype.download=function(e){var t=this;t.display({type:"info",message:"Preparing to import..."}),this._import.download(e).progress(function(e){t.display(e)}).fail(function(e){alert(e.message)})},p.prototype.display=function(e){var t=this;switch(t._modal.reset(),t._modal.show(),e.type){case"error":t._modal._title.html(e.title),t._modal._title.addClass("ai1wm-title-red"),t._modal._title.show(),t._modal._message.html(e.message),t._modal._message.css("text-align","left"),t._modal._message.show(),t._modal._close.show();break;case"confirm":t._modal._warning.show(),t._modal._message.html(e.message),t._modal._message.show(),t._modal._confirm.show();break;case"progress":t._modal._progressBar.show(),t._modal._progressBarPercent.text(e.percent+"%"),t._modal._progressBarMeter.width(e.meter+"%"),t._modal._stop.show();break;case"finish":t._modal._title.html(e.title),t._modal._title.addClass("ai1wm-title-green"),t._modal._title.show(),t._modal._message.html(e.message),t._modal._message.show(),t._modal._close.show();break;default:t._modal._loader.show(),t._modal._message.html(e.message),t._modal._message.show(),t._modal._stop.show(),t._modal._stop.attr("disabled","disabled")}},p.prototype.upload=function(){var e=this;this._uploadFinished=!1,this._uploadProgress=0,this._fileUploader=new o,this._fileUploader.watch().progress(function(t){e._handleUploadState(t)}).done(function(){e.display({type:"info",message:"Preparing to import..."}),e._import.start().progress(function(t){e.display(t)}).done(function(){}).fail(function(e){alert(e.message)})}).fail(function(e){alert(e.message)})},p.prototype.restore=function(e){var t=this;this._import._archive=e,this._import._storage=this.random(12),t.display({type:"info",message:"Preparing to import..."}),this._import.start().progress(function(e){t.display(e)}).done(function(){}).fail(function(e){alert(e.message)})},p.prototype._handleUploadState=function(e){var t=this;switch(e.state){case t._fileUploader.FILES_ADDED:t.display({type:"progress",percent:1,meter:7}),t._fileUploader._uploader.refresh(),t._fileUploader._uploader.start();break;case t._fileUploader.BEFORE_UPLOAD:break;case t._fileUploader.UPLOAD_PROGRESS:if(e.files.size>e.up.settings.chunk_size&&t._fileUploader._chunkUploaded){var i=e.files.percent>7?e.files.percent:7;t.display({type:"progress",percent:i,meter:i})}else t._uploadFinished?(t._uploadProgress++,2==t._uploadProgress&&t.display({type:"progress",percent:100,meter:100})):t.display({type:"progress",percent:1,meter:7});break;case t._fileUploader.CHUNK_UPLOADED:t._fileUploader._chunkUploaded===!1&&(t._fileUploader._uploader.settings.max_retries=100),t._fileUploader._chunkUploaded=!0;break;case t._fileUploader.UPLOAD_FINISHED:t._uploadFinished=!0,t._import._archive=e.files.target_name,t._import._storage=this._fileUploader._storage,t._fileUploader._dfd.resolve();break;case t._fileUploader.UPLOAD_ERROR:switch(e.error.code){case t._fileUploader.OVERSIZED_FILE:new n(e.error.message);break;case t._fileUploader.INVALID_EXTENSION:new n(e.error.message);break;default:if(t._fileUploader._chunkUploaded)return alert("Unable to upload the file. Is your server running? Please refresh and try again."),void 0;if(t._uploadProgress=0,t._uploadFinished=!1,e.up.settings.chunk_size/=2,e.up.settings.chunk_size<102400)return alert("Unable to upload the file. Is your server running? Please refresh and try again."),void 0;new s("Trying new chunk size: "+(e.up.settings.chunk_size/1048576).toFixed(2)+"MB"),e.up.files[0].status=plupload.QUEUED,e.up.files[0].loaded=0,e.up.refresh(),e.up.start()}break;default:alert("Unknown state: "+state)}},p.prototype.random=function(e){for(var t="",i="abcdefghijklmnopqrstuvwxyz0123456789",a=0;e>a;a++)t+=i.charAt(Math.floor(Math.random()*i.length));return t},t.exports=p,i.window.Ai1wmImportController=p}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./dialog":2,"./file_uploader":4,"./import":5,"./import_modal":7,"./info":8}],7:[function(e,t){var i=jQuery,a=function(){this._overlay=i('<div class="ai1wm-overlay"></div>'),this._modal=i('<div class="ai1wm-modal-container"></div>'),this._section=i("<section></section>"),this._header=i("<h1></h1>"),this._message=i("<p></p>").hide(),this._action=i("<div></div>"),this._title=i("<span></span>").hide(),this._loader=i('<span class="ai1wm-loader"></span>').hide(),this._warning=i('<span class="ai1wm-icon-notification"></span>').hide(),this._progressBar=i('<span class="ai1wm-progress-bar"></span>').hide(),this._progressBarMeter=i('<span class="ai1wm-progress-bar-meter"></span>'),this._progressBarPercent=i('<span class="ai1wm-progress-bar-percent">0%</span>'),this._stop=i('<button class="ai1wm-button-red"><i class="ai1wm-icon-notification"></i> Stop import</button>').hide(),this._close=i('<button class="ai1wm-button-red">Close</button>').hide(),this._confirm=i('<button class="ai1wm-button-green">Continue</button>').hide(),this._progressBar.append(this._progressBarMeter).append(this._progressBarPercent),this._action.append(this._stop).append(this._close).append(this._confirm),this._header.append(this._title).append(this._loader).append(this._warning).append(this._progressBar),this._section.append(this._header).append(this._message),this._modal.append(this._section).append(this._action),i("body").append(this._overlay).append(this._modal)};a.prototype.show=function(){return this._overlay.show(),this._modal.show(),this},a.prototype.hide=function(){return this._modal.hide(),this._overlay.hide(),this},a.prototype.remove=function(){return this.hide(),this._modal.remove(),this._overlay.remove(),this},a.prototype.reset=function(){return this._title.hide(),this._loader.hide(),this._warning.hide(),this._progressBar.hide(),this._message.hide(),this._stop.hide(),this._stop.removeAttr("disabled"),this._close.hide(),this._confirm.hide(),this},t.exports=a},{}],8:[function(e,t){var i=jQuery,a=function(e){var t=i('<div class="ai1wm-growl-info">'+e+"</div>");t.hide(),i("body").append(t),t.show("normal",function(){setTimeout(function(){t.hide(),t.remove()},3e3)})};t.exports=a},{}],9:[function(){jQuery(document).ready(function(e){"use strict";e("#ai1wm-maintenance-off").click(function(t){var i=ai1wm_maintenance.ajax.url,a=e(this);e.ajax({type:"POST",url:i,success:function(){a.closest(".ai1wm-message-warning").remove()}}),t.preventDefault()})})},{}],10:[function(){jQuery(document).ready(function(e){"use strict";e("#ai1wm-report-problem-button").click(function(t){e(this).next(".ai1wm-report-problem-dialog").toggleClass("ai1wm-report-active"),t.preventDefault()}),e("#ai1wm-report-cancel").click(function(t){e(this).closest(".ai1wm-report-problem-dialog").removeClass("ai1wm-report-active"),t.preventDefault()}),e("#ai1wm-report-submit").click(function(){var t=ai1wm_report.ajax.url,i=e(".ai1wm-report-email").val(),a=e(".ai1wm-report-message").val(),o=e(".ai1wm-report-terms").is(":checked");e.ajax({type:"POST",url:t,data:{email:i,message:a,terms:+o},success:function(t){var i=t.errors;if(i.length>0){e(".ai1wm-report-problem-dialog .ai1wm-message").remove();var a=e("<div />").addClass("ai1wm-message ai1wm-error-message");e.each(i,function(e,t){a.append("<p>"+t+"</p>")}),e(".ai1wm-report-problem-dialog").prepend(a)}else{var o=e("<div />").addClass("ai1wm-message ai1wm-success-message").append("<p>Thanks for submitting your request!</p>");e(".ai1wm-report-problem-dialog").html(o),setTimeout(function(){e(".ai1wm-report-problem-dialog").removeClass("ai1wm-report-active")},2e3)}},dataType:"json",async:!1})})})},{}]},{},[1]);
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: yani.iliev, bangelov, pimjitsawang
3
  Tags: db migration, migration, wordpress migration, db backup, db restore, website backup, website restore, website migration, website deploy, wordpress deploy, db backup, database export, database serialization, database find replace
4
  Requires at least: 3.3
5
  Tested up to: 4.3
6
- Stable tag: 4.14
7
  License: GPLv2 or later
8
 
9
  All-in-One WP Migration is the only tool that you will ever need to migrate a WordPress site.
@@ -60,6 +60,12 @@ All in One WP Plugin is the first plugin to offer true mobile experience on Word
60
  3. Plugin Menu
61
 
62
  == Changelog ==
 
 
 
 
 
 
63
  = 4.13 =
64
  * Add new mechanism for resolving HTTP requests
65
 
3
  Tags: db migration, migration, wordpress migration, db backup, db restore, website backup, website restore, website migration, website deploy, wordpress deploy, db backup, database export, database serialization, database find replace
4
  Requires at least: 3.3
5
  Tested up to: 4.3
6
+ Stable tag: 4.15
7
  License: GPLv2 or later
8
 
9
  All-in-One WP Migration is the only tool that you will ever need to migrate a WordPress site.
60
  3. Plugin Menu
61
 
62
  == Changelog ==
63
+ = 4.15 =
64
+ * Fix an issue with resovling mechanism on export/import
65
+
66
+ = 4.14 =
67
+ * Fix an issue with database import
68
+
69
  = 4.13 =
70
  * Add new mechanism for resolving HTTP requests
71