WP Migrate DB - Version 1.0.2

Version Description

Download this release

Release Info

Developer deliciousbrains
Plugin Icon 128x128 WP Migrate DB
Version 1.0.2
Comparing to
See all releases

Code changes from version 1.0.1 to 1.0.2

asset/dist/css/styles.css CHANGED
@@ -1 +1 @@
1
- #wpmdb-main{width:742px;position:relative;min-height:950px}.wpmdb h2 ~ .error,.wpmdb h2 ~ .notice,.wpmdb h2 ~ .updated{clear:both}.wpmdb div.updated.warning,.wpmdb div.below-title.warning{max-width:742px;box-sizing:border-box;margin:10px 0}.wpmdb div.updated.warning p,.wpmdb div.below-title.warning p{font-size:13px;margin:0.5em 0}.wpmdb a{text-decoration:none}.wpmdb li{margin-bottom:5px;position:relative}.wpmdb ul{margin:0}.wpmdb input[type=checkbox],.wpmdb input[type=radio]{margin-right:5px;vertical-align:baseline;margin-top:0}.wpmdb input[type=text],.wpmdb input[type=password]{padding:5px}.wpmdb input[disabled=disabled]{cursor:default}.wpmdb label.disabled{color:#888;cursor:default}.wpmdb .option-section{border-bottom:1px solid #ccc;padding-bottom:20px;margin-bottom:20px}.wpmdb .option-section h3{font-size:18px;font-weight:normal}.wpmdb p.migrate-db{overflow:hidden;min-height:29px}.wpmdb p.migrate-db input{float:left}.wpmdb p.migrate-db img{float:left;margin:3px 0 0 5px}.wpmdb p.migrate-db .save-settings-button{margin-left:10px;display:none}.wpmdb .indent-wrap{margin-left:24px}.wpmdb .expandable-content{display:none;margin-top:10px}.wpmdb .expandable-content li:last-child{margin-bottom:0px}.wpmdb .header-wrapper{margin-bottom:10px}.wpmdb .header-expand-collapse{cursor:pointer;display:inline-block}.wpmdb .option-description{font-size:12px;color:#999;margin-left:8px;font-weight:normal}.wpmdb .option-group li:last-child{margin-bottom:0}.wpmdb .connection-status{display:none;overflow:auto}.wpmdb .connection-status.error{color:#9D1818}.wpmdb .copy-licence-to-remote-site{display:inline-block}.wpmdb .ajax-spinner{left:6px;position:relative;top:3px}.wpmdb div.message{margin:15px 0 0}.wpmdb .licence-wrap h3{margin:0 0 10px 0}.wpmdb .licence-input{clear:both;display:block;font-family:Consolas, Monaco, monospace;font-size:14px;margin-bottom:7px;padding:10px;width:418px}.wpmdb .register-licence{float:left;outline:none}.wpmdb .licence-status{color:#A21B1B;font-weight:bold;clear:both;padding-top:0.5em;margin:0}.wpmdb .licence-status.success{color:#333}.wpmdb .register-licence-ajax-spinner{margin:4px 0 0 8px}.wpmdb .return-to-profile-selection{margin-bottom:15px;display:inline-block}.wpmdb .return-to-profile-selection.bottom{margin-top:10px}.wpmdb h2.nav-tab-wrapper{margin-top:10px;margin-bottom:20px;padding-left:5px}.wpmdb h2.nav-tab-wrapper a.nav-tab-active{color:#464646;cursor:default}.wpmdb label{display:inline-block;clear:both}.wpmdb .migration-profile-options li{position:relative;width:520px}.wpmdb .migration-profile-options li a{padding:5px 10px;width:500px;border:1px solid #ddd;margin:0px 0px 7px;display:block;font-size:14px;color:#333}.wpmdb .migration-profile-options li a:hover{border-color:#bbb}.wpmdb .main-list-delete-profile-link{color:#999999;font-size:26px;font-weight:200;position:absolute;right:7px;top:4px;cursor:pointer}.wpmdb .main-list-delete-profile-link:hover{color:#444}.wpmdb .crumbs{overflow:hidden;border-bottom:1px solid #ccc;padding:12px 0}.wpmdb .crumbs .crumb{position:relative;display:block;float:left;margin-right:4px;padding-right:3px;font-size:13px;font-weight:bold}.wpmdb .crumbs span.crumb{padding-left:25px}.wpmdb .crumbs span.crumb:before{content:"\f345";position:absolute;left:0;top:0;display:inline-block;-webkit-font-smoothing:antialiased;font:normal 18px/1 'dashicons';vertical-align:middle}.wpmdb .option-group li{margin-bottom:5px}.wpmdb .option-group>li{margin-bottom:8px}.wpmdb .option-group li>label{font-size:14px;font-weight:bold}.wpmdb .option-group ul{display:none;margin:10px 0px 10px 25px}.wpmdb .option-group ul label{font-size:12px;font-weight:normal}.wpmdb .option-heading,.wpmdb .checkbox-label{font-size:14px;font-weight:bold}.wpmdb .checkbox-label input[type=checkbox]{margin-right:7px;position:relative;top:-1px}.wpmdb .expand-collapse-arrow{margin-right:9px}.wpmdb .migrate-selection{padding-top:20px}.wpmdb .migrate-connection-info{min-width:675px;margin:0}.wpmdb .migrate-tab .pull-push-connection-info{width:418px;height:65px;color:#333;font-family:Consolas, Monaco, monospace;font-size:15px;line-height:21px;padding:10px}.wpmdb .migrate-tab.import .table-options,.wpmdb .migrate-tab.import .exclude-post-types-options,.wpmdb .migrate-tab.import .advanced-options{margin-left:24px;display:none !important}.wpmdb .migrate-tab.import .find-replace-options,.wpmdb .migrate-tab.import .advanced-options,.wpmdb .migrate-tab.import .table-options{border-bottom:none;margin-bottom:0}.wpmdb .migrate-tab.import .table-options,.wpmdb .migrate-tab.import .exclude-post-types-options{border-top:1px solid #ccc;padding-top:20px}.wpmdb .basic-access-auth-wrapper{display:none;margin-bottom:5px}.wpmdb .auth-username,.wpmdb .auth-password{width:206px;margin-top:3px}.wpmdb .auth-password{width:207px}.wpmdb .connection-info-wrapper{display:none;width:670px}.wpmdb .connect-button{margin-top:2px}.wpmdb .temp-disabled{background-color:#EEEEEE;color:#888888;font-family:Consolas, Monaco, monospace;text-shadow:0 1px 0 #FFFFFF}.wpmdb .push-list ul{margin-bottom:0px}.wpmdb .find-heading,.wpmdb .replace-heading{float:left}.wpmdb .find-heading{width:382px}.wpmdb .replace-fields{border-collapse:collapse;border-spacing:0px}.wpmdb .replace-fields input{width:295px}.wpmdb .replace-fields tr td{padding-bottom:7px}.wpmdb .replace-fields tr:last-child td{padding-bottom:0px}.wpmdb .arrow-col{width:93px;text-align:center;vertical-align:middle}.wpmdb .right-arrow{font-size:36px;color:#aaa}.wpmdb .replace-right-col span{border-radius:50%;border:1px solid #ccc;background-color:#eee;width:16px;height:16px;display:inline-block;position:relative;top:4px;cursor:pointer}.wpmdb .replace-right-col span:hover{border-color:#aaa}.wpmdb .pin .sort-handle-col{opacity:0.5;cursor:default}.wpmdb .pin .sort-handle{cursor:default !important}.wpmdb .sort-handle-col{width:20px;cursor:-moz-grab}.wpmdb .sort-handle:before{content:"\f214";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 20px/1 'dashicons';vertical-align:top;color:#aaa;background-color:transparent !important;margin-right:4px}.wpmdb .original-repeatable-field{display:none}.wpmdb .no-replaces-message{display:none;margin-bottom:0px}.wpmdb .inline-message.missing-replace{margin-top:15px;display:none}.wpmdb #new-path-missing-warning{margin-top:5px}.wpmdb .tables-header{display:inline-block}.wpmdb .expand-collapse-arrow{display:inline-block;position:relative;top:-2px;font-size:11px}.wpmdb .collapsed{-webkit-transform:scale(1) rotate(-90deg) translateX(0px) translateY(0px) skewX(0deg) skewY(0deg);transform:scale(1) rotate(-90deg) translateX(0px) translateY(0px) skewX(0deg) skewY(0deg)}.wpmdb .select-deselect-divider{margin:0 6px}.wpmdb .select-wrap{display:none;margin-top:12px}.wpmdb .select-wrap .find-replace-msg{display:none}.wpmdb .select-post-types-wrap{display:block}.wpmdb .exclude-post-types-warning{font-size:13px;font-weight:bold;color:#9c1f1f}.wpmdb .exclude-post-types-warning p{margin:0 0 12px 0}.wpmdb .exclude-post-types-warning .find-replace-msg{display:none}.wpmdb .multiselect{min-width:550px;min-height:180px;margin-bottom:10px}.wpmdb .table-migrate-options li label{font-size:12px;font-weight:normal}.wpmdb .table-migrate-options li{margin-bottom:5px}.wpmdb .general-helper{border-radius:50%;border:1px solid #ccc;background-color:#eee;width:15px;height:15px;display:inline-block;position:relative;top:4px;margin-top:-4px;cursor:pointer;margin-left:2px}.wpmdb .general-helper:hover{border-color:#aaa}.wpmdb .general-helper:after{content:"?";color:#999999;font-size:10px;font-weight:bold;left:4px;position:absolute;top:-1px}.wpmdb .helper-message{padding:10px 16px;border-radius:3px;background-color:#fff;position:absolute;width:500px;z-index:9999;display:none;box-shadow:0px 0px 10px rgba(0,0,0,0.2)}.wpmdb .inline-message{padding:10px;border-radius:3px;margin-top:5px}.wpmdb .inline-message.error{border:1px solid #CC0000;background-color:#FFEBE8}.wpmdb .inline-message.warning{background-color:#FFFFE0;border:1px solid #E6DB55}.wpmdb .helper-message:after{content:'';border-bottom:8px solid transparent;border-right:8px solid #fff;border-top:8px solid transparent;display:block;height:0;left:-7px;position:absolute;top:11px;width:0}.wpmdb .helper-message.bottom:before{content:'';border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #aaa;border-top:0;display:block;height:0;left:50%;margin-left:-8px;position:absolute;top:-9px;width:0}.wpmdb .helper-message.bottom:after{content:'';border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #fff;border-top:0;display:block;height:0;left:50%;margin-left:-8px;position:absolute;top:-8px;width:0}.wpmdb .label-disabled{color:#888}.wpmdb .prefix-notice,.wpmdb .ssl-notice,.wpmdb .different-plugin-version-notice,.wpmdb .directory-permission-notice,.wpmdb .unrecognized-import-file-notice{background-color:#FFFFE0;border:1px solid #E6DB55;padding:15px;border-radius:3px;margin-bottom:15px;display:none}.wpmdb .prefix-notice p,.wpmdb .ssl-notice p,.wpmdb .different-plugin-version-notice p,.wpmdb .directory-permission-notice p,.wpmdb .unrecognized-import-file-notice p{margin-top:0px}.wpmdb .prefix-notice p:last-child,.wpmdb .ssl-notice p:last-child,.wpmdb .different-plugin-version-notice p:last-child,.wpmdb .directory-permission-notice p:last-child,.wpmdb .unrecognized-import-file-notice p:last-child{margin:0px}.wpmdb .different-plugin-version-notice,.wpmdb .directory-permission-notice{background-color:#FFEBE8;border-color:#CC0000}.wpmdb .different-plugin-version-notice a,.wpmdb .directory-permission-notice a{color:#CC0000;text-decoration:underline}.wpmdb .mixed-case-table-name-notice{display:none}.wpmdb .save-migration-profile-wrap li label{font-size:12px;font-weight:normal}.wpmdb .save-migration-profile-wrap li{margin-bottom:5px;padding-left:25px}.wpmdb .save-migration-profile-wrap .indent-wrap{margin-left:0px}.wpmdb .create-new-label{margin-right:8px}.wpmdb .create-new-profile{position:absolute;top:-5px}.wpmdb .replace-remove-row,.wpmdb .delete-profile{background-color:#eee;border:1px solid #ccc;border-radius:50% 50% 50% 50%;cursor:pointer;height:11px;left:5px;margin-left:2px;position:absolute;margin-top:-6px;top:50%;width:11px;display:block;background-position:50% 50%;background-size:6px 6px;background-repeat:no-repeat}.wpmdb .replace-remove-row:after,.wpmdb .delete-profile:after{content:"\00d7";left:2px;position:absolute;top:-3px;color:#aaa;font-size:12px}.wpmdb .replace-remove-row:after{position:relative}.wpmdb .replace-remove-row:hover,.wpmdb .delete-profile:hover{border-color:#aaa}.wpmdb .ajax-success-msg{font-weight:bold;margin-left:9px;position:absolute;display:inline-block}.wpmdb .migrate-db .ajax-success-msg{margin-top:3px}.wpmdb p img.save-profile-ajax-spinner{margin:6px 0 0 10px}.wpmdb .backup-description{left:20px;position:relative}.wpmdb .backup-option-disabled{margin-bottom:0px !important}.wpmdb .settings-tab{display:none}.wpmdb .settings-tab .slider{max-width:416px}.wpmdb .settings-tab .slider-label{display:block;margin-bottom:10px;float:left;width:50%}.wpmdb .settings-tab .slider-label span{vertical-align:middle}.wpmdb .settings-tab .slider-label-wrapper{max-width:416px;width:100%;position:relative;font-size:14px}.wpmdb .settings-tab .amount{width:50%;text-align:right;display:block;float:left}.wpmdb .settings-tab .slider-spinner{position:absolute;right:-35px;bottom:-13px}.wpmdb .settings-tab .slider-success-msg{right:-63px;bottom:-14px;position:absolute;font-weight:bold}.wpmdb .settings-tab .ui-slider{border:2px solid #fff;background:#fff;height:10px;border-radius:2px;position:relative;opacity:1}.wpmdb .settings-tab .ui-slider-handle{width:20px;height:20px;background:#ade7b5;border:2px solid #fff;border-radius:50%;display:block;position:absolute;top:-7px;outline:none;margin-left:-11px}.wpmdb .settings-tab .ui-slider-handle:active{background:#86db91;border-color:#eee}.wpmdb .settings-tab .ui-slider-range{background:#ade7b5;height:100%}.wpmdb .settings-tab .form-table{margin-top:0}.wpmdb .settings-tab .form-table h3,.wpmdb .settings-tab .form-table h4,.wpmdb .settings-tab .form-table p{margin:0;line-height:1.2}.wpmdb .settings-tab .form-table p.has-margin{margin-bottom:10px}.wpmdb .settings-tab .form-table h3{font-weight:normal}.wpmdb .settings-tab .form-table h4{font-size:15px}.wpmdb .settings-tab .form-table h4 .helper-message{font-weight:normal}.wpmdb .settings-tab .form-table h4 img.ajax-spinner{position:absolute;float:left;top:auto;left:auto;margin-top:1px}.wpmdb .settings-tab .form-table h4 .setting-status .ajax-success-msg{margin-left:6px}.wpmdb .settings-tab .form-table tr td{padding:10px 0}.wpmdb .settings-tab .form-table tr.wpmdb-setting-title td{padding-bottom:0}.wpmdb .settings-tab .form-table tr.wpmdb-setting-title td h3{margin:10px 0}.wpmdb .settings-tab .form-table tr:first-child td{padding-top:0}.wpmdb .settings-tab .form-table tr:first-child td h3{margin-top:0}.wpmdb .settings-tab .form-table tr td:first-child{vertical-align:top;min-width:100px;width:100px}@media screen and (max-width: 782px){.wpmdb .settings-tab .form-table tr td:first-child{width:auto}}.wpmdb .settings-tab .form-table tr.option-section.compatibility-mode td{padding-bottom:0}.wpmdb .settings-tab .form-table tr.option-section.compatibility-mode>td{padding:20px 0}.wpmdb .settings-tab .form-table tr.option-section.compatibility-mode .notification-message{margin:15px 0 0 0}.wpmdb .settings-tab .form-table tr.option-section.compatibility-mode .expandable-content{margin-top:15px}.wpmdb .settings-tab .form-table tr.option-section label{font-weight:normal;position:relative}.wpmdb .settings-tab .form-table tr.option-section li{margin-bottom:5px}.wpmdb .settings-tab .form-table tr.option-section li:last-child{margin-bottom:0px}.wpmdb .settings-tab .form-table tr.option-section.allow-remote-requests-wrap .ajax-spinner,.wpmdb .settings-tab .form-table tr.option-section.plugin-compatibility-section .ajax-spinner{right:-23px;left:inherit;top:0px;position:absolute}.wpmdb .settings-tab .form-table tr.option-section .bubble .ajax-spinner{right:-45px}.wpmdb .settings-tab .form-table tr.option-section .bubble .ajax-success-msg{right:-65px}.wpmdb .settings-tab .form-table tr.option-section td{padding-bottom:20px}.wpmdb .settings-tab .form-table tr.licence-wrap td{padding-top:0}.wpmdb .settings-tab .form-table tr.licence-wrap td .notification-message{margin:10px 0 0 0}.wpmdb .settings-tab .form-table tr.licence-wrap td #welcome-wrap{height:170px;padding-top:20px;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);clear:both}.wpmdb .settings-tab .form-table tr.licence-wrap td #welcome-wrap #welcome-img{width:170px;height:170px;float:left}.wpmdb .settings-tab .form-table tr.licence-wrap td #welcome-wrap .welcome-text{height:130px;padding:20px 25px 20px 195px;background:#fff}.wpmdb .settings-tab .form-table tr.licence-wrap td #welcome-wrap .welcome-text h3{font-weight:lighter;font-size:22px;margin-bottom:10px}.wpmdb .settings-tab .form-table tr.licence-wrap td #welcome-wrap .welcome-text p{font-size:15px;line-height:1.5}.wpmdb .settings-tab .form-table tr.licence-wrap td #welcome-wrap .welcome-text a{font-weight:bold}.wpmdb .settings-tab .form-table tr.plugin-compatibility-section td{padding-top:0}.wpmdb .settings-tab .form-table .general-helper{width:20px}.wpmdb .settings-tab .form-table .general-helper:after{top:-1px;font-size:22px;height:20px;left:-1px}.wpmdb .settings-tab .setting-status{padding-left:6px}.wpmdb .settings-tab .slider-label span{font-weight:bold}.wpmdb .allow-remote-reqeusts{font-size:14px;font-weight:bold}.wpmdb .connection-info-label{margin-top:15px;margin-bottom:5px;display:block}.wpmdb .connection-info{clear:both;font-size:15px;line-height:21px;font-family:Consolas, Monaco, monospace;padding:10px 10px;height:67px;text-shadow:0px 1px 0px #fff;display:block;margin-bottom:7px;width:418px}.wpmdb .reset-button-wrap{width:418px}.wpmdb .reset-button-wrap .button{float:left;position:relative}.wpmdb .reset-button-wrap .button:first-of-type{margin-right:10px}.wpmdb .reset-button-wrap .button.copy-api-key .copy-api-key-confirmation{display:none;left:0;position:absolute;text-align:center;top:0;height:100%;width:100%;color:#333}.wpmdb .reset-button-wrap .reset-api-key-ajax-spinner{float:left;margin:4px 7px}.wpmdb .masked-licence{margin-top:0px}.wpmdb .bull{font-size:22px;position:relative;top:4px}.wpmdb .plugin-compatibility-wrap{padding:18px 18px 18px 100px;background-color:#e6e6e6;margin-left:0}.wpmdb .plugin-compatibility-wrap p:last-of-type{margin:10px 0 0 0}.wpmdb ul.plugin-compatibility-options{display:block;margin:10px 0 10px 0px}.wpmdb .plugin-compatibility-spinner{position:relative;top:3px;left:10px}.wpmdb .plugin-compatibility-success-msg{position:relative;left:10px;font-weight:bold}.wpmdb .wpmdb-switch{position:relative;display:inline-block;padding:2px;overflow:hidden;border-radius:2px;background-color:#d4d3d3;cursor:pointer}.wpmdb .wpmdb-switch.on{background-color:#ade7b5}.wpmdb .wpmdb-switch span{visibility:hidden;box-sizing:border-box;float:left;display:inline-block;height:100%;font-size:12px;line-height:20px;border-radius:2px;-webkit-border-radius:2px;font-weight:bold;padding:4px 8px;background:#fff;color:#8d8d8d;z-index:1}.wpmdb .wpmdb-switch span.on{color:#82d78b}.wpmdb .wpmdb-switch span.checked{visibility:visible}.wpmdb .wpmdb-switch.disabled{cursor:default;background:#e6e6e6}.wpmdb .wpmdb-switch.disabled span{background:#f1f1f1;color:#d6d6d6}.wpmdb .wpmdb-switch input[type="checkbox"]{position:absolute !important;top:0;left:0;opacity:0;z-index:-1}.wpmdb .help-tab{display:none}.wpmdb .help-tab h3{font-size:18px;font-weight:normal}.wpmdb .help-tab .support{border-bottom:1px solid #ccc;margin-bottom:25px;padding-bottom:18px}.wpmdb .help-tab .support p{width:640px}.wpmdb .help-tab .support .email a{font-size:12px}.wpmdb .help-tab .support .upgrade-to-pro{font-size:16px;font-weight:bold}.wpmdb .help-tab .support .upgrade-to-pro a{white-space:nowrap}.wpmdb .help-tab .support .ajax-spinner{top:2px}.wpmdb .help-tab .debug .ajax-spinner{top:6px}.wpmdb .help-tab .debug .ajax-success-msg{margin-top:5px}.wpmdb .help-tab .video-viewer{margin-bottom:30px;border:1px solid #ccc}.wpmdb .help-tab .videos{width:640px}.wpmdb .help-tab .videos ul>li{margin-bottom:30px;overflow:hidden;position:relative}.wpmdb .help-tab .videos ul>li a{overflow:hidden;display:block;width:320px;height:180px;float:left;margin-right:15px;position:relative;z-index:1;border:1px solid #ccc}.wpmdb .help-tab .videos ul>li a:before,.wpmdb .help-tab .videos ul>li a:after{position:absolute;content:" ";margin:auto;left:0;right:0;top:0;bottom:0}.wpmdb .help-tab .videos ul>li a:before{width:64px;height:64px;border-radius:64px;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=80);opacity:.8;border:1px solid #ddd;background-color:#fff;z-index:2}.wpmdb .help-tab .videos ul>li a:after{filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=80);opacity:.8;border:21.33333px solid transparent;border-top-width:12.8px;border-bottom-width:12.8px;border-left-color:#333;background:transparent;display:block;left:25px;width:0px;height:0px;z-index:3}.wpmdb .help-tab .videos .video:last-child{margin-bottom:0px}.wpmdb .help-tab .videos img{width:320px;height:240px;position:relative;top:50%;margin-top:-120px}.wpmdb .help-tab .debug{width:640px;border-bottom:1px solid #CCCCCC;margin-bottom:25px;padding-bottom:28px}.wpmdb .help-tab .debug textarea{width:100%;min-height:200px;font-family:Consolas, Monaco, monospace;margin-bottom:5px}.wpmdb .help-tab h4{margin:0 0 0.2em 0}.wpmdb .help-tab p{margin:0 0 0.5em 0}.wpmdb .help-tab iframe{display:none}.wpmdb .addons-tab{display:none}.wpmdb .addons-tab .addon{position:relative;width:100%;min-height:138px;padding:25px 30px 30px 165px;box-sizing:border-box;color:#fff;margin-top:15px}.wpmdb .addons-tab .addon .actions{float:right;font-size:14px}.wpmdb .addons-tab .addon .actions>*{margin-right:10px}.wpmdb .addons-tab .addon .actions *:last-child{margin-right:0}.wpmdb .addons-tab .addon .actions .action{background-color:#fff;font-weight:bold;display:inline-block;padding:0.2em 0.4em}.wpmdb .addons-tab .addon .actions .action:hover{background-color:rgba(255,255,255,0.92)}.wpmdb .addons-tab .addon .actions .status{border-bottom:2px solid #fff;padding-bottom:0.1em}.wpmdb .addons-tab .addon h1{font-weight:normal;float:left;margin:0;margin-top:5px;color:#fff}.wpmdb .addons-tab .addon p{font-size:16px;line-height:1.2em;clear:both;margin:0}.wpmdb .addons-tab .addon p a{text-decoration:underline;color:#fff}.wpmdb .addons-tab .addon p a:hover{color:rgba(255,255,255,0.9)}.wpmdb .addons-tab .addon.wp-migrate-db-pro-media-files{background:#3fab3f url(../img/icon-media-files.svg) no-repeat 30px 30px;background-size:110px 85px}.wpmdb .addons-tab .addon.wp-migrate-db-pro-media-files .action{color:#3fab3f}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli{background:#272822 url(../img/icon-cli.svg) no-repeat 30px 30px;background-size:110px 97px;min-height:157px;color:#ddd}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli .action{color:#272822;background-color:#ddd}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli .action:hover{color:#272822;background-color:#eee}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli .status{border-bottom-color:#ddd}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli p a{color:#ddd}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli p a:hover{color:#f7f7f7}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli code{white-space:nowrap;margin:0;padding:0}.wpmdb .addons-tab .addon.wp-migrate-db-pro-multisite-tools{background:#a90000 url(../img/icon-multisite-tools.svg) no-repeat 30px 20px;background-size:110px 118px;min-height:157px}.wpmdb .addons-tab .addon.wp-migrate-db-pro-multisite-tools .action{color:#a90000}.wpmdb-not-pro .wpmdb .wpmdb-main{margin-top:15px}.wpmdb-not-pro .wpmdb .help-tab .support p{width:auto}#wpmdb-sidebar{position:absolute;top:-21px;right:-312px;width:292px}#wpmdb-sidebar .block{padding:20px;border:1px solid #ccc}#wpmdb-sidebar .subscribe{border-top:none}#wpmdb-sidebar .subscribe h2{padding:0;margin:0;margin-bottom:0.5em;color:#666;font-size:20px;line-height:1.2em;float:none}#wpmdb-sidebar .subscribe h3{font-size:16px;margin:0}#wpmdb-sidebar .subscribe p{margin:0}#wpmdb-sidebar .subscribe p.interesting{margin-bottom:1em;line-height:1.4}#wpmdb-sidebar .subscribe .links{margin-bottom:2em}#wpmdb-sidebar .subscribe .links a{text-decoration:none}#wpmdb-sidebar .subscribe .promise{color:#999;font-size:12px;line-height:1.4em}#wpmdb-sidebar .subscribe .field{margin-bottom:0.5em}#wpmdb-sidebar .subscribe .field p{margin-bottom:0.3em}#wpmdb-sidebar .subscribe .field.submit-button{margin-bottom:1em}#wpmdb-sidebar .testimonial{border-top:none}#wpmdb-sidebar .testimonial p{margin:0}#wpmdb-sidebar .testimonial .quote{font-size:20px}#wpmdb-sidebar .testimonial .author{white-space:nowrap;text-align:right}#wpmdb-sidebar .testimonial .stars{white-space:nowrap;margin-bottom:5px}#wpmdb-sidebar .testimonial .via{text-align:right;font-size:12px}#wpmdb-sidebar .testimonial .via a{color:#666}#wpmdb-sidebar .testimonial .via a:before{content:"\f301";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 18px/1 'dashicons';vertical-align:top;margin-right:3px}@media (min--moz-device-pixel-ratio: 1.3), (-webkit-min-device-pixel-ratio: 1.3), (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx){#wpmdb-sidebar .wpmdb-banner{background-image:url(../img/wp-migrate-db-pro@2x.jpg);background-size:292px 292px;width:292px;height:292px;display:block}#wpmdb-sidebar .wpmdb-banner img{display:none}}@media screen and (max-width: 1252px){#wpmdb-sidebar{position:relative;top:auto;right:auto;margin-top:50px}}body.mp6 input[type=checkbox]:disabled{opacity:1;border-color:#ccc}body.mp6 #wpmdb-main{font-size:14px}body.mp6 p{font-size:14px}body.mp6 .wrap>h1{float:left}body.mp6 .wrap h2{float:left}body.mp6 .wpmdb .content-tab{padding-top:15px}body.mp6 .wpmdb .migrate-tab{padding-top:0}body.mp6 .wpmdb input[type=checkbox],body.mp6 .wpmdb input[type=radio]{vertical-align:middle;margin-top:-4px}body.mp6 .wpmdb input[type=text],body.mp6 .wpmdb input[type=password]{padding:3px 5px}body.mp6 .wpmdb input.code{padding-top:6px}body.mp6 .wpmdb label{font-size:14px}body.mp6 .wpmdb h2.nav-tab-wrapper{float:none;margin-bottom:0;width:722px;font-size:23px;line-height:29px;padding:9px 0 0 5px}body.mp6 .wpmdb .help-tab h3{margin-top:0}body.mp6 .wpmdb .temp-disabled{background-color:#f9f9f9}body.mp6 .wpmdb .migration-profile-options li a{border-color:#ccc;color:#555;background-color:#e4e4e4}body.mp6 .wpmdb .migration-profile-options li a:hover{background-color:#fff;color:#464646}body.mp6 .wpmdb .connection-info,body.mp6 .wpmdb .migrate-tab .pull-push-connection-info{font-weight:bold;font-size:14px}body.mp6 .wpmdb .general-helper{border:0;width:auto;height:auto;top:auto;margin:0}body.mp6 .wpmdb .general-helper:after{content:"\f223";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 22px/1 'dashicons';vertical-align:top;top:auto;left:auto;position:relative}body.mp6 .wpmdb .helper-message{font-size:14px;line-height:1.4em}body.mp6 .wpmdb .right-arrow{display:none}body.mp6 .wpmdb .arrow-col{width:52px}body.mp6 .wpmdb .arrow-col:after{content:"\f344";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 22px/1 'dashicons';vertical-align:top;color:#999}body.mp6 .wpmdb .arrow-col:hover{cursor:pointer}body.mp6 .wpmdb .arrow-col:hover:after{color:#666}body.mp6 .wpmdb .arrow-col.disabled:after{opacity:0.5}body.mp6 .wpmdb .arrow-col.disabled:hover{cursor:default}body.mp6 .wpmdb .arrow-col.disabled:hover:after{color:#999}body.mp6 .wpmdb .find-heading{width:409px}body.mp6 .wpmdb .replace-fields input{width:304px}body.mp6 .wpmdb .replace-right-col span{border-color:#999}body.mp6 .wpmdb .replace-right-col span:hover{border-color:#666}body.mp6 .wpmdb .replace-add-row:after,body.mp6 .wpmdb .replace-add-row:before{background-color:#999}body.mp6 .wpmdb .replace-add-row:hover:after,body.mp6 .wpmdb .replace-add-row:hover:before{background-color:#666}body.mp6 .wpmdb .option-group.migrate-selection>li>label{font-size:16px}body.mp6 .wpmdb .saved-migration-profile-label{font-size:16px}body.mp6 .wpmdb .option-heading,body.mp6 .wpmdb .checkbox-label{font-size:16px}body.mp6 .wpmdb .checkbox-label input[type=checkbox]{top:auto}body.mp6 .wpmdb .return-to-profile-selection{font-size:14px}body.mp6 .wpmdb .option-description{font-size:13px}body.mp6 .wpmdb .save-migration-profile-wrap li{position:relative}body.mp6 .wpmdb .replace-remove-row,body.mp6 .wpmdb .delete-profile{border:0;border-radius:0;height:auto;width:auto;left:0;top:50%;margin-left:0}body.mp6 .wpmdb .replace-remove-row:after,body.mp6 .wpmdb .delete-profile:after{content:"\f153";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 18px/1 'dashicons';vertical-align:middle;color:#999}body.mp6 .wpmdb .replace-remove-row:hover:after,body.mp6 .wpmdb .delete-profile:hover:after{color:#666}body.mp6 .wpmdb .row-action-buttons{position:relative;width:60px}body.mp6 .wpmdb .row-action-buttons .helper-message{width:320px}body.mp6 .wpmdb .row-action-buttons .replace-remove-row{margin-left:4px;border:0;border-radius:50%;height:22px;width:auto;left:0;top:0;display:block;float:left;position:relative;margin-top:0}body.mp6 .wpmdb .row-action-buttons .replace-remove-row:after{display:inline-block;vertical-align:top;top:auto;position:relative;left:auto;height:22px;line-height:22px}body.mp6 .wpmdb .row-action-buttons .general-helper{display:inline-block;position:static;margin-left:4px}body.mp6 .wpmdb .row-action-buttons .general-helper:first-child{margin-left:2px}body.mp6 .wpmdb .row-action-buttons .general-helper:after{display:inline-block;vertical-align:top;top:auto;left:auto;position:relative}body.mp6 .wpmdb .delete-profile:after{color:#ccc}body.mp6 .wpmdb .delete-profile:hover:after{color:#aaa}body.mp6 .wpmdb .addons-tab .addons-content>div:nth-child(1),body.mp6 .wpmdb .addons-tab .addons-content>article:nth-child(1){margin-top:0px}body.mp6 .wpmdb .addons-tab .addon h1{font-weight:300;font-size:25px;margin-top:2px}body.mp6 .wpmdb .addons-tab .addon.wp-migrate-db-pro-cli h1{margin-top:5px}body.mp6 .wpmdb .addons-tab .addon p{font-size:14px;line-height:1.4em}body.mp6 .wpmdb .help-tab .support p,body.mp6 .wpmdb .help-tab .support .email a{font-size:14px}body.mp6 .wpmdb .help-tab div.warning p{font-size:13px}body.mp6 .wpmdb .help-tab .videos h4,body.mp6 .wpmdb .help-tab .videos p{font-size:14px}body.mp6 .wpmdb .inline-message,body.mp6 .wpmdb .notification-message{border-radius:0;border:0;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);padding:10px 14px;font-size:13px}body.mp6 .wpmdb .notification-message{margin-bottom:20px;background-color:#fff}body.mp6 .wpmdb .notification-message.ssl-notice,body.mp6 .wpmdb .notification-message.invalid-licence,body.mp6 .wpmdb .notification-message.unrecognized-import-file-notice{margin-bottom:0;margin-top:15px}body.mp6 .wpmdb .notification-message.backup-option-disabled{line-height:1.8em}body.mp6 .wpmdb .notification-message.backup-option-disabled a{text-decoration:underline}body.mp6 .wpmdb .notification-message.backup-option-disabled a:hover{text-decoration:none}body.mp6 .wpmdb .notification-message.backup-option-disabled .upload-directory-location{font-weight:bold}body.mp6 .wpmdb .notification-message p{font-size:13px;margin-top:0}body.mp6 .wpmdb .notification-message p:last-child{margin:0}body.mp6 .wpmdb .notification-message h4{margin-top:0}body.mp6 .wpmdb .notification-message a{color:#0074a2;text-decoration:none}body.mp6 .wpmdb .notification-message a:hover{color:#2ea2cc}body.mp6 .wpmdb div.notification-message.invalid-licence p:last-child{margin:0.5em 0}body.mp6 .wpmdb div.notification-message.invalid-licence p:last-child a.button{color:#555555}body.mp6 .wpmdb .inline-message.error,body.mp6 .wpmdb .notification-message.error-notice{border-left:4px solid #dd3d36;background-color:#fff}body.mp6 .wpmdb .inline-message.warning,body.mp6 .wpmdb .notification-message.warning-notice{background-color:#fff;border-left:4px solid #ffba00}body.mp6 .wpmdb .inline-message.success,body.mp6 .wpmdb .notification-message.success-notice{border-left:4px solid #7ad03a}body.mp6 .wpmdb .ssl-notice{margin-bottom:0}body.mp6 .wpmdb .different-plugin-version-notice,body.mp6 .wpmdb .directory-permission-notice{margin-bottom:10px}body.mp6 .wpmdb .licence-status{color:#444;float:left;font-weight:normal}body.mp6 #overlay{background-color:rgba(0,0,0,0.5)}body.mp6 .migration-progress-ajax-spinner{top:20px}#overlay{background-color:rgba(255,255,255,0.9);position:fixed;top:0;left:0;width:100%;height:100%;z-index:100000;overflow-x:auto;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-transition:opacity .3s ease-out;transition:opacity .3s ease-out}#overlay.show{opacity:1;display:-webkit-box;display:-ms-flexbox;display:flex}@media screen and (max-width: 700px){#overlay.show{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}}#overlay.hide{opacity:0;display:-webkit-box;display:-ms-flexbox;display:flex}@media screen and (max-width: 1120px){.wpmdb-not-pro #overlay.show{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}}.stage-tabs{margin:0;z-index:5}.stage-tabs .stage-tab{box-sizing:border-box;display:block;float:left;width:auto;height:45px;margin:0 5px -1px 0;background-color:#ddd;border:1px solid #aaa;padding:.5em 1.5em 0;line-height:1.3;text-align:center;text-transform:capitalize;color:#333;-webkit-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out}.stage-tabs .stage-tab.active{background-color:#fff;border-bottom-color:#fff}.stage-tabs .stage-status{display:block;font-size:.8em;font-style:italic}.complete .stage-tabs .stage-tab:not(.active){cursor:pointer}.complete .stage-tabs .stage-tab:not(.active):hover{background-color:#eee}.migration-progress-stages{position:relative;margin:0 -30px 0;background:#fff;overflow-y:auto}.migration-progress-stages .migration-progress-stage-container{top:0;left:0;width:100%;padding:0}.migration-progress-stages .migration-progress-stage-container.queued,.migration-progress-stages .migration-progress-stage-container.complete{display:none}.migration-progress-stages .migration-progress-stage-container.active{display:block}.migration-progress-stages .migration-progress-stage-container.find_replace .progress-items .item-progress .size{display:none}.migration-progress-stages .migration-progress-stage-container.upload .progress-items,.migration-progress-stages .migration-progress-stage-container.import .progress-items{height:0px !important;opacity:0}.migration-progress-stages .truncation-notice{margin:-10px 30px 10px;padding:5px 10px;color:#999;text-align:center}.migration-progress-stages .hide-tables .truncation-notice{display:none}.migration-progress-stages .progress-items{position:relative;overflow-y:auto;padding:10px 30px 10px;z-index:0}.migration-progress-stages .item-progress{position:relative;background-color:#eee;overflow:hidden;margin:0 0 .8em 0;-webkit-transition:height .2s ease-in-out, margin .2s ease-in-out;transition:height .2s ease-in-out, margin .2s ease-in-out}.migration-progress-stages .item-progress .dashicons-yes.dashicons{position:absolute;right:.3em;top:0.12em;z-index:20;background:#333;color:#85d937;width:.75em;height:.75em;border-radius:50%;text-indent:-.18em;line-height:.8;vertical-align:2em;font-size:2em;opacity:0;-webkit-transition:opacity .3s ease-in;transition:opacity .3s ease-in;-webkit-transition-delay:.5s;transition-delay:.5s}.migration-progress-stages .item-progress.complete .dashicons-yes{opacity:1}.migration-progress-stages .item-progress .progress-bar{background:#85d937}.migration-progress-stages .item-progress .item-info{margin:0;position:relative;padding:.25em 0 .25em 1em;font-size:1em;z-index:10}.migration-progress-stages .hide-tables .progress-items{height:0px !important;opacity:0}@-webkit-keyframes progress-bg-anim{0%{background-position:0 0}100%{background-position:50px 50px}}@keyframes progress-bg-anim{0%{background-position:0 0}100%{background-position:50px 50px}}.clearfix:before,.clearfix:after{content:"";display:table}.clearfix:after{clear:both}.clearfix{zoom:1}.general-spinner{width:16px;height:16px}.migration-error{color:#a21b1b;display:block;max-height:400px;max-width:100%;overflow:auto;word-wrap:break-word}.migration-php-errors{display:none;margin:20px 0;overflow-y:scroll;height:180px}.progress-overlay-container{display:none;position:relative;background-color:#eee;padding:30px 30px 15px;box-shadow:0 0 10px rgba(0,0,0,0.5);cursor:default;font-size:14px;z-index:1;margin:0 10px;box-sizing:border-box;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;max-height:95%;overflow-y:hidden;-webkit-transition:opacity .3s ease-out, -webkit-transform .5s ease-out;transition:opacity .3s ease-out, transform .5s ease-out;width:700px;min-width:700px;-ms-flex-preferred-size:700px;flex-basis:700px;-webkit-box-flex:0;-ms-flex:0 1 0%;flex:0 1 0%}.progress-overlay-container.show{display:-webkit-box;display:-ms-flexbox;display:flex;opacity:1}.progress-overlay-container.hide{display:-webkit-box;display:-ms-flexbox;display:flex;opacity:0;-webkit-transform:translateY(-100%);transform:translateY(-100%)}.progress-overlay-container>div{-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto}.progress-overlay-container .migration-progress-stages{-webkit-box-flex:100;-ms-flex:100 1 auto;flex:100 1 auto}@media all and (-ms-high-contrast: none){.progress-overlay-container .migration-progress-stages{height:300px}}.progress-overlay-container .progress-title{margin-top:0;font-size:22px;font-weight:normal;width:85%;line-height:1.3}.progress-overlay-container .progress-title .domain-label{white-space:nowrap}.progress-overlay-container .progress-title .dashicons{display:inline;vertical-align:middle;margin-left:-.15em;padding-right:.3em;font-size:42px}.progress-overlay-container .progress-info-wrapper{margin-bottom:10px}.progress-overlay-container .progress-text{clear:left;float:left;width:100%}.progress-overlay-container .timer{position:absolute;top:35px;right:55px}.progress-overlay-container .progress-bar{position:absolute;top:0;left:0;height:100%;-webkit-transition:width 1s ease-out;transition:width 1s ease-out;z-index:0}.progress-overlay-container .stage-progress{display:none;text-transform:capitalize;padding:15px 30px 0;margin:0 -30px;height:65px;box-sizing:border-box;background:#fff;border-top:1px solid #aaa;z-index:100}.progress-overlay-container .stage-progress.active{display:block}.progress-overlay-container .stage-progress .lowercase{text-transform:lowercase}.progress-overlay-container .stage-progress .items-complete{margin-left:3em}.progress-overlay-container .stage-progress .progress-bar-wrapper{position:relative;height:10px;width:100%;background-color:#eee;margin:15px 0 10px;background-image:-webkit-linear-gradient(135deg, rgba(255,255,255,0.35) 25%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 50%, rgba(255,255,255,0.35) 50%, rgba(255,255,255,0.35) 75%, rgba(0,0,0,0) 75%, rgba(0,0,0,0));background-image:linear-gradient(-45deg, rgba(255,255,255,0.35) 25%,rgba(0,0,0,0) 25%,rgba(0,0,0,0) 50%,rgba(255,255,255,0.35) 50%,rgba(255,255,255,0.35) 75%,rgba(0,0,0,0) 75%,rgba(0,0,0,0));background-size:20px 20px;-webkit-animation:progress-bg-anim 5s linear infinite;animation:progress-bg-anim 5s linear infinite}.progress-overlay-container .stage-progress .progress-bar{background-color:#406fa4}.progress-overlay-container .stage-progress .show-hide-tables{display:block;float:right;cursor:pointer}.progress-overlay-container .stage-progress.import .show-hide-tables,.progress-overlay-container .stage-progress.upload .show-hide-tables{display:none}.progress-overlay-container .stage-progress.import .items-complete-wrap,.progress-overlay-container .stage-progress.upload .items-complete-wrap{display:none}.progress-overlay-container .stage-progress.find_replace .size-complete-wrap{display:none}.progress-overlay-container .stage-progress.find_replace .items-complete{margin-left:9em}.progress-overlay-container .progress-tables{overflow:hidden;margin-bottom:2px;padding:0 0 20px 0}.progress-overlay-container .progress-tables-hover-boxes{position:absolute;top:0px;left:0px;display:block;width:100%}.progress-overlay-container .progress-chunk-hover{display:block;float:left;height:35px;position:relative;top:-5px;z-index:1}.progress-overlay-container .progress-chunk{box-sizing:border-box;float:left;display:block;height:6px;border-right:1px solid #ccc;border-bottom:1px solid #ccc;color:#999;position:relative;text-align:center}.progress-overlay-container .progress-chunk>span{padding:0px 3px;white-space:nowrap;text-overflow:ellipsis;margin-top:10px;display:inline-block}.progress-overlay-container .progress-label{padding:5px 10px;border:1px solid #ccc;border-radius:3px;background-color:#fff;font-family:Consolas, Monaco, monospace;font-size:12px;display:inline-block;top:-35px;position:absolute;opacity:0;-webkit-transition:opacity 200ms ease-in-out;transition:opacity 200ms ease-in-out}.progress-overlay-container .label-visible{opacity:1}.progress-overlay-container .progress-label:before{content:"";width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #ccc;display:block;position:absolute;bottom:-5px;left:50%;margin-left:-2px}.progress-overlay-container .progress-label:after{content:"";width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #fff;display:block;position:absolute;bottom:-4px;left:50%;margin-left:-2px}.progress-overlay-container .migration-progress-ajax-spinner{left:7px;position:relative;top:15px}.progress-overlay-container .close-progress-content{color:#999;cursor:pointer;font-size:26px;font-weight:200;position:absolute;right:10px;top:5px;padding:5px;display:none}.progress-overlay-container .close-progress-content:hover{color:#666;border-color:#aaa}.progress-overlay-container .migration-controls{display:block;-webkit-transition:opacity .2s ease-out;transition:opacity .2s ease-out;padding-top:15px}.progress-overlay-container .migration-controls.hidden{opacity:0;pointer-events:none}.progress-overlay-container .migration-controls span{float:left;text-align:center;display:block}.progress-overlay-container .migration-controls span:first-child{margin-right:10px;width:71px}.progress-overlay-container .migration-controls .pause-before-finalize{display:none;float:right;margin-top:5px}.progress-overlay-container .migration-controls #pause-before-finalize{margin-top:0}.progress-overlay-container .pro-version{margin-top:45px;padding-top:40px;position:relative;border-top:1px solid #ccc}.progress-overlay-container .pro-version iframe{position:absolute;top:40px;right:0;display:block}.progress-overlay-container .pro-version-content{padding-right:460px;min-height:255px}.progress-overlay-container .pro-version-content h1{line-height:1em;margin-top:0;font-size:20px}.progress-overlay-container .pro-version-content ul{margin-left:24px}.progress-overlay-container .pro-version-content li{position:relative;font-size:14px;line-height:1.4em;margin-bottom:15px;max-width:580px}.progress-overlay-container .pro-version-content .pro-quote{margin:0 0 20px 0;max-width:570px}.progress-overlay-container .pro-version-content .pro-quote .dashicons-star-filled{font-size:16px;width:16px;height:16px;position:relative;top:2px}.progress-overlay-container .pro-version-content .pro-quote-author{font-style:italic;white-space:nowrap}.progress-overlay-container.wpmdb-error{outline:3px solid #dc3232}@media screen and (max-width: 1096px){.progress-overlay-container .pro-version iframe{position:relative;top:auto;right:auto}.progress-overlay-container .pro-version-content{min-height:0;padding:0 0 20px 0}}.progress-overlay-container:not(.complete) .migration-progress-stages .item-progress:first-child{background-image:-webkit-linear-gradient(135deg, rgba(255,255,255,0.3) 25%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 50%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0.3) 75%, rgba(0,0,0,0) 75%, rgba(0,0,0,0));background-image:linear-gradient(-45deg, rgba(255,255,255,0.3) 25%,rgba(0,0,0,0) 25%,rgba(0,0,0,0) 50%,rgba(255,255,255,0.3) 50%,rgba(255,255,255,0.3) 75%,rgba(0,0,0,0) 75%,rgba(0,0,0,0));background-size:50px 50px;-webkit-animation:progress-bg-anim 2s linear infinite;animation:progress-bg-anim 2s linear infinite}.progress-overlay-container.paused .active.stage-progress .progress-bar-wrapper{-webkit-animation-play-state:paused;animation-play-state:paused}.progress-overlay-container.paused .migration-progress-stages .item-progress:first-child{-webkit-animation-play-state:paused;animation-play-state:paused}.progress-overlay-container .migration-progress-stages .determining-media .item-progress:first-child{background-image:none;-webkit-animation:none;animation:none}.progress-overlay-container.cancelled .stage-tabs,.progress-overlay-container.cancelled .migration-progress-stages,.progress-overlay-container.cancelled .stage-progress.active,.progress-overlay-container.wpmdb-error .stage-tabs,.progress-overlay-container.wpmdb-error .migration-progress-stages,.progress-overlay-container.wpmdb-error .stage-progress.active{display:none}.migrate-tab>.pro-version{display:none}#overlay .pro-version{width:42%;padding-left:0;padding-right:0;-ms-flex-preferred-size:42%;flex-basis:42%;max-width:515px;min-width:400px;max-height:100%;-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2;font-size:14px;display:block;-webkit-transition:-webkit-transform .3s ease-out, opacity .3s ease-out, margin-left .2s .3s ease-in-out;transition:transform .3s ease-out, opacity .3s ease-out, margin-left .2s .3s ease-in-out}#overlay .pro-version.remove{margin-left:-525px !important}#overlay .pro-version .pro-version-content{padding:0 30px}#overlay .pro-version .pro-version-content h1{font-size:22px;font-weight:bold;margin:0 0 30px}#overlay .pro-version .pro-version-content li{margin-bottom:10px;padding-left:35px;position:relative}#overlay .pro-version .pro-version-content li .dashicons{display:block;position:absolute;font-size:2em;top:-3px;left:0}#overlay .pro-version .pro-version-content .pro-quote{border:1px solid #bbb;border-radius:3px;padding:15px 15px 15px 100px;margin:30px 0;position:relative;background:url("../img/mor10.png") no-repeat 15px 31px;background-size:51px 51px}@media (min--moz-device-pixel-ratio: 1.3), (-webkit-min-device-pixel-ratio: 1.3), (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx){#overlay .pro-version .pro-version-content .pro-quote{background-image:url("../img/mor10@2x.png")}}#overlay .pro-version .pro-version-content .pro-quote p{margin:0;font-size:13px}#overlay .pro-version .pro-version-content .pro-quote .pro-quote-author{font-size:14px;font-weight:bold;color:#999;margin-bottom:5px}#overlay .pro-version .pro-version-content .pro-quote .pro-quote-author .dashicons{float:right;color:#999}#overlay .pro-version .pro-version-content .pro-quote .stars{position:absolute;bottom:0;left:0;width:100%;height:0;overflow:visible;text-align:center}#overlay .pro-version .pro-version-content .pro-quote .stars span{background:#eee;color:#999;margin-top:-.5em}#overlay .pro-version .pro-version-content .pro-quote .stars span:first-child{padding-left:.1em}#overlay .pro-version .pro-version-content .pro-quote .stars span:last-child{padding-right:.1em}#overlay .pro-version iframe,#overlay .pro-version .iframe{width:100%;height:289px;background:#000}#overlay .pro-version .button{display:block;position:relative;width:250px;margin:20px auto 10px;text-align:center}#overlay .pro-version .close-pro-version{color:#999;cursor:pointer;font-size:26px;font-weight:200;position:absolute;right:10px;top:5px;padding:5px;display:block}#overlay .pro-version .close-pro-version:hover{color:#666;border-color:#aaa}
1
+ #wpmdb-main{width:742px;position:relative;min-height:950px}.wpmdb h2 ~ .error,.wpmdb h2 ~ .notice,.wpmdb h2 ~ .updated{clear:both}.wpmdb div.updated.warning,.wpmdb div.below-title.warning{max-width:742px;box-sizing:border-box;margin:10px 0}.wpmdb div.updated.warning p,.wpmdb div.below-title.warning p{font-size:13px;margin:0.5em 0}.wpmdb a{text-decoration:none}.wpmdb li{margin-bottom:5px;position:relative}.wpmdb ul{margin:0}.wpmdb input[type=checkbox],.wpmdb input[type=radio]{margin-right:5px;vertical-align:baseline;margin-top:0}.wpmdb input[type=text],.wpmdb input[type=password]{padding:5px}.wpmdb input[disabled=disabled]{cursor:default}.wpmdb label.disabled{color:#888;cursor:default}.wpmdb .option-section{border-bottom:1px solid #ccc;padding-bottom:20px;margin-bottom:20px}.wpmdb .option-section h3{font-size:18px;font-weight:normal}.wpmdb p.migrate-db{overflow:hidden;min-height:29px}.wpmdb p.migrate-db input{float:left}.wpmdb p.migrate-db img{float:left;margin:3px 0 0 5px}.wpmdb p.migrate-db .save-settings-button{margin-left:10px;display:none}.wpmdb .indent-wrap{margin-left:24px}.wpmdb .expandable-content{display:none;margin-top:10px}.wpmdb .expandable-content li:last-child{margin-bottom:0px}.wpmdb .header-wrapper{margin-bottom:10px}.wpmdb .header-expand-collapse{cursor:pointer;display:inline-block}.wpmdb .option-description{font-size:12px;color:#999;margin-left:8px;font-weight:normal}.wpmdb .option-group li:last-child{margin-bottom:0}.wpmdb .connection-status{display:none;overflow:auto}.wpmdb .connection-status.error{color:#9D1818}.wpmdb .copy-licence-to-remote-site{display:inline-block}.wpmdb .ajax-spinner{left:6px;position:relative;top:3px}.wpmdb div.message{margin:15px 0 0}.wpmdb .licence-wrap h3{margin:0 0 10px 0}.wpmdb .licence-input{clear:both;display:block;font-family:Consolas, Monaco, monospace;font-size:14px;margin-bottom:7px;padding:10px;width:418px}.wpmdb .register-licence{float:left;outline:none}.wpmdb .licence-status{color:#A21B1B;font-weight:bold;clear:both;padding-top:0.5em;margin:0}.wpmdb .licence-status.success{color:#333}.wpmdb .register-licence-ajax-spinner{margin:4px 0 0 8px}.wpmdb .return-to-profile-selection{margin-bottom:15px;display:inline-block}.wpmdb .return-to-profile-selection.bottom{margin-top:10px}.wpmdb h2.nav-tab-wrapper{margin-top:10px;margin-bottom:20px;padding-left:5px}.wpmdb h2.nav-tab-wrapper a.nav-tab-active{color:#464646;cursor:default}.wpmdb label{display:inline-block;clear:both}.wpmdb .migration-profile-options li{position:relative;width:520px}.wpmdb .migration-profile-options li a{padding:5px 10px;width:500px;border:1px solid #ddd;margin:0px 0px 7px;display:block;font-size:14px;color:#333}.wpmdb .migration-profile-options li a:hover{border-color:#bbb}.wpmdb .main-list-delete-profile-link{color:#999999;font-size:26px;font-weight:200;position:absolute;right:7px;top:4px;cursor:pointer}.wpmdb .main-list-delete-profile-link:hover{color:#444}.wpmdb .crumbs{overflow:hidden;border-bottom:1px solid #ccc;padding:12px 0}.wpmdb .crumbs .crumb{position:relative;display:block;float:left;margin-right:4px;padding-right:3px;font-size:13px;font-weight:bold}.wpmdb .crumbs span.crumb{padding-left:25px}.wpmdb .crumbs span.crumb:before{content:"\f345";position:absolute;left:0;top:0;display:inline-block;-webkit-font-smoothing:antialiased;font:normal 18px/1 'dashicons';vertical-align:middle}.wpmdb .option-group li{margin-bottom:5px}.wpmdb .option-group>li{margin-bottom:8px}.wpmdb .option-group li>label{font-size:14px;font-weight:bold}.wpmdb .option-group ul{display:none;margin:10px 0px 10px 25px}.wpmdb .option-group ul label{font-size:12px;font-weight:normal}.wpmdb .option-heading,.wpmdb .checkbox-label{font-size:14px;font-weight:bold}.wpmdb .checkbox-label input[type=checkbox]{margin-right:7px;position:relative;top:-1px}.wpmdb .expand-collapse-arrow{margin-right:9px}.wpmdb .migrate-selection{padding-top:20px}.wpmdb .migrate-connection-info{min-width:675px;margin:0}.wpmdb .migrate-tab .pull-push-connection-info{width:418px;height:65px;color:#333;font-family:Consolas, Monaco, monospace;font-size:15px;line-height:21px;padding:10px}.wpmdb .migrate-tab.import .table-options,.wpmdb .migrate-tab.import .exclude-post-types-options,.wpmdb .migrate-tab.import .advanced-options{margin-left:24px;display:none !important}.wpmdb .migrate-tab.import .find-replace-options,.wpmdb .migrate-tab.import .advanced-options,.wpmdb .migrate-tab.import .table-options{border-bottom:none;margin-bottom:0}.wpmdb .migrate-tab.import .table-options,.wpmdb .migrate-tab.import .exclude-post-types-options{border-top:1px solid #ccc;padding-top:20px}.wpmdb .basic-access-auth-wrapper{display:none;margin-bottom:5px}.wpmdb .auth-username,.wpmdb .auth-password{width:206px;margin-top:3px}.wpmdb .auth-password{width:207px}.wpmdb .connection-info-wrapper{display:none;width:670px}.wpmdb .connect-button{margin-top:2px}.wpmdb .temp-disabled{background-color:#EEEEEE;color:#888888;font-family:Consolas, Monaco, monospace;text-shadow:0 1px 0 #FFFFFF}.wpmdb .push-list ul{margin-bottom:0px}.wpmdb .find-heading,.wpmdb .replace-heading{float:left}.wpmdb .find-heading{width:382px}.wpmdb .replace-fields{border-collapse:collapse;border-spacing:0px}.wpmdb .replace-fields input{width:295px}.wpmdb .replace-fields tr td{padding-bottom:7px}.wpmdb .replace-fields tr:last-child td{padding-bottom:0px}.wpmdb .arrow-col{width:93px;text-align:center;vertical-align:middle}.wpmdb .right-arrow{font-size:36px;color:#aaa}.wpmdb .replace-right-col span{border-radius:50%;border:1px solid #ccc;background-color:#eee;width:16px;height:16px;display:inline-block;position:relative;top:4px;cursor:pointer}.wpmdb .replace-right-col span:hover{border-color:#aaa}.wpmdb .pin .sort-handle-col{opacity:0.5;cursor:default}.wpmdb .pin .sort-handle{cursor:default !important}.wpmdb .sort-handle-col{width:20px;cursor:-moz-grab}.wpmdb .sort-handle:before{content:"\f214";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 20px/1 'dashicons';vertical-align:top;color:#aaa;background-color:transparent !important;margin-right:4px}.wpmdb .original-repeatable-field{display:none}.wpmdb .no-replaces-message{display:none;margin-bottom:0px}.wpmdb .inline-message.missing-replace{margin-top:15px;display:none}.wpmdb #new-path-missing-warning{margin-top:5px}.wpmdb .tables-header{display:inline-block}.wpmdb .expand-collapse-arrow{display:inline-block;position:relative;top:-2px;font-size:11px}.wpmdb .collapsed{-webkit-transform:scale(1) rotate(-90deg) translateX(0px) translateY(0px) skewX(0deg) skewY(0deg);transform:scale(1) rotate(-90deg) translateX(0px) translateY(0px) skewX(0deg) skewY(0deg)}.wpmdb .select-deselect-divider{margin:0 6px}.wpmdb .select-wrap{display:none;margin-top:12px}.wpmdb .select-wrap .find-replace-msg{display:none}.wpmdb .select-post-types-wrap{display:block}.wpmdb .exclude-post-types-warning{font-size:13px;font-weight:bold;color:#9c1f1f}.wpmdb .exclude-post-types-warning p{margin:0 0 12px 0}.wpmdb .exclude-post-types-warning .find-replace-msg{display:none}.wpmdb .multiselect{min-width:550px;min-height:180px;margin-bottom:10px}.wpmdb .table-migrate-options li label{font-size:12px;font-weight:normal}.wpmdb .table-migrate-options li{margin-bottom:5px}.wpmdb .general-helper{border-radius:50%;border:1px solid #ccc;background-color:#eee;width:15px;height:15px;display:inline-block;position:relative;top:4px;margin-top:-4px;cursor:pointer;margin-left:2px}.wpmdb .general-helper:hover{border-color:#aaa}.wpmdb .general-helper:after{content:"?";color:#999999;font-size:10px;font-weight:bold;left:4px;position:absolute;top:-1px}.wpmdb .helper-message{padding:10px 16px;border-radius:3px;background-color:#fff;position:absolute;width:500px;z-index:9999;display:none;box-shadow:0px 0px 10px rgba(0,0,0,0.2)}.wpmdb .inline-message{padding:10px;border-radius:3px;margin-top:5px}.wpmdb .inline-message.error{border:1px solid #CC0000;background-color:#FFEBE8}.wpmdb .inline-message.warning{background-color:#FFFFE0;border:1px solid #E6DB55}.wpmdb .helper-message:after{content:'';border-bottom:8px solid transparent;border-right:8px solid #fff;border-top:8px solid transparent;display:block;height:0;left:-7px;position:absolute;top:11px;width:0}.wpmdb .helper-message.bottom:before{content:'';border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #aaa;border-top:0;display:block;height:0;left:50%;margin-left:-8px;position:absolute;top:-9px;width:0}.wpmdb .helper-message.bottom:after{content:'';border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #fff;border-top:0;display:block;height:0;left:50%;margin-left:-8px;position:absolute;top:-8px;width:0}.wpmdb .label-disabled{color:#888}.wpmdb .prefix-notice,.wpmdb .ssl-notice,.wpmdb .different-plugin-version-notice,.wpmdb .directory-permission-notice,.wpmdb .unrecognized-import-file-notice{background-color:#FFFFE0;border:1px solid #E6DB55;padding:15px;border-radius:3px;margin-bottom:15px;display:none}.wpmdb .prefix-notice p,.wpmdb .ssl-notice p,.wpmdb .different-plugin-version-notice p,.wpmdb .directory-permission-notice p,.wpmdb .unrecognized-import-file-notice p{margin-top:0px}.wpmdb .prefix-notice p:last-child,.wpmdb .ssl-notice p:last-child,.wpmdb .different-plugin-version-notice p:last-child,.wpmdb .directory-permission-notice p:last-child,.wpmdb .unrecognized-import-file-notice p:last-child{margin:0px}.wpmdb .mst-required{display:none}.wpmdb .different-plugin-version-notice,.wpmdb .directory-permission-notice{background-color:#FFEBE8;border-color:#CC0000}.wpmdb .different-plugin-version-notice a,.wpmdb .directory-permission-notice a{color:#CC0000;text-decoration:underline}.wpmdb .mixed-case-table-name-notice{display:none}.wpmdb .save-migration-profile-wrap li label{font-size:12px;font-weight:normal}.wpmdb .save-migration-profile-wrap li{margin-bottom:5px;padding-left:25px}.wpmdb .save-migration-profile-wrap .indent-wrap{margin-left:0px}.wpmdb .create-new-label{margin-right:8px}.wpmdb .create-new-profile{position:absolute;top:-5px}.wpmdb .replace-remove-row,.wpmdb .delete-profile{background-color:#eee;border:1px solid #ccc;border-radius:50% 50% 50% 50%;cursor:pointer;height:11px;left:5px;margin-left:2px;position:absolute;margin-top:-6px;top:50%;width:11px;display:block;background-position:50% 50%;background-size:6px 6px;background-repeat:no-repeat}.wpmdb .replace-remove-row:after,.wpmdb .delete-profile:after{content:"\00d7";left:2px;position:absolute;top:-3px;color:#aaa;font-size:12px}.wpmdb .replace-remove-row:after{position:relative}.wpmdb .replace-remove-row:hover,.wpmdb .delete-profile:hover{border-color:#aaa}.wpmdb .ajax-success-msg{font-weight:bold;margin-left:9px;position:absolute;display:inline-block}.wpmdb .migrate-db .ajax-success-msg{margin-top:3px}.wpmdb p img.save-profile-ajax-spinner{margin:6px 0 0 10px}.wpmdb .backup-description{left:20px;position:relative}.wpmdb .backup-option-disabled{margin-bottom:0px !important}.wpmdb .settings-tab{display:none}.wpmdb .settings-tab .slider{max-width:416px}.wpmdb .settings-tab .slider-label{display:block;margin-bottom:10px;float:left;width:50%}.wpmdb .settings-tab .slider-label span{vertical-align:middle}.wpmdb .settings-tab .slider-label-wrapper{max-width:416px;width:100%;position:relative;font-size:14px}.wpmdb .settings-tab .amount{width:50%;text-align:right;display:block;float:left}.wpmdb .settings-tab .slider-spinner{position:absolute;right:-35px;bottom:-13px}.wpmdb .settings-tab .slider-success-msg{right:-63px;bottom:-14px;position:absolute;font-weight:bold}.wpmdb .settings-tab .ui-slider{border:2px solid #fff;background:#fff;height:10px;border-radius:2px;position:relative;opacity:1}.wpmdb .settings-tab .ui-slider-handle{width:20px;height:20px;background:#ade7b5;border:2px solid #fff;border-radius:50%;display:block;position:absolute;top:-7px;outline:none;margin-left:-11px}.wpmdb .settings-tab .ui-slider-handle:active{background:#86db91;border-color:#eee}.wpmdb .settings-tab .ui-slider-range{background:#ade7b5;height:100%}.wpmdb .settings-tab .form-table{margin-top:0}.wpmdb .settings-tab .form-table h3,.wpmdb .settings-tab .form-table h4,.wpmdb .settings-tab .form-table p{margin:0;line-height:1.2}.wpmdb .settings-tab .form-table p.has-margin{margin-bottom:10px}.wpmdb .settings-tab .form-table h3{font-weight:normal}.wpmdb .settings-tab .form-table h4{font-size:15px}.wpmdb .settings-tab .form-table h4 .helper-message{font-weight:normal}.wpmdb .settings-tab .form-table h4 img.ajax-spinner{position:absolute;float:left;top:auto;left:auto;margin-top:1px}.wpmdb .settings-tab .form-table h4 .setting-status .ajax-success-msg{margin-left:6px}.wpmdb .settings-tab .form-table tr td{padding:10px 0}.wpmdb .settings-tab .form-table tr.wpmdb-setting-title td{padding-bottom:0}.wpmdb .settings-tab .form-table tr.wpmdb-setting-title td h3{margin:10px 0}.wpmdb .settings-tab .form-table tr:first-child td{padding-top:0}.wpmdb .settings-tab .form-table tr:first-child td h3{margin-top:0}.wpmdb .settings-tab .form-table tr td:first-child{vertical-align:top;min-width:100px;width:100px}@media screen and (max-width: 782px){.wpmdb .settings-tab .form-table tr td:first-child{width:auto}}.wpmdb .settings-tab .form-table tr.option-section.compatibility-mode td{padding-bottom:0}.wpmdb .settings-tab .form-table tr.option-section.compatibility-mode>td{padding:20px 0}.wpmdb .settings-tab .form-table tr.option-section.compatibility-mode .notification-message{margin:15px 0 0 0}.wpmdb .settings-tab .form-table tr.option-section.compatibility-mode .expandable-content{margin-top:15px}.wpmdb .settings-tab .form-table tr.option-section.compatibility-mode .compatibility-mode-description h4,.wpmdb .settings-tab .form-table tr.option-section.compatibility-mode .compatibility-mode-description p{line-height:1.4}.wpmdb .settings-tab .form-table tr.option-section label{font-weight:normal;position:relative}.wpmdb .settings-tab .form-table tr.option-section li{margin-bottom:5px}.wpmdb .settings-tab .form-table tr.option-section li:last-child{margin-bottom:0px}.wpmdb .settings-tab .form-table tr.option-section.allow-remote-requests-wrap .ajax-spinner,.wpmdb .settings-tab .form-table tr.option-section.plugin-compatibility-section .ajax-spinner{right:-23px;left:inherit;top:0px;position:absolute}.wpmdb .settings-tab .form-table tr.option-section .bubble .ajax-spinner{right:-45px}.wpmdb .settings-tab .form-table tr.option-section .bubble .ajax-success-msg{right:-65px}.wpmdb .settings-tab .form-table tr.option-section td{padding-bottom:20px}.wpmdb .settings-tab .form-table tr.licence-wrap td{padding-top:0}.wpmdb .settings-tab .form-table tr.licence-wrap td .notification-message{margin:10px 0 0 0}.wpmdb .settings-tab .form-table tr.licence-wrap td #welcome-wrap{height:170px;padding-top:20px;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);clear:both}.wpmdb .settings-tab .form-table tr.licence-wrap td #welcome-wrap #welcome-img{width:170px;height:170px;float:left}.wpmdb .settings-tab .form-table tr.licence-wrap td #welcome-wrap .welcome-text{height:130px;padding:20px 25px 20px 195px;background:#fff}.wpmdb .settings-tab .form-table tr.licence-wrap td #welcome-wrap .welcome-text h3{font-weight:lighter;font-size:22px;margin-bottom:10px}.wpmdb .settings-tab .form-table tr.licence-wrap td #welcome-wrap .welcome-text p{font-size:15px;line-height:1.5}.wpmdb .settings-tab .form-table tr.licence-wrap td #welcome-wrap .welcome-text a{font-weight:bold}.wpmdb .settings-tab .form-table tr.plugin-compatibility-section td{padding-top:0}.wpmdb .settings-tab .form-table .general-helper{width:20px}.wpmdb .settings-tab .form-table .general-helper:after{top:-1px;font-size:22px;height:20px;left:-1px}.wpmdb .settings-tab .setting-status{padding-left:6px}.wpmdb .settings-tab .slider-label span{font-weight:bold}.wpmdb .allow-remote-reqeusts{font-size:14px;font-weight:bold}.wpmdb .connection-info-label{margin-top:15px;margin-bottom:5px;display:block}.wpmdb .connection-info{clear:both;font-size:15px;line-height:21px;font-family:Consolas, Monaco, monospace;padding:10px 10px;height:67px;text-shadow:0px 1px 0px #fff;display:block;margin-bottom:7px;width:418px}.wpmdb .reset-button-wrap{width:418px}.wpmdb .reset-button-wrap .button{float:left;position:relative}.wpmdb .reset-button-wrap .button:first-of-type{margin-right:10px}.wpmdb .reset-button-wrap .button.copy-api-key .copy-api-key-confirmation{display:none;left:0;position:absolute;text-align:center;top:0;height:100%;width:100%;color:#333}.wpmdb .reset-button-wrap .reset-api-key-ajax-spinner{float:left;margin:4px 7px}.wpmdb .masked-licence{margin-top:0px}.wpmdb .bull{font-size:22px;position:relative;top:4px}.wpmdb .plugin-compatibility-wrap{padding:18px 18px 18px 100px;background-color:#e6e6e6;margin-left:0}.wpmdb .plugin-compatibility-wrap p:last-of-type{margin:10px 0 0 0}.wpmdb ul.plugin-compatibility-options{display:block;margin:10px 0 10px 0px}.wpmdb .plugin-compatibility-spinner{position:relative;top:3px;left:10px}.wpmdb .plugin-compatibility-success-msg{position:relative;left:10px;font-weight:bold}.wpmdb .wpmdb-switch{position:relative;display:inline-block;padding:2px;overflow:hidden;border-radius:2px;background-color:#d4d3d3;cursor:pointer}.wpmdb .wpmdb-switch.on{background-color:#ade7b5}.wpmdb .wpmdb-switch span{visibility:hidden;box-sizing:border-box;float:left;display:inline-block;height:100%;font-size:12px;line-height:20px;border-radius:2px;-webkit-border-radius:2px;font-weight:bold;padding:4px 8px;background:#fff;color:#8d8d8d;z-index:1}.wpmdb .wpmdb-switch span.on{color:#82d78b}.wpmdb .wpmdb-switch span.checked{visibility:visible}.wpmdb .wpmdb-switch.disabled{cursor:default;background:#e6e6e6}.wpmdb .wpmdb-switch.disabled span{background:#f1f1f1;color:#d6d6d6}.wpmdb .wpmdb-switch input[type="checkbox"]{position:absolute !important;top:0;left:0;opacity:0;z-index:-1}.wpmdb .help-tab{display:none}.wpmdb .help-tab h3{font-size:18px;font-weight:normal}.wpmdb .help-tab .support{border-bottom:1px solid #ccc;margin-bottom:25px;padding-bottom:18px}.wpmdb .help-tab .support p{width:640px}.wpmdb .help-tab .support .email a{font-size:12px}.wpmdb .help-tab .support .upgrade-to-pro{font-size:16px;font-weight:bold}.wpmdb .help-tab .support .upgrade-to-pro a{white-space:nowrap}.wpmdb .help-tab .support .ajax-spinner{top:2px}.wpmdb .help-tab .debug .ajax-spinner{top:6px}.wpmdb .help-tab .debug .ajax-success-msg{margin-top:5px}.wpmdb .help-tab .video-viewer{margin-bottom:30px;border:1px solid #ccc}.wpmdb .help-tab .videos{width:640px}.wpmdb .help-tab .videos ul>li{margin-bottom:30px;overflow:hidden;position:relative}.wpmdb .help-tab .videos ul>li a{overflow:hidden;display:block;width:320px;height:180px;float:left;margin-right:15px;position:relative;z-index:1;border:1px solid #ccc}.wpmdb .help-tab .videos ul>li a:before,.wpmdb .help-tab .videos ul>li a:after{position:absolute;content:" ";margin:auto;left:0;right:0;top:0;bottom:0}.wpmdb .help-tab .videos ul>li a:before{width:64px;height:64px;border-radius:64px;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=80);opacity:.8;border:1px solid #ddd;background-color:#fff;z-index:2}.wpmdb .help-tab .videos ul>li a:after{filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=80);opacity:.8;border:21.33333px solid transparent;border-top-width:12.8px;border-bottom-width:12.8px;border-left-color:#333;background:transparent;display:block;left:25px;width:0px;height:0px;z-index:3}.wpmdb .help-tab .videos .video:last-child{margin-bottom:0px}.wpmdb .help-tab .videos img{width:320px;height:240px;position:relative;top:50%;margin-top:-120px}.wpmdb .help-tab .debug{width:640px;border-bottom:1px solid #CCCCCC;margin-bottom:25px;padding-bottom:28px}.wpmdb .help-tab .debug textarea{width:100%;min-height:200px;font-family:Consolas, Monaco, monospace;margin-bottom:5px}.wpmdb .help-tab h4{margin:0 0 0.2em 0}.wpmdb .help-tab p{margin:0 0 0.5em 0}.wpmdb .help-tab iframe{display:none}.wpmdb .addons-tab{display:none}.wpmdb .addons-tab .addon{position:relative;width:100%;min-height:138px;padding:25px 30px 30px 165px;box-sizing:border-box;color:#fff;margin-top:15px}.wpmdb .addons-tab .addon .actions{float:right;font-size:14px}.wpmdb .addons-tab .addon .actions>*{margin-right:10px}.wpmdb .addons-tab .addon .actions *:last-child{margin-right:0}.wpmdb .addons-tab .addon .actions .action{background-color:#fff;font-weight:bold;display:inline-block;padding:0.2em 0.4em}.wpmdb .addons-tab .addon .actions .action:hover{background-color:rgba(255,255,255,0.92)}.wpmdb .addons-tab .addon .actions .status{border-bottom:2px solid #fff;padding-bottom:0.1em}.wpmdb .addons-tab .addon h1{font-weight:normal;float:left;margin:0;margin-top:5px;color:#fff}.wpmdb .addons-tab .addon p{font-size:16px;line-height:1.2em;clear:both;margin:0}.wpmdb .addons-tab .addon p a{text-decoration:underline;color:#fff}.wpmdb .addons-tab .addon p a:hover{color:rgba(255,255,255,0.9)}.wpmdb .addons-tab .addon.wp-migrate-db-pro-media-files{background:#3fab3f url(../img/icon-media-files.svg) no-repeat 30px 30px;background-size:110px 85px}.wpmdb .addons-tab .addon.wp-migrate-db-pro-media-files .action{color:#3fab3f}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli{background:#272822 url(../img/icon-cli.svg) no-repeat 30px 30px;background-size:110px 97px;min-height:157px;color:#ddd}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli .action{color:#272822;background-color:#ddd}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli .action:hover{color:#272822;background-color:#eee}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli .status{border-bottom-color:#ddd}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli p a{color:#ddd}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli p a:hover{color:#f7f7f7}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli code{white-space:nowrap;margin:0;padding:0}.wpmdb .addons-tab .addon.wp-migrate-db-pro-multisite-tools{background:#a90000 url(../img/icon-multisite-tools.svg) no-repeat 30px 20px;background-size:110px 118px;min-height:157px}.wpmdb .addons-tab .addon.wp-migrate-db-pro-multisite-tools .action{color:#a90000}.wpmdb-not-pro .wpmdb .wpmdb-main{margin-top:15px}.wpmdb-not-pro .wpmdb .help-tab .support p{width:auto}#wpmdb-sidebar{position:absolute;top:0;right:-312px;width:292px}#wpmdb-sidebar .block{padding:20px;border:1px solid #ccc}#wpmdb-sidebar .wpmdb-banner{display:block;background:#a5ddf1 url(../img/mdb-banner.svg) left bottom/220px 220px no-repeat;padding-bottom:180px;box-shadow:none;color:#042340}#wpmdb-sidebar .wpmdb-banner h4{font-weight:300;font-size:28px;margin:0 0 15px;padding:25px 0 0 20px}#wpmdb-sidebar .wpmdb-banner p{font-size:14px;padding:0 20px;margin:0}#wpmdb-sidebar .wpmdb-banner img{display:block}#wpmdb-sidebar .subscribe{border-top:none}#wpmdb-sidebar .subscribe h2{padding:0;margin:0;margin-bottom:0.5em;color:#666;font-size:20px;line-height:1.2em;float:none}#wpmdb-sidebar .subscribe h3{font-size:16px;margin:0}#wpmdb-sidebar .subscribe p{margin:0}#wpmdb-sidebar .subscribe p.interesting{margin-bottom:1em;line-height:1.4}#wpmdb-sidebar .subscribe .links{margin-bottom:2em}#wpmdb-sidebar .subscribe .links a{text-decoration:none}#wpmdb-sidebar .subscribe .promise{color:#999;font-size:12px;line-height:1.4em}#wpmdb-sidebar .subscribe .field{margin-bottom:0.5em}#wpmdb-sidebar .subscribe .field p{margin-bottom:0.3em}#wpmdb-sidebar .subscribe .field.submit-button{margin-bottom:1em}#wpmdb-sidebar .testimonial{border-top:none}#wpmdb-sidebar .testimonial p{margin:0}#wpmdb-sidebar .testimonial .quote{font-size:20px}#wpmdb-sidebar .testimonial .author{white-space:nowrap;text-align:right}#wpmdb-sidebar .testimonial .stars{white-space:nowrap;margin-bottom:5px}#wpmdb-sidebar .testimonial .via{text-align:right;font-size:12px}#wpmdb-sidebar .testimonial .via a{color:#666}#wpmdb-sidebar .testimonial .via a:before{content:"\f301";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 18px/1 'dashicons';vertical-align:top;margin-right:3px}@media screen and (max-width: 1252px){#wpmdb-sidebar{position:relative;top:auto;right:auto;margin-top:50px}}body.mp6 input[type=checkbox]:disabled{opacity:1;border-color:#ccc}body.mp6 #wpmdb-main{font-size:14px}body.mp6 p{font-size:14px}body.mp6 .wrap>h1{float:left}body.mp6 .wrap h2{float:left}body.mp6 .wpmdb .content-tab{padding-top:15px}body.mp6 .wpmdb .migrate-tab{padding-top:0}body.mp6 .wpmdb input[type=checkbox],body.mp6 .wpmdb input[type=radio]{vertical-align:middle;margin-top:-4px}body.mp6 .wpmdb input[type=text],body.mp6 .wpmdb input[type=password]{padding:3px 5px}body.mp6 .wpmdb input.code{padding-top:6px}body.mp6 .wpmdb label{font-size:14px}body.mp6 .wpmdb h2.nav-tab-wrapper{float:none;margin-bottom:0;width:722px;font-size:23px;line-height:29px;padding:9px 0 0 5px}body.mp6 .wpmdb .help-tab h3{margin-top:0}body.mp6 .wpmdb .temp-disabled{background-color:#f9f9f9}body.mp6 .wpmdb .migration-profile-options li a{border-color:#ccc;color:#555;background-color:#e4e4e4}body.mp6 .wpmdb .migration-profile-options li a:hover{background-color:#fff;color:#464646}body.mp6 .wpmdb .connection-info,body.mp6 .wpmdb .migrate-tab .pull-push-connection-info{font-weight:bold;font-size:14px}body.mp6 .wpmdb .general-helper{border:0;width:auto;height:auto;top:auto;margin:0}body.mp6 .wpmdb .general-helper:after{content:"\f223";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 22px/1 'dashicons';vertical-align:top;top:auto;left:auto;position:relative}body.mp6 .wpmdb .helper-message{font-size:14px;line-height:1.4em}body.mp6 .wpmdb .right-arrow{display:none}body.mp6 .wpmdb .arrow-col{width:52px}body.mp6 .wpmdb .arrow-col:after{content:"\f344";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 22px/1 'dashicons';vertical-align:top;color:#999}body.mp6 .wpmdb .arrow-col:hover{cursor:pointer}body.mp6 .wpmdb .arrow-col:hover:after{color:#666}body.mp6 .wpmdb .arrow-col.disabled:after{opacity:0.5}body.mp6 .wpmdb .arrow-col.disabled:hover{cursor:default}body.mp6 .wpmdb .arrow-col.disabled:hover:after{color:#999}body.mp6 .wpmdb .find-heading{width:409px}body.mp6 .wpmdb .replace-fields input{width:304px}body.mp6 .wpmdb .replace-right-col span{border-color:#999}body.mp6 .wpmdb .replace-right-col span:hover{border-color:#666}body.mp6 .wpmdb .replace-add-row:after,body.mp6 .wpmdb .replace-add-row:before{background-color:#999}body.mp6 .wpmdb .replace-add-row:hover:after,body.mp6 .wpmdb .replace-add-row:hover:before{background-color:#666}body.mp6 .wpmdb .option-group.migrate-selection>li>label{font-size:16px}body.mp6 .wpmdb .saved-migration-profile-label{margin-top:0;padding-top:15px;font-size:16px}body.mp6 .wpmdb .option-heading,body.mp6 .wpmdb .checkbox-label{font-size:16px}body.mp6 .wpmdb .checkbox-label input[type=checkbox]{top:auto}body.mp6 .wpmdb .return-to-profile-selection{font-size:14px}body.mp6 .wpmdb .option-description{font-size:13px}body.mp6 .wpmdb .save-migration-profile-wrap li{position:relative}body.mp6 .wpmdb .replace-remove-row,body.mp6 .wpmdb .delete-profile{border:0;border-radius:0;height:auto;width:auto;left:0;top:50%;margin-left:0}body.mp6 .wpmdb .replace-remove-row:after,body.mp6 .wpmdb .delete-profile:after{content:"\f153";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 18px/1 'dashicons';vertical-align:middle;color:#999}body.mp6 .wpmdb .replace-remove-row:hover:after,body.mp6 .wpmdb .delete-profile:hover:after{color:#666}body.mp6 .wpmdb .row-action-buttons{position:relative;width:60px}body.mp6 .wpmdb .row-action-buttons .helper-message{width:320px}body.mp6 .wpmdb .row-action-buttons .replace-remove-row{margin-left:4px;border:0;border-radius:50%;height:22px;width:auto;left:0;top:0;display:block;float:left;position:relative;margin-top:0}body.mp6 .wpmdb .row-action-buttons .replace-remove-row:after{display:inline-block;vertical-align:top;top:auto;position:relative;left:auto;height:22px;line-height:22px}body.mp6 .wpmdb .row-action-buttons .general-helper{display:inline-block;position:static;margin-left:4px}body.mp6 .wpmdb .row-action-buttons .general-helper:first-child{margin-left:2px}body.mp6 .wpmdb .row-action-buttons .general-helper:after{display:inline-block;vertical-align:top;top:auto;left:auto;position:relative}body.mp6 .wpmdb .delete-profile:after{color:#ccc}body.mp6 .wpmdb .delete-profile:hover:after{color:#aaa}body.mp6 .wpmdb .addons-tab .addons-content>div:nth-child(1),body.mp6 .wpmdb .addons-tab .addons-content>article:nth-child(1){margin-top:0px}body.mp6 .wpmdb .addons-tab .addon h1{font-weight:300;font-size:25px;margin-top:2px}body.mp6 .wpmdb .addons-tab .addon.wp-migrate-db-pro-cli h1{margin-top:5px}body.mp6 .wpmdb .addons-tab .addon p{font-size:14px;line-height:1.4em}body.mp6 .wpmdb .help-tab .support p,body.mp6 .wpmdb .help-tab .support .email a{font-size:14px}body.mp6 .wpmdb .help-tab div.warning p{font-size:13px}body.mp6 .wpmdb .help-tab .videos h4,body.mp6 .wpmdb .help-tab .videos p{font-size:14px}body.mp6 .wpmdb .inline-message,body.mp6 .wpmdb .notification-message{border-radius:0;border:0;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);padding:10px 14px;font-size:13px}body.mp6 .wpmdb .notification-message{margin-bottom:20px;background-color:#fff}body.mp6 .wpmdb .notification-message.ssl-notice,body.mp6 .wpmdb .notification-message.invalid-licence,body.mp6 .wpmdb .notification-message.unrecognized-import-file-notice{margin-bottom:0;margin-top:15px}body.mp6 .wpmdb .notification-message.backup-option-disabled{line-height:1.8em}body.mp6 .wpmdb .notification-message.backup-option-disabled a{text-decoration:underline}body.mp6 .wpmdb .notification-message.backup-option-disabled a:hover{text-decoration:none}body.mp6 .wpmdb .notification-message p{font-size:13px;margin-top:0}body.mp6 .wpmdb .notification-message p:last-child{margin:0}body.mp6 .wpmdb .notification-message h4{margin-top:0}body.mp6 .wpmdb .notification-message a{color:#0074a2;text-decoration:none}body.mp6 .wpmdb .notification-message a:hover{color:#2ea2cc}body.mp6 .wpmdb div.notification-message.invalid-licence p:last-child{margin:0.5em 0}body.mp6 .wpmdb div.notification-message.invalid-licence p:last-child a.button{color:#555555}body.mp6 .wpmdb .inline-message.error,body.mp6 .wpmdb .notification-message.error-notice{border-left:4px solid #dd3d36;background-color:#fff}body.mp6 .wpmdb .inline-message.warning,body.mp6 .wpmdb .notification-message.warning-notice{background-color:#fff;border-left:4px solid #ffba00}body.mp6 .wpmdb .inline-message.success,body.mp6 .wpmdb .notification-message.success-notice{border-left:4px solid #7ad03a}body.mp6 .wpmdb .ssl-notice{margin-bottom:0}body.mp6 .wpmdb .different-plugin-version-notice,body.mp6 .wpmdb .directory-permission-notice{margin-bottom:10px}body.mp6 .wpmdb .licence-status{color:#444;float:left;font-weight:normal}body.mp6 #overlay{background-color:rgba(0,0,0,0.5)}body.mp6 .migration-progress-ajax-spinner{top:20px}#overlay{background-color:rgba(255,255,255,0.9);position:fixed;top:0;left:0;width:100%;height:100%;z-index:100000;overflow-x:auto;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;transition:opacity .3s ease-out}#overlay.show{opacity:1;display:-webkit-box;display:-ms-flexbox;display:flex}@media screen and (max-width: 700px){#overlay.show{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}}#overlay.hide{opacity:0;display:-webkit-box;display:-ms-flexbox;display:flex}@media screen and (max-width: 1120px){.wpmdb-not-pro #overlay.show{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}}.stage-tabs{margin:0;z-index:5}.stage-tabs .stage-tab{box-sizing:border-box;display:block;float:left;width:auto;height:45px;margin:0 5px -1px 0;background-color:#ddd;border:1px solid #aaa;padding:.5em 1.5em 0;line-height:1.3;text-align:center;text-transform:capitalize;color:#333;transition:background-color .2s ease-in-out}.stage-tabs .stage-tab.active{background-color:#fff;border-bottom-color:#fff}.stage-tabs .stage-status{display:block;font-size:.8em;font-style:italic}.complete .stage-tabs .stage-tab:not(.active){cursor:pointer}.complete .stage-tabs .stage-tab:not(.active):hover{background-color:#eee}.migration-progress-stages{position:relative;margin:0 -30px 0;background:#fff;overflow-y:auto}.migration-progress-stages .migration-progress-stage-container{top:0;left:0;width:100%;padding:0}.migration-progress-stages .migration-progress-stage-container.queued,.migration-progress-stages .migration-progress-stage-container.complete{display:none}.migration-progress-stages .migration-progress-stage-container.active{display:block}.migration-progress-stages .migration-progress-stage-container.find_replace .progress-items .item-progress .size{display:none}.migration-progress-stages .migration-progress-stage-container.upload .progress-items,.migration-progress-stages .migration-progress-stage-container.import .progress-items{height:0px !important;opacity:0}.migration-progress-stages .truncation-notice{margin:-10px 30px 10px;padding:5px 10px;color:#999;text-align:center}.migration-progress-stages .hide-tables .truncation-notice{display:none}.migration-progress-stages .progress-items{position:relative;overflow-y:auto;padding:10px 30px 10px;z-index:0}.migration-progress-stages .item-progress{position:relative;background-color:#eee;overflow:hidden;margin:0 0 .8em 0;transition:height .2s ease-in-out, margin .2s ease-in-out}.migration-progress-stages .item-progress .dashicons-yes.dashicons{position:absolute;right:.3em;top:0.12em;z-index:20;background:#333;color:#85d937;width:.75em;height:.75em;border-radius:50%;text-indent:-.18em;line-height:.8;vertical-align:2em;font-size:2em;opacity:0;transition:opacity .3s ease-in;transition-delay:.5s}.migration-progress-stages .item-progress.complete .dashicons-yes{opacity:1}.migration-progress-stages .item-progress .progress-bar{background:#85d937}.migration-progress-stages .item-progress .item-info{margin:0;position:relative;padding:.25em 0 .25em 1em;font-size:1em;z-index:10}.migration-progress-stages .hide-tables .progress-items{height:0px !important;opacity:0}@-webkit-keyframes progress-bg-anim{0%{background-position:0 0}100%{background-position:50px 50px}}@keyframes progress-bg-anim{0%{background-position:0 0}100%{background-position:50px 50px}}.clearfix:before,.clearfix:after{content:"";display:table}.clearfix:after{clear:both}.clearfix{zoom:1}.general-spinner{width:16px;height:16px}.migration-error{color:#a21b1b;display:block;max-height:400px;max-width:100%;overflow:auto;word-wrap:break-word}.migration-php-errors{display:none;margin:20px 0;overflow-y:scroll;height:180px}.progress-overlay-container{display:none;position:relative;background-color:#eee;padding:30px 30px 15px;box-shadow:0 0 10px rgba(0,0,0,0.5);cursor:default;font-size:14px;z-index:1;margin:0 10px;box-sizing:border-box;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;max-height:95%;overflow-y:hidden;transition:opacity .3s ease-out, -webkit-transform .5s ease-out;transition:opacity .3s ease-out, transform .5s ease-out;width:700px;min-width:700px;-ms-flex-preferred-size:700px;flex-basis:700px;-webkit-box-flex:0;-ms-flex:0 1 0%;flex:0 1 0%}.progress-overlay-container.show{display:-webkit-box;display:-ms-flexbox;display:flex;opacity:1}.progress-overlay-container.hide{display:-webkit-box;display:-ms-flexbox;display:flex;opacity:0;-webkit-transform:translateY(-100%);transform:translateY(-100%)}.progress-overlay-container>div{-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto}.progress-overlay-container .migration-progress-stages{-webkit-box-flex:100;-ms-flex:100 1 auto;flex:100 1 auto}@media all and (-ms-high-contrast: none){.progress-overlay-container .migration-progress-stages{height:300px}}.progress-overlay-container .progress-title{margin-top:0;font-size:22px;font-weight:normal;width:85%;line-height:1.3}.progress-overlay-container .progress-title .domain-label{white-space:nowrap}.progress-overlay-container .progress-title .dashicons{display:inline;vertical-align:middle;margin-left:-.15em;padding-right:.3em;font-size:42px}.progress-overlay-container .progress-info-wrapper{margin-bottom:10px}.progress-overlay-container .progress-text{clear:left;float:left;width:100%}.progress-overlay-container .timer{position:absolute;top:35px;right:55px}.progress-overlay-container .progress-bar{position:absolute;top:0;left:0;height:100%;transition:width 1s ease-out;z-index:0}.progress-overlay-container .stage-progress{display:none;text-transform:capitalize;padding:15px 30px 0;margin:0 -30px;height:65px;box-sizing:border-box;background:#fff;border-top:1px solid #aaa;z-index:100}.progress-overlay-container .stage-progress.active{display:block}.progress-overlay-container .stage-progress .lowercase{text-transform:lowercase}.progress-overlay-container .stage-progress .items-complete{margin-left:3em}.progress-overlay-container .stage-progress .progress-bar-wrapper{position:relative;height:10px;width:100%;background-color:#eee;margin:15px 0 10px;background-image:linear-gradient(-45deg, rgba(255,255,255,0.35) 25%,rgba(0,0,0,0) 25%,rgba(0,0,0,0) 50%,rgba(255,255,255,0.35) 50%,rgba(255,255,255,0.35) 75%,rgba(0,0,0,0) 75%,rgba(0,0,0,0));background-size:20px 20px;-webkit-animation:progress-bg-anim 5s linear infinite;animation:progress-bg-anim 5s linear infinite}.progress-overlay-container .stage-progress .progress-bar{background-color:#406fa4}.progress-overlay-container .stage-progress .show-hide-tables{display:block;float:right;cursor:pointer}.progress-overlay-container .stage-progress.import .show-hide-tables,.progress-overlay-container .stage-progress.upload .show-hide-tables{display:none}.progress-overlay-container .stage-progress.import .items-complete-wrap,.progress-overlay-container .stage-progress.upload .items-complete-wrap{display:none}.progress-overlay-container .stage-progress.find_replace .size-complete-wrap{display:none}.progress-overlay-container .stage-progress.find_replace .items-complete{margin-left:9em}.progress-overlay-container .progress-tables{overflow:hidden;margin-bottom:2px;padding:0 0 20px 0}.progress-overlay-container .progress-tables-hover-boxes{position:absolute;top:0px;left:0px;display:block;width:100%}.progress-overlay-container .progress-chunk-hover{display:block;float:left;height:35px;position:relative;top:-5px;z-index:1}.progress-overlay-container .progress-chunk{box-sizing:border-box;float:left;display:block;height:6px;border-right:1px solid #ccc;border-bottom:1px solid #ccc;color:#999;position:relative;text-align:center}.progress-overlay-container .progress-chunk>span{padding:0px 3px;white-space:nowrap;text-overflow:ellipsis;margin-top:10px;display:inline-block}.progress-overlay-container .progress-label{padding:5px 10px;border:1px solid #ccc;border-radius:3px;background-color:#fff;font-family:Consolas, Monaco, monospace;font-size:12px;display:inline-block;top:-35px;position:absolute;opacity:0;transition:opacity 200ms ease-in-out}.progress-overlay-container .label-visible{opacity:1}.progress-overlay-container .progress-label:before{content:"";width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #ccc;display:block;position:absolute;bottom:-5px;left:50%;margin-left:-2px}.progress-overlay-container .progress-label:after{content:"";width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #fff;display:block;position:absolute;bottom:-4px;left:50%;margin-left:-2px}.progress-overlay-container .migration-progress-ajax-spinner{left:7px;position:relative;top:15px}.progress-overlay-container .close-progress-content{color:#999;cursor:pointer;font-size:26px;font-weight:200;position:absolute;right:10px;top:5px;padding:5px;display:none}.progress-overlay-container .close-progress-content:hover{color:#666;border-color:#aaa}.progress-overlay-container .migration-controls{display:block;transition:opacity .2s ease-out;padding-top:15px}.progress-overlay-container .migration-controls.hidden{opacity:0;pointer-events:none}.progress-overlay-container .migration-controls span{float:left;text-align:center;display:block}.progress-overlay-container .migration-controls span:first-child{margin-right:10px;width:71px}.progress-overlay-container .migration-controls .pause-before-finalize{display:none;float:right;margin-top:5px}.progress-overlay-container .migration-controls #pause-before-finalize{margin-top:0}.progress-overlay-container .pro-version{margin-top:45px;padding-top:40px;position:relative;border-top:1px solid #ccc}.progress-overlay-container .pro-version iframe{position:absolute;top:40px;right:0;display:block}.progress-overlay-container .pro-version-content{padding-right:460px;min-height:255px}.progress-overlay-container .pro-version-content h1{line-height:1em;margin-top:0;font-size:20px}.progress-overlay-container .pro-version-content ul{margin-left:24px}.progress-overlay-container .pro-version-content li{position:relative;font-size:14px;line-height:1.4em;margin-bottom:15px;max-width:580px}.progress-overlay-container .pro-version-content .pro-quote{margin:0 0 20px 0;max-width:570px}.progress-overlay-container .pro-version-content .pro-quote .dashicons-star-filled{font-size:16px;width:16px;height:16px;position:relative;top:2px}.progress-overlay-container .pro-version-content .pro-quote-author{font-style:italic;white-space:nowrap}.progress-overlay-container.wpmdb-error{outline:3px solid #dc3232}@media screen and (max-width: 1096px){.progress-overlay-container .pro-version iframe{position:relative;top:auto;right:auto}.progress-overlay-container .pro-version-content{min-height:0;padding:0 0 20px 0}}.progress-overlay-container:not(.complete) .migration-progress-stages .item-progress:first-child{background-image:linear-gradient(-45deg, rgba(255,255,255,0.3) 25%,rgba(0,0,0,0) 25%,rgba(0,0,0,0) 50%,rgba(255,255,255,0.3) 50%,rgba(255,255,255,0.3) 75%,rgba(0,0,0,0) 75%,rgba(0,0,0,0));background-size:50px 50px;-webkit-animation:progress-bg-anim 2s linear infinite;animation:progress-bg-anim 2s linear infinite}.progress-overlay-container.paused .active.stage-progress .progress-bar-wrapper{-webkit-animation-play-state:paused;animation-play-state:paused}.progress-overlay-container.paused .migration-progress-stages .item-progress:first-child{-webkit-animation-play-state:paused;animation-play-state:paused}.progress-overlay-container .migration-progress-stages .determining-media .item-progress:first-child{background-image:none;-webkit-animation:none;animation:none}.progress-overlay-container.cancelled .stage-tabs,.progress-overlay-container.cancelled .migration-progress-stages,.progress-overlay-container.cancelled .stage-progress.active,.progress-overlay-container.wpmdb-error .stage-tabs,.progress-overlay-container.wpmdb-error .migration-progress-stages,.progress-overlay-container.wpmdb-error .stage-progress.active{display:none}.migrate-tab>.pro-version{display:none}#overlay .pro-version{width:42%;padding-left:0;padding-right:0;-ms-flex-preferred-size:42%;flex-basis:42%;max-width:515px;min-width:400px;max-height:100%;-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2;font-size:14px;display:block;transition:-webkit-transform .3s ease-out, opacity .3s ease-out, margin-left .2s .3s ease-in-out;transition:transform .3s ease-out, opacity .3s ease-out, margin-left .2s .3s ease-in-out}#overlay .pro-version.remove{margin-left:-525px !important}#overlay .pro-version .pro-version-content{padding:0 30px}#overlay .pro-version .pro-version-content h1{font-size:22px;font-weight:bold;margin:0 0 30px}#overlay .pro-version .pro-version-content li{margin-bottom:10px;padding-left:35px;position:relative}#overlay .pro-version .pro-version-content li .dashicons{display:block;position:absolute;font-size:2em;top:-3px;left:0}#overlay .pro-version .pro-version-content .pro-quote{border:1px solid #bbb;border-radius:3px;padding:15px 15px 15px 100px;margin:30px 0;position:relative;background:url("../img/mor10.png") no-repeat 15px 31px;background-size:51px 51px}@media (min--moz-device-pixel-ratio: 1.3), (-webkit-min-device-pixel-ratio: 1.3), (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx){#overlay .pro-version .pro-version-content .pro-quote{background-image:url("../img/mor10@2x.png")}}#overlay .pro-version .pro-version-content .pro-quote p{margin:0;font-size:13px}#overlay .pro-version .pro-version-content .pro-quote .pro-quote-author{font-size:14px;font-weight:bold;color:#999;margin-bottom:5px}#overlay .pro-version .pro-version-content .pro-quote .pro-quote-author .dashicons{float:right;color:#999}#overlay .pro-version .pro-version-content .pro-quote .stars{position:absolute;bottom:0;left:0;width:100%;height:0;overflow:visible;text-align:center}#overlay .pro-version .pro-version-content .pro-quote .stars span{background:#eee;color:#999;margin-top:-.5em}#overlay .pro-version .pro-version-content .pro-quote .stars span:first-child{padding-left:.1em}#overlay .pro-version .pro-version-content .pro-quote .stars span:last-child{padding-right:.1em}#overlay .pro-version iframe,#overlay .pro-version .iframe{width:100%;height:289px;background:#000}#overlay .pro-version .button{display:block;position:relative;width:250px;margin:20px auto 10px;text-align:center}#overlay .pro-version .close-pro-version{color:#999;cursor:pointer;font-size:26px;font-weight:200;position:absolute;right:10px;top:5px;padding:5px;display:block}#overlay .pro-version .close-pro-version:hover{color:#666;border-color:#aaa}
asset/dist/img/mdb-banner.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 459 459"><defs><style>.cls-1{fill:#a5ddf1;}.cls-2{fill:#80bdd4;}.cls-3{fill:#042340;}</style></defs><title>mdb-banner</title><rect class="cls-1" width="459" height="459"/><path class="cls-2" d="M144.9,379.68a6.21,6.21,0,0,1-.57-.49,19.06,19.06,0,0,0-2.8-2,11.73,11.73,0,0,1-1.79-1,60.76,60.76,0,0,0-58.9-39.53,86.13,86.13,0,0,0-11.22,1.53,54.56,54.56,0,0,0-14,5.1l-3.82,2.3a30.65,30.65,0,0,0-2-5.1,52.49,52.49,0,0,0-18.36-21.68,77.52,77.52,0,0,0,38-41.05c0-.26.26-.77.26-1s.25-.51.25-.77a66.1,66.1,0,0,0,3.06-10.2,74.47,74.47,0,0,0,1.28-7.9,74.61,74.61,0,0,0-1.53-24.74,102.43,102.43,0,0,0-4.08-12.49,77.64,77.64,0,0,0-16.07-24A59.74,59.74,0,0,0,46.67,191a68.93,68.93,0,0,0-10-6.89,79,79,0,0,0-25.24-9.18c-3.32-.51-6.89-.76-10.2-1,2.8-1,5.61-1.78,8.41-2.55A63.89,63.89,0,0,1,63.24,183.6a22,22,0,0,1,7.14,6.63c1.53,1.79,3.06,3.57,4.34,5.36a46.11,46.11,0,0,1,26,82.62,71.67,71.67,0,0,1,24.22,11,84,84,0,0,1,36.47-19.38,79.36,79.36,0,0,1,49.47,4.34,44.8,44.8,0,0,1,23.2-6.63c23.46.25,42.58,19.38,42.33,42.84v2.29a24.75,24.75,0,0,1,22.7,24.74,19.91,19.91,0,0,1-.77,5.61,76.42,76.42,0,0,1,83.38,58.9c.26,2,.77,4.08,1,6.12a69.75,69.75,0,0,1,39,47.94c.23,1,.44,2,.62,3.06H416.1a47.52,47.52,0,0,0-4.53-7.91,53,53,0,0,0-45.9-22.69,35.11,35.11,0,0,0-5.1.51A22.1,22.1,0,0,0,341.19,419a24.7,24.7,0,0,0-4.34.51,2.92,2.92,0,0,1-.65.2l-.47.1a3,3,0,0,0-.66.2,9.35,9.35,0,0,0-2.81,1c-.51-1.53-1-2.8-1.53-4.08-1-2-2-4.08-3.06-5.86l-2.29-3.83c-7.14-10.2-18.36-18.36-31.62-23.71a92.31,92.31,0,0,0-33.15-6.12h-4.34a92.83,92.83,0,0,0-15,1.78,90.42,90.42,0,0,0-22.44,8.16,63.09,63.09,0,0,0-13.52,9.18c-3.57-.51-7.14-1-11-1.27h-3.83a75.63,75.63,0,0,0-10.71.76l-7.65,1.53a21.62,21.62,0,0,0-3.82,1,60,60,0,0,0-11.73,4.85c0-.51-.26-1.28-.26-1.79a17,17,0,0,0-.51-3.57,30.21,30.21,0,0,0-1.27-4.59,19.6,19.6,0,0,0-1.79-4.08,33.5,33.5,0,0,0-6.88-8.92,5,5,0,0,0-.57-.49l-.39-.29ZM206,354.45c0-2.81-2.8-5.35-6.37-5.1-3.32,0-6.12,2.55-6.12,5.36H188.7V345c-8.67,0-15.55,3.82-15.55,8.67v.76h-8.42c0,2.3,4.33,4.08,10.2,4.85a6.51,6.51,0,0,0-1.78,4.59c0,5.35,6.88,9.94,15.55,9.94V359.3c6.37-.77,11-2.55,11-4.85Zm28.82-31.87,15-28.82c-9.43-4.84-20.91-1.53-25.5,7.65a17.87,17.87,0,0,0-2,7.14l-9.94-9.43c-6.63,6.63-6.63,17.08-.26,23.2a.25.25,0,0,0,.26.26h-9.95c0,3.82,9.95,6.88,22.44,6.88,12.22,0,22-2.92,22.42-6.63h8.18c0-3.82-3.57-6.88-8.16-6.63-4.24,0-7.74,2.68-7.9,6.38h7.9v.25h-7.88v-.25Z"/><path class="cls-2" d="M423.3,300.65a17.61,17.61,0,0,0-11.48,4.59c-4.84-8.93-13.51-14.79-23.2-14.79-9.95,0-18.36,6.12-23.46,15.3h-.51c-8.16,0-14.79,7.9-14.79,17.85h92.05c.51-12.75-7.9-23-18.61-23"/><path class="cls-3" d="M0,173.91H1.27a65.76,65.76,0,0,1,10.2,1,73.24,73.24,0,0,1,25.25,9.18A68.29,68.29,0,0,1,46.66,191a61,61,0,0,1,5.87,5.61,73.31,73.31,0,0,1,16.06,24,71.24,71.24,0,0,1,4.08,12.49,73.55,73.55,0,0,1,1.53,24.74c-.25,2.55-.76,5.35-1.27,7.9a78.54,78.54,0,0,1-3.06,10.2c0,.26-.26.51-.26.77s-.25.76-.25,1c-7.14,17.59-20.4,32.64-38,41.05a52.42,52.42,0,0,1,18.36,21.68,29.81,29.81,0,0,1,2,5.1l3.83-2.3a61.4,61.4,0,0,1,14-5.1,57,57,0,0,1,11.22-1.53,60.79,60.79,0,0,1,58.91,39.53,10.51,10.51,0,0,1,1.78,1,11.32,11.32,0,0,1,2.81,2,6.6,6.6,0,0,1,1.53,1.27,33.39,33.39,0,0,1,6.88,8.93,27.37,27.37,0,0,1,1.79,4.08,30.21,30.21,0,0,1,1.27,4.59c.26,1.27.26,2.29.51,3.57a4.24,4.24,0,0,1,.26,1.78,59.38,59.38,0,0,1,11.73-4.84c1.27-.26,2.55-.77,3.82-1a39.88,39.88,0,0,1,7.65-1.53,70.61,70.61,0,0,1,10.71-.77h3.83a51.2,51.2,0,0,1,11,1.28,83.42,83.42,0,0,1,13.52-9.18,86.54,86.54,0,0,1,22.44-8.16,97.5,97.5,0,0,1,15-1.79h4.34a92.48,92.48,0,0,1,33.15,6.12c13.51,5.36,24.48,13.52,31.62,23.72l2.29,3.82a31.74,31.74,0,0,1,3.06,5.87c.51,1.27,1,2.8,1.54,4.08a12,12,0,0,1,2.8-1,2.55,2.55,0,0,1,.66-.21l.47-.1a3.18,3.18,0,0,0,.66-.2,27.79,27.79,0,0,1,4.33-.51,22.72,22.72,0,0,1,19.38,9.94,35.39,35.39,0,0,1,5.1-.51,52.47,52.47,0,0,1,45.9,22.7,49.63,49.63,0,0,1,4.62,7.9H0V173.91Z"/><path class="cls-2" d="M194.31,242.76h29.58c0-11.22-11.73-20.4-26-20.4A29.47,29.47,0,0,0,178.75,229c-.76,0-1.53-.25-2.55-.25-9.94,0-17.85,6.37-17.85,14Z"/><path class="cls-3" d="M199.92,349.35c-3.32,0-6.12,2.3-6.12,5.1H189v-9.69c-8.67,0-15.55,3.83-15.55,8.67v.77H165c0,2,4.08,3.82,10.2,4.84a7.35,7.35,0,0,0-1.78,4.59c0,5.61,6.88,9.95,15.55,9.95V359c6.38-.76,11-2.55,11-4.84h6.38c-.26-2.55-3.06-4.85-6.38-4.85"/><path class="cls-3" d="M100.21,173.4a13.48,13.48,0,0,0,4.34,17.6l1-1.53a14.35,14.35,0,0,0,13.26,8.67V173.66c4.34-.77,7.4-2.3,7.4-4.08h5.86c0-2.81-2.55-4.85-5.86-4.85s-5.87,2.3-5.87,4.85h-2.29a12.27,12.27,0,0,0-14,0H93.33c-.25,1.53,2.55,3.06,6.89,3.82"/><path class="cls-3" d="M196.35,196.61c16.32,0,29.32-4.08,29.32-8.93h10.46c0-4.84-4.59-8.92-10.46-8.92s-10.45,3.82-10.45,8.67h-7.14l18.1-35.19c-12-6.12-26.26-1.79-32.13,9.43a22.53,22.53,0,0,0-2.55,8.93l-11.22-11.73c-8.16,7.65-9.18,20.14-2.55,28.3H166.51c.26,5.36,13.52,9.44,29.84,9.44"/><path class="cls-3" d="M247.35,316c-4.33,0-7.91,3.06-7.91,6.63h16.07c0-3.57-3.57-6.63-8.16-6.63"/><path class="cls-3" d="M284.58,236.9a18.72,18.72,0,0,0-4.08,4.84c-6.38,10.2-3.32,24.23,7.14,31.11l1.78-2.8a24.62,24.62,0,0,0,22.7,15V237.66c9.69-1.27,16.32-4.33,16.32-7.65h9.94c0-4.59-4.33-8.16-9.94-8.16-5.35,0-9.69,3.57-9.95,8.16H272.85v.26c0,2.55,4.59,5.1,11.73,6.63"/><path class="cls-3" d="M249.9,293.76c-9.43-4.84-20.91-1.53-25.5,7.65a19,19,0,0,0-2,7.14l-10-9.43c-6.37,6.88-6.63,17.34-.25,23.2l.25.26h-9.94c0,3.82,9.94,6.88,22.44,6.88s22.44-3.06,22.44-6.88h-12.5Z"/><path class="cls-3" d="M342.47,195.59c28.81,0,52-7.14,52.27-15.81h18.62c0-8.67-8.42-15.56-18.62-15.56s-18.62,6.89-18.62,15.56H361.33V105.57A40,40,0,0,0,324.61,129l-2.8-4.33c-16.58,10.71-21.68,32.13-11.48,48.19a33.62,33.62,0,0,0,6.12,7.14H290.19c0,8.42,23.46,15.56,52.27,15.56"/></svg>
asset/dist/img/welcome.jpg DELETED
Binary file
asset/dist/img/wp-migrate-db-pro.jpg DELETED
Binary file
asset/dist/img/wp-migrate-db-pro@2x.jpg DELETED
Binary file
asset/dist/js/common-101.js DELETED
@@ -1,223 +0,0 @@
1
- // global vars
2
- var wpmdb = wpmdb || {};
3
- wpmdb.common = {
4
- hooks: [],
5
- call_stack: [],
6
- non_fatal_errors: '',
7
- migration_error: false
8
- };
9
- wpmdb.functions = {};
10
-
11
- /**
12
- * Toggle proper translated strings based on migration type selected.
13
- *
14
- * To show the properly translated strings for the selected push or pull
15
- * migration type, we need to hide all strings then show the right
16
- * translated strings based on the migration type selected.
17
- *
18
- * @see https://github.com/deliciousbrains/wp-migrate-db-pro/issues/764
19
- *
20
- * @return void
21
- */
22
- function wpmdb_toggle_migration_action_text() {
23
- jQuery( '.action-text' ).hide();
24
- jQuery( '.action-text.' + jQuery( 'input[name=action]:checked' ).val() ).show();
25
- }
26
-
27
- /**
28
- * Return the currently selected migration type selected.
29
- *
30
- * @return string Will return `push`, `pull`, `savefile`, or `` for exporting as a file.
31
- */
32
- function wpmdb_migration_type() {
33
- var action = jQuery( 'input[name=action]:checked' );
34
- if ( 0 === action.length ) {
35
- return '';
36
- }
37
- return action.val();
38
- }
39
-
40
- function wpmdb_call_next_hook() {
41
- if ( !wpmdb.common.call_stack.length ) {
42
- wpmdb.common.call_stack = wpmdb.common.hooks;
43
- }
44
-
45
- var func = wpmdb.common.call_stack[ 0 ];
46
- wpmdb.common.call_stack.shift();
47
- func.call( this );
48
- }
49
-
50
- function wpmdb_add_commas( number_string ) {
51
- number_string += '';
52
- var number_parts = number_string.split( '.' );
53
- var integer = number_parts[ 0 ];
54
- var decimal = 1 < number_parts.length ? '.' + number_parts[ 1 ] : '';
55
- var rgx = /(\d+)(\d{3})/;
56
- while ( rgx.test( integer ) ) {
57
- integer = integer.replace( rgx, '$1' + ',' + '$2' );
58
- }
59
- return integer + decimal;
60
- }
61
-
62
- function wpmdb_parse_json( maybe_json ) {
63
- var json_object = {};
64
- try {
65
- json_object = jQuery.parseJSON( maybe_json );
66
- }
67
- catch ( e ) {
68
-
69
- // We simply return false here because the json data itself will never just contain a value of "false"
70
- return false;
71
- }
72
- return json_object;
73
- }
74
-
75
- /**
76
- * Global error method for detecting PHP or other errors in AJAX response
77
- *
78
- * @param title - the error title if not a PHP error
79
- * @param code - the error code if not a PHP error
80
- * @param text - the AJAX response text to sniff for errors
81
- * @param jqXHR - optional AJAX object used to enrich the error message
82
- *
83
- * @returns {string} - html error string with view error toggle element
84
- */
85
- function wpmdbGetAjaxErrors( title, code, text, jqXHR ) {
86
- var jsonErrors = false;
87
- var html = '';
88
-
89
- var validJson = wpmdb_parse_json( text );
90
- if ( false === validJson ) {
91
- jsonErrors = true;
92
- title = wpmdb_strings.ajax_json_message;
93
- code = '(#144)';
94
- var originalText = text;
95
- text = wpmdb_strings.ajax_json_errors + ' ' + code;
96
- text += '<br><a class="show-errors-toggle" href="#">' + wpmdb_strings.view_error_messages + '</a> ';
97
- text += '<div class="migration-php-errors">' + originalText + '</div>';
98
- }
99
-
100
- // Only add local connection issue if php errors (#144) or jqXHR has been provided
101
- if ( jsonErrors || 'undefined' !== jqXHR ) {
102
- html += '<strong>' + title + '</strong>' + ' &mdash; ';
103
- }
104
-
105
- // Only add extra error details if not php errors (#144) and jqXHR has been provided
106
- if ( !jsonErrors && 'undefined' !== jqXHR ) {
107
- html += wpmdb_strings.status + ': ' + jqXHR.status + ' ' + jqXHR.statusText;
108
- html += '<br /><br />' + wpmdb_strings.response + ':<br />';
109
- }
110
-
111
- // Add code to the end of the error text if not json errors
112
- if ( !jsonErrors ) {
113
- text += ' ' + code;
114
- }
115
-
116
- // Finally add the error message to the output
117
- html += text;
118
-
119
- return html;
120
- }
121
-
122
- wpmdb.preg_quote = function( str, delimiter ) {
123
-
124
- // discuss at: http://phpjs.org/functions/preg_quote/
125
- // original by: booeyOH
126
- // improved by: Ates Goral (http://magnetiq.com)
127
- // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
128
- // improved by: Brett Zamir (http://brett-zamir.me)
129
- // bugfixed by: Onno Marsman
130
- // example 1: preg_quote("$40");
131
- // returns 1: '\\$40'
132
- // example 2: preg_quote("*RRRING* Hello?");
133
- // returns 2: '\\*RRRING\\* Hello\\?'
134
- // example 3: preg_quote("\\.+*?[^]$(){}=!<>|:");
135
- // returns 3: '\\\\\\.\\+\\*\\?\\[\\^\\]\\$\\(\\)\\{\\}\\=\\!\\<\\>\\|\\:'
136
-
137
- return String( str )
138
- .replace( new RegExp( '[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\' + ( delimiter || '' ) + '-]', 'g' ), '\\$&' );
139
- };
140
-
141
- wpmdb.table_is = function( table_prefix, desired_table, given_table ) {
142
- if ( ( table_prefix + desired_table ).toLowerCase() === given_table.toLowerCase() ) {
143
- return true;
144
- }
145
-
146
- var escaped_given_table = wpmdb.preg_quote( given_table );
147
- var regex = new RegExp( table_prefix + '([0-9]+)_' + desired_table, 'i' );
148
- var results = regex.exec( escaped_given_table );
149
- return null != results;
150
- };
151
-
152
- wpmdb.subsite_for_table = function( table_prefix, table_name ) {
153
- var escaped_table_name = wpmdb.preg_quote( table_name );
154
- var regex = new RegExp( table_prefix + '([0-9]+)_', 'i' );
155
- var results = regex.exec( escaped_table_name );
156
-
157
- if ( null === results ) {
158
- return 1;
159
- } else {
160
- return results[ 1 ];
161
- }
162
- };
163
-
164
- wpmdb.functions.convertKBSizeToHR = function( size, dec, kbSize, retArray ) {
165
- var retVal, units;
166
- kbSize = kbSize || 1000;
167
- dec = dec || 2;
168
- size = parseInt( size );
169
-
170
- if ( kbSize > Math.abs( size ) ) {
171
- retVal = [ size.toFixed( 0 ), 'KB' ];
172
- } else {
173
- units = [ 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB' ];
174
- var u = -1;
175
- do {
176
- size /= kbSize;
177
- ++u;
178
- } while ( Math.abs( size ) >= kbSize && u < units.length - 1 );
179
- retVal = [ Math.round( size * Math.pow( 10, dec ) ) / Math.pow( 10, dec ), units[ u ] ];
180
- }
181
-
182
- if ( ! retArray ) {
183
- retVal = retVal[0] + ' ' + retVal[1];
184
- }
185
- return retVal;
186
- };
187
-
188
- wpmdb.functions.convertKBSizeToHRFixed = function( size, dec, kbSize ) {
189
- dec = dec || 2;
190
- var hrSizeArray = wpmdb.functions.convertKBSizeToHR( size, dec, kbSize, true );
191
- if ( 'KB' !== hrSizeArray[1] ) {
192
- return hrSizeArray[ 0 ].toFixed( 2 ) + ' ' + hrSizeArray[ 1 ];
193
- }
194
- return hrSizeArray[ 0 ] + ' ' + hrSizeArray[ 1 ];
195
- };
196
-
197
- wpmdb.functions.ajax_handle_dismissible_notice = function( nonce, callback, ele ) {
198
- jQuery.ajax( {
199
- url: ajaxurl,
200
- type: 'POST',
201
- dataType: 'text',
202
- cache: false,
203
- data: {
204
- action: 'wpmdb_process_notice_link',
205
- nonce: nonce,
206
- notice: jQuery( ele ).data( 'notice' ),
207
- type: jQuery( ele ).data( 'type' ),
208
- reminder: jQuery( ele ).data( 'reminder' )
209
- },
210
- beforeSend: callback( ele )
211
- } );
212
- };
213
-
214
- wpmdb.functions.get_spinner_url = function() {
215
- var admin_url = ajaxurl.replace( '/admin-ajax.php', '' ), spinner_url = admin_url + '/images/spinner';
216
-
217
- if ( 2 < window.devicePixelRatio ) {
218
- spinner_url += '-2x';
219
- }
220
- spinner_url += '.gif';
221
-
222
- return spinner_url;
223
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
asset/dist/js/common-101.min.js DELETED
@@ -1 +0,0 @@
1
- function wpmdb_toggle_migration_action_text(){jQuery(".action-text").hide(),jQuery(".action-text."+jQuery("input[name=action]:checked").val()).show()}function wpmdb_migration_type(){var a=jQuery("input[name=action]:checked");return 0===a.length?"":a.val()}function wpmdb_call_next_hook(){wpmdb.common.call_stack.length||(wpmdb.common.call_stack=wpmdb.common.hooks);var a=wpmdb.common.call_stack[0];wpmdb.common.call_stack.shift(),a.call(this)}function wpmdb_add_commas(a){a+="";for(var b=a.split("."),c=b[0],d=1<b.length?"."+b[1]:"",e=/(\d+)(\d{3})/;e.test(c);)c=c.replace(e,"$1,$2");return c+d}function wpmdb_parse_json(a){var b={};try{b=jQuery.parseJSON(a)}catch(c){return!1}return b}function wpmdbGetAjaxErrors(a,b,c,d){var e=!1,f="",g=wpmdb_parse_json(c);if(!1===g){e=!0,a=wpmdb_strings.ajax_json_message,b="(#144)";var h=c;c=wpmdb_strings.ajax_json_errors+" "+b,c+='<br><a class="show-errors-toggle" href="#">'+wpmdb_strings.view_error_messages+"</a> ",c+='<div class="migration-php-errors">'+h+"</div>"}return(e||"undefined"!==d)&&(f+="<strong>"+a+"</strong> &mdash; "),e||"undefined"===d||(f+=wpmdb_strings.status+": "+d.status+" "+d.statusText,f+="<br /><br />"+wpmdb_strings.response+":<br />"),e||(c+=" "+b),f+=c}var wpmdb=wpmdb||{};wpmdb.common={hooks:[],call_stack:[],non_fatal_errors:"",migration_error:!1},wpmdb.functions={},wpmdb.preg_quote=function(a,b){return String(a).replace(new RegExp("[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\"+(b||"")+"-]","g"),"\\$&")},wpmdb.table_is=function(a,b,c){if((a+b).toLowerCase()===c.toLowerCase())return!0;var d=wpmdb.preg_quote(c),e=new RegExp(a+"([0-9]+)_"+b,"i"),f=e.exec(d);return null!=f},wpmdb.subsite_for_table=function(a,b){var c=wpmdb.preg_quote(b),d=new RegExp(a+"([0-9]+)_","i"),e=d.exec(c);return null===e?1:e[1]},wpmdb.functions.convertKBSizeToHR=function(a,b,c,d){var e,f;if(c=c||1e3,b=b||2,a=parseInt(a),c>Math.abs(a))e=[a.toFixed(0),"KB"];else{f=["MB","GB","TB","PB","EB","ZB","YB"];var g=-1;do a/=c,++g;while(Math.abs(a)>=c&&g<f.length-1);e=[Math.round(a*Math.pow(10,b))/Math.pow(10,b),f[g]]}return d||(e=e[0]+" "+e[1]),e},wpmdb.functions.convertKBSizeToHRFixed=function(a,b,c){b=b||2;var d=wpmdb.functions.convertKBSizeToHR(a,b,c,!0);return"KB"!==d[1]?d[0].toFixed(2)+" "+d[1]:d[0]+" "+d[1]},wpmdb.functions.ajax_handle_dismissible_notice=function(a,b,c){jQuery.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_process_notice_link",nonce:a,notice:jQuery(c).data("notice"),type:jQuery(c).data("type"),reminder:jQuery(c).data("reminder")},beforeSend:b(c)})},wpmdb.functions.get_spinner_url=function(){var a=ajaxurl.replace("/admin-ajax.php",""),b=a+"/images/spinner";return 2<window.devicePixelRatio&&(b+="-2x"),b+=".gif"};
 
asset/dist/js/dismissable-notices-101.js DELETED
@@ -1,24 +0,0 @@
1
- (function( $ ) {
2
-
3
- //If there's an error message visible about the mu-plugins folder not being writable
4
- if ( 0 < $( '.wpmdb-compat-plugin-row-error' ).length ) {
5
- $( '[data-slug="wp-migrate-db-pro"]' ).addClass( 'wpmdbpro-has-message' );
6
- }
7
-
8
- //For the free plugin the update class needs to be present
9
- $( '.wpmdbpro-custom' ).prev().addClass( 'update' );
10
-
11
- $( '.notice-link-plugins-page' ).click( function( e ) {
12
- e.preventDefault();
13
- var self = jQuery( this );
14
-
15
- wpmdb.functions.ajax_handle_dismissible_notice( wpmdb_nonces.process_notice_link, function( ele ) {
16
- $( ele ).closest( '.wpmdbpro-custom' ).hide();
17
-
18
- // remove .wpmdb-has-message class from parent TR to add the bottom border back in
19
- $( ele ).closest( 'tr' ).siblings( 'tr.wpmdbpro-has-message' ).removeClass( 'wpmdbpro-has-message' );
20
- }, self );
21
-
22
- $( '.wpmdbpro-custom' ).prev().removeClass( 'update' );
23
- } );
24
- })( jQuery );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
asset/dist/js/dismissable-notices-101.min.js DELETED
@@ -1 +0,0 @@
1
- !function(a){0<a(".wpmdb-compat-plugin-row-error").length&&a('[data-slug="wp-migrate-db-pro"]').addClass("wpmdbpro-has-message"),a(".wpmdbpro-custom").prev().addClass("update"),a(".notice-link-plugins-page").click(function(b){b.preventDefault();var c=jQuery(this);wpmdb.functions.ajax_handle_dismissible_notice(wpmdb_nonces.process_notice_link,function(b){a(b).closest(".wpmdbpro-custom").hide(),a(b).closest("tr").siblings("tr.wpmdbpro-has-message").removeClass("wpmdbpro-has-message")},c),a(".wpmdbpro-custom").prev().removeClass("update")})}(jQuery);
 
asset/dist/js/hook-101.js DELETED
@@ -1,64 +0,0 @@
1
- (function( $ ) {
2
-
3
- $.wpmdb = {
4
- /**
5
- * Implement a WordPress-link Hook System for Javascript
6
- * TODO: Change 'tag' to 'args', allow number (priority), string (tag), object (priority+tag)
7
- */
8
- hooks: { action: {}, filter: {} },
9
- add_action: function( action, callable, tag ) {
10
- jQuery.wpmdb.add_hook( 'action', action, callable, tag );
11
- },
12
- add_filter: function( action, callable, tag ) {
13
- jQuery.wpmdb.add_hook( 'filter', action, callable, tag );
14
- },
15
- do_action: function( action, args ) {
16
- jQuery.wpmdb.do_hook( 'action', action, null, args );
17
- },
18
- apply_filters: function( action, value, args ) {
19
- return jQuery.wpmdb.do_hook( 'filter', action, value, args );
20
- },
21
- remove_action: function( action, tag ) {
22
- jQuery.wpmdb.remove_hook( 'action', action, tag );
23
- },
24
- remove_filter: function( action, tag ) {
25
- jQuery.wpmdb.remove_hook( 'filter', action, tag );
26
- },
27
- add_hook: function( hook_type, action, callable, tag ) {
28
- if ( undefined === jQuery.wpmdb.hooks[hook_type][action] ) {
29
- jQuery.wpmdb.hooks[hook_type][action] = [];
30
- }
31
- var hooks = jQuery.wpmdb.hooks[hook_type][action];
32
- if ( undefined === tag ) {
33
- tag = action + '_' + hooks.length;
34
- }
35
- jQuery.wpmdb.hooks[hook_type][action].push( { tag: tag, callable: callable } );
36
- },
37
- do_hook: function( hook_type, action, value, args ) {
38
- if ( undefined !== jQuery.wpmdb.hooks[hook_type][action] ) {
39
- var hooks = jQuery.wpmdb.hooks[hook_type][action];
40
- for ( var i = 0; i < hooks.length; i++ ) {
41
- if ( 'action' === hook_type ) {
42
- hooks[i].callable( args );
43
- } else {
44
- value = hooks[i].callable( value, args );
45
- }
46
- }
47
- }
48
- if ( 'filter' === hook_type ) {
49
- return value;
50
- }
51
- },
52
- remove_hook: function( hook_type, action, tag ) {
53
- if ( undefined !== jQuery.wpmdb.hooks[hook_type][action] ) {
54
- var hooks = jQuery.wpmdb.hooks[hook_type][action];
55
- for ( var i = hooks.length - 1; 0 < i; i-- ) {
56
- if ( undefined === tag || tag === hooks[i].tag ) {
57
- hooks.splice( i, 1 );
58
- }
59
- }
60
- }
61
- }
62
- };
63
-
64
- })( jQuery );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
asset/dist/js/hook-101.min.js DELETED
@@ -1 +0,0 @@
1
- !function(a){a.wpmdb={hooks:{action:{},filter:{}},add_action:function(a,b,c){jQuery.wpmdb.add_hook("action",a,b,c)},add_filter:function(a,b,c){jQuery.wpmdb.add_hook("filter",a,b,c)},do_action:function(a,b){jQuery.wpmdb.do_hook("action",a,null,b)},apply_filters:function(a,b,c){return jQuery.wpmdb.do_hook("filter",a,b,c)},remove_action:function(a,b){jQuery.wpmdb.remove_hook("action",a,b)},remove_filter:function(a,b){jQuery.wpmdb.remove_hook("filter",a,b)},add_hook:function(a,b,c,d){void 0===jQuery.wpmdb.hooks[a][b]&&(jQuery.wpmdb.hooks[a][b]=[]);var e=jQuery.wpmdb.hooks[a][b];void 0===d&&(d=b+"_"+e.length),jQuery.wpmdb.hooks[a][b].push({tag:d,callable:c})},do_hook:function(a,b,c,d){if(void 0!==jQuery.wpmdb.hooks[a][b])for(var e=jQuery.wpmdb.hooks[a][b],f=0;f<e.length;f++)"action"===a?e[f].callable(d):c=e[f].callable(c,d);return"filter"===a?c:void 0},remove_hook:function(a,b,c){if(void 0!==jQuery.wpmdb.hooks[a][b])for(var d=jQuery.wpmdb.hooks[a][b],e=d.length-1;e>0;e--)void 0!==c&&c!==d[e].tag||d.splice(e,1)}}}(jQuery);
 
asset/dist/js/import-101.js DELETED
@@ -1,593 +0,0 @@
1
- (function( $, wpmdb ) {
2
-
3
- var import_selected = false;
4
- var $import_select = $( '#select-tables' ).clone();
5
- var tables_to_search = [];
6
- var tables_to_import = [];
7
- var unrecognized_import_file = false;
8
- var import_prefix = '';
9
- var import_info = {};
10
- var ajax_spinner = '<img src="' + wpmdb.functions.get_spinner_url() + '" alt="" class="ajax-spinner general-spinner" />';
11
-
12
- /**
13
- * Returns the migration status label for imports
14
- *
15
- * @param string label
16
- * @param object args
17
- *
18
- * @returns {string}
19
- */
20
- function import_migration_status_label( label, args ) {
21
- if ( 'import' === args.intent ) {
22
- if ( 'completed' === args.stage ) {
23
- label = wpmdb_strings.import_label_completed;
24
- } else {
25
- label = wpmdb_strings.import_label_migrating;
26
- }
27
- }
28
-
29
- return label;
30
- }
31
- $.wpmdb.add_filter( 'wpmdb_get_migration_status_label', import_migration_status_label );
32
-
33
- /**
34
- * Updates the connection info box for imports
35
- *
36
- * @param object args
37
- */
38
- function import_connection_info_box( args ) {
39
- var $import_file_status = $( '.import-file-status' );
40
-
41
- if ( 'import' === args.migration_type ) {
42
-
43
- if ( ! import_selected ) {
44
- $( '.step-two' ).hide();
45
-
46
- if ( $import_file_status.hasClass( 'profile-loaded' ) ) {
47
- $import_file_status.attr( 'class', 'import-file-status profile-loaded notification-message success-notice' );
48
- $import_file_status.html( wpmdb_strings.import_profile_loaded );
49
- } else {
50
- $import_file_status.html( wpmdb_strings.please_select_sql_file );
51
- }
52
-
53
- $import_file_status.show();
54
- } else {
55
- if ( unrecognized_import_file ) {
56
- $( '.unrecognized-import-file-notice' ).show();
57
- }
58
- }
59
-
60
- maybe_show_find_replace_options();
61
-
62
- $( '.mst-options' ).hide();
63
- $( '.import-find-replace-option, .import-active-plugin-option' ).show();
64
- } else {
65
- $( '.find-replace-rows, .table-options, .advanced-options, .exclude-post-types-options, label[for="backup-selected"]' ).show();
66
- $( '.import-find-replace-option, .find-replace-options, .import-file-status, .import-active-plugin-option, .unrecognized-import-file-notice' ).hide();
67
-
68
- if ( 'search_all_imported' === $( 'input[name=table_migrate_option]:checked' ).val() ) {
69
- $( 'input[name=table_migrate_option][value=migrate_only_with_prefix]' ).prop( 'checked', true );
70
- }
71
- }
72
- }
73
- $.wpmdb.add_action( 'move_connection_info_box', import_connection_info_box );
74
-
75
- /**
76
- * Starts the upload process for the import
77
- *
78
- * @param stage
79
- */
80
- function maybe_initiate_import( stage ) {
81
- if ( 'import' === wpmdb_migration_type() ) {
82
- if ( 'backup' === stage ) {
83
- wpmdb.common.hooks.push( wpmdb.functions.migrate_table_recursive );
84
- }
85
-
86
- wpmdb.common.hooks.push( wpmdb.functions.upload_file_recursive );
87
- wpmdb.common.next_step_in_migration = { fn: wpmdb_call_next_hook };
88
- wpmdb.functions.execute_next_step();
89
- }
90
- }
91
- $.wpmdb.add_action( 'wpmdb_migration_initiated', maybe_initiate_import );
92
-
93
- /**
94
- * Restores the import select when changing migration types
95
- */
96
- function update_import_table_select() {
97
- $( '#select-tables' ).remove();
98
- $( '.select-tables-wrap' ).prepend( $import_select );
99
- $( '#select-tables' ).change();
100
- }
101
- $.wpmdb.add_action( 'wpmdb_update_import_table_select', update_import_table_select );
102
-
103
- /**
104
- * Updates the selected tables for the "Backup tables that will be replaced during the import" option
105
- *
106
- * @param tables_to_backup
107
- *
108
- * @return array
109
- */
110
- function backup_selected_for_import( tables_to_backup ) {
111
- if ( 'import' === wpmdb_migration_type() ) {
112
- tables_to_backup = tables_to_import;
113
- }
114
-
115
- return tables_to_backup;
116
- }
117
- $.wpmdb.add_filter( 'wpmdb_backup_selected_tables', backup_selected_for_import );
118
-
119
- /**
120
- * Adds the import migration stage
121
- *
122
- * object args
123
- */
124
- function add_import_stage( args ) {
125
- if ( 'import' === wpmdb_migration_type() ) {
126
- wpmdb.current_migration.model.addStage( 'upload', [], 'local', {
127
- strings: {
128
- stage_title: wpmdb_strings.upload
129
- }
130
- } );
131
-
132
- wpmdb.current_migration.model.addStage( 'import', [], 'local', {
133
- strings: {
134
- stage_title: wpmdb_strings.migrate_button_import
135
- }
136
- } );
137
-
138
- if ( $( '#import-find-replace' ).is( ':checked' ) ) {
139
- tables_to_search = args.tables_to_migrate;
140
- wpmdb.current_migration.model.addStage( 'find_replace', [], 'local', {
141
- strings: {
142
- migrated: wpmdb_strings.searched,
143
- stage_title: wpmdb_strings.migrate_button_find_replace
144
- }
145
- } );
146
- }
147
- }
148
- }
149
- $.wpmdb.add_action( 'wpmdb_add_migration_stages', add_import_stage );
150
-
151
- /**
152
- * Adds any info necessary to begin an import
153
- *
154
- * @param object request_data
155
- *
156
- * @return {object}
157
- */
158
- function initiate_import_request_data( request_data ) {
159
- if ( 'import' === wpmdb_migration_type() ) {
160
- request_data.import_info = import_info;
161
- }
162
-
163
- return request_data;
164
- }
165
- $.wpmdb.add_filter( 'wpmdb_initiate_migration_request_data', initiate_import_request_data );
166
-
167
- /**
168
- * Gets more information about the import file and loads step-two
169
- *
170
- * @param event
171
- */
172
- function get_import_info( event ) {
173
- var files = event.target.files; // FileList object
174
- var file = files[0];
175
- var reader = new FileReader();
176
- var $import_file_status = $( '.import-file-status' );
177
- var $backup_selected_option = $( 'label[for="backup-selected"]' );
178
- var $prefix_notice = $( '.prefix-notice' );
179
- var $unrecognized_file_notice = $( '.unrecognized-import-file-notice' );
180
- var $step_two = $( '.step-two' );
181
-
182
- $import_file_status.hide().attr( 'class', 'import-file-status' );
183
- $prefix_notice.hide();
184
- $unrecognized_file_notice.hide();
185
- $step_two.hide();
186
-
187
- if ( ! files.length ) {
188
- if ( import_selected ) {
189
- $step_two.hide();
190
- $import_file_status.text( wpmdb_strings.please_select_sql_file ).show();
191
- import_selected = false;
192
- }
193
- return;
194
- } else {
195
-
196
- if ( '.sql' === file.name.slice( -4 ) || '.sql.gz' === file.name.slice( -7 ) ) {
197
- import_selected = true;
198
- } else {
199
- $import_file_status.addClass( 'notification-message error-notice migration-error' ).text( wpmdb_strings.invalid_sql_file ).show();
200
- $step_two.hide();
201
- return;
202
- }
203
- }
204
-
205
- import_prefix = '';
206
-
207
- $import_file_status.text( wpmdb_strings.parsing_sql_file ).append( ajax_spinner ).show();
208
-
209
- reader.onloadend = function( event ) {
210
- if ( event.target.readyState !== FileReader.DONE ) {
211
- return;
212
- }
213
-
214
- $.ajax( {
215
- url: ajaxurl,
216
- type: 'POST',
217
- dataType: 'json',
218
- cache: false,
219
- data: {
220
- action: 'wpmdb_get_import_info',
221
- file_data: event.target.result,
222
- nonce: wpmdb_data.nonces.import_file
223
- },
224
- error: function( jqXHR, textStatus, errorThrown ) {
225
- console.log( jqXHR, textStatus, errorThrown );
226
- },
227
- success: function( data ) {
228
- $( '.ajax-spinner' ).remove();
229
- $import_file_status.hide();
230
- $step_two.show();
231
-
232
- if ( 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error ) {
233
- $import_file_status.text( data.body ).addClass( 'notification-message error-notice migration-error' ).show();
234
- $step_two.hide();
235
- } else {
236
- var localStorage_form_data = wpmdb.functions.get_localStorage_form_data();
237
- import_info = data;
238
-
239
- if ( 'undefined' !== typeof data.prefix ) {
240
- import_prefix = data.prefix;
241
- $( '.table-prefix' ).text( data.prefix );
242
- wpmdb.functions.maybe_show_prefix_notice( data.prefix );
243
- }
244
-
245
- if ( 'undefined' !== typeof data.tables ) {
246
- tables_to_import = data.tables;
247
- $backup_selected_option.show();
248
-
249
- // Update the find & replace values
250
- if ( ! localStorage_form_data ) {
251
- $( '#old-url' ).val( wpmdb.functions.remove_protocol( data.URL ) );
252
- $( '#old-path' ).val( data.path );
253
- $( '#new-url' ).val( wpmdb.functions.remove_protocol( wpmdb_data.this_url ) );
254
- $( '#new-path' ).val( wpmdb_data.this_path );
255
- }
256
-
257
- // Update the select with tables that will be imported
258
- var loaded_tables = [];
259
- var loaded_post_types = [];
260
-
261
- if ( localStorage_form_data ) {
262
- loaded_tables = localStorage_form_data.select_tables;
263
- loaded_post_types = localStorage_form_data.select_post_types;
264
- wpmdb.functions.remove_localStorage_form_data();
265
- } else {
266
- if ( 'migrate_only_with_prefix' === $( 'input[name=table_migrate_option]:checked' ).val() && ! $import_file_status.hasClass( 'profile-loaded' ) ) {
267
- $( 'input[name=table_migrate_option][value=search_all_imported]' ).prop( 'checked', true );
268
- }
269
- }
270
-
271
- if ( false === wpmdb_default_profile && 'undefined' !== typeof wpmdb_loaded_tables ) {
272
- loaded_tables = wpmdb_loaded_tables;
273
- loaded_post_types = wpmdb_loaded_post_types;
274
- }
275
- $import_select = wpmdb.functions.create_table_select( data.tables, [], loaded_tables );
276
- $.wpmdb.do_action( 'wpmdb_update_import_table_select' );
277
-
278
- if ( 'undefined' !== typeof data.post_types ) {
279
- var $post_type_select = document.createElement( 'select' );
280
- $( $post_type_select ).attr( {
281
- multiple: 'multiple',
282
- name: 'select_post_types[]',
283
- id: 'select-post-types',
284
- class: 'multiselect'
285
- } );
286
-
287
- $.each( data.post_types, function( index, value ) {
288
- var selected = $.inArray( value, loaded_post_types );
289
- if ( -1 !== selected || ( true === wpmdb_convert_exclude_revisions && 'revision' !== value ) ) {
290
- selected = true;
291
- } else {
292
- selected = false;
293
- }
294
-
295
- var opt = document.createElement( 'option' );
296
- opt.value = value;
297
- opt.text = value;
298
- opt.selected = selected;
299
- $post_type_select.add( opt, null );
300
- } );
301
-
302
- $( '#select-post-types' ).remove();
303
- $( '.exclude-post-types-warning' ).after( $post_type_select );
304
- }
305
-
306
- if ( unrecognized_import_file ) {
307
- unrecognized_import_file = false;
308
- maybe_show_find_replace_options();
309
- }
310
- } else {
311
- $unrecognized_file_notice.show();
312
- $backup_selected_option.hide();
313
- $( '.table-options' ).hide();
314
- unrecognized_import_file = true;
315
- }
316
- }
317
- }
318
- } );
319
- };
320
-
321
- var blob = file.slice( 0, 1024 * 1000 );
322
- reader.readAsDataURL( blob );
323
- }
324
- $( '#import-file' ).on( 'change', get_import_info );
325
-
326
- /**
327
- * Displays the find and replace options for imports
328
- */
329
- function maybe_show_find_replace_options() {
330
- var find_replace_rows = $( '.find-replace-rows' );
331
- return $( '#import-find-replace' ).is( ':checked' ) ? find_replace_rows.show() : find_replace_rows.hide();
332
- }
333
- $( '#import-find-replace' ).on( 'click', maybe_show_find_replace_options );
334
-
335
- function maybe_show_table_options() {
336
- if ( ! unrecognized_import_file ) {
337
- return;
338
- }
339
-
340
- setTimeout( function() {
341
- if ( $( '.find-replace-options-toggle .expand-collapse-arrow' ).hasClass( 'collapsed' ) ) {
342
- return;
343
- }
344
-
345
- $( '.table-options' ).hide();
346
- }, 1 );
347
- }
348
- $( '.find-replace-options-toggle' ).on( 'click', maybe_show_table_options );
349
-
350
- /**
351
- * Updates both `keep_active_plugins` checkboxes when one is changed.
352
- */
353
- function update_keep_active_plugins_option() {
354
- $( 'input[name=keep_active_plugins]' ).prop( 'checked', $( this ).is( ':checked' ) );
355
- }
356
- $( 'input[name=keep_active_plugins]' ).on( 'click', update_keep_active_plugins_option );
357
-
358
- /**
359
- * Recursively upload an import file
360
- *
361
- * @param int start
362
- */
363
- wpmdb.functions.upload_file_recursive = function( start ) {
364
- start = 'undefined' === typeof start ? 0 : start;
365
-
366
- var file = document.getElementById( 'import-file' ).files[0];
367
- var slice_size = 1000 * 1024; // 1 MB
368
- var next_slice = start + slice_size + 1;
369
- var reader = new FileReader();
370
-
371
- if ( 0 === start ) {
372
- wpmdb.current_migration.model.addStageItem( 'upload', file.name, file.size / 1000, Math.ceil( file.size / slice_size ) );
373
- }
374
-
375
- reader.onloadend = function( event ) {
376
- if ( event.target.readyState !== FileReader.DONE ) {
377
- return;
378
- }
379
-
380
- $.ajax( {
381
- url: ajaxurl,
382
- type: 'POST',
383
- dataType: 'json',
384
- cache: false,
385
- data: {
386
- action: 'wpmdb_upload_file',
387
- file_data: event.target.result,
388
- file: file.name,
389
- file_type: file.type,
390
- migration_state_id: wpmdb.migration_state_id,
391
- stage: 'import',
392
- import_info: import_info,
393
- nonce: wpmdb_data.nonces.import_file
394
- },
395
- error: function( jqXHR, textStatus, errorThrown ) {
396
- console.log( jqXHR, textStatus, errorThrown );
397
- wpmdb.common.migration_error = true;
398
- wpmdb.functions.migration_complete_events();
399
- },
400
- success: function( data ) {
401
- wpmdb.current_migration.setText();
402
-
403
- if ( 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error ) {
404
- wpmdb.common.migration_error = true;
405
- wpmdb.functions.migration_complete_events();
406
- wpmdb.current_migration.setState( wpmdb_strings.migration_failed, data.body, 'error' );
407
-
408
- return;
409
- }
410
-
411
- var size_done = start + slice_size;
412
-
413
- wpmdb.current_migration.setText( wpmdb_strings.uploading_file_to_server );
414
- wpmdb.current_migration.model.getStageModel( 'upload' ).setItemRowsTransferred( file.name, Math.ceil( size_done / slice_size ) );
415
-
416
- if ( next_slice < file.size ) {
417
- wpmdb.common.next_step_in_migration = {
418
- fn: wpmdb.functions.upload_file_recursive,
419
- args: [ next_slice ]
420
- };
421
- } else {
422
- wpmdb.common.next_step_in_migration = {
423
- fn: wpmdb.functions.upload_import_successful,
424
- args: [ file ]
425
- };
426
- }
427
-
428
- wpmdb.functions.execute_next_step();
429
- }
430
- } );
431
- };
432
-
433
- var blob = file.slice( start, next_slice );
434
- reader.readAsDataURL( blob );
435
- };
436
-
437
- /**
438
- * Prepares the import stage
439
- *
440
- * @param file
441
- */
442
- wpmdb.functions.upload_import_successful = function( file ) {
443
-
444
- $.ajax( {
445
- type: 'POST',
446
- url: ajaxurl,
447
- data: {
448
- action: 'wpmdb_prepare_import_file',
449
- migration_state_id: wpmdb.migration_state_id,
450
- nonce: wpmdb_data.nonces.import_file
451
- },
452
- dataType: 'json',
453
- error: function( jqXHR, textStatus, errorThrown ) {
454
- console.log( jqXHR, textStatus, errorThrown );
455
- wpmdb.common.migration_error = true;
456
- wpmdb.functions.migration_complete_events();
457
- },
458
- success: function( response ) {
459
- var item_name = file.name;
460
- var migration_text = wpmdb_strings.importing_file_to_db;
461
-
462
- if ( '.gz' === item_name.slice( -3 ) ) {
463
- item_name = file.name.slice( 0, -3 );
464
- }
465
-
466
- migration_text = migration_text.replace( /\%s\s?/, item_name );
467
- wpmdb.current_migration.setText( migration_text );
468
-
469
- wpmdb.current_migration.model.addStageItem( 'import', item_name, response.import_size / 1000, response.num_chunks );
470
- wpmdb.current_migration.model.setActiveStage( 'import' );
471
-
472
- wpmdb.common.next_step_in_migration = {
473
- fn: wpmdb.functions.import_file_recursive,
474
- args: [ {
475
- import_filename: response.import_file,
476
- item_name: item_name,
477
- chunk: 0,
478
- current_query: ''
479
- } ]
480
- };
481
-
482
- wpmdb.functions.execute_next_step();
483
- }
484
- } );
485
- };
486
-
487
- /**
488
- * Recursively imports chunks to the database
489
- *
490
- * @param object args
491
- */
492
- wpmdb.functions.import_file_recursive = function( args ) {
493
-
494
- $.ajax( {
495
- type: 'POST',
496
- url: ajaxurl,
497
- data: {
498
- action: 'wpmdb_import_file',
499
- migration_state_id: wpmdb.migration_state_id,
500
- chunk: args.chunk,
501
- current_query: args.current_query,
502
- import_file: args.import_filename,
503
- nonce: wpmdb_data.nonces.import_file
504
- },
505
- dataType: 'json',
506
- error: function( jqXHR, textStatus, errorThrown ) {
507
- console.log( jqXHR, textStatus, errorThrown );
508
- wpmdb.common.migration_error = true;
509
- wpmdb.functions.migration_complete_events();
510
- },
511
- success: function( response ) {
512
- if ( 'undefined' !== typeof response.wpmdb_error && 1 === response.wpmdb_error ) {
513
- wpmdb.common.migration_error = true;
514
- wpmdb.functions.migration_complete_events();
515
- wpmdb.current_migration.setState( wpmdb_strings.migration_failed, response.body, 'error' );
516
- return;
517
- }
518
-
519
- wpmdb.current_migration.model.getStageModel( 'import' ).setItemRowsTransferred( args.item_name, response.chunk );
520
-
521
- if ( response.chunk >= response.num_chunks ) {
522
-
523
- wpmdb.current_migration.model.getStageModel( 'import' ).setItemRowsTransferred( args.item_name, ++response.chunk );
524
-
525
- if ( $( '#import-find-replace' ).is( ':checked' ) ) {
526
-
527
- if ( unrecognized_import_file ) {
528
- $.each( response.table_sizes, function( table, size ) {
529
- if ( table.startsWith( wpmdb_data.this_temp_prefix ) && wpmdb_data.alter_table_name !== table ) {
530
- var table_name = table.replace( wpmdb_data.this_temp_prefix, '' );
531
- wpmdb.current_migration.model.addStageItem( 'find_replace', table_name, response.table_sizes[ table ], response.table_rows[ table ] );
532
- }
533
- } );
534
- } else {
535
- var table_migrate_option = $( 'input[name=table_migrate_option]:checked' ).val();
536
-
537
- if ( 'migrate_only_with_prefix' === table_migrate_option ) {
538
- tables_to_search = tables_to_import.filter( function( table ) {
539
- return import_prefix === table.substring( 0, import_prefix.length );
540
- } );
541
- } else if ( 'search_all_imported' === table_migrate_option ) {
542
- tables_to_search = tables_to_import;
543
- }
544
-
545
- $.each( tables_to_search, function( key, table ) {
546
- var imported_table = wpmdb_data.this_temp_prefix + table;
547
- if ( response.table_sizes.hasOwnProperty( imported_table ) ) {
548
- wpmdb.current_migration.model.addStageItem( 'find_replace', table, response.table_sizes[ imported_table ], response.table_rows[ imported_table ] );
549
- }
550
- } );
551
- }
552
-
553
- tables_to_search = [];
554
-
555
- wpmdb.current_migration.model.setActiveStage( 'find_replace' );
556
- wpmdb.common.next_step_in_migration = {
557
- fn: wpmdb.functions.migrate_table_recursive,
558
- args: [ 0 ]
559
- };
560
- wpmdb.functions.execute_next_step();
561
- return;
562
- } else {
563
- $( '.progress-label' ).removeClass( 'label-visible' );
564
- wpmdb.common.hooks = $.wpmdb.apply_filters( 'wpmdb_before_migration_complete_hooks', wpmdb.common.hooks );
565
- wpmdb.common.hooks.push( wpmdb.functions.migration_complete );
566
- wpmdb.common.hooks.push( wpmdb.functions.wpmdb_flush );
567
- wpmdb.common.hooks = $.wpmdb.apply_filters( 'wpmdb_after_migration_complete_hooks', wpmdb.common.hooks );
568
- wpmdb.common.hooks.push( wpmdb.functions.migration_complete_events );
569
- wpmdb.common.next_step_in_migration = { fn: wpmdb_call_next_hook };
570
- }
571
-
572
- } else {
573
- wpmdb.common.next_step_in_migration = {
574
- fn: wpmdb.functions.import_file_recursive,
575
- args: [ {
576
- import_filename: args.import_filename,
577
- item_name: args.item_name,
578
- chunk: response.chunk,
579
- current_query: response.current_query
580
- } ]
581
- };
582
- }
583
-
584
- wpmdb.functions.execute_next_step();
585
- }
586
- } );
587
- };
588
-
589
- wpmdb.functions.get_tables_to_import = function() {
590
- return tables_to_import;
591
- };
592
-
593
- })( jQuery, wpmdb );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
asset/dist/js/import-101.min.js DELETED
@@ -1 +0,0 @@
1
- !function(a,b){function c(a,b){return"import"===b.intent&&(a="completed"===b.stage?wpmdb_strings.import_label_completed:wpmdb_strings.import_label_migrating),a}function d(b){var c=a(".import-file-status");"import"===b.migration_type?(n?r&&a(".unrecognized-import-file-notice").show():(a(".step-two").hide(),c.hasClass("profile-loaded")?(c.attr("class","import-file-status profile-loaded notification-message success-notice"),c.html(wpmdb_strings.import_profile_loaded)):c.html(wpmdb_strings.please_select_sql_file),c.show()),k(),a(".mst-options").hide(),a(".import-find-replace-option, .import-active-plugin-option").show()):(a('.find-replace-rows, .table-options, .advanced-options, .exclude-post-types-options, label[for="backup-selected"]').show(),a(".import-find-replace-option, .find-replace-options, .import-file-status, .import-active-plugin-option, .unrecognized-import-file-notice").hide(),"search_all_imported"===a("input[name=table_migrate_option]:checked").val()&&a("input[name=table_migrate_option][value=migrate_only_with_prefix]").prop("checked",!0))}function e(a){"import"===wpmdb_migration_type()&&("backup"===a&&b.common.hooks.push(b.functions.migrate_table_recursive),b.common.hooks.push(b.functions.upload_file_recursive),b.common.next_step_in_migration={fn:wpmdb_call_next_hook},b.functions.execute_next_step())}function f(){a("#select-tables").remove(),a(".select-tables-wrap").prepend(o),a("#select-tables").change()}function g(a){return"import"===wpmdb_migration_type()&&(a=q),a}function h(c){"import"===wpmdb_migration_type()&&(b.current_migration.model.addStage("upload",[],"local",{strings:{stage_title:wpmdb_strings.upload}}),b.current_migration.model.addStage("import",[],"local",{strings:{stage_title:wpmdb_strings.migrate_button_import}}),a("#import-find-replace").is(":checked")&&(p=c.tables_to_migrate,b.current_migration.model.addStage("find_replace",[],"local",{strings:{migrated:wpmdb_strings.searched,stage_title:wpmdb_strings.migrate_button_find_replace}})))}function i(a){return"import"===wpmdb_migration_type()&&(a.import_info=t),a}function j(c){var d=c.target.files,e=d[0],f=new FileReader,g=a(".import-file-status"),h=a('label[for="backup-selected"]'),i=a(".prefix-notice"),j=a(".unrecognized-import-file-notice"),l=a(".step-two");if(g.hide().attr("class","import-file-status"),i.hide(),j.hide(),l.hide(),!d.length)return void(n&&(l.hide(),g.text(wpmdb_strings.please_select_sql_file).show(),n=!1));if(".sql"!==e.name.slice(-4)&&".sql.gz"!==e.name.slice(-7))return g.addClass("notification-message error-notice migration-error").text(wpmdb_strings.invalid_sql_file).show(),void l.hide();n=!0,s="",g.text(wpmdb_strings.parsing_sql_file).append(u).show(),f.onloadend=function(c){c.target.readyState===FileReader.DONE&&a.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_get_import_info",file_data:c.target.result,nonce:wpmdb_data.nonces.import_file},error:function(a,b,c){console.log(a,b,c)},success:function(c){if(a(".ajax-spinner").remove(),g.hide(),l.show(),"undefined"!=typeof c.wpmdb_error&&1===c.wpmdb_error)g.text(c.body).addClass("notification-message error-notice migration-error").show(),l.hide();else{var d=b.functions.get_localStorage_form_data();if(t=c,"undefined"!=typeof c.prefix&&(s=c.prefix,a(".table-prefix").text(c.prefix),b.functions.maybe_show_prefix_notice(c.prefix)),"undefined"!=typeof c.tables){q=c.tables,h.show(),d||(a("#old-url").val(b.functions.remove_protocol(c.URL)),a("#old-path").val(c.path),a("#new-url").val(b.functions.remove_protocol(wpmdb_data.this_url)),a("#new-path").val(wpmdb_data.this_path));var e=[],f=[];if(d?(e=d.select_tables,f=d.select_post_types,b.functions.remove_localStorage_form_data()):"migrate_only_with_prefix"!==a("input[name=table_migrate_option]:checked").val()||g.hasClass("profile-loaded")||a("input[name=table_migrate_option][value=search_all_imported]").prop("checked",!0),!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_tables&&(e=wpmdb_loaded_tables,f=wpmdb_loaded_post_types),o=b.functions.create_table_select(c.tables,[],e),a.wpmdb.do_action("wpmdb_update_import_table_select"),"undefined"!=typeof c.post_types){var i=document.createElement("select");a(i).attr({multiple:"multiple",name:"select_post_types[]",id:"select-post-types","class":"multiselect"}),a.each(c.post_types,function(b,c){var d=a.inArray(c,f);d=-1!==d||!0===wpmdb_convert_exclude_revisions&&"revision"!==c;var e=document.createElement("option");e.value=c,e.text=c,e.selected=d,i.add(e,null)}),a("#select-post-types").remove(),a(".exclude-post-types-warning").after(i)}r&&(r=!1,k())}else j.show(),h.hide(),a(".table-options").hide(),r=!0}}})};var m=e.slice(0,1024e3);f.readAsDataURL(m)}function k(){var b=a(".find-replace-rows");return a("#import-find-replace").is(":checked")?b.show():b.hide()}function l(){r&&setTimeout(function(){a(".find-replace-options-toggle .expand-collapse-arrow").hasClass("collapsed")||a(".table-options").hide()},1)}function m(){a("input[name=keep_active_plugins]").prop("checked",a(this).is(":checked"))}var n=!1,o=a("#select-tables").clone(),p=[],q=[],r=!1,s="",t={},u='<img src="'+b.functions.get_spinner_url()+'" alt="" class="ajax-spinner general-spinner" />';a.wpmdb.add_filter("wpmdb_get_migration_status_label",c),a.wpmdb.add_action("move_connection_info_box",d),a.wpmdb.add_action("wpmdb_migration_initiated",e),a.wpmdb.add_action("wpmdb_update_import_table_select",f),a.wpmdb.add_filter("wpmdb_backup_selected_tables",g),a.wpmdb.add_action("wpmdb_add_migration_stages",h),a.wpmdb.add_filter("wpmdb_initiate_migration_request_data",i),a("#import-file").on("change",j),a("#import-find-replace").on("click",k),a(".find-replace-options-toggle").on("click",l),a("input[name=keep_active_plugins]").on("click",m),b.functions.upload_file_recursive=function(c){c="undefined"==typeof c?0:c;var d=document.getElementById("import-file").files[0],e=1024e3,f=c+e+1,g=new FileReader;0===c&&b.current_migration.model.addStageItem("upload",d.name,d.size/1e3,Math.ceil(d.size/e)),g.onloadend=function(g){g.target.readyState===FileReader.DONE&&a.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_upload_file",file_data:g.target.result,file:d.name,file_type:d.type,migration_state_id:b.migration_state_id,stage:"import",import_info:t,nonce:wpmdb_data.nonces.import_file},error:function(a,c,d){console.log(a,c,d),b.common.migration_error=!0,b.functions.migration_complete_events()},success:function(a){if(b.current_migration.setText(),"undefined"!=typeof a.wpmdb_error&&1===a.wpmdb_error)return b.common.migration_error=!0,b.functions.migration_complete_events(),void b.current_migration.setState(wpmdb_strings.migration_failed,a.body,"error");var g=c+e;b.current_migration.setText(wpmdb_strings.uploading_file_to_server),b.current_migration.model.getStageModel("upload").setItemRowsTransferred(d.name,Math.ceil(g/e)),f<d.size?b.common.next_step_in_migration={fn:b.functions.upload_file_recursive,args:[f]}:b.common.next_step_in_migration={fn:b.functions.upload_import_successful,args:[d]},b.functions.execute_next_step()}})};var h=d.slice(c,f);g.readAsDataURL(h)},b.functions.upload_import_successful=function(c){a.ajax({type:"POST",url:ajaxurl,data:{action:"wpmdb_prepare_import_file",migration_state_id:b.migration_state_id,nonce:wpmdb_data.nonces.import_file},dataType:"json",error:function(a,c,d){console.log(a,c,d),b.common.migration_error=!0,b.functions.migration_complete_events()},success:function(a){var d=c.name,e=wpmdb_strings.importing_file_to_db;".gz"===d.slice(-3)&&(d=c.name.slice(0,-3)),e=e.replace(/\%s\s?/,d),b.current_migration.setText(e),b.current_migration.model.addStageItem("import",d,a.import_size/1e3,a.num_chunks),b.current_migration.model.setActiveStage("import"),b.common.next_step_in_migration={fn:b.functions.import_file_recursive,args:[{import_filename:a.import_file,item_name:d,chunk:0,current_query:""}]},b.functions.execute_next_step()}})},b.functions.import_file_recursive=function(c){a.ajax({type:"POST",url:ajaxurl,data:{action:"wpmdb_import_file",migration_state_id:b.migration_state_id,chunk:c.chunk,current_query:c.current_query,import_file:c.import_filename,nonce:wpmdb_data.nonces.import_file},dataType:"json",error:function(a,c,d){console.log(a,c,d),b.common.migration_error=!0,b.functions.migration_complete_events()},success:function(d){if("undefined"!=typeof d.wpmdb_error&&1===d.wpmdb_error)return b.common.migration_error=!0,b.functions.migration_complete_events(),void b.current_migration.setState(wpmdb_strings.migration_failed,d.body,"error");if(b.current_migration.model.getStageModel("import").setItemRowsTransferred(c.item_name,d.chunk),d.chunk>=d.num_chunks){if(b.current_migration.model.getStageModel("import").setItemRowsTransferred(c.item_name,++d.chunk),a("#import-find-replace").is(":checked")){if(r)a.each(d.table_sizes,function(a,c){if(a.startsWith(wpmdb_data.this_temp_prefix)&&wpmdb_data.alter_table_name!==a){var e=a.replace(wpmdb_data.this_temp_prefix,"");b.current_migration.model.addStageItem("find_replace",e,d.table_sizes[a],d.table_rows[a])}});else{var e=a("input[name=table_migrate_option]:checked").val();"migrate_only_with_prefix"===e?p=q.filter(function(a){return s===a.substring(0,s.length)}):"search_all_imported"===e&&(p=q),a.each(p,function(a,c){var e=wpmdb_data.this_temp_prefix+c;d.table_sizes.hasOwnProperty(e)&&b.current_migration.model.addStageItem("find_replace",c,d.table_sizes[e],d.table_rows[e])})}return p=[],b.current_migration.model.setActiveStage("find_replace"),b.common.next_step_in_migration={fn:b.functions.migrate_table_recursive,args:[0]},void b.functions.execute_next_step()}a(".progress-label").removeClass("label-visible"),b.common.hooks=a.wpmdb.apply_filters("wpmdb_before_migration_complete_hooks",b.common.hooks),b.common.hooks.push(b.functions.migration_complete),b.common.hooks.push(b.functions.wpmdb_flush),b.common.hooks=a.wpmdb.apply_filters("wpmdb_after_migration_complete_hooks",b.common.hooks),b.common.hooks.push(b.functions.migration_complete_events),b.common.next_step_in_migration={fn:wpmdb_call_next_hook}}else b.common.next_step_in_migration={fn:b.functions.import_file_recursive,args:[{import_filename:c.import_filename,item_name:c.item_name,chunk:d.chunk,current_query:d.current_query}]};b.functions.execute_next_step()}})},b.functions.get_tables_to_import=function(){return q}}(jQuery,wpmdb);
 
asset/dist/js/localStorage-101.js DELETED
@@ -1,172 +0,0 @@
1
- (function( $, wpmdb ) {
2
-
3
- $( document ).ready( function() {
4
-
5
- wpmdb.functions.localStorage_available = function() {
6
- try {
7
- localStorage.setItem( 'wpmdb_test', 'wpmdb_test' );
8
- localStorage.removeItem( 'wpmdb_test', 'wpmdb_test' );
9
- return true;
10
- }
11
- catch ( e ) {
12
- return false;
13
- }
14
- };
15
-
16
- wpmdb.functions.maybe_reload_page = function() {
17
- var migration_type = wpmdb_migration_type();
18
-
19
- if ( ! wpmdb.functions.localStorage_available() ||
20
- 'cancelled' === wpmdb.current_migration.status ||
21
- true === wpmdb.common.migration_error ||
22
- -1 === $.inArray( migration_type, [ 'pull', 'import', 'find_replace' ] )
23
- ) {
24
- return;
25
- }
26
-
27
- if ( 'true' === wpmdb_data.is_multisite &&
28
- $( '#mst-select-subsite' ).is( ':checked' ) &&
29
- wpmdb_data.this_domain !== $( '#mst-selected-subsite option:selected' ).text()
30
- ) {
31
- return;
32
- }
33
-
34
- var tables_to_migrate = wpmdb.functions.get_tables_to_migrate();
35
-
36
- if ( 'import' === migration_type ) {
37
- tables_to_migrate = wpmdb.functions.get_tables_to_import();
38
- }
39
-
40
- if ( -1 === $.inArray( wpmdb_data.this_prefix + 'options', tables_to_migrate ) &&
41
- -1 === $.inArray( wpmdb_data.this_prefix + 'usermeta', tables_to_migrate ) ) {
42
- return;
43
- }
44
-
45
- wpmdb.functions.set_localStorage_form_data();
46
- location.reload();
47
- };
48
-
49
- wpmdb.functions.set_localStorage_form_data = function() {
50
- var data = {};
51
-
52
- $.each( $( '#migrate-form' ).serializeArray(), function( index, field ) {
53
- if ( '[]' === field.name.substr( -2 ) ) {
54
- var field_name = field.name.slice( 0, -2 );
55
- if ( 'undefined' === typeof data[ field_name ] ) {
56
- data[ field_name ] = [];
57
- }
58
- data[ field_name ].push( field.value );
59
- } else {
60
- data[ field.name ] = field.value;
61
- }
62
- } );
63
-
64
- localStorage.setItem( 'wpmdb_migrate_form', JSON.stringify( data ) );
65
- };
66
-
67
- wpmdb.functions.get_localStorage_form_data = function() {
68
- var form_data = localStorage.getItem( 'wpmdb_migrate_form' );
69
-
70
- if ( null === form_data ) {
71
- return false;
72
- }
73
-
74
- try {
75
- form_data = JSON.parse( form_data );
76
- }
77
- catch ( err ) {
78
- return false;
79
- }
80
-
81
- return form_data;
82
- };
83
-
84
- wpmdb.functions.remove_localStorage_form_data = function() {
85
- localStorage.removeItem( 'wpmdb_migrate_form' );
86
- };
87
-
88
- wpmdb.functions.load_data_from_localStorage = function() {
89
- var form_data = wpmdb.functions.get_localStorage_form_data();
90
-
91
- if ( ! form_data ) {
92
- return;
93
- }
94
-
95
- $.each( form_data, function( name, value ) {
96
- var $input = $( '[name="' + name + '"]' );
97
- var input_type = $input.attr( 'type' );
98
-
99
- if ( 'action' === name ) {
100
- wpmdb.migration_selection = value;
101
- $( '#' + value ).prop( 'checked', true );
102
- } else {
103
- if ( 'radio' === input_type ) {
104
- $( '[name="' + name + '"][value="' + value + '"]' ).prop( 'checked', true );
105
- } else if ( 'checkbox' === input_type ) {
106
- $input.prop( 'checked', true );
107
-
108
- if ( $input.parent().hasClass( 'checkbox-label' ) ) {
109
- $input.parent().next().show();
110
- }
111
- } else {
112
- $input.val( value );
113
- }
114
- }
115
- } );
116
-
117
- $( '.option-group input[type=radio]' ).change();
118
- $( '.' + wpmdb.migration_selection + '-list ul' ).show();
119
-
120
- $.when( wpmdb.functions.connection_box_changed() ).done( function() {
121
- if ( 'migrate_select' === $( 'input[name=table_migrate_option]:checked' ).val() ) {
122
- if ( 'undefined' !== typeof form_data.select_tables ) {
123
- $( '#select-tables' ).val( form_data.select_tables );
124
- }
125
-
126
- $( '.table-options .expandable-content, .select-tables-wrap' ).show();
127
- $( '.table-options .expand-collapse-arrow' ).removeClass( 'collapsed' );
128
- } else {
129
- $( '.select-tables-wrap' ).hide();
130
- }
131
-
132
- if ( 'backup_manual_select' === $( 'input[name=backup_option]:checked' ).val() ) {
133
- if ( 'undefined' !== typeof form_data.select_backup ) {
134
- $( '#select-backup' ).val( form_data.select_backup );
135
- }
136
-
137
- $( '.backup-tables-wrap' ).show();
138
- }
139
-
140
- if ( 'undefined' !== typeof form_data.select_post_types ) {
141
- $( '#select-post-types' ).val( form_data.select_post_types );
142
- wpmdb.functions.exclude_post_types_warning();
143
- }
144
-
145
- if ( 'undefined' !== typeof form_data.replace_old ) {
146
-
147
- $( '.replace-row' ).not( '.original-repeatable-field' ).remove();
148
-
149
- var n = 1;
150
- $.each( form_data.replace_old, function( index, value ) {
151
- if ( ! $( '.replace-row:nth-child(' + n + ')' ).length ) {
152
- $( '.replace-row' ).last().after( $( '.original-repeatable-field' ).clone().removeClass( 'original-repeatable-field' ) );
153
- }
154
-
155
- $( '.replace-row:nth-child(' + n + ') [name="replace_old[]"]' ).val( value );
156
- $( '.replace-row:nth-child(' + n + ') [name="replace_new[]"]' ).val( form_data.replace_new[ index ] );
157
- n++;
158
- } );
159
- }
160
- } );
161
-
162
- wpmdb.functions.update_migrate_button_text();
163
-
164
- if ( 'import' !== wpmdb_migration_type() ) {
165
- wpmdb.functions.remove_localStorage_form_data();
166
- }
167
- };
168
- wpmdb.functions.load_data_from_localStorage();
169
-
170
- } );
171
-
172
- } )( jQuery, wpmdb );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
asset/dist/js/localStorage-101.min.js DELETED
@@ -1 +0,0 @@
1
- !function(a,b){a(document).ready(function(){b.functions.localStorage_available=function(){try{return localStorage.setItem("wpmdb_test","wpmdb_test"),localStorage.removeItem("wpmdb_test","wpmdb_test"),!0}catch(a){return!1}},b.functions.maybe_reload_page=function(){var c=wpmdb_migration_type();if(b.functions.localStorage_available()&&"cancelled"!==b.current_migration.status&&!0!==b.common.migration_error&&-1!==a.inArray(c,["pull","import","find_replace"])&&("true"!==wpmdb_data.is_multisite||!a("#mst-select-subsite").is(":checked")||wpmdb_data.this_domain===a("#mst-selected-subsite option:selected").text())){var d=b.functions.get_tables_to_migrate();"import"===c&&(d=b.functions.get_tables_to_import()),-1===a.inArray(wpmdb_data.this_prefix+"options",d)&&-1===a.inArray(wpmdb_data.this_prefix+"usermeta",d)||(b.functions.set_localStorage_form_data(),location.reload())}},b.functions.set_localStorage_form_data=function(){var b={};a.each(a("#migrate-form").serializeArray(),function(a,c){if("[]"===c.name.substr(-2)){var d=c.name.slice(0,-2);"undefined"==typeof b[d]&&(b[d]=[]),b[d].push(c.value)}else b[c.name]=c.value}),localStorage.setItem("wpmdb_migrate_form",JSON.stringify(b))},b.functions.get_localStorage_form_data=function(){var a=localStorage.getItem("wpmdb_migrate_form");if(null===a)return!1;try{a=JSON.parse(a)}catch(b){return!1}return a},b.functions.remove_localStorage_form_data=function(){localStorage.removeItem("wpmdb_migrate_form")},b.functions.load_data_from_localStorage=function(){var c=b.functions.get_localStorage_form_data();c&&(a.each(c,function(c,d){var e=a('[name="'+c+'"]'),f=e.attr("type");"action"===c?(b.migration_selection=d,a("#"+d).prop("checked",!0)):"radio"===f?a('[name="'+c+'"][value="'+d+'"]').prop("checked",!0):"checkbox"===f?(e.prop("checked",!0),e.parent().hasClass("checkbox-label")&&e.parent().next().show()):e.val(d)}),a(".option-group input[type=radio]").change(),a("."+b.migration_selection+"-list ul").show(),a.when(b.functions.connection_box_changed()).done(function(){if("migrate_select"===a("input[name=table_migrate_option]:checked").val()?("undefined"!=typeof c.select_tables&&a("#select-tables").val(c.select_tables),a(".table-options .expandable-content, .select-tables-wrap").show(),a(".table-options .expand-collapse-arrow").removeClass("collapsed")):a(".select-tables-wrap").hide(),"backup_manual_select"===a("input[name=backup_option]:checked").val()&&("undefined"!=typeof c.select_backup&&a("#select-backup").val(c.select_backup),a(".backup-tables-wrap").show()),"undefined"!=typeof c.select_post_types&&(a("#select-post-types").val(c.select_post_types),b.functions.exclude_post_types_warning()),"undefined"!=typeof c.replace_old){a(".replace-row").not(".original-repeatable-field").remove();var d=1;a.each(c.replace_old,function(b,e){a(".replace-row:nth-child("+d+")").length||a(".replace-row").last().after(a(".original-repeatable-field").clone().removeClass("original-repeatable-field")),a(".replace-row:nth-child("+d+') [name="replace_old[]"]').val(e),a(".replace-row:nth-child("+d+') [name="replace_new[]"]').val(c.replace_new[b]),d++})}}),b.functions.update_migrate_button_text(),"import"!==wpmdb_migration_type()&&b.functions.remove_localStorage_form_data())},b.functions.load_data_from_localStorage()})}(jQuery,wpmdb);
 
asset/dist/js/multisite-101.js DELETED
@@ -1,34 +0,0 @@
1
- var wpmdb = wpmdb || {};
2
-
3
- wpmdb.multisite = {};
4
-
5
- (function( $, wpmdb ) {
6
- wpmdb.multisite.update_multiselect = function( element, subsites, selected_subsite_ids ) {
7
- $( element ).empty();
8
-
9
- if ( 0 < Object.keys( subsites ).length ) {
10
- var table_prefix = $.wpmdb.apply_filters( 'wpmdb_get_table_prefix', null, null );
11
- var site_selected = false;
12
- $.each( subsites, function( blog_id, subsite_path ) {
13
- if ( $.wpmdb.apply_filters( 'wpmdb_exclude_subsite', false, blog_id ) ) {
14
- return;
15
- }
16
-
17
- var selected = ' ';
18
- if ( ( undefined === selected_subsite_ids || null === selected_subsite_ids || 0 === selected_subsite_ids.length ) ||
19
- ( undefined !== selected_subsite_ids && null !== selected_subsite_ids && 0 < selected_subsite_ids.length && -1 !== $.inArray( blog_id, selected_subsite_ids ) )
20
- ) {
21
- selected = ' selected="selected" ';
22
- site_selected = true;
23
- }
24
- subsite_path += ' (' + table_prefix + ( ( '1' !== blog_id ) ? blog_id + '_' : '' ) + ')';
25
- $( element ).append( '<option' + selected + 'value="' + blog_id + '">' + subsite_path + '</option>' );
26
- } );
27
-
28
- // If nothing selected (maybe IDs differ between saved profile and current config) revert to default of all selected.
29
- if ( false === site_selected ) {
30
- wpmdb.multisite.update_multiselect( element, subsites, [] );
31
- }
32
- }
33
- };
34
- })( jQuery, wpmdb );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
asset/dist/js/multisite-101.min.js DELETED
@@ -1 +0,0 @@
1
- var wpmdb=wpmdb||{};wpmdb.multisite={},function(a,b){b.multisite.update_multiselect=function(c,d,e){if(a(c).empty(),0<Object.keys(d).length){var f=a.wpmdb.apply_filters("wpmdb_get_table_prefix",null,null),g=!1;a.each(d,function(b,d){if(!a.wpmdb.apply_filters("wpmdb_exclude_subsite",!1,b)){var h=" ";(void 0===e||null===e||0===e.length||void 0!==e&&null!==e&&0<e.length&&-1!==a.inArray(b,e))&&(h=' selected="selected" ',g=!0),d+=" ("+f+("1"!==b?b+"_":"")+")",a(c).append("<option"+h+'value="'+b+'">'+d+"</option>")}}),!1===g&&b.multisite.update_multiselect(c,d,[])}}}(jQuery,wpmdb);
 
asset/dist/js/plugin-update-101.js DELETED
@@ -1,82 +0,0 @@
1
- (function( $ ) {
2
-
3
- var doing_check_licence = false;
4
- var fade_duration = 650;
5
-
6
- var admin_url = ajaxurl.replace( '/admin-ajax.php', '' );
7
- var spinner_url = admin_url + '/images/spinner';
8
- var spinner;
9
- if ( 2 < window.devicePixelRatio ) {
10
- spinner_url += '-2x';
11
- }
12
- spinner_url += '.gif';
13
- spinner = $( '<img src="' + spinner_url + '" alt="" class="check-licence-spinner" />' );
14
-
15
- $( document ).ready( function() {
16
-
17
- $( 'body' ).on( 'click', '.check-my-licence-again', function( e ) {
18
- e.preventDefault();
19
- $( this ).blur();
20
-
21
- if ( doing_check_licence ) {
22
- return false;
23
- }
24
-
25
- doing_check_licence = true;
26
-
27
- $( this ).hide();
28
- spinner.insertAfter( this );
29
-
30
- var check_again_link = ' <a class="check-my-licence-again" href="#">' + wpmdb_update_strings.check_license_again + '</a>';
31
-
32
- $.ajax( {
33
- url: ajaxurl,
34
- type: 'POST',
35
- dataType: 'json',
36
- cache: false,
37
- data: {
38
- action: 'wpmdb_check_licence',
39
- nonce: wpmdb_nonces.check_licence,
40
- context: 'update'
41
- },
42
- error: function( jqXHR, textStatus, errorThrown ) {
43
- doing_check_licence = false;
44
- $( '.wpmdb-licence-error-notice' ).fadeOut( fade_duration, function() {
45
- $( '.wpmdb-licence-error-notice' ).empty()
46
- .html( wpmdb_update_strings.license_check_problem + check_again_link )
47
- .fadeIn( fade_duration );
48
- } );
49
- },
50
- success: function( data ) {
51
- doing_check_licence = false;
52
- if ( 'undefined' !== typeof data.errors ) {
53
- var msg = '';
54
- for ( var key in data.errors ) {
55
- msg += data.errors[ key ];
56
- }
57
- $( '.wpmdb-licence-error-notice' ).fadeOut( fade_duration, function() {
58
- $( '.check-licence-spinner' ).remove();
59
- $( '.wpmdb-licence-error-notice' ).empty()
60
- .html( msg )
61
- .fadeIn( fade_duration );
62
- } );
63
- } else {
64
-
65
- // Success
66
- // Fade out, empty wpmdb custom error content, swap back in the original wordpress upgrade message, fade in
67
- $( '.wpmdbpro-custom-visible' ).fadeOut( fade_duration, function() {
68
- $( '.check-licence-spinner' ).remove();
69
- $( '.wpmdbpro-custom-visible' ).empty()
70
- .html( $( '.wpmdb-original-update-row' ).html() )
71
- .fadeIn( fade_duration );
72
- } );
73
- }
74
- }
75
- } );
76
-
77
- } );
78
-
79
- $( '.wpmdbpro-custom' ).prev().addClass( 'wpmdbpro-has-message' );
80
-
81
- } );
82
- })( jQuery );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
asset/dist/js/plugin-update-101.min.js DELETED
@@ -1 +0,0 @@
1
- !function(a){var b,c=!1,d=650,e=ajaxurl.replace("/admin-ajax.php",""),f=e+"/images/spinner";2<window.devicePixelRatio&&(f+="-2x"),f+=".gif",b=a('<img src="'+f+'" alt="" class="check-licence-spinner" />'),a(document).ready(function(){a("body").on("click",".check-my-licence-again",function(e){if(e.preventDefault(),a(this).blur(),c)return!1;c=!0,a(this).hide(),b.insertAfter(this);var f=' <a class="check-my-licence-again" href="#">'+wpmdb_update_strings.check_license_again+"</a>";a.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_check_licence",nonce:wpmdb_nonces.check_licence,context:"update"},error:function(b,e,g){c=!1,a(".wpmdb-licence-error-notice").fadeOut(d,function(){a(".wpmdb-licence-error-notice").empty().html(wpmdb_update_strings.license_check_problem+f).fadeIn(d)})},success:function(b){if(c=!1,"undefined"!=typeof b.errors){var e="";for(var f in b.errors)e+=b.errors[f];a(".wpmdb-licence-error-notice").fadeOut(d,function(){a(".check-licence-spinner").remove(),a(".wpmdb-licence-error-notice").empty().html(e).fadeIn(d)})}else a(".wpmdbpro-custom-visible").fadeOut(d,function(){a(".check-licence-spinner").remove(),a(".wpmdbpro-custom-visible").empty().html(a(".wpmdb-original-update-row").html()).fadeIn(d)})}})}),a(".wpmdbpro-custom").prev().addClass("wpmdbpro-has-message")})}(jQuery);
 
asset/dist/js/script-101.js DELETED
@@ -1,4115 +0,0 @@
1
- (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2
- var $ = jQuery;
3
- var MigrationProgressModel = require( 'MigrationProgress-model' );
4
- var MigrationProgressView = require( 'MigrationProgress-view' );
5
- var $overlayOriginal = $( '<div id="overlay" class="hide"></div>' );
6
- var $progressContentOriginal = $( '.progress-content' ).clone().addClass( 'hide' );
7
- var $proVersion = $( '.pro-version' ).addClass( 'hide' );
8
-
9
- $overlayOriginal.append( $proVersion );
10
-
11
- var MigrationProgressController = {
12
- migration: {
13
- model: {},
14
- view: {},
15
- $progress: {},
16
- $wrapper: {},
17
- $overlay: {},
18
- status: 'active',
19
- title: '',
20
- text: '',
21
- timerCount: 0,
22
- elapsedInterval: 0,
23
- currentStageNum: 0,
24
- counterDisplay: false,
25
- originalTitle: document.title,
26
- setTitle: function( title ) {
27
- this.$progress.find( '.progress-title' ).html( title );
28
- this.title = title;
29
- },
30
- setStatus: function( status ) {
31
- this.$progress
32
- .removeClass( this.status )
33
- .addClass( ( 'error' === status ) ? 'wpmdb-error' : status );
34
-
35
- // Possible statuses include: 'error', 'paused', 'complete', 'cancelling'
36
- if ( 'error' === status ) {
37
- this.$progress.find( '.progress-text' ).addClass( 'migration-error' );
38
- }
39
-
40
- this.status = status;
41
-
42
- this.updateTitleElem();
43
- },
44
- setText: function( text ) {
45
- if ( 'string' !== typeof text ) {
46
- text = '';
47
- }
48
-
49
- if ( 0 >= text.indexOf( 'wpmdb_error' ) ) {
50
- text = this.decodeErrorObject( text );
51
- }
52
-
53
- this.$progress.find( '.progress-text' ).html( text );
54
- this.text = text;
55
- },
56
- setState: function( title, text, status ) {
57
- if ( null !== title ) {
58
- this.setTitle( title );
59
- }
60
- if ( null !== text ) {
61
- this.setText( text );
62
- }
63
- if ( null !== status ) {
64
- this.setStatus( status );
65
- }
66
- },
67
- startTimer: function() {
68
- this.timerCount = 0;
69
- this.counterDisplay = $( '.timer' );
70
- this.elapsedInterval = setInterval( this.incrementTimer, 1000 );
71
- },
72
- pauseTimer: function() {
73
- clearInterval( this.elapsedInterval );
74
- },
75
- resumeTimer: function() {
76
- this.elapsedInterval = setInterval( this.incrementTimer, 1000 );
77
- },
78
- incrementTimer: function() {
79
- wpmdb.current_migration.timerCount = wpmdb.current_migration.timerCount + 1;
80
- wpmdb.current_migration.displayCount();
81
- },
82
- displayCount: function() {
83
- var hours = Math.floor( this.timerCount / 3600 ) % 24;
84
- var minutes = Math.floor( this.timerCount / 60 ) % 60;
85
- var seconds = this.timerCount % 60;
86
- var display = this.pad( hours, 2, 0 ) + ':' + this.pad( minutes, 2, 0 ) + ':' + this.pad( seconds, 2, 0 );
87
- this.counterDisplay.html( display );
88
- },
89
- updateTitleElem: function() {
90
- var activeStage = this.model.get( 'activeStageName' );
91
- var stageModel = this.model.getStageModel( activeStage );
92
- var percentDone = Math.max( 0, stageModel.getTotalProgressPercent() );
93
- var numStages = this.model.get( 'stages' ).length;
94
- var currentStage = this.currentStageNum;
95
- var currentStatus = this.status;
96
- var progressText = wpmdb_strings.title_progress;
97
-
98
- if ( 'complete' === stageModel.get( 'status' ) && 0 === stageModel.get( 'totalSize' ) ) {
99
- percentDone = 100;
100
- }
101
-
102
- progressText = progressText.replace( '%1$s', percentDone + '%' );
103
- progressText = progressText.replace( '%2$s', currentStage );
104
- progressText = progressText.replace( '%3$s', numStages );
105
-
106
- if ( 1 === numStages ) {
107
- progressText = percentDone + '%';
108
- }
109
-
110
- if ( wpmdb_strings[ 'title_' + currentStatus ] ) {
111
- progressText = wpmdb_strings[ 'title_' + currentStatus ];
112
- }
113
-
114
- progressText = progressText + ' - ' + this.originalTitle;
115
-
116
- document.title = progressText;
117
- },
118
- restoreTitleElem: function() {
119
- document.title = this.originalTitle;
120
- },
121
- pad: function( num, width, padChar ) {
122
- padChar = padChar || '0';
123
- num = num + '';
124
- return num.length >= width ? num : new Array( width - num.length + 1 ).join( padChar ) + num;
125
- },
126
-
127
- // fixes error objects that have been mangled by html encoding
128
- decodeErrorObject: function( input ) {
129
- var inputDecoded = input
130
- .replace( /\{&quot;/g, '{#q!#' )
131
- .replace( /\&quot;}/g, '#q!#}' )
132
- .replace( /,&quot;/g, ',#q!#' )
133
- .replace( /&quot;:/g, '#q!#:' )
134
- .replace( /:&quot;/g, ':#q!#' )
135
- .replace( /&quot;/g, '\\"' )
136
- .replace( /#q!#/g, '"' )
137
- .replace( /&gt;/g, '>' )
138
- .replace( /&lt;/g, '<' );
139
- try {
140
- inputDecoded = JSON.parse( inputDecoded );
141
- } catch ( e ) {
142
- return input;
143
- }
144
- return ( 'object' === typeof inputDecoded && 'undefined' !== typeof inputDecoded.body ) ? inputDecoded : input;
145
- },
146
- fixProgressStageWidthForScrollBar: function() {
147
- var scrollBarWidth = Math.abs( this.$wrapper[0].offsetWidth - this.$wrapper[0].clientWidth );
148
- var visibleProgressItems = this.$wrapper.find( '.active .progress-items' );
149
- var leftPad = parseInt( visibleProgressItems.css( 'padding-left' ), 10 );
150
- var rightPad = parseInt( visibleProgressItems.css( 'padding-right' ), 10 );
151
-
152
- if ( 0 !== scrollBarWidth || ( 0 === scrollBarWidth && rightPad !== leftPad ) ) {
153
- visibleProgressItems.css( 'padding-right', leftPad - scrollBarWidth + 'px' );
154
- }
155
- }
156
- },
157
- newMigration: function( settings ) {
158
- $( '#overlay' ).remove();
159
- $( '.progress-content' ).remove();
160
- this.migration.$overlay = $overlayOriginal.clone();
161
-
162
- $( '#wpwrap' ).append( this.migration.$overlay );
163
-
164
- this.migration.model = new MigrationProgressModel( settings );
165
- this.migration.view = new MigrationProgressView( {
166
- model: this.migration.model
167
- } );
168
-
169
- this.migration.$progress = $progressContentOriginal.clone();
170
- this.migration.$wrapper = this.migration.view.$el;
171
- this.migration.$progress.find( '.migration-progress-stages' ).replaceWith( this.migration.$wrapper );
172
-
173
- this.migration.$proVersion = this.migration.$overlay.find( '.pro-version' );
174
- var proVersionIFrame = this.migration.$proVersion.find( 'iframe' ).remove().clone();
175
-
176
- this.migration.$overlay.prepend( this.migration.$progress );
177
-
178
- // timeout needed so class is added after elements are appended to dom and transition runs.
179
- var self = this;
180
- setTimeout( function() {
181
- self.migration.$overlay.add( self.migration.$progress ).add( self.migration.$proVersion ).removeClass( 'hide' ).addClass( 'show' );
182
- if ( self.migration.$proVersion.length ) {
183
- setTimeout( function() {
184
- self.migration.$proVersion.find( '.iframe' ).append( proVersionIFrame );
185
- }, 500 );
186
- }
187
- }, 0 );
188
-
189
- this.migration.currentStageNum = 0;
190
-
191
- this.migration.$proVersion.on( 'click', '.close-pro-version', function() {
192
- self.migration.$proVersion.find( 'iframe' ).remove();
193
- self.migration.$proVersion.addClass( 'hide remove' );
194
- setTimeout( function() {
195
- self.migration.$proVersion.remove();
196
- }, 500 );
197
- } );
198
-
199
- this.migration.model.on( 'migrationComplete', function() {
200
- self.utils.updateProgTableVisibilitySetting();
201
- self.utils.updatePauseBeforeFinalizeSetting();
202
- self.migration.pauseTimer();
203
- } );
204
-
205
- $( window ).on( 'resize', _.debounce( this.migration.fixProgressStageWidthForScrollBar.bind( this.migration ), 100 ) );
206
- this.migration.model.on( 'change:activeStage', this.migration.fixProgressStageWidthForScrollBar.bind( this.migration ) );
207
-
208
- return this.migration;
209
- },
210
- utils: require( 'MigrationProgress-utils' )
211
- };
212
-
213
- module.exports = MigrationProgressController;
214
-
215
- },{"MigrationProgress-model":2,"MigrationProgress-utils":3,"MigrationProgress-view":4}],2:[function(require,module,exports){
216
- var MigrationProgressStageModel = require( 'MigrationProgressStage-model' );
217
- var $ = jQuery;
218
-
219
- var MigrationProgressModel = Backbone.Model.extend( {
220
- defaults: {
221
- _initialStages: null,
222
- stages: null,
223
- activeStageName: null,
224
- stageModels: null,
225
- localTableRows: null,
226
- localTableSizes: null,
227
- remoteTableRows: null,
228
- remoteTableSizes: null,
229
- migrationStatus: 'active',
230
- migrationIntent: 'savefile'
231
- },
232
- initialize: function() {
233
- this.set( 'stageModels', {} );
234
- this.set( '_initialStages', this.get( 'stages' ) );
235
- this.set( 'stages', [] );
236
- _.each( this.get( '_initialStages' ), function( stage, items, dataType ) {
237
- this.addStage( stage.name, items, dataType );
238
- }, this );
239
- },
240
- addStage: function( name, items, dataType, extend ) {
241
- var itemsArr = [];
242
- var stage;
243
-
244
- _.each( items, function( item ) {
245
- var size, rows;
246
-
247
- if ( 'remote' === dataType ) {
248
- size = this.get( 'remoteTableSizes' )[ item ];
249
- rows = this.get( 'remoteTableRows' )[ item ];
250
- } else {
251
- size = this.get( 'localTableSizes' )[ item ];
252
- rows = this.get( 'localTableRows' )[ item ];
253
- }
254
-
255
- itemsArr.push( {
256
- name: item,
257
- size: size,
258
- rows: rows
259
- } );
260
- }, this );
261
-
262
- stage = {
263
- name: name,
264
- items: itemsArr,
265
- dataType: dataType
266
- };
267
-
268
- if ( 'object' === typeof extend ) {
269
- stage = $.extend( stage, extend );
270
- }
271
-
272
- this.addStageModel( stage );
273
-
274
- this.trigger( 'stage:added', this.get( 'stageModels' )[ name ] );
275
- this.get( 'stageModels' )[ name ].on( 'change', function() {
276
- this.trigger( 'change' );
277
- }, this );
278
-
279
- return this.getStageModel( stage.name );
280
- },
281
- addStageItem: function( stage, name, size, rows ) {
282
- this.getStageModel( stage ).addItem( name, size, rows );
283
- },
284
- addStageModel: function( stage ) {
285
- var stages = this.get( 'stages' );
286
- var stageModels = this.get( 'stageModels' );
287
- var newStageModel = new MigrationProgressStageModel( stage );
288
-
289
- stages.push( stage );
290
- stageModels[ stage.name ] = newStageModel;
291
-
292
- this.set( 'stages', stages );
293
- this.set( 'stageModels', stageModels );
294
- },
295
- getStageModel: function( name ) {
296
- return this.get( 'stageModels' )[ name ];
297
- },
298
- getStageItems: function( stage, map ) {
299
- var stageModel = this.getStageModel( stage );
300
- var items = stageModel.get( 'items' );
301
-
302
- if ( undefined === map ) {
303
- return items;
304
- } else {
305
- return items.map( function( item ) {
306
- return item[ map ];
307
- } );
308
- }
309
- },
310
- setActiveStage: function( stage ) {
311
- this.setStageComplete();
312
- this.set( 'activeStageName', stage );
313
- this.getStageModel( stage ).set( 'status', 'active' );
314
- this.trigger( 'change:activeStage' );
315
- },
316
- setStageComplete: function( stage ) {
317
- if ( ! stage ) {
318
- stage = this.get( 'activeStageName' );
319
- }
320
- if ( null !== stage ) {
321
- this.getStageModel( stage ).set( 'status', 'complete' );
322
- }
323
-
324
- wpmdb.current_migration.currentStageNum = wpmdb.current_migration.currentStageNum + 1;
325
- },
326
- setMigrationComplete: function() {
327
- var lastStage = this.getStageModel( this.get( 'activeStageName' ) );
328
- this.setStageComplete();
329
- this.trigger( 'migrationComplete' );
330
- this.set( 'migrationStatus', 'complete' );
331
- lastStage.activateTab();
332
- }
333
- } );
334
-
335
- module.exports = MigrationProgressModel;
336
-
337
- },{"MigrationProgressStage-model":5}],3:[function(require,module,exports){
338
- var $ = jQuery;
339
-
340
- module.exports = {
341
- updateProgTableVisibilitySetting: function() {
342
- if ( ! wpmdb_data.prog_tables_visibility_changed ) {
343
- return;
344
- }
345
- wpmdb_data.prog_tables_visibility_changed = false;
346
-
347
- $.ajax( {
348
- url: ajaxurl,
349
- type: 'POST',
350
- dataType: 'text',
351
- cache: false,
352
- data: {
353
- action: 'wpmdb_save_setting',
354
- nonce: wpmdb_data.nonces.save_setting,
355
- setting: 'prog_tables_hidden',
356
- checked: Boolean( wpmdb_data.prog_tables_hidden )
357
- },
358
- error: function( jqXHR, textStatus, errorThrown ) {
359
- console.log( 'Could not save progress item visibility setting', errorThrown );
360
- }
361
- } );
362
- },
363
- updatePauseBeforeFinalizeSetting: function() {
364
- if ( ! wpmdb_data.pause_before_finalize_changed ) {
365
- return;
366
- }
367
- wpmdb_data.pause_before_finalize_changed = false;
368
-
369
- $.ajax( {
370
- url: ajaxurl,
371
- type: 'POST',
372
- dataType: 'text',
373
- cache: false,
374
- data: {
375
- action: 'wpmdb_save_setting',
376
- nonce: wpmdb_data.nonces.save_setting,
377
- setting: 'pause_before_finalize',
378
- checked: Boolean( wpmdb_data.pause_before_finalize )
379
- },
380
- error: function( jqXHR, textStatus, errorThrown ) {
381
- console.log( 'Could not save pause before finalize setting', errorThrown );
382
- }
383
- } );
384
- }
385
- };
386
-
387
- },{}],4:[function(require,module,exports){
388
- var MigrationProgressStageView = require( './MigrationProgressStage-view.js' );
389
- var $ = jQuery;
390
-
391
- var MigrationProgressView = Backbone.View.extend( {
392
- tagName: 'div',
393
- className: 'migration-progress-stages',
394
- id: 'migration-progress-stages',
395
- self: this,
396
- initialize: function() {
397
- this.$el.empty();
398
-
399
- this.model.on( 'stage:added', function( stageModel ) {
400
- this.addStageView( stageModel );
401
- }, this );
402
-
403
- _.each( this.model.get( 'stageModels' ), this.addStageView, this );
404
- },
405
- addStageView: function( stageModel ) {
406
- var newStageSubView = new MigrationProgressStageView( {
407
- model: stageModel
408
- } );
409
- stageModel.trigger( 'view:initialized', newStageSubView );
410
- this.$el.append( newStageSubView.$el );
411
- this.$el.parent().find( '.stage-tabs' ).append( newStageSubView.$tabElem );
412
- }
413
- } );
414
-
415
- module.exports = MigrationProgressView;
416
-
417
- },{"./MigrationProgressStage-view.js":6}],5:[function(require,module,exports){
418
- var $ = jQuery;
419
-
420
- var MigrationProgressStage = Backbone.Model.extend( {
421
- defaults: {
422
- status: 'queued',
423
- _initialItems: null,
424
- items: null,
425
- lookupItems: null,
426
- totalSize: 0,
427
- totalTransferred: 0,
428
- dataType: 'local',
429
- name: '',
430
- itemsComplete: 0,
431
- itemsCompleteArr: [],
432
- strings: null
433
- },
434
- initialize: function() {
435
- this.initStrings();
436
-
437
- this.set( '_initialItems', this.get( 'items' ).slice() );
438
- this.set( 'items', [] );
439
- this.set( 'lookupItems', {} );
440
- this.set( 'itemsCompleteArr', [] );
441
-
442
- _.each( this.get( '_initialItems' ), function( item ) {
443
- this.addItem( item.name, item.size, item.rows );
444
- }, this );
445
-
446
- this.on( 'view:initialized', this.triggerItemViewInit );
447
-
448
- this.on( 'change', function() {
449
- wpmdb.current_migration.updateTitleElem();
450
- } );
451
- },
452
- initStrings: function() {
453
- var default_strings = {
454
- stage_title: this.get( 'name' ),
455
- migrated: wpmdb_strings.migrated,
456
- queued: wpmdb_strings.queued,
457
- active: wpmdb_strings.running,
458
- complete: wpmdb_strings.complete,
459
- hide: wpmdb_strings.hide,
460
- show: wpmdb_strings.show,
461
- itemsName: wpmdb_strings.tables
462
- };
463
- var strings = this.get( 'strings' );
464
-
465
- strings = ( 'object' === typeof strings ) ? strings : {};
466
- strings = $.extend( default_strings, strings );
467
-
468
- strings.items_migrated = strings.itemsName + ' ' + strings.migrated;
469
- strings.hide_items = strings.hide + ' ' + strings.itemsName;
470
- strings.show_items = strings.show + ' ' + strings.itemsName;
471
-
472
- this.set( 'strings', strings );
473
- },
474
- addItem: function( name, size, rows ) {
475
- var items = this.get( 'items' );
476
- var item = {
477
- name: name,
478
- size: size,
479
- rows: rows || size,
480
- stageName: this.get( 'name' ),
481
- $el: null,
482
- transferred: 0,
483
- rowsTransferred: 0,
484
- complete: false
485
- };
486
-
487
- items.push( item );
488
- this.get( 'lookupItems' )[ name ] = items.length - 1;
489
-
490
- this.set( 'totalSize', parseInt( this.get( 'totalSize' ) ) + parseInt( size ) );
491
- this.trigger( 'item:added', item );
492
- },
493
- triggerItemViewInit: function() {
494
- var items = this.get( 'items' );
495
- var self = this;
496
- _.each( items, function( item ) {
497
- self.trigger( 'item:added', item );
498
- } );
499
- },
500
- getTotalSizeTransferred: function() {
501
- return this.get( 'totalTransferred' );
502
- },
503
- countItemsComplete: function() {
504
- return this.get( 'itemsComplete' );
505
- },
506
- getTotalProgressPercent: function() {
507
- var transferred = this.getTotalSizeTransferred();
508
- var total = this.get( 'totalSize' );
509
- if ( 0 >= transferred || 0 >= total ) {
510
- return 0;
511
- }
512
- return Math.min( 100, Math.floor( ( transferred / total ) * 100 ) );
513
- },
514
- activateTab: function() {
515
- this.trigger( 'activateTab' );
516
- wpmdb.current_migration.model.trigger( 'change:activeStage' );
517
- },
518
- setItemComplete: function( itemName ) {
519
-
520
- // Guard: return if item has already been set complete
521
- var itemsCompleteArr = this.get( 'itemsCompleteArr' );
522
- if ( ~itemsCompleteArr.indexOf( itemName ) ) {
523
- return;
524
- }
525
- itemsCompleteArr.push( itemName );
526
-
527
- var item = this.getItemByName( itemName );
528
- var totalTransferred = this.get( 'totalTransferred' );
529
- var itemsComplete = this.get( 'itemsComplete' );
530
-
531
- this.set( 'itemsComplete', ++itemsComplete );
532
-
533
- totalTransferred += item.size - item.transferred;
534
- this.set( 'totalTransferred', totalTransferred );
535
-
536
- item.transferred = item.size;
537
- item.complete = true;
538
- item.rowsTransferred = item.rows;
539
- this.trigger( 'change change:items', item );
540
- },
541
- setItemRowsTransferred: function( itemName, numRows ) {
542
- var amtDone, estTransferred;
543
- var item = this.getItemByName( itemName );
544
- var totalTransferred = this.get( 'totalTransferred' );
545
-
546
- if ( -1 === parseInt( numRows ) ) {
547
- amtDone = 1;
548
- } else {
549
- amtDone = Math.min( 1, numRows / item.rows );
550
- }
551
-
552
- if ( 1 === amtDone ) {
553
- this.setItemComplete( itemName );
554
- return;
555
- }
556
-
557
- estTransferred = item.size * amtDone;
558
-
559
- totalTransferred += estTransferred - item.transferred;
560
- this.set( 'totalTransferred', totalTransferred );
561
-
562
- item.transferred = estTransferred;
563
- item.rowsTransferred = numRows;
564
- this.trigger( 'change change:items', item );
565
- },
566
- getItemByName: function( itemName ) {
567
- var item = this.get( 'items' )[ this.get( 'lookupItems' )[ itemName ] ] || {};
568
- if ( itemName === item.name ) {
569
- return item;
570
- } else {
571
- return this.determineItemByName( itemName );
572
- }
573
- },
574
- determineItemByName: function( itemName ) {
575
- var items = this.get( 'items' );
576
- for ( var index = 0; index < items.length; index++ ) {
577
- var item = items[ index ];
578
- if ( itemName === item.name ) {
579
- this.get( 'lookupItems' ).itemName = index;
580
- return item;
581
- }
582
- }
583
- }
584
- } );
585
-
586
- module.exports = MigrationProgressStage;
587
-
588
- },{}],6:[function(require,module,exports){
589
- var $ = jQuery;
590
-
591
- var MigrationProgressStageView = Backbone.View.extend( {
592
- tagName: 'div',
593
- className: 'migration-progress-stage-container hide-tables',
594
- $totalProgressElem: null,
595
- $tabElem: null,
596
- $showHideTablesElem: null,
597
- $pauseBeforeFinalizeElem: null,
598
- $pauseBeforeFinalizeCheckbox: null,
599
- $itemsContainer: null,
600
- itemViews: null,
601
- maxDomNodes: 100,
602
- visibleDomNodes: 0,
603
- queuedElements: null,
604
- $truncationNotice: null,
605
- $truncationNoticeHiddenItems: null,
606
- initialize: function() {
607
- this.$el.empty();
608
- this.$el.attr( 'data-stage', this.model.get( 'name' ) ).addClass( 'queued ' + this.model.get( 'name' ) );
609
-
610
- this.queuedElements = [];
611
-
612
- this.initTotalProgressElem();
613
- wpmdb.current_migration.view.$el.parent().find( '.stage-tabs' ).after( this.$totalProgressElem );
614
-
615
- this.$itemsContainer = $( '<div class=progress-items />' );
616
- this.$el.append( this.$itemsContainer );
617
-
618
- this.initTabElem();
619
-
620
- this.model.on( 'item:added', this.maybeAddElementToView, this );
621
-
622
- _.each( this.model.get( 'itemModels' ), this.maybeAddElementToView, this );
623
- this.model.on( 'change', function() {
624
- this.updateProgressElem();
625
- this.updateStageTotals();
626
- }, this );
627
-
628
- this.model.on( 'change:status', function( e ) {
629
- this.$el.removeClass( 'queued active' ).addClass( this.model.get( 'status' ) );
630
- this.$totalProgressElem.removeClass( 'queued active' ).addClass( this.model.get( 'status' ) );
631
- this.$tabElem.removeClass( 'queued active' ).addClass( this.model.get( 'status' ) )
632
- .find( '.stage-status' ).text( this.model.get( 'strings' )[ this.model.get( 'status' ) ] );
633
- }, this );
634
-
635
- this.model.on( 'change:items', function( item ) {
636
- if ( item.name ) {
637
- this.setItemProgress( item );
638
- }
639
- }, this );
640
-
641
- this.model.on( 'activateTab', function() {
642
- if ( 'complete' === wpmdb.current_migration.model.get( 'migrationStatus' ) ) {
643
- this.$totalProgressElem.addClass( 'active' ).siblings().removeClass( 'active' );
644
- this.$tabElem.addClass( 'active' ).siblings().removeClass( 'active' );
645
- this.$el.addClass( 'active' ).siblings().removeClass( 'active' );
646
- }
647
- }, this );
648
- },
649
- initTotalProgressElem: function() {
650
- this.initShowHideTablesElem();
651
- this.initPauseBeforeFinalizeElem();
652
-
653
- this.$totalProgressElem = $( '<div class="stage-progress ' + this.model.get( 'name' ) + '" />' )
654
- .append( '<span class=percent-complete>0</span>% ' + this.model.get( 'strings' ).complete + ' ' )
655
- .append( '<span class="size-complete-wrap">(<span class=size-complete>0 MB</span> / <span class=size-total>0 MB</span>) </span>' )
656
- .append( '<span class="items-complete-wrap"><span class=items-complete>0</span> <span class=lowercase >of</span> <span class=items-total>0</span> ' + this.model.get( 'strings' ).items_migrated + '</span>' )
657
- .append( this.$showHideTablesElem )
658
- .append( '<div class=progress-bar-wrapper><div class=progress-bar /></div>' );
659
-
660
- this.updateStageTotals();
661
- },
662
- initShowHideTablesElem: function() {
663
- this.$showHideTablesElem = $( '<a class=show-hide-tables/>' ).text( this.model.get( 'strings' ).show_items );
664
- var self = this;
665
- this.$showHideTablesElem.on( 'click show-hide-progress-tables', function() {
666
- var progTablesHidden;
667
- if ( self.$el.hasClass( 'hide-tables' ) ) { // show tables
668
- progTablesHidden = false;
669
- self.$el.add( self.$el.siblings() ).removeClass( 'hide-tables' );
670
- self.$showHideTablesElem.text( self.model.get( 'strings' ).hide_items );
671
- } else { // hide tables
672
- progTablesHidden = true;
673
- self.$el.add( self.$el.siblings() ).addClass( 'hide-tables' );
674
- self.$showHideTablesElem.text( self.model.get( 'strings' ).show_items );
675
- }
676
-
677
- if ( Boolean( progTablesHidden ) !== Boolean( wpmdb_data.prog_tables_hidden ) ) {
678
- wpmdb_data.prog_tables_visibility_changed = true;
679
- wpmdb_data.prog_tables_hidden = progTablesHidden;
680
- }
681
- } );
682
-
683
- // show progress tables on init if hidden is false
684
- if ( ! wpmdb_data.prog_tables_hidden ) {
685
- this.$showHideTablesElem.triggerHandler( 'show-hide-progress-tables' );
686
- }
687
-
688
- // make sure text reflects current state when showing
689
- this.model.on( 'change:status activateTab', function() {
690
- if ( wpmdb_data.prog_tables_hidden ) {
691
- self.$showHideTablesElem.text( self.model.get( 'strings' ).show_items );
692
- } else {
693
- self.$showHideTablesElem.text( self.model.get( 'strings' ).hide_items );
694
- }
695
- } );
696
- },
697
- initPauseBeforeFinalizeElem: function() {
698
- this.$pauseBeforeFinalizeElem = $( '.pause-before-finalize' );
699
- this.$pauseBeforeFinalizeCheckbox = this.$pauseBeforeFinalizeElem.find( 'input[type=checkbox]' );
700
- var self = this;
701
- var isChecked = false;
702
- var migrationIntent = wpmdb.current_migration.model.get( 'migrationIntent' );
703
-
704
- // make sure checkbox is checked based on current state
705
- if ( wpmdb_data.pause_before_finalize ) {
706
- isChecked = true;
707
- }
708
- this.$pauseBeforeFinalizeCheckbox.prop( 'checked', isChecked );
709
-
710
- // only display on certain migrations
711
- if ( -1 !== $.inArray( migrationIntent, [ 'push', 'pull', 'find_replace', 'import' ] ) ) {
712
- if ( 'find_replace' === migrationIntent ) {
713
- $( '#pause-before-finalize-label' ).text( wpmdb_strings.pause_before_finalize_find_replace );
714
- }
715
- this.$pauseBeforeFinalizeElem.show();
716
- } else {
717
- this.$pauseBeforeFinalizeElem.hide();
718
- }
719
-
720
- // hide on media stage
721
- wpmdb.current_migration.model.on( 'change:activeStage', function() {
722
- if ( 'media' === wpmdb.current_migration.model.get( 'activeStageName' ) ) {
723
- self.$pauseBeforeFinalizeElem.hide();
724
- }
725
- } );
726
-
727
- this.$pauseBeforeFinalizeElem.on( 'click', function() {
728
- var pauseBeforeFinalizeValue = Boolean( self.$pauseBeforeFinalizeCheckbox.is( ':checked' ) );
729
- if ( pauseBeforeFinalizeValue !== Boolean( wpmdb_data.pause_before_finalize ) ) {
730
- wpmdb_data.pause_before_finalize_changed = true;
731
- wpmdb_data.pause_before_finalize = pauseBeforeFinalizeValue;
732
- }
733
- } );
734
- },
735
- initTabElem: function() {
736
- var self = this;
737
- this.$tabElem = $( '<a class=stage-tab>' )
738
- .append( '<span class=stage-title>' + this.model.get( 'strings' ).stage_title + '</span> ' )
739
- .append( '<span class=stage-status>' + this.model.get( 'strings' ).queued + '</span> ' )
740
- .on( 'click', function() {
741
- self.model.activateTab();
742
- } );
743
- },
744
- updateProgressElem: function() {
745
- var percentDone = Math.max( 0, this.model.getTotalProgressPercent() );
746
- var sizeDone = wpmdb.functions.convertKBSizeToHRFixed( Math.min( this.model.getTotalSizeTransferred(), this.model.get( 'totalSize' ) ) );
747
- var tablesDone = Math.min( this.model.countItemsComplete(), this.model.get( 'items' ).length );
748
-
749
- if ( 'complete' === this.model.get( 'status' ) && 0 === this.model.get( 'totalSize' ) ) {
750
- percentDone = 100;
751
- this.$showHideTablesElem.fadeOut();
752
- }
753
-
754
- this.$totalProgressElem.find( '.percent-complete' ).text( percentDone );
755
- this.$totalProgressElem.find( '.size-complete' ).text( sizeDone );
756
- this.$totalProgressElem.find( '.items-complete' ).text( wpmdb_add_commas( tablesDone ) );
757
- this.$totalProgressElem.find( '.progress-bar-wrapper .progress-bar' ).css( { width: percentDone + '%' } );
758
- },
759
- updateStageTotals: function() {
760
- var itemCount = this.model.get( 'items' ).length;
761
- this.$totalProgressElem.find( '.items-total' ).text( wpmdb_add_commas( itemCount ) );
762
- this.$totalProgressElem.find( '.size-total' ).text( wpmdb.functions.convertKBSizeToHRFixed( this.model.get( 'totalSize' ) ) );
763
- },
764
- initializeItemElement: function( item ) {
765
- var $el = $( '<div class="item-progress" />' );
766
- var $progress = $( '<div class="progress-bar"/>' ).css( 'width', '0%' );
767
- var $title = $( '<p>' ).addClass( 'item-info' )
768
- .append( $( '<span class="name" />' ).text( item.name ) )
769
- .append( ' ' )
770
- .append( $( '<span class="size" />' ).text( '(' + wpmdb.functions.convertKBSizeToHRFixed( item.size ) + ')' ) );
771
-
772
- $el.append( $title );
773
- $el.append( $progress );
774
- $el.append( '<span class="dashicons dashicons-yes"/>' );
775
-
776
- $el.attr( 'id', 'item-' + item.name );
777
- $el.attr( 'data-stage', this.model.get( 'name' ) );
778
-
779
- item.$el = $el;
780
- item.$progress = $progress;
781
- item.$title = $title;
782
-
783
- return item;
784
- },
785
- maybeAddElementToView: function( item ) {
786
- if ( this.visibleDomNodes < this.maxDomNodes ) {
787
- ++this.visibleDomNodes;
788
- this.$itemsContainer.append( this.initializeItemElement( item ).$el );
789
- } else {
790
- this.queuedElements.push( item );
791
- if ( ! this.$truncationNotice ) {
792
- this.showTruncationNotice();
793
- } else {
794
- this.updateTruncationNotice();
795
- }
796
- }
797
- },
798
- showTruncationNotice: function() {
799
- if ( this.$truncationNotice ) {
800
- return;
801
- }
802
- this.$truncationNotice = $( '<div class="truncation-notice" >' + wpmdb_strings.progress_items_truncated_msg.replace( '%1$s', '<span class="hidden-items">' + wpmdb_add_commas( this.queuedElements.length ) + '</span>' ) + '</div>' );
803
- this.$truncationNoticeHiddenItems = this.$truncationNotice.find( '.hidden-items' );
804
- this.$itemsContainer.after( this.$truncationNotice );
805
- },
806
- updateTruncationNotice: function() {
807
- this.$truncationNoticeHiddenItems.text( wpmdb_add_commas( this.queuedElements.length ) );
808
- },
809
- getNextElementForView: function( $el ) {
810
- var queueItem;
811
- if ( this.queuedElements.length ) {
812
- if ( $el ) {
813
- this.queuedElements.push( $el );
814
- }
815
- queueItem = this.queuedElements.shift();
816
- if ( queueItem instanceof $ ) {
817
- $el = queueItem;
818
- } else {
819
- $el = this.initializeItemElement( queueItem ).$el;
820
- }
821
- }
822
- return $el;
823
- },
824
- setItemProgress: function( item ) {
825
- var percentDone = Math.min( 100, Math.ceil( 100 * ( item.transferred / item.size ) ) );
826
- item.$progress.css( 'width', percentDone + '%' );
827
- if ( 100 <= percentDone ) {
828
- this.elemComplete( item );
829
- }
830
- },
831
- elemComplete: function( item ) {
832
- var $el = item.$el.addClass( 'complete' );
833
-
834
- // skip moving item to end of list if there's only one item in the list
835
- if ( 1 === this.model.get( 'items' ).length ) {
836
- return;
837
- }
838
-
839
- var $nextEl = this.getNextElementForView( $el );
840
-
841
- var height = $el.height();
842
- var marginBottom = $el.css( 'margin-bottom' );
843
-
844
- var $clone = $nextEl.clone().css( { height: 0, marginBottom: 0 } ).addClass( 'clone' );
845
- $clone.appendTo( this.$itemsContainer );
846
- $el.css( { height: height, marginBottom: marginBottom } );
847
-
848
- setTimeout( function() {
849
- $el.css( { height: 0, marginBottom: 0 } );
850
- $clone.css( { height: height, marginBottom: marginBottom } );
851
-
852
- setTimeout( function() {
853
- $el.css( { height: 'auto', marginBottom: marginBottom } ).remove();
854
- $clone.remove();
855
- this.$itemsContainer.find( '.item-progress:not(.clone)' ).last().after( $nextEl.css( { height: 'auto', marginBottom: marginBottom } ) );
856
- }.bind( this ), 250 );
857
-
858
- }.bind( this ), 1000 );
859
-
860
- }
861
- } );
862
-
863
- module.exports = MigrationProgressStageView;
864
-
865
- },{}],7:[function(require,module,exports){
866
- (function( $, wpmdb ) {
867
-
868
- var connection_established = false;
869
- var last_replace_switch = '';
870
- var doing_ajax = false;
871
- var doing_licence_registration_ajax = false;
872
- var doing_reset_api_key_ajax = false;
873
- var doing_save_profile = false;
874
- var doing_plugin_compatibility_ajax = false;
875
- var profile_name_edited = false;
876
- var checked_licence = false;
877
- var show_prefix_notice = false;
878
- var show_ssl_notice = false;
879
- var force_reconnect = false;
880
- var migration_selection = '';
881
- var show_version_notice = false;
882
- var migration_completed = false;
883
- var currently_migrating = false;
884
- var dump_filename = '';
885
- var dump_path = '';
886
- var migration_intent;
887
- var remote_site;
888
- var secret_key;
889
- var form_data;
890
- var stage;
891
- var elapsed_interval;
892
- var completed_msg;
893
- var tables_to_migrate = [];
894
- var migration_paused = false;
895
- var previous_progress_title = '';
896
- var previous_progress_text_primary = '';
897
- var previous_progress_text_secondary = '';
898
- var cancelling_text = '';
899
- var paused_text = '';
900
- var migration_cancelled = false;
901
- var flag_skip_delay = false;
902
- var delay_between_requests = 0;
903
- var fade_duration = 400;
904
- var pause_before_finalize = false;
905
- var is_auto_pause_before_finalize = false;
906
- var spinner_url = wpmdb.functions.get_spinner_url();
907
- var ajax_spinner = '<img src="' + spinner_url + '" alt="" class="ajax-spinner general-spinner" />';
908
-
909
- wpmdb.migration_progress_controller = require( 'MigrationProgress-controller' );
910
- wpmdb.current_migration = null;
911
- wpmdb.migration_selection = wpmdb_migration_type();
912
-
913
- window.onbeforeunload = function( e ) {
914
- if ( 'import' === wpmdb_migration_type() && ! $( '.step-two' ).is( ':visible' ) ) {
915
- wpmdb.functions.remove_localStorage_form_data();
916
- }
917
-
918
- if ( currently_migrating ) {
919
- e = e || window.event;
920
-
921
- // For IE and Firefox prior to version 4
922
- if ( e ) {
923
- e.returnValue = wpmdb_strings.sure;
924
- }
925
-
926
- // For Safari
927
- return wpmdb_strings.sure;
928
- }
929
- };
930
-
931
- function pad( n, width, z ) {
932
- z = z || '0';
933
- n = n + '';
934
- return n.length >= width ? n : new Array( width - n.length + 1 ).join( z ) + n;
935
- }
936
-
937
- function is_int( n ) {
938
- n = parseInt( n );
939
- return 'number' === typeof n && 0 === n % 1;
940
- }
941
-
942
- function get_intersect( arr1, arr2 ) {
943
- var r = [], o = {}, l = arr2.length, i, v;
944
- for ( i = 0; i < l; i++ ) {
945
- o[ arr2[ i ] ] = true;
946
- }
947
- l = arr1.length;
948
- for ( i = 0; i < l; i++ ) {
949
- v = arr1[ i ];
950
- if ( v in o ) {
951
- r.push( v );
952
- }
953
- }
954
- return r;
955
- }
956
-
957
- function get_query_var( name ) {
958
- name = name.replace( /[\[]/, '\\[' ).replace( /[\]]/, '\\]' );
959
- var regex = new RegExp( '[\\?&]' + name + '=([^&#]*)' ),
960
- results = regex.exec( location.search );
961
- return null === results ? '' : decodeURIComponent( results[ 1 ].replace( /\+/g, ' ' ) );
962
- }
963
-
964
- function maybe_show_ssl_warning( url, key, remote_scheme ) {
965
- var scheme = url.substr( 0, url.indexOf( ':' ) );
966
- if ( remote_scheme !== scheme && url.indexOf( 'https' ) !== -1 ) {
967
- $( '.ssl-notice' ).show();
968
- show_ssl_notice = true;
969
- url = url.replace( 'https', 'http' );
970
- $( '.pull-push-connection-info' ).val( url + '\n' + key );
971
- return;
972
- }
973
- show_ssl_notice = false;
974
- return;
975
- }
976
-
977
- wpmdb.functions.maybe_show_prefix_notice = function( prefix ) {
978
- if ( prefix !== wpmdb_data.this_prefix ) {
979
- $( '.remote-prefix' ).html( prefix );
980
- show_prefix_notice = true;
981
- $( '.prefix-notice' ).show();
982
- }
983
- };
984
-
985
- function maybe_show_mixed_cased_table_name_warning() {
986
- if ( 'undefined' === typeof wpmdb.common.connection_data || false === wpmdb.common.connection_data ) {
987
- return;
988
- }
989
-
990
- var migration_intent = wpmdb_migration_type();
991
- var tables_to_migrate = wpmdb.functions.get_tables_to_migrate( null, null );
992
-
993
- $( '.mixed-case-table-name-notice' ).hide();
994
-
995
- if ( null === tables_to_migrate ) {
996
- return;
997
- }
998
-
999
- tables_to_migrate = tables_to_migrate.join( '' );
1000
-
1001
- // The table names are all lowercase, no need to display the warning.
1002
- if ( tables_to_migrate === tables_to_migrate.toLowerCase() ) {
1003
- return;
1004
- }
1005
-
1006
- /*
1007
- * Do not display the warning if the remote lower_case_table_names does not equal "1" (i.e the only problematic setting)
1008
- * Applies to push/export migrations.
1009
- */
1010
- if ( '1' !== wpmdb.common.connection_data.lower_case_table_names && ( 'push' === migration_intent || 'savefile' === migration_intent ) ) {
1011
- return;
1012
- }
1013
-
1014
- /*
1015
- * Do not display the warning if the local lower_case_table_names does not equal "1" (i.e the only problematic setting)
1016
- * Only applies to pull migrations.
1017
- */
1018
- if ( '1' !== wpmdb_data.lower_case_table_names && 'pull' === migration_intent ) {
1019
- return;
1020
- }
1021
-
1022
- /*
1023
- * At this stage we've determined:
1024
- * 1. The source database contains at least one table that contains an uppercase character.
1025
- * 2. The destination environment has lower_case_table_names set to 1.
1026
- * 3. The source database table containing the uppercase letter will be converted to lowercase during the migration.
1027
- */
1028
-
1029
- if ( 'push' === migration_intent || 'savefile' === migration_intent ) {
1030
- $( '.mixed-case-table-name-notice.push' ).show();
1031
- } else {
1032
- $( '.mixed-case-table-name-notice.pull' ).show();
1033
- }
1034
- }
1035
-
1036
- wpmdb.functions.maybe_show_select_table_notice = function() {
1037
-
1038
- // check that they've selected some tables to migrate
1039
- if ( $( '#migrate-selected' ).is( ':checked' ) && null === $( '#select-tables' ).val() ) {
1040
- if ( 'import' !== wpmdb_migration_type() ) {
1041
- alert( wpmdb_strings.please_select_one_table );
1042
- return true;
1043
- } else {
1044
- if ( $( '#import-find-replace' ).is( ':checked' ) && $( '#select-tables' ).is( ':visible' ) ) {
1045
- alert( wpmdb_strings.please_select_one_table_import );
1046
- return true;
1047
- }
1048
- }
1049
- }
1050
-
1051
- // check that they've selected some tables to backup
1052
- if ( 'savefile' !== wpmdb_migration_type() && $( '#backup-manual-select' ).is( ':checked' ) && null === $( '#select-backup' ).val() ) {
1053
- alert( wpmdb_strings.please_select_one_table_backup );
1054
- return true;
1055
- }
1056
-
1057
- return false;
1058
- };
1059
-
1060
- function get_domain_name( url ) {
1061
- var temp_url = url;
1062
- var domain = temp_url.replace( /\/\/(.*)@/, '//' ).replace( 'http://', '' ).replace( 'https://', '' ).replace( 'www.', '' );
1063
- return domain;
1064
- }
1065
-
1066
- function update_domain_placeholder( label, url, stage ) {
1067
- var domain = get_domain_name( url );
1068
-
1069
- if ( 'completed' === stage ) {
1070
- return label.replace( /\%s\s?/, '<span class=domain-label>' + domain + '</span>&nbsp;' );
1071
- }
1072
-
1073
- return label.replace( /\%s(\S*)\s?/, '<span class=domain-label>' + domain + '$1</span>&nbsp;' );
1074
- }
1075
-
1076
- function get_migration_status_label( url, intent, stage ) {
1077
- var migrating_stage_label = '';
1078
- var completed_stage_label = '';
1079
-
1080
- switch ( intent ) {
1081
- case 'push':
1082
- migrating_stage_label = wpmdb_strings.push_migration_label_migrating;
1083
- completed_stage_label = wpmdb_strings.push_migration_label_completed;
1084
- break;
1085
- case 'pull':
1086
- migrating_stage_label = wpmdb_strings.pull_migration_label_migrating;
1087
- completed_stage_label = wpmdb_strings.pull_migration_label_completed;
1088
- break;
1089
- case 'find_replace':
1090
- migrating_stage_label = wpmdb_strings.find_replace_label_migrating;
1091
- completed_stage_label = wpmdb_strings.find_replace_label_completed;
1092
- break;
1093
- case 'savefile':
1094
- migrating_stage_label = wpmdb_strings.exporting_please_wait;
1095
- completed_stage_label = wpmdb_strings.exporting_complete;
1096
- break;
1097
- }
1098
-
1099
- var label = migrating_stage_label;
1100
-
1101
- if ( 'completed' === stage ) {
1102
- label = completed_stage_label;
1103
- }
1104
-
1105
- if ( 'push' === intent || 'pull' === intent ) {
1106
- label = update_domain_placeholder( label, url, stage );
1107
- }
1108
-
1109
- label = $.wpmdb.apply_filters( 'wpmdb_get_migration_status_label', label, {
1110
- intent: intent,
1111
- stage: stage
1112
- } );
1113
-
1114
- return label;
1115
- }
1116
-
1117
- wpmdb.functions.remove_protocol = function( url ) {
1118
- return url.replace( /^https?:/i, '' );
1119
- };
1120
-
1121
- function disable_export_type_controls() {
1122
- $( '.option-group' ).each( function( index ) {
1123
- $( 'input', this ).attr( 'disabled', 'disabled' );
1124
- $( 'label', this ).css( 'cursor', 'default' );
1125
- } );
1126
- }
1127
-
1128
- function enable_export_type_controls() {
1129
- $( '.option-group' ).each( function( index ) {
1130
- $( 'input', this ).removeAttr( 'disabled' );
1131
- $( 'label', this ).css( 'cursor', 'pointer' );
1132
- } );
1133
- }
1134
-
1135
- function set_slider_value( parent_selector, value, unit, display ) {
1136
- var display_value = value;
1137
-
1138
- if ( undefined !== display ) {
1139
- display_value = display;
1140
- }
1141
-
1142
- $( '.slider', parent_selector ).slider( 'value', parseInt( value ) );
1143
- $( '.amount', parent_selector ).html( wpmdb_add_commas( display_value ) + ' ' + unit );
1144
- }
1145
-
1146
- function set_pause_resume_button( event ) {
1147
- if ( true === migration_paused ) {
1148
- migration_paused = false;
1149
- doing_ajax = true;
1150
-
1151
- wpmdb.current_migration.setState( previous_progress_title, previous_progress_text_primary, 'active' );
1152
- $( '.pause-resume' ).html( wpmdb_strings.pause );
1153
-
1154
- // Resume the timer
1155
- wpmdb.current_migration.resumeTimer();
1156
-
1157
- wpmdb.functions.execute_next_step();
1158
- } else {
1159
- migration_paused = true;
1160
- doing_ajax = false;
1161
- paused_text = wpmdb_strings.migration_paused;
1162
- previous_progress_title = $( '.progress-title' ).html();
1163
- previous_progress_text_primary = $( '.progress-text', '.progress-wrapper-primary' ).html();
1164
- previous_progress_text_secondary = $( '.progress-text', '.progress-wrapper-secondary ' ).html();
1165
-
1166
- if ( 'find_replace' === migration_intent ) {
1167
- paused_text = wpmdb_strings.find_replace_paused;
1168
- }
1169
-
1170
- wpmdb.current_migration.setState( paused_text, wpmdb_strings.completing_current_request, null );
1171
- $( 'body' ).off( 'click', '.pause-resume' ); // Is re-bound at execute_next_step when migration is finally paused
1172
- $( 'body' ).off( 'click', '.cancel' ); // Is re-bound at execute_next_step when migration is finally paused
1173
- }
1174
- }
1175
-
1176
- wpmdb.functions.create_table_select = function( tables, table_sizes_hr, selected_tables ) {
1177
- var $table_select = document.createElement( 'select' );
1178
- $( $table_select ).attr( {
1179
- multiple: 'multiple',
1180
- name: 'select_tables[]',
1181
- id: 'select-tables',
1182
- class: 'multiselect'
1183
- } );
1184
-
1185
- if ( 0 < tables.length ) {
1186
- $.each( tables, function( index, table ) {
1187
- if ( $.wpmdb.apply_filters( 'wpmdb_exclude_table', false, table ) ) {
1188
- return;
1189
- }
1190
-
1191
- var selected = ' ';
1192
- if ( undefined !== selected_tables && null !== selected_tables && 0 < selected_tables.length && -1 !== $.inArray( table, selected_tables ) ) {
1193
- selected = ' selected="selected" ';
1194
- }
1195
-
1196
- var size = '';
1197
- if ( 0 !== table_sizes_hr.length ) {
1198
- size = ' (' + table_sizes_hr[ table ] + ')';
1199
- }
1200
-
1201
- $( $table_select ).append( '<option' + selected + 'value="' + table + '">' + table + size + '</option>' );
1202
- } );
1203
- }
1204
-
1205
- return $table_select;
1206
- };
1207
-
1208
- /**
1209
- * Filter temporary tables out of wpmdb.functions.create_table_select().
1210
- *
1211
- * @param exclude
1212
- * @param table_name
1213
- * @returns {bool}
1214
- */
1215
- function filter_temp_tables( exclude, table_name ) {
1216
- var temp_prefix = wpmdb_data.this_temp_prefix;
1217
-
1218
- if ( 'pull' === wpmdb_migration_type() && 'undefined' !== typeof wpmdb.common.connection_data && 'undefined' !== typeof wpmdb.common.connection_data.temp_prefix ) {
1219
- temp_prefix = wpmdb.common.connection_data.temp_prefix;
1220
- }
1221
-
1222
- if ( temp_prefix === table_name.substring( 0, temp_prefix.length ) ) {
1223
- return true;
1224
- }
1225
-
1226
- return exclude;
1227
- }
1228
- $.wpmdb.add_filter( 'wpmdb_exclude_table', filter_temp_tables );
1229
-
1230
- /**
1231
- * Returns tables selected for migration.
1232
- *
1233
- * @param value
1234
- * @param args
1235
- * @returns {array}
1236
- *
1237
- * Also handler for wpmdb_get_tables_to_migrate filter, disregards input values as it is the primary source.
1238
- */
1239
- wpmdb.functions.get_tables_to_migrate = function( value, args ) {
1240
- var tables = [];
1241
- var mig_type = wpmdb_migration_type();
1242
- var table_intent = $( 'input[name=table_migrate_option]:checked' ).val();
1243
-
1244
- // Grab tables as per what the user has selected from the multiselect box or all prefixed tables.
1245
- if ( 'migrate_select' === table_intent ) {
1246
- tables = $( '#select-tables' ).val();
1247
- } else {
1248
- if ( 'pull' !== mig_type && 'undefined' !== typeof wpmdb_data.this_prefixed_tables ) {
1249
- tables = wpmdb_data.this_prefixed_tables;
1250
- } else if ( 'pull' === mig_type && 'undefined' !== typeof wpmdb.common.connection_data && 'undefined' !== typeof wpmdb.common.connection_data.prefixed_tables ) {
1251
- tables = wpmdb.common.connection_data.prefixed_tables;
1252
- }
1253
- }
1254
-
1255
- return tables;
1256
- };
1257
-
1258
- function get_table_prefix( value, args ) {
1259
- return $( '.table-select-wrap .table-prefix' ).text();
1260
- }
1261
-
1262
- function lock_replace_url( lock ) {
1263
- if ( true === lock ) {
1264
- $( '.replace-row.pin .replace-right-col input[type="text"]' ).attr( 'readonly', 'readonly' );
1265
- $( '.replace-row.pin .arrow-col' ).addClass( 'disabled' );
1266
- } else {
1267
- $( '.replace-row.pin .replace-right-col input[type="text"]' ).removeAttr( 'readonly' );
1268
- $( '.replace-row.pin .arrow-col' ).removeClass( 'disabled' );
1269
- }
1270
- }
1271
-
1272
- function set_connection_data( data ) {
1273
- wpmdb.common.previous_connection_data = wpmdb.common.connection_data;
1274
- wpmdb.common.connection_data = data;
1275
- $.wpmdb.do_action( 'wpmdb_connection_data_updated', data );
1276
- }
1277
-
1278
- /**
1279
- * Returns formatted info for the Max Request Size slider.
1280
- *
1281
- * @param value
1282
- * @return object
1283
- */
1284
- function get_max_request_display_info( value ) {
1285
- var display_info = {};
1286
-
1287
- display_info.unit = 'MB';
1288
- display_info.amount = ( value / 1024 ).toFixed( 2 );
1289
-
1290
- return display_info;
1291
- }
1292
-
1293
- $( document ).ready( function() {
1294
- wpmdb.migration_state_id = '';
1295
-
1296
- $( '#plugin-compatibility' ).change( function( e ) {
1297
- var install = '1';
1298
- var $status = $( this ).closest( 'td' ).next( 'td' ).find( '.setting-status' );
1299
-
1300
- if ( !$( this ).is( ':checked' ) ) {
1301
- install = '0';
1302
- }
1303
-
1304
- $( '.plugin-compatibility-wrap' ).toggle();
1305
-
1306
- $status.find( '.ajax-success-msg' ).remove();
1307
- $status.append( ajax_spinner );
1308
- $( '#plugin-compatibility' ).attr( 'disabled', 'disabled' );
1309
- $( '.plugin-compatibility' ).addClass( 'disabled' );
1310
-
1311
- $.ajax( {
1312
- url: ajaxurl,
1313
- type: 'POST',
1314
- dataType: 'text',
1315
- cache: false,
1316
- data: {
1317
- action: 'wpmdb_plugin_compatibility',
1318
- install: install,
1319
- nonce: wpmdb_data.nonces.plugin_compatibility
1320
- },
1321
- error: function( jqXHR, textStatus, errorThrown ) {
1322
- alert( wpmdb_strings.plugin_compatibility_settings_problem + '\r\n\r\n' + wpmdb_strings.status + ' ' + jqXHR.status + ' ' + jqXHR.statusText + '\r\n\r\n' + wpmdb_strings.response + '\r\n' + jqXHR.responseText );
1323
- $( '.ajax-spinner' ).remove();
1324
- $( '#plugin-compatibility' ).removeAttr( 'disabled' );
1325
- $( '.plugin-compatibility' ).removeClass( 'disabled' );
1326
- },
1327
- success: function( data ) {
1328
- if ( '' !== $.trim( data ) ) {
1329
- alert( data );
1330
- } else {
1331
- $status.append( '<span class="ajax-success-msg">' + wpmdb_strings.saved + '</span>' );
1332
- $( '.ajax-success-msg' ).fadeOut( 2000, function() {
1333
- $( this ).remove();
1334
- } );
1335
- }
1336
- $( '.ajax-spinner' ).remove();
1337
- $( '#plugin-compatibility' ).removeAttr( 'disabled' );
1338
- $( '.plugin-compatibility' ).removeClass( 'disabled' );
1339
- }
1340
- } );
1341
-
1342
- } );
1343
-
1344
- if ( $( '#plugin-compatibility' ).is( ':checked' ) ) {
1345
- $( '.plugin-compatibility-wrap' ).show();
1346
- }
1347
-
1348
- if ( 0 <= navigator.userAgent.indexOf( 'MSIE' ) || 0 <= navigator.userAgent.indexOf( 'Trident' ) ) {
1349
- $( '.ie-warning' ).show();
1350
- }
1351
-
1352
- if ( 0 === wpmdb_data.valid_licence ) {
1353
- $( '#savefile' ).prop( 'checked', true );
1354
- }
1355
- var max_request_size_container = $( '.max-request-size' );
1356
- var max_request_size_slider = $( '.slider', max_request_size_container );
1357
- max_request_size_slider.slider( {
1358
- range: 'min',
1359
- value: parseInt( wpmdb_data.max_request / 1024 ),
1360
- min: 512,
1361
- max: parseInt( wpmdb_data.bottleneck / 1024 ),
1362
- step: 256,
1363
- create: function( event, ui ) {
1364
- var display_info = get_max_request_display_info( wpmdb_data.max_request / 1024 );
1365
- set_slider_value( max_request_size_container, wpmdb_data.max_request / 1024, display_info.unit, display_info.amount );
1366
- },
1367
- slide: function( event, ui ) {
1368
- var display_info = get_max_request_display_info( ui.value );
1369
- set_slider_value( max_request_size_container, ui.value, display_info.unit, display_info.amount );
1370
- },
1371
- stop: function( event, ui ) {
1372
- $( '.slider-success-msg' ).remove();
1373
- $( '.amount', max_request_size_container ).after( '<img src="' + spinner_url + '" alt="" class="slider-spinner general-spinner" />' );
1374
- max_request_size_slider.slider( 'disable' );
1375
-
1376
- $.ajax( {
1377
- url: ajaxurl,
1378
- type: 'POST',
1379
- cache: false,
1380
- data: {
1381
- action: 'wpmdb_update_max_request_size',
1382
- max_request_size: parseInt( ui.value ),
1383
- nonce: wpmdb_data.nonces.update_max_request_size
1384
- },
1385
- error: function( jqXHR, textStatus, errorThrown ) {
1386
- max_request_size_slider.slider( 'enable' );
1387
- $( '.slider-spinner', max_request_size_container ).remove();
1388
- alert( wpmdb_strings.max_request_size_problem );
1389
- var display_info = get_max_request_display_info( wpmdb_data.max_request / 1024 );
1390
- set_slider_value( max_request_size_container, wpmdb_data.max_request / 1024, display_info.unit, display_info.amount );
1391
- max_request_size_slider.slider( 'enable' );
1392
- },
1393
- success: function() {
1394
- max_request_size_slider.slider( 'enable' );
1395
- $( '.slider-label-wrapper', max_request_size_container ).append( '<span class="slider-success-msg">' + wpmdb_strings.saved + '</span>' );
1396
- $( '.slider-success-msg', max_request_size_container ).fadeOut( 2000, function() {
1397
- $( this ).remove();
1398
- } );
1399
- $( '.slider-spinner', max_request_size_container ).remove();
1400
- }
1401
- } );
1402
- }
1403
- } );
1404
-
1405
- var delay_between_requests_container = $( '.delay-between-requests' );
1406
- var delay_between_requests_slider = $( '.slider', delay_between_requests_container );
1407
- delay_between_requests_slider.slider( {
1408
- range: 'min',
1409
- value: parseInt( wpmdb_data.delay_between_requests / 1000 ),
1410
- min: 0,
1411
- max: 10,
1412
- step: 1,
1413
- create: function( event, ui ) {
1414
- set_slider_value( delay_between_requests_container, wpmdb_data.delay_between_requests / 1000, 's' );
1415
- },
1416
- slide: function( event, ui ) {
1417
- set_slider_value( delay_between_requests_container, ui.value, 's' );
1418
- },
1419
- stop: function( event, ui ) {
1420
- $( '.slider-success-msg' ).remove();
1421
- $( '.amount', delay_between_requests_container ).after( '<img src="' + spinner_url + '" alt="" class="slider-spinner general-spinner" />' );
1422
- delay_between_requests_slider.slider( 'disable' );
1423
-
1424
- $.ajax( {
1425
- url: ajaxurl,
1426
- type: 'POST',
1427
- cache: false,
1428
- data: {
1429
- action: 'wpmdb_update_delay_between_requests',
1430
- delay_between_requests: parseInt( ui.value * 1000 ),
1431
- nonce: wpmdb_data.nonces.update_delay_between_requests
1432
- },
1433
- error: function( jqXHR, textStatus, errorThrown ) {
1434
- delay_between_requests_slider.slider( 'enable' );
1435
- $( '.slider-spinner', delay_between_requests_container ).remove();
1436
- alert( wpmdb_strings.delay_between_requests_problem );
1437
- set_slider_value( delay_between_requests_container, wpmdb_data.delay_between_requests / 1000, 's' );
1438
- delay_between_requests_slider.slider( 'enable' );
1439
- },
1440
- success: function() {
1441
- wpmdb_data.delay_between_requests = parseInt( ui.value * 1000 );
1442
- delay_between_requests_slider.slider( 'enable' );
1443
- $( '.slider-label-wrapper', delay_between_requests_container ).append( '<span class="slider-success-msg">' + wpmdb_strings.saved + '</span>' );
1444
- $( '.slider-success-msg', delay_between_requests_container ).fadeOut( 2000, function() {
1445
- $( this ).remove();
1446
- } );
1447
- $( '.slider-spinner', delay_between_requests_container ).remove();
1448
- }
1449
- } );
1450
- }
1451
- } );
1452
-
1453
- var $push_select = $( '#select-tables' ).clone();
1454
- var $pull_select = $( '#select-tables' ).clone();
1455
- var $push_post_type_select = $( '#select-post-types' ).clone();
1456
- var $pull_post_type_select = $( '#select-post-types' ).clone();
1457
- var $push_select_backup = $( '#select-backup' ).clone();
1458
- var $pull_select_backup = $( '#select-backup' ).clone();
1459
-
1460
- $( '.help-tab .video' ).each( function() {
1461
- var $container = $( this ),
1462
- $viewer = $( '.video-viewer' );
1463
-
1464
- $( 'a', this ).click( function( e ) {
1465
- e.preventDefault();
1466
-
1467
- $viewer.attr( 'src', '//www.youtube.com/embed/' + $container.data( 'video-id' ) + '?autoplay=1' );
1468
- $viewer.show();
1469
- var offset = $viewer.offset();
1470
- $( window ).scrollTop( offset.top - 50 );
1471
- } );
1472
- } );
1473
-
1474
- $( '.backup-options' ).show();
1475
- $( '.keep-active-plugins' ).show();
1476
- if ( 'savefile' === wpmdb_migration_type() ) {
1477
- $( '.backup-options' ).hide();
1478
- $( '.keep-active-plugins' ).hide();
1479
- }
1480
-
1481
- last_replace_switch = wpmdb_migration_type();
1482
-
1483
- function check_licence( licence ) {
1484
- var update_licence_content = ! doing_licence_registration_ajax;
1485
- checked_licence = true;
1486
- $.ajax( {
1487
- url: ajaxurl,
1488
- type: 'POST',
1489
- dataType: 'json',
1490
- cache: false,
1491
- data: {
1492
- action: 'wpmdb_check_licence',
1493
- licence: licence,
1494
- context: 'all',
1495
- nonce: wpmdb_data.nonces.check_licence
1496
- },
1497
- error: function( jqXHR, textStatus, errorThrown ) {
1498
- alert( wpmdb_strings.license_check_problem );
1499
- },
1500
- success: function( data ) {
1501
-
1502
- var $support_content = $( '.support-content' );
1503
- var $addons_content = $( '.addons-content' );
1504
- var $licence_content = $( '.licence-status:not(.notification-message)' );
1505
- var licence_msg, support_msg, addons_msg;
1506
-
1507
- if ( 'undefined' !== typeof data.dbrains_api_down ) {
1508
- support_msg = data.dbrains_api_down + data.message;
1509
- addons_msg = data.dbrains_api_down;
1510
- } else if ( 'undefined' !== typeof data.errors ) {
1511
-
1512
- if ( 'undefined' !== typeof data.errors.subscription_expired ) {
1513
- licence_msg = data.errors.subscription_expired.licence;
1514
- support_msg = data.errors.subscription_expired.support;
1515
- addons_msg = data.errors.subscription_expired.addons;
1516
- } else {
1517
- var msg = '';
1518
- for ( var key in data.errors ) {
1519
- msg += data.errors[ key ];
1520
- }
1521
- support_msg = msg;
1522
- addons_msg = msg;
1523
- }
1524
- if ( 'undefined' !== typeof data.addon_content ) {
1525
- addons_msg += '\n' + data.addon_content;
1526
- }
1527
- } else {
1528
- support_msg = data.message;
1529
- addons_msg = data.addon_content;
1530
- }
1531
-
1532
- if ( update_licence_content ) {
1533
- $licence_content.stop().fadeOut( fade_duration, function() {
1534
- if ( 'undefined' === typeof licence_msg ) {
1535
- $( this ).css( { visibility: 'hidden', display: 'block' } ).slideUp();
1536
- licence_msg = '';
1537
- }
1538
-
1539
- $( this )
1540
- .empty()
1541
- .html( licence_msg )
1542
- .stop()
1543
- .fadeIn( fade_duration );
1544
- } );
1545
- }
1546
-
1547
- $support_content.stop().fadeOut( fade_duration, function() {
1548
- $( this )
1549
- .empty()
1550
- .html( support_msg )
1551
- .stop()
1552
- .fadeIn( fade_duration );
1553
- } );
1554
- $addons_content.stop().fadeOut( fade_duration, function() {
1555
- $( this )
1556
- .empty()
1557
- .html( addons_msg )
1558
- .stop()
1559
- .fadeIn( fade_duration );
1560
- } );
1561
-
1562
- if ( $( '#plugin-compatibility' ).is( ':not(:checked)' ) ) {
1563
- $( '#compatibility-header' ).click();
1564
- }
1565
- }
1566
- } );
1567
- }
1568
-
1569
- /**
1570
- * Handle 'Check License Again' functionality found in expired license messages.
1571
- */
1572
- $( '.content-tab' ).on( 'click', '.check-my-licence-again', function( e ) {
1573
- e.preventDefault();
1574
- checked_licence = false;
1575
- $( e.target ).replaceWith( 'Checking... ' + ajax_spinner );
1576
- check_licence( null, 'all' );
1577
- } );
1578
-
1579
- function refresh_table_selects() {
1580
- if ( undefined !== wpmdb_data && undefined !== wpmdb_data.this_tables && undefined !== wpmdb_data.this_table_sizes_hr ) {
1581
- $push_select = wpmdb.functions.create_table_select( wpmdb_data.this_tables, wpmdb_data.this_table_sizes_hr, $( $push_select ).val() );
1582
- }
1583
-
1584
- if ( undefined !== wpmdb.common.connection_data && undefined !== wpmdb.common.connection_data.tables && undefined !== wpmdb.common.connection_data.table_sizes_hr ) {
1585
- $pull_select = wpmdb.functions.create_table_select( wpmdb.common.connection_data.tables, wpmdb.common.connection_data.table_sizes_hr, $( $pull_select ).val() );
1586
- }
1587
- }
1588
-
1589
- $.wpmdb.add_action( 'wpmdb_refresh_table_selects', refresh_table_selects );
1590
-
1591
- function update_push_table_select() {
1592
- $( '#select-tables' ).remove();
1593
- $( '.select-tables-wrap' ).prepend( $push_select );
1594
- $( '#select-tables' ).change();
1595
- }
1596
-
1597
- $.wpmdb.add_action( 'wpmdb_update_push_table_select', update_push_table_select );
1598
-
1599
- function update_pull_table_select() {
1600
- $( '#select-tables' ).remove();
1601
- $( '.select-tables-wrap' ).prepend( $pull_select );
1602
- $( '#select-tables' ).change();
1603
- }
1604
-
1605
- $.wpmdb.add_action( 'wpmdb_update_pull_table_select', update_pull_table_select );
1606
-
1607
- function disable_table_migration_options() {
1608
- $( '#migrate-selected' ).parents( '.option-section' ).children( '.header-expand-collapse' ).children( '.expand-collapse-arrow' ).removeClass( 'collapsed' );
1609
- $( '.table-select-wrap' ).show();
1610
- $( '#migrate-only-with-prefix' ).prop( 'checked', false );
1611
- $( '#migrate-selected' ).prop( 'checked', true );
1612
- $( '.table-migrate-options' ).hide();
1613
- $( '.select-tables-wrap' ).show();
1614
- }
1615
-
1616
- $.wpmdb.add_action( 'wpmdb_disable_table_migration_options', disable_table_migration_options );
1617
-
1618
- function enable_table_migration_options() {
1619
- $( '.table-migrate-options' ).show();
1620
- }
1621
-
1622
- $.wpmdb.add_action( 'wpmdb_enable_table_migration_options', enable_table_migration_options );
1623
-
1624
- function select_all_tables() {
1625
- $( '#select-tables' ).children( 'option' ).prop( 'selected', true );
1626
- $( '#select-tables' ).change();
1627
- }
1628
-
1629
- $.wpmdb.add_action( 'wpmdb_select_all_tables', select_all_tables );
1630
-
1631
- function base_old_url( value, args ) {
1632
- return wpmdb.functions.remove_protocol( wpmdb_data.this_url );
1633
- }
1634
-
1635
- $.wpmdb.add_filter( 'wpmdb_base_old_url', base_old_url );
1636
-
1637
- function establish_remote_connection_from_saved_profile() {
1638
- var action = wpmdb_migration_type();
1639
- var connection_info = $.trim( $( '.pull-push-connection-info' ).val() ).split( '\n' );
1640
- if ( 'undefined' === typeof wpmdb_default_profile ||
1641
- true === wpmdb_default_profile ||
1642
- 'savefile' === action ||
1643
- 'find_replace' === action ||
1644
- 'import' === action ||
1645
- doing_ajax ||
1646
- ! wpmdb_data.is_pro ) {
1647
- return;
1648
- }
1649
-
1650
- doing_ajax = true;
1651
- disable_export_type_controls();
1652
-
1653
- $( '.connection-status' ).html( wpmdb_strings.establishing_remote_connection );
1654
- $( '.connection-status' ).removeClass( 'notification-message error-notice migration-error' );
1655
- $( '.connection-status' ).append( ajax_spinner );
1656
-
1657
- var intent = wpmdb_migration_type();
1658
-
1659
- $.ajax( {
1660
- url: ajaxurl,
1661
- type: 'POST',
1662
- dataType: 'json',
1663
- cache: false,
1664
- data: {
1665
- action: 'wpmdb_verify_connection_to_remote_site',
1666
- url: connection_info[ 0 ],
1667
- key: connection_info[ 1 ],
1668
- intent: intent,
1669
- nonce: wpmdb_data.nonces.verify_connection_to_remote_site,
1670
- convert_post_type_selection: wpmdb_convert_post_type_selection,
1671
- profile: wpmdb_data.profile
1672
- },
1673
- error: function( jqXHR, textStatus, errorThrown ) {
1674
- $( '.connection-status' ).html( get_ajax_errors( jqXHR.responseText, '(#102)', jqXHR ) );
1675
- $( '.connection-status' ).addClass( 'notification-message error-notice migration-error' );
1676
- $( '.ajax-spinner' ).remove();
1677
- doing_ajax = false;
1678
- enable_export_type_controls();
1679
- },
1680
- success: function( data ) {
1681
- $( '.ajax-spinner' ).remove();
1682
- doing_ajax = false;
1683
- enable_export_type_controls();
1684
-
1685
- if ( 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error ) {
1686
- $( '.connection-status' ).html( data.body );
1687
- $( '.connection-status' ).addClass( 'notification-message error-notice migration-error' );
1688
-
1689
- if ( data.body.indexOf( '401 Unauthorized' ) > -1 ) {
1690
- $( '.basic-access-auth-wrapper' ).show();
1691
- }
1692
-
1693
- return;
1694
- }
1695
-
1696
- maybe_show_ssl_warning( connection_info[ 0 ], connection_info[ 1 ], data.scheme );
1697
- wpmdb.functions.maybe_show_prefix_notice( data.prefix );
1698
-
1699
- $( '.pull-push-connection-info' ).addClass( 'temp-disabled' );
1700
- $( '.pull-push-connection-info' ).attr( 'readonly', 'readonly' );
1701
- $( '.connect-button' ).hide();
1702
-
1703
- $( '.connection-status' ).hide();
1704
- $( '.step-two' ).show();
1705
- connection_established = true;
1706
- set_connection_data( data );
1707
- move_connection_info_box();
1708
-
1709
- maybe_show_mixed_cased_table_name_warning();
1710
-
1711
- var loaded_tables = '';
1712
- if ( false === wpmdb_default_profile && 'undefined' !== typeof wpmdb_loaded_tables ) {
1713
- loaded_tables = wpmdb_loaded_tables;
1714
- }
1715
-
1716
- $pull_select = wpmdb.functions.create_table_select( wpmdb.common.connection_data.tables, wpmdb.common.connection_data.table_sizes_hr, loaded_tables );
1717
-
1718
- var loaded_post_types = '';
1719
- if ( false === wpmdb_default_profile && 'undefined' !== typeof wpmdb_loaded_post_types ) {
1720
- if ( 'undefined' !== typeof data.select_post_types ) {
1721
- $( '#exclude-post-types' ).attr( 'checked', 'checked' );
1722
- $( '.post-type-select-wrap' ).show();
1723
- loaded_post_types = data.select_post_types;
1724
- } else {
1725
- loaded_post_types = wpmdb_loaded_post_types;
1726
- }
1727
- }
1728
-
1729
- var $post_type_select = document.createElement( 'select' );
1730
- $( $post_type_select ).attr( {
1731
- multiple: 'multiple',
1732
- name: 'select_post_types[]',
1733
- id: 'select-post-types',
1734
- class: 'multiselect'
1735
- } );
1736
-
1737
- $.each( wpmdb.common.connection_data.post_types, function( index, value ) {
1738
- var selected = $.inArray( value, loaded_post_types );
1739
- if ( -1 !== selected || ( true === wpmdb_convert_exclude_revisions && 'revision' !== value ) ) {
1740
- selected = ' selected="selected" ';
1741
- } else {
1742
- selected = ' ';
1743
- }
1744
- $( $post_type_select ).append( '<option' + selected + 'value="' + value + '">' + value + '</option>' );
1745
- } );
1746
-
1747
- $pull_post_type_select = $post_type_select;
1748
-
1749
- var loaded_tables_backup = '';
1750
- if ( false === wpmdb_default_profile && 'undefined' !== typeof wpmdb_loaded_tables_backup ) {
1751
- loaded_tables_backup = wpmdb_loaded_tables_backup;
1752
- }
1753
-
1754
- var $table_select_backup = document.createElement( 'select' );
1755
- $( $table_select_backup ).attr( {
1756
- multiple: 'multiple',
1757
- name: 'select_backup[]',
1758
- id: 'select-backup',
1759
- class: 'multiselect'
1760
- } );
1761
-
1762
- $.each( wpmdb.common.connection_data.tables, function( index, value ) {
1763
- var selected = $.inArray( value, loaded_tables_backup );
1764
- if ( -1 !== selected ) {
1765
- selected = ' selected="selected" ';
1766
- } else {
1767
- selected = ' ';
1768
- }
1769
- $( $table_select_backup ).append( '<option' + selected + 'value="' + value + '">' + value + ' (' + wpmdb.common.connection_data.table_sizes_hr[ value ] + ')</option>' );
1770
- } );
1771
-
1772
- $push_select_backup = $table_select_backup;
1773
-
1774
- if ( 'pull' === wpmdb_migration_type() ) {
1775
- $.wpmdb.do_action( 'wpmdb_update_pull_table_select' );
1776
- $( '#select-post-types' ).remove();
1777
- $( '.exclude-post-types-warning' ).after( $pull_post_type_select );
1778
- $( '#select-backup' ).remove();
1779
- $( '.backup-tables-wrap' ).prepend( $pull_select_backup );
1780
- $( '.table-prefix' ).html( data.prefix );
1781
- $( '.uploads-dir' ).html( wpmdb_data.this_uploads_dir );
1782
- } else {
1783
- $( '#select-backup' ).remove();
1784
- $( '.backup-tables-wrap' ).prepend( $push_select_backup );
1785
- }
1786
-
1787
- $.wpmdb.do_action( 'verify_connection_to_remote_site', wpmdb.common.connection_data );
1788
- }
1789
-
1790
- } );
1791
-
1792
- }
1793
-
1794
- // automatically validate connection info if we're loading a saved profile
1795
- establish_remote_connection_from_saved_profile();
1796
-
1797
- // add to <a> tags which act as JS event buttons, will not jump page to top and will deselect the button
1798
- $( 'body' ).on( 'click', '.js-action-link', function( e ) {
1799
- e.preventDefault();
1800
- $( this ).blur();
1801
- } );
1802
-
1803
- function enable_pro_licence( data, licence_key ) {
1804
- $( '.licence-input, .register-licence' ).remove();
1805
- $( '.licence-not-entered' ).prepend( data.masked_licence );
1806
- $( '.support-content' ).empty().html( '<p>' + wpmdb_strings.fetching_license + '<img src="' + spinner_url + '" alt="" class="ajax-spinner general-spinner" /></p>' );
1807
- check_licence( licence_key );
1808
-
1809
- $( '.migrate-selection label' ).removeClass( 'disabled' );
1810
- $( '.migrate-selection input' ).removeAttr( 'disabled' );
1811
- }
1812
-
1813
- $( '.licence-input' ).keypress( function( e ) {
1814
- if ( 13 === e.which ) {
1815
- e.preventDefault();
1816
- $( '.register-licence' ).click();
1817
- }
1818
- } );
1819
-
1820
- // registers your licence
1821
- $( 'body' ).on( 'click', '.register-licence', function( e ) {
1822
- e.preventDefault();
1823
-
1824
- if ( doing_licence_registration_ajax ) {
1825
- return;
1826
- }
1827
-
1828
- var licence_key = $.trim( $( '.licence-input' ).val() );
1829
- var $licence_status = $( '.licence-status' );
1830
-
1831
- $licence_status.removeClass( 'notification-message error-notice success-notice' );
1832
-
1833
- if ( '' === licence_key ) {
1834
- $licence_status.html( '<div class="notification-message error-notice">' + wpmdb_strings.enter_license_key + '</div>' );
1835
- return;
1836
- }
1837
-
1838
- $licence_status.empty().removeClass( 'success' );
1839
- doing_licence_registration_ajax = true;
1840
- $( '.button.register-licence' ).after( '<img src="' + spinner_url + '" alt="" class="register-licence-ajax-spinner general-spinner" />' );
1841
-
1842
- $.ajax( {
1843
- url: ajaxurl,
1844
- type: 'POST',
1845
- dataType: 'JSON',
1846
- cache: false,
1847
- data: {
1848
- action: 'wpmdb_activate_licence',
1849
- licence_key: licence_key,
1850
- nonce: wpmdb_data.nonces.activate_licence,
1851
- context: 'licence'
1852
- },
1853
- error: function( jqXHR, textStatus, errorThrown ) {
1854
- doing_licence_registration_ajax = false;
1855
- $( '.register-licence-ajax-spinner' ).remove();
1856
- $licence_status.html( wpmdb_strings.register_license_problem );
1857
- },
1858
- success: function( data ) {
1859
- $( '.register-licence-ajax-spinner' ).remove();
1860
-
1861
- if ( 'undefined' !== typeof data.errors ) {
1862
- var msg = '';
1863
- for ( var key in data.errors ) {
1864
- msg += data.errors[ key ];
1865
- }
1866
- $licence_status.html( msg );
1867
-
1868
- if ( 'undefined' !== typeof data.masked_licence ) {
1869
- enable_pro_licence( data, licence_key );
1870
- $( '.migrate-tab .invalid-licence' ).hide();
1871
- }
1872
- } else if ( 'undefined' !== typeof data.wpmdb_error && 'undefined' !== typeof data.body ) {
1873
- $licence_status.html( data.body );
1874
- } else {
1875
- if ( 1 === Number( data.is_first_activation ) ) {
1876
- wpmdb_strings.welcome_text = wpmdb_strings.welcome_text.replace( '%1$s', 'https://deliciousbrains.com/wp-migrate-db-pro/doc/quick-start-guide/?utm_campaign=support%2Bdocs&utm_source=MDB%2BPaid&utm_medium=insideplugin' );
1877
- wpmdb_strings.welcome_text = wpmdb_strings.welcome_text.replace( '%2$s', 'https://deliciousbrains.com/wp-migrate-db-pro/videos/?utm_campaign=support%2Bdocs&utm_source=MDB%2BPaid&utm_medium=insideplugin' );
1878
-
1879
- $licence_status.after(
1880
- '<div id="welcome-wrap">' +
1881
- '<img id="welcome-img" src="' + wpmdb_data.this_plugin_url + 'asset/dist/img/welcome.jpg" />' +
1882
- '<div class="welcome-text">' +
1883
- '<h3>' + wpmdb_strings.welcome_title + '</h3>' +
1884
- '<p>' + wpmdb_strings.welcome_text + '</p>' +
1885
- '</div>' +
1886
- '</div>'
1887
- );
1888
- }
1889
-
1890
- $licence_status.html( wpmdb_strings.license_registered ).delay( 5000 ).fadeOut( 1000, function() {
1891
- $( this ).css( { visibility: 'hidden', display: 'block' } ).slideUp();
1892
- } );
1893
- $licence_status.addClass( 'success notification-message success-notice' );
1894
- enable_pro_licence( data, licence_key );
1895
- $( '.invalid-licence' ).hide();
1896
- }
1897
-
1898
- doing_licence_registration_ajax = false;
1899
- }
1900
- } );
1901
-
1902
- } );
1903
-
1904
- // clears the debug log
1905
- $( '.clear-log' ).click( function() {
1906
- $( '.ajax-spinner, .ajax-success-msg' ).remove();
1907
- $( this ).after( ajax_spinner );
1908
- $( '.debug-log-textarea' ).val( '' );
1909
- $.ajax( {
1910
- url: ajaxurl,
1911
- type: 'POST',
1912
- dataType: 'text',
1913
- cache: false,
1914
- data: {
1915
- action: 'wpmdb_clear_log',
1916
- nonce: wpmdb_data.nonces.clear_log
1917
- },
1918
- error: function( jqXHR, textStatus, errorThrown ) {
1919
- $( '.ajax-spinner' ).remove();
1920
- alert( wpmdb_strings.clear_log_problem );
1921
- },
1922
- success: function( data ) {
1923
- $( '.ajax-spinner, .ajax-success-msg' ).remove();
1924
- refresh_debug_log();
1925
- $( '.clear-log' ).after( '<span class="ajax-success-msg">' + wpmdb_strings.clear_error_log + '</span>' );
1926
- $( '.ajax-success-msg' ).fadeOut( 2000, function() {
1927
- $( this ).remove();
1928
- } );
1929
- }
1930
- } );
1931
- } );
1932
-
1933
- // updates the debug log when the user switches to the help tab
1934
- function refresh_debug_log() {
1935
- $.ajax( {
1936
- url: ajaxurl,
1937
- type: 'POST',
1938
- dataType: 'text',
1939
- cache: false,
1940
- data: {
1941
- action: 'wpmdb_get_log',
1942
- nonce: wpmdb_data.nonces.get_log
1943
- },
1944
- error: function( jqXHR, textStatus, errorThrown ) {
1945
- alert( wpmdb_strings.update_log_problem );
1946
- },
1947
- success: function( data ) {
1948
- $( '.debug-log-textarea' ).val( data );
1949
- }
1950
- } );
1951
- }
1952
-
1953
- // select all tables
1954
- $( '.multiselect-select-all' ).click( function() {
1955
- var multiselect = $( this ).parents( '.select-wrap' ).children( '.multiselect' );
1956
- $( 'option', multiselect ).prop( 'selected', 1 );
1957
- $( multiselect ).focus().trigger( 'change' );
1958
- } );
1959
-
1960
- // deselect all tables
1961
- $( '.multiselect-deselect-all' ).click( function() {
1962
- var multiselect = $( this ).parents( '.select-wrap' ).children( '.multiselect' );
1963
- $( 'option', multiselect ).removeAttr( 'selected' );
1964
- $( multiselect ).focus().trigger( 'change' );
1965
- } );
1966
-
1967
- // invert table selection
1968
- $( '.multiselect-invert-selection' ).click( function() {
1969
- var multiselect = $( this ).parents( '.select-wrap' ).children( '.multiselect' );
1970
- $( 'option', multiselect ).each( function() {
1971
- $( this ).attr( 'selected', !$( this ).attr( 'selected' ) );
1972
- } );
1973
- $( multiselect ).focus().trigger( 'change' );
1974
- } );
1975
-
1976
- // on option select hide all "advanced" option divs and show the correct div for the option selected
1977
- $( '.option-group input[type=radio]' ).change( function() {
1978
- var group = $( this ).closest( '.option-group' );
1979
- $( 'ul', group ).hide();
1980
- var parent = $( this ).closest( 'li' );
1981
- $( 'ul', parent ).show();
1982
- } );
1983
-
1984
- // on page load, expand hidden divs for selected options (browser form cache)
1985
- $( '.option-group' ).each( function() {
1986
- $( '.option-group input[type=radio]' ).each( function() {
1987
- if ( $( this ).is( ':checked' ) ) {
1988
- var parent = $( this ).closest( 'li' );
1989
- $( 'ul', parent ).show();
1990
- }
1991
- } );
1992
- } );
1993
-
1994
- // expand and collapse content on click
1995
- $( '.header-expand-collapse' ).click( function() {
1996
- var target = null;
1997
-
1998
- if ( undefined !== $( this ).data( 'next' ) ) {
1999
- target = $( this ).data( 'next' );
2000
- }
2001
-
2002
- if ( $( '.expand-collapse-arrow', this ).hasClass( 'collapsed' ) ) {
2003
- $( '.expand-collapse-arrow', this ).removeClass( 'collapsed' );
2004
- if ( target ) {
2005
- $( target ).show();
2006
- } else {
2007
- $( this ).next().show();
2008
- }
2009
- } else {
2010
- $( '.expand-collapse-arrow', this ).addClass( 'collapsed' );
2011
- if ( target ) {
2012
- $( target ).hide();
2013
- } else {
2014
- $( this ).next().hide();
2015
- }
2016
- }
2017
- } );
2018
-
2019
- $( '.checkbox-label input[type=checkbox]' ).change( function() {
2020
- if ( $( this ).is( ':checked' ) ) {
2021
- $( this ).parent().next().show();
2022
- } else {
2023
- $( this ).parent().next().hide();
2024
- }
2025
- } );
2026
-
2027
- // warning for excluding post types
2028
- $( '.select-post-types-wrap' ).on( 'change', '#select-post-types', function() {
2029
- wpmdb.functions.exclude_post_types_warning();
2030
- } );
2031
-
2032
- wpmdb.functions.exclude_post_types_warning = function() {
2033
- var excluded_post_types = $( '#select-post-types' ).val();
2034
- var excluded_post_types_text = '';
2035
- var $exclude_post_types_warning = $( '.exclude-post-types-warning' );
2036
-
2037
- if ( excluded_post_types ) {
2038
- excluded_post_types_text = '<code>' + excluded_post_types.join( '</code>, <code>' ) + '</code>';
2039
- $( '.excluded-post-types' ).html( excluded_post_types_text );
2040
-
2041
- if ( '0' === $exclude_post_types_warning.css( 'opacity' ) ) {
2042
- $exclude_post_types_warning
2043
- .css( { opacity: 0 } )
2044
- .slideDown( 200 )
2045
- .animate( { opacity: 1 } );
2046
- }
2047
- } else {
2048
- $exclude_post_types_warning
2049
- .css( { opacity: 0 } )
2050
- .slideUp( 200 )
2051
- .animate( { opacity: 0 } );
2052
- }
2053
- };
2054
-
2055
- if ( $( '#exclude-post-types' ).is( ':checked' ) ) {
2056
- if ( $( '#select-post-types' ).val() ) {
2057
- $( '.exclude-post-types-warning' ).css( { display: 'block', opacity: 1 } );
2058
- }
2059
- }
2060
-
2061
- // special expand and collapse content on click for save migration profile
2062
- $( '#save-migration-profile' ).change( function() {
2063
- wpmdb.functions.update_migrate_button_text();
2064
- if ( $( this ).is( ':checked' ) ) {
2065
- $( '.save-settings-button' ).show();
2066
- } else {
2067
- $( '.save-settings-button' ).hide();
2068
- }
2069
- } );
2070
-
2071
- if ( $( '#save-migration-profile' ).is( ':checked' ) ) {
2072
- $( '.save-settings-button' ).show();
2073
- }
2074
-
2075
- $( '.create-new-profile' ).focus( function() {
2076
- $( '#create_new' ).prop( 'checked', true );
2077
- } );
2078
-
2079
- $( '.checkbox-label input[type=checkbox]' ).each( function() {
2080
- if ( $( this ).is( ':checked' ) ) {
2081
- $( this ).parent().next().show();
2082
- }
2083
- } );
2084
-
2085
- // AJAX migrate button
2086
- $( '.migrate-db-button' ).click( function( event ) {
2087
- $( this ).blur();
2088
- event.preventDefault();
2089
- wpmdb.migration_state_id = '';
2090
-
2091
- if ( false === $.wpmdb.apply_filters( 'wpmdb_migration_profile_ready', true ) ) {
2092
- return;
2093
- }
2094
-
2095
- if ( true === wpmdb.functions.maybe_show_select_table_notice() ) {
2096
- return;
2097
- }
2098
-
2099
- var new_url_missing = false;
2100
- var new_file_path_missing = false;
2101
- if ( $( '#new-url' ).length && !$( '#new-url' ).val() ) {
2102
- $( '#new-url-missing-warning' ).show();
2103
- $( '#new-url' ).focus();
2104
- $( 'html,body' ).scrollTop( 0 );
2105
- new_url_missing = true;
2106
- }
2107
-
2108
- if ( $( '#new-path' ).length && !$( '#new-path' ).val() ) {
2109
- $( '#new-path-missing-warning' ).show();
2110
- if ( false === new_url_missing ) {
2111
- $( '#new-path' ).focus();
2112
- $( 'html,body' ).scrollTop( 0 );
2113
- }
2114
- new_file_path_missing = true;
2115
- }
2116
-
2117
- if ( true === new_url_missing || true === new_file_path_missing ) {
2118
- if ( 'import' === wpmdb_migration_type() ) {
2119
- if ( $( '#import-find-replace' ).is( ':checked' ) ) {
2120
- return;
2121
- }
2122
- } else {
2123
- return;
2124
- }
2125
- }
2126
-
2127
- // also save profile
2128
- if ( $( '#save-migration-profile' ).is( ':checked' ) ) {
2129
- save_active_profile();
2130
- }
2131
-
2132
- form_data = $( $( '#migrate-form' )[0].elements ).not( '.auth-credentials' ).serialize();
2133
-
2134
- migration_intent = wpmdb_migration_type();
2135
-
2136
- stage = 'backup';
2137
-
2138
- if ( 'savefile' === migration_intent ) {
2139
- stage = 'migrate';
2140
- }
2141
-
2142
- if ( false === $( '#create-backup' ).is( ':checked' ) ) {
2143
- if ( -1 !== $.inArray( migration_intent, [ 'savefile', 'push', 'pull' ] ) ) {
2144
- stage = 'migrate';
2145
- } else if ( 'import' === migration_intent ) {
2146
- stage = 'upload';
2147
- } else {
2148
- stage = migration_intent;
2149
- }
2150
- }
2151
-
2152
- wpmdb.current_migration = wpmdb.migration_progress_controller.newMigration( {
2153
- 'localTableSizes': wpmdb_data.this_table_sizes,
2154
- 'localTableRows': wpmdb_data.this_table_rows,
2155
- 'remoteTableSizes': 'undefined' !== typeof wpmdb.common.connection_data ? wpmdb.common.connection_data.table_sizes : null,
2156
- 'remoteTableRows': 'undefined' !== typeof wpmdb.common.connection_data ? wpmdb.common.connection_data.table_rows : null,
2157
- 'migrationIntent': wpmdb_migration_type()
2158
- } );
2159
-
2160
- var backup_option = $( 'input[name=backup_option]:checked' ).val();
2161
- var table_option = $( 'input[name=table_migrate_option]:checked' ).val();
2162
- var selected_tables = '';
2163
- var data_type = '';
2164
-
2165
- // set up backup stage
2166
- if ( 'backup' === stage ) {
2167
- if ( 'migrate_only_with_prefix' === table_option && 'backup_selected' === backup_option && 'import' !== migration_intent ) {
2168
- backup_option = 'backup_only_with_prefix';
2169
- }
2170
- if ( 'push' === migration_intent ) {
2171
- data_type = 'remote';
2172
- if ( 'backup_only_with_prefix' === backup_option ) {
2173
- tables_to_migrate = wpmdb.common.connection_data.prefixed_tables;
2174
- } else if ( 'backup_selected' === backup_option ) {
2175
- selected_tables = $( '#select-tables' ).val();
2176
- selected_tables = $.wpmdb.apply_filters( 'wpmdb_backup_selected_tables', selected_tables );
2177
- tables_to_migrate = get_intersect( selected_tables, wpmdb.common.connection_data.tables );
2178
- } else if ( 'backup_manual_select' === backup_option ) {
2179
- tables_to_migrate = $( '#select-backup' ).val();
2180
- }
2181
- } else {
2182
- data_type = 'local';
2183
- if ( 'backup_only_with_prefix' === backup_option ) {
2184
- tables_to_migrate = wpmdb_data.this_prefixed_tables;
2185
- } else if ( 'backup_selected' === backup_option ) {
2186
- selected_tables = $( '#select-tables' ).val();
2187
- selected_tables = $.wpmdb.apply_filters( 'wpmdb_backup_selected_tables', selected_tables );
2188
- tables_to_migrate = get_intersect( selected_tables, wpmdb_data.this_tables );
2189
- } else if ( 'backup_manual_select' === backup_option ) {
2190
- tables_to_migrate = $( '#select-backup' ).val();
2191
- }
2192
- }
2193
-
2194
- wpmdb.current_migration.model.addStage( 'backup', tables_to_migrate, data_type, {
2195
- strings: {
2196
- migrated: wpmdb_strings.backed_up
2197
- }
2198
- } );
2199
- }
2200
-
2201
- // set up migration stage
2202
- if ( 'pull' === migration_intent ) {
2203
- data_type = 'remote';
2204
- } else {
2205
- data_type = 'local';
2206
- }
2207
-
2208
- if ( 'find_replace' === migration_intent ) {
2209
- wpmdb.current_migration.model.addStage( 'find_replace', wpmdb.functions.get_tables_to_migrate( null, null ), data_type, {
2210
- strings: {
2211
- migrated: wpmdb_strings.searched,
2212
- stage_title: wpmdb_strings.migrate_button_find_replace
2213
- }
2214
- } );
2215
- } else if ( -1 !== $.inArray( migration_intent, [ 'savefile', 'push', 'pull' ] ) ) {
2216
- wpmdb.current_migration.model.addStage( 'migrate', wpmdb.functions.get_tables_to_migrate( null, null ), data_type );
2217
- }
2218
-
2219
- // add any additional migration stages via hook
2220
- $.wpmdb.do_action( 'wpmdb_add_migration_stages', {
2221
- 'data_type': data_type,
2222
- 'tables_to_migrate': wpmdb.functions.get_tables_to_migrate( null, null )
2223
- } );
2224
-
2225
- var table_intent = $( 'input[name=table_migrate_option]:checked' ).val();
2226
- var connection_info = $.trim( $( '.pull-push-connection-info' ).val() ).split( '\n' );
2227
- var table_rows = '';
2228
-
2229
- remote_site = connection_info[ 0 ];
2230
- secret_key = connection_info[ 1 ];
2231
-
2232
- var static_migration_label = get_migration_status_label( remote_site, migration_intent, 'migrating' );
2233
- completed_msg = get_migration_status_label( remote_site, migration_intent, 'completed' );
2234
-
2235
- if ( -1 !== $.inArray( stage, [ 'find_replace', 'backup', 'migrate' ] ) ) {
2236
- tables_to_migrate = wpmdb.current_migration.model.getStageItems( stage, 'name' );
2237
- }
2238
-
2239
- wpmdb.current_migration.model.setActiveStage( stage );
2240
-
2241
- wpmdb.current_migration.setTitle( static_migration_label );
2242
-
2243
- wpmdb.current_migration.startTimer();
2244
-
2245
- currently_migrating = true;
2246
- wpmdb.current_migration.setStatus( 'active' );
2247
-
2248
- var request_data = {
2249
- action: 'wpmdb_initiate_migration',
2250
- intent: migration_intent,
2251
- url: remote_site,
2252
- key: secret_key,
2253
- form_data: form_data,
2254
- stage: stage,
2255
- nonce: wpmdb_data.nonces.initiate_migration
2256
- };
2257
-
2258
- request_data.site_details = {
2259
- local: wpmdb_data.site_details
2260
- };
2261
-
2262
- if ( -1 !== $.inArray( migration_intent, [ 'push', 'pull' ] ) ) {
2263
- request_data.temp_prefix = wpmdb.common.connection_data.temp_prefix;
2264
- request_data.site_details.remote = wpmdb.common.connection_data.site_details;
2265
- }
2266
-
2267
- // site_details can have a very large number of elements that blows out PHP's max_input_vars
2268
- // so we reduce it down to one variable for this one POST.
2269
- request_data.site_details = JSON.stringify( request_data.site_details );
2270
-
2271
- request_data = $.wpmdb.apply_filters( 'wpmdb_initiate_migration_request_data', request_data, request_data );
2272
-
2273
- doing_ajax = true;
2274
-
2275
- $.ajax( {
2276
- url: ajaxurl,
2277
- type: 'POST',
2278
- dataType: 'json',
2279
- cache: false,
2280
- data: request_data,
2281
- error: function( jqXHR, textStatus, errorThrown ) {
2282
-
2283
- wpmdb.current_migration.setState( wpmdb_strings.migration_failed, get_ajax_errors( jqXHR.responseText, '(#112)', jqXHR ), 'error' );
2284
-
2285
- console.log( jqXHR );
2286
- console.log( textStatus );
2287
- console.log( errorThrown );
2288
- doing_ajax = false;
2289
- wpmdb.common.migration_error = true;
2290
- wpmdb.functions.migration_complete_events();
2291
- return;
2292
- },
2293
- success: function( data ) {
2294
- doing_ajax = false;
2295
- if ( 'undefined' !== typeof data && 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error ) {
2296
- wpmdb.common.migration_error = true;
2297
- wpmdb.functions.migration_complete_events();
2298
- wpmdb.current_migration.setState( wpmdb_strings.migration_failed, data.body, 'error' );
2299
-
2300
- return;
2301
- }
2302
-
2303
- wpmdb.migration_state_id = data.migration_state_id;
2304
-
2305
- var i = 0;
2306
-
2307
- // Set delay between requests - use max of local/remote values, 0 if doing export
2308
- delay_between_requests = 0;
2309
- if ( 'savefile' !== migration_intent && 'undefined' !== typeof wpmdb.common.connection_data && 'undefined' !== typeof wpmdb.common.connection_data.delay_between_requests || 'import' === migration_intent ) {
2310
- if ( 'import' === migration_intent ) {
2311
- delay_between_requests = wpmdb_data.delay_between_requests;
2312
- } else {
2313
- delay_between_requests = Math.max( parseInt( wpmdb_data.delay_between_requests ), parseInt( wpmdb.common.connection_data.delay_between_requests ) );
2314
- }
2315
- }
2316
-
2317
- wpmdb.functions.migrate_table_recursive = function( current_row, primary_keys ) {
2318
-
2319
- if ( i >= tables_to_migrate.length ) {
2320
-
2321
- if ( 'upload' === stage && wpmdb.current_migration.model.getStageItems( 'find_replace' ).length ) {
2322
- stage = 'find_replace';
2323
- tables_to_migrate = wpmdb.current_migration.model.getStageItems( 'find_replace', 'name' );
2324
- tables_to_migrate = tables_to_migrate.map( function( table ) {
2325
- return '_mig_' + table;
2326
- } );
2327
- i = 0;
2328
- } else if ( 'backup' === stage ) {
2329
-
2330
- if ( -1 !== $.inArray( migration_intent, [ 'push', 'pull' ] ) ) {
2331
- stage = 'migrate';
2332
- } else if ( 'import' === migration_intent ) {
2333
- stage = 'upload';
2334
- } else {
2335
- stage = migration_intent;
2336
- }
2337
-
2338
- wpmdb.current_migration.model.setActiveStage( stage );
2339
-
2340
- if ( 'find_replace' !== stage && 'migrate' !== stage ) {
2341
- wpmdb_call_next_hook();
2342
- return;
2343
- }
2344
-
2345
- i = 0;
2346
-
2347
- // should get from model
2348
- tables_to_migrate = wpmdb.functions.get_tables_to_migrate( null, null );
2349
-
2350
- } else {
2351
- $( '.progress-label' ).removeClass( 'label-visible' );
2352
-
2353
- wpmdb.common.hooks = $.wpmdb.apply_filters( 'wpmdb_before_migration_complete_hooks', wpmdb.common.hooks );
2354
- wpmdb.common.hooks.push( wpmdb.functions.migration_complete );
2355
- wpmdb.common.hooks.push( wpmdb.functions.wpmdb_flush );
2356
- wpmdb.common.hooks = $.wpmdb.apply_filters( 'wpmdb_after_migration_complete_hooks', wpmdb.common.hooks );
2357
- wpmdb.common.hooks.push( wpmdb.functions.migration_complete_events );
2358
- wpmdb.common.next_step_in_migration = { fn: wpmdb_call_next_hook };
2359
- wpmdb.functions.execute_next_step();
2360
- return;
2361
- }
2362
- }
2363
-
2364
- var last_table = 0;
2365
- if ( i === ( tables_to_migrate.length - 1 ) ) {
2366
- last_table = 1;
2367
- }
2368
-
2369
- var gzip = 0;
2370
- if ( -1 !== $.inArray( migration_intent, [ 'push', 'pull' ] ) && 1 === parseInt( wpmdb.common.connection_data.gzip ) ) {
2371
- gzip = 1;
2372
- }
2373
-
2374
- var request_data = {
2375
- action: 'wpmdb_migrate_table',
2376
- migration_state_id: wpmdb.migration_state_id,
2377
- table: tables_to_migrate[ i ],
2378
- stage: stage,
2379
- current_row: current_row,
2380
- last_table: last_table,
2381
- primary_keys: primary_keys,
2382
- gzip: gzip,
2383
- nonce: wpmdb_data.nonces.migrate_table
2384
- };
2385
-
2386
- if ( -1 !== $.inArray( migration_intent, [ 'push', 'pull' ] ) ) {
2387
- request_data.bottleneck = wpmdb.common.connection_data.bottleneck;
2388
- request_data.prefix = wpmdb.common.connection_data.prefix;
2389
- }
2390
-
2391
- if ( wpmdb.common.connection_data && wpmdb.common.connection_data.path_current_site && wpmdb.common.connection_data.domain ) {
2392
- request_data.path_current_site = wpmdb.common.connection_data.path_current_site;
2393
- request_data.domain_current_site = wpmdb.common.connection_data.domain;
2394
- }
2395
-
2396
- doing_ajax = true;
2397
-
2398
- $.ajax( {
2399
- url: ajaxurl,
2400
- type: 'POST',
2401
- dataType: 'text',
2402
- cache: false,
2403
- timeout: 0,
2404
- data: request_data,
2405
- error: function( jqXHR, textStatus, errorThrown ) {
2406
- var progress_text = wpmdb_strings.table_process_problem + ' ' + tables_to_migrate[ i ] + '<br /><br />' + wpmdb_strings.status + ': ' + jqXHR.status + ' ' + jqXHR.statusText + '<br /><br />' + wpmdb_strings.response + ':<br />' + jqXHR.responseText;
2407
- wpmdb.current_migration.setState( wpmdb_strings.migration_failed, progress_text, 'error' );
2408
-
2409
- doing_ajax = false;
2410
- console.log( jqXHR );
2411
- console.log( textStatus );
2412
- console.log( errorThrown );
2413
- wpmdb.common.migration_error = true;
2414
- wpmdb.functions.migration_complete_events();
2415
- return;
2416
- },
2417
- success: function( data ) {
2418
- doing_ajax = false;
2419
- data = $.trim( data );
2420
- var row_information = wpmdb_parse_json( data );
2421
- var error_text = '';
2422
-
2423
- if ( false === row_information || null === row_information ) {
2424
-
2425
- // should update model
2426
- if ( '' === data || null === data ) {
2427
- error_text = wpmdb_strings.table_process_problem_empty_response + ' ' + tables_to_migrate[ i ];
2428
- } else {
2429
- error_text = get_ajax_errors( data, null, null );
2430
- }
2431
-
2432
- wpmdb.current_migration.setState( wpmdb_strings.migration_failed, error_text, 'error' );
2433
- wpmdb.common.migration_error = true;
2434
- wpmdb.functions.migration_complete_events();
2435
- return;
2436
- }
2437
-
2438
- if ( 'undefined' !== typeof row_information.wpmdb_error && 1 === row_information.wpmdb_error ) {
2439
- wpmdb.current_migration.setState( wpmdb_strings.migration_failed, row_information.body, 'error' );
2440
- wpmdb.common.migration_error = true;
2441
- wpmdb.functions.migration_complete_events();
2442
- return;
2443
- }
2444
-
2445
- var item_name = tables_to_migrate[ i ];
2446
- if ( 'import' === migration_intent && 'find_replace' === stage ) {
2447
- item_name = item_name.replace( wpmdb_data.this_temp_prefix, '' );
2448
- }
2449
-
2450
- //successful iteration, update model
2451
- wpmdb.current_migration.setText();
2452
- wpmdb.current_migration.model.getStageModel( stage ).setItemRowsTransferred( item_name, row_information.current_row );
2453
-
2454
- // We need the returned file name for delivery or display to the user.
2455
- if ( 1 === last_table && 'savefile' === migration_intent ) {
2456
- if ( 'undefined' !== typeof row_information.dump_filename ) {
2457
- dump_filename = row_information.dump_filename;
2458
- }
2459
- if ( 'undefined' !== typeof row_information.dump_path ) {
2460
- dump_path = row_information.dump_path;
2461
- }
2462
- }
2463
-
2464
- if ( -1 === parseInt( row_information.current_row ) ) {
2465
- i++;
2466
- row_information.current_row = '';
2467
- row_information.primary_keys = '';
2468
- }
2469
-
2470
- wpmdb.common.next_step_in_migration = {
2471
- fn: wpmdb.functions.migrate_table_recursive,
2472
- args: [ row_information.current_row, row_information.primary_keys ]
2473
- };
2474
- wpmdb.functions.execute_next_step();
2475
- }
2476
- } );
2477
-
2478
- };
2479
-
2480
- if ( -1 !== $.inArray( migration_intent, [ 'savefile', 'push', 'pull', 'find_replace' ] ) ) {
2481
- wpmdb.common.next_step_in_migration = {
2482
- fn: wpmdb.functions.migrate_table_recursive,
2483
- args: [ '-1', '' ]
2484
- };
2485
- wpmdb.functions.execute_next_step();
2486
- }
2487
-
2488
- $.wpmdb.do_action( 'wpmdb_migration_initiated', stage );
2489
- }
2490
-
2491
- } ); // end ajax
2492
-
2493
- } );
2494
-
2495
- wpmdb.functions.migration_complete_events = function() {
2496
- if ( false === wpmdb.common.migration_error ) {
2497
- if ( '' === wpmdb.common.non_fatal_errors ) {
2498
- if ( 'savefile' !== migration_intent && true === $( '#save_computer' ).is( ':checked' ) ) {
2499
- wpmdb.current_migration.setText();
2500
- }
2501
-
2502
- completed_msg = completed_msg + '&nbsp;<div class="dashicons dashicons-yes"></div>';
2503
-
2504
- if ( true === migration_cancelled ) {
2505
- var cancel_success = wpmdb_strings.migration_cancelled_success;
2506
-
2507
- if ( 'find_replace' === migration_intent ) {
2508
- cancel_success = wpmdb_strings.find_replace_cancelled_success;
2509
- }
2510
-
2511
- wpmdb.current_migration.setState( completed_msg, cancel_success, 'cancelled' );
2512
- } else {
2513
- wpmdb.current_migration.setState( completed_msg, '', 'complete' );
2514
- }
2515
-
2516
- } else {
2517
- wpmdb.current_migration.setState( wpmdb_strings.completed_with_some_errors, wpmdb.common.non_fatal_errors, 'error' );
2518
- }
2519
- }
2520
-
2521
- $( '.migration-controls' ).addClass( 'hidden' );
2522
-
2523
- // reset migration variables so consecutive migrations work correctly
2524
- wpmdb.common.hooks = [];
2525
- wpmdb.common.call_stack = [];
2526
- wpmdb.common.migration_error = false;
2527
- currently_migrating = false;
2528
- migration_completed = true;
2529
- migration_paused = false;
2530
- migration_cancelled = false;
2531
- doing_ajax = false;
2532
- wpmdb.common.non_fatal_errors = '';
2533
- tables_to_migrate = [];
2534
-
2535
- $( '.progress-label' ).remove();
2536
- $( '.migration-progress-ajax-spinner' ).remove();
2537
- $( '.close-progress-content' ).show();
2538
- $( '#overlay' ).css( 'cursor', 'pointer' );
2539
- wpmdb.current_migration.model.setMigrationComplete();
2540
- };
2541
-
2542
- wpmdb.functions.migration_complete = function() {
2543
-
2544
- $( '.migration-controls' ).addClass( 'hidden' );
2545
-
2546
- if ( 'savefile' === migration_intent ) {
2547
- currently_migrating = false;
2548
- var migrate_complete_text = wpmdb_strings.migration_complete;
2549
- if ( $( '#save_computer' ).is( ':checked' ) ) {
2550
- var url = wpmdb_data.this_download_url + encodeURIComponent( dump_filename );
2551
- if ( $( '#gzip_file' ).is( ':checked' ) ) {
2552
- url += '&gzip=1';
2553
- }
2554
- window.location = url;
2555
- } else {
2556
- migrate_complete_text = wpmdb_strings.completed_dump_located_at + ' ' + dump_path;
2557
- }
2558
-
2559
- if ( false === wpmdb.common.migration_error ) {
2560
-
2561
- wpmdb.functions.migration_complete_events();
2562
- wpmdb.current_migration.setState( completed_msg, migrate_complete_text, 'complete' );
2563
-
2564
- }
2565
-
2566
- } else { // rename temp tables, delete old tables
2567
-
2568
- wpmdb.current_migration.setState( null, wpmdb_strings.finalizing_migration, 'finalizing' );
2569
-
2570
- var request_data = {
2571
- action: 'wpmdb_finalize_migration',
2572
- migration_state_id: wpmdb.migration_state_id,
2573
- tables: tables_to_migrate.join( ',' ),
2574
- nonce: wpmdb_data.nonces.finalize_migration
2575
- };
2576
-
2577
- if ( -1 !== $.inArray( migration_intent, [ 'push', 'pull' ] ) ) {
2578
- request_data.prefix = wpmdb.common.connection_data.prefix;
2579
- }
2580
-
2581
- doing_ajax = true;
2582
- $.ajax( {
2583
- url: ajaxurl,
2584
- type: 'POST',
2585
- dataType: 'text',
2586
- cache: false,
2587
- data: request_data,
2588
- error: function( jqXHR, textStatus, errorThrown ) {
2589
- doing_ajax = false;
2590
- wpmdb.current_migration.setState( wpmdb_strings.migration_failed, wpmdb_strings.finalize_tables_problem, 'error' );
2591
-
2592
- alert( jqXHR + ' : ' + textStatus + ' : ' + errorThrown );
2593
- wpmdb.common.migration_error = true;
2594
- wpmdb.functions.migration_complete_events();
2595
- return;
2596
- },
2597
- success: function( data ) {
2598
- doing_ajax = false;
2599
- if ( '1' !== $.trim( data ) ) {
2600
- wpmdb.current_migration.setState( wpmdb_strings.migration_failed, data, 'error' );
2601
-
2602
- wpmdb.common.migration_error = true;
2603
- wpmdb.functions.migration_complete_events();
2604
- return;
2605
- }
2606
- wpmdb.common.next_step_in_migration = { fn: wpmdb_call_next_hook };
2607
- wpmdb.functions.execute_next_step();
2608
- }
2609
- } );
2610
- }
2611
- };
2612
-
2613
- wpmdb.functions.wpmdb_flush = function() {
2614
- if ( 'savefile' !== migration_intent ) {
2615
- wpmdb.current_migration.setText( wpmdb_strings.flushing );
2616
- doing_ajax = true;
2617
- $.ajax( {
2618
- url: ajaxurl,
2619
- type: 'POST',
2620
- dataType: 'text',
2621
- cache: false,
2622
- data: {
2623
- action: 'wpmdb_flush',
2624
- migration_state_id: wpmdb.migration_state_id,
2625
- nonce: wpmdb_data.nonces.flush
2626
- },
2627
- error: function( jqXHR, textStatus, errorThrown ) {
2628
- doing_ajax = false;
2629
- wpmdb.current_migration.setState( wpmdb_strings.migration_failed, wpmdb_strings.flush_problem, 'error' );
2630
-
2631
- alert( jqXHR + ' : ' + textStatus + ' : ' + errorThrown );
2632
- wpmdb.common.migration_error = true;
2633
- wpmdb.functions.migration_complete_events();
2634
- return;
2635
- },
2636
- success: function( data ) {
2637
- doing_ajax = false;
2638
- if ( '1' !== $.trim( data ) ) {
2639
- wpmdb.current_migration.setState( wpmdb_strings.migration_failed, data, 'error' );
2640
-
2641
- wpmdb.common.migration_error = true;
2642
- wpmdb.functions.migration_complete_events();
2643
- return;
2644
- }
2645
- wpmdb.common.next_step_in_migration = { fn: wpmdb_call_next_hook };
2646
- wpmdb.functions.execute_next_step();
2647
- }
2648
- } );
2649
- }
2650
- };
2651
-
2652
- wpmdb.functions.update_migrate_button_text = function() {
2653
- var migration_intent = wpmdb_migration_type();
2654
- var save_string = ( $( '#save-migration-profile' ).is( ':checked' ) ) ? '_save' : '';
2655
- var migrate_string = 'migrate_button_' + ( ( 'savefile' === migration_intent ) ? 'export' : migration_intent ) + save_string;
2656
- $( '.migrate-db .button-primary' ).val( wpmdb_strings[ migrate_string ] );
2657
- };
2658
-
2659
- wpmdb.functions.update_migrate_button_text();
2660
-
2661
- // close progress pop up once migration is completed
2662
- $( 'body' ).on( 'click', '.close-progress-content-button', function( e ) {
2663
- hide_overlay();
2664
- wpmdb.current_migration.restoreTitleElem();
2665
- wpmdb.functions.maybe_reload_page();
2666
- } );
2667
-
2668
- $( 'body' ).on( 'click', '#overlay', function( e ) {
2669
- if ( true === migration_completed && e.target === this ) {
2670
- hide_overlay();
2671
- wpmdb.current_migration.restoreTitleElem();
2672
- wpmdb.functions.maybe_reload_page();
2673
- }
2674
- } );
2675
-
2676
- function hide_overlay() {
2677
- $( '#overlay' ).removeClass( 'show' ).addClass( 'hide' );
2678
- $( '#overlay > div' ).removeClass( 'show' ).addClass( 'hide' );
2679
- wpmdb.current_migration.$proVersion.find( 'iframe' ).remove();
2680
- setTimeout( function() {
2681
- $( '#overlay' ).remove();
2682
- }, 500 );
2683
- migration_completed = false;
2684
- }
2685
-
2686
- // AJAX save button profile
2687
- $( '.save-settings-button' ).click( function( event ) {
2688
- event.preventDefault();
2689
- if ( '' === $.trim( $( '.create-new-profile' ).val() ) && $( '#create_new' ).is( ':checked' ) ) {
2690
- alert( wpmdb_strings.enter_name_for_profile );
2691
- $( '.create-new-profile' ).focus();
2692
- return;
2693
- }
2694
- save_active_profile();
2695
- } );
2696
-
2697
- function save_active_profile() {
2698
- var profile;
2699
- $( '.save-settings-button' ).blur();
2700
-
2701
- if ( doing_save_profile ) {
2702
- return;
2703
- }
2704
-
2705
- if ( true === wpmdb.functions.maybe_show_select_table_notice() ) {
2706
- return;
2707
- }
2708
-
2709
- var create_new_profile = false;
2710
-
2711
- if ( $( '#create_new' ).is( ':checked' ) ) {
2712
- create_new_profile = true;
2713
- }
2714
- var profile_name = $( '.create-new-profile' ).val();
2715
-
2716
- doing_save_profile = true;
2717
- profile = $( $( '#migrate-form' )[0].elements ).not( '.auth-credentials' ).serialize();
2718
-
2719
- $( '.save-settings-button' ).attr( 'disabled', 'disabled' )
2720
- .after( '<img src="' + spinner_url + '" alt="" class="save-profile-ajax-spinner general-spinner" />' );
2721
-
2722
- doing_ajax = true;
2723
-
2724
- $.ajax( {
2725
- url: ajaxurl,
2726
- type: 'POST',
2727
- dataType: 'text',
2728
- cache: false,
2729
- data: {
2730
- action: 'wpmdb_save_profile',
2731
- profile: profile,
2732
- nonce: wpmdb_data.nonces.save_profile
2733
- },
2734
- error: function( jqXHR, textStatus, errorThrown ) {
2735
- doing_ajax = false;
2736
- alert( wpmdb_strings.save_profile_problem );
2737
- $( '.save-settings-button' ).removeAttr( 'disabled' );
2738
- $( '.save-profile-ajax-spinner' ).remove();
2739
- $( '.save-settings-button' ).after( '<span class="ajax-success-msg">' + wpmdb_strings.saved + '</span>' );
2740
- $( '.ajax-success-msg' ).fadeOut( 2000, function() {
2741
- $( this ).remove();
2742
- } );
2743
- doing_save_profile = false;
2744
- },
2745
- success: function( data ) {
2746
- var updated_profile_id = parseInt( $( '#migrate-form input[name=save_migration_profile_option]:checked' ).val(), 10 ) + 1;
2747
- doing_ajax = false;
2748
- $( '.save-settings-button' ).removeAttr( 'disabled' );
2749
- $( '.save-profile-ajax-spinner' ).remove();
2750
- $( '.save-settings-button' ).after( '<span class="ajax-success-msg">' + wpmdb_strings.saved + '</span>' );
2751
- $( '.ajax-success-msg' ).fadeOut( 2000, function() {
2752
- $( this ).remove();
2753
- } );
2754
- doing_save_profile = false;
2755
- $( '.create-new-profile' ).val( '' );
2756
-
2757
- if ( create_new_profile ) {
2758
- var new_profile_key = parseInt( data, 10 );
2759
- var new_profile_id = new_profile_key + 1;
2760
- var new_li = $( '<li><span class="delete-profile" data-profile-id="' + new_profile_id + '"></span><label for="profile-' + new_profile_id + '"><input id="profile-' + new_profile_id + '" value="' + new_profile_key + '" name="save_migration_profile_option" type="radio"></label></li>' );
2761
- new_li.find( 'label' ).append( document.createTextNode( ' ' + profile_name ) );
2762
- updated_profile_id = new_profile_id;
2763
-
2764
- $( '#create_new' ).parents( 'li' ).before( new_li );
2765
- $( '#profile-' + new_profile_id ).attr( 'checked', 'checked' );
2766
- }
2767
-
2768
- // Push updated profile id to history if available
2769
- var updated_url = window.location.href.replace( '#migrate', '' ).replace( /&wpmdb-profile=-?\d+/, '' ) + '&wpmdb-profile=' + updated_profile_id;
2770
- var updated_profile_name = $( '#migrate-form input[name=save_migration_profile_option]:checked' ).parent().text().trim();
2771
-
2772
- if ( 'function' === typeof window.history.pushState ) {
2773
- if ( $( '#migrate-form .crumbs' ).length ) {
2774
- $( '#migrate-form .crumbs .crumb:last' ).text( updated_profile_name );
2775
- } else {
2776
- var $crumbs = $( '<div class="crumbs" />' )
2777
- .append( '<a class="crumb" href="' + wpmdb_data.this_plugin_base + '"> Saved Profiles </a>' )
2778
- .append( '<span class="crumb">' + updated_profile_name + '</span>' );
2779
- $( '#migrate-form' ).prepend( $crumbs );
2780
- }
2781
- window.history.pushState( { updated_profile_id: updated_profile_id }, null, updated_url );
2782
- }
2783
- }
2784
- } );
2785
- }
2786
-
2787
- // save file (export) / push / pull special conditions
2788
- function move_connection_info_box() {
2789
- $( '.connection-status' ).hide();
2790
- $( '.prefix-notice' ).hide();
2791
- $( '.ssl-notice' ).hide();
2792
- $( '.different-plugin-version-notice' ).hide();
2793
- $( '.step-two' ).show();
2794
- $( '.backup-options' ).show();
2795
- $( '.keep-active-plugins' ).show();
2796
- $( '.directory-permission-notice' ).hide();
2797
- $( '#create-backup' ).removeAttr( 'disabled' );
2798
- $( '#create-backup-label' ).removeClass( 'disabled' );
2799
- $( '.backup-option-disabled' ).hide();
2800
- $( '.compatibility-older-mysql' ).hide();
2801
- var connection_info = $.trim( $( '.pull-push-connection-info' ).val() ).split( '\n' );
2802
- var profile_name;
2803
- wpmdb_toggle_migration_action_text();
2804
-
2805
- $.wpmdb.do_action( 'move_connection_info_box', {
2806
- 'migration_type': wpmdb_migration_type(),
2807
- 'last_migration_type': last_replace_switch
2808
- } );
2809
-
2810
- $( '.migrate-tab' ).attr( 'class', 'migrate-tab content-tab' ).addClass( wpmdb_migration_type() );
2811
-
2812
- if ( 'pull' === wpmdb_migration_type() ) {
2813
- $( '.pull-list li' ).append( $connection_info_box );
2814
- $connection_info_box.show( function() {
2815
- var connection_textarea = $( this ).find( '.pull-push-connection-info' );
2816
- if ( ! connection_textarea.val() ) {
2817
- connection_textarea.focus();
2818
- }
2819
- } );
2820
- if ( ( 'push' === wpmdb.migration_selection || 'savefile' === wpmdb.migration_selection ) && 2 === connection_info.length ) {
2821
- wpmdb.force_reconnect = true;
2822
- $( '.pull-list li' ).append( $connection_info_box );
2823
- $( '.pull-push-connection-info' ).removeClass( 'temp-disabled' ).attr( 'readonly', 'readonly' );
2824
- $( '.connect-button' ).hide();
2825
- wpmdb.functions.connection_box_changed();
2826
- return;
2827
- }
2828
- if ( connection_established ) {
2829
- $( '.connection-status' ).hide();
2830
- $( '.step-two' ).show();
2831
- $( '.table-prefix' ).html( wpmdb.common.connection_data.prefix );
2832
- $( '.backup-table-prefix' ).html( wpmdb_data.site_details.prefix );
2833
- $( '.uploads-dir' ).html( wpmdb_data.this_uploads_dir );
2834
- if ( false === profile_name_edited ) {
2835
- profile_name = get_domain_name( wpmdb.common.connection_data.url );
2836
- $( '.create-new-profile' ).val( profile_name );
2837
- }
2838
- if ( true === show_prefix_notice ) {
2839
- $( '.prefix-notice' ).show();
2840
- }
2841
- if ( true === show_ssl_notice ) {
2842
- $( '.ssl-notice' ).show();
2843
- }
2844
- if ( true === show_version_notice ) {
2845
- $( '.different-plugin-version-notice' ).show();
2846
- $( '.step-two' ).hide();
2847
- }
2848
- wpmdb_toggle_migration_action_text();
2849
- if ( 'false' === wpmdb_data.write_permission ) {
2850
- show_backup_disabled_msg( wpmdb_data.this_upload_dir_long );
2851
- }
2852
- } else {
2853
- $( '.connection-status' ).show();
2854
- $( '.step-two' ).hide();
2855
- }
2856
- } else if ( 'push' === wpmdb_migration_type() ) {
2857
- $( '.push-list li' ).append( $connection_info_box );
2858
- $connection_info_box.show( function() {
2859
- var connection_textarea = $( this ).find( '.pull-push-connection-info' );
2860
- if ( ! connection_textarea.val() ) {
2861
- connection_textarea.focus();
2862
- }
2863
- } );
2864
- if ( ( 'pull' === wpmdb.migration_selection || 'savefile' === wpmdb.migration_selection ) && 2 === connection_info.length ) {
2865
- wpmdb.force_reconnect = true;
2866
- $( '.push-list li' ).append( $connection_info_box );
2867
- $( '.pull-push-connection-info' ).removeClass( 'temp-disabled' ).attr( 'readonly', 'readonly' );
2868
- $( '.connect-button' ).hide();
2869
- wpmdb.functions.connection_box_changed();
2870
- return;
2871
- }
2872
- if ( connection_established ) {
2873
- $( '.connection-status' ).hide();
2874
- $( '.step-two' ).show();
2875
- $( '.table-prefix' ).html( wpmdb_data.this_prefix );
2876
- $( '.backup-table-prefix' ).html( wpmdb.common.connection_data.prefix );
2877
- $( '.uploads-dir' ).html( wpmdb.common.connection_data.uploads_dir );
2878
- if ( false === profile_name_edited ) {
2879
- profile_name = get_domain_name( wpmdb.common.connection_data.url );
2880
- $( '.create-new-profile' ).val( profile_name );
2881
- }
2882
- if ( true === show_prefix_notice ) {
2883
- $( '.prefix-notice' ).show();
2884
- }
2885
- if ( true === show_ssl_notice ) {
2886
- $( '.ssl-notice' ).show();
2887
- }
2888
- if ( true === show_version_notice ) {
2889
- $( '.different-plugin-version-notice' ).show();
2890
- $( '.step-two' ).hide();
2891
- }
2892
- wpmdb_toggle_migration_action_text();
2893
- if ( '0' === wpmdb.common.connection_data.write_permissions ) {
2894
- show_backup_disabled_msg( wpmdb.common.connection_data.upload_dir_long );
2895
- }
2896
- } else {
2897
- $( '.connection-status' ).show();
2898
- $( '.step-two' ).hide();
2899
- }
2900
- } else if ( -1 !== $.inArray( wpmdb_migration_type(), [ 'savefile', 'find_replace', 'import' ] ) ) {
2901
- $( '.connection-status' ).hide();
2902
- $( '.table-prefix' ).html( wpmdb_data.this_prefix );
2903
- if ( false === profile_name_edited ) {
2904
- $( '.create-new-profile' ).val( '' );
2905
- }
2906
-
2907
- if ( 'import' !== wpmdb_migration_type() ) {
2908
- $( '.step-two' ).show();
2909
- $.wpmdb.do_action( 'wpmdb_update_push_table_select' );
2910
- } else {
2911
- $.wpmdb.do_action( 'wpmdb_update_import_table_select' );
2912
- }
2913
-
2914
- if ( 'savefile' === wpmdb_migration_type() ) {
2915
- $( '.backup-options' ).hide();
2916
- $( '.compatibility-older-mysql' ).show();
2917
- }
2918
-
2919
- $( '.keep-active-plugins' ).hide();
2920
- if ( false === wpmdb_data.write_permission ) {
2921
- $( '.directory-permission-notice' ).show();
2922
- $( '.step-two' ).hide();
2923
- }
2924
-
2925
- if ( 'find_replace' === wpmdb_migration_type() || 'import' === wpmdb_migration_type() ) {
2926
- if ( 'true' === wpmdb_data.is_multisite ) {
2927
- var $old_replace_col = $( '.old-replace-col' ).eq( 1 );
2928
- $old_replace_col.parent().removeClass( 'pin' ).find( '.replace-remove-row' ).show();
2929
- $old_replace_col.find( 'input' ).removeAttr( 'readonly' );
2930
- }
2931
-
2932
- if ( 'false' === wpmdb_data.write_permission ) {
2933
- show_backup_disabled_msg( wpmdb_data.this_upload_dir_long );
2934
- }
2935
- }
2936
-
2937
- }
2938
-
2939
- maybe_show_mixed_cased_table_name_warning();
2940
- }
2941
-
2942
- function show_backup_disabled_msg( upload_dir ) {
2943
- $( '#create-backup' ).prop( 'checked', false );
2944
- $( '#create-backup' ).attr( 'disabled', 'disabled' );
2945
- $( '#create-backup-label' ).addClass( 'disabled' );
2946
- $( '.backup-option-disabled' ).show();
2947
- $( '.upload-directory-location' ).html( upload_dir );
2948
- }
2949
-
2950
- // move around textarea depending on whether or not the push/pull options are selected
2951
- var $connection_info_box = $( '.connection-info-wrapper' );
2952
- move_connection_info_box();
2953
-
2954
- $( '.migrate-selection.option-group input[type=radio]' ).change( function() {
2955
- move_connection_info_box();
2956
- wpmdb.migration_selection = wpmdb_migration_type();
2957
- if ( connection_established ) {
2958
- change_replace_values();
2959
- }
2960
- wpmdb.functions.update_migrate_button_text();
2961
- } );
2962
-
2963
- function change_replace_values() {
2964
- var old_url = null;
2965
- var old_path = null;
2966
- if ( null !== wpmdb.common.previous_connection_data && 'object' === typeof wpmdb.common.previous_connection_data && wpmdb.common.previous_connection_data.url !== wpmdb.common.connection_data.url ) {
2967
- old_url = wpmdb.functions.remove_protocol( wpmdb.common.previous_connection_data.url );
2968
- old_path = wpmdb.common.previous_connection_data.path;
2969
- }
2970
-
2971
- if ( 'push' === wpmdb_migration_type() || 'savefile' === wpmdb_migration_type() ) {
2972
- if ( 'pull' === last_replace_switch ) {
2973
- $( '.replace-row' ).each( function() {
2974
- var old_val = $( '.old-replace-col input', this ).val();
2975
- $( '.old-replace-col input', this ).val( $( '.replace-right-col input', this ).val() );
2976
- $( '.replace-right-col input', this ).val( old_val );
2977
- } );
2978
- } else if ( 'push' === last_replace_switch && 'push' === wpmdb_migration_type() && null !== old_url && null !== old_path ) {
2979
- $( '.replace-row' ).each( function() {
2980
- var old_val = $( '.replace-right-col input', this ).val();
2981
- if ( old_val === old_path ) {
2982
- $( '.replace-right-col input', this ).val( wpmdb.common.connection_data.path );
2983
- }
2984
- if ( old_val === old_url ) {
2985
- $( '.replace-right-col input', this ).val( wpmdb.functions.remove_protocol( wpmdb.common.connection_data.url ) );
2986
- }
2987
- } );
2988
- }
2989
- $.wpmdb.do_action( 'wpmdb_update_push_table_select' );
2990
- $( '#select-post-types' ).remove();
2991
- $( '.exclude-post-types-warning' ).after( $push_post_type_select );
2992
- wpmdb.functions.exclude_post_types_warning();
2993
- $( '#select-backup' ).remove();
2994
- $( '.backup-tables-wrap' ).prepend( $push_select_backup );
2995
- } else if ( 'pull' === wpmdb_migration_type() ) {
2996
- if ( '' === last_replace_switch || 'push' === last_replace_switch || 'savefile' === last_replace_switch ) {
2997
- $( '.replace-row' ).each( function() {
2998
- var old_val = $( '.old-replace-col input', this ).val();
2999
- $( '.old-replace-col input', this ).val( $( '.replace-right-col input', this ).val() );
3000
- $( '.replace-right-col input', this ).val( old_val );
3001
- } );
3002
- } else if ( 'pull' === last_replace_switch && 'pull' === wpmdb_migration_type() && null !== old_url && null !== old_path ) {
3003
- $( '.replace-row' ).each( function() {
3004
- var old_val = $( '.old-replace-col input', this ).val();
3005
- if ( old_val === old_path ) {
3006
- $( '.old-replace-col input', this ).val( wpmdb.common.connection_data.path );
3007
- }
3008
- if ( old_val === old_url ) {
3009
- $( '.old-replace-col input', this ).val( wpmdb.functions.remove_protocol( wpmdb.common.connection_data.url ) );
3010
- }
3011
- } );
3012
- }
3013
- $.wpmdb.do_action( 'wpmdb_update_pull_table_select' );
3014
- $( '#select-post-types' ).remove();
3015
- $( '.exclude-post-types-warning' ).after( $pull_post_type_select );
3016
- wpmdb.functions.exclude_post_types_warning();
3017
- $( '#select-backup' ).remove();
3018
- $( '.backup-tables-wrap' ).prepend( $pull_select_backup );
3019
- }
3020
- last_replace_switch = wpmdb_migration_type();
3021
- }
3022
-
3023
- // hide second section if pull or push is selected with no connection established
3024
- if ( ( 'pull' === wpmdb_migration_type() || 'push' === wpmdb_migration_type() ) && ! connection_established ) {
3025
- $( '.step-two' ).hide();
3026
- $( '.connection-status' ).show();
3027
- }
3028
-
3029
- // show / hide GUID helper description
3030
- $( '.general-helper' ).click( function( e ) {
3031
- e.preventDefault();
3032
- var icon = $( this ),
3033
- bubble = $( this ).next();
3034
-
3035
- // Close any that are already open
3036
- $( '.helper-message' ).not( bubble ).hide();
3037
-
3038
- var position = icon.position();
3039
- if ( bubble.hasClass( 'bottom' ) ) {
3040
- var bubble_offset = 1;
3041
-
3042
- if ( true === bubble.hasClass( 'compatibility-help' ) ) {
3043
- bubble_offset = 6;
3044
- } else if ( $( this ).is( ':first-child' ) ) {
3045
- bubble_offset = 3;
3046
- }
3047
- bubble.css( {
3048
- 'left': ( ( position.left - bubble.width() / 2 ) - bubble_offset ) + 'px',
3049
- 'top': ( position.top + icon.height() + 9 ) + 'px'
3050
- } );
3051
- } else {
3052
- bubble.css( {
3053
- 'left': ( position.left + icon.width() + 9 ) + 'px',
3054
- 'top': ( position.top + icon.height() / 2 - 18 ) + 'px'
3055
- } );
3056
- }
3057
- bubble.toggle();
3058
- e.stopPropagation();
3059
- } );
3060
-
3061
- $( 'body' ).click( function() {
3062
- $( '.helper-message' ).hide();
3063
- } );
3064
-
3065
- $( '.helper-message' ).click( function( e ) {
3066
- e.stopPropagation();
3067
- } );
3068
-
3069
- $( 'body' ).on( 'click', '.show-errors-toggle', function( e ) {
3070
- e.preventDefault();
3071
- $( this ).next( '.migration-php-errors' ).toggle();
3072
- } );
3073
-
3074
- /**
3075
- * Core plugin wrapper for the common AJAX error detecting method
3076
- *
3077
- * @param text
3078
- * @param code
3079
- * @param jqXHR
3080
- *
3081
- * @returns {string}
3082
- */
3083
- function get_ajax_errors( text, code, jqXHR ) {
3084
- return wpmdbGetAjaxErrors( wpmdb_strings.connection_local_server_problem, code, text, jqXHR );
3085
- }
3086
-
3087
- // migrate / settings tabs
3088
- $( '.nav-tab' ).click( function() {
3089
- var hash = $( this ).attr( 'data-div-name' );
3090
- hash = hash.replace( '-tab', '' );
3091
- window.location.hash = hash;
3092
- switch_to_plugin_tab( hash, false );
3093
- } );
3094
-
3095
- $( 'body' ).on( 'click', 'a[href^="#"]', function( event ) {
3096
- var href = $( event.target ).attr( 'href' );
3097
- var tab_name = href.substr( 1 );
3098
-
3099
- if ( tab_name ) {
3100
- var nav_tab = $( '.' + tab_name );
3101
- if ( 1 === nav_tab.length ) {
3102
- nav_tab.trigger( 'click' );
3103
- event.preventDefault();
3104
- }
3105
- }
3106
- } );
3107
-
3108
- // repeatable fields
3109
- $( 'body' ).on( 'click', '.add-row', function() {
3110
- var $parent_tr = $( this ).parents( 'tr' );
3111
- $parent_tr.before( $( '.original-repeatable-field' ).clone().removeClass( 'original-repeatable-field' ) );
3112
- $parent_tr.prev().find( '.old-replace-col input' ).focus();
3113
- } );
3114
-
3115
- // repeatable fields
3116
- $( 'body' ).on( 'click', '.replace-remove-row', function() {
3117
- $( this ).parents( 'tr' ).remove();
3118
- if ( 2 >= $( '.replace-row' ).length ) {
3119
- $( '.no-replaces-message' ).show();
3120
- }
3121
-
3122
- var prev_id = $( this ).prev().attr( 'id' );
3123
- if ( 'new-url' === prev_id || 'new-path' === prev_id ) {
3124
- $( '#' + prev_id + '-missing-warning' ).hide();
3125
- }
3126
- } );
3127
-
3128
- // Hide New URL & New Path Warnings on change.
3129
- $( 'body' )
3130
- .on( 'change', '#new-url', function() {
3131
- $( '#new-url-missing-warning' ).hide();
3132
- } )
3133
- .on( 'change', '#new-path', function() {
3134
- $( '#new-path-missing-warning' ).hide();
3135
- } );
3136
-
3137
- // Copy Find field to associated Replace field on arrow click.
3138
- $( 'body' ).on( 'click', '.arrow-col', function() {
3139
- var replace_row_arrow = this;
3140
-
3141
- if ( $( replace_row_arrow ).hasClass( 'disabled' ) ) {
3142
- return;
3143
- }
3144
-
3145
- var original_value = $( replace_row_arrow ).prev( 'td' ).find( 'input' ).val();
3146
- var new_value_input = $( replace_row_arrow ).next( 'td' ).find( 'input' );
3147
- new_value_input.val( original_value );
3148
-
3149
- // Hide New URL or New Path Warning if changed.
3150
- if ( 'new-url' === new_value_input.prop( 'id' ) ) {
3151
- $( '#new-url-missing-warning' ).hide();
3152
- } else if ( 'new-path' === new_value_input.prop( 'id' ) ) {
3153
- $( '#new-path-missing-warning' ).hide();
3154
- }
3155
- } );
3156
-
3157
- $( '.add-replace' ).click( function() {
3158
- $( '.replace-fields' ).prepend( $( '.original-repeatable-field' ).clone().removeClass( 'original-repeatable-field' ) );
3159
- $( '.no-replaces-message' ).hide();
3160
- } );
3161
-
3162
- $( '#find-and-replace-sort tbody' ).sortable( {
3163
- items: '> tr:not(.pin)',
3164
- handle: 'td:first',
3165
- start: function() {
3166
- $( '.sort-handle' ).css( 'cursor', '-webkit-grabbing' );
3167
- $( '.sort-handle' ).css( 'cursor', '-moz-grabbing' );
3168
- },
3169
- stop: function() {
3170
- $( '.sort-handle' ).css( 'cursor', '-webkit-grab' );
3171
- $( '.sort-handle' ).css( 'cursor', '-moz-grab' );
3172
- }
3173
- } );
3174
-
3175
- function validate_url( url ) {
3176
- return /^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)){0})(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test( url );
3177
- }
3178
-
3179
- function switch_to_plugin_tab( hash, skip_addons_check ) {
3180
- $( '.nav-tab' ).removeClass( 'nav-tab-active' );
3181
- $( '.nav-tab.' + hash ).addClass( 'nav-tab-active' );
3182
- $( '.content-tab' ).hide();
3183
- $( '.' + hash + '-tab' ).show();
3184
-
3185
- if ( 'settings' === hash ) {
3186
- if ( true === should_check_licence() ) {
3187
- $( 'p.licence-status' ).append( 'Checking License... ' ).append( ajax_spinner );
3188
- check_licence();
3189
- }
3190
- }
3191
-
3192
- if ( 'help' === hash ) {
3193
- refresh_debug_log();
3194
- if ( true === should_check_licence() ) {
3195
- $( '.support-content p' ).append( ajax_spinner );
3196
- check_licence();
3197
- }
3198
- }
3199
-
3200
- if ( 'addons' === hash && true !== skip_addons_check ) {
3201
- if ( true === should_check_licence() ) {
3202
- $( '.addons-content p' ).append( ajax_spinner );
3203
- check_licence();
3204
- }
3205
- }
3206
- }
3207
-
3208
- function should_check_licence() {
3209
- if ( false === checked_licence && '1' === wpmdb_data.has_licence && 'true' === wpmdb_data.is_pro ) {
3210
- return true;
3211
- }
3212
- return false;
3213
- }
3214
-
3215
- var hash = '';
3216
-
3217
- // check for hash in url (settings || migrate) switch tabs accordingly
3218
- if ( window.location.hash ) {
3219
- hash = window.location.hash.substring( 1 );
3220
- switch_to_plugin_tab( hash, false );
3221
- }
3222
-
3223
- if ( '' !== get_query_var( 'install-plugin' ) ) {
3224
- hash = 'addons';
3225
- checked_licence = true;
3226
- switch_to_plugin_tab( hash, true );
3227
- }
3228
-
3229
- // process notice links clicks, eg. dismiss, reminder
3230
- $( '.notice-link' ).click( function( e ) {
3231
- e.preventDefault();
3232
-
3233
- // process notice links clicks, eg. dismiss, reminder
3234
- wpmdb.functions.ajax_handle_dismissible_notice( wpmdb_data.nonces.process_notice_link, function( ele ) {
3235
- $( ele ).closest( '.inline-message' ).hide();
3236
- }, $( this ) );
3237
- } );
3238
-
3239
- // When read-only connection info is copied, convert it to one line
3240
- $( '#connection_info' ).on( 'copy', function( e ) {
3241
- var $this = $( this );
3242
-
3243
- // Test for two lines
3244
- var lines = $this.val().split( '\n' );
3245
- if ( 2 === lines.length ) {
3246
-
3247
- // Wrapping in a try in case there's no browser support
3248
- try {
3249
-
3250
- // Combine the two lines into one
3251
- e.originalEvent.clipboardData.setData( 'text/plain', lines.join( ' ' ) );
3252
- e.preventDefault(); // Default behaviour is to copy any selected text
3253
- }
3254
- catch ( err ) {
3255
-
3256
- // Do nothing. Allow normal copying
3257
- }
3258
- }
3259
- });
3260
-
3261
- // regenerates the saved secret key
3262
- $( '.reset-api-key' ).click( function() {
3263
- var answer = confirm( wpmdb_strings.reset_api_key );
3264
-
3265
- if ( ! answer || doing_reset_api_key_ajax ) {
3266
- return;
3267
- }
3268
-
3269
- doing_reset_api_key_ajax = true;
3270
- $( '.reset-api-key' ).after( '<img src="' + spinner_url + '" alt="" class="reset-api-key-ajax-spinner general-spinner" />' );
3271
-
3272
- $.ajax( {
3273
- url: ajaxurl,
3274
- type: 'POST',
3275
- dataType: 'text',
3276
- cache: false,
3277
- data: {
3278
- action: 'wpmdb_reset_api_key',
3279
- nonce: wpmdb_data.nonces.reset_api_key
3280
- },
3281
- error: function( jqXHR, textStatus, errorThrown ) {
3282
- alert( wpmdb_strings.reset_api_key_problem );
3283
- $( '.reset-api-key-ajax-spinner' ).remove();
3284
- doing_reset_api_key_ajax = false;
3285
- },
3286
- success: function( data ) {
3287
- $( '.reset-api-key-ajax-spinner' ).remove();
3288
- doing_reset_api_key_ajax = false;
3289
- $( '.connection-info' ).html( data );
3290
- wpmdb_data.connection_info = $.trim( data ).split( '\n' );
3291
- }
3292
- } );
3293
-
3294
- } );
3295
-
3296
- // Copy the connection info to the clipboard
3297
- $( '.copy-api-key' ).click( function() {
3298
-
3299
- var $el = $( this );
3300
-
3301
- // Get connection_info input
3302
- var $connection_info = $( '#connection_info' );
3303
-
3304
- // Get the connection info
3305
- var two_lines = $connection_info.val();
3306
-
3307
- // Make it one line, if it's two
3308
- var one_line = two_lines.replace( '\n', ' ' );
3309
-
3310
- // Replace two lines with one
3311
- $connection_info.val( one_line );
3312
-
3313
- // Select the input val
3314
- $connection_info.select();
3315
-
3316
- try {
3317
-
3318
- // Copy connection_info
3319
- document.execCommand( 'copy' );
3320
-
3321
- // Unselect connection_info input
3322
- $connection_info.blur();
3323
-
3324
- // show confirmation
3325
- $el.css( 'color', 'transparent' );
3326
- var $confirmation = $( '.copy-api-key-confirmation' ).show();
3327
-
3328
- // fadeout confirmation
3329
- setTimeout( function() {
3330
- $confirmation.fadeOut( 'fast' );
3331
- setTimeout( function() {
3332
- $el.css( 'color', '' );
3333
- }, 200 );
3334
-
3335
- }, 1000 );
3336
- }
3337
- catch ( err ) {
3338
- alert( 'please press Ctrl/Cmd+C to copy' );
3339
- }
3340
-
3341
- // Replace the input val with the two lines
3342
- $connection_info.val( two_lines );
3343
- } );
3344
-
3345
- $( 'input[name=table_migrate_option]' ).change( function() {
3346
- $( '.select-tables-wrap' ).hide();
3347
-
3348
- if ( 'migrate_select' === $( this ).val() ) {
3349
- $( '.select-tables-wrap' ).show();
3350
- }
3351
- } );
3352
-
3353
- $( '.show-multiselect' ).each( function() {
3354
- if ( $( this ).is( ':checked' ) ) {
3355
- $( this ).parents( '.option-section' ).children( '.header-expand-collapse' ).children( '.expand-collapse-arrow' ).removeClass( 'collapsed' );
3356
- $( this ).parents( '.expandable-content' ).show();
3357
- $( this ).parents( '.expandable-content' ).children( '.select-wrap' ).toggle();
3358
- }
3359
- } );
3360
-
3361
- $( 'input[name=backup_option]' ).change( function() {
3362
- $( '.backup-tables-wrap' ).hide();
3363
- if ( 'backup_manual_select' === $( this ).val() ) {
3364
- $( '.backup-tables-wrap' ).show();
3365
- }
3366
- } );
3367
-
3368
- if ( $( '#backup-manual-select' ).is( ':checked' ) ) {
3369
- $( '.backup-tables-wrap' ).show();
3370
- }
3371
-
3372
- $( '.plugin-compatibility-save' ).click( function() {
3373
- if ( doing_plugin_compatibility_ajax ) {
3374
- return;
3375
- }
3376
- $( this ).addClass( 'disabled' );
3377
- var select_element = $( '#selected-plugins' );
3378
- $( select_element ).attr( 'disabled', 'disabled' );
3379
-
3380
- $( '.plugin-compatibility-success-msg' ).remove();
3381
-
3382
- doing_plugin_compatibility_ajax = true;
3383
- $( this ).after( '<img src="' + spinner_url + '" alt="" class="plugin-compatibility-spinner general-spinner" />' );
3384
-
3385
- $.ajax( {
3386
- url: ajaxurl,
3387
- type: 'POST',
3388
- dataType: 'text',
3389
- cache: false,
3390
- data: {
3391
- action: 'wpmdb_whitelist_plugins',
3392
- whitelist_plugins: $( select_element ).val(),
3393
- nonce: wpmdb_data.nonces.whitelist_plugins
3394
- },
3395
- error: function( jqXHR, textStatus, errorThrown ) {
3396
- alert( wpmdb_strings.blacklist_problem + '\r\n\r\n' + wpmdb_strings.status + ' ' + jqXHR.status + ' ' + jqXHR.statusText + '\r\n\r\n' + wpmdb_strings.response + '\r\n' + jqXHR.responseText );
3397
- $( select_element ).removeAttr( 'disabled' );
3398
- $( '.plugin-compatibility-save' ).removeClass( 'disabled' );
3399
- doing_plugin_compatibility_ajax = false;
3400
- $( '.plugin-compatibility-spinner' ).remove();
3401
- },
3402
- success: function( data ) {
3403
- if ( '' !== $.trim( data ) ) {
3404
- alert( data );
3405
- }
3406
- $( select_element ).removeAttr( 'disabled' );
3407
- $( '.plugin-compatibility-save' ).removeClass( 'disabled' );
3408
- doing_plugin_compatibility_ajax = false;
3409
- $( '.plugin-compatibility-spinner' ).remove();
3410
- $( '.plugin-compatibility-save' ).after( '<span class="plugin-compatibility-success-msg">' + wpmdb_strings.saved + '</span>' );
3411
- $( '.plugin-compatibility-success-msg' ).fadeOut( 2000 );
3412
- }
3413
- } );
3414
- } );
3415
-
3416
- // delete a profile from the migrate form area
3417
- $( 'body' ).on( 'click', '.delete-profile', function() {
3418
- var name = $( this ).next().clone();
3419
- $( 'input', name ).remove();
3420
- name = $.trim( $( name ).html() );
3421
- var answer = confirm( wpmdb_strings.remove_profile.replace( '{{profile}}', name ) );
3422
-
3423
- if ( ! answer ) {
3424
- return;
3425
- }
3426
- var $profile_li = $( this ).parent();
3427
-
3428
- if ( $profile_li.find( 'input:checked' ).length ) {
3429
- var $new_profile_li = $profile_li.siblings().last();
3430
- $new_profile_li.find( 'input[type=radio]' ).prop( 'checked', 'checked' );
3431
- $new_profile_li.find( 'input[type=text]' ).focus();
3432
- $( '#migrate-form .crumbs .crumb:last' ).text( 'New Profile' );
3433
-
3434
- if ( 'function' === typeof window.history.pushState ) {
3435
- var updated_url = window.location.href.replace( '#migrate', '' ).replace( /&wpmdb-profile=-?\d+/, '' ) + '&wpmdb-profile=-1';
3436
- window.history.pushState( { updated_profile_id: -1 }, null, updated_url );
3437
- }
3438
- }
3439
-
3440
- $profile_li.fadeOut( 500 );
3441
-
3442
- $.ajax( {
3443
- url: ajaxurl,
3444
- type: 'POST',
3445
- dataType: 'text',
3446
- cache: false,
3447
- data: {
3448
- action: 'wpmdb_delete_migration_profile',
3449
- profile_id: $( this ).attr( 'data-profile-id' ),
3450
- nonce: wpmdb_data.nonces.delete_migration_profile
3451
- },
3452
- error: function( jqXHR, textStatus, errorThrown ) {
3453
- alert( wpmdb_strings.remove_profile_problem );
3454
- },
3455
- success: function( data ) {
3456
- if ( '-1' === data ) {
3457
- alert( wpmdb_strings.remove_profile_not_found );
3458
- }
3459
- }
3460
- } );
3461
-
3462
- } );
3463
-
3464
- // deletes a profile from the main profile selection screen
3465
- $( '.main-list-delete-profile-link' ).click( function() {
3466
- var name = $( this ).prev().html();
3467
- var answer = confirm( wpmdb_strings.remove_profile.replace( '{{profile}}', name ) );
3468
-
3469
- if ( ! answer ) {
3470
- return;
3471
- }
3472
-
3473
- $( this ).parent().fadeOut( 500 );
3474
-
3475
- $.ajax( {
3476
- url: ajaxurl,
3477
- type: 'POST',
3478
- dataType: 'text',
3479
- cache: false,
3480
- data: {
3481
- action: 'wpmdb_delete_migration_profile',
3482
- profile_id: $( this ).attr( 'data-profile-id' ),
3483
- nonce: wpmdb_data.nonces.delete_migration_profile
3484
- },
3485
- error: function( jqXHR, textStatus, errorThrown ) {
3486
- alert( wpmdb_strings.remove_profile_problem );
3487
- }
3488
- } );
3489
-
3490
- } );
3491
-
3492
- // warn the user when editing the connection info after a connection has been established
3493
- $( 'body' ).on( 'click', '.temp-disabled', function() {
3494
- var answer = confirm( wpmdb_strings.change_connection_info );
3495
-
3496
- if ( ! answer ) {
3497
- return;
3498
- } else {
3499
- $( '.ssl-notice' ).hide();
3500
- $( '.different-plugin-version-notice' ).hide();
3501
- $( '.migrate-db-button' ).show();
3502
- $( '.temp-disabled' ).removeAttr( 'readonly' );
3503
- $( '.temp-disabled' ).removeClass( 'temp-disabled' );
3504
- $( '.connect-button' ).show();
3505
- $( '.step-two' ).hide();
3506
- $( '.connection-status' ).show().html( wpmdb_strings.enter_connection_info );
3507
- connection_established = false;
3508
- }
3509
- } );
3510
-
3511
- // ajax request for settings page when checking/unchecking setting radio buttons
3512
- $( '.settings-tab input[type=checkbox]' ).change( function() {
3513
- if ( 'plugin-compatibility' === $( this ).attr( 'id' ) ) {
3514
- return;
3515
- }
3516
- var checked = $( this ).is( ':checked' );
3517
- var setting = $( this ).attr( 'id' );
3518
- var $status = $( this ).closest( 'td' ).next( 'td' ).find( '.setting-status' );
3519
-
3520
- $( '.ajax-success-msg' ).remove();
3521
- $status.after( ajax_spinner );
3522
-
3523
- $.ajax( {
3524
- url: ajaxurl,
3525
- type: 'POST',
3526
- dataType: 'text',
3527
- cache: false,
3528
- data: {
3529
- action: 'wpmdb_save_setting',
3530
- checked: checked,
3531
- setting: setting,
3532
- nonce: wpmdb_data.nonces.save_setting
3533
- },
3534
- error: function( jqXHR, textStatus, errorThrown ) {
3535
- alert( wpmdb_strings.save_settings_problem );
3536
- $( '.ajax-spinner' ).remove();
3537
- },
3538
- success: function( data ) {
3539
- $( '.ajax-spinner' ).remove();
3540
- $status.append( '<span class="ajax-success-msg">' + wpmdb_strings.saved + '</span>' );
3541
- $( '.ajax-success-msg' ).fadeOut( 2000, function() {
3542
- $( this ).remove();
3543
- } );
3544
- }
3545
- } );
3546
-
3547
- } );
3548
-
3549
- // disable form submissions
3550
- $( '.migrate-form' ).submit( function( e ) {
3551
- e.preventDefault();
3552
- } );
3553
-
3554
- // fire connection_box_changed when the connect button is pressed
3555
- $( '.connect-button' ).click( function( event ) {
3556
- event.preventDefault();
3557
- $( this ).blur();
3558
- wpmdb.functions.connection_box_changed();
3559
- } );
3560
-
3561
- // send paste even to connection_box_changed() function
3562
- $( '.pull-push-connection-info' ).bind( 'paste', function( e ) {
3563
- var $this = this;
3564
- setTimeout( function() {
3565
- wpmdb.functions.connection_box_changed();
3566
- }, 0 );
3567
-
3568
- } );
3569
-
3570
- $( 'body' ).on( 'click', '.try-again', function() {
3571
- $( '.pull-push-connection-info' ).removeClass( 'temp-disabled' );
3572
- wpmdb.functions.connection_box_changed();
3573
- } );
3574
-
3575
- $( 'body' ).on( 'click', '.try-http', function() {
3576
- var connection_info = $.trim( $( '.pull-push-connection-info' ).val() ).split( '\n' );
3577
- var new_url = connection_info[ 0 ].replace( 'https', 'http' );
3578
- var new_contents = new_url + '\n' + connection_info[ 1 ];
3579
- $( '.pull-push-connection-info' ).val( new_contents );
3580
- wpmdb.functions.connection_box_changed();
3581
- } );
3582
-
3583
- $( '.create-new-profile' ).change( function() {
3584
- profile_name_edited = true;
3585
- } );
3586
-
3587
- $( 'body' ).on( 'click', '.temporarily-disable-ssl', function() {
3588
- var hash = '';
3589
- if ( window.location.hash ) {
3590
- hash = window.location.hash.substring( 1 );
3591
- }
3592
- $( this ).attr( 'href', $( this ).attr( 'href' ) + '&hash=' + hash );
3593
- } );
3594
-
3595
- // fired when the connection info box changes (e.g. gets pasted into)
3596
- wpmdb.functions.connection_box_changed = function() {
3597
- var $this = $( '.pull-push-connection-info' );
3598
-
3599
- if ( -1 === $.inArray( wpmdb_migration_type(), [ 'push', 'pull' ] ) ||
3600
- ( doing_ajax || $( $this ).hasClass( 'temp-disabled' ) ) && false === wpmdb.force_reconnect ) {
3601
- return;
3602
- }
3603
-
3604
- wpmdb.force_reconnect = false;
3605
- var data = $( '.pull-push-connection-info' ).val();
3606
-
3607
- var connection_info = $.trim( data ).split( '\n' );
3608
- var error = false;
3609
- var error_message = '';
3610
-
3611
- if ( '' === connection_info ) {
3612
- error = true;
3613
- error_message = wpmdb_strings.connection_info_missing;
3614
- }
3615
-
3616
- // attempt to format the connection info from a single line
3617
- if ( 1 === connection_info.length && ! error ) {
3618
- var connection_words = $.trim( data ).split( ' ' );
3619
- if ( 2 === connection_words.length )
3620
- {
3621
- connection_info = connection_words;
3622
- }
3623
- }
3624
-
3625
- if ( 2 !== connection_info.length && ! error ) {
3626
- error = true;
3627
- error_message = wpmdb_strings.connection_info_incorrect;
3628
- }
3629
-
3630
- if ( ! error && ! validate_url( connection_info[ 0 ] ) ) {
3631
- error = true;
3632
- error_message = wpmdb_strings.connection_info_url_invalid;
3633
- }
3634
-
3635
- var key_length = 0;
3636
-
3637
- if ( 'undefined' !== typeof connection_info[ 1 ] ) {
3638
- key_length = connection_info[ 1 ].length;
3639
- }
3640
-
3641
- if ( ! error && 32 !== key_length && 40 !== key_length ) {
3642
- error = true;
3643
- error_message = wpmdb_strings.connection_info_key_invalid;
3644
- }
3645
-
3646
- if ( ! error && connection_info[ 0 ] === wpmdb_data.connection_info[ 0 ] ) {
3647
- error = true;
3648
- error_message = wpmdb_strings.connection_info_local_url;
3649
- }
3650
-
3651
- if ( ! error && connection_info[ 1 ] === wpmdb_data.connection_info[ 1 ] ) {
3652
- error = true;
3653
- error_message = wpmdb_strings.connection_info_local_key;
3654
- }
3655
- if ( error ) {
3656
- $( '.connection-status' ).html( error_message );
3657
- $( '.connection-status' ).addClass( 'notification-message error-notice migration-error' );
3658
- return;
3659
- }
3660
-
3661
- var new_connection_info_contents = connection_info[ 0 ] + '\n' + connection_info[ 1 ];
3662
-
3663
- // If connection info is a single line
3664
- if ( 1 === $.trim( data ).split( '\n' ).length ) {
3665
-
3666
- // Repopulate the input with the info on two lines
3667
- $( '.pull-push-connection-info' ).val( new_connection_info_contents );
3668
- }
3669
-
3670
- if ( false === wpmdb_data.openssl_available ) {
3671
- connection_info[ 0 ] = connection_info[ 0 ].replace( 'https://', 'http://' );
3672
- new_connection_info_contents = connection_info[ 0 ] + '\n' + connection_info[ 1 ];
3673
- $( '.pull-push-connection-info' ).val( new_connection_info_contents );
3674
- }
3675
-
3676
- show_prefix_notice = false;
3677
- doing_ajax = true;
3678
- disable_export_type_controls();
3679
-
3680
- if ( $( '.basic-access-auth-wrapper' ).is( ':visible' ) ) {
3681
- connection_info[ 0 ] = connection_info[ 0 ].replace( /\/\/(.*)@/, '//' );
3682
- connection_info[ 0 ] = connection_info[ 0 ].replace( '//', '//' + encodeURIComponent( $.trim( $( '.auth-username' ).val() ) ) + ':' + encodeURIComponent( $.trim( $( '.auth-password' ).val() ) ) + '@' );
3683
- new_connection_info_contents = connection_info[ 0 ] + '\n' + connection_info[ 1 ];
3684
- $( '.pull-push-connection-info' ).val( new_connection_info_contents );
3685
- $( '.basic-access-auth-wrapper' ).hide();
3686
- }
3687
-
3688
- $( '.step-two' ).hide();
3689
- $( '.ssl-notice' ).hide();
3690
- $( '.prefix-notice' ).hide();
3691
- $( '.connection-status' ).show();
3692
-
3693
- $( '.connection-status' ).html( wpmdb_strings.establishing_remote_connection );
3694
- $( '.connection-status' ).removeClass( 'notification-message error-notice migration-error' );
3695
- $( '.connection-status' ).append( ajax_spinner );
3696
-
3697
- var intent = wpmdb_migration_type();
3698
-
3699
- profile_name_edited = false;
3700
-
3701
- return $.ajax( {
3702
- url: ajaxurl,
3703
- type: 'POST',
3704
- dataType: 'json',
3705
- cache: false,
3706
- data: {
3707
- action: 'wpmdb_verify_connection_to_remote_site',
3708
- url: connection_info[ 0 ],
3709
- key: connection_info[ 1 ],
3710
- intent: intent,
3711
- nonce: wpmdb_data.nonces.verify_connection_to_remote_site
3712
- },
3713
- error: function( jqXHR, textStatus, errorThrown ) {
3714
- $( '.connection-status' ).html( get_ajax_errors( jqXHR.responseText, '(#100)', jqXHR ) );
3715
- $( '.connection-status' ).addClass( 'notification-message error-notice migration-error' );
3716
- $( '.ajax-spinner' ).remove();
3717
- doing_ajax = false;
3718
- enable_export_type_controls();
3719
- },
3720
- success: function( data ) {
3721
- $( '.ajax-spinner' ).remove();
3722
- doing_ajax = false;
3723
- enable_export_type_controls();
3724
-
3725
- if ( 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error ) {
3726
- $( '.connection-status' ).html( data.body );
3727
- $( '.connection-status' ).addClass( 'notification-message error-notice migration-error' );
3728
-
3729
- if ( data.body.indexOf( '401 Unauthorized' ) > -1 ) {
3730
- $( '.basic-access-auth-wrapper' ).show();
3731
- }
3732
-
3733
- if ( ! $( '.pull-push-connection-info' ).hasClass( 'temp-disabled' ) && ! $( '.connect-button' ).is( ':visible' ) ) {
3734
- $( '.pull-push-connection-info' ).removeAttr( 'readonly' );
3735
- $( '.connect-button' ).show();
3736
- }
3737
-
3738
- return;
3739
- }
3740
-
3741
- maybe_show_ssl_warning( connection_info[ 0 ], connection_info[ 1 ], data.scheme );
3742
-
3743
- var profile_name = get_domain_name( data.url );
3744
- $( '.create-new-profile' ).val( profile_name );
3745
-
3746
- $( '.pull-push-connection-info' ).addClass( 'temp-disabled' );
3747
- $( '.pull-push-connection-info' ).attr( 'readonly', 'readonly' );
3748
- $( '.connect-button' ).hide();
3749
-
3750
- $( '.connection-status' ).hide();
3751
- $( '.step-two' ).show();
3752
-
3753
- wpmdb.functions.maybe_show_prefix_notice( data.prefix );
3754
-
3755
- connection_established = true;
3756
- set_connection_data( data );
3757
- move_connection_info_box();
3758
- change_replace_values();
3759
-
3760
- maybe_show_mixed_cased_table_name_warning();
3761
-
3762
- refresh_table_selects();
3763
-
3764
- $push_select_backup = $( $pull_select ).clone();
3765
- $( $push_select_backup ).attr( {
3766
- name: 'select_backup[]',
3767
- id: 'select-backup'
3768
- } );
3769
-
3770
- var $post_type_select = document.createElement( 'select' );
3771
- $( $post_type_select ).attr( {
3772
- multiple: 'multiple',
3773
- name: 'select_post_types[]',
3774
- id: 'select-post-types',
3775
- class: 'multiselect'
3776
- } );
3777
-
3778
- $.each( wpmdb.common.connection_data.post_types, function( index, value ) {
3779
- $( $post_type_select ).append( '<option value="' + value + '">' + value + '</option>' );
3780
- } );
3781
-
3782
- $pull_post_type_select = $post_type_select;
3783
-
3784
- $( '#new-path-missing-warning, #new-url-missing-warning' ).hide();
3785
-
3786
- if ( 'pull' === wpmdb_migration_type() ) {
3787
- $( '#new-url' ).val( wpmdb.functions.remove_protocol( wpmdb_data.this_url ) );
3788
- $( '#new-path' ).val( wpmdb_data.this_path );
3789
- if ( 'true' === wpmdb_data.is_multisite ) {
3790
- $( '#new-domain' ).val( wpmdb_data.this_domain );
3791
- $( '.replace-row.pin .old-replace-col input[type="text"]' ).val( wpmdb.functions.remove_protocol( data.url ) );
3792
- }
3793
- $( '#old-url' ).val( wpmdb.functions.remove_protocol( data.url ) );
3794
- $( '#old-path' ).val( data.path );
3795
-
3796
- $.wpmdb.do_action( 'wpmdb_update_pull_table_select' );
3797
- $( '#select-post-types' ).remove();
3798
- $( '.exclude-post-types-warning' ).after( $pull_post_type_select );
3799
- wpmdb.functions.exclude_post_types_warning();
3800
- $( '.table-prefix' ).html( data.prefix );
3801
- $( '.backup-table-prefix' ).html( wpmdb_data.site_details.prefix );
3802
- $( '.uploads-dir' ).html( wpmdb_data.this_uploads_dir );
3803
- } else {
3804
- $( '#new-url' ).val( wpmdb.functions.remove_protocol( data.url ) );
3805
- $( '#new-path' ).val( data.path );
3806
-
3807
- if ( 'true' === wpmdb_data.is_multisite ) {
3808
- $( '.replace-row.pin .old-replace-col input[type="text"]' ).val( wpmdb.functions.remove_protocol( wpmdb_data.this_url ) );
3809
- }
3810
- $.wpmdb.do_action( 'wpmdb_update_push_table_select' );
3811
- $( '#select-backup' ).remove();
3812
- $( '.backup-tables-wrap' ).prepend( $push_select_backup );
3813
- }
3814
-
3815
- wpmdb.common.next_step_in_migration = {
3816
- fn: $.wpmdb.do_action,
3817
- args: [ 'verify_connection_to_remote_site', wpmdb.common.connection_data ]
3818
- };
3819
- wpmdb.functions.execute_next_step();
3820
- }
3821
-
3822
- } );
3823
-
3824
- };
3825
-
3826
- // Sets the initial Pause/Resume button event to Pause
3827
- $( 'body' ).on( 'click', '.pause-resume', function( event ) {
3828
- set_pause_resume_button( event );
3829
- } );
3830
-
3831
- function cancel_migration( event ) {
3832
- migration_cancelled = true;
3833
- cancelling_text = wpmdb_strings.cancelling_migration;
3834
- $( '.migration-controls' ).css( { visibility: 'hidden' } );
3835
-
3836
- if ( 'find_replace' === migration_intent ) {
3837
- cancelling_text = wpmdb_strings.cancelling_find_replace;
3838
- }
3839
-
3840
- wpmdb.current_migration.setState( cancelling_text, wpmdb_strings.completing_current_request, 'cancelling' );
3841
-
3842
- if ( true === migration_paused ) {
3843
- migration_paused = false;
3844
- wpmdb.functions.execute_next_step();
3845
- }
3846
- }
3847
-
3848
- $( 'body' ).on( 'click', '.cancel', function( event ) {
3849
- cancel_migration( event );
3850
- } );
3851
-
3852
- $( '.enter-licence' ).click( function() {
3853
- $( '.settings' ).click();
3854
- $( '.licence-input' ).focus();
3855
- } );
3856
-
3857
- wpmdb.functions.execute_next_step = function() {
3858
-
3859
- // if delay is set, set a timeout for delay to recall this function, then return
3860
- if ( 0 < delay_between_requests && false === flag_skip_delay ) {
3861
- setTimeout( function() {
3862
- flag_skip_delay = true;
3863
- wpmdb.functions.execute_next_step();
3864
- }, delay_between_requests );
3865
- return;
3866
- } else {
3867
- flag_skip_delay = false;
3868
- }
3869
-
3870
- if ( true === migration_paused ) {
3871
- $( '.migration-progress-ajax-spinner' ).hide();
3872
-
3873
- // Pause the timer
3874
- wpmdb.current_migration.pauseTimer();
3875
-
3876
- var pause_text = '';
3877
- if ( true === is_auto_pause_before_finalize ) {
3878
- pause_text = wpmdb_strings.paused_before_finalize;
3879
- is_auto_pause_before_finalize = false;
3880
-
3881
- if ( 'find_replace' === wpmdb_migration_type() ) {
3882
- pause_text = wpmdb_strings.find_replace_paused_before_finalize;
3883
- }
3884
- } else {
3885
- pause_text = wpmdb_strings.paused;
3886
- }
3887
-
3888
- wpmdb.current_migration.setState( null, pause_text, 'paused' );
3889
-
3890
- // Re-bind Pause/Resume button to Resume when we are finally Paused
3891
- $( 'body' ).on( 'click', '.pause-resume', function( event ) {
3892
- set_pause_resume_button( event );
3893
- } );
3894
- $( 'body' ).on( 'click', '.cancel', function( event ) {
3895
- cancel_migration( event );
3896
- } );
3897
- $( '.pause-resume' ).html( wpmdb_strings.resume );
3898
- return;
3899
- } else if ( true === migration_cancelled ) {
3900
- migration_intent = wpmdb_migration_type();
3901
-
3902
- var progress_msg;
3903
-
3904
- if ( 'savefile' === migration_intent ) {
3905
- progress_msg = wpmdb_strings.removing_local_sql;
3906
- } else if ( 'pull' === migration_intent ) {
3907
- if ( 'backup' === stage ) {
3908
- progress_msg = wpmdb_strings.removing_local_backup;
3909
- } else {
3910
- progress_msg = wpmdb_strings.removing_local_temp_tables;
3911
- }
3912
- } else if ( 'push' === migration_intent ) {
3913
- if ( 'backup' === stage ) {
3914
- progress_msg = wpmdb_strings.removing_remote_sql;
3915
- } else {
3916
- progress_msg = wpmdb_strings.removing_remote_temp_tables;
3917
- }
3918
- }
3919
- wpmdb.current_migration.setText( progress_msg );
3920
-
3921
- var request_data = {
3922
- action: 'wpmdb_cancel_migration',
3923
- migration_state_id: wpmdb.migration_state_id,
3924
- nonce: wpmdb_data.nonces.cancel_migration
3925
- };
3926
-
3927
- doing_ajax = true;
3928
-
3929
- $.ajax( {
3930
- url: ajaxurl,
3931
- type: 'POST',
3932
- dataType: 'text',
3933
- cache: false,
3934
- data: request_data,
3935
- error: function( jqXHR, textStatus, errorThrown ) {
3936
- wpmdb.current_migration.setState( wpmdb_strings.migration_cancellation_failed, wpmdb_strings.manually_remove_temp_files + '<br /><br />' + wpmdb_strings.status + ': ' + jqXHR.status + ' ' + jqXHR.statusText + '<br /><br />' + wpmdb_strings.response + ':<br />' + jqXHR.responseText, 'error' );
3937
- console.log( jqXHR );
3938
- console.log( textStatus );
3939
- console.log( errorThrown );
3940
- doing_ajax = false;
3941
- wpmdb.common.migration_error = true;
3942
- wpmdb.functions.migration_complete_events();
3943
- return;
3944
- },
3945
- success: function( data ) {
3946
- doing_ajax = false;
3947
- data = $.trim( data );
3948
-
3949
- if ( ( 'push' === migration_intent && '1' !== data ) || ( 'push' !== migration_intent && '' !== data ) ) {
3950
-
3951
- if ( 'undefined' !== typeof data && 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error ) {
3952
- data = data.wpmdb_error;
3953
- }
3954
-
3955
- wpmdb.current_migration.setState( wpmdb_strings.migration_cancellation_failed, data, 'error' );
3956
- wpmdb.common.migration_error = true;
3957
- wpmdb.functions.migration_complete_events();
3958
- return;
3959
- }
3960
-
3961
- completed_msg = wpmdb_strings.migration_cancelled;
3962
-
3963
- if ( 'find_replace' === migration_intent ) {
3964
- completed_msg = wpmdb_strings.find_replace_cancelled;
3965
- }
3966
-
3967
- wpmdb.functions.migration_complete_events();
3968
- wpmdb.current_migration.setStatus( 'cancelled' );
3969
- }
3970
- } );
3971
- } else {
3972
- wpmdb.common.next_step_in_migration.fn.apply( null, wpmdb.common.next_step_in_migration.args );
3973
- }
3974
- };
3975
-
3976
- $( 'body' ).on( 'click', '.copy-licence-to-remote-site', function() {
3977
- $( '.connection-status' ).html( wpmdb_strings.copying_license );
3978
- $( '.connection-status' ).removeClass( 'notification-message error-notice migration-error' );
3979
- $( '.connection-status' ).append( ajax_spinner );
3980
-
3981
- var connection_info = $.trim( $( '.pull-push-connection-info' ).val() ).split( '\n' );
3982
-
3983
- doing_ajax = true;
3984
- disable_export_type_controls();
3985
-
3986
- $.ajax( {
3987
- url: ajaxurl,
3988
- type: 'POST',
3989
- dataType: 'json',
3990
- cache: false,
3991
- data: {
3992
- action: 'wpmdb_copy_licence_to_remote_site',
3993
- url: connection_info[ 0 ],
3994
- key: connection_info[ 1 ],
3995
- nonce: wpmdb_data.nonces.copy_licence_to_remote_site
3996
- },
3997
- error: function( jqXHR, textStatus, errorThrown ) {
3998
- $( '.connection-status' ).html( get_ajax_errors( jqXHR.responseText, '(#143)', jqXHR ) );
3999
- $( '.connection-status' ).addClass( 'notification-message error-notice migration-error' );
4000
- $( '.ajax-spinner' ).remove();
4001
- doing_ajax = false;
4002
- enable_export_type_controls();
4003
- },
4004
- success: function( data ) {
4005
- $( '.ajax-spinner' ).remove();
4006
- doing_ajax = false;
4007
- enable_export_type_controls();
4008
-
4009
- if ( 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error ) {
4010
- $( '.connection-status' ).html( data.body );
4011
- $( '.connection-status' ).addClass( 'notification-message error-notice migration-error' );
4012
-
4013
- if ( data.body.indexOf( '401 Unauthorized' ) > -1 ) {
4014
- $( '.basic-access-auth-wrapper' ).show();
4015
- }
4016
-
4017
- return;
4018
- }
4019
- wpmdb.functions.connection_box_changed();
4020
- }
4021
- } );
4022
- } );
4023
-
4024
- $( 'body' ).on( 'click', '.reactivate-licence', function( e ) {
4025
- doing_ajax = true;
4026
-
4027
- $( '.invalid-licence' ).empty().html( wpmdb_strings.attempting_to_activate_licence );
4028
- $( '.invalid-licence' ).append( ajax_spinner );
4029
-
4030
- $.ajax( {
4031
- url: ajaxurl,
4032
- type: 'POST',
4033
- dataType: 'json',
4034
- cache: false,
4035
- data: {
4036
- action: 'wpmdb_reactivate_licence',
4037
- nonce: wpmdb_data.nonces.reactivate_licence
4038
- },
4039
- error: function( jqXHR, textStatus, errorThrown ) {
4040
- $( '.invalid-licence' ).html( wpmdb_strings.activate_licence_problem );
4041
- $( '.invalid-licence' ).append( '<br /><br />' + wpmdb_strings.status + ': ' + jqXHR.status + ' ' + jqXHR.statusText + '<br /><br />' + wpmdb_strings.response + '<br />' + jqXHR.responseText );
4042
- $( '.ajax-spinner' ).remove();
4043
- doing_ajax = false;
4044
- },
4045
- success: function( data ) {
4046
- $( '.ajax-spinner' ).remove();
4047
- doing_ajax = false;
4048
-
4049
- if ( 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error ) {
4050
- $( '.invalid-licence' ).html( data.body );
4051
- return;
4052
- }
4053
-
4054
- if ( 'undefined' !== typeof data.wpmdb_dbrains_api_down && 1 === data.wpmdb_dbrains_api_down ) {
4055
- $( '.invalid-licence' ).html( wpmdb_strings.temporarily_activated_licence );
4056
- $( '.invalid-licence' ).append( data.body );
4057
- return;
4058
- }
4059
-
4060
- $( '.invalid-licence' ).empty().html( wpmdb_strings.licence_reactivated );
4061
- location.reload();
4062
- }
4063
- } );
4064
-
4065
- } );
4066
-
4067
- $( 'input[name=table_migrate_option]' ).change( function() {
4068
- maybe_show_mixed_cased_table_name_warning();
4069
- $.wpmdb.do_action( 'wpmdb_tables_to_migrate_changed' );
4070
- } );
4071
-
4072
- $( 'body' ).on( 'change', '#select-tables', function() {
4073
- maybe_show_mixed_cased_table_name_warning();
4074
- $.wpmdb.do_action( 'wpmdb_tables_to_migrate_changed' );
4075
- } );
4076
-
4077
- $.wpmdb.add_filter( 'wpmdb_get_table_prefix', get_table_prefix );
4078
- $.wpmdb.add_filter( 'wpmdb_get_tables_to_migrate', wpmdb.functions.get_tables_to_migrate );
4079
- $.wpmdb.add_action( 'wpmdb_lock_replace_url', lock_replace_url );
4080
- $.wpmdb.add_action( 'move_connection_info_box', wpmdb.functions.exclude_post_types_warning );
4081
-
4082
- $.wpmdb.add_filter( 'wpmdb_before_migration_complete_hooks', function( hooks ) {
4083
- pause_before_finalize = $( 'input[name=pause_before_finalize]:checked' ).length ? true : false;
4084
- if ( true === pause_before_finalize && 'savefile' !== migration_intent ) {
4085
- set_pause_resume_button( null ); // don't just set migration_paused to true, since `set_pause_resume_button` will get double bound to clicking resume
4086
- is_auto_pause_before_finalize = true;
4087
- }
4088
- return hooks;
4089
- } );
4090
-
4091
- /**
4092
- * Set checkbox
4093
- *
4094
- * @param string checkbox_wrap
4095
- */
4096
- function set_checkbox( checkbox_wrap ) {
4097
- var $switch = $( '#' + checkbox_wrap );
4098
- var $checkbox = $switch.find( 'input[type=checkbox]' );
4099
-
4100
- $switch.toggleClass( 'on' ).find( 'span' ).toggleClass( 'checked' );
4101
- var switch_on = $switch.find( 'span.on' ).hasClass( 'checked' );
4102
- $checkbox.attr( 'checked', switch_on ).trigger( 'change' );
4103
- }
4104
-
4105
- $( '.wpmdb-switch' ).on( 'click', function( e ) {
4106
- if ( ! $( this ).hasClass( 'disabled' ) ) {
4107
- set_checkbox( $( this ).attr( 'id' ) );
4108
- }
4109
- } );
4110
-
4111
- } );
4112
-
4113
- })( jQuery, wpmdb );
4114
-
4115
- },{"MigrationProgress-controller":1}]},{},[1,2,3,4,5,6,7]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
asset/dist/js/script-101.min.js DELETED
@@ -1,3 +0,0 @@
1
- !function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){var d=jQuery,e=a("MigrationProgress-model"),f=a("MigrationProgress-view"),g=d('<div id="overlay" class="hide"></div>'),h=d(".progress-content").clone().addClass("hide"),i=d(".pro-version").addClass("hide");g.append(i);var j={migration:{model:{},view:{},$progress:{},$wrapper:{},$overlay:{},status:"active",title:"",text:"",timerCount:0,elapsedInterval:0,currentStageNum:0,counterDisplay:!1,originalTitle:document.title,setTitle:function(a){this.$progress.find(".progress-title").html(a),this.title=a},setStatus:function(a){this.$progress.removeClass(this.status).addClass("error"===a?"wpmdb-error":a),"error"===a&&this.$progress.find(".progress-text").addClass("migration-error"),this.status=a,this.updateTitleElem()},setText:function(a){"string"!=typeof a&&(a=""),0>=a.indexOf("wpmdb_error")&&(a=this.decodeErrorObject(a)),this.$progress.find(".progress-text").html(a),this.text=a},setState:function(a,b,c){null!==a&&this.setTitle(a),null!==b&&this.setText(b),null!==c&&this.setStatus(c)},startTimer:function(){this.timerCount=0,this.counterDisplay=d(".timer"),this.elapsedInterval=setInterval(this.incrementTimer,1e3)},pauseTimer:function(){clearInterval(this.elapsedInterval)},resumeTimer:function(){this.elapsedInterval=setInterval(this.incrementTimer,1e3)},incrementTimer:function(){wpmdb.current_migration.timerCount=wpmdb.current_migration.timerCount+1,wpmdb.current_migration.displayCount()},displayCount:function(){var a=Math.floor(this.timerCount/3600)%24,b=Math.floor(this.timerCount/60)%60,c=this.timerCount%60,d=this.pad(a,2,0)+":"+this.pad(b,2,0)+":"+this.pad(c,2,0);this.counterDisplay.html(d)},updateTitleElem:function(){var a=this.model.get("activeStageName"),b=this.model.getStageModel(a),c=Math.max(0,b.getTotalProgressPercent()),d=this.model.get("stages").length,e=this.currentStageNum,f=this.status,g=wpmdb_strings.title_progress;"complete"===b.get("status")&&0===b.get("totalSize")&&(c=100),g=g.replace("%1$s",c+"%"),g=g.replace("%2$s",e),g=g.replace("%3$s",d),1===d&&(g=c+"%"),wpmdb_strings["title_"+f]&&(g=wpmdb_strings["title_"+f]),g=g+" - "+this.originalTitle,document.title=g},restoreTitleElem:function(){document.title=this.originalTitle},pad:function(a,b,c){return c=c||"0",a+="",a.length>=b?a:new Array(b-a.length+1).join(c)+a},decodeErrorObject:function(a){var b=a.replace(/\{&quot;/g,"{#q!#").replace(/\&quot;}/g,"#q!#}").replace(/,&quot;/g,",#q!#").replace(/&quot;:/g,"#q!#:").replace(/:&quot;/g,":#q!#").replace(/&quot;/g,'\\"').replace(/#q!#/g,'"').replace(/&gt;/g,">").replace(/&lt;/g,"<");try{b=JSON.parse(b)}catch(c){return a}return"object"==typeof b&&"undefined"!=typeof b.body?b:a},fixProgressStageWidthForScrollBar:function(){var a=Math.abs(this.$wrapper[0].offsetWidth-this.$wrapper[0].clientWidth),b=this.$wrapper.find(".active .progress-items"),c=parseInt(b.css("padding-left"),10),d=parseInt(b.css("padding-right"),10);(0!==a||0===a&&d!==c)&&b.css("padding-right",c-a+"px")}},newMigration:function(a){d("#overlay").remove(),d(".progress-content").remove(),this.migration.$overlay=g.clone(),d("#wpwrap").append(this.migration.$overlay),this.migration.model=new e(a),this.migration.view=new f({model:this.migration.model}),this.migration.$progress=h.clone(),this.migration.$wrapper=this.migration.view.$el,this.migration.$progress.find(".migration-progress-stages").replaceWith(this.migration.$wrapper),this.migration.$proVersion=this.migration.$overlay.find(".pro-version");var b=this.migration.$proVersion.find("iframe").remove().clone();this.migration.$overlay.prepend(this.migration.$progress);var c=this;return setTimeout(function(){c.migration.$overlay.add(c.migration.$progress).add(c.migration.$proVersion).removeClass("hide").addClass("show"),c.migration.$proVersion.length&&setTimeout(function(){c.migration.$proVersion.find(".iframe").append(b)},500)},0),this.migration.currentStageNum=0,this.migration.$proVersion.on("click",".close-pro-version",function(){c.migration.$proVersion.find("iframe").remove(),c.migration.$proVersion.addClass("hide remove"),setTimeout(function(){c.migration.$proVersion.remove()},500)}),this.migration.model.on("migrationComplete",function(){c.utils.updateProgTableVisibilitySetting(),c.utils.updatePauseBeforeFinalizeSetting(),c.migration.pauseTimer()}),d(window).on("resize",_.debounce(this.migration.fixProgressStageWidthForScrollBar.bind(this.migration),100)),this.migration.model.on("change:activeStage",this.migration.fixProgressStageWidthForScrollBar.bind(this.migration)),this.migration},utils:a("MigrationProgress-utils")};b.exports=j},{"MigrationProgress-model":2,"MigrationProgress-utils":3,"MigrationProgress-view":4}],2:[function(a,b,c){var d=a("MigrationProgressStage-model"),e=jQuery,f=Backbone.Model.extend({defaults:{_initialStages:null,stages:null,activeStageName:null,stageModels:null,localTableRows:null,localTableSizes:null,remoteTableRows:null,remoteTableSizes:null,migrationStatus:"active",migrationIntent:"savefile"},initialize:function(){this.set("stageModels",{}),this.set("_initialStages",this.get("stages")),this.set("stages",[]),_.each(this.get("_initialStages"),function(a,b,c){this.addStage(a.name,b,c)},this)},addStage:function(a,b,c,d){var f,g=[];return _.each(b,function(a){var b,d;"remote"===c?(b=this.get("remoteTableSizes")[a],d=this.get("remoteTableRows")[a]):(b=this.get("localTableSizes")[a],d=this.get("localTableRows")[a]),g.push({name:a,size:b,rows:d})},this),f={name:a,items:g,dataType:c},"object"==typeof d&&(f=e.extend(f,d)),this.addStageModel(f),this.trigger("stage:added",this.get("stageModels")[a]),this.get("stageModels")[a].on("change",function(){this.trigger("change")},this),this.getStageModel(f.name)},addStageItem:function(a,b,c,d){this.getStageModel(a).addItem(b,c,d)},addStageModel:function(a){var b=this.get("stages"),c=this.get("stageModels"),e=new d(a);b.push(a),c[a.name]=e,this.set("stages",b),this.set("stageModels",c)},getStageModel:function(a){return this.get("stageModels")[a]},getStageItems:function(a,b){var c=this.getStageModel(a),d=c.get("items");return void 0===b?d:d.map(function(a){return a[b]})},setActiveStage:function(a){this.setStageComplete(),this.set("activeStageName",a),this.getStageModel(a).set("status","active"),this.trigger("change:activeStage")},setStageComplete:function(a){a||(a=this.get("activeStageName")),null!==a&&this.getStageModel(a).set("status","complete"),wpmdb.current_migration.currentStageNum=wpmdb.current_migration.currentStageNum+1},setMigrationComplete:function(){var a=this.getStageModel(this.get("activeStageName"));this.setStageComplete(),this.trigger("migrationComplete"),this.set("migrationStatus","complete"),a.activateTab()}});b.exports=f},{"MigrationProgressStage-model":5}],3:[function(a,b,c){var d=jQuery;b.exports={updateProgTableVisibilitySetting:function(){wpmdb_data.prog_tables_visibility_changed&&(wpmdb_data.prog_tables_visibility_changed=!1,d.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_setting",nonce:wpmdb_data.nonces.save_setting,setting:"prog_tables_hidden",checked:Boolean(wpmdb_data.prog_tables_hidden)},error:function(a,b,c){console.log("Could not save progress item visibility setting",c)}}))},updatePauseBeforeFinalizeSetting:function(){wpmdb_data.pause_before_finalize_changed&&(wpmdb_data.pause_before_finalize_changed=!1,d.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_setting",nonce:wpmdb_data.nonces.save_setting,setting:"pause_before_finalize",checked:Boolean(wpmdb_data.pause_before_finalize)},error:function(a,b,c){console.log("Could not save pause before finalize setting",c)}}))}}},{}],4:[function(a,b,c){var d=a("./MigrationProgressStage-view.js"),e=(jQuery,Backbone.View.extend({tagName:"div",className:"migration-progress-stages",id:"migration-progress-stages",self:this,initialize:function(){this.$el.empty(),this.model.on("stage:added",function(a){this.addStageView(a)},this),_.each(this.model.get("stageModels"),this.addStageView,this)},addStageView:function(a){var b=new d({model:a});a.trigger("view:initialized",b),this.$el.append(b.$el),this.$el.parent().find(".stage-tabs").append(b.$tabElem)}}));b.exports=e},{"./MigrationProgressStage-view.js":6}],5:[function(a,b,c){var d=jQuery,e=Backbone.Model.extend({defaults:{status:"queued",_initialItems:null,items:null,lookupItems:null,totalSize:0,totalTransferred:0,dataType:"local",name:"",itemsComplete:0,itemsCompleteArr:[],strings:null},initialize:function(){this.initStrings(),this.set("_initialItems",this.get("items").slice()),this.set("items",[]),this.set("lookupItems",{}),this.set("itemsCompleteArr",[]),_.each(this.get("_initialItems"),function(a){this.addItem(a.name,a.size,a.rows)},this),this.on("view:initialized",this.triggerItemViewInit),this.on("change",function(){wpmdb.current_migration.updateTitleElem()})},initStrings:function(){var a={stage_title:this.get("name"),migrated:wpmdb_strings.migrated,queued:wpmdb_strings.queued,active:wpmdb_strings.running,complete:wpmdb_strings.complete,hide:wpmdb_strings.hide,show:wpmdb_strings.show,itemsName:wpmdb_strings.tables},b=this.get("strings");b="object"==typeof b?b:{},b=d.extend(a,b),b.items_migrated=b.itemsName+" "+b.migrated,b.hide_items=b.hide+" "+b.itemsName,b.show_items=b.show+" "+b.itemsName,this.set("strings",b)},addItem:function(a,b,c){var d=this.get("items"),e={name:a,size:b,rows:c||b,stageName:this.get("name"),$el:null,transferred:0,rowsTransferred:0,complete:!1};d.push(e),this.get("lookupItems")[a]=d.length-1,this.set("totalSize",parseInt(this.get("totalSize"))+parseInt(b)),this.trigger("item:added",e)},triggerItemViewInit:function(){var a=this.get("items"),b=this;_.each(a,function(a){b.trigger("item:added",a)})},getTotalSizeTransferred:function(){return this.get("totalTransferred")},countItemsComplete:function(){return this.get("itemsComplete")},getTotalProgressPercent:function(){var a=this.getTotalSizeTransferred(),b=this.get("totalSize");return 0>=a||0>=b?0:Math.min(100,Math.floor(a/b*100))},activateTab:function(){this.trigger("activateTab"),wpmdb.current_migration.model.trigger("change:activeStage")},setItemComplete:function(a){var b=this.get("itemsCompleteArr");if(!~b.indexOf(a)){b.push(a);var c=this.getItemByName(a),d=this.get("totalTransferred"),e=this.get("itemsComplete");this.set("itemsComplete",++e),d+=c.size-c.transferred,this.set("totalTransferred",d),c.transferred=c.size,c.complete=!0,c.rowsTransferred=c.rows,this.trigger("change change:items",c)}},setItemRowsTransferred:function(a,b){var c,d,e=this.getItemByName(a),f=this.get("totalTransferred");return c=-1===parseInt(b)?1:Math.min(1,b/e.rows),1===c?void this.setItemComplete(a):(d=e.size*c,f+=d-e.transferred,this.set("totalTransferred",f),e.transferred=d,e.rowsTransferred=b,void this.trigger("change change:items",e))},getItemByName:function(a){var b=this.get("items")[this.get("lookupItems")[a]]||{};return a===b.name?b:this.determineItemByName(a)},determineItemByName:function(a){for(var b=this.get("items"),c=0;c<b.length;c++){var d=b[c];if(a===d.name)return this.get("lookupItems").itemName=c,d}}});b.exports=e},{}],6:[function(a,b,c){var d=jQuery,e=Backbone.View.extend({tagName:"div",className:"migration-progress-stage-container hide-tables",$totalProgressElem:null,$tabElem:null,$showHideTablesElem:null,$pauseBeforeFinalizeElem:null,$pauseBeforeFinalizeCheckbox:null,$itemsContainer:null,itemViews:null,maxDomNodes:100,visibleDomNodes:0,queuedElements:null,$truncationNotice:null,$truncationNoticeHiddenItems:null,initialize:function(){this.$el.empty(),this.$el.attr("data-stage",this.model.get("name")).addClass("queued "+this.model.get("name")),this.queuedElements=[],this.initTotalProgressElem(),wpmdb.current_migration.view.$el.parent().find(".stage-tabs").after(this.$totalProgressElem),this.$itemsContainer=d("<div class=progress-items />"),this.$el.append(this.$itemsContainer),this.initTabElem(),this.model.on("item:added",this.maybeAddElementToView,this),_.each(this.model.get("itemModels"),this.maybeAddElementToView,this),this.model.on("change",function(){this.updateProgressElem(),this.updateStageTotals()},this),this.model.on("change:status",function(a){this.$el.removeClass("queued active").addClass(this.model.get("status")),this.$totalProgressElem.removeClass("queued active").addClass(this.model.get("status")),this.$tabElem.removeClass("queued active").addClass(this.model.get("status")).find(".stage-status").text(this.model.get("strings")[this.model.get("status")])},this),this.model.on("change:items",function(a){a.name&&this.setItemProgress(a)},this),this.model.on("activateTab",function(){"complete"===wpmdb.current_migration.model.get("migrationStatus")&&(this.$totalProgressElem.addClass("active").siblings().removeClass("active"),this.$tabElem.addClass("active").siblings().removeClass("active"),this.$el.addClass("active").siblings().removeClass("active"))},this)},initTotalProgressElem:function(){this.initShowHideTablesElem(),this.initPauseBeforeFinalizeElem(),this.$totalProgressElem=d('<div class="stage-progress '+this.model.get("name")+'" />').append("<span class=percent-complete>0</span>% "+this.model.get("strings").complete+" ").append('<span class="size-complete-wrap">(<span class=size-complete>0 MB</span> / <span class=size-total>0 MB</span>) </span>').append('<span class="items-complete-wrap"><span class=items-complete>0</span> <span class=lowercase >of</span> <span class=items-total>0</span> '+this.model.get("strings").items_migrated+"</span>").append(this.$showHideTablesElem).append("<div class=progress-bar-wrapper><div class=progress-bar /></div>"),this.updateStageTotals()},initShowHideTablesElem:function(){this.$showHideTablesElem=d("<a class=show-hide-tables/>").text(this.model.get("strings").show_items);var a=this;this.$showHideTablesElem.on("click show-hide-progress-tables",function(){var b;a.$el.hasClass("hide-tables")?(b=!1,a.$el.add(a.$el.siblings()).removeClass("hide-tables"),a.$showHideTablesElem.text(a.model.get("strings").hide_items)):(b=!0,a.$el.add(a.$el.siblings()).addClass("hide-tables"),a.$showHideTablesElem.text(a.model.get("strings").show_items)),Boolean(b)!==Boolean(wpmdb_data.prog_tables_hidden)&&(wpmdb_data.prog_tables_visibility_changed=!0,wpmdb_data.prog_tables_hidden=b)}),wpmdb_data.prog_tables_hidden||this.$showHideTablesElem.triggerHandler("show-hide-progress-tables"),this.model.on("change:status activateTab",function(){wpmdb_data.prog_tables_hidden?a.$showHideTablesElem.text(a.model.get("strings").show_items):a.$showHideTablesElem.text(a.model.get("strings").hide_items)})},initPauseBeforeFinalizeElem:function(){this.$pauseBeforeFinalizeElem=d(".pause-before-finalize"),this.$pauseBeforeFinalizeCheckbox=this.$pauseBeforeFinalizeElem.find("input[type=checkbox]");var a=this,b=!1,c=wpmdb.current_migration.model.get("migrationIntent");wpmdb_data.pause_before_finalize&&(b=!0),this.$pauseBeforeFinalizeCheckbox.prop("checked",b),-1!==d.inArray(c,["push","pull","find_replace","import"])?("find_replace"===c&&d("#pause-before-finalize-label").text(wpmdb_strings.pause_before_finalize_find_replace),this.$pauseBeforeFinalizeElem.show()):this.$pauseBeforeFinalizeElem.hide(),wpmdb.current_migration.model.on("change:activeStage",function(){"media"===wpmdb.current_migration.model.get("activeStageName")&&a.$pauseBeforeFinalizeElem.hide()}),this.$pauseBeforeFinalizeElem.on("click",function(){var b=Boolean(a.$pauseBeforeFinalizeCheckbox.is(":checked"));b!==Boolean(wpmdb_data.pause_before_finalize)&&(wpmdb_data.pause_before_finalize_changed=!0,wpmdb_data.pause_before_finalize=b)})},initTabElem:function(){var a=this;this.$tabElem=d("<a class=stage-tab>").append("<span class=stage-title>"+this.model.get("strings").stage_title+"</span> ").append("<span class=stage-status>"+this.model.get("strings").queued+"</span> ").on("click",function(){a.model.activateTab()})},updateProgressElem:function(){var a=Math.max(0,this.model.getTotalProgressPercent()),b=wpmdb.functions.convertKBSizeToHRFixed(Math.min(this.model.getTotalSizeTransferred(),this.model.get("totalSize"))),c=Math.min(this.model.countItemsComplete(),this.model.get("items").length);"complete"===this.model.get("status")&&0===this.model.get("totalSize")&&(a=100,this.$showHideTablesElem.fadeOut()),this.$totalProgressElem.find(".percent-complete").text(a),this.$totalProgressElem.find(".size-complete").text(b),this.$totalProgressElem.find(".items-complete").text(wpmdb_add_commas(c)),this.$totalProgressElem.find(".progress-bar-wrapper .progress-bar").css({width:a+"%"})},updateStageTotals:function(){var a=this.model.get("items").length;this.$totalProgressElem.find(".items-total").text(wpmdb_add_commas(a)),this.$totalProgressElem.find(".size-total").text(wpmdb.functions.convertKBSizeToHRFixed(this.model.get("totalSize")))},initializeItemElement:function(a){var b=d('<div class="item-progress" />'),c=d('<div class="progress-bar"/>').css("width","0%"),e=d("<p>").addClass("item-info").append(d('<span class="name" />').text(a.name)).append(" ").append(d('<span class="size" />').text("("+wpmdb.functions.convertKBSizeToHRFixed(a.size)+")"));return b.append(e),b.append(c),b.append('<span class="dashicons dashicons-yes"/>'),b.attr("id","item-"+a.name),b.attr("data-stage",this.model.get("name")),a.$el=b,a.$progress=c,a.$title=e,a},maybeAddElementToView:function(a){this.visibleDomNodes<this.maxDomNodes?(++this.visibleDomNodes,this.$itemsContainer.append(this.initializeItemElement(a).$el)):(this.queuedElements.push(a),this.$truncationNotice?this.updateTruncationNotice():this.showTruncationNotice())},showTruncationNotice:function(){this.$truncationNotice||(this.$truncationNotice=d('<div class="truncation-notice" >'+wpmdb_strings.progress_items_truncated_msg.replace("%1$s",'<span class="hidden-items">'+wpmdb_add_commas(this.queuedElements.length)+"</span>")+"</div>"),this.$truncationNoticeHiddenItems=this.$truncationNotice.find(".hidden-items"),this.$itemsContainer.after(this.$truncationNotice))},updateTruncationNotice:function(){this.$truncationNoticeHiddenItems.text(wpmdb_add_commas(this.queuedElements.length))},getNextElementForView:function(a){var b;return this.queuedElements.length&&(a&&this.queuedElements.push(a),b=this.queuedElements.shift(),a=b instanceof d?b:this.initializeItemElement(b).$el),a},setItemProgress:function(a){var b=Math.min(100,Math.ceil(100*(a.transferred/a.size)));a.$progress.css("width",b+"%"),b>=100&&this.elemComplete(a)},elemComplete:function(a){var b=a.$el.addClass("complete");if(1!==this.model.get("items").length){var c=this.getNextElementForView(b),d=b.height(),e=b.css("margin-bottom"),f=c.clone().css({height:0,marginBottom:0}).addClass("clone");f.appendTo(this.$itemsContainer),b.css({height:d,marginBottom:e}),setTimeout(function(){b.css({height:0,marginBottom:0}),f.css({height:d,marginBottom:e}),setTimeout(function(){b.css({height:"auto",marginBottom:e}).remove(),f.remove(),this.$itemsContainer.find(".item-progress:not(.clone)").last().after(c.css({height:"auto",marginBottom:e}))}.bind(this),250)}.bind(this),1e3)}}});b.exports=e},{}],7:[function(a,b,c){!function(b,c){function d(a,b){var c,d,e=[],f={},g=b.length;for(c=0;g>c;c++)f[b[c]]=!0;for(g=a.length,c=0;g>c;c++)d=a[c],d in f&&e.push(d);return e}function e(a){a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var b=new RegExp("[\\?&]"+a+"=([^&#]*)"),c=b.exec(location.search);return null===c?"":decodeURIComponent(c[1].replace(/\+/g," "))}function f(a,c,d){var e=a.substr(0,a.indexOf(":"));return d!==e&&-1!==a.indexOf("https")?(b(".ssl-notice").show(),J=!0,a=a.replace("https","http"),void b(".pull-push-connection-info").val(a+"\n"+c)):void(J=!1)}function g(){if("undefined"!=typeof c.common.connection_data&&!1!==c.common.connection_data){var a=wpmdb_migration_type(),d=c.functions.get_tables_to_migrate(null,null);b(".mixed-case-table-name-notice").hide(),null!==d&&(d=d.join(""),d!==d.toLowerCase()&&("1"===c.common.connection_data.lower_case_table_names||"push"!==a&&"savefile"!==a)&&("1"!==wpmdb_data.lower_case_table_names&&"pull"===a||("push"===a||"savefile"===a?b(".mixed-case-table-name-notice.push").show():b(".mixed-case-table-name-notice.pull").show())))}}function h(a){var b=a,c=b.replace(/\/\/(.*)@/,"//").replace("http://","").replace("https://","").replace("www.","");return c}function i(a,b,c){var d=h(b);return"completed"===c?a.replace(/\%s\s?/,"<span class=domain-label>"+d+"</span>&nbsp;"):a.replace(/\%s(\S*)\s?/,"<span class=domain-label>"+d+"$1</span>&nbsp;")}function j(a,c,d){var e="",f="";switch(c){case"push":e=wpmdb_strings.push_migration_label_migrating,f=wpmdb_strings.push_migration_label_completed;break;case"pull":e=wpmdb_strings.pull_migration_label_migrating,f=wpmdb_strings.pull_migration_label_completed;break;case"find_replace":e=wpmdb_strings.find_replace_label_migrating,f=wpmdb_strings.find_replace_label_completed;break;case"savefile":e=wpmdb_strings.exporting_please_wait,f=wpmdb_strings.exporting_complete}var g=e;return"completed"===d&&(g=f),"push"!==c&&"pull"!==c||(g=i(g,a,d)),g=b.wpmdb.apply_filters("wpmdb_get_migration_status_label",g,{intent:c,stage:d})}function k(){b(".option-group").each(function(a){b("input",this).attr("disabled","disabled"),b("label",this).css("cursor","default")})}function l(){b(".option-group").each(function(a){b("input",this).removeAttr("disabled"),b("label",this).css("cursor","pointer")})}function m(a,c,d,e){var f=c;void 0!==e&&(f=e),b(".slider",a).slider("value",parseInt(c)),b(".amount",a).html(wpmdb_add_commas(f)+" "+d)}function n(a){!0===Q?(Q=!1,B=!0,c.current_migration.setState(R,S,"active"),b(".pause-resume").html(wpmdb_strings.pause),c.current_migration.resumeTimer(),c.functions.execute_next_step()):(Q=!0,B=!1,V=wpmdb_strings.migration_paused,R=b(".progress-title").html(),S=b(".progress-text",".progress-wrapper-primary").html(),T=b(".progress-text",".progress-wrapper-secondary ").html(),"find_replace"===t&&(V=wpmdb_strings.find_replace_paused),c.current_migration.setState(V,wpmdb_strings.completing_current_request,null),b("body").off("click",".pause-resume"),b("body").off("click",".cancel"))}function o(a,b){var d=wpmdb_data.this_temp_prefix;return"pull"===wpmdb_migration_type()&&"undefined"!=typeof c.common.connection_data&&"undefined"!=typeof c.common.connection_data.temp_prefix&&(d=c.common.connection_data.temp_prefix),d===b.substring(0,d.length)?!0:a}function p(a,c){return b(".table-select-wrap .table-prefix").text()}function q(a){!0===a?(b('.replace-row.pin .replace-right-col input[type="text"]').attr("readonly","readonly"),b(".replace-row.pin .arrow-col").addClass("disabled")):(b('.replace-row.pin .replace-right-col input[type="text"]').removeAttr("readonly"),b(".replace-row.pin .arrow-col").removeClass("disabled"))}function r(a){c.common.previous_connection_data=c.common.connection_data,c.common.connection_data=a,b.wpmdb.do_action("wpmdb_connection_data_updated",a)}function s(a){var b={};return b.unit="MB",b.amount=(a/1024).toFixed(2),b}var t,u,v,w,x,y,z=!1,A="",B=!1,C=!1,D=!1,E=!1,F=!1,G=!1,H=!1,I=!1,J=!1,K=!1,L=!1,M=!1,N="",O="",P=[],Q=!1,R="",S="",T="",U="",V="",W=!1,X=!1,Y=0,Z=400,$=!1,_=!1,aa=c.functions.get_spinner_url(),ba='<img src="'+aa+'" alt="" class="ajax-spinner general-spinner" />';c.migration_progress_controller=a("MigrationProgress-controller"),c.current_migration=null,c.migration_selection=wpmdb_migration_type(),window.onbeforeunload=function(a){return"import"!==wpmdb_migration_type()||b(".step-two").is(":visible")||c.functions.remove_localStorage_form_data(),M?(a=a||window.event,a&&(a.returnValue=wpmdb_strings.sure),wpmdb_strings.sure):void 0},c.functions.maybe_show_prefix_notice=function(a){a!==wpmdb_data.this_prefix&&(b(".remote-prefix").html(a),I=!0,b(".prefix-notice").show())},c.functions.maybe_show_select_table_notice=function(){if(b("#migrate-selected").is(":checked")&&null===b("#select-tables").val()){if("import"!==wpmdb_migration_type())return alert(wpmdb_strings.please_select_one_table),!0;if(b("#import-find-replace").is(":checked")&&b("#select-tables").is(":visible"))return alert(wpmdb_strings.please_select_one_table_import),!0}return"savefile"!==wpmdb_migration_type()&&b("#backup-manual-select").is(":checked")&&null===b("#select-backup").val()?(alert(wpmdb_strings.please_select_one_table_backup),!0):!1},c.functions.remove_protocol=function(a){return a.replace(/^https?:/i,"")},c.functions.create_table_select=function(a,c,d){var e=document.createElement("select");return b(e).attr({multiple:"multiple",name:"select_tables[]",id:"select-tables","class":"multiselect"}),0<a.length&&b.each(a,function(a,f){if(!b.wpmdb.apply_filters("wpmdb_exclude_table",!1,f)){var g=" ";void 0!==d&&null!==d&&0<d.length&&-1!==b.inArray(f,d)&&(g=' selected="selected" ');var h="";0!==c.length&&(h=" ("+c[f]+")"),b(e).append("<option"+g+'value="'+f+'">'+f+h+"</option>")}}),e},b.wpmdb.add_filter("wpmdb_exclude_table",o),c.functions.get_tables_to_migrate=function(a,d){var e=[],f=wpmdb_migration_type(),g=b("input[name=table_migrate_option]:checked").val();return"migrate_select"===g?e=b("#select-tables").val():"pull"!==f&&"undefined"!=typeof wpmdb_data.this_prefixed_tables?e=wpmdb_data.this_prefixed_tables:"pull"===f&&"undefined"!=typeof c.common.connection_data&&"undefined"!=typeof c.common.connection_data.prefixed_tables&&(e=c.common.connection_data.prefixed_tables),e},b(document).ready(function(){function a(a){var c=!C;H=!0,b.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_check_licence",licence:a,context:"all",nonce:wpmdb_data.nonces.check_licence},error:function(a,b,c){alert(wpmdb_strings.license_check_problem)},success:function(a){var d,e,f,g=b(".support-content"),h=b(".addons-content"),i=b(".licence-status:not(.notification-message)");if("undefined"!=typeof a.dbrains_api_down)e=a.dbrains_api_down+a.message,f=a.dbrains_api_down;else if("undefined"!=typeof a.errors){if("undefined"!=typeof a.errors.subscription_expired)d=a.errors.subscription_expired.licence,e=a.errors.subscription_expired.support,f=a.errors.subscription_expired.addons;else{var j="";for(var k in a.errors)j+=a.errors[k];e=j,f=j}"undefined"!=typeof a.addon_content&&(f+="\n"+a.addon_content)}else e=a.message,f=a.addon_content;c&&i.stop().fadeOut(Z,function(){"undefined"==typeof d&&(b(this).css({visibility:"hidden",display:"block"}).slideUp(),d=""),b(this).empty().html(d).stop().fadeIn(Z)}),g.stop().fadeOut(Z,function(){b(this).empty().html(e).stop().fadeIn(Z)}),h.stop().fadeOut(Z,function(){b(this).empty().html(f).stop().fadeIn(Z)}),b("#plugin-compatibility").is(":not(:checked)")&&b("#compatibility-header").click()}})}function i(){void 0!==wpmdb_data&&void 0!==wpmdb_data.this_tables&&void 0!==wpmdb_data.this_table_sizes_hr&&(va=c.functions.create_table_select(wpmdb_data.this_tables,wpmdb_data.this_table_sizes_hr,b(va).val())),void 0!==c.common.connection_data&&void 0!==c.common.connection_data.tables&&void 0!==c.common.connection_data.table_sizes_hr&&(wa=c.functions.create_table_select(c.common.connection_data.tables,c.common.connection_data.table_sizes_hr,b(wa).val()))}function o(){b("#select-tables").remove(),b(".select-tables-wrap").prepend(va),b("#select-tables").change()}function R(){b("#select-tables").remove(),b(".select-tables-wrap").prepend(wa),b("#select-tables").change()}function S(){b("#migrate-selected").parents(".option-section").children(".header-expand-collapse").children(".expand-collapse-arrow").removeClass("collapsed"),b(".table-select-wrap").show(),b("#migrate-only-with-prefix").prop("checked",!1),b("#migrate-selected").prop("checked",!0),b(".table-migrate-options").hide(),b(".select-tables-wrap").show()}function T(){b(".table-migrate-options").show()}function V(){b("#select-tables").children("option").prop("selected",!0),b("#select-tables").change()}function ca(a,b){return c.functions.remove_protocol(wpmdb_data.this_url)}function da(){var a=wpmdb_migration_type(),d=b.trim(b(".pull-push-connection-info").val()).split("\n");if("undefined"!=typeof wpmdb_default_profile&&!0!==wpmdb_default_profile&&"savefile"!==a&&"find_replace"!==a&&"import"!==a&&!B&&wpmdb_data.is_pro){B=!0,k(),b(".connection-status").html(wpmdb_strings.establishing_remote_connection),b(".connection-status").removeClass("notification-message error-notice migration-error"),b(".connection-status").append(ba);var e=wpmdb_migration_type();b.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_verify_connection_to_remote_site",url:d[0],key:d[1],intent:e,nonce:wpmdb_data.nonces.verify_connection_to_remote_site,convert_post_type_selection:wpmdb_convert_post_type_selection,profile:wpmdb_data.profile},error:function(a,c,d){b(".connection-status").html(la(a.responseText,"(#102)",a)),b(".connection-status").addClass("notification-message error-notice migration-error"),b(".ajax-spinner").remove(),B=!1,l()},success:function(a){if(b(".ajax-spinner").remove(),B=!1,l(),"undefined"!=typeof a.wpmdb_error&&1===a.wpmdb_error)return b(".connection-status").html(a.body),b(".connection-status").addClass("notification-message error-notice migration-error"),void(a.body.indexOf("401 Unauthorized")>-1&&b(".basic-access-auth-wrapper").show());f(d[0],d[1],a.scheme),c.functions.maybe_show_prefix_notice(a.prefix),b(".pull-push-connection-info").addClass("temp-disabled"),b(".pull-push-connection-info").attr("readonly","readonly"),b(".connect-button").hide(),b(".connection-status").hide(),b(".step-two").show(),z=!0,r(a),ia(),g();var e="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_tables&&(e=wpmdb_loaded_tables),wa=c.functions.create_table_select(c.common.connection_data.tables,c.common.connection_data.table_sizes_hr,e);var h="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_post_types&&("undefined"!=typeof a.select_post_types?(b("#exclude-post-types").attr("checked","checked"),b(".post-type-select-wrap").show(),h=a.select_post_types):h=wpmdb_loaded_post_types);var i=document.createElement("select");b(i).attr({multiple:"multiple",name:"select_post_types[]",id:"select-post-types","class":"multiselect"}),b.each(c.common.connection_data.post_types,function(a,c){var d=b.inArray(c,h);d=-1!==d||!0===wpmdb_convert_exclude_revisions&&"revision"!==c?' selected="selected" ':" ",b(i).append("<option"+d+'value="'+c+'">'+c+"</option>")}),ya=i;var j="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_tables_backup&&(j=wpmdb_loaded_tables_backup);var k=document.createElement("select");b(k).attr({multiple:"multiple",name:"select_backup[]",id:"select-backup","class":"multiselect"}),b.each(c.common.connection_data.tables,function(a,d){var e=b.inArray(d,j);e=-1!==e?' selected="selected" ':" ",b(k).append("<option"+e+'value="'+d+'">'+d+" ("+c.common.connection_data.table_sizes_hr[d]+")</option>")}),za=k,"pull"===wpmdb_migration_type()?(b.wpmdb.do_action("wpmdb_update_pull_table_select"),b("#select-post-types").remove(),b(".exclude-post-types-warning").after(ya),b("#select-backup").remove(),b(".backup-tables-wrap").prepend(Aa),b(".table-prefix").html(a.prefix),b(".uploads-dir").html(wpmdb_data.this_uploads_dir)):(b("#select-backup").remove(),b(".backup-tables-wrap").prepend(za)),b.wpmdb.do_action("verify_connection_to_remote_site",c.common.connection_data)}})}}function ea(c,d){b(".licence-input, .register-licence").remove(),b(".licence-not-entered").prepend(c.masked_licence),b(".support-content").empty().html("<p>"+wpmdb_strings.fetching_license+'<img src="'+aa+'" alt="" class="ajax-spinner general-spinner" /></p>'),a(d),b(".migrate-selection label").removeClass("disabled"),b(".migrate-selection input").removeAttr("disabled")}function fa(){b.ajax({url:ajaxurl,
2
- type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_get_log",nonce:wpmdb_data.nonces.get_log},error:function(a,b,c){alert(wpmdb_strings.update_log_problem)},success:function(a){b(".debug-log-textarea").val(a)}})}function ga(){b("#overlay").removeClass("show").addClass("hide"),b("#overlay > div").removeClass("show").addClass("hide"),c.current_migration.$proVersion.find("iframe").remove(),setTimeout(function(){b("#overlay").remove()},500),L=!1}function ha(){var a;if(b(".save-settings-button").blur(),!E&&!0!==c.functions.maybe_show_select_table_notice()){var d=!1;b("#create_new").is(":checked")&&(d=!0);var e=b(".create-new-profile").val();E=!0,a=b(b("#migrate-form")[0].elements).not(".auth-credentials").serialize(),b(".save-settings-button").attr("disabled","disabled").after('<img src="'+aa+'" alt="" class="save-profile-ajax-spinner general-spinner" />'),B=!0,b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_profile",profile:a,nonce:wpmdb_data.nonces.save_profile},error:function(a,c,d){B=!1,alert(wpmdb_strings.save_profile_problem),b(".save-settings-button").removeAttr("disabled"),b(".save-profile-ajax-spinner").remove(),b(".save-settings-button").after('<span class="ajax-success-msg">'+wpmdb_strings.saved+"</span>"),b(".ajax-success-msg").fadeOut(2e3,function(){b(this).remove()}),E=!1},success:function(a){var c=parseInt(b("#migrate-form input[name=save_migration_profile_option]:checked").val(),10)+1;if(B=!1,b(".save-settings-button").removeAttr("disabled"),b(".save-profile-ajax-spinner").remove(),b(".save-settings-button").after('<span class="ajax-success-msg">'+wpmdb_strings.saved+"</span>"),b(".ajax-success-msg").fadeOut(2e3,function(){b(this).remove()}),E=!1,b(".create-new-profile").val(""),d){var f=parseInt(a,10),g=f+1,h=b('<li><span class="delete-profile" data-profile-id="'+g+'"></span><label for="profile-'+g+'"><input id="profile-'+g+'" value="'+f+'" name="save_migration_profile_option" type="radio"></label></li>');h.find("label").append(document.createTextNode(" "+e)),c=g,b("#create_new").parents("li").before(h),b("#profile-"+g).attr("checked","checked")}var i=window.location.href.replace("#migrate","").replace(/&wpmdb-profile=-?\d+/,"")+"&wpmdb-profile="+c,j=b("#migrate-form input[name=save_migration_profile_option]:checked").parent().text().trim();if("function"==typeof window.history.pushState){if(b("#migrate-form .crumbs").length)b("#migrate-form .crumbs .crumb:last").text(j);else{var k=b('<div class="crumbs" />').append('<a class="crumb" href="'+wpmdb_data.this_plugin_base+'"> Saved Profiles </a>').append('<span class="crumb">'+j+"</span>");b("#migrate-form").prepend(k)}window.history.pushState({updated_profile_id:c},null,i)}}})}}function ia(){b(".connection-status").hide(),b(".prefix-notice").hide(),b(".ssl-notice").hide(),b(".different-plugin-version-notice").hide(),b(".step-two").show(),b(".backup-options").show(),b(".keep-active-plugins").show(),b(".directory-permission-notice").hide(),b("#create-backup").removeAttr("disabled"),b("#create-backup-label").removeClass("disabled"),b(".backup-option-disabled").hide(),b(".compatibility-older-mysql").hide();var a,d=b.trim(b(".pull-push-connection-info").val()).split("\n");if(wpmdb_toggle_migration_action_text(),b.wpmdb.do_action("move_connection_info_box",{migration_type:wpmdb_migration_type(),last_migration_type:A}),b(".migrate-tab").attr("class","migrate-tab content-tab").addClass(wpmdb_migration_type()),"pull"===wpmdb_migration_type()){if(b(".pull-list li").append(Ba),Ba.show(function(){var a=b(this).find(".pull-push-connection-info");a.val()||a.focus()}),("push"===c.migration_selection||"savefile"===c.migration_selection)&&2===d.length)return c.force_reconnect=!0,b(".pull-list li").append(Ba),b(".pull-push-connection-info").removeClass("temp-disabled").attr("readonly","readonly"),b(".connect-button").hide(),void c.functions.connection_box_changed();z?(b(".connection-status").hide(),b(".step-two").show(),b(".table-prefix").html(c.common.connection_data.prefix),b(".backup-table-prefix").html(wpmdb_data.site_details.prefix),b(".uploads-dir").html(wpmdb_data.this_uploads_dir),!1===G&&(a=h(c.common.connection_data.url),b(".create-new-profile").val(a)),!0===I&&b(".prefix-notice").show(),!0===J&&b(".ssl-notice").show(),!0===K&&(b(".different-plugin-version-notice").show(),b(".step-two").hide()),wpmdb_toggle_migration_action_text(),"false"===wpmdb_data.write_permission&&ja(wpmdb_data.this_upload_dir_long)):(b(".connection-status").show(),b(".step-two").hide())}else if("push"===wpmdb_migration_type()){if(b(".push-list li").append(Ba),Ba.show(function(){var a=b(this).find(".pull-push-connection-info");a.val()||a.focus()}),("pull"===c.migration_selection||"savefile"===c.migration_selection)&&2===d.length)return c.force_reconnect=!0,b(".push-list li").append(Ba),b(".pull-push-connection-info").removeClass("temp-disabled").attr("readonly","readonly"),b(".connect-button").hide(),void c.functions.connection_box_changed();z?(b(".connection-status").hide(),b(".step-two").show(),b(".table-prefix").html(wpmdb_data.this_prefix),b(".backup-table-prefix").html(c.common.connection_data.prefix),b(".uploads-dir").html(c.common.connection_data.uploads_dir),!1===G&&(a=h(c.common.connection_data.url),b(".create-new-profile").val(a)),!0===I&&b(".prefix-notice").show(),!0===J&&b(".ssl-notice").show(),!0===K&&(b(".different-plugin-version-notice").show(),b(".step-two").hide()),wpmdb_toggle_migration_action_text(),"0"===c.common.connection_data.write_permissions&&ja(c.common.connection_data.upload_dir_long)):(b(".connection-status").show(),b(".step-two").hide())}else if(-1!==b.inArray(wpmdb_migration_type(),["savefile","find_replace","import"])&&(b(".connection-status").hide(),b(".table-prefix").html(wpmdb_data.this_prefix),!1===G&&b(".create-new-profile").val(""),"import"!==wpmdb_migration_type()?(b(".step-two").show(),b.wpmdb.do_action("wpmdb_update_push_table_select")):b.wpmdb.do_action("wpmdb_update_import_table_select"),"savefile"===wpmdb_migration_type()&&(b(".backup-options").hide(),b(".compatibility-older-mysql").show()),b(".keep-active-plugins").hide(),!1===wpmdb_data.write_permission&&(b(".directory-permission-notice").show(),b(".step-two").hide()),"find_replace"===wpmdb_migration_type()||"import"===wpmdb_migration_type())){if("true"===wpmdb_data.is_multisite){var e=b(".old-replace-col").eq(1);e.parent().removeClass("pin").find(".replace-remove-row").show(),e.find("input").removeAttr("readonly")}"false"===wpmdb_data.write_permission&&ja(wpmdb_data.this_upload_dir_long)}g()}function ja(a){b("#create-backup").prop("checked",!1),b("#create-backup").attr("disabled","disabled"),b("#create-backup-label").addClass("disabled"),b(".backup-option-disabled").show(),b(".upload-directory-location").html(a)}function ka(){var a=null,d=null;null!==c.common.previous_connection_data&&"object"==typeof c.common.previous_connection_data&&c.common.previous_connection_data.url!==c.common.connection_data.url&&(a=c.functions.remove_protocol(c.common.previous_connection_data.url),d=c.common.previous_connection_data.path),"push"===wpmdb_migration_type()||"savefile"===wpmdb_migration_type()?("pull"===A?b(".replace-row").each(function(){var a=b(".old-replace-col input",this).val();b(".old-replace-col input",this).val(b(".replace-right-col input",this).val()),b(".replace-right-col input",this).val(a)}):"push"===A&&"push"===wpmdb_migration_type()&&null!==a&&null!==d&&b(".replace-row").each(function(){var e=b(".replace-right-col input",this).val();e===d&&b(".replace-right-col input",this).val(c.common.connection_data.path),e===a&&b(".replace-right-col input",this).val(c.functions.remove_protocol(c.common.connection_data.url))}),b.wpmdb.do_action("wpmdb_update_push_table_select"),b("#select-post-types").remove(),b(".exclude-post-types-warning").after(xa),c.functions.exclude_post_types_warning(),b("#select-backup").remove(),b(".backup-tables-wrap").prepend(za)):"pull"===wpmdb_migration_type()&&(""===A||"push"===A||"savefile"===A?b(".replace-row").each(function(){var a=b(".old-replace-col input",this).val();b(".old-replace-col input",this).val(b(".replace-right-col input",this).val()),b(".replace-right-col input",this).val(a)}):"pull"===A&&"pull"===wpmdb_migration_type()&&null!==a&&null!==d&&b(".replace-row").each(function(){var e=b(".old-replace-col input",this).val();e===d&&b(".old-replace-col input",this).val(c.common.connection_data.path),e===a&&b(".old-replace-col input",this).val(c.functions.remove_protocol(c.common.connection_data.url))}),b.wpmdb.do_action("wpmdb_update_pull_table_select"),b("#select-post-types").remove(),b(".exclude-post-types-warning").after(ya),c.functions.exclude_post_types_warning(),b("#select-backup").remove(),b(".backup-tables-wrap").prepend(Aa)),A=wpmdb_migration_type()}function la(a,b,c){return wpmdbGetAjaxErrors(wpmdb_strings.connection_local_server_problem,b,a,c)}function ma(a){return/^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)){0})(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)}function na(c,d){b(".nav-tab").removeClass("nav-tab-active"),b(".nav-tab."+c).addClass("nav-tab-active"),b(".content-tab").hide(),b("."+c+"-tab").show(),"settings"===c&&!0===oa()&&(b("p.licence-status").append("Checking License... ").append(ba),a()),"help"===c&&(fa(),!0===oa()&&(b(".support-content p").append(ba),a())),"addons"===c&&!0!==d&&!0===oa()&&(b(".addons-content p").append(ba),a())}function oa(){return!1===H&&"1"===wpmdb_data.has_licence&&"true"===wpmdb_data.is_pro}function pa(a){W=!0,U=wpmdb_strings.cancelling_migration,b(".migration-controls").css({visibility:"hidden"}),"find_replace"===t&&(U=wpmdb_strings.cancelling_find_replace),c.current_migration.setState(U,wpmdb_strings.completing_current_request,"cancelling"),!0===Q&&(Q=!1,c.functions.execute_next_step())}function qa(a){var c=b("#"+a),d=c.find("input[type=checkbox]");c.toggleClass("on").find("span").toggleClass("checked");var e=c.find("span.on").hasClass("checked");d.attr("checked",e).trigger("change")}c.migration_state_id="",b("#plugin-compatibility").change(function(a){var c="1",d=b(this).closest("td").next("td").find(".setting-status");b(this).is(":checked")||(c="0"),b(".plugin-compatibility-wrap").toggle(),d.find(".ajax-success-msg").remove(),d.append(ba),b("#plugin-compatibility").attr("disabled","disabled"),b(".plugin-compatibility").addClass("disabled"),b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_plugin_compatibility",install:c,nonce:wpmdb_data.nonces.plugin_compatibility},error:function(a,c,d){alert(wpmdb_strings.plugin_compatibility_settings_problem+"\r\n\r\n"+wpmdb_strings.status+" "+a.status+" "+a.statusText+"\r\n\r\n"+wpmdb_strings.response+"\r\n"+a.responseText),b(".ajax-spinner").remove(),b("#plugin-compatibility").removeAttr("disabled"),b(".plugin-compatibility").removeClass("disabled")},success:function(a){""!==b.trim(a)?alert(a):(d.append('<span class="ajax-success-msg">'+wpmdb_strings.saved+"</span>"),b(".ajax-success-msg").fadeOut(2e3,function(){b(this).remove()})),b(".ajax-spinner").remove(),b("#plugin-compatibility").removeAttr("disabled"),b(".plugin-compatibility").removeClass("disabled")}})}),b("#plugin-compatibility").is(":checked")&&b(".plugin-compatibility-wrap").show(),(0<=navigator.userAgent.indexOf("MSIE")||0<=navigator.userAgent.indexOf("Trident"))&&b(".ie-warning").show(),0===wpmdb_data.valid_licence&&b("#savefile").prop("checked",!0);var ra=b(".max-request-size"),sa=b(".slider",ra);sa.slider({range:"min",value:parseInt(wpmdb_data.max_request/1024),min:512,max:parseInt(wpmdb_data.bottleneck/1024),step:256,create:function(a,b){var c=s(wpmdb_data.max_request/1024);m(ra,wpmdb_data.max_request/1024,c.unit,c.amount)},slide:function(a,b){var c=s(b.value);m(ra,b.value,c.unit,c.amount)},stop:function(a,c){b(".slider-success-msg").remove(),b(".amount",ra).after('<img src="'+aa+'" alt="" class="slider-spinner general-spinner" />'),sa.slider("disable"),b.ajax({url:ajaxurl,type:"POST",cache:!1,data:{action:"wpmdb_update_max_request_size",max_request_size:parseInt(c.value),nonce:wpmdb_data.nonces.update_max_request_size},error:function(a,c,d){sa.slider("enable"),b(".slider-spinner",ra).remove(),alert(wpmdb_strings.max_request_size_problem);var e=s(wpmdb_data.max_request/1024);m(ra,wpmdb_data.max_request/1024,e.unit,e.amount),sa.slider("enable")},success:function(){sa.slider("enable"),b(".slider-label-wrapper",ra).append('<span class="slider-success-msg">'+wpmdb_strings.saved+"</span>"),b(".slider-success-msg",ra).fadeOut(2e3,function(){b(this).remove()}),b(".slider-spinner",ra).remove()}})}});var ta=b(".delay-between-requests"),ua=b(".slider",ta);ua.slider({range:"min",value:parseInt(wpmdb_data.delay_between_requests/1e3),min:0,max:10,step:1,create:function(a,b){m(ta,wpmdb_data.delay_between_requests/1e3,"s")},slide:function(a,b){m(ta,b.value,"s")},stop:function(a,c){b(".slider-success-msg").remove(),b(".amount",ta).after('<img src="'+aa+'" alt="" class="slider-spinner general-spinner" />'),ua.slider("disable"),b.ajax({url:ajaxurl,type:"POST",cache:!1,data:{action:"wpmdb_update_delay_between_requests",delay_between_requests:parseInt(1e3*c.value),nonce:wpmdb_data.nonces.update_delay_between_requests},error:function(a,c,d){ua.slider("enable"),b(".slider-spinner",ta).remove(),alert(wpmdb_strings.delay_between_requests_problem),m(ta,wpmdb_data.delay_between_requests/1e3,"s"),ua.slider("enable")},success:function(){wpmdb_data.delay_between_requests=parseInt(1e3*c.value),ua.slider("enable"),b(".slider-label-wrapper",ta).append('<span class="slider-success-msg">'+wpmdb_strings.saved+"</span>"),b(".slider-success-msg",ta).fadeOut(2e3,function(){b(this).remove()}),b(".slider-spinner",ta).remove()}})}});var va=b("#select-tables").clone(),wa=b("#select-tables").clone(),xa=b("#select-post-types").clone(),ya=b("#select-post-types").clone(),za=b("#select-backup").clone(),Aa=b("#select-backup").clone();b(".help-tab .video").each(function(){var a=b(this),c=b(".video-viewer");b("a",this).click(function(d){d.preventDefault(),c.attr("src","//www.youtube.com/embed/"+a.data("video-id")+"?autoplay=1"),c.show();var e=c.offset();b(window).scrollTop(e.top-50)})}),b(".backup-options").show(),b(".keep-active-plugins").show(),"savefile"===wpmdb_migration_type()&&(b(".backup-options").hide(),b(".keep-active-plugins").hide()),A=wpmdb_migration_type(),b(".content-tab").on("click",".check-my-licence-again",function(c){c.preventDefault(),H=!1,b(c.target).replaceWith("Checking... "+ba),a(null,"all")}),b.wpmdb.add_action("wpmdb_refresh_table_selects",i),b.wpmdb.add_action("wpmdb_update_push_table_select",o),b.wpmdb.add_action("wpmdb_update_pull_table_select",R),b.wpmdb.add_action("wpmdb_disable_table_migration_options",S),b.wpmdb.add_action("wpmdb_enable_table_migration_options",T),b.wpmdb.add_action("wpmdb_select_all_tables",V),b.wpmdb.add_filter("wpmdb_base_old_url",ca),da(),b("body").on("click",".js-action-link",function(a){a.preventDefault(),b(this).blur()}),b(".licence-input").keypress(function(a){13===a.which&&(a.preventDefault(),b(".register-licence").click())}),b("body").on("click",".register-licence",function(a){if(a.preventDefault(),!C){var c=b.trim(b(".licence-input").val()),d=b(".licence-status");if(d.removeClass("notification-message error-notice success-notice"),""===c)return void d.html('<div class="notification-message error-notice">'+wpmdb_strings.enter_license_key+"</div>");d.empty().removeClass("success"),C=!0,b(".button.register-licence").after('<img src="'+aa+'" alt="" class="register-licence-ajax-spinner general-spinner" />'),b.ajax({url:ajaxurl,type:"POST",dataType:"JSON",cache:!1,data:{action:"wpmdb_activate_licence",licence_key:c,nonce:wpmdb_data.nonces.activate_licence,context:"licence"},error:function(a,c,e){C=!1,b(".register-licence-ajax-spinner").remove(),d.html(wpmdb_strings.register_license_problem)},success:function(a){if(b(".register-licence-ajax-spinner").remove(),"undefined"!=typeof a.errors){var e="";for(var f in a.errors)e+=a.errors[f];d.html(e),"undefined"!=typeof a.masked_licence&&(ea(a,c),b(".migrate-tab .invalid-licence").hide())}else"undefined"!=typeof a.wpmdb_error&&"undefined"!=typeof a.body?d.html(a.body):(1===Number(a.is_first_activation)&&(wpmdb_strings.welcome_text=wpmdb_strings.welcome_text.replace("%1$s","https://deliciousbrains.com/wp-migrate-db-pro/doc/quick-start-guide/?utm_campaign=support%2Bdocs&utm_source=MDB%2BPaid&utm_medium=insideplugin"),wpmdb_strings.welcome_text=wpmdb_strings.welcome_text.replace("%2$s","https://deliciousbrains.com/wp-migrate-db-pro/videos/?utm_campaign=support%2Bdocs&utm_source=MDB%2BPaid&utm_medium=insideplugin"),d.after('<div id="welcome-wrap"><img id="welcome-img" src="'+wpmdb_data.this_plugin_url+'asset/dist/img/welcome.jpg" /><div class="welcome-text"><h3>'+wpmdb_strings.welcome_title+"</h3><p>"+wpmdb_strings.welcome_text+"</p></div></div>")),d.html(wpmdb_strings.license_registered).delay(5e3).fadeOut(1e3,function(){b(this).css({visibility:"hidden",display:"block"}).slideUp()}),d.addClass("success notification-message success-notice"),ea(a,c),b(".invalid-licence").hide());C=!1}})}}),b(".clear-log").click(function(){b(".ajax-spinner, .ajax-success-msg").remove(),b(this).after(ba),b(".debug-log-textarea").val(""),b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_clear_log",nonce:wpmdb_data.nonces.clear_log},error:function(a,c,d){b(".ajax-spinner").remove(),alert(wpmdb_strings.clear_log_problem)},success:function(a){b(".ajax-spinner, .ajax-success-msg").remove(),fa(),b(".clear-log").after('<span class="ajax-success-msg">'+wpmdb_strings.clear_error_log+"</span>"),b(".ajax-success-msg").fadeOut(2e3,function(){b(this).remove()})}})}),b(".multiselect-select-all").click(function(){var a=b(this).parents(".select-wrap").children(".multiselect");b("option",a).prop("selected",1),b(a).focus().trigger("change")}),b(".multiselect-deselect-all").click(function(){var a=b(this).parents(".select-wrap").children(".multiselect");b("option",a).removeAttr("selected"),b(a).focus().trigger("change")}),b(".multiselect-invert-selection").click(function(){var a=b(this).parents(".select-wrap").children(".multiselect");b("option",a).each(function(){b(this).attr("selected",!b(this).attr("selected"))}),b(a).focus().trigger("change")}),b(".option-group input[type=radio]").change(function(){var a=b(this).closest(".option-group");b("ul",a).hide();var c=b(this).closest("li");b("ul",c).show()}),b(".option-group").each(function(){b(".option-group input[type=radio]").each(function(){if(b(this).is(":checked")){var a=b(this).closest("li");b("ul",a).show()}})}),b(".header-expand-collapse").click(function(){var a=null;void 0!==b(this).data("next")&&(a=b(this).data("next")),b(".expand-collapse-arrow",this).hasClass("collapsed")?(b(".expand-collapse-arrow",this).removeClass("collapsed"),a?b(a).show():b(this).next().show()):(b(".expand-collapse-arrow",this).addClass("collapsed"),a?b(a).hide():b(this).next().hide())}),b(".checkbox-label input[type=checkbox]").change(function(){b(this).is(":checked")?b(this).parent().next().show():b(this).parent().next().hide()}),b(".select-post-types-wrap").on("change","#select-post-types",function(){c.functions.exclude_post_types_warning()}),c.functions.exclude_post_types_warning=function(){var a=b("#select-post-types").val(),c="",d=b(".exclude-post-types-warning");a?(c="<code>"+a.join("</code>, <code>")+"</code>",b(".excluded-post-types").html(c),"0"===d.css("opacity")&&d.css({opacity:0}).slideDown(200).animate({opacity:1})):d.css({opacity:0}).slideUp(200).animate({opacity:0})},b("#exclude-post-types").is(":checked")&&b("#select-post-types").val()&&b(".exclude-post-types-warning").css({display:"block",opacity:1}),b("#save-migration-profile").change(function(){c.functions.update_migrate_button_text(),b(this).is(":checked")?b(".save-settings-button").show():b(".save-settings-button").hide()}),b("#save-migration-profile").is(":checked")&&b(".save-settings-button").show(),b(".create-new-profile").focus(function(){b("#create_new").prop("checked",!0)}),b(".checkbox-label input[type=checkbox]").each(function(){b(this).is(":checked")&&b(this).parent().next().show()}),b(".migrate-db-button").click(function(a){if(b(this).blur(),a.preventDefault(),c.migration_state_id="",!1!==b.wpmdb.apply_filters("wpmdb_migration_profile_ready",!0)&&!0!==c.functions.maybe_show_select_table_notice()){var e=!1,f=!1;if(b("#new-url").length&&!b("#new-url").val()&&(b("#new-url-missing-warning").show(),b("#new-url").focus(),b("html,body").scrollTop(0),e=!0),b("#new-path").length&&!b("#new-path").val()&&(b("#new-path-missing-warning").show(),!1===e&&(b("#new-path").focus(),b("html,body").scrollTop(0)),f=!0),!0===e||!0===f){if("import"!==wpmdb_migration_type())return;if(b("#import-find-replace").is(":checked"))return}b("#save-migration-profile").is(":checked")&&ha(),w=b(b("#migrate-form")[0].elements).not(".auth-credentials").serialize(),t=wpmdb_migration_type(),x="backup","savefile"===t&&(x="migrate"),!1===b("#create-backup").is(":checked")&&(x=-1!==b.inArray(t,["savefile","push","pull"])?"migrate":"import"===t?"upload":t),c.current_migration=c.migration_progress_controller.newMigration({localTableSizes:wpmdb_data.this_table_sizes,localTableRows:wpmdb_data.this_table_rows,remoteTableSizes:"undefined"!=typeof c.common.connection_data?c.common.connection_data.table_sizes:null,remoteTableRows:"undefined"!=typeof c.common.connection_data?c.common.connection_data.table_rows:null,migrationIntent:wpmdb_migration_type()});var g=b("input[name=backup_option]:checked").val(),h=b("input[name=table_migrate_option]:checked").val(),i="",k="";"backup"===x&&("migrate_only_with_prefix"===h&&"backup_selected"===g&&"import"!==t&&(g="backup_only_with_prefix"),"push"===t?(k="remote","backup_only_with_prefix"===g?P=c.common.connection_data.prefixed_tables:"backup_selected"===g?(i=b("#select-tables").val(),i=b.wpmdb.apply_filters("wpmdb_backup_selected_tables",i),P=d(i,c.common.connection_data.tables)):"backup_manual_select"===g&&(P=b("#select-backup").val())):(k="local","backup_only_with_prefix"===g?P=wpmdb_data.this_prefixed_tables:"backup_selected"===g?(i=b("#select-tables").val(),i=b.wpmdb.apply_filters("wpmdb_backup_selected_tables",i),P=d(i,wpmdb_data.this_tables)):"backup_manual_select"===g&&(P=b("#select-backup").val())),c.current_migration.model.addStage("backup",P,k,{strings:{migrated:wpmdb_strings.backed_up}})),k="pull"===t?"remote":"local","find_replace"===t?c.current_migration.model.addStage("find_replace",c.functions.get_tables_to_migrate(null,null),k,{strings:{migrated:wpmdb_strings.searched,stage_title:wpmdb_strings.migrate_button_find_replace}}):-1!==b.inArray(t,["savefile","push","pull"])&&c.current_migration.model.addStage("migrate",c.functions.get_tables_to_migrate(null,null),k),b.wpmdb.do_action("wpmdb_add_migration_stages",{data_type:k,tables_to_migrate:c.functions.get_tables_to_migrate(null,null)});var l=(b("input[name=table_migrate_option]:checked").val(),b.trim(b(".pull-push-connection-info").val()).split("\n"));u=l[0],v=l[1];var m=j(u,t,"migrating");y=j(u,t,"completed"),-1!==b.inArray(x,["find_replace","backup","migrate"])&&(P=c.current_migration.model.getStageItems(x,"name")),c.current_migration.model.setActiveStage(x),c.current_migration.setTitle(m),c.current_migration.startTimer(),M=!0,c.current_migration.setStatus("active");var n={action:"wpmdb_initiate_migration",intent:t,url:u,key:v,form_data:w,stage:x,nonce:wpmdb_data.nonces.initiate_migration};n.site_details={local:wpmdb_data.site_details},-1!==b.inArray(t,["push","pull"])&&(n.temp_prefix=c.common.connection_data.temp_prefix,n.site_details.remote=c.common.connection_data.site_details),n.site_details=JSON.stringify(n.site_details),n=b.wpmdb.apply_filters("wpmdb_initiate_migration_request_data",n,n),B=!0,b.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:n,error:function(a,b,d){c.current_migration.setState(wpmdb_strings.migration_failed,la(a.responseText,"(#112)",a),"error"),console.log(a),console.log(b),console.log(d),B=!1,c.common.migration_error=!0,c.functions.migration_complete_events()},success:function(a){if(B=!1,"undefined"!=typeof a&&"undefined"!=typeof a.wpmdb_error&&1===a.wpmdb_error)return c.common.migration_error=!0,c.functions.migration_complete_events(),void c.current_migration.setState(wpmdb_strings.migration_failed,a.body,"error");c.migration_state_id=a.migration_state_id;var d=0;Y=0,("savefile"!==t&&"undefined"!=typeof c.common.connection_data&&"undefined"!=typeof c.common.connection_data.delay_between_requests||"import"===t)&&(Y="import"===t?wpmdb_data.delay_between_requests:Math.max(parseInt(wpmdb_data.delay_between_requests),parseInt(c.common.connection_data.delay_between_requests))),c.functions.migrate_table_recursive=function(a,e){if(d>=P.length)if("upload"===x&&c.current_migration.model.getStageItems("find_replace").length)x="find_replace",P=c.current_migration.model.getStageItems("find_replace","name"),P=P.map(function(a){return"_mig_"+a}),d=0;else{if("backup"!==x)return b(".progress-label").removeClass("label-visible"),c.common.hooks=b.wpmdb.apply_filters("wpmdb_before_migration_complete_hooks",c.common.hooks),c.common.hooks.push(c.functions.migration_complete),c.common.hooks.push(c.functions.wpmdb_flush),c.common.hooks=b.wpmdb.apply_filters("wpmdb_after_migration_complete_hooks",c.common.hooks),c.common.hooks.push(c.functions.migration_complete_events),c.common.next_step_in_migration={fn:wpmdb_call_next_hook},void c.functions.execute_next_step();if(x=-1!==b.inArray(t,["push","pull"])?"migrate":"import"===t?"upload":t,c.current_migration.model.setActiveStage(x),"find_replace"!==x&&"migrate"!==x)return void wpmdb_call_next_hook();d=0,P=c.functions.get_tables_to_migrate(null,null)}var f=0;d===P.length-1&&(f=1);var g=0;-1!==b.inArray(t,["push","pull"])&&1===parseInt(c.common.connection_data.gzip)&&(g=1);var h={action:"wpmdb_migrate_table",migration_state_id:c.migration_state_id,table:P[d],stage:x,current_row:a,last_table:f,primary_keys:e,gzip:g,nonce:wpmdb_data.nonces.migrate_table};-1!==b.inArray(t,["push","pull"])&&(h.bottleneck=c.common.connection_data.bottleneck,h.prefix=c.common.connection_data.prefix),c.common.connection_data&&c.common.connection_data.path_current_site&&c.common.connection_data.domain&&(h.path_current_site=c.common.connection_data.path_current_site,h.domain_current_site=c.common.connection_data.domain),B=!0,b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,timeout:0,data:h,error:function(a,b,e){var f=wpmdb_strings.table_process_problem+" "+P[d]+"<br /><br />"+wpmdb_strings.status+": "+a.status+" "+a.statusText+"<br /><br />"+wpmdb_strings.response+":<br />"+a.responseText;c.current_migration.setState(wpmdb_strings.migration_failed,f,"error"),B=!1,console.log(a),console.log(b),console.log(e),c.common.migration_error=!0,c.functions.migration_complete_events()},success:function(a){B=!1,a=b.trim(a);var e=wpmdb_parse_json(a),g="";if(!1===e||null===e)return g=""===a||null===a?wpmdb_strings.table_process_problem_empty_response+" "+P[d]:la(a,null,null),c.current_migration.setState(wpmdb_strings.migration_failed,g,"error"),c.common.migration_error=!0,void c.functions.migration_complete_events();if("undefined"!=typeof e.wpmdb_error&&1===e.wpmdb_error)return c.current_migration.setState(wpmdb_strings.migration_failed,e.body,"error"),c.common.migration_error=!0,void c.functions.migration_complete_events();var h=P[d];"import"===t&&"find_replace"===x&&(h=h.replace(wpmdb_data.this_temp_prefix,"")),c.current_migration.setText(),c.current_migration.model.getStageModel(x).setItemRowsTransferred(h,e.current_row),1===f&&"savefile"===t&&("undefined"!=typeof e.dump_filename&&(N=e.dump_filename),"undefined"!=typeof e.dump_path&&(O=e.dump_path)),-1===parseInt(e.current_row)&&(d++,e.current_row="",e.primary_keys=""),c.common.next_step_in_migration={fn:c.functions.migrate_table_recursive,args:[e.current_row,e.primary_keys]},c.functions.execute_next_step()}})},-1!==b.inArray(t,["savefile","push","pull","find_replace"])&&(c.common.next_step_in_migration={fn:c.functions.migrate_table_recursive,args:["-1",""]},c.functions.execute_next_step()),b.wpmdb.do_action("wpmdb_migration_initiated",x)}})}}),c.functions.migration_complete_events=function(){if(!1===c.common.migration_error)if(""===c.common.non_fatal_errors)if("savefile"!==t&&!0===b("#save_computer").is(":checked")&&c.current_migration.setText(),y+='&nbsp;<div class="dashicons dashicons-yes"></div>',!0===W){var a=wpmdb_strings.migration_cancelled_success;"find_replace"===t&&(a=wpmdb_strings.find_replace_cancelled_success),c.current_migration.setState(y,a,"cancelled")}else c.current_migration.setState(y,"","complete");else c.current_migration.setState(wpmdb_strings.completed_with_some_errors,c.common.non_fatal_errors,"error");b(".migration-controls").addClass("hidden"),c.common.hooks=[],c.common.call_stack=[],c.common.migration_error=!1,M=!1,L=!0,Q=!1,W=!1,B=!1,c.common.non_fatal_errors="",P=[],b(".progress-label").remove(),b(".migration-progress-ajax-spinner").remove(),b(".close-progress-content").show(),b("#overlay").css("cursor","pointer"),c.current_migration.model.setMigrationComplete()},c.functions.migration_complete=function(){if(b(".migration-controls").addClass("hidden"),"savefile"===t){M=!1;var a=wpmdb_strings.migration_complete;if(b("#save_computer").is(":checked")){var d=wpmdb_data.this_download_url+encodeURIComponent(N);b("#gzip_file").is(":checked")&&(d+="&gzip=1"),window.location=d}else a=wpmdb_strings.completed_dump_located_at+" "+O;!1===c.common.migration_error&&(c.functions.migration_complete_events(),c.current_migration.setState(y,a,"complete"))}else{c.current_migration.setState(null,wpmdb_strings.finalizing_migration,"finalizing");var e={action:"wpmdb_finalize_migration",migration_state_id:c.migration_state_id,tables:P.join(","),nonce:wpmdb_data.nonces.finalize_migration};-1!==b.inArray(t,["push","pull"])&&(e.prefix=c.common.connection_data.prefix),B=!0,b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:e,error:function(a,b,d){B=!1,c.current_migration.setState(wpmdb_strings.migration_failed,wpmdb_strings.finalize_tables_problem,"error"),alert(a+" : "+b+" : "+d),c.common.migration_error=!0,c.functions.migration_complete_events()},success:function(a){return B=!1,"1"!==b.trim(a)?(c.current_migration.setState(wpmdb_strings.migration_failed,a,"error"),c.common.migration_error=!0,void c.functions.migration_complete_events()):(c.common.next_step_in_migration={fn:wpmdb_call_next_hook},void c.functions.execute_next_step())}})}},c.functions.wpmdb_flush=function(){"savefile"!==t&&(c.current_migration.setText(wpmdb_strings.flushing),B=!0,b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,
3
- data:{action:"wpmdb_flush",migration_state_id:c.migration_state_id,nonce:wpmdb_data.nonces.flush},error:function(a,b,d){B=!1,c.current_migration.setState(wpmdb_strings.migration_failed,wpmdb_strings.flush_problem,"error"),alert(a+" : "+b+" : "+d),c.common.migration_error=!0,c.functions.migration_complete_events()},success:function(a){return B=!1,"1"!==b.trim(a)?(c.current_migration.setState(wpmdb_strings.migration_failed,a,"error"),c.common.migration_error=!0,void c.functions.migration_complete_events()):(c.common.next_step_in_migration={fn:wpmdb_call_next_hook},void c.functions.execute_next_step())}}))},c.functions.update_migrate_button_text=function(){var a=wpmdb_migration_type(),c=b("#save-migration-profile").is(":checked")?"_save":"",d="migrate_button_"+("savefile"===a?"export":a)+c;b(".migrate-db .button-primary").val(wpmdb_strings[d])},c.functions.update_migrate_button_text(),b("body").on("click",".close-progress-content-button",function(a){ga(),c.current_migration.restoreTitleElem(),c.functions.maybe_reload_page()}),b("body").on("click","#overlay",function(a){!0===L&&a.target===this&&(ga(),c.current_migration.restoreTitleElem(),c.functions.maybe_reload_page())}),b(".save-settings-button").click(function(a){return a.preventDefault(),""===b.trim(b(".create-new-profile").val())&&b("#create_new").is(":checked")?(alert(wpmdb_strings.enter_name_for_profile),void b(".create-new-profile").focus()):void ha()});var Ba=b(".connection-info-wrapper");ia(),b(".migrate-selection.option-group input[type=radio]").change(function(){ia(),c.migration_selection=wpmdb_migration_type(),z&&ka(),c.functions.update_migrate_button_text()}),"pull"!==wpmdb_migration_type()&&"push"!==wpmdb_migration_type()||z||(b(".step-two").hide(),b(".connection-status").show()),b(".general-helper").click(function(a){a.preventDefault();var c=b(this),d=b(this).next();b(".helper-message").not(d).hide();var e=c.position();if(d.hasClass("bottom")){var f=1;!0===d.hasClass("compatibility-help")?f=6:b(this).is(":first-child")&&(f=3),d.css({left:e.left-d.width()/2-f+"px",top:e.top+c.height()+9+"px"})}else d.css({left:e.left+c.width()+9+"px",top:e.top+c.height()/2-18+"px"});d.toggle(),a.stopPropagation()}),b("body").click(function(){b(".helper-message").hide()}),b(".helper-message").click(function(a){a.stopPropagation()}),b("body").on("click",".show-errors-toggle",function(a){a.preventDefault(),b(this).next(".migration-php-errors").toggle()}),b(".nav-tab").click(function(){var a=b(this).attr("data-div-name");a=a.replace("-tab",""),window.location.hash=a,na(a,!1)}),b("body").on("click",'a[href^="#"]',function(a){var c=b(a.target).attr("href"),d=c.substr(1);if(d){var e=b("."+d);1===e.length&&(e.trigger("click"),a.preventDefault())}}),b("body").on("click",".add-row",function(){var a=b(this).parents("tr");a.before(b(".original-repeatable-field").clone().removeClass("original-repeatable-field")),a.prev().find(".old-replace-col input").focus()}),b("body").on("click",".replace-remove-row",function(){b(this).parents("tr").remove(),2>=b(".replace-row").length&&b(".no-replaces-message").show();var a=b(this).prev().attr("id");"new-url"!==a&&"new-path"!==a||b("#"+a+"-missing-warning").hide()}),b("body").on("change","#new-url",function(){b("#new-url-missing-warning").hide()}).on("change","#new-path",function(){b("#new-path-missing-warning").hide()}),b("body").on("click",".arrow-col",function(){var a=this;if(!b(a).hasClass("disabled")){var c=b(a).prev("td").find("input").val(),d=b(a).next("td").find("input");d.val(c),"new-url"===d.prop("id")?b("#new-url-missing-warning").hide():"new-path"===d.prop("id")&&b("#new-path-missing-warning").hide()}}),b(".add-replace").click(function(){b(".replace-fields").prepend(b(".original-repeatable-field").clone().removeClass("original-repeatable-field")),b(".no-replaces-message").hide()}),b("#find-and-replace-sort tbody").sortable({items:"> tr:not(.pin)",handle:"td:first",start:function(){b(".sort-handle").css("cursor","-webkit-grabbing"),b(".sort-handle").css("cursor","-moz-grabbing")},stop:function(){b(".sort-handle").css("cursor","-webkit-grab"),b(".sort-handle").css("cursor","-moz-grab")}});var Ca="";window.location.hash&&(Ca=window.location.hash.substring(1),na(Ca,!1)),""!==e("install-plugin")&&(Ca="addons",H=!0,na(Ca,!0)),b(".notice-link").click(function(a){a.preventDefault(),c.functions.ajax_handle_dismissible_notice(wpmdb_data.nonces.process_notice_link,function(a){b(a).closest(".inline-message").hide()},b(this))}),b("#connection_info").on("copy",function(a){var c=b(this),d=c.val().split("\n");if(2===d.length)try{a.originalEvent.clipboardData.setData("text/plain",d.join(" ")),a.preventDefault()}catch(e){}}),b(".reset-api-key").click(function(){var a=confirm(wpmdb_strings.reset_api_key);a&&!D&&(D=!0,b(".reset-api-key").after('<img src="'+aa+'" alt="" class="reset-api-key-ajax-spinner general-spinner" />'),b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_reset_api_key",nonce:wpmdb_data.nonces.reset_api_key},error:function(a,c,d){alert(wpmdb_strings.reset_api_key_problem),b(".reset-api-key-ajax-spinner").remove(),D=!1},success:function(a){b(".reset-api-key-ajax-spinner").remove(),D=!1,b(".connection-info").html(a),wpmdb_data.connection_info=b.trim(a).split("\n")}}))}),b(".copy-api-key").click(function(){var a=b(this),c=b("#connection_info"),d=c.val(),e=d.replace("\n"," ");c.val(e),c.select();try{document.execCommand("copy"),c.blur(),a.css("color","transparent");var f=b(".copy-api-key-confirmation").show();setTimeout(function(){f.fadeOut("fast"),setTimeout(function(){a.css("color","")},200)},1e3)}catch(g){alert("please press Ctrl/Cmd+C to copy")}c.val(d)}),b("input[name=table_migrate_option]").change(function(){b(".select-tables-wrap").hide(),"migrate_select"===b(this).val()&&b(".select-tables-wrap").show()}),b(".show-multiselect").each(function(){b(this).is(":checked")&&(b(this).parents(".option-section").children(".header-expand-collapse").children(".expand-collapse-arrow").removeClass("collapsed"),b(this).parents(".expandable-content").show(),b(this).parents(".expandable-content").children(".select-wrap").toggle())}),b("input[name=backup_option]").change(function(){b(".backup-tables-wrap").hide(),"backup_manual_select"===b(this).val()&&b(".backup-tables-wrap").show()}),b("#backup-manual-select").is(":checked")&&b(".backup-tables-wrap").show(),b(".plugin-compatibility-save").click(function(){if(!F){b(this).addClass("disabled");var a=b("#selected-plugins");b(a).attr("disabled","disabled"),b(".plugin-compatibility-success-msg").remove(),F=!0,b(this).after('<img src="'+aa+'" alt="" class="plugin-compatibility-spinner general-spinner" />'),b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_whitelist_plugins",whitelist_plugins:b(a).val(),nonce:wpmdb_data.nonces.whitelist_plugins},error:function(c,d,e){alert(wpmdb_strings.blacklist_problem+"\r\n\r\n"+wpmdb_strings.status+" "+c.status+" "+c.statusText+"\r\n\r\n"+wpmdb_strings.response+"\r\n"+c.responseText),b(a).removeAttr("disabled"),b(".plugin-compatibility-save").removeClass("disabled"),F=!1,b(".plugin-compatibility-spinner").remove()},success:function(c){""!==b.trim(c)&&alert(c),b(a).removeAttr("disabled"),b(".plugin-compatibility-save").removeClass("disabled"),F=!1,b(".plugin-compatibility-spinner").remove(),b(".plugin-compatibility-save").after('<span class="plugin-compatibility-success-msg">'+wpmdb_strings.saved+"</span>"),b(".plugin-compatibility-success-msg").fadeOut(2e3)}})}}),b("body").on("click",".delete-profile",function(){var a=b(this).next().clone();b("input",a).remove(),a=b.trim(b(a).html());var c=confirm(wpmdb_strings.remove_profile.replace("{{profile}}",a));if(c){var d=b(this).parent();if(d.find("input:checked").length){var e=d.siblings().last();if(e.find("input[type=radio]").prop("checked","checked"),e.find("input[type=text]").focus(),b("#migrate-form .crumbs .crumb:last").text("New Profile"),"function"==typeof window.history.pushState){var f=window.location.href.replace("#migrate","").replace(/&wpmdb-profile=-?\d+/,"")+"&wpmdb-profile=-1";window.history.pushState({updated_profile_id:-1},null,f)}}d.fadeOut(500),b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_delete_migration_profile",profile_id:b(this).attr("data-profile-id"),nonce:wpmdb_data.nonces.delete_migration_profile},error:function(a,b,c){alert(wpmdb_strings.remove_profile_problem)},success:function(a){"-1"===a&&alert(wpmdb_strings.remove_profile_not_found)}})}}),b(".main-list-delete-profile-link").click(function(){var a=b(this).prev().html(),c=confirm(wpmdb_strings.remove_profile.replace("{{profile}}",a));c&&(b(this).parent().fadeOut(500),b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_delete_migration_profile",profile_id:b(this).attr("data-profile-id"),nonce:wpmdb_data.nonces.delete_migration_profile},error:function(a,b,c){alert(wpmdb_strings.remove_profile_problem)}}))}),b("body").on("click",".temp-disabled",function(){var a=confirm(wpmdb_strings.change_connection_info);a&&(b(".ssl-notice").hide(),b(".different-plugin-version-notice").hide(),b(".migrate-db-button").show(),b(".temp-disabled").removeAttr("readonly"),b(".temp-disabled").removeClass("temp-disabled"),b(".connect-button").show(),b(".step-two").hide(),b(".connection-status").show().html(wpmdb_strings.enter_connection_info),z=!1)}),b(".settings-tab input[type=checkbox]").change(function(){if("plugin-compatibility"!==b(this).attr("id")){var a=b(this).is(":checked"),c=b(this).attr("id"),d=b(this).closest("td").next("td").find(".setting-status");b(".ajax-success-msg").remove(),d.after(ba),b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_setting",checked:a,setting:c,nonce:wpmdb_data.nonces.save_setting},error:function(a,c,d){alert(wpmdb_strings.save_settings_problem),b(".ajax-spinner").remove()},success:function(a){b(".ajax-spinner").remove(),d.append('<span class="ajax-success-msg">'+wpmdb_strings.saved+"</span>"),b(".ajax-success-msg").fadeOut(2e3,function(){b(this).remove()})}})}}),b(".migrate-form").submit(function(a){a.preventDefault()}),b(".connect-button").click(function(a){a.preventDefault(),b(this).blur(),c.functions.connection_box_changed()}),b(".pull-push-connection-info").bind("paste",function(a){setTimeout(function(){c.functions.connection_box_changed()},0)}),b("body").on("click",".try-again",function(){b(".pull-push-connection-info").removeClass("temp-disabled"),c.functions.connection_box_changed()}),b("body").on("click",".try-http",function(){var a=b.trim(b(".pull-push-connection-info").val()).split("\n"),d=a[0].replace("https","http"),e=d+"\n"+a[1];b(".pull-push-connection-info").val(e),c.functions.connection_box_changed()}),b(".create-new-profile").change(function(){G=!0}),b("body").on("click",".temporarily-disable-ssl",function(){var a="";window.location.hash&&(a=window.location.hash.substring(1)),b(this).attr("href",b(this).attr("href")+"&hash="+a)}),c.functions.connection_box_changed=function(){var a=b(".pull-push-connection-info");if(-1!==b.inArray(wpmdb_migration_type(),["push","pull"])&&(!B&&!b(a).hasClass("temp-disabled")||!1!==c.force_reconnect)){c.force_reconnect=!1;var d=b(".pull-push-connection-info").val(),e=b.trim(d).split("\n"),j=!1,m="";if(""===e&&(j=!0,m=wpmdb_strings.connection_info_missing),1===e.length&&!j){var n=b.trim(d).split(" ");2===n.length&&(e=n)}2===e.length||j||(j=!0,m=wpmdb_strings.connection_info_incorrect),j||ma(e[0])||(j=!0,m=wpmdb_strings.connection_info_url_invalid);var o=0;if("undefined"!=typeof e[1]&&(o=e[1].length),j||32===o||40===o||(j=!0,m=wpmdb_strings.connection_info_key_invalid),j||e[0]!==wpmdb_data.connection_info[0]||(j=!0,m=wpmdb_strings.connection_info_local_url),j||e[1]!==wpmdb_data.connection_info[1]||(j=!0,m=wpmdb_strings.connection_info_local_key),j)return b(".connection-status").html(m),void b(".connection-status").addClass("notification-message error-notice migration-error");var p=e[0]+"\n"+e[1];1===b.trim(d).split("\n").length&&b(".pull-push-connection-info").val(p),!1===wpmdb_data.openssl_available&&(e[0]=e[0].replace("https://","http://"),p=e[0]+"\n"+e[1],b(".pull-push-connection-info").val(p)),I=!1,B=!0,k(),b(".basic-access-auth-wrapper").is(":visible")&&(e[0]=e[0].replace(/\/\/(.*)@/,"//"),e[0]=e[0].replace("//","//"+encodeURIComponent(b.trim(b(".auth-username").val()))+":"+encodeURIComponent(b.trim(b(".auth-password").val()))+"@"),p=e[0]+"\n"+e[1],b(".pull-push-connection-info").val(p),b(".basic-access-auth-wrapper").hide()),b(".step-two").hide(),b(".ssl-notice").hide(),b(".prefix-notice").hide(),b(".connection-status").show(),b(".connection-status").html(wpmdb_strings.establishing_remote_connection),b(".connection-status").removeClass("notification-message error-notice migration-error"),b(".connection-status").append(ba);var q=wpmdb_migration_type();return G=!1,b.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_verify_connection_to_remote_site",url:e[0],key:e[1],intent:q,nonce:wpmdb_data.nonces.verify_connection_to_remote_site},error:function(a,c,d){b(".connection-status").html(la(a.responseText,"(#100)",a)),b(".connection-status").addClass("notification-message error-notice migration-error"),b(".ajax-spinner").remove(),B=!1,l()},success:function(a){if(b(".ajax-spinner").remove(),B=!1,l(),"undefined"!=typeof a.wpmdb_error&&1===a.wpmdb_error)return b(".connection-status").html(a.body),b(".connection-status").addClass("notification-message error-notice migration-error"),a.body.indexOf("401 Unauthorized")>-1&&b(".basic-access-auth-wrapper").show(),void(b(".pull-push-connection-info").hasClass("temp-disabled")||b(".connect-button").is(":visible")||(b(".pull-push-connection-info").removeAttr("readonly"),b(".connect-button").show()));f(e[0],e[1],a.scheme);var d=h(a.url);b(".create-new-profile").val(d),b(".pull-push-connection-info").addClass("temp-disabled"),b(".pull-push-connection-info").attr("readonly","readonly"),b(".connect-button").hide(),b(".connection-status").hide(),b(".step-two").show(),c.functions.maybe_show_prefix_notice(a.prefix),z=!0,r(a),ia(),ka(),g(),i(),za=b(wa).clone(),b(za).attr({name:"select_backup[]",id:"select-backup"});var j=document.createElement("select");b(j).attr({multiple:"multiple",name:"select_post_types[]",id:"select-post-types","class":"multiselect"}),b.each(c.common.connection_data.post_types,function(a,c){b(j).append('<option value="'+c+'">'+c+"</option>")}),ya=j,b("#new-path-missing-warning, #new-url-missing-warning").hide(),"pull"===wpmdb_migration_type()?(b("#new-url").val(c.functions.remove_protocol(wpmdb_data.this_url)),b("#new-path").val(wpmdb_data.this_path),"true"===wpmdb_data.is_multisite&&(b("#new-domain").val(wpmdb_data.this_domain),b('.replace-row.pin .old-replace-col input[type="text"]').val(c.functions.remove_protocol(a.url))),b("#old-url").val(c.functions.remove_protocol(a.url)),b("#old-path").val(a.path),b.wpmdb.do_action("wpmdb_update_pull_table_select"),b("#select-post-types").remove(),b(".exclude-post-types-warning").after(ya),c.functions.exclude_post_types_warning(),b(".table-prefix").html(a.prefix),b(".backup-table-prefix").html(wpmdb_data.site_details.prefix),b(".uploads-dir").html(wpmdb_data.this_uploads_dir)):(b("#new-url").val(c.functions.remove_protocol(a.url)),b("#new-path").val(a.path),"true"===wpmdb_data.is_multisite&&b('.replace-row.pin .old-replace-col input[type="text"]').val(c.functions.remove_protocol(wpmdb_data.this_url)),b.wpmdb.do_action("wpmdb_update_push_table_select"),b("#select-backup").remove(),b(".backup-tables-wrap").prepend(za)),c.common.next_step_in_migration={fn:b.wpmdb.do_action,args:["verify_connection_to_remote_site",c.common.connection_data]},c.functions.execute_next_step()}})}},b("body").on("click",".pause-resume",function(a){n(a)}),b("body").on("click",".cancel",function(a){pa(a)}),b(".enter-licence").click(function(){b(".settings").click(),b(".licence-input").focus()}),c.functions.execute_next_step=function(){if(Y>0&&!1===X)return void setTimeout(function(){X=!0,c.functions.execute_next_step()},Y);if(X=!1,!0===Q){b(".migration-progress-ajax-spinner").hide(),c.current_migration.pauseTimer();var a="";return!0===_?(a=wpmdb_strings.paused_before_finalize,_=!1,"find_replace"===wpmdb_migration_type()&&(a=wpmdb_strings.find_replace_paused_before_finalize)):a=wpmdb_strings.paused,c.current_migration.setState(null,a,"paused"),b("body").on("click",".pause-resume",function(a){n(a)}),b("body").on("click",".cancel",function(a){pa(a)}),void b(".pause-resume").html(wpmdb_strings.resume)}if(!0===W){t=wpmdb_migration_type();var d;"savefile"===t?d=wpmdb_strings.removing_local_sql:"pull"===t?d="backup"===x?wpmdb_strings.removing_local_backup:wpmdb_strings.removing_local_temp_tables:"push"===t&&(d="backup"===x?wpmdb_strings.removing_remote_sql:wpmdb_strings.removing_remote_temp_tables),c.current_migration.setText(d);var e={action:"wpmdb_cancel_migration",migration_state_id:c.migration_state_id,nonce:wpmdb_data.nonces.cancel_migration};B=!0,b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:e,error:function(a,b,d){c.current_migration.setState(wpmdb_strings.migration_cancellation_failed,wpmdb_strings.manually_remove_temp_files+"<br /><br />"+wpmdb_strings.status+": "+a.status+" "+a.statusText+"<br /><br />"+wpmdb_strings.response+":<br />"+a.responseText,"error"),console.log(a),console.log(b),console.log(d),B=!1,c.common.migration_error=!0,c.functions.migration_complete_events()},success:function(a){return B=!1,a=b.trim(a),"push"===t&&"1"!==a||"push"!==t&&""!==a?("undefined"!=typeof a&&"undefined"!=typeof a.wpmdb_error&&1===a.wpmdb_error&&(a=a.wpmdb_error),c.current_migration.setState(wpmdb_strings.migration_cancellation_failed,a,"error"),c.common.migration_error=!0,void c.functions.migration_complete_events()):(y=wpmdb_strings.migration_cancelled,"find_replace"===t&&(y=wpmdb_strings.find_replace_cancelled),c.functions.migration_complete_events(),void c.current_migration.setStatus("cancelled"))}})}else c.common.next_step_in_migration.fn.apply(null,c.common.next_step_in_migration.args)},b("body").on("click",".copy-licence-to-remote-site",function(){b(".connection-status").html(wpmdb_strings.copying_license),b(".connection-status").removeClass("notification-message error-notice migration-error"),b(".connection-status").append(ba);var a=b.trim(b(".pull-push-connection-info").val()).split("\n");B=!0,k(),b.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_copy_licence_to_remote_site",url:a[0],key:a[1],nonce:wpmdb_data.nonces.copy_licence_to_remote_site},error:function(a,c,d){b(".connection-status").html(la(a.responseText,"(#143)",a)),b(".connection-status").addClass("notification-message error-notice migration-error"),b(".ajax-spinner").remove(),B=!1,l()},success:function(a){return b(".ajax-spinner").remove(),B=!1,l(),"undefined"!=typeof a.wpmdb_error&&1===a.wpmdb_error?(b(".connection-status").html(a.body),b(".connection-status").addClass("notification-message error-notice migration-error"),void(a.body.indexOf("401 Unauthorized")>-1&&b(".basic-access-auth-wrapper").show())):void c.functions.connection_box_changed()}})}),b("body").on("click",".reactivate-licence",function(a){B=!0,b(".invalid-licence").empty().html(wpmdb_strings.attempting_to_activate_licence),b(".invalid-licence").append(ba),b.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_reactivate_licence",nonce:wpmdb_data.nonces.reactivate_licence},error:function(a,c,d){b(".invalid-licence").html(wpmdb_strings.activate_licence_problem),b(".invalid-licence").append("<br /><br />"+wpmdb_strings.status+": "+a.status+" "+a.statusText+"<br /><br />"+wpmdb_strings.response+"<br />"+a.responseText),b(".ajax-spinner").remove(),B=!1},success:function(a){return b(".ajax-spinner").remove(),B=!1,"undefined"!=typeof a.wpmdb_error&&1===a.wpmdb_error?void b(".invalid-licence").html(a.body):"undefined"!=typeof a.wpmdb_dbrains_api_down&&1===a.wpmdb_dbrains_api_down?(b(".invalid-licence").html(wpmdb_strings.temporarily_activated_licence),void b(".invalid-licence").append(a.body)):(b(".invalid-licence").empty().html(wpmdb_strings.licence_reactivated),void location.reload())}})}),b("input[name=table_migrate_option]").change(function(){g(),b.wpmdb.do_action("wpmdb_tables_to_migrate_changed")}),b("body").on("change","#select-tables",function(){g(),b.wpmdb.do_action("wpmdb_tables_to_migrate_changed")}),b.wpmdb.add_filter("wpmdb_get_table_prefix",p),b.wpmdb.add_filter("wpmdb_get_tables_to_migrate",c.functions.get_tables_to_migrate),b.wpmdb.add_action("wpmdb_lock_replace_url",q),b.wpmdb.add_action("move_connection_info_box",c.functions.exclude_post_types_warning),b.wpmdb.add_filter("wpmdb_before_migration_complete_hooks",function(a){return $=!!b("input[name=pause_before_finalize]:checked").length,!0===$&&"savefile"!==t&&(n(null),_=!0),a}),b(".wpmdb-switch").on("click",function(a){b(this).hasClass("disabled")||qa(b(this).attr("id"))})})}(jQuery,wpmdb)},{"MigrationProgress-controller":1}]},{},[1,2,3,4,5,6,7]);
 
 
 
asset/dist/js/script-102.js ADDED
@@ -0,0 +1,5310 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2
+ 'use strict';
3
+
4
+ // global vars
5
+ window.wpmdb = window.wpmdb || {};
6
+ wpmdb.common = {
7
+ hooks: [],
8
+ call_stack: [],
9
+ non_fatal_errors: '',
10
+ migration_error: false
11
+ };
12
+ wpmdb.functions = {};
13
+
14
+ /**
15
+ * Toggle proper translated strings based on migration type selected.
16
+ *
17
+ * To show the properly translated strings for the selected push or pull
18
+ * migration type, we need to hide all strings then show the right
19
+ * translated strings based on the migration type selected.
20
+ *
21
+ * @see https://github.com/deliciousbrains/wp-migrate-db-pro/issues/764
22
+ *
23
+ * @return void
24
+ */
25
+ wpmdb.functions.wpmdb_toggle_migration_action_text = function () {
26
+ jQuery('.action-text').hide();
27
+ jQuery('.action-text.' + jQuery('input[name=action]:checked').val()).show();
28
+ };
29
+
30
+ /**
31
+ * Return the currently selected migration type selected.
32
+ *
33
+ * @return string Will return `push`, `pull`, `savefile`, or `` for exporting as a file.
34
+ */
35
+ wpmdb.functions.wpmdb_migration_type = function () {
36
+ var action = jQuery('input[name=action]:checked');
37
+ if (0 === action.length) {
38
+ return '';
39
+ }
40
+ return action.val();
41
+ };
42
+
43
+ wpmdb.functions.wpmdb_call_next_hook = function () {
44
+ if (!wpmdb.common.call_stack.length) {
45
+ wpmdb.common.call_stack = wpmdb.common.hooks;
46
+ }
47
+
48
+ var func = wpmdb.common.call_stack[0];
49
+ wpmdb.common.call_stack.shift();
50
+ func.call(this);
51
+ };
52
+
53
+ wpmdb.functions.wpmdb_add_commas = function (number_string) {
54
+ number_string += '';
55
+ var number_parts = number_string.split('.');
56
+ var integer = number_parts[0];
57
+ var decimal = 1 < number_parts.length ? '.' + number_parts[1] : '';
58
+ var rgx = /(\d+)(\d{3})/;
59
+ while (rgx.test(integer)) {
60
+ integer = integer.replace(rgx, '$1' + ',' + '$2');
61
+ }
62
+ return integer + decimal;
63
+ };
64
+
65
+ wpmdb.functions.wpmdb_parse_json = function (maybe_json) {
66
+ var json_object = {};
67
+ try {
68
+ json_object = jQuery.parseJSON(maybe_json);
69
+ } catch (e) {
70
+
71
+ // We simply return false here because the json data itself will never just contain a value of "false"
72
+ return false;
73
+ }
74
+ return json_object;
75
+ };
76
+ /**
77
+ * Global error method for detecting PHP or other errors in AJAX response
78
+ *
79
+ * @param title - the error title if not a PHP error
80
+ * @param code - the error code if not a PHP error
81
+ * @param text - the AJAX response text to sniff for errors
82
+ * @param jqXHR - optional AJAX object used to enrich the error message
83
+ *
84
+ * @returns {string} - html error string with view error toggle element
85
+ */
86
+ wpmdb.functions.wpmdbGetAjaxErrors = function (title, code, text, jqXHR) {
87
+ var jsonErrors = false;
88
+ var html = '';
89
+
90
+ var validJson = wpmdb.functions.wpmdb_parse_json(text);
91
+ if (false === validJson) {
92
+ jsonErrors = true;
93
+ title = wpmdb_strings.ajax_json_message;
94
+ code = '(#144)';
95
+ var originalText = text;
96
+ text = wpmdb_strings.ajax_json_errors + ' ' + code;
97
+ text += '<br><a class="show-errors-toggle" href="#">' + wpmdb_strings.view_error_messages + '</a> ';
98
+ text += '<div class="migration-php-errors">' + originalText + '</div>';
99
+ }
100
+
101
+ // Only add local connection issue if php errors (#144) or jqXHR has been provided
102
+ if (jsonErrors || 'undefined' !== jqXHR) {
103
+ html += '<strong>' + title + '</strong>' + ' &mdash; ';
104
+ }
105
+
106
+ // Only add extra error details if not php errors (#144) and jqXHR has been provided
107
+ if (!jsonErrors && 'undefined' !== jqXHR) {
108
+ html += wpmdb_strings.status + ': ' + jqXHR.status + ' ' + jqXHR.statusText;
109
+ html += '<br /><br />' + wpmdb_strings.response + ':<br />';
110
+ }
111
+
112
+ // Add code to the end of the error text if not json errors
113
+ if (!jsonErrors) {
114
+ text += ' ' + code;
115
+ }
116
+
117
+ // Finally add the error message to the output
118
+ html += text;
119
+
120
+ return html;
121
+ };
122
+
123
+ wpmdb.preg_quote = function (str, delimiter) {
124
+
125
+ // discuss at: http://phpjs.org/functions/preg_quote/
126
+ // original by: booeyOH
127
+ // improved by: Ates Goral (http://magnetiq.com)
128
+ // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
129
+ // improved by: Brett Zamir (http://brett-zamir.me)
130
+ // bugfixed by: Onno Marsman
131
+ // example 1: preg_quote("$40");
132
+ // returns 1: '\\$40'
133
+ // example 2: preg_quote("*RRRING* Hello?");
134
+ // returns 2: '\\*RRRING\\* Hello\\?'
135
+ // example 3: preg_quote("\\.+*?[^]$(){}=!<>|:");
136
+ // returns 3: '\\\\\\.\\+\\*\\?\\[\\^\\]\\$\\(\\)\\{\\}\\=\\!\\<\\>\\|\\:'
137
+
138
+ return String(str).replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\' + (delimiter || '') + '-]', 'g'), '\\$&');
139
+ };
140
+
141
+ wpmdb.table_is = function (table_prefix, desired_table, given_table) {
142
+ if ((table_prefix + desired_table).toLowerCase() === given_table.toLowerCase()) {
143
+ return true;
144
+ }
145
+
146
+ var escaped_given_table = wpmdb.preg_quote(given_table);
147
+ var regex = new RegExp(table_prefix + '([0-9]+)_' + desired_table, 'i');
148
+ var results = regex.exec(escaped_given_table);
149
+ return null != results;
150
+ };
151
+
152
+ wpmdb.subsite_for_table = function (table_prefix, table_name) {
153
+ var escaped_table_name = wpmdb.preg_quote(table_name);
154
+ var regex = new RegExp(table_prefix + '([0-9]+)_', 'i');
155
+ var results = regex.exec(escaped_table_name);
156
+
157
+ if (null === results) {
158
+ return 1;
159
+ } else {
160
+ return results[1];
161
+ }
162
+ };
163
+
164
+ wpmdb.functions.convertKBSizeToHR = function (size, dec, kbSize, retArray) {
165
+ var retVal, units;
166
+ kbSize = kbSize || 1000;
167
+ dec = dec || 2;
168
+ size = parseInt(size);
169
+
170
+ if (kbSize > Math.abs(size)) {
171
+ retVal = [size.toFixed(0), 'KB'];
172
+ } else {
173
+ units = ['MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
174
+ var u = -1;
175
+ do {
176
+ size /= kbSize;
177
+ ++u;
178
+ } while (Math.abs(size) >= kbSize && u < units.length - 1);
179
+ retVal = [Math.round(size * Math.pow(10, dec)) / Math.pow(10, dec), units[u]];
180
+ }
181
+
182
+ if (!retArray) {
183
+ retVal = retVal[0] + ' ' + retVal[1];
184
+ }
185
+ return retVal;
186
+ };
187
+
188
+ wpmdb.functions.convertKBSizeToHRFixed = function (size, dec, kbSize) {
189
+ dec = dec || 2;
190
+ var hrSizeArray = wpmdb.functions.convertKBSizeToHR(size, dec, kbSize, true);
191
+ if ('KB' !== hrSizeArray[1]) {
192
+ return hrSizeArray[0].toFixed(2) + ' ' + hrSizeArray[1];
193
+ }
194
+ return hrSizeArray[0] + ' ' + hrSizeArray[1];
195
+ };
196
+
197
+ wpmdb.functions.ajax_handle_dismissible_notice = function (nonce, callback, ele) {
198
+ jQuery.ajax({
199
+ url: ajaxurl,
200
+ type: 'POST',
201
+ dataType: 'text',
202
+ cache: false,
203
+ data: {
204
+ action: 'wpmdb_process_notice_link',
205
+ nonce: nonce,
206
+ notice: jQuery(ele).data('notice'),
207
+ type: jQuery(ele).data('type'),
208
+ reminder: jQuery(ele).data('reminder')
209
+ },
210
+ beforeSend: callback(ele)
211
+ });
212
+ };
213
+
214
+ wpmdb.functions.get_spinner_url = function () {
215
+ var admin_url = ajaxurl.replace('/admin-ajax.php', ''),
216
+ spinner_url = admin_url + '/images/spinner';
217
+
218
+ if (2 < window.devicePixelRatio) {
219
+ spinner_url += '-2x';
220
+ }
221
+ spinner_url += '.gif';
222
+
223
+ return spinner_url;
224
+ };
225
+
226
+ },{}],2:[function(require,module,exports){
227
+ 'use strict';
228
+
229
+ (function ($) {
230
+
231
+ //If there's an error message visible about the mu-plugins folder not being writable
232
+ if (0 < $('.wpmdb-compat-plugin-row-error').length) {
233
+ $('[data-slug="wp-migrate-db-pro"]').addClass('wpmdbpro-has-message');
234
+ }
235
+
236
+ //For the free plugin the update class needs to be present
237
+ $('.wpmdbpro-custom').prev().addClass('update');
238
+
239
+ $('.notice-link-plugins-page').click(function (e) {
240
+ e.preventDefault();
241
+ var self = jQuery(this);
242
+
243
+ wpmdb.functions.ajax_handle_dismissible_notice(wpmdb_nonces.process_notice_link, function (ele) {
244
+ $(ele).closest('.wpmdbpro-custom').hide();
245
+
246
+ // remove .wpmdb-has-message class from parent TR to add the bottom border back in
247
+ $(ele).closest('tr').siblings('tr.wpmdbpro-has-message').removeClass('wpmdbpro-has-message');
248
+ }, self);
249
+
250
+ $('.wpmdbpro-custom').prev().removeClass('update');
251
+ });
252
+ })(jQuery);
253
+
254
+ },{}],3:[function(require,module,exports){
255
+ 'use strict';
256
+
257
+ (function ($) {
258
+
259
+ $.wpmdb = {
260
+ /**
261
+ * Implement a WordPress-link Hook System for Javascript
262
+ * TODO: Change 'tag' to 'args', allow number (priority), string (tag), object (priority+tag)
263
+ */
264
+ hooks: { action: {}, filter: {} },
265
+ add_action: function add_action(action, callable, tag) {
266
+ jQuery.wpmdb.add_hook('action', action, callable, tag);
267
+ },
268
+ add_filter: function add_filter(action, callable, tag) {
269
+ jQuery.wpmdb.add_hook('filter', action, callable, tag);
270
+ },
271
+ do_action: function do_action(action, args) {
272
+ jQuery.wpmdb.do_hook('action', action, null, args);
273
+ },
274
+ apply_filters: function apply_filters(action, value, args) {
275
+ return jQuery.wpmdb.do_hook('filter', action, value, args);
276
+ },
277
+ remove_action: function remove_action(action, tag) {
278
+ jQuery.wpmdb.remove_hook('action', action, tag);
279
+ },
280
+ remove_filter: function remove_filter(action, tag) {
281
+ jQuery.wpmdb.remove_hook('filter', action, tag);
282
+ },
283
+ add_hook: function add_hook(hook_type, action, callable, tag) {
284
+ if (undefined === jQuery.wpmdb.hooks[hook_type][action]) {
285
+ jQuery.wpmdb.hooks[hook_type][action] = [];
286
+ }
287
+ var hooks = jQuery.wpmdb.hooks[hook_type][action];
288
+ if (undefined === tag) {
289
+ tag = action + '_' + hooks.length;
290
+ }
291
+ jQuery.wpmdb.hooks[hook_type][action].push({ tag: tag, callable: callable });
292
+ },
293
+ do_hook: function do_hook(hook_type, action, value, args) {
294
+ if (undefined !== jQuery.wpmdb.hooks[hook_type][action]) {
295
+ var hooks = jQuery.wpmdb.hooks[hook_type][action];
296
+ for (var i = 0; i < hooks.length; i++) {
297
+ if ('action' === hook_type) {
298
+ hooks[i].callable(args);
299
+ } else {
300
+ value = hooks[i].callable(value, args);
301
+ }
302
+ }
303
+ }
304
+ if ('filter' === hook_type) {
305
+ return value;
306
+ }
307
+ },
308
+ remove_hook: function remove_hook(hook_type, action, tag) {
309
+ if (undefined !== jQuery.wpmdb.hooks[hook_type][action]) {
310
+ var hooks = jQuery.wpmdb.hooks[hook_type][action];
311
+ for (var i = hooks.length - 1; 0 < i; i--) {
312
+ if (undefined === tag || tag === hooks[i].tag) {
313
+ hooks.splice(i, 1);
314
+ }
315
+ }
316
+ }
317
+ }
318
+ };
319
+ })(jQuery);
320
+
321
+ },{}],4:[function(require,module,exports){
322
+ 'use strict';
323
+
324
+ window.wpmdb = window.wpmdb || {};
325
+
326
+ (function ($, wpmdb) {
327
+
328
+ var import_selected = false;
329
+ var $import_select = $('#select-tables').clone();
330
+ var tables_to_search = [];
331
+ var tables_to_import = [];
332
+ var unrecognized_import_file = false;
333
+ var import_prefix = '';
334
+ var import_info = {};
335
+ var ajax_spinner = '<img src="' + wpmdb.functions.get_spinner_url() + '" alt="" class="ajax-spinner general-spinner" />';
336
+
337
+ /**
338
+ * Returns the migration status label for imports
339
+ *
340
+ * @param string label
341
+ * @param object args
342
+ *
343
+ * @returns {string}
344
+ */
345
+ function import_migration_status_label(label, args) {
346
+ if ('import' === args.intent) {
347
+ if ('completed' === args.stage) {
348
+ label = wpmdb_strings.import_label_completed;
349
+ } else {
350
+ label = wpmdb_strings.import_label_migrating;
351
+ }
352
+ }
353
+
354
+ return label;
355
+ }
356
+ $.wpmdb.add_filter('wpmdb_get_migration_status_label', import_migration_status_label);
357
+
358
+ /**
359
+ * Updates the connection info box for imports
360
+ *
361
+ * @param object args
362
+ */
363
+ function import_connection_info_box(args) {
364
+ var $import_file_status = $('.import-file-status');
365
+
366
+ if ('import' === args.migration_type) {
367
+
368
+ if (!import_selected) {
369
+ $('.step-two').hide();
370
+
371
+ if ($import_file_status.hasClass('profile-loaded')) {
372
+ $import_file_status.attr('class', 'import-file-status profile-loaded notification-message success-notice');
373
+ $import_file_status.html(wpmdb_strings.import_profile_loaded);
374
+ } else {
375
+ $import_file_status.html(wpmdb_strings.please_select_sql_file);
376
+ }
377
+
378
+ $import_file_status.show();
379
+ } else {
380
+ if (unrecognized_import_file) {
381
+ $('.unrecognized-import-file-notice').show();
382
+ }
383
+ }
384
+
385
+ maybe_show_find_replace_options();
386
+
387
+ $('.mst-options').hide();
388
+ $('.import-find-replace-option, .import-active-plugin-option').show();
389
+ } else {
390
+ $('.find-replace-rows, .table-options, .advanced-options, .exclude-post-types-options, label[for="backup-selected"]').show();
391
+ $('.import-find-replace-option, .find-replace-options, .import-file-status, .import-active-plugin-option, .unrecognized-import-file-notice').hide();
392
+
393
+ if ('search_all_imported' === $('input[name=table_migrate_option]:checked').val()) {
394
+ $('input[name=table_migrate_option][value=migrate_only_with_prefix]').prop('checked', true);
395
+ }
396
+ }
397
+ }
398
+ $.wpmdb.add_action('move_connection_info_box', import_connection_info_box);
399
+
400
+ /**
401
+ * Starts the upload process for the import
402
+ *
403
+ * @param stage
404
+ */
405
+ function maybe_initiate_import(stage) {
406
+ if ('import' === wpmdb.functions.wpmdb_migration_type()) {
407
+ if ('backup' === stage) {
408
+ wpmdb.common.hooks.push(wpmdb.functions.migrate_table_recursive);
409
+ }
410
+
411
+ wpmdb.common.hooks.push(wpmdb.functions.upload_file_recursive);
412
+ wpmdb.common.next_step_in_migration = { fn: wpmdb.functions.wpmdb_call_next_hook };
413
+ wpmdb.functions.execute_next_step();
414
+ }
415
+ }
416
+ $.wpmdb.add_action('wpmdb_migration_initiated', maybe_initiate_import);
417
+
418
+ /**
419
+ * Restores the import select when changing migration types
420
+ */
421
+ function update_import_table_select() {
422
+ $('#select-tables').remove();
423
+ $('.select-tables-wrap').prepend($import_select);
424
+ $('#select-tables').change();
425
+ }
426
+ $.wpmdb.add_action('wpmdb_update_import_table_select', update_import_table_select);
427
+
428
+ /**
429
+ * Updates the selected tables for the "Backup tables that will be replaced during the import" option
430
+ *
431
+ * @param tables_to_backup
432
+ *
433
+ * @return array
434
+ */
435
+ function backup_selected_for_import(tables_to_backup) {
436
+ if ('import' === wpmdb.functions.wpmdb_migration_type()) {
437
+ tables_to_backup = tables_to_import;
438
+ }
439
+
440
+ return tables_to_backup;
441
+ }
442
+ $.wpmdb.add_filter('wpmdb_backup_selected_tables', backup_selected_for_import);
443
+
444
+ /**
445
+ * Adds the import migration stage
446
+ *
447
+ * object args
448
+ */
449
+ function add_import_stage(args) {
450
+ if ('import' === wpmdb.functions.wpmdb_migration_type()) {
451
+ wpmdb.current_migration.model.addStage('upload', [], 'local', {
452
+ strings: {
453
+ stage_title: wpmdb_strings.upload
454
+ }
455
+ });
456
+
457
+ wpmdb.current_migration.model.addStage('import', [], 'local', {
458
+ strings: {
459
+ stage_title: wpmdb_strings.migrate_button_import
460
+ }
461
+ });
462
+
463
+ if ($('#import-find-replace').is(':checked')) {
464
+ tables_to_search = args.tables_to_migrate;
465
+ wpmdb.current_migration.model.addStage('find_replace', [], 'local', {
466
+ strings: {
467
+ migrated: wpmdb_strings.searched,
468
+ stage_title: wpmdb_strings.migrate_button_find_replace
469
+ }
470
+ });
471
+ }
472
+ }
473
+ }
474
+ $.wpmdb.add_action('wpmdb_add_migration_stages', add_import_stage);
475
+
476
+ /**
477
+ * Adds any info necessary to begin an import
478
+ *
479
+ * @param object request_data
480
+ *
481
+ * @return {object}
482
+ */
483
+ function initiate_import_request_data(request_data) {
484
+ if ('import' === wpmdb.functions.wpmdb_migration_type()) {
485
+ request_data.import_info = import_info;
486
+ }
487
+
488
+ return request_data;
489
+ }
490
+ $.wpmdb.add_filter('wpmdb_initiate_migration_request_data', initiate_import_request_data);
491
+
492
+ /**
493
+ * Gets more information about the import file and loads step-two
494
+ *
495
+ * @param event
496
+ */
497
+ function get_import_info(event) {
498
+ var files = event.target.files; // FileList object
499
+ var file = files[0];
500
+ var reader = new FileReader();
501
+ var $import_file_status = $('.import-file-status');
502
+ var $backup_selected_option = $('label[for="backup-selected"]');
503
+ var $prefix_notice = $('.prefix-notice');
504
+ var $unrecognized_file_notice = $('.unrecognized-import-file-notice');
505
+ var $step_two = $('.step-two');
506
+ var $old_url = $('#old-url');
507
+ var $old_path = $('#old-path');
508
+ var $new_url = $('#new-url');
509
+ var $new_path = $('#new-path');
510
+
511
+ $import_file_status.hide().attr('class', 'import-file-status');
512
+ $prefix_notice.hide();
513
+ $unrecognized_file_notice.hide();
514
+ $step_two.hide();
515
+ $('.mst-required ').hide();
516
+
517
+ if (!files.length) {
518
+ if (import_selected) {
519
+ $step_two.hide();
520
+ $import_file_status.text(wpmdb_strings.please_select_sql_file).show();
521
+ import_selected = false;
522
+ }
523
+ return;
524
+ } else {
525
+
526
+ if ('.sql' === file.name.slice(-4) || '.sql.gz' === file.name.slice(-7)) {
527
+ import_selected = true;
528
+ } else {
529
+ $import_file_status.addClass('notification-message error-notice migration-error').text(wpmdb_strings.invalid_sql_file).show();
530
+ $step_two.hide();
531
+ return;
532
+ }
533
+ }
534
+
535
+ import_prefix = '';
536
+
537
+ $import_file_status.text(wpmdb_strings.parsing_sql_file).append(ajax_spinner).show();
538
+
539
+ reader.onloadend = function (event) {
540
+ if (event.target.readyState !== FileReader.DONE) {
541
+ return;
542
+ }
543
+
544
+ $.ajax({
545
+ url: ajaxurl,
546
+ type: 'POST',
547
+ dataType: 'json',
548
+ cache: false,
549
+ data: {
550
+ action: 'wpmdb_get_import_info',
551
+ file_data: event.target.result,
552
+ nonce: wpmdb_data.nonces.import_file
553
+ },
554
+ error: function error(jqXHR, textStatus, errorThrown) {
555
+ console.log(jqXHR, textStatus, errorThrown);
556
+ },
557
+ success: function success(data) {
558
+ $('.ajax-spinner').remove();
559
+ $import_file_status.hide();
560
+
561
+ if (true === wpmdb.functions.maybe_show_mst_warning(data)) {
562
+ return;
563
+ }
564
+
565
+ $step_two.show();
566
+
567
+ if ('undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error) {
568
+ $import_file_status.text(data.body).addClass('notification-message error-notice migration-error').show();
569
+ $step_two.hide();
570
+ } else {
571
+ var localStorage_form_data = wpmdb.functions.get_localStorage_form_data();
572
+ import_info = data;
573
+
574
+ if ('undefined' !== typeof data.prefix) {
575
+ import_prefix = data.prefix;
576
+ $('.table-prefix').text(data.prefix);
577
+ wpmdb.functions.maybe_show_prefix_notice(data.prefix);
578
+ }
579
+
580
+ if ('undefined' !== typeof data.tables) {
581
+ tables_to_import = data.tables;
582
+ $backup_selected_option.show();
583
+
584
+ // Update the find & replace values
585
+ if (!localStorage_form_data) {
586
+ $old_url.val(wpmdb.functions.remove_protocol(data.URL));
587
+ $old_path.val(data.path);
588
+ $new_url.val(wpmdb.functions.remove_protocol(wpmdb_data.this_url));
589
+ $new_path.val(wpmdb_data.this_path);
590
+ }
591
+
592
+ // Update the select with tables that will be imported
593
+ var loaded_tables = [];
594
+ var loaded_post_types = [];
595
+
596
+ if (localStorage_form_data) {
597
+ loaded_tables = localStorage_form_data.select_tables;
598
+ loaded_post_types = localStorage_form_data.select_post_types;
599
+ wpmdb.functions.remove_localStorage_form_data();
600
+ } else {
601
+ if ('migrate_only_with_prefix' === $('input[name=table_migrate_option]:checked').val() && !$import_file_status.hasClass('profile-loaded')) {
602
+ $('input[name=table_migrate_option][value=search_all_imported]').prop('checked', true);
603
+ }
604
+ }
605
+
606
+ if (false === wpmdb_default_profile && 'undefined' !== typeof wpmdb_loaded_tables) {
607
+ loaded_tables = wpmdb_loaded_tables;
608
+ loaded_post_types = wpmdb_loaded_post_types;
609
+ }
610
+ $import_select = wpmdb.functions.create_table_select(data.tables, [], loaded_tables);
611
+ $.wpmdb.do_action('wpmdb_update_import_table_select');
612
+
613
+ if ('undefined' !== typeof data.post_types) {
614
+ var $post_type_select = document.createElement('select');
615
+ $($post_type_select).attr({
616
+ multiple: 'multiple',
617
+ name: 'select_post_types[]',
618
+ id: 'select-post-types',
619
+ class: 'multiselect'
620
+ });
621
+
622
+ $.each(data.post_types, function (index, value) {
623
+ var selected = $.inArray(value, loaded_post_types);
624
+ if (-1 !== selected || true === wpmdb_convert_exclude_revisions && 'revision' !== value) {
625
+ selected = true;
626
+ } else {
627
+ selected = false;
628
+ }
629
+
630
+ var opt = document.createElement('option');
631
+ opt.value = value;
632
+ opt.text = value;
633
+ opt.selected = selected;
634
+ $post_type_select.add(opt, null);
635
+ });
636
+
637
+ $('#select-post-types').remove();
638
+ $('.exclude-post-types-warning').after($post_type_select);
639
+ }
640
+
641
+ if (unrecognized_import_file) {
642
+ unrecognized_import_file = false;
643
+ maybe_show_find_replace_options();
644
+ }
645
+ } else {
646
+ $unrecognized_file_notice.show();
647
+ $backup_selected_option.hide();
648
+ $('.table-options').hide();
649
+ unrecognized_import_file = true;
650
+
651
+ $new_url.val($old_url.val());
652
+ $new_path.val($old_path.val());
653
+ $old_url.val('');
654
+ $old_path.val('');
655
+ }
656
+ }
657
+ }
658
+ });
659
+ };
660
+
661
+ var blob = file.slice(0, 1024 * 1000);
662
+ reader.readAsDataURL(blob);
663
+ }
664
+ $('#import-file').on('change', get_import_info);
665
+
666
+ /**
667
+ * Displays the find and replace options for imports
668
+ */
669
+ function maybe_show_find_replace_options() {
670
+ var find_replace_rows = $('.find-replace-rows');
671
+ return $('#import-find-replace').is(':checked') ? find_replace_rows.show() : find_replace_rows.hide();
672
+ }
673
+ $('#import-find-replace').on('click', maybe_show_find_replace_options);
674
+
675
+ function maybe_show_table_options() {
676
+ if (!unrecognized_import_file) {
677
+ return;
678
+ }
679
+
680
+ setTimeout(function () {
681
+ if ($('.find-replace-options-toggle .expand-collapse-arrow').hasClass('collapsed')) {
682
+ return;
683
+ }
684
+
685
+ $('.table-options').hide();
686
+ }, 1);
687
+ }
688
+ $('.find-replace-options-toggle').on('click', maybe_show_table_options);
689
+
690
+ /**
691
+ * Updates both `keep_active_plugins` checkboxes when one is changed.
692
+ */
693
+ function update_keep_active_plugins_option() {
694
+ $('input[name=keep_active_plugins]').prop('checked', $(this).is(':checked'));
695
+ }
696
+ $('input[name=keep_active_plugins]').on('click', update_keep_active_plugins_option);
697
+
698
+ /**
699
+ * Recursively upload an import file
700
+ *
701
+ * @param int start
702
+ */
703
+ wpmdb.functions.upload_file_recursive = function (start) {
704
+ start = 'undefined' === typeof start ? 0 : start;
705
+
706
+ var file = document.getElementById('import-file').files[0];
707
+ var slice_size = 1000 * 1024; // 1 MB
708
+ var next_slice = start + slice_size + 1;
709
+ var reader = new FileReader();
710
+
711
+ if (0 === start) {
712
+ wpmdb.current_migration.model.addStageItem('upload', file.name, file.size / 1000, Math.ceil(file.size / slice_size));
713
+ }
714
+
715
+ reader.onloadend = function (event) {
716
+ if (event.target.readyState !== FileReader.DONE) {
717
+ return;
718
+ }
719
+
720
+ $.ajax({
721
+ url: ajaxurl,
722
+ type: 'POST',
723
+ dataType: 'json',
724
+ cache: false,
725
+ data: {
726
+ action: 'wpmdb_upload_file',
727
+ file_data: event.target.result,
728
+ file: file.name,
729
+ file_type: file.type,
730
+ migration_state_id: wpmdb.migration_state_id,
731
+ stage: 'import',
732
+ import_info: import_info,
733
+ nonce: wpmdb_data.nonces.import_file
734
+ },
735
+ error: function error(jqXHR, textStatus, errorThrown) {
736
+ console.log(jqXHR, textStatus, errorThrown);
737
+ wpmdb.common.migration_error = true;
738
+ wpmdb.functions.migration_complete_events();
739
+ },
740
+ success: function success(data) {
741
+ wpmdb.current_migration.setText();
742
+
743
+ if ('undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error) {
744
+ wpmdb.common.migration_error = true;
745
+ wpmdb.functions.migration_complete_events();
746
+ wpmdb.current_migration.setState(wpmdb_strings.migration_failed, data.body, 'error');
747
+
748
+ return;
749
+ }
750
+
751
+ var size_done = start + slice_size;
752
+
753
+ wpmdb.current_migration.setText(wpmdb_strings.uploading_file_to_server);
754
+ wpmdb.current_migration.model.getStageModel('upload').setItemRowsTransferred(file.name, Math.ceil(size_done / slice_size));
755
+
756
+ if (next_slice < file.size) {
757
+ wpmdb.common.next_step_in_migration = {
758
+ fn: wpmdb.functions.upload_file_recursive,
759
+ args: [next_slice]
760
+ };
761
+ } else {
762
+ wpmdb.common.next_step_in_migration = {
763
+ fn: wpmdb.functions.upload_import_successful,
764
+ args: [file]
765
+ };
766
+ }
767
+
768
+ wpmdb.functions.execute_next_step();
769
+ }
770
+ });
771
+ };
772
+
773
+ var blob = file.slice(start, next_slice);
774
+ reader.readAsDataURL(blob);
775
+ };
776
+
777
+ /**
778
+ * Prepares the import stage
779
+ *
780
+ * @param file
781
+ */
782
+ wpmdb.functions.upload_import_successful = function (file) {
783
+
784
+ $.ajax({
785
+ type: 'POST',
786
+ url: ajaxurl,
787
+ data: {
788
+ action: 'wpmdb_prepare_import_file',
789
+ migration_state_id: wpmdb.migration_state_id,
790
+ nonce: wpmdb_data.nonces.import_file
791
+ },
792
+ dataType: 'json',
793
+ error: function error(jqXHR, textStatus, errorThrown) {
794
+ console.log(jqXHR, textStatus, errorThrown);
795
+ wpmdb.common.migration_error = true;
796
+ wpmdb.functions.migration_complete_events();
797
+ },
798
+ success: function success(response) {
799
+ var item_name = file.name;
800
+ var migration_text = wpmdb_strings.importing_file_to_db;
801
+
802
+ if ('.gz' === item_name.slice(-3)) {
803
+ item_name = file.name.slice(0, -3);
804
+ }
805
+
806
+ migration_text = migration_text.replace(/\%s\s?/, item_name);
807
+ wpmdb.current_migration.setText(migration_text);
808
+
809
+ wpmdb.current_migration.model.addStageItem('import', item_name, response.import_size / 1000, response.num_chunks);
810
+ wpmdb.current_migration.model.setActiveStage('import');
811
+
812
+ wpmdb.common.next_step_in_migration = {
813
+ fn: wpmdb.functions.import_file_recursive,
814
+ args: [{
815
+ import_filename: response.import_file,
816
+ item_name: item_name,
817
+ chunk: 0,
818
+ current_query: ''
819
+ }]
820
+ };
821
+
822
+ wpmdb.functions.execute_next_step();
823
+ }
824
+ });
825
+ };
826
+
827
+ /**
828
+ * Recursively imports chunks to the database
829
+ *
830
+ * @param object args
831
+ */
832
+ wpmdb.functions.import_file_recursive = function (args) {
833
+
834
+ $.ajax({
835
+ type: 'POST',
836
+ url: ajaxurl,
837
+ data: {
838
+ action: 'wpmdb_import_file',
839
+ migration_state_id: wpmdb.migration_state_id,
840
+ chunk: args.chunk,
841
+ current_query: args.current_query,
842
+ import_file: args.import_filename,
843
+ nonce: wpmdb_data.nonces.import_file
844
+ },
845
+ dataType: 'json',
846
+ error: function error(jqXHR, textStatus, errorThrown) {
847
+ console.log(jqXHR, textStatus, errorThrown);
848
+ wpmdb.common.migration_error = true;
849
+ wpmdb.functions.migration_complete_events();
850
+ },
851
+ success: function success(response) {
852
+ if ('undefined' !== typeof response.wpmdb_error && 1 === response.wpmdb_error) {
853
+ wpmdb.common.migration_error = true;
854
+ wpmdb.functions.migration_complete_events();
855
+ wpmdb.current_migration.setState(wpmdb_strings.migration_failed, response.body, 'error');
856
+ return;
857
+ }
858
+
859
+ wpmdb.current_migration.model.getStageModel('import').setItemRowsTransferred(args.item_name, response.chunk);
860
+
861
+ if (response.chunk >= response.num_chunks) {
862
+
863
+ wpmdb.current_migration.model.getStageModel('import').setItemRowsTransferred(args.item_name, ++response.chunk);
864
+
865
+ if ($('#import-find-replace').is(':checked')) {
866
+
867
+ if (unrecognized_import_file) {
868
+ $.each(response.table_sizes, function (table, size) {
869
+ if (table.startsWith(wpmdb_data.this_temp_prefix) && wpmdb_data.alter_table_name !== table) {
870
+ var table_name = table.replace(wpmdb_data.this_temp_prefix, '');
871
+ wpmdb.current_migration.model.addStageItem('find_replace', table_name, response.table_sizes[table], response.table_rows[table]);
872
+ }
873
+ });
874
+ } else {
875
+ var table_migrate_option = $('input[name=table_migrate_option]:checked').val();
876
+
877
+ if ('migrate_only_with_prefix' === table_migrate_option) {
878
+ tables_to_search = tables_to_import.filter(function (table) {
879
+ return import_prefix === table.substring(0, import_prefix.length);
880
+ });
881
+ } else if ('search_all_imported' === table_migrate_option) {
882
+ tables_to_search = tables_to_import;
883
+ }
884
+
885
+ $.each(tables_to_search, function (key, table) {
886
+ var imported_table = wpmdb_data.this_temp_prefix + table;
887
+ if (response.table_sizes.hasOwnProperty(imported_table)) {
888
+ wpmdb.current_migration.model.addStageItem('find_replace', table, response.table_sizes[imported_table], response.table_rows[imported_table]);
889
+ }
890
+ });
891
+ }
892
+
893
+ tables_to_search = [];
894
+
895
+ wpmdb.current_migration.model.setActiveStage('find_replace');
896
+ var tables_to_migrate = wpmdb.functions.get_tables_to_migrate();
897
+
898
+ wpmdb.common.next_step_in_migration = {
899
+ fn: wpmdb.functions.migrate_table_recursive,
900
+ args: ['-1', '', tables_to_migrate.length]
901
+ };
902
+ wpmdb.functions.execute_next_step();
903
+ return;
904
+ } else {
905
+ $('.progress-label').removeClass('label-visible');
906
+ wpmdb.common.hooks = $.wpmdb.apply_filters('wpmdb_before_migration_complete_hooks', wpmdb.common.hooks);
907
+ wpmdb.common.hooks.push(wpmdb.functions.migration_complete);
908
+ wpmdb.common.hooks.push(wpmdb.functions.wpmdb_flush);
909
+ wpmdb.common.hooks = $.wpmdb.apply_filters('wpmdb_after_migration_complete_hooks', wpmdb.common.hooks);
910
+ wpmdb.common.hooks.push(wpmdb.functions.migration_complete_events);
911
+ wpmdb.common.next_step_in_migration = { fn: wpmdb.functions.wpmdb_call_next_hook };
912
+ }
913
+ } else {
914
+ wpmdb.common.next_step_in_migration = {
915
+ fn: wpmdb.functions.import_file_recursive,
916
+ args: [{
917
+ import_filename: args.import_filename,
918
+ item_name: args.item_name,
919
+ chunk: response.chunk,
920
+ current_query: response.current_query
921
+ }]
922
+ };
923
+ }
924
+
925
+ wpmdb.functions.execute_next_step();
926
+ }
927
+ });
928
+ };
929
+
930
+ wpmdb.functions.get_tables_to_import = function () {
931
+ return tables_to_import;
932
+ };
933
+ })(jQuery, wpmdb);
934
+
935
+ },{}],5:[function(require,module,exports){
936
+ 'use strict';
937
+
938
+ window.wpmdb = window.wpmdb || {};
939
+
940
+ (function ($, wpmdb) {
941
+
942
+ $(document).ready(function () {
943
+
944
+ wpmdb.functions.localStorage_available = function () {
945
+ try {
946
+ localStorage.setItem('wpmdb_test', 'wpmdb_test');
947
+ localStorage.removeItem('wpmdb_test', 'wpmdb_test');
948
+ return true;
949
+ } catch (e) {
950
+ return false;
951
+ }
952
+ };
953
+
954
+ wpmdb.functions.maybe_reload_page = function () {
955
+ var migration_type = wpmdb.functions.wpmdb_migration_type();
956
+
957
+ if (!wpmdb.functions.localStorage_available() || 'cancelled' === wpmdb.current_migration.status || true === wpmdb.common.migration_error || -1 === $.inArray(migration_type, ['pull', 'import', 'find_replace'])) {
958
+ return;
959
+ }
960
+
961
+ if ('true' === wpmdb_data.is_multisite && $('#mst-select-subsite').is(':checked') && wpmdb_data.this_domain !== $('#mst-selected-subsite option:selected').text()) {
962
+ return;
963
+ }
964
+
965
+ var tables_to_migrate = wpmdb.functions.get_tables_to_migrate();
966
+
967
+ if ('import' === migration_type) {
968
+ tables_to_migrate = wpmdb.functions.get_tables_to_import();
969
+ }
970
+
971
+ if (-1 === $.inArray(wpmdb_data.this_prefix + 'options', tables_to_migrate) && -1 === $.inArray(wpmdb_data.this_prefix + 'usermeta', tables_to_migrate)) {
972
+ return;
973
+ }
974
+
975
+ wpmdb.functions.set_localStorage_form_data();
976
+ location.reload();
977
+ };
978
+
979
+ wpmdb.functions.set_localStorage_form_data = function () {
980
+ var data = {};
981
+
982
+ $.each($('#migrate-form').serializeArray(), function (index, field) {
983
+ if ('[]' === field.name.substr(-2)) {
984
+ var field_name = field.name.slice(0, -2);
985
+ if ('undefined' === typeof data[field_name]) {
986
+ data[field_name] = [];
987
+ }
988
+ data[field_name].push(field.value);
989
+ } else {
990
+ data[field.name] = field.value;
991
+ }
992
+ });
993
+
994
+ localStorage.setItem('wpmdb_migrate_form', JSON.stringify(data));
995
+ };
996
+
997
+ wpmdb.functions.get_localStorage_form_data = function () {
998
+ var form_data = localStorage.getItem('wpmdb_migrate_form');
999
+
1000
+ if (null === form_data) {
1001
+ return false;
1002
+ }
1003
+
1004
+ try {
1005
+ form_data = JSON.parse(form_data);
1006
+ } catch (err) {
1007
+ return false;
1008
+ }
1009
+
1010
+ return form_data;
1011
+ };
1012
+
1013
+ wpmdb.functions.remove_localStorage_form_data = function () {
1014
+ localStorage.removeItem('wpmdb_migrate_form');
1015
+ };
1016
+
1017
+ wpmdb.functions.load_data_from_localStorage = function () {
1018
+ var form_data = wpmdb.functions.get_localStorage_form_data();
1019
+
1020
+ if (!form_data) {
1021
+ return;
1022
+ }
1023
+
1024
+ $.each(form_data, function (name, value) {
1025
+ var $input = $('[name="' + name + '"]');
1026
+ var input_type = $input.attr('type');
1027
+
1028
+ if ('action' === name) {
1029
+ wpmdb.migration_selection = value;
1030
+ $('#' + value).prop('checked', true);
1031
+ } else {
1032
+ if ('radio' === input_type) {
1033
+ $('[name="' + name + '"][value="' + value + '"]').prop('checked', true);
1034
+ } else if ('checkbox' === input_type) {
1035
+ $input.prop('checked', true);
1036
+
1037
+ if ($input.parent().hasClass('checkbox-label')) {
1038
+ $input.parent().next().show();
1039
+ }
1040
+ } else {
1041
+ $input.val(value);
1042
+ }
1043
+ }
1044
+ });
1045
+
1046
+ $('.option-group input[type=radio]').change();
1047
+ $('.' + wpmdb.migration_selection + '-list ul').show();
1048
+
1049
+ $.when(wpmdb.functions.connection_box_changed()).done(function () {
1050
+ if ('migrate_select' === $('input[name=table_migrate_option]:checked').val()) {
1051
+ if ('undefined' !== typeof form_data.select_tables) {
1052
+ $('#select-tables').val(form_data.select_tables);
1053
+ }
1054
+
1055
+ $('.table-options .expandable-content, .select-tables-wrap').show();
1056
+ $('.table-options .expand-collapse-arrow').removeClass('collapsed');
1057
+ } else {
1058
+ $('.select-tables-wrap').hide();
1059
+ }
1060
+
1061
+ if ('backup_manual_select' === $('input[name=backup_option]:checked').val()) {
1062
+ if ('undefined' !== typeof form_data.select_backup) {
1063
+ $('#select-backup').val(form_data.select_backup);
1064
+ }
1065
+
1066
+ $('.backup-tables-wrap').show();
1067
+ }
1068
+
1069
+ if ('undefined' !== typeof form_data.select_post_types) {
1070
+ $('#select-post-types').val(form_data.select_post_types);
1071
+ wpmdb.functions.exclude_post_types_warning();
1072
+ }
1073
+
1074
+ if ('undefined' !== typeof form_data.replace_old) {
1075
+
1076
+ $('.replace-row').not('.original-repeatable-field').remove();
1077
+
1078
+ var n = 1;
1079
+ $.each(form_data.replace_old, function (index, value) {
1080
+ if (!$('.replace-row:nth-child(' + n + ')').length) {
1081
+ $('.replace-row').last().after($('.original-repeatable-field').clone().removeClass('original-repeatable-field'));
1082
+ }
1083
+
1084
+ $('.replace-row:nth-child(' + n + ') [name="replace_old[]"]').val(value);
1085
+ $('.replace-row:nth-child(' + n + ') [name="replace_new[]"]').val(form_data.replace_new[index]);
1086
+ n++;
1087
+ });
1088
+ }
1089
+ });
1090
+
1091
+ wpmdb.functions.update_migrate_button_text();
1092
+
1093
+ if ('import' !== wpmdb.functions.wpmdb_migration_type()) {
1094
+ wpmdb.functions.remove_localStorage_form_data();
1095
+ }
1096
+ };
1097
+ wpmdb.functions.load_data_from_localStorage();
1098
+ });
1099
+ })(jQuery, wpmdb);
1100
+
1101
+ },{}],6:[function(require,module,exports){
1102
+ 'use strict';
1103
+
1104
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
1105
+
1106
+ var $ = jQuery;
1107
+ var MigrationProgressModel = require('MigrationProgress-model');
1108
+ var MigrationProgressView = require('MigrationProgress-view');
1109
+ var $overlayOriginal = $('<div id="overlay" class="hide"></div>');
1110
+ var $progressContentOriginal = $('.progress-content').clone().addClass('hide');
1111
+ var $proVersion = $('.pro-version').addClass('hide');
1112
+
1113
+ $overlayOriginal.append($proVersion);
1114
+
1115
+ var MigrationProgressController = {
1116
+ migration: {
1117
+ model: {},
1118
+ view: {},
1119
+ $progress: {},
1120
+ $wrapper: {},
1121
+ $overlay: {},
1122
+ status: 'active',
1123
+ title: '',
1124
+ text: '',
1125
+ timerCount: 0,
1126
+ elapsedInterval: 0,
1127
+ currentStageNum: 0,
1128
+ counterDisplay: false,
1129
+ originalTitle: document.title,
1130
+ setTitle: function setTitle(title) {
1131
+ this.$progress.find('.progress-title').html(title);
1132
+ this.title = title;
1133
+ },
1134
+ setStatus: function setStatus(status) {
1135
+ this.$progress.removeClass(this.status).addClass('error' === status ? 'wpmdb-error' : status);
1136
+
1137
+ // Possible statuses include: 'error', 'paused', 'complete', 'cancelling'
1138
+ if ('error' === status) {
1139
+ this.$progress.find('.progress-text').addClass('migration-error');
1140
+ }
1141
+
1142
+ this.status = status;
1143
+
1144
+ this.updateTitleElem();
1145
+ },
1146
+ setText: function setText(text) {
1147
+ if ('string' !== typeof text) {
1148
+ text = '';
1149
+ }
1150
+
1151
+ if (0 >= text.indexOf('wpmdb_error')) {
1152
+ text = this.decodeErrorObject(text);
1153
+ }
1154
+
1155
+ this.$progress.find('.progress-text').html(text);
1156
+ this.text = text;
1157
+ },
1158
+ setState: function setState(title, text, status) {
1159
+ if (null !== title) {
1160
+ this.setTitle(title);
1161
+ }
1162
+ if (null !== text) {
1163
+ this.setText(text);
1164
+ }
1165
+ if (null !== status) {
1166
+ this.setStatus(status);
1167
+ }
1168
+ },
1169
+ startTimer: function startTimer() {
1170
+ this.timerCount = 0;
1171
+ this.counterDisplay = $('.timer');
1172
+ this.elapsedInterval = setInterval(this.incrementTimer, 1000);
1173
+ },
1174
+ pauseTimer: function pauseTimer() {
1175
+ clearInterval(this.elapsedInterval);
1176
+ },
1177
+ resumeTimer: function resumeTimer() {
1178
+ this.elapsedInterval = setInterval(this.incrementTimer, 1000);
1179
+ },
1180
+ incrementTimer: function incrementTimer() {
1181
+ wpmdb.current_migration.timerCount = wpmdb.current_migration.timerCount + 1;
1182
+ wpmdb.current_migration.displayCount();
1183
+ },
1184
+ displayCount: function displayCount() {
1185
+ var hours = Math.floor(this.timerCount / 3600) % 24;
1186
+ var minutes = Math.floor(this.timerCount / 60) % 60;
1187
+ var seconds = this.timerCount % 60;
1188
+ var display = this.pad(hours, 2, 0) + ':' + this.pad(minutes, 2, 0) + ':' + this.pad(seconds, 2, 0);
1189
+ this.counterDisplay.html(display);
1190
+ },
1191
+ updateTitleElem: function updateTitleElem() {
1192
+ var activeStage = this.model.get('activeStageName');
1193
+ var stageModel = this.model.getStageModel(activeStage);
1194
+ var percentDone = Math.max(0, stageModel.getTotalProgressPercent());
1195
+ var numStages = this.model.get('stages').length;
1196
+ var currentStage = this.currentStageNum;
1197
+ var currentStatus = this.status;
1198
+ var progressText = wpmdb_strings.title_progress;
1199
+
1200
+ if ('complete' === stageModel.get('status') && 0 === stageModel.get('totalSize')) {
1201
+ percentDone = 100;
1202
+ }
1203
+
1204
+ progressText = progressText.replace('%1$s', percentDone + '%');
1205
+ progressText = progressText.replace('%2$s', currentStage);
1206
+ progressText = progressText.replace('%3$s', numStages);
1207
+
1208
+ if (1 === numStages) {
1209
+ progressText = percentDone + '%';
1210
+ }
1211
+
1212
+ if (wpmdb_strings['title_' + currentStatus]) {
1213
+ progressText = wpmdb_strings['title_' + currentStatus];
1214
+ }
1215
+
1216
+ progressText = progressText + ' - ' + this.originalTitle;
1217
+
1218
+ document.title = progressText;
1219
+ },
1220
+ restoreTitleElem: function restoreTitleElem() {
1221
+ document.title = this.originalTitle;
1222
+ },
1223
+ pad: function pad(num, width, padChar) {
1224
+ padChar = padChar || '0';
1225
+ num = num + '';
1226
+ return num.length >= width ? num : new Array(width - num.length + 1).join(padChar) + num;
1227
+ },
1228
+
1229
+ // fixes error objects that have been mangled by html encoding
1230
+ decodeErrorObject: function decodeErrorObject(input) {
1231
+ var inputDecoded = input.replace(/\{&quot;/g, '{#q!#').replace(/\&quot;}/g, '#q!#}').replace(/,&quot;/g, ',#q!#').replace(/&quot;:/g, '#q!#:').replace(/:&quot;/g, ':#q!#').replace(/&quot;/g, '\\"').replace(/#q!#/g, '"').replace(/&gt;/g, '>').replace(/&lt;/g, '<');
1232
+ try {
1233
+ inputDecoded = JSON.parse(inputDecoded);
1234
+ } catch (e) {
1235
+ return input;
1236
+ }
1237
+ return 'object' === (typeof inputDecoded === 'undefined' ? 'undefined' : _typeof(inputDecoded)) && 'undefined' !== typeof inputDecoded.body ? inputDecoded : input;
1238
+ },
1239
+ fixProgressStageWidthForScrollBar: function fixProgressStageWidthForScrollBar() {
1240
+ var scrollBarWidth = Math.abs(this.$wrapper[0].offsetWidth - this.$wrapper[0].clientWidth);
1241
+ var visibleProgressItems = this.$wrapper.find('.active .progress-items');
1242
+ var leftPad = parseInt(visibleProgressItems.css('padding-left'), 10);
1243
+ var rightPad = parseInt(visibleProgressItems.css('padding-right'), 10);
1244
+
1245
+ if (0 !== scrollBarWidth || 0 === scrollBarWidth && rightPad !== leftPad) {
1246
+ visibleProgressItems.css('padding-right', leftPad - scrollBarWidth + 'px');
1247
+ }
1248
+ }
1249
+ },
1250
+ newMigration: function newMigration(settings) {
1251
+ $('#overlay').remove();
1252
+ $('.progress-content').remove();
1253
+ this.migration.$overlay = $overlayOriginal.clone();
1254
+
1255
+ $('#wpwrap').append(this.migration.$overlay);
1256
+
1257
+ this.migration.model = new MigrationProgressModel(settings);
1258
+ this.migration.view = new MigrationProgressView({
1259
+ model: this.migration.model
1260
+ });
1261
+
1262
+ this.migration.$progress = $progressContentOriginal.clone();
1263
+ this.migration.$wrapper = this.migration.view.$el;
1264
+ this.migration.$progress.find('.migration-progress-stages').replaceWith(this.migration.$wrapper);
1265
+
1266
+ this.migration.$proVersion = this.migration.$overlay.find('.pro-version');
1267
+ var proVersionIFrame = this.migration.$proVersion.find('iframe').remove().clone();
1268
+
1269
+ this.migration.$overlay.prepend(this.migration.$progress);
1270
+
1271
+ // timeout needed so class is added after elements are appended to dom and transition runs.
1272
+ var self = this;
1273
+ setTimeout(function () {
1274
+ self.migration.$overlay.add(self.migration.$progress).add(self.migration.$proVersion).removeClass('hide').addClass('show');
1275
+ if (self.migration.$proVersion.length) {
1276
+ setTimeout(function () {
1277
+ self.migration.$proVersion.find('.iframe').append(proVersionIFrame);
1278
+ }, 500);
1279
+ }
1280
+ }, 0);
1281
+
1282
+ this.migration.currentStageNum = 0;
1283
+
1284
+ this.migration.$proVersion.on('click', '.close-pro-version', function () {
1285
+ self.migration.$proVersion.find('iframe').remove();
1286
+ self.migration.$proVersion.addClass('hide remove');
1287
+ setTimeout(function () {
1288
+ self.migration.$proVersion.remove();
1289
+ }, 500);
1290
+ });
1291
+
1292
+ this.migration.model.on('migrationComplete', function () {
1293
+ self.utils.updateProgTableVisibilitySetting();
1294
+ self.utils.updatePauseBeforeFinalizeSetting();
1295
+ self.migration.pauseTimer();
1296
+ });
1297
+
1298
+ $(window).on('resize', _.debounce(this.migration.fixProgressStageWidthForScrollBar.bind(this.migration), 100));
1299
+ this.migration.model.on('change:activeStage', this.migration.fixProgressStageWidthForScrollBar.bind(this.migration));
1300
+
1301
+ return this.migration;
1302
+ },
1303
+ utils: require('MigrationProgress-utils')
1304
+ };
1305
+
1306
+ module.exports = MigrationProgressController;
1307
+
1308
+ },{"MigrationProgress-model":7,"MigrationProgress-utils":8,"MigrationProgress-view":9}],7:[function(require,module,exports){
1309
+ 'use strict';
1310
+
1311
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
1312
+
1313
+ var MigrationProgressStageModel = require('MigrationProgressStage-model');
1314
+ var $ = jQuery;
1315
+
1316
+ var MigrationProgressModel = Backbone.Model.extend({
1317
+ defaults: {
1318
+ _initialStages: null,
1319
+ stages: null,
1320
+ activeStageName: null,
1321
+ stageModels: null,
1322
+ localTableRows: null,
1323
+ localTableSizes: null,
1324
+ remoteTableRows: null,
1325
+ remoteTableSizes: null,
1326
+ migrationStatus: 'active',
1327
+ migrationIntent: 'savefile'
1328
+ },
1329
+ initialize: function initialize() {
1330
+ this.set('stageModels', {});
1331
+ this.set('_initialStages', this.get('stages'));
1332
+ this.set('stages', []);
1333
+ _.each(this.get('_initialStages'), function (stage, items, dataType) {
1334
+ this.addStage(stage.name, items, dataType);
1335
+ }, this);
1336
+ },
1337
+ addStage: function addStage(name, items, dataType, extend) {
1338
+ var itemsArr = [];
1339
+ var stage;
1340
+
1341
+ _.each(items, function (item) {
1342
+ var size, rows;
1343
+
1344
+ if ('remote' === dataType) {
1345
+ size = this.get('remoteTableSizes')[item];
1346
+ rows = this.get('remoteTableRows')[item];
1347
+ } else {
1348
+ size = this.get('localTableSizes')[item];
1349
+ rows = this.get('localTableRows')[item];
1350
+ }
1351
+
1352
+ itemsArr.push({
1353
+ name: item,
1354
+ size: size,
1355
+ rows: rows
1356
+ });
1357
+ }, this);
1358
+
1359
+ stage = {
1360
+ name: name,
1361
+ items: itemsArr,
1362
+ dataType: dataType
1363
+ };
1364
+
1365
+ if ('object' === (typeof extend === 'undefined' ? 'undefined' : _typeof(extend))) {
1366
+ stage = $.extend(stage, extend);
1367
+ }
1368
+
1369
+ this.addStageModel(stage);
1370
+
1371
+ this.trigger('stage:added', this.get('stageModels')[name]);
1372
+ this.get('stageModels')[name].on('change', function () {
1373
+ this.trigger('change');
1374
+ }, this);
1375
+
1376
+ return this.getStageModel(stage.name);
1377
+ },
1378
+ addStageItem: function addStageItem(stage, name, size, rows) {
1379
+ this.getStageModel(stage).addItem(name, size, rows);
1380
+ },
1381
+ addStageModel: function addStageModel(stage) {
1382
+ var stages = this.get('stages');
1383
+ var stageModels = this.get('stageModels');
1384
+ var newStageModel = new MigrationProgressStageModel(stage);
1385
+
1386
+ stages.push(stage);
1387
+ stageModels[stage.name] = newStageModel;
1388
+
1389
+ this.set('stages', stages);
1390
+ this.set('stageModels', stageModels);
1391
+ },
1392
+ getStageModel: function getStageModel(name) {
1393
+ return this.get('stageModels')[name];
1394
+ },
1395
+ getStageItems: function getStageItems(stage, map) {
1396
+ var stageModel = this.getStageModel(stage);
1397
+ var items = stageModel.get('items');
1398
+
1399
+ if (undefined === map) {
1400
+ return items;
1401
+ } else {
1402
+ return items.map(function (item) {
1403
+ return item[map];
1404
+ });
1405
+ }
1406
+ },
1407
+ setActiveStage: function setActiveStage(stage) {
1408
+ this.setStageComplete();
1409
+ this.set('activeStageName', stage);
1410
+ this.getStageModel(stage).set('status', 'active');
1411
+ this.trigger('change:activeStage');
1412
+ },
1413
+ setStageComplete: function setStageComplete(stage) {
1414
+ if (!stage) {
1415
+ stage = this.get('activeStageName');
1416
+ }
1417
+ if (null !== stage) {
1418
+ this.getStageModel(stage).set('status', 'complete');
1419
+ }
1420
+
1421
+ wpmdb.current_migration.currentStageNum = wpmdb.current_migration.currentStageNum + 1;
1422
+ },
1423
+ setMigrationComplete: function setMigrationComplete() {
1424
+ var lastStage = this.getStageModel(this.get('activeStageName'));
1425
+ this.setStageComplete();
1426
+ this.trigger('migrationComplete');
1427
+ this.set('migrationStatus', 'complete');
1428
+ lastStage.activateTab();
1429
+ }
1430
+ });
1431
+
1432
+ module.exports = MigrationProgressModel;
1433
+
1434
+ },{"MigrationProgressStage-model":10}],8:[function(require,module,exports){
1435
+ 'use strict';
1436
+
1437
+ var $ = jQuery;
1438
+
1439
+ module.exports = {
1440
+ updateProgTableVisibilitySetting: function updateProgTableVisibilitySetting() {
1441
+ if (!wpmdb_data.prog_tables_visibility_changed) {
1442
+ return;
1443
+ }
1444
+ wpmdb_data.prog_tables_visibility_changed = false;
1445
+
1446
+ $.ajax({
1447
+ url: ajaxurl,
1448
+ type: 'POST',
1449
+ dataType: 'text',
1450
+ cache: false,
1451
+ data: {
1452
+ action: 'wpmdb_save_setting',
1453
+ nonce: wpmdb_data.nonces.save_setting,
1454
+ setting: 'prog_tables_hidden',
1455
+ checked: Boolean(wpmdb_data.prog_tables_hidden)
1456
+ },
1457
+ error: function error(jqXHR, textStatus, errorThrown) {
1458
+ console.log('Could not save progress item visibility setting', errorThrown);
1459
+ }
1460
+ });
1461
+ },
1462
+ updatePauseBeforeFinalizeSetting: function updatePauseBeforeFinalizeSetting() {
1463
+ if (!wpmdb_data.pause_before_finalize_changed) {
1464
+ return;
1465
+ }
1466
+ wpmdb_data.pause_before_finalize_changed = false;
1467
+
1468
+ $.ajax({
1469
+ url: ajaxurl,
1470
+ type: 'POST',
1471
+ dataType: 'text',
1472
+ cache: false,
1473
+ data: {
1474
+ action: 'wpmdb_save_setting',
1475
+ nonce: wpmdb_data.nonces.save_setting,
1476
+ setting: 'pause_before_finalize',
1477
+ checked: Boolean(wpmdb_data.pause_before_finalize)
1478
+ },
1479
+ error: function error(jqXHR, textStatus, errorThrown) {
1480
+ console.log('Could not save pause before finalize setting', errorThrown);
1481
+ }
1482
+ });
1483
+ }
1484
+ };
1485
+
1486
+ },{}],9:[function(require,module,exports){
1487
+ 'use strict';
1488
+
1489
+ var MigrationProgressStageView = require('./MigrationProgressStage-view.js');
1490
+ var $ = jQuery;
1491
+
1492
+ var MigrationProgressView = Backbone.View.extend({
1493
+ tagName: 'div',
1494
+ className: 'migration-progress-stages',
1495
+ id: 'migration-progress-stages',
1496
+ self: undefined,
1497
+ initialize: function initialize() {
1498
+ this.$el.empty();
1499
+
1500
+ this.model.on('stage:added', function (stageModel) {
1501
+ this.addStageView(stageModel);
1502
+ }, this);
1503
+
1504
+ _.each(this.model.get('stageModels'), this.addStageView, this);
1505
+ },
1506
+ addStageView: function addStageView(stageModel) {
1507
+ var newStageSubView = new MigrationProgressStageView({
1508
+ model: stageModel
1509
+ });
1510
+ stageModel.trigger('view:initialized', newStageSubView);
1511
+ this.$el.append(newStageSubView.$el);
1512
+ this.$el.parent().find('.stage-tabs').append(newStageSubView.$tabElem);
1513
+ }
1514
+ });
1515
+
1516
+ module.exports = MigrationProgressView;
1517
+
1518
+ },{"./MigrationProgressStage-view.js":11}],10:[function(require,module,exports){
1519
+ 'use strict';
1520
+
1521
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
1522
+
1523
+ var $ = jQuery;
1524
+
1525
+ var MigrationProgressStage = Backbone.Model.extend({
1526
+ defaults: {
1527
+ status: 'queued',
1528
+ _initialItems: null,
1529
+ items: null,
1530
+ lookupItems: null,
1531
+ totalSize: 0,
1532
+ totalTransferred: 0,
1533
+ dataType: 'local',
1534
+ name: '',
1535
+ itemsComplete: 0,
1536
+ itemsCompleteArr: [],
1537
+ strings: null
1538
+ },
1539
+ initialize: function initialize() {
1540
+ this.initStrings();
1541
+
1542
+ this.set('_initialItems', this.get('items').slice());
1543
+ this.set('items', []);
1544
+ this.set('lookupItems', {});
1545
+ this.set('itemsCompleteArr', []);
1546
+
1547
+ _.each(this.get('_initialItems'), function (item) {
1548
+ this.addItem(item.name, item.size, item.rows);
1549
+ }, this);
1550
+
1551
+ this.on('view:initialized', this.triggerItemViewInit);
1552
+
1553
+ this.on('change', function () {
1554
+ wpmdb.current_migration.updateTitleElem();
1555
+ });
1556
+ },
1557
+ initStrings: function initStrings() {
1558
+ var default_strings = {
1559
+ stage_title: this.get('name'),
1560
+ migrated: wpmdb_strings.migrated,
1561
+ queued: wpmdb_strings.queued,
1562
+ active: wpmdb_strings.running,
1563
+ complete: wpmdb_strings.complete,
1564
+ hide: wpmdb_strings.hide,
1565
+ show: wpmdb_strings.show,
1566
+ itemsName: wpmdb_strings.tables
1567
+ };
1568
+ var strings = this.get('strings');
1569
+
1570
+ strings = 'object' === (typeof strings === 'undefined' ? 'undefined' : _typeof(strings)) ? strings : {};
1571
+ strings = $.extend(default_strings, strings);
1572
+
1573
+ strings.items_migrated = strings.itemsName + ' ' + strings.migrated;
1574
+ strings.hide_items = strings.hide + ' ' + strings.itemsName;
1575
+ strings.show_items = strings.show + ' ' + strings.itemsName;
1576
+
1577
+ this.set('strings', strings);
1578
+ },
1579
+ addItem: function addItem(name, size, rows) {
1580
+ var items = this.get('items');
1581
+ var item = {
1582
+ name: name,
1583
+ size: size,
1584
+ rows: rows || size,
1585
+ stageName: this.get('name'),
1586
+ $el: null,
1587
+ transferred: 0,
1588
+ rowsTransferred: 0,
1589
+ complete: false
1590
+ };
1591
+
1592
+ items.push(item);
1593
+ this.get('lookupItems')[name] = items.length - 1;
1594
+
1595
+ this.set('totalSize', parseInt(this.get('totalSize')) + parseInt(size));
1596
+ this.trigger('item:added', item);
1597
+ },
1598
+ triggerItemViewInit: function triggerItemViewInit() {
1599
+ var items = this.get('items');
1600
+ var self = this;
1601
+ _.each(items, function (item) {
1602
+ self.trigger('item:added', item);
1603
+ });
1604
+ },
1605
+ getTotalSizeTransferred: function getTotalSizeTransferred() {
1606
+ return this.get('totalTransferred');
1607
+ },
1608
+ countItemsComplete: function countItemsComplete() {
1609
+ return this.get('itemsComplete');
1610
+ },
1611
+ getTotalProgressPercent: function getTotalProgressPercent() {
1612
+ var transferred = this.getTotalSizeTransferred();
1613
+ var total = this.get('totalSize');
1614
+ if (0 >= transferred || 0 >= total) {
1615
+ return 0;
1616
+ }
1617
+ return Math.min(100, Math.floor(transferred / total * 100));
1618
+ },
1619
+ activateTab: function activateTab() {
1620
+ this.trigger('activateTab');
1621
+ wpmdb.current_migration.model.trigger('change:activeStage');
1622
+ },
1623
+ setItemComplete: function setItemComplete(itemName) {
1624
+
1625
+ // Guard: return if item has already been set complete
1626
+ var itemsCompleteArr = this.get('itemsCompleteArr');
1627
+ if (~itemsCompleteArr.indexOf(itemName)) {
1628
+ return;
1629
+ }
1630
+ itemsCompleteArr.push(itemName);
1631
+
1632
+ var item = this.getItemByName(itemName);
1633
+ var totalTransferred = this.get('totalTransferred');
1634
+ var itemsComplete = this.get('itemsComplete');
1635
+
1636
+ this.set('itemsComplete', ++itemsComplete);
1637
+
1638
+ totalTransferred += item.size - item.transferred;
1639
+ this.set('totalTransferred', totalTransferred);
1640
+
1641
+ item.transferred = item.size;
1642
+ item.complete = true;
1643
+ item.rowsTransferred = item.rows;
1644
+ this.trigger('change change:items', item);
1645
+ },
1646
+ setItemRowsTransferred: function setItemRowsTransferred(itemName, numRows) {
1647
+ var amtDone, estTransferred;
1648
+ var item = this.getItemByName(itemName);
1649
+ var totalTransferred = this.get('totalTransferred');
1650
+
1651
+ if (-1 === parseInt(numRows)) {
1652
+ amtDone = 1;
1653
+ } else {
1654
+ amtDone = Math.min(1, numRows / item.rows);
1655
+ }
1656
+
1657
+ if (1 === amtDone) {
1658
+ this.setItemComplete(itemName);
1659
+ return;
1660
+ }
1661
+
1662
+ estTransferred = item.size * amtDone;
1663
+
1664
+ totalTransferred += estTransferred - item.transferred;
1665
+ this.set('totalTransferred', totalTransferred);
1666
+
1667
+ item.transferred = estTransferred;
1668
+ item.rowsTransferred = numRows;
1669
+ this.trigger('change change:items', item);
1670
+ },
1671
+ getItemByName: function getItemByName(itemName) {
1672
+ var item = this.get('items')[this.get('lookupItems')[itemName]] || {};
1673
+ if (itemName === item.name) {
1674
+ return item;
1675
+ } else {
1676
+ return this.determineItemByName(itemName);
1677
+ }
1678
+ },
1679
+ determineItemByName: function determineItemByName(itemName) {
1680
+ var items = this.get('items');
1681
+ for (var index = 0; index < items.length; index++) {
1682
+ var item = items[index];
1683
+ if (itemName === item.name) {
1684
+ this.get('lookupItems').itemName = index;
1685
+ return item;
1686
+ }
1687
+ }
1688
+ }
1689
+ });
1690
+
1691
+ module.exports = MigrationProgressStage;
1692
+
1693
+ },{}],11:[function(require,module,exports){
1694
+ 'use strict';
1695
+
1696
+ var $ = jQuery;
1697
+
1698
+ var MigrationProgressStageView = Backbone.View.extend({
1699
+ tagName: 'div',
1700
+ className: 'migration-progress-stage-container hide-tables',
1701
+ $totalProgressElem: null,
1702
+ $tabElem: null,
1703
+ $showHideTablesElem: null,
1704
+ $pauseBeforeFinalizeElem: null,
1705
+ $pauseBeforeFinalizeCheckbox: null,
1706
+ $itemsContainer: null,
1707
+ itemViews: null,
1708
+ maxDomNodes: 100,
1709
+ visibleDomNodes: 0,
1710
+ queuedElements: null,
1711
+ $truncationNotice: null,
1712
+ $truncationNoticeHiddenItems: null,
1713
+ initialize: function initialize() {
1714
+ this.$el.empty();
1715
+ this.$el.attr('data-stage', this.model.get('name')).addClass('queued ' + this.model.get('name'));
1716
+
1717
+ this.queuedElements = [];
1718
+
1719
+ this.initTotalProgressElem();
1720
+ wpmdb.current_migration.view.$el.parent().find('.stage-tabs').after(this.$totalProgressElem);
1721
+
1722
+ this.$itemsContainer = $('<div class=progress-items />');
1723
+ this.$el.append(this.$itemsContainer);
1724
+
1725
+ this.initTabElem();
1726
+
1727
+ this.model.on('item:added', this.maybeAddElementToView, this);
1728
+
1729
+ _.each(this.model.get('itemModels'), this.maybeAddElementToView, this);
1730
+ this.model.on('change', function () {
1731
+ this.updateProgressElem();
1732
+ this.updateStageTotals();
1733
+ }, this);
1734
+
1735
+ this.model.on('change:status', function (e) {
1736
+ this.$el.removeClass('queued active').addClass(this.model.get('status'));
1737
+ this.$totalProgressElem.removeClass('queued active').addClass(this.model.get('status'));
1738
+ this.$tabElem.removeClass('queued active').addClass(this.model.get('status')).find('.stage-status').text(this.model.get('strings')[this.model.get('status')]);
1739
+ }, this);
1740
+
1741
+ this.model.on('change:items', function (item) {
1742
+ if (item.name) {
1743
+ this.setItemProgress(item);
1744
+ }
1745
+ }, this);
1746
+
1747
+ this.model.on('activateTab', function () {
1748
+ if ('complete' === wpmdb.current_migration.model.get('migrationStatus')) {
1749
+ this.$totalProgressElem.addClass('active').siblings().removeClass('active');
1750
+ this.$tabElem.addClass('active').siblings().removeClass('active');
1751
+ this.$el.addClass('active').siblings().removeClass('active');
1752
+ }
1753
+ }, this);
1754
+ },
1755
+ initTotalProgressElem: function initTotalProgressElem() {
1756
+ this.initShowHideTablesElem();
1757
+ this.initPauseBeforeFinalizeElem();
1758
+
1759
+ this.$totalProgressElem = $('<div class="stage-progress ' + this.model.get('name') + '" />').append('<span class=percent-complete>0</span>% ' + this.model.get('strings').complete + ' ').append('<span class="size-complete-wrap">(<span class=size-complete>0 MB</span> / <span class=size-total>0 MB</span>) </span>').append('<span class="items-complete-wrap"><span class=items-complete>0</span> <span class=lowercase >of</span> <span class=items-total>0</span> ' + this.model.get('strings').items_migrated + '</span>').append(this.$showHideTablesElem).append('<div class=progress-bar-wrapper><div class=progress-bar /></div>');
1760
+
1761
+ this.updateStageTotals();
1762
+ },
1763
+ initShowHideTablesElem: function initShowHideTablesElem() {
1764
+ this.$showHideTablesElem = $('<a class=show-hide-tables/>').text(this.model.get('strings').show_items);
1765
+ var self = this;
1766
+ this.$showHideTablesElem.on('click show-hide-progress-tables', function () {
1767
+ var progTablesHidden;
1768
+ if (self.$el.hasClass('hide-tables')) {
1769
+ // show tables
1770
+ progTablesHidden = false;
1771
+ self.$el.add(self.$el.siblings()).removeClass('hide-tables');
1772
+ self.$showHideTablesElem.text(self.model.get('strings').hide_items);
1773
+ } else {
1774
+ // hide tables
1775
+ progTablesHidden = true;
1776
+ self.$el.add(self.$el.siblings()).addClass('hide-tables');
1777
+ self.$showHideTablesElem.text(self.model.get('strings').show_items);
1778
+ }
1779
+
1780
+ if (Boolean(progTablesHidden) !== Boolean(wpmdb_data.prog_tables_hidden)) {
1781
+ wpmdb_data.prog_tables_visibility_changed = true;
1782
+ wpmdb_data.prog_tables_hidden = progTablesHidden;
1783
+ }
1784
+ });
1785
+
1786
+ // show progress tables on init if hidden is false
1787
+ if (!wpmdb_data.prog_tables_hidden) {
1788
+ this.$showHideTablesElem.triggerHandler('show-hide-progress-tables');
1789
+ }
1790
+
1791
+ // make sure text reflects current state when showing
1792
+ this.model.on('change:status activateTab', function () {
1793
+ if (wpmdb_data.prog_tables_hidden) {
1794
+ self.$showHideTablesElem.text(self.model.get('strings').show_items);
1795
+ } else {
1796
+ self.$showHideTablesElem.text(self.model.get('strings').hide_items);
1797
+ }
1798
+ });
1799
+ },
1800
+ initPauseBeforeFinalizeElem: function initPauseBeforeFinalizeElem() {
1801
+ this.$pauseBeforeFinalizeElem = $('.pause-before-finalize');
1802
+ this.$pauseBeforeFinalizeCheckbox = this.$pauseBeforeFinalizeElem.find('input[type=checkbox]');
1803
+ var self = this;
1804
+ var isChecked = false;
1805
+ var migrationIntent = wpmdb.current_migration.model.get('migrationIntent');
1806
+
1807
+ // make sure checkbox is checked based on current state
1808
+ if (wpmdb_data.pause_before_finalize) {
1809
+ isChecked = true;
1810
+ }
1811
+ this.$pauseBeforeFinalizeCheckbox.prop('checked', isChecked);
1812
+
1813
+ // only display on certain migrations
1814
+ if (-1 !== $.inArray(migrationIntent, ['push', 'pull', 'find_replace', 'import'])) {
1815
+ if ('find_replace' === migrationIntent) {
1816
+ $('#pause-before-finalize-label').text(wpmdb_strings.pause_before_finalize_find_replace);
1817
+ }
1818
+ this.$pauseBeforeFinalizeElem.show();
1819
+ } else {
1820
+ this.$pauseBeforeFinalizeElem.hide();
1821
+ }
1822
+
1823
+ // hide on media stage
1824
+ wpmdb.current_migration.model.on('change:activeStage', function () {
1825
+ if ('media' === wpmdb.current_migration.model.get('activeStageName')) {
1826
+ self.$pauseBeforeFinalizeElem.hide();
1827
+ }
1828
+ });
1829
+
1830
+ this.$pauseBeforeFinalizeElem.on('click', function () {
1831
+ var pauseBeforeFinalizeValue = Boolean(self.$pauseBeforeFinalizeCheckbox.is(':checked'));
1832
+ if (pauseBeforeFinalizeValue !== Boolean(wpmdb_data.pause_before_finalize)) {
1833
+ wpmdb_data.pause_before_finalize_changed = true;
1834
+ wpmdb_data.pause_before_finalize = pauseBeforeFinalizeValue;
1835
+ }
1836
+ });
1837
+ },
1838
+ initTabElem: function initTabElem() {
1839
+ var self = this;
1840
+ this.$tabElem = $('<a class=stage-tab>').append('<span class=stage-title>' + this.model.get('strings').stage_title + '</span> ').append('<span class=stage-status>' + this.model.get('strings').queued + '</span> ').on('click', function () {
1841
+ self.model.activateTab();
1842
+ });
1843
+ },
1844
+ updateProgressElem: function updateProgressElem() {
1845
+ var percentDone = Math.max(0, this.model.getTotalProgressPercent());
1846
+ var sizeDone = wpmdb.functions.convertKBSizeToHRFixed(Math.min(this.model.getTotalSizeTransferred(), this.model.get('totalSize')));
1847
+ var tablesDone = Math.min(this.model.countItemsComplete(), this.model.get('items').length);
1848
+
1849
+ if ('complete' === this.model.get('status') && 0 === this.model.get('totalSize')) {
1850
+ percentDone = 100;
1851
+ this.$showHideTablesElem.fadeOut();
1852
+ }
1853
+
1854
+ this.$totalProgressElem.find('.percent-complete').text(percentDone);
1855
+ this.$totalProgressElem.find('.size-complete').text(sizeDone);
1856
+ this.$totalProgressElem.find('.items-complete').text(wpmdb.functions.wpmdb_add_commas(tablesDone));
1857
+ this.$totalProgressElem.find('.progress-bar-wrapper .progress-bar').css({ width: percentDone + '%' });
1858
+ },
1859
+ updateStageTotals: function updateStageTotals() {
1860
+ var itemCount = this.model.get('items').length;
1861
+ this.$totalProgressElem.find('.items-total').text(wpmdb.functions.wpmdb_add_commas(itemCount));
1862
+ this.$totalProgressElem.find('.size-total').text(wpmdb.functions.convertKBSizeToHRFixed(this.model.get('totalSize')));
1863
+ },
1864
+ initializeItemElement: function initializeItemElement(item) {
1865
+ var $el = $('<div class="item-progress" />');
1866
+ var $progress = $('<div class="progress-bar"/>').css('width', '0%');
1867
+ var $title = $('<p>').addClass('item-info').append($('<span class="name" />').text(item.name)).append(' ').append($('<span class="size" />').text('(' + wpmdb.functions.convertKBSizeToHRFixed(item.size) + ')'));
1868
+
1869
+ $el.append($title);
1870
+ $el.append($progress);
1871
+ $el.append('<span class="dashicons dashicons-yes"/>');
1872
+
1873
+ $el.attr('id', 'item-' + item.name);
1874
+ $el.attr('data-stage', this.model.get('name'));
1875
+
1876
+ item.$el = $el;
1877
+ item.$progress = $progress;
1878
+ item.$title = $title;
1879
+
1880
+ return item;
1881
+ },
1882
+ maybeAddElementToView: function maybeAddElementToView(item) {
1883
+ if (this.visibleDomNodes < this.maxDomNodes) {
1884
+ ++this.visibleDomNodes;
1885
+ this.$itemsContainer.append(this.initializeItemElement(item).$el);
1886
+ } else {
1887
+ this.queuedElements.push(item);
1888
+ if (!this.$truncationNotice) {
1889
+ this.showTruncationNotice();
1890
+ } else {
1891
+ this.updateTruncationNotice();
1892
+ }
1893
+ }
1894
+ },
1895
+ showTruncationNotice: function showTruncationNotice() {
1896
+ if (this.$truncationNotice) {
1897
+ return;
1898
+ }
1899
+ this.$truncationNotice = $('<div class="truncation-notice" >' + wpmdb_strings.progress_items_truncated_msg.replace('%1$s', '<span class="hidden-items">' + wpmdb.functions.wpmdb_add_commas(this.queuedElements.length) + '</span>') + '</div>');
1900
+ this.$truncationNoticeHiddenItems = this.$truncationNotice.find('.hidden-items');
1901
+ this.$itemsContainer.after(this.$truncationNotice);
1902
+ },
1903
+ updateTruncationNotice: function updateTruncationNotice() {
1904
+ this.$truncationNoticeHiddenItems.text(wpmdb.functions.wpmdb_add_commas(this.queuedElements.length));
1905
+ },
1906
+ getNextElementForView: function getNextElementForView($el) {
1907
+ var queueItem;
1908
+ if (this.queuedElements.length) {
1909
+ if ($el) {
1910
+ this.queuedElements.push($el);
1911
+ }
1912
+ queueItem = this.queuedElements.shift();
1913
+ if (queueItem instanceof $) {
1914
+ $el = queueItem;
1915
+ } else {
1916
+ $el = this.initializeItemElement(queueItem).$el;
1917
+ }
1918
+ }
1919
+ return $el;
1920
+ },
1921
+ setItemProgress: function setItemProgress(item) {
1922
+ var percentDone = Math.min(100, Math.ceil(100 * (item.transferred / item.size)));
1923
+ item.$progress.css('width', percentDone + '%');
1924
+ if (100 <= percentDone) {
1925
+ this.elemComplete(item);
1926
+ }
1927
+ },
1928
+ elemComplete: function elemComplete(item) {
1929
+ var $el = item.$el.addClass('complete');
1930
+
1931
+ // skip moving item to end of list if there's only one item in the list
1932
+ if (1 === this.model.get('items').length) {
1933
+ return;
1934
+ }
1935
+
1936
+ var $nextEl = this.getNextElementForView($el);
1937
+
1938
+ var height = $el.height();
1939
+ var marginBottom = $el.css('margin-bottom');
1940
+
1941
+ var $clone = $nextEl.clone().css({ height: 0, marginBottom: 0 }).addClass('clone');
1942
+ $clone.appendTo(this.$itemsContainer);
1943
+ $el.css({ height: height, marginBottom: marginBottom });
1944
+
1945
+ setTimeout(function () {
1946
+ $el.css({ height: 0, marginBottom: 0 });
1947
+ $clone.css({ height: height, marginBottom: marginBottom });
1948
+
1949
+ setTimeout(function () {
1950
+ $el.css({ height: 'auto', marginBottom: marginBottom }).remove();
1951
+ $clone.remove();
1952
+ this.$itemsContainer.find('.item-progress:not(.clone)').last().after($nextEl.css({ height: 'auto', marginBottom: marginBottom }));
1953
+ }.bind(this), 250);
1954
+ }.bind(this), 1000);
1955
+ }
1956
+ });
1957
+
1958
+ module.exports = MigrationProgressStageView;
1959
+
1960
+ },{}],12:[function(require,module,exports){
1961
+ 'use strict';
1962
+
1963
+ window.wpmdb = window.wpmdb || {};
1964
+
1965
+ (function ($, wpmdb) {
1966
+ wpmdb.functions.update_multiselect = function (element, subsites, selected_subsite_ids) {
1967
+ $(element).empty();
1968
+
1969
+ if (0 < Object.keys(subsites).length) {
1970
+ var table_prefix = $.wpmdb.apply_filters('wpmdb_get_table_prefix', null, null);
1971
+ var site_selected = false;
1972
+ $.each(subsites, function (blog_id, subsite_path) {
1973
+ if ($.wpmdb.apply_filters('wpmdb_exclude_subsite', false, blog_id)) {
1974
+ return;
1975
+ }
1976
+
1977
+ var selected = ' ';
1978
+ if (undefined === selected_subsite_ids || null === selected_subsite_ids || 0 === selected_subsite_ids.length || undefined !== selected_subsite_ids && null !== selected_subsite_ids && 0 < selected_subsite_ids.length && -1 !== $.inArray(blog_id, selected_subsite_ids)) {
1979
+ selected = ' selected="selected" ';
1980
+ site_selected = true;
1981
+ }
1982
+ subsite_path += ' (' + table_prefix + ('1' !== blog_id ? blog_id + '_' : '') + ')';
1983
+ $(element).append('<option' + selected + 'value="' + blog_id + '">' + subsite_path + '</option>');
1984
+ });
1985
+
1986
+ // If nothing selected (maybe IDs differ between saved profile and current config) revert to default of all selected.
1987
+ if (false === site_selected) {
1988
+ wpmdb.functions.update_multiselect(element, subsites, []);
1989
+ }
1990
+ }
1991
+ };
1992
+ })(jQuery, wpmdb);
1993
+
1994
+ },{}],13:[function(require,module,exports){
1995
+ 'use strict';
1996
+
1997
+ (function ($) {
1998
+
1999
+ var doing_check_licence = false;
2000
+ var fade_duration = 650;
2001
+
2002
+ var admin_url = ajaxurl.replace('/admin-ajax.php', '');
2003
+ var spinner_url = admin_url + '/images/spinner';
2004
+ var spinner;
2005
+ if (2 < window.devicePixelRatio) {
2006
+ spinner_url += '-2x';
2007
+ }
2008
+ spinner_url += '.gif';
2009
+ spinner = $('<img src="' + spinner_url + '" alt="" class="check-licence-spinner" />');
2010
+
2011
+ $(document).ready(function () {
2012
+
2013
+ $('body').on('click', '.check-my-licence-again', function (e) {
2014
+ e.preventDefault();
2015
+ $(this).blur();
2016
+
2017
+ if (doing_check_licence) {
2018
+ return false;
2019
+ }
2020
+
2021
+ doing_check_licence = true;
2022
+
2023
+ $(this).hide();
2024
+ spinner.insertAfter(this);
2025
+
2026
+ var check_again_link = ' <a class="check-my-licence-again" href="#">' + wpmdb_update_strings.check_license_again + '</a>';
2027
+
2028
+ $.ajax({
2029
+ url: ajaxurl,
2030
+ type: 'POST',
2031
+ dataType: 'json',
2032
+ cache: false,
2033
+ data: {
2034
+ action: 'wpmdb_check_licence',
2035
+ nonce: wpmdb_nonces.check_licence,
2036
+ context: 'update'
2037
+ },
2038
+ error: function error(jqXHR, textStatus, errorThrown) {
2039
+ doing_check_licence = false;
2040
+ $('.wpmdb-licence-error-notice').fadeOut(fade_duration, function () {
2041
+ $('.wpmdb-licence-error-notice').empty().html(wpmdb_update_strings.license_check_problem + check_again_link).fadeIn(fade_duration);
2042
+ });
2043
+ },
2044
+ success: function success(data) {
2045
+ doing_check_licence = false;
2046
+ if ('undefined' !== typeof data.errors) {
2047
+ var msg = '';
2048
+ for (var key in data.errors) {
2049
+ msg += data.errors[key];
2050
+ }
2051
+ $('.wpmdb-licence-error-notice').fadeOut(fade_duration, function () {
2052
+ $('.check-licence-spinner').remove();
2053
+ $('.wpmdb-licence-error-notice').empty().html(msg).fadeIn(fade_duration);
2054
+ });
2055
+ } else {
2056
+
2057
+ // Success
2058
+ // Fade out, empty wpmdb custom error content, swap back in the original wordpress upgrade message, fade in
2059
+ $('.wpmdbpro-custom-visible').fadeOut(fade_duration, function () {
2060
+ $('.check-licence-spinner').remove();
2061
+ $('.wpmdbpro-custom-visible').empty().html($('.wpmdb-original-update-row').html()).fadeIn(fade_duration);
2062
+ });
2063
+ }
2064
+ }
2065
+ });
2066
+ });
2067
+
2068
+ $('.wpmdbpro-custom').prev().addClass('wpmdbpro-has-message');
2069
+ });
2070
+ })(jQuery);
2071
+
2072
+ },{}],14:[function(require,module,exports){
2073
+ 'use strict';
2074
+
2075
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
2076
+
2077
+ window.wpmdb = window.wpmdb || {};
2078
+
2079
+ (function ($, wpmdb) {
2080
+
2081
+ var connection_established = false;
2082
+ var last_replace_switch = '';
2083
+ var doing_ajax = false;
2084
+ var doing_licence_registration_ajax = false;
2085
+ var doing_reset_api_key_ajax = false;
2086
+ var doing_save_profile = false;
2087
+ var doing_plugin_compatibility_ajax = false;
2088
+ var profile_name_edited = false;
2089
+ var checked_licence = false;
2090
+ var show_prefix_notice = false;
2091
+ var show_ssl_notice = false;
2092
+ var force_reconnect = false;
2093
+ var migration_selection = '';
2094
+ var show_version_notice = false;
2095
+ var migration_completed = false;
2096
+ var currently_migrating = false;
2097
+ var dump_filename = '';
2098
+ var dump_path = '';
2099
+ var migration_intent;
2100
+ var remote_site;
2101
+ var secret_key;
2102
+ var form_data;
2103
+ var stage;
2104
+ var elapsed_interval;
2105
+ var completed_msg;
2106
+ var tables_to_migrate = [];
2107
+ var migration_paused = false;
2108
+ var previous_progress_title = '';
2109
+ var previous_progress_text_primary = '';
2110
+ var previous_progress_text_secondary = '';
2111
+ var cancelling_text = '';
2112
+ var paused_text = '';
2113
+ var migration_cancelled = false;
2114
+ var flag_skip_delay = false;
2115
+ var delay_between_requests = 0;
2116
+ var fade_duration = 400;
2117
+ var pause_before_finalize = false;
2118
+ var is_auto_pause_before_finalize = false;
2119
+ var spinner_url = wpmdb.functions.get_spinner_url();
2120
+ var ajax_spinner = '<img src="' + spinner_url + '" alt="" class="ajax-spinner general-spinner" />';
2121
+
2122
+ wpmdb.migration_progress_controller = require('MigrationProgress-controller');
2123
+ wpmdb.current_migration = null;
2124
+ wpmdb.migration_selection = wpmdb.functions.wpmdb_migration_type();
2125
+
2126
+ var $push_select = $('#select-tables').clone();
2127
+ var $pull_select = $('#select-tables').clone();
2128
+ var $push_post_type_select = $('#select-post-types').clone();
2129
+ var $pull_post_type_select = $('#select-post-types').clone();
2130
+ var $push_select_backup = $('#select-backup').clone();
2131
+ var $pull_select_backup = $('#select-backup').clone();
2132
+
2133
+ var $connection_info_box = $('.connection-info-wrapper');
2134
+
2135
+ window.onbeforeunload = function (e) {
2136
+ if ('import' === wpmdb.functions.wpmdb_migration_type() && !$('.step-two').is(':visible')) {
2137
+ wpmdb.functions.remove_localStorage_form_data();
2138
+ }
2139
+
2140
+ if (currently_migrating) {
2141
+ e = e || window.event;
2142
+
2143
+ // For IE and Firefox prior to version 4
2144
+ if (e) {
2145
+ e.returnValue = wpmdb_strings.sure;
2146
+ }
2147
+
2148
+ // For Safari
2149
+ return wpmdb_strings.sure;
2150
+ }
2151
+ };
2152
+
2153
+ function pad(n, width, z) {
2154
+ z = z || '0';
2155
+ n = n + '';
2156
+ return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
2157
+ }
2158
+
2159
+ function is_int(n) {
2160
+ n = parseInt(n);
2161
+ return 'number' === typeof n && 0 === n % 1;
2162
+ }
2163
+
2164
+ function get_intersect(arr1, arr2) {
2165
+ var r = [],
2166
+ o = {},
2167
+ l = arr2.length,
2168
+ i,
2169
+ v;
2170
+ for (i = 0; i < l; i++) {
2171
+ o[arr2[i]] = true;
2172
+ }
2173
+ l = arr1.length;
2174
+ for (i = 0; i < l; i++) {
2175
+ v = arr1[i];
2176
+ if (v in o) {
2177
+ r.push(v);
2178
+ }
2179
+ }
2180
+
2181
+ return r;
2182
+ }
2183
+
2184
+ function pin_replace_url(pin) {
2185
+ if (true === pin && 1 > $('.replace-row.pin').length && 1 === $('#old-url').length) {
2186
+ $('#old-url').parents('.replace-row').addClass('pin');
2187
+ }
2188
+
2189
+ if (false === pin && 0 < $('.replace-row.pin').length) {
2190
+ $('.replace-row.pin').removeClass('pin');
2191
+ }
2192
+ }
2193
+
2194
+ /**
2195
+ * Core plugin wrapper for the common AJAX error detecting method
2196
+ *
2197
+ * @param text
2198
+ * @param code
2199
+ * @param jqXHR
2200
+ *
2201
+ * @returns {string}
2202
+ */
2203
+ function get_ajax_errors(text, code, jqXHR) {
2204
+ return wpmdb.functions.wpmdbGetAjaxErrors(wpmdb_strings.connection_local_server_problem, code, text, jqXHR);
2205
+ }
2206
+
2207
+ // updates the debug log when the user switches to the help tab
2208
+ function refresh_debug_log() {
2209
+ $.ajax({
2210
+ url: ajaxurl,
2211
+ type: 'POST',
2212
+ dataType: 'text',
2213
+ cache: false,
2214
+ data: {
2215
+ action: 'wpmdb_get_log',
2216
+ nonce: wpmdb_data.nonces.get_log
2217
+ },
2218
+ error: function error(jqXHR, textStatus, errorThrown) {
2219
+ alert(wpmdb_strings.update_log_problem);
2220
+ },
2221
+ success: function success(data) {
2222
+ $('.debug-log-textarea').val(data);
2223
+ }
2224
+ });
2225
+ }
2226
+
2227
+ function get_query_var(name) {
2228
+ name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
2229
+ var regex = new RegExp('[\\?&]' + name + '=([^&#]*)'),
2230
+ results = regex.exec(location.search);
2231
+ return null === results ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
2232
+ }
2233
+
2234
+ function maybe_show_ssl_warning(url, key, remote_scheme) {
2235
+ var scheme = url.substr(0, url.indexOf(':'));
2236
+ var $ssl_notice = $('.ssl-notice');
2237
+
2238
+ if (!show_ssl_notice) {
2239
+ $ssl_notice.hide();
2240
+ }
2241
+
2242
+ if (remote_scheme !== scheme && url.indexOf('https') !== -1) {
2243
+ $ssl_notice.show();
2244
+ show_ssl_notice = true;
2245
+ url = url.replace('https', 'http');
2246
+ $('.pull-push-connection-info').val(url + '\n' + key);
2247
+ return;
2248
+ }
2249
+
2250
+ show_ssl_notice = false;
2251
+ }
2252
+
2253
+ function validate_url(url) {
2254
+ return (/^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)){0})(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(url)
2255
+ );
2256
+ }
2257
+
2258
+ function refresh_table_selects() {
2259
+ if (undefined !== wpmdb_data && undefined !== wpmdb_data.this_tables && undefined !== wpmdb_data.this_table_sizes_hr) {
2260
+ $push_select = wpmdb.functions.create_table_select(wpmdb_data.this_tables, wpmdb_data.this_table_sizes_hr, $($push_select).val());
2261
+ }
2262
+
2263
+ if (undefined !== wpmdb.common.connection_data && undefined !== wpmdb.common.connection_data.tables && undefined !== wpmdb.common.connection_data.table_sizes_hr) {
2264
+ $pull_select = wpmdb.functions.create_table_select(wpmdb.common.connection_data.tables, wpmdb.common.connection_data.table_sizes_hr, $($pull_select).val());
2265
+ }
2266
+ }
2267
+
2268
+ function save_active_profile() {
2269
+ var profile;
2270
+ $('.save-settings-button').blur();
2271
+
2272
+ if (doing_save_profile) {
2273
+ return;
2274
+ }
2275
+
2276
+ if (true === wpmdb.functions.maybe_show_select_table_notice()) {
2277
+ return;
2278
+ }
2279
+
2280
+ var create_new_profile = false;
2281
+
2282
+ if ($('#create_new').is(':checked')) {
2283
+ create_new_profile = true;
2284
+ }
2285
+ var profile_name = $('.create-new-profile').val();
2286
+
2287
+ doing_save_profile = true;
2288
+ profile = $($('#migrate-form')[0].elements).not('.auth-credentials').serialize();
2289
+
2290
+ $('.save-settings-button').attr('disabled', 'disabled').after('<img src="' + spinner_url + '" alt="" class="save-profile-ajax-spinner general-spinner" />');
2291
+
2292
+ doing_ajax = true;
2293
+
2294
+ $.ajax({
2295
+ url: ajaxurl,
2296
+ type: 'POST',
2297
+ dataType: 'text',
2298
+ cache: false,
2299
+ data: {
2300
+ action: 'wpmdb_save_profile',
2301
+ profile: profile,
2302
+ nonce: wpmdb_data.nonces.save_profile
2303
+ },
2304
+ error: function error(jqXHR, textStatus, errorThrown) {
2305
+ doing_ajax = false;
2306
+ alert(wpmdb_strings.save_profile_problem);
2307
+ $('.save-settings-button').removeAttr('disabled');
2308
+ $('.save-profile-ajax-spinner').remove();
2309
+ $('.save-settings-button').after('<span class="ajax-success-msg">' + wpmdb_strings.saved + '</span>');
2310
+ $('.ajax-success-msg').fadeOut(2000, function () {
2311
+ $(this).remove();
2312
+ });
2313
+ doing_save_profile = false;
2314
+ },
2315
+ success: function success(data) {
2316
+ var updated_profile_id = parseInt($('#migrate-form input[name=save_migration_profile_option]:checked').val(), 10) + 1;
2317
+ doing_ajax = false;
2318
+ $('.save-settings-button').removeAttr('disabled');
2319
+ $('.save-profile-ajax-spinner').remove();
2320
+ $('.save-settings-button').after('<span class="ajax-success-msg">' + wpmdb_strings.saved + '</span>');
2321
+ $('.ajax-success-msg').fadeOut(2000, function () {
2322
+ $(this).remove();
2323
+ });
2324
+ doing_save_profile = false;
2325
+ $('.create-new-profile').val('');
2326
+
2327
+ if (create_new_profile) {
2328
+ var new_profile_key = parseInt(data, 10);
2329
+ var new_profile_id = new_profile_key + 1;
2330
+ var new_li = $('<li><span class="delete-profile" data-profile-id="' + new_profile_id + '"></span><label for="profile-' + new_profile_id + '"><input id="profile-' + new_profile_id + '" value="' + new_profile_key + '" name="save_migration_profile_option" type="radio"></label></li>');
2331
+ new_li.find('label').append(document.createTextNode(' ' + profile_name));
2332
+ updated_profile_id = new_profile_id;
2333
+
2334
+ $('#create_new').parents('li').before(new_li);
2335
+ $('#profile-' + new_profile_id).attr('checked', 'checked');
2336
+ }
2337
+
2338
+ // Push updated profile id to history if available
2339
+ var updated_url = window.location.href.replace('#migrate', '').replace(/&wpmdb-profile=-?\d+/, '') + '&wpmdb-profile=' + updated_profile_id;
2340
+ var updated_profile_name = $('#migrate-form input[name=save_migration_profile_option]:checked').parent().text().trim();
2341
+
2342
+ if ('function' === typeof window.history.pushState) {
2343
+ if ($('#migrate-form .crumbs').length) {
2344
+ $('#migrate-form .crumbs .crumb:last').text(updated_profile_name);
2345
+ } else {
2346
+ var $crumbs = $('<div class="crumbs" />').append('<a class="crumb" href="' + wpmdb_data.this_plugin_base + '"> Saved Profiles </a>').append('<span class="crumb">' + updated_profile_name + '</span>');
2347
+ $('#migrate-form').prepend($crumbs);
2348
+ }
2349
+ window.history.pushState({ updated_profile_id: updated_profile_id }, null, updated_url);
2350
+ }
2351
+ }
2352
+ });
2353
+ }
2354
+
2355
+ function cancel_migration(event) {
2356
+ migration_cancelled = true;
2357
+ cancelling_text = wpmdb_strings.cancelling_migration;
2358
+ $('.migration-controls').css({ visibility: 'hidden' });
2359
+
2360
+ if ('find_replace' === migration_intent) {
2361
+ cancelling_text = wpmdb_strings.cancelling_find_replace;
2362
+ }
2363
+
2364
+ wpmdb.current_migration.setState(cancelling_text, wpmdb_strings.completing_current_request, 'cancelling');
2365
+
2366
+ if (true === migration_paused) {
2367
+ migration_paused = false;
2368
+ wpmdb.functions.execute_next_step();
2369
+ }
2370
+ }
2371
+
2372
+ /**
2373
+ * Set checkbox
2374
+ *
2375
+ * @param string checkbox_wrap
2376
+ */
2377
+ function set_checkbox(checkbox_wrap) {
2378
+ var $switch = $('#' + checkbox_wrap);
2379
+ var $checkbox = $switch.find('input[type=checkbox]');
2380
+
2381
+ $switch.toggleClass('on').find('span').toggleClass('checked');
2382
+ var switch_on = $switch.find('span.on').hasClass('checked');
2383
+ $checkbox.attr('checked', switch_on).trigger('change');
2384
+ }
2385
+
2386
+ // save file (export) / push / pull special conditions
2387
+ function move_connection_info_box() {
2388
+ var $connection_status = $('.connection-status');
2389
+ var $directory_permission_notice = $('.directory-permission-notice');
2390
+ var $compatibility_older_mysql = $('.compatibility-older-mysql');
2391
+ var $mst_required = $('.mst-required');
2392
+ var $keep_active_plugins = $('.keep-active-plugins');
2393
+ var $step_two = $('.step-two');
2394
+ var $backup_options = $('.backup-options');
2395
+ var new_migration_type = wpmdb.functions.wpmdb_migration_type();
2396
+ var profile_name, table_prefix, backup_table_prefix, uploads_dir, upload_dir_long, write_permission;
2397
+
2398
+ $connection_status.hide();
2399
+ $directory_permission_notice.hide();
2400
+ $step_two.show();
2401
+ $backup_options.show();
2402
+ $keep_active_plugins.show();
2403
+ $compatibility_older_mysql.hide();
2404
+ $mst_required.hide();
2405
+
2406
+ wpmdb.functions.wpmdb_toggle_migration_action_text();
2407
+
2408
+ $('.migrate-tab').attr('class', 'migrate-tab content-tab').addClass(wpmdb.functions.wpmdb_migration_type());
2409
+
2410
+ $.wpmdb.do_action('move_connection_info_box', {
2411
+ 'migration_type': new_migration_type,
2412
+ 'last_migration_type': last_replace_switch
2413
+ });
2414
+
2415
+ if (-1 !== $.inArray(new_migration_type, ['push', 'pull'])) {
2416
+ var $pull_push_connection_info = $('.pull-push-connection-info');
2417
+ var connection_info = $.trim($pull_push_connection_info.val()).split('\n');
2418
+ var $migration_list_li = $('.' + new_migration_type + '-list li');
2419
+
2420
+ $migration_list_li.append($connection_info_box);
2421
+ $connection_info_box.show(function () {
2422
+ var connection_textarea = $(this).find('.pull-push-connection-info');
2423
+ if (!connection_textarea.val()) {
2424
+ connection_textarea.focus();
2425
+ }
2426
+ });
2427
+
2428
+ // Reconnect if the migration type was just changed
2429
+ if (new_migration_type !== last_replace_switch && 2 === connection_info.length) {
2430
+ wpmdb.force_reconnect = true;
2431
+ $migration_list_li.append($connection_info_box);
2432
+ $pull_push_connection_info.removeClass('temp-disabled').attr('readonly', 'readonly');
2433
+ $('.connect-button').hide();
2434
+ wpmdb.functions.connection_box_changed();
2435
+ return;
2436
+ }
2437
+
2438
+ if (connection_established) {
2439
+ $connection_status.hide();
2440
+ $step_two.show();
2441
+
2442
+ wpmdb.functions.wpmdb_toggle_migration_action_text();
2443
+
2444
+ if ('pull' === new_migration_type) {
2445
+ table_prefix = wpmdb.common.connection_data.prefix;
2446
+ backup_table_prefix = wpmdb_data.site_details.prefix;
2447
+ uploads_dir = wpmdb_data.this_uploads_dir;
2448
+ upload_dir_long = wpmdb_data.this_upload_dir_long;
2449
+ write_permission = wpmdb_data.write_permission;
2450
+ } else {
2451
+ table_prefix = wpmdb_data.this_prefix;
2452
+ backup_table_prefix = wpmdb.common.connection_data.prefix;
2453
+ uploads_dir = wpmdb.common.connection_data.uploads_dir;
2454
+ upload_dir_long = wpmdb.common.connection_data.upload_dir_long;
2455
+ write_permission = wpmdb.common.connection_data.write_permissions;
2456
+ }
2457
+
2458
+ $('.table_prefix').html(table_prefix);
2459
+ $('.backup-table-prefix').html(backup_table_prefix);
2460
+ $('.uploads-dir').html(uploads_dir);
2461
+
2462
+ maybe_show_backup_disabled_msg(upload_dir_long, write_permission);
2463
+
2464
+ if (false === profile_name_edited) {
2465
+ profile_name = get_domain_name(wpmdb.common.connection_data.url);
2466
+ $('.create-new-profile').val(profile_name);
2467
+ }
2468
+ } else {
2469
+ $connection_status.show();
2470
+ $step_two.hide();
2471
+ }
2472
+ } else if (-1 !== $.inArray(new_migration_type, ['find_replace', 'savefile'])) {
2473
+ $connection_status.hide();
2474
+ $step_two.show();
2475
+ $('.table-prefix').html(wpmdb_data.this_prefix);
2476
+ if (false === profile_name_edited) {
2477
+ $('.create-new-profile').val('');
2478
+ }
2479
+
2480
+ $keep_active_plugins.hide();
2481
+
2482
+ if ('savefile' === new_migration_type) {
2483
+ $backup_options.hide();
2484
+ $compatibility_older_mysql.show();
2485
+
2486
+ if ('false' === wpmdb_data.write_permission) {
2487
+ $directory_permission_notice.show();
2488
+ $step_two.hide();
2489
+ }
2490
+ } else {
2491
+ if ('true' === wpmdb_data.is_multisite) {
2492
+ var $old_replace_col = $('.old-replace-col').eq(1);
2493
+ $old_replace_col.parent().removeClass('pin').find('.replace-remove-row').show();
2494
+ $old_replace_col.find('input').removeAttr('readonly');
2495
+ }
2496
+
2497
+ maybe_show_backup_disabled_msg(wpmdb_data.this_upload_dir_long, wpmdb_data.write_permission);
2498
+ }
2499
+ }
2500
+
2501
+ maybe_show_mixed_cased_table_name_warning();
2502
+ }
2503
+
2504
+ function maybe_show_backup_disabled_msg(upload_dir, write_permission) {
2505
+ var $create_backup = $('#create-backup');
2506
+ var $create_backup_label = $('#create-backup-label');
2507
+ var $backup_option_disabled = $('.backup-option-disabled');
2508
+
2509
+ $create_backup.removeAttr('disabled');
2510
+ $create_backup_label.removeClass('disabled');
2511
+ $backup_option_disabled.hide();
2512
+
2513
+ if ('false' === write_permission) {
2514
+ $create_backup.prop('checked', false);
2515
+ $create_backup.attr('disabled', 'disabled');
2516
+ $create_backup_label.addClass('disabled');
2517
+ $backup_option_disabled.show();
2518
+ $('.upload-directory-location').html(upload_dir);
2519
+ }
2520
+ }
2521
+
2522
+ function change_replace_values() {
2523
+ var old_url = null;
2524
+ var old_path = null;
2525
+ if (null !== wpmdb.common.previous_connection_data && 'object' === _typeof(wpmdb.common.previous_connection_data) && wpmdb.common.previous_connection_data.url !== wpmdb.common.connection_data.url) {
2526
+ old_url = wpmdb.functions.remove_protocol(wpmdb.common.previous_connection_data.url);
2527
+ old_path = wpmdb.common.previous_connection_data.path;
2528
+ }
2529
+
2530
+ if ('push' === wpmdb.functions.wpmdb_migration_type() || 'savefile' === wpmdb.functions.wpmdb_migration_type()) {
2531
+ if ('pull' === last_replace_switch) {
2532
+ $('.replace-row').each(function () {
2533
+ var old_val = $('.old-replace-col input', this).val();
2534
+ $('.old-replace-col input', this).val($('.replace-right-col input', this).val());
2535
+ $('.replace-right-col input', this).val(old_val);
2536
+ });
2537
+ } else if ('push' === last_replace_switch && 'push' === wpmdb.functions.wpmdb_migration_type() && null !== old_url && null !== old_path) {
2538
+ $('.replace-row').each(function () {
2539
+ var old_val = $('.replace-right-col input', this).val();
2540
+ if (old_val === old_path) {
2541
+ $('.replace-right-col input', this).val(wpmdb.common.connection_data.path);
2542
+ }
2543
+ if (old_val === old_url) {
2544
+ $('.replace-right-col input', this).val(wpmdb.functions.remove_protocol(wpmdb.common.connection_data.url));
2545
+ }
2546
+ });
2547
+ }
2548
+ $.wpmdb.do_action('wpmdb_update_push_table_select');
2549
+ $('#select-post-types').remove();
2550
+ $('.exclude-post-types-warning').after($push_post_type_select);
2551
+ wpmdb.functions.exclude_post_types_warning();
2552
+ $('#select-backup').remove();
2553
+ $('.backup-tables-wrap').prepend($push_select_backup);
2554
+ } else if ('pull' === wpmdb.functions.wpmdb_migration_type()) {
2555
+ if ('' === last_replace_switch || 'push' === last_replace_switch || 'savefile' === last_replace_switch) {
2556
+ $('.replace-row').each(function () {
2557
+ var old_val = $('.old-replace-col input', this).val();
2558
+ $('.old-replace-col input', this).val($('.replace-right-col input', this).val());
2559
+ $('.replace-right-col input', this).val(old_val);
2560
+ });
2561
+ } else if ('pull' === last_replace_switch && 'pull' === wpmdb.functions.wpmdb_migration_type() && null !== old_url && null !== old_path) {
2562
+ $('.replace-row').each(function () {
2563
+ var old_val = $('.old-replace-col input', this).val();
2564
+ if (old_val === old_path) {
2565
+ $('.old-replace-col input', this).val(wpmdb.common.connection_data.path);
2566
+ }
2567
+ if (old_val === old_url) {
2568
+ $('.old-replace-col input', this).val(wpmdb.functions.remove_protocol(wpmdb.common.connection_data.url));
2569
+ }
2570
+ });
2571
+ }
2572
+ $.wpmdb.do_action('wpmdb_update_pull_table_select');
2573
+ $('#select-post-types').remove();
2574
+ $('.exclude-post-types-warning').after($pull_post_type_select);
2575
+ wpmdb.functions.exclude_post_types_warning();
2576
+ $('#select-backup').remove();
2577
+ $('.backup-tables-wrap').prepend($pull_select_backup);
2578
+ }
2579
+ last_replace_switch = wpmdb.functions.wpmdb_migration_type();
2580
+ }
2581
+
2582
+ function switch_to_plugin_tab(hash, skip_addons_check) {
2583
+ $('.nav-tab').removeClass('nav-tab-active');
2584
+ $('.nav-tab.' + hash).addClass('nav-tab-active');
2585
+ $('.content-tab').hide();
2586
+ $('.' + hash + '-tab').show();
2587
+
2588
+ if ('settings' === hash) {
2589
+ if (true === should_check_licence()) {
2590
+ $('p.licence-status').append('Checking License... ').append(ajax_spinner);
2591
+ check_licence();
2592
+ }
2593
+ }
2594
+
2595
+ if ('help' === hash) {
2596
+ refresh_debug_log();
2597
+ if (true === should_check_licence()) {
2598
+ $('.support-content p').append(ajax_spinner);
2599
+ check_licence();
2600
+ }
2601
+ }
2602
+
2603
+ if ('addons' === hash && true !== skip_addons_check) {
2604
+ if (true === should_check_licence()) {
2605
+ $('.addons-content p').append(ajax_spinner);
2606
+ check_licence();
2607
+ }
2608
+ }
2609
+ }
2610
+
2611
+ function hide_overlay() {
2612
+ $('#overlay').removeClass('show').addClass('hide');
2613
+ $('#overlay > div').removeClass('show').addClass('hide');
2614
+ wpmdb.current_migration.$proVersion.find('iframe').remove();
2615
+ setTimeout(function () {
2616
+ $('#overlay').remove();
2617
+ }, 500);
2618
+ migration_completed = false;
2619
+ }
2620
+
2621
+ function check_licence(licence) {
2622
+ var update_licence_content = !doing_licence_registration_ajax;
2623
+ checked_licence = true;
2624
+ $.ajax({
2625
+ url: ajaxurl,
2626
+ type: 'POST',
2627
+ dataType: 'json',
2628
+ cache: false,
2629
+ data: {
2630
+ action: 'wpmdb_check_licence',
2631
+ licence: licence,
2632
+ context: 'all',
2633
+ nonce: wpmdb_data.nonces.check_licence
2634
+ },
2635
+ error: function error(jqXHR, textStatus, errorThrown) {
2636
+ alert(wpmdb_strings.license_check_problem);
2637
+ },
2638
+ success: function success(data) {
2639
+
2640
+ var $support_content = $('.support-content');
2641
+ var $addons_content = $('.addons-content');
2642
+ var $licence_content = $('.licence-status:not(.notification-message)');
2643
+ var licence_msg, support_msg, addons_msg;
2644
+
2645
+ if ('undefined' !== typeof data.dbrains_api_down) {
2646
+ support_msg = data.dbrains_api_down + data.message;
2647
+ addons_msg = data.dbrains_api_down;
2648
+ } else if ('undefined' !== typeof data.errors) {
2649
+
2650
+ if ('undefined' !== typeof data.errors.subscription_expired) {
2651
+ licence_msg = data.errors.subscription_expired.licence;
2652
+ support_msg = data.errors.subscription_expired.support;
2653
+ addons_msg = data.errors.subscription_expired.addons;
2654
+ } else {
2655
+ var msg = '';
2656
+ for (var key in data.errors) {
2657
+ msg += data.errors[key];
2658
+ }
2659
+ support_msg = msg;
2660
+ addons_msg = msg;
2661
+ }
2662
+ if ('undefined' !== typeof data.addon_content) {
2663
+ addons_msg += '\n' + data.addon_content;
2664
+ }
2665
+ } else {
2666
+ support_msg = data.message;
2667
+ addons_msg = data.addon_content;
2668
+ }
2669
+
2670
+ if (update_licence_content) {
2671
+ $licence_content.stop().fadeOut(fade_duration, function () {
2672
+ if ('undefined' === typeof licence_msg) {
2673
+ $(this).css({ visibility: 'hidden', display: 'block' }).slideUp();
2674
+ licence_msg = '';
2675
+ }
2676
+
2677
+ $(this).empty().html(licence_msg).stop().fadeIn(fade_duration);
2678
+ });
2679
+ }
2680
+
2681
+ $support_content.stop().fadeOut(fade_duration, function () {
2682
+ $(this).empty().html(support_msg).stop().fadeIn(fade_duration);
2683
+ });
2684
+ $addons_content.stop().fadeOut(fade_duration, function () {
2685
+ $(this).empty().html(addons_msg).stop().fadeIn(fade_duration);
2686
+ });
2687
+
2688
+ if ($('#plugin-compatibility').is(':not(:checked)')) {
2689
+ $('#compatibility-header').click();
2690
+ }
2691
+ }
2692
+ });
2693
+ }
2694
+
2695
+ function should_check_licence() {
2696
+ return false === checked_licence && '1' === wpmdb_data.has_licence && 'true' === wpmdb_data.is_pro;
2697
+ }
2698
+
2699
+ function maybe_show_mixed_cased_table_name_warning() {
2700
+ if ('undefined' === typeof wpmdb.common.connection_data || false === wpmdb.common.connection_data) {
2701
+ return;
2702
+ }
2703
+
2704
+ var migration_intent = wpmdb.functions.wpmdb_migration_type();
2705
+ var tables_to_migrate = wpmdb.functions.get_tables_to_migrate(null, null);
2706
+
2707
+ $('.mixed-case-table-name-notice').hide();
2708
+
2709
+ if (null === tables_to_migrate) {
2710
+ return;
2711
+ }
2712
+
2713
+ tables_to_migrate = tables_to_migrate.join('');
2714
+
2715
+ // The table names are all lowercase, no need to display the warning.
2716
+ if (tables_to_migrate === tables_to_migrate.toLowerCase()) {
2717
+ return;
2718
+ }
2719
+
2720
+ /*
2721
+ * Do not display the warning if the remote lower_case_table_names does not equal "1" (i.e the only problematic setting)
2722
+ * Applies to push/export migrations.
2723
+ */
2724
+ if ('1' !== wpmdb.common.connection_data.lower_case_table_names && ('push' === migration_intent || 'savefile' === migration_intent)) {
2725
+ return;
2726
+ }
2727
+
2728
+ /*
2729
+ * Do not display the warning if the local lower_case_table_names does not equal "1" (i.e the only problematic setting)
2730
+ * Only applies to pull migrations.
2731
+ */
2732
+ if ('1' !== wpmdb_data.lower_case_table_names && 'pull' === migration_intent) {
2733
+ return;
2734
+ }
2735
+
2736
+ /*
2737
+ * At this stage we've determined:
2738
+ * 1. The source database contains at least one table that contains an uppercase character.
2739
+ * 2. The destination environment has lower_case_table_names set to 1.
2740
+ * 3. The source database table containing the uppercase letter will be converted to lowercase during the migration.
2741
+ */
2742
+
2743
+ if ('push' === migration_intent || 'savefile' === migration_intent) {
2744
+ $('.mixed-case-table-name-notice.push').show();
2745
+ } else {
2746
+ $('.mixed-case-table-name-notice.pull').show();
2747
+ }
2748
+ }
2749
+
2750
+ function enable_pro_licence(data, licence_key) {
2751
+ $('.licence-input, .register-licence').remove();
2752
+ $('.licence-not-entered').prepend(data.masked_licence);
2753
+ $('.support-content').empty().html('<p>' + wpmdb_strings.fetching_license + '<img src="' + spinner_url + '" alt="" class="ajax-spinner general-spinner" /></p>');
2754
+ check_licence(licence_key);
2755
+
2756
+ $('.migrate-selection label').removeClass('disabled');
2757
+ $('.migrate-selection input').removeAttr('disabled');
2758
+ }
2759
+
2760
+ function get_domain_name(url) {
2761
+ var temp_url = url;
2762
+ var domain = temp_url.replace(/\/\/(.*)@/, '//').replace('http://', '').replace('https://', '').replace('www.', '');
2763
+ return domain;
2764
+ }
2765
+
2766
+ function update_domain_placeholder(label, url, stage) {
2767
+ var domain = get_domain_name(url);
2768
+
2769
+ if ('completed' === stage) {
2770
+ return label.replace(/\%s\s?/, '<span class=domain-label>' + domain + '</span>&nbsp;');
2771
+ }
2772
+
2773
+ return label.replace(/\%s(\S*)\s?/, '<span class=domain-label>' + domain + '$1</span>&nbsp;');
2774
+ }
2775
+
2776
+ function get_migration_status_label(url, intent, stage) {
2777
+ var migrating_stage_label = '';
2778
+ var completed_stage_label = '';
2779
+
2780
+ switch (intent) {
2781
+ case 'push':
2782
+ migrating_stage_label = wpmdb_strings.push_migration_label_migrating;
2783
+ completed_stage_label = wpmdb_strings.push_migration_label_completed;
2784
+ break;
2785
+ case 'pull':
2786
+ migrating_stage_label = wpmdb_strings.pull_migration_label_migrating;
2787
+ completed_stage_label = wpmdb_strings.pull_migration_label_completed;
2788
+ break;
2789
+ case 'find_replace':
2790
+ migrating_stage_label = wpmdb_strings.find_replace_label_migrating;
2791
+ completed_stage_label = wpmdb_strings.find_replace_label_completed;
2792
+ break;
2793
+ case 'savefile':
2794
+ migrating_stage_label = wpmdb_strings.exporting_please_wait;
2795
+ completed_stage_label = wpmdb_strings.exporting_complete;
2796
+ break;
2797
+ }
2798
+
2799
+ var label = migrating_stage_label;
2800
+
2801
+ if ('completed' === stage) {
2802
+ label = completed_stage_label;
2803
+ }
2804
+
2805
+ if ('push' === intent || 'pull' === intent) {
2806
+ label = update_domain_placeholder(label, url, stage);
2807
+ }
2808
+
2809
+ label = $.wpmdb.apply_filters('wpmdb_get_migration_status_label', label, {
2810
+ intent: intent,
2811
+ stage: stage
2812
+ });
2813
+
2814
+ return label;
2815
+ }
2816
+
2817
+ function disable_export_type_controls() {
2818
+ $('.option-group').each(function (index) {
2819
+ $('input', this).attr('disabled', 'disabled');
2820
+ $('label', this).css('cursor', 'default');
2821
+ });
2822
+ }
2823
+
2824
+ function enable_export_type_controls() {
2825
+ $('.option-group').each(function (index) {
2826
+ $('input', this).removeAttr('disabled');
2827
+ $('label', this).css('cursor', 'pointer');
2828
+ });
2829
+ }
2830
+
2831
+ function set_slider_value(parent_selector, value, unit, display) {
2832
+ var display_value = value;
2833
+
2834
+ if (undefined !== display) {
2835
+ display_value = display;
2836
+ }
2837
+
2838
+ $('.slider', parent_selector).slider('value', parseInt(value));
2839
+ $('.amount', parent_selector).html(wpmdb.functions.wpmdb_add_commas(display_value) + ' ' + unit);
2840
+ }
2841
+
2842
+ function set_pause_resume_button(event) {
2843
+ if (true === migration_paused) {
2844
+ migration_paused = false;
2845
+ doing_ajax = true;
2846
+
2847
+ wpmdb.current_migration.setState(previous_progress_title, previous_progress_text_primary, 'active');
2848
+ $('.pause-resume').html(wpmdb_strings.pause);
2849
+
2850
+ // Resume the timer
2851
+ wpmdb.current_migration.resumeTimer();
2852
+
2853
+ wpmdb.functions.execute_next_step();
2854
+ } else {
2855
+ migration_paused = true;
2856
+ doing_ajax = false;
2857
+ paused_text = wpmdb_strings.migration_paused;
2858
+ previous_progress_title = $('.progress-title').html();
2859
+ previous_progress_text_primary = $('.progress-text', '.progress-wrapper-primary').html();
2860
+ previous_progress_text_secondary = $('.progress-text', '.progress-wrapper-secondary ').html();
2861
+
2862
+ if ('find_replace' === migration_intent) {
2863
+ paused_text = wpmdb_strings.find_replace_paused;
2864
+ }
2865
+
2866
+ wpmdb.current_migration.setState(paused_text, wpmdb_strings.completing_current_request, null);
2867
+ $('body').off('click', '.pause-resume'); // Is re-bound at execute_next_step when migration is finally paused
2868
+ $('body').off('click', '.cancel'); // Is re-bound at execute_next_step when migration is finally paused
2869
+ }
2870
+ }
2871
+
2872
+ /**
2873
+ * Filter temporary tables out of wpmdb.functions.create_table_select().
2874
+ *
2875
+ * @param exclude
2876
+ * @param table_name
2877
+ * @returns {bool}
2878
+ */
2879
+ function filter_temp_tables(exclude, table_name) {
2880
+ var temp_prefix = wpmdb_data.this_temp_prefix;
2881
+
2882
+ if ('pull' === wpmdb.functions.wpmdb_migration_type() && 'undefined' !== typeof wpmdb.common.connection_data && 'undefined' !== typeof wpmdb.common.connection_data.temp_prefix) {
2883
+ temp_prefix = wpmdb.common.connection_data.temp_prefix;
2884
+ }
2885
+
2886
+ if (temp_prefix === table_name.substring(0, temp_prefix.length)) {
2887
+ return true;
2888
+ }
2889
+
2890
+ return exclude;
2891
+ }
2892
+
2893
+ $.wpmdb.add_filter('wpmdb_exclude_table', filter_temp_tables);
2894
+
2895
+ function get_table_prefix(value, args) {
2896
+ return $('.table-select-wrap .table-prefix').text();
2897
+ }
2898
+
2899
+ function lock_replace_url(lock) {
2900
+ if (true === lock) {
2901
+ $('.replace-row.pin .replace-right-col input[type="text"]').attr('readonly', 'readonly');
2902
+ $('.replace-row.pin .arrow-col').addClass('disabled');
2903
+ } else {
2904
+ $('.replace-row.pin .replace-right-col input[type="text"]').removeAttr('readonly');
2905
+ $('.replace-row.pin .arrow-col').removeClass('disabled');
2906
+ }
2907
+ }
2908
+
2909
+ function set_connection_data(data) {
2910
+ wpmdb.common.previous_connection_data = wpmdb.common.connection_data;
2911
+ wpmdb.common.connection_data = data;
2912
+ $.wpmdb.do_action('wpmdb_connection_data_updated', data);
2913
+ }
2914
+
2915
+ /**
2916
+ * Returns formatted info for the Max Request Size slider.
2917
+ *
2918
+ * @param value
2919
+ * @return object
2920
+ */
2921
+ function get_max_request_display_info(value) {
2922
+ var display_info = {};
2923
+
2924
+ display_info.unit = 'MB';
2925
+ display_info.amount = (value / 1024).toFixed(2);
2926
+
2927
+ return display_info;
2928
+ }
2929
+
2930
+ function establish_remote_connection_from_saved_profile() {
2931
+ var action = wpmdb.functions.wpmdb_migration_type();
2932
+ var connection_info = $.trim($('.pull-push-connection-info').val()).split('\n');
2933
+ if ('undefined' === typeof wpmdb_default_profile || true === wpmdb_default_profile || 'savefile' === action || 'find_replace' === action || 'import' === action || doing_ajax || !wpmdb_data.is_pro) {
2934
+ return;
2935
+ }
2936
+
2937
+ doing_ajax = true;
2938
+ disable_export_type_controls();
2939
+
2940
+ $('.connection-status').html(wpmdb_strings.establishing_remote_connection);
2941
+ $('.connection-status').removeClass('notification-message error-notice migration-error');
2942
+ $('.connection-status').append(ajax_spinner);
2943
+
2944
+ var intent = wpmdb.functions.wpmdb_migration_type();
2945
+
2946
+ $.ajax({
2947
+ url: ajaxurl,
2948
+ type: 'POST',
2949
+ dataType: 'json',
2950
+ cache: false,
2951
+ data: {
2952
+ action: 'wpmdb_verify_connection_to_remote_site',
2953
+ url: connection_info[0],
2954
+ key: connection_info[1],
2955
+ intent: intent,
2956
+ nonce: wpmdb_data.nonces.verify_connection_to_remote_site,
2957
+ convert_post_type_selection: wpmdb_convert_post_type_selection,
2958
+ profile: wpmdb_data.profile
2959
+ },
2960
+ error: function error(jqXHR, textStatus, errorThrown) {
2961
+ $('.connection-status').html(get_ajax_errors(jqXHR.responseText, '(#102)', jqXHR));
2962
+ $('.connection-status').addClass('notification-message error-notice migration-error');
2963
+ $('.ajax-spinner').remove();
2964
+ doing_ajax = false;
2965
+ enable_export_type_controls();
2966
+ },
2967
+ success: function success(data) {
2968
+ $('.ajax-spinner').remove();
2969
+ doing_ajax = false;
2970
+ enable_export_type_controls();
2971
+
2972
+ if ('undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error) {
2973
+ $('.connection-status').html(data.body);
2974
+ $('.connection-status').addClass('notification-message error-notice migration-error');
2975
+
2976
+ if (data.body.indexOf('401 Unauthorized') > -1) {
2977
+ $('.basic-access-auth-wrapper').show();
2978
+ }
2979
+
2980
+ return;
2981
+ }
2982
+
2983
+ if (true === wpmdb.functions.maybe_show_mst_warning(data)) {
2984
+ $('.connection-status').hide();
2985
+ return;
2986
+ }
2987
+
2988
+ maybe_show_ssl_warning(connection_info[0], connection_info[1], data.scheme);
2989
+ wpmdb.functions.maybe_show_prefix_notice(data.prefix);
2990
+
2991
+ $('.pull-push-connection-info').addClass('temp-disabled');
2992
+ $('.pull-push-connection-info').attr('readonly', 'readonly');
2993
+ $('.connect-button').hide();
2994
+
2995
+ $('.connection-status').hide();
2996
+ $('.step-two').show();
2997
+ connection_established = true;
2998
+ set_connection_data(data);
2999
+ move_connection_info_box();
3000
+
3001
+ maybe_show_mixed_cased_table_name_warning();
3002
+
3003
+ var loaded_tables = '';
3004
+ if (false === wpmdb_default_profile && 'undefined' !== typeof wpmdb_loaded_tables) {
3005
+ loaded_tables = wpmdb_loaded_tables;
3006
+ }
3007
+
3008
+ $pull_select = wpmdb.functions.create_table_select(wpmdb.common.connection_data.tables, wpmdb.common.connection_data.table_sizes_hr, loaded_tables);
3009
+
3010
+ var loaded_post_types = '';
3011
+ if (false === wpmdb_default_profile && 'undefined' !== typeof wpmdb_loaded_post_types) {
3012
+ if ('undefined' !== typeof data.select_post_types) {
3013
+ $('#exclude-post-types').attr('checked', 'checked');
3014
+ $('.post-type-select-wrap').show();
3015
+ loaded_post_types = data.select_post_types;
3016
+ } else {
3017
+ loaded_post_types = wpmdb_loaded_post_types;
3018
+ }
3019
+ }
3020
+
3021
+ var $post_type_select = document.createElement('select');
3022
+ $($post_type_select).attr({
3023
+ multiple: 'multiple',
3024
+ name: 'select_post_types[]',
3025
+ id: 'select-post-types',
3026
+ class: 'multiselect'
3027
+ });
3028
+
3029
+ $.each(wpmdb.common.connection_data.post_types, function (index, value) {
3030
+ var selected = $.inArray(value, loaded_post_types);
3031
+ if (-1 !== selected || true === wpmdb_convert_exclude_revisions && 'revision' !== value) {
3032
+ selected = ' selected="selected" ';
3033
+ } else {
3034
+ selected = ' ';
3035
+ }
3036
+ $($post_type_select).append('<option' + selected + 'value="' + value + '">' + value + '</option>');
3037
+ });
3038
+
3039
+ $pull_post_type_select = $post_type_select;
3040
+
3041
+ var loaded_tables_backup = '';
3042
+ if (false === wpmdb_default_profile && 'undefined' !== typeof wpmdb_loaded_tables_backup) {
3043
+ loaded_tables_backup = wpmdb_loaded_tables_backup;
3044
+ }
3045
+
3046
+ var $table_select_backup = document.createElement('select');
3047
+ $($table_select_backup).attr({
3048
+ multiple: 'multiple',
3049
+ name: 'select_backup[]',
3050
+ id: 'select-backup',
3051
+ class: 'multiselect'
3052
+ });
3053
+
3054
+ $.each(wpmdb.common.connection_data.tables, function (index, value) {
3055
+ var selected = $.inArray(value, loaded_tables_backup);
3056
+ if (-1 !== selected) {
3057
+ selected = ' selected="selected" ';
3058
+ } else {
3059
+ selected = ' ';
3060
+ }
3061
+ $($table_select_backup).append('<option' + selected + 'value="' + value + '">' + value + ' (' + wpmdb.common.connection_data.table_sizes_hr[value] + ')</option>');
3062
+ });
3063
+
3064
+ $push_select_backup = $table_select_backup;
3065
+
3066
+ if ('pull' === wpmdb.functions.wpmdb_migration_type()) {
3067
+ $.wpmdb.do_action('wpmdb_update_pull_table_select');
3068
+ $('#select-post-types').remove();
3069
+ $('.exclude-post-types-warning').after($pull_post_type_select);
3070
+ $('#select-backup').remove();
3071
+ $('.backup-tables-wrap').prepend($pull_select_backup);
3072
+ $('.table-prefix').html(data.prefix);
3073
+ $('.uploads-dir').html(wpmdb_data.this_uploads_dir);
3074
+ } else {
3075
+ $('#select-backup').remove();
3076
+ $('.backup-tables-wrap').prepend($push_select_backup);
3077
+ }
3078
+
3079
+ $.wpmdb.do_action('verify_connection_to_remote_site', wpmdb.common.connection_data);
3080
+ }
3081
+
3082
+ });
3083
+ }
3084
+
3085
+ /*
3086
+ wpmdb.functions namespaced functions
3087
+ */
3088
+
3089
+ wpmdb.functions.exclude_post_types_warning = function () {
3090
+ var excluded_post_types = $('#select-post-types').val();
3091
+ var excluded_post_types_text = '';
3092
+ var $exclude_post_types_warning = $('.exclude-post-types-warning');
3093
+
3094
+ if (excluded_post_types) {
3095
+ excluded_post_types_text = '<code>' + excluded_post_types.join('</code>, <code>') + '</code>';
3096
+ $('.excluded-post-types').html(excluded_post_types_text);
3097
+
3098
+ if ('0' === $exclude_post_types_warning.css('opacity')) {
3099
+ $exclude_post_types_warning.css({ opacity: 0 }).slideDown(200).animate({ opacity: 1 });
3100
+ }
3101
+ } else {
3102
+ $exclude_post_types_warning.css({ opacity: 0 }).slideUp(200).animate({ opacity: 0 });
3103
+ }
3104
+ };
3105
+
3106
+ //Main method that shows migration progress in the UI
3107
+ wpmdb.functions.migrate_table_recursive = function (current_row, primary_keys, iterator) {
3108
+ var i = iterator || 0;
3109
+
3110
+ if (i >= tables_to_migrate.length) {
3111
+
3112
+ if ('upload' === stage && wpmdb.current_migration.model.getStageItems('find_replace').length) {
3113
+ stage = 'find_replace';
3114
+ tables_to_migrate = wpmdb.current_migration.model.getStageItems('find_replace', 'name');
3115
+ tables_to_migrate = tables_to_migrate.map(function (table) {
3116
+ return '_mig_' + table;
3117
+ });
3118
+ i = 0;
3119
+ } else if ('backup' === stage) {
3120
+
3121
+ if (-1 !== $.inArray(migration_intent, ['push', 'pull'])) {
3122
+ stage = 'migrate';
3123
+ } else if ('import' === migration_intent) {
3124
+ stage = 'upload';
3125
+ } else {
3126
+ stage = migration_intent;
3127
+ }
3128
+
3129
+ wpmdb.current_migration.model.setActiveStage(stage);
3130
+
3131
+ if ('find_replace' !== stage && 'migrate' !== stage) {
3132
+ wpmdb.functions.wpmdb_call_next_hook();
3133
+ return;
3134
+ }
3135
+
3136
+ i = 0;
3137
+
3138
+ // should get from model
3139
+ tables_to_migrate = wpmdb.functions.get_tables_to_migrate(null, null);
3140
+ } else {
3141
+ $('.progress-label').removeClass('label-visible');
3142
+
3143
+ wpmdb.common.hooks = $.wpmdb.apply_filters('wpmdb_before_migration_complete_hooks', wpmdb.common.hooks);
3144
+ wpmdb.common.hooks.push(wpmdb.functions.migration_complete);
3145
+ wpmdb.common.hooks.push(wpmdb.functions.wpmdb_flush);
3146
+ wpmdb.common.hooks = $.wpmdb.apply_filters('wpmdb_after_migration_complete_hooks', wpmdb.common.hooks);
3147
+ wpmdb.common.hooks.push(wpmdb.functions.migration_complete_events);
3148
+ wpmdb.common.next_step_in_migration = { fn: wpmdb.functions.wpmdb_call_next_hook };
3149
+ wpmdb.functions.execute_next_step();
3150
+ return;
3151
+ }
3152
+ }
3153
+
3154
+ var last_table = 0;
3155
+ if (i === tables_to_migrate.length - 1) {
3156
+ last_table = 1;
3157
+ }
3158
+
3159
+ var gzip = 0;
3160
+ if (-1 !== $.inArray(migration_intent, ['push', 'pull']) && 1 === parseInt(wpmdb.common.connection_data.gzip)) {
3161
+ gzip = 1;
3162
+ }
3163
+
3164
+ var request_data = {
3165
+ action: 'wpmdb_migrate_table',
3166
+ migration_state_id: wpmdb.migration_state_id,
3167
+ table: tables_to_migrate[i],
3168
+ stage: stage,
3169
+ current_row: current_row,
3170
+ last_table: last_table,
3171
+ primary_keys: primary_keys,
3172
+ gzip: gzip,
3173
+ nonce: wpmdb_data.nonces.migrate_table
3174
+ };
3175
+
3176
+ if (-1 !== $.inArray(migration_intent, ['push', 'pull'])) {
3177
+ request_data.bottleneck = wpmdb.common.connection_data.bottleneck;
3178
+ request_data.prefix = wpmdb.common.connection_data.prefix;
3179
+ }
3180
+
3181
+ if (wpmdb.common.connection_data && wpmdb.common.connection_data.path_current_site && wpmdb.common.connection_data.domain) {
3182
+ request_data.path_current_site = wpmdb.common.connection_data.path_current_site;
3183
+ request_data.domain_current_site = wpmdb.common.connection_data.domain;
3184
+ }
3185
+
3186
+ doing_ajax = true;
3187
+
3188
+ $.ajax({
3189
+ url: ajaxurl,
3190
+ type: 'POST',
3191
+ dataType: 'text',
3192
+ cache: false,
3193
+ timeout: 0,
3194
+ data: request_data,
3195
+ error: function error(jqXHR, textStatus, errorThrown) {
3196
+ var progress_text = wpmdb_strings.table_process_problem + ' ' + tables_to_migrate[i] + '<br /><br />' + wpmdb_strings.status + ': ' + jqXHR.status + ' ' + jqXHR.statusText + '<br /><br />' + wpmdb_strings.response + ':<br />' + jqXHR.responseText;
3197
+ wpmdb.current_migration.setState(wpmdb_strings.migration_failed, progress_text, 'error');
3198
+
3199
+ doing_ajax = false;
3200
+ console.log(jqXHR);
3201
+ console.log(textStatus);
3202
+ console.log(errorThrown);
3203
+ wpmdb.common.migration_error = true;
3204
+ wpmdb.functions.migration_complete_events();
3205
+ },
3206
+ success: function success(data) {
3207
+ doing_ajax = false;
3208
+ data = $.trim(data);
3209
+ var row_information = wpmdb.functions.wpmdb_parse_json(data);
3210
+ var error_text = '';
3211
+
3212
+ if (false === row_information || null === row_information) {
3213
+
3214
+ // should update model
3215
+ if ('' === data || null === data) {
3216
+ error_text = wpmdb_strings.table_process_problem_empty_response + ' ' + tables_to_migrate[i];
3217
+ } else {
3218
+ error_text = get_ajax_errors(data, null, null);
3219
+ }
3220
+
3221
+ wpmdb.current_migration.setState(wpmdb_strings.migration_failed, error_text, 'error');
3222
+ wpmdb.common.migration_error = true;
3223
+ wpmdb.functions.migration_complete_events();
3224
+ return;
3225
+ }
3226
+
3227
+ if ('undefined' !== typeof row_information.wpmdb_error && 1 === row_information.wpmdb_error) {
3228
+ wpmdb.current_migration.setState(wpmdb_strings.migration_failed, row_information.body, 'error');
3229
+ wpmdb.common.migration_error = true;
3230
+ wpmdb.functions.migration_complete_events();
3231
+ return;
3232
+ }
3233
+
3234
+ var item_name = tables_to_migrate[i];
3235
+ if ('import' === migration_intent && 'find_replace' === stage) {
3236
+ item_name = item_name.replace(wpmdb_data.this_temp_prefix, '');
3237
+ }
3238
+
3239
+ //successful iteration
3240
+ wpmdb.current_migration.setText();
3241
+ wpmdb.current_migration.model.getStageModel(stage).setItemRowsTransferred(item_name, row_information.current_row);
3242
+
3243
+ // We need the returned file name for delivery or display to the user.
3244
+ if (1 === last_table && 'savefile' === migration_intent) {
3245
+ if ('undefined' !== typeof row_information.dump_filename) {
3246
+ dump_filename = row_information.dump_filename;
3247
+ }
3248
+ if ('undefined' !== typeof row_information.dump_path) {
3249
+ dump_path = row_information.dump_path;
3250
+ }
3251
+ }
3252
+
3253
+ if (-1 === parseInt(row_information.current_row)) {
3254
+ i++;
3255
+ row_information.current_row = '';
3256
+ row_information.primary_keys = '';
3257
+ }
3258
+
3259
+ wpmdb.common.next_step_in_migration = {
3260
+ fn: wpmdb.functions.migrate_table_recursive,
3261
+ args: [row_information.current_row, row_information.primary_keys, i]
3262
+ };
3263
+ wpmdb.functions.execute_next_step();
3264
+ }
3265
+ });
3266
+ };
3267
+
3268
+ wpmdb.functions.migration_complete_events = function () {
3269
+ if (false === wpmdb.common.migration_error) {
3270
+ if ('' === wpmdb.common.non_fatal_errors) {
3271
+ if ('savefile' !== migration_intent && true === $('#save_computer').is(':checked')) {
3272
+ wpmdb.current_migration.setText();
3273
+ }
3274
+
3275
+ completed_msg = completed_msg + '&nbsp;<div class="dashicons dashicons-yes"></div>';
3276
+
3277
+ if (true === migration_cancelled) {
3278
+ var cancel_success = wpmdb_strings.migration_cancelled_success;
3279
+
3280
+ if ('find_replace' === migration_intent) {
3281
+ cancel_success = wpmdb_strings.find_replace_cancelled_success;
3282
+ }
3283
+
3284
+ wpmdb.current_migration.setState(completed_msg, cancel_success, 'cancelled');
3285
+ } else {
3286
+ wpmdb.current_migration.setState(completed_msg, '', 'complete');
3287
+ }
3288
+ } else {
3289
+ wpmdb.current_migration.setState(wpmdb_strings.completed_with_some_errors, wpmdb.common.non_fatal_errors, 'error');
3290
+ }
3291
+ }
3292
+
3293
+ $('.migration-controls').addClass('hidden');
3294
+
3295
+ // reset migration variables so consecutive migrations work correctly
3296
+ wpmdb.common.hooks = [];
3297
+ wpmdb.common.call_stack = [];
3298
+ wpmdb.common.migration_error = false;
3299
+ currently_migrating = false;
3300
+ migration_completed = true;
3301
+ migration_paused = false;
3302
+ migration_cancelled = false;
3303
+ doing_ajax = false;
3304
+ wpmdb.common.non_fatal_errors = '';
3305
+ tables_to_migrate = [];
3306
+
3307
+ $('.progress-label').remove();
3308
+ $('.migration-progress-ajax-spinner').remove();
3309
+ $('.close-progress-content').show();
3310
+ $('#overlay').css('cursor', 'pointer');
3311
+ wpmdb.current_migration.model.setMigrationComplete();
3312
+ };
3313
+
3314
+ wpmdb.functions.migration_complete = function () {
3315
+
3316
+ $('.migration-controls').addClass('hidden');
3317
+
3318
+ if ('savefile' === migration_intent) {
3319
+ currently_migrating = false;
3320
+ var migrate_complete_text = wpmdb_strings.migration_complete;
3321
+ if ($('#save_computer').is(':checked')) {
3322
+ var url = wpmdb_data.this_download_url + encodeURIComponent(dump_filename);
3323
+ if ($('#gzip_file').is(':checked')) {
3324
+ url += '&gzip=1';
3325
+ }
3326
+ window.location = url;
3327
+ } else {
3328
+ migrate_complete_text = wpmdb_strings.completed_dump_located_at + ' ' + dump_path;
3329
+ }
3330
+
3331
+ if (false === wpmdb.common.migration_error) {
3332
+
3333
+ wpmdb.functions.migration_complete_events();
3334
+ wpmdb.current_migration.setState(completed_msg, migrate_complete_text, 'complete');
3335
+ }
3336
+ } else {
3337
+ // rename temp tables, delete old tables
3338
+
3339
+ wpmdb.current_migration.setState(null, wpmdb_strings.finalizing_migration, 'finalizing');
3340
+
3341
+ var request_data = {
3342
+ action: 'wpmdb_finalize_migration',
3343
+ migration_state_id: wpmdb.migration_state_id,
3344
+ tables: tables_to_migrate.join(','),
3345
+ nonce: wpmdb_data.nonces.finalize_migration
3346
+ };
3347
+
3348
+ if (-1 !== $.inArray(migration_intent, ['push', 'pull'])) {
3349
+ request_data.prefix = wpmdb.common.connection_data.prefix;
3350
+ }
3351
+
3352
+ doing_ajax = true;
3353
+ $.ajax({
3354
+ url: ajaxurl,
3355
+ type: 'POST',
3356
+ dataType: 'text',
3357
+ cache: false,
3358
+ data: request_data,
3359
+ error: function error(jqXHR, textStatus, errorThrown) {
3360
+ doing_ajax = false;
3361
+ wpmdb.current_migration.setState(wpmdb_strings.migration_failed, wpmdb_strings.finalize_tables_problem, 'error');
3362
+
3363
+ alert(jqXHR + ' : ' + textStatus + ' : ' + errorThrown);
3364
+ wpmdb.common.migration_error = true;
3365
+ wpmdb.functions.migration_complete_events();
3366
+ },
3367
+ success: function success(data) {
3368
+ doing_ajax = false;
3369
+ if ('1' !== $.trim(data)) {
3370
+ wpmdb.current_migration.setState(wpmdb_strings.migration_failed, data, 'error');
3371
+
3372
+ wpmdb.common.migration_error = true;
3373
+ wpmdb.functions.migration_complete_events();
3374
+ return;
3375
+ }
3376
+ wpmdb.common.next_step_in_migration = { fn: wpmdb.functions.wpmdb_call_next_hook };
3377
+ wpmdb.functions.execute_next_step();
3378
+ }
3379
+ });
3380
+ }
3381
+ };
3382
+
3383
+ wpmdb.functions.wpmdb_flush = function () {
3384
+ if ('savefile' !== migration_intent) {
3385
+ wpmdb.current_migration.setText(wpmdb_strings.flushing);
3386
+ doing_ajax = true;
3387
+ $.ajax({
3388
+ url: ajaxurl,
3389
+ type: 'POST',
3390
+ dataType: 'text',
3391
+ cache: false,
3392
+ data: {
3393
+ action: 'wpmdb_flush',
3394
+ migration_state_id: wpmdb.migration_state_id,
3395
+ nonce: wpmdb_data.nonces.flush
3396
+ },
3397
+ error: function error(jqXHR, textStatus, errorThrown) {
3398
+ doing_ajax = false;
3399
+ wpmdb.current_migration.setState(wpmdb_strings.migration_failed, wpmdb_strings.flush_problem, 'error');
3400
+
3401
+ alert(jqXHR + ' : ' + textStatus + ' : ' + errorThrown);
3402
+ wpmdb.common.migration_error = true;
3403
+ wpmdb.functions.migration_complete_events();
3404
+ },
3405
+ success: function success(data) {
3406
+ doing_ajax = false;
3407
+ if ('1' !== $.trim(data)) {
3408
+ wpmdb.current_migration.setState(wpmdb_strings.migration_failed, data, 'error');
3409
+
3410
+ wpmdb.common.migration_error = true;
3411
+ wpmdb.functions.migration_complete_events();
3412
+ return;
3413
+ }
3414
+ wpmdb.common.next_step_in_migration = { fn: wpmdb.functions.wpmdb_call_next_hook };
3415
+ wpmdb.functions.execute_next_step();
3416
+ }
3417
+ });
3418
+ }
3419
+ };
3420
+
3421
+ wpmdb.functions.execute_next_step = function () {
3422
+
3423
+ // if delay is set, set a timeout for delay to recall this function, then return
3424
+ if (0 < delay_between_requests && false === flag_skip_delay) {
3425
+ setTimeout(function () {
3426
+ flag_skip_delay = true;
3427
+ wpmdb.functions.execute_next_step();
3428
+ }, delay_between_requests);
3429
+ return;
3430
+ } else {
3431
+ flag_skip_delay = false;
3432
+ }
3433
+
3434
+ if (true === migration_paused) {
3435
+ $('.migration-progress-ajax-spinner').hide();
3436
+
3437
+ // Pause the timer
3438
+ wpmdb.current_migration.pauseTimer();
3439
+
3440
+ var pause_text = '';
3441
+ if (true === is_auto_pause_before_finalize) {
3442
+ pause_text = wpmdb_strings.paused_before_finalize;
3443
+ is_auto_pause_before_finalize = false;
3444
+
3445
+ if ('find_replace' === wpmdb.functions.wpmdb_migration_type()) {
3446
+ pause_text = wpmdb_strings.find_replace_paused_before_finalize;
3447
+ }
3448
+ } else {
3449
+ pause_text = wpmdb_strings.paused;
3450
+ }
3451
+
3452
+ wpmdb.current_migration.setState(null, pause_text, 'paused');
3453
+
3454
+ // Re-bind Pause/Resume button to Resume when we are finally Paused
3455
+ $('body').on('click', '.pause-resume', function (event) {
3456
+ set_pause_resume_button(event);
3457
+ });
3458
+ $('body').on('click', '.cancel', function (event) {
3459
+ cancel_migration(event);
3460
+ });
3461
+ $('.pause-resume').html(wpmdb_strings.resume);
3462
+ } else if (true === migration_cancelled) {
3463
+ migration_intent = wpmdb.functions.wpmdb_migration_type();
3464
+
3465
+ var progress_msg;
3466
+
3467
+ if ('savefile' === migration_intent) {
3468
+ progress_msg = wpmdb_strings.removing_local_sql;
3469
+ } else if ('pull' === migration_intent) {
3470
+ if ('backup' === stage) {
3471
+ progress_msg = wpmdb_strings.removing_local_backup;
3472
+ } else {
3473
+ progress_msg = wpmdb_strings.removing_local_temp_tables;
3474
+ }
3475
+ } else if ('push' === migration_intent) {
3476
+ if ('backup' === stage) {
3477
+ progress_msg = wpmdb_strings.removing_remote_sql;
3478
+ } else {
3479
+ progress_msg = wpmdb_strings.removing_remote_temp_tables;
3480
+ }
3481
+ }
3482
+ wpmdb.current_migration.setText(progress_msg);
3483
+
3484
+ var request_data = {
3485
+ action: 'wpmdb_cancel_migration',
3486
+ migration_state_id: wpmdb.migration_state_id,
3487
+ nonce: wpmdb_data.nonces.cancel_migration
3488
+ };
3489
+
3490
+ doing_ajax = true;
3491
+
3492
+ $.ajax({
3493
+ url: ajaxurl,
3494
+ type: 'POST',
3495
+ dataType: 'text',
3496
+ cache: false,
3497
+ data: request_data,
3498
+ error: function error(jqXHR, textStatus, errorThrown) {
3499
+ wpmdb.current_migration.setState(wpmdb_strings.migration_cancellation_failed, wpmdb_strings.manually_remove_temp_files + '<br /><br />' + wpmdb_strings.status + ': ' + jqXHR.status + ' ' + jqXHR.statusText + '<br /><br />' + wpmdb_strings.response + ':<br />' + jqXHR.responseText, 'error');
3500
+ console.log(jqXHR);
3501
+ console.log(textStatus);
3502
+ console.log(errorThrown);
3503
+ doing_ajax = false;
3504
+ wpmdb.common.migration_error = true;
3505
+ wpmdb.functions.migration_complete_events();
3506
+ },
3507
+ success: function success(data) {
3508
+ doing_ajax = false;
3509
+ data = $.trim(data);
3510
+
3511
+ if ('push' === migration_intent && '1' !== data || 'push' !== migration_intent && '' !== data) {
3512
+
3513
+ if ('undefined' !== typeof data && 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error) {
3514
+ data = data.wpmdb_error;
3515
+ }
3516
+
3517
+ wpmdb.current_migration.setState(wpmdb_strings.migration_cancellation_failed, data, 'error');
3518
+ wpmdb.common.migration_error = true;
3519
+ wpmdb.functions.migration_complete_events();
3520
+ return;
3521
+ }
3522
+
3523
+ completed_msg = wpmdb_strings.migration_cancelled;
3524
+
3525
+ if ('find_replace' === migration_intent) {
3526
+ completed_msg = wpmdb_strings.find_replace_cancelled;
3527
+ }
3528
+
3529
+ wpmdb.functions.migration_complete_events();
3530
+ wpmdb.current_migration.setStatus('cancelled');
3531
+ }
3532
+ });
3533
+ } else {
3534
+ wpmdb.common.next_step_in_migration.fn.apply(null, wpmdb.common.next_step_in_migration.args);
3535
+ }
3536
+ };
3537
+
3538
+ wpmdb.functions.maybe_show_prefix_notice = function (prefix) {
3539
+ var $prefix_notice = $('.prefix-notice');
3540
+
3541
+ $prefix_notice.hide();
3542
+
3543
+ if (prefix !== wpmdb_data.this_prefix) {
3544
+ $('.remote-prefix').html(prefix);
3545
+ show_prefix_notice = true;
3546
+ $prefix_notice.show();
3547
+ }
3548
+ };
3549
+
3550
+ wpmdb.functions.maybe_show_mst_warning = function (data) {
3551
+ var migration_type = wpmdb.functions.wpmdb_migration_type();
3552
+ var show_mst_warning = false;
3553
+
3554
+ if (-1 !== $.inArray(migration_type, ['push', 'pull']) && 'undefined' !== typeof data.site_details) {
3555
+ if (wpmdb_data.site_details.is_multisite !== data.site_details.is_multisite) {
3556
+ if ('undefined' === typeof wpmdb.mst || 'undefined' === typeof data.mst_available || '1' !== data.mst_available) {
3557
+ show_mst_warning = true;
3558
+ }
3559
+ }
3560
+ } else if ('import' === migration_type) {
3561
+ if ('undefined' !== typeof data.multisite && 'undefined' !== typeof data.subsite_export) {
3562
+ if ('false' === wpmdb_data.site_details.is_multisite && 'true' === data.multisite && 'true' !== data.subsite_export || 'true' === wpmdb_data.site_details.is_multisite && 'false' === data.multisite) {
3563
+ show_mst_warning = true;
3564
+ }
3565
+ }
3566
+ }
3567
+
3568
+ show_mst_warning = $.wpmdb.apply_filters('wpmdb_show_mst_warning', show_mst_warning);
3569
+
3570
+ if (show_mst_warning) {
3571
+ $('.mst-required').show();
3572
+ }
3573
+
3574
+ return show_mst_warning;
3575
+ };
3576
+
3577
+ wpmdb.functions.maybe_show_select_table_notice = function () {
3578
+
3579
+ // check that they've selected some tables to migrate
3580
+ if ($('#migrate-selected').is(':checked') && null === $('#select-tables').val()) {
3581
+ if ('import' !== wpmdb.functions.wpmdb_migration_type()) {
3582
+ alert(wpmdb_strings.please_select_one_table);
3583
+ return true;
3584
+ } else {
3585
+ if ($('#import-find-replace').is(':checked') && $('#select-tables').is(':visible')) {
3586
+ alert(wpmdb_strings.please_select_one_table_import);
3587
+ return true;
3588
+ }
3589
+ }
3590
+ }
3591
+
3592
+ // check that they've selected some tables to backup
3593
+ if ('savefile' !== wpmdb.functions.wpmdb_migration_type() && $('#backup-manual-select').is(':checked') && null === $('#select-backup').val()) {
3594
+ alert(wpmdb_strings.please_select_one_table_backup);
3595
+ return true;
3596
+ }
3597
+
3598
+ return false;
3599
+ };
3600
+
3601
+ wpmdb.functions.remove_protocol = function (url) {
3602
+ return url.replace(/^https?:/i, '');
3603
+ };
3604
+
3605
+ wpmdb.functions.create_table_select = function (tables, table_sizes_hr, selected_tables) {
3606
+ var $table_select = document.createElement('select');
3607
+ $($table_select).attr({
3608
+ multiple: 'multiple',
3609
+ name: 'select_tables[]',
3610
+ id: 'select-tables',
3611
+ class: 'multiselect'
3612
+ });
3613
+
3614
+ if (0 < tables.length) {
3615
+ $.each(tables, function (index, table) {
3616
+ if ($.wpmdb.apply_filters('wpmdb_exclude_table', false, table)) {
3617
+ return;
3618
+ }
3619
+
3620
+ var selected = ' ';
3621
+ if (undefined !== selected_tables && null !== selected_tables && 0 < selected_tables.length && -1 !== $.inArray(table, selected_tables)) {
3622
+ selected = ' selected="selected" ';
3623
+ }
3624
+
3625
+ var size = '';
3626
+ if (0 !== table_sizes_hr.length) {
3627
+ size = ' (' + table_sizes_hr[table] + ')';
3628
+ }
3629
+
3630
+ $($table_select).append('<option' + selected + 'value="' + table + '">' + table + size + '</option>');
3631
+ });
3632
+ }
3633
+
3634
+ return $table_select;
3635
+ };
3636
+
3637
+ /**
3638
+ * Returns tables selected for migration.
3639
+ *
3640
+ * @param value
3641
+ * @param args
3642
+ * @returns {array}
3643
+ *
3644
+ * Also handler for wpmdb_get_tables_to_migrate filter, disregards input values as it is the primary source.
3645
+ */
3646
+ wpmdb.functions.get_tables_to_migrate = function (value, args) {
3647
+ var tables = [];
3648
+ var mig_type = wpmdb.functions.wpmdb_migration_type();
3649
+ var table_intent = $('input[name=table_migrate_option]:checked').val();
3650
+
3651
+ // Grab tables as per what the user has selected from the multiselect box or all prefixed tables.
3652
+ if ('migrate_select' === table_intent) {
3653
+ tables = $('#select-tables').val();
3654
+ } else {
3655
+ if ('pull' !== mig_type && 'undefined' !== typeof wpmdb_data.this_prefixed_tables) {
3656
+ tables = wpmdb_data.this_prefixed_tables;
3657
+ } else if ('pull' === mig_type && 'undefined' !== typeof wpmdb.common.connection_data && 'undefined' !== typeof wpmdb.common.connection_data.prefixed_tables) {
3658
+ tables = wpmdb.common.connection_data.prefixed_tables;
3659
+ }
3660
+ }
3661
+
3662
+ return tables;
3663
+ };
3664
+
3665
+ wpmdb.functions.update_migrate_button_text = function () {
3666
+ var migration_intent = wpmdb.functions.wpmdb_migration_type();
3667
+ var save_string = $('#save-migration-profile').is(':checked') ? '_save' : '';
3668
+ var migrate_string = 'migrate_button_' + ('savefile' === migration_intent ? 'export' : migration_intent) + save_string;
3669
+ $('.migrate-db .button-primary').val(wpmdb_strings[migrate_string]);
3670
+ };
3671
+
3672
+ // fired when the connection info box changes (e.g. gets pasted into)
3673
+ wpmdb.functions.connection_box_changed = function () {
3674
+ var $this = $('.pull-push-connection-info');
3675
+
3676
+ if (-1 === $.inArray(wpmdb.functions.wpmdb_migration_type(), ['push', 'pull']) || (doing_ajax || $($this).hasClass('temp-disabled')) && false === wpmdb.force_reconnect) {
3677
+ return;
3678
+ }
3679
+
3680
+ wpmdb.force_reconnect = false;
3681
+ var data = $('.pull-push-connection-info').val();
3682
+
3683
+ var connection_info = $.trim(data).split('\n');
3684
+ var error = false;
3685
+ var error_message = '';
3686
+
3687
+ if ('' === connection_info) {
3688
+ error = true;
3689
+ error_message = wpmdb_strings.connection_info_missing;
3690
+ }
3691
+
3692
+ // attempt to format the connection info from a single line
3693
+ if (1 === connection_info.length && !error) {
3694
+ var connection_words = $.trim(data).split(' ');
3695
+ if (2 === connection_words.length) {
3696
+ connection_info = connection_words;
3697
+ }
3698
+ }
3699
+
3700
+ if (2 !== connection_info.length && !error) {
3701
+ error = true;
3702
+ error_message = wpmdb_strings.connection_info_incorrect;
3703
+ }
3704
+
3705
+ if (!error && !validate_url(connection_info[0])) {
3706
+ error = true;
3707
+ error_message = wpmdb_strings.connection_info_url_invalid;
3708
+ }
3709
+
3710
+ var key_length = 0;
3711
+
3712
+ if ('undefined' !== typeof connection_info[1]) {
3713
+ key_length = connection_info[1].length;
3714
+ }
3715
+
3716
+ if (!error && 32 !== key_length && 40 !== key_length) {
3717
+ error = true;
3718
+ error_message = wpmdb_strings.connection_info_key_invalid;
3719
+ }
3720
+
3721
+ if (!error && connection_info[0] === wpmdb_data.connection_info[0]) {
3722
+ error = true;
3723
+ error_message = wpmdb_strings.connection_info_local_url;
3724
+ }
3725
+
3726
+ if (!error && connection_info[1] === wpmdb_data.connection_info[1]) {
3727
+ error = true;
3728
+ error_message = wpmdb_strings.connection_info_local_key;
3729
+ }
3730
+ if (error) {
3731
+ $('.connection-status').html(error_message);
3732
+ $('.connection-status').addClass('notification-message error-notice migration-error');
3733
+ return;
3734
+ }
3735
+
3736
+ var new_connection_info_contents = connection_info[0] + '\n' + connection_info[1];
3737
+
3738
+ // If connection info is a single line
3739
+ if (1 === $.trim(data).split('\n').length) {
3740
+
3741
+ // Repopulate the input with the info on two lines
3742
+ $('.pull-push-connection-info').val(new_connection_info_contents);
3743
+ }
3744
+
3745
+ if (false === wpmdb_data.openssl_available) {
3746
+ connection_info[0] = connection_info[0].replace('https://', 'http://');
3747
+ new_connection_info_contents = connection_info[0] + '\n' + connection_info[1];
3748
+ $('.pull-push-connection-info').val(new_connection_info_contents);
3749
+ }
3750
+
3751
+ show_prefix_notice = false;
3752
+ doing_ajax = true;
3753
+ disable_export_type_controls();
3754
+
3755
+ if ($('.basic-access-auth-wrapper').is(':visible')) {
3756
+ connection_info[0] = connection_info[0].replace(/\/\/(.*)@/, '//');
3757
+ connection_info[0] = connection_info[0].replace('//', '//' + encodeURIComponent($.trim($('.auth-username').val())) + ':' + encodeURIComponent($.trim($('.auth-password').val())) + '@');
3758
+ new_connection_info_contents = connection_info[0] + '\n' + connection_info[1];
3759
+ $('.pull-push-connection-info').val(new_connection_info_contents);
3760
+ $('.basic-access-auth-wrapper').hide();
3761
+ }
3762
+
3763
+ $('.step-two').hide();
3764
+ $('.ssl-notice').hide();
3765
+ $('.prefix-notice').hide();
3766
+ $('.connection-status').show();
3767
+
3768
+ $('.connection-status').html(wpmdb_strings.establishing_remote_connection);
3769
+ $('.connection-status').removeClass('notification-message error-notice migration-error');
3770
+ $('.connection-status').append(ajax_spinner);
3771
+
3772
+ var intent = wpmdb.functions.wpmdb_migration_type();
3773
+
3774
+ profile_name_edited = false;
3775
+
3776
+ return $.ajax({
3777
+ url: ajaxurl,
3778
+ type: 'POST',
3779
+ dataType: 'json',
3780
+ cache: false,
3781
+ data: {
3782
+ action: 'wpmdb_verify_connection_to_remote_site',
3783
+ url: connection_info[0],
3784
+ key: connection_info[1],
3785
+ intent: intent,
3786
+ nonce: wpmdb_data.nonces.verify_connection_to_remote_site
3787
+ },
3788
+ error: function error(jqXHR, textStatus, errorThrown) {
3789
+ $('.connection-status').html(get_ajax_errors(jqXHR.responseText, '(#100)', jqXHR));
3790
+ $('.connection-status').addClass('notification-message error-notice migration-error');
3791
+ $('.ajax-spinner').remove();
3792
+ doing_ajax = false;
3793
+ enable_export_type_controls();
3794
+ },
3795
+ success: function success(data) {
3796
+ $('.ajax-spinner').remove();
3797
+ doing_ajax = false;
3798
+ enable_export_type_controls();
3799
+
3800
+ if ('undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error) {
3801
+ $('.connection-status').html(data.body);
3802
+ $('.connection-status').addClass('notification-message error-notice migration-error');
3803
+
3804
+ if (data.body.indexOf('401 Unauthorized') > -1) {
3805
+ $('.basic-access-auth-wrapper').show();
3806
+ }
3807
+
3808
+ if (!$('.pull-push-connection-info').hasClass('temp-disabled') && !$('.connect-button').is(':visible')) {
3809
+ $('.pull-push-connection-info').removeAttr('readonly');
3810
+ $('.connect-button').show();
3811
+ }
3812
+
3813
+ return;
3814
+ }
3815
+
3816
+ if (true === wpmdb.functions.maybe_show_mst_warning(data)) {
3817
+ $('.connection-status').hide();
3818
+ return;
3819
+ }
3820
+
3821
+ maybe_show_ssl_warning(connection_info[0], connection_info[1], data.scheme);
3822
+
3823
+ var profile_name = get_domain_name(data.url);
3824
+ $('.create-new-profile').val(profile_name);
3825
+
3826
+ $('.pull-push-connection-info').addClass('temp-disabled');
3827
+ $('.pull-push-connection-info').attr('readonly', 'readonly');
3828
+ $('.connect-button').hide();
3829
+
3830
+ $('.connection-status').hide();
3831
+ $('.step-two').show();
3832
+
3833
+ wpmdb.functions.maybe_show_prefix_notice(data.prefix);
3834
+
3835
+ connection_established = true;
3836
+ set_connection_data(data);
3837
+ move_connection_info_box();
3838
+ change_replace_values();
3839
+
3840
+ maybe_show_mixed_cased_table_name_warning();
3841
+
3842
+ refresh_table_selects();
3843
+
3844
+ $push_select_backup = $($pull_select).clone();
3845
+ $($push_select_backup).attr({
3846
+ name: 'select_backup[]',
3847
+ id: 'select-backup'
3848
+ });
3849
+
3850
+ var $post_type_select = document.createElement('select');
3851
+ $($post_type_select).attr({
3852
+ multiple: 'multiple',
3853
+ name: 'select_post_types[]',
3854
+ id: 'select-post-types',
3855
+ class: 'multiselect'
3856
+ });
3857
+
3858
+ $.each(wpmdb.common.connection_data.post_types, function (index, value) {
3859
+ $($post_type_select).append('<option value="' + value + '">' + value + '</option>');
3860
+ });
3861
+
3862
+ $pull_post_type_select = $post_type_select;
3863
+
3864
+ $('#new-path-missing-warning, #new-url-missing-warning').hide();
3865
+
3866
+ if ('pull' === wpmdb.functions.wpmdb_migration_type()) {
3867
+ $('#new-url').val(wpmdb.functions.remove_protocol(wpmdb_data.this_url));
3868
+ $('#new-path').val(wpmdb_data.this_path);
3869
+ if ('true' === wpmdb_data.is_multisite) {
3870
+ $('#new-domain').val(wpmdb_data.this_domain);
3871
+ $('.replace-row.pin .old-replace-col input[type="text"]').val(wpmdb.functions.remove_protocol(data.url));
3872
+ }
3873
+ $('#old-url').val(wpmdb.functions.remove_protocol(data.url));
3874
+ $('#old-path').val(data.path);
3875
+
3876
+ $.wpmdb.do_action('wpmdb_update_pull_table_select');
3877
+ $('#select-post-types').remove();
3878
+ $('.exclude-post-types-warning').after($pull_post_type_select);
3879
+ wpmdb.functions.exclude_post_types_warning();
3880
+ $('.table-prefix').html(data.prefix);
3881
+ $('.backup-table-prefix').html(wpmdb_data.site_details.prefix);
3882
+ $('.uploads-dir').html(wpmdb_data.this_uploads_dir);
3883
+ } else {
3884
+ $('#new-url').val(wpmdb.functions.remove_protocol(data.url));
3885
+ $('#new-path').val(data.path);
3886
+
3887
+ if ('true' === wpmdb_data.is_multisite) {
3888
+ $('.replace-row.pin .old-replace-col input[type="text"]').val(wpmdb.functions.remove_protocol(wpmdb_data.this_url));
3889
+ }
3890
+ $.wpmdb.do_action('wpmdb_update_push_table_select');
3891
+ $('#select-backup').remove();
3892
+ $('.backup-tables-wrap').prepend($push_select_backup);
3893
+ }
3894
+
3895
+ wpmdb.common.next_step_in_migration = {
3896
+ fn: $.wpmdb.do_action,
3897
+ args: ['verify_connection_to_remote_site', wpmdb.common.connection_data]
3898
+ };
3899
+ wpmdb.functions.execute_next_step();
3900
+ }
3901
+
3902
+ });
3903
+ };
3904
+
3905
+ /**
3906
+ *
3907
+ * ========= DOM ready =========
3908
+ *
3909
+ * Mostly direct DOM manipulation specific code
3910
+ *
3911
+ */
3912
+ $(document).ready(function () {
3913
+ wpmdb.migration_state_id = '';
3914
+
3915
+ $('#plugin-compatibility').change(function (e) {
3916
+ var install = '1';
3917
+ var $status = $(this).closest('td').next('td').find('.setting-status');
3918
+
3919
+ if (!$(this).is(':checked')) {
3920
+ install = '0';
3921
+ }
3922
+
3923
+ $('.plugin-compatibility-wrap').toggle();
3924
+
3925
+ $status.find('.ajax-success-msg').remove();
3926
+ $status.append(ajax_spinner);
3927
+ $('#plugin-compatibility').attr('disabled', 'disabled');
3928
+ $('.plugin-compatibility').addClass('disabled');
3929
+
3930
+ $.ajax({
3931
+ url: ajaxurl,
3932
+ type: 'POST',
3933
+ dataType: 'text',
3934
+ cache: false,
3935
+ data: {
3936
+ action: 'wpmdb_plugin_compatibility',
3937
+ install: install,
3938
+ nonce: wpmdb_data.nonces.plugin_compatibility
3939
+ },
3940
+ error: function error(jqXHR, textStatus, errorThrown) {
3941
+ alert(wpmdb_strings.plugin_compatibility_settings_problem + '\r\n\r\n' + wpmdb_strings.status + ' ' + jqXHR.status + ' ' + jqXHR.statusText + '\r\n\r\n' + wpmdb_strings.response + '\r\n' + jqXHR.responseText);
3942
+ $('.ajax-spinner').remove();
3943
+ $('#plugin-compatibility').removeAttr('disabled');
3944
+ $('.plugin-compatibility').removeClass('disabled');
3945
+ },
3946
+ success: function success(data) {
3947
+ if ('' !== $.trim(data)) {
3948
+ alert(data);
3949
+ } else {
3950
+ $status.append('<span class="ajax-success-msg">' + wpmdb_strings.saved + '</span>');
3951
+ $('.ajax-success-msg').fadeOut(2000, function () {
3952
+ $(this).remove();
3953
+ });
3954
+ }
3955
+ $('.ajax-spinner').remove();
3956
+ $('#plugin-compatibility').removeAttr('disabled');
3957
+ $('.plugin-compatibility').removeClass('disabled');
3958
+ }
3959
+ });
3960
+ });
3961
+
3962
+ if ($('#plugin-compatibility').is(':checked')) {
3963
+ $('.plugin-compatibility-wrap').show();
3964
+ }
3965
+
3966
+ if (0 <= navigator.userAgent.indexOf('MSIE') || 0 <= navigator.userAgent.indexOf('Trident')) {
3967
+ $('.ie-warning').show();
3968
+ }
3969
+
3970
+ if (0 === wpmdb_data.valid_licence) {
3971
+ $('#savefile').prop('checked', true);
3972
+ }
3973
+ var max_request_size_container = $('.max-request-size');
3974
+ var max_request_size_slider = $('.slider', max_request_size_container);
3975
+ max_request_size_slider.slider({
3976
+ range: 'min',
3977
+ value: parseInt(wpmdb_data.max_request / 1024),
3978
+ min: 512,
3979
+ max: parseInt(wpmdb_data.bottleneck / 1024),
3980
+ step: 256,
3981
+ create: function create(event, ui) {
3982
+ var display_info = get_max_request_display_info(wpmdb_data.max_request / 1024);
3983
+ set_slider_value(max_request_size_container, wpmdb_data.max_request / 1024, display_info.unit, display_info.amount);
3984
+ },
3985
+ slide: function slide(event, ui) {
3986
+ var display_info = get_max_request_display_info(ui.value);
3987
+ set_slider_value(max_request_size_container, ui.value, display_info.unit, display_info.amount);
3988
+ },
3989
+ stop: function stop(event, ui) {
3990
+ $('.slider-success-msg').remove();
3991
+ $('.amount', max_request_size_container).after('<img src="' + spinner_url + '" alt="" class="slider-spinner general-spinner" />');
3992
+ max_request_size_slider.slider('disable');
3993
+
3994
+ $.ajax({
3995
+ url: ajaxurl,
3996
+ type: 'POST',
3997
+ cache: false,
3998
+ data: {
3999
+ action: 'wpmdb_update_max_request_size',
4000
+ max_request_size: parseInt(ui.value),
4001
+ nonce: wpmdb_data.nonces.update_max_request_size
4002
+ },
4003
+ error: function error(jqXHR, textStatus, errorThrown) {
4004
+ max_request_size_slider.slider('enable');
4005
+ $('.slider-spinner', max_request_size_container).remove();
4006
+ alert(wpmdb_strings.max_request_size_problem);
4007
+ var display_info = get_max_request_display_info(wpmdb_data.max_request / 1024);
4008
+ set_slider_value(max_request_size_container, wpmdb_data.max_request / 1024, display_info.unit, display_info.amount);
4009
+ max_request_size_slider.slider('enable');
4010
+ },
4011
+ success: function success() {
4012
+ max_request_size_slider.slider('enable');
4013
+ $('.slider-label-wrapper', max_request_size_container).append('<span class="slider-success-msg">' + wpmdb_strings.saved + '</span>');
4014
+ $('.slider-success-msg', max_request_size_container).fadeOut(2000, function () {
4015
+ $(this).remove();
4016
+ });
4017
+ $('.slider-spinner', max_request_size_container).remove();
4018
+ }
4019
+ });
4020
+ }
4021
+ });
4022
+
4023
+ var delay_between_requests_container = $('.delay-between-requests');
4024
+ var delay_between_requests_slider = $('.slider', delay_between_requests_container);
4025
+ delay_between_requests_slider.slider({
4026
+ range: 'min',
4027
+ value: parseInt(wpmdb_data.delay_between_requests / 1000),
4028
+ min: 0,
4029
+ max: 10,
4030
+ step: 1,
4031
+ create: function create(event, ui) {
4032
+ set_slider_value(delay_between_requests_container, wpmdb_data.delay_between_requests / 1000, 's');
4033
+ },
4034
+ slide: function slide(event, ui) {
4035
+ set_slider_value(delay_between_requests_container, ui.value, 's');
4036
+ },
4037
+ stop: function stop(event, ui) {
4038
+ $('.slider-success-msg').remove();
4039
+ $('.amount', delay_between_requests_container).after('<img src="' + spinner_url + '" alt="" class="slider-spinner general-spinner" />');
4040
+ delay_between_requests_slider.slider('disable');
4041
+
4042
+ $.ajax({
4043
+ url: ajaxurl,
4044
+ type: 'POST',
4045
+ cache: false,
4046
+ data: {
4047
+ action: 'wpmdb_update_delay_between_requests',
4048
+ delay_between_requests: parseInt(ui.value * 1000),
4049
+ nonce: wpmdb_data.nonces.update_delay_between_requests
4050
+ },
4051
+ error: function error(jqXHR, textStatus, errorThrown) {
4052
+ delay_between_requests_slider.slider('enable');
4053
+ $('.slider-spinner', delay_between_requests_container).remove();
4054
+ alert(wpmdb_strings.delay_between_requests_problem);
4055
+ set_slider_value(delay_between_requests_container, wpmdb_data.delay_between_requests / 1000, 's');
4056
+ delay_between_requests_slider.slider('enable');
4057
+ },
4058
+ success: function success() {
4059
+ wpmdb_data.delay_between_requests = parseInt(ui.value * 1000);
4060
+ delay_between_requests_slider.slider('enable');
4061
+ $('.slider-label-wrapper', delay_between_requests_container).append('<span class="slider-success-msg">' + wpmdb_strings.saved + '</span>');
4062
+ $('.slider-success-msg', delay_between_requests_container).fadeOut(2000, function () {
4063
+ $(this).remove();
4064
+ });
4065
+ $('.slider-spinner', delay_between_requests_container).remove();
4066
+ }
4067
+ });
4068
+ }
4069
+ });
4070
+
4071
+ $('.help-tab .video').each(function () {
4072
+ var $container = $(this),
4073
+ $viewer = $('.video-viewer');
4074
+
4075
+ $('a', this).click(function (e) {
4076
+ e.preventDefault();
4077
+
4078
+ $viewer.attr('src', '//www.youtube.com/embed/' + $container.data('video-id') + '?autoplay=1');
4079
+ $viewer.show();
4080
+ var offset = $viewer.offset();
4081
+ $(window).scrollTop(offset.top - 50);
4082
+ });
4083
+ });
4084
+
4085
+ $('.backup-options').show();
4086
+ $('.keep-active-plugins').show();
4087
+ if ('savefile' === wpmdb.functions.wpmdb_migration_type()) {
4088
+ $('.backup-options').hide();
4089
+ $('.keep-active-plugins').hide();
4090
+ }
4091
+
4092
+ last_replace_switch = wpmdb.functions.wpmdb_migration_type();
4093
+
4094
+ /**
4095
+ * Handle 'Check License Again' functionality found in expired license messages.
4096
+ */
4097
+ $('.content-tab').on('click', '.check-my-licence-again', function (e) {
4098
+ e.preventDefault();
4099
+ checked_licence = false;
4100
+ $(e.target).replaceWith('Checking... ' + ajax_spinner);
4101
+ check_licence(null, 'all');
4102
+ });
4103
+
4104
+ $.wpmdb.add_action('wpmdb_refresh_table_selects', refresh_table_selects);
4105
+
4106
+ function update_push_table_select() {
4107
+ $('#select-tables').remove();
4108
+ $('.select-tables-wrap').prepend($push_select);
4109
+ $('#select-tables').change();
4110
+ }
4111
+
4112
+ $.wpmdb.add_action('wpmdb_update_push_table_select', update_push_table_select);
4113
+
4114
+ function update_pull_table_select() {
4115
+ $('#select-tables').remove();
4116
+ $('.select-tables-wrap').prepend($pull_select);
4117
+ $('#select-tables').change();
4118
+ }
4119
+
4120
+ $.wpmdb.add_action('wpmdb_update_pull_table_select', update_pull_table_select);
4121
+
4122
+ function disable_table_migration_options() {
4123
+ $('#migrate-selected').parents('.option-section').children('.header-expand-collapse').children('.expand-collapse-arrow').removeClass('collapsed');
4124
+ $('.table-select-wrap').show();
4125
+ $('#migrate-only-with-prefix').prop('checked', false);
4126
+ $('#migrate-selected').prop('checked', true);
4127
+ $('.table-migrate-options').hide();
4128
+ $('.select-tables-wrap').show();
4129
+ }
4130
+
4131
+ $.wpmdb.add_action('wpmdb_disable_table_migration_options', disable_table_migration_options);
4132
+
4133
+ function enable_table_migration_options() {
4134
+ $('.table-migrate-options').show();
4135
+ }
4136
+
4137
+ $.wpmdb.add_action('wpmdb_enable_table_migration_options', enable_table_migration_options);
4138
+
4139
+ function select_all_tables() {
4140
+ $('#select-tables').children('option').prop('selected', true);
4141
+ $('#select-tables').change();
4142
+ }
4143
+
4144
+ $.wpmdb.add_action('wpmdb_select_all_tables', select_all_tables);
4145
+
4146
+ function base_old_url(value, args) {
4147
+ return wpmdb.functions.remove_protocol(wpmdb_data.this_url);
4148
+ }
4149
+
4150
+ $.wpmdb.add_filter('wpmdb_base_old_url', base_old_url);
4151
+
4152
+ // automatically validate connection info if we're loading a saved profile
4153
+ establish_remote_connection_from_saved_profile();
4154
+
4155
+ // add to <a> tags which act as JS event buttons, will not jump page to top and will deselect the button
4156
+ $('body').on('click', '.js-action-link', function (e) {
4157
+ e.preventDefault();
4158
+ $(this).blur();
4159
+ });
4160
+
4161
+ $('.licence-input').keypress(function (e) {
4162
+ if (13 === e.which) {
4163
+ e.preventDefault();
4164
+ $('.register-licence').click();
4165
+ }
4166
+ });
4167
+
4168
+ // registers your licence
4169
+ $('body').on('click', '.register-licence', function (e) {
4170
+ e.preventDefault();
4171
+
4172
+ if (doing_licence_registration_ajax) {
4173
+ return;
4174
+ }
4175
+
4176
+ var licence_key = $.trim($('.licence-input').val());
4177
+ var $licence_status = $('.licence-status');
4178
+
4179
+ $licence_status.removeClass('notification-message error-notice success-notice');
4180
+
4181
+ if ('' === licence_key) {
4182
+ $licence_status.html('<div class="notification-message error-notice">' + wpmdb_strings.enter_license_key + '</div>');
4183
+ return;
4184
+ }
4185
+
4186
+ $licence_status.empty().removeClass('success');
4187
+ doing_licence_registration_ajax = true;
4188
+ $('.button.register-licence').after('<img src="' + spinner_url + '" alt="" class="register-licence-ajax-spinner general-spinner" />');
4189
+
4190
+ $.ajax({
4191
+ url: ajaxurl,
4192
+ type: 'POST',
4193
+ dataType: 'JSON',
4194
+ cache: false,
4195
+ data: {
4196
+ action: 'wpmdb_activate_licence',
4197
+ licence_key: licence_key,
4198
+ nonce: wpmdb_data.nonces.activate_licence,
4199
+ context: 'licence'
4200
+ },
4201
+ error: function error(jqXHR, textStatus, errorThrown) {
4202
+ doing_licence_registration_ajax = false;
4203
+ $('.register-licence-ajax-spinner').remove();
4204
+ $licence_status.html(wpmdb_strings.register_license_problem);
4205
+ },
4206
+ success: function success(data) {
4207
+ $('.register-licence-ajax-spinner').remove();
4208
+
4209
+ if ('undefined' !== typeof data.errors) {
4210
+ var msg = '';
4211
+ for (var key in data.errors) {
4212
+ msg += data.errors[key];
4213
+ }
4214
+ $licence_status.html(msg);
4215
+
4216
+ if ('undefined' !== typeof data.masked_licence) {
4217
+ enable_pro_licence(data, licence_key);
4218
+ $('.migrate-tab .invalid-licence').hide();
4219
+ }
4220
+ } else if ('undefined' !== typeof data.wpmdb_error && 'undefined' !== typeof data.body) {
4221
+ $licence_status.html(data.body);
4222
+ } else {
4223
+ if (1 === Number(data.is_first_activation)) {
4224
+ wpmdb_strings.welcome_text = wpmdb_strings.welcome_text.replace('%1$s', 'https://deliciousbrains.com/wp-migrate-db-pro/doc/quick-start-guide/?utm_campaign=support%2Bdocs&utm_source=MDB%2BPaid&utm_medium=insideplugin');
4225
+ wpmdb_strings.welcome_text = wpmdb_strings.welcome_text.replace('%2$s', 'https://deliciousbrains.com/wp-migrate-db-pro/videos/?utm_campaign=support%2Bdocs&utm_source=MDB%2BPaid&utm_medium=insideplugin');
4226
+
4227
+ $licence_status.after('<div id="welcome-wrap">' + '<img id="welcome-img" src="' + wpmdb_data.this_plugin_url + 'asset/dist/img/mdb-banner.svg" />' + '<div class="welcome-text">' + '<h3>' + wpmdb_strings.welcome_title + '</h3>' + '<p>' + wpmdb_strings.welcome_text + '</p>' + '</div>' + '</div>');
4228
+ }
4229
+
4230
+ $licence_status.html(wpmdb_strings.license_registered).delay(5000).fadeOut(1000, function () {
4231
+ $(this).css({ visibility: 'hidden', display: 'block' }).slideUp();
4232
+ });
4233
+ $licence_status.addClass('success notification-message success-notice');
4234
+ enable_pro_licence(data, licence_key);
4235
+ $('.invalid-licence').hide();
4236
+ }
4237
+
4238
+ doing_licence_registration_ajax = false;
4239
+ }
4240
+ });
4241
+ });
4242
+
4243
+ // clears the debug log
4244
+ $('.clear-log').click(function () {
4245
+ $('.ajax-spinner, .ajax-success-msg').remove();
4246
+ $(this).after(ajax_spinner);
4247
+ $('.debug-log-textarea').val('');
4248
+ $.ajax({
4249
+ url: ajaxurl,
4250
+ type: 'POST',
4251
+ dataType: 'text',
4252
+ cache: false,
4253
+ data: {
4254
+ action: 'wpmdb_clear_log',
4255
+ nonce: wpmdb_data.nonces.clear_log
4256
+ },
4257
+ error: function error(jqXHR, textStatus, errorThrown) {
4258
+ $('.ajax-spinner').remove();
4259
+ alert(wpmdb_strings.clear_log_problem);
4260
+ },
4261
+ success: function success(data) {
4262
+ $('.ajax-spinner, .ajax-success-msg').remove();
4263
+ refresh_debug_log();
4264
+ $('.clear-log').after('<span class="ajax-success-msg">' + wpmdb_strings.clear_error_log + '</span>');
4265
+ $('.ajax-success-msg').fadeOut(2000, function () {
4266
+ $(this).remove();
4267
+ });
4268
+ }
4269
+ });
4270
+ });
4271
+
4272
+ // select all tables
4273
+ $('.multiselect-select-all').click(function () {
4274
+ var multiselect = $(this).parents('.select-wrap').children('.multiselect');
4275
+ $('option', multiselect).prop('selected', 1);
4276
+ $(multiselect).focus().trigger('change');
4277
+ });
4278
+
4279
+ // deselect all tables
4280
+ $('.multiselect-deselect-all').click(function () {
4281
+ var multiselect = $(this).parents('.select-wrap').children('.multiselect');
4282
+ $('option', multiselect).removeAttr('selected');
4283
+ $(multiselect).focus().trigger('change');
4284
+ });
4285
+
4286
+ // invert table selection
4287
+ $('.multiselect-invert-selection').click(function () {
4288
+ var multiselect = $(this).parents('.select-wrap').children('.multiselect');
4289
+ $('option', multiselect).each(function () {
4290
+ $(this).attr('selected', !$(this).attr('selected'));
4291
+ });
4292
+ $(multiselect).focus().trigger('change');
4293
+ });
4294
+
4295
+ // on option select hide all "advanced" option divs and show the correct div for the option selected
4296
+ $('.option-group input[type=radio]').change(function () {
4297
+ var group = $(this).closest('.option-group');
4298
+ $('ul', group).hide();
4299
+ var parent = $(this).closest('li');
4300
+ $('ul', parent).show();
4301
+ });
4302
+
4303
+ // on page load, expand hidden divs for selected options (browser form cache)
4304
+ $('.option-group').each(function () {
4305
+ $('.option-group input[type=radio]').each(function () {
4306
+ if ($(this).is(':checked')) {
4307
+ var parent = $(this).closest('li');
4308
+ $('ul', parent).show();
4309
+ }
4310
+ });
4311
+ });
4312
+
4313
+ // expand and collapse content on click
4314
+ $('.header-expand-collapse').click(function () {
4315
+ var target = null;
4316
+
4317
+ if (undefined !== $(this).data('next')) {
4318
+ target = $(this).data('next');
4319
+ }
4320
+
4321
+ if ($('.expand-collapse-arrow', this).hasClass('collapsed')) {
4322
+ $('.expand-collapse-arrow', this).removeClass('collapsed');
4323
+ if (target) {
4324
+ $(target).show();
4325
+ } else {
4326
+ $(this).next().show();
4327
+ }
4328
+ } else {
4329
+ $('.expand-collapse-arrow', this).addClass('collapsed');
4330
+ if (target) {
4331
+ $(target).hide();
4332
+ } else {
4333
+ $(this).next().hide();
4334
+ }
4335
+ }
4336
+ });
4337
+
4338
+ $('.checkbox-label input[type=checkbox]').change(function () {
4339
+ if ($(this).is(':checked')) {
4340
+ $(this).parent().next().show();
4341
+ } else {
4342
+ $(this).parent().next().hide();
4343
+ }
4344
+ });
4345
+
4346
+ // warning for excluding post types
4347
+ $('.select-post-types-wrap').on('change', '#select-post-types', function () {
4348
+ wpmdb.functions.exclude_post_types_warning();
4349
+ });
4350
+
4351
+ if ($('#exclude-post-types').is(':checked')) {
4352
+ if ($('#select-post-types').val()) {
4353
+ $('.exclude-post-types-warning').css({ display: 'block', opacity: 1 });
4354
+ }
4355
+ }
4356
+
4357
+ // special expand and collapse content on click for save migration profile
4358
+ $('#save-migration-profile').change(function () {
4359
+ wpmdb.functions.update_migrate_button_text();
4360
+ if ($(this).is(':checked')) {
4361
+ $('.save-settings-button').show();
4362
+ } else {
4363
+ $('.save-settings-button').hide();
4364
+ }
4365
+ });
4366
+
4367
+ if ($('#save-migration-profile').is(':checked')) {
4368
+ $('.save-settings-button').show();
4369
+ }
4370
+
4371
+ $('.create-new-profile').focus(function () {
4372
+ $('#create_new').prop('checked', true);
4373
+ });
4374
+
4375
+ $('.checkbox-label input[type=checkbox]').each(function () {
4376
+ if ($(this).is(':checked')) {
4377
+ $(this).parent().next().show();
4378
+ }
4379
+ });
4380
+
4381
+ // AJAX migrate button
4382
+ $('.migrate-db-button').click(function (event) {
4383
+ $(this).blur();
4384
+ event.preventDefault();
4385
+ wpmdb.migration_state_id = '';
4386
+
4387
+ if (false === $.wpmdb.apply_filters('wpmdb_migration_profile_ready', true)) {
4388
+ return;
4389
+ }
4390
+
4391
+ if (true === wpmdb.functions.maybe_show_select_table_notice()) {
4392
+ return;
4393
+ }
4394
+
4395
+ var new_url_missing = false;
4396
+ var new_file_path_missing = false;
4397
+ if ($('#new-url').length && !$('#new-url').val()) {
4398
+ $('#new-url-missing-warning').show();
4399
+ $('#new-url').focus();
4400
+ $('html,body').scrollTop(0);
4401
+ new_url_missing = true;
4402
+ }
4403
+
4404
+ if ($('#new-path').length && !$('#new-path').val()) {
4405
+ $('#new-path-missing-warning').show();
4406
+ if (false === new_url_missing) {
4407
+ $('#new-path').focus();
4408
+ $('html,body').scrollTop(0);
4409
+ }
4410
+ new_file_path_missing = true;
4411
+ }
4412
+
4413
+ if (true === new_url_missing || true === new_file_path_missing) {
4414
+ if ('import' === wpmdb.functions.wpmdb_migration_type()) {
4415
+ if ($('#import-find-replace').is(':checked')) {
4416
+ return;
4417
+ }
4418
+ } else {
4419
+ return;
4420
+ }
4421
+ }
4422
+
4423
+ // also save profile
4424
+ if ($('#save-migration-profile').is(':checked')) {
4425
+ save_active_profile();
4426
+ }
4427
+
4428
+ form_data = $($('#migrate-form')[0].elements).not('.auth-credentials').serialize();
4429
+
4430
+ migration_intent = wpmdb.functions.wpmdb_migration_type();
4431
+
4432
+ stage = 'backup';
4433
+
4434
+ if ('savefile' === migration_intent) {
4435
+ stage = 'migrate';
4436
+ }
4437
+
4438
+ if (false === $('#create-backup').is(':checked')) {
4439
+ if (-1 !== $.inArray(migration_intent, ['savefile', 'push', 'pull'])) {
4440
+ stage = 'migrate';
4441
+ } else if ('import' === migration_intent) {
4442
+ stage = 'upload';
4443
+ } else {
4444
+ stage = migration_intent;
4445
+ }
4446
+ }
4447
+
4448
+ wpmdb.current_migration = wpmdb.migration_progress_controller.newMigration({
4449
+ 'localTableSizes': wpmdb_data.this_table_sizes,
4450
+ 'localTableRows': wpmdb_data.this_table_rows,
4451
+ 'remoteTableSizes': 'undefined' !== typeof wpmdb.common.connection_data ? wpmdb.common.connection_data.table_sizes : null,
4452
+ 'remoteTableRows': 'undefined' !== typeof wpmdb.common.connection_data ? wpmdb.common.connection_data.table_rows : null,
4453
+ 'migrationIntent': wpmdb.functions.wpmdb_migration_type()
4454
+ });
4455
+
4456
+ var backup_option = $('input[name=backup_option]:checked').val();
4457
+ var table_option = $('input[name=table_migrate_option]:checked').val();
4458
+ var selected_tables = '';
4459
+ var data_type = '';
4460
+
4461
+ // set up backup stage
4462
+ if ('backup' === stage) {
4463
+ if ('migrate_only_with_prefix' === table_option && 'backup_selected' === backup_option && 'import' !== migration_intent) {
4464
+ backup_option = 'backup_only_with_prefix';
4465
+ }
4466
+ if ('push' === migration_intent) {
4467
+ data_type = 'remote';
4468
+ if ('backup_only_with_prefix' === backup_option) {
4469
+ tables_to_migrate = wpmdb.common.connection_data.prefixed_tables;
4470
+ } else if ('backup_selected' === backup_option) {
4471
+ selected_tables = $('#select-tables').val();
4472
+ selected_tables = $.wpmdb.apply_filters('wpmdb_backup_selected_tables', selected_tables);
4473
+ tables_to_migrate = get_intersect(selected_tables, wpmdb.common.connection_data.tables);
4474
+ } else if ('backup_manual_select' === backup_option) {
4475
+ tables_to_migrate = $('#select-backup').val();
4476
+ }
4477
+ } else {
4478
+ data_type = 'local';
4479
+ if ('backup_only_with_prefix' === backup_option) {
4480
+ tables_to_migrate = wpmdb_data.this_prefixed_tables;
4481
+ } else if ('backup_selected' === backup_option) {
4482
+ selected_tables = $('#select-tables').val();
4483
+ selected_tables = $.wpmdb.apply_filters('wpmdb_backup_selected_tables', selected_tables);
4484
+ tables_to_migrate = get_intersect(selected_tables, wpmdb_data.this_tables);
4485
+ } else if ('backup_manual_select' === backup_option) {
4486
+ tables_to_migrate = $('#select-backup').val();
4487
+ }
4488
+ }
4489
+
4490
+ wpmdb.current_migration.model.addStage('backup', tables_to_migrate, data_type, {
4491
+ strings: {
4492
+ migrated: wpmdb_strings.backed_up
4493
+ }
4494
+ });
4495
+ }
4496
+
4497
+ // set up migration stage
4498
+ if ('pull' === migration_intent) {
4499
+ data_type = 'remote';
4500
+ } else {
4501
+ data_type = 'local';
4502
+ }
4503
+
4504
+ if ('find_replace' === migration_intent) {
4505
+ wpmdb.current_migration.model.addStage('find_replace', wpmdb.functions.get_tables_to_migrate(null, null), data_type, {
4506
+ strings: {
4507
+ migrated: wpmdb_strings.searched,
4508
+ stage_title: wpmdb_strings.migrate_button_find_replace
4509
+ }
4510
+ });
4511
+ } else if (-1 !== $.inArray(migration_intent, ['savefile', 'push', 'pull'])) {
4512
+ wpmdb.current_migration.model.addStage('migrate', wpmdb.functions.get_tables_to_migrate(null, null), data_type);
4513
+ }
4514
+
4515
+ // add any additional migration stages via hook
4516
+ $.wpmdb.do_action('wpmdb_add_migration_stages', {
4517
+ 'data_type': data_type,
4518
+ 'tables_to_migrate': wpmdb.functions.get_tables_to_migrate(null, null)
4519
+ });
4520
+
4521
+ var table_intent = $('input[name=table_migrate_option]:checked').val();
4522
+ var connection_info = $.trim($('.pull-push-connection-info').val()).split('\n');
4523
+ var table_rows = '';
4524
+
4525
+ remote_site = connection_info[0];
4526
+ secret_key = connection_info[1];
4527
+
4528
+ var static_migration_label = get_migration_status_label(remote_site, migration_intent, 'migrating');
4529
+ completed_msg = get_migration_status_label(remote_site, migration_intent, 'completed');
4530
+
4531
+ if (-1 !== $.inArray(stage, ['find_replace', 'backup', 'migrate'])) {
4532
+ tables_to_migrate = wpmdb.current_migration.model.getStageItems(stage, 'name');
4533
+ }
4534
+
4535
+ wpmdb.current_migration.model.setActiveStage(stage);
4536
+
4537
+ wpmdb.current_migration.setTitle(static_migration_label);
4538
+
4539
+ wpmdb.current_migration.startTimer();
4540
+
4541
+ currently_migrating = true;
4542
+ wpmdb.current_migration.setStatus('active');
4543
+
4544
+ var request_data = {
4545
+ action: 'wpmdb_initiate_migration',
4546
+ intent: migration_intent,
4547
+ url: remote_site,
4548
+ key: secret_key,
4549
+ form_data: form_data,
4550
+ stage: stage,
4551
+ nonce: wpmdb_data.nonces.initiate_migration
4552
+ };
4553
+
4554
+ request_data.site_details = {
4555
+ local: wpmdb_data.site_details
4556
+ };
4557
+
4558
+ if (-1 !== $.inArray(migration_intent, ['push', 'pull'])) {
4559
+ request_data.temp_prefix = wpmdb.common.connection_data.temp_prefix;
4560
+ request_data.site_details.remote = wpmdb.common.connection_data.site_details;
4561
+ }
4562
+
4563
+ // site_details can have a very large number of elements that blows out PHP's max_input_vars
4564
+ // so we reduce it down to one variable for this one POST.
4565
+ request_data.site_details = JSON.stringify(request_data.site_details);
4566
+
4567
+ request_data = $.wpmdb.apply_filters('wpmdb_initiate_migration_request_data', request_data, request_data);
4568
+
4569
+ doing_ajax = true;
4570
+
4571
+ $.ajax({
4572
+ url: ajaxurl,
4573
+ type: 'POST',
4574
+ dataType: 'json',
4575
+ cache: false,
4576
+ data: request_data,
4577
+ error: function error(jqXHR, textStatus, errorThrown) {
4578
+
4579
+ wpmdb.current_migration.setState(wpmdb_strings.migration_failed, get_ajax_errors(jqXHR.responseText, '(#112)', jqXHR), 'error');
4580
+
4581
+ console.log(jqXHR);
4582
+ console.log(textStatus);
4583
+ console.log(errorThrown);
4584
+ doing_ajax = false;
4585
+ wpmdb.common.migration_error = true;
4586
+ wpmdb.functions.migration_complete_events();
4587
+ },
4588
+ success: function success(data) {
4589
+ doing_ajax = false;
4590
+ if ('undefined' !== typeof data && 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error) {
4591
+ wpmdb.common.migration_error = true;
4592
+ wpmdb.functions.migration_complete_events();
4593
+ wpmdb.current_migration.setState(wpmdb_strings.migration_failed, data.body, 'error');
4594
+
4595
+ return;
4596
+ }
4597
+
4598
+ wpmdb.migration_state_id = data.migration_state_id;
4599
+
4600
+ var i = 0;
4601
+
4602
+ // Set delay between requests - use max of local/remote values, 0 if doing export
4603
+ delay_between_requests = 0;
4604
+ if ('savefile' !== migration_intent && 'undefined' !== typeof wpmdb.common.connection_data && 'undefined' !== typeof wpmdb.common.connection_data.delay_between_requests || 'import' === migration_intent) {
4605
+ if ('import' === migration_intent) {
4606
+ delay_between_requests = wpmdb_data.delay_between_requests;
4607
+ } else {
4608
+ delay_between_requests = Math.max(parseInt(wpmdb_data.delay_between_requests), parseInt(wpmdb.common.connection_data.delay_between_requests));
4609
+ }
4610
+ }
4611
+
4612
+ if (-1 !== $.inArray(migration_intent, ['savefile', 'push', 'pull', 'find_replace'])) {
4613
+ wpmdb.common.next_step_in_migration = {
4614
+ fn: wpmdb.functions.migrate_table_recursive,
4615
+ args: ['-1', '']
4616
+ };
4617
+ wpmdb.functions.execute_next_step();
4618
+ }
4619
+
4620
+ $.wpmdb.do_action('wpmdb_migration_initiated', stage);
4621
+ }
4622
+
4623
+ }); // end ajax
4624
+ });
4625
+
4626
+ wpmdb.functions.update_migrate_button_text();
4627
+
4628
+ // close progress pop up once migration is completed
4629
+ $('body').on('click', '.close-progress-content-button', function (e) {
4630
+ hide_overlay();
4631
+ wpmdb.current_migration.restoreTitleElem();
4632
+ wpmdb.functions.maybe_reload_page();
4633
+ });
4634
+
4635
+ $('body').on('click', '#overlay', function (e) {
4636
+ if (true === migration_completed && e.target === this) {
4637
+ hide_overlay();
4638
+ wpmdb.current_migration.restoreTitleElem();
4639
+ wpmdb.functions.maybe_reload_page();
4640
+ }
4641
+ });
4642
+
4643
+ // AJAX save button profile
4644
+ $('.save-settings-button').click(function (event) {
4645
+ event.preventDefault();
4646
+ if ('' === $.trim($('.create-new-profile').val()) && $('#create_new').is(':checked')) {
4647
+ alert(wpmdb_strings.enter_name_for_profile);
4648
+ $('.create-new-profile').focus();
4649
+ return;
4650
+ }
4651
+ save_active_profile();
4652
+ });
4653
+
4654
+ // move around textarea depending on whether or not the push/pull options are selected
4655
+ move_connection_info_box();
4656
+
4657
+ $('.migrate-selection.option-group input[type=radio]').change(function () {
4658
+ move_connection_info_box();
4659
+ wpmdb.migration_selection = wpmdb.functions.wpmdb_migration_type();
4660
+ if (connection_established) {
4661
+ change_replace_values();
4662
+ }
4663
+ wpmdb.functions.update_migrate_button_text();
4664
+ });
4665
+
4666
+ // hide second section if pull or push is selected with no connection established
4667
+ if (('pull' === wpmdb.functions.wpmdb_migration_type() || 'push' === wpmdb.functions.wpmdb_migration_type()) && !connection_established) {
4668
+ $('.step-two').hide();
4669
+ $('.connection-status').show();
4670
+ }
4671
+
4672
+ // show / hide GUID helper description
4673
+ $('.general-helper').click(function (e) {
4674
+ e.preventDefault();
4675
+ var icon = $(this),
4676
+ bubble = $(this).next();
4677
+
4678
+ // Close any that are already open
4679
+ $('.helper-message').not(bubble).hide();
4680
+
4681
+ var position = icon.position();
4682
+ if (bubble.hasClass('bottom')) {
4683
+ var bubble_offset = 1;
4684
+
4685
+ if (true === bubble.hasClass('compatibility-help')) {
4686
+ bubble_offset = 6;
4687
+ } else if ($(this).is(':first-child')) {
4688
+ bubble_offset = 3;
4689
+ }
4690
+ bubble.css({
4691
+ 'left': position.left - bubble.width() / 2 - bubble_offset + 'px',
4692
+ 'top': position.top + icon.height() + 9 + 'px'
4693
+ });
4694
+ } else {
4695
+ bubble.css({
4696
+ 'left': position.left + icon.width() + 9 + 'px',
4697
+ 'top': position.top + icon.height() / 2 - 18 + 'px'
4698
+ });
4699
+ }
4700
+ bubble.toggle();
4701
+ e.stopPropagation();
4702
+ });
4703
+
4704
+ $('body').click(function () {
4705
+ $('.helper-message').hide();
4706
+ });
4707
+
4708
+ $('.helper-message').click(function (e) {
4709
+ e.stopPropagation();
4710
+ });
4711
+
4712
+ $('body').on('click', '.show-errors-toggle', function (e) {
4713
+ e.preventDefault();
4714
+ $(this).next('.migration-php-errors').toggle();
4715
+ });
4716
+
4717
+ // migrate / settings tabs
4718
+ $('.nav-tab').click(function () {
4719
+ var hash = $(this).attr('data-div-name');
4720
+ hash = hash.replace('-tab', '');
4721
+ window.location.hash = hash;
4722
+ switch_to_plugin_tab(hash, false);
4723
+ });
4724
+
4725
+ $('body').on('click', 'a[href^="#"]', function (event) {
4726
+ var href = $(event.target).attr('href');
4727
+ var tab_name = href.substr(1);
4728
+
4729
+ if (tab_name) {
4730
+ var nav_tab = $('.' + tab_name);
4731
+ if (1 === nav_tab.length) {
4732
+ nav_tab.trigger('click');
4733
+ event.preventDefault();
4734
+ }
4735
+ }
4736
+ });
4737
+
4738
+ // repeatable fields
4739
+ $('body').on('click', '.add-row', function () {
4740
+ var $parent_tr = $(this).parents('tr');
4741
+ $parent_tr.before($('.original-repeatable-field').clone().removeClass('original-repeatable-field'));
4742
+ $parent_tr.prev().find('.old-replace-col input').focus();
4743
+ });
4744
+
4745
+ // repeatable fields
4746
+ $('body').on('click', '.replace-remove-row', function () {
4747
+ $(this).parents('tr').remove();
4748
+ if (2 >= $('.replace-row').length) {
4749
+ $('.no-replaces-message').show();
4750
+ }
4751
+
4752
+ var prev_id = $(this).prev().attr('id');
4753
+ if ('new-url' === prev_id || 'new-path' === prev_id) {
4754
+ $('#' + prev_id + '-missing-warning').hide();
4755
+ }
4756
+ });
4757
+
4758
+ // Hide New URL & New Path Warnings on change.
4759
+ $('body').on('change', '#new-url', function () {
4760
+ $('#new-url-missing-warning').hide();
4761
+ }).on('change', '#new-path', function () {
4762
+ $('#new-path-missing-warning').hide();
4763
+ });
4764
+
4765
+ // Copy Find field to associated Replace field on arrow click.
4766
+ $('body').on('click', '.arrow-col', function () {
4767
+ var replace_row_arrow = this;
4768
+
4769
+ if ($(replace_row_arrow).hasClass('disabled')) {
4770
+ return;
4771
+ }
4772
+
4773
+ var original_value = $(replace_row_arrow).prev('td').find('input').val();
4774
+ var new_value_input = $(replace_row_arrow).next('td').find('input');
4775
+ new_value_input.val(original_value);
4776
+
4777
+ // Hide New URL or New Path Warning if changed.
4778
+ if ('new-url' === new_value_input.prop('id')) {
4779
+ $('#new-url-missing-warning').hide();
4780
+ } else if ('new-path' === new_value_input.prop('id')) {
4781
+ $('#new-path-missing-warning').hide();
4782
+ }
4783
+ });
4784
+
4785
+ $('.add-replace').click(function () {
4786
+ $('.replace-fields').prepend($('.original-repeatable-field').clone().removeClass('original-repeatable-field'));
4787
+ $('.no-replaces-message').hide();
4788
+ });
4789
+
4790
+ $('#find-and-replace-sort tbody').sortable({
4791
+ items: '> tr:not(.pin)',
4792
+ handle: 'td:first',
4793
+ start: function start() {
4794
+ $('.sort-handle').css('cursor', '-webkit-grabbing');
4795
+ $('.sort-handle').css('cursor', '-moz-grabbing');
4796
+ },
4797
+ stop: function stop() {
4798
+ $('.sort-handle').css('cursor', '-webkit-grab');
4799
+ $('.sort-handle').css('cursor', '-moz-grab');
4800
+ }
4801
+ });
4802
+
4803
+ var hash = '';
4804
+
4805
+ // check for hash in url (settings || migrate) switch tabs accordingly
4806
+ if (window.location.hash) {
4807
+ hash = window.location.hash.substring(1);
4808
+ switch_to_plugin_tab(hash, false);
4809
+ }
4810
+
4811
+ if ('' !== get_query_var('install-plugin')) {
4812
+ hash = 'addons';
4813
+ checked_licence = true;
4814
+ switch_to_plugin_tab(hash, true);
4815
+ }
4816
+
4817
+ // process notice links clicks, eg. dismiss, reminder
4818
+ $('.notice-link').click(function (e) {
4819
+ e.preventDefault();
4820
+
4821
+ // process notice links clicks, eg. dismiss, reminder
4822
+ wpmdb.functions.ajax_handle_dismissible_notice(wpmdb_data.nonces.process_notice_link, function (ele) {
4823
+ $(ele).closest('.inline-message').hide();
4824
+ }, $(this));
4825
+ });
4826
+
4827
+ // When read-only connection info is copied, convert it to one line
4828
+ $('#connection_info').on('copy', function (e) {
4829
+ var $this = $(this);
4830
+
4831
+ // Test for two lines
4832
+ var lines = $this.val().split('\n');
4833
+ if (2 === lines.length) {
4834
+
4835
+ // Wrapping in a try in case there's no browser support
4836
+ try {
4837
+
4838
+ // Combine the two lines into one
4839
+ e.originalEvent.clipboardData.setData('text/plain', lines.join(' '));
4840
+ e.preventDefault(); // Default behaviour is to copy any selected text
4841
+ } catch (err) {
4842
+
4843
+ // Do nothing. Allow normal copying
4844
+ }
4845
+ }
4846
+ });
4847
+
4848
+ // regenerates the saved secret key
4849
+ $('.reset-api-key').click(function () {
4850
+ var answer = confirm(wpmdb_strings.reset_api_key);
4851
+
4852
+ if (!answer || doing_reset_api_key_ajax) {
4853
+ return;
4854
+ }
4855
+
4856
+ doing_reset_api_key_ajax = true;
4857
+ $('.reset-api-key').after('<img src="' + spinner_url + '" alt="" class="reset-api-key-ajax-spinner general-spinner" />');
4858
+
4859
+ $.ajax({
4860
+ url: ajaxurl,
4861
+ type: 'POST',
4862
+ dataType: 'text',
4863
+ cache: false,
4864
+ data: {
4865
+ action: 'wpmdb_reset_api_key',
4866
+ nonce: wpmdb_data.nonces.reset_api_key
4867
+ },
4868
+ error: function error(jqXHR, textStatus, errorThrown) {
4869
+ alert(wpmdb_strings.reset_api_key_problem);
4870
+ $('.reset-api-key-ajax-spinner').remove();
4871
+ doing_reset_api_key_ajax = false;
4872
+ },
4873
+ success: function success(data) {
4874
+ $('.reset-api-key-ajax-spinner').remove();
4875
+ doing_reset_api_key_ajax = false;
4876
+ $('.connection-info').html(data);
4877
+ wpmdb_data.connection_info = $.trim(data).split('\n');
4878
+ }
4879
+ });
4880
+ });
4881
+
4882
+ // Copy the connection info to the clipboard
4883
+ $('.copy-api-key').click(function () {
4884
+
4885
+ var $el = $(this);
4886
+
4887
+ // Get connection_info input
4888
+ var $connection_info = $('#connection_info');
4889
+
4890
+ // Get the connection info
4891
+ var two_lines = $connection_info.val();
4892
+
4893
+ // Make it one line, if it's two
4894
+ var one_line = two_lines.replace('\n', ' ');
4895
+
4896
+ // Replace two lines with one
4897
+ $connection_info.val(one_line);
4898
+
4899
+ // Select the input val
4900
+ $connection_info.select();
4901
+
4902
+ try {
4903
+
4904
+ // Copy connection_info
4905
+ document.execCommand('copy');
4906
+
4907
+ // Unselect connection_info input
4908
+ $connection_info.blur();
4909
+
4910
+ // show confirmation
4911
+ $el.css('color', 'transparent');
4912
+ var $confirmation = $('.copy-api-key-confirmation').show();
4913
+
4914
+ // fadeout confirmation
4915
+ setTimeout(function () {
4916
+ $confirmation.fadeOut('fast');
4917
+ setTimeout(function () {
4918
+ $el.css('color', '');
4919
+ }, 200);
4920
+ }, 1000);
4921
+ } catch (err) {
4922
+ alert('please press Ctrl/Cmd+C to copy');
4923
+ }
4924
+
4925
+ // Replace the input val with the two lines
4926
+ $connection_info.val(two_lines);
4927
+ });
4928
+
4929
+ $('input[name=table_migrate_option]').change(function () {
4930
+ $('.select-tables-wrap').hide();
4931
+
4932
+ if ('migrate_select' === $(this).val()) {
4933
+ $('.select-tables-wrap').show();
4934
+ }
4935
+ });
4936
+
4937
+ $('.show-multiselect').each(function () {
4938
+ if ($(this).is(':checked')) {
4939
+ $(this).parents('.option-section').children('.header-expand-collapse').children('.expand-collapse-arrow').removeClass('collapsed');
4940
+ $(this).parents('.expandable-content').show();
4941
+ $(this).parents('.expandable-content').children('.select-wrap').toggle();
4942
+ }
4943
+ });
4944
+
4945
+ $('input[name=backup_option]').change(function () {
4946
+ $('.backup-tables-wrap').hide();
4947
+ if ('backup_manual_select' === $(this).val()) {
4948
+ $('.backup-tables-wrap').show();
4949
+ }
4950
+ });
4951
+
4952
+ if ($('#backup-manual-select').is(':checked')) {
4953
+ $('.backup-tables-wrap').show();
4954
+ }
4955
+
4956
+ $('.plugin-compatibility-save').click(function () {
4957
+ if (doing_plugin_compatibility_ajax) {
4958
+ return;
4959
+ }
4960
+ $(this).addClass('disabled');
4961
+ var select_element = $('#selected-plugins');
4962
+ $(select_element).attr('disabled', 'disabled');
4963
+
4964
+ $('.plugin-compatibility-success-msg').remove();
4965
+
4966
+ doing_plugin_compatibility_ajax = true;
4967
+ $(this).after('<img src="' + spinner_url + '" alt="" class="plugin-compatibility-spinner general-spinner" />');
4968
+
4969
+ $.ajax({
4970
+ url: ajaxurl,
4971
+ type: 'POST',
4972
+ dataType: 'text',
4973
+ cache: false,
4974
+ data: {
4975
+ action: 'wpmdb_whitelist_plugins',
4976
+ whitelist_plugins: $(select_element).val(),
4977
+ nonce: wpmdb_data.nonces.whitelist_plugins
4978
+ },
4979
+ error: function error(jqXHR, textStatus, errorThrown) {
4980
+ alert(wpmdb_strings.blacklist_problem + '\r\n\r\n' + wpmdb_strings.status + ' ' + jqXHR.status + ' ' + jqXHR.statusText + '\r\n\r\n' + wpmdb_strings.response + '\r\n' + jqXHR.responseText);
4981
+ $(select_element).removeAttr('disabled');
4982
+ $('.plugin-compatibility-save').removeClass('disabled');
4983
+ doing_plugin_compatibility_ajax = false;
4984
+ $('.plugin-compatibility-spinner').remove();
4985
+ },
4986
+ success: function success(data) {
4987
+ if ('' !== $.trim(data)) {
4988
+ alert(data);
4989
+ }
4990
+ $(select_element).removeAttr('disabled');
4991
+ $('.plugin-compatibility-save').removeClass('disabled');
4992
+ doing_plugin_compatibility_ajax = false;
4993
+ $('.plugin-compatibility-spinner').remove();
4994
+ $('.plugin-compatibility-save').after('<span class="plugin-compatibility-success-msg">' + wpmdb_strings.saved + '</span>');
4995
+ $('.plugin-compatibility-success-msg').fadeOut(2000);
4996
+ }
4997
+ });
4998
+ });
4999
+
5000
+ // delete a profile from the migrate form area
5001
+ $('body').on('click', '.delete-profile', function () {
5002
+ var name = $(this).next().clone();
5003
+ $('input', name).remove();
5004
+ name = $.trim($(name).html());
5005
+ var answer = confirm(wpmdb_strings.remove_profile.replace('{{profile}}', name));
5006
+
5007
+ if (!answer) {
5008
+ return;
5009
+ }
5010
+ var $profile_li = $(this).parent();
5011
+
5012
+ if ($profile_li.find('input:checked').length) {
5013
+ var $new_profile_li = $profile_li.siblings().last();
5014
+ $new_profile_li.find('input[type=radio]').prop('checked', 'checked');
5015
+ $new_profile_li.find('input[type=text]').focus();
5016
+ $('#migrate-form .crumbs .crumb:last').text('New Profile');
5017
+
5018
+ if ('function' === typeof window.history.pushState) {
5019
+ var updated_url = window.location.href.replace('#migrate', '').replace(/&wpmdb-profile=-?\d+/, '') + '&wpmdb-profile=-1';
5020
+ window.history.pushState({ updated_profile_id: -1 }, null, updated_url);
5021
+ }
5022
+ }
5023
+
5024
+ $profile_li.fadeOut(500);
5025
+
5026
+ $.ajax({
5027
+ url: ajaxurl,
5028
+ type: 'POST',
5029
+ dataType: 'text',
5030
+ cache: false,
5031
+ data: {
5032
+ action: 'wpmdb_delete_migration_profile',
5033
+ profile_id: $(this).attr('data-profile-id'),
5034
+ nonce: wpmdb_data.nonces.delete_migration_profile
5035
+ },
5036
+ error: function error(jqXHR, textStatus, errorThrown) {
5037
+ alert(wpmdb_strings.remove_profile_problem);
5038
+ },
5039
+ success: function success(data) {
5040
+ if ('-1' === data) {
5041
+ alert(wpmdb_strings.remove_profile_not_found);
5042
+ }
5043
+ }
5044
+ });
5045
+ });
5046
+
5047
+ // deletes a profile from the main profile selection screen
5048
+ $('.main-list-delete-profile-link').click(function () {
5049
+ var name = $(this).prev().html();
5050
+ var answer = confirm(wpmdb_strings.remove_profile.replace('{{profile}}', name));
5051
+
5052
+ if (!answer) {
5053
+ return;
5054
+ }
5055
+
5056
+ $(this).parent().fadeOut(500);
5057
+
5058
+ $.ajax({
5059
+ url: ajaxurl,
5060
+ type: 'POST',
5061
+ dataType: 'text',
5062
+ cache: false,
5063
+ data: {
5064
+ action: 'wpmdb_delete_migration_profile',
5065
+ profile_id: $(this).attr('data-profile-id'),
5066
+ nonce: wpmdb_data.nonces.delete_migration_profile
5067
+ },
5068
+ error: function error(jqXHR, textStatus, errorThrown) {
5069
+ alert(wpmdb_strings.remove_profile_problem);
5070
+ }
5071
+ });
5072
+ });
5073
+
5074
+ // warn the user when editing the connection info after a connection has been established
5075
+ $('body').on('click', '.temp-disabled', function () {
5076
+ var answer = confirm(wpmdb_strings.change_connection_info);
5077
+
5078
+ if (answer) {
5079
+ $('.ssl-notice').hide();
5080
+ $('.different-plugin-version-notice').hide();
5081
+ $('.migrate-db-button').show();
5082
+ $('.temp-disabled').removeAttr('readonly');
5083
+ $('.temp-disabled').removeClass('temp-disabled');
5084
+ $('.connect-button').show();
5085
+ $('.step-two').hide();
5086
+ $('.connection-status').show().html(wpmdb_strings.enter_connection_info);
5087
+ connection_established = false;
5088
+ }
5089
+ });
5090
+
5091
+ // ajax request for settings page when checking/unchecking setting radio buttons
5092
+ $('.settings-tab input[type=checkbox]').change(function () {
5093
+ if ('plugin-compatibility' === $(this).attr('id')) {
5094
+ return;
5095
+ }
5096
+ var checked = $(this).is(':checked');
5097
+ var setting = $(this).attr('id');
5098
+ var $status = $(this).closest('td').next('td').find('.setting-status');
5099
+
5100
+ $('.ajax-success-msg').remove();
5101
+ $status.after(ajax_spinner);
5102
+
5103
+ $.ajax({
5104
+ url: ajaxurl,
5105
+ type: 'POST',
5106
+ dataType: 'text',
5107
+ cache: false,
5108
+ data: {
5109
+ action: 'wpmdb_save_setting',
5110
+ checked: checked,
5111
+ setting: setting,
5112
+ nonce: wpmdb_data.nonces.save_setting
5113
+ },
5114
+ error: function error(jqXHR, textStatus, errorThrown) {
5115
+ alert(wpmdb_strings.save_settings_problem);
5116
+ $('.ajax-spinner').remove();
5117
+ },
5118
+ success: function success(data) {
5119
+ $('.ajax-spinner').remove();
5120
+ $status.append('<span class="ajax-success-msg">' + wpmdb_strings.saved + '</span>');
5121
+ $('.ajax-success-msg').fadeOut(2000, function () {
5122
+ $(this).remove();
5123
+ });
5124
+ }
5125
+ });
5126
+ });
5127
+
5128
+ // disable form submissions
5129
+ $('.migrate-form').submit(function (e) {
5130
+ e.preventDefault();
5131
+ });
5132
+
5133
+ // fire connection_box_changed when the connect button is pressed
5134
+ $('.connect-button').click(function (event) {
5135
+ event.preventDefault();
5136
+ $(this).blur();
5137
+ wpmdb.functions.connection_box_changed();
5138
+ });
5139
+
5140
+ // send paste even to connection_box_changed() function
5141
+ $('.pull-push-connection-info').bind('paste', function (e) {
5142
+ var $this = this;
5143
+ setTimeout(function () {
5144
+ wpmdb.functions.connection_box_changed();
5145
+ }, 0);
5146
+ });
5147
+
5148
+ $('body').on('click', '.try-again', function () {
5149
+ $('.pull-push-connection-info').removeClass('temp-disabled');
5150
+ wpmdb.functions.connection_box_changed();
5151
+ });
5152
+
5153
+ $('body').on('click', '.try-http', function () {
5154
+ var connection_info = $.trim($('.pull-push-connection-info').val()).split('\n');
5155
+ var new_url = connection_info[0].replace('https', 'http');
5156
+ var new_contents = new_url + '\n' + connection_info[1];
5157
+ $('.pull-push-connection-info').val(new_contents);
5158
+ wpmdb.functions.connection_box_changed();
5159
+ });
5160
+
5161
+ $('.create-new-profile').change(function () {
5162
+ profile_name_edited = true;
5163
+ });
5164
+
5165
+ $('body').on('click', '.temporarily-disable-ssl', function () {
5166
+ var hash = '';
5167
+ if (window.location.hash) {
5168
+ hash = window.location.hash.substring(1);
5169
+ }
5170
+ $(this).attr('href', $(this).attr('href') + '&hash=' + hash);
5171
+ });
5172
+
5173
+ // Sets the initial Pause/Resume button event to Pause
5174
+ $('body').on('click', '.pause-resume', function (event) {
5175
+ set_pause_resume_button(event);
5176
+ });
5177
+
5178
+ $('body').on('click', '.cancel', function (event) {
5179
+ cancel_migration(event);
5180
+ });
5181
+
5182
+ $('.enter-licence').click(function () {
5183
+ $('.settings').click();
5184
+ $('.licence-input').focus();
5185
+ });
5186
+
5187
+ $('body').on('click', '.copy-licence-to-remote-site', function () {
5188
+ $('.connection-status').html(wpmdb_strings.copying_license);
5189
+ $('.connection-status').removeClass('notification-message error-notice migration-error');
5190
+ $('.connection-status').append(ajax_spinner);
5191
+
5192
+ var connection_info = $.trim($('.pull-push-connection-info').val()).split('\n');
5193
+
5194
+ doing_ajax = true;
5195
+ disable_export_type_controls();
5196
+
5197
+ $.ajax({
5198
+ url: ajaxurl,
5199
+ type: 'POST',
5200
+ dataType: 'json',
5201
+ cache: false,
5202
+ data: {
5203
+ action: 'wpmdb_copy_licence_to_remote_site',
5204
+ url: connection_info[0],
5205
+ key: connection_info[1],
5206
+ nonce: wpmdb_data.nonces.copy_licence_to_remote_site
5207
+ },
5208
+ error: function error(jqXHR, textStatus, errorThrown) {
5209
+ $('.connection-status').html(get_ajax_errors(jqXHR.responseText, '(#143)', jqXHR));
5210
+ $('.connection-status').addClass('notification-message error-notice migration-error');
5211
+ $('.ajax-spinner').remove();
5212
+ doing_ajax = false;
5213
+ enable_export_type_controls();
5214
+ },
5215
+ success: function success(data) {
5216
+ $('.ajax-spinner').remove();
5217
+ doing_ajax = false;
5218
+ enable_export_type_controls();
5219
+
5220
+ if ('undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error) {
5221
+ $('.connection-status').html(data.body);
5222
+ $('.connection-status').addClass('notification-message error-notice migration-error');
5223
+
5224
+ if (data.body.indexOf('401 Unauthorized') > -1) {
5225
+ $('.basic-access-auth-wrapper').show();
5226
+ }
5227
+
5228
+ return;
5229
+ }
5230
+ wpmdb.functions.connection_box_changed();
5231
+ }
5232
+ });
5233
+ });
5234
+
5235
+ $('body').on('click', '.reactivate-licence', function (e) {
5236
+ doing_ajax = true;
5237
+
5238
+ $('.invalid-licence').empty().html(wpmdb_strings.attempting_to_activate_licence);
5239
+ $('.invalid-licence').append(ajax_spinner);
5240
+
5241
+ $.ajax({
5242
+ url: ajaxurl,
5243
+ type: 'POST',
5244
+ dataType: 'json',
5245
+ cache: false,
5246
+ data: {
5247
+ action: 'wpmdb_reactivate_licence',
5248
+ nonce: wpmdb_data.nonces.reactivate_licence
5249
+ },
5250
+ error: function error(jqXHR, textStatus, errorThrown) {
5251
+ $('.invalid-licence').html(wpmdb_strings.activate_licence_problem);
5252
+ $('.invalid-licence').append('<br /><br />' + wpmdb_strings.status + ': ' + jqXHR.status + ' ' + jqXHR.statusText + '<br /><br />' + wpmdb_strings.response + '<br />' + jqXHR.responseText);
5253
+ $('.ajax-spinner').remove();
5254
+ doing_ajax = false;
5255
+ },
5256
+ success: function success(data) {
5257
+ $('.ajax-spinner').remove();
5258
+ doing_ajax = false;
5259
+
5260
+ if ('undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error) {
5261
+ $('.invalid-licence').html(data.body);
5262
+ return;
5263
+ }
5264
+
5265
+ if ('undefined' !== typeof data.wpmdb_dbrains_api_down && 1 === data.wpmdb_dbrains_api_down) {
5266
+ $('.invalid-licence').html(wpmdb_strings.temporarily_activated_licence);
5267
+ $('.invalid-licence').append(data.body);
5268
+ return;
5269
+ }
5270
+
5271
+ $('.invalid-licence').empty().html(wpmdb_strings.licence_reactivated);
5272
+ location.reload();
5273
+ }
5274
+ });
5275
+ });
5276
+
5277
+ $('input[name=table_migrate_option]').change(function () {
5278
+ maybe_show_mixed_cased_table_name_warning();
5279
+ $.wpmdb.do_action('wpmdb_tables_to_migrate_changed');
5280
+ });
5281
+
5282
+ $('body').on('change', '#select-tables', function () {
5283
+ maybe_show_mixed_cased_table_name_warning();
5284
+ $.wpmdb.do_action('wpmdb_tables_to_migrate_changed');
5285
+ });
5286
+
5287
+ $.wpmdb.add_filter('wpmdb_get_table_prefix', get_table_prefix);
5288
+ $.wpmdb.add_filter('wpmdb_get_tables_to_migrate', wpmdb.functions.get_tables_to_migrate);
5289
+ $.wpmdb.add_action('wpmdb_lock_replace_url', lock_replace_url);
5290
+ $.wpmdb.add_action('wpmdb_pin_replace_url', pin_replace_url);
5291
+ $.wpmdb.add_action('move_connection_info_box', wpmdb.functions.exclude_post_types_warning);
5292
+
5293
+ $.wpmdb.add_filter('wpmdb_before_migration_complete_hooks', function (hooks) {
5294
+ pause_before_finalize = !!$('input[name=pause_before_finalize]:checked').length;
5295
+ if (true === pause_before_finalize && 'savefile' !== migration_intent) {
5296
+ set_pause_resume_button(null); // don't just set migration_paused to true, since `set_pause_resume_button` will get double bound to clicking resume
5297
+ is_auto_pause_before_finalize = true;
5298
+ }
5299
+ return hooks;
5300
+ });
5301
+
5302
+ $('.wpmdb-switch').on('click', function (e) {
5303
+ if (!$(this).hasClass('disabled')) {
5304
+ set_checkbox($(this).attr('id'));
5305
+ }
5306
+ });
5307
+ });
5308
+ })(jQuery, wpmdb);
5309
+
5310
+ },{"MigrationProgress-controller":6}]},{},[1,2,3,4,5,12,13,14]);
asset/dist/js/script-102.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function e(t,i,n){function a(s,r){if(!i[s]){if(!t[s]){var c="function"==typeof require&&require;if(!r&&c)return c(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var p=i[s]={exports:{}};t[s][0].call(p.exports,function(e){var i=t[s][1][e];return a(i||e)},p,p.exports,e,t,i,n)}return i[s].exports}for(var o="function"==typeof require&&require,s=0;s<n.length;s++)a(n[s]);return a}({1:[function(e,t,i){"use strict";window.wpmdb=window.wpmdb||{},wpmdb.common={hooks:[],call_stack:[],non_fatal_errors:"",migration_error:!1},wpmdb.functions={},wpmdb.functions.wpmdb_toggle_migration_action_text=function(){jQuery(".action-text").hide(),jQuery(".action-text."+jQuery("input[name=action]:checked").val()).show()},wpmdb.functions.wpmdb_migration_type=function(){var e=jQuery("input[name=action]:checked");return 0===e.length?"":e.val()},wpmdb.functions.wpmdb_call_next_hook=function(){wpmdb.common.call_stack.length||(wpmdb.common.call_stack=wpmdb.common.hooks);var e=wpmdb.common.call_stack[0];wpmdb.common.call_stack.shift(),e.call(this)},wpmdb.functions.wpmdb_add_commas=function(e){for(var t=(e+="").split("."),i=t[0],n=1<t.length?"."+t[1]:"",a=/(\d+)(\d{3})/;a.test(i);)i=i.replace(a,"$1,$2");return i+n},wpmdb.functions.wpmdb_parse_json=function(e){var t={};try{t=jQuery.parseJSON(e)}catch(e){return!1}return t},wpmdb.functions.wpmdbGetAjaxErrors=function(e,t,i,n){var a=!1,o="";if(!1===wpmdb.functions.wpmdb_parse_json(i)){a=!0,e=wpmdb_strings.ajax_json_message,t="(#144)";var s=i;i=wpmdb_strings.ajax_json_errors+" "+t,i+='<br><a class="show-errors-toggle" href="#">'+wpmdb_strings.view_error_messages+"</a> ",i+='<div class="migration-php-errors">'+s+"</div>"}return(a||"undefined"!==n)&&(o+="<strong>"+e+"</strong> &mdash; "),a||"undefined"===n||(o+=wpmdb_strings.status+": "+n.status+" "+n.statusText,o+="<br /><br />"+wpmdb_strings.response+":<br />"),a||(i+=" "+t),o+=i},wpmdb.preg_quote=function(e,t){return String(e).replace(new RegExp("[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\"+(t||"")+"-]","g"),"\\$&")},wpmdb.table_is=function(e,t,i){if((e+t).toLowerCase()===i.toLowerCase())return!0;var n=wpmdb.preg_quote(i);return null!=new RegExp(e+"([0-9]+)_"+t,"i").exec(n)},wpmdb.subsite_for_table=function(e,t){var i=wpmdb.preg_quote(t),n=new RegExp(e+"([0-9]+)_","i").exec(i);return null===n?1:n[1]},wpmdb.functions.convertKBSizeToHR=function(e,t,i,n){var a,o;if(i=i||1e3,t=t||2,e=parseInt(e),i>Math.abs(e))a=[e.toFixed(0),"KB"];else{o=["MB","GB","TB","PB","EB","ZB","YB"];var s=-1;do{e/=i,++s}while(Math.abs(e)>=i&&s<o.length-1);a=[Math.round(e*Math.pow(10,t))/Math.pow(10,t),o[s]]}return n||(a=a[0]+" "+a[1]),a},wpmdb.functions.convertKBSizeToHRFixed=function(e,t,i){t=t||2;var n=wpmdb.functions.convertKBSizeToHR(e,t,i,!0);return"KB"!==n[1]?n[0].toFixed(2)+" "+n[1]:n[0]+" "+n[1]},wpmdb.functions.ajax_handle_dismissible_notice=function(e,t,i){jQuery.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_process_notice_link",nonce:e,notice:jQuery(i).data("notice"),type:jQuery(i).data("type"),reminder:jQuery(i).data("reminder")},beforeSend:t(i)})},wpmdb.functions.get_spinner_url=function(){var e=ajaxurl.replace("/admin-ajax.php","")+"/images/spinner";return 2<window.devicePixelRatio&&(e+="-2x"),e+=".gif"}},{}],2:[function(e,t,i){"use strict";var n;0<(n=jQuery)(".wpmdb-compat-plugin-row-error").length&&n('[data-slug="wp-migrate-db-pro"]').addClass("wpmdbpro-has-message"),n(".wpmdbpro-custom").prev().addClass("update"),n(".notice-link-plugins-page").click(function(e){e.preventDefault();var t=jQuery(this);wpmdb.functions.ajax_handle_dismissible_notice(wpmdb_nonces.process_notice_link,function(e){n(e).closest(".wpmdbpro-custom").hide(),n(e).closest("tr").siblings("tr.wpmdbpro-has-message").removeClass("wpmdbpro-has-message")},t),n(".wpmdbpro-custom").prev().removeClass("update")})},{}],3:[function(e,t,i){"use strict";jQuery.wpmdb={hooks:{action:{},filter:{}},add_action:function(e,t,i){jQuery.wpmdb.add_hook("action",e,t,i)},add_filter:function(e,t,i){jQuery.wpmdb.add_hook("filter",e,t,i)},do_action:function(e,t){jQuery.wpmdb.do_hook("action",e,null,t)},apply_filters:function(e,t,i){return jQuery.wpmdb.do_hook("filter",e,t,i)},remove_action:function(e,t){jQuery.wpmdb.remove_hook("action",e,t)},remove_filter:function(e,t){jQuery.wpmdb.remove_hook("filter",e,t)},add_hook:function(e,t,i,n){void 0===jQuery.wpmdb.hooks[e][t]&&(jQuery.wpmdb.hooks[e][t]=[]);var a=jQuery.wpmdb.hooks[e][t];void 0===n&&(n=t+"_"+a.length),jQuery.wpmdb.hooks[e][t].push({tag:n,callable:i})},do_hook:function(e,t,i,n){if(void 0!==jQuery.wpmdb.hooks[e][t])for(var a=jQuery.wpmdb.hooks[e][t],o=0;o<a.length;o++)"action"===e?a[o].callable(n):i=a[o].callable(i,n);if("filter"===e)return i},remove_hook:function(e,t,i){if(void 0!==jQuery.wpmdb.hooks[e][t])for(var n=jQuery.wpmdb.hooks[e][t],a=n.length-1;0<a;a--)void 0!==i&&i!==n[a].tag||n.splice(a,1)}}},{}],4:[function(e,t,i){"use strict";window.wpmdb=window.wpmdb||{},function(e,t){var i=!1,n=e("#select-tables").clone(),a=[],o=[],s=!1,r="",c={},l='<img src="'+t.functions.get_spinner_url()+'" alt="" class="ajax-spinner general-spinner" />';function p(){var t=e(".find-replace-rows");return e("#import-find-replace").is(":checked")?t.show():t.hide()}e.wpmdb.add_filter("wpmdb_get_migration_status_label",function(e,t){return"import"===t.intent&&(e="completed"===t.stage?wpmdb_strings.import_label_completed:wpmdb_strings.import_label_migrating),e}),e.wpmdb.add_action("move_connection_info_box",function(t){var n=e(".import-file-status");"import"===t.migration_type?(i?s&&e(".unrecognized-import-file-notice").show():(e(".step-two").hide(),n.hasClass("profile-loaded")?(n.attr("class","import-file-status profile-loaded notification-message success-notice"),n.html(wpmdb_strings.import_profile_loaded)):n.html(wpmdb_strings.please_select_sql_file),n.show()),p(),e(".mst-options").hide(),e(".import-find-replace-option, .import-active-plugin-option").show()):(e('.find-replace-rows, .table-options, .advanced-options, .exclude-post-types-options, label[for="backup-selected"]').show(),e(".import-find-replace-option, .find-replace-options, .import-file-status, .import-active-plugin-option, .unrecognized-import-file-notice").hide(),"search_all_imported"===e("input[name=table_migrate_option]:checked").val()&&e("input[name=table_migrate_option][value=migrate_only_with_prefix]").prop("checked",!0))}),e.wpmdb.add_action("wpmdb_migration_initiated",function(e){"import"===t.functions.wpmdb_migration_type()&&("backup"===e&&t.common.hooks.push(t.functions.migrate_table_recursive),t.common.hooks.push(t.functions.upload_file_recursive),t.common.next_step_in_migration={fn:t.functions.wpmdb_call_next_hook},t.functions.execute_next_step())}),e.wpmdb.add_action("wpmdb_update_import_table_select",function(){e("#select-tables").remove(),e(".select-tables-wrap").prepend(n),e("#select-tables").change()}),e.wpmdb.add_filter("wpmdb_backup_selected_tables",function(e){return"import"===t.functions.wpmdb_migration_type()&&(e=o),e}),e.wpmdb.add_action("wpmdb_add_migration_stages",function(i){"import"===t.functions.wpmdb_migration_type()&&(t.current_migration.model.addStage("upload",[],"local",{strings:{stage_title:wpmdb_strings.upload}}),t.current_migration.model.addStage("import",[],"local",{strings:{stage_title:wpmdb_strings.migrate_button_import}}),e("#import-find-replace").is(":checked")&&(a=i.tables_to_migrate,t.current_migration.model.addStage("find_replace",[],"local",{strings:{migrated:wpmdb_strings.searched,stage_title:wpmdb_strings.migrate_button_find_replace}})))}),e.wpmdb.add_filter("wpmdb_initiate_migration_request_data",function(e){return"import"===t.functions.wpmdb_migration_type()&&(e.import_info=c),e}),e("#import-file").on("change",function(a){var d=a.target.files,m=d[0],u=new FileReader,_=e(".import-file-status"),g=e('label[for="backup-selected"]'),f=e(".prefix-notice"),b=e(".unrecognized-import-file-notice"),h=e(".step-two"),w=e("#old-url"),v=e("#old-path"),y=e("#new-url"),x=e("#new-path");if(_.hide().attr("class","import-file-status"),f.hide(),b.hide(),h.hide(),e(".mst-required ").hide(),d.length){if(".sql"!==m.name.slice(-4)&&".sql.gz"!==m.name.slice(-7))return _.addClass("notification-message error-notice migration-error").text(wpmdb_strings.invalid_sql_file).show(),void h.hide();i=!0,r="",_.text(wpmdb_strings.parsing_sql_file).append(l).show(),u.onloadend=function(i){i.target.readyState===FileReader.DONE&&e.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_get_import_info",file_data:i.target.result,nonce:wpmdb_data.nonces.import_file},error:function(e,t,i){console.log(e,t,i)},success:function(i){if(e(".ajax-spinner").remove(),_.hide(),!0!==t.functions.maybe_show_mst_warning(i))if(h.show(),void 0!==i.wpmdb_error&&1===i.wpmdb_error)_.text(i.body).addClass("notification-message error-notice migration-error").show(),h.hide();else{var a=t.functions.get_localStorage_form_data();if(c=i,void 0!==i.prefix&&(r=i.prefix,e(".table-prefix").text(i.prefix),t.functions.maybe_show_prefix_notice(i.prefix)),void 0!==i.tables){o=i.tables,g.show(),a||(w.val(t.functions.remove_protocol(i.URL)),v.val(i.path),y.val(t.functions.remove_protocol(wpmdb_data.this_url)),x.val(wpmdb_data.this_path));var l=[],d=[];if(a?(l=a.select_tables,d=a.select_post_types,t.functions.remove_localStorage_form_data()):"migrate_only_with_prefix"!==e("input[name=table_migrate_option]:checked").val()||_.hasClass("profile-loaded")||e("input[name=table_migrate_option][value=search_all_imported]").prop("checked",!0),!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_tables&&(l=wpmdb_loaded_tables,d=wpmdb_loaded_post_types),n=t.functions.create_table_select(i.tables,[],l),e.wpmdb.do_action("wpmdb_update_import_table_select"),void 0!==i.post_types){var m=document.createElement("select");e(m).attr({multiple:"multiple",name:"select_post_types[]",id:"select-post-types",class:"multiselect"}),e.each(i.post_types,function(t,i){var n=e.inArray(i,d);n=-1!==n||!0===wpmdb_convert_exclude_revisions&&"revision"!==i;var a=document.createElement("option");a.value=i,a.text=i,a.selected=n,m.add(a,null)}),e("#select-post-types").remove(),e(".exclude-post-types-warning").after(m)}s&&(s=!1,p())}else b.show(),g.hide(),e(".table-options").hide(),s=!0,y.val(w.val()),x.val(v.val()),w.val(""),v.val("")}}})};var k=m.slice(0,1024e3);u.readAsDataURL(k)}else i&&(h.hide(),_.text(wpmdb_strings.please_select_sql_file).show(),i=!1)}),e("#import-find-replace").on("click",p),e(".find-replace-options-toggle").on("click",function(){s&&setTimeout(function(){e(".find-replace-options-toggle .expand-collapse-arrow").hasClass("collapsed")||e(".table-options").hide()},1)}),e("input[name=keep_active_plugins]").on("click",function(){e("input[name=keep_active_plugins]").prop("checked",e(this).is(":checked"))}),t.functions.upload_file_recursive=function(i){i=void 0===i?0:i;var n=document.getElementById("import-file").files[0],a=1024e3,o=i+a+1,s=new FileReader;0===i&&t.current_migration.model.addStageItem("upload",n.name,n.size/1e3,Math.ceil(n.size/a)),s.onloadend=function(s){s.target.readyState===FileReader.DONE&&e.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_upload_file",file_data:s.target.result,file:n.name,file_type:n.type,migration_state_id:t.migration_state_id,stage:"import",import_info:c,nonce:wpmdb_data.nonces.import_file},error:function(e,i,n){console.log(e,i,n),t.common.migration_error=!0,t.functions.migration_complete_events()},success:function(e){if(t.current_migration.setText(),void 0!==e.wpmdb_error&&1===e.wpmdb_error)return t.common.migration_error=!0,t.functions.migration_complete_events(),void t.current_migration.setState(wpmdb_strings.migration_failed,e.body,"error");var s=i+a;t.current_migration.setText(wpmdb_strings.uploading_file_to_server),t.current_migration.model.getStageModel("upload").setItemRowsTransferred(n.name,Math.ceil(s/a)),o<n.size?t.common.next_step_in_migration={fn:t.functions.upload_file_recursive,args:[o]}:t.common.next_step_in_migration={fn:t.functions.upload_import_successful,args:[n]},t.functions.execute_next_step()}})};var r=n.slice(i,o);s.readAsDataURL(r)},t.functions.upload_import_successful=function(i){e.ajax({type:"POST",url:ajaxurl,data:{action:"wpmdb_prepare_import_file",migration_state_id:t.migration_state_id,nonce:wpmdb_data.nonces.import_file},dataType:"json",error:function(e,i,n){console.log(e,i,n),t.common.migration_error=!0,t.functions.migration_complete_events()},success:function(e){var n=i.name,a=wpmdb_strings.importing_file_to_db;".gz"===n.slice(-3)&&(n=i.name.slice(0,-3)),a=a.replace(/\%s\s?/,n),t.current_migration.setText(a),t.current_migration.model.addStageItem("import",n,e.import_size/1e3,e.num_chunks),t.current_migration.model.setActiveStage("import"),t.common.next_step_in_migration={fn:t.functions.import_file_recursive,args:[{import_filename:e.import_file,item_name:n,chunk:0,current_query:""}]},t.functions.execute_next_step()}})},t.functions.import_file_recursive=function(i){e.ajax({type:"POST",url:ajaxurl,data:{action:"wpmdb_import_file",migration_state_id:t.migration_state_id,chunk:i.chunk,current_query:i.current_query,import_file:i.import_filename,nonce:wpmdb_data.nonces.import_file},dataType:"json",error:function(e,i,n){console.log(e,i,n),t.common.migration_error=!0,t.functions.migration_complete_events()},success:function(n){if(void 0!==n.wpmdb_error&&1===n.wpmdb_error)return t.common.migration_error=!0,t.functions.migration_complete_events(),void t.current_migration.setState(wpmdb_strings.migration_failed,n.body,"error");if(t.current_migration.model.getStageModel("import").setItemRowsTransferred(i.item_name,n.chunk),n.chunk>=n.num_chunks){if(t.current_migration.model.getStageModel("import").setItemRowsTransferred(i.item_name,++n.chunk),e("#import-find-replace").is(":checked")){if(s)e.each(n.table_sizes,function(e,i){if(e.startsWith(wpmdb_data.this_temp_prefix)&&wpmdb_data.alter_table_name!==e){var a=e.replace(wpmdb_data.this_temp_prefix,"");t.current_migration.model.addStageItem("find_replace",a,n.table_sizes[e],n.table_rows[e])}});else{var c=e("input[name=table_migrate_option]:checked").val();"migrate_only_with_prefix"===c?a=o.filter(function(e){return r===e.substring(0,r.length)}):"search_all_imported"===c&&(a=o),e.each(a,function(e,i){var a=wpmdb_data.this_temp_prefix+i;n.table_sizes.hasOwnProperty(a)&&t.current_migration.model.addStageItem("find_replace",i,n.table_sizes[a],n.table_rows[a])})}a=[],t.current_migration.model.setActiveStage("find_replace");var l=t.functions.get_tables_to_migrate();return t.common.next_step_in_migration={fn:t.functions.migrate_table_recursive,args:["-1","",l.length]},void t.functions.execute_next_step()}e(".progress-label").removeClass("label-visible"),t.common.hooks=e.wpmdb.apply_filters("wpmdb_before_migration_complete_hooks",t.common.hooks),t.common.hooks.push(t.functions.migration_complete),t.common.hooks.push(t.functions.wpmdb_flush),t.common.hooks=e.wpmdb.apply_filters("wpmdb_after_migration_complete_hooks",t.common.hooks),t.common.hooks.push(t.functions.migration_complete_events),t.common.next_step_in_migration={fn:t.functions.wpmdb_call_next_hook}}else t.common.next_step_in_migration={fn:t.functions.import_file_recursive,args:[{import_filename:i.import_filename,item_name:i.item_name,chunk:n.chunk,current_query:n.current_query}]};t.functions.execute_next_step()}})},t.functions.get_tables_to_import=function(){return o}}(jQuery,wpmdb)},{}],5:[function(e,t,i){"use strict";var n,a;window.wpmdb=window.wpmdb||{},n=jQuery,a=wpmdb,n(document).ready(function(){a.functions.localStorage_available=function(){try{return localStorage.setItem("wpmdb_test","wpmdb_test"),localStorage.removeItem("wpmdb_test","wpmdb_test"),!0}catch(e){return!1}},a.functions.maybe_reload_page=function(){var e=a.functions.wpmdb_migration_type();if(a.functions.localStorage_available()&&"cancelled"!==a.current_migration.status&&!0!==a.common.migration_error&&-1!==n.inArray(e,["pull","import","find_replace"])&&("true"!==wpmdb_data.is_multisite||!n("#mst-select-subsite").is(":checked")||wpmdb_data.this_domain===n("#mst-selected-subsite option:selected").text())){var t=a.functions.get_tables_to_migrate();"import"===e&&(t=a.functions.get_tables_to_import()),-1===n.inArray(wpmdb_data.this_prefix+"options",t)&&-1===n.inArray(wpmdb_data.this_prefix+"usermeta",t)||(a.functions.set_localStorage_form_data(),location.reload())}},a.functions.set_localStorage_form_data=function(){var e={};n.each(n("#migrate-form").serializeArray(),function(t,i){if("[]"===i.name.substr(-2)){var n=i.name.slice(0,-2);void 0===e[n]&&(e[n]=[]),e[n].push(i.value)}else e[i.name]=i.value}),localStorage.setItem("wpmdb_migrate_form",JSON.stringify(e))},a.functions.get_localStorage_form_data=function(){var e=localStorage.getItem("wpmdb_migrate_form");if(null===e)return!1;try{e=JSON.parse(e)}catch(e){return!1}return e},a.functions.remove_localStorage_form_data=function(){localStorage.removeItem("wpmdb_migrate_form")},a.functions.load_data_from_localStorage=function(){var e=a.functions.get_localStorage_form_data();e&&(n.each(e,function(e,t){var i=n('[name="'+e+'"]'),o=i.attr("type");"action"===e?(a.migration_selection=t,n("#"+t).prop("checked",!0)):"radio"===o?n('[name="'+e+'"][value="'+t+'"]').prop("checked",!0):"checkbox"===o?(i.prop("checked",!0),i.parent().hasClass("checkbox-label")&&i.parent().next().show()):i.val(t)}),n(".option-group input[type=radio]").change(),n("."+a.migration_selection+"-list ul").show(),n.when(a.functions.connection_box_changed()).done(function(){if("migrate_select"===n("input[name=table_migrate_option]:checked").val()?(void 0!==e.select_tables&&n("#select-tables").val(e.select_tables),n(".table-options .expandable-content, .select-tables-wrap").show(),n(".table-options .expand-collapse-arrow").removeClass("collapsed")):n(".select-tables-wrap").hide(),"backup_manual_select"===n("input[name=backup_option]:checked").val()&&(void 0!==e.select_backup&&n("#select-backup").val(e.select_backup),n(".backup-tables-wrap").show()),void 0!==e.select_post_types&&(n("#select-post-types").val(e.select_post_types),a.functions.exclude_post_types_warning()),void 0!==e.replace_old){n(".replace-row").not(".original-repeatable-field").remove();var t=1;n.each(e.replace_old,function(i,a){n(".replace-row:nth-child("+t+")").length||n(".replace-row").last().after(n(".original-repeatable-field").clone().removeClass("original-repeatable-field")),n(".replace-row:nth-child("+t+') [name="replace_old[]"]').val(a),n(".replace-row:nth-child("+t+') [name="replace_new[]"]').val(e.replace_new[i]),t++})}}),a.functions.update_migrate_button_text(),"import"!==a.functions.wpmdb_migration_type()&&a.functions.remove_localStorage_form_data())},a.functions.load_data_from_localStorage()})},{}],6:[function(e,t,i){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=jQuery,o=e("MigrationProgress-model"),s=e("MigrationProgress-view"),r=a('<div id="overlay" class="hide"></div>'),c=a(".progress-content").clone().addClass("hide"),l=a(".pro-version").addClass("hide");r.append(l);var p={migration:{model:{},view:{},$progress:{},$wrapper:{},$overlay:{},status:"active",title:"",text:"",timerCount:0,elapsedInterval:0,currentStageNum:0,counterDisplay:!1,originalTitle:document.title,setTitle:function(e){this.$progress.find(".progress-title").html(e),this.title=e},setStatus:function(e){this.$progress.removeClass(this.status).addClass("error"===e?"wpmdb-error":e),"error"===e&&this.$progress.find(".progress-text").addClass("migration-error"),this.status=e,this.updateTitleElem()},setText:function(e){"string"!=typeof e&&(e=""),0>=e.indexOf("wpmdb_error")&&(e=this.decodeErrorObject(e)),this.$progress.find(".progress-text").html(e),this.text=e},setState:function(e,t,i){null!==e&&this.setTitle(e),null!==t&&this.setText(t),null!==i&&this.setStatus(i)},startTimer:function(){this.timerCount=0,this.counterDisplay=a(".timer"),this.elapsedInterval=setInterval(this.incrementTimer,1e3)},pauseTimer:function(){clearInterval(this.elapsedInterval)},resumeTimer:function(){this.elapsedInterval=setInterval(this.incrementTimer,1e3)},incrementTimer:function(){wpmdb.current_migration.timerCount=wpmdb.current_migration.timerCount+1,wpmdb.current_migration.displayCount()},displayCount:function(){var e=Math.floor(this.timerCount/3600)%24,t=Math.floor(this.timerCount/60)%60,i=this.timerCount%60,n=this.pad(e,2,0)+":"+this.pad(t,2,0)+":"+this.pad(i,2,0);this.counterDisplay.html(n)},updateTitleElem:function(){var e=this.model.get("activeStageName"),t=this.model.getStageModel(e),i=Math.max(0,t.getTotalProgressPercent()),n=this.model.get("stages").length,a=this.currentStageNum,o=this.status,s=wpmdb_strings.title_progress;"complete"===t.get("status")&&0===t.get("totalSize")&&(i=100),s=(s=(s=s.replace("%1$s",i+"%")).replace("%2$s",a)).replace("%3$s",n),1===n&&(s=i+"%"),wpmdb_strings["title_"+o]&&(s=wpmdb_strings["title_"+o]),s=s+" - "+this.originalTitle,document.title=s},restoreTitleElem:function(){document.title=this.originalTitle},pad:function(e,t,i){return i=i||"0",(e+="").length>=t?e:new Array(t-e.length+1).join(i)+e},decodeErrorObject:function(e){var t=e.replace(/\{&quot;/g,"{#q!#").replace(/\&quot;}/g,"#q!#}").replace(/,&quot;/g,",#q!#").replace(/&quot;:/g,"#q!#:").replace(/:&quot;/g,":#q!#").replace(/&quot;/g,'\\"').replace(/#q!#/g,'"').replace(/&gt;/g,">").replace(/&lt;/g,"<");try{t=JSON.parse(t)}catch(t){return e}return"object"===(void 0===t?"undefined":n(t))&&void 0!==t.body?t:e},fixProgressStageWidthForScrollBar:function(){var e=Math.abs(this.$wrapper[0].offsetWidth-this.$wrapper[0].clientWidth),t=this.$wrapper.find(".active .progress-items"),i=parseInt(t.css("padding-left"),10),n=parseInt(t.css("padding-right"),10);(0!==e||0===e&&n!==i)&&t.css("padding-right",i-e+"px")}},newMigration:function(e){a("#overlay").remove(),a(".progress-content").remove(),this.migration.$overlay=r.clone(),a("#wpwrap").append(this.migration.$overlay),this.migration.model=new o(e),this.migration.view=new s({model:this.migration.model}),this.migration.$progress=c.clone(),this.migration.$wrapper=this.migration.view.$el,this.migration.$progress.find(".migration-progress-stages").replaceWith(this.migration.$wrapper),this.migration.$proVersion=this.migration.$overlay.find(".pro-version");var t=this.migration.$proVersion.find("iframe").remove().clone();this.migration.$overlay.prepend(this.migration.$progress);var i=this;return setTimeout(function(){i.migration.$overlay.add(i.migration.$progress).add(i.migration.$proVersion).removeClass("hide").addClass("show"),i.migration.$proVersion.length&&setTimeout(function(){i.migration.$proVersion.find(".iframe").append(t)},500)},0),this.migration.currentStageNum=0,this.migration.$proVersion.on("click",".close-pro-version",function(){i.migration.$proVersion.find("iframe").remove(),i.migration.$proVersion.addClass("hide remove"),setTimeout(function(){i.migration.$proVersion.remove()},500)}),this.migration.model.on("migrationComplete",function(){i.utils.updateProgTableVisibilitySetting(),i.utils.updatePauseBeforeFinalizeSetting(),i.migration.pauseTimer()}),a(window).on("resize",_.debounce(this.migration.fixProgressStageWidthForScrollBar.bind(this.migration),100)),this.migration.model.on("change:activeStage",this.migration.fixProgressStageWidthForScrollBar.bind(this.migration)),this.migration},utils:e("MigrationProgress-utils")};t.exports=p},{"MigrationProgress-model":7,"MigrationProgress-utils":8,"MigrationProgress-view":9}],7:[function(e,t,i){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=e("MigrationProgressStage-model"),o=jQuery,s=Backbone.Model.extend({defaults:{_initialStages:null,stages:null,activeStageName:null,stageModels:null,localTableRows:null,localTableSizes:null,remoteTableRows:null,remoteTableSizes:null,migrationStatus:"active",migrationIntent:"savefile"},initialize:function(){this.set("stageModels",{}),this.set("_initialStages",this.get("stages")),this.set("stages",[]),_.each(this.get("_initialStages"),function(e,t,i){this.addStage(e.name,t,i)},this)},addStage:function(e,t,i,a){var s,r=[];return _.each(t,function(e){var t,n;"remote"===i?(t=this.get("remoteTableSizes")[e],n=this.get("remoteTableRows")[e]):(t=this.get("localTableSizes")[e],n=this.get("localTableRows")[e]),r.push({name:e,size:t,rows:n})},this),s={name:e,items:r,dataType:i},"object"===(void 0===a?"undefined":n(a))&&(s=o.extend(s,a)),this.addStageModel(s),this.trigger("stage:added",this.get("stageModels")[e]),this.get("stageModels")[e].on("change",function(){this.trigger("change")},this),this.getStageModel(s.name)},addStageItem:function(e,t,i,n){this.getStageModel(e).addItem(t,i,n)},addStageModel:function(e){var t=this.get("stages"),i=this.get("stageModels"),n=new a(e);t.push(e),i[e.name]=n,this.set("stages",t),this.set("stageModels",i)},getStageModel:function(e){return this.get("stageModels")[e]},getStageItems:function(e,t){var i=this.getStageModel(e).get("items");return void 0===t?i:i.map(function(e){return e[t]})},setActiveStage:function(e){this.setStageComplete(),this.set("activeStageName",e),this.getStageModel(e).set("status","active"),this.trigger("change:activeStage")},setStageComplete:function(e){e||(e=this.get("activeStageName")),null!==e&&this.getStageModel(e).set("status","complete"),wpmdb.current_migration.currentStageNum=wpmdb.current_migration.currentStageNum+1},setMigrationComplete:function(){var e=this.getStageModel(this.get("activeStageName"));this.setStageComplete(),this.trigger("migrationComplete"),this.set("migrationStatus","complete"),e.activateTab()}});t.exports=s},{"MigrationProgressStage-model":10}],8:[function(e,t,i){"use strict";var n=jQuery;t.exports={updateProgTableVisibilitySetting:function(){wpmdb_data.prog_tables_visibility_changed&&(wpmdb_data.prog_tables_visibility_changed=!1,n.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_setting",nonce:wpmdb_data.nonces.save_setting,setting:"prog_tables_hidden",checked:Boolean(wpmdb_data.prog_tables_hidden)},error:function(e,t,i){console.log("Could not save progress item visibility setting",i)}}))},updatePauseBeforeFinalizeSetting:function(){wpmdb_data.pause_before_finalize_changed&&(wpmdb_data.pause_before_finalize_changed=!1,n.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_setting",nonce:wpmdb_data.nonces.save_setting,setting:"pause_before_finalize",checked:Boolean(wpmdb_data.pause_before_finalize)},error:function(e,t,i){console.log("Could not save pause before finalize setting",i)}}))}}},{}],9:[function(e,t,i){"use strict";var n=e("./MigrationProgressStage-view.js"),a=(jQuery,Backbone.View.extend({tagName:"div",className:"migration-progress-stages",id:"migration-progress-stages",self:void 0,initialize:function(){this.$el.empty(),this.model.on("stage:added",function(e){this.addStageView(e)},this),_.each(this.model.get("stageModels"),this.addStageView,this)},addStageView:function(e){var t=new n({model:e});e.trigger("view:initialized",t),this.$el.append(t.$el),this.$el.parent().find(".stage-tabs").append(t.$tabElem)}}));t.exports=a},{"./MigrationProgressStage-view.js":11}],10:[function(e,t,i){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=jQuery,o=Backbone.Model.extend({defaults:{status:"queued",_initialItems:null,items:null,lookupItems:null,totalSize:0,totalTransferred:0,dataType:"local",name:"",itemsComplete:0,itemsCompleteArr:[],strings:null},initialize:function(){this.initStrings(),this.set("_initialItems",this.get("items").slice()),this.set("items",[]),this.set("lookupItems",{}),this.set("itemsCompleteArr",[]),_.each(this.get("_initialItems"),function(e){this.addItem(e.name,e.size,e.rows)},this),this.on("view:initialized",this.triggerItemViewInit),this.on("change",function(){wpmdb.current_migration.updateTitleElem()})},initStrings:function(){var e={stage_title:this.get("name"),migrated:wpmdb_strings.migrated,queued:wpmdb_strings.queued,active:wpmdb_strings.running,complete:wpmdb_strings.complete,hide:wpmdb_strings.hide,show:wpmdb_strings.show,itemsName:wpmdb_strings.tables},t=this.get("strings");t="object"===(void 0===t?"undefined":n(t))?t:{},(t=a.extend(e,t)).items_migrated=t.itemsName+" "+t.migrated,t.hide_items=t.hide+" "+t.itemsName,t.show_items=t.show+" "+t.itemsName,this.set("strings",t)},addItem:function(e,t,i){var n=this.get("items"),a={name:e,size:t,rows:i||t,stageName:this.get("name"),$el:null,transferred:0,rowsTransferred:0,complete:!1};n.push(a),this.get("lookupItems")[e]=n.length-1,this.set("totalSize",parseInt(this.get("totalSize"))+parseInt(t)),this.trigger("item:added",a)},triggerItemViewInit:function(){var e=this.get("items"),t=this;_.each(e,function(e){t.trigger("item:added",e)})},getTotalSizeTransferred:function(){return this.get("totalTransferred")},countItemsComplete:function(){return this.get("itemsComplete")},getTotalProgressPercent:function(){var e=this.getTotalSizeTransferred(),t=this.get("totalSize");return 0>=e||0>=t?0:Math.min(100,Math.floor(e/t*100))},activateTab:function(){this.trigger("activateTab"),wpmdb.current_migration.model.trigger("change:activeStage")},setItemComplete:function(e){var t=this.get("itemsCompleteArr");if(!~t.indexOf(e)){t.push(e);var i=this.getItemByName(e),n=this.get("totalTransferred"),a=this.get("itemsComplete");this.set("itemsComplete",++a),n+=i.size-i.transferred,this.set("totalTransferred",n),i.transferred=i.size,i.complete=!0,i.rowsTransferred=i.rows,this.trigger("change change:items",i)}},setItemRowsTransferred:function(e,t){var i,n,a=this.getItemByName(e),o=this.get("totalTransferred");1!==(i=-1===parseInt(t)?1:Math.min(1,t/a.rows))?(o+=(n=a.size*i)-a.transferred,this.set("totalTransferred",o),a.transferred=n,a.rowsTransferred=t,this.trigger("change change:items",a)):this.setItemComplete(e)},getItemByName:function(e){var t=this.get("items")[this.get("lookupItems")[e]]||{};return e===t.name?t:this.determineItemByName(e)},determineItemByName:function(e){for(var t=this.get("items"),i=0;i<t.length;i++){var n=t[i];if(e===n.name)return this.get("lookupItems").itemName=i,n}}});t.exports=o},{}],11:[function(e,t,i){"use strict";var n=jQuery,a=Backbone.View.extend({tagName:"div",className:"migration-progress-stage-container hide-tables",$totalProgressElem:null,$tabElem:null,$showHideTablesElem:null,$pauseBeforeFinalizeElem:null,$pauseBeforeFinalizeCheckbox:null,$itemsContainer:null,itemViews:null,maxDomNodes:100,visibleDomNodes:0,queuedElements:null,$truncationNotice:null,$truncationNoticeHiddenItems:null,initialize:function(){this.$el.empty(),this.$el.attr("data-stage",this.model.get("name")).addClass("queued "+this.model.get("name")),this.queuedElements=[],this.initTotalProgressElem(),wpmdb.current_migration.view.$el.parent().find(".stage-tabs").after(this.$totalProgressElem),this.$itemsContainer=n("<div class=progress-items />"),this.$el.append(this.$itemsContainer),this.initTabElem(),this.model.on("item:added",this.maybeAddElementToView,this),_.each(this.model.get("itemModels"),this.maybeAddElementToView,this),this.model.on("change",function(){this.updateProgressElem(),this.updateStageTotals()},this),this.model.on("change:status",function(e){this.$el.removeClass("queued active").addClass(this.model.get("status")),this.$totalProgressElem.removeClass("queued active").addClass(this.model.get("status")),this.$tabElem.removeClass("queued active").addClass(this.model.get("status")).find(".stage-status").text(this.model.get("strings")[this.model.get("status")])},this),this.model.on("change:items",function(e){e.name&&this.setItemProgress(e)},this),this.model.on("activateTab",function(){"complete"===wpmdb.current_migration.model.get("migrationStatus")&&(this.$totalProgressElem.addClass("active").siblings().removeClass("active"),this.$tabElem.addClass("active").siblings().removeClass("active"),this.$el.addClass("active").siblings().removeClass("active"))},this)},initTotalProgressElem:function(){this.initShowHideTablesElem(),this.initPauseBeforeFinalizeElem(),this.$totalProgressElem=n('<div class="stage-progress '+this.model.get("name")+'" />').append("<span class=percent-complete>0</span>% "+this.model.get("strings").complete+" ").append('<span class="size-complete-wrap">(<span class=size-complete>0 MB</span> / <span class=size-total>0 MB</span>) </span>').append('<span class="items-complete-wrap"><span class=items-complete>0</span> <span class=lowercase >of</span> <span class=items-total>0</span> '+this.model.get("strings").items_migrated+"</span>").append(this.$showHideTablesElem).append("<div class=progress-bar-wrapper><div class=progress-bar /></div>"),this.updateStageTotals()},initShowHideTablesElem:function(){this.$showHideTablesElem=n("<a class=show-hide-tables/>").text(this.model.get("strings").show_items);var e=this;this.$showHideTablesElem.on("click show-hide-progress-tables",function(){var t;e.$el.hasClass("hide-tables")?(t=!1,e.$el.add(e.$el.siblings()).removeClass("hide-tables"),e.$showHideTablesElem.text(e.model.get("strings").hide_items)):(t=!0,e.$el.add(e.$el.siblings()).addClass("hide-tables"),e.$showHideTablesElem.text(e.model.get("strings").show_items)),Boolean(t)!==Boolean(wpmdb_data.prog_tables_hidden)&&(wpmdb_data.prog_tables_visibility_changed=!0,wpmdb_data.prog_tables_hidden=t)}),wpmdb_data.prog_tables_hidden||this.$showHideTablesElem.triggerHandler("show-hide-progress-tables"),this.model.on("change:status activateTab",function(){wpmdb_data.prog_tables_hidden?e.$showHideTablesElem.text(e.model.get("strings").show_items):e.$showHideTablesElem.text(e.model.get("strings").hide_items)})},initPauseBeforeFinalizeElem:function(){this.$pauseBeforeFinalizeElem=n(".pause-before-finalize"),this.$pauseBeforeFinalizeCheckbox=this.$pauseBeforeFinalizeElem.find("input[type=checkbox]");var e=this,t=!1,i=wpmdb.current_migration.model.get("migrationIntent");wpmdb_data.pause_before_finalize&&(t=!0),this.$pauseBeforeFinalizeCheckbox.prop("checked",t),-1!==n.inArray(i,["push","pull","find_replace","import"])?("find_replace"===i&&n("#pause-before-finalize-label").text(wpmdb_strings.pause_before_finalize_find_replace),this.$pauseBeforeFinalizeElem.show()):this.$pauseBeforeFinalizeElem.hide(),wpmdb.current_migration.model.on("change:activeStage",function(){"media"===wpmdb.current_migration.model.get("activeStageName")&&e.$pauseBeforeFinalizeElem.hide()}),this.$pauseBeforeFinalizeElem.on("click",function(){var t=Boolean(e.$pauseBeforeFinalizeCheckbox.is(":checked"));t!==Boolean(wpmdb_data.pause_before_finalize)&&(wpmdb_data.pause_before_finalize_changed=!0,wpmdb_data.pause_before_finalize=t)})},initTabElem:function(){var e=this;this.$tabElem=n("<a class=stage-tab>").append("<span class=stage-title>"+this.model.get("strings").stage_title+"</span> ").append("<span class=stage-status>"+this.model.get("strings").queued+"</span> ").on("click",function(){e.model.activateTab()})},updateProgressElem:function(){var e=Math.max(0,this.model.getTotalProgressPercent()),t=wpmdb.functions.convertKBSizeToHRFixed(Math.min(this.model.getTotalSizeTransferred(),this.model.get("totalSize"))),i=Math.min(this.model.countItemsComplete(),this.model.get("items").length);"complete"===this.model.get("status")&&0===this.model.get("totalSize")&&(e=100,this.$showHideTablesElem.fadeOut()),this.$totalProgressElem.find(".percent-complete").text(e),this.$totalProgressElem.find(".size-complete").text(t),this.$totalProgressElem.find(".items-complete").text(wpmdb.functions.wpmdb_add_commas(i)),this.$totalProgressElem.find(".progress-bar-wrapper .progress-bar").css({width:e+"%"})},updateStageTotals:function(){var e=this.model.get("items").length;this.$totalProgressElem.find(".items-total").text(wpmdb.functions.wpmdb_add_commas(e)),this.$totalProgressElem.find(".size-total").text(wpmdb.functions.convertKBSizeToHRFixed(this.model.get("totalSize")))},initializeItemElement:function(e){var t=n('<div class="item-progress" />'),i=n('<div class="progress-bar"/>').css("width","0%"),a=n("<p>").addClass("item-info").append(n('<span class="name" />').text(e.name)).append(" ").append(n('<span class="size" />').text("("+wpmdb.functions.convertKBSizeToHRFixed(e.size)+")"));return t.append(a),t.append(i),t.append('<span class="dashicons dashicons-yes"/>'),t.attr("id","item-"+e.name),t.attr("data-stage",this.model.get("name")),e.$el=t,e.$progress=i,e.$title=a,e},maybeAddElementToView:function(e){this.visibleDomNodes<this.maxDomNodes?(++this.visibleDomNodes,this.$itemsContainer.append(this.initializeItemElement(e).$el)):(this.queuedElements.push(e),this.$truncationNotice?this.updateTruncationNotice():this.showTruncationNotice())},showTruncationNotice:function(){this.$truncationNotice||(this.$truncationNotice=n('<div class="truncation-notice" >'+wpmdb_strings.progress_items_truncated_msg.replace("%1$s",'<span class="hidden-items">'+wpmdb.functions.wpmdb_add_commas(this.queuedElements.length)+"</span>")+"</div>"),this.$truncationNoticeHiddenItems=this.$truncationNotice.find(".hidden-items"),this.$itemsContainer.after(this.$truncationNotice))},updateTruncationNotice:function(){this.$truncationNoticeHiddenItems.text(wpmdb.functions.wpmdb_add_commas(this.queuedElements.length))},getNextElementForView:function(e){var t;return this.queuedElements.length&&(e&&this.queuedElements.push(e),e=(t=this.queuedElements.shift())instanceof n?t:this.initializeItemElement(t).$el),e},setItemProgress:function(e){var t=Math.min(100,Math.ceil(e.transferred/e.size*100));e.$progress.css("width",t+"%"),100<=t&&this.elemComplete(e)},elemComplete:function(e){var t=e.$el.addClass("complete");if(1!==this.model.get("items").length){var i=this.getNextElementForView(t),n=t.height(),a=t.css("margin-bottom"),o=i.clone().css({height:0,marginBottom:0}).addClass("clone");o.appendTo(this.$itemsContainer),t.css({height:n,marginBottom:a}),setTimeout(function(){t.css({height:0,marginBottom:0}),o.css({height:n,marginBottom:a}),setTimeout(function(){t.css({height:"auto",marginBottom:a}).remove(),o.remove(),this.$itemsContainer.find(".item-progress:not(.clone)").last().after(i.css({height:"auto",marginBottom:a}))}.bind(this),250)}.bind(this),1e3)}}});t.exports=a},{}],12:[function(e,t,i){"use strict";var n,a;window.wpmdb=window.wpmdb||{},n=jQuery,(a=wpmdb).functions.update_multiselect=function(e,t,i){if(n(e).empty(),0<Object.keys(t).length){var o=n.wpmdb.apply_filters("wpmdb_get_table_prefix",null,null),s=!1;n.each(t,function(t,a){if(!n.wpmdb.apply_filters("wpmdb_exclude_subsite",!1,t)){var r=" ";(void 0===i||null===i||0===i.length||void 0!==i&&null!==i&&0<i.length&&-1!==n.inArray(t,i))&&(r=' selected="selected" ',s=!0),a+=" ("+o+("1"!==t?t+"_":"")+")",n(e).append("<option"+r+'value="'+t+'">'+a+"</option>")}}),!1===s&&a.functions.update_multiselect(e,t,[])}}},{}],13:[function(e,t,i){"use strict";var n,a,o,s;n=jQuery,o=!1,s=ajaxurl.replace("/admin-ajax.php","")+"/images/spinner",2<window.devicePixelRatio&&(s+="-2x"),a=n('<img src="'+(s+=".gif")+'" alt="" class="check-licence-spinner" />'),n(document).ready(function(){n("body").on("click",".check-my-licence-again",function(e){if(e.preventDefault(),n(this).blur(),o)return!1;o=!0,n(this).hide(),a.insertAfter(this);var t=' <a class="check-my-licence-again" href="#">'+wpmdb_update_strings.check_license_again+"</a>";n.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_check_licence",nonce:wpmdb_nonces.check_licence,context:"update"},error:function(e,i,a){o=!1,n(".wpmdb-licence-error-notice").fadeOut(650,function(){n(".wpmdb-licence-error-notice").empty().html(wpmdb_update_strings.license_check_problem+t).fadeIn(650)})},success:function(e){if(o=!1,void 0!==e.errors){var t="";for(var i in e.errors)t+=e.errors[i];n(".wpmdb-licence-error-notice").fadeOut(650,function(){n(".check-licence-spinner").remove(),n(".wpmdb-licence-error-notice").empty().html(t).fadeIn(650)})}else n(".wpmdbpro-custom-visible").fadeOut(650,function(){n(".check-licence-spinner").remove(),n(".wpmdbpro-custom-visible").empty().html(n(".wpmdb-original-update-row").html()).fadeIn(650)})}})}),n(".wpmdbpro-custom").prev().addClass("wpmdbpro-has-message")})},{}],14:[function(e,t,i){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};window.wpmdb=window.wpmdb||{},function(t,i){var a,o,s,r,c,l,p=!1,d="",m=!1,u=!1,_=!1,g=!1,f=!1,b=!1,h=!1,w=!1,v=!1,y=!1,x="",k="",S=[],T=!1,j="",C="",F="",z="",$=!1,E=!1,I=0,P=400,q=!1,O=i.functions.get_spinner_url(),M='<img src="'+O+'" alt="" class="ajax-spinner general-spinner" />';i.migration_progress_controller=e("MigrationProgress-controller"),i.current_migration=null,i.migration_selection=i.functions.wpmdb_migration_type();var A=t("#select-tables").clone(),D=t("#select-tables").clone(),B=t("#select-post-types").clone(),N=t("#select-post-types").clone(),Q=t("#select-backup").clone(),R=t("#select-backup").clone(),V=t(".connection-info-wrapper");function H(e,t){var i,n,a=[],o={},s=t.length;for(i=0;i<s;i++)o[t[i]]=!0;for(s=e.length,i=0;i<s;i++)(n=e[i])in o&&a.push(n);return a}function U(e){!0===e&&1>t(".replace-row.pin").length&&1===t("#old-url").length&&t("#old-url").parents(".replace-row").addClass("pin"),!1===e&&0<t(".replace-row.pin").length&&t(".replace-row.pin").removeClass("pin")}function K(e,t,n){return i.functions.wpmdbGetAjaxErrors(wpmdb_strings.connection_local_server_problem,t,e,n)}function L(){t.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_get_log",nonce:wpmdb_data.nonces.get_log},error:function(e,t,i){alert(wpmdb_strings.update_log_problem)},success:function(e){t(".debug-log-textarea").val(e)}})}function W(e,i,n){var a=e.substr(0,e.indexOf(":")),o=t(".ssl-notice");if(w||o.hide(),n!==a&&-1!==e.indexOf("https"))return o.show(),w=!0,e=e.replace("https","http"),void t(".pull-push-connection-info").val(e+"\n"+i);w=!1}function J(){void 0!==wpmdb_data&&void 0!==wpmdb_data.this_tables&&void 0!==wpmdb_data.this_table_sizes_hr&&(A=i.functions.create_table_select(wpmdb_data.this_tables,wpmdb_data.this_table_sizes_hr,t(A).val())),void 0!==i.common.connection_data&&void 0!==i.common.connection_data.tables&&void 0!==i.common.connection_data.table_sizes_hr&&(D=i.functions.create_table_select(i.common.connection_data.tables,i.common.connection_data.table_sizes_hr,t(D).val()))}function G(){var e;if(t(".save-settings-button").blur(),!g&&!0!==i.functions.maybe_show_select_table_notice()){var n=!1;t("#create_new").is(":checked")&&(n=!0);var a=t(".create-new-profile").val();g=!0,e=t(t("#migrate-form")[0].elements).not(".auth-credentials").serialize(),t(".save-settings-button").attr("disabled","disabled").after('<img src="'+O+'" alt="" class="save-profile-ajax-spinner general-spinner" />'),m=!0,t.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_profile",profile:e,nonce:wpmdb_data.nonces.save_profile},error:function(e,i,n){m=!1,alert(wpmdb_strings.save_profile_problem),t(".save-settings-button").removeAttr("disabled"),t(".save-profile-ajax-spinner").remove(),t(".save-settings-button").after('<span class="ajax-success-msg">'+wpmdb_strings.saved+"</span>"),t(".ajax-success-msg").fadeOut(2e3,function(){t(this).remove()}),g=!1},success:function(e){var i=parseInt(t("#migrate-form input[name=save_migration_profile_option]:checked").val(),10)+1;if(m=!1,t(".save-settings-button").removeAttr("disabled"),t(".save-profile-ajax-spinner").remove(),t(".save-settings-button").after('<span class="ajax-success-msg">'+wpmdb_strings.saved+"</span>"),t(".ajax-success-msg").fadeOut(2e3,function(){t(this).remove()}),g=!1,t(".create-new-profile").val(""),n){var o=parseInt(e,10),s=o+1,r=t('<li><span class="delete-profile" data-profile-id="'+s+'"></span><label for="profile-'+s+'"><input id="profile-'+s+'" value="'+o+'" name="save_migration_profile_option" type="radio"></label></li>');r.find("label").append(document.createTextNode(" "+a)),i=s,t("#create_new").parents("li").before(r),t("#profile-"+s).attr("checked","checked")}var c=window.location.href.replace("#migrate","").replace(/&wpmdb-profile=-?\d+/,"")+"&wpmdb-profile="+i,l=t("#migrate-form input[name=save_migration_profile_option]:checked").parent().text().trim();if("function"==typeof window.history.pushState){if(t("#migrate-form .crumbs").length)t("#migrate-form .crumbs .crumb:last").text(l);else{var p=t('<div class="crumbs" />').append('<a class="crumb" href="'+wpmdb_data.this_plugin_base+'"> Saved Profiles </a>').append('<span class="crumb">'+l+"</span>");t("#migrate-form").prepend(p)}window.history.pushState({updated_profile_id:i},null,c)}}})}}function Y(e){$=!0,F=wpmdb_strings.cancelling_migration,t(".migration-controls").css({visibility:"hidden"}),"find_replace"===a&&(F=wpmdb_strings.cancelling_find_replace),i.current_migration.setState(F,wpmdb_strings.completing_current_request,"cancelling"),!0===T&&(T=!1,i.functions.execute_next_step())}function Z(){var e,n,a,o,s,r,c=t(".connection-status"),l=t(".directory-permission-notice"),m=t(".compatibility-older-mysql"),u=t(".mst-required"),_=t(".keep-active-plugins"),g=t(".step-two"),f=t(".backup-options"),h=i.functions.wpmdb_migration_type();if(c.hide(),l.hide(),g.show(),f.show(),_.show(),m.hide(),u.hide(),i.functions.wpmdb_toggle_migration_action_text(),t(".migrate-tab").attr("class","migrate-tab content-tab").addClass(i.functions.wpmdb_migration_type()),t.wpmdb.do_action("move_connection_info_box",{migration_type:h,last_migration_type:d}),-1!==t.inArray(h,["push","pull"])){var w=t(".pull-push-connection-info"),v=t.trim(w.val()).split("\n"),y=t("."+h+"-list li");if(y.append(V),V.show(function(){var e=t(this).find(".pull-push-connection-info");e.val()||e.focus()}),h!==d&&2===v.length)return i.force_reconnect=!0,y.append(V),w.removeClass("temp-disabled").attr("readonly","readonly"),t(".connect-button").hide(),void i.functions.connection_box_changed();p?(c.hide(),g.show(),i.functions.wpmdb_toggle_migration_action_text(),"pull"===h?(n=i.common.connection_data.prefix,a=wpmdb_data.site_details.prefix,o=wpmdb_data.this_uploads_dir,s=wpmdb_data.this_upload_dir_long,r=wpmdb_data.write_permission):(n=wpmdb_data.this_prefix,a=i.common.connection_data.prefix,o=i.common.connection_data.uploads_dir,s=i.common.connection_data.upload_dir_long,r=i.common.connection_data.write_permissions),t(".table_prefix").html(n),t(".backup-table-prefix").html(a),t(".uploads-dir").html(o),X(s,r),!1===b&&(e=re(i.common.connection_data.url),t(".create-new-profile").val(e))):(c.show(),g.hide())}else if(-1!==t.inArray(h,["find_replace","savefile"]))if(c.hide(),g.show(),t(".table-prefix").html(wpmdb_data.this_prefix),!1===b&&t(".create-new-profile").val(""),_.hide(),"savefile"===h)f.hide(),m.show(),"false"===wpmdb_data.write_permission&&(l.show(),g.hide());else{if("true"===wpmdb_data.is_multisite){var x=t(".old-replace-col").eq(1);x.parent().removeClass("pin").find(".replace-remove-row").show(),x.find("input").removeAttr("readonly")}X(wpmdb_data.this_upload_dir_long,wpmdb_data.write_permission)}oe()}function X(e,i){var n=t("#create-backup"),a=t("#create-backup-label"),o=t(".backup-option-disabled");n.removeAttr("disabled"),a.removeClass("disabled"),o.hide(),"false"===i&&(n.prop("checked",!1),n.attr("disabled","disabled"),a.addClass("disabled"),o.show(),t(".upload-directory-location").html(e))}function ee(){var e=null,a=null;null!==i.common.previous_connection_data&&"object"===n(i.common.previous_connection_data)&&i.common.previous_connection_data.url!==i.common.connection_data.url&&(e=i.functions.remove_protocol(i.common.previous_connection_data.url),a=i.common.previous_connection_data.path),"push"===i.functions.wpmdb_migration_type()||"savefile"===i.functions.wpmdb_migration_type()?("pull"===d?t(".replace-row").each(function(){var e=t(".old-replace-col input",this).val();t(".old-replace-col input",this).val(t(".replace-right-col input",this).val()),t(".replace-right-col input",this).val(e)}):"push"===d&&"push"===i.functions.wpmdb_migration_type()&&null!==e&&null!==a&&t(".replace-row").each(function(){var n=t(".replace-right-col input",this).val();n===a&&t(".replace-right-col input",this).val(i.common.connection_data.path),n===e&&t(".replace-right-col input",this).val(i.functions.remove_protocol(i.common.connection_data.url))}),t.wpmdb.do_action("wpmdb_update_push_table_select"),t("#select-post-types").remove(),t(".exclude-post-types-warning").after(B),i.functions.exclude_post_types_warning(),t("#select-backup").remove(),t(".backup-tables-wrap").prepend(Q)):"pull"===i.functions.wpmdb_migration_type()&&(""===d||"push"===d||"savefile"===d?t(".replace-row").each(function(){var e=t(".old-replace-col input",this).val();t(".old-replace-col input",this).val(t(".replace-right-col input",this).val()),t(".replace-right-col input",this).val(e)}):"pull"===d&&"pull"===i.functions.wpmdb_migration_type()&&null!==e&&null!==a&&t(".replace-row").each(function(){var n=t(".old-replace-col input",this).val();n===a&&t(".old-replace-col input",this).val(i.common.connection_data.path),n===e&&t(".old-replace-col input",this).val(i.functions.remove_protocol(i.common.connection_data.url))}),t.wpmdb.do_action("wpmdb_update_pull_table_select"),t("#select-post-types").remove(),t(".exclude-post-types-warning").after(N),i.functions.exclude_post_types_warning(),t("#select-backup").remove(),t(".backup-tables-wrap").prepend(R)),d=i.functions.wpmdb_migration_type()}function te(e,i){t(".nav-tab").removeClass("nav-tab-active"),t(".nav-tab."+e).addClass("nav-tab-active"),t(".content-tab").hide(),t("."+e+"-tab").show(),"settings"===e&&!0===ae()&&(t("p.licence-status").append("Checking License... ").append(M),ne()),"help"===e&&(L(),!0===ae()&&(t(".support-content p").append(M),ne())),"addons"===e&&!0!==i&&!0===ae()&&(t(".addons-content p").append(M),ne())}function ie(){t("#overlay").removeClass("show").addClass("hide"),t("#overlay > div").removeClass("show").addClass("hide"),i.current_migration.$proVersion.find("iframe").remove(),setTimeout(function(){t("#overlay").remove()},500),v=!1}function ne(e){var i=!u;h=!0,t.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_check_licence",licence:e,context:"all",nonce:wpmdb_data.nonces.check_licence},error:function(e,t,i){alert(wpmdb_strings.license_check_problem)},success:function(e){var n,a,o,s=t(".support-content"),r=t(".addons-content"),c=t(".licence-status:not(.notification-message)");if(void 0!==e.dbrains_api_down)a=e.dbrains_api_down+e.message,o=e.dbrains_api_down;else if(void 0!==e.errors){if(void 0!==e.errors.subscription_expired)n=e.errors.subscription_expired.licence,a=e.errors.subscription_expired.support,o=e.errors.subscription_expired.addons;else{var l="";for(var p in e.errors)l+=e.errors[p];a=l,o=l}void 0!==e.addon_content&&(o+="\n"+e.addon_content)}else a=e.message,o=e.addon_content;i&&c.stop().fadeOut(P,function(){void 0===n&&(t(this).css({visibility:"hidden",display:"block"}).slideUp(),n=""),t(this).empty().html(n).stop().fadeIn(P)}),s.stop().fadeOut(P,function(){t(this).empty().html(a).stop().fadeIn(P)}),r.stop().fadeOut(P,function(){t(this).empty().html(o).stop().fadeIn(P)}),t("#plugin-compatibility").is(":not(:checked)")&&t("#compatibility-header").click()}})}function ae(){return!1===h&&"1"===wpmdb_data.has_licence&&"true"===wpmdb_data.is_pro}function oe(){if(void 0!==i.common.connection_data&&!1!==i.common.connection_data){var e=i.functions.wpmdb_migration_type(),n=i.functions.get_tables_to_migrate(null,null);t(".mixed-case-table-name-notice").hide(),null!==n&&(n=n.join(""))!==n.toLowerCase()&&("1"===i.common.connection_data.lower_case_table_names||"push"!==e&&"savefile"!==e)&&("1"!==wpmdb_data.lower_case_table_names&&"pull"===e||("push"===e||"savefile"===e?t(".mixed-case-table-name-notice.push").show():t(".mixed-case-table-name-notice.pull").show()))}}function se(e,i){t(".licence-input, .register-licence").remove(),t(".licence-not-entered").prepend(e.masked_licence),t(".support-content").empty().html("<p>"+wpmdb_strings.fetching_license+'<img src="'+O+'" alt="" class="ajax-spinner general-spinner" /></p>'),ne(i),t(".migrate-selection label").removeClass("disabled"),t(".migrate-selection input").removeAttr("disabled")}function re(e){return e.replace(/\/\/(.*)@/,"//").replace("http://","").replace("https://","").replace("www.","")}function ce(e,i,n){var a="",o="";switch(i){case"push":a=wpmdb_strings.push_migration_label_migrating,o=wpmdb_strings.push_migration_label_completed;break;case"pull":a=wpmdb_strings.pull_migration_label_migrating,o=wpmdb_strings.pull_migration_label_completed;break;case"find_replace":a=wpmdb_strings.find_replace_label_migrating,o=wpmdb_strings.find_replace_label_completed;break;case"savefile":a=wpmdb_strings.exporting_please_wait,o=wpmdb_strings.exporting_complete}var s,r,c,l=a;return"completed"===n&&(l=o),"push"!==i&&"pull"!==i||(s=l,r=n,c=re(e),l="completed"===r?s.replace(/\%s\s?/,"<span class=domain-label>"+c+"</span>&nbsp;"):s.replace(/\%s(\S*)\s?/,"<span class=domain-label>"+c+"$1</span>&nbsp;")),l=t.wpmdb.apply_filters("wpmdb_get_migration_status_label",l,{intent:i,stage:n})}function le(){t(".option-group").each(function(e){t("input",this).attr("disabled","disabled"),t("label",this).css("cursor","default")})}function pe(){t(".option-group").each(function(e){t("input",this).removeAttr("disabled"),t("label",this).css("cursor","pointer")})}function de(e,n,a,o){var s=n;void 0!==o&&(s=o),t(".slider",e).slider("value",parseInt(n)),t(".amount",e).html(i.functions.wpmdb_add_commas(s)+" "+a)}function me(e){!0===T?(T=!1,m=!0,i.current_migration.setState(j,C,"active"),t(".pause-resume").html(wpmdb_strings.pause),i.current_migration.resumeTimer(),i.functions.execute_next_step()):(T=!0,m=!1,z=wpmdb_strings.migration_paused,j=t(".progress-title").html(),C=t(".progress-text",".progress-wrapper-primary").html(),t(".progress-text",".progress-wrapper-secondary ").html(),"find_replace"===a&&(z=wpmdb_strings.find_replace_paused),i.current_migration.setState(z,wpmdb_strings.completing_current_request,null),t("body").off("click",".pause-resume"),t("body").off("click",".cancel"))}function ue(e,i){return t(".table-select-wrap .table-prefix").text()}function _e(e){!0===e?(t('.replace-row.pin .replace-right-col input[type="text"]').attr("readonly","readonly"),t(".replace-row.pin .arrow-col").addClass("disabled")):(t('.replace-row.pin .replace-right-col input[type="text"]').removeAttr("readonly"),t(".replace-row.pin .arrow-col").removeClass("disabled"))}function ge(e){i.common.previous_connection_data=i.common.connection_data,i.common.connection_data=e,t.wpmdb.do_action("wpmdb_connection_data_updated",e)}function fe(e){var t={unit:"MB"};return t.amount=(e/1024).toFixed(2),t}window.onbeforeunload=function(e){if("import"!==i.functions.wpmdb_migration_type()||t(".step-two").is(":visible")||i.functions.remove_localStorage_form_data(),y)return(e=e||window.event)&&(e.returnValue=wpmdb_strings.sure),wpmdb_strings.sure},t.wpmdb.add_filter("wpmdb_exclude_table",function(e,t){var n=wpmdb_data.this_temp_prefix;return"pull"===i.functions.wpmdb_migration_type()&&void 0!==i.common.connection_data&&void 0!==i.common.connection_data.temp_prefix&&(n=i.common.connection_data.temp_prefix),n===t.substring(0,n.length)||e}),i.functions.exclude_post_types_warning=function(){var e=t("#select-post-types").val(),i="",n=t(".exclude-post-types-warning");e?(i="<code>"+e.join("</code>, <code>")+"</code>",t(".excluded-post-types").html(i),"0"===n.css("opacity")&&n.css({opacity:0}).slideDown(200).animate({opacity:1})):n.css({opacity:0}).slideUp(200).animate({opacity:0})},i.functions.migrate_table_recursive=function(e,n,o){var s=o||0;if(s>=S.length)if("upload"===c&&i.current_migration.model.getStageItems("find_replace").length)c="find_replace",S=(S=i.current_migration.model.getStageItems("find_replace","name")).map(function(e){return"_mig_"+e}),s=0;else{if("backup"!==c)return t(".progress-label").removeClass("label-visible"),i.common.hooks=t.wpmdb.apply_filters("wpmdb_before_migration_complete_hooks",i.common.hooks),i.common.hooks.push(i.functions.migration_complete),i.common.hooks.push(i.functions.wpmdb_flush),i.common.hooks=t.wpmdb.apply_filters("wpmdb_after_migration_complete_hooks",i.common.hooks),i.common.hooks.push(i.functions.migration_complete_events),i.common.next_step_in_migration={fn:i.functions.wpmdb_call_next_hook},void i.functions.execute_next_step();if(c=-1!==t.inArray(a,["push","pull"])?"migrate":"import"===a?"upload":a,i.current_migration.model.setActiveStage(c),"find_replace"!==c&&"migrate"!==c)return void i.functions.wpmdb_call_next_hook();s=0,S=i.functions.get_tables_to_migrate(null,null)}var r=0;s===S.length-1&&(r=1);var l=0;-1!==t.inArray(a,["push","pull"])&&1===parseInt(i.common.connection_data.gzip)&&(l=1);var p={action:"wpmdb_migrate_table",migration_state_id:i.migration_state_id,table:S[s],stage:c,current_row:e,last_table:r,primary_keys:n,gzip:l,nonce:wpmdb_data.nonces.migrate_table};-1!==t.inArray(a,["push","pull"])&&(p.bottleneck=i.common.connection_data.bottleneck,p.prefix=i.common.connection_data.prefix),i.common.connection_data&&i.common.connection_data.path_current_site&&i.common.connection_data.domain&&(p.path_current_site=i.common.connection_data.path_current_site,p.domain_current_site=i.common.connection_data.domain),m=!0,t.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,timeout:0,data:p,error:function(e,t,n){var a=wpmdb_strings.table_process_problem+" "+S[s]+"<br /><br />"+wpmdb_strings.status+": "+e.status+" "+e.statusText+"<br /><br />"+wpmdb_strings.response+":<br />"+e.responseText;i.current_migration.setState(wpmdb_strings.migration_failed,a,"error"),m=!1,console.log(e),console.log(t),console.log(n),i.common.migration_error=!0,i.functions.migration_complete_events()},success:function(e){m=!1,e=t.trim(e);var n=i.functions.wpmdb_parse_json(e),o="";if(!1===n||null===n)return o=""===e||null===e?wpmdb_strings.table_process_problem_empty_response+" "+S[s]:K(e,null,null),i.current_migration.setState(wpmdb_strings.migration_failed,o,"error"),i.common.migration_error=!0,void i.functions.migration_complete_events();if(void 0!==n.wpmdb_error&&1===n.wpmdb_error)return i.current_migration.setState(wpmdb_strings.migration_failed,n.body,"error"),i.common.migration_error=!0,void i.functions.migration_complete_events();var l=S[s];"import"===a&&"find_replace"===c&&(l=l.replace(wpmdb_data.this_temp_prefix,"")),i.current_migration.setText(),i.current_migration.model.getStageModel(c).setItemRowsTransferred(l,n.current_row),1===r&&"savefile"===a&&(void 0!==n.dump_filename&&(x=n.dump_filename),void 0!==n.dump_path&&(k=n.dump_path)),-1===parseInt(n.current_row)&&(s++,n.current_row="",n.primary_keys=""),i.common.next_step_in_migration={fn:i.functions.migrate_table_recursive,args:[n.current_row,n.primary_keys,s]},i.functions.execute_next_step()}})},i.functions.migration_complete_events=function(){if(!1===i.common.migration_error)if(""===i.common.non_fatal_errors)if("savefile"!==a&&!0===t("#save_computer").is(":checked")&&i.current_migration.setText(),l+='&nbsp;<div class="dashicons dashicons-yes"></div>',!0===$){var e=wpmdb_strings.migration_cancelled_success;"find_replace"===a&&(e=wpmdb_strings.find_replace_cancelled_success),i.current_migration.setState(l,e,"cancelled")}else i.current_migration.setState(l,"","complete");else i.current_migration.setState(wpmdb_strings.completed_with_some_errors,i.common.non_fatal_errors,"error");t(".migration-controls").addClass("hidden"),i.common.hooks=[],i.common.call_stack=[],i.common.migration_error=!1,y=!1,v=!0,T=!1,$=!1,m=!1,i.common.non_fatal_errors="",S=[],t(".progress-label").remove(),t(".migration-progress-ajax-spinner").remove(),t(".close-progress-content").show(),t("#overlay").css("cursor","pointer"),i.current_migration.model.setMigrationComplete()},i.functions.migration_complete=function(){if(t(".migration-controls").addClass("hidden"),"savefile"===a){y=!1;var e=wpmdb_strings.migration_complete;if(t("#save_computer").is(":checked")){var n=wpmdb_data.this_download_url+encodeURIComponent(x);t("#gzip_file").is(":checked")&&(n+="&gzip=1"),window.location=n}else e=wpmdb_strings.completed_dump_located_at+" "+k;!1===i.common.migration_error&&(i.functions.migration_complete_events(),i.current_migration.setState(l,e,"complete"))}else{i.current_migration.setState(null,wpmdb_strings.finalizing_migration,"finalizing");var o={action:"wpmdb_finalize_migration",migration_state_id:i.migration_state_id,tables:S.join(","),nonce:wpmdb_data.nonces.finalize_migration};-1!==t.inArray(a,["push","pull"])&&(o.prefix=i.common.connection_data.prefix),m=!0,t.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:o,error:function(e,t,n){m=!1,i.current_migration.setState(wpmdb_strings.migration_failed,wpmdb_strings.finalize_tables_problem,"error"),alert(e+" : "+t+" : "+n),i.common.migration_error=!0,i.functions.migration_complete_events()},success:function(e){if(m=!1,"1"!==t.trim(e))return i.current_migration.setState(wpmdb_strings.migration_failed,e,"error"),i.common.migration_error=!0,void i.functions.migration_complete_events();i.common.next_step_in_migration={fn:i.functions.wpmdb_call_next_hook},i.functions.execute_next_step()}})}},i.functions.wpmdb_flush=function(){"savefile"!==a&&(i.current_migration.setText(wpmdb_strings.flushing),m=!0,t.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_flush",migration_state_id:i.migration_state_id,nonce:wpmdb_data.nonces.flush},error:function(e,t,n){m=!1,i.current_migration.setState(wpmdb_strings.migration_failed,wpmdb_strings.flush_problem,"error"),alert(e+" : "+t+" : "+n),i.common.migration_error=!0,i.functions.migration_complete_events()},success:function(e){if(m=!1,"1"!==t.trim(e))return i.current_migration.setState(wpmdb_strings.migration_failed,e,"error"),i.common.migration_error=!0,void i.functions.migration_complete_events();i.common.next_step_in_migration={fn:i.functions.wpmdb_call_next_hook},i.functions.execute_next_step()}}))},i.functions.execute_next_step=function(){if(0<I&&!1===E)setTimeout(function(){E=!0,i.functions.execute_next_step()},I);else if(E=!1,!0===T){t(".migration-progress-ajax-spinner").hide(),i.current_migration.pauseTimer();var e="";!0===q?(e=wpmdb_strings.paused_before_finalize,q=!1,"find_replace"===i.functions.wpmdb_migration_type()&&(e=wpmdb_strings.find_replace_paused_before_finalize)):e=wpmdb_strings.paused,i.current_migration.setState(null,e,"paused"),t("body").on("click",".pause-resume",function(e){me()}),t("body").on("click",".cancel",function(e){Y()}),t(".pause-resume").html(wpmdb_strings.resume)}else if(!0===$){var n;"savefile"===(a=i.functions.wpmdb_migration_type())?n=wpmdb_strings.removing_local_sql:"pull"===a?n="backup"===c?wpmdb_strings.removing_local_backup:wpmdb_strings.removing_local_temp_tables:"push"===a&&(n="backup"===c?wpmdb_strings.removing_remote_sql:wpmdb_strings.removing_remote_temp_tables),i.current_migration.setText(n);var o={action:"wpmdb_cancel_migration",migration_state_id:i.migration_state_id,nonce:wpmdb_data.nonces.cancel_migration};m=!0,t.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:o,error:function(e,t,n){i.current_migration.setState(wpmdb_strings.migration_cancellation_failed,wpmdb_strings.manually_remove_temp_files+"<br /><br />"+wpmdb_strings.status+": "+e.status+" "+e.statusText+"<br /><br />"+wpmdb_strings.response+":<br />"+e.responseText,"error"),console.log(e),console.log(t),console.log(n),m=!1,i.common.migration_error=!0,i.functions.migration_complete_events()},success:function(e){if(m=!1,e=t.trim(e),"push"===a&&"1"!==e||"push"!==a&&""!==e)return void 0!==e&&void 0!==e.wpmdb_error&&1===e.wpmdb_error&&(e=e.wpmdb_error),i.current_migration.setState(wpmdb_strings.migration_cancellation_failed,e,"error"),i.common.migration_error=!0,void i.functions.migration_complete_events();l=wpmdb_strings.migration_cancelled,"find_replace"===a&&(l=wpmdb_strings.find_replace_cancelled),i.functions.migration_complete_events(),i.current_migration.setStatus("cancelled")}})}else i.common.next_step_in_migration.fn.apply(null,i.common.next_step_in_migration.args)},i.functions.maybe_show_prefix_notice=function(e){var i=t(".prefix-notice");i.hide(),e!==wpmdb_data.this_prefix&&(t(".remote-prefix").html(e),!0,i.show())},i.functions.maybe_show_mst_warning=function(e){var n=i.functions.wpmdb_migration_type(),a=!1;return-1!==t.inArray(n,["push","pull"])&&void 0!==e.site_details?wpmdb_data.site_details.is_multisite!==e.site_details.is_multisite&&(void 0!==i.mst&&void 0!==e.mst_available&&"1"===e.mst_available||(a=!0)):"import"===n&&void 0!==e.multisite&&void 0!==e.subsite_export&&("false"===wpmdb_data.site_details.is_multisite&&"true"===e.multisite&&"true"!==e.subsite_export||"true"===wpmdb_data.site_details.is_multisite&&"false"===e.multisite)&&(a=!0),(a=t.wpmdb.apply_filters("wpmdb_show_mst_warning",a))&&t(".mst-required").show(),a},i.functions.maybe_show_select_table_notice=function(){if(t("#migrate-selected").is(":checked")&&null===t("#select-tables").val()){if("import"!==i.functions.wpmdb_migration_type())return alert(wpmdb_strings.please_select_one_table),!0;if(t("#import-find-replace").is(":checked")&&t("#select-tables").is(":visible"))return alert(wpmdb_strings.please_select_one_table_import),!0}return!("savefile"===i.functions.wpmdb_migration_type()||!t("#backup-manual-select").is(":checked")||null!==t("#select-backup").val())&&(alert(wpmdb_strings.please_select_one_table_backup),!0)},i.functions.remove_protocol=function(e){return e.replace(/^https?:/i,"")},i.functions.create_table_select=function(e,i,n){var a=document.createElement("select");return t(a).attr({multiple:"multiple",name:"select_tables[]",id:"select-tables",class:"multiselect"}),0<e.length&&t.each(e,function(e,o){if(!t.wpmdb.apply_filters("wpmdb_exclude_table",!1,o)){var s=" ";void 0!==n&&null!==n&&0<n.length&&-1!==t.inArray(o,n)&&(s=' selected="selected" ');var r="";0!==i.length&&(r=" ("+i[o]+")"),t(a).append("<option"+s+'value="'+o+'">'+o+r+"</option>")}}),a},i.functions.get_tables_to_migrate=function(e,n){var a=[],o=i.functions.wpmdb_migration_type();return"migrate_select"===t("input[name=table_migrate_option]:checked").val()?a=t("#select-tables").val():"pull"!==o&&void 0!==wpmdb_data.this_prefixed_tables?a=wpmdb_data.this_prefixed_tables:"pull"===o&&void 0!==i.common.connection_data&&void 0!==i.common.connection_data.prefixed_tables&&(a=i.common.connection_data.prefixed_tables),a},i.functions.update_migrate_button_text=function(){var e=i.functions.wpmdb_migration_type(),n=t("#save-migration-profile").is(":checked")?"_save":"",a="migrate_button_"+("savefile"===e?"export":e)+n;t(".migrate-db .button-primary").val(wpmdb_strings[a])},i.functions.connection_box_changed=function(){var e=t(".pull-push-connection-info");if(-1!==t.inArray(i.functions.wpmdb_migration_type(),["push","pull"])&&(!m&&!t(e).hasClass("temp-disabled")||!1!==i.force_reconnect)){i.force_reconnect=!1;var n,a=t(".pull-push-connection-info").val(),o=t.trim(a).split("\n"),s=!1,r="";if(""===o&&(s=!0,r=wpmdb_strings.connection_info_missing),1===o.length&&!s){var c=t.trim(a).split(" ");2===c.length&&(o=c)}2===o.length||s||(s=!0,r=wpmdb_strings.connection_info_incorrect),s||(n=o[0],/^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)){0})(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(n))||(s=!0,r=wpmdb_strings.connection_info_url_invalid);var l=0;if(void 0!==o[1]&&(l=o[1].length),s||32===l||40===l||(s=!0,r=wpmdb_strings.connection_info_key_invalid),s||o[0]!==wpmdb_data.connection_info[0]||(s=!0,r=wpmdb_strings.connection_info_local_url),s||o[1]!==wpmdb_data.connection_info[1]||(s=!0,r=wpmdb_strings.connection_info_local_key),s)return t(".connection-status").html(r),void t(".connection-status").addClass("notification-message error-notice migration-error");var d=o[0]+"\n"+o[1];1===t.trim(a).split("\n").length&&t(".pull-push-connection-info").val(d),!1===wpmdb_data.openssl_available&&(o[0]=o[0].replace("https://","http://"),d=o[0]+"\n"+o[1],t(".pull-push-connection-info").val(d)),!1,m=!0,le(),t(".basic-access-auth-wrapper").is(":visible")&&(o[0]=o[0].replace(/\/\/(.*)@/,"//"),o[0]=o[0].replace("//","//"+encodeURIComponent(t.trim(t(".auth-username").val()))+":"+encodeURIComponent(t.trim(t(".auth-password").val()))+"@"),d=o[0]+"\n"+o[1],t(".pull-push-connection-info").val(d),t(".basic-access-auth-wrapper").hide()),t(".step-two").hide(),t(".ssl-notice").hide(),t(".prefix-notice").hide(),t(".connection-status").show(),t(".connection-status").html(wpmdb_strings.establishing_remote_connection),t(".connection-status").removeClass("notification-message error-notice migration-error"),t(".connection-status").append(M);var u=i.functions.wpmdb_migration_type();return b=!1,t.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_verify_connection_to_remote_site",url:o[0],key:o[1],intent:u,nonce:wpmdb_data.nonces.verify_connection_to_remote_site},error:function(e,i,n){t(".connection-status").html(K(e.responseText,"(#100)",e)),t(".connection-status").addClass("notification-message error-notice migration-error"),t(".ajax-spinner").remove(),m=!1,pe()},success:function(e){if(t(".ajax-spinner").remove(),m=!1,pe(),void 0!==e.wpmdb_error&&1===e.wpmdb_error)return t(".connection-status").html(e.body),t(".connection-status").addClass("notification-message error-notice migration-error"),e.body.indexOf("401 Unauthorized")>-1&&t(".basic-access-auth-wrapper").show(),void(t(".pull-push-connection-info").hasClass("temp-disabled")||t(".connect-button").is(":visible")||(t(".pull-push-connection-info").removeAttr("readonly"),t(".connect-button").show()));if(!0!==i.functions.maybe_show_mst_warning(e)){W(o[0],o[1],e.scheme);var n=re(e.url);t(".create-new-profile").val(n),t(".pull-push-connection-info").addClass("temp-disabled"),t(".pull-push-connection-info").attr("readonly","readonly"),t(".connect-button").hide(),t(".connection-status").hide(),t(".step-two").show(),i.functions.maybe_show_prefix_notice(e.prefix),p=!0,ge(e),Z(),ee(),oe(),J(),Q=t(D).clone(),t(Q).attr({name:"select_backup[]",id:"select-backup"});var a=document.createElement("select");t(a).attr({multiple:"multiple",name:"select_post_types[]",id:"select-post-types",class:"multiselect"}),t.each(i.common.connection_data.post_types,function(e,i){t(a).append('<option value="'+i+'">'+i+"</option>")}),N=a,t("#new-path-missing-warning, #new-url-missing-warning").hide(),"pull"===i.functions.wpmdb_migration_type()?(t("#new-url").val(i.functions.remove_protocol(wpmdb_data.this_url)),t("#new-path").val(wpmdb_data.this_path),"true"===wpmdb_data.is_multisite&&(t("#new-domain").val(wpmdb_data.this_domain),t('.replace-row.pin .old-replace-col input[type="text"]').val(i.functions.remove_protocol(e.url))),t("#old-url").val(i.functions.remove_protocol(e.url)),t("#old-path").val(e.path),t.wpmdb.do_action("wpmdb_update_pull_table_select"),t("#select-post-types").remove(),t(".exclude-post-types-warning").after(N),i.functions.exclude_post_types_warning(),t(".table-prefix").html(e.prefix),t(".backup-table-prefix").html(wpmdb_data.site_details.prefix),t(".uploads-dir").html(wpmdb_data.this_uploads_dir)):(t("#new-url").val(i.functions.remove_protocol(e.url)),t("#new-path").val(e.path),"true"===wpmdb_data.is_multisite&&t('.replace-row.pin .old-replace-col input[type="text"]').val(i.functions.remove_protocol(wpmdb_data.this_url)),t.wpmdb.do_action("wpmdb_update_push_table_select"),t("#select-backup").remove(),t(".backup-tables-wrap").prepend(Q)),i.common.next_step_in_migration={fn:t.wpmdb.do_action,args:["verify_connection_to_remote_site",i.common.connection_data]},i.functions.execute_next_step()}else t(".connection-status").hide()}})}},t(document).ready(function(){i.migration_state_id="",t("#plugin-compatibility").change(function(e){var i="1",n=t(this).closest("td").next("td").find(".setting-status");t(this).is(":checked")||(i="0"),t(".plugin-compatibility-wrap").toggle(),n.find(".ajax-success-msg").remove(),n.append(M),t("#plugin-compatibility").attr("disabled","disabled"),t(".plugin-compatibility").addClass("disabled"),t.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_plugin_compatibility",install:i,nonce:wpmdb_data.nonces.plugin_compatibility},error:function(e,i,n){alert(wpmdb_strings.plugin_compatibility_settings_problem+"\r\n\r\n"+wpmdb_strings.status+" "+e.status+" "+e.statusText+"\r\n\r\n"+wpmdb_strings.response+"\r\n"+e.responseText),t(".ajax-spinner").remove(),t("#plugin-compatibility").removeAttr("disabled"),t(".plugin-compatibility").removeClass("disabled")},success:function(e){""!==t.trim(e)?alert(e):(n.append('<span class="ajax-success-msg">'+wpmdb_strings.saved+"</span>"),t(".ajax-success-msg").fadeOut(2e3,function(){t(this).remove()})),t(".ajax-spinner").remove(),t("#plugin-compatibility").removeAttr("disabled"),t(".plugin-compatibility").removeClass("disabled")}})}),t("#plugin-compatibility").is(":checked")&&t(".plugin-compatibility-wrap").show(),(0<=navigator.userAgent.indexOf("MSIE")||0<=navigator.userAgent.indexOf("Trident"))&&t(".ie-warning").show(),0===wpmdb_data.valid_licence&&t("#savefile").prop("checked",!0);var e=t(".max-request-size"),n=t(".slider",e);n.slider({range:"min",value:parseInt(wpmdb_data.max_request/1024),min:512,max:parseInt(wpmdb_data.bottleneck/1024),step:256,create:function(t,i){var n=fe(wpmdb_data.max_request/1024);de(e,wpmdb_data.max_request/1024,n.unit,n.amount)},slide:function(t,i){var n=fe(i.value);de(e,i.value,n.unit,n.amount)},stop:function(i,a){t(".slider-success-msg").remove(),t(".amount",e).after('<img src="'+O+'" alt="" class="slider-spinner general-spinner" />'),n.slider("disable"),t.ajax({url:ajaxurl,type:"POST",cache:!1,data:{action:"wpmdb_update_max_request_size",max_request_size:parseInt(a.value),nonce:wpmdb_data.nonces.update_max_request_size},error:function(i,a,o){n.slider("enable"),t(".slider-spinner",e).remove(),alert(wpmdb_strings.max_request_size_problem);var s=fe(wpmdb_data.max_request/1024);de(e,wpmdb_data.max_request/1024,s.unit,s.amount),n.slider("enable")},success:function(){n.slider("enable"),t(".slider-label-wrapper",e).append('<span class="slider-success-msg">'+wpmdb_strings.saved+"</span>"),t(".slider-success-msg",e).fadeOut(2e3,function(){t(this).remove()}),t(".slider-spinner",e).remove()}})}});var g=t(".delay-between-requests"),w=t(".slider",g);w.slider({range:"min",value:parseInt(wpmdb_data.delay_between_requests/1e3),min:0,max:10,step:1,create:function(e,t){de(g,wpmdb_data.delay_between_requests/1e3,"s")},slide:function(e,t){de(g,t.value,"s")},stop:function(e,i){t(".slider-success-msg").remove(),t(".amount",g).after('<img src="'+O+'" alt="" class="slider-spinner general-spinner" />'),w.slider("disable"),t.ajax({url:ajaxurl,type:"POST",cache:!1,data:{action:"wpmdb_update_delay_between_requests",delay_between_requests:parseInt(1e3*i.value),nonce:wpmdb_data.nonces.update_delay_between_requests},error:function(e,i,n){w.slider("enable"),t(".slider-spinner",g).remove(),alert(wpmdb_strings.delay_between_requests_problem),de(g,wpmdb_data.delay_between_requests/1e3,"s"),w.slider("enable")},success:function(){wpmdb_data.delay_between_requests=parseInt(1e3*i.value),w.slider("enable"),t(".slider-label-wrapper",g).append('<span class="slider-success-msg">'+wpmdb_strings.saved+"</span>"),t(".slider-success-msg",g).fadeOut(2e3,function(){t(this).remove()}),t(".slider-spinner",g).remove()}})}}),t(".help-tab .video").each(function(){var e=t(this),i=t(".video-viewer");t("a",this).click(function(n){n.preventDefault(),i.attr("src","//www.youtube.com/embed/"+e.data("video-id")+"?autoplay=1"),i.show();var a=i.offset();t(window).scrollTop(a.top-50)})}),t(".backup-options").show(),t(".keep-active-plugins").show(),"savefile"===i.functions.wpmdb_migration_type()&&(t(".backup-options").hide(),t(".keep-active-plugins").hide()),d=i.functions.wpmdb_migration_type(),t(".content-tab").on("click",".check-my-licence-again",function(e){e.preventDefault(),h=!1,t(e.target).replaceWith("Checking... "+M),ne(null)}),t.wpmdb.add_action("wpmdb_refresh_table_selects",J),t.wpmdb.add_action("wpmdb_update_push_table_select",function(){t("#select-tables").remove(),t(".select-tables-wrap").prepend(A),t("#select-tables").change()}),t.wpmdb.add_action("wpmdb_update_pull_table_select",function(){t("#select-tables").remove(),t(".select-tables-wrap").prepend(D),t("#select-tables").change()}),t.wpmdb.add_action("wpmdb_disable_table_migration_options",function(){t("#migrate-selected").parents(".option-section").children(".header-expand-collapse").children(".expand-collapse-arrow").removeClass("collapsed"),t(".table-select-wrap").show(),t("#migrate-only-with-prefix").prop("checked",!1),t("#migrate-selected").prop("checked",!0),t(".table-migrate-options").hide(),t(".select-tables-wrap").show()}),t.wpmdb.add_action("wpmdb_enable_table_migration_options",function(){t(".table-migrate-options").show()}),t.wpmdb.add_action("wpmdb_select_all_tables",function(){t("#select-tables").children("option").prop("selected",!0),t("#select-tables").change()}),t.wpmdb.add_filter("wpmdb_base_old_url",function(e,t){return i.functions.remove_protocol(wpmdb_data.this_url)}),function(){var e=i.functions.wpmdb_migration_type(),n=t.trim(t(".pull-push-connection-info").val()).split("\n");if("undefined"!=typeof wpmdb_default_profile&&!0!==wpmdb_default_profile&&"savefile"!==e&&"find_replace"!==e&&"import"!==e&&!m&&wpmdb_data.is_pro){m=!0,le(),t(".connection-status").html(wpmdb_strings.establishing_remote_connection),t(".connection-status").removeClass("notification-message error-notice migration-error"),t(".connection-status").append(M);var a=i.functions.wpmdb_migration_type();t.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_verify_connection_to_remote_site",url:n[0],key:n[1],intent:a,nonce:wpmdb_data.nonces.verify_connection_to_remote_site,convert_post_type_selection:wpmdb_convert_post_type_selection,profile:wpmdb_data.profile},error:function(e,i,n){t(".connection-status").html(K(e.responseText,"(#102)",e)),t(".connection-status").addClass("notification-message error-notice migration-error"),t(".ajax-spinner").remove(),m=!1,pe()},success:function(e){if(t(".ajax-spinner").remove(),m=!1,pe(),void 0!==e.wpmdb_error&&1===e.wpmdb_error)return t(".connection-status").html(e.body),t(".connection-status").addClass("notification-message error-notice migration-error"),void(e.body.indexOf("401 Unauthorized")>-1&&t(".basic-access-auth-wrapper").show());if(!0!==i.functions.maybe_show_mst_warning(e)){W(n[0],n[1],e.scheme),i.functions.maybe_show_prefix_notice(e.prefix),t(".pull-push-connection-info").addClass("temp-disabled"),t(".pull-push-connection-info").attr("readonly","readonly"),t(".connect-button").hide(),t(".connection-status").hide(),t(".step-two").show(),p=!0,ge(e),Z(),oe();var a="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_tables&&(a=wpmdb_loaded_tables),D=i.functions.create_table_select(i.common.connection_data.tables,i.common.connection_data.table_sizes_hr,a);var o="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_post_types&&(void 0!==e.select_post_types?(t("#exclude-post-types").attr("checked","checked"),t(".post-type-select-wrap").show(),o=e.select_post_types):o=wpmdb_loaded_post_types);var s=document.createElement("select");t(s).attr({multiple:"multiple",name:"select_post_types[]",id:"select-post-types",class:"multiselect"}),t.each(i.common.connection_data.post_types,function(e,i){var n=t.inArray(i,o);n=-1!==n||!0===wpmdb_convert_exclude_revisions&&"revision"!==i?' selected="selected" ':" ",t(s).append("<option"+n+'value="'+i+'">'+i+"</option>")}),N=s;var r="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_tables_backup&&(r=wpmdb_loaded_tables_backup);var c=document.createElement("select");t(c).attr({multiple:"multiple",name:"select_backup[]",id:"select-backup",class:"multiselect"}),t.each(i.common.connection_data.tables,function(e,n){var a=t.inArray(n,r);a=-1!==a?' selected="selected" ':" ",t(c).append("<option"+a+'value="'+n+'">'+n+" ("+i.common.connection_data.table_sizes_hr[n]+")</option>")}),Q=c,"pull"===i.functions.wpmdb_migration_type()?(t.wpmdb.do_action("wpmdb_update_pull_table_select"),t("#select-post-types").remove(),t(".exclude-post-types-warning").after(N),t("#select-backup").remove(),t(".backup-tables-wrap").prepend(R),t(".table-prefix").html(e.prefix),t(".uploads-dir").html(wpmdb_data.this_uploads_dir)):(t("#select-backup").remove(),t(".backup-tables-wrap").prepend(Q)),t.wpmdb.do_action("verify_connection_to_remote_site",i.common.connection_data)}else t(".connection-status").hide()}})}}(),t("body").on("click",".js-action-link",function(e){e.preventDefault(),t(this).blur()}),t(".licence-input").keypress(function(e){13===e.which&&(e.preventDefault(),t(".register-licence").click())}),t("body").on("click",".register-licence",function(e){if(e.preventDefault(),!u){var i=t.trim(t(".licence-input").val()),n=t(".licence-status");n.removeClass("notification-message error-notice success-notice"),""!==i?(n.empty().removeClass("success"),u=!0,t(".button.register-licence").after('<img src="'+O+'" alt="" class="register-licence-ajax-spinner general-spinner" />'),t.ajax({url:ajaxurl,type:"POST",dataType:"JSON",cache:!1,data:{action:"wpmdb_activate_licence",licence_key:i,nonce:wpmdb_data.nonces.activate_licence,context:"licence"},error:function(e,i,a){u=!1,t(".register-licence-ajax-spinner").remove(),n.html(wpmdb_strings.register_license_problem)},success:function(e){if(t(".register-licence-ajax-spinner").remove(),void 0!==e.errors){var a="";for(var o in e.errors)a+=e.errors[o];n.html(a),void 0!==e.masked_licence&&(se(e,i),t(".migrate-tab .invalid-licence").hide())}else void 0!==e.wpmdb_error&&void 0!==e.body?n.html(e.body):(1===Number(e.is_first_activation)&&(wpmdb_strings.welcome_text=wpmdb_strings.welcome_text.replace("%1$s","https://deliciousbrains.com/wp-migrate-db-pro/doc/quick-start-guide/?utm_campaign=support%2Bdocs&utm_source=MDB%2BPaid&utm_medium=insideplugin"),wpmdb_strings.welcome_text=wpmdb_strings.welcome_text.replace("%2$s","https://deliciousbrains.com/wp-migrate-db-pro/videos/?utm_campaign=support%2Bdocs&utm_source=MDB%2BPaid&utm_medium=insideplugin"),n.after('<div id="welcome-wrap"><img id="welcome-img" src="'+wpmdb_data.this_plugin_url+'asset/dist/img/mdb-banner.svg" /><div class="welcome-text"><h3>'+wpmdb_strings.welcome_title+"</h3><p>"+wpmdb_strings.welcome_text+"</p></div></div>")),n.html(wpmdb_strings.license_registered).delay(5e3).fadeOut(1e3,function(){t(this).css({visibility:"hidden",display:"block"}).slideUp()}),n.addClass("success notification-message success-notice"),se(e,i),t(".invalid-licence").hide());u=!1}})):n.html('<div class="notification-message error-notice">'+wpmdb_strings.enter_license_key+"</div>")}}),t(".clear-log").click(function(){t(".ajax-spinner, .ajax-success-msg").remove(),t(this).after(M),t(".debug-log-textarea").val(""),t.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_clear_log",nonce:wpmdb_data.nonces.clear_log},error:function(e,i,n){t(".ajax-spinner").remove(),alert(wpmdb_strings.clear_log_problem)},success:function(e){t(".ajax-spinner, .ajax-success-msg").remove(),L(),t(".clear-log").after('<span class="ajax-success-msg">'+wpmdb_strings.clear_error_log+"</span>"),t(".ajax-success-msg").fadeOut(2e3,function(){t(this).remove()})}})}),t(".multiselect-select-all").click(function(){var e=t(this).parents(".select-wrap").children(".multiselect");t("option",e).prop("selected",1),t(e).focus().trigger("change")}),t(".multiselect-deselect-all").click(function(){var e=t(this).parents(".select-wrap").children(".multiselect");t("option",e).removeAttr("selected"),t(e).focus().trigger("change")}),t(".multiselect-invert-selection").click(function(){var e=t(this).parents(".select-wrap").children(".multiselect");t("option",e).each(function(){t(this).attr("selected",!t(this).attr("selected"))}),t(e).focus().trigger("change")}),t(".option-group input[type=radio]").change(function(){var e=t(this).closest(".option-group");t("ul",e).hide();var i=t(this).closest("li");t("ul",i).show()}),t(".option-group").each(function(){t(".option-group input[type=radio]").each(function(){if(t(this).is(":checked")){var e=t(this).closest("li");t("ul",e).show()}})}),t(".header-expand-collapse").click(function(){var e=null;void 0!==t(this).data("next")&&(e=t(this).data("next")),t(".expand-collapse-arrow",this).hasClass("collapsed")?(t(".expand-collapse-arrow",this).removeClass("collapsed"),e?t(e).show():t(this).next().show()):(t(".expand-collapse-arrow",this).addClass("collapsed"),e?t(e).hide():t(this).next().hide())}),t(".checkbox-label input[type=checkbox]").change(function(){t(this).is(":checked")?t(this).parent().next().show():t(this).parent().next().hide()}),t(".select-post-types-wrap").on("change","#select-post-types",function(){i.functions.exclude_post_types_warning()}),t("#exclude-post-types").is(":checked")&&t("#select-post-types").val()&&t(".exclude-post-types-warning").css({display:"block",opacity:1}),t("#save-migration-profile").change(function(){i.functions.update_migrate_button_text(),t(this).is(":checked")?t(".save-settings-button").show():t(".save-settings-button").hide()}),t("#save-migration-profile").is(":checked")&&t(".save-settings-button").show(),t(".create-new-profile").focus(function(){t("#create_new").prop("checked",!0)}),t(".checkbox-label input[type=checkbox]").each(function(){t(this).is(":checked")&&t(this).parent().next().show()}),t(".migrate-db-button").click(function(e){if(t(this).blur(),e.preventDefault(),i.migration_state_id="",!1!==t.wpmdb.apply_filters("wpmdb_migration_profile_ready",!0)&&!0!==i.functions.maybe_show_select_table_notice()){var n=!1,p=!1;if(t("#new-url").length&&!t("#new-url").val()&&(t("#new-url-missing-warning").show(),t("#new-url").focus(),t("html,body").scrollTop(0),n=!0),t("#new-path").length&&!t("#new-path").val()&&(t("#new-path-missing-warning").show(),!1===n&&(t("#new-path").focus(),t("html,body").scrollTop(0)),p=!0),!0===n||!0===p){if("import"!==i.functions.wpmdb_migration_type())return;if(t("#import-find-replace").is(":checked"))return}t("#save-migration-profile").is(":checked")&&G(),r=t(t("#migrate-form")[0].elements).not(".auth-credentials").serialize(),a=i.functions.wpmdb_migration_type(),c="backup","savefile"===a&&(c="migrate"),!1===t("#create-backup").is(":checked")&&(c=-1!==t.inArray(a,["savefile","push","pull"])?"migrate":"import"===a?"upload":a),i.current_migration=i.migration_progress_controller.newMigration({localTableSizes:wpmdb_data.this_table_sizes,localTableRows:wpmdb_data.this_table_rows,remoteTableSizes:void 0!==i.common.connection_data?i.common.connection_data.table_sizes:null,remoteTableRows:void 0!==i.common.connection_data?i.common.connection_data.table_rows:null,migrationIntent:i.functions.wpmdb_migration_type()});var d=t("input[name=backup_option]:checked").val(),u=t("input[name=table_migrate_option]:checked").val(),_="",g="";"backup"===c&&("migrate_only_with_prefix"===u&&"backup_selected"===d&&"import"!==a&&(d="backup_only_with_prefix"),"push"===a?(g="remote","backup_only_with_prefix"===d?S=i.common.connection_data.prefixed_tables:"backup_selected"===d?(_=t("#select-tables").val(),_=t.wpmdb.apply_filters("wpmdb_backup_selected_tables",_),S=H(_,i.common.connection_data.tables)):"backup_manual_select"===d&&(S=t("#select-backup").val())):(g="local","backup_only_with_prefix"===d?S=wpmdb_data.this_prefixed_tables:"backup_selected"===d?(_=t("#select-tables").val(),_=t.wpmdb.apply_filters("wpmdb_backup_selected_tables",_),S=H(_,wpmdb_data.this_tables)):"backup_manual_select"===d&&(S=t("#select-backup").val())),i.current_migration.model.addStage("backup",S,g,{strings:{migrated:wpmdb_strings.backed_up}})),g="pull"===a?"remote":"local","find_replace"===a?i.current_migration.model.addStage("find_replace",i.functions.get_tables_to_migrate(null,null),g,{strings:{migrated:wpmdb_strings.searched,stage_title:wpmdb_strings.migrate_button_find_replace}}):-1!==t.inArray(a,["savefile","push","pull"])&&i.current_migration.model.addStage("migrate",i.functions.get_tables_to_migrate(null,null),g),t.wpmdb.do_action("wpmdb_add_migration_stages",{data_type:g,tables_to_migrate:i.functions.get_tables_to_migrate(null,null)});t("input[name=table_migrate_option]:checked").val();var f=t.trim(t(".pull-push-connection-info").val()).split("\n");o=f[0],s=f[1];var b=ce(o,a,"migrating");l=ce(o,a,"completed"),-1!==t.inArray(c,["find_replace","backup","migrate"])&&(S=i.current_migration.model.getStageItems(c,"name")),i.current_migration.model.setActiveStage(c),i.current_migration.setTitle(b),i.current_migration.startTimer(),y=!0,i.current_migration.setStatus("active");var h={action:"wpmdb_initiate_migration",intent:a,url:o,key:s,form_data:r,stage:c,nonce:wpmdb_data.nonces.initiate_migration};h.site_details={local:wpmdb_data.site_details},-1!==t.inArray(a,["push","pull"])&&(h.temp_prefix=i.common.connection_data.temp_prefix,h.site_details.remote=i.common.connection_data.site_details),h.site_details=JSON.stringify(h.site_details),h=t.wpmdb.apply_filters("wpmdb_initiate_migration_request_data",h,h),m=!0,t.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:h,error:function(e,t,n){i.current_migration.setState(wpmdb_strings.migration_failed,K(e.responseText,"(#112)",e),"error"),console.log(e),console.log(t),console.log(n),m=!1,i.common.migration_error=!0,i.functions.migration_complete_events()},success:function(e){if(m=!1,void 0!==e&&void 0!==e.wpmdb_error&&1===e.wpmdb_error)return i.common.migration_error=!0,i.functions.migration_complete_events(),void i.current_migration.setState(wpmdb_strings.migration_failed,e.body,"error");i.migration_state_id=e.migration_state_id;I=0,("savefile"!==a&&void 0!==i.common.connection_data&&void 0!==i.common.connection_data.delay_between_requests||"import"===a)&&(I="import"===a?wpmdb_data.delay_between_requests:Math.max(parseInt(wpmdb_data.delay_between_requests),parseInt(i.common.connection_data.delay_between_requests))),-1!==t.inArray(a,["savefile","push","pull","find_replace"])&&(i.common.next_step_in_migration={fn:i.functions.migrate_table_recursive,args:["-1",""]},i.functions.execute_next_step()),t.wpmdb.do_action("wpmdb_migration_initiated",c)}})}}),i.functions.update_migrate_button_text(),t("body").on("click",".close-progress-content-button",function(e){ie(),i.current_migration.restoreTitleElem(),i.functions.maybe_reload_page()}),t("body").on("click","#overlay",function(e){!0===v&&e.target===this&&(ie(),i.current_migration.restoreTitleElem(),i.functions.maybe_reload_page())}),t(".save-settings-button").click(function(e){if(e.preventDefault(),""===t.trim(t(".create-new-profile").val())&&t("#create_new").is(":checked"))return alert(wpmdb_strings.enter_name_for_profile),void t(".create-new-profile").focus();G()}),Z(),t(".migrate-selection.option-group input[type=radio]").change(function(){Z(),i.migration_selection=i.functions.wpmdb_migration_type(),p&&ee(),i.functions.update_migrate_button_text()}),"pull"!==i.functions.wpmdb_migration_type()&&"push"!==i.functions.wpmdb_migration_type()||p||(t(".step-two").hide(),t(".connection-status").show()),t(".general-helper").click(function(e){e.preventDefault();var i=t(this),n=t(this).next();t(".helper-message").not(n).hide();var a=i.position();if(n.hasClass("bottom")){var o=1;!0===n.hasClass("compatibility-help")?o=6:t(this).is(":first-child")&&(o=3),n.css({left:a.left-n.width()/2-o+"px",top:a.top+i.height()+9+"px"})}else n.css({left:a.left+i.width()+9+"px",top:a.top+i.height()/2-18+"px"});n.toggle(),e.stopPropagation()}),t("body").click(function(){t(".helper-message").hide()}),t(".helper-message").click(function(e){e.stopPropagation()}),t("body").on("click",".show-errors-toggle",function(e){e.preventDefault(),t(this).next(".migration-php-errors").toggle()}),t(".nav-tab").click(function(){var e=t(this).attr("data-div-name");e=e.replace("-tab",""),window.location.hash=e,te(e,!1)}),t("body").on("click",'a[href^="#"]',function(e){var i=t(e.target).attr("href").substr(1);if(i){var n=t("."+i);1===n.length&&(n.trigger("click"),e.preventDefault())}}),t("body").on("click",".add-row",function(){var e=t(this).parents("tr");e.before(t(".original-repeatable-field").clone().removeClass("original-repeatable-field")),e.prev().find(".old-replace-col input").focus()}),t("body").on("click",".replace-remove-row",function(){t(this).parents("tr").remove(),2>=t(".replace-row").length&&t(".no-replaces-message").show();var e=t(this).prev().attr("id");"new-url"!==e&&"new-path"!==e||t("#"+e+"-missing-warning").hide()}),t("body").on("change","#new-url",function(){t("#new-url-missing-warning").hide()}).on("change","#new-path",function(){t("#new-path-missing-warning").hide()}),t("body").on("click",".arrow-col",function(){if(!t(this).hasClass("disabled")){var e=t(this).prev("td").find("input").val(),i=t(this).next("td").find("input");i.val(e),"new-url"===i.prop("id")?t("#new-url-missing-warning").hide():"new-path"===i.prop("id")&&t("#new-path-missing-warning").hide()}}),t(".add-replace").click(function(){t(".replace-fields").prepend(t(".original-repeatable-field").clone().removeClass("original-repeatable-field")),t(".no-replaces-message").hide()}),t("#find-and-replace-sort tbody").sortable({items:"> tr:not(.pin)",handle:"td:first",start:function(){t(".sort-handle").css("cursor","-webkit-grabbing"),t(".sort-handle").css("cursor","-moz-grabbing")},stop:function(){t(".sort-handle").css("cursor","-webkit-grab"),t(".sort-handle").css("cursor","-moz-grab")}});window.location.hash&&te(window.location.hash.substring(1),!1),""!==function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))}("install-plugin")&&(h=!0,te("addons",!0)),t(".notice-link").click(function(e){e.preventDefault(),i.functions.ajax_handle_dismissible_notice(wpmdb_data.nonces.process_notice_link,function(e){t(e).closest(".inline-message").hide()},t(this))}),t("#connection_info").on("copy",function(e){var i=t(this).val().split("\n");if(2===i.length)try{e.originalEvent.clipboardData.setData("text/plain",i.join(" ")),e.preventDefault()}catch(e){}}),t(".reset-api-key").click(function(){confirm(wpmdb_strings.reset_api_key)&&!_&&(_=!0,t(".reset-api-key").after('<img src="'+O+'" alt="" class="reset-api-key-ajax-spinner general-spinner" />'),t.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_reset_api_key",nonce:wpmdb_data.nonces.reset_api_key},error:function(e,i,n){alert(wpmdb_strings.reset_api_key_problem),t(".reset-api-key-ajax-spinner").remove(),_=!1},success:function(e){t(".reset-api-key-ajax-spinner").remove(),_=!1,t(".connection-info").html(e),wpmdb_data.connection_info=t.trim(e).split("\n")}}))}),t(".copy-api-key").click(function(){var e=t(this),i=t("#connection_info"),n=i.val(),a=n.replace("\n"," ");i.val(a),i.select();try{document.execCommand("copy"),i.blur(),e.css("color","transparent");var o=t(".copy-api-key-confirmation").show();setTimeout(function(){o.fadeOut("fast"),setTimeout(function(){e.css("color","")},200)},1e3)}catch(e){alert("please press Ctrl/Cmd+C to copy")}i.val(n)}),t("input[name=table_migrate_option]").change(function(){t(".select-tables-wrap").hide(),"migrate_select"===t(this).val()&&t(".select-tables-wrap").show()}),t(".show-multiselect").each(function(){t(this).is(":checked")&&(t(this).parents(".option-section").children(".header-expand-collapse").children(".expand-collapse-arrow").removeClass("collapsed"),t(this).parents(".expandable-content").show(),t(this).parents(".expandable-content").children(".select-wrap").toggle())}),t("input[name=backup_option]").change(function(){t(".backup-tables-wrap").hide(),"backup_manual_select"===t(this).val()&&t(".backup-tables-wrap").show()}),t("#backup-manual-select").is(":checked")&&t(".backup-tables-wrap").show(),t(".plugin-compatibility-save").click(function(){if(!f){t(this).addClass("disabled");var e=t("#selected-plugins");t(e).attr("disabled","disabled"),t(".plugin-compatibility-success-msg").remove(),f=!0,t(this).after('<img src="'+O+'" alt="" class="plugin-compatibility-spinner general-spinner" />'),t.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_whitelist_plugins",whitelist_plugins:t(e).val(),nonce:wpmdb_data.nonces.whitelist_plugins},error:function(i,n,a){alert(wpmdb_strings.blacklist_problem+"\r\n\r\n"+wpmdb_strings.status+" "+i.status+" "+i.statusText+"\r\n\r\n"+wpmdb_strings.response+"\r\n"+i.responseText),t(e).removeAttr("disabled"),t(".plugin-compatibility-save").removeClass("disabled"),f=!1,t(".plugin-compatibility-spinner").remove()},success:function(i){""!==t.trim(i)&&alert(i),t(e).removeAttr("disabled"),t(".plugin-compatibility-save").removeClass("disabled"),f=!1,t(".plugin-compatibility-spinner").remove(),t(".plugin-compatibility-save").after('<span class="plugin-compatibility-success-msg">'+wpmdb_strings.saved+"</span>"),t(".plugin-compatibility-success-msg").fadeOut(2e3)}})}}),t("body").on("click",".delete-profile",function(){var e=t(this).next().clone();if(t("input",e).remove(),e=t.trim(t(e).html()),confirm(wpmdb_strings.remove_profile.replace("{{profile}}",e))){var i=t(this).parent();if(i.find("input:checked").length){var n=i.siblings().last();if(n.find("input[type=radio]").prop("checked","checked"),n.find("input[type=text]").focus(),t("#migrate-form .crumbs .crumb:last").text("New Profile"),"function"==typeof window.history.pushState){var a=window.location.href.replace("#migrate","").replace(/&wpmdb-profile=-?\d+/,"")+"&wpmdb-profile=-1";window.history.pushState({updated_profile_id:-1},null,a)}}i.fadeOut(500),t.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_delete_migration_profile",profile_id:t(this).attr("data-profile-id"),nonce:wpmdb_data.nonces.delete_migration_profile},error:function(e,t,i){alert(wpmdb_strings.remove_profile_problem)},success:function(e){"-1"===e&&alert(wpmdb_strings.remove_profile_not_found)}})}}),t(".main-list-delete-profile-link").click(function(){var e=t(this).prev().html();confirm(wpmdb_strings.remove_profile.replace("{{profile}}",e))&&(t(this).parent().fadeOut(500),t.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_delete_migration_profile",profile_id:t(this).attr("data-profile-id"),nonce:wpmdb_data.nonces.delete_migration_profile},error:function(e,t,i){alert(wpmdb_strings.remove_profile_problem)}}))}),t("body").on("click",".temp-disabled",function(){confirm(wpmdb_strings.change_connection_info)&&(t(".ssl-notice").hide(),t(".different-plugin-version-notice").hide(),t(".migrate-db-button").show(),t(".temp-disabled").removeAttr("readonly"),t(".temp-disabled").removeClass("temp-disabled"),t(".connect-button").show(),t(".step-two").hide(),t(".connection-status").show().html(wpmdb_strings.enter_connection_info),p=!1)}),t(".settings-tab input[type=checkbox]").change(function(){if("plugin-compatibility"!==t(this).attr("id")){var e=t(this).is(":checked"),i=t(this).attr("id"),n=t(this).closest("td").next("td").find(".setting-status");t(".ajax-success-msg").remove(),n.after(M),t.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_setting",checked:e,setting:i,nonce:wpmdb_data.nonces.save_setting},error:function(e,i,n){alert(wpmdb_strings.save_settings_problem),t(".ajax-spinner").remove()},success:function(e){t(".ajax-spinner").remove(),n.append('<span class="ajax-success-msg">'+wpmdb_strings.saved+"</span>"),t(".ajax-success-msg").fadeOut(2e3,function(){t(this).remove()})}})}}),t(".migrate-form").submit(function(e){e.preventDefault()}),t(".connect-button").click(function(e){e.preventDefault(),t(this).blur(),i.functions.connection_box_changed()}),t(".pull-push-connection-info").bind("paste",function(e){setTimeout(function(){i.functions.connection_box_changed()},0)}),t("body").on("click",".try-again",function(){t(".pull-push-connection-info").removeClass("temp-disabled"),i.functions.connection_box_changed()}),t("body").on("click",".try-http",function(){var e=t.trim(t(".pull-push-connection-info").val()).split("\n"),n=e[0].replace("https","http")+"\n"+e[1];t(".pull-push-connection-info").val(n),i.functions.connection_box_changed()}),t(".create-new-profile").change(function(){b=!0}),t("body").on("click",".temporarily-disable-ssl",function(){var e="";window.location.hash&&(e=window.location.hash.substring(1)),t(this).attr("href",t(this).attr("href")+"&hash="+e)}),t("body").on("click",".pause-resume",function(e){me()}),t("body").on("click",".cancel",function(e){Y()}),t(".enter-licence").click(function(){t(".settings").click(),t(".licence-input").focus()}),t("body").on("click",".copy-licence-to-remote-site",function(){t(".connection-status").html(wpmdb_strings.copying_license),t(".connection-status").removeClass("notification-message error-notice migration-error"),t(".connection-status").append(M);var e=t.trim(t(".pull-push-connection-info").val()).split("\n");m=!0,le(),t.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_copy_licence_to_remote_site",url:e[0],key:e[1],nonce:wpmdb_data.nonces.copy_licence_to_remote_site},error:function(e,i,n){t(".connection-status").html(K(e.responseText,"(#143)",e)),t(".connection-status").addClass("notification-message error-notice migration-error"),t(".ajax-spinner").remove(),m=!1,pe()},success:function(e){if(t(".ajax-spinner").remove(),m=!1,pe(),void 0!==e.wpmdb_error&&1===e.wpmdb_error)return t(".connection-status").html(e.body),t(".connection-status").addClass("notification-message error-notice migration-error"),void(e.body.indexOf("401 Unauthorized")>-1&&t(".basic-access-auth-wrapper").show());i.functions.connection_box_changed()}})}),t("body").on("click",".reactivate-licence",function(e){m=!0,t(".invalid-licence").empty().html(wpmdb_strings.attempting_to_activate_licence),t(".invalid-licence").append(M),t.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_reactivate_licence",nonce:wpmdb_data.nonces.reactivate_licence},error:function(e,i,n){t(".invalid-licence").html(wpmdb_strings.activate_licence_problem),t(".invalid-licence").append("<br /><br />"+wpmdb_strings.status+": "+e.status+" "+e.statusText+"<br /><br />"+wpmdb_strings.response+"<br />"+e.responseText),t(".ajax-spinner").remove(),m=!1},success:function(e){if(t(".ajax-spinner").remove(),m=!1,void 0===e.wpmdb_error||1!==e.wpmdb_error){if(void 0!==e.wpmdb_dbrains_api_down&&1===e.wpmdb_dbrains_api_down)return t(".invalid-licence").html(wpmdb_strings.temporarily_activated_licence),void t(".invalid-licence").append(e.body);t(".invalid-licence").empty().html(wpmdb_strings.licence_reactivated),location.reload()}else t(".invalid-licence").html(e.body)}})}),t("input[name=table_migrate_option]").change(function(){oe(),t.wpmdb.do_action("wpmdb_tables_to_migrate_changed")}),t("body").on("change","#select-tables",function(){oe(),t.wpmdb.do_action("wpmdb_tables_to_migrate_changed")}),t.wpmdb.add_filter("wpmdb_get_table_prefix",ue),t.wpmdb.add_filter("wpmdb_get_tables_to_migrate",i.functions.get_tables_to_migrate),t.wpmdb.add_action("wpmdb_lock_replace_url",_e),t.wpmdb.add_action("wpmdb_pin_replace_url",U),t.wpmdb.add_action("move_connection_info_box",i.functions.exclude_post_types_warning),t.wpmdb.add_filter("wpmdb_before_migration_complete_hooks",function(e){return!0===!!t("input[name=pause_before_finalize]:checked").length&&"savefile"!==a&&(me(),q=!0),e}),t(".wpmdb-switch").on("click",function(e){t(this).hasClass("disabled")||function(e){var i=t("#"+e),n=i.find("input[type=checkbox]");i.toggleClass("on").find("span").toggleClass("checked");var a=i.find("span.on").hasClass("checked");n.attr("checked",a).trigger("change")}(t(this).attr("id"))})})}(jQuery,wpmdb)},{"MigrationProgress-controller":6}]},{},[1,2,3,4,5,12,13,14]);
class/wpmdb-base.php CHANGED
@@ -87,6 +87,7 @@ class WPMDB_Base {
87
  'plugin_version',
88
  'error',
89
  'state_data',
 
90
  );
91
 
92
  //Setup strings for license responses
@@ -95,8 +96,8 @@ class WPMDB_Base {
95
 
96
  public function setup_license_responses() {
97
 
98
- $disable_ssl_url = network_admin_url( $this->plugin_base . '&nonce=' . wp_create_nonce( 'wpmdb-disable-ssl' ) . '&wpmdb-disable-ssl=1' );
99
- $check_licence_again_url = network_admin_url( $this->plugin_base . '&nonce=' . wp_create_nonce( 'wpmdb-check-licence' ) . '&wpmdb-check-licence=1' );
100
 
101
  // List of potential license responses. Keys must must exist in both arrays, otherwise the default error message will be shown.
102
  $this->license_response_messages = array(
@@ -244,15 +245,15 @@ class WPMDB_Base {
244
  $this->addons = array(
245
  'wp-migrate-db-pro-media-files/wp-migrate-db-pro-media-files.php' => array(
246
  'name' => 'Media Files',
247
- 'required_version' => '1.4.8',
248
  ),
249
  'wp-migrate-db-pro-cli/wp-migrate-db-pro-cli.php' => array(
250
  'name' => 'CLI',
251
- 'required_version' => '1.3.1',
252
  ),
253
  'wp-migrate-db-pro-multisite-tools/wp-migrate-db-pro-multisite-tools.php' => array(
254
  'name' => 'Multisite Tools',
255
- 'required_version' => '1.1.6',
256
  ),
257
  );
258
 
@@ -933,7 +934,7 @@ class WPMDB_Base {
933
  }
934
  }
935
 
936
- $disable_ssl_url = network_admin_url( $this->plugin_base . '&nonce=' . wp_create_nonce( 'wpmdb-disable-ssl' ) . '&wpmdb-disable-ssl=1' );
937
  $connection_failed_message = '<div class="updated warning inline-message">';
938
  $connection_failed_message .= sprintf( __( '<strong>Could not connect to api.deliciousbrains.com</strong> &mdash; You will not receive update notifications or be able to activate your license until this is fixed. This issue is often caused by an improperly configured SSL server (https). We recommend <a href="%1$s" target="_blank">fixing the SSL configuration on your server</a>, but if you need a quick fix you can:%2$s', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/could-not-connect-deliciousbrains-com/?utm_campaign=error%2Bmessages&utm_source=MDB%2BPaid&utm_medium=insideplugin', sprintf( '<p><a href="%1$s" class="temporarily-disable-ssl button">%2$s</a></p>', $disable_ssl_url, __( 'Temporarily disable SSL for connections to api.deliciousbrains.com', 'wp-migrate-db' ) ) );
939
  $connection_failed_message .= '</div>';
@@ -1539,7 +1540,7 @@ class WPMDB_Base {
1539
  return;
1540
  }
1541
 
1542
- $result = check_ajax_referer( $action, 'nonce', false );
1543
 
1544
  if ( false === $result ) {
1545
  $return = array( 'wpmdb_error' => 1, 'body' => sprintf( __( 'Invalid nonce for: %s', 'wp-migrate-db' ), $action ) );
87
  'plugin_version',
88
  'error',
89
  'state_data',
90
+ 'is_pro',
91
  );
92
 
93
  //Setup strings for license responses
96
 
97
  public function setup_license_responses() {
98
 
99
+ $disable_ssl_url = network_admin_url( $this->plugin_base . '&nonce=' . WPMDB_Utils::create_nonce( 'wpmdb-disable-ssl' ) . '&wpmdb-disable-ssl=1' );
100
+ $check_licence_again_url = network_admin_url( $this->plugin_base . '&nonce=' . WPMDB_Utils::create_nonce( 'wpmdb-check-licence' ) . '&wpmdb-check-licence=1' );
101
 
102
  // List of potential license responses. Keys must must exist in both arrays, otherwise the default error message will be shown.
103
  $this->license_response_messages = array(
245
  $this->addons = array(
246
  'wp-migrate-db-pro-media-files/wp-migrate-db-pro-media-files.php' => array(
247
  'name' => 'Media Files',
248
+ 'required_version' => '1.4.9',
249
  ),
250
  'wp-migrate-db-pro-cli/wp-migrate-db-pro-cli.php' => array(
251
  'name' => 'CLI',
252
+ 'required_version' => '1.3.2',
253
  ),
254
  'wp-migrate-db-pro-multisite-tools/wp-migrate-db-pro-multisite-tools.php' => array(
255
  'name' => 'Multisite Tools',
256
+ 'required_version' => '1.2',
257
  ),
258
  );
259
 
934
  }
935
  }
936
 
937
+ $disable_ssl_url = network_admin_url( $this->plugin_base . '&nonce=' . WPMDB_Utils::create_nonce( 'wpmdb-disable-ssl' ) . '&wpmdb-disable-ssl=1' );
938
  $connection_failed_message = '<div class="updated warning inline-message">';
939
  $connection_failed_message .= sprintf( __( '<strong>Could not connect to api.deliciousbrains.com</strong> &mdash; You will not receive update notifications or be able to activate your license until this is fixed. This issue is often caused by an improperly configured SSL server (https). We recommend <a href="%1$s" target="_blank">fixing the SSL configuration on your server</a>, but if you need a quick fix you can:%2$s', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/could-not-connect-deliciousbrains-com/?utm_campaign=error%2Bmessages&utm_source=MDB%2BPaid&utm_medium=insideplugin', sprintf( '<p><a href="%1$s" class="temporarily-disable-ssl button">%2$s</a></p>', $disable_ssl_url, __( 'Temporarily disable SSL for connections to api.deliciousbrains.com', 'wp-migrate-db' ) ) );
940
  $connection_failed_message .= '</div>';
1540
  return;
1541
  }
1542
 
1543
+ $result = WPMDB_Utils::check_ajax_referer( $action, 'nonce', false );
1544
 
1545
  if ( false === $result ) {
1546
  $return = array( 'wpmdb_error' => 1, 'body' => sprintf( __( 'Invalid nonce for: %s', 'wp-migrate-db' ), $action ) );
class/wpmdb-compatibility-plugin-manager.php CHANGED
@@ -66,7 +66,7 @@ class WPMDB_Compatibility_Plugin_Manager {
66
  */
67
  public function is_muplugin_installed() {
68
  $plugins = wp_get_mu_plugins();
69
- $muplugin_filename = 'wp-migrate-db-pro-compatibility.php';
70
  $installed = false;
71
 
72
  foreach ( $plugins as $plugin ) {
@@ -201,6 +201,13 @@ class WPMDB_Compatibility_Plugin_Manager {
201
  return sprintf( __( 'The compatibility plugin could not be activated because your mu-plugin directory is currently not writable. Please update the permissions of the mu-plugins folder: %s', 'wp-migrate-db' ), $this->mu_plugin_dir );
202
  }
203
 
 
 
 
 
 
 
 
204
  if ( $this->is_muplugin_update_required() ) {
205
  // Update version number in the database
206
  $wpmdb_settings['compatibility_plugin_version'] = $this->compatibility_plugin_version;
66
  */
67
  public function is_muplugin_installed() {
68
  $plugins = wp_get_mu_plugins();
69
+ $muplugin_filename = basename( $this->mu_plugin_dest );
70
  $installed = false;
71
 
72
  foreach ( $plugins as $plugin ) {
201
  return sprintf( __( 'The compatibility plugin could not be activated because your mu-plugin directory is currently not writable. Please update the permissions of the mu-plugins folder: %s', 'wp-migrate-db' ), $this->mu_plugin_dir );
202
  }
203
 
204
+ //Rename muplugin in header
205
+ if ( ! $this->wpmdb->get( 'is_pro' ) ) {
206
+ $mu_contents = file_get_contents( $this->mu_plugin_dest );
207
+ $mu_contents = str_replace( 'Plugin Name: WP Migrate DB Pro Compatibility', 'Plugin Name: WP Migrate DB Compatibility', $mu_contents );
208
+ file_put_contents( $this->mu_plugin_dest, $mu_contents );
209
+ }
210
+
211
  if ( $this->is_muplugin_update_required() ) {
212
  // Update version number in the database
213
  $wpmdb_settings['compatibility_plugin_version'] = $this->compatibility_plugin_version;
class/wpmdb-compatibility.php CHANGED
@@ -19,6 +19,10 @@ class WPMDB_Compatibility {
19
  add_action( 'muplugins_loaded', array( $this, 'wpmdbc_set_default_whitelist' ), 5 );
20
  add_action( 'muplugins_loaded', array( $this, 'wpmdbc_plugins_loaded' ), 10 );
21
  add_action( 'after_setup_theme', array( $this, 'wpmdbc_after_theme_setup' ) );
 
 
 
 
22
  }
23
 
24
  /**
@@ -188,11 +192,7 @@ class WPMDB_Compatibility {
188
  * @return bool
189
  */
190
  public function wpmdbc_is_wpmdb_ajax_call() {
191
- if ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) && ( isset( $_POST['action'] ) && false !== strpos( $_POST['action'], 'wpmdb' ) ) ) {
192
- return true;
193
- }
194
-
195
- return false;
196
  }
197
 
198
  /**
19
  add_action( 'muplugins_loaded', array( $this, 'wpmdbc_set_default_whitelist' ), 5 );
20
  add_action( 'muplugins_loaded', array( $this, 'wpmdbc_plugins_loaded' ), 10 );
21
  add_action( 'after_setup_theme', array( $this, 'wpmdbc_after_theme_setup' ) );
22
+
23
+ if ( ! class_exists( 'WPMDB_Utils' ) ) {
24
+ require_once( dirname( __FILE__ ) . '/wpmdb-utils.php' );
25
+ }
26
  }
27
 
28
  /**
192
  * @return bool
193
  */
194
  public function wpmdbc_is_wpmdb_ajax_call() {
195
+ return WPMDB_Utils::is_wpmdb_ajax_call();
 
 
 
 
196
  }
197
 
198
  /**
class/wpmdb-replace.php CHANGED
@@ -256,10 +256,18 @@ final class WPMDB_Replace {
256
  if ( is_string( $data ) && ( $unserialized = WPMDB_Utils::unserialize( $data, __METHOD__ ) ) !== false ) {
257
  // PHP currently has a bug that doesn't allow you to clone the DateInterval / DatePeriod classes.
258
  // We skip them here as they probably won't need data to be replaced anyway
259
- if ( is_object( $unserialized ) ) {
260
  if ( $unserialized instanceof DateInterval || $unserialized instanceof DatePeriod ) {
261
  return $data;
262
  }
 
 
 
 
 
 
 
 
263
  }
264
  $data = $this->recursive_unserialize_replace( $unserialized, true, true, $successive_filter );
265
  } elseif ( is_array( $data ) ) {
256
  if ( is_string( $data ) && ( $unserialized = WPMDB_Utils::unserialize( $data, __METHOD__ ) ) !== false ) {
257
  // PHP currently has a bug that doesn't allow you to clone the DateInterval / DatePeriod classes.
258
  // We skip them here as they probably won't need data to be replaced anyway
259
+ if ( 'object' == gettype( $unserialized ) ) {
260
  if ( $unserialized instanceof DateInterval || $unserialized instanceof DatePeriod ) {
261
  return $data;
262
  }
263
+ if ( $unserialized instanceof __PHP_Incomplete_Class && defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) {
264
+ $objectName = array();
265
+ preg_match( '/O:\d+:\"([^\"]+)\"/', $data, $objectName );
266
+ $objectName = $objectName[1] ? $objectName[1] : $data;
267
+ $error = sprintf( __( "WP Migrate DB - Failed to instantiate object for replacement. If the serialized object's class is defined by a plugin, you should enable that plugin for migration requests. \nClass Name: %s", 'wp-migrate-db' ), $objectName );
268
+ error_log( $error );
269
+ return $data;
270
+ }
271
  }
272
  $data = $this->recursive_unserialize_replace( $unserialized, true, true, $successive_filter );
273
  } elseif ( is_array( $data ) ) {
class/wpmdb-utils.php CHANGED
@@ -116,8 +116,8 @@ class WPMDB_Utils {
116
 
117
  return @gzdecode( $data );
118
  }
119
-
120
- /*
121
  * Require wpmdb-wpdb and create new instance
122
  *
123
  * @return WPMDB_WPDB
@@ -144,4 +144,94 @@ class WPMDB_Utils {
144
 
145
  return $string;
146
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  }
116
 
117
  return @gzdecode( $data );
118
  }
119
+
120
+ /**
121
  * Require wpmdb-wpdb and create new instance
122
  *
123
  * @return WPMDB_WPDB
144
 
145
  return $string;
146
  }
147
+
148
+ /**
149
+ * Runs WPs create nonce with all filters removed
150
+ *
151
+ * @param string|int $action Scalar value to add context to the nonce.
152
+ *
153
+ * @return string The Token
154
+ */
155
+ public static function create_nonce( $action = - 1 ) {
156
+ global $wp_filter;
157
+ $filter_backup = $wp_filter;
158
+ static::filter_nonce_filters();
159
+ $return = wp_create_nonce( $action );
160
+ $wp_filter = $filter_backup;
161
+
162
+ return $return;
163
+ }
164
+
165
+ /**
166
+ * Runs WPs check ajax_referer [sic] with all filters removed
167
+ *
168
+ * @param int|string $action Action nonce.
169
+ * @param false|string $query_arg Optional. Key to check for the nonce in `$_REQUEST` (since 2.5). If false,
170
+ * `$_REQUEST` values will be evaluated for '_ajax_nonce', and '_wpnonce'
171
+ * (in that order). Default false.
172
+ * @param bool $die Optional. Whether to die early when the nonce cannot be verified.
173
+ * Default true.
174
+ *
175
+ * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
176
+ * 0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
177
+ */
178
+ public static function check_ajax_referer( $action = - 1, $query_arg = false, $die = true ) {
179
+ global $wp_filter;
180
+ $filter_backup = $wp_filter;
181
+ static::filter_nonce_filters();
182
+ $return = check_ajax_referer( $action, $query_arg, $die );
183
+ $wp_filter = $filter_backup;
184
+
185
+ return $return;
186
+ }
187
+
188
+ /**
189
+ * Removes filters from $wp_filter that might interfere with wpmdb nonce generation/checking
190
+ */
191
+ private static function filter_nonce_filters() {
192
+ global $wp_filter;
193
+ $filtered_filters = apply_filters( 'wpmdb_filtered_filters', array(
194
+ 'nonce_life',
195
+ ) );
196
+ foreach ( $filtered_filters as $filter ) {
197
+ unset( $wp_filter[ $filter ] );
198
+ }
199
+ }
200
+
201
+ /**
202
+ *
203
+ * Checks if the current request is a WPMDB request
204
+ *
205
+ * @return bool
206
+ */
207
+ public static function is_wpmdb_ajax_call() {
208
+ if (
209
+ ( defined( 'DOING_AJAX' ) && DOING_AJAX )
210
+ && ( isset( $_POST['action'] )
211
+ && false !== strpos( $_POST['action'], 'wpmdb' ) )
212
+ ) {
213
+ return true;
214
+ }
215
+
216
+ return false;
217
+ }
218
+
219
+ /**
220
+ *
221
+ * Sets 'Expect' header to an empty string which some server/host setups require
222
+ *
223
+ * Called from the `http_request_args` filter
224
+ *
225
+ * @param $r
226
+ * @param $url
227
+ *
228
+ * @return mixed
229
+ */
230
+ public static function preempt_expect_header( $r, $url ) {
231
+ if ( self::is_wpmdb_ajax_call() ) {
232
+ $r['headers']['Expect'] = '';
233
+ }
234
+
235
+ return $r;
236
+ }
237
  }
class/wpmdb.php CHANGED
@@ -35,6 +35,9 @@ class WPMDB extends WPMDB_Base {
35
  $this->plugin_version = $GLOBALS['wpmdb_meta'][ $this->core_slug ]['version'];
36
  $this->max_insert_string_len = 50000; // 50000 is the default as defined by PhpMyAdmin
37
 
 
 
 
38
  add_filter( 'plugin_action_links_' . $this->plugin_basename, array( $this, 'plugin_action_links' ) );
39
  add_filter( 'network_admin_plugin_action_links_' . $this->plugin_basename, array( $this, 'plugin_action_links' ) );
40
 
@@ -95,6 +98,7 @@ class WPMDB extends WPMDB_Base {
95
  'backup_option' => 'backup_only_with_prefix',
96
  'exclude_transients' => '1',
97
  'compatibility_older_mysql' => '0',
 
98
  );
99
 
100
  $this->checkbox_options = array(
@@ -144,28 +148,25 @@ class WPMDB extends WPMDB_Base {
144
  $this->compatibility_plugin_manager = new WPMDB_Compatibility_Plugin_Manager( $this );
145
  }
146
 
147
- // Add some custom JS into the WP admin pages
148
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_common_js' ) );
149
-
150
  add_action( 'wp_ajax_wpmdb_process_notice_link', array( $this, 'ajax_process_notice_link' ) );
151
  }
152
 
153
- public function enqueue_common_js( $hook ) {
154
-
155
- if ( 'plugins.php' != $hook ) {
156
- return;
 
 
 
 
 
 
 
 
 
157
  }
158
 
159
- $ver_string = '-' . str_replace( '.', '', $this->plugin_version );
160
- $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
161
-
162
- $src = plugins_url( "asset/dist/js/common{$ver_string}{$min}.js", dirname( __FILE__ ) );
163
- wp_enqueue_script( 'wp-migrate-db-pro-common', $src, array( 'jquery' ), false, true );
164
-
165
- $src = plugins_url( "asset/dist/js/dismissable-notices{$ver_string}{$min}.js", dirname( __FILE__ ) );
166
- wp_enqueue_script( 'wp-migrate-db-pro-dismissable-notices', $src, array( 'jquery' ), false, true );
167
-
168
- wp_localize_script( 'wp-migrate-db-pro-dismissable-notices', 'wpmdb_nonces', array( 'process_notice_link' => wp_create_nonce( 'process-notice-link' ) ) );
169
  }
170
 
171
  /**
@@ -1555,7 +1556,7 @@ class WPMDB extends WPMDB_Base {
1555
  *
1556
  * @param array $preserved_options_data
1557
  *
1558
- * return array
1559
  */
1560
  function preserve_wpmdb_plugins( $preserved_options_data ) {
1561
  $keep_active_plugins = $this->profile_value( 'keep_active_plugins' );
@@ -1766,18 +1767,21 @@ class WPMDB extends WPMDB_Base {
1766
 
1767
  if ( is_multisite() ) {
1768
  $tables = $this->get_tables( 'prefix' );
1769
- $sql = "SELECT `post_type` FROM `{$wpdb->base_prefix}posts` ";
 
1770
  $prefix_escaped = preg_quote( $wpdb->base_prefix, '/' );
1771
 
1772
  foreach ( $tables as $table ) {
1773
  if ( 0 == preg_match( '/' . $prefix_escaped . '[0-9]+_posts/', $table ) ) {
1774
  continue;
1775
  }
1776
- $blog_id = str_replace( array( $wpdb->base_prefix, '_posts' ), array( '', '' ), $table );
1777
- $sql .= "UNION SELECT `post_type` FROM `{$wpdb->base_prefix}" . $blog_id . '_posts` ';
 
 
 
 
1778
  }
1779
- $sql .= ';';
1780
- $post_types = $wpdb->get_results( $sql, ARRAY_A );
1781
  } else {
1782
  $post_types = $wpdb->get_results(
1783
  "SELECT DISTINCT `post_type`
@@ -3052,6 +3056,12 @@ class WPMDB extends WPMDB_Base {
3052
 
3053
  $this->stow( '# Protocol: ' . $protocol . "\n", false );
3054
 
 
 
 
 
 
 
3055
  $this->stow( "# --------------------------------------------------------\n\n", false );
3056
  $this->stow( "/*!40101 SET NAMES $charset */;\n\n", false );
3057
  $this->stow( "SET sql_mode='NO_AUTO_VALUE_ON_ZERO';\n\n", false );
@@ -3445,23 +3455,11 @@ class WPMDB extends WPMDB_Base {
3445
  $src = $plugins_url . 'asset/dist/css/styles.css';
3446
  wp_enqueue_style( 'wp-migrate-db-pro-styles', $src, array(), $version );
3447
 
3448
- $src = $plugins_url . "asset/dist/js/common{$ver_string}{$min}.js";
3449
- wp_enqueue_script( 'wp-migrate-db-pro-common', $src, null, $version, true );
3450
-
3451
- $src = $plugins_url . "asset/dist/js/hook{$ver_string}{$min}.js";
3452
- wp_enqueue_script( 'wp-migrate-db-pro-hook', $src, null, $version, true );
3453
-
3454
- $src = $plugins_url . "asset/dist/js/multisite{$ver_string}{$min}.js";
3455
- wp_enqueue_script( 'wp-migrate-db-pro-multisite', $src, array( 'jquery' ), $version, true );
3456
-
3457
  do_action( 'wpmdb_load_assets' );
3458
 
3459
  $src = $plugins_url . "asset/dist/js/script{$ver_string}{$min}.js";
3460
  wp_enqueue_script( 'wp-migrate-db-pro-script', $src, array( 'jquery', 'backbone' ), $version, true );
3461
 
3462
- $src = $plugins_url . "asset/dist/js/localStorage{$ver_string}{$min}.js";
3463
- wp_enqueue_script( 'wp-migrate-db-pro-localstorage', $src, array( 'wp-migrate-db-pro-script' ), $version, true );
3464
-
3465
  wp_localize_script( 'wp-migrate-db-pro-script',
3466
  'wpmdb_strings',
3467
  array(
@@ -3649,28 +3647,28 @@ class WPMDB extends WPMDB_Base {
3649
  $site_details = $this->site_details();
3650
 
3651
  $nonces = apply_filters( 'wpmdb_nonces', array(
3652
- 'update_max_request_size' => wp_create_nonce( 'update-max-request-size' ),
3653
- 'update_delay_between_requests' => wp_create_nonce( 'update-delay-between-requests' ),
3654
- 'check_licence' => wp_create_nonce( 'check-licence' ),
3655
- 'verify_connection_to_remote_site' => wp_create_nonce( 'verify-connection-to-remote-site' ),
3656
- 'activate_licence' => wp_create_nonce( 'activate-licence' ),
3657
- 'clear_log' => wp_create_nonce( 'clear-log' ),
3658
- 'get_log' => wp_create_nonce( 'get-log' ),
3659
- 'save_profile' => wp_create_nonce( 'save-profile' ),
3660
- 'initiate_migration' => wp_create_nonce( 'initiate-migration' ),
3661
- 'migrate_table' => wp_create_nonce( 'migrate-table' ),
3662
- 'finalize_migration' => wp_create_nonce( 'finalize-migration' ),
3663
- 'reset_api_key' => wp_create_nonce( 'reset-api-key' ),
3664
- 'delete_migration_profile' => wp_create_nonce( 'delete-migration-profile' ),
3665
- 'save_setting' => wp_create_nonce( 'save-setting' ),
3666
- 'copy_licence_to_remote_site' => wp_create_nonce( 'copy-licence-to-remote-site' ),
3667
- 'reactivate_licence' => wp_create_nonce( 'reactivate-licence' ),
3668
- 'process_notice_link' => wp_create_nonce( 'process-notice-link' ),
3669
- 'flush' => wp_create_nonce( 'flush' ),
3670
- 'plugin_compatibility' => wp_create_nonce( 'plugin_compatibility' ),
3671
- 'import_file' => wp_create_nonce( 'import-file' ),
3672
- 'whitelist_plugins' => wp_create_nonce( 'whitelist_plugins' ),
3673
- 'cancel_migration' => wp_create_nonce( 'cancel_migration' ),
3674
  ) );
3675
 
3676
  $data = apply_filters( 'wpmdb_data', array(
35
  $this->plugin_version = $GLOBALS['wpmdb_meta'][ $this->core_slug ]['version'];
36
  $this->max_insert_string_len = 50000; // 50000 is the default as defined by PhpMyAdmin
37
 
38
+ // For Firefox extend "Cache-Control" header to include 'no-store' so that refresh after migration doesn't override JS set values.
39
+ add_filter( 'nocache_headers', array( $this, 'nocache_headers' ) );
40
+
41
  add_filter( 'plugin_action_links_' . $this->plugin_basename, array( $this, 'plugin_action_links' ) );
42
  add_filter( 'network_admin_plugin_action_links_' . $this->plugin_basename, array( $this, 'plugin_action_links' ) );
43
 
98
  'backup_option' => 'backup_only_with_prefix',
99
  'exclude_transients' => '1',
100
  'compatibility_older_mysql' => '0',
101
+ 'import_find_replace' => '1',
102
  );
103
 
104
  $this->checkbox_options = array(
148
  $this->compatibility_plugin_manager = new WPMDB_Compatibility_Plugin_Manager( $this );
149
  }
150
 
 
 
 
151
  add_action( 'wp_ajax_wpmdb_process_notice_link', array( $this, 'ajax_process_notice_link' ) );
152
  }
153
 
154
+ /**
155
+ * Extend Cache-Control header to include "no-store" so that Firefox doesn't override input selection after refresh.
156
+ *
157
+ * @param array $headers
158
+ *
159
+ * @return array
160
+ */
161
+ public function nocache_headers( $headers ) {
162
+ if ( is_array( $headers ) &&
163
+ key_exists( 'Cache-Control', $headers ) &&
164
+ false === strpos( $headers['Cache-Control'], 'no-store' )
165
+ ) {
166
+ $headers['Cache-Control'] .= ', no-store';
167
  }
168
 
169
+ return $headers;
 
 
 
 
 
 
 
 
 
170
  }
171
 
172
  /**
1556
  *
1557
  * @param array $preserved_options_data
1558
  *
1559
+ * @return array
1560
  */
1561
  function preserve_wpmdb_plugins( $preserved_options_data ) {
1562
  $keep_active_plugins = $this->profile_value( 'keep_active_plugins' );
1767
 
1768
  if ( is_multisite() ) {
1769
  $tables = $this->get_tables( 'prefix' );
1770
+ $sql = "SELECT DISTINCT `post_type` FROM `{$wpdb->base_prefix}posts` ;";
1771
+ $post_types = $wpdb->get_results( $sql, ARRAY_A );
1772
  $prefix_escaped = preg_quote( $wpdb->base_prefix, '/' );
1773
 
1774
  foreach ( $tables as $table ) {
1775
  if ( 0 == preg_match( '/' . $prefix_escaped . '[0-9]+_posts/', $table ) ) {
1776
  continue;
1777
  }
1778
+ $blog_id = str_replace( array( $wpdb->base_prefix, '_posts' ), array( '', '' ), $table );
1779
+ $sql = "SELECT DISTINCT `post_type` FROM `{$wpdb->base_prefix}" . $blog_id . '_posts` ;';
1780
+ $site_post_types = $wpdb->get_results( $sql, ARRAY_A );
1781
+ if ( is_array( $site_post_types ) ) {
1782
+ $post_types = array_merge( $post_types, $site_post_types );
1783
+ }
1784
  }
 
 
1785
  } else {
1786
  $post_types = $wpdb->get_results(
1787
  "SELECT DISTINCT `post_type`
3056
 
3057
  $this->stow( '# Protocol: ' . $protocol . "\n", false );
3058
 
3059
+ $is_multisite = is_multisite() ? 'true' : 'false';
3060
+ $this->stow( '# Multisite: ' . $is_multisite . "\n", false );
3061
+
3062
+ $is_subsite_export = apply_filters( 'wpmdb_backup_header_is_subsite_export', 'false' );
3063
+ $this->stow ( '# Subsite Export: ' . $is_subsite_export . "\n", false );
3064
+
3065
  $this->stow( "# --------------------------------------------------------\n\n", false );
3066
  $this->stow( "/*!40101 SET NAMES $charset */;\n\n", false );
3067
  $this->stow( "SET sql_mode='NO_AUTO_VALUE_ON_ZERO';\n\n", false );
3455
  $src = $plugins_url . 'asset/dist/css/styles.css';
3456
  wp_enqueue_style( 'wp-migrate-db-pro-styles', $src, array(), $version );
3457
 
 
 
 
 
 
 
 
 
 
3458
  do_action( 'wpmdb_load_assets' );
3459
 
3460
  $src = $plugins_url . "asset/dist/js/script{$ver_string}{$min}.js";
3461
  wp_enqueue_script( 'wp-migrate-db-pro-script', $src, array( 'jquery', 'backbone' ), $version, true );
3462
 
 
 
 
3463
  wp_localize_script( 'wp-migrate-db-pro-script',
3464
  'wpmdb_strings',
3465
  array(
3647
  $site_details = $this->site_details();
3648
 
3649
  $nonces = apply_filters( 'wpmdb_nonces', array(
3650
+ 'update_max_request_size' => WPMDB_Utils::create_nonce( 'update-max-request-size' ),
3651
+ 'update_delay_between_requests' => WPMDB_Utils::create_nonce( 'update-delay-between-requests' ),
3652
+ 'check_licence' => WPMDB_Utils::create_nonce( 'check-licence' ),
3653
+ 'verify_connection_to_remote_site' => WPMDB_Utils::create_nonce( 'verify-connection-to-remote-site' ),
3654
+ 'activate_licence' => WPMDB_Utils::create_nonce( 'activate-licence' ),
3655
+ 'clear_log' => WPMDB_Utils::create_nonce( 'clear-log' ),
3656
+ 'get_log' => WPMDB_Utils::create_nonce( 'get-log' ),
3657
+ 'save_profile' => WPMDB_Utils::create_nonce( 'save-profile' ),
3658
+ 'initiate_migration' => WPMDB_Utils::create_nonce( 'initiate-migration' ),
3659
+ 'migrate_table' => WPMDB_Utils::create_nonce( 'migrate-table' ),
3660
+ 'finalize_migration' => WPMDB_Utils::create_nonce( 'finalize-migration' ),
3661
+ 'reset_api_key' => WPMDB_Utils::create_nonce( 'reset-api-key' ),
3662
+ 'delete_migration_profile' => WPMDB_Utils::create_nonce( 'delete-migration-profile' ),
3663
+ 'save_setting' => WPMDB_Utils::create_nonce( 'save-setting' ),
3664
+ 'copy_licence_to_remote_site' => WPMDB_Utils::create_nonce( 'copy-licence-to-remote-site' ),
3665
+ 'reactivate_licence' => WPMDB_Utils::create_nonce( 'reactivate-licence' ),
3666
+ 'process_notice_link' => WPMDB_Utils::create_nonce( 'process-notice-link' ),
3667
+ 'flush' => WPMDB_Utils::create_nonce( 'flush' ),
3668
+ 'plugin_compatibility' => WPMDB_Utils::create_nonce( 'plugin_compatibility' ),
3669
+ 'import_file' => WPMDB_Utils::create_nonce( 'import-file' ),
3670
+ 'whitelist_plugins' => WPMDB_Utils::create_nonce( 'whitelist_plugins' ),
3671
+ 'cancel_migration' => WPMDB_Utils::create_nonce( 'cancel_migration' ),
3672
  ) );
3673
 
3674
  $data = apply_filters( 'wpmdb_data', array(
languages/wp-migrate-db-en.pot CHANGED
@@ -8,7 +8,7 @@ msgid ""
8
  msgstr ""
9
  "Project-Id-Version: wp-migrate-db\n"
10
  "Report-Msgid-Bugs-To: nom@deliciousbrains.com\n"
11
- "POT-Creation-Date: 2017-09-14 12:24-0400\n"
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,8 +17,8 @@ msgstr ""
17
  "Content-Type: text/plain; charset=UTF-8\n"
18
  "Content-Transfer-Encoding: 8bit\n"
19
 
20
- #: class/wpmdb-base.php:104
21
- #: class/wpmdb-base.php:938
22
  #, php-format
23
  msgid ""
24
  "<strong>Could not connect to api.deliciousbrains.com</strong> &mdash; You "
@@ -29,12 +29,12 @@ msgid ""
29
  "can:%2$s"
30
  msgstr ""
31
 
32
- #: class/wpmdb-base.php:104
33
- #: class/wpmdb-base.php:938
34
  msgid "Temporarily disable SSL for connections to api.deliciousbrains.com"
35
  msgstr ""
36
 
37
- #: class/wpmdb-base.php:105
38
  msgid ""
39
  "Could not connect to api.deliciousbrains.com - You will not receive update "
40
  "notifications or be able to activate your license until this is fixed. This "
@@ -45,8 +45,8 @@ msgid ""
45
  "deliciousbrains.com' );` to your wp-config.php file."
46
  msgstr ""
47
 
48
- #: class/wpmdb-base.php:108
49
- #: class/wpmdb-base.php:946
50
  #, php-format
51
  msgid ""
52
  "We've detected that <code>WP_HTTP_BLOCK_EXTERNAL</code> is enabled and the "
@@ -56,7 +56,7 @@ msgid ""
56
  "\" target=\"_blank\">More information</a>."
57
  msgstr ""
58
 
59
- #: class/wpmdb-base.php:109
60
  #, php-format
61
  msgid ""
62
  "We've detected that WP_HTTP_BLOCK_EXTERNAL is enabled and the host %1$s has "
@@ -64,7 +64,7 @@ msgid ""
64
  "or add %1$s to WP_ACCESSIBLE_HOSTS to continue."
65
  msgstr ""
66
 
67
- #: class/wpmdb-base.php:112
68
  #, php-format
69
  msgid ""
70
  "<strong>Your License Was Cancelled</strong> &mdash; Please visit <a href=\"%s"
@@ -73,40 +73,40 @@ msgid ""
73
  "%s</a>"
74
  msgstr ""
75
 
76
- #: class/wpmdb-base.php:112
77
- #: class/wpmdb-base.php:120
78
- #: class/wpmdb-base.php:124
79
- #: class/wpmdb-base.php:128
80
- #: class/wpmdbpro.php:1084
81
- #: class/wpmdbpro.php:1641
82
  msgid "Check my license again"
83
  msgstr ""
84
 
85
- #: class/wpmdb-base.php:113
86
  #, php-format
87
  msgid ""
88
  "Your License Was Cancelled - Please login to your account (%s) to renew or "
89
  "upgrade your license and enable push and pull."
90
  msgstr ""
91
 
92
- #: class/wpmdb-base.php:116
93
  #: class/wpmdb-base.php:117
 
94
  msgid "Your License Has Expired"
95
  msgstr ""
96
 
97
- #: class/wpmdb-base.php:120
98
  #, php-format
99
  msgid ""
100
  "Login to <a href=\"%s\">My Account</a> to renew. <a href=\"%s\" class="
101
  "\"check-my-licence-again\">%s</a>"
102
  msgstr ""
103
 
104
- #: class/wpmdb-base.php:121
105
  #, php-format
106
  msgid "Login to your account to renew (%s)"
107
  msgstr ""
108
 
109
- #: class/wpmdb-base.php:124
110
  #, php-format
111
  msgid ""
112
  "<strong>No Activations Left</strong> &mdash; Please visit <a href=\"%s\" "
@@ -115,14 +115,14 @@ msgid ""
115
  "my-licence-again\">%s</a>"
116
  msgstr ""
117
 
118
- #: class/wpmdb-base.php:125
119
  #, php-format
120
  msgid ""
121
  "No Activations Left - Please visit your account (%s) to upgrade your license "
122
  "or deactivate a previous activation and enable push and pull."
123
  msgstr ""
124
 
125
- #: class/wpmdb-base.php:128
126
  #, php-format
127
  msgid ""
128
  "<strong>Your License Was Not Found</strong> &mdash; Perhaps you made a typo "
@@ -131,7 +131,7 @@ msgid ""
131
  "license key. <a href=\"%s\" class=\"check-my-licence-again\">%s</a>"
132
  msgstr ""
133
 
134
- #: class/wpmdb-base.php:129
135
  #, php-format
136
  msgid ""
137
  "Your License Was Not Found - Perhaps you made a typo when defining your "
@@ -139,70 +139,70 @@ msgid ""
139
  "to double check your license key."
140
  msgstr ""
141
 
142
- #: class/wpmdb-base.php:132
143
  #, php-format
144
  msgid "<strong>Your License Was Not Found</strong> &mdash; %s"
145
  msgstr ""
146
 
147
- #: class/wpmdb-base.php:133
148
  #, php-format
149
  msgid "Your License Was Not Found - %s"
150
  msgstr ""
151
 
152
- #: class/wpmdb-base.php:136
153
  #: class/wpmdb-base.php:137
 
154
  msgid "Your License Is Inactive"
155
  msgstr ""
156
 
157
- #: class/wpmdb-base.php:136
158
  #: class/wpmdb-base.php:137
 
159
  msgid "Your license has been deactivated for this install."
160
  msgstr ""
161
 
162
- #: class/wpmdb-base.php:136
163
  #: class/wpmdb-base.php:137
 
164
  msgid "Reactivate your license"
165
  msgstr ""
166
 
167
- #: class/wpmdb-base.php:140
168
  #, php-format
169
  msgid ""
170
  "<strong>An Unexpected Error Occurred</strong> &mdash; Please contact us at "
171
  "<a href=\"%1$s\">%2$s</a> and quote the following: <p>%3$s</p>"
172
  msgstr ""
173
 
174
- #: class/wpmdb-base.php:141
175
  #, php-format
176
  msgid ""
177
  "An Unexpected Error Occurred - Please contact us at %2$s and quote the "
178
  "following: %3$s"
179
  msgstr ""
180
 
181
- #: class/wpmdb-base.php:259
182
  msgid ""
183
  "Invalid content verification signature, please verify the connection "
184
  "information on the remote site and try again."
185
  msgstr ""
186
 
187
- #: class/wpmdb-base.php:259
188
  #, php-format
189
  msgctxt "Ex. Remote URL: http://wp.dev"
190
  msgid " Remote URL: %s "
191
  msgstr ""
192
 
193
- #: class/wpmdb-base.php:488
194
  #, php-format
195
  msgid ""
196
  "The connection to the remote server has timed out, no changes have been "
197
  "committed. (#134 - scope: %s)"
198
  msgstr ""
199
 
200
- #: class/wpmdb-base.php:490
201
  #, php-format
202
  msgid "We could not find: %s. Are you sure this is the correct URL?"
203
  msgstr ""
204
 
205
- #: class/wpmdb-base.php:496
206
  msgid ""
207
  "It appears that you might be trying to pull from a local environment. This "
208
  "will not work if <u>this</u> website happens to be located on a remote "
@@ -210,7 +210,7 @@ msgid ""
210
  "environment."
211
  msgstr ""
212
 
213
- #: class/wpmdb-base.php:498
214
  msgid ""
215
  "It appears that you might be trying to push to a local environment. This "
216
  "will not work if <u>this</u> website happens to be located on a remote "
@@ -218,7 +218,7 @@ msgid ""
218
  "environment."
219
  msgstr ""
220
 
221
- #: class/wpmdb-base.php:506
222
  #, php-format
223
  msgid ""
224
  "We've detected that <code>WP_HTTP_BLOCK_EXTERNAL</code> is enabled and the "
@@ -228,14 +228,14 @@ msgid ""
228
  "\" target=\"_blank\">More information</a>. (#147 - scope: %3$s)"
229
  msgstr ""
230
 
231
- #: class/wpmdb-base.php:509
232
  #, php-format
233
  msgid ""
234
  "Couldn't connect over HTTPS. You might want to try regular HTTP instead. "
235
  "(#121 - scope: %s)"
236
  msgstr ""
237
 
238
- #: class/wpmdb-base.php:511
239
  #, php-format
240
  msgid ""
241
  "<strong>HTTPS Connection Error:</strong> (#121 - scope: %s) This typically "
@@ -245,95 +245,95 @@ msgid ""
245
  "documentation</a> for possible solutions."
246
  msgstr ""
247
 
248
- #: class/wpmdb-base.php:513
249
  #, php-format
250
  msgid ""
251
  "The connection failed, an unexpected error occurred, please contact support. "
252
  "(#121 - scope: %s)"
253
  msgstr ""
254
 
255
- #: class/wpmdb-base.php:526
256
  msgid ""
257
  "The remote site is protected with Basic Authentication. Please enter the "
258
  "username and password above to continue. (401 Unauthorized)"
259
  msgstr ""
260
 
261
- #: class/wpmdb-base.php:534
262
  #, php-format
263
  msgid ""
264
  "Unable to connect to the remote server, the remote server responded with: "
265
  "%1$s %2$s (scope: %3$s)"
266
  msgstr ""
267
 
268
- #: class/wpmdb-base.php:546
269
  #, php-format
270
  msgid ""
271
  "Unable to connect to the remote server, please check the connection details "
272
  "- %1$s %2$s (#129 - scope: %3$s)"
273
  msgstr ""
274
 
275
- #: class/wpmdb-base.php:562
276
  #, php-format
277
  msgid ""
278
  "WP Migrate DB Pro does not seem to be installed or active on the remote "
279
  "site. (#131 - scope: %s)"
280
  msgstr ""
281
 
282
- #: class/wpmdb-base.php:568
283
  #, php-format
284
  msgid ""
285
  "A response was expected from the remote, instead we got nothing. (#146 - "
286
  "scope: %1$s) Please review %2$s for possible solutions."
287
  msgstr ""
288
 
289
- #: class/wpmdb-base.php:568
290
- #: class/wpmdb.php:4028
291
  msgid "our documentation"
292
  msgstr ""
293
 
294
- #: class/wpmdb-base.php:578
295
  msgid ""
296
  "There was a problem with the AJAX request, we were expecting a serialized "
297
  "response, instead we received:<br />"
298
  msgstr ""
299
 
300
- #: class/wpmdb-base.php:991
301
  msgid ""
302
  "<strong>Delicious Brains API is Down — </strong>Unfortunately we're "
303
  "experiencing some problems with our server."
304
  msgstr ""
305
 
306
- #: class/wpmdb-base.php:995
307
  #, php-format
308
  msgctxt "ex. 2 hours ago"
309
  msgid "%s ago"
310
  msgstr ""
311
 
312
- #: class/wpmdb-base.php:1000
313
  msgid "Here's the most recent update on its status"
314
  msgstr ""
315
 
316
- #: class/wpmdb-base.php:1027
317
  #, php-format
318
  msgid ""
319
  "Error retrieving download from deliciousbrain.com. Please try again or "
320
  "download manually from <a href=\"%1$s\">%2$s</a>."
321
  msgstr ""
322
 
323
- #: class/wpmdb-base.php:1027
324
  msgctxt "Delicious Brains account"
325
  msgid "My Account"
326
  msgstr ""
327
 
328
- #: class/wpmdb-base.php:1086
329
- #: class/wpmdb.php:115
330
- #: class/wpmdb.php:346
331
- #: class/wpmdbpro.php:1634
332
  msgctxt "Plugin configuration and preferences"
333
  msgid "Settings"
334
  msgstr ""
335
 
336
- #: class/wpmdb-base.php:1087
337
  #, php-format
338
  msgid ""
339
  "To finish activating WP Migrate DB Pro, please go to %1$s and enter your "
@@ -341,31 +341,31 @@ msgid ""
341
  "\">purchase one</a>."
342
  msgstr ""
343
 
344
- #: class/wpmdb-base.php:1318
345
- #: class/wpmdb-base.php:1328
346
  msgctxt "A new version of the plugin is available"
347
  msgid "Update Available"
348
  msgstr ""
349
 
350
- #: class/wpmdb-base.php:1319
351
  #, php-format
352
  msgid "A new version of %1$s is now available. %2$s"
353
  msgstr ""
354
 
355
- #: class/wpmdb-base.php:1319
356
- #: class/wpmdb-base.php:1329
357
  msgctxt "Download and install a new version of the plugin"
358
  msgid "Update Now"
359
  msgstr ""
360
 
361
- #: class/wpmdb-base.php:1329
362
  #, php-format
363
  msgid ""
364
  "%1$s %2$s is now available. You currently have %3$s installed. <a href=\"%4$s"
365
  "\">%5$s</a>"
366
  msgstr ""
367
 
368
- #: class/wpmdb-base.php:1428
369
  #, php-format
370
  msgid ""
371
  "<strong>Activate Your License</strong> &mdash; Please <a href=\"%s\" class="
@@ -373,54 +373,54 @@ msgid ""
373
  "priority support and plugin updates."
374
  msgstr ""
375
 
376
- #: class/wpmdb-base.php:1445
377
  msgid ""
378
  "<strong>We've temporarily activated your license and will complete the "
379
  "activation once the Delicious Brains API is available again.</strong>"
380
  msgstr ""
381
 
382
- #: class/wpmdb-base.php:1474
383
  msgid "Updates are only available to those with an active license. "
384
  msgstr ""
385
 
386
- #: class/wpmdb-base.php:1475
387
  msgid "Only active licenses can download and install addons. "
388
  msgstr ""
389
 
390
- #: class/wpmdb-base.php:1476
391
  msgid "Only active licenses can submit support requests. "
392
  msgstr ""
393
 
394
- #: class/wpmdb-base.php:1477
395
  msgid ""
396
  "All features will continue to work, but you won't be able to receive updates "
397
  "or email support. "
398
  msgstr ""
399
 
400
- #: class/wpmdb-base.php:1545
401
  #, php-format
402
  msgid "Invalid nonce for: %s"
403
  msgstr ""
404
 
405
- #: class/wpmdb-base.php:1553
406
  #, php-format
407
  msgid "Access denied for: %s"
408
  msgstr ""
409
 
410
- #: class/wpmdb-base.php:1730
411
  msgctxt "dismiss notice permanently"
412
  msgid "Dismiss"
413
  msgstr ""
414
 
415
- #: class/wpmdb-base.php:1743
416
  msgid "Remind Me Later"
417
  msgstr ""
418
 
419
- #: class/wpmdb-base.php:1845
420
  msgid "Failed to save migration state. Please contact support."
421
  msgstr ""
422
 
423
- #: class/wpmdb-base.php:1868
424
  msgid "Failed to retrieve migration state. Please contact support."
425
  msgstr ""
426
 
@@ -534,7 +534,7 @@ msgid "Export saved to: %s"
534
  msgstr ""
535
 
536
  #: class/wpmdb-command.php:190
537
- #: class/wpmdb.php:3549
538
  msgid "Find & Replace complete"
539
  msgstr ""
540
 
@@ -551,7 +551,7 @@ msgid ""
551
  "mu-plugins folder: %s"
552
  msgstr ""
553
 
554
- #: class/wpmdb-compatibility-plugin-manager.php:227
555
  #, php-format
556
  msgid ""
557
  "The compatibility plugin could not be deactivated because your mu-plugin "
@@ -559,7 +559,16 @@ msgid ""
559
  "mu-plugins folder: %s"
560
  msgstr ""
561
 
562
- #: class/wpmdb-replace.php:313
 
 
 
 
 
 
 
 
 
563
  msgid ""
564
  "Failed attempting to do the recursive unserialize replace. Please contact "
565
  "support."
@@ -658,22 +667,22 @@ msgstr ""
658
  msgid "WPMDB Error: Data cannot be unserialized. %s"
659
  msgstr ""
660
 
661
- #: class/wpmdb.php:114
662
  msgctxt "Configure a migration or export"
663
  msgid "Migrate"
664
  msgstr ""
665
 
666
- #: class/wpmdb.php:116
667
  msgctxt "Plugin extensions"
668
  msgid "Addons"
669
  msgstr ""
670
 
671
- #: class/wpmdb.php:117
672
  msgctxt "Get help or contact support"
673
  msgid "Help"
674
  msgstr ""
675
 
676
- #: class/wpmdb.php:806
677
  #, php-format
678
  msgid ""
679
  "The imported table `%1s` contains characters which are invalid in the target "
@@ -683,7 +692,7 @@ msgid ""
683
  "documentation</a> for more information."
684
  msgstr ""
685
 
686
- #: class/wpmdb.php:809
687
  #, php-format
688
  msgid ""
689
  "The table `%1s` contains characters which are invalid in the target "
@@ -691,7 +700,7 @@ msgid ""
691
  "information."
692
  msgstr ""
693
 
694
- #: class/wpmdb.php:1132
695
  #, php-format
696
  msgid ""
697
  "<p><strong>Export Failed</strong> — We can't save your export to the "
@@ -700,272 +709,272 @@ msgid ""
700
  "more information »</a></p>"
701
  msgstr ""
702
 
703
- #: class/wpmdb.php:1173
704
- #: class/wpmdbpro.php:381
705
- #: class/wpmdbpro.php:1478
706
  msgid ""
707
  "Failed attempting to unserialize the response from the remote server. Please "
708
  "contact support."
709
  msgstr ""
710
 
711
- #: class/wpmdb.php:2190
712
  #, php-format
713
  msgid ""
714
  "Failed to retrieve table structure for table '%s', please ensure your "
715
  "database is online. (#125)"
716
  msgstr ""
717
 
718
- #: class/wpmdb.php:2289
719
  #, php-format
720
  msgid "Error creating temporary table. Table \"%s\" does not exist."
721
  msgstr ""
722
 
723
- #: class/wpmdb.php:2395
724
  #, php-format
725
  msgid "Delete any existing table %s"
726
  msgstr ""
727
 
728
- #: class/wpmdb.php:2406
729
  #, php-format
730
  msgid "Table structure of table %s"
731
  msgstr ""
732
 
733
- #: class/wpmdb.php:2414
734
  msgid ""
735
  "Failed to generate the create table query, please ensure your database is "
736
  "online. (#126)"
737
  msgstr ""
738
 
739
- #: class/wpmdb.php:2470
740
  #, php-format
741
  msgid "Data contents of table %s"
742
  msgstr ""
743
 
744
- #: class/wpmdb.php:2488
745
  #, php-format
746
  msgid "End of data contents of table %s"
747
  msgstr ""
748
 
749
- #: class/wpmdb.php:3004
750
  msgid "WordPress MySQL database migration"
751
  msgstr ""
752
 
753
- #: class/wpmdb.php:3006
754
  #, php-format
755
  msgid "Generated: %s"
756
  msgstr ""
757
 
758
- #: class/wpmdb.php:3007
759
  #, php-format
760
  msgid "Hostname: %s"
761
  msgstr ""
762
 
763
- #: class/wpmdb.php:3008
764
  #, php-format
765
  msgid "Database: %s"
766
  msgstr ""
767
 
768
- #: class/wpmdb.php:3107
769
  msgid "Failed to write the gzipped SQL data to the file. (#127)"
770
  msgstr ""
771
 
772
- #: class/wpmdb.php:3114
773
  msgid "Failed to write the SQL data to the file. (#128)"
774
  msgstr ""
775
 
776
- #: class/wpmdb.php:3263
777
- #: class/wpmdb.php:3288
778
- #: class/wpmdbpro.php:1438
779
  msgid "Migrate DB Pro"
780
  msgstr ""
781
 
782
- #: class/wpmdb.php:3263
783
- #: class/wpmdb.php:3288
784
- #: class/wpmdb.php:3933
785
  msgid "Migrate DB"
786
  msgstr ""
787
 
788
- #: class/wpmdb.php:3468
789
  msgid ""
790
  "A problem occurred when trying to change the maximum request size, please "
791
  "try again."
792
  msgstr ""
793
 
794
- #: class/wpmdb.php:3469
795
- #: class/wpmdbpro.php:1084
796
  msgid "A problem occurred when trying to check the license, please try again."
797
  msgstr ""
798
 
799
- #: class/wpmdb.php:3470
800
  msgid "Establishing connection to remote server, please wait"
801
  msgstr ""
802
 
803
- #: class/wpmdb.php:3471
804
  msgid ""
805
  "A problem occurred when attempting to connect to the local server, please "
806
  "check the details and try again."
807
  msgstr ""
808
 
809
- #: class/wpmdb.php:3472
810
  msgid "Please enter your license key."
811
  msgstr ""
812
 
813
- #: class/wpmdb.php:3473
814
  msgid ""
815
  "A problem occurred when trying to register the license, please try again."
816
  msgstr ""
817
 
818
- #: class/wpmdb.php:3474
819
  msgid ""
820
  "Your license has been activated. You will now receive automatic updates and "
821
  "access to email support."
822
  msgstr ""
823
 
824
- #: class/wpmdb.php:3475
825
  msgid "Fetching license details, please wait…"
826
  msgstr ""
827
 
828
- #: class/wpmdb.php:3476
829
  msgid ""
830
  "An error occurred when trying to clear the debug log. Please contact "
831
  "support. (#132)"
832
  msgstr ""
833
 
834
- #: class/wpmdb.php:3477
835
  msgid ""
836
  "An error occurred when trying to update the debug log. Please contact "
837
  "support. (#133)"
838
  msgstr ""
839
 
840
- #: class/wpmdb.php:3478
841
  msgid "Please select at least one table to migrate."
842
  msgstr ""
843
 
844
- #: class/wpmdb.php:3479
845
  msgid "Please select at least one table for backup."
846
  msgstr ""
847
 
848
- #: class/wpmdb.php:3480
849
  msgid "Please select at least one table for the find & replace"
850
  msgstr ""
851
 
852
- #: class/wpmdb.php:3481
853
  msgid "Please enter a name for your migration profile."
854
  msgstr ""
855
 
856
- #: class/wpmdb.php:3482
857
  msgid ""
858
  "An error occurred when attempting to save the migration profile. Please see "
859
  "the Help tab for details on how to request support. (#118)"
860
  msgstr ""
861
 
862
- #: class/wpmdb.php:3483
863
  msgctxt "Data has been successfully exported"
864
  msgid "Export complete"
865
  msgstr ""
866
 
867
- #: class/wpmdb.php:3484
868
  msgid "Exporting, please wait…"
869
  msgstr ""
870
 
871
- #: class/wpmdb.php:3485
872
  msgid "please wait…"
873
  msgstr ""
874
 
875
- #: class/wpmdb.php:3486
876
  msgctxt "Finished successfully"
877
  msgid "complete"
878
  msgstr ""
879
 
880
- #: class/wpmdb.php:3487
881
  msgctxt "Copy of data between servers did not complete"
882
  msgid "Migration failed"
883
  msgstr ""
884
 
885
- #: class/wpmdb.php:3488
886
  msgctxt "Saving a copy of the data before import"
887
  msgid "Backing up"
888
  msgstr ""
889
 
890
- #: class/wpmdb.php:3489
891
  msgctxt "In line to be processed"
892
  msgid "Queued"
893
  msgstr ""
894
 
895
- #: class/wpmdb.php:3490
896
  msgctxt "Copying data between servers"
897
  msgid "Migrating"
898
  msgstr ""
899
 
900
- #: class/wpmdb.php:3491
901
  msgctxt "Process is active"
902
  msgid "Running"
903
  msgstr ""
904
 
905
- #: class/wpmdb.php:3492
906
  msgctxt "Current request status"
907
  msgid "Status"
908
  msgstr ""
909
 
910
- #: class/wpmdb.php:3493
911
  msgctxt "The message the server responded with"
912
  msgid "Response"
913
  msgstr ""
914
 
915
- #: class/wpmdb.php:3494
916
  msgid ""
917
  "A problem occurred when attempting to process the following table (#113)"
918
  msgstr ""
919
 
920
- #: class/wpmdb.php:3495
921
  msgid ""
922
  "A problem occurred when processing the following table. We were expecting a "
923
  "response in JSON format but instead received an empty response."
924
  msgstr ""
925
 
926
- #: class/wpmdb.php:3496
927
  msgid "Migration completed with some errors"
928
  msgstr ""
929
 
930
- #: class/wpmdb.php:3497
931
  msgid "Migration complete, your backup is located at:"
932
  msgstr ""
933
 
934
- #: class/wpmdb.php:3498
935
  msgid "A problem occurred when finalizing the backup. (#140)"
936
  msgstr ""
937
 
938
- #: class/wpmdb.php:3499
939
  msgctxt "The settings were saved successfully"
940
  msgid "Saved"
941
  msgstr ""
942
 
943
- #: class/wpmdb.php:3500
944
  msgid ""
945
  "Any sites setup to use the current secret key will no longer be able to "
946
  "connect. You will need to update those sites with the newly generated secret "
947
  "key. Do you wish to continue?"
948
  msgstr ""
949
 
950
- #: class/wpmdb.php:3501
951
  msgid ""
952
  "An error occurred when trying to generate the secret key. Please see the "
953
  "Help tab for details on how to request support. (#105)"
954
  msgstr ""
955
 
956
- #: class/wpmdb.php:3502
957
  msgid ""
958
  "You are about to remove the migration profile \"{{profile}}\". This cannot "
959
  "be undone. Do you wish to continue?"
960
  msgstr ""
961
 
962
- #: class/wpmdb.php:3503
963
  msgid ""
964
  "An error occurred when trying to delete the profile. Please see the Help tab "
965
  "for details on how to request support. (#106)"
966
  msgstr ""
967
 
968
- #: class/wpmdb.php:3504
969
  msgid ""
970
  "The selected migration profile could not be deleted because it was not "
971
  "found.\n"
@@ -973,273 +982,273 @@ msgid ""
973
  "migration profiles."
974
  msgstr ""
975
 
976
- #: class/wpmdb.php:3505
977
  msgid ""
978
  "If you change the connection details, you will lose any replaces and table "
979
  "selections you have made below. Do you wish to continue?"
980
  msgstr ""
981
 
982
- #: class/wpmdb.php:3506
983
  #: template/migrate.php:119
984
  msgid "Please enter the connection information above to continue."
985
  msgstr ""
986
 
987
- #: class/wpmdb.php:3507
988
  msgid ""
989
  "An error occurred when trying to save the settings. Please try again. If the "
990
  "problem persists, please see the Help tab for details on how to request "
991
  "support. (#108)"
992
  msgstr ""
993
 
994
- #: class/wpmdb.php:3508
995
  msgid ""
996
  "The connection information appears to be missing, please enter it to "
997
  "continue."
998
  msgstr ""
999
 
1000
- #: class/wpmdb.php:3509
1001
  msgid ""
1002
  "The connection information appears to be incorrect, it should consist of two "
1003
  "lines. The first being the remote server's URL and the second being the "
1004
  "secret key."
1005
  msgstr ""
1006
 
1007
- #: class/wpmdb.php:3510
1008
  msgid ""
1009
  "The URL on the first line appears to be invalid, please check it and try "
1010
  "again."
1011
  msgstr ""
1012
 
1013
- #: class/wpmdb.php:3511
1014
  msgid ""
1015
  "The secret key on the second line appears to be invalid. It should be a 40 "
1016
  "character string that consists of letters, numbers and special characters "
1017
  "only."
1018
  msgstr ""
1019
 
1020
- #: class/wpmdb.php:3512
1021
  msgid ""
1022
  "It appears you've entered the URL for this website, you need to provide the "
1023
  "URL of the remote website instead."
1024
  msgstr ""
1025
 
1026
- #: class/wpmdb.php:3513
1027
  msgid ""
1028
  "Looks like your remote secret key is the same as the secret key for this "
1029
  "site. To fix this, go to the <a href=\"#settings\">Settings tab</a> and "
1030
  "click \"Reset Secret Key\""
1031
  msgstr ""
1032
 
1033
- #: class/wpmdb.php:3514
1034
  msgid "Time Elapsed:"
1035
  msgstr ""
1036
 
1037
- #: class/wpmdb.php:3515
1038
  #: template/migrate-progress.php:17
1039
  msgctxt "Temporarily stop migrating"
1040
  msgid "Pause"
1041
  msgstr ""
1042
 
1043
- #: class/wpmdb.php:3516
1044
  msgctxt "The migration has been temporarily stopped"
1045
  msgid "Migration Paused"
1046
  msgstr ""
1047
 
1048
- #: class/wpmdb.php:3517
1049
  msgctxt "The find & replace has been temporarily stopped"
1050
  msgid "Find &amp; Replace Paused"
1051
  msgstr ""
1052
 
1053
- #: class/wpmdb.php:3518
1054
  msgctxt "Restart migrating after it was paused"
1055
  msgid "Resume"
1056
  msgstr ""
1057
 
1058
- #: class/wpmdb.php:3519
1059
  msgid "Completing current request"
1060
  msgstr ""
1061
 
1062
- #: class/wpmdb.php:3520
1063
  msgctxt "The migration is being cancelled"
1064
  msgid "Cancelling migration"
1065
  msgstr ""
1066
 
1067
- #: class/wpmdb.php:3521
1068
  msgctxt "The find & replace is being cancelled"
1069
  msgid "Cancelling find &amp; replace"
1070
  msgstr ""
1071
 
1072
- #: class/wpmdb.php:3522
1073
  msgctxt "The migration has been temporarily stopped"
1074
  msgid "Paused"
1075
  msgstr ""
1076
 
1077
- #: class/wpmdb.php:3523
1078
  msgid "Pause before finalizing the updates"
1079
  msgstr ""
1080
 
1081
- #: class/wpmdb.php:3524
1082
  msgid ""
1083
  "Automatically paused before migrated tables are replaced. Click \"Resume\" "
1084
  "or \"Cancel\" when ready."
1085
  msgstr ""
1086
 
1087
- #: class/wpmdb.php:3525
1088
  msgid ""
1089
  "Automatically paused before the find &amp; replace was finalized. Click "
1090
  "\"Resume\" or \"Cancel\" when ready."
1091
  msgstr ""
1092
 
1093
- #: class/wpmdb.php:3526
1094
  msgid "Removing the local MySQL export file"
1095
  msgstr ""
1096
 
1097
- #: class/wpmdb.php:3527
1098
  msgid "Removing the local backup MySQL export file"
1099
  msgstr ""
1100
 
1101
- #: class/wpmdb.php:3528
1102
  msgid "Removing the local temporary tables"
1103
  msgstr ""
1104
 
1105
- #: class/wpmdb.php:3529
1106
  msgid "Removing the remote backup MySQL export file"
1107
  msgstr ""
1108
 
1109
- #: class/wpmdb.php:3530
1110
  msgid "Removing the remote temporary tables"
1111
  msgstr ""
1112
 
1113
- #: class/wpmdb.php:3531
1114
  msgid "Migration cancellation failed"
1115
  msgstr ""
1116
 
1117
- #: class/wpmdb.php:3532
1118
  msgid ""
1119
  "A problem occurred while cancelling the migration, you may have to manually "
1120
  "delete some temporary files / tables."
1121
  msgstr ""
1122
 
1123
- #: class/wpmdb.php:3533
1124
  msgctxt "The migration has been cancelled"
1125
  msgid "Migration cancelled"
1126
  msgstr ""
1127
 
1128
- #: class/wpmdb.php:3534
1129
  msgid ""
1130
  "The migration has been stopped and all temporary files and data have been "
1131
  "cleaned up."
1132
  msgstr ""
1133
 
1134
- #: class/wpmdb.php:3535
1135
  msgctxt "The migration has been cancelled"
1136
  msgid "Find &amp; replace cancelled"
1137
  msgstr ""
1138
 
1139
- #: class/wpmdb.php:3536
1140
  msgid ""
1141
  "The find &amp; replace has been cancelled and all temporary data has been "
1142
  "cleaned up."
1143
  msgstr ""
1144
 
1145
- #: class/wpmdb.php:3537
1146
  msgctxt "The migration completed successfully"
1147
  msgid "Migration complete"
1148
  msgstr ""
1149
 
1150
- #: class/wpmdb.php:3538
1151
  msgctxt "The migration is in the last stages"
1152
  msgid "Finalizing migration"
1153
  msgstr ""
1154
 
1155
- #: class/wpmdb.php:3539
1156
  msgctxt "The caches and rewrite rules for the target are being flushed"
1157
  msgid "Flushing caches and rewrite rules"
1158
  msgstr ""
1159
 
1160
- #: class/wpmdb.php:3540
1161
  msgid "A problem occurred when trying to add plugins to backlist."
1162
  msgstr ""
1163
 
1164
- #: class/wpmdb.php:3541
1165
  msgid ""
1166
  "If confirmed we will install an additional WordPress 'Must Use' plugin. This "
1167
  "plugin will allow us to control which plugins are loaded during WP Migrate "
1168
  "DB Pro specific operations. Do you wish to continue?"
1169
  msgstr ""
1170
 
1171
- #: class/wpmdb.php:3542
1172
  msgid ""
1173
  "A problem occurred when trying to change the plugin compatibility setting."
1174
  msgstr ""
1175
 
1176
- #: class/wpmdb.php:3543
1177
  msgctxt "Confirmation required"
1178
  msgid "Sure?"
1179
  msgstr ""
1180
 
1181
- #: class/wpmdb.php:3544
1182
  #, php-format
1183
  msgid "Pulling from %s…"
1184
  msgstr ""
1185
 
1186
- #: class/wpmdb.php:3545
1187
  #, php-format
1188
  msgid "Pull from %s complete"
1189
  msgstr ""
1190
 
1191
- #: class/wpmdb.php:3546
1192
  #, php-format
1193
  msgid "Pushing to %s…"
1194
  msgstr ""
1195
 
1196
- #: class/wpmdb.php:3547
1197
  #, php-format
1198
  msgid "Push to %s complete"
1199
  msgstr ""
1200
 
1201
- #: class/wpmdb.php:3548
1202
  msgid "Running Find & Replace…"
1203
  msgstr ""
1204
 
1205
- #: class/wpmdb.php:3550
1206
  msgid "Importing…"
1207
  msgstr ""
1208
 
1209
- #: class/wpmdb.php:3551
1210
  msgid "Import complete"
1211
  msgstr ""
1212
 
1213
- #: class/wpmdb.php:3552
1214
  msgid "Copying license to the remote site, please wait"
1215
  msgstr ""
1216
 
1217
- #: class/wpmdb.php:3553
1218
  msgid "Attempting to activate your license, please wait…"
1219
  msgstr ""
1220
 
1221
- #: class/wpmdb.php:3554
1222
  msgid "License successfully activated, please wait…"
1223
  msgstr ""
1224
 
1225
- #: class/wpmdb.php:3555
1226
  msgid ""
1227
  "An error occurred when trying to reactivate your license. Please provide the "
1228
  "following information when requesting support:"
1229
  msgstr ""
1230
 
1231
- #: class/wpmdb.php:3556
1232
  msgid ""
1233
  "<strong>We've temporarily activated your licence and will complete the "
1234
  "activation once the Delicious Brains API is available again.</strong><br /"
1235
  ">Please refresh this page to continue."
1236
  msgstr ""
1237
 
1238
- #: class/wpmdb.php:3557
1239
  msgid "JSON Decoding Failure"
1240
  msgstr ""
1241
 
1242
- #: class/wpmdb.php:3558
1243
  msgid ""
1244
  "Our AJAX request was expecting JSON but we received something else. Often "
1245
  "this is caused by your theme and/or plugins spitting out PHP errors. If you "
@@ -1248,113 +1257,113 @@ msgid ""
1248
  "disable errors from showing up."
1249
  msgstr ""
1250
 
1251
- #: class/wpmdb.php:3559
1252
  msgid "View error messages"
1253
  msgstr ""
1254
 
1255
- #: class/wpmdb.php:3560
1256
  #, php-format
1257
  msgid "Waiting %s seconds before executing next step"
1258
  msgstr ""
1259
 
1260
- #: class/wpmdb.php:3561
1261
  msgid ""
1262
  "A problem occurred when trying to change the delay between requests, please "
1263
  "try again."
1264
  msgstr ""
1265
 
1266
- #: class/wpmdb.php:3562
1267
  msgid "A problem occurred when flushing caches and rewrite rules. (#145)"
1268
  msgstr ""
1269
 
1270
- #: class/wpmdb.php:3563
1271
  msgctxt "Transfer this database to the remote site"
1272
  msgid "Push"
1273
  msgstr ""
1274
 
1275
- #: class/wpmdb.php:3564
1276
  msgctxt "Transfer this database to the remote site and save migration profile"
1277
  msgid "Push &amp; Save"
1278
  msgstr ""
1279
 
1280
- #: class/wpmdb.php:3565
1281
  msgctxt "Transfer the remote database to this site"
1282
  msgid "Pull"
1283
  msgstr ""
1284
 
1285
- #: class/wpmdb.php:3566
1286
  msgctxt "Transfer the remote database to this site and save migration profile"
1287
  msgid "Pull &amp; Save"
1288
  msgstr ""
1289
 
1290
- #: class/wpmdb.php:3567
1291
- #: template/migrate.php:371
1292
  msgctxt "Download a copy of the database"
1293
  msgid "Export"
1294
  msgstr ""
1295
 
1296
- #: class/wpmdb.php:3568
1297
  msgctxt "Download a copy of the database and save migration profile"
1298
  msgid "Export &amp; Save"
1299
  msgstr ""
1300
 
1301
- #: class/wpmdb.php:3569
1302
  msgctxt "Import an SQL file into the database"
1303
  msgid "Import"
1304
  msgstr ""
1305
 
1306
- #: class/wpmdb.php:3570
1307
  msgctxt "Import an SQL file and save migration profile"
1308
  msgid "Import &amp; Save"
1309
  msgstr ""
1310
 
1311
- #: class/wpmdb.php:3571
1312
  msgctxt "Run a find and replace on the database"
1313
  msgid "Find &amp; Replace"
1314
  msgstr ""
1315
 
1316
- #: class/wpmdb.php:3572
1317
  msgctxt "Run a find and replace and save migration profile"
1318
  msgid "Find &amp; Replace &amp; Save"
1319
  msgstr ""
1320
 
1321
- #: class/wpmdb.php:3573
1322
  msgctxt "database tables"
1323
  msgid "Tables"
1324
  msgstr ""
1325
 
1326
- #: class/wpmdb.php:3574
1327
  msgid "Files"
1328
  msgstr ""
1329
 
1330
- #: class/wpmdb.php:3575
1331
  msgctxt "Transferred"
1332
  msgid "Migrated"
1333
  msgstr ""
1334
 
1335
- #: class/wpmdb.php:3576
1336
  msgid "Backed Up"
1337
  msgstr ""
1338
 
1339
- #: class/wpmdb.php:3577
1340
  msgid "Searched"
1341
  msgstr ""
1342
 
1343
- #: class/wpmdb.php:3578
1344
  msgctxt "Obscure from view"
1345
  msgid "Hide"
1346
  msgstr ""
1347
 
1348
- #: class/wpmdb.php:3579
1349
  msgctxt "Reveal"
1350
  msgid "Show"
1351
  msgstr ""
1352
 
1353
- #: class/wpmdb.php:3580
1354
  msgid "Welcome to WP Migrate DB Pro! &#127881;"
1355
  msgstr ""
1356
 
1357
- #: class/wpmdb.php:3581
1358
  #, php-format
1359
  msgid ""
1360
  "Hey, this is the first time activating your license, nice! Your migrations "
@@ -1364,112 +1373,112 @@ msgid ""
1364
  "submit a support request."
1365
  msgstr ""
1366
 
1367
- #: class/wpmdb.php:3582
1368
  #, php-format
1369
  msgid "%1$s Stage %2$s of %3$s"
1370
  msgstr ""
1371
 
1372
- #: class/wpmdb.php:3583
1373
  msgid "Paused"
1374
  msgstr ""
1375
 
1376
- #: class/wpmdb.php:3584
1377
  msgid "Cancelling"
1378
  msgstr ""
1379
 
1380
- #: class/wpmdb.php:3585
1381
  msgid "Cancelled"
1382
  msgstr ""
1383
 
1384
- #: class/wpmdb.php:3586
1385
  msgid "Finalizing"
1386
  msgstr ""
1387
 
1388
- #: class/wpmdb.php:3587
1389
  msgid "Complete"
1390
  msgstr ""
1391
 
1392
- #: class/wpmdb.php:3588
1393
  msgid "Failed"
1394
  msgstr ""
1395
 
1396
- #: class/wpmdb.php:3589
1397
  #, php-format
1398
  msgid "%1$s items are not shown to maintain browser performance"
1399
  msgstr ""
1400
 
1401
- #: class/wpmdb.php:3590
1402
  msgctxt "Error log emptied"
1403
  msgid "Cleared"
1404
  msgstr ""
1405
 
1406
- #: class/wpmdb.php:3591
1407
  msgid "Parsing SQL file, please wait"
1408
  msgstr ""
1409
 
1410
- #: class/wpmdb.php:3592
1411
  msgid ""
1412
  "The selected file does not have a recognized file type. Please upload a "
1413
  "valid SQL file to continue."
1414
  msgstr ""
1415
 
1416
- #: class/wpmdb.php:3593
1417
  msgid "Please select an SQL export file above to continue."
1418
  msgstr ""
1419
 
1420
- #: class/wpmdb.php:3594
1421
  msgid "Profile Loaded"
1422
  msgstr ""
1423
 
1424
- #: class/wpmdb.php:3594
1425
  msgid ""
1426
  "The selected profile has been loaded, please select an SQL export file above "
1427
  "to continue."
1428
  msgstr ""
1429
 
1430
- #: class/wpmdb.php:3595
1431
  msgid "Uploading file to the server"
1432
  msgstr ""
1433
 
1434
- #: class/wpmdb.php:3596
1435
  #, php-format
1436
  msgid "Importing data from %s"
1437
  msgstr ""
1438
 
1439
- #: class/wpmdb.php:3597
1440
  msgid "Upload"
1441
  msgstr ""
1442
 
1443
- #: class/wpmdb.php:3636
1444
  #, php-format
1445
  msgid "<h3>Output prevented download. </h3> %s"
1446
  msgstr ""
1447
 
1448
- #: class/wpmdb.php:3639
1449
  msgid "Could not find the file to download:"
1450
  msgstr ""
1451
 
1452
- #: class/wpmdb.php:3868
1453
  msgid "MySQL export file not found."
1454
  msgstr ""
1455
 
1456
- #: class/wpmdb.php:3873
1457
  msgid "Could not delete the MySQL export file."
1458
  msgstr ""
1459
 
1460
- #: class/wpmdb.php:3939
1461
  msgid ""
1462
  "WP Migrate DB and WP Migrate DB Pro cannot both be active. We've "
1463
  "automatically deactivated WP Migrate DB."
1464
  msgstr ""
1465
 
1466
- #: class/wpmdb.php:3941
1467
  msgid ""
1468
  "WP Migrate DB and WP Migrate DB Pro cannot both be active. We've "
1469
  "automatically deactivated WP Migrate DB Pro."
1470
  msgstr ""
1471
 
1472
- #: class/wpmdb.php:4028
1473
  #, php-format
1474
  msgid ""
1475
  "The source site supports utf8mb4 data but the target does not, aborting "
@@ -1477,29 +1486,29 @@ msgid ""
1477
  "information. (#148)"
1478
  msgstr ""
1479
 
1480
- #: class/wpmdb.php:4079
1481
  msgid "Warning: Mixed Case Table Names"
1482
  msgstr ""
1483
 
1484
- #: class/wpmdb.php:4082
1485
  msgid ""
1486
  "Whoa! We've detected that your <b>local</b> site has the MySQL setting "
1487
  "<code>lower_case_table_names</code> set to <code>1</code>."
1488
  msgstr ""
1489
 
1490
- #: class/wpmdb.php:4084
1491
  msgid ""
1492
  "Whoa! We've detected that your <b>remote</b> site has the MySQL setting "
1493
  "<code>lower_case_table_names</code> set to <code>1</code>."
1494
  msgstr ""
1495
 
1496
- #: class/wpmdb.php:4087
1497
  msgid ""
1498
  "As a result, uppercase characters in table names will be converted to "
1499
  "lowercase during the migration."
1500
  msgstr ""
1501
 
1502
- #: class/wpmdb.php:4089
1503
  #, php-format
1504
  msgid ""
1505
  "You can read more about this in <a href=\"%s\">our documentation</a>, "
@@ -1514,13 +1523,13 @@ msgid ""
1514
  "Now</a></strong>"
1515
  msgstr ""
1516
 
1517
- #: class/wpmdbpro-import.php:63
1518
  msgid ""
1519
  "The server is not compatible with gzip, please decompress the import file "
1520
  "and try again."
1521
  msgstr ""
1522
 
1523
- #: class/wpmdbpro-import.php:74
1524
  msgid "Unable to read data from the import file"
1525
  msgstr ""
1526
 
@@ -1541,78 +1550,78 @@ msgstr ""
1541
  msgid "Failed to import the SQL query: %s"
1542
  msgstr ""
1543
 
1544
- #: class/wpmdbpro.php:262
1545
  msgid "UI Walkthrough"
1546
  msgstr ""
1547
 
1548
- #: class/wpmdbpro.php:263
1549
  msgid ""
1550
  "A brief walkthrough of the WP Migrate DB plugin showing all of the different "
1551
  "options and explaining them."
1552
  msgstr ""
1553
 
1554
- #: class/wpmdbpro.php:266
1555
  msgid "Pulling Live Data Into Your Local Development&nbsp;Environment"
1556
  msgstr ""
1557
 
1558
- #: class/wpmdbpro.php:267
1559
  msgid ""
1560
  "This screencast demonstrates how you can pull data from a remote, live "
1561
  "WordPress install and update the data in your local development environment."
1562
  msgstr ""
1563
 
1564
- #: class/wpmdbpro.php:270
1565
  msgid "Pushing Local Development Data to a Staging&nbsp;Environment"
1566
  msgstr ""
1567
 
1568
- #: class/wpmdbpro.php:271
1569
  msgid ""
1570
  "This screencast demonstrates how you can push a local WordPress database "
1571
  "you've been using for development to a staging environment."
1572
  msgstr ""
1573
 
1574
- #: class/wpmdbpro.php:274
1575
  msgid "WP Migrate DB Pro Media Files Addon 1.3 and CLI Addon 1.1"
1576
  msgstr ""
1577
 
1578
- #: class/wpmdbpro.php:275
1579
  msgid ""
1580
  "A demonstration of what's new in WP Migrate DB Pro Media Files Addon 1.3 and "
1581
  "CLI Addon 1.1."
1582
  msgstr ""
1583
 
1584
- #: class/wpmdbpro.php:347
1585
  msgid ""
1586
  "Please activate your license before attempting a pull or push migration."
1587
  msgstr ""
1588
 
1589
- #: class/wpmdbpro.php:647
1590
  msgid ""
1591
  "The connection succeeded but the remote site is configured to reject pull "
1592
  "connections. You can change this in the \"settings\" tab on the remote site. "
1593
  "(#141)"
1594
  msgstr ""
1595
 
1596
- #: class/wpmdbpro.php:709
1597
  msgid ""
1598
  "The connection succeeded but the remote site is configured to reject pull "
1599
  "connections. You can change this in the \"settings\" tab on the remote site. "
1600
  "(#110)"
1601
  msgstr ""
1602
 
1603
- #: class/wpmdbpro.php:711
1604
  msgid ""
1605
  "The connection succeeded but the remote site is configured to reject push "
1606
  "connections. You can change this in the \"settings\" tab on the remote site. "
1607
  "(#110)"
1608
  msgstr ""
1609
 
1610
- #: class/wpmdbpro.php:792
1611
  msgctxt "Asking to try and connect to remote server after verification error"
1612
  msgid "Try again?"
1613
  msgstr ""
1614
 
1615
- #: class/wpmdbpro.php:804
1616
  #, php-format
1617
  msgid ""
1618
  "<b>Version Mismatch</b> &mdash; We've detected you have version %1$s of WP "
@@ -1620,7 +1629,7 @@ msgid ""
1620
  "the Plugins page on both installs and check for updates."
1621
  msgstr ""
1622
 
1623
- #: class/wpmdbpro.php:806
1624
  #, php-format
1625
  msgid ""
1626
  "<b>Version Mismatch</b> &mdash; We've detected you have version %1$s of WP "
@@ -1628,134 +1637,134 @@ msgid ""
1628
  "\"%4$s\">Plugins page</a> on both installs and check for updates."
1629
  msgstr ""
1630
 
1631
- #: class/wpmdbpro.php:823
1632
  #, php-format
1633
  msgid ""
1634
  "Activate remote license &mdash; Looks like you don't have a WP Migrate DB "
1635
  "Pro license active at %s."
1636
  msgstr ""
1637
 
1638
- #: class/wpmdbpro.php:825
1639
  #, php-format
1640
  msgid "Copy %1$s license key to %2$s and activate it"
1641
  msgstr ""
1642
 
1643
- #: class/wpmdbpro.php:836
1644
  msgid ""
1645
  "The connection succeeded but the remote site is configured to reject pull "
1646
  "connections. You can change this in the \"settings\" tab on the remote site. "
1647
  "(#122)"
1648
  msgstr ""
1649
 
1650
- #: class/wpmdbpro.php:838
1651
  msgid ""
1652
  "The connection succeeded but the remote site is configured to reject push "
1653
  "connections. You can change this in the \"settings\" tab on the remote site. "
1654
  "(#122)"
1655
  msgstr ""
1656
 
1657
- #: class/wpmdbpro.php:840
1658
  msgctxt "Attempt to connect to the remote server again"
1659
  msgid "Try again?"
1660
  msgstr ""
1661
 
1662
- #: class/wpmdbpro.php:988
1663
  msgctxt "Delete license"
1664
  msgid "Remove"
1665
  msgstr ""
1666
 
1667
- #: class/wpmdbpro.php:1171
1668
  msgid ""
1669
  "If you have an <strong>active license</strong>, you may send an email to the "
1670
  "following address."
1671
  msgstr ""
1672
 
1673
- #: class/wpmdbpro.php:1173
1674
  msgid ""
1675
  "Please copy the Diagnostic Info &amp; Error Log info below into a text file "
1676
  "and attach it to your email. Do the same for any other site involved in your "
1677
  "email."
1678
  msgstr ""
1679
 
1680
- #: class/wpmdbpro.php:1204
1681
  msgctxt "License does not allow use of addons"
1682
  msgid "Addons Unavailable"
1683
  msgstr ""
1684
 
1685
- #: class/wpmdbpro.php:1204
1686
  #, php-format
1687
  msgid ""
1688
  "Addons are not included with the Personal license. Visit <a href=\"%s\" "
1689
  "target=\"_blank\">My Account</a> to upgrade in just a few clicks."
1690
  msgstr ""
1691
 
1692
- #: class/wpmdbpro.php:1219
1693
  msgctxt "Installed on website but not activated"
1694
  msgid "Installed"
1695
  msgstr ""
1696
 
1697
- #: class/wpmdbpro.php:1221
1698
  msgctxt "Installed and activated on website"
1699
  msgid "Activated"
1700
  msgstr ""
1701
 
1702
- #: class/wpmdbpro.php:1224
1703
  msgctxt "Enable addon so it may be used"
1704
  msgid "Activate"
1705
  msgstr ""
1706
 
1707
- #: class/wpmdbpro.php:1228
1708
  msgctxt "Download and activate addon"
1709
  msgid "Install"
1710
  msgstr ""
1711
 
1712
- #: class/wpmdbpro.php:1234
1713
  #: template/common/debug-info.php:4
1714
  msgctxt "Download to your computer"
1715
  msgid "Download"
1716
  msgstr ""
1717
 
1718
- #: class/wpmdbpro.php:1367
1719
  msgid "Could not upload the SQL to the server. (#135)"
1720
  msgstr ""
1721
 
1722
- #: class/wpmdbpro.php:1373
1723
  msgid "Could not read the SQL file we uploaded to the server. (#136)"
1724
  msgstr ""
1725
 
1726
- #: class/wpmdbpro.php:1392
1727
  msgid ""
1728
  "The connection succeeded but the remote site is configured to reject push "
1729
  "connections. You can change this in the \"settings\" tab on the remote site. "
1730
  "(#139)"
1731
  msgstr ""
1732
 
1733
- #: class/wpmdbpro.php:1624
1734
  #, php-format
1735
  msgid "There is a new version of %s available."
1736
  msgstr ""
1737
 
1738
- #: class/wpmdbpro.php:1626
1739
  #, php-format
1740
  msgid "View version %s details"
1741
  msgstr ""
1742
 
1743
- #: class/wpmdbpro.php:1636
1744
  #, php-format
1745
  msgid ""
1746
  "To update, go to %1$s and enter your license key. If you don't have a "
1747
  "license key, you may <a href=\"%2$s\">purchase one</a>."
1748
  msgstr ""
1749
 
1750
- #: class/wpmdbpro.php:1638
1751
  #, php-format
1752
  msgid ""
1753
  "To finish activating %1$s, please go to %2$s and enter your license key. If "
1754
  "you don't have a license key, you may <a href=\"%3$s\">purchase one</a>."
1755
  msgstr ""
1756
 
1757
- #: class/wpmdbpro.php:1725
1758
- #: class/wpmdbpro.php:1736
1759
  msgid "Could not retrieve version details. Please try again."
1760
  msgstr ""
1761
 
@@ -1845,40 +1854,41 @@ msgid ""
1845
  msgstr ""
1846
 
1847
  #: template/common/compatibility.php:27
1848
- msgid "Plugin Compatibility Mode"
1849
  msgstr ""
1850
 
1851
  #: template/common/compatibility.php:32
1852
  #, php-format
1853
  msgid ""
1854
- "Enabling this feature will enhance performance and reduce the likelihood of "
1855
- "a third-party plugin interfering with migrations. <a href=\"%1$s\" target="
1856
- "\"_blank\">Learn More »</a>"
 
1857
  msgstr ""
1858
 
1859
- #: template/common/compatibility.php:53
1860
  #: template/pro/backup.php:47
1861
  #: template/pro/exclude-post-types.php:33
1862
  #: template/pro/select-tables.php:56
1863
  msgid "Select All"
1864
  msgstr ""
1865
 
1866
- #: template/common/compatibility.php:55
1867
  #: template/pro/backup.php:49
1868
  #: template/pro/exclude-post-types.php:35
1869
  #: template/pro/select-tables.php:58
1870
  msgid "Deselect All"
1871
  msgstr ""
1872
 
1873
- #: template/common/compatibility.php:57
1874
  #: template/pro/backup.php:51
1875
  #: template/pro/exclude-post-types.php:37
1876
  #: template/pro/select-tables.php:60
1877
  msgid "Invert Selection"
1878
  msgstr ""
1879
 
1880
- #: template/common/compatibility.php:60
1881
- msgid "Enable Selected Plugins for Migration Requests"
1882
  msgstr ""
1883
 
1884
  #: template/common/debug-info.php:2
@@ -1968,28 +1978,44 @@ msgid ""
1968
  "transmitted unencrypted. Most people are fine with this, but just a heads up."
1969
  msgstr ""
1970
 
1971
- #: template/migrate.php:124
1972
- msgid "Cannot Access Uploads Directory"
 
1973
  msgstr ""
1974
 
1975
  #: template/migrate.php:126
1976
  msgid ""
1977
- "We require write permissions to the standard WordPress uploads directory. "
1978
- "Without this permission exports are unavailable. Please grant 755 "
1979
- "permissions on the following directory:"
1980
  msgstr ""
1981
 
1982
- #: template/migrate.php:139
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1983
  msgctxt "Source text to be replaced"
1984
  msgid "Find"
1985
  msgstr ""
1986
 
1987
- #: template/migrate.php:140
1988
  msgctxt "Text to replace in source"
1989
  msgid "Replace"
1990
  msgstr ""
1991
 
1992
- #: template/migrate.php:182
1993
  #, php-format
1994
  msgid ""
1995
  "This find & replace will find the domain name of your remote site and "
@@ -1998,7 +2024,7 @@ msgid ""
1998
  "target=\"_blank\">Find & Replace Documentation</a>"
1999
  msgstr ""
2000
 
2001
- #: template/migrate.php:203
2002
  #, php-format
2003
  msgid ""
2004
  "This find and replace is mostly for 3rd party plugins that store the "
@@ -2007,7 +2033,7 @@ msgid ""
2007
  "migration. <a href=\"%s\" target=\"_blank\">Find & Replace Documentation</a>"
2008
  msgstr ""
2009
 
2010
- #: template/migrate.php:243
2011
  #, php-format
2012
  msgid ""
2013
  "<strong>New URL Missing</strong> &mdash; Please enter the protocol-relative "
@@ -2017,7 +2043,7 @@ msgid ""
2017
  "fields."
2018
  msgstr ""
2019
 
2020
- #: template/migrate.php:245
2021
  #, php-format
2022
  msgid ""
2023
  "<strong>New URL Missing</strong> &mdash; Please enter the protocol-relative "
@@ -2026,7 +2052,7 @@ msgid ""
2026
  "documentation</a> on find and replace fields."
2027
  msgstr ""
2028
 
2029
- #: template/migrate.php:249
2030
  #, php-format
2031
  msgid ""
2032
  "<strong>New File Path Missing</strong> &mdash; Please enter the root file "
@@ -2036,15 +2062,15 @@ msgid ""
2036
  "find and replace fields."
2037
  msgstr ""
2038
 
2039
- #: template/migrate.php:258
2040
  msgid "Advanced Options"
2041
  msgstr ""
2042
 
2043
- #: template/migrate.php:267
2044
  msgid "Replace GUIDs"
2045
  msgstr ""
2046
 
2047
- #: template/migrate.php:273
2048
  #, php-format
2049
  msgid ""
2050
  "Although the <a href=\"%s\" target=\"_blank\">WordPress Codex emphasizes</a> "
@@ -2054,37 +2080,37 @@ msgid ""
2054
  "want to migrate the site live to somedomain.com."
2055
  msgstr ""
2056
 
2057
- #: template/migrate.php:279
2058
  msgid "Exclude spam comments"
2059
  msgstr ""
2060
 
2061
- #: template/migrate.php:285
2062
  msgid ""
2063
  "Do not migrate the 'active_plugins' setting (i.e. which plugins are "
2064
  "activated/deactivated)"
2065
  msgstr ""
2066
 
2067
- #: template/migrate.php:297
2068
  msgid "Compatible with older versions of MySQL (pre-5.5)"
2069
  msgstr ""
2070
 
2071
- #: template/migrate.php:315
2072
  msgid "Save Migration Profile"
2073
  msgstr ""
2074
 
2075
- #: template/migrate.php:315
2076
  msgid "Save the above settings for the next time you do a similiar migration"
2077
  msgstr ""
2078
 
2079
- #: template/migrate.php:337
2080
  msgid "Create new profile"
2081
  msgstr ""
2082
 
2083
- #: template/migrate.php:346
2084
  msgid "Warning: Different Table Prefixes"
2085
  msgstr ""
2086
 
2087
- #: template/migrate.php:348
2088
  msgid ""
2089
  "Whoa! We've detected that the database table prefix differs between "
2090
  "installations. Clicking the Migrate button below will create new database "
@@ -2092,7 +2118,7 @@ msgid ""
2092
  "span>\"."
2093
  msgstr ""
2094
 
2095
- #: template/migrate.php:349
2096
  #, php-format
2097
  msgid ""
2098
  "Whoa! We've detected that the database table prefix differs between "
@@ -2100,7 +2126,7 @@ msgid ""
2100
  "tables in the remote database with prefix \"%s\"."
2101
  msgstr ""
2102
 
2103
- #: template/migrate.php:350
2104
  #, php-format
2105
  msgid ""
2106
  "Whoa! We've detected that the database table prefix in the import file does "
@@ -2108,7 +2134,7 @@ msgid ""
2108
  "below will create new database tables with the prefix \"%s\"."
2109
  msgstr ""
2110
 
2111
- #: template/migrate.php:352
2112
  #, php-format
2113
  msgid ""
2114
  "However, your local install is configured to use table prefix \"%1$s\" and "
@@ -2117,7 +2143,7 @@ msgid ""
2117
  "variable to \"<span class=\"remote-prefix\"></span>\"."
2118
  msgstr ""
2119
 
2120
- #: template/migrate.php:353
2121
  #, php-format
2122
  msgid ""
2123
  "However, your remote install is configured to use table prefix \"<span class="
@@ -2127,7 +2153,7 @@ msgid ""
2127
  "span>\" variable to \"%s\"."
2128
  msgstr ""
2129
 
2130
- #: template/migrate.php:354
2131
  #, php-format
2132
  msgid ""
2133
  "However, this install is configured to use the table prefix \"%1$s\" and "
@@ -2136,25 +2162,25 @@ msgid ""
2136
  "of the \"$table_prefix\" variable to \"%2$s\"."
2137
  msgstr ""
2138
 
2139
- #: template/migrate.php:356
2140
  msgid ""
2141
  "This will allow your local install to use the migrated tables. Once you do "
2142
  "this, you shouldn't have to do it again."
2143
  msgstr ""
2144
 
2145
- #: template/migrate.php:357
2146
  msgid ""
2147
  "This will allow your remote install to use the migrated tables. Once you do "
2148
  "this, you shouldn't have to do it again."
2149
  msgstr ""
2150
 
2151
- #: template/migrate.php:358
2152
  msgid ""
2153
  "That will allow this install to use the imported tables. Once you do this, "
2154
  "you shouldn't have to do it again."
2155
  msgstr ""
2156
 
2157
- #: template/migrate.php:372
2158
  msgctxt "Save current migration settings"
2159
  msgid "Save Profile"
2160
  msgstr ""
@@ -2236,31 +2262,16 @@ msgstr ""
2236
  msgid "Backup only selected tables below"
2237
  msgstr ""
2238
 
2239
- #: template/pro/backup.php:56
2240
  msgid ""
2241
  "The backup option has been disabled because the local uploads directory is "
2242
- "not writable."
2243
  msgstr ""
2244
 
2245
  #: template/pro/backup.php:59
2246
  msgid ""
2247
  "The backup option has been disabled because the remote uploads directory is "
2248
- "not writable."
2249
- msgstr ""
2250
-
2251
- #: template/pro/backup.php:61
2252
- #, php-format
2253
- msgid ""
2254
- "We can't save the backup to the following folder: <br><span class=\"upload-"
2255
- "directory-location\">%s</span>"
2256
- msgstr ""
2257
-
2258
- #: template/pro/backup.php:62
2259
- msgid ""
2260
- "Please adjust the permissions on this folder. <a href=\"https://"
2261
- "deliciousbrains.com/wp-migrate-db-pro/doc/uploads-folder-permissions/?"
2262
- "utm_campaign=error%2Bmessages&utm_source=MDB%2BPaid&utm_medium=insideplugin"
2263
- "\" target=\"_blank\">See our documentation for more information »</a>"
2264
  msgstr ""
2265
 
2266
  #: template/pro/block-external-warning.php:4
@@ -2361,6 +2372,68 @@ msgstr ""
2361
  msgid "Activate License"
2362
  msgstr ""
2363
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2364
  #: template/pro/outdated-addons-warning.php:16
2365
  #, php-format
2366
  msgid ""
@@ -2550,40 +2623,44 @@ msgstr ""
2550
  msgid "More About The Pro Version"
2551
  msgstr ""
2552
 
2553
- #: template/wpmdb/sidebar.php:3
 
 
 
 
2554
  msgid ""
2555
- "WP Migrate DB Pro &mdash; Push and pull your database from one WordPress "
2556
- "install to another in 1-click."
2557
  msgstr ""
2558
 
2559
- #: template/wpmdb/sidebar.php:6
2560
  msgid "Get 20% Off!"
2561
  msgstr ""
2562
 
2563
- #: template/wpmdb/sidebar.php:11
2564
  #, php-format
2565
  msgid ""
2566
  "Submit your name and email and we'll send you a coupon for 20% off your "
2567
  "upgrade to the pro version."
2568
  msgstr ""
2569
 
2570
- #: template/wpmdb/sidebar.php:15
2571
  msgid "Your Email"
2572
  msgstr ""
2573
 
2574
- #: template/wpmdb/sidebar.php:19
2575
  msgid "First Name"
2576
  msgstr ""
2577
 
2578
- #: template/wpmdb/sidebar.php:23
2579
  msgid "Last Name"
2580
  msgstr ""
2581
 
2582
- #: template/wpmdb/sidebar.php:30
2583
  msgid "Send me the coupon"
2584
  msgstr ""
2585
 
2586
- #: template/wpmdb/sidebar.php:34
2587
  msgid ""
2588
  "We promise we will not use your email for anything else and you can "
2589
  "unsubscribe with 1-click anytime."
8
  msgstr ""
9
  "Project-Id-Version: wp-migrate-db\n"
10
  "Report-Msgid-Bugs-To: nom@deliciousbrains.com\n"
11
+ "POT-Creation-Date: 2018-04-15 08:07-0400\n"
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
17
  "Content-Type: text/plain; charset=UTF-8\n"
18
  "Content-Transfer-Encoding: 8bit\n"
19
 
20
+ #: class/wpmdb-base.php:105
21
+ #: class/wpmdb-base.php:939
22
  #, php-format
23
  msgid ""
24
  "<strong>Could not connect to api.deliciousbrains.com</strong> &mdash; You "
29
  "can:%2$s"
30
  msgstr ""
31
 
32
+ #: class/wpmdb-base.php:105
33
+ #: class/wpmdb-base.php:939
34
  msgid "Temporarily disable SSL for connections to api.deliciousbrains.com"
35
  msgstr ""
36
 
37
+ #: class/wpmdb-base.php:106
38
  msgid ""
39
  "Could not connect to api.deliciousbrains.com - You will not receive update "
40
  "notifications or be able to activate your license until this is fixed. This "
45
  "deliciousbrains.com' );` to your wp-config.php file."
46
  msgstr ""
47
 
48
+ #: class/wpmdb-base.php:109
49
+ #: class/wpmdb-base.php:947
50
  #, php-format
51
  msgid ""
52
  "We've detected that <code>WP_HTTP_BLOCK_EXTERNAL</code> is enabled and the "
56
  "\" target=\"_blank\">More information</a>."
57
  msgstr ""
58
 
59
+ #: class/wpmdb-base.php:110
60
  #, php-format
61
  msgid ""
62
  "We've detected that WP_HTTP_BLOCK_EXTERNAL is enabled and the host %1$s has "
64
  "or add %1$s to WP_ACCESSIBLE_HOSTS to continue."
65
  msgstr ""
66
 
67
+ #: class/wpmdb-base.php:113
68
  #, php-format
69
  msgid ""
70
  "<strong>Your License Was Cancelled</strong> &mdash; Please visit <a href=\"%s"
73
  "%s</a>"
74
  msgstr ""
75
 
76
+ #: class/wpmdb-base.php:113
77
+ #: class/wpmdb-base.php:121
78
+ #: class/wpmdb-base.php:125
79
+ #: class/wpmdb-base.php:129
80
+ #: class/wpmdbpro.php:1101
81
+ #: class/wpmdbpro.php:1658
82
  msgid "Check my license again"
83
  msgstr ""
84
 
85
+ #: class/wpmdb-base.php:114
86
  #, php-format
87
  msgid ""
88
  "Your License Was Cancelled - Please login to your account (%s) to renew or "
89
  "upgrade your license and enable push and pull."
90
  msgstr ""
91
 
 
92
  #: class/wpmdb-base.php:117
93
+ #: class/wpmdb-base.php:118
94
  msgid "Your License Has Expired"
95
  msgstr ""
96
 
97
+ #: class/wpmdb-base.php:121
98
  #, php-format
99
  msgid ""
100
  "Login to <a href=\"%s\">My Account</a> to renew. <a href=\"%s\" class="
101
  "\"check-my-licence-again\">%s</a>"
102
  msgstr ""
103
 
104
+ #: class/wpmdb-base.php:122
105
  #, php-format
106
  msgid "Login to your account to renew (%s)"
107
  msgstr ""
108
 
109
+ #: class/wpmdb-base.php:125
110
  #, php-format
111
  msgid ""
112
  "<strong>No Activations Left</strong> &mdash; Please visit <a href=\"%s\" "
115
  "my-licence-again\">%s</a>"
116
  msgstr ""
117
 
118
+ #: class/wpmdb-base.php:126
119
  #, php-format
120
  msgid ""
121
  "No Activations Left - Please visit your account (%s) to upgrade your license "
122
  "or deactivate a previous activation and enable push and pull."
123
  msgstr ""
124
 
125
+ #: class/wpmdb-base.php:129
126
  #, php-format
127
  msgid ""
128
  "<strong>Your License Was Not Found</strong> &mdash; Perhaps you made a typo "
131
  "license key. <a href=\"%s\" class=\"check-my-licence-again\">%s</a>"
132
  msgstr ""
133
 
134
+ #: class/wpmdb-base.php:130
135
  #, php-format
136
  msgid ""
137
  "Your License Was Not Found - Perhaps you made a typo when defining your "
139
  "to double check your license key."
140
  msgstr ""
141
 
142
+ #: class/wpmdb-base.php:133
143
  #, php-format
144
  msgid "<strong>Your License Was Not Found</strong> &mdash; %s"
145
  msgstr ""
146
 
147
+ #: class/wpmdb-base.php:134
148
  #, php-format
149
  msgid "Your License Was Not Found - %s"
150
  msgstr ""
151
 
 
152
  #: class/wpmdb-base.php:137
153
+ #: class/wpmdb-base.php:138
154
  msgid "Your License Is Inactive"
155
  msgstr ""
156
 
 
157
  #: class/wpmdb-base.php:137
158
+ #: class/wpmdb-base.php:138
159
  msgid "Your license has been deactivated for this install."
160
  msgstr ""
161
 
 
162
  #: class/wpmdb-base.php:137
163
+ #: class/wpmdb-base.php:138
164
  msgid "Reactivate your license"
165
  msgstr ""
166
 
167
+ #: class/wpmdb-base.php:141
168
  #, php-format
169
  msgid ""
170
  "<strong>An Unexpected Error Occurred</strong> &mdash; Please contact us at "
171
  "<a href=\"%1$s\">%2$s</a> and quote the following: <p>%3$s</p>"
172
  msgstr ""
173
 
174
+ #: class/wpmdb-base.php:142
175
  #, php-format
176
  msgid ""
177
  "An Unexpected Error Occurred - Please contact us at %2$s and quote the "
178
  "following: %3$s"
179
  msgstr ""
180
 
181
+ #: class/wpmdb-base.php:260
182
  msgid ""
183
  "Invalid content verification signature, please verify the connection "
184
  "information on the remote site and try again."
185
  msgstr ""
186
 
187
+ #: class/wpmdb-base.php:260
188
  #, php-format
189
  msgctxt "Ex. Remote URL: http://wp.dev"
190
  msgid " Remote URL: %s "
191
  msgstr ""
192
 
193
+ #: class/wpmdb-base.php:489
194
  #, php-format
195
  msgid ""
196
  "The connection to the remote server has timed out, no changes have been "
197
  "committed. (#134 - scope: %s)"
198
  msgstr ""
199
 
200
+ #: class/wpmdb-base.php:491
201
  #, php-format
202
  msgid "We could not find: %s. Are you sure this is the correct URL?"
203
  msgstr ""
204
 
205
+ #: class/wpmdb-base.php:497
206
  msgid ""
207
  "It appears that you might be trying to pull from a local environment. This "
208
  "will not work if <u>this</u> website happens to be located on a remote "
210
  "environment."
211
  msgstr ""
212
 
213
+ #: class/wpmdb-base.php:499
214
  msgid ""
215
  "It appears that you might be trying to push to a local environment. This "
216
  "will not work if <u>this</u> website happens to be located on a remote "
218
  "environment."
219
  msgstr ""
220
 
221
+ #: class/wpmdb-base.php:507
222
  #, php-format
223
  msgid ""
224
  "We've detected that <code>WP_HTTP_BLOCK_EXTERNAL</code> is enabled and the "
228
  "\" target=\"_blank\">More information</a>. (#147 - scope: %3$s)"
229
  msgstr ""
230
 
231
+ #: class/wpmdb-base.php:510
232
  #, php-format
233
  msgid ""
234
  "Couldn't connect over HTTPS. You might want to try regular HTTP instead. "
235
  "(#121 - scope: %s)"
236
  msgstr ""
237
 
238
+ #: class/wpmdb-base.php:512
239
  #, php-format
240
  msgid ""
241
  "<strong>HTTPS Connection Error:</strong> (#121 - scope: %s) This typically "
245
  "documentation</a> for possible solutions."
246
  msgstr ""
247
 
248
+ #: class/wpmdb-base.php:514
249
  #, php-format
250
  msgid ""
251
  "The connection failed, an unexpected error occurred, please contact support. "
252
  "(#121 - scope: %s)"
253
  msgstr ""
254
 
255
+ #: class/wpmdb-base.php:527
256
  msgid ""
257
  "The remote site is protected with Basic Authentication. Please enter the "
258
  "username and password above to continue. (401 Unauthorized)"
259
  msgstr ""
260
 
261
+ #: class/wpmdb-base.php:535
262
  #, php-format
263
  msgid ""
264
  "Unable to connect to the remote server, the remote server responded with: "
265
  "%1$s %2$s (scope: %3$s)"
266
  msgstr ""
267
 
268
+ #: class/wpmdb-base.php:547
269
  #, php-format
270
  msgid ""
271
  "Unable to connect to the remote server, please check the connection details "
272
  "- %1$s %2$s (#129 - scope: %3$s)"
273
  msgstr ""
274
 
275
+ #: class/wpmdb-base.php:563
276
  #, php-format
277
  msgid ""
278
  "WP Migrate DB Pro does not seem to be installed or active on the remote "
279
  "site. (#131 - scope: %s)"
280
  msgstr ""
281
 
282
+ #: class/wpmdb-base.php:569
283
  #, php-format
284
  msgid ""
285
  "A response was expected from the remote, instead we got nothing. (#146 - "
286
  "scope: %1$s) Please review %2$s for possible solutions."
287
  msgstr ""
288
 
289
+ #: class/wpmdb-base.php:569
290
+ #: class/wpmdb.php:4026
291
  msgid "our documentation"
292
  msgstr ""
293
 
294
+ #: class/wpmdb-base.php:579
295
  msgid ""
296
  "There was a problem with the AJAX request, we were expecting a serialized "
297
  "response, instead we received:<br />"
298
  msgstr ""
299
 
300
+ #: class/wpmdb-base.php:992
301
  msgid ""
302
  "<strong>Delicious Brains API is Down — </strong>Unfortunately we're "
303
  "experiencing some problems with our server."
304
  msgstr ""
305
 
306
+ #: class/wpmdb-base.php:996
307
  #, php-format
308
  msgctxt "ex. 2 hours ago"
309
  msgid "%s ago"
310
  msgstr ""
311
 
312
+ #: class/wpmdb-base.php:1001
313
  msgid "Here's the most recent update on its status"
314
  msgstr ""
315
 
316
+ #: class/wpmdb-base.php:1028
317
  #, php-format
318
  msgid ""
319
  "Error retrieving download from deliciousbrain.com. Please try again or "
320
  "download manually from <a href=\"%1$s\">%2$s</a>."
321
  msgstr ""
322
 
323
+ #: class/wpmdb-base.php:1028
324
  msgctxt "Delicious Brains account"
325
  msgid "My Account"
326
  msgstr ""
327
 
328
+ #: class/wpmdb-base.php:1087
329
+ #: class/wpmdb.php:119
330
+ #: class/wpmdb.php:347
331
+ #: class/wpmdbpro.php:1651
332
  msgctxt "Plugin configuration and preferences"
333
  msgid "Settings"
334
  msgstr ""
335
 
336
+ #: class/wpmdb-base.php:1088
337
  #, php-format
338
  msgid ""
339
  "To finish activating WP Migrate DB Pro, please go to %1$s and enter your "
341
  "\">purchase one</a>."
342
  msgstr ""
343
 
344
+ #: class/wpmdb-base.php:1319
345
+ #: class/wpmdb-base.php:1329
346
  msgctxt "A new version of the plugin is available"
347
  msgid "Update Available"
348
  msgstr ""
349
 
350
+ #: class/wpmdb-base.php:1320
351
  #, php-format
352
  msgid "A new version of %1$s is now available. %2$s"
353
  msgstr ""
354
 
355
+ #: class/wpmdb-base.php:1320
356
+ #: class/wpmdb-base.php:1330
357
  msgctxt "Download and install a new version of the plugin"
358
  msgid "Update Now"
359
  msgstr ""
360
 
361
+ #: class/wpmdb-base.php:1330
362
  #, php-format
363
  msgid ""
364
  "%1$s %2$s is now available. You currently have %3$s installed. <a href=\"%4$s"
365
  "\">%5$s</a>"
366
  msgstr ""
367
 
368
+ #: class/wpmdb-base.php:1429
369
  #, php-format
370
  msgid ""
371
  "<strong>Activate Your License</strong> &mdash; Please <a href=\"%s\" class="
373
  "priority support and plugin updates."
374
  msgstr ""
375
 
376
+ #: class/wpmdb-base.php:1446
377
  msgid ""
378
  "<strong>We've temporarily activated your license and will complete the "
379
  "activation once the Delicious Brains API is available again.</strong>"
380
  msgstr ""
381
 
382
+ #: class/wpmdb-base.php:1475
383
  msgid "Updates are only available to those with an active license. "
384
  msgstr ""
385
 
386
+ #: class/wpmdb-base.php:1476
387
  msgid "Only active licenses can download and install addons. "
388
  msgstr ""
389
 
390
+ #: class/wpmdb-base.php:1477
391
  msgid "Only active licenses can submit support requests. "
392
  msgstr ""
393
 
394
+ #: class/wpmdb-base.php:1478
395
  msgid ""
396
  "All features will continue to work, but you won't be able to receive updates "
397
  "or email support. "
398
  msgstr ""
399
 
400
+ #: class/wpmdb-base.php:1546
401
  #, php-format
402
  msgid "Invalid nonce for: %s"
403
  msgstr ""
404
 
405
+ #: class/wpmdb-base.php:1554
406
  #, php-format
407
  msgid "Access denied for: %s"
408
  msgstr ""
409
 
410
+ #: class/wpmdb-base.php:1731
411
  msgctxt "dismiss notice permanently"
412
  msgid "Dismiss"
413
  msgstr ""
414
 
415
+ #: class/wpmdb-base.php:1744
416
  msgid "Remind Me Later"
417
  msgstr ""
418
 
419
+ #: class/wpmdb-base.php:1846
420
  msgid "Failed to save migration state. Please contact support."
421
  msgstr ""
422
 
423
+ #: class/wpmdb-base.php:1869
424
  msgid "Failed to retrieve migration state. Please contact support."
425
  msgstr ""
426
 
534
  msgstr ""
535
 
536
  #: class/wpmdb-command.php:190
537
+ #: class/wpmdb.php:3547
538
  msgid "Find & Replace complete"
539
  msgstr ""
540
 
551
  "mu-plugins folder: %s"
552
  msgstr ""
553
 
554
+ #: class/wpmdb-compatibility-plugin-manager.php:234
555
  #, php-format
556
  msgid ""
557
  "The compatibility plugin could not be deactivated because your mu-plugin "
559
  "mu-plugins folder: %s"
560
  msgstr ""
561
 
562
+ #: class/wpmdb-replace.php:267
563
+ #, php-format
564
+ msgid ""
565
+ "WP Migrate DB - Failed to instantiate object for replacement. If the "
566
+ "serialized object's class is defined by a plugin, you should enable that "
567
+ "plugin for migration requests. \n"
568
+ "Class Name: %s"
569
+ msgstr ""
570
+
571
+ #: class/wpmdb-replace.php:321
572
  msgid ""
573
  "Failed attempting to do the recursive unserialize replace. Please contact "
574
  "support."
667
  msgid "WPMDB Error: Data cannot be unserialized. %s"
668
  msgstr ""
669
 
670
+ #: class/wpmdb.php:118
671
  msgctxt "Configure a migration or export"
672
  msgid "Migrate"
673
  msgstr ""
674
 
675
+ #: class/wpmdb.php:120
676
  msgctxt "Plugin extensions"
677
  msgid "Addons"
678
  msgstr ""
679
 
680
+ #: class/wpmdb.php:121
681
  msgctxt "Get help or contact support"
682
  msgid "Help"
683
  msgstr ""
684
 
685
+ #: class/wpmdb.php:807
686
  #, php-format
687
  msgid ""
688
  "The imported table `%1s` contains characters which are invalid in the target "
692
  "documentation</a> for more information."
693
  msgstr ""
694
 
695
+ #: class/wpmdb.php:810
696
  #, php-format
697
  msgid ""
698
  "The table `%1s` contains characters which are invalid in the target "
700
  "information."
701
  msgstr ""
702
 
703
+ #: class/wpmdb.php:1133
704
  #, php-format
705
  msgid ""
706
  "<p><strong>Export Failed</strong> — We can't save your export to the "
709
  "more information »</a></p>"
710
  msgstr ""
711
 
712
+ #: class/wpmdb.php:1174
713
+ #: class/wpmdbpro.php:393
714
+ #: class/wpmdbpro.php:1495
715
  msgid ""
716
  "Failed attempting to unserialize the response from the remote server. Please "
717
  "contact support."
718
  msgstr ""
719
 
720
+ #: class/wpmdb.php:2194
721
  #, php-format
722
  msgid ""
723
  "Failed to retrieve table structure for table '%s', please ensure your "
724
  "database is online. (#125)"
725
  msgstr ""
726
 
727
+ #: class/wpmdb.php:2293
728
  #, php-format
729
  msgid "Error creating temporary table. Table \"%s\" does not exist."
730
  msgstr ""
731
 
732
+ #: class/wpmdb.php:2399
733
  #, php-format
734
  msgid "Delete any existing table %s"
735
  msgstr ""
736
 
737
+ #: class/wpmdb.php:2410
738
  #, php-format
739
  msgid "Table structure of table %s"
740
  msgstr ""
741
 
742
+ #: class/wpmdb.php:2418
743
  msgid ""
744
  "Failed to generate the create table query, please ensure your database is "
745
  "online. (#126)"
746
  msgstr ""
747
 
748
+ #: class/wpmdb.php:2474
749
  #, php-format
750
  msgid "Data contents of table %s"
751
  msgstr ""
752
 
753
+ #: class/wpmdb.php:2492
754
  #, php-format
755
  msgid "End of data contents of table %s"
756
  msgstr ""
757
 
758
+ #: class/wpmdb.php:3008
759
  msgid "WordPress MySQL database migration"
760
  msgstr ""
761
 
762
+ #: class/wpmdb.php:3010
763
  #, php-format
764
  msgid "Generated: %s"
765
  msgstr ""
766
 
767
+ #: class/wpmdb.php:3011
768
  #, php-format
769
  msgid "Hostname: %s"
770
  msgstr ""
771
 
772
+ #: class/wpmdb.php:3012
773
  #, php-format
774
  msgid "Database: %s"
775
  msgstr ""
776
 
777
+ #: class/wpmdb.php:3117
778
  msgid "Failed to write the gzipped SQL data to the file. (#127)"
779
  msgstr ""
780
 
781
+ #: class/wpmdb.php:3124
782
  msgid "Failed to write the SQL data to the file. (#128)"
783
  msgstr ""
784
 
785
+ #: class/wpmdb.php:3273
786
+ #: class/wpmdb.php:3298
787
+ #: class/wpmdbpro.php:1455
788
  msgid "Migrate DB Pro"
789
  msgstr ""
790
 
791
+ #: class/wpmdb.php:3273
792
+ #: class/wpmdb.php:3298
793
+ #: class/wpmdb.php:3931
794
  msgid "Migrate DB"
795
  msgstr ""
796
 
797
+ #: class/wpmdb.php:3466
798
  msgid ""
799
  "A problem occurred when trying to change the maximum request size, please "
800
  "try again."
801
  msgstr ""
802
 
803
+ #: class/wpmdb.php:3467
804
+ #: class/wpmdbpro.php:1101
805
  msgid "A problem occurred when trying to check the license, please try again."
806
  msgstr ""
807
 
808
+ #: class/wpmdb.php:3468
809
  msgid "Establishing connection to remote server, please wait"
810
  msgstr ""
811
 
812
+ #: class/wpmdb.php:3469
813
  msgid ""
814
  "A problem occurred when attempting to connect to the local server, please "
815
  "check the details and try again."
816
  msgstr ""
817
 
818
+ #: class/wpmdb.php:3470
819
  msgid "Please enter your license key."
820
  msgstr ""
821
 
822
+ #: class/wpmdb.php:3471
823
  msgid ""
824
  "A problem occurred when trying to register the license, please try again."
825
  msgstr ""
826
 
827
+ #: class/wpmdb.php:3472
828
  msgid ""
829
  "Your license has been activated. You will now receive automatic updates and "
830
  "access to email support."
831
  msgstr ""
832
 
833
+ #: class/wpmdb.php:3473
834
  msgid "Fetching license details, please wait…"
835
  msgstr ""
836
 
837
+ #: class/wpmdb.php:3474
838
  msgid ""
839
  "An error occurred when trying to clear the debug log. Please contact "
840
  "support. (#132)"
841
  msgstr ""
842
 
843
+ #: class/wpmdb.php:3475
844
  msgid ""
845
  "An error occurred when trying to update the debug log. Please contact "
846
  "support. (#133)"
847
  msgstr ""
848
 
849
+ #: class/wpmdb.php:3476
850
  msgid "Please select at least one table to migrate."
851
  msgstr ""
852
 
853
+ #: class/wpmdb.php:3477
854
  msgid "Please select at least one table for backup."
855
  msgstr ""
856
 
857
+ #: class/wpmdb.php:3478
858
  msgid "Please select at least one table for the find & replace"
859
  msgstr ""
860
 
861
+ #: class/wpmdb.php:3479
862
  msgid "Please enter a name for your migration profile."
863
  msgstr ""
864
 
865
+ #: class/wpmdb.php:3480
866
  msgid ""
867
  "An error occurred when attempting to save the migration profile. Please see "
868
  "the Help tab for details on how to request support. (#118)"
869
  msgstr ""
870
 
871
+ #: class/wpmdb.php:3481
872
  msgctxt "Data has been successfully exported"
873
  msgid "Export complete"
874
  msgstr ""
875
 
876
+ #: class/wpmdb.php:3482
877
  msgid "Exporting, please wait…"
878
  msgstr ""
879
 
880
+ #: class/wpmdb.php:3483
881
  msgid "please wait…"
882
  msgstr ""
883
 
884
+ #: class/wpmdb.php:3484
885
  msgctxt "Finished successfully"
886
  msgid "complete"
887
  msgstr ""
888
 
889
+ #: class/wpmdb.php:3485
890
  msgctxt "Copy of data between servers did not complete"
891
  msgid "Migration failed"
892
  msgstr ""
893
 
894
+ #: class/wpmdb.php:3486
895
  msgctxt "Saving a copy of the data before import"
896
  msgid "Backing up"
897
  msgstr ""
898
 
899
+ #: class/wpmdb.php:3487
900
  msgctxt "In line to be processed"
901
  msgid "Queued"
902
  msgstr ""
903
 
904
+ #: class/wpmdb.php:3488
905
  msgctxt "Copying data between servers"
906
  msgid "Migrating"
907
  msgstr ""
908
 
909
+ #: class/wpmdb.php:3489
910
  msgctxt "Process is active"
911
  msgid "Running"
912
  msgstr ""
913
 
914
+ #: class/wpmdb.php:3490
915
  msgctxt "Current request status"
916
  msgid "Status"
917
  msgstr ""
918
 
919
+ #: class/wpmdb.php:3491
920
  msgctxt "The message the server responded with"
921
  msgid "Response"
922
  msgstr ""
923
 
924
+ #: class/wpmdb.php:3492
925
  msgid ""
926
  "A problem occurred when attempting to process the following table (#113)"
927
  msgstr ""
928
 
929
+ #: class/wpmdb.php:3493
930
  msgid ""
931
  "A problem occurred when processing the following table. We were expecting a "
932
  "response in JSON format but instead received an empty response."
933
  msgstr ""
934
 
935
+ #: class/wpmdb.php:3494
936
  msgid "Migration completed with some errors"
937
  msgstr ""
938
 
939
+ #: class/wpmdb.php:3495
940
  msgid "Migration complete, your backup is located at:"
941
  msgstr ""
942
 
943
+ #: class/wpmdb.php:3496
944
  msgid "A problem occurred when finalizing the backup. (#140)"
945
  msgstr ""
946
 
947
+ #: class/wpmdb.php:3497
948
  msgctxt "The settings were saved successfully"
949
  msgid "Saved"
950
  msgstr ""
951
 
952
+ #: class/wpmdb.php:3498
953
  msgid ""
954
  "Any sites setup to use the current secret key will no longer be able to "
955
  "connect. You will need to update those sites with the newly generated secret "
956
  "key. Do you wish to continue?"
957
  msgstr ""
958
 
959
+ #: class/wpmdb.php:3499
960
  msgid ""
961
  "An error occurred when trying to generate the secret key. Please see the "
962
  "Help tab for details on how to request support. (#105)"
963
  msgstr ""
964
 
965
+ #: class/wpmdb.php:3500
966
  msgid ""
967
  "You are about to remove the migration profile \"{{profile}}\". This cannot "
968
  "be undone. Do you wish to continue?"
969
  msgstr ""
970
 
971
+ #: class/wpmdb.php:3501
972
  msgid ""
973
  "An error occurred when trying to delete the profile. Please see the Help tab "
974
  "for details on how to request support. (#106)"
975
  msgstr ""
976
 
977
+ #: class/wpmdb.php:3502
978
  msgid ""
979
  "The selected migration profile could not be deleted because it was not "
980
  "found.\n"
982
  "migration profiles."
983
  msgstr ""
984
 
985
+ #: class/wpmdb.php:3503
986
  msgid ""
987
  "If you change the connection details, you will lose any replaces and table "
988
  "selections you have made below. Do you wish to continue?"
989
  msgstr ""
990
 
991
+ #: class/wpmdb.php:3504
992
  #: template/migrate.php:119
993
  msgid "Please enter the connection information above to continue."
994
  msgstr ""
995
 
996
+ #: class/wpmdb.php:3505
997
  msgid ""
998
  "An error occurred when trying to save the settings. Please try again. If the "
999
  "problem persists, please see the Help tab for details on how to request "
1000
  "support. (#108)"
1001
  msgstr ""
1002
 
1003
+ #: class/wpmdb.php:3506
1004
  msgid ""
1005
  "The connection information appears to be missing, please enter it to "
1006
  "continue."
1007
  msgstr ""
1008
 
1009
+ #: class/wpmdb.php:3507
1010
  msgid ""
1011
  "The connection information appears to be incorrect, it should consist of two "
1012
  "lines. The first being the remote server's URL and the second being the "
1013
  "secret key."
1014
  msgstr ""
1015
 
1016
+ #: class/wpmdb.php:3508
1017
  msgid ""
1018
  "The URL on the first line appears to be invalid, please check it and try "
1019
  "again."
1020
  msgstr ""
1021
 
1022
+ #: class/wpmdb.php:3509
1023
  msgid ""
1024
  "The secret key on the second line appears to be invalid. It should be a 40 "
1025
  "character string that consists of letters, numbers and special characters "
1026
  "only."
1027
  msgstr ""
1028
 
1029
+ #: class/wpmdb.php:3510
1030
  msgid ""
1031
  "It appears you've entered the URL for this website, you need to provide the "
1032
  "URL of the remote website instead."
1033
  msgstr ""
1034
 
1035
+ #: class/wpmdb.php:3511
1036
  msgid ""
1037
  "Looks like your remote secret key is the same as the secret key for this "
1038
  "site. To fix this, go to the <a href=\"#settings\">Settings tab</a> and "
1039
  "click \"Reset Secret Key\""
1040
  msgstr ""
1041
 
1042
+ #: class/wpmdb.php:3512
1043
  msgid "Time Elapsed:"
1044
  msgstr ""
1045
 
1046
+ #: class/wpmdb.php:3513
1047
  #: template/migrate-progress.php:17
1048
  msgctxt "Temporarily stop migrating"
1049
  msgid "Pause"
1050
  msgstr ""
1051
 
1052
+ #: class/wpmdb.php:3514
1053
  msgctxt "The migration has been temporarily stopped"
1054
  msgid "Migration Paused"
1055
  msgstr ""
1056
 
1057
+ #: class/wpmdb.php:3515
1058
  msgctxt "The find & replace has been temporarily stopped"
1059
  msgid "Find &amp; Replace Paused"
1060
  msgstr ""
1061
 
1062
+ #: class/wpmdb.php:3516
1063
  msgctxt "Restart migrating after it was paused"
1064
  msgid "Resume"
1065
  msgstr ""
1066
 
1067
+ #: class/wpmdb.php:3517
1068
  msgid "Completing current request"
1069
  msgstr ""
1070
 
1071
+ #: class/wpmdb.php:3518
1072
  msgctxt "The migration is being cancelled"
1073
  msgid "Cancelling migration"
1074
  msgstr ""
1075
 
1076
+ #: class/wpmdb.php:3519
1077
  msgctxt "The find & replace is being cancelled"
1078
  msgid "Cancelling find &amp; replace"
1079
  msgstr ""
1080
 
1081
+ #: class/wpmdb.php:3520
1082
  msgctxt "The migration has been temporarily stopped"
1083
  msgid "Paused"
1084
  msgstr ""
1085
 
1086
+ #: class/wpmdb.php:3521
1087
  msgid "Pause before finalizing the updates"
1088
  msgstr ""
1089
 
1090
+ #: class/wpmdb.php:3522
1091
  msgid ""
1092
  "Automatically paused before migrated tables are replaced. Click \"Resume\" "
1093
  "or \"Cancel\" when ready."
1094
  msgstr ""
1095
 
1096
+ #: class/wpmdb.php:3523
1097
  msgid ""
1098
  "Automatically paused before the find &amp; replace was finalized. Click "
1099
  "\"Resume\" or \"Cancel\" when ready."
1100
  msgstr ""
1101
 
1102
+ #: class/wpmdb.php:3524
1103
  msgid "Removing the local MySQL export file"
1104
  msgstr ""
1105
 
1106
+ #: class/wpmdb.php:3525
1107
  msgid "Removing the local backup MySQL export file"
1108
  msgstr ""
1109
 
1110
+ #: class/wpmdb.php:3526
1111
  msgid "Removing the local temporary tables"
1112
  msgstr ""
1113
 
1114
+ #: class/wpmdb.php:3527
1115
  msgid "Removing the remote backup MySQL export file"
1116
  msgstr ""
1117
 
1118
+ #: class/wpmdb.php:3528
1119
  msgid "Removing the remote temporary tables"
1120
  msgstr ""
1121
 
1122
+ #: class/wpmdb.php:3529
1123
  msgid "Migration cancellation failed"
1124
  msgstr ""
1125
 
1126
+ #: class/wpmdb.php:3530
1127
  msgid ""
1128
  "A problem occurred while cancelling the migration, you may have to manually "
1129
  "delete some temporary files / tables."
1130
  msgstr ""
1131
 
1132
+ #: class/wpmdb.php:3531
1133
  msgctxt "The migration has been cancelled"
1134
  msgid "Migration cancelled"
1135
  msgstr ""
1136
 
1137
+ #: class/wpmdb.php:3532
1138
  msgid ""
1139
  "The migration has been stopped and all temporary files and data have been "
1140
  "cleaned up."
1141
  msgstr ""
1142
 
1143
+ #: class/wpmdb.php:3533
1144
  msgctxt "The migration has been cancelled"
1145
  msgid "Find &amp; replace cancelled"
1146
  msgstr ""
1147
 
1148
+ #: class/wpmdb.php:3534
1149
  msgid ""
1150
  "The find &amp; replace has been cancelled and all temporary data has been "
1151
  "cleaned up."
1152
  msgstr ""
1153
 
1154
+ #: class/wpmdb.php:3535
1155
  msgctxt "The migration completed successfully"
1156
  msgid "Migration complete"
1157
  msgstr ""
1158
 
1159
+ #: class/wpmdb.php:3536
1160
  msgctxt "The migration is in the last stages"
1161
  msgid "Finalizing migration"
1162
  msgstr ""
1163
 
1164
+ #: class/wpmdb.php:3537
1165
  msgctxt "The caches and rewrite rules for the target are being flushed"
1166
  msgid "Flushing caches and rewrite rules"
1167
  msgstr ""
1168
 
1169
+ #: class/wpmdb.php:3538
1170
  msgid "A problem occurred when trying to add plugins to backlist."
1171
  msgstr ""
1172
 
1173
+ #: class/wpmdb.php:3539
1174
  msgid ""
1175
  "If confirmed we will install an additional WordPress 'Must Use' plugin. This "
1176
  "plugin will allow us to control which plugins are loaded during WP Migrate "
1177
  "DB Pro specific operations. Do you wish to continue?"
1178
  msgstr ""
1179
 
1180
+ #: class/wpmdb.php:3540
1181
  msgid ""
1182
  "A problem occurred when trying to change the plugin compatibility setting."
1183
  msgstr ""
1184
 
1185
+ #: class/wpmdb.php:3541
1186
  msgctxt "Confirmation required"
1187
  msgid "Sure?"
1188
  msgstr ""
1189
 
1190
+ #: class/wpmdb.php:3542
1191
  #, php-format
1192
  msgid "Pulling from %s…"
1193
  msgstr ""
1194
 
1195
+ #: class/wpmdb.php:3543
1196
  #, php-format
1197
  msgid "Pull from %s complete"
1198
  msgstr ""
1199
 
1200
+ #: class/wpmdb.php:3544
1201
  #, php-format
1202
  msgid "Pushing to %s…"
1203
  msgstr ""
1204
 
1205
+ #: class/wpmdb.php:3545
1206
  #, php-format
1207
  msgid "Push to %s complete"
1208
  msgstr ""
1209
 
1210
+ #: class/wpmdb.php:3546
1211
  msgid "Running Find & Replace…"
1212
  msgstr ""
1213
 
1214
+ #: class/wpmdb.php:3548
1215
  msgid "Importing…"
1216
  msgstr ""
1217
 
1218
+ #: class/wpmdb.php:3549
1219
  msgid "Import complete"
1220
  msgstr ""
1221
 
1222
+ #: class/wpmdb.php:3550
1223
  msgid "Copying license to the remote site, please wait"
1224
  msgstr ""
1225
 
1226
+ #: class/wpmdb.php:3551
1227
  msgid "Attempting to activate your license, please wait…"
1228
  msgstr ""
1229
 
1230
+ #: class/wpmdb.php:3552
1231
  msgid "License successfully activated, please wait…"
1232
  msgstr ""
1233
 
1234
+ #: class/wpmdb.php:3553
1235
  msgid ""
1236
  "An error occurred when trying to reactivate your license. Please provide the "
1237
  "following information when requesting support:"
1238
  msgstr ""
1239
 
1240
+ #: class/wpmdb.php:3554
1241
  msgid ""
1242
  "<strong>We've temporarily activated your licence and will complete the "
1243
  "activation once the Delicious Brains API is available again.</strong><br /"
1244
  ">Please refresh this page to continue."
1245
  msgstr ""
1246
 
1247
+ #: class/wpmdb.php:3555
1248
  msgid "JSON Decoding Failure"
1249
  msgstr ""
1250
 
1251
+ #: class/wpmdb.php:3556
1252
  msgid ""
1253
  "Our AJAX request was expecting JSON but we received something else. Often "
1254
  "this is caused by your theme and/or plugins spitting out PHP errors. If you "
1257
  "disable errors from showing up."
1258
  msgstr ""
1259
 
1260
+ #: class/wpmdb.php:3557
1261
  msgid "View error messages"
1262
  msgstr ""
1263
 
1264
+ #: class/wpmdb.php:3558
1265
  #, php-format
1266
  msgid "Waiting %s seconds before executing next step"
1267
  msgstr ""
1268
 
1269
+ #: class/wpmdb.php:3559
1270
  msgid ""
1271
  "A problem occurred when trying to change the delay between requests, please "
1272
  "try again."
1273
  msgstr ""
1274
 
1275
+ #: class/wpmdb.php:3560
1276
  msgid "A problem occurred when flushing caches and rewrite rules. (#145)"
1277
  msgstr ""
1278
 
1279
+ #: class/wpmdb.php:3561
1280
  msgctxt "Transfer this database to the remote site"
1281
  msgid "Push"
1282
  msgstr ""
1283
 
1284
+ #: class/wpmdb.php:3562
1285
  msgctxt "Transfer this database to the remote site and save migration profile"
1286
  msgid "Push &amp; Save"
1287
  msgstr ""
1288
 
1289
+ #: class/wpmdb.php:3563
1290
  msgctxt "Transfer the remote database to this site"
1291
  msgid "Pull"
1292
  msgstr ""
1293
 
1294
+ #: class/wpmdb.php:3564
1295
  msgctxt "Transfer the remote database to this site and save migration profile"
1296
  msgid "Pull &amp; Save"
1297
  msgstr ""
1298
 
1299
+ #: class/wpmdb.php:3565
1300
+ #: template/migrate.php:380
1301
  msgctxt "Download a copy of the database"
1302
  msgid "Export"
1303
  msgstr ""
1304
 
1305
+ #: class/wpmdb.php:3566
1306
  msgctxt "Download a copy of the database and save migration profile"
1307
  msgid "Export &amp; Save"
1308
  msgstr ""
1309
 
1310
+ #: class/wpmdb.php:3567
1311
  msgctxt "Import an SQL file into the database"
1312
  msgid "Import"
1313
  msgstr ""
1314
 
1315
+ #: class/wpmdb.php:3568
1316
  msgctxt "Import an SQL file and save migration profile"
1317
  msgid "Import &amp; Save"
1318
  msgstr ""
1319
 
1320
+ #: class/wpmdb.php:3569
1321
  msgctxt "Run a find and replace on the database"
1322
  msgid "Find &amp; Replace"
1323
  msgstr ""
1324
 
1325
+ #: class/wpmdb.php:3570
1326
  msgctxt "Run a find and replace and save migration profile"
1327
  msgid "Find &amp; Replace &amp; Save"
1328
  msgstr ""
1329
 
1330
+ #: class/wpmdb.php:3571
1331
  msgctxt "database tables"
1332
  msgid "Tables"
1333
  msgstr ""
1334
 
1335
+ #: class/wpmdb.php:3572
1336
  msgid "Files"
1337
  msgstr ""
1338
 
1339
+ #: class/wpmdb.php:3573
1340
  msgctxt "Transferred"
1341
  msgid "Migrated"
1342
  msgstr ""
1343
 
1344
+ #: class/wpmdb.php:3574
1345
  msgid "Backed Up"
1346
  msgstr ""
1347
 
1348
+ #: class/wpmdb.php:3575
1349
  msgid "Searched"
1350
  msgstr ""
1351
 
1352
+ #: class/wpmdb.php:3576
1353
  msgctxt "Obscure from view"
1354
  msgid "Hide"
1355
  msgstr ""
1356
 
1357
+ #: class/wpmdb.php:3577
1358
  msgctxt "Reveal"
1359
  msgid "Show"
1360
  msgstr ""
1361
 
1362
+ #: class/wpmdb.php:3578
1363
  msgid "Welcome to WP Migrate DB Pro! &#127881;"
1364
  msgstr ""
1365
 
1366
+ #: class/wpmdb.php:3579
1367
  #, php-format
1368
  msgid ""
1369
  "Hey, this is the first time activating your license, nice! Your migrations "
1373
  "submit a support request."
1374
  msgstr ""
1375
 
1376
+ #: class/wpmdb.php:3580
1377
  #, php-format
1378
  msgid "%1$s Stage %2$s of %3$s"
1379
  msgstr ""
1380
 
1381
+ #: class/wpmdb.php:3581
1382
  msgid "Paused"
1383
  msgstr ""
1384
 
1385
+ #: class/wpmdb.php:3582
1386
  msgid "Cancelling"
1387
  msgstr ""
1388
 
1389
+ #: class/wpmdb.php:3583
1390
  msgid "Cancelled"
1391
  msgstr ""
1392
 
1393
+ #: class/wpmdb.php:3584
1394
  msgid "Finalizing"
1395
  msgstr ""
1396
 
1397
+ #: class/wpmdb.php:3585
1398
  msgid "Complete"
1399
  msgstr ""
1400
 
1401
+ #: class/wpmdb.php:3586
1402
  msgid "Failed"
1403
  msgstr ""
1404
 
1405
+ #: class/wpmdb.php:3587
1406
  #, php-format
1407
  msgid "%1$s items are not shown to maintain browser performance"
1408
  msgstr ""
1409
 
1410
+ #: class/wpmdb.php:3588
1411
  msgctxt "Error log emptied"
1412
  msgid "Cleared"
1413
  msgstr ""
1414
 
1415
+ #: class/wpmdb.php:3589
1416
  msgid "Parsing SQL file, please wait"
1417
  msgstr ""
1418
 
1419
+ #: class/wpmdb.php:3590
1420
  msgid ""
1421
  "The selected file does not have a recognized file type. Please upload a "
1422
  "valid SQL file to continue."
1423
  msgstr ""
1424
 
1425
+ #: class/wpmdb.php:3591
1426
  msgid "Please select an SQL export file above to continue."
1427
  msgstr ""
1428
 
1429
+ #: class/wpmdb.php:3592
1430
  msgid "Profile Loaded"
1431
  msgstr ""
1432
 
1433
+ #: class/wpmdb.php:3592
1434
  msgid ""
1435
  "The selected profile has been loaded, please select an SQL export file above "
1436
  "to continue."
1437
  msgstr ""
1438
 
1439
+ #: class/wpmdb.php:3593
1440
  msgid "Uploading file to the server"
1441
  msgstr ""
1442
 
1443
+ #: class/wpmdb.php:3594
1444
  #, php-format
1445
  msgid "Importing data from %s"
1446
  msgstr ""
1447
 
1448
+ #: class/wpmdb.php:3595
1449
  msgid "Upload"
1450
  msgstr ""
1451
 
1452
+ #: class/wpmdb.php:3634
1453
  #, php-format
1454
  msgid "<h3>Output prevented download. </h3> %s"
1455
  msgstr ""
1456
 
1457
+ #: class/wpmdb.php:3637
1458
  msgid "Could not find the file to download:"
1459
  msgstr ""
1460
 
1461
+ #: class/wpmdb.php:3866
1462
  msgid "MySQL export file not found."
1463
  msgstr ""
1464
 
1465
+ #: class/wpmdb.php:3871
1466
  msgid "Could not delete the MySQL export file."
1467
  msgstr ""
1468
 
1469
+ #: class/wpmdb.php:3937
1470
  msgid ""
1471
  "WP Migrate DB and WP Migrate DB Pro cannot both be active. We've "
1472
  "automatically deactivated WP Migrate DB."
1473
  msgstr ""
1474
 
1475
+ #: class/wpmdb.php:3939
1476
  msgid ""
1477
  "WP Migrate DB and WP Migrate DB Pro cannot both be active. We've "
1478
  "automatically deactivated WP Migrate DB Pro."
1479
  msgstr ""
1480
 
1481
+ #: class/wpmdb.php:4026
1482
  #, php-format
1483
  msgid ""
1484
  "The source site supports utf8mb4 data but the target does not, aborting "
1486
  "information. (#148)"
1487
  msgstr ""
1488
 
1489
+ #: class/wpmdb.php:4077
1490
  msgid "Warning: Mixed Case Table Names"
1491
  msgstr ""
1492
 
1493
+ #: class/wpmdb.php:4080
1494
  msgid ""
1495
  "Whoa! We've detected that your <b>local</b> site has the MySQL setting "
1496
  "<code>lower_case_table_names</code> set to <code>1</code>."
1497
  msgstr ""
1498
 
1499
+ #: class/wpmdb.php:4082
1500
  msgid ""
1501
  "Whoa! We've detected that your <b>remote</b> site has the MySQL setting "
1502
  "<code>lower_case_table_names</code> set to <code>1</code>."
1503
  msgstr ""
1504
 
1505
+ #: class/wpmdb.php:4085
1506
  msgid ""
1507
  "As a result, uppercase characters in table names will be converted to "
1508
  "lowercase during the migration."
1509
  msgstr ""
1510
 
1511
+ #: class/wpmdb.php:4087
1512
  #, php-format
1513
  msgid ""
1514
  "You can read more about this in <a href=\"%s\">our documentation</a>, "
1523
  "Now</a></strong>"
1524
  msgstr ""
1525
 
1526
+ #: class/wpmdbpro-import.php:55
1527
  msgid ""
1528
  "The server is not compatible with gzip, please decompress the import file "
1529
  "and try again."
1530
  msgstr ""
1531
 
1532
+ #: class/wpmdbpro-import.php:66
1533
  msgid "Unable to read data from the import file"
1534
  msgstr ""
1535
 
1550
  msgid "Failed to import the SQL query: %s"
1551
  msgstr ""
1552
 
1553
+ #: class/wpmdbpro.php:269
1554
  msgid "UI Walkthrough"
1555
  msgstr ""
1556
 
1557
+ #: class/wpmdbpro.php:270
1558
  msgid ""
1559
  "A brief walkthrough of the WP Migrate DB plugin showing all of the different "
1560
  "options and explaining them."
1561
  msgstr ""
1562
 
1563
+ #: class/wpmdbpro.php:273
1564
  msgid "Pulling Live Data Into Your Local Development&nbsp;Environment"
1565
  msgstr ""
1566
 
1567
+ #: class/wpmdbpro.php:274
1568
  msgid ""
1569
  "This screencast demonstrates how you can pull data from a remote, live "
1570
  "WordPress install and update the data in your local development environment."
1571
  msgstr ""
1572
 
1573
+ #: class/wpmdbpro.php:277
1574
  msgid "Pushing Local Development Data to a Staging&nbsp;Environment"
1575
  msgstr ""
1576
 
1577
+ #: class/wpmdbpro.php:278
1578
  msgid ""
1579
  "This screencast demonstrates how you can push a local WordPress database "
1580
  "you've been using for development to a staging environment."
1581
  msgstr ""
1582
 
1583
+ #: class/wpmdbpro.php:281
1584
  msgid "WP Migrate DB Pro Media Files Addon 1.3 and CLI Addon 1.1"
1585
  msgstr ""
1586
 
1587
+ #: class/wpmdbpro.php:282
1588
  msgid ""
1589
  "A demonstration of what's new in WP Migrate DB Pro Media Files Addon 1.3 and "
1590
  "CLI Addon 1.1."
1591
  msgstr ""
1592
 
1593
+ #: class/wpmdbpro.php:358
1594
  msgid ""
1595
  "Please activate your license before attempting a pull or push migration."
1596
  msgstr ""
1597
 
1598
+ #: class/wpmdbpro.php:659
1599
  msgid ""
1600
  "The connection succeeded but the remote site is configured to reject pull "
1601
  "connections. You can change this in the \"settings\" tab on the remote site. "
1602
  "(#141)"
1603
  msgstr ""
1604
 
1605
+ #: class/wpmdbpro.php:721
1606
  msgid ""
1607
  "The connection succeeded but the remote site is configured to reject pull "
1608
  "connections. You can change this in the \"settings\" tab on the remote site. "
1609
  "(#110)"
1610
  msgstr ""
1611
 
1612
+ #: class/wpmdbpro.php:723
1613
  msgid ""
1614
  "The connection succeeded but the remote site is configured to reject push "
1615
  "connections. You can change this in the \"settings\" tab on the remote site. "
1616
  "(#110)"
1617
  msgstr ""
1618
 
1619
+ #: class/wpmdbpro.php:809
1620
  msgctxt "Asking to try and connect to remote server after verification error"
1621
  msgid "Try again?"
1622
  msgstr ""
1623
 
1624
+ #: class/wpmdbpro.php:821
1625
  #, php-format
1626
  msgid ""
1627
  "<b>Version Mismatch</b> &mdash; We've detected you have version %1$s of WP "
1629
  "the Plugins page on both installs and check for updates."
1630
  msgstr ""
1631
 
1632
+ #: class/wpmdbpro.php:823
1633
  #, php-format
1634
  msgid ""
1635
  "<b>Version Mismatch</b> &mdash; We've detected you have version %1$s of WP "
1637
  "\"%4$s\">Plugins page</a> on both installs and check for updates."
1638
  msgstr ""
1639
 
1640
+ #: class/wpmdbpro.php:840
1641
  #, php-format
1642
  msgid ""
1643
  "Activate remote license &mdash; Looks like you don't have a WP Migrate DB "
1644
  "Pro license active at %s."
1645
  msgstr ""
1646
 
1647
+ #: class/wpmdbpro.php:842
1648
  #, php-format
1649
  msgid "Copy %1$s license key to %2$s and activate it"
1650
  msgstr ""
1651
 
1652
+ #: class/wpmdbpro.php:853
1653
  msgid ""
1654
  "The connection succeeded but the remote site is configured to reject pull "
1655
  "connections. You can change this in the \"settings\" tab on the remote site. "
1656
  "(#122)"
1657
  msgstr ""
1658
 
1659
+ #: class/wpmdbpro.php:855
1660
  msgid ""
1661
  "The connection succeeded but the remote site is configured to reject push "
1662
  "connections. You can change this in the \"settings\" tab on the remote site. "
1663
  "(#122)"
1664
  msgstr ""
1665
 
1666
+ #: class/wpmdbpro.php:857
1667
  msgctxt "Attempt to connect to the remote server again"
1668
  msgid "Try again?"
1669
  msgstr ""
1670
 
1671
+ #: class/wpmdbpro.php:1005
1672
  msgctxt "Delete license"
1673
  msgid "Remove"
1674
  msgstr ""
1675
 
1676
+ #: class/wpmdbpro.php:1188
1677
  msgid ""
1678
  "If you have an <strong>active license</strong>, you may send an email to the "
1679
  "following address."
1680
  msgstr ""
1681
 
1682
+ #: class/wpmdbpro.php:1190
1683
  msgid ""
1684
  "Please copy the Diagnostic Info &amp; Error Log info below into a text file "
1685
  "and attach it to your email. Do the same for any other site involved in your "
1686
  "email."
1687
  msgstr ""
1688
 
1689
+ #: class/wpmdbpro.php:1221
1690
  msgctxt "License does not allow use of addons"
1691
  msgid "Addons Unavailable"
1692
  msgstr ""
1693
 
1694
+ #: class/wpmdbpro.php:1221
1695
  #, php-format
1696
  msgid ""
1697
  "Addons are not included with the Personal license. Visit <a href=\"%s\" "
1698
  "target=\"_blank\">My Account</a> to upgrade in just a few clicks."
1699
  msgstr ""
1700
 
1701
+ #: class/wpmdbpro.php:1236
1702
  msgctxt "Installed on website but not activated"
1703
  msgid "Installed"
1704
  msgstr ""
1705
 
1706
+ #: class/wpmdbpro.php:1238
1707
  msgctxt "Installed and activated on website"
1708
  msgid "Activated"
1709
  msgstr ""
1710
 
1711
+ #: class/wpmdbpro.php:1241
1712
  msgctxt "Enable addon so it may be used"
1713
  msgid "Activate"
1714
  msgstr ""
1715
 
1716
+ #: class/wpmdbpro.php:1245
1717
  msgctxt "Download and activate addon"
1718
  msgid "Install"
1719
  msgstr ""
1720
 
1721
+ #: class/wpmdbpro.php:1251
1722
  #: template/common/debug-info.php:4
1723
  msgctxt "Download to your computer"
1724
  msgid "Download"
1725
  msgstr ""
1726
 
1727
+ #: class/wpmdbpro.php:1384
1728
  msgid "Could not upload the SQL to the server. (#135)"
1729
  msgstr ""
1730
 
1731
+ #: class/wpmdbpro.php:1390
1732
  msgid "Could not read the SQL file we uploaded to the server. (#136)"
1733
  msgstr ""
1734
 
1735
+ #: class/wpmdbpro.php:1409
1736
  msgid ""
1737
  "The connection succeeded but the remote site is configured to reject push "
1738
  "connections. You can change this in the \"settings\" tab on the remote site. "
1739
  "(#139)"
1740
  msgstr ""
1741
 
1742
+ #: class/wpmdbpro.php:1641
1743
  #, php-format
1744
  msgid "There is a new version of %s available."
1745
  msgstr ""
1746
 
1747
+ #: class/wpmdbpro.php:1643
1748
  #, php-format
1749
  msgid "View version %s details"
1750
  msgstr ""
1751
 
1752
+ #: class/wpmdbpro.php:1653
1753
  #, php-format
1754
  msgid ""
1755
  "To update, go to %1$s and enter your license key. If you don't have a "
1756
  "license key, you may <a href=\"%2$s\">purchase one</a>."
1757
  msgstr ""
1758
 
1759
+ #: class/wpmdbpro.php:1655
1760
  #, php-format
1761
  msgid ""
1762
  "To finish activating %1$s, please go to %2$s and enter your license key. If "
1763
  "you don't have a license key, you may <a href=\"%3$s\">purchase one</a>."
1764
  msgstr ""
1765
 
1766
+ #: class/wpmdbpro.php:1742
1767
+ #: class/wpmdbpro.php:1753
1768
  msgid "Could not retrieve version details. Please try again."
1769
  msgstr ""
1770
 
1854
  msgstr ""
1855
 
1856
  #: template/common/compatibility.php:27
1857
+ msgid "Plugins to Load for Migration Requests"
1858
  msgstr ""
1859
 
1860
  #: template/common/compatibility.php:32
1861
  #, php-format
1862
  msgid ""
1863
+ "By default plugins are not loaded for migration requests. This enhances "
1864
+ "performance and reduces the likelihood of a third-party plugin interfering "
1865
+ "with migrations. To load certain plugins for migrations requests, select "
1866
+ "them below and save. <a href=\"%1$s\" target=\"_blank\">Learn More »</a>"
1867
  msgstr ""
1868
 
1869
+ #: template/common/compatibility.php:52
1870
  #: template/pro/backup.php:47
1871
  #: template/pro/exclude-post-types.php:33
1872
  #: template/pro/select-tables.php:56
1873
  msgid "Select All"
1874
  msgstr ""
1875
 
1876
+ #: template/common/compatibility.php:54
1877
  #: template/pro/backup.php:49
1878
  #: template/pro/exclude-post-types.php:35
1879
  #: template/pro/select-tables.php:58
1880
  msgid "Deselect All"
1881
  msgstr ""
1882
 
1883
+ #: template/common/compatibility.php:56
1884
  #: template/pro/backup.php:51
1885
  #: template/pro/exclude-post-types.php:37
1886
  #: template/pro/select-tables.php:60
1887
  msgid "Invert Selection"
1888
  msgstr ""
1889
 
1890
+ #: template/common/compatibility.php:59
1891
+ msgid "Save"
1892
  msgstr ""
1893
 
1894
  #: template/common/debug-info.php:2
1978
  "transmitted unencrypted. Most people are fine with this, but just a heads up."
1979
  msgstr ""
1980
 
1981
+ #: template/migrate.php:125
1982
+ #: template/pro/backup.php:57
1983
+ msgid "Uploads Directory Not Writable"
1984
  msgstr ""
1985
 
1986
  #: template/migrate.php:126
1987
  msgid ""
1988
+ "The Export feature is unavailable because the following directory is not "
1989
+ "writable:"
 
1990
  msgstr ""
1991
 
1992
+ #: template/migrate.php:127
1993
+ msgid ""
1994
+ "The Import feature is unavailable because the following directory is not "
1995
+ "writable:"
1996
+ msgstr ""
1997
+
1998
+ #: template/migrate.php:134
1999
+ #: template/pro/backup.php:66
2000
+ msgid "Please adjust the permissions on this directory."
2001
+ msgstr ""
2002
+
2003
+ #: template/migrate.php:136
2004
+ #: template/pro/backup.php:68
2005
+ msgid "More info"
2006
+ msgstr ""
2007
+
2008
+ #: template/migrate.php:148
2009
  msgctxt "Source text to be replaced"
2010
  msgid "Find"
2011
  msgstr ""
2012
 
2013
+ #: template/migrate.php:149
2014
  msgctxt "Text to replace in source"
2015
  msgid "Replace"
2016
  msgstr ""
2017
 
2018
+ #: template/migrate.php:191
2019
  #, php-format
2020
  msgid ""
2021
  "This find & replace will find the domain name of your remote site and "
2024
  "target=\"_blank\">Find & Replace Documentation</a>"
2025
  msgstr ""
2026
 
2027
+ #: template/migrate.php:212
2028
  #, php-format
2029
  msgid ""
2030
  "This find and replace is mostly for 3rd party plugins that store the "
2033
  "migration. <a href=\"%s\" target=\"_blank\">Find & Replace Documentation</a>"
2034
  msgstr ""
2035
 
2036
+ #: template/migrate.php:252
2037
  #, php-format
2038
  msgid ""
2039
  "<strong>New URL Missing</strong> &mdash; Please enter the protocol-relative "
2043
  "fields."
2044
  msgstr ""
2045
 
2046
+ #: template/migrate.php:254
2047
  #, php-format
2048
  msgid ""
2049
  "<strong>New URL Missing</strong> &mdash; Please enter the protocol-relative "
2052
  "documentation</a> on find and replace fields."
2053
  msgstr ""
2054
 
2055
+ #: template/migrate.php:258
2056
  #, php-format
2057
  msgid ""
2058
  "<strong>New File Path Missing</strong> &mdash; Please enter the root file "
2062
  "find and replace fields."
2063
  msgstr ""
2064
 
2065
+ #: template/migrate.php:267
2066
  msgid "Advanced Options"
2067
  msgstr ""
2068
 
2069
+ #: template/migrate.php:276
2070
  msgid "Replace GUIDs"
2071
  msgstr ""
2072
 
2073
+ #: template/migrate.php:282
2074
  #, php-format
2075
  msgid ""
2076
  "Although the <a href=\"%s\" target=\"_blank\">WordPress Codex emphasizes</a> "
2080
  "want to migrate the site live to somedomain.com."
2081
  msgstr ""
2082
 
2083
+ #: template/migrate.php:288
2084
  msgid "Exclude spam comments"
2085
  msgstr ""
2086
 
2087
+ #: template/migrate.php:294
2088
  msgid ""
2089
  "Do not migrate the 'active_plugins' setting (i.e. which plugins are "
2090
  "activated/deactivated)"
2091
  msgstr ""
2092
 
2093
+ #: template/migrate.php:306
2094
  msgid "Compatible with older versions of MySQL (pre-5.5)"
2095
  msgstr ""
2096
 
2097
+ #: template/migrate.php:324
2098
  msgid "Save Migration Profile"
2099
  msgstr ""
2100
 
2101
+ #: template/migrate.php:324
2102
  msgid "Save the above settings for the next time you do a similiar migration"
2103
  msgstr ""
2104
 
2105
+ #: template/migrate.php:346
2106
  msgid "Create new profile"
2107
  msgstr ""
2108
 
2109
+ #: template/migrate.php:355
2110
  msgid "Warning: Different Table Prefixes"
2111
  msgstr ""
2112
 
2113
+ #: template/migrate.php:357
2114
  msgid ""
2115
  "Whoa! We've detected that the database table prefix differs between "
2116
  "installations. Clicking the Migrate button below will create new database "
2118
  "span>\"."
2119
  msgstr ""
2120
 
2121
+ #: template/migrate.php:358
2122
  #, php-format
2123
  msgid ""
2124
  "Whoa! We've detected that the database table prefix differs between "
2126
  "tables in the remote database with prefix \"%s\"."
2127
  msgstr ""
2128
 
2129
+ #: template/migrate.php:359
2130
  #, php-format
2131
  msgid ""
2132
  "Whoa! We've detected that the database table prefix in the import file does "
2134
  "below will create new database tables with the prefix \"%s\"."
2135
  msgstr ""
2136
 
2137
+ #: template/migrate.php:361
2138
  #, php-format
2139
  msgid ""
2140
  "However, your local install is configured to use table prefix \"%1$s\" and "
2143
  "variable to \"<span class=\"remote-prefix\"></span>\"."
2144
  msgstr ""
2145
 
2146
+ #: template/migrate.php:362
2147
  #, php-format
2148
  msgid ""
2149
  "However, your remote install is configured to use table prefix \"<span class="
2153
  "span>\" variable to \"%s\"."
2154
  msgstr ""
2155
 
2156
+ #: template/migrate.php:363
2157
  #, php-format
2158
  msgid ""
2159
  "However, this install is configured to use the table prefix \"%1$s\" and "
2162
  "of the \"$table_prefix\" variable to \"%2$s\"."
2163
  msgstr ""
2164
 
2165
+ #: template/migrate.php:365
2166
  msgid ""
2167
  "This will allow your local install to use the migrated tables. Once you do "
2168
  "this, you shouldn't have to do it again."
2169
  msgstr ""
2170
 
2171
+ #: template/migrate.php:366
2172
  msgid ""
2173
  "This will allow your remote install to use the migrated tables. Once you do "
2174
  "this, you shouldn't have to do it again."
2175
  msgstr ""
2176
 
2177
+ #: template/migrate.php:367
2178
  msgid ""
2179
  "That will allow this install to use the imported tables. Once you do this, "
2180
  "you shouldn't have to do it again."
2181
  msgstr ""
2182
 
2183
+ #: template/migrate.php:381
2184
  msgctxt "Save current migration settings"
2185
  msgid "Save Profile"
2186
  msgstr ""
2262
  msgid "Backup only selected tables below"
2263
  msgstr ""
2264
 
2265
+ #: template/pro/backup.php:58
2266
  msgid ""
2267
  "The backup option has been disabled because the local uploads directory is "
2268
+ "not writable:"
2269
  msgstr ""
2270
 
2271
  #: template/pro/backup.php:59
2272
  msgid ""
2273
  "The backup option has been disabled because the remote uploads directory is "
2274
+ "not writable:"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2275
  msgstr ""
2276
 
2277
  #: template/pro/block-external-warning.php:4
2372
  msgid "Activate License"
2373
  msgstr ""
2374
 
2375
+ #: template/pro/mst-required.php:3
2376
+ #: template/pro/mst-required.php:20
2377
+ msgid "single site"
2378
+ msgstr ""
2379
+
2380
+ #: template/pro/mst-required.php:4
2381
+ #: template/pro/mst-required.php:19
2382
+ msgid "multisite"
2383
+ msgstr ""
2384
+
2385
+ #: template/pro/mst-required.php:11
2386
+ msgid "Multisite tools addon"
2387
+ msgstr ""
2388
+
2389
+ #: template/pro/mst-required.php:13
2390
+ #, php-format
2391
+ msgid ""
2392
+ "It looks like the file you are trying to import is from a multisite install "
2393
+ "and this install is a single site. To run this type of import you'll need to "
2394
+ "use the %s to export a subsite as a single site. <a href=\"%s\" target="
2395
+ "\"_blank\">Learn more »</a>"
2396
+ msgstr ""
2397
+
2398
+ #: template/pro/mst-required.php:21
2399
+ #, php-format
2400
+ msgid ""
2401
+ "It looks like the file you are trying to import is from a single site "
2402
+ "install and this install is a multisite. This type of migration isn't "
2403
+ "currently supported. <a href=\"%s\" target=\"_blank\">Learn more »</a>"
2404
+ msgstr ""
2405
+
2406
+ #: template/pro/mst-required.php:29
2407
+ msgid "Activate"
2408
+ msgstr ""
2409
+
2410
+ #: template/pro/mst-required.php:31
2411
+ #, php-format
2412
+ msgid ""
2413
+ "It looks like the remote site is a %s install and this install is a %s. To "
2414
+ "run this type of migration you'll need the %s activated on the "
2415
+ "<strong>remote</strong> site."
2416
+ msgstr ""
2417
+
2418
+ #: template/pro/mst-required.php:45
2419
+ msgid "Install"
2420
+ msgstr ""
2421
+
2422
+ #: template/pro/mst-required.php:48
2423
+ msgid "Upgrade your license"
2424
+ msgstr ""
2425
+
2426
+ #: template/pro/mst-required.php:54
2427
+ #, php-format
2428
+ msgid ""
2429
+ "It looks like the remote site is a %s install and this install is a %s. To "
2430
+ "run this type of migration you'll need the %s. %s"
2431
+ msgstr ""
2432
+
2433
+ #: template/pro/mst-required.php:65
2434
+ msgid "Multisite Tools Addon Needed"
2435
+ msgstr ""
2436
+
2437
  #: template/pro/outdated-addons-warning.php:16
2438
  #, php-format
2439
  msgid ""
2623
  msgid "More About The Pro Version"
2624
  msgstr ""
2625
 
2626
+ #: template/wpmdb/sidebar.php:4
2627
+ msgid "Upgrade to Pro"
2628
+ msgstr ""
2629
+
2630
+ #: template/wpmdb/sidebar.php:5
2631
  msgid ""
2632
+ "Push and pull your database from one WordPress install to another "
2633
+ "in&nbsp;1&#8209;click."
2634
  msgstr ""
2635
 
2636
+ #: template/wpmdb/sidebar.php:9
2637
  msgid "Get 20% Off!"
2638
  msgstr ""
2639
 
2640
+ #: template/wpmdb/sidebar.php:14
2641
  #, php-format
2642
  msgid ""
2643
  "Submit your name and email and we'll send you a coupon for 20% off your "
2644
  "upgrade to the pro version."
2645
  msgstr ""
2646
 
2647
+ #: template/wpmdb/sidebar.php:18
2648
  msgid "Your Email"
2649
  msgstr ""
2650
 
2651
+ #: template/wpmdb/sidebar.php:22
2652
  msgid "First Name"
2653
  msgstr ""
2654
 
2655
+ #: template/wpmdb/sidebar.php:26
2656
  msgid "Last Name"
2657
  msgstr ""
2658
 
2659
+ #: template/wpmdb/sidebar.php:33
2660
  msgid "Send me the coupon"
2661
  msgstr ""
2662
 
2663
+ #: template/wpmdb/sidebar.php:37
2664
  msgid ""
2665
  "We promise we will not use your email for anything else and you can "
2666
  "unsubscribe with 1-click anytime."
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: bradt, deliciousbrains
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5VPMGLLK94XJC
4
  Tags: migrate, migration, export, data dump, backup, database, mysql
5
  Requires at least: 3.6
6
- Tested up to: 4.8.1
7
- Stable tag: 1.0.1
8
  License: GPLv2
9
 
10
  Migrates your database by running find & replace on URLs and file paths, handling serialized data, and saving an SQL file.
@@ -75,7 +75,7 @@ Yep, it will run a find &amp; replace on your serialized data and migrate it wit
75
 
76
  = What are the requirements? =
77
 
78
- They are the same as the [requirements for WP Migrate DB Pro](https://deliciousbrains.com/wp-migrate-db-pro/pricing/?utm_campaign=WP%2BMigrate%2BDB%2BPro&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=requirements#requirements.
79
 
80
  = Do you offer email support? =
81
 
@@ -89,6 +89,10 @@ If you upgrade to [WP Migrate DB Pro](http://deliciousbrains.com/wp-migrate-db-p
89
 
90
  == Changelog ==
91
 
 
 
 
 
92
  = WP Migrate DB 1.0.1 - 2017-09-14 =
93
  * Bug Fix: Parse error on PHP 5.2
94
  * Bug Fix: Row not set for `wpmdb_replace_custom_data` filter
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5VPMGLLK94XJC
4
  Tags: migrate, migration, export, data dump, backup, database, mysql
5
  Requires at least: 3.6
6
+ Tested up to: 4.9
7
+ Stable tag: 1.0.2
8
  License: GPLv2
9
 
10
  Migrates your database by running find & replace on URLs and file paths, handling serialized data, and saving an SQL file.
75
 
76
  = What are the requirements? =
77
 
78
+ They are the same as the [requirements for WP Migrate DB Pro](https://deliciousbrains.com/wp-migrate-db-pro/pricing/?utm_campaign=WP%2BMigrate%2BDB%2BPro&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=requirements#requirements).
79
 
80
  = Do you offer email support? =
81
 
89
 
90
  == Changelog ==
91
 
92
+ = WP Migrate DB 1.0.2 - 2017-10-25 =
93
+ * Bug fix: Some plugins causing "Invalid nonce" errors when using compatibility mode
94
+ * Bug fix: Error for invalid permissions for Exports not displaying
95
+
96
  = WP Migrate DB 1.0.1 - 2017-09-14 =
97
  * Bug Fix: Parse error on PHP 5.2
98
  * Bug Fix: Row not set for `wpmdb_replace_custom_data` filter
template/common/compatibility.php CHANGED
@@ -22,21 +22,20 @@
22
  'value' => $plugin_compatibility_checked,
23
  'disabled' => ! $this->compatibility_plugin_manager->is_muplugin_writable(),
24
  ) ); ?></td>
25
- <td>
26
  <h4>
27
- <?php _e( 'Plugin Compatibility Mode', 'wp-migrate-db' ); ?>
28
 
29
  <span class="setting-status"></span>
30
  </h4>
31
 
32
- <p class="has-margin"><?php printf( __( 'Enabling this feature will enhance performance and reduce the likelihood of a third-party plugin interfering with migrations. <a href="%1$s" target="_blank">Learn More »</a>', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/compatibility-mode/' ); ?></p>
33
  </td>
34
  </tr>
35
 
36
  <tr class="plugin-compatibility-section">
37
  <td colspan="2">
38
  <div class="indent-wrap expandable-content plugin-compatibility-wrap select-wrap">
39
- <p class="has-margin"><label for="selected_plugins">Plugins to enable for migration requests:</label></p>
40
  <select autocomplete="off" class="multiselect" id="selected-plugins" name="selected_plugins[]" multiple="multiple">
41
  <?php
42
  $whitelist = array_flip( (array) $this->settings['whitelist_plugins'] );
@@ -57,7 +56,7 @@
57
  <a class="multiselect-invert-selection js-action-link" href="#"><?php _e( 'Invert Selection', 'wp-migrate-db' ); ?></a>
58
 
59
  <p>
60
- <span class="button plugin-compatibility-save"><?php _e( 'Enable Selected Plugins for Migration Requests', 'wp-migrate-db' ); ?></span>
61
  </p>
62
  </div>
63
  </td>
22
  'value' => $plugin_compatibility_checked,
23
  'disabled' => ! $this->compatibility_plugin_manager->is_muplugin_writable(),
24
  ) ); ?></td>
25
+ <td class="compatibility-mode-description">
26
  <h4>
27
+ <?php _e( 'Plugins to Load for Migration Requests', 'wp-migrate-db' ); ?>
28
 
29
  <span class="setting-status"></span>
30
  </h4>
31
 
32
+ <p class="has-margin"><?php printf( __( 'By default plugins are not loaded for migration requests. This enhances performance and reduces the likelihood of a third-party plugin interfering with migrations. To load certain plugins for migrations requests, select them below and save. <a href="%1$s" target="_blank">Learn More »</a>', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/compatibility-mode/' ); ?></p>
33
  </td>
34
  </tr>
35
 
36
  <tr class="plugin-compatibility-section">
37
  <td colspan="2">
38
  <div class="indent-wrap expandable-content plugin-compatibility-wrap select-wrap">
 
39
  <select autocomplete="off" class="multiselect" id="selected-plugins" name="selected_plugins[]" multiple="multiple">
40
  <?php
41
  $whitelist = array_flip( (array) $this->settings['whitelist_plugins'] );
56
  <a class="multiselect-invert-selection js-action-link" href="#"><?php _e( 'Invert Selection', 'wp-migrate-db' ); ?></a>
57
 
58
  <p>
59
+ <span class="button plugin-compatibility-save"><?php _e( 'Save', 'wp-migrate-db' ); ?></span>
60
  </p>
61
  </div>
62
  </td>
template/common/debug-info.php CHANGED
@@ -1,6 +1,6 @@
1
  <div class="debug">
2
  <h3><?php _e( 'Diagnostic Info &amp; Error Log', 'wp-migrate-db' ); ?></h3>
3
  <textarea class="debug-log-textarea" autocomplete="off" readonly></textarea>
4
- <a href="<?php echo network_admin_url( $this->plugin_base . '&nonce=' . wp_create_nonce( 'wpmdb-download-log' ) . '&wpmdb-download-log=1' ); ?>" class="button"><?php _ex( 'Download', 'Download to your computer', 'wp-migrate-db' ); ?></a>
5
  <a class="button clear-log js-action-link"><?php _e( 'Clear Error Log', 'wp-migrate-db' ); ?></a>
6
- </div>
1
  <div class="debug">
2
  <h3><?php _e( 'Diagnostic Info &amp; Error Log', 'wp-migrate-db' ); ?></h3>
3
  <textarea class="debug-log-textarea" autocomplete="off" readonly></textarea>
4
+ <a href="<?php echo network_admin_url( $this->plugin_base . '&nonce=' . WPMDB_Utils::create_nonce( 'wpmdb-download-log' ) . '&wpmdb-download-log=1' ); ?>" class="button"><?php _ex( 'Download', 'Download to your computer', 'wp-migrate-db' ); ?></a>
5
  <a class="button clear-log js-action-link"><?php _e( 'Clear Error Log', 'wp-migrate-db' ); ?></a>
6
+ </div>
template/migrate.php CHANGED
@@ -118,14 +118,23 @@ $breadcrumbs_params = array(
118
 
119
  <p class="connection-status"><?php _e( 'Please enter the connection information above to continue.', 'wp-migrate-db' ); ?></p>
120
 
121
- <?php $this->template_part( array( 'import_file_status' ) ); ?>
122
 
123
  <div class="notification-message error-notice directory-permission-notice inline-message" style="display: none;">
124
- <strong><?php _e( 'Cannot Access Uploads Directory', 'wp-migrate-db' ); ?></strong> &mdash;
125
- <?php
126
- _e( 'We require write permissions to the standard WordPress uploads directory. Without this permission exports are unavailable. Please grant 755 permissions on the following directory:', 'wp-migrate-db' );
127
- echo esc_html( $this->get_upload_info( 'path' ) );
128
- ?>
 
 
 
 
 
 
 
 
 
129
  </div>
130
 
131
  <div class="step-two">
118
 
119
  <p class="connection-status"><?php _e( 'Please enter the connection information above to continue.', 'wp-migrate-db' ); ?></p>
120
 
121
+ <?php $this->template_part( array( 'import_file_status', 'mst_required' ) ); ?>
122
 
123
  <div class="notification-message error-notice directory-permission-notice inline-message" style="display: none;">
124
+ <p>
125
+ <strong><?php _e( 'Uploads Directory Not Writable', 'wp-migrate-db' ); ?></strong> &mdash;
126
+ <span class="action-text savefile"><?php _e( 'The Export feature is unavailable because the following directory is not writable:', 'wp-migrate-db' ); ?></span>
127
+ <span class="action-text import"><?php _e( 'The Import feature is unavailable because the following directory is not writable:', 'wp-migrate-db' ); ?></span>
128
+ </p>
129
+
130
+ <p><?php echo esc_html( $this->get_upload_info( 'path' ) ); ?></p>
131
+
132
+ <p>
133
+ <?php printf( '%s <a href="%s">%s »</a>',
134
+ __( 'Please adjust the permissions on this directory.', 'wp-migrate-db' ),
135
+ 'https://deliciousbrains.com/wp-migrate-db-pro/doc/uploads-folder-permissions/?utm_campaign=error%2Bmessages&utm_source=MDB%2BPaid&utm_medium=insideplugin',
136
+ __( 'More info', 'wp-migrate-db' ) ); ?>
137
+ </p>
138
  </div>
139
 
140
  <div class="step-two">
template/wpmdb/sidebar.php CHANGED
@@ -1,6 +1,9 @@
1
  <div id="wpmdb-sidebar">
2
 
3
- <a class="wpmdb-banner" target="_blank" href="https://deliciousbrains.com/wp-migrate-db-pro/?utm_campaign=WP%2BMigrate%2BDB%2BPro%2BUpgrade&utm_source=MDB%2BFree&utm_medium=insideplugin"><img src="<?php echo plugins_url( 'asset/dist/img/wp-migrate-db-pro.jpg', $this->plugin_file_path ); ?>" width="292" height="292" alt="<?php _e( 'WP Migrate DB Pro &mdash; Push and pull your database from one WordPress install to another in 1-click.', 'wp-migrate-db' ); ?>" /></a>
 
 
 
4
 
5
  <form method="post" action="https://deliciousbrains.com/email-subscribe/" target="_blank" class="subscribe block">
6
  <h2><?php _e( 'Get 20% Off!', 'wp-migrate-db' ); ?></h2>
1
  <div id="wpmdb-sidebar">
2
 
3
+ <a class="wpmdb-banner" target="_blank" href="https://deliciousbrains.com/wp-migrate-db-pro/?utm_campaign=WP%2BMigrate%2BDB%2BPro%2BUpgrade&utm_source=MDB%2BFree&utm_medium=insideplugin">
4
+ <h4><?php _e( 'Upgrade to Pro', 'wp-migrate-db' ); ?></h4>
5
+ <p><?php _e( 'Push and pull your database from one WordPress install to another in&nbsp;1&#8209;click.', 'wp-migrate-db' ); ?></p>
6
+ </a>
7
 
8
  <form method="post" action="https://deliciousbrains.com/email-subscribe/" target="_blank" class="subscribe block">
9
  <h2><?php _e( 'Get 20% Off!', 'wp-migrate-db' ); ?></h2>
wp-migrate-db.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  /*
3
  Plugin Name: WP Migrate DB
4
- Plugin URI: http://wordpress.org/plugins/wp-migrate-db/
5
  Description: Exports your database as a MySQL data dump (much like phpMyAdmin), does a find and replace on URLs and file paths, then allows you to save it to your computer.
6
  Author: Delicious Brains
7
- Version: 1.0.1
8
- Author URI: http://deliciousbrains.com
9
  Network: True
10
  Text Domain: wp-migrate-db
11
  Domain Path: /languages/
@@ -22,7 +22,7 @@ Domain Path: /languages/
22
  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23
  // **********************************************************************
24
 
25
- $GLOBALS['wpmdb_meta']['wp-migrate-db']['version'] = '1.0.1';
26
 
27
  if ( ! class_exists( 'WPMDB_Utils' ) ) {
28
  require dirname( __FILE__ ) . '/class/wpmdb-utils.php';
1
  <?php
2
  /*
3
  Plugin Name: WP Migrate DB
4
+ Plugin URI: https://wordpress.org/plugins/wp-migrate-db/
5
  Description: Exports your database as a MySQL data dump (much like phpMyAdmin), does a find and replace on URLs and file paths, then allows you to save it to your computer.
6
  Author: Delicious Brains
7
+ Version: 1.0.2
8
+ Author URI: https://deliciousbrains.com
9
  Network: True
10
  Text Domain: wp-migrate-db
11
  Domain Path: /languages/
22
  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23
  // **********************************************************************
24
 
25
+ $GLOBALS['wpmdb_meta']['wp-migrate-db']['version'] = '1.0.2';
26
 
27
  if ( ! class_exists( 'WPMDB_Utils' ) ) {
28
  require dirname( __FILE__ ) . '/class/wpmdb-utils.php';