Version Description
Download this release
Release Info
Developer | deliciousbrains |
Plugin | WP Migrate DB |
Version | 1.0.3 |
Comparing to | |
See all releases |
Code changes from version 1.0.2 to 1.0.3
- asset/build/css/plugin-update-styles.css +1 -0
- asset/build/css/styles.css +1 -0
- asset/{dist → build}/img/icon-cli.svg +1 -1
- asset/{dist → build}/img/icon-media-files.svg +1 -1
- asset/{dist → build}/img/icon-multisite-tools.svg +1 -1
- asset/build/img/icon-theme-plugin-files.svg +12 -0
- asset/{dist → build}/img/mdb-banner.svg +0 -0
- asset/{dist → build}/img/mor10.png +0 -0
- asset/{dist → build}/img/mor10@2x.png +0 -0
- asset/build/js/bundle-103.js +2 -0
- asset/build/js/bundle-103.js.map +1 -0
- asset/dist/css/styles.css +0 -1
- asset/dist/js/script-102.js +0 -5310
- asset/dist/js/script-102.min.js +0 -1
- class/wpmdb-base.php +191 -42
- class/wpmdb-cli.php +8 -0
- class/wpmdb-command.php +10 -1
- class/wpmdb-compatibility.php +5 -3
- class/wpmdb-filesystem.php +91 -7
asset/build/css/plugin-update-styles.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.check-licence-spinner{left:5px;position:relative;top:2px;margin-bottom:-2px;width:16px;height:16px}.wpmdb-original-update-row{display:none}.plugin-update-tr.wpmdbpro-custom-visible .update-message.pre-shiny-updates,.plugin-update-tr.wpmdbpro-custom .update-message.pre-shiny-updates{padding-left:40px}.plugin-update-tr.wpmdbpro-custom-visible .update-message.pre-shiny-updates:before,.plugin-update-tr.wpmdbpro-custom .update-message.pre-shiny-updates:before{margin-left:-30px;float:left}.plugin-update-tr.wpmdbpro-custom-visible .update-message.pre-shiny-updates p,.plugin-update-tr.wpmdbpro-custom .update-message.pre-shiny-updates p{display:inline-block;margin:0}.plugin-update-tr.wpmdbpro-custom-visible .update-message.pre-shiny-updates span,.plugin-update-tr.wpmdbpro-custom .update-message.pre-shiny-updates span{display:block}.plugin-update-tr.wpmdbpro-custom-visible .update-message.post-shiny-updates p:before,.plugin-update-tr.wpmdbpro-custom .update-message.post-shiny-updates p:before{position:absolute}.plugin-update-tr.wpmdbpro-custom-visible .update-message.post-shiny-updates p span,.plugin-update-tr.wpmdbpro-custom .update-message.post-shiny-updates p span{margin-left:30px;display:block}.plugins #the-list tr.wpmdbpro-has-message td,.plugins #the-list tr.wpmdbpro-has-message th{box-shadow:none;-webkit-box-shadow:none}.plugins .plugin-update-tr .wpmdb-compat-plugin-row-error .notice{margin-top:0}
|
asset/build/css/styles.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
#overlay{background-color:hsla(0,0%,100%,.9);position:fixed;top:0;left:0;width:100%;height:100%;z-index:100000;overflow-x:auto;display:flex;flex-direction:row;align-items:flex-start;justify-content:center;transition:opacity .3s ease-out}#overlay.show{opacity:1;display:flex}@media screen and (max-width:700px){#overlay.show{justify-content:flex-start}}#overlay.hide{opacity:0;display:flex}@media screen and (max-width:1120px){.wpmdb-not-pro #overlay.show{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;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.complete,.migration-progress-stages .migration-progress-stage-container.queued{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.import .progress-items,.migration-progress-stages .migration-progress-stage-container.upload .progress-items{height:0!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;z-index:0}.migration-progress-stages .item-progress{position:relative;background-color:#eee;overflow:hidden;margin:0 0 .8em;transition:height .2s ease-in-out,margin .2s ease-in-out}.migration-progress-stages .item-progress .dashicons-yes.dashicons{position:absolute;right:.3em;top:.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 .progress-bar.excluded{opacity:.3}.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:0!important;opacity:0}@keyframes a{0%{background-position:0 0}to{background-position:50px 50px}}.clearfix:after,.clearfix:before{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,.5);cursor:default;font-size:14px;z-index:1;margin:0 10px;box-sizing:border-box;flex-direction:column;max-height:95%;overflow-y:hidden;transition:opacity .3s ease-out,transform .5s ease-out;width:700px;min-width:700px;flex-basis:700px;flex:0 1 0%}.progress-overlay-container.show{display:flex;opacity:1}.progress-overlay-container.hide{display:flex;opacity:0;transform:translateY(-100%)}.progress-overlay-container>div{flex:1 0 auto}.progress-overlay-container .migration-progress-stages{flex:100 1 auto}@media (-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:400;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 .5s ease-out;z-index:0}.progress-overlay-container .progress-bar-no-transition{transition:none!important}.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,hsla(0,0%,100%,.35) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.35) 0,hsla(0,0%,100%,.35) 75%,transparent 0,transparent);background-size:20px 20px;animation:a 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.find_replace .size-complete-wrap,.progress-overlay-container .stage-progress.import .items-complete-wrap,.progress-overlay-container .stage-progress.import .show-hide-tables,.progress-overlay-container .stage-progress.upload .items-complete-wrap,.progress-overlay-container .stage-progress.upload .show-hide-tables{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}.progress-overlay-container .progress-tables-hover-boxes{position:absolute;top:0;left:0;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:0 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 .2s ease-in-out}.progress-overlay-container .label-visible{opacity:1}.progress-overlay-container .progress-label:before{border-top:4px solid #ccc;bottom:-5px}.progress-overlay-container .progress-label:after,.progress-overlay-container .progress-label:before{content:"";width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;display:block;position:absolute;left:50%;margin-left:-2px}.progress-overlay-container .progress-label:after{border-top:4px solid #fff;bottom:-4px}.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;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}}.progress-overlay-container:not(.complete) .migration-progress-stages .item-progress:first-child{background-image:linear-gradient(-45deg,hsla(0,0%,100%,.3) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.3) 0,hsla(0,0%,100%,.3) 75%,transparent 0,transparent);background-size:50px 50px;animation:a 2s linear infinite}.progress-overlay-container.paused .active.stage-progress .progress-bar-wrapper,.progress-overlay-container.paused .migration-progress-stages .item-progress:first-child{animation-play-state:paused}.progress-overlay-container .migration-progress-stages .determining-media .item-progress:first-child{background-image:none;animation:none}.migrate-tab>.pro-version,.progress-overlay-container.cancelled .migration-progress-stages,.progress-overlay-container.cancelled .stage-progress.active,.progress-overlay-container.cancelled .stage-tabs,.progress-overlay-container.wpmdb-error .migration-progress-stages,.progress-overlay-container.wpmdb-error .stage-progress.active,.progress-overlay-container.wpmdb-error .stage-tabs{display:none}#overlay .pro-version{width:42%;padding-left:0;padding-right:0;flex-basis:42%;max-width:515px;min-width:400px;max-height:100%;order:2;font-size:14px;display:block;transition:transform .3s ease-out,opacity .3s ease-out,margin-left .2s ease-in-out .3s}#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:700;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 (-webkit-min-device-pixel-ratio:1.3),(min--moz-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:700;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}.check-licence-spinner{left:5px;position:relative;top:2px;margin-bottom:-2px;width:16px;height:16px}.wpmdb-original-update-row{display:none}.plugin-update-tr.wpmdbpro-custom-visible .update-message.pre-shiny-updates,.plugin-update-tr.wpmdbpro-custom .update-message.pre-shiny-updates{padding-left:40px}.plugin-update-tr.wpmdbpro-custom-visible .update-message.pre-shiny-updates:before,.plugin-update-tr.wpmdbpro-custom .update-message.pre-shiny-updates:before{margin-left:-30px;float:left}.plugin-update-tr.wpmdbpro-custom-visible .update-message.pre-shiny-updates p,.plugin-update-tr.wpmdbpro-custom .update-message.pre-shiny-updates p{display:inline-block;margin:0}.plugin-update-tr.wpmdbpro-custom-visible .update-message.pre-shiny-updates span,.plugin-update-tr.wpmdbpro-custom .update-message.pre-shiny-updates span{display:block}.plugin-update-tr.wpmdbpro-custom-visible .update-message.post-shiny-updates p:before,.plugin-update-tr.wpmdbpro-custom .update-message.post-shiny-updates p:before{position:absolute}.plugin-update-tr.wpmdbpro-custom-visible .update-message.post-shiny-updates p span,.plugin-update-tr.wpmdbpro-custom .update-message.post-shiny-updates p span{margin-left:30px;display:block}.plugins #the-list tr.wpmdbpro-has-message td,.plugins #the-list tr.wpmdbpro-has-message th{box-shadow:none;-webkit-box-shadow:none}.plugins .plugin-update-tr .wpmdb-compat-plugin-row-error .notice{margin-top:0}#wpmdb-main{width:742px;position:relative;min-height:950px;visibility:visible}.wpmdb h2~.error,.wpmdb h2~.notice,.wpmdb h2~.updated{clear:both}.wpmdb div.below-title.warning,.wpmdb div.updated.warning{max-width:742px;box-sizing:border-box;margin:10px 0}.wpmdb div.below-title.warning p,.wpmdb div.updated.warning p{font-size:13px;margin:.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=password],.wpmdb input[type=text]{padding:5px}.wpmdb input[disabled=disabled],.wpmdb label[disabled=disabled]{cursor:default}.wpmdb label.disabled{color:#888;cursor:default}.wpmdb div.disabled{color:#888}.wpmdb .option-section{border-bottom:1px solid #ccc;padding-bottom:20px;margin-bottom:20px}.wpmdb .option-section h3{font-size:18px;font-weight:400}.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:0}.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:400}.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}.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:700;clear:both;padding-top:.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:0 0 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:#999;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:700}.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:700}.wpmdb .option-group ul{display:none;margin:10px 0 10px 25px}.wpmdb .option-group ul label{font-size:12px;font-weight:400}.wpmdb .checkbox-label,.wpmdb .option-heading{font-size:14px;font-weight:700}.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 .advanced-options,.wpmdb .migrate-tab.import .exclude-post-types-options,.wpmdb .migrate-tab.import .table-options{margin-left:24px;display:none!important}.wpmdb .migrate-tab.import .advanced-options,.wpmdb .migrate-tab.import .find-replace-options,.wpmdb .migrate-tab.import .table-options{border-bottom:none;margin-bottom:0}.wpmdb .migrate-tab.import .exclude-post-types-options,.wpmdb .migrate-tab.import .table-options{border-top:1px solid #ccc;padding-top:20px}.wpmdb .basic-access-auth-wrapper{display:none;margin-bottom:5px}.wpmdb .auth-password,.wpmdb .auth-username{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:#eee;color:#888;font-family:Consolas,Monaco,monospace;text-shadow:0 1px 0 #fff}.wpmdb .push-list ul{margin-bottom:0}.wpmdb .find-heading,.wpmdb .replace-heading{float:left}.wpmdb .find-heading{width:382px}.wpmdb .replace-fields{border-collapse:collapse;border-spacing:0}.wpmdb .replace-fields input{width:295px}.wpmdb .replace-fields tr td{padding-bottom:7px}.wpmdb .replace-fields tr:last-child td{padding-bottom:0}.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:.5;cursor:default}.wpmdb .pin .sort-handle{cursor:default!important}.wpmdb .sort-handle-col{width:20px;cursor:-webkit-grab;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:0}.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(0) translateY(0) skewX(0deg) skewY(0deg);transform:scale(1) rotate(-90deg) translateX(0) translateY(0) 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:700;color:#9c1f1f}.wpmdb .exclude-post-types-warning p{margin:0 0 12px}.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:400}.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:#999;font-size:10px;font-weight:700;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:0 0 10px rgba(0,0,0,.2)}.wpmdb .inline-message{padding:10px;border-radius:3px;margin-top:5px}.wpmdb .inline-message.error{border:1px solid #c00;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{border-bottom:8px solid #aaa;top:-9px}.wpmdb .helper-message.bottom:after,.wpmdb .helper-message.bottom:before{content:"";border-left:8px solid transparent;border-right:8px solid transparent;border-top:0;display:block;height:0;left:50%;margin-left:-8px;position:absolute;width:0}.wpmdb .helper-message.bottom:after{border-bottom:8px solid #fff;top:-8px}.wpmdb .label-disabled{color:#888}.wpmdb .different-plugin-version-notice,.wpmdb .directory-permission-notice,.wpmdb .prefix-notice,.wpmdb .ssl-notice,.wpmdb .unrecognized-import-file-notice{background-color:#ffffe0;border:1px solid #e6db55;padding:15px;border-radius:3px;margin-bottom:15px;display:none}.wpmdb .different-plugin-version-notice p,.wpmdb .directory-permission-notice p,.wpmdb .prefix-notice p,.wpmdb .ssl-notice p,.wpmdb .unrecognized-import-file-notice p{margin-top:0}.wpmdb .different-plugin-version-notice p:last-child,.wpmdb .directory-permission-notice p:last-child,.wpmdb .prefix-notice p:last-child,.wpmdb .ssl-notice p:last-child,.wpmdb .unrecognized-import-file-notice p:last-child{margin:0}.wpmdb .mst-required{display:none}.wpmdb .different-plugin-version-notice,.wpmdb .directory-permission-notice{background-color:#ffebe8;border-color:#c00}.wpmdb .different-plugin-version-notice a,.wpmdb .directory-permission-notice a{color:#c00;text-decoration:underline}.wpmdb .mixed-case-table-name-notice{display:none}.wpmdb .save-migration-profile-wrap li label{font-size:12px;font-weight:400}.wpmdb .save-migration-profile-wrap li{margin-bottom:5px;padding-left:25px}.wpmdb .save-migration-profile-wrap .indent-wrap{margin-left:0}.wpmdb .create-new-label{margin-right:8px}.wpmdb .create-new-profile{position:absolute;top:-5px}.wpmdb .delete-profile,.wpmdb .replace-remove-row{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 .delete-profile:after,.wpmdb .replace-remove-row:after{content:"\D7";left:2px;position:absolute;top:-3px;color:#aaa;font-size:12px}.wpmdb .replace-remove-row:after{position:relative}.wpmdb .delete-profile:hover,.wpmdb .replace-remove-row:hover{border-color:#aaa}.wpmdb .ajax-success-msg{font-weight:700;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:0!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:700}.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:400}.wpmdb .settings-tab .form-table h4{font-size:15px}.wpmdb .settings-tab .form-table h4 .helper-message{font-weight:400}.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}.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:400;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:0}.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:0;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}.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,.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:700}.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:700}.wpmdb .allow-remote-reqeusts{font-size:14px;font-weight:700}.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;height:67px;text-shadow:0 1px 0 #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:0}.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}.wpmdb ul.plugin-compatibility-options{display:block;margin:10px 0}.wpmdb .plugin-compatibility-spinner{position:relative;top:3px;left:10px}.wpmdb .plugin-compatibility-success-msg{position:relative;left:10px;font-weight:700}.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:700;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:400}.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:700}.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:after,.wpmdb .help-tab .videos ul>li a:before{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;opacity:.8;border:1px solid #ddd;background-color:#fff;z-index:2}.wpmdb .help-tab .videos ul>li a:after{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:0;height:0;z-index:3}.wpmdb .help-tab .videos .video:last-child{margin-bottom:0}.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 #ccc;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 .2em}.wpmdb .help-tab p{margin:0 0 .5em}.wpmdb .addons-tab,.wpmdb .help-tab iframe{display:none}.wpmdb .addons-tab .addons-content>article:first-child,.wpmdb .addons-tab .addons-content>div:first-child{margin-top:0}.wpmdb .addons-tab .addon{position:relative;width:100%;min-height:138px;padding:25px 30px 30px 165px;box-sizing:border-box;margin-top:15px;border:1px solid #ddd;background-color:#f9f9f9;background-repeat:no-repeat}.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:#0085ba;color:#fff;display:inline-block;padding:.2em .4em}.wpmdb .addons-tab .addon .actions .action:hover{background-color:#008ec2}.wpmdb .addons-tab .addon .actions .status{border-bottom:2px solid #444;padding-bottom:.1em}.wpmdb .addons-tab .addon h1{float:left;margin:0;padding:0;font-weight:700;font-size:22px;margin-bottom:5px;color:#002040;text-transform:uppercase}.wpmdb .addons-tab .addon p{font-size:14px;line-height:1.4;clear:both;margin:0}.wpmdb .addons-tab .addon p a{text-decoration:underline}.wpmdb .addons-tab .addon.wp-migrate-db-pro-media-files{background-image:url(../img/icon-media-files.svg);background-position:30px 30px;background-size:110px 85px}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli{background-image:url(../img/icon-cli.svg);background-position:30px 30px;background-size:110px 97px;min-height:157px}.wpmdb .addons-tab .addon.wp-migrate-db-pro-multisite-tools{background-image:url(../img/icon-multisite-tools.svg);background-position:30px 20px;background-size:110px 118px;min-height:157px}.wpmdb .addons-tab .addon.wp-migrate-db-pro-theme-plugin-files{background-image:url(../img/icon-theme-plugin-files.svg);background-position:30px 20px;background-size:110px 118px;min-height:157px}.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) 0 100%/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:.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:.5em}#wpmdb-sidebar .subscribe .field p{margin-bottom:.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,body.mp6 p{font-size:14px}body.mp6 .wrap>h1,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=password],body.mp6 .wpmdb input[type=text]{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:700;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:.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 .checkbox-label,body.mp6 .wpmdb .option-heading{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 .delete-profile,body.mp6 .wpmdb .replace-remove-row{border:0;border-radius:0;height:auto;width:auto;left:0;top:50%;margin-left:0}body.mp6 .wpmdb .delete-profile:after,body.mp6 .wpmdb .replace-remove-row:after{content:"\F153";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 18px/1 dashicons;vertical-align:middle;color:#999}body.mp6 .wpmdb .delete-profile:hover:after,body.mp6 .wpmdb .replace-remove-row: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 .help-tab .support .email a,body.mp6 .wpmdb .help-tab .support p{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,.1);padding:10px 14px;font-size:13px}body.mp6 .wpmdb .notification-message{margin-bottom:20px;background-color:#fff}body.mp6 .wpmdb .notification-message.invalid-licence,body.mp6 .wpmdb .notification-message.ssl-notice,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:.5em 0}body.mp6 .wpmdb div.notification-message.invalid-licence p:last-child a.button{color:#555}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:400}body.mp6 #overlay{background-color:rgba(0,0,0,.5)}body.mp6 .migration-progress-ajax-spinner{top:20px}
|
asset/{dist → build}/img/icon-cli.svg
RENAMED
@@ -3,6 +3,6 @@
|
|
3 |
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
4 |
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
5 |
width="412px" height="365px" viewBox="0 0 412 365" enable-background="new 0 0 412 365" xml:space="preserve">
|
6 |
-
<path id="window-command-icon" fill="#
|
7 |
L87.998,255.96l48.801-49.065L87.93,157.761l27.461-27.329L191.458,206.895z M326,244.027H212.5v38H326V244.027z"/>
|
8 |
</svg>
|
3 |
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
4 |
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
5 |
width="412px" height="365px" viewBox="0 0 412 365" enable-background="new 0 0 412 365" xml:space="preserve">
|
6 |
+
<path id="window-command-icon" fill="#002040" d="M0,0v365h412V0H0z M362,315H50V97h312V315z M191.458,206.895l-75.999,76.397
|
7 |
L87.998,255.96l48.801-49.065L87.93,157.761l27.461-27.329L191.458,206.895z M326,244.027H212.5v38H326V244.027z"/>
|
8 |
</svg>
|
asset/{dist → build}/img/icon-media-files.svg
RENAMED
@@ -3,7 +3,7 @@
|
|
3 |
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
4 |
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
5 |
width="412px" height="318.25px" viewBox="0 0 412 318.25" enable-background="new 0 0 412 318.25" xml:space="preserve">
|
6 |
-
<path id="photo-camera-4-icon" fill="#
|
7 |
c-29.39,0-53.297-23.908-53.297-53.3c0-29.389,23.909-53.296,53.297-53.296C265.742,127.307,289.652,151.215,289.652,180.604z
|
8 |
M412,51.25v267H0v-267h113.219c11.253,0,21.56-6.297,26.694-16.31L157.832,0h153.665l19.819,35.785
|
9 |
c5.284,9.543,15.335,15.465,26.242,15.465H412z M104.831,109.5c0-11.322-9.178-20.5-20.5-20.5c-11.322,0-20.5,9.178-20.5,20.5
|
3 |
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
4 |
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
5 |
width="412px" height="318.25px" viewBox="0 0 412 318.25" enable-background="new 0 0 412 318.25" xml:space="preserve">
|
6 |
+
<path id="photo-camera-4-icon" fill="#002040" d="M289.652,180.604c0,29.392-23.909,53.3-53.3,53.3
|
7 |
c-29.39,0-53.297-23.908-53.297-53.3c0-29.389,23.909-53.296,53.297-53.296C265.742,127.307,289.652,151.215,289.652,180.604z
|
8 |
M412,51.25v267H0v-267h113.219c11.253,0,21.56-6.297,26.694-16.31L157.832,0h153.665l19.819,35.785
|
9 |
c5.284,9.543,15.335,15.465,26.242,15.465H412z M104.831,109.5c0-11.322-9.178-20.5-20.5-20.5c-11.322,0-20.5,9.178-20.5,20.5
|
asset/{dist → build}/img/icon-multisite-tools.svg
RENAMED
@@ -3,7 +3,7 @@
|
|
3 |
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
4 |
width="14em" height="15em" viewBox="64.684 51 382.628 410" enable-background="new 64.684 51 382.628 410"
|
5 |
xml:space="preserve">
|
6 |
-
<path id="network-6-icon" fill="#
|
7 |
c24.381,0,43.363,22.232,56.707,56.239c-8.562,3.61-17.354,7.632-27.344,12.62C275.139,93.088,263.473,81,256.001,81
|
8 |
C248.31,81,236.177,93.811,225.741,122.262z M256.001,431c-7.471,0-19.135-12.088-29.361-38.859
|
9 |
c-10.084,5.035-18.803,9.016-27.346,12.62C212.64,438.767,231.62,461,256.001,461c25.028,0,44.365-23.43,57.758-58.974
|
3 |
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
4 |
width="14em" height="15em" viewBox="64.684 51 382.628 410" enable-background="new 64.684 51 382.628 410"
|
5 |
xml:space="preserve">
|
6 |
+
<path id="network-6-icon" fill="#002040" d="M225.741,122.262c-10.096-4.89-19.027-8.84-27.496-12.287C211.636,74.43,230.974,51,256.001,51
|
7 |
c24.381,0,43.363,22.232,56.707,56.239c-8.562,3.61-17.354,7.632-27.344,12.62C275.139,93.088,263.473,81,256.001,81
|
8 |
C248.31,81,236.177,93.811,225.741,122.262z M256.001,431c-7.471,0-19.135-12.088-29.361-38.859
|
9 |
c-10.084,5.035-18.803,9.016-27.346,12.62C212.64,438.767,231.62,461,256.001,461c25.028,0,44.365-23.43,57.758-58.974
|
asset/build/img/icon-theme-plugin-files.svg
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<svg width="23px" height="24px" viewBox="0 0 23 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
3 |
+
<!-- Generator: Sketch 51.2 (57519) - http://www.bohemiancoding.com/sketch -->
|
4 |
+
<title>icon-theme-plugin-files</title>
|
5 |
+
<desc>Created with Sketch.</desc>
|
6 |
+
<defs></defs>
|
7 |
+
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
8 |
+
<g id="icon-theme-plugin-files" fill="#002040" fill-rule="nonzero">
|
9 |
+
<path d="M4.759,5.753 L4.746,5.753 L4.746,6.711 C4.711,8.325 9.151,8.329 9.097,6.711 L9.097,5.754 C8.968,4.226 4.871,4.218 4.759,5.753 Z M8.304,5.9 C8.304,6.214 7.69,6.471 6.934,6.471 C6.179,6.471 5.564,6.215 5.564,5.9 C5.564,5.585 6.179,5.33 6.934,5.33 C7.69,5.33 8.304,5.586 8.304,5.9 Z M0,6.079 L0.009,6.084 L0,6.065 L11.5,0 L23,6.142 L23,11.373 L12,17.171 L12,11.86 L21.864,6.67 L11.497,1.153 L1.166,6.607 L11,11.836 L11,17.167 L0,11.309 L0,6.079 Z M23,12.513 L23,18.326 L12,24 L12,18.311 L23,12.513 Z M9.308,9.143 C9.273,10.758 13.714,10.761 13.659,9.143 L13.659,8.186 C13.53,6.658 9.434,6.65 9.322,8.185 L9.308,8.185 L9.308,9.143 Z M11.496,7.762 C12.251,7.762 12.866,8.017 12.866,8.332 C12.866,8.646 12.251,8.902 11.496,8.902 C10.741,8.902 10.126,8.647 10.126,8.332 C10.126,8.017 10.741,7.762 11.496,7.762 Z M13.658,4.408 L13.658,3.452 C13.528,1.925 9.433,1.917 9.321,3.451 L9.308,3.451 L9.308,4.408 C9.272,6.023 13.714,6.026 13.658,4.408 Z M11.497,3.027 C12.251,3.027 12.867,3.283 12.867,3.598 C12.867,3.912 12.251,4.169 11.497,4.169 C10.741,4.169 10.127,3.912 10.127,3.598 C10.127,3.284 10.741,3.027 11.497,3.027 Z M18.209,6.711 L18.209,5.754 C18.079,4.226 13.983,4.218 13.873,5.753 L13.859,5.753 L13.859,6.711 C13.822,8.326 18.264,8.329 18.209,6.711 Z M14.677,5.901 C14.677,5.587 15.292,5.331 16.047,5.331 C16.803,5.331 17.418,5.587 17.418,5.901 C17.418,6.215 16.803,6.471 16.047,6.471 C15.292,6.471 14.677,6.215 14.677,5.901 Z M11,18.309 L11,24 L3.55271368e-15,18.327 L3.55271368e-15,12.452 L11,18.309 Z" id="Shape"></path>
|
10 |
+
</g>
|
11 |
+
</g>
|
12 |
+
</svg>
|
asset/{dist → build}/img/mdb-banner.svg
RENAMED
File without changes
|
asset/{dist → build}/img/mor10.png
RENAMED
File without changes
|
asset/{dist → build}/img/mor10@2x.png
RENAMED
File without changes
|
asset/build/js/bundle-103.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
!function(e){var t={};function i(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=5)}([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=i(1),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){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";this.getStageModel(e).addItem(t,i,n,a)},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()}});e.exports=s},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,names: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("names",[]),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,n){var o=this.get("items"),s=this.get("names");if(!~s.indexOf(e)){s.push(e);var r={name:e,size:t,rows:i||t,stageName:this.get("name"),transferred:0,rowsTransferred:0,complete:!1,title:null,get $title(){return this.title||this.createTitleElem()},set $title(e){this.title=e},createTitleElem:function(){return this.title=a("<p>").addClass("item-info").append(a('<span class="name" />').text(this.displayName||this.name)).append(" ").append(a('<span class="size" />').text("("+wpmdb.functions.convertKBSizeToHRFixed(r.size)+")")),this.title},progress:null,get $progress(){return this.progress||this.createProgElem()},set $progress(e){this.progress=e},createProgElem:function(){return this.progress=a('<div class="progress-bar"/>').css("width","0%"),this.progress},el:null,get $el(){return this.el||this.createMainElem()},set $el(e){this.el=e},createMainElem:function(){return this.el=a('<div class="item-progress" />'),this.el.append(this.$title),this.el.append(this.$progress),this.el.append('<span class="dashicons dashicons-yes"/>'),this.el.attr("id","item-"+this.name),this.el.attr("data-stage",this.stageName),this.el},updateProgress:function(e){var t=this.$progress;window.requestAnimationFrame(function(){t.css("width",e+"%")}.bind(this))}};void 0!==n&&n.length&&(r.displayName=n),o.push(r),this.get("lookupItems")[e]=o.length-1,this.set("totalSize",parseFloat(this.get("totalSize"))+parseFloat(t)),this.trigger("item:added",r)}},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.round(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)}},setItemPercentTransferred:function(e,t,i,n){var a=this.getItemByName(e),o=i/1e3;if(1===t){a.complete=!0,a.transferred=o;var s=this.get("itemsComplete");this.set("itemsComplete",++s),this.trigger("change change:items",a)}a.transferred=n/1e3,a.exactPercent=t;var r=this.get("totalTransferred");r+=o,this.set("totalTransferred",r),this.trigger("change change:items",a)},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}}});e.exports=o},function(e,t,i){"use strict";var n=i(3),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)}}));e.exports=a},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:140,visibleDomNodes:0,itemCount:0,percentDone:0,sizeDone:0,tablesDone:0,queuedElements:null,$truncationNotice:null,$truncationNoticeHiddenItems:null,shouldHideItemProgress:!1,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(){-1!==n.inArray(wpmdb.current_migration.model.get("activeStageName"),["media","themes","plugins"])&&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()),e!==this.percentDone&&(this.percentDone=e,this.$totalProgressElem.find(".percent-complete").text(e),this.$totalProgressElem.find(".progress-bar-wrapper .progress-bar").css({width:e+"%"})),t!=this.sizeDone&&(this.sizeDone=t,this.$totalProgressElem.find(".size-complete").text(t)),i!=this.tablesDone&&(this.tablesDone=i,this.$totalProgressElem.find(".items-complete").text(wpmdb.functions.wpmdb_add_commas(i)))},updateStageTotals:function(e){if((e=e||this.model.get("items").length)!==this.itemCount&&(this.itemCount=e,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"))),!this.shouldHideItemProgress&&500<e)){var t=this.model.get("name").toLowerCase();"themes"!=t&&"plugins"!==t||this.hideItemProgress()}},hideItemProgress:function(){this.shouldHideItemProgress||(this.shouldHideItemProgress=!0,this.$itemsContainer.empty(),this.$showHideTablesElem&&this.$showHideTablesElem.hide())},maybeAddElementToView:function(e){var t=this.shouldHideItemProgress?0:this.maxDomNodes;this.visibleDomNodes<t?(++this.visibleDomNodes,this.$itemsContainer.append(e.$el)):(this.queuedElements.push(e),this.$truncationNotice?this.updateTruncationNotice():this.showTruncationNotice())},showTruncationNotice:function(){if(!this.$truncationNotice){var e=this.shouldHideItemProgress?this.model.get("items").length:this.queuedElements.length;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(e)+"</span>")+"</div>"),this.$truncationNoticeHiddenItems=this.$truncationNotice.find(".hidden-items"),this.$itemsContainer.after(this.$truncationNotice)}},updateTruncationNotice:function(){var e=this.shouldHideItemProgress?this.model.get("items").length:this.queuedElements.length;this.$truncationNoticeHiddenItems.text(wpmdb.functions.wpmdb_add_commas(e))},getNextElementForView:function(e){var t;return!this.shouldHideItemProgress&&(this.queuedElements.length&&(e&&this.queuedElements.push(e),e=(t=this.queuedElements.shift())instanceof n?t:t.$el),e)},setItemProgress:function(e){var t=Math.min(100,Math.ceil(e.transferred/e.size*100));e.hasOwnProperty("exactPercent")&&(t=100*e.exactPercent),0===e.size&&(t=100),e.updateProgress(t),(100<=t||0===e.size)&&this.elemComplete(e)},elemComplete:function(e){if(!this.shouldHideItemProgress){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=!1;i===t&&(o=i.clone().css({height:0,marginBottom:0,display:"block"}).addClass("clone complete")).appendTo(this.$itemsContainer),t.css({height:n,marginBottom:a}),setTimeout(function(){t.css({height:0,marginBottom:0});var e=0;o&&(e=250,o.css({height:n,marginBottom:a}),o.find(".progress-bar").addClass("progress-bar-no-transition").css({width:"100%"})),setTimeout(function(){t.css({display:"none"}),t.remove(),o&&o.remove(),this.$itemsContainer.find(".item-progress:not(.clone)").last().after(i.css({height:"auto",marginBottom:a,display:"block"}))}.bind(this),e)}.bind(this),1e3)}}}});e.exports=a},function(e,t,i){"use strict";var n=jQuery;e.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)}}))}}},function(e,t,i){"use strict";var n=function(e){return e&&e.__esModule?e:{default:e}}(i(6));window.wpmdb={functions:{},common:{hooks:[],call_stack:[],non_fatal_errors:"",migration_error:!1}},wpmdb.functions=new n.default,function(e){e.keys().forEach(function(t){t.includes("wpmdbCommon.js")||e(t)})}(i(7))},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return n(e,[{key:"wpmdb_toggle_migration_action_text",value:function(){jQuery(".action-text").hide(),jQuery(".action-text."+jQuery("input[name=action]:checked").val()).show()}},{key:"wpmdb_migration_type",value:function(){var e=jQuery("input[name=action]:checked");return 0===e.length?"":e.val()}},{key:"wpmdb_call_next_hook",value:function(){var e=window.wpmdb;e.common.call_stack.length||(e.common.call_stack=e.common.hooks);var t=e.common.call_stack[0];e.common.call_stack.shift(),t.call(this)}},{key:"wpmdb_add_commas",value: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}},{key:"wpmdb_parse_json",value:function(e){var t={};try{t=jQuery.parseJSON(e)}catch(e){return!1}return t}},{key:"wpmdbGetAjaxErrors",value:function(e,t,i,n){var a=!1,o="";if(!1===this.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> — "),a||"undefined"===n||(o+=wpmdb_strings.status+": "+n.status+" "+n.statusText,o+="<br /><br />"+wpmdb_strings.response+":<br />"),a||(i+=" "+t),o+=i}},{key:"preg_quote",value:function(e,t){return String(e).replace(new RegExp("[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\"+(t||"")+"-]","g"),"\\$&")}},{key:"table_is",value:function(e,t,i){if((e+t).toLowerCase()===i.toLowerCase())return!0;var n=this.preg_quote(i);return null!==new RegExp(e+"([0-9]+)_"+t,"i").exec(n)}},{key:"subsite_for_table",value:function(e,t){var i=this.preg_quote(t),n=new RegExp(e+"([0-9]+)_","i").exec(i);return null===n?1:n[1]}},{key:"convertKBSizeToHR",value:function(e,t,i,n){var a,o;if(i=i||1e3,t=t||2,(e=parseFloat(e))<1&&e>0)a=[(e*i).toFixed(0),"B"];else if(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}},{key:"convertKBSizeToHRFixed",value:function(e,t,i){t=t||2;var n=this.convertKBSizeToHR(e,t,i,!0);return"MB"==n[1]?n[0].toFixed(2)+" "+n[1]:n[0]+" "+n[1]}},{key:"ajax_handle_dismissible_notice",value: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)})}},{key:"get_spinner_url",value:function(){var e=ajaxurl.replace("/admin-ajax.php","")+"/images/spinner";return 2<window.devicePixelRatio&&(e+="-2x"),e+=".gif"}},{key:"exclude_post_types_warning",value:function(){var e=$("#select-post-types").val(),t="",i=$(".exclude-post-types-warning");e?(t="<code>"+e.join("</code>, <code>")+"</code>",$(".excluded-post-types").html(t),"0"===i.css("opacity")&&i.css({opacity:0}).slideDown(200).animate({opacity:1})):i.css({opacity:0}).slideUp(200).animate({opacity:0})}}]),e}();t.default=a},function(e,t,i){var n={"./js/dismissable-notices.js":8,"./js/helpers/events.js":9,"./js/helpers/utils.js":10,"./js/helpers/wpmdbCommon.js":11,"./js/helpers/wpmdbGlobals.js":12,"./js/hook.js":13,"./js/import.js":14,"./js/localStorage.js":15,"./js/modules/MigrationProgress-controller.js":16,"./js/modules/MigrationProgress-model.js":17,"./js/modules/MigrationProgress-utils.js":18,"./js/modules/MigrationProgress-view.js":19,"./js/modules/MigrationProgressStage-model.js":20,"./js/modules/MigrationProgressStage-view.js":21,"./js/multisite.js":22,"./js/plugin-update.js":23,"./js/script.js":24,"./js/usage-tracking-notice.js":28,"./sass/_migration-progress.scss":29,"./sass/_progress-upgrade.scss":30,"./sass/plugin-update-styles.scss":31,"./sass/styles.scss":32};function a(e){return i(o(e))}function o(e){var t=n[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}a.keys=function(){return Object.keys(n)},a.resolve=o,e.exports=a,a.id=7},function(e,t){window.jQuery;!function(e){0<e(".wpmdb-compat-plugin-row-error").length&&e('[data-slug="wp-migrate-db-pro"]').addClass("wpmdbpro-has-message"),e(".wpmdbpro-custom").prev().addClass("update"),e(".notice-link-plugins-page").click(function(t){t.preventDefault();var i=jQuery(this);wpmdb.functions.ajax_handle_dismissible_notice(wpmdb_nonces.process_notice_link,function(t){e(t).closest(".wpmdbpro-custom").hide(),e(t).closest("tr").siblings("tr.wpmdbpro-has-message").removeClass("wpmdbpro-has-message")},i),e(".wpmdbpro-custom").prev().removeClass("update")})}(jQuery)},function(e,t){var i=window.jQuery;i.fn.bindFirst=function(e,t){this.bindNth(e,t,0)},i.fn.bindNth=function(e,t,i){this.bind(e,t),this.changeEventOrder(e,i)},i.fn.changeEventOrder=function(e,t){var n=this;i.each(e.split(" "),function(e,a){n.each(function(){var e=i._data(this,"events")[a.split(".")[0]];t=Math.min(t,e.length-1),e.splice(t,0,e.pop())})})}},function(e,t){window.jQuery;Object.defineProperty(t,"__esModule",{value:!0});t.handleAjaxError=function(e,t){var i="\n\t\t\t<p>"+wpmdb_strings.ajax_php_errors+":</p>\n\t\t\t<p>"+t.message+"</p>\n\t";wpmdb.current_migration.setState(e,i,"error"),wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events(),console.error("🚨 🚒",t)},t.throwMDBError=function(e){var t=void 0;throw void 0!==e.body&&(wpmdb.common.non_fatal_errors+=e.body,t=e.body),void 0!==e.msg&&(t=e.msg),new Error(t)},t.jQueryAjaxError=function(e,t){return void 0!==t.responseText&&""!==t.responseText?e=t.responseText:void 0!==t.statusText&&(e=t.statusText),console.error(t),wpmdb.current_migration.setState(wpmdb_strings.migration_failed,e,"error"),wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events(),e},t.doNextStep=function(e,t,i){return wpmdb.common.next_step_in_migration={fn:e,args:t},wpmdb.functions.execute_next_step(i)}},function(e,t){var i=window.jQuery;Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return n(e,[{key:"wpmdb_toggle_migration_action_text",value:function(){jQuery(".action-text").hide(),jQuery(".action-text."+jQuery("input[name=action]:checked").val()).show()}},{key:"wpmdb_migration_type",value:function(){var e=jQuery("input[name=action]:checked");return 0===e.length?"":e.val()}},{key:"wpmdb_call_next_hook",value:function(){var e=window.wpmdb;e.common.call_stack.length||(e.common.call_stack=e.common.hooks);var t=e.common.call_stack[0];e.common.call_stack.shift(),t.call(this)}},{key:"wpmdb_add_commas",value: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}},{key:"wpmdb_parse_json",value:function(e){var t={};try{t=jQuery.parseJSON(e)}catch(e){return!1}return t}},{key:"wpmdbGetAjaxErrors",value:function(e,t,i,n){var a=!1,o="";if(!1===this.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> — "),a||"undefined"===n||(o+=wpmdb_strings.status+": "+n.status+" "+n.statusText,o+="<br /><br />"+wpmdb_strings.response+":<br />"),a||(i+=" "+t),o+=i}},{key:"preg_quote",value:function(e,t){return String(e).replace(new RegExp("[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\"+(t||"")+"-]","g"),"\\$&")}},{key:"table_is",value:function(e,t,i){if((e+t).toLowerCase()===i.toLowerCase())return!0;var n=this.preg_quote(i);return null!==new RegExp(e+"([0-9]+)_"+t,"i").exec(n)}},{key:"subsite_for_table",value:function(e,t){var i=this.preg_quote(t),n=new RegExp(e+"([0-9]+)_","i").exec(i);return null===n?1:n[1]}},{key:"convertKBSizeToHR",value:function(e,t,i,n){var a,o;if(i=i||1e3,t=t||2,(e=parseFloat(e))<1&&e>0)a=[(e*i).toFixed(0),"B"];else if(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}},{key:"convertKBSizeToHRFixed",value:function(e,t,i){t=t||2;var n=this.convertKBSizeToHR(e,t,i,!0);return"MB"==n[1]?n[0].toFixed(2)+" "+n[1]:n[0]+" "+n[1]}},{key:"ajax_handle_dismissible_notice",value: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)})}},{key:"get_spinner_url",value:function(){var e=ajaxurl.replace("/admin-ajax.php","")+"/images/spinner";return 2<window.devicePixelRatio&&(e+="-2x"),e+=".gif"}},{key:"exclude_post_types_warning",value:function(){var e=i("#select-post-types").val(),t="",n=i(".exclude-post-types-warning");e?(t="<code>"+e.join("</code>, <code>")+"</code>",i(".excluded-post-types").html(t),"0"===n.css("opacity")&&n.css({opacity:0}).slideDown(200).animate({opacity:1})):n.css({opacity:0}).slideUp(200).animate({opacity:0})}}]),e}();t.default=a},function(e,t){var i=window.jQuery;Object.defineProperty(t,"__esModule",{value:!0});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=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();i=window.jQuery;var o=window.ajaxurl,s=window.wpmdb_strings,r=window.wpmdb_data,l=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.show_ssl_notice=!1,this.doing_save_profile=!1,this.doing_ajax=!1,this.profile_name_edited=!1,this.migration_intent=null,this.doing_licence_registration_ajax=!1,this.migration_paused=!1,this.last_replace_switch=wpmdb.functions.wpmdb_migration_type(),this.connection_established=!1,this.profile_name_edited=!1,this.checked_licence=!1,this.show_prefix_notice=!1,this.show_ssl_notice=!1,this.force_reconnect=!1,this.migration_selection="",this.show_version_notice=!1,this.migration_completed=!1,this.currently_migrating=!1,this.dump_filename="",this.dump_path="",this.migration_intent="",this.remote_site=null,this.secret_key=null,this.form_data=null,this.stage=null,this.elapsed_interval=null,this.completed_msg=null,this.tables_to_migrate=[],this.migration_paused=!1,this.previous_progress_title="",this.previous_progress_text_primary="",this.previous_progress_text_secondary="",this.cancelling_text="",this.paused_text="",this.migration_cancelled=!1,this.flag_skip_delay=!1,this.delay_between_requests=0,this.fade_duration=400,this.pause_before_finalize=!1,this.is_auto_pause_before_finalize=!1,this.$connection_info_box=i(".connection-info-wrapper"),this.$push_select=window.wpmdb.$push_select=i("#select-tables").clone(),this.$pull_select=window.wpmdb.$pull_select=i("#select-tables").clone(),this.$push_post_type_select=i("#select-post-types").clone(),this.$pull_post_type_select=i("#select-post-types").clone(),this.$push_select_backup=i("#select-backup").clone(),this.$pull_select_backup=i("#select-backup").clone(),this.spinner_url=window.spinner_url=wpmdb.functions.get_spinner_url(),this.ajax_spinner=window.ajax_spinner='<img src="'+this.spinner_url+'" alt="" class="ajax-spinner general-spinner" />'}return a(e,[{key:"pad",value:function(e,t,i){return i=i||"0",(e+="").length>=t?e:new Array(t-e.length+1).join(i)+e}},{key:"is_int",value:function(e){return"number"==typeof(e=parseInt(e))&&0==e%1}},{key:"get_intersect",value:function(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}},{key:"pin_replace_url",value:function(e){!0===e&&1>i(".replace-row.pin").length&&1===i("#old-url").length&&i("#old-url").parents(".replace-row").addClass("pin"),!1===e&&0<i(".replace-row.pin").length&&i(".replace-row.pin").removeClass("pin")}},{key:"get_ajax_errors",value:function(e,t,i){return wpmdb.functions.wpmdbGetAjaxErrors(s.connection_local_server_problem,t,e,i)}},{key:"refresh_debug_log",value:function(){i.ajax({url:o,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_get_log",nonce:r.nonces.get_log},error:function(e,t,i){alert(s.update_log_problem)},success:function(e){i(".debug-log-textarea").val(e)}})}},{key:"get_query_var",value:function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))}},{key:"maybe_show_ssl_warning",value:function(e,t,n){var a=e.substr(0,e.indexOf(":")),o=i(".ssl-notice");if(this.show_ssl_notice||o.hide(),n!==a&&-1!==e.indexOf("https"))return o.show(),this.show_ssl_notice=!0,e=e.replace("https","http"),void i(".pull-push-connection-info").val(e+"\n"+t);this.show_ssl_notice=!1}},{key:"validate_url",value:function(e){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(e)}},{key:"refresh_table_selects",value:function(){void 0!==r&&void 0!==r.this_tables&&void 0!==r.this_table_sizes_hr&&(this.$push_select=this.create_table_select(r.this_tables,r.this_table_sizes_hr,i(wpmdb.$push_select).val())),void 0!==wpmdb.common.connection_data&&void 0!==wpmdb.common.connection_data.tables&&void 0!==wpmdb.common.connection_data.table_sizes_hr&&(this.$pull_select=this.create_table_select(wpmdb.common.connection_data.tables,wpmdb.common.connection_data.table_sizes_hr,i(wpmdb.$pull_select).val()))}},{key:"save_active_profile",value:function(){var e,t=this;if(i(".save-settings-button").blur(),!this.doing_save_profile&&!0!==this.maybe_show_select_table_notice()){var n=!1;i("#create_new").is(":checked")&&(n=!0);var a=i(".create-new-profile").val();this.doing_save_profile=!0,e=i(i("#migrate-form")[0].elements).not(".auth-credentials").serialize(),i(".save-settings-button").attr("disabled","disabled").after('<img src="'+this.spinner_url+'" alt="" class="save-profile-ajax-spinner general-spinner" />'),this.doing_ajax=!0,i.ajax({url:o,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_profile",profile:e,nonce:r.nonces.save_profile},error:function(e,n,a){t.doing_ajax=!1,alert(s.save_profile_problem),i(".save-settings-button").removeAttr("disabled"),i(".save-profile-ajax-spinner").remove(),i(".save-settings-button").after('<span class="ajax-success-msg">'+s.saved+"</span>"),i(".ajax-success-msg").fadeOut(2e3,function(){i(this).remove()}),t.doing_save_profile=!1},success:function(e){var o=parseInt(i("#migrate-form input[name=save_migration_profile_option]:checked").val(),10)+1;if(t.doing_ajax=!1,i(".save-settings-button").removeAttr("disabled"),i(".save-profile-ajax-spinner").remove(),i(".save-settings-button").after('<span class="ajax-success-msg">'+s.saved+"</span>"),i(".ajax-success-msg").fadeOut(2e3,function(){i(this).remove()}),t.doing_save_profile=!1,i(".create-new-profile").val(""),n){var l=parseInt(e,10),c=l+1,p=i('<li><span class="delete-profile" data-profile-id="'+c+'"></span><label for="profile-'+c+'"><input id="profile-'+c+'" value="'+l+'" name="save_migration_profile_option" type="radio"></label></li>');p.find("label").append(document.createTextNode(" "+a)),o=c,i("#create_new").parents("li").before(p),i("#profile-"+c).attr("checked","checked")}var m=window.location.href.replace("#migrate","").replace(/&wpmdb-profile=-?\d+/,"")+"&wpmdb-profile="+o,d=i("#migrate-form input[name=save_migration_profile_option]:checked").parent().text().trim();if("function"==typeof window.history.pushState){if(i("#migrate-form .crumbs").length)i("#migrate-form .crumbs .crumb:last").text(d);else{var _=i('<div class="crumbs" />').append('<a class="crumb" href="'+r.this_plugin_base+'"> Saved Profiles </a>').append('<span class="crumb">'+d+"</span>");i("#migrate-form").prepend(_)}window.history.pushState({updated_profile_id:o},null,m)}}})}}},{key:"cancel_migration",value:function(e){this.migration_cancelled=!0,this.cancelling_text=s.cancelling_migration,i(".migration-controls").css({visibility:"hidden"}),"find_replace"===this.migration_intent&&(this.cancelling_text=s.cancelling_find_replace),wpmdb.current_migration.setState(this.cancelling_text,s.completing_current_request,"cancelling"),!0===this.migration_paused&&(this.migration_paused=!1,wpmdb.functions.execute_next_step())}},{key:"set_checkbox",value:function(e){var t=i("#"+e),n=t.find("input[type=checkbox]");t.toggleClass("on").find("span").toggleClass("checked");var a=t.find("span.on").hasClass("checked");n.attr("checked",a).trigger("change")}},{key:"move_connection_info_box",value:function(){var e,t,n,a,o,s,l=i(".connection-status"),c=i(".directory-permission-notice"),p=i(".compatibility-older-mysql"),m=i(".mst-required"),d=i(".keep-active-plugins"),_=i(".step-two"),u=i(".backup-options"),g=wpmdb.functions.wpmdb_migration_type();if(l.hide(),c.hide(),_.show(),u.show(),d.show(),p.hide(),m.hide(),wpmdb.functions.wpmdb_toggle_migration_action_text(),i(".migrate-tab").attr("class","migrate-tab content-tab").addClass(wpmdb.functions.wpmdb_migration_type()),i.wpmdb.do_action("move_connection_info_box",{migration_type:g,last_migration_type:this.last_replace_switch}),-1!==i.inArray(g,["push","pull"])){var h=i(".pull-push-connection-info"),b=i.trim(h.val()).split("\n"),f=i("."+g+"-list li");if(f.append(this.$connection_info_box),this.$connection_info_box.show(function(){var e=i(this).find(".pull-push-connection-info");e.val()||e.focus()}),g!==this.last_replace_switch&&2===b.length)return wpmdb.force_reconnect=!0,f.append(this.$connection_info_box),h.removeClass("temp-disabled").attr("readonly","readonly"),i(".connect-button").hide(),void wpmdb.functions.connection_box_changed();this.connection_established?(l.hide(),_.show(),wpmdb.functions.wpmdb_toggle_migration_action_text(),"pull"===g?(t=wpmdb.common.connection_data.prefix,n=r.site_details.prefix,a=r.this_uploads_dir,o=r.this_upload_dir_long,s=r.write_permission):(t=r.this_prefix,n=wpmdb.common.connection_data.prefix,a=wpmdb.common.connection_data.uploads_dir,o=wpmdb.common.connection_data.upload_dir_long,s=wpmdb.common.connection_data.write_permissions),i(".table_prefix").html(t),i(".backup-table-prefix").html(n),i(".uploads-dir").html(a),this.maybe_show_backup_disabled_msg(o,s),!1===this.profile_name_edited&&(e=this.get_domain_name(wpmdb.common.connection_data.url),i(".create-new-profile").val(e))):(l.show(),_.hide())}else if(-1!==i.inArray(g,["find_replace","savefile"]))if(l.hide(),_.show(),i(".table-prefix").html(r.this_prefix),!1===this.profile_name_edited&&i(".create-new-profile").val(""),d.hide(),"savefile"===g)u.hide(),p.show(),"false"===r.write_permission&&(c.show(),_.hide());else{if("true"===r.is_multisite){var w=i(".old-replace-col").eq(1);w.parent().removeClass("pin").find(".replace-remove-row").show(),w.find("input").removeAttr("readonly")}this.maybe_show_backup_disabled_msg(r.this_upload_dir_long,r.write_permission)}this.maybe_show_mixed_cased_table_name_warning()}},{key:"maybe_show_backup_disabled_msg",value:function(e,t){var n=i("#create-backup"),a=i("#create-backup-label"),o=i(".backup-option-disabled");n.removeAttr("disabled"),a.removeClass("disabled"),o.hide(),"false"===t&&(n.prop("checked",!1),n.attr("disabled","disabled"),a.addClass("disabled"),o.show(),i(".upload-directory-location").html(e))}},{key:"change_replace_values",value:function(){var e=null,t=null;null!==wpmdb.common.previous_connection_data&&"object"===n(wpmdb.common.previous_connection_data)&&wpmdb.common.previous_connection_data.url!==wpmdb.common.connection_data.url&&(e=this.remove_protocol(wpmdb.common.previous_connection_data.url),t=wpmdb.common.previous_connection_data.path),"push"===wpmdb.functions.wpmdb_migration_type()||"savefile"===wpmdb.functions.wpmdb_migration_type()?("pull"===this.last_replace_switch?i(".replace-row").each(function(){var e=i(".old-replace-col input",this).val();i(".old-replace-col input",this).val(i(".replace-right-col input",this).val()),i(".replace-right-col input",this).val(e)}):"push"===this.last_replace_switch&&"push"===wpmdb.functions.wpmdb_migration_type()&&null!==e&&null!==t&&i(".replace-row").each(function(){var n=i(".replace-right-col input",this).val();n===t&&i(".replace-right-col input",this).val(wpmdb.common.connection_data.path),n===e&&i(".replace-right-col input",this).val(this.remove_protocol(wpmdb.common.connection_data.url))}),i.wpmdb.do_action("wpmdb_update_push_table_select"),i("#select-post-types").remove(),i(".exclude-post-types-warning").after(this.$push_post_type_select),wpmdb.functions.exclude_post_types_warning(),i("#select-backup").remove(),i(".backup-tables-wrap").prepend(this.$push_select_backup)):"pull"===wpmdb.functions.wpmdb_migration_type()&&(""===this.last_replace_switch||"push"===this.last_replace_switch||"savefile"===this.last_replace_switch?i(".replace-row").each(function(){var e=i(".old-replace-col input",this).val();i(".old-replace-col input",this).val(i(".replace-right-col input",this).val()),i(".replace-right-col input",this).val(e)}):"pull"===this.last_replace_switch&&"pull"===wpmdb.functions.wpmdb_migration_type()&&null!==e&&null!==t&&i(".replace-row").each(function(){var n=i(".old-replace-col input",this).val();n===t&&i(".old-replace-col input",this).val(wpmdb.common.connection_data.path),n===e&&i(".old-replace-col input",this).val(this.remove_protocol(wpmdb.common.connection_data.url))}),i.wpmdb.do_action("wpmdb_update_pull_table_select"),i("#select-post-types").remove(),i(".exclude-post-types-warning").after(this.$pull_post_type_select),wpmdb.functions.exclude_post_types_warning(),i("#select-backup").remove(),i(".backup-tables-wrap").prepend(this.$pull_select_backup)),this.last_replace_switch=wpmdb.functions.wpmdb_migration_type()}},{key:"switch_to_plugin_tab",value:function(e,t){i(".nav-tab").removeClass("nav-tab-active"),i(".nav-tab."+e).addClass("nav-tab-active"),i(".content-tab").hide(),i("."+e+"-tab").show(),"settings"===e&&!0===this.should_check_licence()&&(i("p.licence-status").append("Checking License... ").append(this.ajax_spinner),this.check_licence()),"help"===e&&(this.refresh_debug_log(),!0===this.should_check_licence()&&(i(".support-content p").append(this.ajax_spinner),this.check_licence())),"addons"===e&&!0!==t&&!0===this.should_check_licence()&&(i(".addons-content p").append(this.ajax_spinner),this.check_licence())}},{key:"hide_overlay",value:function(){i("#overlay").removeClass("show").addClass("hide"),i("#overlay > div").removeClass("show").addClass("hide"),wpmdb.current_migration.$proVersion.find("iframe").remove(),setTimeout(function(){i("#overlay").remove()},500),this.migration_completed=!1}},{key:"check_licence",value:function(e){var t=!this.doing_licence_registration_ajax;this.checked_licence=!0;var n=this;i.ajax({url:o,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_check_licence",licence:e,context:"all",nonce:r.nonces.check_licence},error:function(e,t,i){alert(s.license_check_problem)},success:function(e){var a,o,s,r=i(".support-content"),l=i(".addons-content"),c=i(".licence-status:not(.notification-message)");if(void 0!==e.dbrains_api_down)o=e.dbrains_api_down+e.message,s=e.dbrains_api_down;else if(void 0!==e.errors){if(void 0!==e.errors.subscription_expired)a=e.errors.subscription_expired.licence,o=e.errors.subscription_expired.support,s=e.errors.subscription_expired.addons;else{var p="";for(var m in e.errors)p+=e.errors[m];o=p,s=p}void 0!==e.addon_content&&(s+="\n"+e.addon_content)}else o=e.message,s=e.addon_content;t&&c.stop().fadeOut(n.fade_duration,function(){void 0===a&&(i(this).css({visibility:"hidden",display:"block"}).slideUp(),a=""),i(this).empty().html(a).stop().fadeIn(n.fade_duration)}),r.stop().fadeOut(n.fade_duration,function(){i(this).empty().html(o).stop().fadeIn(n.fade_duration)}),l.stop().fadeOut(n.fade_duration,function(){i(this).empty().html(s).stop().fadeIn(n.fade_duration)}),i("#plugin-compatibility").is(":not(:checked)")&&i("#compatibility-header").click()}})}},{key:"should_check_licence",value:function(){return!1===this.checked_licence&&"1"===r.has_licence&&"true"===r.is_pro}},{key:"maybe_show_mixed_cased_table_name_warning",value:function(){if(void 0!==wpmdb.common.connection_data&&!1!==wpmdb.common.connection_data){var e=wpmdb.functions.wpmdb_migration_type(),t=wpmdb.functions.get_tables_to_migrate(null,null);i(".mixed-case-table-name-notice").hide(),null!==t&&(t=t.join(""))!==t.toLowerCase()&&("1"===wpmdb.common.connection_data.lower_case_table_names||"push"!==e&&"savefile"!==e)&&("1"!==r.lower_case_table_names&&"pull"===e||("push"===e||"savefile"===e?i(".mixed-case-table-name-notice.push").show():i(".mixed-case-table-name-notice.pull").show()))}}},{key:"enable_pro_licence",value:function(e,t){i(".licence-input, .register-licence").remove(),i(".licence-not-entered").prepend(e.masked_licence),i(".support-content").empty().html("<p>"+s.fetching_license+'<img src="'+this.spinner_url+'" alt="" class="ajax-spinner general-spinner" /></p>'),this.check_licence(t),i(".migrate-selection label").removeClass("disabled"),i(".migrate-selection input").removeAttr("disabled")}},{key:"get_domain_name",value:function(e){return e.replace(/\/\/(.*)@/,"//").replace("http://","").replace("https://","").replace("www.","")}},{key:"update_domain_placeholder",value:function(e,t,i){var n=this.get_domain_name(t);return"completed"===i?e.replace(/\%s\s?/,"<span class=domain-label>"+n+"</span> "):e.replace(/\%s(\S*)\s?/,"<span class=domain-label>"+n+"$1</span> ")}},{key:"get_migration_status_label",value:function(e,t,n){var a="",o="";switch(t){case"push":a=s.push_migration_label_migrating,o=s.push_migration_label_completed;break;case"pull":a=s.pull_migration_label_migrating,o=s.pull_migration_label_completed;break;case"find_replace":a=s.find_replace_label_migrating,o=s.find_replace_label_completed;break;case"savefile":a=s.exporting_please_wait,o=s.exporting_complete}var r=a;return"completed"===n&&(r=o),"push"!==t&&"pull"!==t||(r=this.update_domain_placeholder(r,e,n)),r=i.wpmdb.apply_filters("wpmdb_get_migration_status_label",r,{intent:t,stage:n})}},{key:"disable_export_type_controls",value:function(){i(".option-group").each(function(e){i("input",this).attr("disabled","disabled"),i("label",this).css("cursor","default")})}},{key:"enable_export_type_controls",value:function(){i(".option-group").each(function(e){i("input",this).removeAttr("disabled"),i("label",this).css("cursor","pointer")})}},{key:"set_slider_value",value:function(e,t,n,a){var o=t;void 0!==a&&(o=a),i(".slider",e).slider("value",parseInt(t)),i(".amount",e).html(wpmdb.functions.wpmdb_add_commas(o)+" "+n)}},{key:"set_pause_resume_button",value:function(e,t){!0===this.migration_paused?(this.migration_paused=!1,this.doing_ajax=!0,wpmdb.current_migration.setState(this.previous_progress_title,this.previous_progress_text_primary,"active"),i(".pause-resume").html(s.pause),wpmdb.current_migration.resumeTimer(),wpmdb.functions.execute_next_step(t)):(this.migration_paused=!0,this.doing_ajax=!1,this.paused_text=s.migration_paused,this.previous_progress_title=i(".progress-title").html(),this.previous_progress_text_primary=i(".progress-text",".progress-wrapper-primary").html(),this.previous_progress_text_secondary=i(".progress-text",".progress-wrapper-secondary ").html(),"find_replace"===this.migration_intent&&(this.paused_text=s.find_replace_paused),wpmdb.current_migration.setState(this.paused_text,s.completing_current_request,null),i("body").off("click",".pause-resume"),i("body").off("click",".cancel"))}},{key:"filter_temp_tables",value:function(e,t){var i=r.this_temp_prefix;return"pull"===wpmdb.functions.wpmdb_migration_type()&&void 0!==wpmdb.common.connection_data&&void 0!==wpmdb.common.connection_data.temp_prefix&&(i=wpmdb.common.connection_data.temp_prefix),i===t.substring(0,i.length)||e}},{key:"get_table_prefix",value:function(e,t){return i(".table-select-wrap .table-prefix").text()}},{key:"lock_replace_url",value:function(e){!0===e?(i('.replace-row.pin .replace-right-col input[type="text"]').attr("readonly","readonly"),i(".replace-row.pin .arrow-col").addClass("disabled")):(i('.replace-row.pin .replace-right-col input[type="text"]').removeAttr("readonly"),i(".replace-row.pin .arrow-col").removeClass("disabled"))}},{key:"set_connection_data",value:function(e){window.wpmdb.common.previous_connection_data=wpmdb.common.connection_data,window.wpmdb.common.connection_data=e,i.wpmdb.do_action("wpmdb_connection_data_updated",e)}},{key:"get_max_request_display_info",value:function(e){var t={unit:"MB"};return t.amount=(e/1024).toFixed(2),t}},{key:"establish_remote_connection_from_saved_profile",value:function(){var e=wpmdb.functions.wpmdb_migration_type(),t=i.trim(i(".pull-push-connection-info").val()).split("\n");if("undefined"!=typeof wpmdb_default_profile&&!0!==wpmdb_default_profile&&"savefile"!==e&&"find_replace"!==e&&"import"!==e&&!this.doing_ajax&&r.is_pro){this.doing_ajax=!0,this.disable_export_type_controls(),i(".connection-status").html(s.establishing_remote_connection),i(".connection-status").removeClass("notification-message error-notice migration-error"),i(".connection-status").append(this.ajax_spinner);var n=wpmdb.functions.wpmdb_migration_type(),a=this;i.ajax({url:o,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_verify_connection_to_remote_site",url:t[0],key:t[1],intent:n,nonce:r.nonces.verify_connection_to_remote_site,convert_post_type_selection:wpmdb_convert_post_type_selection,profile:r.profile},error:function(e,t,n){i(".connection-status").html(a.get_ajax_errors(e.responseText,"(#102)",e)),i(".connection-status").addClass("notification-message error-notice migration-error"),i(".ajax-spinner").remove(),a.doing_ajax=!1,a.enable_export_type_controls()},success:function(e){if(i(".ajax-spinner").remove(),a.doing_ajax=!1,a.enable_export_type_controls(),void 0!==e.wpmdb_error&&1===e.wpmdb_error)return i(".connection-status").html(e.body),i(".connection-status").addClass("notification-message error-notice migration-error"),void(e.body.indexOf("401 Unauthorized")>-1&&i(".basic-access-auth-wrapper").show());if(!0!==a.maybe_show_mst_warning(e)){a.maybe_show_ssl_warning(t[0],t[1],e.scheme),wpmdb.functions.maybe_show_prefix_notice(e.prefix),i(".pull-push-connection-info").addClass("temp-disabled"),i(".pull-push-connection-info").attr("readonly","readonly"),i(".connect-button").hide(),i(".connection-status").hide(),i(".step-two").show(),a.connection_established=!0,a.set_connection_data(e),a.move_connection_info_box(),a.maybe_show_mixed_cased_table_name_warning();var n="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_tables&&(n=wpmdb_loaded_tables),a.$pull_select=wpmdb.functions.create_table_select(wpmdb.common.connection_data.tables,wpmdb.common.connection_data.table_sizes_hr,n);var o="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_post_types&&(void 0!==e.select_post_types?(i("#exclude-post-types").attr("checked","checked"),i(".post-type-select-wrap").show(),o=e.select_post_types):o=wpmdb_loaded_post_types);var s=document.createElement("select");i(s).attr({multiple:"multiple",name:"select_post_types[]",id:"select-post-types",class:"multiselect"}),i.each(wpmdb.common.connection_data.post_types,function(e,t){var n=i.inArray(t,o);n=-1!==n||!0===wpmdb_convert_exclude_revisions&&"revision"!==t?' selected="selected" ':" ",i(s).append("<option"+n+'value="'+t+'">'+t+"</option>")}),a.$pull_post_type_select=s;var l="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_tables_backup&&(l=wpmdb_loaded_tables_backup);var c=document.createElement("select");i(c).attr({multiple:"multiple",name:"select_backup[]",id:"select-backup",class:"multiselect"}),i.each(wpmdb.common.connection_data.tables,function(e,t){var n=i.inArray(t,l);n=-1!==n?' selected="selected" ':" ",i(c).append("<option"+n+'value="'+t+'">'+t+" ("+wpmdb.common.connection_data.table_sizes_hr[t]+")</option>")}),a.$push_select_backup=c,"pull"===wpmdb.functions.wpmdb_migration_type()?(i.wpmdb.do_action("wpmdb_update_pull_table_select"),i("#select-post-types").remove(),i(".exclude-post-types-warning").after(a.$pull_post_type_select),i("#select-backup").remove(),i(".backup-tables-wrap").prepend(a.$pull_select_backup),i(".table-prefix").html(e.prefix),i(".uploads-dir").html(r.this_uploads_dir)):(i("#select-backup").remove(),i(".backup-tables-wrap").prepend(a.$push_select_backup)),i.wpmdb.do_action("verify_connection_to_remote_site",wpmdb.common.connection_data)}else i(".connection-status").hide()}})}}},{key:"migrate_table_recursive",value:function(e,t,n){var a=this,l=n||0;if(l>=this.tables_to_migrate.length)if("upload"===this.stage&&wpmdb.current_migration.model.getStageItems("find_replace").length)this.stage="find_replace",this.tables_to_migrate=wpmdb.current_migration.model.getStageItems("find_replace","name"),this.tables_to_migrate=this.tables_to_migrate.map(function(e){return"_mig_"+e}),l=0;else{if("backup"!==this.stage)return i(".progress-label").removeClass("label-visible"),wpmdb.common.hooks=i.wpmdb.apply_filters("wpmdb_before_migration_complete_hooks",wpmdb.common.hooks),wpmdb.common.hooks.push(wpmdb.functions.migration_complete),wpmdb.common.hooks.push(wpmdb.functions.wpmdb_flush),wpmdb.common.hooks=i.wpmdb.apply_filters("wpmdb_after_migration_complete_hooks",wpmdb.common.hooks),wpmdb.common.hooks.push(wpmdb.functions.migration_complete_events),wpmdb.common.next_step_in_migration={fn:wpmdb.functions.wpmdb_call_next_hook},void wpmdb.functions.execute_next_step();if(-1!==i.inArray(this.migration_intent,["push","pull"])?this.stage="migrate":"import"===this.migration_intent?this.stage="upload":this.stage=this.migration_intent,wpmdb.current_migration.model.setActiveStage(this.stage),"find_replace"!==this.stage&&"migrate"!==this.stage)return void wpmdb.functions.wpmdb_call_next_hook();l=0,this.tables_to_migrate=wpmdb.functions.get_tables_to_migrate(null,null)}var c=0;l===this.tables_to_migrate.length-1&&(c=1);var p=0;-1!==i.inArray(this.migration_intent,["push","pull"])&&1===parseInt(wpmdb.common.connection_data.gzip)&&(p=1);var m={action:"wpmdb_migrate_table",migration_state_id:wpmdb.migration_state_id,table:this.tables_to_migrate[l],stage:this.stage,current_row:e,last_table:c,primary_keys:t,gzip:p,nonce:r.nonces.migrate_table};-1!==i.inArray(this.migration_intent,["push","pull"])&&(m.bottleneck=wpmdb.common.connection_data.bottleneck,m.prefix=wpmdb.common.connection_data.prefix),wpmdb.common.connection_data&&wpmdb.common.connection_data.path_current_site&&wpmdb.common.connection_data.domain&&(m.path_current_site=wpmdb.common.connection_data.path_current_site,m.domain_current_site=wpmdb.common.connection_data.domain),this.doing_ajax=!0,i.ajax({url:o,type:"POST",dataType:"text",cache:!1,timeout:0,data:m,error:function(e,t,i){var n=s.table_process_problem+" "+a.tables_to_migrate[l]+"<br /><br />"+s.status+": "+e.status+" "+e.statusText+"<br /><br />"+s.response+":<br />"+e.responseText;wpmdb.current_migration.setState(s.migration_failed,n,"error"),a.doing_ajax=!1,console.log(e),console.log(t),console.log(i),wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events()},success:function(e){a.doing_ajax=!1,e=i.trim(e);var t=wpmdb.functions.wpmdb_parse_json(e),n="";if(!1===t||null===t)return n=""===e||null===e?s.table_process_problem_empty_response+" "+a.tables_to_migrate[l]:a.get_ajax_errors(e,null,null),wpmdb.current_migration.setState(s.migration_failed,n,"error"),wpmdb.common.migration_error=!0,void wpmdb.functions.migration_complete_events();if(void 0!==t.wpmdb_error&&1===t.wpmdb_error)return wpmdb.current_migration.setState(s.migration_failed,t.body,"error"),wpmdb.common.migration_error=!0,void wpmdb.functions.migration_complete_events();var o=a.tables_to_migrate[l];"import"===a.migration_intent&&"find_replace"===a.stage&&(o=o.replace(r.this_temp_prefix,"")),wpmdb.current_migration.setText(),wpmdb.current_migration.model.getStageModel(a.stage).setItemRowsTransferred(o,t.current_row),1===c&&"savefile"===a.migration_intent&&(void 0!==t.dump_filename&&(a.dump_filename=t.dump_filename),void 0!==t.dump_path&&(a.dump_path=t.dump_path)),-1===parseInt(t.current_row)&&(l++,t.current_row="",t.primary_keys=""),wpmdb.common.next_step_in_migration={fn:wpmdb.functions.migrate_table_recursive,args:[t.current_row,t.primary_keys,l]},wpmdb.functions.execute_next_step()}})}},{key:"migration_complete_events",value:function(){if(!1===wpmdb.common.migration_error)if(""===wpmdb.common.non_fatal_errors)if("savefile"!==this.migration_intent&&!0===i("#save_computer").is(":checked")&&wpmdb.current_migration.setText(),this.completed_msg=this.completed_msg+' <div class="dashicons dashicons-yes"></div>',!0===this.migration_cancelled){var e=s.migration_cancelled_success;"find_replace"===this.migration_intent&&(e=s.find_replace_cancelled_success),wpmdb.current_migration.setState(this.completed_msg,e,"cancelled")}else wpmdb.current_migration.setState(this.completed_msg,"","complete");else wpmdb.current_migration.setState(s.completed_with_some_errors,wpmdb.common.non_fatal_errors,"error");i(".migration-controls").addClass("hidden"),wpmdb.common.hooks=[],wpmdb.common.call_stack=[],wpmdb.common.migration_error=!1,this.currently_migrating=!1,this.migration_completed=!0,this.migration_paused=!1,this.migration_cancelled=!1,this.doing_ajax=!1,wpmdb.common.non_fatal_errors="",this.tables_to_migrate=[],i(".progress-label").remove(),i(".migration-progress-ajax-spinner").remove(),i(".close-progress-content").show(),i("#overlay").css("cursor","pointer"),wpmdb.current_migration.model.setMigrationComplete()}},{key:"migration_complete",value:function(){var e=this;if(i(".migration-controls").addClass("hidden"),"savefile"===this.migration_intent){this.currently_migrating=!1;var t=s.migration_complete;if(i("#save_computer").is(":checked")){var n=r.this_download_url+encodeURIComponent(this.dump_filename);i("#gzip_file").is(":checked")&&(n+="&gzip=1"),window.location=n}else t=s.completed_dump_located_at+" "+this.dump_path;!1===wpmdb.common.migration_error&&(wpmdb.functions.migration_complete_events(),wpmdb.current_migration.setState(this.completed_msg,t,"complete"))}else{wpmdb.current_migration.setState(null,s.finalizing_migration,"finalizing");var a={action:"wpmdb_finalize_migration",migration_state_id:wpmdb.migration_state_id,tables:this.tables_to_migrate.join(","),nonce:r.nonces.finalize_migration};-1!==i.inArray(this.migration_intent,["push","pull"])&&(a.prefix=wpmdb.common.connection_data.prefix),this.doing_ajax=!0,i.ajax({url:o,type:"POST",dataType:"text",cache:!1,data:a,error:function(t,i,n){e.doing_ajax=!1,wpmdb.current_migration.setState(s.migration_failed,s.finalize_tables_problem,"error"),alert(t+" : "+i+" : "+n),wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events()},success:function(t){if(e.doing_ajax=!1,"1"!==i.trim(t))return wpmdb.current_migration.setState(s.migration_failed,t,"error"),wpmdb.common.migration_error=!0,void wpmdb.functions.migration_complete_events();wpmdb.common.next_step_in_migration={fn:wpmdb.functions.wpmdb_call_next_hook},wpmdb.functions.execute_next_step()}})}}},{key:"wpmdb_flush",value:function(){var e=this;"savefile"!==this.migration_intent&&(wpmdb.current_migration.setText(s.flushing),this.doing_ajax=!0,i.ajax({url:o,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_flush",migration_state_id:wpmdb.migration_state_id,nonce:r.nonces.flush},error:function(t,i,n){e.doing_ajax=!1,wpmdb.current_migration.setState(s.migration_failed,s.flush_problem,"error"),alert(t+" : "+i+" : "+n),wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events()},success:function(t){if(e.doing_ajax=!1,"1"!==i.trim(t))return wpmdb.current_migration.setState(s.migration_failed,t,"error"),wpmdb.common.migration_error=!0,void wpmdb.functions.migration_complete_events();wpmdb.common.next_step_in_migration={fn:wpmdb.functions.wpmdb_call_next_hook},wpmdb.functions.execute_next_step()}}))}},{key:"execute_next_step",value:function(){var e=this;if(0<this.delay_between_requests&&!1===this.flag_skip_delay)setTimeout(function(){this.flag_skip_delay=!0,wpmdb.functions.execute_next_step()},this.delay_between_requests);else if(this.flag_skip_delay=!1,!0===this.migration_paused){i(".migration-progress-ajax-spinner").hide(),wpmdb.current_migration.pauseTimer();var t="";!0===this.is_auto_pause_before_finalize?(t=s.paused_before_finalize,this.is_auto_pause_before_finalize=!1,"find_replace"===wpmdb.functions.wpmdb_migration_type()&&(t=s.find_replace_paused_before_finalize)):t=s.paused,wpmdb.current_migration.setState(null,t,"paused"),i("body").on("click",".pause-resume",function(e){this.set_pause_resume_button(e)}),i("body").on("click",".cancel",function(e){this.cancel_migration(e)}),i(".pause-resume").html(s.resume)}else if(!0===this.migration_cancelled){var n;this.migration_intent=wpmdb.functions.wpmdb_migration_type(),"savefile"===this.migration_intent?n=s.removing_local_sql:"pull"===this.migration_intent?n="backup"===this.stage?s.removing_local_backup:s.removing_local_temp_tables:"push"===this.migration_intent&&(n="backup"===this.stage?s.removing_remote_sql:s.removing_remote_temp_tables),wpmdb.current_migration.setText(n);var a={action:"wpmdb_cancel_migration",migration_state_id:wpmdb.migration_state_id,nonce:r.nonces.cancel_migration};this.doing_ajax=!0,i.ajax({url:o,type:"POST",dataType:"text",cache:!1,data:a,error:function(t,i,n){wpmdb.current_migration.setState(s.migration_cancellation_failed,s.manually_remove_temp_files+"<br /><br />"+s.status+": "+t.status+" "+t.statusText+"<br /><br />"+s.response+":<br />"+t.responseText,"error"),console.log(t),console.log(i),console.log(n),e.doing_ajax=!1,wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events()},success:function(t){if(e.doing_ajax=!1,t=i.trim(t),"push"===e.migration_intent&&"1"!==t||"push"!==e.migration_intent&&""!==t)return void 0!==t&&void 0!==t.wpmdb_error&&1===t.wpmdb_error&&(t=t.wpmdb_error),wpmdb.current_migration.setState(s.migration_cancellation_failed,t,"error"),wpmdb.common.migration_error=!0,void wpmdb.functions.migration_complete_events();e.completed_msg=s.migration_cancelled,"find_replace"===e.migration_intent&&(e.completed_msg=s.find_replace_cancelled),wpmdb.functions.migration_complete_events(),wpmdb.current_migration.setStatus("cancelled")}})}else wpmdb.common.next_step_in_migration.fn.apply(null,wpmdb.common.next_step_in_migration.args)}},{key:"maybe_show_prefix_notice",value:function(e){var t=i(".prefix-notice");t.hide(),e!==r.this_prefix&&(i(".remote-prefix").html(e),this.show_prefix_notice=!0,t.show())}},{key:"maybe_show_mst_warning",value:function(e){var t=wpmdb.functions.wpmdb_migration_type(),n=!1;return-1!==i.inArray(t,["push","pull"])&&void 0!==e.site_details?r.site_details.is_multisite!==e.site_details.is_multisite&&(void 0!==wpmdb.mst&&void 0!==e.mst_available&&"1"===e.mst_available||(n=!0)):"import"===t&&void 0!==e.multisite&&void 0!==e.subsite_export&&("false"===r.site_details.is_multisite&&"true"===e.multisite&&"true"!==e.subsite_export||"true"===r.site_details.is_multisite&&"false"===e.multisite)&&(n=!0),(n=i.wpmdb.apply_filters("wpmdb_show_mst_warning",n))&&i(".mst-required").show(),n}},{key:"maybe_show_select_table_notice",value:function(){if(i("#migrate-selected").is(":checked")&&null===i("#select-tables").val()){if("import"!==wpmdb.functions.wpmdb_migration_type())return alert(s.please_select_one_table),!0;if(i("#import-find-replace").is(":checked")&&i("#select-tables").is(":visible"))return alert(s.please_select_one_table_import),!0}return!("savefile"===wpmdb.functions.wpmdb_migration_type()||!i("#backup-manual-select").is(":checked")||null!==i("#select-backup").val())&&(alert(s.please_select_one_table_backup),!0)}},{key:"remove_protocol",value:function(e){return e.replace(/^https?:/i,"")}},{key:"create_table_select",value:function(e,t,n){var a=document.createElement("select");return i(a).attr({multiple:"multiple",name:"select_tables[]",id:"select-tables",class:"multiselect"}),0<e.length&&i.each(e,function(e,o){if(!i.wpmdb.apply_filters("wpmdb_exclude_table",!1,o)){var s=" ";void 0!==n&&null!==n&&0<n.length&&-1!==i.inArray(o,n)&&(s=' selected="selected" ');var r="";0!==t.length&&(r=" ("+t[o]+")"),i(a).append("<option"+s+'value="'+o+'">'+o+r+"</option>")}}),a}},{key:"get_tables_to_migrate",value:function(){var e=[],t=wpmdb.functions.wpmdb_migration_type();return"migrate_select"===i("input[name=table_migrate_option]:checked").val()?e=i("#select-tables").val():"pull"!==t&&void 0!==r.this_prefixed_tables?e=r.this_prefixed_tables:"pull"===t&&void 0!==wpmdb.common.connection_data&&void 0!==wpmdb.common.connection_data.prefixed_tables&&(e=wpmdb.common.connection_data.prefixed_tables),e}},{key:"update_migrate_button_text",value:function(){var e=wpmdb.functions.wpmdb_migration_type(),t=i("#save-migration-profile").is(":checked")?"_save":"",n="migrate_button_"+("savefile"===e?"export":e)+t;i(".migrate-db .button-primary").val(s[n])}},{key:"connection_box_changed",value:function(){var e=this,t=i(".pull-push-connection-info");if(-1!==i.inArray(wpmdb.functions.wpmdb_migration_type(),["push","pull"])&&(!this.doing_ajax&&!i(t).hasClass("temp-disabled")||!1!==wpmdb.force_reconnect)){wpmdb.force_reconnect=!1;var n=i(".pull-push-connection-info").val(),a=i.trim(n).split("\n"),l=!1,c="";if(""===a&&(l=!0,c=s.connection_info_missing),1===a.length&&!l){var p=i.trim(n).split(" ");2===p.length&&(a=p)}2===a.length||l||(l=!0,c=s.connection_info_incorrect),l||this.validate_url(a[0])||(l=!0,c=s.connection_info_url_invalid);var m=0;if(void 0!==a[1]&&(m=a[1].length),l||32===m||40===m||(l=!0,c=s.connection_info_key_invalid),l||a[0]!==r.connection_info[0]||(l=!0,c=s.connection_info_local_url),l||a[1]!==r.connection_info[1]||(l=!0,c=s.connection_info_local_key),l)return i(".connection-status").html(c),void i(".connection-status").addClass("notification-message error-notice migration-error");var d=a[0]+"\n"+a[1];1===i.trim(n).split("\n").length&&i(".pull-push-connection-info").val(d),!1===r.openssl_available&&(a[0]=a[0].replace("https://","http://"),d=a[0]+"\n"+a[1],i(".pull-push-connection-info").val(d)),this.show_prefix_notice=!1,this.doing_ajax=!0,this.disable_export_type_controls(),i(".basic-access-auth-wrapper").is(":visible")&&(a[0]=a[0].replace(/\/\/(.*)@/,"//"),a[0]=a[0].replace("//","//"+encodeURIComponent(i.trim(i(".auth-username").val()))+":"+encodeURIComponent(i.trim(i(".auth-password").val()))+"@"),d=a[0]+"\n"+a[1],i(".pull-push-connection-info").val(d),i(".basic-access-auth-wrapper").hide()),i(".step-two").hide(),i(".ssl-notice").hide(),i(".prefix-notice").hide(),i(".connection-status").show(),i(".connection-status").html(s.establishing_remote_connection),i(".connection-status").removeClass("notification-message error-notice migration-error"),i(".connection-status").append(this.ajax_spinner);var _=wpmdb.functions.wpmdb_migration_type();return this.profile_name_edited=!1,i.ajax({url:o,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_verify_connection_to_remote_site",url:a[0],key:a[1],intent:_,nonce:r.nonces.verify_connection_to_remote_site},error:function(t,n,a){i(".connection-status").html(e.get_ajax_errors(t.responseText,"(#100)",t)),i(".connection-status").addClass("notification-message error-notice migration-error"),i(".ajax-spinner").remove(),e.doing_ajax=!1,e.enable_export_type_controls()},success:function(t){if(i(".ajax-spinner").remove(),e.doing_ajax=!1,e.enable_export_type_controls(),void 0!==t.wpmdb_error&&1===t.wpmdb_error)return i(".connection-status").html(t.body),i(".connection-status").addClass("notification-message error-notice migration-error"),t.body.indexOf("401 Unauthorized")>-1&&i(".basic-access-auth-wrapper").show(),void(i(".pull-push-connection-info").hasClass("temp-disabled")||i(".connect-button").is(":visible")||(i(".pull-push-connection-info").removeAttr("readonly"),i(".connect-button").show()));if(!0!==e.maybe_show_mst_warning(t)){e.maybe_show_ssl_warning(a[0],a[1],t.scheme);var n=e.get_domain_name(t.url);i(".create-new-profile").val(n),i(".pull-push-connection-info").addClass("temp-disabled"),i(".pull-push-connection-info").attr("readonly","readonly"),i(".connect-button").hide(),i(".connection-status").hide(),i(".step-two").show(),wpmdb.functions.maybe_show_prefix_notice(t.prefix),e.connection_established=!0,e.set_connection_data(t),e.move_connection_info_box(),e.change_replace_values(),e.maybe_show_mixed_cased_table_name_warning(),e.refresh_table_selects(null,null,e),e.$push_select_backup=i(e.$pull_select).clone(),i(e.$push_select_backup).attr({name:"select_backup[]",id:"select-backup"});var o=document.createElement("select");i(o).attr({multiple:"multiple",name:"select_post_types[]",id:"select-post-types",class:"multiselect"}),i.each(wpmdb.common.connection_data.post_types,function(e,t){i(o).append('<option value="'+t+'">'+t+"</option>")}),e.$pull_post_type_select=o,i("#new-path-missing-warning, #new-url-missing-warning").hide(),"pull"===wpmdb.functions.wpmdb_migration_type()?(i("#new-url").val(e.remove_protocol(r.this_url)),i("#new-path").val(r.this_path),"true"===r.is_multisite&&(i("#new-domain").val(r.this_domain),i('.replace-row.pin .old-replace-col input[type="text"]').val(e.remove_protocol(t.url))),i("#old-url").val(e.remove_protocol(t.url)),i("#old-path").val(t.path),i.wpmdb.do_action("wpmdb_update_pull_table_select"),i("#select-post-types").remove(),i(".exclude-post-types-warning").after(e.$pull_post_type_select),wpmdb.functions.exclude_post_types_warning(),i(".table-prefix").html(t.prefix),i(".backup-table-prefix").html(r.site_details.prefix),i(".uploads-dir").html(r.this_uploads_dir)):(i("#new-url").val(e.remove_protocol(t.url)),i("#new-path").val(t.path),"true"===r.is_multisite&&i('.replace-row.pin .old-replace-col input[type="text"]').val(e.remove_protocol(r.this_url)),i.wpmdb.do_action("wpmdb_update_push_table_select"),i("#select-backup").remove(),i(".backup-tables-wrap").prepend(e.$push_select_backup)),wpmdb.common.next_step_in_migration={fn:i.wpmdb.do_action,args:["verify_connection_to_remote_site",wpmdb.common.connection_data]},wpmdb.functions.execute_next_step()}else i(".connection-status").hide()}})}}}]),e}();t.default=l},function(e,t){window.jQuery;jQuery.wpmdb={hooks:{action:{},filter:{}},add_action:function(e,t,i,n){jQuery.wpmdb.add_hook("action",e,t,i,n)},add_filter:function(e,t,i,n){jQuery.wpmdb.add_hook("filter",e,t,i,n)},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,a){void 0===jQuery.wpmdb.hooks[e][t]&&(jQuery.wpmdb.hooks[e][t]=[]);var o=jQuery.wpmdb.hooks[e][t];void 0===n&&(n=t+"_"+o.length),jQuery.wpmdb.hooks[e][t].push({tag:n,callable:i,instance:a})},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.call(a[o].instance,n,a[o].instance):i=a[o].callable.call(a[o].instance,i,n,a[o].instance);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)}}},function(e,t){window.jQuery;!function(e,t){var i=!1,n=e("#select-tables").clone(),a=[],o=[],s=!1,r="",l={},c='<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=l),e}),e("#import-file").on("change",function(a){var m=a.target.files,d=m[0],_=new FileReader,u=e(".import-file-status"),g=e('label[for="backup-selected"]'),h=e(".prefix-notice"),b=e(".unrecognized-import-file-notice"),f=e(".step-two"),w=e("#old-url"),v=e("#old-path"),y=e("#new-url"),x=e("#new-path");if(u.hide().attr("class","import-file-status"),h.hide(),b.hide(),f.hide(),e(".mst-required ").hide(),m.length){if(".sql"!==d.name.slice(-4)&&".sql.gz"!==d.name.slice(-7))return u.addClass("notification-message error-notice migration-error").text(wpmdb_strings.invalid_sql_file).show(),void f.hide();i=!0,r="",u.text(wpmdb_strings.parsing_sql_file).append(c).show(),_.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(),u.hide(),!0!==t.functions.maybe_show_mst_warning(i))if(f.show(),void 0!==i.wpmdb_error&&1===i.wpmdb_error)u.text(i.body).addClass("notification-message error-notice migration-error").show(),f.hide();else{var a=t.functions.get_localStorage_form_data();if(l=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 c=[],m=[];if(a?(c=a.select_tables,m=a.select_post_types,t.functions.remove_localStorage_form_data()):"migrate_only_with_prefix"!==e("input[name=table_migrate_option]:checked").val()||u.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&&(c=wpmdb_loaded_tables,m=wpmdb_loaded_post_types),n=t.functions.create_table_select(i.tables,[],c),e.wpmdb.do_action("wpmdb_update_import_table_select"),void 0!==i.post_types){var d=document.createElement("select");e(d).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,m);n=-1!==n||!0===wpmdb_convert_exclude_revisions&&"revision"!==i;var a=document.createElement("option");a.value=i,a.text=i,a.selected=n,d.add(a,null)}),e("#select-post-types").remove(),e(".exclude-post-types-warning").after(d)}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=d.slice(0,1024e3);_.readAsDataURL(k)}else i&&(f.hide(),u.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=i+1024e3+1,o=new FileReader;0===i&&t.current_migration.model.addStageItem("upload",n.name,n.size/1e3,Math.ceil(n.size/1024e3)),o.onloadend=function(o){o.target.readyState===FileReader.DONE&&e.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_upload_file",file_data:o.target.result,file:n.name,file_type:n.type,migration_state_id:t.migration_state_id,stage:"import",import_info:l,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 o=i+1024e3;t.current_migration.setText(wpmdb_strings.uploading_file_to_server),t.current_migration.model.getStageModel("upload").setItemRowsTransferred(n.name,Math.ceil(o/1024e3)),a<n.size?t.common.next_step_in_migration={fn:t.functions.upload_file_recursive,args:[a]}:t.common.next_step_in_migration={fn:t.functions.upload_import_successful,args:[n]},t.functions.execute_next_step()}})};var s=n.slice(i,a);o.readAsDataURL(s)},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 l=e("input[name=table_migrate_option]:checked").val();"migrate_only_with_prefix"===l?a=o.filter(function(e){return r===e.substring(0,r.length)}):"search_all_imported"===l&&(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 c=t.functions.get_tables_to_migrate();return t.common.next_step_in_migration={fn:t.functions.migrate_table_recursive,args:["-1","",c.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)},function(e,t){window.jQuery;!function(e,t){e(document).ready(function(){t.functions.localStorage_available=function(){try{return localStorage.setItem("wpmdb_test","wpmdb_test"),localStorage.removeItem("wpmdb_test","wpmdb_test"),!0}catch(e){return!1}},t.functions.maybe_reload_page=function(){var i=t.functions.wpmdb_migration_type();if(t.functions.localStorage_available()&&"cancelled"!==t.current_migration.status&&!0!==t.common.migration_error&&!e(".progress-overlay-container").hasClass("wpmdb-error")&&-1!==e.inArray(i,["pull","import","find_replace"])&&("true"!==wpmdb_data.is_multisite||!e("#mst-select-subsite").is(":checked")||wpmdb_data.this_domain===e("#mst-selected-subsite option:selected").text())){var n=t.functions.get_tables_to_migrate();"import"===i&&(n=t.functions.get_tables_to_import()),-1===e.inArray(wpmdb_data.this_prefix+"options",n)&&-1===e.inArray(wpmdb_data.this_prefix+"usermeta",n)||(t.functions.set_localStorage_form_data(),location.reload())}},t.functions.set_localStorage_form_data=function(){var t={};e.each(e("#migrate-form").serializeArray(),function(e,i){if("[]"===i.name.substr(-2)){var n=i.name.slice(0,-2);void 0===t[n]&&(t[n]=[]),t[n].push(i.value)}else t[i.name]=i.value}),localStorage.setItem("wpmdb_migrate_form",JSON.stringify(t))},t.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},t.functions.remove_localStorage_form_data=function(){localStorage.removeItem("wpmdb_migrate_form")},t.functions.load_data_from_localStorage=function(){var i=t.functions.get_localStorage_form_data();i&&(e.each(i,function(i,n){var a=e('[name="'+i+'"]'),o=a.attr("type");"action"===i?(t.migration_selection=n,e("#"+n).prop("checked",!0)):"radio"===o?e('[name="'+i+'"][value="'+n+'"]').prop("checked",!0):"checkbox"===o?(a.prop("checked",!0),a.parent().hasClass("checkbox-label")&&a.parent().next().show()):a.val(n)}),e(".option-group input[type=radio]").change(),e("."+t.migration_selection+"-list ul").show(),e.when(t.functions.connection_box_changed()).done(function(){if("migrate_select"===e("input[name=table_migrate_option]:checked").val()?(void 0!==i.select_tables&&e("#select-tables").val(i.select_tables),e(".table-options .expandable-content, .select-tables-wrap").show(),e(".table-options .expand-collapse-arrow").removeClass("collapsed")):e(".select-tables-wrap").hide(),"backup_manual_select"===e("input[name=backup_option]:checked").val()&&(void 0!==i.select_backup&&e("#select-backup").val(i.select_backup),e(".backup-tables-wrap").show()),void 0!==i.select_post_types&&(e("#select-post-types").val(i.select_post_types),t.functions.exclude_post_types_warning()),void 0!==i.replace_old){e(".replace-row").not(".original-repeatable-field").remove();var n=1;e.each(i.replace_old,function(t,a){e(".replace-row:nth-child("+n+")").length||e(".replace-row").last().after(e(".original-repeatable-field").clone().removeClass("original-repeatable-field")),e(".replace-row:nth-child("+n+') [name="replace_old[]"]').val(a),e(".replace-row:nth-child("+n+') [name="replace_new[]"]').val(i.replace_new[t]),n++})}}),t.functions.update_migrate_button_text(),"import"!==t.functions.wpmdb_migration_type()&&t.functions.remove_localStorage_form_data())},t.functions.load_data_from_localStorage()})}(jQuery,wpmdb)},function(e,t,i){var n=window.jQuery,a="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},o=(n=jQuery,i(0)),s=i(2),r=n('<div id="overlay" class="hide"></div>'),l=n(".progress-content").clone().addClass("hide"),c=n(".pro-version").addClass("hide");r.append(c);var p={migration:{model:{},view:{},$progress:{},$wrapper:{},$overlay:{},status:"active",title:"",text:"",timerCount:0,timerStart: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.timerStart=Date.now(),this.timerCount=0,this.counterDisplay=n(".timer"),this.elapsedInterval=setInterval(this.incrementTimer.bind(this),1e3)},getTimerCountInSeconds:function(){return Math.floor((Date.now()-this.timerStart)/1e3)},pauseTimer:function(){this.pausedAt=Date.now(),clearInterval(this.elapsedInterval)},resumeTimer:function(){this.timerStart+=Date.now()-this.pausedAt,this.elapsedInterval=setInterval(this.incrementTimer.bind(this),1e3)},incrementTimer:function(){this.timerCount=this.getTimerCountInSeconds(),this.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(/\{"/g,"{#q!#").replace(/\"}/g,"#q!#}").replace(/,"/g,",#q!#").replace(/":/g,"#q!#:").replace(/:"/g,":#q!#").replace(/"/g,'\\"').replace(/#q!#/g,'"').replace(/>/g,">").replace(/</g,"<");try{t=JSON.parse(t)}catch(t){return e}return"object"===(void 0===t?"undefined":a(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){n("#overlay").remove(),n(".progress-content").remove(),this.migration.$overlay=r.clone(),n("#wpwrap").append(this.migration.$overlay),this.migration.model=new o(e),this.migration.view=new s({model:this.migration.model}),this.migration.$progress=l.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()}),n(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:i(4)};e.exports=p},function(e,t,i){var n=window.jQuery,a="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},o=i(1),s=(n=jQuery,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,o){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===o?"undefined":a(o))&&(s=n.extend(s,o)),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){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";this.getStageModel(e).addItem(t,i,n,a)},addStageModel:function(e){var t=this.get("stages"),i=this.get("stageModels"),n=new o(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()}}));e.exports=s},function(e,t){var i=window.jQuery;i=jQuery;e.exports={updateProgTableVisibilitySetting:function(){wpmdb_data.prog_tables_visibility_changed&&(wpmdb_data.prog_tables_visibility_changed=!1,i.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,i.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)}}))}}},function(e,t,i){window.jQuery;var n=i(3),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)}}));e.exports=a},function(e,t){var i=window.jQuery,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=(i=jQuery,Backbone.Model.extend({defaults:{status:"queued",_initialItems:null,items:null,names: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("names",[]),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=i.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,n,a){var o=this.get("items"),s=this.get("names");if(!~s.indexOf(e)){s.push(e);var r={name:e,size:t,rows:n||t,stageName:this.get("name"),transferred:0,rowsTransferred:0,complete:!1,title:null,get $title(){return this.title||this.createTitleElem()},set $title(e){this.title=e},createTitleElem:function(){return this.title=i("<p>").addClass("item-info").append(i('<span class="name" />').text(this.displayName||this.name)).append(" ").append(i('<span class="size" />').text("("+wpmdb.functions.convertKBSizeToHRFixed(r.size)+")")),this.title},progress:null,get $progress(){return this.progress||this.createProgElem()},set $progress(e){this.progress=e},createProgElem:function(){return this.progress=i('<div class="progress-bar"/>').css("width","0%"),this.progress},el:null,get $el(){return this.el||this.createMainElem()},set $el(e){this.el=e},createMainElem:function(){return this.el=i('<div class="item-progress" />'),this.el.append(this.$title),this.el.append(this.$progress),this.el.append('<span class="dashicons dashicons-yes"/>'),this.el.attr("id","item-"+this.name),this.el.attr("data-stage",this.stageName),this.el},updateProgress:function(e){var t=this.$progress;window.requestAnimationFrame(function(){t.css("width",e+"%")}.bind(this))}};void 0!==a&&a.length&&(r.displayName=a),o.push(r),this.get("lookupItems")[e]=o.length-1,this.set("totalSize",parseFloat(this.get("totalSize"))+parseFloat(t)),this.trigger("item:added",r)}},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.round(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)}},setItemPercentTransferred:function(e,t,i,n){var a=this.getItemByName(e),o=i/1e3;if(1===t){a.complete=!0,a.transferred=o;var s=this.get("itemsComplete");this.set("itemsComplete",++s),this.trigger("change change:items",a)}a.transferred=n/1e3,a.exactPercent=t;var r=this.get("totalTransferred");r+=o,this.set("totalTransferred",r),this.trigger("change change:items",a)},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}}}));e.exports=a},function(e,t){var i=window.jQuery,n=(i=jQuery,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:140,visibleDomNodes:0,itemCount:0,percentDone:0,sizeDone:0,tablesDone:0,queuedElements:null,$truncationNotice:null,$truncationNoticeHiddenItems:null,shouldHideItemProgress:!1,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=i("<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=i('<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=i("<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=i(".pause-before-finalize"),this.$pauseBeforeFinalizeCheckbox=this.$pauseBeforeFinalizeElem.find("input[type=checkbox]");var e=this,t=!1,n=wpmdb.current_migration.model.get("migrationIntent");wpmdb_data.pause_before_finalize&&(t=!0),this.$pauseBeforeFinalizeCheckbox.prop("checked",t),-1!==i.inArray(n,["push","pull","find_replace","import"])?("find_replace"===n&&i("#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(){-1!==i.inArray(wpmdb.current_migration.model.get("activeStageName"),["media","themes","plugins"])&&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=i("<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()),e!==this.percentDone&&(this.percentDone=e,this.$totalProgressElem.find(".percent-complete").text(e),this.$totalProgressElem.find(".progress-bar-wrapper .progress-bar").css({width:e+"%"})),t!=this.sizeDone&&(this.sizeDone=t,this.$totalProgressElem.find(".size-complete").text(t)),i!=this.tablesDone&&(this.tablesDone=i,this.$totalProgressElem.find(".items-complete").text(wpmdb.functions.wpmdb_add_commas(i)))},updateStageTotals:function(e){if((e=e||this.model.get("items").length)!==this.itemCount&&(this.itemCount=e,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"))),!this.shouldHideItemProgress&&500<e)){var t=this.model.get("name").toLowerCase();"themes"!=t&&"plugins"!==t||this.hideItemProgress()}},hideItemProgress:function(){this.shouldHideItemProgress||(this.shouldHideItemProgress=!0,this.$itemsContainer.empty(),this.$showHideTablesElem&&this.$showHideTablesElem.hide())},maybeAddElementToView:function(e){var t=this.shouldHideItemProgress?0:this.maxDomNodes;this.visibleDomNodes<t?(++this.visibleDomNodes,this.$itemsContainer.append(e.$el)):(this.queuedElements.push(e),this.$truncationNotice?this.updateTruncationNotice():this.showTruncationNotice())},showTruncationNotice:function(){if(!this.$truncationNotice){var e=this.shouldHideItemProgress?this.model.get("items").length:this.queuedElements.length;this.$truncationNotice=i('<div class="truncation-notice" >'+wpmdb_strings.progress_items_truncated_msg.replace("%1$s",'<span class="hidden-items">'+wpmdb.functions.wpmdb_add_commas(e)+"</span>")+"</div>"),this.$truncationNoticeHiddenItems=this.$truncationNotice.find(".hidden-items"),this.$itemsContainer.after(this.$truncationNotice)}},updateTruncationNotice:function(){var e=this.shouldHideItemProgress?this.model.get("items").length:this.queuedElements.length;this.$truncationNoticeHiddenItems.text(wpmdb.functions.wpmdb_add_commas(e))},getNextElementForView:function(e){var t;return!this.shouldHideItemProgress&&(this.queuedElements.length&&(e&&this.queuedElements.push(e),e=(t=this.queuedElements.shift())instanceof i?t:t.$el),e)},setItemProgress:function(e){var t=Math.min(100,Math.ceil(e.transferred/e.size*100));e.hasOwnProperty("exactPercent")&&(t=100*e.exactPercent),0===e.size&&(t=100),e.updateProgress(t),(100<=t||0===e.size)&&this.elemComplete(e)},elemComplete:function(e){if(!this.shouldHideItemProgress){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=!1;i===t&&(o=i.clone().css({height:0,marginBottom:0,display:"block"}).addClass("clone complete")).appendTo(this.$itemsContainer),t.css({height:n,marginBottom:a}),setTimeout(function(){t.css({height:0,marginBottom:0});var e=0;o&&(e=250,o.css({height:n,marginBottom:a}),o.find(".progress-bar").addClass("progress-bar-no-transition").css({width:"100%"})),setTimeout(function(){t.css({display:"none"}),t.remove(),o&&o.remove(),this.$itemsContainer.find(".item-progress:not(.clone)").last().after(i.css({height:"auto",marginBottom:a,display:"block"}))}.bind(this),e)}.bind(this),1e3)}}}}));e.exports=n},function(e,t){window.jQuery;!function(e,t){t.functions.update_multiselect=function(i,n,a){if(e(i).empty(),0<Object.keys(n).length){var o=e.wpmdb.apply_filters("wpmdb_get_table_prefix",null,null),s=!1;e.each(n,function(t,n){if(!e.wpmdb.apply_filters("wpmdb_exclude_subsite",!1,t)){var r=" ";(void 0===a||null===a||0===a.length||void 0!==a&&null!==a&&0<a.length&&-1!==e.inArray(t,a))&&(r=' selected="selected" ',s=!0),n+=" ("+o+("1"!==t?t+"_":"")+")",e(i).append("<option"+r+'value="'+t+'">'+n+"</option>")}}),!1===s&&t.functions.update_multiselect(i,n,[])}}}(jQuery,wpmdb)},function(e,t){window.jQuery;!function(e){var t,i=!1,n=ajaxurl.replace("/admin-ajax.php","")+"/images/spinner";2<window.devicePixelRatio&&(n+="-2x"),t=e('<img src="'+(n+=".gif")+'" alt="" class="check-licence-spinner" />'),e(document).ready(function(){e("body").on("click",".check-my-licence-again",function(n){if(n.preventDefault(),e(this).blur(),i)return!1;i=!0,e(this).hide(),t.insertAfter(this);var a=' <a class="check-my-licence-again" href="#">'+wpmdb_update_strings.check_license_again+"</a>";e.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_check_licence",nonce:wpmdb_nonces.check_licence,context:"update"},error:function(t,n,o){i=!1,e(".wpmdb-licence-error-notice").fadeOut(650,function(){e(".wpmdb-licence-error-notice").empty().html(wpmdb_update_strings.license_check_problem+a).fadeIn(650)})},success:function(t){if(i=!1,void 0!==t.errors){var n="";for(var a in t.errors)n+=t.errors[a];e(".wpmdb-licence-error-notice").fadeOut(650,function(){e(".check-licence-spinner").remove(),e(".wpmdb-licence-error-notice").empty().html(n).fadeIn(650)})}else e(".wpmdbpro-custom-visible").fadeOut(650,function(){e(".check-licence-spinner").remove(),e(".wpmdbpro-custom-visible").empty().html(e(".wpmdb-original-update-row").html()).fadeIn(650)})}})}),e(".wpmdbpro-custom").prev().addClass("wpmdbpro-has-message")})}(jQuery)},function(e,t,i){window.jQuery;var n=function(e){return e&&e.__esModule?e:{default:e}}(i(25)),a=i(26);var o=new n.default,s=window.wpmdb||{};!function(e,t){t.migration_progress_controller=i(27),t.current_migration=null,t.migration_selection=t.functions.wpmdb_migration_type(),window.onbeforeunload=function(i){if("import"!==t.functions.wpmdb_migration_type()||e(".step-two").is(":visible")||t.functions.remove_localStorage_form_data(),o.currently_migrating)return(i=i||window.event)&&(i.returnValue=wpmdb_strings.sure),wpmdb_strings.sure},t.functions.exclude_post_types_warning=function(){var t=e("#select-post-types").val(),i="",n=e(".exclude-post-types-warning");t?(i="<code>"+t.join("</code>, <code>")+"</code>",e(".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})},t.functions.migrate_table_recursive=function(i,n,a){var s=a||0;if(s>=o.tables_to_migrate.length)if("upload"===o.stage&&t.current_migration.model.getStageItems("find_replace").length)o.stage="find_replace",o.tables_to_migrate=t.current_migration.model.getStageItems("find_replace","name"),o.tables_to_migrate=o.tables_to_migrate.map(function(e){return"_mig_"+e}),s=0;else{if("backup"!==o.stage)return 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},void t.functions.execute_next_step();if(-1!==e.inArray(o.migration_intent,["push","pull"])?o.stage="migrate":"import"===o.migration_intent?o.stage="upload":o.stage=o.migration_intent,t.current_migration.model.setActiveStage(o.stage),"find_replace"!==o.stage&&"migrate"!==o.stage)return void t.functions.wpmdb_call_next_hook();s=0,o.tables_to_migrate=t.functions.get_tables_to_migrate(null,null)}var r=0;s===o.tables_to_migrate.length-1&&(r=1);var l=0;-1!==e.inArray(o.migration_intent,["push","pull"])&&1===parseInt(t.common.connection_data.gzip)&&(l=1);var c={action:"wpmdb_migrate_table",migration_state_id:t.migration_state_id,table:o.tables_to_migrate[s],stage:o.stage,current_row:i,last_table:r,primary_keys:n,gzip:l,nonce:wpmdb_data.nonces.migrate_table};-1!==e.inArray(o.migration_intent,["push","pull"])&&(c.bottleneck=t.common.connection_data.bottleneck,c.prefix=t.common.connection_data.prefix),t.common.connection_data&&t.common.connection_data.path_current_site&&t.common.connection_data.domain&&(c.path_current_site=t.common.connection_data.path_current_site,c.domain_current_site=t.common.connection_data.domain),o.doing_ajax=!0,e.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,timeout:0,data:c,error:function(e,i,n){var a=wpmdb_strings.table_process_problem+" "+o.tables_to_migrate[s]+"<br /><br />"+wpmdb_strings.status+": "+e.status+" "+e.statusText+"<br /><br />"+wpmdb_strings.response+":<br />"+e.responseText;t.current_migration.setState(wpmdb_strings.migration_failed,a,"error"),o.doing_ajax=!1,console.log(e),console.log(i),console.log(n),t.common.migration_error=!0,t.functions.migration_complete_events()},success:function(i){o.doing_ajax=!1,i=e.trim(i);var n=t.functions.wpmdb_parse_json(i),a="";if(!1===n||null===n)return a=""===i||null===i?wpmdb_strings.table_process_problem_empty_response+" "+o.tables_to_migrate[s]:o.get_ajax_errors(i,null,null),t.current_migration.setState(wpmdb_strings.migration_failed,a,"error"),t.common.migration_error=!0,void t.functions.migration_complete_events();if(void 0!==n.wpmdb_error&&1===n.wpmdb_error)return t.current_migration.setState(wpmdb_strings.migration_failed,n.body,"error"),t.common.migration_error=!0,void t.functions.migration_complete_events();var l=o.tables_to_migrate[s];"import"===o.migration_intent&&"find_replace"===o.stage&&(l=l.replace(wpmdb_data.this_temp_prefix,"")),t.current_migration.setText(),t.current_migration.model.getStageModel(o.stage).setItemRowsTransferred(l,n.current_row),1===r&&"savefile"===o.migration_intent&&(void 0!==n.dump_filename&&(o.dump_filename=n.dump_filename),void 0!==n.dump_path&&(o.dump_path=n.dump_path)),-1===parseInt(n.current_row)&&(s++,n.current_row="",n.primary_keys=""),t.common.next_step_in_migration={fn:t.functions.migrate_table_recursive,args:[n.current_row,n.primary_keys,s]},t.functions.execute_next_step()}})},t.functions.migration_complete_events=function(){if(!1===t.common.migration_error)if(""===t.common.non_fatal_errors)if("savefile"!==o.migration_intent&&!0===e("#save_computer").is(":checked")&&t.current_migration.setText(),o.completed_msg=o.completed_msg+' <div class="dashicons dashicons-yes"></div>',!0===o.migration_cancelled){var i=wpmdb_strings.migration_cancelled_success;"find_replace"===o.migration_intent&&(i=wpmdb_strings.find_replace_cancelled_success),t.current_migration.setState(o.completed_msg,i,"cancelled")}else t.current_migration.setState(o.completed_msg,"","complete");else t.current_migration.setState(wpmdb_strings.completed_with_some_errors,t.common.non_fatal_errors,"error");e(".migration-controls").addClass("hidden"),t.common.hooks=[],t.common.call_stack=[],t.common.migration_error=!1,o.currently_migrating=!1,o.migration_completed=!0,o.migration_paused=!1,o.migration_cancelled=!1,o.doing_ajax=!1,t.common.non_fatal_errors="",o.tables_to_migrate=[],e(".progress-label").remove(),e(".migration-progress-ajax-spinner").remove(),e(".close-progress-content").show(),e("#overlay").css("cursor","pointer"),t.current_migration.model.setMigrationComplete()},t.functions.migration_complete=function(){if(e(".migration-controls").addClass("hidden"),"savefile"===o.migration_intent){o.currently_migrating=!1;var i=wpmdb_strings.migration_complete;if(e("#save_computer").is(":checked")){var n=wpmdb_data.this_download_url+encodeURIComponent(o.dump_filename);e("#gzip_file").is(":checked")&&(n+="&gzip=1"),window.location=n}else i=wpmdb_strings.completed_dump_located_at+" "+o.dump_path;!1===t.common.migration_error&&(t.functions.migration_complete_events(),t.current_migration.setState(o.completed_msg,i,"complete"))}else{t.current_migration.setState(null,wpmdb_strings.finalizing_migration,"finalizing");var s={action:"wpmdb_finalize_migration",migration_state_id:t.migration_state_id,tables:o.tables_to_migrate.join(","),nonce:wpmdb_data.nonces.finalize_migration};-1!==e.inArray(o.migration_intent,["push","pull"])&&(s.prefix=t.common.connection_data.prefix),o.doing_ajax=!0,e.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:s,error:function(e){o.doing_ajax=!1;var t=wpmdb_strings.finalize_tables_problem;(0,a.jQueryAjaxError)(t,e)},success:function(e){if(o.doing_ajax=!1,void 0!==e&&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");t.common.next_step_in_migration={fn:t.functions.wpmdb_call_next_hook},t.functions.execute_next_step()}})}},t.functions.wpmdb_flush=function(){"savefile"!==o.migration_intent&&(t.current_migration.setText(wpmdb_strings.flushing),o.doing_ajax=!0,e.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_flush",migration_state_id:t.migration_state_id,nonce:wpmdb_data.nonces.flush},error:function(e,i,n){o.doing_ajax=!1,t.current_migration.setState(wpmdb_strings.migration_failed,wpmdb_strings.flush_problem,"error"),alert(e+" : "+i+" : "+n),t.common.migration_error=!0,t.functions.migration_complete_events()},success:function(i){if(o.doing_ajax=!1,"1"!==e.trim(i))return t.current_migration.setState(wpmdb_strings.migration_failed,i,"error"),t.common.migration_error=!0,void t.functions.migration_complete_events();t.common.next_step_in_migration={fn:t.functions.wpmdb_call_next_hook},t.functions.execute_next_step()}}))},t.functions.execute_next_step=function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(0<o.delay_between_requests&&!1===o.flag_skip_delay)setTimeout(function(){o.flag_skip_delay=!0,t.functions.execute_next_step(i)},o.delay_between_requests);else if(o.flag_skip_delay=!1,!0===o.migration_paused){e(".migration-progress-ajax-spinner").hide(),t.current_migration.pauseTimer();var a="";!0===o.is_auto_pause_before_finalize?(a=wpmdb_strings.paused_before_finalize,o.is_auto_pause_before_finalize=!1,"find_replace"===t.functions.wpmdb_migration_type()&&(a=wpmdb_strings.find_replace_paused_before_finalize)):a=wpmdb_strings.paused,t.current_migration.setState(null,a,"paused"),e("body").on("click",".pause-resume",function(e){o.set_pause_resume_button(e,i)}),e("body").on("click",".cancel",function(e){o.cancel_migration(e)}),e(".pause-resume").html(wpmdb_strings.resume)}else if(!0===o.migration_cancelled){var s;o.migration_intent=t.functions.wpmdb_migration_type(),"savefile"===o.migration_intent?s=wpmdb_strings.removing_local_sql:"pull"===o.migration_intent?s="backup"===o.stage?wpmdb_strings.removing_local_backup:wpmdb_strings.removing_local_temp_tables:"push"===o.migration_intent&&(s="backup"===o.stage?wpmdb_strings.removing_remote_sql:wpmdb_strings.removing_remote_temp_tables),t.current_migration.setText(s);var r={action:"wpmdb_cancel_migration",migration_state_id:t.migration_state_id,nonce:wpmdb_data.nonces.cancel_migration};o.doing_ajax=!0,e.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:r,error:function(e,i,n){t.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(i),console.log(n),o.doing_ajax=!1,t.common.migration_error=!0,t.functions.migration_complete_events()},success:function(i){if(o.doing_ajax=!1,i=e.trim(i),"push"===o.migration_intent&&"1"!==i||"push"!==o.migration_intent&&""!==i)return void 0!==i&&void 0!==i.wpmdb_error&&1===i.wpmdb_error&&(i=i.wpmdb_error),t.current_migration.setState(wpmdb_strings.migration_cancellation_failed,i,"error"),t.common.migration_error=!0,void t.functions.migration_complete_events();o.completed_msg=wpmdb_strings.migration_cancelled,"find_replace"===o.migration_intent&&(o.completed_msg=wpmdb_strings.find_replace_cancelled),t.functions.migration_complete_events(),t.current_migration.setStatus("cancelled")}})}else n&&t.common.next_step_in_migration.fn.apply(i,t.common.next_step_in_migration.args)},t.functions.maybe_show_prefix_notice=function(t){var i=e(".prefix-notice");i.hide(),t!==wpmdb_data.this_prefix&&(e(".remote-prefix").html(t),o.show_prefix_notice=!0,i.show())},t.functions.maybe_show_mst_warning=function(i){var n=t.functions.wpmdb_migration_type(),a=!1;return-1!==e.inArray(n,["push","pull"])&&void 0!==i.site_details?wpmdb_data.site_details.is_multisite!==i.site_details.is_multisite&&(void 0!==t.mst&&void 0!==i.mst_available&&"1"===i.mst_available||(a=!0)):"import"===n&&void 0!==i.multisite&&void 0!==i.subsite_export&&("false"===wpmdb_data.site_details.is_multisite&&"true"===i.multisite&&"true"!==i.subsite_export||"true"===wpmdb_data.site_details.is_multisite&&"false"===i.multisite)&&(a=!0),(a=e.wpmdb.apply_filters("wpmdb_show_mst_warning",a))&&e(".mst-required").show(),a},t.functions.maybe_show_select_table_notice=function(){if(e("#migrate-selected").is(":checked")&&null===e("#select-tables").val()){if("import"!==t.functions.wpmdb_migration_type())return alert(wpmdb_strings.please_select_one_table),!0;if(e("#import-find-replace").is(":checked")&&e("#select-tables").is(":visible"))return alert(wpmdb_strings.please_select_one_table_import),!0}return!("savefile"===t.functions.wpmdb_migration_type()||!e("#backup-manual-select").is(":checked")||null!==e("#select-backup").val())&&(alert(wpmdb_strings.please_select_one_table_backup),!0)},t.functions.remove_protocol=function(e){return e.replace(/^https?:/i,"")},t.functions.create_table_select=function(t,i,n){var a=document.createElement("select");return e(a).attr({multiple:"multiple",name:"select_tables[]",id:"select-tables",class:"multiselect"}),0<t.length&&e.each(t,function(t,o){if(!e.wpmdb.apply_filters("wpmdb_exclude_table",!1,o)){var s=" ";void 0!==n&&null!==n&&0<n.length&&-1!==e.inArray(o,n)&&(s=' selected="selected" ');var r="";0!==i.length&&(r=" ("+i[o]+")"),e(a).append("<option"+s+'value="'+o+'">'+o+r+"</option>")}}),a},t.functions.get_tables_to_migrate=function(){var i=[],n=t.functions.wpmdb_migration_type();return"migrate_select"===e("input[name=table_migrate_option]:checked").val()?i=e("#select-tables").val():"pull"!==n&&void 0!==wpmdb_data.this_prefixed_tables?i=wpmdb_data.this_prefixed_tables:"pull"===n&&void 0!==t.common.connection_data&&void 0!==t.common.connection_data.prefixed_tables&&(i=t.common.connection_data.prefixed_tables),i},t.functions.update_migrate_button_text=function(){var i=t.functions.wpmdb_migration_type(),n=e("#save-migration-profile").is(":checked")?"_save":"",a="migrate_button_"+("savefile"===i?"export":i)+n;e(".migrate-db .button-primary").val(wpmdb_strings[a])},t.functions.connection_box_changed=function(){var i=e(".pull-push-connection-info");if(-1!==e.inArray(t.functions.wpmdb_migration_type(),["push","pull"])&&(!o.doing_ajax&&!e(i).hasClass("temp-disabled")||!1!==t.force_reconnect)){t.force_reconnect=!1;var n=e(".pull-push-connection-info").val(),a=e.trim(n).split("\n"),s=!1,r="";if(""===a&&(s=!0,r=wpmdb_strings.connection_info_missing),1===a.length&&!s){var l=e.trim(n).split(" ");2===l.length&&(a=l)}2===a.length||s||(s=!0,r=wpmdb_strings.connection_info_incorrect),s||o.validate_url(a[0])||(s=!0,r=wpmdb_strings.connection_info_url_invalid);var c=0;if(void 0!==a[1]&&(c=a[1].length),s||32===c||40===c||(s=!0,r=wpmdb_strings.connection_info_key_invalid),s||a[0]!==wpmdb_data.connection_info[0]||(s=!0,r=wpmdb_strings.connection_info_local_url),s||a[1]!==wpmdb_data.connection_info[1]||(s=!0,r=wpmdb_strings.connection_info_local_key),s)return e(".connection-status").html(r),void e(".connection-status").addClass("notification-message error-notice migration-error");var p=a[0]+"\n"+a[1];1===e.trim(n).split("\n").length&&e(".pull-push-connection-info").val(p),!1===wpmdb_data.openssl_available&&(a[0]=a[0].replace("https://","http://"),p=a[0]+"\n"+a[1],e(".pull-push-connection-info").val(p)),o.show_prefix_notice=!1,o.doing_ajax=!0,o.disable_export_type_controls(),e(".basic-access-auth-wrapper").is(":visible")&&(a[0]=a[0].replace(/\/\/(.*)@/,"//"),a[0]=a[0].replace("//","//"+encodeURIComponent(e.trim(e(".auth-username").val()))+":"+encodeURIComponent(e.trim(e(".auth-password").val()))+"@"),p=a[0]+"\n"+a[1],e(".pull-push-connection-info").val(p),e(".basic-access-auth-wrapper").hide()),e(".step-two").hide(),e(".ssl-notice").hide(),e(".prefix-notice").hide(),e(".connection-status").show(),e(".connection-status").html(wpmdb_strings.establishing_remote_connection),e(".connection-status").removeClass("notification-message error-notice migration-error"),e(".connection-status").append(o.ajax_spinner);var m=t.functions.wpmdb_migration_type();return o.profile_name_edited=!1,e.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_verify_connection_to_remote_site",url:a[0],key:a[1],intent:m,nonce:wpmdb_data.nonces.verify_connection_to_remote_site},error:function(t,i,n){e(".connection-status").html(o.get_ajax_errors(t.responseText,"(#100)",t)),e(".connection-status").addClass("notification-message error-notice migration-error"),e(".ajax-spinner").remove(),o.doing_ajax=!1,o.enable_export_type_controls()},success:function(i){if(e(".ajax-spinner").remove(),o.doing_ajax=!1,o.enable_export_type_controls(),void 0!==i.wpmdb_error&&1===i.wpmdb_error)return e(".connection-status").html(i.body),e(".connection-status").addClass("notification-message error-notice migration-error"),i.body.indexOf("401 Unauthorized")>-1&&e(".basic-access-auth-wrapper").show(),void(e(".pull-push-connection-info").hasClass("temp-disabled")||e(".connect-button").is(":visible")||(e(".pull-push-connection-info").removeAttr("readonly"),e(".connect-button").show()));if(!0!==t.functions.maybe_show_mst_warning(i)){o.maybe_show_ssl_warning(a[0],a[1],i.scheme);var n=o.get_domain_name(i.url);e(".create-new-profile").val(n),e(".pull-push-connection-info").addClass("temp-disabled"),e(".pull-push-connection-info").attr("readonly","readonly"),e(".connect-button").hide(),e(".connection-status").hide(),e(".step-two").show(),t.functions.maybe_show_prefix_notice(i.prefix),o.connection_established=!0,o.set_connection_data(i),o.move_connection_info_box(),o.change_replace_values(),o.maybe_show_mixed_cased_table_name_warning(),o.refresh_table_selects(null,null,this),o.$push_select_backup=e(o.$pull_select).clone(),e(o.$push_select_backup).attr({name:"select_backup[]",id:"select-backup"});var s=document.createElement("select");e(s).attr({multiple:"multiple",name:"select_post_types[]",id:"select-post-types",class:"multiselect"}),e.each(t.common.connection_data.post_types,function(t,i){e(s).append('<option value="'+i+'">'+i+"</option>")}),o.$pull_post_type_select=s,e("#new-path-missing-warning, #new-url-missing-warning").hide(),"pull"===t.functions.wpmdb_migration_type()?(e("#new-url").val(t.functions.remove_protocol(wpmdb_data.this_url)),e("#new-path").val(wpmdb_data.this_path),"true"===wpmdb_data.is_multisite&&(e("#new-domain").val(wpmdb_data.this_domain),e('.replace-row.pin .old-replace-col input[type="text"]').val(t.functions.remove_protocol(i.url))),e("#old-url").val(t.functions.remove_protocol(i.url)),e("#old-path").val(i.path),e.wpmdb.do_action("wpmdb_update_pull_table_select"),e("#select-post-types").remove(),e(".exclude-post-types-warning").after(o.$pull_post_type_select),t.functions.exclude_post_types_warning(),e(".table-prefix").html(i.prefix),e(".backup-table-prefix").html(wpmdb_data.site_details.prefix),e(".uploads-dir").html(wpmdb_data.this_uploads_dir)):(e("#new-url").val(t.functions.remove_protocol(i.url)),e("#new-path").val(i.path),"true"===wpmdb_data.is_multisite&&e('.replace-row.pin .old-replace-col input[type="text"]').val(t.functions.remove_protocol(wpmdb_data.this_url)),e.wpmdb.do_action("wpmdb_update_push_table_select"),e("#select-backup").remove(),e(".backup-tables-wrap").prepend(o.$push_select_backup)),t.common.next_step_in_migration={fn:e.wpmdb.do_action,args:["verify_connection_to_remote_site",t.common.connection_data]},t.functions.execute_next_step()}else e(".connection-status").hide()}})}},e(document).ready(function(){t.migration_state_id="",e("#plugin-compatibility").change(function(t){var i="1",n=e(this).closest("td").next("td").find(".setting-status");e(this).is(":checked")||(i="0"),e(".plugin-compatibility-wrap").toggle(),n.find(".ajax-success-msg").remove(),n.append(o.ajax_spinner),e("#plugin-compatibility").attr("disabled","disabled"),e(".plugin-compatibility").addClass("disabled"),e.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_plugin_compatibility",install:i,nonce:wpmdb_data.nonces.plugin_compatibility},error:function(t,i,n){alert(wpmdb_strings.plugin_compatibility_settings_problem+"\r\n\r\n"+wpmdb_strings.status+" "+t.status+" "+t.statusText+"\r\n\r\n"+wpmdb_strings.response+"\r\n"+t.responseText),e(".ajax-spinner").remove(),e("#plugin-compatibility").removeAttr("disabled"),e(".plugin-compatibility").removeClass("disabled")},success:function(t){""!==e.trim(t)?alert(t):(n.append('<span class="ajax-success-msg">'+wpmdb_strings.saved+"</span>"),e(".ajax-success-msg").fadeOut(2e3,function(){e(this).remove()})),e(".ajax-spinner").remove(),e("#plugin-compatibility").removeAttr("disabled"),e(".plugin-compatibility").removeClass("disabled")}})}),e("#plugin-compatibility").is(":checked")&&e(".plugin-compatibility-wrap").show(),(0<=navigator.userAgent.indexOf("MSIE")||0<=navigator.userAgent.indexOf("Trident"))&&e(".ie-warning").show(),0<=navigator.userAgent.indexOf("Edge")&&e(".edge-warning").show(),0===wpmdb_data.valid_licence&&e("#savefile").prop("checked",!0);var i=e(".max-request-size"),n=e(".slider",i);n.slider({range:"min",value:parseInt(wpmdb_data.max_request/1024),min:512,max:parseInt(wpmdb_data.bottleneck/1024),step:256,create:function(e,t){var n=o.get_max_request_display_info(wpmdb_data.max_request/1024);o.set_slider_value(i,wpmdb_data.max_request/1024,n.unit,n.amount)},slide:function(e,t){var n=o.get_max_request_display_info(t.value);o.set_slider_value(i,t.value,n.unit,n.amount)},stop:function(t,a){e(".slider-success-msg").remove(),e(".amount",i).after('<img src="'+o.spinner_url+'" alt="" class="slider-spinner general-spinner" />'),n.slider("disable"),e.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(t,a,s){n.slider("enable"),e(".slider-spinner",i).remove(),alert(wpmdb_strings.max_request_size_problem);var r=o.get_max_request_display_info(wpmdb_data.max_request/1024);o.set_slider_value(i,wpmdb_data.max_request/1024,r.unit,r.amount),n.slider("enable")},success:function(){n.slider("enable"),e(".slider-label-wrapper",i).append('<span class="slider-success-msg">'+wpmdb_strings.saved+"</span>"),e(".slider-success-msg",i).fadeOut(2e3,function(){e(this).remove()}),e(".slider-spinner",i).remove()}})}});var a=e(".delay-between-requests"),s=e(".slider",a);s.slider({range:"min",value:parseInt(wpmdb_data.delay_between_requests/1e3),min:0,max:10,step:1,create:function(e,t){o.set_slider_value(a,wpmdb_data.delay_between_requests/1e3,"s")},slide:function(e,t){o.set_slider_value(a,t.value,"s")},stop:function(t,i){e(".slider-success-msg").remove(),e(".amount",a).after('<img src="'+o.spinner_url+'" alt="" class="slider-spinner general-spinner" />'),s.slider("disable"),e.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(t,i,n){s.slider("enable"),e(".slider-spinner",a).remove(),alert(wpmdb_strings.delay_between_requests_problem),o.set_slider_value(a,wpmdb_data.delay_between_requests/1e3,"s"),s.slider("enable")},success:function(){wpmdb_data.delay_between_requests=parseInt(1e3*i.value),s.slider("enable"),e(".slider-label-wrapper",a).append('<span class="slider-success-msg">'+wpmdb_strings.saved+"</span>"),e(".slider-success-msg",a).fadeOut(2e3,function(){e(this).remove()}),e(".slider-spinner",a).remove()}})}}),e(".help-tab .video").each(function(){var t=e(this),i=e(".video-viewer");e("a",this).click(function(n){n.preventDefault(),i.attr("src","//www.youtube.com/embed/"+t.data("video-id")+"?autoplay=1"),i.show();var a=i.offset();e(window).scrollTop(a.top-50)})}),e(".backup-options").show(),e(".keep-active-plugins").show(),"savefile"===t.functions.wpmdb_migration_type()&&(e(".backup-options").hide(),e(".keep-active-plugins").hide()),o.last_replace_switch=t.functions.wpmdb_migration_type(),e(".content-tab").on("click",".check-my-licence-again",function(t){t.preventDefault(),o.checked_licence=!1,e(t.target).replaceWith("Checking... "+o.ajax_spinner),o.check_licence(null,"all")}),e.wpmdb.add_action("wpmdb_refresh_table_selects",o.refresh_table_selects,"",o),e.wpmdb.add_action("wpmdb_update_push_table_select",function(){e("#select-tables").remove(),e(".select-tables-wrap").prepend(o.$push_select),e("#select-tables").change()}),e.wpmdb.add_action("wpmdb_update_pull_table_select",function(){e("#select-tables").remove(),e(".select-tables-wrap").prepend(o.$pull_select),e("#select-tables").change()}),e.wpmdb.add_action("wpmdb_disable_table_migration_options",function(){e("#migrate-selected").parents(".option-section").children(".header-expand-collapse").children(".expand-collapse-arrow").removeClass("collapsed"),e(".table-select-wrap").show(),e("#migrate-only-with-prefix").prop("checked",!1),e("#migrate-selected").prop("checked",!0),e(".table-migrate-options").hide(),e(".select-tables-wrap").show()}),e.wpmdb.add_action("wpmdb_enable_table_migration_options",function(){e(".table-migrate-options").show()}),e.wpmdb.add_action("wpmdb_select_all_tables",function(){e("#select-tables").children("option").prop("selected",!0),e("#select-tables").change()}),e.wpmdb.add_filter("wpmdb_base_old_url",function(e,t){return o.remove_protocol(wpmdb_data.this_url)}),o.establish_remote_connection_from_saved_profile(),e("body").on("click",".js-action-link",function(t){t.preventDefault(),e(this).blur()}),e(".licence-input").keypress(function(t){13===t.which&&(t.preventDefault(),e(".register-licence").click())}),e("body").on("click",".register-licence",function(t){if(t.preventDefault(),!o.doing_licence_registration_ajax){var i=e.trim(e(".licence-input").val()),n=e(".licence-status");n.removeClass("notification-message error-notice success-notice"),""!==i?(n.empty().removeClass("success"),o.doing_licence_registration_ajax=!0,e(".button.register-licence").after('<img src="'+o.spinner_url+'" alt="" class="register-licence-ajax-spinner general-spinner" />'),e.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(t,i,a){o.doing_licence_registration_ajax=!1,e(".register-licence-ajax-spinner").remove(),n.html(wpmdb_strings.register_license_problem)},success:function(t){if(e(".register-licence-ajax-spinner").remove(),void 0!==t.errors){var a="";for(var s in t.errors)a+=t.errors[s];n.html(a),void 0!==t.masked_licence&&(o.enable_pro_licence(t,i),e(".migrate-tab .invalid-licence").hide())}else void 0!==t.wpmdb_error&&void 0!==t.body?n.html(t.body):(1===Number(t.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(){e(this).css({visibility:"hidden",display:"block"}).slideUp()}),n.addClass("success notification-message success-notice"),o.enable_pro_licence(t,i),e(".invalid-licence").hide());o.doing_licence_registration_ajax=!1}})):n.html('<div class="notification-message error-notice">'+wpmdb_strings.enter_license_key+"</div>")}}),e(".clear-log").click(function(){e(".ajax-spinner, .ajax-success-msg").remove(),e(this).after(o.ajax_spinner),e(".debug-log-textarea").val(""),e.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_clear_log",nonce:wpmdb_data.nonces.clear_log},error:function(t,i,n){e(".ajax-spinner").remove(),alert(wpmdb_strings.clear_log_problem)},success:function(t){e(".ajax-spinner, .ajax-success-msg").remove(),o.refresh_debug_log(),e(".clear-log").after('<span class="ajax-success-msg">'+wpmdb_strings.clear_error_log+"</span>"),e(".ajax-success-msg").fadeOut(2e3,function(){e(this).remove()})}})}),e(".multiselect-select-all").click(function(){var t=e(this).parents(".select-wrap").children(".multiselect");e("option",t).prop("selected",1),e(t).focus().trigger("change")}),e(".multiselect-deselect-all").click(function(){var t=e(this).parents(".select-wrap").children(".multiselect");e("option",t).removeAttr("selected"),e(t).focus().trigger("change")}),e(".multiselect-invert-selection").click(function(){var t=e(this).parents(".select-wrap").children(".multiselect");e("option",t).each(function(){e(this).attr("selected",!e(this).attr("selected"))}),e(t).focus().trigger("change")}),e(".option-group input[type=radio]").change(function(){var t=e(this).closest(".option-group");e("ul",t).hide();var i=e(this).closest("li");e("ul",i).show()}),e(".option-group").each(function(){e(".option-group input[type=radio]").each(function(){if(e(this).is(":checked")){var t=e(this).closest("li");e("ul",t).show()}})}),e(".header-expand-collapse").click(function(){var t=null;void 0!==e(this).data("next")&&(t=e(this).data("next")),e(".expand-collapse-arrow",this).hasClass("collapsed")?(e(".expand-collapse-arrow",this).removeClass("collapsed"),t?e(t).show():e(this).next().show()):(e(".expand-collapse-arrow",this).addClass("collapsed"),t?e(t).hide():e(this).next().hide())}),e(".checkbox-label input[type=checkbox]").change(function(){e(this).is(":checked")?e(this).parent().next().show():e(this).parent().next().hide()}),e(".select-post-types-wrap").on("change","#select-post-types",function(){t.functions.exclude_post_types_warning()}),e("#exclude-post-types").is(":checked")&&e("#select-post-types").val()&&e(".exclude-post-types-warning").css({display:"block",opacity:1}),e("#save-migration-profile").change(function(){t.functions.update_migrate_button_text(),e(this).is(":checked")?e(".save-settings-button").show():e(".save-settings-button").hide()}),e("#save-migration-profile").is(":checked")&&e(".save-settings-button").show(),e(".create-new-profile").focus(function(){e("#create_new").prop("checked",!0)}),e(".checkbox-label input[type=checkbox]").each(function(){e(this).is(":checked")&&e(this).parent().next().show()}),e(".migrate-db-button").click(function(i){if(e(this).blur(),i.preventDefault(),t.migration_state_id="",!1!==e.wpmdb.apply_filters("wpmdb_migration_profile_ready",!0)&&!0!==t.functions.maybe_show_select_table_notice()){var n=!1,a=!1;if(e("#new-url").length&&!e("#new-url").val()&&(e("#new-url-missing-warning").show(),e("#new-url").focus(),e("html,body").scrollTop(0),n=!0),e("#new-path").length&&!e("#new-path").val()&&(e("#new-path-missing-warning").show(),!1===n&&(e("#new-path").focus(),e("html,body").scrollTop(0)),a=!0),!0===n||!0===a){if("import"!==t.functions.wpmdb_migration_type())return;if(e("#import-find-replace").is(":checked"))return}e("#save-migration-profile").is(":checked")&&o.save_active_profile(),o.form_data=e(e("#migrate-form")[0].elements).not(".auth-credentials").serialize(),o.migration_intent=t.functions.wpmdb_migration_type(),o.stage="backup","savefile"===o.migration_intent&&(o.stage="migrate"),!1===e("#create-backup").is(":checked")&&(-1!==e.inArray(o.migration_intent,["savefile","push","pull"])?o.stage="migrate":"import"===o.migration_intent?o.stage="upload":o.stage=o.migration_intent),t.current_migration=t.migration_progress_controller.newMigration({localTableSizes:wpmdb_data.this_table_sizes,localTableRows:wpmdb_data.this_table_rows,remoteTableSizes:void 0!==t.common.connection_data?t.common.connection_data.table_sizes:null,remoteTableRows:void 0!==t.common.connection_data?t.common.connection_data.table_rows:null,migrationIntent:t.functions.wpmdb_migration_type()});var s=e("input[name=backup_option]:checked").val(),r=e("input[name=table_migrate_option]:checked").val(),l="",c="";"backup"===o.stage&&("migrate_only_with_prefix"===r&&"backup_selected"===s&&"import"!==o.migration_intent&&(s="backup_only_with_prefix"),"push"===o.migration_intent?(c="remote","backup_only_with_prefix"===s?o.tables_to_migrate=t.common.connection_data.prefixed_tables:"backup_selected"===s?(l=e("#select-tables").val(),l=e.wpmdb.apply_filters("wpmdb_backup_selected_tables",l),o.tables_to_migrate=o.get_intersect(l,t.common.connection_data.tables)):"backup_manual_select"===s&&(o.tables_to_migrate=e("#select-backup").val())):(c="local","backup_only_with_prefix"===s?o.tables_to_migrate=wpmdb_data.this_prefixed_tables:"backup_selected"===s?(l=e("#select-tables").val(),l=e.wpmdb.apply_filters("wpmdb_backup_selected_tables",l),o.tables_to_migrate=o.get_intersect(l,wpmdb_data.this_tables)):"backup_manual_select"===s&&(o.tables_to_migrate=e("#select-backup").val())),t.current_migration.model.addStage("backup",o.tables_to_migrate,c,{strings:{migrated:wpmdb_strings.backed_up}})),c="pull"===o.migration_intent?"remote":"local","find_replace"===o.migration_intent?t.current_migration.model.addStage("find_replace",t.functions.get_tables_to_migrate(null,null),c,{strings:{migrated:wpmdb_strings.searched,stage_title:wpmdb_strings.migrate_button_find_replace}}):-1!==e.inArray(o.migration_intent,["savefile","push","pull"])&&t.current_migration.model.addStage("migrate",t.functions.get_tables_to_migrate(null,null),c),e.wpmdb.do_action("wpmdb_add_migration_stages",{data_type:c,tables_to_migrate:t.functions.get_tables_to_migrate(null,null)});e("input[name=table_migrate_option]:checked").val();var p=e.trim(e(".pull-push-connection-info").val()).split("\n");o.remote_site=p[0],o.secret_key=p[1];var m=o.get_migration_status_label(o.remote_site,o.migration_intent,"migrating");o.completed_msg=o.get_migration_status_label(o.remote_site,o.migration_intent,"completed"),-1!==e.inArray(o.stage,["find_replace","backup","migrate"])&&(o.tables_to_migrate=t.current_migration.model.getStageItems(o.stage,"name")),t.current_migration.model.setActiveStage(o.stage),t.current_migration.setTitle(m),t.current_migration.startTimer(),o.currently_migrating=!0,t.current_migration.setStatus("active");var d={action:"wpmdb_initiate_migration",intent:o.migration_intent,url:o.remote_site,key:o.secret_key,form_data:o.form_data,stage:o.stage,nonce:wpmdb_data.nonces.initiate_migration};d.site_details={local:wpmdb_data.site_details},-1!==e.inArray(o.migration_intent,["push","pull"])&&(d.temp_prefix=t.common.connection_data.temp_prefix,d.site_details.remote=t.common.connection_data.site_details),d.site_details=JSON.stringify(d.site_details),d=e.wpmdb.apply_filters("wpmdb_initiate_migration_request_data",d,d),o.doing_ajax=!0,e.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:d,error:function(e,i,n){t.current_migration.setState(wpmdb_strings.migration_failed,o.get_ajax_errors(e.responseText,"(#112)",e),"error"),console.log(e),console.log(i),console.log(n),o.doing_ajax=!1,t.common.migration_error=!0,t.functions.migration_complete_events()},success:function(i){if(o.doing_ajax=!1,void 0!==i&&void 0!==i.wpmdb_error&&1===i.wpmdb_error)return t.common.migration_error=!0,t.functions.migration_complete_events(),void t.current_migration.setState(wpmdb_strings.migration_failed,i.body,"error");t.migration_state_id=i.migration_state_id;o.delay_between_requests=0,("savefile"!==o.migration_intent&&void 0!==t.common.connection_data&&void 0!==t.common.connection_data.delay_between_requests||"import"===o.migration_intent)&&("import"===o.migration_intent?o.delay_between_requests=wpmdb_data.delay_between_requests:o.delay_between_requests=Math.max(parseInt(wpmdb_data.delay_between_requests),parseInt(t.common.connection_data.delay_between_requests))),-1!==e.inArray(o.migration_intent,["savefile","push","pull","find_replace"])&&(t.common.next_step_in_migration={fn:t.functions.migrate_table_recursive,args:["-1",""]},t.functions.execute_next_step()),e.wpmdb.do_action("wpmdb_migration_initiated",o.stage)}})}}),o.update_migrate_button_text(),e("body").on("click",".close-progress-content-button",function(e){o.hide_overlay(),t.current_migration.restoreTitleElem(),t.functions.maybe_reload_page()}),e("body").on("click","#overlay",function(e){!0===o.migration_completed&&e.target===this&&(o.hide_overlay(),t.current_migration.restoreTitleElem(),t.functions.maybe_reload_page())}),e(".save-settings-button").click(function(t){if(t.preventDefault(),""===e.trim(e(".create-new-profile").val())&&e("#create_new").is(":checked"))return alert(wpmdb_strings.enter_name_for_profile),void e(".create-new-profile").focus();o.save_active_profile()}),o.move_connection_info_box(),e(".migrate-selection.option-group input[type=radio]").change(function(){o.move_connection_info_box(),t.migration_selection=t.functions.wpmdb_migration_type(),o.connection_established&&o.change_replace_values(),t.functions.update_migrate_button_text()}),"pull"!==t.functions.wpmdb_migration_type()&&"push"!==t.functions.wpmdb_migration_type()||o.connection_established||(e(".step-two").hide(),e(".connection-status").show()),e(".general-helper").click(function(t){t.preventDefault();var i=e(this),n=e(this).next();e(".helper-message").not(n).hide();var a=i.position();if(n.hasClass("bottom")){var o=1;!0===n.hasClass("compatibility-help")?o=6:e(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(),t.stopPropagation()}),e("body").click(function(){e(".helper-message").hide()}),e(".helper-message").click(function(e){e.stopPropagation()}),e("body").on("click",".show-errors-toggle",function(t){t.preventDefault(),e(this).next(".migration-php-errors").toggle()}),e(".nav-tab").click(function(){var t=e(this).attr("data-div-name");t=t.replace("-tab",""),window.location.hash=t,o.switch_to_plugin_tab(t,!1)}),e("body").on("click",'a[href^="#"]',function(t){var i=e(t.target).attr("href").substr(1);if(i){var n=e("."+i);1===n.length&&(n.trigger("click"),t.preventDefault())}}),e("body").on("click",".add-row",function(){var t=e(this).parents("tr");t.before(e(".original-repeatable-field").clone().removeClass("original-repeatable-field")),t.prev().find(".old-replace-col input").focus()}),e("body").on("click",".replace-remove-row",function(){e(this).parents("tr").remove(),2>=e(".replace-row").length&&e(".no-replaces-message").show();var t=e(this).prev().attr("id");"new-url"!==t&&"new-path"!==t||e("#"+t+"-missing-warning").hide()}),e("body").on("change","#new-url",function(){e("#new-url-missing-warning").hide()}).on("change","#new-path",function(){e("#new-path-missing-warning").hide()}),e("body").on("click",".arrow-col",function(){if(!e(this).hasClass("disabled")){var t=e(this).prev("td").find("input").val(),i=e(this).next("td").find("input");i.val(t),"new-url"===i.prop("id")?e("#new-url-missing-warning").hide():"new-path"===i.prop("id")&&e("#new-path-missing-warning").hide()}}),e(".add-replace").click(function(){e(".replace-fields").prepend(e(".original-repeatable-field").clone().removeClass("original-repeatable-field")),e(".no-replaces-message").hide()}),e("#find-and-replace-sort tbody").sortable({items:"> tr:not(.pin)",handle:"td:first",start:function(){e(".sort-handle").css("cursor","-webkit-grabbing"),e(".sort-handle").css("cursor","-moz-grabbing")},stop:function(){e(".sort-handle").css("cursor","-webkit-grab"),e(".sort-handle").css("cursor","-moz-grab")}});var r="";window.location.hash&&(r=window.location.hash.substring(1),o.switch_to_plugin_tab(r,!1)),""!==o.get_query_var("install-plugin")&&(r="addons",o.checked_licence=!0,o.switch_to_plugin_tab(r,!0)),e(".notice-link").click(function(i){i.preventDefault(),t.functions.ajax_handle_dismissible_notice(wpmdb_data.nonces.process_notice_link,function(t){e(t).closest(".inline-message").hide()},e(this))}),e("#connection_info").on("copy",function(t){var i=e(this).val().split("\n");if(2===i.length)try{t.originalEvent.clipboardData.setData("text/plain",i.join(" ")),t.preventDefault()}catch(e){}}),e(".reset-api-key").click(function(){confirm(wpmdb_strings.reset_api_key)&&!o.doing_reset_api_key_ajax&&(o.doing_reset_api_key_ajax=!0,e(".reset-api-key").after('<img src="'+o.spinner_url+'" alt="" class="reset-api-key-ajax-spinner general-spinner" />'),e.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_reset_api_key",nonce:wpmdb_data.nonces.reset_api_key},error:function(t,i,n){alert(wpmdb_strings.reset_api_key_problem),e(".reset-api-key-ajax-spinner").remove(),o.doing_reset_api_key_ajax=!1},success:function(t){e(".reset-api-key-ajax-spinner").remove(),o.doing_reset_api_key_ajax=!1,e(".connection-info").html(t),wpmdb_data.connection_info=e.trim(t).split("\n")}}))}),e(".copy-api-key").click(function(){var t=e(this),i=e("#connection_info"),n=i.val(),a=n.replace("\n"," ");i.val(a),i.select();try{document.execCommand("copy"),i.blur(),t.css("color","transparent");var o=e(".copy-api-key-confirmation").show();setTimeout(function(){o.fadeOut("fast"),setTimeout(function(){t.css("color","")},200)},1e3)}catch(e){alert("please press Ctrl/Cmd+C to copy")}i.val(n)}),e("input[name=table_migrate_option]").change(function(){e(".select-tables-wrap").hide(),"migrate_select"===e(this).val()&&e(".select-tables-wrap").show()}),e(".show-multiselect").each(function(){e(this).is(":checked")&&(e(this).parents(".option-section").children(".header-expand-collapse").children(".expand-collapse-arrow").removeClass("collapsed"),e(this).parents(".expandable-content").show(),e(this).parents(".expandable-content").children(".select-wrap").toggle())}),e("input[name=backup_option]").change(function(){e(".backup-tables-wrap").hide(),"backup_manual_select"===e(this).val()&&e(".backup-tables-wrap").show()}),e("#backup-manual-select").is(":checked")&&e(".backup-tables-wrap").show(),e(".plugin-compatibility-save").click(function(){if(!o.doing_plugin_compatibility_ajax){e(this).addClass("disabled");var t=e("#selected-plugins");e(t).attr("disabled","disabled"),e(".plugin-compatibility-success-msg").remove(),o.doing_plugin_compatibility_ajax=!0,e(this).after('<img src="'+o.spinner_url+'" alt="" class="plugin-compatibility-spinner general-spinner" />'),e.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_whitelist_plugins",whitelist_plugins:e(t).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),e(t).removeAttr("disabled"),e(".plugin-compatibility-save").removeClass("disabled"),o.doing_plugin_compatibility_ajax=!1,e(".plugin-compatibility-spinner").remove()},success:function(i){""!==e.trim(i)&&alert(i),e(t).removeAttr("disabled"),e(".plugin-compatibility-save").removeClass("disabled"),o.doing_plugin_compatibility_ajax=!1,e(".plugin-compatibility-spinner").remove(),e(".plugin-compatibility-save").after('<span class="plugin-compatibility-success-msg">'+wpmdb_strings.saved+"</span>"),e(".plugin-compatibility-success-msg").fadeOut(2e3)}})}}),e("body").on("click",".delete-profile",function(){var t=e(this).next().clone();if(e("input",t).remove(),t=e.trim(e(t).html()),confirm(wpmdb_strings.remove_profile.replace("{{profile}}",t))){var i=e(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(),e("#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),e.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_delete_migration_profile",profile_id:e(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)}})}}),e(".main-list-delete-profile-link").click(function(){var t=e(this).prev().html();confirm(wpmdb_strings.remove_profile.replace("{{profile}}",t))&&(e(this).parent().fadeOut(500),e.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_delete_migration_profile",profile_id:e(this).attr("data-profile-id"),nonce:wpmdb_data.nonces.delete_migration_profile},error:function(e,t,i){alert(wpmdb_strings.remove_profile_problem)}}))}),e("body").on("click",".temp-disabled",function(){confirm(wpmdb_strings.change_connection_info)&&(e(".ssl-notice").hide(),e(".different-plugin-version-notice").hide(),e(".migrate-db-button").show(),e(".temp-disabled").removeAttr("readonly"),e(".temp-disabled").removeClass("temp-disabled"),e(".connect-button").show(),e(".step-two").hide(),e(".connection-status").show().html(wpmdb_strings.enter_connection_info),o.connection_established=!1)}),e(".settings-tab input[type=checkbox]").change(function(){if("plugin-compatibility"!==e(this).attr("id")){var t=e(this).is(":checked"),i=e(this).attr("id"),n=e(this).closest("td").next("td").find(".setting-status");e(".ajax-success-msg").remove(),n.after(o.ajax_spinner),e.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_setting",checked:t,setting:i,nonce:wpmdb_data.nonces.save_setting},error:function(t,i,n){alert(wpmdb_strings.save_settings_problem),e(".ajax-spinner").remove()},success:function(t){e(".ajax-spinner").remove(),n.append('<span class="ajax-success-msg">'+wpmdb_strings.saved+"</span>"),e(".ajax-success-msg").fadeOut(2e3,function(){e(this).remove()})}})}}),e(".migrate-form").submit(function(e){e.preventDefault()}),e(".connect-button").click(function(i){i.preventDefault(),e(this).blur(),t.functions.connection_box_changed()}),e(".pull-push-connection-info").bind("paste",function(e){setTimeout(function(){t.functions.connection_box_changed()},0)}),e("body").on("click",".try-again",function(){e(".pull-push-connection-info").removeClass("temp-disabled"),t.functions.connection_box_changed()}),e("body").on("click",".try-http",function(){var i=e.trim(e(".pull-push-connection-info").val()).split("\n"),n=i[0].replace("https","http")+"\n"+i[1];e(".pull-push-connection-info").val(n),t.functions.connection_box_changed()}),e(".create-new-profile").change(function(){o.profile_name_edited=!0}),e("body").on("click",".temporarily-disable-ssl",function(){var t="";window.location.hash&&(t=window.location.hash.substring(1)),e(this).attr("href",e(this).attr("href")+"&hash="+t)}),e("body").on("click",".pause-resume",function(e){o.set_pause_resume_button(e)}),e("body").on("click",".cancel",function(e){o.cancel_migration(e)}),e(".enter-licence").click(function(){e(".settings").click(),e(".licence-input").focus()}),e("body").on("click",".copy-licence-to-remote-site",function(){e(".connection-status").html(wpmdb_strings.copying_license),e(".connection-status").removeClass("notification-message error-notice migration-error"),e(".connection-status").append(o.ajax_spinner);var i=e.trim(e(".pull-push-connection-info").val()).split("\n");o.doing_ajax=!0,o.disable_export_type_controls(),e.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_copy_licence_to_remote_site",url:i[0],key:i[1],nonce:wpmdb_data.nonces.copy_licence_to_remote_site},error:function(t,i,n){e(".connection-status").html(o.get_ajax_errors(t.responseText,"(#143)",t)),e(".connection-status").addClass("notification-message error-notice migration-error"),e(".ajax-spinner").remove(),o.doing_ajax=!1,o.enable_export_type_controls()},success:function(i){if(e(".ajax-spinner").remove(),o.doing_ajax=!1,o.enable_export_type_controls(),void 0!==i.wpmdb_error&&1===i.wpmdb_error)return e(".connection-status").html(i.body),e(".connection-status").addClass("notification-message error-notice migration-error"),void(i.body.indexOf("401 Unauthorized")>-1&&e(".basic-access-auth-wrapper").show());t.functions.connection_box_changed()}})}),e("body").on("click",".reactivate-licence",function(t){o.doing_ajax=!0,e(".invalid-licence").empty().html(wpmdb_strings.attempting_to_activate_licence),e(".invalid-licence").append(o.ajax_spinner),e.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_reactivate_licence",nonce:wpmdb_data.nonces.reactivate_licence},error:function(t,i,n){e(".invalid-licence").html(wpmdb_strings.activate_licence_problem),e(".invalid-licence").append("<br /><br />"+wpmdb_strings.status+": "+t.status+" "+t.statusText+"<br /><br />"+wpmdb_strings.response+"<br />"+t.responseText),e(".ajax-spinner").remove(),o.doing_ajax=!1},success:function(t){if(e(".ajax-spinner").remove(),o.doing_ajax=!1,void 0===t.wpmdb_error||1!==t.wpmdb_error){if(void 0!==t.wpmdb_dbrains_api_down&&1===t.wpmdb_dbrains_api_down)return e(".invalid-licence").html(wpmdb_strings.temporarily_activated_licence),void e(".invalid-licence").append(t.body);e(".invalid-licence").empty().html(wpmdb_strings.licence_reactivated),location.reload()}else e(".invalid-licence").html(t.body)}})}),e("input[name=table_migrate_option]").change(function(){o.maybe_show_mixed_cased_table_name_warning(),e.wpmdb.do_action("wpmdb_tables_to_migrate_changed")}),e("body").on("change","#select-tables",function(){o.maybe_show_mixed_cased_table_name_warning(),e.wpmdb.do_action("wpmdb_tables_to_migrate_changed")}),e.wpmdb.add_filter("wpmdb_get_table_prefix",o.get_table_prefix),e.wpmdb.add_filter("wpmdb_get_tables_to_migrate",t.functions.get_tables_to_migrate),e.wpmdb.add_action("wpmdb_lock_replace_url",o.lock_replace_url),e.wpmdb.add_action("wpmdb_pin_replace_url",o.pin_replace_url),e.wpmdb.add_action("move_connection_info_box",t.functions.exclude_post_types_warning),e.wpmdb.add_filter("wpmdb_before_migration_complete_hooks",function(t){return o.pause_before_finalize=!!e("input[name=pause_before_finalize]:checked").length,!0===o.pause_before_finalize&&"savefile"!==o.migration_intent&&(o.set_pause_resume_button(null),window.is_auto_pause_before_finalize=!0),t}),e(".wpmdb-switch").on("click",function(t){e(this).hasClass("disabled")||o.set_checkbox(e(this).attr("id"))}),e("#beta_optin-wrap").on("click",function(t){e(this).find("span.on").hasClass("checked")||wpmdb_data.is_beta_plugins_installed&&confirm(wpmdb_strings.rollback_beta_to_stable)&&(window.location=wpmdb_data.rollback_to_stable_url)})})}(jQuery,s)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});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=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();var o=window.jQuery,s=window.ajaxurl,r=window.wpmdb_strings,l=window.wpmdb_data,c=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.show_ssl_notice=!1,this.doing_save_profile=!1,this.doing_ajax=!1,this.profile_name_edited=!1,this.migration_intent=null,this.doing_licence_registration_ajax=!1,this.migration_paused=!1,this.last_replace_switch=wpmdb.functions.wpmdb_migration_type(),this.connection_established=!1,this.profile_name_edited=!1,this.checked_licence=!1,this.show_prefix_notice=!1,this.show_ssl_notice=!1,this.force_reconnect=!1,this.migration_selection="",this.show_version_notice=!1,this.migration_completed=!1,this.currently_migrating=!1,this.dump_filename="",this.dump_path="",this.migration_intent="",this.remote_site=null,this.secret_key=null,this.form_data=null,this.stage=null,this.elapsed_interval=null,this.completed_msg=null,this.tables_to_migrate=[],this.migration_paused=!1,this.previous_progress_title="",this.previous_progress_text_primary="",this.previous_progress_text_secondary="",this.cancelling_text="",this.paused_text="",this.migration_cancelled=!1,this.flag_skip_delay=!1,this.delay_between_requests=0,this.fade_duration=400,this.pause_before_finalize=!1,this.is_auto_pause_before_finalize=!1,this.$connection_info_box=o(".connection-info-wrapper"),this.$push_select=window.wpmdb.$push_select=o("#select-tables").clone(),this.$pull_select=window.wpmdb.$pull_select=o("#select-tables").clone(),this.$push_post_type_select=o("#select-post-types").clone(),this.$pull_post_type_select=o("#select-post-types").clone(),this.$push_select_backup=o("#select-backup").clone(),this.$pull_select_backup=o("#select-backup").clone(),this.spinner_url=window.spinner_url=wpmdb.functions.get_spinner_url(),this.ajax_spinner=window.ajax_spinner='<img src="'+this.spinner_url+'" alt="" class="ajax-spinner general-spinner" />'}return a(e,[{key:"pad",value:function(e,t,i){return i=i||"0",(e+="").length>=t?e:new Array(t-e.length+1).join(i)+e}},{key:"is_int",value:function(e){return"number"==typeof(e=parseInt(e))&&0==e%1}},{key:"get_intersect",value:function(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}},{key:"pin_replace_url",value:function(e){!0===e&&1>o(".replace-row.pin").length&&1===o("#old-url").length&&o("#old-url").parents(".replace-row").addClass("pin"),!1===e&&0<o(".replace-row.pin").length&&o(".replace-row.pin").removeClass("pin")}},{key:"get_ajax_errors",value:function(e,t,i){return wpmdb.functions.wpmdbGetAjaxErrors(r.connection_local_server_problem,t,e,i)}},{key:"refresh_debug_log",value:function(){o.ajax({url:s,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_get_log",nonce:l.nonces.get_log},error:function(e,t,i){alert(r.update_log_problem)},success:function(e){o(".debug-log-textarea").val(e)}})}},{key:"get_query_var",value:function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))}},{key:"maybe_show_ssl_warning",value:function(e,t,i){var n=e.substr(0,e.indexOf(":")),a=o(".ssl-notice");if(this.show_ssl_notice||a.hide(),i!==n&&-1!==e.indexOf("https"))return a.show(),this.show_ssl_notice=!0,e=e.replace("https","http"),void o(".pull-push-connection-info").val(e+"\n"+t);this.show_ssl_notice=!1}},{key:"validate_url",value:function(e){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(e)}},{key:"refresh_table_selects",value:function(){void 0!==l&&void 0!==l.this_tables&&void 0!==l.this_table_sizes_hr&&(this.$push_select=this.create_table_select(l.this_tables,l.this_table_sizes_hr,o(wpmdb.$push_select).val())),void 0!==wpmdb.common.connection_data&&void 0!==wpmdb.common.connection_data.tables&&void 0!==wpmdb.common.connection_data.table_sizes_hr&&(this.$pull_select=this.create_table_select(wpmdb.common.connection_data.tables,wpmdb.common.connection_data.table_sizes_hr,o(wpmdb.$pull_select).val()))}},{key:"save_active_profile",value:function(){var e,t=this;if(o(".save-settings-button").blur(),!this.doing_save_profile&&!0!==this.maybe_show_select_table_notice()){var i=!1;o("#create_new").is(":checked")&&(i=!0);var n=o(".create-new-profile").val();this.doing_save_profile=!0,e=o(o("#migrate-form")[0].elements).not(".auth-credentials").serialize(),o(".save-settings-button").attr("disabled","disabled").after('<img src="'+this.spinner_url+'" alt="" class="save-profile-ajax-spinner general-spinner" />'),this.doing_ajax=!0,o.ajax({url:s,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_profile",profile:e,nonce:l.nonces.save_profile},error:function(e,i,n){t.doing_ajax=!1,alert(r.save_profile_problem),o(".save-settings-button").removeAttr("disabled"),o(".save-profile-ajax-spinner").remove(),o(".save-settings-button").after('<span class="ajax-success-msg">'+r.saved+"</span>"),o(".ajax-success-msg").fadeOut(2e3,function(){o(this).remove()}),t.doing_save_profile=!1},success:function(e){var a=parseInt(o("#migrate-form input[name=save_migration_profile_option]:checked").val(),10)+1;if(t.doing_ajax=!1,o(".save-settings-button").removeAttr("disabled"),o(".save-profile-ajax-spinner").remove(),o(".save-settings-button").after('<span class="ajax-success-msg">'+r.saved+"</span>"),o(".ajax-success-msg").fadeOut(2e3,function(){o(this).remove()}),t.doing_save_profile=!1,o(".create-new-profile").val(""),i){var s=parseInt(e,10),c=s+1,p=o('<li><span class="delete-profile" data-profile-id="'+c+'"></span><label for="profile-'+c+'"><input id="profile-'+c+'" value="'+s+'" name="save_migration_profile_option" type="radio"></label></li>');p.find("label").append(document.createTextNode(" "+n)),a=c,o("#create_new").parents("li").before(p),o("#profile-"+c).attr("checked","checked")}var m=window.location.href.replace("#migrate","").replace(/&wpmdb-profile=-?\d+/,"")+"&wpmdb-profile="+a,d=o("#migrate-form input[name=save_migration_profile_option]:checked").parent().text().trim();if("function"==typeof window.history.pushState){if(o("#migrate-form .crumbs").length)o("#migrate-form .crumbs .crumb:last").text(d);else{var _=o('<div class="crumbs" />').append('<a class="crumb" href="'+l.this_plugin_base+'"> Saved Profiles </a>').append('<span class="crumb">'+d+"</span>");o("#migrate-form").prepend(_)}window.history.pushState({updated_profile_id:a},null,m)}}})}}},{key:"cancel_migration",value:function(e){this.migration_cancelled=!0,this.cancelling_text=r.cancelling_migration,o(".migration-controls").css({visibility:"hidden"}),"find_replace"===this.migration_intent&&(this.cancelling_text=r.cancelling_find_replace),wpmdb.current_migration.setState(this.cancelling_text,r.completing_current_request,"cancelling"),!0===this.migration_paused&&(this.migration_paused=!1,wpmdb.functions.execute_next_step())}},{key:"set_checkbox",value:function(e){var t=o("#"+e),i=t.find("input[type=checkbox]");t.toggleClass("on").find("span").toggleClass("checked");var n=t.find("span.on").hasClass("checked");i.attr("checked",n).trigger("change")}},{key:"move_connection_info_box",value:function(){var e,t,i,n,a,s,r=o(".connection-status"),c=o(".directory-permission-notice"),p=o(".compatibility-older-mysql"),m=o(".mst-required"),d=o(".keep-active-plugins"),_=o(".step-two"),u=o(".backup-options"),g=wpmdb.functions.wpmdb_migration_type();if(r.hide(),c.hide(),_.show(),u.show(),d.show(),p.hide(),m.hide(),wpmdb.functions.wpmdb_toggle_migration_action_text(),o(".migrate-tab").attr("class","migrate-tab content-tab").addClass(wpmdb.functions.wpmdb_migration_type()),o.wpmdb.do_action("move_connection_info_box",{migration_type:g,last_migration_type:this.last_replace_switch}),-1!==o.inArray(g,["push","pull"])){var h=o(".pull-push-connection-info"),b=o.trim(h.val()).split("\n"),f=o("."+g+"-list li");if(f.append(this.$connection_info_box),this.$connection_info_box.show(function(){var e=o(this).find(".pull-push-connection-info");e.val()||e.focus()}),g!==this.last_replace_switch&&2===b.length)return wpmdb.force_reconnect=!0,f.append(this.$connection_info_box),h.removeClass("temp-disabled").attr("readonly","readonly"),o(".connect-button").hide(),void wpmdb.functions.connection_box_changed();this.connection_established?(r.hide(),_.show(),wpmdb.functions.wpmdb_toggle_migration_action_text(),"pull"===g?(t=wpmdb.common.connection_data.prefix,i=l.site_details.prefix,n=l.this_uploads_dir,a=l.this_upload_dir_long,s=l.write_permission):(t=l.this_prefix,i=wpmdb.common.connection_data.prefix,n=wpmdb.common.connection_data.uploads_dir,a=wpmdb.common.connection_data.upload_dir_long,s=wpmdb.common.connection_data.write_permissions),o(".table_prefix").html(t),o(".backup-table-prefix").html(i),o(".uploads-dir").html(n),this.maybe_show_backup_disabled_msg(a,s),!1===this.profile_name_edited&&(e=this.get_domain_name(wpmdb.common.connection_data.url),o(".create-new-profile").val(e))):(r.show(),_.hide())}else if(-1!==o.inArray(g,["find_replace","savefile"]))if(r.hide(),_.show(),o(".table-prefix").html(l.this_prefix),!1===this.profile_name_edited&&o(".create-new-profile").val(""),d.hide(),"savefile"===g)u.hide(),p.show(),"false"===l.write_permission&&(c.show(),_.hide());else{if("true"===l.is_multisite){var w=o(".old-replace-col").eq(1);w.parent().removeClass("pin").find(".replace-remove-row").show(),w.find("input").removeAttr("readonly")}this.maybe_show_backup_disabled_msg(l.this_upload_dir_long,l.write_permission)}this.maybe_show_mixed_cased_table_name_warning()}},{key:"maybe_show_backup_disabled_msg",value:function(e,t){var i=o("#create-backup"),n=o("#create-backup-label"),a=o(".backup-option-disabled");i.removeAttr("disabled"),n.removeClass("disabled"),a.hide(),"false"===t&&(i.prop("checked",!1),i.attr("disabled","disabled"),n.addClass("disabled"),a.show(),o(".upload-directory-location").html(e))}},{key:"change_replace_values",value:function(){var e=null,t=null;null!==wpmdb.common.previous_connection_data&&"object"===n(wpmdb.common.previous_connection_data)&&wpmdb.common.previous_connection_data.url!==wpmdb.common.connection_data.url&&(e=this.remove_protocol(wpmdb.common.previous_connection_data.url),t=wpmdb.common.previous_connection_data.path),"push"===wpmdb.functions.wpmdb_migration_type()||"savefile"===wpmdb.functions.wpmdb_migration_type()?("pull"===this.last_replace_switch?o(".replace-row").each(function(){var e=o(".old-replace-col input",this).val();o(".old-replace-col input",this).val(o(".replace-right-col input",this).val()),o(".replace-right-col input",this).val(e)}):"push"===this.last_replace_switch&&"push"===wpmdb.functions.wpmdb_migration_type()&&null!==e&&null!==t&&o(".replace-row").each(function(){var i=o(".replace-right-col input",this).val();i===t&&o(".replace-right-col input",this).val(wpmdb.common.connection_data.path),i===e&&o(".replace-right-col input",this).val(this.remove_protocol(wpmdb.common.connection_data.url))}),o.wpmdb.do_action("wpmdb_update_push_table_select"),o("#select-post-types").remove(),o(".exclude-post-types-warning").after(this.$push_post_type_select),wpmdb.functions.exclude_post_types_warning(),o("#select-backup").remove(),o(".backup-tables-wrap").prepend(this.$push_select_backup)):"pull"===wpmdb.functions.wpmdb_migration_type()&&(""===this.last_replace_switch||"push"===this.last_replace_switch||"savefile"===this.last_replace_switch?o(".replace-row").each(function(){var e=o(".old-replace-col input",this).val();o(".old-replace-col input",this).val(o(".replace-right-col input",this).val()),o(".replace-right-col input",this).val(e)}):"pull"===this.last_replace_switch&&"pull"===wpmdb.functions.wpmdb_migration_type()&&null!==e&&null!==t&&o(".replace-row").each(function(){var i=o(".old-replace-col input",this).val();i===t&&o(".old-replace-col input",this).val(wpmdb.common.connection_data.path),i===e&&o(".old-replace-col input",this).val(this.remove_protocol(wpmdb.common.connection_data.url))}),o.wpmdb.do_action("wpmdb_update_pull_table_select"),o("#select-post-types").remove(),o(".exclude-post-types-warning").after(this.$pull_post_type_select),wpmdb.functions.exclude_post_types_warning(),o("#select-backup").remove(),o(".backup-tables-wrap").prepend(this.$pull_select_backup)),this.last_replace_switch=wpmdb.functions.wpmdb_migration_type()}},{key:"switch_to_plugin_tab",value:function(e,t){o(".nav-tab").removeClass("nav-tab-active"),o(".nav-tab."+e).addClass("nav-tab-active"),o(".content-tab").hide(),o("."+e+"-tab").show(),"settings"===e&&!0===this.should_check_licence()&&(o("p.licence-status").append("Checking License... ").append(this.ajax_spinner),this.check_licence()),"help"===e&&(this.refresh_debug_log(),!0===this.should_check_licence()&&(o(".support-content p").append(this.ajax_spinner),this.check_licence())),"addons"===e&&!0!==t&&!0===this.should_check_licence()&&(o(".addons-content p").append(this.ajax_spinner),this.check_licence())}},{key:"hide_overlay",value:function(){o("#overlay").removeClass("show").addClass("hide"),o("#overlay > div").removeClass("show").addClass("hide"),wpmdb.current_migration.$proVersion.find("iframe").remove(),setTimeout(function(){o("#overlay").remove()},500),this.migration_completed=!1}},{key:"check_licence",value:function(e){var t=!this.doing_licence_registration_ajax;this.checked_licence=!0;var i=this;o.ajax({url:s,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_check_licence",licence:e,context:"all",nonce:l.nonces.check_licence},error:function(e,t,i){alert(r.license_check_problem)},success:function(e){var n,a,s,r=o(".support-content"),l=o(".addons-content"),c=o(".licence-status:not(.notification-message)");if(void 0!==e.dbrains_api_down)a=e.dbrains_api_down+e.message,s=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,s=e.errors.subscription_expired.addons;else{var p="";for(var m in e.errors)p+=e.errors[m];a=p,s=p}void 0!==e.addon_content&&(s+="\n"+e.addon_content)}else a=e.message,s=e.addon_content;t&&c.stop().fadeOut(i.fade_duration,function(){void 0===n&&(o(this).css({visibility:"hidden",display:"block"}).slideUp(),n=""),o(this).empty().html(n).stop().fadeIn(i.fade_duration)}),r.stop().fadeOut(i.fade_duration,function(){o(this).empty().html(a).stop().fadeIn(i.fade_duration)}),l.stop().fadeOut(i.fade_duration,function(){o(this).empty().html(s).stop().fadeIn(i.fade_duration)}),o("#plugin-compatibility").is(":not(:checked)")&&o("#compatibility-header").click()}})}},{key:"should_check_licence",value:function(){return!1===this.checked_licence&&"1"===l.has_licence&&"true"===l.is_pro}},{key:"maybe_show_mixed_cased_table_name_warning",value:function(){if(void 0!==wpmdb.common.connection_data&&!1!==wpmdb.common.connection_data){var e=wpmdb.functions.wpmdb_migration_type(),t=wpmdb.functions.get_tables_to_migrate(null,null);o(".mixed-case-table-name-notice").hide(),null!==t&&(t=t.join(""))!==t.toLowerCase()&&("1"===wpmdb.common.connection_data.lower_case_table_names||"push"!==e&&"savefile"!==e)&&("1"!==l.lower_case_table_names&&"pull"===e||("push"===e||"savefile"===e?o(".mixed-case-table-name-notice.push").show():o(".mixed-case-table-name-notice.pull").show()))}}},{key:"enable_pro_licence",value:function(e,t){o(".licence-input, .register-licence").remove(),o(".licence-not-entered").prepend(e.masked_licence),o(".support-content").empty().html("<p>"+r.fetching_license+'<img src="'+this.spinner_url+'" alt="" class="ajax-spinner general-spinner" /></p>'),this.check_licence(t),o(".migrate-selection label").removeClass("disabled"),o(".migrate-selection input").removeAttr("disabled")}},{key:"get_domain_name",value:function(e){return e.replace(/\/\/(.*)@/,"//").replace("http://","").replace("https://","").replace("www.","")}},{key:"update_domain_placeholder",value:function(e,t,i){var n=this.get_domain_name(t);return"completed"===i?e.replace(/\%s\s?/,"<span class=domain-label>"+n+"</span> "):e.replace(/\%s(\S*)\s?/,"<span class=domain-label>"+n+"$1</span> ")}},{key:"get_migration_status_label",value:function(e,t,i){var n="",a="";switch(t){case"push":n=r.push_migration_label_migrating,a=r.push_migration_label_completed;break;case"pull":n=r.pull_migration_label_migrating,a=r.pull_migration_label_completed;break;case"find_replace":n=r.find_replace_label_migrating,a=r.find_replace_label_completed;break;case"savefile":n=r.exporting_please_wait,a=r.exporting_complete}var s=n;return"completed"===i&&(s=a),"push"!==t&&"pull"!==t||(s=this.update_domain_placeholder(s,e,i)),s=o.wpmdb.apply_filters("wpmdb_get_migration_status_label",s,{intent:t,stage:i})}},{key:"disable_export_type_controls",value:function(){o(".option-group").each(function(e){o("input",this).attr("disabled","disabled"),o("label",this).css("cursor","default")})}},{key:"enable_export_type_controls",value:function(){o(".option-group").each(function(e){o("input",this).removeAttr("disabled"),o("label",this).css("cursor","pointer")})}},{key:"set_slider_value",value:function(e,t,i,n){var a=t;void 0!==n&&(a=n),o(".slider",e).slider("value",parseInt(t)),o(".amount",e).html(wpmdb.functions.wpmdb_add_commas(a)+" "+i)}},{key:"set_pause_resume_button",value:function(e,t){!0===this.migration_paused?(this.migration_paused=!1,this.doing_ajax=!0,wpmdb.current_migration.setState(this.previous_progress_title,this.previous_progress_text_primary,"active"),o(".pause-resume").html(r.pause),wpmdb.current_migration.resumeTimer(),wpmdb.functions.execute_next_step(t)):(this.migration_paused=!0,this.doing_ajax=!1,this.paused_text=r.migration_paused,this.previous_progress_title=o(".progress-title").html(),this.previous_progress_text_primary=o(".progress-text",".progress-wrapper-primary").html(),this.previous_progress_text_secondary=o(".progress-text",".progress-wrapper-secondary ").html(),"find_replace"===this.migration_intent&&(this.paused_text=r.find_replace_paused),wpmdb.current_migration.setState(this.paused_text,r.completing_current_request,null),o("body").off("click",".pause-resume"),o("body").off("click",".cancel"))}},{key:"filter_temp_tables",value:function(e,t){var i=l.this_temp_prefix;return"pull"===wpmdb.functions.wpmdb_migration_type()&&void 0!==wpmdb.common.connection_data&&void 0!==wpmdb.common.connection_data.temp_prefix&&(i=wpmdb.common.connection_data.temp_prefix),i===t.substring(0,i.length)||e}},{key:"get_table_prefix",value:function(e,t){return o(".table-select-wrap .table-prefix").text()}},{key:"lock_replace_url",value:function(e){!0===e?(o('.replace-row.pin .replace-right-col input[type="text"]').attr("readonly","readonly"),o(".replace-row.pin .arrow-col").addClass("disabled")):(o('.replace-row.pin .replace-right-col input[type="text"]').removeAttr("readonly"),o(".replace-row.pin .arrow-col").removeClass("disabled"))}},{key:"set_connection_data",value:function(e){window.wpmdb.common.previous_connection_data=wpmdb.common.connection_data,window.wpmdb.common.connection_data=e,o.wpmdb.do_action("wpmdb_connection_data_updated",e)}},{key:"get_max_request_display_info",value:function(e){var t={unit:"MB"};return t.amount=(e/1024).toFixed(2),t}},{key:"establish_remote_connection_from_saved_profile",value:function(){var e=wpmdb.functions.wpmdb_migration_type(),t=o.trim(o(".pull-push-connection-info").val()).split("\n");if("undefined"!=typeof wpmdb_default_profile&&!0!==wpmdb_default_profile&&"savefile"!==e&&"find_replace"!==e&&"import"!==e&&!this.doing_ajax&&l.is_pro){this.doing_ajax=!0,this.disable_export_type_controls(),o(".connection-status").html(r.establishing_remote_connection),o(".connection-status").removeClass("notification-message error-notice migration-error"),o(".connection-status").append(this.ajax_spinner);var i=wpmdb.functions.wpmdb_migration_type(),n=this;o.ajax({url:s,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_verify_connection_to_remote_site",url:t[0],key:t[1],intent:i,nonce:l.nonces.verify_connection_to_remote_site,convert_post_type_selection:wpmdb_convert_post_type_selection,profile:l.profile},error:function(e,t,i){o(".connection-status").html(n.get_ajax_errors(e.responseText,"(#102)",e)),o(".connection-status").addClass("notification-message error-notice migration-error"),o(".ajax-spinner").remove(),n.doing_ajax=!1,n.enable_export_type_controls()},success:function(e){if(o(".ajax-spinner").remove(),n.doing_ajax=!1,n.enable_export_type_controls(),void 0!==e.wpmdb_error&&1===e.wpmdb_error)return o(".connection-status").html(e.body),o(".connection-status").addClass("notification-message error-notice migration-error"),void(e.body.indexOf("401 Unauthorized")>-1&&o(".basic-access-auth-wrapper").show());if(!0!==n.maybe_show_mst_warning(e)){n.maybe_show_ssl_warning(t[0],t[1],e.scheme),wpmdb.functions.maybe_show_prefix_notice(e.prefix),o(".pull-push-connection-info").addClass("temp-disabled"),o(".pull-push-connection-info").attr("readonly","readonly"),o(".connect-button").hide(),o(".connection-status").hide(),o(".step-two").show(),n.connection_established=!0,n.set_connection_data(e),n.move_connection_info_box(),n.maybe_show_mixed_cased_table_name_warning();var i="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_tables&&(i=wpmdb_loaded_tables),n.$pull_select=wpmdb.functions.create_table_select(wpmdb.common.connection_data.tables,wpmdb.common.connection_data.table_sizes_hr,i);var a="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_post_types&&(void 0!==e.select_post_types?(o("#exclude-post-types").attr("checked","checked"),o(".post-type-select-wrap").show(),a=e.select_post_types):a=wpmdb_loaded_post_types);var s=document.createElement("select");o(s).attr({multiple:"multiple",name:"select_post_types[]",id:"select-post-types",class:"multiselect"}),o.each(wpmdb.common.connection_data.post_types,function(e,t){var i=o.inArray(t,a);i=-1!==i||!0===wpmdb_convert_exclude_revisions&&"revision"!==t?' selected="selected" ':" ",o(s).append("<option"+i+'value="'+t+'">'+t+"</option>")}),n.$pull_post_type_select=s;var r="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_tables_backup&&(r=wpmdb_loaded_tables_backup);var c=document.createElement("select");o(c).attr({multiple:"multiple",name:"select_backup[]",id:"select-backup",class:"multiselect"}),o.each(wpmdb.common.connection_data.tables,function(e,t){var i=o.inArray(t,r);i=-1!==i?' selected="selected" ':" ",o(c).append("<option"+i+'value="'+t+'">'+t+" ("+wpmdb.common.connection_data.table_sizes_hr[t]+")</option>")}),n.$push_select_backup=c,"pull"===wpmdb.functions.wpmdb_migration_type()?(o.wpmdb.do_action("wpmdb_update_pull_table_select"),o("#select-post-types").remove(),o(".exclude-post-types-warning").after(n.$pull_post_type_select),o("#select-backup").remove(),o(".backup-tables-wrap").prepend(n.$pull_select_backup),o(".table-prefix").html(e.prefix),o(".uploads-dir").html(l.this_uploads_dir)):(o("#select-backup").remove(),o(".backup-tables-wrap").prepend(n.$push_select_backup)),o.wpmdb.do_action("verify_connection_to_remote_site",wpmdb.common.connection_data)}else o(".connection-status").hide()}})}}},{key:"migrate_table_recursive",value:function(e,t,i){var n=this,a=i||0;if(a>=this.tables_to_migrate.length)if("upload"===this.stage&&wpmdb.current_migration.model.getStageItems("find_replace").length)this.stage="find_replace",this.tables_to_migrate=wpmdb.current_migration.model.getStageItems("find_replace","name"),this.tables_to_migrate=this.tables_to_migrate.map(function(e){return"_mig_"+e}),a=0;else{if("backup"!==this.stage)return o(".progress-label").removeClass("label-visible"),wpmdb.common.hooks=o.wpmdb.apply_filters("wpmdb_before_migration_complete_hooks",wpmdb.common.hooks),wpmdb.common.hooks.push(wpmdb.functions.migration_complete),wpmdb.common.hooks.push(wpmdb.functions.wpmdb_flush),wpmdb.common.hooks=o.wpmdb.apply_filters("wpmdb_after_migration_complete_hooks",wpmdb.common.hooks),wpmdb.common.hooks.push(wpmdb.functions.migration_complete_events),wpmdb.common.next_step_in_migration={fn:wpmdb.functions.wpmdb_call_next_hook},void wpmdb.functions.execute_next_step();if(-1!==o.inArray(this.migration_intent,["push","pull"])?this.stage="migrate":"import"===this.migration_intent?this.stage="upload":this.stage=this.migration_intent,wpmdb.current_migration.model.setActiveStage(this.stage),"find_replace"!==this.stage&&"migrate"!==this.stage)return void wpmdb.functions.wpmdb_call_next_hook();a=0,this.tables_to_migrate=wpmdb.functions.get_tables_to_migrate(null,null)}var c=0;a===this.tables_to_migrate.length-1&&(c=1);var p=0;-1!==o.inArray(this.migration_intent,["push","pull"])&&1===parseInt(wpmdb.common.connection_data.gzip)&&(p=1);var m={action:"wpmdb_migrate_table",migration_state_id:wpmdb.migration_state_id,table:this.tables_to_migrate[a],stage:this.stage,current_row:e,last_table:c,primary_keys:t,gzip:p,nonce:l.nonces.migrate_table};-1!==o.inArray(this.migration_intent,["push","pull"])&&(m.bottleneck=wpmdb.common.connection_data.bottleneck,m.prefix=wpmdb.common.connection_data.prefix),wpmdb.common.connection_data&&wpmdb.common.connection_data.path_current_site&&wpmdb.common.connection_data.domain&&(m.path_current_site=wpmdb.common.connection_data.path_current_site,m.domain_current_site=wpmdb.common.connection_data.domain),this.doing_ajax=!0,o.ajax({url:s,type:"POST",dataType:"text",cache:!1,timeout:0,data:m,error:function(e,t,i){var o=r.table_process_problem+" "+n.tables_to_migrate[a]+"<br /><br />"+r.status+": "+e.status+" "+e.statusText+"<br /><br />"+r.response+":<br />"+e.responseText;wpmdb.current_migration.setState(r.migration_failed,o,"error"),n.doing_ajax=!1,console.log(e),console.log(t),console.log(i),wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events()},success:function(e){n.doing_ajax=!1,e=o.trim(e);var t=wpmdb.functions.wpmdb_parse_json(e),i="";if(!1===t||null===t)return i=""===e||null===e?r.table_process_problem_empty_response+" "+n.tables_to_migrate[a]:n.get_ajax_errors(e,null,null),wpmdb.current_migration.setState(r.migration_failed,i,"error"),wpmdb.common.migration_error=!0,void wpmdb.functions.migration_complete_events();if(void 0!==t.wpmdb_error&&1===t.wpmdb_error)return wpmdb.current_migration.setState(r.migration_failed,t.body,"error"),wpmdb.common.migration_error=!0,void wpmdb.functions.migration_complete_events();var s=n.tables_to_migrate[a];"import"===n.migration_intent&&"find_replace"===n.stage&&(s=s.replace(l.this_temp_prefix,"")),wpmdb.current_migration.setText(),wpmdb.current_migration.model.getStageModel(n.stage).setItemRowsTransferred(s,t.current_row),1===c&&"savefile"===n.migration_intent&&(void 0!==t.dump_filename&&(n.dump_filename=t.dump_filename),void 0!==t.dump_path&&(n.dump_path=t.dump_path)),-1===parseInt(t.current_row)&&(a++,t.current_row="",t.primary_keys=""),wpmdb.common.next_step_in_migration={fn:wpmdb.functions.migrate_table_recursive,args:[t.current_row,t.primary_keys,a]},wpmdb.functions.execute_next_step()}})}},{key:"migration_complete_events",value:function(){if(!1===wpmdb.common.migration_error)if(""===wpmdb.common.non_fatal_errors)if("savefile"!==this.migration_intent&&!0===o("#save_computer").is(":checked")&&wpmdb.current_migration.setText(),this.completed_msg=this.completed_msg+' <div class="dashicons dashicons-yes"></div>',!0===this.migration_cancelled){var e=r.migration_cancelled_success;"find_replace"===this.migration_intent&&(e=r.find_replace_cancelled_success),wpmdb.current_migration.setState(this.completed_msg,e,"cancelled")}else wpmdb.current_migration.setState(this.completed_msg,"","complete");else wpmdb.current_migration.setState(r.completed_with_some_errors,wpmdb.common.non_fatal_errors,"error");o(".migration-controls").addClass("hidden"),wpmdb.common.hooks=[],wpmdb.common.call_stack=[],wpmdb.common.migration_error=!1,this.currently_migrating=!1,this.migration_completed=!0,this.migration_paused=!1,this.migration_cancelled=!1,this.doing_ajax=!1,wpmdb.common.non_fatal_errors="",this.tables_to_migrate=[],o(".progress-label").remove(),o(".migration-progress-ajax-spinner").remove(),o(".close-progress-content").show(),o("#overlay").css("cursor","pointer"),wpmdb.current_migration.model.setMigrationComplete()}},{key:"migration_complete",value:function(){var e=this;if(o(".migration-controls").addClass("hidden"),"savefile"===this.migration_intent){this.currently_migrating=!1;var t=r.migration_complete;if(o("#save_computer").is(":checked")){var i=l.this_download_url+encodeURIComponent(this.dump_filename);o("#gzip_file").is(":checked")&&(i+="&gzip=1"),window.location=i}else t=r.completed_dump_located_at+" "+this.dump_path;!1===wpmdb.common.migration_error&&(wpmdb.functions.migration_complete_events(),wpmdb.current_migration.setState(this.completed_msg,t,"complete"))}else{wpmdb.current_migration.setState(null,r.finalizing_migration,"finalizing");var n={action:"wpmdb_finalize_migration",migration_state_id:wpmdb.migration_state_id,tables:this.tables_to_migrate.join(","),nonce:l.nonces.finalize_migration};-1!==o.inArray(this.migration_intent,["push","pull"])&&(n.prefix=wpmdb.common.connection_data.prefix),this.doing_ajax=!0,o.ajax({url:s,type:"POST",dataType:"text",cache:!1,data:n,error:function(t,i,n){e.doing_ajax=!1,wpmdb.current_migration.setState(r.migration_failed,r.finalize_tables_problem,"error"),alert(t+" : "+i+" : "+n),wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events()},success:function(t){if(e.doing_ajax=!1,"1"!==o.trim(t))return wpmdb.current_migration.setState(r.migration_failed,t,"error"),wpmdb.common.migration_error=!0,void wpmdb.functions.migration_complete_events();wpmdb.common.next_step_in_migration={fn:wpmdb.functions.wpmdb_call_next_hook},wpmdb.functions.execute_next_step()}})}}},{key:"wpmdb_flush",value:function(){var e=this;"savefile"!==this.migration_intent&&(wpmdb.current_migration.setText(r.flushing),this.doing_ajax=!0,o.ajax({url:s,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_flush",migration_state_id:wpmdb.migration_state_id,nonce:l.nonces.flush},error:function(t,i,n){e.doing_ajax=!1,wpmdb.current_migration.setState(r.migration_failed,r.flush_problem,"error"),alert(t+" : "+i+" : "+n),wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events()},success:function(t){if(e.doing_ajax=!1,"1"!==o.trim(t))return wpmdb.current_migration.setState(r.migration_failed,t,"error"),wpmdb.common.migration_error=!0,void wpmdb.functions.migration_complete_events();wpmdb.common.next_step_in_migration={fn:wpmdb.functions.wpmdb_call_next_hook},wpmdb.functions.execute_next_step()}}))}},{key:"execute_next_step",value:function(){var e=this;if(0<this.delay_between_requests&&!1===this.flag_skip_delay)setTimeout(function(){this.flag_skip_delay=!0,wpmdb.functions.execute_next_step()},this.delay_between_requests);else if(this.flag_skip_delay=!1,!0===this.migration_paused){o(".migration-progress-ajax-spinner").hide(),wpmdb.current_migration.pauseTimer();var t="";!0===this.is_auto_pause_before_finalize?(t=r.paused_before_finalize,this.is_auto_pause_before_finalize=!1,"find_replace"===wpmdb.functions.wpmdb_migration_type()&&(t=r.find_replace_paused_before_finalize)):t=r.paused,wpmdb.current_migration.setState(null,t,"paused"),o("body").on("click",".pause-resume",function(e){this.set_pause_resume_button(e)}),o("body").on("click",".cancel",function(e){this.cancel_migration(e)}),o(".pause-resume").html(r.resume)}else if(!0===this.migration_cancelled){var i;this.migration_intent=wpmdb.functions.wpmdb_migration_type(),"savefile"===this.migration_intent?i=r.removing_local_sql:"pull"===this.migration_intent?i="backup"===this.stage?r.removing_local_backup:r.removing_local_temp_tables:"push"===this.migration_intent&&(i="backup"===this.stage?r.removing_remote_sql:r.removing_remote_temp_tables),wpmdb.current_migration.setText(i);var n={action:"wpmdb_cancel_migration",migration_state_id:wpmdb.migration_state_id,nonce:l.nonces.cancel_migration};this.doing_ajax=!0,o.ajax({url:s,type:"POST",dataType:"text",cache:!1,data:n,error:function(t,i,n){wpmdb.current_migration.setState(r.migration_cancellation_failed,r.manually_remove_temp_files+"<br /><br />"+r.status+": "+t.status+" "+t.statusText+"<br /><br />"+r.response+":<br />"+t.responseText,"error"),console.log(t),console.log(i),console.log(n),e.doing_ajax=!1,wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events()},success:function(t){if(e.doing_ajax=!1,t=o.trim(t),"push"===e.migration_intent&&"1"!==t||"push"!==e.migration_intent&&""!==t)return void 0!==t&&void 0!==t.wpmdb_error&&1===t.wpmdb_error&&(t=t.wpmdb_error),wpmdb.current_migration.setState(r.migration_cancellation_failed,t,"error"),wpmdb.common.migration_error=!0,void wpmdb.functions.migration_complete_events();e.completed_msg=r.migration_cancelled,"find_replace"===e.migration_intent&&(e.completed_msg=r.find_replace_cancelled),wpmdb.functions.migration_complete_events(),wpmdb.current_migration.setStatus("cancelled")}})}else wpmdb.common.next_step_in_migration.fn.apply(null,wpmdb.common.next_step_in_migration.args)}},{key:"maybe_show_prefix_notice",value:function(e){var t=o(".prefix-notice");t.hide(),e!==l.this_prefix&&(o(".remote-prefix").html(e),this.show_prefix_notice=!0,t.show())}},{key:"maybe_show_mst_warning",value:function(e){var t=wpmdb.functions.wpmdb_migration_type(),i=!1;return-1!==o.inArray(t,["push","pull"])&&void 0!==e.site_details?l.site_details.is_multisite!==e.site_details.is_multisite&&(void 0!==wpmdb.mst&&void 0!==e.mst_available&&"1"===e.mst_available||(i=!0)):"import"===t&&void 0!==e.multisite&&void 0!==e.subsite_export&&("false"===l.site_details.is_multisite&&"true"===e.multisite&&"true"!==e.subsite_export||"true"===l.site_details.is_multisite&&"false"===e.multisite)&&(i=!0),(i=o.wpmdb.apply_filters("wpmdb_show_mst_warning",i))&&o(".mst-required").show(),i}},{key:"maybe_show_select_table_notice",value:function(){if(o("#migrate-selected").is(":checked")&&null===o("#select-tables").val()){if("import"!==wpmdb.functions.wpmdb_migration_type())return alert(r.please_select_one_table),!0;if(o("#import-find-replace").is(":checked")&&o("#select-tables").is(":visible"))return alert(r.please_select_one_table_import),!0}return!("savefile"===wpmdb.functions.wpmdb_migration_type()||!o("#backup-manual-select").is(":checked")||null!==o("#select-backup").val())&&(alert(r.please_select_one_table_backup),!0)}},{key:"remove_protocol",value:function(e){return e.replace(/^https?:/i,"")}},{key:"create_table_select",value:function(e,t,i){var n=document.createElement("select");return o(n).attr({multiple:"multiple",name:"select_tables[]",id:"select-tables",class:"multiselect"}),0<e.length&&o.each(e,function(e,a){if(!o.wpmdb.apply_filters("wpmdb_exclude_table",!1,a)){var s=" ";void 0!==i&&null!==i&&0<i.length&&-1!==o.inArray(a,i)&&(s=' selected="selected" ');var r="";0!==t.length&&(r=" ("+t[a]+")"),o(n).append("<option"+s+'value="'+a+'">'+a+r+"</option>")}}),n}},{key:"get_tables_to_migrate",value:function(){var e=[],t=wpmdb.functions.wpmdb_migration_type();return"migrate_select"===o("input[name=table_migrate_option]:checked").val()?e=o("#select-tables").val():"pull"!==t&&void 0!==l.this_prefixed_tables?e=l.this_prefixed_tables:"pull"===t&&void 0!==wpmdb.common.connection_data&&void 0!==wpmdb.common.connection_data.prefixed_tables&&(e=wpmdb.common.connection_data.prefixed_tables),e}},{key:"update_migrate_button_text",value:function(){var e=wpmdb.functions.wpmdb_migration_type(),t=o("#save-migration-profile").is(":checked")?"_save":"",i="migrate_button_"+("savefile"===e?"export":e)+t;o(".migrate-db .button-primary").val(r[i])}},{key:"connection_box_changed",value:function(){var e=this,t=o(".pull-push-connection-info");if(-1!==o.inArray(wpmdb.functions.wpmdb_migration_type(),["push","pull"])&&(!this.doing_ajax&&!o(t).hasClass("temp-disabled")||!1!==wpmdb.force_reconnect)){wpmdb.force_reconnect=!1;var i=o(".pull-push-connection-info").val(),n=o.trim(i).split("\n"),a=!1,c="";if(""===n&&(a=!0,c=r.connection_info_missing),1===n.length&&!a){var p=o.trim(i).split(" ");2===p.length&&(n=p)}2===n.length||a||(a=!0,c=r.connection_info_incorrect),a||this.validate_url(n[0])||(a=!0,c=r.connection_info_url_invalid);var m=0;if(void 0!==n[1]&&(m=n[1].length),a||32===m||40===m||(a=!0,c=r.connection_info_key_invalid),a||n[0]!==l.connection_info[0]||(a=!0,c=r.connection_info_local_url),a||n[1]!==l.connection_info[1]||(a=!0,c=r.connection_info_local_key),a)return o(".connection-status").html(c),void o(".connection-status").addClass("notification-message error-notice migration-error");var d=n[0]+"\n"+n[1];1===o.trim(i).split("\n").length&&o(".pull-push-connection-info").val(d),!1===l.openssl_available&&(n[0]=n[0].replace("https://","http://"),d=n[0]+"\n"+n[1],o(".pull-push-connection-info").val(d)),this.show_prefix_notice=!1,this.doing_ajax=!0,this.disable_export_type_controls(),o(".basic-access-auth-wrapper").is(":visible")&&(n[0]=n[0].replace(/\/\/(.*)@/,"//"),n[0]=n[0].replace("//","//"+encodeURIComponent(o.trim(o(".auth-username").val()))+":"+encodeURIComponent(o.trim(o(".auth-password").val()))+"@"),d=n[0]+"\n"+n[1],o(".pull-push-connection-info").val(d),o(".basic-access-auth-wrapper").hide()),o(".step-two").hide(),o(".ssl-notice").hide(),o(".prefix-notice").hide(),o(".connection-status").show(),o(".connection-status").html(r.establishing_remote_connection),o(".connection-status").removeClass("notification-message error-notice migration-error"),o(".connection-status").append(this.ajax_spinner);var _=wpmdb.functions.wpmdb_migration_type();return this.profile_name_edited=!1,o.ajax({url:s,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_verify_connection_to_remote_site",url:n[0],key:n[1],intent:_,nonce:l.nonces.verify_connection_to_remote_site},error:function(t,i,n){o(".connection-status").html(e.get_ajax_errors(t.responseText,"(#100)",t)),o(".connection-status").addClass("notification-message error-notice migration-error"),o(".ajax-spinner").remove(),e.doing_ajax=!1,e.enable_export_type_controls()},success:function(t){if(o(".ajax-spinner").remove(),e.doing_ajax=!1,e.enable_export_type_controls(),void 0!==t.wpmdb_error&&1===t.wpmdb_error)return o(".connection-status").html(t.body),o(".connection-status").addClass("notification-message error-notice migration-error"),t.body.indexOf("401 Unauthorized")>-1&&o(".basic-access-auth-wrapper").show(),void(o(".pull-push-connection-info").hasClass("temp-disabled")||o(".connect-button").is(":visible")||(o(".pull-push-connection-info").removeAttr("readonly"),o(".connect-button").show()));if(!0!==e.maybe_show_mst_warning(t)){e.maybe_show_ssl_warning(n[0],n[1],t.scheme);var i=e.get_domain_name(t.url);o(".create-new-profile").val(i),o(".pull-push-connection-info").addClass("temp-disabled"),o(".pull-push-connection-info").attr("readonly","readonly"),o(".connect-button").hide(),o(".connection-status").hide(),o(".step-two").show(),wpmdb.functions.maybe_show_prefix_notice(t.prefix),e.connection_established=!0,e.set_connection_data(t),e.move_connection_info_box(),e.change_replace_values(),e.maybe_show_mixed_cased_table_name_warning(),e.refresh_table_selects(null,null,e),e.$push_select_backup=o(e.$pull_select).clone(),o(e.$push_select_backup).attr({name:"select_backup[]",id:"select-backup"});var a=document.createElement("select");o(a).attr({multiple:"multiple",name:"select_post_types[]",id:"select-post-types",class:"multiselect"}),o.each(wpmdb.common.connection_data.post_types,function(e,t){o(a).append('<option value="'+t+'">'+t+"</option>")}),e.$pull_post_type_select=a,o("#new-path-missing-warning, #new-url-missing-warning").hide(),"pull"===wpmdb.functions.wpmdb_migration_type()?(o("#new-url").val(e.remove_protocol(l.this_url)),o("#new-path").val(l.this_path),"true"===l.is_multisite&&(o("#new-domain").val(l.this_domain),o('.replace-row.pin .old-replace-col input[type="text"]').val(e.remove_protocol(t.url))),o("#old-url").val(e.remove_protocol(t.url)),o("#old-path").val(t.path),o.wpmdb.do_action("wpmdb_update_pull_table_select"),o("#select-post-types").remove(),o(".exclude-post-types-warning").after(e.$pull_post_type_select),wpmdb.functions.exclude_post_types_warning(),o(".table-prefix").html(t.prefix),o(".backup-table-prefix").html(l.site_details.prefix),o(".uploads-dir").html(l.this_uploads_dir)):(o("#new-url").val(e.remove_protocol(t.url)),o("#new-path").val(t.path),"true"===l.is_multisite&&o('.replace-row.pin .old-replace-col input[type="text"]').val(e.remove_protocol(l.this_url)),o.wpmdb.do_action("wpmdb_update_push_table_select"),o("#select-backup").remove(),o(".backup-tables-wrap").prepend(e.$push_select_backup)),wpmdb.common.next_step_in_migration={fn:o.wpmdb.do_action,args:["verify_connection_to_remote_site",wpmdb.common.connection_data]},wpmdb.functions.execute_next_step()}else o(".connection-status").hide()}})}}}]),e}();t.default=c},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.handleAjaxError=function(e,t){var i="\n\t\t\t<p>"+wpmdb_strings.ajax_php_errors+":</p>\n\t\t\t<p>"+t.message+"</p>\n\t";wpmdb.current_migration.setState(e,i,"error"),wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events(),console.error("🚨 🚒",t)},t.throwMDBError=function(e){var t=void 0;throw void 0!==e.body&&(wpmdb.common.non_fatal_errors+=e.body,t=e.body),void 0!==e.msg&&(t=e.msg),new Error(t)},t.jQueryAjaxError=function(e,t){return void 0!==t.responseText&&""!==t.responseText?e=t.responseText:void 0!==t.statusText&&(e=t.statusText),console.error(t),wpmdb.current_migration.setState(wpmdb_strings.migration_failed,e,"error"),wpmdb.common.migration_error=!0,wpmdb.functions.migration_complete_events(),e},t.doNextStep=function(e,t,i){return wpmdb.common.next_step_in_migration={fn:e,args:t},wpmdb.functions.execute_next_step(i)}},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=i(0),s=i(2),r=a('<div id="overlay" class="hide"></div>'),l=a(".progress-content").clone().addClass("hide"),c=a(".pro-version").addClass("hide");r.append(c);var p={migration:{model:{},view:{},$progress:{},$wrapper:{},$overlay:{},status:"active",title:"",text:"",timerCount:0,timerStart: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.timerStart=Date.now(),this.timerCount=0,this.counterDisplay=a(".timer"),this.elapsedInterval=setInterval(this.incrementTimer.bind(this),1e3)},getTimerCountInSeconds:function(){return Math.floor((Date.now()-this.timerStart)/1e3)},pauseTimer:function(){this.pausedAt=Date.now(),clearInterval(this.elapsedInterval)},resumeTimer:function(){this.timerStart+=Date.now()-this.pausedAt,this.elapsedInterval=setInterval(this.incrementTimer.bind(this),1e3)},incrementTimer:function(){this.timerCount=this.getTimerCountInSeconds(),this.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(/\{"/g,"{#q!#").replace(/\"}/g,"#q!#}").replace(/,"/g,",#q!#").replace(/":/g,"#q!#:").replace(/:"/g,":#q!#").replace(/"/g,'\\"').replace(/#q!#/g,'"').replace(/>/g,">").replace(/</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=l.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:i(4)};e.exports=p},function(e,t){window.jQuery;jQuery(function(){jQuery(".wpmdb-opt-usage-tracking").on("click",function(e){e.preventDefault();var t=!!e.target.classList.contains("opt-yes");jQuery(".wpmdb-usage-tracking-notice .links").text(t?"Thanks!":"Done."),jQuery(".wpmdb-usage-tracking-notice").delay(1e3).fadeOut(200);var i=jQuery("#allow_tracking-wrap");if(t){if(!i.hasClass("on"))return void i.trigger("click")}else if(i.hasClass("on"))return void i.trigger("click");i.find("input[type=checkbox]").trigger("change")})})},function(e,t){window.jQuery},function(e,t){window.jQuery},function(e,t){window.jQuery},function(e,t){window.jQuery}]);
|
2 |
+
//# sourceMappingURL=bundle-103.js.map
|
asset/build/js/bundle-103.js.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"sources":["webpack:///webpack/bootstrap 105f76a700956bc2f959","webpack:///./src/wp-migrate-db-pro/asset/src/js/modules/MigrationProgress-model.js","webpack:///./src/wp-migrate-db-pro/asset/src/js/modules/MigrationProgressStage-model.js","webpack:///./src/wp-migrate-db-pro/asset/src/js/modules/MigrationProgress-view.js","webpack:///./src/wp-migrate-db-pro/asset/src/js/modules/MigrationProgressStage-view.js","webpack:///./src/wp-migrate-db-pro/asset/src/js/modules/MigrationProgress-utils.js","webpack:///./src/wp-migrate-db-pro/asset/webpack.index.js","webpack:///./src/wp-migrate-db-pro/asset/src/js/helpers/wpmdbCommon.js","webpack:///./src/wp-migrate-db-pro/asset/src ./node_modules/imports-loader","webpack:///./src/wp-migrate-db-pro/asset/src/js/dismissable-notices.js","webpack:///./src/wp-migrate-db-pro/asset/src/js/helpers/events.js","webpack:///./src/wp-migrate-db-pro/asset/src/js/helpers/utils.js","webpack:///./src/wp-migrate-db-pro/asset/src/js/helpers/wpmdbGlobals.js","webpack:///./src/wp-migrate-db-pro/asset/src/js/hook.js","webpack:///./src/wp-migrate-db-pro/asset/src/js/import.js","webpack:///./src/wp-migrate-db-pro/asset/src/js/localStorage.js","webpack:///./src/wp-migrate-db-pro/asset/src/js/modules/MigrationProgress-controller.js","webpack:///./src/wp-migrate-db-pro/asset/src/js/multisite.js","webpack:///./src/wp-migrate-db-pro/asset/src/js/plugin-update.js","webpack:///./src/wp-migrate-db-pro/asset/src/js/script.js","webpack:///./src/wp-migrate-db-pro/asset/src/js/usage-tracking-notice.js","webpack:///./src/wp-migrate-db-pro/asset/src/sass/_migration-progress.scss","webpack:///./src/wp-migrate-db-pro/asset/src/sass/_progress-upgrade.scss","webpack:///./src/wp-migrate-db-pro/asset/src/sass/plugin-update-styles.scss","webpack:///./src/wp-migrate-db-pro/asset/src/sass/styles.scss"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","MigrationProgressStageModel","$","jQuery","MigrationProgressModel","Backbone","Model","extend","defaults","_initialStages","stages","activeStageName","stageModels","localTableRows","localTableSizes","remoteTableRows","remoteTableSizes","migrationStatus","migrationIntent","initialize","this","set","_","each","stage","items","dataType","addStage","itemsArr","item","size","rows","push","_typeof","addStageModel","trigger","on","getStageModel","addStageItem","displayName","arguments","length","undefined","addItem","newStageModel","getStageItems","map","setActiveStage","setStageComplete","wpmdb","current_migration","currentStageNum","setMigrationComplete","lastStage","activateTab","MigrationProgressStage","status","_initialItems","names","lookupItems","totalSize","totalTransferred","itemsComplete","itemsCompleteArr","strings","initStrings","slice","triggerItemViewInit","updateTitleElem","default_strings","stage_title","migrated","wpmdb_strings","queued","active","running","complete","hide","show","itemsName","tables","items_migrated","hide_items","show_items","indexOf","stageName","transferred","rowsTransferred","title","$title","createTitleElem","addClass","append","text","functions","convertKBSizeToHRFixed","progress","$progress","createProgElem","prog","css","el","$el","createMainElem","attr","updateProgress","percent","window","requestAnimationFrame","bind","parseFloat","self","getTotalSizeTransferred","countItemsComplete","getTotalProgressPercent","total","Math","min","round","model","setItemComplete","itemName","getItemByName","setItemPercentTransferred","percentTransferred","batchSize","folderTransferred","exactPercent","total_transferred","setItemRowsTransferred","numRows","amtDone","estTransferred","parseInt","determineItemByName","index","MigrationProgressStageView","MigrationProgressView","View","tagName","className","id","empty","stageModel","addStageView","newStageSubView","parent","find","$tabElem","$totalProgressElem","$showHideTablesElem","$pauseBeforeFinalizeElem","$pauseBeforeFinalizeCheckbox","$itemsContainer","itemViews","maxDomNodes","visibleDomNodes","itemCount","percentDone","sizeDone","tablesDone","queuedElements","$truncationNotice","$truncationNoticeHiddenItems","shouldHideItemProgress","initTotalProgressElem","view","after","initTabElem","maybeAddElementToView","updateProgressElem","updateStageTotals","e","removeClass","setItemProgress","siblings","initShowHideTablesElem","initPauseBeforeFinalizeElem","progTablesHidden","hasClass","add","Boolean","wpmdb_data","prog_tables_hidden","prog_tables_visibility_changed","triggerHandler","isChecked","pause_before_finalize","prop","inArray","pause_before_finalize_find_replace","pauseBeforeFinalizeValue","is","pause_before_finalize_changed","max","fadeOut","width","wpmdb_add_commas","toLowerCase","hideItemProgress","updateTruncationNotice","showTruncationNotice","hiddenItemsCount","progress_items_truncated_msg","replace","getNextElementForView","queueItem","shift","ceil","elemComplete","$nextEl","height","marginBottom","$clone","clone","display","appendTo","setTimeout","timeout","remove","last","updateProgTableVisibilitySetting","ajax","url","ajaxurl","type","cache","data","action","nonce","nonces","save_setting","setting","checked","error","jqXHR","textStatus","errorThrown","console","log","updatePauseBeforeFinalizeSetting","common","hooks","call_stack","non_fatal_errors","migration_error","_wpmdbCommon2","default","require","keys","forEach","file","includes","importAll","WPMDBCommon","_classCallCheck","val","func","number_string","number_parts","split","integer","decimal","rgx","test","maybe_json","json_object","parseJSON","code","jsonErrors","html","wpmdb_parse_json","ajax_json_message","originalText","ajax_json_errors","view_error_messages","statusText","response","str","delimiter","String","RegExp","table_prefix","desired_table","given_table","escaped_given_table","preg_quote","exec","table_name","escaped_table_name","results","dec","kbSize","retArray","retVal","units","toFixed","abs","u","pow","hrSizeArray","convertKBSizeToHR","callback","ele","notice","reminder","beforeSend","spinner_url","devicePixelRatio","excluded_post_types","excluded_post_types_text","$exclude_post_types_warning","join","opacity","slideDown","animate","slideUp","./js/dismissable-notices.js","./js/helpers/events.js","./js/helpers/utils.js","./js/helpers/wpmdbCommon.js","./js/helpers/wpmdbGlobals.js","./js/hook.js","./js/import.js","./js/localStorage.js","./js/modules/MigrationProgress-controller.js","./js/modules/MigrationProgress-model.js","./js/modules/MigrationProgress-utils.js","./js/modules/MigrationProgress-view.js","./js/modules/MigrationProgressStage-model.js","./js/modules/MigrationProgressStage-view.js","./js/multisite.js","./js/plugin-update.js","./js/script.js","./js/usage-tracking-notice.js","./sass/_migration-progress.scss","./sass/_progress-upgrade.scss","./sass/plugin-update-styles.scss","./sass/styles.scss","webpackContext","req","webpackContextResolve","Error","resolve","prev","click","preventDefault","ajax_handle_dismissible_notice","wpmdb_nonces","process_notice_link","closest","fn","bindFirst","bindNth","changeEventOrder","newIndex","that","idx","handlers","_data","splice","pop","handleAjaxError","header_text","errorTemplate","ajax_php_errors","message","setState","migration_complete_events","throwMDBError","parsed_response","error_body","body","msg","jQueryAjaxError","responseText","migration_failed","doNextStep","args","instance","next_step_in_migration","execute_next_step","WPMDBGlobals","show_ssl_notice","doing_save_profile","doing_ajax","profile_name_edited","migration_intent","doing_licence_registration_ajax","migration_paused","last_replace_switch","wpmdb_migration_type","connection_established","checked_licence","show_prefix_notice","force_reconnect","migration_selection","show_version_notice","migration_completed","currently_migrating","dump_filename","dump_path","remote_site","secret_key","form_data","elapsed_interval","completed_msg","tables_to_migrate","previous_progress_title","previous_progress_text_primary","previous_progress_text_secondary","cancelling_text","paused_text","migration_cancelled","flag_skip_delay","delay_between_requests","fade_duration","is_auto_pause_before_finalize","$connection_info_box","$push_select","$pull_select","$push_post_type_select","$pull_post_type_select","$push_select_backup","$pull_select_backup","get_spinner_url","ajax_spinner","z","Array","arr1","arr2","v","r","pin","parents","wpmdbGetAjaxErrors","connection_local_server_problem","get_log","alert","update_log_problem","success","location","search","decodeURIComponent","key","remote_scheme","scheme","substr","$ssl_notice","this_tables","this_table_sizes_hr","create_table_select","connection_data","table_sizes_hr","profile","_this","blur","maybe_show_select_table_notice","create_new_profile","profile_name","elements","not","serialize","save_profile","save_profile_problem","removeAttr","saved","updated_profile_id","new_profile_key","new_profile_id","new_li","document","createTextNode","before","updated_url","href","updated_profile_name","trim","history","pushState","$crumbs","this_plugin_base","prepend","event","cancelling_migration","visibility","cancelling_find_replace","completing_current_request","checkbox_wrap","$switch","$checkbox","toggleClass","switch_on","backup_table_prefix","uploads_dir","upload_dir_long","write_permission","$connection_status","$directory_permission_notice","$compatibility_older_mysql","$mst_required","$keep_active_plugins","$step_two","$backup_options","new_migration_type","wpmdb_toggle_migration_action_text","do_action","migration_type","last_migration_type","$pull_push_connection_info","connection_info","$migration_list_li","connection_textarea","focus","connection_box_changed","prefix","site_details","this_uploads_dir","this_upload_dir_long","this_prefix","write_permissions","maybe_show_backup_disabled_msg","get_domain_name","is_multisite","$old_replace_col","eq","maybe_show_mixed_cased_table_name_warning","upload_dir","$create_backup","$create_backup_label","$backup_option_disabled","old_url","old_path","previous_connection_data","remove_protocol","path","old_val","exclude_post_types_warning","hash","skip_addons_check","should_check_licence","check_licence","refresh_debug_log","$proVersion","licence","update_licence_content","context","license_check_problem","licence_msg","support_msg","addons_msg","$support_content","$addons_content","$licence_content","dbrains_api_down","errors","subscription_expired","support","addons","addon_content","stop","fadeIn","has_licence","is_pro","get_tables_to_migrate","lower_case_table_names","licence_key","masked_licence","fetching_license","label","domain","intent","migrating_stage_label","completed_stage_label","push_migration_label_migrating","push_migration_label_completed","pull_migration_label_migrating","pull_migration_label_completed","find_replace_label_migrating","find_replace_label_completed","exporting_please_wait","exporting_complete","update_domain_placeholder","apply_filters","parent_selector","value","unit","display_value","slider","pause","resumeTimer","find_replace_paused","off","exclude","temp_prefix","this_temp_prefix","substring","lock","display_info","amount","wpmdb_default_profile","disable_export_type_controls","establishing_remote_connection","verify_connection_to_remote_site","convert_post_type_selection","wpmdb_convert_post_type_selection","get_ajax_errors","enable_export_type_controls","wpmdb_error","maybe_show_mst_warning","maybe_show_ssl_warning","maybe_show_prefix_notice","set_connection_data","move_connection_info_box","loaded_tables","wpmdb_loaded_tables","loaded_post_types","wpmdb_loaded_post_types","select_post_types","$post_type_select","createElement","multiple","class","post_types","selected","wpmdb_convert_exclude_revisions","loaded_tables_backup","wpmdb_loaded_tables_backup","$table_select_backup","current_row","primary_keys","iterator","_this2","table","migration_complete","wpmdb_flush","wpmdb_call_next_hook","last_table","gzip","request_data","migration_state_id","migrate_table","bottleneck","path_current_site","domain_current_site","progress_text","table_process_problem","row_information","error_text","table_process_problem_empty_response","item_name","setText","migrate_table_recursive","cancel_success","migration_cancelled_success","find_replace_cancelled_success","completed_with_some_errors","_this3","migrate_complete_text","this_download_url","encodeURIComponent","completed_dump_located_at","finalizing_migration","finalize_migration","finalize_tables_problem","_this4","flushing","flush","flush_problem","_this5","pauseTimer","pause_text","paused_before_finalize","find_replace_paused_before_finalize","paused","set_pause_resume_button","cancel_migration","resume","progress_msg","removing_local_sql","removing_local_backup","removing_local_temp_tables","removing_remote_sql","removing_remote_temp_tables","migration_cancellation_failed","manually_remove_temp_files","find_replace_cancelled","setStatus","apply","$prefix_notice","show_mst_warning","mst","mst_available","multisite","subsite_export","please_select_one_table","please_select_one_table_import","please_select_one_table_backup","selected_tables","$table_select","mig_type","this_prefixed_tables","prefixed_tables","save_string","migrate_string","_this6","$this","error_message","connection_info_missing","connection_words","connection_info_incorrect","validate_url","connection_info_url_invalid","key_length","connection_info_key_invalid","connection_info_local_url","connection_info_local_key","new_connection_info_contents","openssl_available","change_replace_values","refresh_table_selects","this_url","this_path","this_domain","filter","add_action","callable","tag","add_hook","add_filter","do_hook","remove_action","remove_hook","remove_filter","hook_type","import_selected","$import_select","tables_to_search","tables_to_import","unrecognized_import_file","import_prefix","import_info","maybe_show_find_replace_options","find_replace_rows","import_label_completed","import_label_migrating","$import_file_status","import_profile_loaded","please_select_sql_file","upload_file_recursive","change","tables_to_backup","upload","migrate_button_import","searched","migrate_button_find_replace","files","target","reader","FileReader","$backup_selected_option","$unrecognized_file_notice","$old_url","$old_path","$new_url","$new_path","invalid_sql_file","parsing_sql_file","onloadend","readyState","DONE","file_data","result","import_file","localStorage_form_data","get_localStorage_form_data","URL","select_tables","remove_localStorage_form_data","opt","blob","readAsDataURL","start","getElementById","next_slice","file_type","size_done","uploading_file_to_server","upload_import_successful","migration_text","importing_file_to_db","import_size","num_chunks","import_file_recursive","import_filename","chunk","current_query","table_sizes","startsWith","alter_table_name","table_rows","table_migrate_option","imported_table","get_tables_to_import","ready","localStorage_available","localStorage","setItem","removeItem","maybe_reload_page","set_localStorage_form_data","reload","serializeArray","field","field_name","JSON","stringify","getItem","parse","err","load_data_from_localStorage","$input","input_type","next","when","done","select_backup","replace_old","replace_new","update_migrate_button_text","$overlayOriginal","$progressContentOriginal","MigrationProgressController","migration","$wrapper","$overlay","timerCount","timerStart","elapsedInterval","counterDisplay","originalTitle","setTitle","decodeErrorObject","startTimer","Date","now","setInterval","incrementTimer","getTimerCountInSeconds","floor","pausedAt","clearInterval","displayCount","hours","minutes","seconds","pad","activeStage","numStages","currentStage","currentStatus","progressText","title_progress","restoreTitleElem","num","padChar","input","inputDecoded","fixProgressStageWidthForScrollBar","scrollBarWidth","offsetWidth","clientWidth","visibleProgressItems","leftPad","rightPad","newMigration","settings","replaceWith","proVersionIFrame","utils","debounce","update_multiselect","element","subsites","selected_subsite_ids","site_selected","blog_id","subsite_path","spinner","doing_check_licence","insertAfter","check_again_link","wpmdb_update_strings","check_license_again","_utils","globals","_wpmdbGlobals2","migration_progress_controller","onbeforeunload","returnValue","sure","run_fn","install","$status","toggle","plugin_compatibility","plugin_compatibility_settings_problem","navigator","userAgent","valid_licence","max_request_size_container","max_request_size_slider","range","max_request","step","create","ui","get_max_request_display_info","set_slider_value","slide","max_request_size","update_max_request_size","max_request_size_problem","delay_between_requests_container","delay_between_requests_slider","update_delay_between_requests","delay_between_requests_problem","$container","$viewer","offset","scrollTop","top","children","establish_remote_connection_from_saved_profile","keypress","which","$licence_status","activate_licence","register_license_problem","enable_pro_licence","Number","is_first_activation","welcome_text","this_plugin_url","welcome_title","license_registered","delay","enter_license_key","clear_log","clear_log_problem","clear_error_log","multiselect","group","new_url_missing","new_file_path_missing","save_active_profile","this_table_sizes","this_table_rows","backup_option","table_option","data_type","get_intersect","backed_up","static_migration_label","get_migration_status_label","initiate_migration","local","remote","hide_overlay","enter_name_for_profile","icon","bubble","position","bubble_offset","left","stopPropagation","switch_to_plugin_tab","tab_name","nav_tab","$parent_tr","prev_id","original_value","new_value_input","sortable","handle","get_query_var","lines","originalEvent","clipboardData","setData","confirm","reset_api_key","doing_reset_api_key_ajax","reset_api_key_problem","$connection_info","two_lines","one_line","select","execCommand","$confirmation","doing_plugin_compatibility_ajax","select_element","whitelist_plugins","blacklist_problem","remove_profile","$profile_li","$new_profile_li","profile_id","delete_migration_profile","remove_profile_problem","remove_profile_not_found","change_connection_info","enter_connection_info","save_settings_problem","submit","new_contents","copying_license","copy_licence_to_remote_site","attempting_to_activate_licence","reactivate_licence","activate_licence_problem","wpmdb_dbrains_api_down","temporarily_activated_licence","licence_reactivated","get_table_prefix","lock_replace_url","pin_replace_url","set_checkbox","is_beta_plugins_installed","rollback_beta_to_stable","rollback_to_stable_url","optIn","classList","contains"],"mappings":"aACA,IAAAA,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAG,EAAAH,EACAI,GAAA,EACAH,YAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAZ,EAAAmB,EAAA,SAAAhB,GACA,IAAAS,EAAAT,KAAAiB,WACA,WAA2B,OAAAjB,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAH,EAAAU,EAAAE,EAAA,IAAAA,GACAA,GAIAZ,EAAAa,EAAA,SAAAQ,EAAAC,GAAsD,OAAAR,OAAAS,UAAAC,eAAAjB,KAAAc,EAAAC,IAGtDtB,EAAAyB,EAAA,GAGAzB,IAAA0B,EAAA,kPC7DIC,EAA8B3B,EAAS,GACvC4B,EAAIC,OAEJC,EAAyBC,SAASC,MAAMC,QAC3CC,UACCC,eAAgB,KAChBC,OAAQ,KACRC,gBAAiB,KACjBC,YAAa,KACbC,eAAgB,KAChBC,gBAAiB,KACjBC,gBAAiB,KACjBC,iBAAkB,KAClBC,gBAAiB,SACjBC,gBAAiB,YAElBC,WAAY,WACXC,KAAKC,IAAK,kBACVD,KAAKC,IAAK,iBAAkBD,KAAK5B,IAAK,WACtC4B,KAAKC,IAAK,aACVC,EAAEC,KAAMH,KAAK5B,IAAK,kBAAoB,SAAUgC,EAAOC,EAAOC,GAC7DN,KAAKO,SAAUH,EAAMvC,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kCAAkCvvB,KAAMzF,KAAK6yB,YAEpG7yB,KAAK6yB,WAEb8C,MAAOz4B,EAAS,IAGjBG,EAAOD,QAAUw1B,+BIzNjB7zB,OAAQ,WACPA,OAAO,6BAA6BiC,GAAI,QAAS,SAASwI,GACzDA,EAAE8K,iBACF,IAAI6qB,IAAQ31B,EAAEykB,OAAOmR,UAAUC,SAAS,WAExCtgC,OAAO,uCAAuC0F,KAAO06B,EAAS,UAAY,SAC1EpgC,OAAO,gCAAgC+6B,MAAM,KAAM/uB,QAAQ,KAE3D,IAAIsS,EAAUte,OAAO,wBACrB,GAAIogC,GACH,IAAM9hB,EAAQtT,SAAS,MAEtB,YADAsT,EAAQtc,QAAQ,cAIjB,GAAIsc,EAAQtT,SAAS,MAEpB,YADAsT,EAAQtc,QAAQ,SAIlBsc,EAAQtV,KAAK,wBAAwBhH,QAAQ,6BCpB/CwE,OAAAxG,sBCAAwG,OAAAxG,sBCAAwG,OAAAxG,sBCAAwG,OAAAxG","file":"wp-migrate-db-pro/free/../asset/build/js/bundle-103.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 105f76a700956bc2f959","var MigrationProgressStageModel = require( './MigrationProgressStage-model' );\nvar $ = jQuery;\n\nvar MigrationProgressModel = Backbone.Model.extend( {\n\tdefaults: {\n\t\t_initialStages: null,\n\t\tstages: null,\n\t\tactiveStageName: null,\n\t\tstageModels: null,\n\t\tlocalTableRows: null,\n\t\tlocalTableSizes: null,\n\t\tremoteTableRows: null,\n\t\tremoteTableSizes: null,\n\t\tmigrationStatus: 'active',\n\t\tmigrationIntent: 'savefile'\n\t},\n\tinitialize: function() {\n\t\tthis.set( 'stageModels', {} );\n\t\tthis.set( '_initialStages', this.get( 'stages' ) );\n\t\tthis.set( 'stages', [] );\n\t\t_.each( this.get( '_initialStages' ), function( stage, items, dataType ) {\n\t\t\tthis.addStage( stage.name, items, dataType );\n\t\t}, this );\n\t},\n\taddStage: function( name, items, dataType, extend ) {\n\t\tvar itemsArr = [];\n\t\tvar stage;\n\n\t\t_.each( items, function( item ) {\n\t\t\tvar size, rows;\n\n\t\t\tif ( 'remote' === dataType ) {\n\t\t\t\tsize = this.get( 'remoteTableSizes' )[ item ];\n\t\t\t\trows = this.get( 'remoteTableRows' )[ item ];\n\t\t\t} else {\n\t\t\t\tsize = this.get( 'localTableSizes' )[ item ];\n\t\t\t\trows = this.get( 'localTableRows' )[ item ];\n\t\t\t}\n\n\t\t\titemsArr.push( {\n\t\t\t\tname: item,\n\t\t\t\tsize: size,\n\t\t\t\trows: rows\n\t\t\t} );\n\t\t}, this );\n\n\t\tstage = {\n\t\t\tname: name,\n\t\t\titems: itemsArr,\n\t\t\tdataType: dataType\n\t\t};\n\n\t\tif ( 'object' === typeof extend ) {\n\t\t\tstage = $.extend( stage, extend );\n\t\t}\n\n\t\tthis.addStageModel( stage );\n\n\t\tthis.trigger( 'stage:added', this.get( 'stageModels' )[ name ] );\n\t\tthis.get( 'stageModels' )[ name ].on( 'change', function() {\n\t\t\tthis.trigger( 'change' );\n\t\t}, this );\n\n\t\treturn this.getStageModel( stage.name );\n\t},\n\taddStageItem: function( stage, name, size, rows, displayName = '' ) {\n\t\tthis.getStageModel( stage ).addItem( name, size, rows, displayName );\n\t},\n\taddStageModel: function( stage ) {\n\t\tvar stages = this.get( 'stages' );\n\t\tvar stageModels = this.get( 'stageModels' );\n\t\tvar newStageModel = new MigrationProgressStageModel( stage );\n\n\t\tstages.push( stage );\n\t\tstageModels[ stage.name ] = newStageModel;\n\n\t\tthis.set( 'stages', stages );\n\t\tthis.set( 'stageModels', stageModels );\n\t},\n\tgetStageModel: function( name ) {\n\t\treturn this.get( 'stageModels' )[ name ];\n\t},\n\tgetStageItems: function( stage, map ) {\n\t\tvar stageModel = this.getStageModel( stage );\n\t\tvar items = stageModel.get( 'items' );\n\n\t\tif ( undefined === map ) {\n\t\t\treturn items;\n\t\t} else {\n\t\t\treturn items.map( function( item ) {\n\t\t\t\treturn item[ map ];\n\t\t\t} );\n\t\t}\n\t},\n\tsetActiveStage: function( stage ) {\n\t\tthis.setStageComplete();\n\t\tthis.set( 'activeStageName', stage );\n\t\tthis.getStageModel( stage ).set( 'status', 'active' );\n\t\tthis.trigger( 'change:activeStage' );\n\t},\n\tsetStageComplete: function( stage ) {\n\t\tif ( ! stage ) {\n\t\t\tstage = this.get( 'activeStageName' );\n\t\t}\n\t\tif ( null !== stage ) {\n\t\t\tthis.getStageModel( stage ).set( 'status', 'complete' );\n\t\t}\n\n\t\twpmdb.current_migration.currentStageNum = wpmdb.current_migration.currentStageNum + 1;\n\t},\n\tsetMigrationComplete: function() {\n\t\tvar lastStage = this.getStageModel( this.get( 'activeStageName' ) );\n\t\tthis.setStageComplete();\n\t\tthis.trigger( 'migrationComplete' );\n\t\tthis.set( 'migrationStatus', 'complete' );\n\t\tlastStage.activateTab();\n\t}\n} );\n\nmodule.exports = MigrationProgressModel;\n\n\n\n// WEBPACK FOOTER //\n// ./src/wp-migrate-db-pro/asset/src/js/modules/MigrationProgress-model.js","var $ = jQuery;\nvar MigrationProgressStage = Backbone.Model.extend( {\n\tdefaults: {\n\t\tstatus: 'queued',\n\t\t_initialItems: null,\n\t\titems: null,\n\t\tnames: null,\n\t\tlookupItems: null,\n\t\ttotalSize: 0,\n\t\ttotalTransferred: 0,\n\t\tdataType: 'local',\n\t\tname: '',\n\t\titemsComplete: 0,\n\t\titemsCompleteArr: [],\n\t\tstrings: null\n\t},\n\tinitialize: function() {\n\t\tthis.initStrings();\n\n\t\tthis.set( '_initialItems', this.get( 'items' ).slice() );\n\t\tthis.set( 'items', [] );\n\t\tthis.set( 'names', [] );\n\t\tthis.set( 'lookupItems', {} );\n\t\tthis.set( 'itemsCompleteArr', [] );\n\n\t\t_.each( this.get( '_initialItems' ), function( item ) {\n\t\t\tthis.addItem( item.name, item.size, item.rows );\n\t\t}, this );\n\n\t\tthis.on( 'view:initialized', this.triggerItemViewInit );\n\n\t\tthis.on( 'change', function() {\n\t\t\twpmdb.current_migration.updateTitleElem();\n\t\t} );\n\t},\n\tinitStrings: function() {\n\t\tvar default_strings = {\n\t\t\tstage_title: this.get( 'name' ),\n\t\t\tmigrated: wpmdb_strings.migrated,\n\t\t\tqueued: wpmdb_strings.queued,\n\t\t\tactive: wpmdb_strings.running,\n\t\t\tcomplete: wpmdb_strings.complete,\n\t\t\thide: wpmdb_strings.hide,\n\t\t\tshow: wpmdb_strings.show,\n\t\t\titemsName: wpmdb_strings.tables\n\t\t};\n\t\tvar strings = this.get( 'strings' );\n\n\t\tstrings = ('object' === typeof strings) ? strings : {};\n\t\tstrings = $.extend( default_strings, strings );\n\n\t\tstrings.items_migrated = strings.itemsName + ' ' + strings.migrated;\n\t\tstrings.hide_items = strings.hide + ' ' + strings.itemsName;\n\t\tstrings.show_items = strings.show + ' ' + strings.itemsName;\n\n\t\tthis.set( 'strings', strings );\n\t},\n\taddItem: function( name, size, rows, displayName ) {\n\t\tvar items = this.get( 'items' );\n\t\tvar names = this.get( 'names' );\n\t\tif ( ~names.indexOf( name ) ) {\n\t\t\treturn;\n\t\t}\n\t\tnames.push( name );\n\t\tvar item = {\n\t\t\tname: name,\n\t\t\tsize: size,\n\t\t\trows: rows || size,\n\t\t\tstageName: this.get( 'name' ),\n\t\t\ttransferred: 0,\n\t\t\trowsTransferred: 0,\n\t\t\tcomplete: false,\n\n\t\t\ttitle: null,\n\t\t\tget $title() {\n\t\t\t\treturn this.title || this.createTitleElem()\n\t\t\t},\n\t\t\tset $title( title ) {\n\t\t\t\tthis.title = title\n\t\t\t},\n\t\t\tcreateTitleElem: function() {\n\t\t\t\tthis.title = $( '<p>' ).addClass( 'item-info' )\n\t\t\t\t\t.append( $( '<span class=\"name\" />' ).text( this.displayName || this.name ) )\n\t\t\t\t\t.append( ' ' )\n\t\t\t\t\t.append( $( '<span class=\"size\" />' ).text( '(' + wpmdb.functions.convertKBSizeToHRFixed( item.size ) + ')' ) );\n\t\t\t\treturn this.title\n\t\t\t},\n\n\t\t\tprogress: null,\n\t\t\tget $progress() {\n\t\t\t\treturn this.progress || this.createProgElem()\n\t\t\t},\n\t\t\tset $progress( prog ) {\n\t\t\t\tthis.progress = prog\n\t\t\t},\n\t\t\tcreateProgElem: function() {\n\t\t\t\tthis.progress = $( '<div class=\"progress-bar\"/>' ).css( 'width', '0%' );\n\t\t\t\treturn this.progress;\n\t\t\t},\n\n\t\t\tel: null,\n\t\t\tget $el() {\n\t\t\t\treturn this.el || this.createMainElem()\n\t\t\t},\n\t\t\tset $el( el ) {\n\t\t\t\tthis.el = el\n\t\t\t},\n\t\t\tcreateMainElem: function() {\n\t\t\t\tthis.el = $( '<div class=\"item-progress\" />' );\n\t\t\t\tthis.el.append( this.$title );\n\t\t\t\tthis.el.append( this.$progress );\n\t\t\t\tthis.el.append( '<span class=\"dashicons dashicons-yes\"/>' );\n\t\t\t\tthis.el.attr( 'id', 'item-' + this.name );\n\t\t\t\tthis.el.attr( 'data-stage', this.stageName );\n\t\t\t\treturn this.el;\n\t\t\t},\n\n\t\t\tupdateProgress( percent ) {\n\t\t\t\tvar $progress = this.$progress;\n\t\t\t\twindow.requestAnimationFrame( function() {\n\t\t\t\t\t$progress.css( 'width', percent + '%' )\n\t\t\t\t}.bind( this ) );\n\t\t\t},\n\n\t\t};\n\n\t\t// Only add the displayName if it's not empty\n\t\tif ( 'undefined' !== typeof(displayName) && displayName.length ) {\n\t\t\titem.displayName = displayName;\n\t\t}\n\n\t\titems.push( item );\n\n\t\tthis.get( 'lookupItems' )[ name ] = items.length - 1;\n\n\t\tthis.set( 'totalSize', parseFloat( this.get( 'totalSize' ) ) + parseFloat( size ) );\n\t\tthis.trigger( 'item:added', item );\n\t},\n\ttriggerItemViewInit: function() {\n\t\tvar items = this.get( 'items' );\n\t\tvar self = this;\n\t\t_.each( items, function( item ) {\n\t\t\tself.trigger( 'item:added', item );\n\t\t} );\n\t},\n\tgetTotalSizeTransferred: function() {\n\t\treturn this.get( 'totalTransferred' );\n\t},\n\tcountItemsComplete: function() {\n\t\treturn this.get( 'itemsComplete' );\n\t},\n\tgetTotalProgressPercent: function() {\n\t\tvar transferred = this.getTotalSizeTransferred();\n\t\tvar total = this.get( 'totalSize' );\n\t\tif ( 0 >= transferred || 0 >= total ) {\n\t\t\treturn 0;\n\t\t}\n\t\tconst percent_transferred = Math.min( 100, Math.round( (transferred / total) * 100 ) );\n\t\treturn percent_transferred;\n\t},\n\tactivateTab: function() {\n\t\tthis.trigger( 'activateTab' );\n\t\twpmdb.current_migration.model.trigger( 'change:activeStage' );\n\t},\n\tsetItemComplete: function( itemName ) {\n\n\t\t// Guard: return if item has already been set complete\n\t\tvar itemsCompleteArr = this.get( 'itemsCompleteArr' );\n\t\tif ( ~itemsCompleteArr.indexOf( itemName ) ) {\n\t\t\treturn;\n\t\t}\n\t\titemsCompleteArr.push( itemName );\n\n\t\tvar item = this.getItemByName( itemName );\n\t\tvar totalTransferred = this.get( 'totalTransferred' );\n\t\tvar itemsComplete = this.get( 'itemsComplete' );\n\n\t\tthis.set( 'itemsComplete', ++itemsComplete );\n\n\t\ttotalTransferred += item.size - item.transferred;\n\t\tthis.set( 'totalTransferred', totalTransferred );\n\n\t\titem.transferred = item.size;\n\t\titem.complete = true;\n\t\titem.rowsTransferred = item.rows;\n\n\t\tthis.trigger( 'change change:items', item );\n\t},\n\tsetItemPercentTransferred( itemName, percentTransferred, batchSize, folderTransferred ) {\n\t\tlet item = this.getItemByName( itemName );\n\t\tlet transferred = batchSize / 1000;\n\n\t\tif ( 1 === percentTransferred ) {\n\t\t\titem.complete = true;\n\t\t\titem.transferred = transferred;\n\t\t\tlet itemsComplete = this.get( 'itemsComplete' );\n\t\t\tthis.set( 'itemsComplete', ++itemsComplete );\n\t\t\tthis.trigger( 'change change:items', item );\n\t\t}\n\t\titem.transferred = folderTransferred / 1000;\n\t\titem.exactPercent = percentTransferred;\n\t\tlet total_transferred = this.get( 'totalTransferred' );\n\t\ttotal_transferred += transferred;\n\n\t\tthis.set( 'totalTransferred', total_transferred );\n\t\tthis.trigger( 'change change:items', item );\n\t},\n\tsetItemRowsTransferred: function( itemName, numRows ) {\n\t\tvar amtDone, estTransferred;\n\t\tvar item = this.getItemByName( itemName );\n\t\tvar totalTransferred = this.get( 'totalTransferred' );\n\n\t\tif ( -1 === parseInt( numRows ) ) {\n\t\t\tamtDone = 1;\n\t\t} else {\n\t\t\tamtDone = Math.min( 1, numRows / item.rows );\n\t\t}\n\n\t\tif ( 1 === amtDone ) {\n\t\t\tthis.setItemComplete( itemName );\n\t\t\treturn;\n\t\t}\n\n\t\testTransferred = item.size * amtDone;\n\n\t\ttotalTransferred += estTransferred - item.transferred;\n\t\tthis.set( 'totalTransferred', totalTransferred );\n\n\t\titem.transferred = estTransferred;\n\t\titem.rowsTransferred = numRows;\n\t\tthis.trigger( 'change change:items', item );\n\t},\n\tgetItemByName: function( itemName ) {\n\t\tvar item = this.get( 'items' )[ this.get( 'lookupItems' )[ itemName ] ] || {};\n\t\tif ( itemName === item.name ) {\n\t\t\treturn item;\n\t\t} else {\n\t\t\treturn this.determineItemByName( itemName );\n\t\t}\n\t},\n\tdetermineItemByName: function( itemName ) {\n\t\tvar items = this.get( 'items' );\n\t\tfor ( var index = 0; index < items.length; index++ ) {\n\t\t\tvar item = items[ index ];\n\t\t\tif ( itemName === item.name ) {\n\t\t\t\tthis.get( 'lookupItems' ).itemName = index;\n\t\t\t\treturn item;\n\t\t\t}\n\t\t}\n\t}\n} );\n\nmodule.exports = MigrationProgressStage;\n\n\n\n// WEBPACK FOOTER //\n// ./src/wp-migrate-db-pro/asset/src/js/modules/MigrationProgressStage-model.js","var MigrationProgressStageView = require( './MigrationProgressStage-view.js' );\nvar $ = jQuery;\n\nvar MigrationProgressView = Backbone.View.extend( {\n\ttagName: 'div',\n\tclassName: 'migration-progress-stages',\n\tid: 'migration-progress-stages',\n\tself: this,\n\tinitialize: function() {\n\t\tthis.$el.empty();\n\n\t\tthis.model.on( 'stage:added', function( stageModel ) {\n\t\t\tthis.addStageView( stageModel );\n\t\t}, this );\n\n\t\t_.each( this.model.get( 'stageModels' ), this.addStageView, this );\n\t},\n\taddStageView: function( stageModel ) {\n\t\tvar newStageSubView = new MigrationProgressStageView( {\n\t\t\tmodel: stageModel\n\t\t} );\n\t\tstageModel.trigger( 'view:initialized', newStageSubView );\n\t\tthis.$el.append( newStageSubView.$el );\n\t\tthis.$el.parent().find( '.stage-tabs' ).append( newStageSubView.$tabElem );\n\t}\n} );\n\nmodule.exports = MigrationProgressView;\n\n\n\n// WEBPACK FOOTER //\n// ./src/wp-migrate-db-pro/asset/src/js/modules/MigrationProgress-view.js","var $ = jQuery;\n\nvar MigrationProgressStageView = Backbone.View.extend( {\n\ttagName: 'div',\n\tclassName: 'migration-progress-stage-container hide-tables',\n\t$totalProgressElem: null,\n\t$tabElem: null,\n\t$showHideTablesElem: null,\n\t$pauseBeforeFinalizeElem: null,\n\t$pauseBeforeFinalizeCheckbox: null,\n\t$itemsContainer: null,\n\titemViews: null,\n\tmaxDomNodes: 140,\n\tvisibleDomNodes: 0,\n\titemCount: 0,\n\tpercentDone: 0,\n\tsizeDone: 0,\n\ttablesDone: 0,\n\tqueuedElements: null,\n\t$truncationNotice: null,\n\t$truncationNoticeHiddenItems: null,\n\tshouldHideItemProgress: false,\n\tinitialize: function() {\n\t\tthis.$el.empty();\n\t\tthis.$el.attr( 'data-stage', this.model.get( 'name' ) ).addClass( 'queued ' + this.model.get( 'name' ) );\n\n\t\tthis.queuedElements = [];\n\n\t\tthis.initTotalProgressElem();\n\t\twpmdb.current_migration.view.$el.parent().find( '.stage-tabs' ).after( this.$totalProgressElem );\n\n\t\tthis.$itemsContainer = $( '<div class=progress-items />' );\n\t\tthis.$el.append( this.$itemsContainer );\n\n\t\tthis.initTabElem();\n\n\t\tthis.model.on( 'item:added', this.maybeAddElementToView, this );\n\n\t\t_.each( this.model.get( 'itemModels' ), this.maybeAddElementToView, this );\n\t\tthis.model.on( 'change', function() {\n\t\t\tthis.updateProgressElem();\n\t\t\tthis.updateStageTotals();\n\t\t}, this );\n\n\t\tthis.model.on( 'change:status', function( e ) {\n\t\t\tthis.$el.removeClass( 'queued active' ).addClass( this.model.get( 'status' ) );\n\t\t\tthis.$totalProgressElem.removeClass( 'queued active' ).addClass( this.model.get( 'status' ) );\n\t\t\tthis.$tabElem.removeClass( 'queued active' ).addClass( this.model.get( 'status' ) )\n\t\t\t\t.find( '.stage-status' ).text( this.model.get( 'strings' )[ this.model.get( 'status' ) ] );\n\t\t}, this );\n\n\t\tthis.model.on( 'change:items', function( item ) {\n\t\t\tif ( item.name ) {\n\t\t\t\tthis.setItemProgress( item );\n\t\t\t}\n\t\t}, this );\n\n\t\tthis.model.on( 'activateTab', function() {\n\t\t\tif ( 'complete' === wpmdb.current_migration.model.get( 'migrationStatus' ) ) {\n\t\t\t\tthis.$totalProgressElem.addClass( 'active' ).siblings().removeClass( 'active' );\n\t\t\t\tthis.$tabElem.addClass( 'active' ).siblings().removeClass( 'active' );\n\t\t\t\tthis.$el.addClass( 'active' ).siblings().removeClass( 'active' );\n\t\t\t}\n\t\t}, this );\n\t},\n\tinitTotalProgressElem: function() {\n\t\tthis.initShowHideTablesElem();\n\t\tthis.initPauseBeforeFinalizeElem();\n\n\t\tthis.$totalProgressElem = $( '<div class=\"stage-progress ' + this.model.get( 'name' ) + '\" />' )\n\t\t\t.append( '<span class=percent-complete>0</span>% ' + this.model.get( 'strings' ).complete + ' ' )\n\t\t\t.append( '<span class=\"size-complete-wrap\">(<span class=size-complete>0 MB</span> / <span class=size-total>0 MB</span>) </span>' )\n\t\t\t.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>' )\n\t\t\t.append( this.$showHideTablesElem )\n\t\t\t.append( '<div class=progress-bar-wrapper><div class=progress-bar /></div>' );\n\n\t\tthis.updateStageTotals();\n\t},\n\tinitShowHideTablesElem: function() {\n\t\tthis.$showHideTablesElem = $( '<a class=show-hide-tables/>' ).text( this.model.get( 'strings' ).show_items );\n\t\tvar self = this;\n\t\tthis.$showHideTablesElem.on( 'click show-hide-progress-tables', function() {\n\t\t\tvar progTablesHidden;\n\t\t\tif ( self.$el.hasClass( 'hide-tables' ) ) { // show tables\n\t\t\t\tprogTablesHidden = false;\n\t\t\t\tself.$el.add( self.$el.siblings() ).removeClass( 'hide-tables' );\n\t\t\t\tself.$showHideTablesElem.text( self.model.get( 'strings' ).hide_items );\n\t\t\t} else { // hide tables\n\t\t\t\tprogTablesHidden = true;\n\t\t\t\tself.$el.add( self.$el.siblings() ).addClass( 'hide-tables' );\n\t\t\t\tself.$showHideTablesElem.text( self.model.get( 'strings' ).show_items );\n\t\t\t}\n\n\t\t\tif ( Boolean( progTablesHidden ) !== Boolean( wpmdb_data.prog_tables_hidden ) ) {\n\t\t\t\twpmdb_data.prog_tables_visibility_changed = true;\n\t\t\t\twpmdb_data.prog_tables_hidden = progTablesHidden;\n\t\t\t}\n\t\t} );\n\n\t\t// show progress tables on init if hidden is false\n\t\tif ( !wpmdb_data.prog_tables_hidden ) {\n\t\t\tthis.$showHideTablesElem.triggerHandler( 'show-hide-progress-tables' );\n\t\t}\n\n\t\t// make sure text reflects current state when showing\n\t\tthis.model.on( 'change:status activateTab', function() {\n\t\t\tif ( wpmdb_data.prog_tables_hidden ) {\n\t\t\t\tself.$showHideTablesElem.text( self.model.get( 'strings' ).show_items );\n\t\t\t} else {\n\t\t\t\tself.$showHideTablesElem.text( self.model.get( 'strings' ).hide_items );\n\t\t\t}\n\t\t} );\n\t},\n\tinitPauseBeforeFinalizeElem: function() {\n\t\tthis.$pauseBeforeFinalizeElem = $( '.pause-before-finalize' );\n\t\tthis.$pauseBeforeFinalizeCheckbox = this.$pauseBeforeFinalizeElem.find( 'input[type=checkbox]' );\n\t\tvar self = this;\n\t\tvar isChecked = false;\n\t\tvar migrationIntent = wpmdb.current_migration.model.get( 'migrationIntent' );\n\n\t\t// make sure checkbox is checked based on current state\n\t\tif ( wpmdb_data.pause_before_finalize ) {\n\t\t\tisChecked = true;\n\t\t}\n\t\tthis.$pauseBeforeFinalizeCheckbox.prop( 'checked', isChecked );\n\n\t\t// only display on certain migrations\n\t\tif ( -1 !== $.inArray( migrationIntent, [ 'push', 'pull', 'find_replace', 'import' ] ) ) {\n\t\t\tif ( 'find_replace' === migrationIntent ) {\n\t\t\t\t$( '#pause-before-finalize-label' ).text( wpmdb_strings.pause_before_finalize_find_replace );\n\t\t\t}\n\t\t\tthis.$pauseBeforeFinalizeElem.show();\n\t\t} else {\n\t\t\tthis.$pauseBeforeFinalizeElem.hide();\n\t\t}\n\n\t\t// hide on media stage\n\t\twpmdb.current_migration.model.on( 'change:activeStage', function() {\n\t\t\tif ( -1 !== $.inArray( wpmdb.current_migration.model.get( 'activeStageName' ), [\n\t\t\t\t'media',\n\t\t\t\t'themes',\n\t\t\t\t'plugins'\n\t\t\t] ) ) {\n\t\t\t\tself.$pauseBeforeFinalizeElem.hide();\n\t\t\t}\n\t\t} );\n\n\t\tthis.$pauseBeforeFinalizeElem.on( 'click', function() {\n\t\t\tvar pauseBeforeFinalizeValue = Boolean( self.$pauseBeforeFinalizeCheckbox.is( ':checked' ) );\n\t\t\tif ( pauseBeforeFinalizeValue !== Boolean( wpmdb_data.pause_before_finalize ) ) {\n\t\t\t\twpmdb_data.pause_before_finalize_changed = true;\n\t\t\t\twpmdb_data.pause_before_finalize = pauseBeforeFinalizeValue;\n\t\t\t}\n\t\t} );\n\t},\n\tinitTabElem: function() {\n\t\tvar self = this;\n\t\tthis.$tabElem = $( '<a class=stage-tab>' )\n\t\t\t.append( '<span class=stage-title>' + this.model.get( 'strings' ).stage_title + '</span> ' )\n\t\t\t.append( '<span class=stage-status>' + this.model.get( 'strings' ).queued + '</span> ' )\n\t\t\t.on( 'click', function() {\n\t\t\t\tself.model.activateTab();\n\t\t\t} );\n\t},\n\tupdateProgressElem: function() {\n\t\tvar percentDone = Math.max( 0, this.model.getTotalProgressPercent() );\n\t\tvar sizeDone = wpmdb.functions.convertKBSizeToHRFixed( Math.min( this.model.getTotalSizeTransferred(), this.model.get( 'totalSize' ) ) );\n\t\tvar tablesDone = Math.min( this.model.countItemsComplete(), this.model.get( 'items' ).length );\n\n\t\tif ( 'complete' === this.model.get( 'status' ) && 0 === this.model.get( 'totalSize' ) ) {\n\t\t\tpercentDone = 100;\n\t\t\tthis.$showHideTablesElem.fadeOut();\n\t\t}\n\n\t\tif ( percentDone !== this.percentDone ) {\n\t\t\tthis.percentDone = percentDone;\n\t\t\tthis.$totalProgressElem.find( '.percent-complete' ).text( percentDone );\n\t\t\tthis.$totalProgressElem.find( '.progress-bar-wrapper .progress-bar' ).css( { width: percentDone + '%' } );\n\t\t}\n\t\tif ( sizeDone != this.sizeDone ) {\n\t\t\tthis.sizeDone = sizeDone;\n\t\t\tthis.$totalProgressElem.find( '.size-complete' ).text( sizeDone );\n\t\t}\n\t\tif ( tablesDone != this.tablesDone ) {\n\t\t\tthis.tablesDone = tablesDone;\n\t\t\tthis.$totalProgressElem.find( '.items-complete' ).text( wpmdb.functions.wpmdb_add_commas( tablesDone ) );\n\t\t}\n\t},\n\tupdateStageTotals: function( itemCount ) {\n\t\titemCount = itemCount || this.model.get( 'items' ).length;\n\t\tif ( itemCount === this.itemCount ) {\n\t\t\treturn;\n\t\t}\n\t\tthis.itemCount = itemCount;\n\t\tthis.$totalProgressElem.find( '.items-total' ).text( wpmdb.functions.wpmdb_add_commas( itemCount ) );\n\t\tthis.$totalProgressElem.find( '.size-total' ).text( wpmdb.functions.convertKBSizeToHRFixed( this.model.get( 'totalSize' ) ) );\n\n\t\tif ( !this.shouldHideItemProgress && 500 < itemCount ) {\n\t\t\tlet stageName = this.model.get( 'name' ).toLowerCase();\n\t\t\tif ( 'themes' == stageName || 'plugins' === stageName ) {\n\t\t\t\tthis.hideItemProgress();\n\t\t\t}\n\t\t}\n\t},\n\thideItemProgress: function() {\n\t\tif ( this.shouldHideItemProgress ) {\n\t\t\treturn;\n\t\t}\n\t\tthis.shouldHideItemProgress = true;\n\t\tthis.$itemsContainer.empty();\n\t\tif ( this.$showHideTablesElem ) {\n\t\t\tthis.$showHideTablesElem.hide();\n\t\t}\n\t},\n\tmaybeAddElementToView: function( item ) {\n\t\tvar maxDomNodes = this.shouldHideItemProgress ? 0 : this.maxDomNodes;\n\t\tif ( this.visibleDomNodes < maxDomNodes ) {\n\t\t\t++this.visibleDomNodes;\n\t\t\tthis.$itemsContainer.append( item.$el );\n\t\t} else {\n\t\t\tthis.queuedElements.push( item );\n\t\t\tif ( !this.$truncationNotice ) {\n\t\t\t\tthis.showTruncationNotice();\n\t\t\t} else {\n\t\t\t\tthis.updateTruncationNotice();\n\t\t\t}\n\t\t}\n\t},\n\tshowTruncationNotice: function() {\n\t\tif ( this.$truncationNotice ) {\n\t\t\treturn;\n\t\t}\n\t\tvar hiddenItemsCount = this.shouldHideItemProgress ? this.model.get( 'items' ).length : this.queuedElements.length;\n\t\tthis.$truncationNotice = $( '<div class=\"truncation-notice\" >' + wpmdb_strings.progress_items_truncated_msg.replace( '%1$s', '<span class=\"hidden-items\">' + wpmdb.functions.wpmdb_add_commas( hiddenItemsCount ) + '</span>' ) + '</div>' );\n\t\tthis.$truncationNoticeHiddenItems = this.$truncationNotice.find( '.hidden-items' );\n\t\tthis.$itemsContainer.after( this.$truncationNotice );\n\t},\n\tupdateTruncationNotice: function() {\n\t\tvar hiddenItemsCount = this.shouldHideItemProgress ? this.model.get( 'items' ).length : this.queuedElements.length;\n\t\tthis.$truncationNoticeHiddenItems.text( wpmdb.functions.wpmdb_add_commas( hiddenItemsCount ) );\n\t},\n\tgetNextElementForView: function( $el ) {\n\t\tvar queueItem;\n\n\t\tif ( this.shouldHideItemProgress ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( this.queuedElements.length ) {\n\t\t\tif ( $el ) {\n\t\t\t\tthis.queuedElements.push( $el );\n\t\t\t}\n\t\t\tqueueItem = this.queuedElements.shift();\n\t\t\tif ( queueItem instanceof $ ) {\n\t\t\t\t$el = queueItem;\n\t\t\t} else {\n\t\t\t\t$el = queueItem.$el;\n\t\t\t}\n\t\t}\n\t\treturn $el;\n\t},\n\tsetItemProgress: function( item ) {\n\t\tvar percentDone = Math.min( 100, Math.ceil( 100 * (item.transferred / item.size) ) );\n\n\t\tif ( item.hasOwnProperty( 'exactPercent' ) ) {\n\t\t\tpercentDone = 100 * item.exactPercent;\n\t\t}\n\n\t\tif ( 0 === item.size ) {\n\t\t\tpercentDone = 100;\n\t\t}\n\n\t\titem.updateProgress( percentDone )\n\t\tif ( 100 <= percentDone || 0 === item.size ) {\n\t\t\tthis.elemComplete( item );\n\t\t}\n\t},\n\telemComplete: function( item ) {\n\t\tif ( this.shouldHideItemProgress ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar $el = item.$el.addClass( 'complete' );\n\n\t\t// skip moving item to end of list if there's only one item in the list\n\t\tvar numItems = this.model.get( 'items' ).length;\n\t\tif ( 1 === numItems ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar $nextEl = this.getNextElementForView( $el );\n\n\t\tvar height = $el.height();\n\t\tvar marginBottom = $el.css( 'margin-bottom' );\n\n\t\tvar $clone = false;\n\t\tif ( $nextEl === $el ) {\n\t\t\t$clone = $nextEl.clone().css( {\n\t\t\t\theight: 0,\n\t\t\t\tmarginBottom: 0,\n\t\t\t\tdisplay: 'block'\n\t\t\t} ).addClass( 'clone complete' );\n\t\t\t$clone.appendTo( this.$itemsContainer );\n\t\t}\n\t\t$el.css( { height: height, marginBottom: marginBottom } );\n\n\t\tsetTimeout( function() {\n\t\t\t$el.css( { height: 0, marginBottom: 0 } );\n\n\t\t\tvar timeout = 0;\n\t\t\tif ( $clone ) {\n\t\t\t\ttimeout = 250;\n\t\t\t\t$clone.css( { height: height, marginBottom: marginBottom } );\n\t\t\t\t$clone.find('.progress-bar').addClass('progress-bar-no-transition').css({width: '100%'});\n\t\t\t}\n\t\t\t\n\t\t\tsetTimeout( function() {\n\t\t\t\t$el.css( { display: 'none' } );\n\t\t\t\t$el.remove();\n\t\t\t\t$clone && $clone.remove();\n\n\t\t\t\tthis.$itemsContainer.find( '.item-progress:not(.clone)' ).last().after( $nextEl.css( {\n\t\t\t\t\theight: 'auto',\n\t\t\t\t\tmarginBottom: marginBottom,\n\t\t\t\t\tdisplay: 'block'\n\t\t\t\t} ) );\n\t\t\t}.bind( this ), timeout );\n\n\t\t}.bind( this ), 1000 );\n\n\t}\n} );\n\nmodule.exports = MigrationProgressStageView;\n\n\n\n// WEBPACK FOOTER //\n// ./src/wp-migrate-db-pro/asset/src/js/modules/MigrationProgressStage-view.js","var $ = jQuery;\n\nmodule.exports = {\n\tupdateProgTableVisibilitySetting: function() {\n\t\tif ( ! wpmdb_data.prog_tables_visibility_changed ) {\n\t\t\treturn;\n\t\t}\n\t\twpmdb_data.prog_tables_visibility_changed = false;\n\n\t\t$.ajax( {\n\t\t\turl: ajaxurl,\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'text',\n\t\t\tcache: false,\n\t\t\tdata: {\n\t\t\t\taction: 'wpmdb_save_setting',\n\t\t\t\tnonce: wpmdb_data.nonces.save_setting,\n\t\t\t\tsetting: 'prog_tables_hidden',\n\t\t\t\tchecked: Boolean( wpmdb_data.prog_tables_hidden )\n\t\t\t},\n\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\tconsole.log( 'Could not save progress item visibility setting', errorThrown );\n\t\t\t}\n\t\t} );\n\t},\n\tupdatePauseBeforeFinalizeSetting: function() {\n\t\tif ( ! wpmdb_data.pause_before_finalize_changed ) {\n\t\t\treturn;\n\t\t}\n\t\twpmdb_data.pause_before_finalize_changed = false;\n\n\t\t$.ajax( {\n\t\t\turl: ajaxurl,\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'text',\n\t\t\tcache: false,\n\t\t\tdata: {\n\t\t\t\taction: 'wpmdb_save_setting',\n\t\t\t\tnonce: wpmdb_data.nonces.save_setting,\n\t\t\t\tsetting: 'pause_before_finalize',\n\t\t\t\tchecked: Boolean( wpmdb_data.pause_before_finalize )\n\t\t\t},\n\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\tconsole.log( 'Could not save pause before finalize setting', errorThrown );\n\t\t\t}\n\t\t} );\n\t}\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/wp-migrate-db-pro/asset/src/js/modules/MigrationProgress-utils.js","import WPMDBCommon from './src/js/helpers/wpmdbCommon';\n\nwindow.wpmdb = {\n\tfunctions : {},\n\tcommon : {\n\t\thooks: [],\n\t\tcall_stack: [],\n\t\tnon_fatal_errors: '',\n\t\tmigration_error: false\n\t}\n};\n\nwpmdb.functions = new WPMDBCommon();\n\nfunction importAll( require ) {\n\trequire.keys().forEach( function( file ) {\n\t\tif ( !file.includes( 'wpmdbCommon.js' ) ) {\n\t\t\trequire( file );\n\t\t}\n\t} );\n}\n\nimportAll( \n\trequire.context( \n\t\t'imports-loader?$=>window.jQuery!./src', true, /^(.*\\.(js|sass|scss$))/im\n\t)\n );\n\n\n\n// WEBPACK FOOTER //\n// ./src/wp-migrate-db-pro/asset/webpack.index.js","/**\n * Wrapper for wpmdb.functions, assigned in Webpack entry file\n */\nexport default class WPMDBCommon {\n\tconstructor() {}\n\t/**\n\t * Toggle proper translated strings based on migration type selected.\n\t *\n\t * To show the properly translated strings for the selected push or pull\n\t * migration type, we need to hide all strings then show the right\n\t * translated strings based on the migration type selected.\n\t *\n\t * @see https://github.com/deliciousbrains/wp-migrate-db-pro/issues/764\n\t *\n\t * @return void\n\t */\n\twpmdb_toggle_migration_action_text() {\n\t\tjQuery( '.action-text' ).hide();\n\t\tjQuery( '.action-text.' + jQuery( 'input[name=action]:checked' ).val() ).show();\n\t}\n\n\t/**\n\t * Return the currently selected migration type selected.\n\t *\n\t * @return string Will return `push`, `pull`, `savefile`, or `` for exporting as a file.\n\t */\n\twpmdb_migration_type() {\n\t\tvar action = jQuery( 'input[name=action]:checked' );\n\t\tif ( 0 === action.length ) {\n\t\t\treturn '';\n\t\t}\n\t\treturn action.val();\n\t}\n\n\n\twpmdb_call_next_hook( ) {\n\t\tconst wpmdb = window.wpmdb;\n\t\tif ( !wpmdb.common.call_stack.length ) {\n\t\t\twpmdb.common.call_stack = wpmdb.common.hooks;\n\t\t}\n\n\t\tvar func = wpmdb.common.call_stack[ 0 ];\n\t\twpmdb.common.call_stack.shift();\n\t\tfunc.call( this );\n\t}\n\n\twpmdb_add_commas( number_string ) {\n\t\tnumber_string += '';\n\t\tvar number_parts = number_string.split( '.' );\n\t\tvar integer = number_parts[ 0 ];\n\t\tvar decimal = 1 < number_parts.length ? '.' + number_parts[ 1 ] : '';\n\t\tvar rgx = /(\\d+)(\\d{3})/;\n\t\twhile ( rgx.test( integer ) ) {\n\t\t\tinteger = integer.replace( rgx, '$1' + ',' + '$2' );\n\t\t}\n\t\treturn integer + decimal;\n\t}\n\n\twpmdb_parse_json( maybe_json ) {\n\t\tvar json_object = {};\n\t\ttry {\n\t\t\tjson_object = jQuery.parseJSON( maybe_json );\n\t\t}\n\t\tcatch ( e ) {\n\n\t\t\t// We simply return false here because the json data itself will never just contain a value of \"false\"\n\t\t\treturn false;\n\t\t}\n\t\treturn json_object;\n\t}\n\n\t/**\n\t * Global error method for detecting PHP or other errors in AJAX response\n\t *\n\t * @param title - the error title if not a PHP error\n\t * @param code - the error code if not a PHP error\n\t * @param text - the AJAX response text to sniff for errors\n\t * @param jqXHR - optional AJAX object used to enrich the error message\n\t *\n\t * @returns {string} - html error string with view error toggle element\n\t */\n\twpmdbGetAjaxErrors( title, code, text, jqXHR ) {\n\t\tvar jsonErrors = false;\n\t\tvar html = '';\n\n\t\tvar validJson = this.wpmdb_parse_json( text );\n\t\tif ( false === validJson ) {\n\t\t\tjsonErrors = true;\n\t\t\ttitle = wpmdb_strings.ajax_json_message;\n\t\t\tcode = '(#144)';\n\t\t\tvar originalText = text;\n\t\t\ttext = wpmdb_strings.ajax_json_errors + ' ' + code;\n\t\t\ttext += '<br><a class=\"show-errors-toggle\" href=\"#\">' + wpmdb_strings.view_error_messages + '</a> ';\n\t\t\ttext += '<div class=\"migration-php-errors\">' + originalText + '</div>';\n\t\t}\n\n\t\t// Only add local connection issue if php errors (#144) or jqXHR has been provided\n\t\tif ( jsonErrors || 'undefined' !== jqXHR ) {\n\t\t\thtml += '<strong>' + title + '</strong>' + ' — ';\n\t\t}\n\n\t\t// Only add extra error details if not php errors (#144) and jqXHR has been provided\n\t\tif ( !jsonErrors && 'undefined' !== jqXHR ) {\n\t\t\thtml += wpmdb_strings.status + ': ' + jqXHR.status + ' ' + jqXHR.statusText;\n\t\t\thtml += '<br /><br />' + wpmdb_strings.response + ':<br />';\n\t\t}\n\n\t\t// Add code to the end of the error text if not json errors\n\t\tif ( !jsonErrors ) {\n\t\t\ttext += ' ' + code;\n\t\t}\n\n\t\t// Finally add the error message to the output\n\t\thtml += text;\n\n\t\treturn html;\n\t}\n\n\t/**\n\t * @TODO convert to functions object\n\t * @param str\n\t * @param delimiter\n\t * @returns {string}\n\t */\n\tpreg_quote( str, delimiter ) {\n\n\t\t// discuss at: http://phpjs.org/functions/preg_quote/\n\t\t// original by: booeyOH\n\t\t// improved by: Ates Goral (http://magnetiq.com)\n\t\t// improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n\t\t// improved by: Brett Zamir (http://brett-zamir.me)\n\t\t// bugfixed by: Onno Marsman\n\t\t// example 1: preg_quote(\"$40\");\n\t\t// returns 1: '\\\\$40'\n\t\t// example 2: preg_quote(\"*RRRING* Hello?\");\n\t\t// returns 2: '\\\\*RRRING\\\\* Hello\\\\?'\n\t\t// example 3: preg_quote(\"\\\\.+*?[^]$(){}=!<>|:\");\n\t\t// returns 3: '\\\\\\\\\\\\.\\\\+\\\\*\\\\?\\\\[\\\\^\\\\]\\\\$\\\\(\\\\)\\\\{\\\\}\\\\=\\\\!\\\\<\\\\>\\\\|\\\\:'\n\n\t\treturn String( str )\n\t\t\t.replace( new RegExp( '[.\\\\\\\\+*?\\\\[\\\\^\\\\]$(){}=!<>|:\\\\' + (delimiter || '') + '-]', 'g' ), '\\\\$&' );\n\t}\n\n\t/**\n\t * @TODO convert to functions object\n\t * @param table_prefix\n\t * @param desired_table\n\t * @param given_table\n\t * @returns {boolean}\n\t */\n\ttable_is( table_prefix, desired_table, given_table ) {\n\t\tif ( (table_prefix + desired_table).toLowerCase() === given_table.toLowerCase() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tvar escaped_given_table = this.preg_quote( given_table );\n\t\tvar regex = new RegExp( table_prefix + '([0-9]+)_' + desired_table, 'i' );\n\t\tvar results = regex.exec( escaped_given_table );\n\t\treturn null !== results;\n\t}\n\n\t/**\n\t * @TODO convert to functions object\n\t * @param table_prefix\n\t * @param table_name\n\t * @returns {*}\n\t */\n\tsubsite_for_table( table_prefix, table_name ) {\n\t\tvar escaped_table_name = this.preg_quote( table_name );\n\t\tvar regex = new RegExp( table_prefix + '([0-9]+)_', 'i' );\n\t\tvar results = regex.exec( escaped_table_name );\n\n\t\tif ( null === results ) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn results[ 1 ];\n\t\t}\n\t}\n\n\tconvertKBSizeToHR( size, dec, kbSize, retArray ) {\n\t\tvar retVal, units;\n\t\tkbSize = kbSize || 1000;\n\t\tdec = dec || 2;\n\n\t\tsize = parseFloat( size );\n\n\t\tif ( size < 1 && size > 0 ) {\n\t\t\tretVal = [ (size * kbSize).toFixed( 0 ), 'B' ];\n\t\t} else if ( kbSize > Math.abs( size ) ) {\n\t\t\tretVal = [ size.toFixed( 0 ), 'KB' ];\n\t\t} else {\n\t\t\tunits = [ 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB' ];\n\t\t\tvar u = -1;\n\t\t\tdo {\n\t\t\t\tsize /= kbSize;\n\t\t\t\t++u;\n\t\t\t} while ( Math.abs( size ) >= kbSize && u < units.length - 1 );\n\t\t\tretVal = [ Math.round( size * Math.pow( 10, dec ) ) / Math.pow( 10, dec ), units[ u ] ];\n\t\t}\n\n\t\tif ( !retArray ) {\n\t\t\tretVal = retVal[ 0 ] + ' ' + retVal[ 1 ];\n\t\t}\n\t\treturn retVal;\n\t}\n\n\tconvertKBSizeToHRFixed( size, dec, kbSize ) {\n\t\tdec = dec || 2;\n\t\tvar hrSizeArray = this.convertKBSizeToHR( size, dec, kbSize, true );\n\n\t\t// Show 2 decimal points for MBs\n\t\tif ( 'MB' == hrSizeArray[ 1 ] ) {\n\t\t\treturn hrSizeArray[ 0 ].toFixed( 2 ) + ' ' + hrSizeArray[ 1 ];\n\t\t}\n\n\t\treturn hrSizeArray[ 0 ] + ' ' + hrSizeArray[ 1 ];\n\t}\n\n\tajax_handle_dismissible_notice( nonce, callback, ele ) {\n\t\tjQuery.ajax( {\n\t\t\turl: ajaxurl,\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'text',\n\t\t\tcache: false,\n\t\t\tdata: {\n\t\t\t\taction: 'wpmdb_process_notice_link',\n\t\t\t\tnonce: nonce,\n\t\t\t\tnotice: jQuery( ele ).data( 'notice' ),\n\t\t\t\ttype: jQuery( ele ).data( 'type' ),\n\t\t\t\treminder: jQuery( ele ).data( 'reminder' )\n\t\t\t},\n\t\t\tbeforeSend: callback( ele )\n\t\t} );\n\t}\n\n\tget_spinner_url() {\n\t\tvar admin_url = ajaxurl.replace( '/admin-ajax.php', '' ), spinner_url = admin_url + '/images/spinner';\n\n\t\tif ( 2 < window.devicePixelRatio ) {\n\t\t\tspinner_url += '-2x';\n\t\t}\n\t\tspinner_url += '.gif';\n\n\t\treturn spinner_url;\n\t}\n\n\texclude_post_types_warning() {\n\t\tvar excluded_post_types = $( '#select-post-types' ).val();\n\t\tvar excluded_post_types_text = '';\n\t\tvar $exclude_post_types_warning = $( '.exclude-post-types-warning' );\n\n\t\tif ( excluded_post_types ) {\n\t\t\texcluded_post_types_text = '<code>' + excluded_post_types.join( '</code>, <code>' ) + '</code>';\n\t\t\t$( '.excluded-post-types' ).html( excluded_post_types_text );\n\n\t\t\tif ( '0' === $exclude_post_types_warning.css( 'opacity' ) ) {\n\t\t\t\t$exclude_post_types_warning\n\t\t\t\t\t.css( { opacity: 0 } )\n\t\t\t\t\t.slideDown( 200 )\n\t\t\t\t\t.animate( { opacity: 1 } );\n\t\t\t}\n\t\t} else {\n\t\t\t$exclude_post_types_warning\n\t\t\t\t.css( { opacity: 0 } )\n\t\t\t\t.slideUp( 200 )\n\t\t\t\t.animate( { opacity: 0 } );\n\t\t}\n\t}\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/wp-migrate-db-pro/asset/src/js/helpers/wpmdbCommon.js","var map = {\n\t\"./js/dismissable-notices.js\": 8,\n\t\"./js/helpers/events.js\": 9,\n\t\"./js/helpers/utils.js\": 10,\n\t\"./js/helpers/wpmdbCommon.js\": 11,\n\t\"./js/helpers/wpmdbGlobals.js\": 12,\n\t\"./js/hook.js\": 13,\n\t\"./js/import.js\": 14,\n\t\"./js/localStorage.js\": 15,\n\t\"./js/modules/MigrationProgress-controller.js\": 16,\n\t\"./js/modules/MigrationProgress-model.js\": 17,\n\t\"./js/modules/MigrationProgress-utils.js\": 18,\n\t\"./js/modules/MigrationProgress-view.js\": 19,\n\t\"./js/modules/MigrationProgressStage-model.js\": 20,\n\t\"./js/modules/MigrationProgressStage-view.js\": 21,\n\t\"./js/multisite.js\": 22,\n\t\"./js/plugin-update.js\": 23,\n\t\"./js/script.js\": 24,\n\t\"./js/usage-tracking-notice.js\": 28,\n\t\"./sass/_migration-progress.scss\": 29,\n\t\"./sass/_progress-upgrade.scss\": 30,\n\t\"./sass/plugin-update-styles.scss\": 31,\n\t\"./sass/styles.scss\": 32\n};\nfunction webpackContext(req) {\n\treturn __webpack_require__(webpackContextResolve(req));\n};\nfunction webpackContextResolve(req) {\n\tvar id = map[req];\n\tif(!(id + 1)) // check for number or string\n\t\tthrow new Error(\"Cannot find module '\" + req + \"'.\");\n\treturn id;\n};\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 7;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/wp-migrate-db-pro/asset/src ./node_modules/imports-loader?$=>window.jQuery ^(.*\\.(js|sass|scss$))/i\n// module id = 7\n// module chunks = 0","(function( $ ) {\n\n\t//If there's an error message visible about the mu-plugins folder not being writable\n\tif ( 0 < $( '.wpmdb-compat-plugin-row-error' ).length ) {\n\t\t$( '[data-slug=\"wp-migrate-db-pro\"]' ).addClass( 'wpmdbpro-has-message' );\n\t}\n\n\t//For the free plugin the update class needs to be present\n\t$( '.wpmdbpro-custom' ).prev().addClass( 'update' );\n\n\t$( '.notice-link-plugins-page' ).click( function( e ) {\n\t\te.preventDefault();\n\t\tvar self = jQuery( this );\n\n\t\twpmdb.functions.ajax_handle_dismissible_notice( wpmdb_nonces.process_notice_link, function( ele ) {\n\t\t\t$( ele ).closest( '.wpmdbpro-custom' ).hide();\n\n\t\t\t// remove .wpmdb-has-message class from parent TR to add the bottom border back in\n\t\t\t$( ele ).closest( 'tr' ).siblings( 'tr.wpmdbpro-has-message' ).removeClass( 'wpmdbpro-has-message' );\n\t\t}, self );\n\n\t\t$( '.wpmdbpro-custom' ).prev().removeClass( 'update' );\n\t} );\n})( jQuery );\n\n\n\n// WEBPACK FOOTER //\n// ./src/wp-migrate-db-pro/asset/src/js/dismissable-notices.js","$.fn.bindFirst = function (name, fn) {\n\tthis.bindNth(name, fn, 0);\n};\n\n$.fn.bindNth = function(name, fn, index) {\n\t// Bind event normally.\n\tthis.bind(name, fn);\n\t// Move to nth position.\n\tthis.changeEventOrder(name, index);\n};\n\n$.fn.changeEventOrder = function (names, newIndex) {\n\tvar that = this;\n\t// Allow for multiple events.\n\t$.each(names.split(' '), function (idx, name) {\n\t\tthat.each(function () {\n\t\t\tvar handlers = $._data(this, 'events')[name.split('.')[0]];\n\t\t\t// Validate requested position.\n\t\t\tnewIndex = Math.min(newIndex, handlers.length - 1);\n\t\t\thandlers.splice(newIndex, 0, handlers.pop());\n\t\t});\n\t});\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/wp-migrate-db-pro/asset/src/js/helpers/events.js","export const handleAjaxError = ( header_text, error ) => {\n\n\tlet errorTemplate = `\n\t\t\t<p>${wpmdb_strings.ajax_php_errors}:</p>\n\t\t\t<p>${error.message}</p>\n\t`;\n\n\twpmdb.current_migration.setState( header_text, errorTemplate, 'error' );\n\twpmdb.common.migration_error = true;\n\twpmdb.functions.migration_complete_events();\n\tconsole.error( '🚨 🚒', error );\n\treturn;\n};\n\nexport const throwMDBError = ( parsed_response ) => {\n\tlet error_body;\n\n\tif ( undefined !== parsed_response.body ) {\n\t\twpmdb.common.non_fatal_errors += parsed_response.body;\n\t\terror_body = parsed_response.body;\n\t}\n\n\tif ( undefined !== parsed_response.msg ) {\n\t\terror_body = parsed_response.msg;\n\t}\n\n\tthrow new Error( error_body );\n};\n\nexport const jQueryAjaxError = ( responseText, jqXHR ) => {\n\tif ( 'undefined' !== typeof jqXHR.responseText && '' !== jqXHR.responseText ) {\n\t\tresponseText = jqXHR.responseText;\n\t} else if ( 'undefined' !== typeof jqXHR.statusText ) {\n\t\tresponseText = jqXHR.statusText;\n\t}\n\n\tconsole.error( jqXHR );\n\n\twpmdb.current_migration.setState( wpmdb_strings.migration_failed, responseText, 'error' );\n\twpmdb.common.migration_error = true;\n\twpmdb.functions.migration_complete_events();\n\treturn responseText;\n};\n\nexport const doNextStep = ( fn, args, instance ) => {\n\twpmdb.common.next_step_in_migration = {\n\t\tfn: fn,\n\t\targs: args\n\t};\n\n\treturn wpmdb.functions.execute_next_step( instance );\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/wp-migrate-db-pro/asset/src/js/helpers/utils.js","const $ = window.jQuery;\nconst ajaxurl = window.ajaxurl;\nconst wpmdb_strings = window.wpmdb_strings;\nconst wpmdb_data = window.wpmdb_data;\n\nexport default class WPMDBGlobals {\n\tconstructor() {\n\t\tthis.show_ssl_notice = false;\n\t\tthis.doing_save_profile = false;\n\t\tthis.doing_ajax = false;\n\t\tthis.profile_name_edited = false;\n\t\tthis.migration_intent = null;\n\t\tthis.doing_licence_registration_ajax = false;\n\t\tthis.migration_paused = false;\n\t\tthis.last_replace_switch = wpmdb.functions.wpmdb_migration_type();\n\t\tthis.connection_established = false;\n\t\tthis.profile_name_edited = false;\n\t\tthis.checked_licence = false;\n\t\tthis.show_prefix_notice = false;\n\t\tthis.show_ssl_notice = false;\n\t\tthis.force_reconnect = false;\n\t\tthis.migration_selection = '';\n\t\tthis.show_version_notice = false;\n\t\tthis.migration_completed = false;\n\t\tthis.currently_migrating = false;\n\t\tthis.dump_filename = '';\n\t\tthis.dump_path = '';\n\t\tthis.migration_intent = '';\n\t\tthis.remote_site = null;\n\t\tthis.secret_key = null;\n\t\tthis.form_data = null;\n\t\tthis.stage = null;\n\t\tthis.elapsed_interval = null;\n\t\tthis.completed_msg = null;\n\t\tthis.tables_to_migrate = [];\n\t\tthis.migration_paused = false;\n\t\tthis.previous_progress_title = '';\n\t\tthis.previous_progress_text_primary = '';\n\t\tthis.previous_progress_text_secondary = '';\n\t\tthis.cancelling_text = '';\n\t\tthis.paused_text = '';\n\t\tthis.migration_cancelled = false;\n\t\tthis.flag_skip_delay = false;\n\t\tthis.delay_between_requests = 0;\n\t\tthis.fade_duration = 400;\n\t\tthis.pause_before_finalize = false;\n\t\tthis.is_auto_pause_before_finalize = false;\n\t\tthis.$connection_info_box = $( '.connection-info-wrapper' );\n\t\tthis.$push_select = window.wpmdb.$push_select = $( '#select-tables' ).clone();\n\t\tthis.$pull_select = window.wpmdb.$pull_select = $( '#select-tables' ).clone();\n\t\tthis.$push_post_type_select = $( '#select-post-types' ).clone();\n\t\tthis.$pull_post_type_select = $( '#select-post-types' ).clone();\n\t\tthis.$push_select_backup = $( '#select-backup' ).clone();\n\t\tthis.$pull_select_backup = $( '#select-backup' ).clone();\n\n\t\tthis.spinner_url = window.spinner_url = wpmdb.functions.get_spinner_url();\n\t\tthis.ajax_spinner = window.ajax_spinner = '<img src=\"' + this.spinner_url + '\" alt=\"\" class=\"ajax-spinner general-spinner\" />';\n\t}\n\n\tpad( n, width, z ) {\n\t\tz = z || '0';\n\t\tn = n + '';\n\t\treturn n.length >= width ? n : new Array( width - n.length + 1 ).join( z ) + n;\n\t}\n\n\tis_int( n ) {\n\t\tn = parseInt( n );\n\t\treturn 'number' === typeof n && 0 === n % 1;\n\t}\n\n\tget_intersect( arr1, arr2 ) {\n\t\tvar r = [], o = {}, l = arr2.length, i, v;\n\t\tfor ( i = 0; i < l; i++ ) {\n\t\t\to[ arr2[ i ] ] = true;\n\t\t}\n\t\tl = arr1.length;\n\t\tfor ( i = 0; i < l; i++ ) {\n\t\t\tv = arr1[ i ];\n\t\t\tif ( v in o ) {\n\t\t\t\tr.push( v );\n\t\t\t}\n\t\t}\n\n\t\treturn r;\n\t}\n\n\tpin_replace_url( pin ) {\n\t\tif ( true === pin && 1 > $( '.replace-row.pin' ).length && 1 === $( '#old-url' ).length ) {\n\t\t\t$( '#old-url' ).parents( '.replace-row' ).addClass( 'pin' );\n\t\t}\n\n\t\tif ( false === pin && 0 < $( '.replace-row.pin' ).length ) {\n\t\t\t$( '.replace-row.pin' ).removeClass( 'pin' );\n\t\t}\n\t}\n\n\t/**\n\t * Core plugin wrapper for the common AJAX error detecting method\n\t *\n\t * @param text\n\t * @param code\n\t * @param jqXHR\n\t *\n\t * @returns {string}\n\t */\n\tget_ajax_errors( text, code, jqXHR ) {\n\t\treturn wpmdb.functions.wpmdbGetAjaxErrors( wpmdb_strings.connection_local_server_problem, code, text, jqXHR );\n\t}\n\n\t// updates the debug log when the user switches to the help tab\n\trefresh_debug_log() {\n\t\t$.ajax( {\n\t\t\turl: ajaxurl,\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'text',\n\t\t\tcache: false,\n\t\t\tdata: {\n\t\t\t\taction: 'wpmdb_get_log',\n\t\t\t\tnonce: wpmdb_data.nonces.get_log\n\t\t\t},\n\t\t\terror( jqXHR, textStatus, errorThrown ) {\n\t\t\t\talert( wpmdb_strings.update_log_problem );\n\t\t\t},\n\t\t\tsuccess( data ) {\n\t\t\t\t$( '.debug-log-textarea' ).val( data );\n\t\t\t}\n\t\t} );\n\t}\n\n\tget_query_var( name ) {\n\t\tname = name.replace( /[\\[]/, '\\\\[' ).replace( /[\\]]/, '\\\\]' );\n\t\tvar regex = new RegExp( '[\\\\?&]' + name + '=([^&#]*)' ),\n\t\t\tresults = regex.exec( location.search );\n\t\treturn null === results ? '' : decodeURIComponent( results[ 1 ].replace( /\\+/g, ' ' ) );\n\t}\n\n\tmaybe_show_ssl_warning( url, key, remote_scheme ) {\n\t\tvar scheme = url.substr( 0, url.indexOf( ':' ) );\n\t\tvar $ssl_notice = $( '.ssl-notice' );\n\n\t\tif ( !this.show_ssl_notice ) {\n\t\t\t$ssl_notice.hide();\n\t\t}\n\n\t\tif ( remote_scheme !== scheme && url.indexOf( 'https' ) !== -1 ) {\n\t\t\t$ssl_notice.show();\n\t\t\tthis.show_ssl_notice = true;\n\t\t\turl = url.replace( 'https', 'http' );\n\t\t\t$( '.pull-push-connection-info' ).val( url + '\\n' + key );\n\t\t\treturn;\n\t\t}\n\n\t\tthis.show_ssl_notice = false;\n\t}\n\n\tvalidate_url( url ) {\n\t\treturn /^([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 );\n\t}\n\n\trefresh_table_selects() {\n\t\tif ( undefined !== wpmdb_data && undefined !== wpmdb_data.this_tables && undefined !== wpmdb_data.this_table_sizes_hr ) {\n\t\t\tthis.$push_select = this.create_table_select( wpmdb_data.this_tables, wpmdb_data.this_table_sizes_hr, $( wpmdb.$push_select ).val() );\n\t\t}\n\n\t\tif ( undefined !== wpmdb.common.connection_data && undefined !== wpmdb.common.connection_data.tables && undefined !== wpmdb.common.connection_data.table_sizes_hr ) {\n\t\t\tthis.$pull_select = this.create_table_select( wpmdb.common.connection_data.tables, wpmdb.common.connection_data.table_sizes_hr, $( wpmdb.$pull_select ).val() );\n\t\t}\n\t}\n\n\tsave_active_profile() {\n\t\tvar profile;\n\t\t$( '.save-settings-button' ).blur();\n\n\t\tif ( this.doing_save_profile ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( true === this.maybe_show_select_table_notice() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar create_new_profile = false;\n\n\t\tif ( $( '#create_new' ).is( ':checked' ) ) {\n\t\t\tcreate_new_profile = true;\n\t\t}\n\t\tvar profile_name = $( '.create-new-profile' ).val();\n\n\t\tthis.doing_save_profile = true;\n\t\tprofile = $( $( '#migrate-form' )[ 0 ].elements ).not( '.auth-credentials' ).serialize();\n\n\t\t$( '.save-settings-button' ).attr( 'disabled', 'disabled' )\n\t\t\t.after( '<img src=\"' + this.spinner_url + '\" alt=\"\" class=\"save-profile-ajax-spinner general-spinner\" />' );\n\n\t\tthis.doing_ajax = true;\n\n\t\t$.ajax( {\n\t\t\turl: ajaxurl,\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'text',\n\t\t\tcache: false,\n\t\t\tdata: {\n\t\t\t\taction: 'wpmdb_save_profile',\n\t\t\t\tprofile: profile,\n\t\t\t\tnonce: wpmdb_data.nonces.save_profile\n\t\t\t},\n\t\t\terror: ( jqXHR, textStatus, errorThrown ) => {\n\t\t\t\tthis.doing_ajax = false;\n\t\t\t\talert( wpmdb_strings.save_profile_problem );\n\t\t\t\t$( '.save-settings-button' ).removeAttr( 'disabled' );\n\t\t\t\t$( '.save-profile-ajax-spinner' ).remove();\n\t\t\t\t$( '.save-settings-button' ).after( '<span class=\"ajax-success-msg\">' + wpmdb_strings.saved + '</span>' );\n\t\t\t\t$( '.ajax-success-msg' ).fadeOut( 2000, function() {\n\t\t\t\t\t$( this ).remove();\n\t\t\t\t} );\n\t\t\t\tthis.doing_save_profile = false;\n\t\t\t},\n\t\t\tsuccess: ( data ) => {\n\t\t\t\tvar updated_profile_id = parseInt( $( '#migrate-form input[name=save_migration_profile_option]:checked' ).val(), 10 ) + 1;\n\t\t\t\tthis.doing_ajax = false;\n\t\t\t\t$( '.save-settings-button' ).removeAttr( 'disabled' );\n\t\t\t\t$( '.save-profile-ajax-spinner' ).remove();\n\t\t\t\t$( '.save-settings-button' ).after( '<span class=\"ajax-success-msg\">' + wpmdb_strings.saved + '</span>' );\n\t\t\t\t$( '.ajax-success-msg' ).fadeOut( 2000, function() {\n\t\t\t\t\t$( this ).remove();\n\t\t\t\t} );\n\t\t\t\tthis.doing_save_profile = false;\n\t\t\t\t$( '.create-new-profile' ).val( '' );\n\n\t\t\t\tif ( create_new_profile ) {\n\t\t\t\t\tvar new_profile_key = parseInt( data, 10 );\n\t\t\t\t\tvar new_profile_id = new_profile_key + 1;\n\t\t\t\t\tvar 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>' );\n\t\t\t\t\tnew_li.find( 'label' ).append( document.createTextNode( ' ' + profile_name ) );\n\t\t\t\t\tupdated_profile_id = new_profile_id;\n\n\t\t\t\t\t$( '#create_new' ).parents( 'li' ).before( new_li );\n\t\t\t\t\t$( '#profile-' + new_profile_id ).attr( 'checked', 'checked' );\n\t\t\t\t}\n\n\t\t\t\t// Push updated profile id to history if available\n\t\t\t\tvar updated_url = window.location.href.replace( '#migrate', '' ).replace( /&wpmdb-profile=-?\\d+/, '' ) + '&wpmdb-profile=' + updated_profile_id;\n\t\t\t\tvar updated_profile_name = $( '#migrate-form input[name=save_migration_profile_option]:checked' ).parent().text().trim();\n\n\t\t\t\tif ( 'function' === typeof window.history.pushState ) {\n\t\t\t\t\tif ( $( '#migrate-form .crumbs' ).length ) {\n\t\t\t\t\t\t$( '#migrate-form .crumbs .crumb:last' ).text( updated_profile_name );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar $crumbs = $( '<div class=\"crumbs\" />' )\n\t\t\t\t\t\t\t.append( '<a class=\"crumb\" href=\"' + wpmdb_data.this_plugin_base + '\"> Saved Profiles </a>' )\n\t\t\t\t\t\t\t.append( '<span class=\"crumb\">' + updated_profile_name + '</span>' );\n\t\t\t\t\t\t$( '#migrate-form' ).prepend( $crumbs );\n\t\t\t\t\t}\n\t\t\t\t\twindow.history.pushState( { updated_profile_id: updated_profile_id }, null, updated_url );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\tcancel_migration( event ) {\n\t\tthis.migration_cancelled = true;\n\t\tthis.cancelling_text = wpmdb_strings.cancelling_migration;\n\t\t$( '.migration-controls' ).css( { visibility: 'hidden' } );\n\n\t\tif ( 'find_replace' === this.migration_intent ) {\n\t\t\tthis.cancelling_text = wpmdb_strings.cancelling_find_replace;\n\t\t}\n\n\t\twpmdb.current_migration.setState( this.cancelling_text, wpmdb_strings.completing_current_request, 'cancelling' );\n\n\t\tif ( true === this.migration_paused ) {\n\t\t\tthis.migration_paused = false;\n\t\t\twpmdb.functions.execute_next_step();\n\t\t}\n\t}\n\n\t/**\n\t * Set checkbox\n\t *\n\t * @param string checkbox_wrap\n\t */\n\tset_checkbox( checkbox_wrap ) {\n\t\tconst $switch = $( '#' + checkbox_wrap );\n\t\tvar $checkbox = $switch.find( 'input[type=checkbox]' );\n\n\t\t$switch.toggleClass( 'on' ).find( 'span' ).toggleClass( 'checked' );\n\t\tvar switch_on = $switch.find( 'span.on' ).hasClass( 'checked' );\n\t\t$checkbox.attr( 'checked', switch_on ).trigger( 'change' );\n\t}\n\n\t// save file (export) / push / pull special conditions\n\tmove_connection_info_box() {\n\t\tvar $connection_status = $( '.connection-status' );\n\t\tvar $directory_permission_notice = $( '.directory-permission-notice' );\n\t\tvar $compatibility_older_mysql = $( '.compatibility-older-mysql' );\n\t\tvar $mst_required = $( '.mst-required' );\n\t\tvar $keep_active_plugins = $( '.keep-active-plugins' );\n\t\tvar $step_two = $( '.step-two' );\n\t\tvar $backup_options = $( '.backup-options' );\n\t\tvar new_migration_type = wpmdb.functions.wpmdb_migration_type();\n\t\tvar profile_name, table_prefix, backup_table_prefix, uploads_dir, upload_dir_long, write_permission;\n\n\t\t$connection_status.hide();\n\t\t$directory_permission_notice.hide();\n\t\t$step_two.show();\n\t\t$backup_options.show();\n\t\t$keep_active_plugins.show();\n\t\t$compatibility_older_mysql.hide();\n\t\t$mst_required.hide();\n\n\t\twpmdb.functions.wpmdb_toggle_migration_action_text();\n\n\t\t$( '.migrate-tab' ).attr( 'class', 'migrate-tab content-tab' ).addClass( wpmdb.functions.wpmdb_migration_type() );\n\n\t\t$.wpmdb.do_action( 'move_connection_info_box', {\n\t\t\tmigration_type: new_migration_type,\n\t\t\tlast_migration_type: this.last_replace_switch\n\t\t} );\n\n\t\tif ( -1 !== $.inArray( new_migration_type, [ 'push', 'pull' ] ) ) {\n\t\t\tvar $pull_push_connection_info = $( '.pull-push-connection-info' );\n\t\t\tvar connection_info = $.trim( $pull_push_connection_info.val() ).split( '\\n' );\n\t\t\tvar $migration_list_li = $( '.' + new_migration_type + '-list li' );\n\n\t\t\t$migration_list_li.append( this.$connection_info_box );\n\t\t\tthis.$connection_info_box.show( function() {\n\t\t\t\tvar connection_textarea = $( this ).find( '.pull-push-connection-info' );\n\t\t\t\tif ( !connection_textarea.val() ) {\n\t\t\t\t\tconnection_textarea.focus();\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\t// Reconnect if the migration type was just changed\n\t\t\tif ( new_migration_type !== this.last_replace_switch && 2 === connection_info.length ) {\n\t\t\t\twpmdb.force_reconnect = true;\n\t\t\t\t$migration_list_li.append( this.$connection_info_box );\n\t\t\t\t$pull_push_connection_info.removeClass( 'temp-disabled' ).attr( 'readonly', 'readonly' );\n\t\t\t\t$( '.connect-button' ).hide();\n\t\t\t\twpmdb.functions.connection_box_changed();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( this.connection_established ) {\n\t\t\t\t$connection_status.hide();\n\t\t\t\t$step_two.show();\n\n\t\t\t\twpmdb.functions.wpmdb_toggle_migration_action_text();\n\n\t\t\t\tif ( 'pull' === new_migration_type ) {\n\t\t\t\t\ttable_prefix = wpmdb.common.connection_data.prefix;\n\t\t\t\t\tbackup_table_prefix = wpmdb_data.site_details.prefix;\n\t\t\t\t\tuploads_dir = wpmdb_data.this_uploads_dir;\n\t\t\t\t\tupload_dir_long = wpmdb_data.this_upload_dir_long;\n\t\t\t\t\twrite_permission = wpmdb_data.write_permission;\n\t\t\t\t} else {\n\t\t\t\t\ttable_prefix = wpmdb_data.this_prefix;\n\t\t\t\t\tbackup_table_prefix = wpmdb.common.connection_data.prefix;\n\t\t\t\t\tuploads_dir = wpmdb.common.connection_data.uploads_dir;\n\t\t\t\t\tupload_dir_long = wpmdb.common.connection_data.upload_dir_long;\n\t\t\t\t\twrite_permission = wpmdb.common.connection_data.write_permissions;\n\t\t\t\t}\n\n\t\t\t\t$( '.table_prefix' ).html( table_prefix );\n\t\t\t\t$( '.backup-table-prefix' ).html( backup_table_prefix );\n\t\t\t\t$( '.uploads-dir' ).html( uploads_dir );\n\n\t\t\t\tthis.maybe_show_backup_disabled_msg( upload_dir_long, write_permission );\n\n\t\t\t\tif ( false === this.profile_name_edited ) {\n\t\t\t\t\tprofile_name = this.get_domain_name( wpmdb.common.connection_data.url );\n\t\t\t\t\t$( '.create-new-profile' ).val( profile_name );\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t$connection_status.show();\n\t\t\t\t$step_two.hide();\n\t\t\t}\n\n\t\t} else if ( -1 !== $.inArray( new_migration_type, [ 'find_replace', 'savefile' ] ) ) {\n\t\t\t$connection_status.hide();\n\t\t\t$step_two.show();\n\t\t\t$( '.table-prefix' ).html( wpmdb_data.this_prefix );\n\t\t\tif ( false === this.profile_name_edited ) {\n\t\t\t\t$( '.create-new-profile' ).val( '' );\n\t\t\t}\n\n\t\t\t$keep_active_plugins.hide();\n\n\t\t\tif ( 'savefile' === new_migration_type ) {\n\t\t\t\t$backup_options.hide();\n\t\t\t\t$compatibility_older_mysql.show();\n\n\t\t\t\tif ( 'false' === wpmdb_data.write_permission ) {\n\t\t\t\t\t$directory_permission_notice.show();\n\t\t\t\t\t$step_two.hide();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( 'true' === wpmdb_data.is_multisite ) {\n\t\t\t\t\tvar $old_replace_col = $( '.old-replace-col' ).eq( 1 );\n\t\t\t\t\t$old_replace_col.parent().removeClass( 'pin' ).find( '.replace-remove-row' ).show();\n\t\t\t\t\t$old_replace_col.find( 'input' ).removeAttr( 'readonly' );\n\t\t\t\t}\n\n\t\t\t\tthis.maybe_show_backup_disabled_msg( wpmdb_data.this_upload_dir_long, wpmdb_data.write_permission );\n\t\t\t}\n\t\t}\n\n\t\tthis.maybe_show_mixed_cased_table_name_warning();\n\t}\n\n\tmaybe_show_backup_disabled_msg( upload_dir, write_permission ) {\n\t\tvar $create_backup = $( '#create-backup' );\n\t\tvar $create_backup_label = $( '#create-backup-label' );\n\t\tvar $backup_option_disabled = $( '.backup-option-disabled' );\n\n\t\t$create_backup.removeAttr( 'disabled' );\n\t\t$create_backup_label.removeClass( 'disabled' );\n\t\t$backup_option_disabled.hide();\n\n\t\tif ( 'false' === write_permission ) {\n\t\t\t$create_backup.prop( 'checked', false );\n\t\t\t$create_backup.attr( 'disabled', 'disabled' );\n\t\t\t$create_backup_label.addClass( 'disabled' );\n\t\t\t$backup_option_disabled.show();\n\t\t\t$( '.upload-directory-location' ).html( upload_dir );\n\t\t}\n\t}\n\n\tchange_replace_values() {\n\t\tvar old_url = null;\n\t\tvar old_path = null;\n\t\tif ( null !== wpmdb.common.previous_connection_data && 'object' === typeof wpmdb.common.previous_connection_data && wpmdb.common.previous_connection_data.url !== wpmdb.common.connection_data.url ) {\n\t\t\told_url = this.remove_protocol( wpmdb.common.previous_connection_data.url );\n\t\t\told_path = wpmdb.common.previous_connection_data.path;\n\t\t}\n\n\t\tif ( 'push' === wpmdb.functions.wpmdb_migration_type() || 'savefile' === wpmdb.functions.wpmdb_migration_type() ) {\n\t\t\tif ( 'pull' === this.last_replace_switch ) {\n\t\t\t\t$( '.replace-row' ).each( function() {\n\t\t\t\t\tvar old_val = $( '.old-replace-col input', this ).val();\n\t\t\t\t\t$( '.old-replace-col input', this ).val( $( '.replace-right-col input', this ).val() );\n\t\t\t\t\t$( '.replace-right-col input', this ).val( old_val );\n\t\t\t\t} );\n\t\t\t} else if ( 'push' === this.last_replace_switch && 'push' === wpmdb.functions.wpmdb_migration_type() && null !== old_url && null !== old_path ) {\n\t\t\t\t$( '.replace-row' ).each( function() {\n\t\t\t\t\tvar old_val = $( '.replace-right-col input', this ).val();\n\t\t\t\t\tif ( old_val === old_path ) {\n\t\t\t\t\t\t$( '.replace-right-col input', this ).val( wpmdb.common.connection_data.path );\n\t\t\t\t\t}\n\t\t\t\t\tif ( old_val === old_url ) {\n\t\t\t\t\t\t$( '.replace-right-col input', this ).val( this.remove_protocol( wpmdb.common.connection_data.url ) );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t\t$.wpmdb.do_action( 'wpmdb_update_push_table_select' );\n\t\t\t$( '#select-post-types' ).remove();\n\t\t\t$( '.exclude-post-types-warning' ).after( this.$push_post_type_select );\n\t\t\twpmdb.functions.exclude_post_types_warning();\n\t\t\t$( '#select-backup' ).remove();\n\t\t\t$( '.backup-tables-wrap' ).prepend( this.$push_select_backup );\n\t\t} else if ( 'pull' === wpmdb.functions.wpmdb_migration_type() ) {\n\t\t\tif ( '' === this.last_replace_switch || 'push' === this.last_replace_switch || 'savefile' === this.last_replace_switch ) {\n\t\t\t\t$( '.replace-row' ).each( function() {\n\t\t\t\t\tvar old_val = $( '.old-replace-col input', this ).val();\n\t\t\t\t\t$( '.old-replace-col input', this ).val( $( '.replace-right-col input', this ).val() );\n\t\t\t\t\t$( '.replace-right-col input', this ).val( old_val );\n\t\t\t\t} );\n\t\t\t} else if ( 'pull' === this.last_replace_switch && 'pull' === wpmdb.functions.wpmdb_migration_type() && null !== old_url && null !== old_path ) {\n\t\t\t\t$( '.replace-row' ).each( function() {\n\t\t\t\t\tvar old_val = $( '.old-replace-col input', this ).val();\n\t\t\t\t\tif ( old_val === old_path ) {\n\t\t\t\t\t\t$( '.old-replace-col input', this ).val( wpmdb.common.connection_data.path );\n\t\t\t\t\t}\n\t\t\t\t\tif ( old_val === old_url ) {\n\t\t\t\t\t\t$( '.old-replace-col input', this ).val( this.remove_protocol( wpmdb.common.connection_data.url ) );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t\t$.wpmdb.do_action( 'wpmdb_update_pull_table_select' );\n\t\t\t$( '#select-post-types' ).remove();\n\t\t\t$( '.exclude-post-types-warning' ).after( this.$pull_post_type_select );\n\t\t\twpmdb.functions.exclude_post_types_warning();\n\t\t\t$( '#select-backup' ).remove();\n\t\t\t$( '.backup-tables-wrap' ).prepend( this.$pull_select_backup );\n\t\t}\n\t\tthis.last_replace_switch = wpmdb.functions.wpmdb_migration_type();\n\t}\n\n\tswitch_to_plugin_tab( hash, skip_addons_check ) {\n\t\t$( '.nav-tab' ).removeClass( 'nav-tab-active' );\n\t\t$( '.nav-tab.' + hash ).addClass( 'nav-tab-active' );\n\t\t$( '.content-tab' ).hide();\n\t\t$( '.' + hash + '-tab' ).show();\n\n\t\tif ( 'settings' === hash ) {\n\t\t\tif ( true === this.should_check_licence() ) {\n\t\t\t\t$( 'p.licence-status' ).append( 'Checking License... ' ).append( this.ajax_spinner );\n\t\t\t\tthis.check_licence();\n\t\t\t}\n\t\t}\n\n\t\tif ( 'help' === hash ) {\n\t\t\tthis.refresh_debug_log();\n\t\t\tif ( true === this.should_check_licence() ) {\n\t\t\t\t$( '.support-content p' ).append( this.ajax_spinner );\n\t\t\t\tthis.check_licence();\n\t\t\t}\n\t\t}\n\n\t\tif ( 'addons' === hash && true !== skip_addons_check ) {\n\t\t\tif ( true === this.should_check_licence() ) {\n\t\t\t\t$( '.addons-content p' ).append( this.ajax_spinner );\n\t\t\t\tthis.check_licence();\n\t\t\t}\n\t\t}\n\t}\n\n\thide_overlay() {\n\t\t$( '#overlay' ).removeClass( 'show' ).addClass( 'hide' );\n\t\t$( '#overlay > div' ).removeClass( 'show' ).addClass( 'hide' );\n\t\twpmdb.current_migration.$proVersion.find( 'iframe' ).remove();\n\t\tsetTimeout( function() {\n\t\t\t$( '#overlay' ).remove();\n\t\t}, 500 );\n\t\tthis.migration_completed = false;\n\t}\n\n\tcheck_licence( licence ) {\n\t\tvar update_licence_content = !this.doing_licence_registration_ajax;\n\t\tthis.checked_licence = true;\n\t\tlet self = this;\n\t\t$.ajax( {\n\t\t\turl: ajaxurl,\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'json',\n\t\t\tcache: false,\n\t\t\tdata: {\n\t\t\t\taction: 'wpmdb_check_licence',\n\t\t\t\tlicence: licence,\n\t\t\t\tcontext: 'all',\n\t\t\t\tnonce: wpmdb_data.nonces.check_licence\n\t\t\t},\n\t\t\terror( jqXHR, textStatus, errorThrown ) {\n\t\t\t\talert( wpmdb_strings.license_check_problem );\n\t\t\t},\n\t\t\tsuccess( data ) {\n\n\t\t\t\tvar $support_content = $( '.support-content' );\n\t\t\t\tvar $addons_content = $( '.addons-content' );\n\t\t\t\tvar $licence_content = $( '.licence-status:not(.notification-message)' );\n\t\t\t\tvar licence_msg, support_msg, addons_msg;\n\n\t\t\t\tif ( 'undefined' !== typeof data.dbrains_api_down ) {\n\t\t\t\t\tsupport_msg = data.dbrains_api_down + data.message;\n\t\t\t\t\taddons_msg = data.dbrains_api_down;\n\t\t\t\t} else if ( 'undefined' !== typeof data.errors ) {\n\n\t\t\t\t\tif ( 'undefined' !== typeof data.errors.subscription_expired ) {\n\t\t\t\t\t\tlicence_msg = data.errors.subscription_expired.licence;\n\t\t\t\t\t\tsupport_msg = data.errors.subscription_expired.support;\n\t\t\t\t\t\taddons_msg = data.errors.subscription_expired.addons;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar msg = '';\n\t\t\t\t\t\tfor ( var key in data.errors ) {\n\t\t\t\t\t\t\tmsg += data.errors[ key ];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsupport_msg = msg;\n\t\t\t\t\t\taddons_msg = msg;\n\t\t\t\t\t}\n\t\t\t\t\tif ( 'undefined' !== typeof data.addon_content ) {\n\t\t\t\t\t\taddons_msg += '\\n' + data.addon_content;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tsupport_msg = data.message;\n\t\t\t\t\taddons_msg = data.addon_content;\n\t\t\t\t}\n\n\t\t\t\tif ( update_licence_content ) {\n\t\t\t\t\t$licence_content.stop().fadeOut( self.fade_duration, function() {\n\t\t\t\t\t\tif ( 'undefined' === typeof licence_msg ) {\n\t\t\t\t\t\t\t$( this ).css( { visibility: 'hidden', display: 'block' } ).slideUp();\n\t\t\t\t\t\t\tlicence_msg = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$( this )\n\t\t\t\t\t\t\t.empty()\n\t\t\t\t\t\t\t.html( licence_msg )\n\t\t\t\t\t\t\t.stop()\n\t\t\t\t\t\t\t.fadeIn( self.fade_duration );\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\t$support_content.stop().fadeOut( self.fade_duration, function() {\n\t\t\t\t\t$( this )\n\t\t\t\t\t\t.empty()\n\t\t\t\t\t\t.html( support_msg )\n\t\t\t\t\t\t.stop()\n\t\t\t\t\t\t.fadeIn( self.fade_duration );\n\t\t\t\t} );\n\t\t\t\t$addons_content.stop().fadeOut( self.fade_duration, function() {\n\t\t\t\t\t$( this )\n\t\t\t\t\t\t.empty()\n\t\t\t\t\t\t.html( addons_msg )\n\t\t\t\t\t\t.stop()\n\t\t\t\t\t\t.fadeIn( self.fade_duration );\n\t\t\t\t} );\n\n\t\t\t\tif ( $( '#plugin-compatibility' ).is( ':not(:checked)' ) ) {\n\t\t\t\t\t$( '#compatibility-header' ).click();\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\tshould_check_licence() {\n\t\treturn false === this.checked_licence && '1' === wpmdb_data.has_licence && 'true' === wpmdb_data.is_pro;\n\t}\n\n\tmaybe_show_mixed_cased_table_name_warning() {\n\t\tif ( 'undefined' === typeof wpmdb.common.connection_data || false === wpmdb.common.connection_data ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar migration_intent = wpmdb.functions.wpmdb_migration_type();\n\t\tvar tables_to_migrate = wpmdb.functions.get_tables_to_migrate( null, null );\n\n\t\t$( '.mixed-case-table-name-notice' ).hide();\n\n\t\tif ( null === tables_to_migrate ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttables_to_migrate = tables_to_migrate.join( '' );\n\n\t\t// The table names are all lowercase, no need to display the warning.\n\t\tif ( tables_to_migrate === tables_to_migrate.toLowerCase() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * Do not display the warning if the remote lower_case_table_names does not equal \"1\" (i.e the only problematic setting)\n\t\t * Applies to push/export migrations.\n\t\t */\n\t\tif ( '1' !== wpmdb.common.connection_data.lower_case_table_names && ('push' === migration_intent || 'savefile' === migration_intent) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * Do not display the warning if the local lower_case_table_names does not equal \"1\" (i.e the only problematic setting)\n\t\t * Only applies to pull migrations.\n\t\t */\n\t\tif ( '1' !== wpmdb_data.lower_case_table_names && 'pull' === migration_intent ) {\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * At this stage we've determined:\n\t\t * 1. The source database contains at least one table that contains an uppercase character.\n\t\t * 2. The destination environment has lower_case_table_names set to 1.\n\t\t * 3. The source database table containing the uppercase letter will be converted to lowercase during the migration.\n\t\t */\n\n\t\tif ( 'push' === migration_intent || 'savefile' === migration_intent ) {\n\t\t\t$( '.mixed-case-table-name-notice.push' ).show();\n\t\t} else {\n\t\t\t$( '.mixed-case-table-name-notice.pull' ).show();\n\t\t}\n\t}\n\n\tenable_pro_licence( data, licence_key ) {\n\t\t$( '.licence-input, .register-licence' ).remove();\n\t\t$( '.licence-not-entered' ).prepend( data.masked_licence );\n\t\t$( '.support-content' ).empty().html( '<p>' + wpmdb_strings.fetching_license + '<img src=\"' + this.spinner_url + '\" alt=\"\" class=\"ajax-spinner general-spinner\" /></p>' );\n\t\tthis.check_licence( licence_key );\n\n\t\t$( '.migrate-selection label' ).removeClass( 'disabled' );\n\t\t$( '.migrate-selection input' ).removeAttr( 'disabled' );\n\t}\n\n\tget_domain_name( url ) {\n\t\tvar temp_url = url;\n\t\tvar domain = temp_url.replace( /\\/\\/(.*)@/, '//' ).replace( 'http://', '' ).replace( 'https://', '' ).replace( 'www.', '' );\n\t\treturn domain;\n\t}\n\n\tupdate_domain_placeholder( label, url, stage ) {\n\t\tvar domain = this.get_domain_name( url );\n\n\t\tif ( 'completed' === stage ) {\n\t\t\treturn label.replace( /\\%s\\s?/, '<span class=domain-label>' + domain + '</span> ' );\n\t\t}\n\n\t\treturn label.replace( /\\%s(\\S*)\\s?/, '<span class=domain-label>' + domain + '$1</span> ' );\n\t}\n\n\tget_migration_status_label( url, intent, stage ) {\n\t\tvar migrating_stage_label = '';\n\t\tvar completed_stage_label = '';\n\n\t\tswitch ( intent ) {\n\t\t\tcase 'push':\n\t\t\t\tmigrating_stage_label = wpmdb_strings.push_migration_label_migrating;\n\t\t\t\tcompleted_stage_label = wpmdb_strings.push_migration_label_completed;\n\t\t\t\tbreak;\n\t\t\tcase 'pull':\n\t\t\t\tmigrating_stage_label = wpmdb_strings.pull_migration_label_migrating;\n\t\t\t\tcompleted_stage_label = wpmdb_strings.pull_migration_label_completed;\n\t\t\t\tbreak;\n\t\t\tcase 'find_replace':\n\t\t\t\tmigrating_stage_label = wpmdb_strings.find_replace_label_migrating;\n\t\t\t\tcompleted_stage_label = wpmdb_strings.find_replace_label_completed;\n\t\t\t\tbreak;\n\t\t\tcase 'savefile':\n\t\t\t\tmigrating_stage_label = wpmdb_strings.exporting_please_wait;\n\t\t\t\tcompleted_stage_label = wpmdb_strings.exporting_complete;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tvar label = migrating_stage_label;\n\n\t\tif ( 'completed' === stage ) {\n\t\t\tlabel = completed_stage_label;\n\t\t}\n\n\t\tif ( 'push' === intent || 'pull' === intent ) {\n\t\t\tlabel = this.update_domain_placeholder( label, url, stage );\n\t\t}\n\n\t\tlabel = $.wpmdb.apply_filters( 'wpmdb_get_migration_status_label', label, {\n\t\t\tintent: intent,\n\t\t\tstage: stage\n\t\t} );\n\n\t\treturn label;\n\t}\n\n\tdisable_export_type_controls() {\n\t\t$( '.option-group' ).each( function( index ) {\n\t\t\t$( 'input', this ).attr( 'disabled', 'disabled' );\n\t\t\t$( 'label', this ).css( 'cursor', 'default' );\n\t\t} );\n\t}\n\n\tenable_export_type_controls() {\n\t\t$( '.option-group' ).each( function( index ) {\n\t\t\t$( 'input', this ).removeAttr( 'disabled' );\n\t\t\t$( 'label', this ).css( 'cursor', 'pointer' );\n\t\t} );\n\t}\n\n\tset_slider_value( parent_selector, value, unit, display ) {\n\t\tvar display_value = value;\n\n\t\tif ( undefined !== display ) {\n\t\t\tdisplay_value = display;\n\t\t}\n\n\t\t$( '.slider', parent_selector ).slider( 'value', parseInt( value ) );\n\t\t$( '.amount', parent_selector ).html( wpmdb.functions.wpmdb_add_commas( display_value ) + ' ' + unit );\n\t}\n\n\tset_pause_resume_button( event, instance ) {\n\t\tif ( true === this.migration_paused ) {\n\t\t\tthis.migration_paused = false;\n\t\t\tthis.doing_ajax = true;\n\n\t\t\twpmdb.current_migration.setState( this.previous_progress_title, this.previous_progress_text_primary, 'active' );\n\t\t\t$( '.pause-resume' ).html( wpmdb_strings.pause );\n\n\t\t\t// Resume the timer\n\t\t\twpmdb.current_migration.resumeTimer();\n\n\t\t\twpmdb.functions.execute_next_step( instance );\n\t\t} else {\n\t\t\tthis.migration_paused = true;\n\t\t\tthis.doing_ajax = false;\n\t\t\tthis.paused_text = wpmdb_strings.migration_paused;\n\t\t\tthis.previous_progress_title = $( '.progress-title' ).html();\n\t\t\tthis.previous_progress_text_primary = $( '.progress-text', '.progress-wrapper-primary' ).html();\n\t\t\tthis.previous_progress_text_secondary = $( '.progress-text', '.progress-wrapper-secondary ' ).html();\n\n\t\t\tif ( 'find_replace' === this.migration_intent ) {\n\t\t\t\tthis.paused_text = wpmdb_strings.find_replace_paused;\n\t\t\t}\n\n\t\t\twpmdb.current_migration.setState( this.paused_text, wpmdb_strings.completing_current_request, null );\n\t\t\t$( 'body' ).off( 'click', '.pause-resume' ); // Is re-bound at execute_next_step when migration is finally paused\n\t\t\t$( 'body' ).off( 'click', '.cancel' ); // Is re-bound at execute_next_step when migration is finally paused\n\t\t}\n\t}\n\n\t/**\n\t * Filter temporary tables out of wpmdb.functions.create_table_select().\n\t *\n\t * @param exclude\n\t * @param table_name\n\t * @returns {bool}\n\t */\n\tfilter_temp_tables( exclude, table_name ) {\n\t\tvar temp_prefix = wpmdb_data.this_temp_prefix;\n\n\t\tif ( 'pull' === wpmdb.functions.wpmdb_migration_type() && 'undefined' !== typeof wpmdb.common.connection_data && 'undefined' !== typeof wpmdb.common.connection_data.temp_prefix ) {\n\t\t\ttemp_prefix = wpmdb.common.connection_data.temp_prefix;\n\t\t}\n\n\t\tif ( temp_prefix === table_name.substring( 0, temp_prefix.length ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn exclude;\n\t}\n\n\tget_table_prefix( value, args ) {\n\t\treturn $( '.table-select-wrap .table-prefix' ).text();\n\t}\n\n\tlock_replace_url( lock ) {\n\t\tif ( true === lock ) {\n\t\t\t$( '.replace-row.pin .replace-right-col input[type=\"text\"]' ).attr( 'readonly', 'readonly' );\n\t\t\t$( '.replace-row.pin .arrow-col' ).addClass( 'disabled' );\n\t\t} else {\n\t\t\t$( '.replace-row.pin .replace-right-col input[type=\"text\"]' ).removeAttr( 'readonly' );\n\t\t\t$( '.replace-row.pin .arrow-col' ).removeClass( 'disabled' );\n\t\t}\n\t}\n\n\tset_connection_data( data ) {\n\t\twindow.wpmdb.common.previous_connection_data = wpmdb.common.connection_data;\n\t\twindow.wpmdb.common.connection_data = data;\n\t\t$.wpmdb.do_action( 'wpmdb_connection_data_updated', data );\n\t}\n\n\t/**\n\t * Returns formatted info for the Max Request Size slider.\n\t *\n\t * @param value\n\t * @return object\n\t */\n\tget_max_request_display_info( value ) {\n\t\tvar display_info = {};\n\n\t\tdisplay_info.unit = 'MB';\n\t\tdisplay_info.amount = (value / 1024).toFixed( 2 );\n\n\t\treturn display_info;\n\t}\n\n\testablish_remote_connection_from_saved_profile() {\n\t\tvar action = wpmdb.functions.wpmdb_migration_type();\n\t\tvar connection_info = $.trim( $( '.pull-push-connection-info' ).val() ).split( '\\n' );\n\t\tif ( 'undefined' === typeof wpmdb_default_profile ||\n\t\t true === wpmdb_default_profile ||\n\t\t 'savefile' === action ||\n\t\t 'find_replace' === action ||\n\t\t 'import' === action ||\n\t\t this.doing_ajax ||\n\t\t !wpmdb_data.is_pro ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.doing_ajax = true;\n\t\tthis.disable_export_type_controls();\n\n\t\t$( '.connection-status' ).html( wpmdb_strings.establishing_remote_connection );\n\t\t$( '.connection-status' ).removeClass( 'notification-message error-notice migration-error' );\n\t\t$( '.connection-status' ).append( this.ajax_spinner );\n\n\t\tvar intent = wpmdb.functions.wpmdb_migration_type();\n\t\t// Hack to keep object scope\n\t\tconst self = this;\n\n\t\t$.ajax( {\n\t\t\turl: ajaxurl,\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'json',\n\t\t\tcache: false,\n\t\t\tdata: {\n\t\t\t\taction: 'wpmdb_verify_connection_to_remote_site',\n\t\t\t\turl: connection_info[ 0 ],\n\t\t\t\tkey: connection_info[ 1 ],\n\t\t\t\tintent: intent,\n\t\t\t\tnonce: wpmdb_data.nonces.verify_connection_to_remote_site,\n\t\t\t\tconvert_post_type_selection: wpmdb_convert_post_type_selection,\n\t\t\t\tprofile: wpmdb_data.profile\n\t\t\t},\n\t\t\terror( jqXHR, textStatus, errorThrown ){\n\t\t\t\t$( '.connection-status' ).html( self.get_ajax_errors( jqXHR.responseText, '(#102)', jqXHR ) );\n\t\t\t\t$( '.connection-status' ).addClass( 'notification-message error-notice migration-error' );\n\t\t\t\t$( '.ajax-spinner' ).remove();\n\t\t\t\tself.doing_ajax = false;\n\t\t\t\tself.enable_export_type_controls();\n\t\t\t},\n\t\t\tsuccess( data ) {\n\t\t\t\t$( '.ajax-spinner' ).remove();\n\t\t\t\tself.doing_ajax = false;\n\t\t\t\tself.enable_export_type_controls();\n\n\t\t\t\tif ( 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error ) {\n\t\t\t\t\t$( '.connection-status' ).html( data.body );\n\t\t\t\t\t$( '.connection-status' ).addClass( 'notification-message error-notice migration-error' );\n\n\t\t\t\t\tif ( data.body.indexOf( '401 Unauthorized' ) > -1 ) {\n\t\t\t\t\t\t$( '.basic-access-auth-wrapper' ).show();\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( true === self.maybe_show_mst_warning( data ) ) {\n\t\t\t\t\t$( '.connection-status' ).hide();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tself.maybe_show_ssl_warning( connection_info[ 0 ], connection_info[ 1 ], data.scheme );\n\t\t\t\twpmdb.functions.maybe_show_prefix_notice( data.prefix );\n\n\t\t\t\t$( '.pull-push-connection-info' ).addClass( 'temp-disabled' );\n\t\t\t\t$( '.pull-push-connection-info' ).attr( 'readonly', 'readonly' );\n\t\t\t\t$( '.connect-button' ).hide();\n\n\t\t\t\t$( '.connection-status' ).hide();\n\t\t\t\t$( '.step-two' ).show();\n\t\t\t\tself.connection_established = true;\n\t\t\t\tself.set_connection_data( data );\n\t\t\t\tself.move_connection_info_box();\n\n\t\t\t\tself.maybe_show_mixed_cased_table_name_warning();\n\n\t\t\t\tvar loaded_tables = '';\n\t\t\t\tif ( false === wpmdb_default_profile && 'undefined' !== typeof wpmdb_loaded_tables ) {\n\t\t\t\t\tloaded_tables = wpmdb_loaded_tables;\n\t\t\t\t}\n\n\t\t\t\tself.$pull_select = wpmdb.functions.create_table_select( wpmdb.common.connection_data.tables, wpmdb.common.connection_data.table_sizes_hr, loaded_tables );\n\t\t\t\tvar loaded_post_types = '';\n\t\t\t\tif ( false === wpmdb_default_profile && 'undefined' !== typeof wpmdb_loaded_post_types ) {\n\t\t\t\t\tif ( 'undefined' !== typeof data.select_post_types ) {\n\t\t\t\t\t\t$( '#exclude-post-types' ).attr( 'checked', 'checked' );\n\t\t\t\t\t\t$( '.post-type-select-wrap' ).show();\n\t\t\t\t\t\tloaded_post_types = data.select_post_types;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tloaded_post_types = wpmdb_loaded_post_types;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar $post_type_select = document.createElement( 'select' );\n\t\t\t\t$( $post_type_select ).attr( {\n\t\t\t\t\tmultiple: 'multiple',\n\t\t\t\t\tname: 'select_post_types[]',\n\t\t\t\t\tid: 'select-post-types',\n\t\t\t\t\tclass: 'multiselect'\n\t\t\t\t} );\n\n\t\t\t\t$.each( wpmdb.common.connection_data.post_types, function( index, value ) {\n\t\t\t\t\tvar selected = $.inArray( value, loaded_post_types );\n\t\t\t\t\tif ( -1 !== selected || (true === wpmdb_convert_exclude_revisions && 'revision' !== value) ) {\n\t\t\t\t\t\tselected = ' selected=\"selected\" ';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tselected = ' ';\n\t\t\t\t\t}\n\t\t\t\t\t$( $post_type_select ).append( '<option' + selected + 'value=\"' + value + '\">' + value + '</option>' );\n\t\t\t\t} );\n\n\t\t\t\tself.$pull_post_type_select = $post_type_select;\n\n\t\t\t\tvar loaded_tables_backup = '';\n\t\t\t\tif ( false === wpmdb_default_profile && 'undefined' !== typeof wpmdb_loaded_tables_backup ) {\n\t\t\t\t\tloaded_tables_backup = wpmdb_loaded_tables_backup;\n\t\t\t\t}\n\n\t\t\t\tvar $table_select_backup = document.createElement( 'select' );\n\t\t\t\t$( $table_select_backup ).attr( {\n\t\t\t\t\tmultiple: 'multiple',\n\t\t\t\t\tname: 'select_backup[]',\n\t\t\t\t\tid: 'select-backup',\n\t\t\t\t\tclass: 'multiselect'\n\t\t\t\t} );\n\n\t\t\t\t$.each( wpmdb.common.connection_data.tables, function( index, value ) {\n\t\t\t\t\tvar selected = $.inArray( value, loaded_tables_backup );\n\t\t\t\t\tif ( -1 !== selected ) {\n\t\t\t\t\t\tselected = ' selected=\"selected\" ';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tselected = ' ';\n\t\t\t\t\t}\n\t\t\t\t\t$( $table_select_backup ).append( '<option' + selected + 'value=\"' + value + '\">' + value + ' (' + wpmdb.common.connection_data.table_sizes_hr[ value ] + ')</option>' );\n\t\t\t\t} );\n\n\t\t\t\tself.$push_select_backup = $table_select_backup;\n\n\t\t\t\tif ( 'pull' === wpmdb.functions.wpmdb_migration_type() ) {\n\t\t\t\t\t$.wpmdb.do_action( 'wpmdb_update_pull_table_select' );\n\t\t\t\t\t$( '#select-post-types' ).remove();\n\t\t\t\t\t$( '.exclude-post-types-warning' ).after( self.$pull_post_type_select );\n\t\t\t\t\t$( '#select-backup' ).remove();\n\t\t\t\t\t$( '.backup-tables-wrap' ).prepend( self.$pull_select_backup );\n\t\t\t\t\t$( '.table-prefix' ).html( data.prefix );\n\t\t\t\t\t$( '.uploads-dir' ).html( wpmdb_data.this_uploads_dir );\n\t\t\t\t} else {\n\t\t\t\t\t$( '#select-backup' ).remove();\n\t\t\t\t\t$( '.backup-tables-wrap' ).prepend( self.$push_select_backup );\n\t\t\t\t}\n\n\t\t\t\t$.wpmdb.do_action( 'verify_connection_to_remote_site', wpmdb.common.connection_data );\n\t\t\t}\n\t\t} );\n\t}\n\n\t/**\n\t * Main method that shows migration progress in the UI\n\t * @param current_row\n\t * @param primary_keys\n\t * @param iterator\n\t */\n\tmigrate_table_recursive( current_row, primary_keys, iterator ) {\n\t\tlet i = iterator || 0;\n\n\t\tif ( i >= this.tables_to_migrate.length ) {\n\n\t\t\tif ( 'upload' === this.stage && wpmdb.current_migration.model.getStageItems( 'find_replace' ).length ) {\n\t\t\t\tthis.stage = 'find_replace';\n\t\t\t\tthis.tables_to_migrate = wpmdb.current_migration.model.getStageItems( 'find_replace', 'name' );\n\t\t\t\tthis.tables_to_migrate = this.tables_to_migrate.map( function( table ) {\n\t\t\t\t\treturn '_mig_' + table;\n\t\t\t\t} );\n\t\t\t\ti = 0;\n\t\t\t} else if ( 'backup' === this.stage ) {\n\n\t\t\t\tif ( -1 !== $.inArray( this.migration_intent, [ 'push', 'pull' ] ) ) {\n\t\t\t\t\tthis.stage = 'migrate';\n\t\t\t\t} else if ( 'import' === this.migration_intent ) {\n\t\t\t\t\tthis.stage = 'upload';\n\t\t\t\t} else {\n\t\t\t\t\tthis.stage = this.migration_intent;\n\t\t\t\t}\n\n\t\t\t\twpmdb.current_migration.model.setActiveStage( this.stage );\n\n\t\t\t\tif ( 'find_replace' !== this.stage && 'migrate' !== this.stage ) {\n\t\t\t\t\twpmdb.functions.wpmdb_call_next_hook();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\ti = 0;\n\n\t\t\t\t// should get from model\n\t\t\t\tthis.tables_to_migrate = wpmdb.functions.get_tables_to_migrate( null, null );\n\n\t\t\t} else {\n\t\t\t\t$( '.progress-label' ).removeClass( 'label-visible' );\n\n\t\t\t\twpmdb.common.hooks = $.wpmdb.apply_filters( 'wpmdb_before_migration_complete_hooks', wpmdb.common.hooks );\n\t\t\t\twpmdb.common.hooks.push( wpmdb.functions.migration_complete );\n\t\t\t\twpmdb.common.hooks.push( wpmdb.functions.wpmdb_flush );\n\t\t\t\twpmdb.common.hooks = $.wpmdb.apply_filters( 'wpmdb_after_migration_complete_hooks', wpmdb.common.hooks );\n\t\t\t\twpmdb.common.hooks.push( wpmdb.functions.migration_complete_events );\n\t\t\t\twpmdb.common.next_step_in_migration = { fn: wpmdb.functions.wpmdb_call_next_hook };\n\t\t\t\twpmdb.functions.execute_next_step();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tvar last_table = 0;\n\t\tif ( i === (this.tables_to_migrate.length - 1) ) {\n\t\t\tlast_table = 1;\n\t\t}\n\n\t\tvar gzip = 0;\n\t\tif ( -1 !== $.inArray( this.migration_intent, [\n\t\t\t\t'push',\n\t\t\t\t'pull'\n\t\t\t] ) && 1 === parseInt( wpmdb.common.connection_data.gzip ) ) {\n\t\t\tgzip = 1;\n\t\t}\n\n\t\tvar request_data = {\n\t\t\taction: 'wpmdb_migrate_table',\n\t\t\tmigration_state_id: wpmdb.migration_state_id,\n\t\t\ttable: this.tables_to_migrate[ i ],\n\t\t\tstage: this.stage,\n\t\t\tcurrent_row: current_row,\n\t\t\tlast_table: last_table,\n\t\t\tprimary_keys: primary_keys,\n\t\t\tgzip: gzip,\n\t\t\tnonce: wpmdb_data.nonces.migrate_table\n\t\t};\n\n\t\tif ( -1 !== $.inArray( this.migration_intent, [ 'push', 'pull' ] ) ) {\n\t\t\trequest_data.bottleneck = wpmdb.common.connection_data.bottleneck;\n\t\t\trequest_data.prefix = wpmdb.common.connection_data.prefix;\n\t\t}\n\n\t\tif ( wpmdb.common.connection_data && wpmdb.common.connection_data.path_current_site && wpmdb.common.connection_data.domain ) {\n\t\t\trequest_data.path_current_site = wpmdb.common.connection_data.path_current_site;\n\t\t\trequest_data.domain_current_site = wpmdb.common.connection_data.domain;\n\t\t}\n\n\t\tthis.doing_ajax = true;\n\n\t\t$.ajax( {\n\t\t\turl: ajaxurl,\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'text',\n\t\t\tcache: false,\n\t\t\ttimeout: 0,\n\t\t\tdata: request_data,\n\t\t\terror: ( jqXHR, textStatus, errorThrown ) => {\n\t\t\t\tvar progress_text = wpmdb_strings.table_process_problem + ' ' + this.tables_to_migrate[ i ] + '<br /><br />' + wpmdb_strings.status + ': ' + jqXHR.status + ' ' + jqXHR.statusText + '<br /><br />' + wpmdb_strings.response + ':<br />' + jqXHR.responseText;\n\t\t\t\twpmdb.current_migration.setState( wpmdb_strings.migration_failed, progress_text, 'error' );\n\n\t\t\t\tthis.doing_ajax = false;\n\t\t\t\tconsole.log( jqXHR );\n\t\t\t\tconsole.log( textStatus );\n\t\t\t\tconsole.log( errorThrown );\n\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\twpmdb.functions.migration_complete_events();\n\n\t\t\t},\n\t\t\tsuccess: ( data ) => {\n\t\t\t\tthis.doing_ajax = false;\n\t\t\t\tdata = $.trim( data );\n\t\t\t\tvar row_information = wpmdb.functions.wpmdb_parse_json( data );\n\t\t\t\tvar error_text = '';\n\n\t\t\t\tif ( false === row_information || null === row_information ) {\n\n\t\t\t\t\t// should update model\n\t\t\t\t\tif ( '' === data || null === data ) {\n\t\t\t\t\t\terror_text = wpmdb_strings.table_process_problem_empty_response + ' ' + this.tables_to_migrate[ i ];\n\t\t\t\t\t} else {\n\t\t\t\t\t\terror_text = this.get_ajax_errors( data, null, null );\n\t\t\t\t\t}\n\n\t\t\t\t\twpmdb.current_migration.setState( wpmdb_strings.migration_failed, error_text, 'error' );\n\t\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\t\twpmdb.functions.migration_complete_events();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( 'undefined' !== typeof row_information.wpmdb_error && 1 === row_information.wpmdb_error ) {\n\t\t\t\t\twpmdb.current_migration.setState( wpmdb_strings.migration_failed, row_information.body, 'error' );\n\t\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\t\twpmdb.functions.migration_complete_events();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar item_name = this.tables_to_migrate[ i ];\n\t\t\t\tif ( 'import' === this.migration_intent && 'find_replace' === this.stage ) {\n\t\t\t\t\titem_name = item_name.replace( wpmdb_data.this_temp_prefix, '' );\n\t\t\t\t}\n\n\t\t\t\t//successful iteration\n\t\t\t\twpmdb.current_migration.setText();\n\t\t\t\twpmdb.current_migration.model.getStageModel( this.stage ).setItemRowsTransferred( item_name, row_information.current_row );\n\n\t\t\t\t// We need the returned file name for delivery or display to the user.\n\t\t\t\tif ( 1 === last_table && 'savefile' === this.migration_intent ) {\n\t\t\t\t\tif ( 'undefined' !== typeof row_information.dump_filename ) {\n\t\t\t\t\t\tthis.dump_filename = row_information.dump_filename;\n\t\t\t\t\t}\n\t\t\t\t\tif ( 'undefined' !== typeof row_information.dump_path ) {\n\t\t\t\t\t\tthis.dump_path = row_information.dump_path;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( -1 === parseInt( row_information.current_row ) ) {\n\t\t\t\t\ti++;\n\t\t\t\t\trow_information.current_row = '';\n\t\t\t\t\trow_information.primary_keys = '';\n\t\t\t\t}\n\n\t\t\t\twpmdb.common.next_step_in_migration = {\n\t\t\t\t\tfn: wpmdb.functions.migrate_table_recursive,\n\t\t\t\t\targs: [ row_information.current_row, row_information.primary_keys, i ]\n\t\t\t\t};\n\t\t\t\twpmdb.functions.execute_next_step();\n\t\t\t}\n\t\t} );\n\n\t}\n\n\tmigration_complete_events() {\n\t\tif ( false === wpmdb.common.migration_error ) {\n\t\t\tif ( '' === wpmdb.common.non_fatal_errors ) {\n\t\t\t\tif ( 'savefile' !== this.migration_intent && true === $( '#save_computer' ).is( ':checked' ) ) {\n\t\t\t\t\twpmdb.current_migration.setText();\n\t\t\t\t}\n\n\t\t\t\tthis.completed_msg = this.completed_msg + ' <div class=\"dashicons dashicons-yes\"></div>';\n\n\t\t\t\tif ( true === this.migration_cancelled ) {\n\t\t\t\t\tvar cancel_success = wpmdb_strings.migration_cancelled_success;\n\n\t\t\t\t\tif ( 'find_replace' === this.migration_intent ) {\n\t\t\t\t\t\tcancel_success = wpmdb_strings.find_replace_cancelled_success;\n\t\t\t\t\t}\n\n\t\t\t\t\twpmdb.current_migration.setState( this.completed_msg, cancel_success, 'cancelled' );\n\t\t\t\t} else {\n\t\t\t\t\twpmdb.current_migration.setState( this.completed_msg, '', 'complete' );\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\twpmdb.current_migration.setState( wpmdb_strings.completed_with_some_errors, wpmdb.common.non_fatal_errors, 'error' );\n\t\t\t}\n\t\t}\n\n\t\t$( '.migration-controls' ).addClass( 'hidden' );\n\n\t\t// reset migration variables so consecutive migrations work correctly\n\t\twpmdb.common.hooks = [];\n\t\twpmdb.common.call_stack = [];\n\t\twpmdb.common.migration_error = false;\n\t\tthis.currently_migrating = false;\n\t\tthis.migration_completed = true;\n\t\tthis.migration_paused = false;\n\t\tthis.migration_cancelled = false;\n\t\tthis.doing_ajax = false;\n\t\twpmdb.common.non_fatal_errors = '';\n\t\tthis.tables_to_migrate = [];\n\n\t\t$( '.progress-label' ).remove();\n\t\t$( '.migration-progress-ajax-spinner' ).remove();\n\t\t$( '.close-progress-content' ).show();\n\t\t$( '#overlay' ).css( 'cursor', 'pointer' );\n\t\twpmdb.current_migration.model.setMigrationComplete();\n\t}\n\n\tmigration_complete() {\n\n\t\t$( '.migration-controls' ).addClass( 'hidden' );\n\n\t\tif ( 'savefile' === this.migration_intent ) {\n\t\t\tthis.currently_migrating = false;\n\t\t\tvar migrate_complete_text = wpmdb_strings.migration_complete;\n\t\t\tif ( $( '#save_computer' ).is( ':checked' ) ) {\n\t\t\t\tvar url = wpmdb_data.this_download_url + encodeURIComponent( this.dump_filename );\n\t\t\t\tif ( $( '#gzip_file' ).is( ':checked' ) ) {\n\t\t\t\t\turl += '&gzip=1';\n\t\t\t\t}\n\t\t\t\twindow.location = url;\n\t\t\t} else {\n\t\t\t\tmigrate_complete_text = wpmdb_strings.completed_dump_located_at + ' ' + this.dump_path;\n\t\t\t}\n\n\t\t\tif ( false === wpmdb.common.migration_error ) {\n\n\t\t\t\twpmdb.functions.migration_complete_events();\n\t\t\t\twpmdb.current_migration.setState( this.completed_msg, migrate_complete_text, 'complete' );\n\n\t\t\t}\n\n\t\t} else { // rename temp tables, delete old tables\n\n\t\t\twpmdb.current_migration.setState( null, wpmdb_strings.finalizing_migration, 'finalizing' );\n\n\t\t\tvar request_data = {\n\t\t\t\taction: 'wpmdb_finalize_migration',\n\t\t\t\tmigration_state_id: wpmdb.migration_state_id,\n\t\t\t\ttables: this.tables_to_migrate.join( ',' ),\n\t\t\t\tnonce: wpmdb_data.nonces.finalize_migration\n\t\t\t};\n\n\t\t\tif ( -1 !== $.inArray( this.migration_intent, [ 'push', 'pull' ] ) ) {\n\t\t\t\trequest_data.prefix = wpmdb.common.connection_data.prefix;\n\t\t\t}\n\n\t\t\tthis.doing_ajax = true;\n\t\t\t$.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'POST',\n\t\t\t\tdataType: 'text',\n\t\t\t\tcache: false,\n\t\t\t\tdata: request_data,\n\t\t\t\terror: ( jqXHR, textStatus, errorThrown ) => {\n\t\t\t\t\tthis.doing_ajax = false;\n\t\t\t\t\twpmdb.current_migration.setState( wpmdb_strings.migration_failed, wpmdb_strings.finalize_tables_problem, 'error' );\n\n\t\t\t\t\talert( jqXHR + ' : ' + textStatus + ' : ' + errorThrown );\n\t\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\t\twpmdb.functions.migration_complete_events();\n\n\t\t\t\t},\n\t\t\t\tsuccess: ( data ) => {\n\t\t\t\t\tthis.doing_ajax = false;\n\t\t\t\t\tif ( '1' !== $.trim( data ) ) {\n\t\t\t\t\t\twpmdb.current_migration.setState( wpmdb_strings.migration_failed, data, 'error' );\n\n\t\t\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\t\t\twpmdb.functions.migration_complete_events();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\twpmdb.common.next_step_in_migration = { fn: wpmdb.functions.wpmdb_call_next_hook };\n\t\t\t\t\twpmdb.functions.execute_next_step();\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\twpmdb_flush() {\n\t\tif ( 'savefile' !== this.migration_intent ) {\n\t\t\twpmdb.current_migration.setText( wpmdb_strings.flushing );\n\t\t\tthis.doing_ajax = true;\n\t\t\t$.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'POST',\n\t\t\t\tdataType: 'text',\n\t\t\t\tcache: false,\n\t\t\t\tdata: {\n\t\t\t\t\taction: 'wpmdb_flush',\n\t\t\t\t\tmigration_state_id: wpmdb.migration_state_id,\n\t\t\t\t\tnonce: wpmdb_data.nonces.flush\n\t\t\t\t},\n\t\t\t\terror: ( jqXHR, textStatus, errorThrown ) => {\n\t\t\t\t\tthis.doing_ajax = false;\n\t\t\t\t\twpmdb.current_migration.setState( wpmdb_strings.migration_failed, wpmdb_strings.flush_problem, 'error' );\n\n\t\t\t\t\talert( jqXHR + ' : ' + textStatus + ' : ' + errorThrown );\n\t\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\t\twpmdb.functions.migration_complete_events();\n\n\t\t\t\t},\n\t\t\t\tsuccess: ( data ) => {\n\t\t\t\t\tthis.doing_ajax = false;\n\t\t\t\t\tif ( '1' !== $.trim( data ) ) {\n\t\t\t\t\t\twpmdb.current_migration.setState( wpmdb_strings.migration_failed, data, 'error' );\n\n\t\t\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\t\t\twpmdb.functions.migration_complete_events();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\twpmdb.common.next_step_in_migration = { fn: wpmdb.functions.wpmdb_call_next_hook };\n\t\t\t\t\twpmdb.functions.execute_next_step();\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\texecute_next_step() {\n\n\t\t// if delay is set, set a timeout for delay to recall this function, then return\n\t\tif ( 0 < this.delay_between_requests && false === this.flag_skip_delay ) {\n\t\t\tsetTimeout( function() {\n\t\t\t\tthis.flag_skip_delay = true;\n\t\t\t\twpmdb.functions.execute_next_step();\n\t\t\t}, this.delay_between_requests );\n\t\t\treturn;\n\t\t} else {\n\t\t\tthis.flag_skip_delay = false;\n\t\t}\n\n\t\tif ( true === this.migration_paused ) {\n\t\t\t$( '.migration-progress-ajax-spinner' ).hide();\n\n\t\t\t// Pause the timer\n\t\t\twpmdb.current_migration.pauseTimer();\n\n\t\t\tvar pause_text = '';\n\t\t\tif ( true === this.is_auto_pause_before_finalize ) {\n\t\t\t\tpause_text = wpmdb_strings.paused_before_finalize;\n\t\t\t\tthis.is_auto_pause_before_finalize = false;\n\n\t\t\t\tif ( 'find_replace' === wpmdb.functions.wpmdb_migration_type() ) {\n\t\t\t\t\tpause_text = wpmdb_strings.find_replace_paused_before_finalize;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tpause_text = wpmdb_strings.paused;\n\t\t\t}\n\n\t\t\twpmdb.current_migration.setState( null, pause_text, 'paused' );\n\n\t\t\t// Re-bind Pause/Resume button to Resume when we are finally Paused\n\t\t\t$( 'body' ).on( 'click', '.pause-resume', function( event ) {\n\t\t\t\tthis.set_pause_resume_button( event );\n\t\t\t} );\n\t\t\t$( 'body' ).on( 'click', '.cancel', function( event ) {\n\t\t\t\tthis.cancel_migration( event );\n\t\t\t} );\n\t\t\t$( '.pause-resume' ).html( wpmdb_strings.resume );\n\n\t\t} else if ( true === this.migration_cancelled ) {\n\t\t\tthis.migration_intent = wpmdb.functions.wpmdb_migration_type();\n\n\t\t\tvar progress_msg;\n\n\t\t\tif ( 'savefile' === this.migration_intent ) {\n\t\t\t\tprogress_msg = wpmdb_strings.removing_local_sql;\n\t\t\t} else if ( 'pull' === this.migration_intent ) {\n\t\t\t\tif ( 'backup' === this.stage ) {\n\t\t\t\t\tprogress_msg = wpmdb_strings.removing_local_backup;\n\t\t\t\t} else {\n\t\t\t\t\tprogress_msg = wpmdb_strings.removing_local_temp_tables;\n\t\t\t\t}\n\t\t\t} else if ( 'push' === this.migration_intent ) {\n\t\t\t\tif ( 'backup' === this.stage ) {\n\t\t\t\t\tprogress_msg = wpmdb_strings.removing_remote_sql;\n\t\t\t\t} else {\n\t\t\t\t\tprogress_msg = wpmdb_strings.removing_remote_temp_tables;\n\t\t\t\t}\n\t\t\t}\n\t\t\twpmdb.current_migration.setText( progress_msg );\n\n\t\t\tvar request_data = {\n\t\t\t\taction: 'wpmdb_cancel_migration',\n\t\t\t\tmigration_state_id: wpmdb.migration_state_id,\n\t\t\t\tnonce: wpmdb_data.nonces.cancel_migration\n\t\t\t};\n\n\t\t\tthis.doing_ajax = true;\n\n\t\t\t$.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'POST',\n\t\t\t\tdataType: 'text',\n\t\t\t\tcache: false,\n\t\t\t\tdata: request_data,\n\t\t\t\terror: ( jqXHR, textStatus, errorThrown ) => {\n\t\t\t\t\twpmdb.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' );\n\t\t\t\t\tconsole.log( jqXHR );\n\t\t\t\t\tconsole.log( textStatus );\n\t\t\t\t\tconsole.log( errorThrown );\n\t\t\t\t\tthis.doing_ajax = false;\n\t\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\t\twpmdb.functions.migration_complete_events();\n\n\t\t\t\t},\n\t\t\t\tsuccess: ( data ) => {\n\t\t\t\t\tthis.doing_ajax = false;\n\t\t\t\t\tdata = $.trim( data );\n\n\t\t\t\t\tif ( ('push' === this.migration_intent && '1' !== data) || ('push' !== this.migration_intent && '' !== data) ) {\n\n\t\t\t\t\t\tif ( 'undefined' !== typeof data && 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error ) {\n\t\t\t\t\t\t\tdata = data.wpmdb_error;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\twpmdb.current_migration.setState( wpmdb_strings.migration_cancellation_failed, data, 'error' );\n\t\t\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\t\t\twpmdb.functions.migration_complete_events();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.completed_msg = wpmdb_strings.migration_cancelled;\n\n\t\t\t\t\tif ( 'find_replace' === this.migration_intent ) {\n\t\t\t\t\t\tthis.completed_msg = wpmdb_strings.find_replace_cancelled;\n\t\t\t\t\t}\n\n\t\t\t\t\twpmdb.functions.migration_complete_events();\n\t\t\t\t\twpmdb.current_migration.setStatus( 'cancelled' );\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\twpmdb.common.next_step_in_migration.fn.apply( null, wpmdb.common.next_step_in_migration.args );\n\t\t}\n\t}\n\n\tmaybe_show_prefix_notice( prefix ) {\n\t\tvar $prefix_notice = $( '.prefix-notice' );\n\n\t\t$prefix_notice.hide();\n\n\t\tif ( prefix !== wpmdb_data.this_prefix ) {\n\t\t\t$( '.remote-prefix' ).html( prefix );\n\t\t\tthis.show_prefix_notice = true;\n\t\t\t$prefix_notice.show();\n\t\t}\n\t}\n\n\tmaybe_show_mst_warning( data ) {\n\t\tconst migration_type = wpmdb.functions.wpmdb_migration_type();\n\t\tlet show_mst_warning = false;\n\n\t\tif ( -1 !== $.inArray( migration_type, [ 'push', 'pull' ] ) && 'undefined' !== typeof data.site_details ) {\n\t\t\tif ( wpmdb_data.site_details.is_multisite !== data.site_details.is_multisite ) {\n\t\t\t\tif ( 'undefined' === typeof wpmdb.mst || 'undefined' === typeof data.mst_available || '1' !== data.mst_available ) {\n\t\t\t\t\tshow_mst_warning = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ( 'import' === migration_type ) {\n\t\t\tif ( 'undefined' !== typeof data.multisite && 'undefined' !== typeof data.subsite_export ) {\n\t\t\t\tif (\n\t\t\t\t\t('false' === wpmdb_data.site_details.is_multisite && 'true' === data.multisite && 'true' !== data.subsite_export) ||\n\t\t\t\t\t('true' === wpmdb_data.site_details.is_multisite && 'false' === data.multisite)\n\t\t\t\t) {\n\t\t\t\t\tshow_mst_warning = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tshow_mst_warning = $.wpmdb.apply_filters( 'wpmdb_show_mst_warning', show_mst_warning );\n\n\t\tif ( show_mst_warning ) {\n\t\t\t$( '.mst-required' ).show();\n\t\t}\n\n\t\treturn show_mst_warning;\n\n\t}\n\n\tmaybe_show_select_table_notice() {\n\n\t\t// check that they've selected some tables to migrate\n\t\tif ( $( '#migrate-selected' ).is( ':checked' ) && null === $( '#select-tables' ).val() ) {\n\t\t\tif ( 'import' !== wpmdb.functions.wpmdb_migration_type() ) {\n\t\t\t\talert( wpmdb_strings.please_select_one_table );\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tif ( $( '#import-find-replace' ).is( ':checked' ) && $( '#select-tables' ).is( ':visible' ) ) {\n\t\t\t\t\talert( wpmdb_strings.please_select_one_table_import );\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// check that they've selected some tables to backup\n\t\tif ( 'savefile' !== wpmdb.functions.wpmdb_migration_type() && $( '#backup-manual-select' ).is( ':checked' ) && null === $( '#select-backup' ).val() ) {\n\t\t\talert( wpmdb_strings.please_select_one_table_backup );\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tremove_protocol( url ) {\n\t\treturn url.replace( /^https?:/i, '' );\n\t}\n\n\tcreate_table_select( tables, table_sizes_hr, selected_tables ) {\n\t\tvar $table_select = document.createElement( 'select' );\n\t\t$( $table_select ).attr( {\n\t\t\tmultiple: 'multiple',\n\t\t\tname: 'select_tables[]',\n\t\t\tid: 'select-tables',\n\t\t\tclass: 'multiselect'\n\t\t} );\n\n\t\tif ( 0 < tables.length ) {\n\t\t\t$.each( tables, function( index, table ) {\n\t\t\t\tif ( $.wpmdb.apply_filters( 'wpmdb_exclude_table', false, table ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar selected = ' ';\n\t\t\t\tif ( undefined !== selected_tables && null !== selected_tables && 0 < selected_tables.length && -1 !== $.inArray( table, selected_tables ) ) {\n\t\t\t\t\tselected = ' selected=\"selected\" ';\n\t\t\t\t}\n\n\t\t\t\tvar size = '';\n\t\t\t\tif ( 0 !== table_sizes_hr.length ) {\n\t\t\t\t\tsize = ' (' + table_sizes_hr[ table ] + ')';\n\t\t\t\t}\n\n\t\t\t\t$( $table_select ).append( '<option' + selected + 'value=\"' + table + '\">' + table + size + '</option>' );\n\t\t\t} );\n\t\t}\n\n\t\treturn $table_select;\n\t}\n\n\t/**\n\t * Returns tables selected for migration.\n\t *\n\t * @returns {array}\n\t *\n\t * Also handler for wpmdb_get_tables_to_migrate filter, disregards input values as it is the primary source.\n\t */\n\tget_tables_to_migrate() {\n\t\tvar tables = [];\n\t\tvar mig_type = wpmdb.functions.wpmdb_migration_type();\n\t\tvar table_intent = $( 'input[name=table_migrate_option]:checked' ).val();\n\n\t\t// Grab tables as per what the user has selected from the multiselect box or all prefixed tables.\n\t\tif ( 'migrate_select' === table_intent ) {\n\t\t\ttables = $( '#select-tables' ).val();\n\t\t} else {\n\t\t\tif ( 'pull' !== mig_type && 'undefined' !== typeof wpmdb_data.this_prefixed_tables ) {\n\t\t\t\ttables = wpmdb_data.this_prefixed_tables;\n\t\t\t} else if ( 'pull' === mig_type && 'undefined' !== typeof wpmdb.common.connection_data && 'undefined' !== typeof wpmdb.common.connection_data.prefixed_tables ) {\n\t\t\t\ttables = wpmdb.common.connection_data.prefixed_tables;\n\t\t\t}\n\t\t}\n\n\t\treturn tables;\n\t}\n\n\tupdate_migrate_button_text() {\n\t\tvar migration_intent = wpmdb.functions.wpmdb_migration_type();\n\t\tvar save_string = ($( '#save-migration-profile' ).is( ':checked' )) ? '_save' : '';\n\t\tvar migrate_string = 'migrate_button_' + (('savefile' === migration_intent) ? 'export' : migration_intent) + save_string;\n\t\t$( '.migrate-db .button-primary' ).val( wpmdb_strings[ migrate_string ] );\n\t}\n\n\t// fired when the connection info box changes (e.g. gets pasted into)\n\tconnection_box_changed() {\n\t\tvar $this = $( '.pull-push-connection-info' );\n\n\t\tif ( -1 === $.inArray( wpmdb.functions.wpmdb_migration_type(), [ 'push', 'pull' ] ) ||\n\t\t (this.doing_ajax || $( $this ).hasClass( 'temp-disabled' )) && false === wpmdb.force_reconnect ) {\n\t\t\treturn;\n\t\t}\n\n\t\twpmdb.force_reconnect = false;\n\t\tvar data = $( '.pull-push-connection-info' ).val();\n\n\t\tvar connection_info = $.trim( data ).split( '\\n' );\n\t\tvar error = false;\n\t\tvar error_message = '';\n\n\t\tif ( '' === connection_info ) {\n\t\t\terror = true;\n\t\t\terror_message = wpmdb_strings.connection_info_missing;\n\t\t}\n\n\t\t// attempt to format the connection info from a single line\n\t\tif ( 1 === connection_info.length && !error ) {\n\t\t\tvar connection_words = $.trim( data ).split( ' ' );\n\t\t\tif ( 2 === connection_words.length ) {\n\t\t\t\tconnection_info = connection_words;\n\t\t\t}\n\t\t}\n\n\t\tif ( 2 !== connection_info.length && !error ) {\n\t\t\terror = true;\n\t\t\terror_message = wpmdb_strings.connection_info_incorrect;\n\t\t}\n\n\t\tif ( !error && !this.validate_url( connection_info[ 0 ] ) ) {\n\t\t\terror = true;\n\t\t\terror_message = wpmdb_strings.connection_info_url_invalid;\n\t\t}\n\n\t\tvar key_length = 0;\n\n\t\tif ( 'undefined' !== typeof connection_info[ 1 ] ) {\n\t\t\tkey_length = connection_info[ 1 ].length;\n\t\t}\n\n\t\tif ( !error && 32 !== key_length && 40 !== key_length ) {\n\t\t\terror = true;\n\t\t\terror_message = wpmdb_strings.connection_info_key_invalid;\n\t\t}\n\n\t\tif ( !error && connection_info[ 0 ] === wpmdb_data.connection_info[ 0 ] ) {\n\t\t\terror = true;\n\t\t\terror_message = wpmdb_strings.connection_info_local_url;\n\t\t}\n\n\t\tif ( !error && connection_info[ 1 ] === wpmdb_data.connection_info[ 1 ] ) {\n\t\t\terror = true;\n\t\t\terror_message = wpmdb_strings.connection_info_local_key;\n\t\t}\n\t\tif ( error ) {\n\t\t\t$( '.connection-status' ).html( error_message );\n\t\t\t$( '.connection-status' ).addClass( 'notification-message error-notice migration-error' );\n\t\t\treturn;\n\t\t}\n\n\t\tvar new_connection_info_contents = connection_info[ 0 ] + '\\n' + connection_info[ 1 ];\n\n\t\t// If connection info is a single line\n\t\tif ( 1 === $.trim( data ).split( '\\n' ).length ) {\n\n\t\t\t// Repopulate the input with the info on two lines\n\t\t\t$( '.pull-push-connection-info' ).val( new_connection_info_contents );\n\t\t}\n\n\t\tif ( false === wpmdb_data.openssl_available ) {\n\t\t\tconnection_info[ 0 ] = connection_info[ 0 ].replace( 'https://', 'http://' );\n\t\t\tnew_connection_info_contents = connection_info[ 0 ] + '\\n' + connection_info[ 1 ];\n\t\t\t$( '.pull-push-connection-info' ).val( new_connection_info_contents );\n\t\t}\n\n\t\tthis.show_prefix_notice = false;\n\t\tthis.doing_ajax = true;\n\t\tthis.disable_export_type_controls();\n\n\t\tif ( $( '.basic-access-auth-wrapper' ).is( ':visible' ) ) {\n\t\t\tconnection_info[ 0 ] = connection_info[ 0 ].replace( /\\/\\/(.*)@/, '//' );\n\t\t\tconnection_info[ 0 ] = connection_info[ 0 ].replace( '//', '//' + encodeURIComponent( $.trim( $( '.auth-username' ).val() ) ) + ':' + encodeURIComponent( $.trim( $( '.auth-password' ).val() ) ) + '@' );\n\t\t\tnew_connection_info_contents = connection_info[ 0 ] + '\\n' + connection_info[ 1 ];\n\t\t\t$( '.pull-push-connection-info' ).val( new_connection_info_contents );\n\t\t\t$( '.basic-access-auth-wrapper' ).hide();\n\t\t}\n\n\t\t$( '.step-two' ).hide();\n\t\t$( '.ssl-notice' ).hide();\n\t\t$( '.prefix-notice' ).hide();\n\t\t$( '.connection-status' ).show();\n\n\t\t$( '.connection-status' ).html( wpmdb_strings.establishing_remote_connection );\n\t\t$( '.connection-status' ).removeClass( 'notification-message error-notice migration-error' );\n\t\t$( '.connection-status' ).append( this.ajax_spinner );\n\n\t\tvar intent = wpmdb.functions.wpmdb_migration_type();\n\n\t\tthis.profile_name_edited = false;\n\n\t\treturn $.ajax( {\n\t\t\turl: ajaxurl,\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'json',\n\t\t\tcache: false,\n\t\t\tdata: {\n\t\t\t\taction: 'wpmdb_verify_connection_to_remote_site',\n\t\t\t\turl: connection_info[ 0 ],\n\t\t\t\tkey: connection_info[ 1 ],\n\t\t\t\tintent: intent,\n\t\t\t\tnonce: wpmdb_data.nonces.verify_connection_to_remote_site\n\t\t\t},\n\t\t\terror: ( jqXHR, textStatus, errorThrown ) => {\n\t\t\t\t$( '.connection-status' ).html( this.get_ajax_errors( jqXHR.responseText, '(#100)', jqXHR ) );\n\t\t\t\t$( '.connection-status' ).addClass( 'notification-message error-notice migration-error' );\n\t\t\t\t$( '.ajax-spinner' ).remove();\n\t\t\t\tthis.doing_ajax = false;\n\t\t\t\tthis.enable_export_type_controls();\n\t\t\t},\n\t\t\tsuccess: ( data ) => {\n\t\t\t\t$( '.ajax-spinner' ).remove();\n\t\t\t\tthis.doing_ajax = false;\n\t\t\t\tthis.enable_export_type_controls();\n\n\t\t\t\tif ( 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error ) {\n\t\t\t\t\t$( '.connection-status' ).html( data.body );\n\t\t\t\t\t$( '.connection-status' ).addClass( 'notification-message error-notice migration-error' );\n\n\t\t\t\t\tif ( data.body.indexOf( '401 Unauthorized' ) > -1 ) {\n\t\t\t\t\t\t$( '.basic-access-auth-wrapper' ).show();\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !$( '.pull-push-connection-info' ).hasClass( 'temp-disabled' ) && !$( '.connect-button' ).is( ':visible' ) ) {\n\t\t\t\t\t\t$( '.pull-push-connection-info' ).removeAttr( 'readonly' );\n\t\t\t\t\t\t$( '.connect-button' ).show();\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( true === this.maybe_show_mst_warning( data ) ) {\n\t\t\t\t\t$( '.connection-status' ).hide();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.maybe_show_ssl_warning( connection_info[ 0 ], connection_info[ 1 ], data.scheme );\n\n\t\t\t\tvar profile_name = this.get_domain_name( data.url );\n\t\t\t\t$( '.create-new-profile' ).val( profile_name );\n\n\t\t\t\t$( '.pull-push-connection-info' ).addClass( 'temp-disabled' );\n\t\t\t\t$( '.pull-push-connection-info' ).attr( 'readonly', 'readonly' );\n\t\t\t\t$( '.connect-button' ).hide();\n\n\t\t\t\t$( '.connection-status' ).hide();\n\t\t\t\t$( '.step-two' ).show();\n\n\t\t\t\twpmdb.functions.maybe_show_prefix_notice( data.prefix );\n\n\t\t\t\tthis.connection_established = true;\n\t\t\t\tthis.set_connection_data( data );\n\t\t\t\tthis.move_connection_info_box();\n\t\t\t\tthis.change_replace_values();\n\n\t\t\t\tthis.maybe_show_mixed_cased_table_name_warning();\n\n\t\t\t\tthis.refresh_table_selects( null, null, this );\n\n\t\t\t\tthis.$push_select_backup = $( this.$pull_select ).clone();\n\t\t\t\t$( this.$push_select_backup ).attr( {\n\t\t\t\t\tname: 'select_backup[]',\n\t\t\t\t\tid: 'select-backup'\n\t\t\t\t} );\n\n\t\t\t\tvar $post_type_select = document.createElement( 'select' );\n\t\t\t\t$( $post_type_select ).attr( {\n\t\t\t\t\tmultiple: 'multiple',\n\t\t\t\t\tname: 'select_post_types[]',\n\t\t\t\t\tid: 'select-post-types',\n\t\t\t\t\tclass: 'multiselect'\n\t\t\t\t} );\n\n\t\t\t\t$.each( wpmdb.common.connection_data.post_types, function( index, value ) {\n\t\t\t\t\t$( $post_type_select ).append( '<option value=\"' + value + '\">' + value + '</option>' );\n\t\t\t\t} );\n\n\t\t\t\tthis.$pull_post_type_select = $post_type_select;\n\n\t\t\t\t$( '#new-path-missing-warning, #new-url-missing-warning' ).hide();\n\n\t\t\t\tif ( 'pull' === wpmdb.functions.wpmdb_migration_type() ) {\n\t\t\t\t\t$( '#new-url' ).val( this.remove_protocol( wpmdb_data.this_url ) );\n\t\t\t\t\t$( '#new-path' ).val( wpmdb_data.this_path );\n\t\t\t\t\tif ( 'true' === wpmdb_data.is_multisite ) {\n\t\t\t\t\t\t$( '#new-domain' ).val( wpmdb_data.this_domain );\n\t\t\t\t\t\t$( '.replace-row.pin .old-replace-col input[type=\"text\"]' ).val( this.remove_protocol( data.url ) );\n\t\t\t\t\t}\n\t\t\t\t\t$( '#old-url' ).val( this.remove_protocol( data.url ) );\n\t\t\t\t\t$( '#old-path' ).val( data.path );\n\n\t\t\t\t\t$.wpmdb.do_action( 'wpmdb_update_pull_table_select' );\n\t\t\t\t\t$( '#select-post-types' ).remove();\n\t\t\t\t\t$( '.exclude-post-types-warning' ).after( this.$pull_post_type_select );\n\t\t\t\t\twpmdb.functions.exclude_post_types_warning();\n\t\t\t\t\t$( '.table-prefix' ).html( data.prefix );\n\t\t\t\t\t$( '.backup-table-prefix' ).html( wpmdb_data.site_details.prefix );\n\t\t\t\t\t$( '.uploads-dir' ).html( wpmdb_data.this_uploads_dir );\n\t\t\t\t} else {\n\t\t\t\t\t$( '#new-url' ).val( this.remove_protocol( data.url ) );\n\t\t\t\t\t$( '#new-path' ).val( data.path );\n\n\t\t\t\t\tif ( 'true' === wpmdb_data.is_multisite ) {\n\t\t\t\t\t\t$( '.replace-row.pin .old-replace-col input[type=\"text\"]' ).val( this.remove_protocol( wpmdb_data.this_url ) );\n\t\t\t\t\t}\n\t\t\t\t\t$.wpmdb.do_action( 'wpmdb_update_push_table_select' );\n\t\t\t\t\t$( '#select-backup' ).remove();\n\t\t\t\t\t$( '.backup-tables-wrap' ).prepend( this.$push_select_backup );\n\t\t\t\t}\n\n\t\t\t\twpmdb.common.next_step_in_migration = {\n\t\t\t\t\tfn: $.wpmdb.do_action,\n\t\t\t\t\targs: [ 'verify_connection_to_remote_site', wpmdb.common.connection_data ]\n\t\t\t\t};\n\t\t\t\twpmdb.functions.execute_next_step();\n\t\t\t}\n\t\t} );\n\t}\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/wp-migrate-db-pro/asset/src/js/helpers/wpmdbGlobals.js","(function( $ ) {\n\n\t$.wpmdb = {\n\t\t/**\n\t\t * Implement a WordPress-link Hook System for Javascript\n\t\t * TODO: Change 'tag' to 'args', allow number (priority), string (tag), object (priority+tag)\n\t\t */\n\t\thooks: { action: {}, filter: {} },\n\t\tadd_action: function( action, callable, tag, self ) {\n\t\t\tjQuery.wpmdb.add_hook( 'action', action, callable, tag, self );\n\t\t},\n\t\tadd_filter: function( action, callable, tag, self ) {\n\t\t\tjQuery.wpmdb.add_hook( 'filter', action, callable, tag, self );\n\t\t},\n\t\tdo_action: function( action, args ) {\n\t\t\tjQuery.wpmdb.do_hook( 'action', action, null, args );\n\t\t},\n\t\tapply_filters: function( action, value, args ) {\n\t\t\treturn jQuery.wpmdb.do_hook( 'filter', action, value, args );\n\t\t},\n\t\tremove_action: function( action, tag ) {\n\t\t\tjQuery.wpmdb.remove_hook( 'action', action, tag );\n\t\t},\n\t\tremove_filter: function( action, tag ) {\n\t\t\tjQuery.wpmdb.remove_hook( 'filter', action, tag );\n\t\t},\n\t\tadd_hook: function( hook_type, action, callable, tag, self ) {\n\t\t\tif ( undefined === jQuery.wpmdb.hooks[ hook_type ][ action ] ) {\n\t\t\t\tjQuery.wpmdb.hooks[ hook_type ][ action ] = [];\n\t\t\t}\n\t\t\tvar hooks = jQuery.wpmdb.hooks[ hook_type ][ action ];\n\t\t\tif ( undefined === tag ) {\n\t\t\t\ttag = action + '_' + hooks.length;\n\t\t\t}\n\t\t\tjQuery.wpmdb.hooks[ hook_type ][ action ].push( { tag: tag, callable: callable, instance: self } );\n\t\t},\n\t\tdo_hook: function( hook_type, action, value, args ) {\n\t\t\tif ( undefined !== jQuery.wpmdb.hooks[ hook_type ][ action ] ) {\n\t\t\t\tvar hooks = jQuery.wpmdb.hooks[ hook_type ][ action ];\n\t\t\t\tfor ( var i = 0; i < hooks.length; i++ ) {\n\t\t\t\t\tif ( 'action' === hook_type ) {\n\n\t\t\t\t\t\t// .call (value of this, arg1, arg2) https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call\n\t\t\t\t\t\thooks[ i ].callable.call( hooks[ i ].instance, args, hooks[ i ].instance );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalue = hooks[ i ].callable.call( hooks[ i ].instance, value, args, hooks[ i ].instance );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( 'filter' === hook_type ) {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t},\n\t\tremove_hook: function( hook_type, action, tag ) {\n\t\t\tif ( undefined !== jQuery.wpmdb.hooks[ hook_type ][ action ] ) {\n\t\t\t\tvar hooks = jQuery.wpmdb.hooks[ hook_type ][ action ];\n\t\t\t\tfor ( var i = hooks.length - 1; 0 < i; i-- ) {\n\t\t\t\t\tif ( undefined === tag || tag === hooks[ i ].tag ) {\n\t\t\t\t\t\thooks.splice( i, 1 );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n})( jQuery );\n\n\n\n// WEBPACK FOOTER //\n// ./src/wp-migrate-db-pro/asset/src/js/hook.js","(function( $, wpmdb ) {\n\n\tvar import_selected = false;\n\tvar $import_select = $( '#select-tables' ).clone();\n\tvar tables_to_search = [];\n\tvar tables_to_import = [];\n\tvar unrecognized_import_file = false;\n\tvar import_prefix = '';\n\tvar import_info = {};\n\tvar ajax_spinner = '<img src=\"' + wpmdb.functions.get_spinner_url() + '\" alt=\"\" class=\"ajax-spinner general-spinner\" />';\n\n\t/**\n\t * Returns the migration status label for imports\n\t *\n\t * @param string label\n\t * @param object args\n\t *\n\t * @returns {string}\n\t */\n\tfunction import_migration_status_label( label, args ) {\n\t\tif ( 'import' === args.intent ) {\n\t\t\tif ( 'completed' === args.stage ) {\n\t\t\t\tlabel = wpmdb_strings.import_label_completed;\n\t\t\t} else {\n\t\t\t\tlabel = wpmdb_strings.import_label_migrating;\n\t\t\t}\n\t\t}\n\n\t\treturn label;\n\t}\n\t$.wpmdb.add_filter( 'wpmdb_get_migration_status_label', import_migration_status_label );\n\n\t/**\n\t * Updates the connection info box for imports\n\t *\n\t * @param object args\n\t */\n\tfunction import_connection_info_box( args ) {\n\t\tvar $import_file_status = $( '.import-file-status' );\n\n\t\tif ( 'import' === args.migration_type ) {\n\n\t\t\tif ( ! import_selected ) {\n\t\t\t\t$( '.step-two' ).hide();\n\n\t\t\t\tif ( $import_file_status.hasClass( 'profile-loaded' ) ) {\n\t\t\t\t\t$import_file_status.attr( 'class', 'import-file-status profile-loaded notification-message success-notice' );\n\t\t\t\t\t$import_file_status.html( wpmdb_strings.import_profile_loaded );\n\t\t\t\t} else {\n\t\t\t\t\t$import_file_status.html( wpmdb_strings.please_select_sql_file );\n\t\t\t\t}\n\n\t\t\t\t$import_file_status.show();\n\t\t\t} else {\n\t\t\t\tif ( unrecognized_import_file ) {\n\t\t\t\t\t$( '.unrecognized-import-file-notice' ).show();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tmaybe_show_find_replace_options();\n\n\t\t\t$( '.mst-options' ).hide();\n\t\t\t$( '.import-find-replace-option, .import-active-plugin-option' ).show();\n\t\t} else {\n\t\t\t$( '.find-replace-rows, .table-options, .advanced-options, .exclude-post-types-options, label[for=\"backup-selected\"]' ).show();\n\t\t\t$( '.import-find-replace-option, .find-replace-options, .import-file-status, .import-active-plugin-option, .unrecognized-import-file-notice' ).hide();\n\n\t\t\tif ( 'search_all_imported' === $( 'input[name=table_migrate_option]:checked' ).val() ) {\n\t\t\t\t$( 'input[name=table_migrate_option][value=migrate_only_with_prefix]' ).prop( 'checked', true );\n\t\t\t}\n\t\t}\n\t}\n\t$.wpmdb.add_action( 'move_connection_info_box', import_connection_info_box );\n\n\t/**\n\t * Starts the upload process for the import\n\t *\n\t * @param stage\n\t */\n\tfunction maybe_initiate_import( stage ) {\n\t\tif ( 'import' === wpmdb.functions.wpmdb_migration_type() ) {\n\t\t\tif ( 'backup' === stage ) {\n\t\t\t\twpmdb.common.hooks.push( wpmdb.functions.migrate_table_recursive );\n\t\t\t}\n\n\t\t\twpmdb.common.hooks.push( wpmdb.functions.upload_file_recursive );\n\t\t\twpmdb.common.next_step_in_migration = { fn: wpmdb.functions.wpmdb_call_next_hook };\n\t\t\twpmdb.functions.execute_next_step();\n\t\t}\n\t}\n\t$.wpmdb.add_action( 'wpmdb_migration_initiated', maybe_initiate_import );\n\n\t/**\n\t * Restores the import select when changing migration types\n\t */\n\tfunction update_import_table_select() {\n\t\t$( '#select-tables' ).remove();\n\t\t$( '.select-tables-wrap' ).prepend( $import_select );\n\t\t$( '#select-tables' ).change();\n\t}\n\t$.wpmdb.add_action( 'wpmdb_update_import_table_select', update_import_table_select );\n\n\t/**\n\t * Updates the selected tables for the \"Backup tables that will be replaced during the import\" option\n\t *\n\t * @param tables_to_backup\n\t *\n\t * @return array\n\t */\n\tfunction backup_selected_for_import( tables_to_backup ) {\n\t\tif ( 'import' === wpmdb.functions.wpmdb_migration_type() ) {\n\t\t\ttables_to_backup = tables_to_import;\n\t\t}\n\n\t\treturn tables_to_backup;\n\t}\n\t$.wpmdb.add_filter( 'wpmdb_backup_selected_tables', backup_selected_for_import );\n\n\t/**\n\t * Adds the import migration stage\n\t *\n\t * object args\n\t */\n\tfunction add_import_stage( args ) {\n\t\tif ( 'import' === wpmdb.functions.wpmdb_migration_type() ) {\n\t\t\twpmdb.current_migration.model.addStage( 'upload', [], 'local', {\n\t\t\t\tstrings: {\n\t\t\t\t\tstage_title: wpmdb_strings.upload\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\twpmdb.current_migration.model.addStage( 'import', [], 'local', {\n\t\t\t\tstrings: {\n\t\t\t\t\tstage_title: wpmdb_strings.migrate_button_import\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tif ( $( '#import-find-replace' ).is( ':checked' ) ) {\n\t\t\t\ttables_to_search = args.tables_to_migrate;\n\t\t\t\twpmdb.current_migration.model.addStage( 'find_replace', [], 'local', {\n\t\t\t\t\tstrings: {\n\t\t\t\t\t\tmigrated: wpmdb_strings.searched,\n\t\t\t\t\t\tstage_title: wpmdb_strings.migrate_button_find_replace\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t}\n\t$.wpmdb.add_action( 'wpmdb_add_migration_stages', add_import_stage );\n\n\t/**\n\t * Adds any info necessary to begin an import\n\t *\n\t * @param object request_data\n\t *\n\t * @return {object}\n\t */\n\tfunction initiate_import_request_data( request_data ) {\n\t\tif ( 'import' === wpmdb.functions.wpmdb_migration_type() ) {\n\t\t\trequest_data.import_info = import_info;\n\t\t}\n\n\t\treturn request_data;\n\t}\n\t$.wpmdb.add_filter( 'wpmdb_initiate_migration_request_data', initiate_import_request_data );\n\n\t/**\n\t * Gets more information about the import file and loads step-two\n\t *\n\t * @param event\n\t */\n\tfunction get_import_info( event ) {\n\t\tvar files = event.target.files; // FileList object\n\t\tvar file = files[0];\n\t\tvar reader = new FileReader();\n\t\tvar $import_file_status = $( '.import-file-status' );\n\t\tvar $backup_selected_option = $( 'label[for=\"backup-selected\"]' );\n\t\tvar $prefix_notice = $( '.prefix-notice' );\n\t\tvar $unrecognized_file_notice = $( '.unrecognized-import-file-notice' );\n\t\tvar $step_two = $( '.step-two' );\n\t\tvar $old_url = $( '#old-url' );\n\t\tvar $old_path = $( '#old-path' );\n\t\tvar $new_url = $( '#new-url' );\n\t\tvar $new_path = $( '#new-path' );\n\n\t\t$import_file_status.hide().attr( 'class', 'import-file-status' );\n\t\t$prefix_notice.hide();\n\t\t$unrecognized_file_notice.hide();\n\t\t$step_two.hide();\n\t\t$( '.mst-required ' ).hide();\n\n\t\tif ( ! files.length ) {\n\t\t\tif ( import_selected ) {\n\t\t\t\t$step_two.hide();\n\t\t\t\t$import_file_status.text( wpmdb_strings.please_select_sql_file ).show();\n\t\t\t\timport_selected = false;\n\t\t\t}\n\t\t\treturn;\n\t\t} else {\n\n\t\t\tif ( '.sql' === file.name.slice( -4 ) || '.sql.gz' === file.name.slice( -7 ) ) {\n\t\t\t\timport_selected = true;\n\t\t\t} else {\n\t\t\t\t$import_file_status.addClass( 'notification-message error-notice migration-error' ).text( wpmdb_strings.invalid_sql_file ).show();\n\t\t\t\t$step_two.hide();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\timport_prefix = '';\n\n\t\t$import_file_status.text( wpmdb_strings.parsing_sql_file ).append( ajax_spinner ).show();\n\n\t\treader.onloadend = function( event ) {\n\t\t\tif ( event.target.readyState !== FileReader.DONE ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'POST',\n\t\t\t\tdataType: 'json',\n\t\t\t\tcache: false,\n\t\t\t\tdata: {\n\t\t\t\t\taction: 'wpmdb_get_import_info',\n\t\t\t\t\tfile_data: event.target.result,\n\t\t\t\t\tnonce: wpmdb_data.nonces.import_file\n\t\t\t\t},\n\t\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\t\tconsole.log( jqXHR, textStatus, errorThrown );\n\t\t\t\t},\n\t\t\t\tsuccess: function( data ) {\n\t\t\t\t\t$( '.ajax-spinner' ).remove();\n\t\t\t\t\t$import_file_status.hide();\n\n\t\t\t\t\tif ( true === wpmdb.functions.maybe_show_mst_warning( data ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t$step_two.show();\n\n\t\t\t\t\tif ( 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error ) {\n\t\t\t\t\t\t$import_file_status.text( data.body ).addClass( 'notification-message error-notice migration-error' ).show();\n\t\t\t\t\t\t$step_two.hide();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar localStorage_form_data = wpmdb.functions.get_localStorage_form_data();\n\t\t\t\t\t\timport_info = data;\n\n\t\t\t\t\t\tif ( 'undefined' !== typeof data.prefix ) {\n\t\t\t\t\t\t\timport_prefix = data.prefix;\n\t\t\t\t\t\t\t$( '.table-prefix' ).text( data.prefix );\n\t\t\t\t\t\t\twpmdb.functions.maybe_show_prefix_notice( data.prefix );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( 'undefined' !== typeof data.tables ) {\n\t\t\t\t\t\t\ttables_to_import = data.tables;\n\t\t\t\t\t\t\t$backup_selected_option.show();\n\n\t\t\t\t\t\t\t// Update the find & replace values\n\t\t\t\t\t\t\tif ( ! localStorage_form_data ) {\n\t\t\t\t\t\t\t\t$old_url.val( wpmdb.functions.remove_protocol( data.URL ) );\n\t\t\t\t\t\t\t\t$old_path.val( data.path );\n\t\t\t\t\t\t\t\t$new_url.val( wpmdb.functions.remove_protocol( wpmdb_data.this_url ) );\n\t\t\t\t\t\t\t\t$new_path.val( wpmdb_data.this_path );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Update the select with tables that will be imported\n\t\t\t\t\t\t\tvar loaded_tables = [];\n\t\t\t\t\t\t\tvar loaded_post_types = [];\n\n\t\t\t\t\t\t\tif ( localStorage_form_data ) {\n\t\t\t\t\t\t\t\tloaded_tables = localStorage_form_data.select_tables;\n\t\t\t\t\t\t\t\tloaded_post_types = localStorage_form_data.select_post_types;\n\t\t\t\t\t\t\t\twpmdb.functions.remove_localStorage_form_data();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif ( 'migrate_only_with_prefix' === $( 'input[name=table_migrate_option]:checked' ).val() && ! $import_file_status.hasClass( 'profile-loaded' ) ) {\n\t\t\t\t\t\t\t\t\t$( 'input[name=table_migrate_option][value=search_all_imported]' ).prop( 'checked', true );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( false === wpmdb_default_profile && 'undefined' !== typeof wpmdb_loaded_tables ) {\n\t\t\t\t\t\t\t\tloaded_tables = wpmdb_loaded_tables;\n\t\t\t\t\t\t\t\tloaded_post_types = wpmdb_loaded_post_types;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$import_select = wpmdb.functions.create_table_select( data.tables, [], loaded_tables );\n\t\t\t\t\t\t\t$.wpmdb.do_action( 'wpmdb_update_import_table_select' );\n\n\t\t\t\t\t\t\tif ( 'undefined' !== typeof data.post_types ) {\n\t\t\t\t\t\t\t\tvar $post_type_select = document.createElement( 'select' );\n\t\t\t\t\t\t\t\t$( $post_type_select ).attr( {\n\t\t\t\t\t\t\t\t\tmultiple: 'multiple',\n\t\t\t\t\t\t\t\t\tname: 'select_post_types[]',\n\t\t\t\t\t\t\t\t\tid: 'select-post-types',\n\t\t\t\t\t\t\t\t\tclass: 'multiselect'\n\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t\t$.each( data.post_types, function( index, value ) {\n\t\t\t\t\t\t\t\t\tvar selected = $.inArray( value, loaded_post_types );\n\t\t\t\t\t\t\t\t\tif ( -1 !== selected || ( true === wpmdb_convert_exclude_revisions && 'revision' !== value ) ) {\n\t\t\t\t\t\t\t\t\t\tselected = true;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tselected = false;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tvar opt = document.createElement( 'option' );\n\t\t\t\t\t\t\t\t\topt.value = value;\n\t\t\t\t\t\t\t\t\topt.text = value;\n\t\t\t\t\t\t\t\t\topt.selected = selected;\n\t\t\t\t\t\t\t\t\t$post_type_select.add( opt, null );\n\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t\t$( '#select-post-types' ).remove();\n\t\t\t\t\t\t\t\t$( '.exclude-post-types-warning' ).after( $post_type_select );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( unrecognized_import_file ) {\n\t\t\t\t\t\t\t\tunrecognized_import_file = false;\n\t\t\t\t\t\t\t\tmaybe_show_find_replace_options();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$unrecognized_file_notice.show();\n\t\t\t\t\t\t\t$backup_selected_option.hide();\n\t\t\t\t\t\t\t$( '.table-options' ).hide();\n\t\t\t\t\t\t\tunrecognized_import_file = true;\n\n\t\t\t\t\t\t\t$new_url.val( $old_url.val() );\n\t\t\t\t\t\t\t$new_path.val( $old_path.val() );\n\t\t\t\t\t\t\t$old_url.val( '' );\n\t\t\t\t\t\t\t$old_path.val( '' );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t};\n\n\t\tvar blob = file.slice( 0, 1024 * 1000 );\n\t\treader.readAsDataURL( blob );\n\t}\n\t$( '#import-file' ).on( 'change', get_import_info );\n\n\t/**\n\t * Displays the find and replace options for imports\n\t */\n\tfunction maybe_show_find_replace_options() {\n\t\tvar find_replace_rows = $( '.find-replace-rows' );\n\t\treturn $( '#import-find-replace' ).is( ':checked' ) ? find_replace_rows.show() : find_replace_rows.hide();\n\t}\n\t$( '#import-find-replace' ).on( 'click', maybe_show_find_replace_options );\n\n\tfunction maybe_show_table_options() {\n\t\tif ( ! unrecognized_import_file ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetTimeout( function() {\n\t\t\tif ( $( '.find-replace-options-toggle .expand-collapse-arrow' ).hasClass( 'collapsed' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$( '.table-options' ).hide();\n\t\t}, 1 );\n\t}\n\t$( '.find-replace-options-toggle' ).on( 'click', maybe_show_table_options );\n\n\t/**\n\t * Updates both `keep_active_plugins` checkboxes when one is changed.\n\t */\n\tfunction update_keep_active_plugins_option() {\n\t\t$( 'input[name=keep_active_plugins]' ).prop( 'checked', $( this ).is( ':checked' ) );\n\t}\n\t$( 'input[name=keep_active_plugins]' ).on( 'click', update_keep_active_plugins_option );\n\n\t/**\n\t * Recursively upload an import file\n\t *\n\t * @param int start\n\t */\n\twpmdb.functions.upload_file_recursive = function( start ) {\n\t\tstart = 'undefined' === typeof start ? 0 : start;\n\n\t\tvar file = document.getElementById( 'import-file' ).files[0];\n\t\tvar slice_size = 1000 * 1024; // 1 MB\n\t\tvar next_slice = start + slice_size + 1;\n\t\tvar reader = new FileReader();\n\n\t\tif ( 0 === start ) {\n\t\t\twpmdb.current_migration.model.addStageItem( 'upload', file.name, file.size / 1000, Math.ceil( file.size / slice_size ) );\n\t\t}\n\n\t\treader.onloadend = function( event ) {\n\t\t\tif ( event.target.readyState !== FileReader.DONE ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'POST',\n\t\t\t\tdataType: 'json',\n\t\t\t\tcache: false,\n\t\t\t\tdata: {\n\t\t\t\t\taction: 'wpmdb_upload_file',\n\t\t\t\t\tfile_data: event.target.result,\n\t\t\t\t\tfile: file.name,\n\t\t\t\t\tfile_type: file.type,\n\t\t\t\t\tmigration_state_id: wpmdb.migration_state_id,\n\t\t\t\t\tstage: 'import',\n\t\t\t\t\timport_info: import_info,\n\t\t\t\t\tnonce: wpmdb_data.nonces.import_file\n\t\t\t\t},\n\t\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\t\tconsole.log( jqXHR, textStatus, errorThrown );\n\t\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\t\twpmdb.functions.migration_complete_events();\n\t\t\t\t},\n\t\t\t\tsuccess: function( data ) {\n\t\t\t\t\twpmdb.current_migration.setText();\n\n\t\t\t\t\tif ( 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error ) {\n\t\t\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\t\t\twpmdb.functions.migration_complete_events();\n\t\t\t\t\t\twpmdb.current_migration.setState( wpmdb_strings.migration_failed, data.body, 'error' );\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar size_done = start + slice_size;\n\n\t\t\t\t\twpmdb.current_migration.setText( wpmdb_strings.uploading_file_to_server );\n\t\t\t\t\twpmdb.current_migration.model.getStageModel( 'upload' ).setItemRowsTransferred( file.name, Math.ceil( size_done / slice_size ) );\n\n\t\t\t\t\tif ( next_slice < file.size ) {\n\t\t\t\t\t\twpmdb.common.next_step_in_migration = {\n\t\t\t\t\t\t\tfn: wpmdb.functions.upload_file_recursive,\n\t\t\t\t\t\t\targs: [ next_slice ]\n\t\t\t\t\t\t};\n\t\t\t\t\t} else {\n\t\t\t\t\t\twpmdb.common.next_step_in_migration = {\n\t\t\t\t\t\t\tfn: wpmdb.functions.upload_import_successful,\n\t\t\t\t\t\t\targs: [ file ]\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\twpmdb.functions.execute_next_step();\n\t\t\t\t}\n\t\t\t} );\n\t\t};\n\n\t\tvar blob = file.slice( start, next_slice );\n\t\treader.readAsDataURL( blob );\n\t};\n\n\t/**\n\t * Prepares the import stage\n\t *\n\t * @param file\n\t */\n\twpmdb.functions.upload_import_successful = function( file ) {\n\n\t\t$.ajax( {\n\t\t\ttype: 'POST',\n\t\t\turl: ajaxurl,\n\t\t\tdata: {\n\t\t\t\taction: 'wpmdb_prepare_import_file',\n\t\t\t\tmigration_state_id: wpmdb.migration_state_id,\n\t\t\t\tnonce: wpmdb_data.nonces.import_file\n\t\t\t},\n\t\t\tdataType: 'json',\n\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\tconsole.log( jqXHR, textStatus, errorThrown );\n\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\twpmdb.functions.migration_complete_events();\n\t\t\t},\n\t\t\tsuccess: function( response ) {\n\t\t\t\tvar item_name = file.name;\n\t\t\t\tvar migration_text = wpmdb_strings.importing_file_to_db;\n\n\t\t\t\tif ( '.gz' === item_name.slice( -3 ) ) {\n\t\t\t\t\titem_name = file.name.slice( 0, -3 );\n\t\t\t\t}\n\n\t\t\t\tmigration_text = migration_text.replace( /\\%s\\s?/, item_name );\n\t\t\t\twpmdb.current_migration.setText( migration_text );\n\n\t\t\t\twpmdb.current_migration.model.addStageItem( 'import', item_name, response.import_size / 1000, response.num_chunks );\n\t\t\t\twpmdb.current_migration.model.setActiveStage( 'import' );\n\n\t\t\t\twpmdb.common.next_step_in_migration = {\n\t\t\t\t\tfn: wpmdb.functions.import_file_recursive,\n\t\t\t\t\targs: [ {\n\t\t\t\t\t\timport_filename: response.import_file,\n\t\t\t\t\t\titem_name: item_name,\n\t\t\t\t\t\tchunk: 0,\n\t\t\t\t\t\tcurrent_query: ''\n\t\t\t\t\t} ]\n\t\t\t\t};\n\n\t\t\t\twpmdb.functions.execute_next_step();\n\t\t\t}\n\t\t} );\n\t};\n\n\t/**\n\t * Recursively imports chunks to the database\n\t *\n\t * @param object args\n\t */\n\twpmdb.functions.import_file_recursive = function( args ) {\n\n\t\t$.ajax( {\n\t\t\ttype: 'POST',\n\t\t\turl: ajaxurl,\n\t\t\tdata: {\n\t\t\t\taction: 'wpmdb_import_file',\n\t\t\t\tmigration_state_id: wpmdb.migration_state_id,\n\t\t\t\tchunk: args.chunk,\n\t\t\t\tcurrent_query: args.current_query,\n\t\t\t\timport_file: args.import_filename,\n\t\t\t\tnonce: wpmdb_data.nonces.import_file\n\t\t\t},\n\t\t\tdataType: 'json',\n\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\tconsole.log( jqXHR, textStatus, errorThrown );\n\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\twpmdb.functions.migration_complete_events();\n\t\t\t},\n\t\t\tsuccess: function( response ) {\n\t\t\t\tif ( 'undefined' !== typeof response.wpmdb_error && 1 === response.wpmdb_error ) {\n\t\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\t\twpmdb.functions.migration_complete_events();\n\t\t\t\t\twpmdb.current_migration.setState( wpmdb_strings.migration_failed, response.body, 'error' );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twpmdb.current_migration.model.getStageModel( 'import' ).setItemRowsTransferred( args.item_name, response.chunk );\n\n\t\t\t\tif ( response.chunk >= response.num_chunks ) {\n\n\t\t\t\t\twpmdb.current_migration.model.getStageModel( 'import' ).setItemRowsTransferred( args.item_name, ++response.chunk );\n\n\t\t\t\t\tif ( $( '#import-find-replace' ).is( ':checked' ) ) {\n\n\t\t\t\t\t\tif ( unrecognized_import_file ) {\n\t\t\t\t\t\t\t$.each( response.table_sizes, function( table, size ) {\n\t\t\t\t\t\t\t\tif ( table.startsWith( wpmdb_data.this_temp_prefix ) && wpmdb_data.alter_table_name !== table ) {\n\t\t\t\t\t\t\t\t\tvar table_name = table.replace( wpmdb_data.this_temp_prefix, '' );\n\t\t\t\t\t\t\t\t\twpmdb.current_migration.model.addStageItem( 'find_replace', table_name, response.table_sizes[ table ], response.table_rows[ table ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar table_migrate_option = $( 'input[name=table_migrate_option]:checked' ).val();\n\n\t\t\t\t\t\t\tif ( 'migrate_only_with_prefix' === table_migrate_option ) {\n\t\t\t\t\t\t\t\ttables_to_search = tables_to_import.filter( function( table ) {\n\t\t\t\t\t\t\t\t\treturn import_prefix === table.substring( 0, import_prefix.length );\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} else if ( 'search_all_imported' === table_migrate_option ) {\n\t\t\t\t\t\t\t\ttables_to_search = tables_to_import;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$.each( tables_to_search, function( key, table ) {\n\t\t\t\t\t\t\t\tvar imported_table = wpmdb_data.this_temp_prefix + table;\n\t\t\t\t\t\t\t\tif ( response.table_sizes.hasOwnProperty( imported_table ) ) {\n\t\t\t\t\t\t\t\t\twpmdb.current_migration.model.addStageItem( 'find_replace', table, response.table_sizes[ imported_table ], response.table_rows[ imported_table ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttables_to_search = [];\n\n\t\t\t\t\t\twpmdb.current_migration.model.setActiveStage( 'find_replace' );\n\t\t\t\t\t\tconst tables_to_migrate = wpmdb.functions.get_tables_to_migrate();\n\n\t\t\t\t\t\twpmdb.common.next_step_in_migration = {\n\t\t\t\t\t\t\tfn: wpmdb.functions.migrate_table_recursive,\n\t\t\t\t\t\t\targs: [ '-1', '', tables_to_migrate.length ]\n\t\t\t\t\t\t};\n\t\t\t\t\t\twpmdb.functions.execute_next_step();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$( '.progress-label' ).removeClass( 'label-visible' );\n\t\t\t\t\t\twpmdb.common.hooks = $.wpmdb.apply_filters( 'wpmdb_before_migration_complete_hooks', wpmdb.common.hooks );\n\t\t\t\t\t\twpmdb.common.hooks.push( wpmdb.functions.migration_complete );\n\t\t\t\t\t\twpmdb.common.hooks.push( wpmdb.functions.wpmdb_flush );\n\t\t\t\t\t\twpmdb.common.hooks = $.wpmdb.apply_filters( 'wpmdb_after_migration_complete_hooks', wpmdb.common.hooks );\n\t\t\t\t\t\twpmdb.common.hooks.push( wpmdb.functions.migration_complete_events );\n\t\t\t\t\t\twpmdb.common.next_step_in_migration = { fn: wpmdb.functions.wpmdb_call_next_hook };\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\twpmdb.common.next_step_in_migration = {\n\t\t\t\t\t\tfn: wpmdb.functions.import_file_recursive,\n\t\t\t\t\t\targs: [ {\n\t\t\t\t\t\t\timport_filename: args.import_filename,\n\t\t\t\t\t\t\titem_name: args.item_name,\n\t\t\t\t\t\t\tchunk: response.chunk,\n\t\t\t\t\t\t\tcurrent_query: response.current_query\n\t\t\t\t\t\t} ]\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\twpmdb.functions.execute_next_step();\n\t\t\t}\n\t\t} );\n\t};\n\n\twpmdb.functions.get_tables_to_import = function() {\n\t\treturn tables_to_import;\n\t};\n\n})( jQuery, wpmdb );\n\n\n\n// WEBPACK FOOTER //\n// ./src/wp-migrate-db-pro/asset/src/js/import.js","(function( $, wpmdb ) {\n\n\t$( document ).ready( function() {\n\n\t\twpmdb.functions.localStorage_available = function() {\n\t\t\ttry {\n\t\t\t\tlocalStorage.setItem( 'wpmdb_test', 'wpmdb_test' );\n\t\t\t\tlocalStorage.removeItem( 'wpmdb_test', 'wpmdb_test' );\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tcatch ( e ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\n\t\twpmdb.functions.maybe_reload_page = function() {\n\t\t\tvar migration_type = wpmdb.functions.wpmdb_migration_type();\n\n\t\t\tif ( ! wpmdb.functions.localStorage_available() ||\n\t\t\t 'cancelled' === wpmdb.current_migration.status ||\n\t\t\t true === wpmdb.common.migration_error ||\n\t\t\t $('.progress-overlay-container').hasClass('wpmdb-error') ||\n\t\t\t -1 === $.inArray( migration_type, [ 'pull', 'import', 'find_replace' ] )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( 'true' === wpmdb_data.is_multisite &&\n\t\t\t $( '#mst-select-subsite' ).is( ':checked' ) &&\n\t\t\t wpmdb_data.this_domain !== $( '#mst-selected-subsite option:selected' ).text()\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar tables_to_migrate = wpmdb.functions.get_tables_to_migrate();\n\n\t\t\tif ( 'import' === migration_type ) {\n\t\t\t\ttables_to_migrate = wpmdb.functions.get_tables_to_import();\n\t\t\t}\n\n\t\t\tif ( -1 === $.inArray( wpmdb_data.this_prefix + 'options', tables_to_migrate ) &&\n\t\t\t -1 === $.inArray( wpmdb_data.this_prefix + 'usermeta', tables_to_migrate ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\twpmdb.functions.set_localStorage_form_data();\n\t\t\tlocation.reload();\n\t\t};\n\n\t\twpmdb.functions.set_localStorage_form_data = function() {\n\t\t\tvar data = {};\n\n\t\t\t$.each( $( '#migrate-form' ).serializeArray(), function( index, field ) {\n\t\t\t\tif ( '[]' === field.name.substr( -2 ) ) {\n\t\t\t\t\tvar field_name = field.name.slice( 0, -2 );\n\t\t\t\t\tif ( 'undefined' === typeof data[ field_name ] ) {\n\t\t\t\t\t\tdata[ field_name ] = [];\n\t\t\t\t\t}\n\t\t\t\t\tdata[ field_name ].push( field.value );\n\t\t\t\t} else {\n\t\t\t\t\tdata[ field.name ] = field.value;\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tlocalStorage.setItem( 'wpmdb_migrate_form', JSON.stringify( data ) );\n\t\t};\n\n\t\twpmdb.functions.get_localStorage_form_data = function() {\n\t\t\tvar form_data = localStorage.getItem( 'wpmdb_migrate_form' );\n\n\t\t\tif ( null === form_data ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tform_data = JSON.parse( form_data );\n\t\t\t}\n\t\t\tcatch ( err ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn form_data;\n\t\t};\n\n\t\twpmdb.functions.remove_localStorage_form_data = function() {\n\t\t\tlocalStorage.removeItem( 'wpmdb_migrate_form' );\n\t\t};\n\n\t\twpmdb.functions.load_data_from_localStorage = function() {\n\t\t\tvar form_data = wpmdb.functions.get_localStorage_form_data();\n\n\t\t\tif ( ! form_data ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$.each( form_data, function( name, value ) {\n\t\t\t\tvar $input = $( '[name=\"' + name + '\"]' );\n\t\t\t\tvar input_type = $input.attr( 'type' );\n\n\t\t\t\tif ( 'action' === name ) {\n\t\t\t\t\twpmdb.migration_selection = value;\n\t\t\t\t\t$( '#' + value ).prop( 'checked', true );\n\t\t\t\t} else {\n\t\t\t\t\tif ( 'radio' === input_type ) {\n\t\t\t\t\t\t$( '[name=\"' + name + '\"][value=\"' + value + '\"]' ).prop( 'checked', true );\n\t\t\t\t\t} else if ( 'checkbox' === input_type ) {\n\t\t\t\t\t\t$input.prop( 'checked', true );\n\n\t\t\t\t\t\tif ( $input.parent().hasClass( 'checkbox-label' ) ) {\n\t\t\t\t\t\t\t$input.parent().next().show();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$input.val( value );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\t$( '.option-group input[type=radio]' ).change();\n\t\t\t$( '.' + wpmdb.migration_selection + '-list ul' ).show();\n\n\t\t\t$.when( wpmdb.functions.connection_box_changed() ).done( function() {\n\t\t\t\tif ( 'migrate_select' === $( 'input[name=table_migrate_option]:checked' ).val() ) {\n\t\t\t\t\tif ( 'undefined' !== typeof form_data.select_tables ) {\n\t\t\t\t\t\t$( '#select-tables' ).val( form_data.select_tables );\n\t\t\t\t\t}\n\n\t\t\t\t\t$( '.table-options .expandable-content, .select-tables-wrap' ).show();\n\t\t\t\t\t$( '.table-options .expand-collapse-arrow' ).removeClass( 'collapsed' );\n\t\t\t\t} else {\n\t\t\t\t\t$( '.select-tables-wrap' ).hide();\n\t\t\t\t}\n\n\t\t\t\tif ( 'backup_manual_select' === $( 'input[name=backup_option]:checked' ).val() ) {\n\t\t\t\t\tif ( 'undefined' !== typeof form_data.select_backup ) {\n\t\t\t\t\t\t$( '#select-backup' ).val( form_data.select_backup );\n\t\t\t\t\t}\n\n\t\t\t\t\t$( '.backup-tables-wrap' ).show();\n\t\t\t\t}\n\n\t\t\t\tif ( 'undefined' !== typeof form_data.select_post_types ) {\n\t\t\t\t\t$( '#select-post-types' ).val( form_data.select_post_types );\n\t\t\t\t\twpmdb.functions.exclude_post_types_warning();\n\t\t\t\t}\n\n\t\t\t\tif ( 'undefined' !== typeof form_data.replace_old ) {\n\n\t\t\t\t\t$( '.replace-row' ).not( '.original-repeatable-field' ).remove();\n\n\t\t\t\t\tvar n = 1;\n\t\t\t\t\t$.each( form_data.replace_old, function( index, value ) {\n\t\t\t\t\t\tif ( ! $( '.replace-row:nth-child(' + n + ')' ).length ) {\n\t\t\t\t\t\t\t$( '.replace-row' ).last().after( $( '.original-repeatable-field' ).clone().removeClass( 'original-repeatable-field' ) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$( '.replace-row:nth-child(' + n + ') [name=\"replace_old[]\"]' ).val( value );\n\t\t\t\t\t\t$( '.replace-row:nth-child(' + n + ') [name=\"replace_new[]\"]' ).val( form_data.replace_new[ index ] );\n\t\t\t\t\t\tn++;\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\twpmdb.functions.update_migrate_button_text();\n\n\t\t\tif ( 'import' !== wpmdb.functions.wpmdb_migration_type() ) {\n\t\t\t\twpmdb.functions.remove_localStorage_form_data();\n\t\t\t}\n\t\t};\n\t\twpmdb.functions.load_data_from_localStorage();\n\n\t} );\n\n} )( jQuery, wpmdb );\n\n\n\n// WEBPACK FOOTER //\n// ./src/wp-migrate-db-pro/asset/src/js/localStorage.js","var $ = jQuery;\nvar MigrationProgressModel = require( './MigrationProgress-model' );\nvar MigrationProgressView = require( './MigrationProgress-view' );\nvar $overlayOriginal = $( '<div id=\"overlay\" class=\"hide\"></div>' );\nvar $progressContentOriginal = $( '.progress-content' ).clone().addClass( 'hide' );\nvar $proVersion = $( '.pro-version' ).addClass( 'hide' );\n\n$overlayOriginal.append( $proVersion );\n\nvar MigrationProgressController = {\n\tmigration: {\n\t\tmodel: {},\n\t\tview: {},\n\t\t$progress: {},\n\t\t$wrapper: {},\n\t\t$overlay: {},\n\t\tstatus: 'active',\n\t\ttitle: '',\n\t\ttext: '',\n\t\ttimerCount: 0,\n\t\ttimerStart: 0,\n\t\telapsedInterval: 0,\n\t\tcurrentStageNum: 0,\n\t\tcounterDisplay: false,\n\t\toriginalTitle: document.title,\n\t\tsetTitle: function( title ) {\n\t\t\tthis.$progress.find( '.progress-title' ).html( title );\n\t\t\tthis.title = title;\n\t\t},\n\t\tsetStatus: function( status ) {\n\t\t\tthis.$progress\n\t\t\t\t.removeClass( this.status )\n\t\t\t\t.addClass( ( 'error' === status ) ? 'wpmdb-error' : status );\n\n\t\t\t// Possible statuses include: 'error', 'paused', 'complete', 'cancelling'\n\t\t\tif ( 'error' === status ) {\n\t\t\t\tthis.$progress.find( '.progress-text' ).addClass( 'migration-error' );\n\t\t\t}\n\n\t\t\tthis.status = status;\n\n\t\t\tthis.updateTitleElem();\n\t\t},\n\t\tsetText: function( text ) {\n\t\t\tif ( 'string' !== typeof text ) {\n\t\t\t\ttext = '';\n\t\t\t}\n\n\t\t\tif ( 0 >= text.indexOf( 'wpmdb_error' ) ) {\n\t\t\t\ttext = this.decodeErrorObject( text );\n\t\t\t}\n\n\t\t\tthis.$progress.find( '.progress-text' ).html( text );\n\t\t\tthis.text = text;\n\t\t},\n\t\tsetState: function( title, text, status ) {\n\t\t\tif ( null !== title ) {\n\t\t\t\tthis.setTitle( title );\n\t\t\t}\n\t\t\tif ( null !== text ) {\n\t\t\t\tthis.setText( text );\n\t\t\t}\n\t\t\tif ( null !== status ) {\n\t\t\t\tthis.setStatus( status );\n\t\t\t}\n\t\t},\n\t\tstartTimer: function() {\n\t\t\tthis.timerStart = Date.now();\n\t\t\tthis.timerCount = 0;\n\t\t\tthis.counterDisplay = $( '.timer' );\n\t\t\tthis.elapsedInterval = setInterval( this.incrementTimer.bind( this ), 1000 );\n\t\t},\n\t\tgetTimerCountInSeconds() {\n\t\t\treturn Math.floor( (Date.now() - this.timerStart) / 1000 );\n\t\t},\n\t\tpauseTimer: function() {\n\t\t\tthis.pausedAt = Date.now()\n\t\t\tclearInterval( this.elapsedInterval );\n\t\t},\n\t\tresumeTimer: function() {\n\t\t\tthis.timerStart += Date.now() - this.pausedAt;\n\t\t\tthis.elapsedInterval = setInterval( this.incrementTimer.bind( this ), 1000 );\n\t\t},\n\t\tincrementTimer: function() {\n\t\t\tthis.timerCount = this.getTimerCountInSeconds();\n\t\t\tthis.displayCount();\n\t\t},\n\t\tdisplayCount: function() {\n\t\t\tvar hours = Math.floor( this.timerCount / 3600 ) % 24;\n\t\t\tvar minutes = Math.floor( this.timerCount / 60 ) % 60;\n\t\t\tvar seconds = this.timerCount % 60;\n\t\t\tvar display = this.pad( hours, 2, 0 ) + ':' + this.pad( minutes, 2, 0 ) + ':' + this.pad( seconds, 2, 0 );\n\t\t\tthis.counterDisplay.html( display );\n\t\t},\n\t\tupdateTitleElem: function() {\n\t\t\tvar activeStage = this.model.get( 'activeStageName' );\n\t\t\tvar stageModel = this.model.getStageModel( activeStage );\n\t\t\tvar percentDone = Math.max( 0, stageModel.getTotalProgressPercent() );\n\t\t\tvar numStages = this.model.get( 'stages' ).length;\n\t\t\tvar currentStage = this.currentStageNum;\n\t\t\tvar currentStatus = this.status;\n\t\t\tvar progressText = wpmdb_strings.title_progress;\n\n\t\t\tif ( 'complete' === stageModel.get( 'status' ) && 0 === stageModel.get( 'totalSize' ) ) {\n\t\t\t\tpercentDone = 100;\n\t\t\t}\n\n\t\t\tprogressText = progressText.replace( '%1$s', percentDone + '%' );\n\t\t\tprogressText = progressText.replace( '%2$s', currentStage );\n\t\t\tprogressText = progressText.replace( '%3$s', numStages );\n\n\t\t\tif ( 1 === numStages ) {\n\t\t\t\tprogressText = percentDone + '%';\n\t\t\t}\n\n\t\t\tif ( wpmdb_strings[ 'title_' + currentStatus ] ) {\n\t\t\t\tprogressText = wpmdb_strings[ 'title_' + currentStatus ];\n\t\t\t}\n\n\t\t\tprogressText = progressText + ' - ' + this.originalTitle;\n\n\t\t\tdocument.title = progressText;\n\t\t},\n\t\trestoreTitleElem: function() {\n\t\t\tdocument.title = this.originalTitle;\n\t\t},\n\t\tpad: function( num, width, padChar ) {\n\t\t\tpadChar = padChar || '0';\n\t\t\tnum = num + '';\n\t\t\treturn num.length >= width ? num : new Array( width - num.length + 1 ).join( padChar ) + num;\n\t\t},\n\n\t\t// fixes error objects that have been mangled by html encoding\n\t\tdecodeErrorObject: function( input ) {\n\t\t\tvar inputDecoded = input\n\t\t\t\t.replace( /\\{"/g, '{#q!#' )\n\t\t\t\t.replace( /\\"}/g, '#q!#}' )\n\t\t\t\t.replace( /,"/g, ',#q!#' )\n\t\t\t\t.replace( /":/g, '#q!#:' )\n\t\t\t\t.replace( /:"/g, ':#q!#' )\n\t\t\t\t.replace( /"/g, '\\\\\"' )\n\t\t\t\t.replace( /#q!#/g, '\"' )\n\t\t\t\t.replace( />/g, '>' )\n\t\t\t\t.replace( /</g, '<' );\n\t\t\ttry {\n\t\t\t\tinputDecoded = JSON.parse( inputDecoded );\n\t\t\t} catch ( e ) {\n\t\t\t\treturn input;\n\t\t\t}\n\t\t\treturn ( 'object' === typeof inputDecoded && 'undefined' !== typeof inputDecoded.body ) ? inputDecoded : input;\n\t\t},\n\t\tfixProgressStageWidthForScrollBar: function() {\n\t\t\tvar scrollBarWidth = Math.abs( this.$wrapper[0].offsetWidth - this.$wrapper[0].clientWidth );\n\t\t\tvar visibleProgressItems = this.$wrapper.find( '.active .progress-items' );\n\t\t\tvar leftPad = parseInt( visibleProgressItems.css( 'padding-left' ), 10 );\n\t\t\tvar rightPad = parseInt( visibleProgressItems.css( 'padding-right' ), 10 );\n\n\t\t\tif ( 0 !== scrollBarWidth || ( 0 === scrollBarWidth && rightPad !== leftPad ) ) {\n\t\t\t\tvisibleProgressItems.css( 'padding-right', leftPad - scrollBarWidth + 'px' );\n\t\t\t}\n\t\t}\n\t},\n\tnewMigration: function( settings ) {\n\t\t$( '#overlay' ).remove();\n\t\t$( '.progress-content' ).remove();\n\t\tthis.migration.$overlay = $overlayOriginal.clone();\n\n\t\t$( '#wpwrap' ).append( this.migration.$overlay );\n\n\t\tthis.migration.model = new MigrationProgressModel( settings );\n\t\tthis.migration.view = new MigrationProgressView( {\n\t\t\tmodel: this.migration.model\n\t\t} );\n\n\t\tthis.migration.$progress = $progressContentOriginal.clone();\n\t\tthis.migration.$wrapper = this.migration.view.$el;\n\t\tthis.migration.$progress.find( '.migration-progress-stages' ).replaceWith( this.migration.$wrapper );\n\n\t\tthis.migration.$proVersion = this.migration.$overlay.find( '.pro-version' );\n\t\tvar proVersionIFrame = this.migration.$proVersion.find( 'iframe' ).remove().clone();\n\n\t\tthis.migration.$overlay.prepend( this.migration.$progress );\n\n\t\t// timeout needed so class is added after elements are appended to dom and transition runs.\n\t\tvar self = this;\n\t\tsetTimeout( function() {\n\t\t\tself.migration.$overlay.add( self.migration.$progress ).add( self.migration.$proVersion ).removeClass( 'hide' ).addClass( 'show' );\n\t\t\tif ( self.migration.$proVersion.length ) {\n\t\t\t\tsetTimeout( function() {\n\t\t\t\t\tself.migration.$proVersion.find( '.iframe' ).append( proVersionIFrame );\n\t\t\t\t}, 500 );\n\t\t\t}\n\t\t}, 0 );\n\n\t\tthis.migration.currentStageNum = 0;\n\n\t\tthis.migration.$proVersion.on( 'click', '.close-pro-version', function() {\n\t\t\tself.migration.$proVersion.find( 'iframe' ).remove();\n\t\t\tself.migration.$proVersion.addClass( 'hide remove' );\n\t\t\tsetTimeout( function() {\n\t\t\t\tself.migration.$proVersion.remove();\n\t\t\t}, 500 );\n\t\t} );\n\n\t\tthis.migration.model.on( 'migrationComplete', function() {\n\t\t\tself.utils.updateProgTableVisibilitySetting();\n\t\t\tself.utils.updatePauseBeforeFinalizeSetting();\n\t\t\tself.migration.pauseTimer();\n\t\t} );\n\n\t\t$( window ).on( 'resize', _.debounce( this.migration.fixProgressStageWidthForScrollBar.bind( this.migration ), 100 ) );\n\t\tthis.migration.model.on( 'change:activeStage', this.migration.fixProgressStageWidthForScrollBar.bind( this.migration ) );\n\n\t\treturn this.migration;\n\t},\n\tutils: require( './MigrationProgress-utils' )\n};\n\nmodule.exports = MigrationProgressController;\n\n\n\n// WEBPACK FOOTER //\n// ./src/wp-migrate-db-pro/asset/src/js/modules/MigrationProgress-controller.js","(function( $, wpmdb ) {\n\twpmdb.functions.update_multiselect = function( element, subsites, selected_subsite_ids ) {\n\t\t$( element ).empty();\n\n\t\tif ( 0 < Object.keys( subsites ).length ) {\n\t\t\tconst table_prefix = $.wpmdb.apply_filters( 'wpmdb_get_table_prefix', null, null );\n\t\t\tvar site_selected = false;\n\t\t\t$.each( subsites, function( blog_id, subsite_path ) {\n\t\t\t\tif ( $.wpmdb.apply_filters( 'wpmdb_exclude_subsite', false, blog_id ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar selected = ' ';\n\t\t\t\tif ( ( undefined === selected_subsite_ids || null === selected_subsite_ids || 0 === selected_subsite_ids.length ) ||\n\t\t\t\t ( undefined !== selected_subsite_ids && null !== selected_subsite_ids && 0 < selected_subsite_ids.length && -1 !== $.inArray( blog_id, selected_subsite_ids ) )\n\t\t\t\t) {\n\t\t\t\t\tselected = ' selected=\"selected\" ';\n\t\t\t\t\tsite_selected = true;\n\t\t\t\t}\n\t\t\t\tsubsite_path += ' (' + table_prefix + ( ( '1' !== blog_id ) ? blog_id + '_' : '' ) + ')';\n\t\t\t\t$( element ).append( '<option' + selected + 'value=\"' + blog_id + '\">' + subsite_path + '</option>' );\n\t\t\t} );\n\n\t\t\t// If nothing selected (maybe IDs differ between saved profile and current config) revert to default of all selected.\n\t\t\tif ( false === site_selected ) {\n\t\t\t\twpmdb.functions.update_multiselect( element, subsites, [] );\n\t\t\t}\n\t\t}\n\t};\n})( jQuery, wpmdb );\n\n\n\n// WEBPACK FOOTER //\n// ./src/wp-migrate-db-pro/asset/src/js/multisite.js","(function( $ ) {\n\n\tvar doing_check_licence = false;\n\tvar fade_duration = 650;\n\n\tvar admin_url = ajaxurl.replace( '/admin-ajax.php', '' );\n\tvar spinner_url = admin_url + '/images/spinner';\n\tvar spinner;\n\tif ( 2 < window.devicePixelRatio ) {\n\t\tspinner_url += '-2x';\n\t}\n\tspinner_url += '.gif';\n\tspinner = $( '<img src=\"' + spinner_url + '\" alt=\"\" class=\"check-licence-spinner\" />' );\n\n\t$( document ).ready( function() {\n\n\t\t$( 'body' ).on( 'click', '.check-my-licence-again', function( e ) {\n\t\t\te.preventDefault();\n\t\t\t$( this ).blur();\n\n\t\t\tif ( doing_check_licence ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tdoing_check_licence = true;\n\n\t\t\t$( this ).hide();\n\t\t\tspinner.insertAfter( this );\n\n\t\t\tvar check_again_link = ' <a class=\"check-my-licence-again\" href=\"#\">' + wpmdb_update_strings.check_license_again + '</a>';\n\n\t\t\t$.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'POST',\n\t\t\t\tdataType: 'json',\n\t\t\t\tcache: false,\n\t\t\t\tdata: {\n\t\t\t\t\taction: 'wpmdb_check_licence',\n\t\t\t\t\tnonce: wpmdb_nonces.check_licence,\n\t\t\t\t\tcontext: 'update'\n\t\t\t\t},\n\t\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\t\tdoing_check_licence = false;\n\t\t\t\t\t$( '.wpmdb-licence-error-notice' ).fadeOut( fade_duration, function() {\n\t\t\t\t\t\t$( '.wpmdb-licence-error-notice' ).empty()\n\t\t\t\t\t\t\t.html( wpmdb_update_strings.license_check_problem + check_again_link )\n\t\t\t\t\t\t\t.fadeIn( fade_duration );\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t\tsuccess: function( data ) {\n\t\t\t\t\tdoing_check_licence = false;\n\t\t\t\t\tif ( 'undefined' !== typeof data.errors ) {\n\t\t\t\t\t\tvar msg = '';\n\t\t\t\t\t\tfor ( var key in data.errors ) {\n\t\t\t\t\t\t\tmsg += data.errors[ key ];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$( '.wpmdb-licence-error-notice' ).fadeOut( fade_duration, function() {\n\t\t\t\t\t\t\t$( '.check-licence-spinner' ).remove();\n\t\t\t\t\t\t\t$( '.wpmdb-licence-error-notice' ).empty()\n\t\t\t\t\t\t\t\t.html( msg )\n\t\t\t\t\t\t\t\t.fadeIn( fade_duration );\n\t\t\t\t\t\t} );\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// Success\n\t\t\t\t\t\t// Fade out, empty wpmdb custom error content, swap back in the original wordpress upgrade message, fade in\n\t\t\t\t\t\t$( '.wpmdbpro-custom-visible' ).fadeOut( fade_duration, function() {\n\t\t\t\t\t\t\t$( '.check-licence-spinner' ).remove();\n\t\t\t\t\t\t\t$( '.wpmdbpro-custom-visible' ).empty()\n\t\t\t\t\t\t\t\t.html( $( '.wpmdb-original-update-row' ).html() )\n\t\t\t\t\t\t\t\t.fadeIn( fade_duration );\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\n\t\t} );\n\n\t\t$( '.wpmdbpro-custom' ).prev().addClass( 'wpmdbpro-has-message' );\n\n\t} );\n})( jQuery );\n\n\n\n// WEBPACK FOOTER //\n// ./src/wp-migrate-db-pro/asset/src/js/plugin-update.js","import WPMDBGlobals from './helpers/wpmdbGlobals';\nimport {jQueryAjaxError} from 'src/wp-migrate-db-pro/asset/src/js/helpers/utils';\nconst globals = new WPMDBGlobals();\nconst wpmdb = window.wpmdb || {};\n\n(function( $, wpmdb ) {\n\n\twpmdb.migration_progress_controller = require( './modules/MigrationProgress-controller' );\n\twpmdb.current_migration = null;\n\twpmdb.migration_selection = wpmdb.functions.wpmdb_migration_type();\n\n\twindow.onbeforeunload = function( e ) {\n\t\tif ( 'import' === wpmdb.functions.wpmdb_migration_type() && !$( '.step-two' ).is( ':visible' ) ) {\n\t\t\twpmdb.functions.remove_localStorage_form_data();\n\t\t}\n\n\t\tif ( globals.currently_migrating ) {\n\t\t\te = e || window.event;\n\n\t\t\t// For IE and Firefox prior to version 4\n\t\t\tif ( e ) {\n\t\t\t\te.returnValue = wpmdb_strings.sure;\n\t\t\t}\n\n\t\t\t// For Safari\n\t\t\treturn wpmdb_strings.sure;\n\t\t}\n\t};\n\n\twpmdb.functions.exclude_post_types_warning = function() {\n\t\tvar excluded_post_types = $( '#select-post-types' ).val();\n\t\tvar excluded_post_types_text = '';\n\t\tvar $exclude_post_types_warning = $( '.exclude-post-types-warning' );\n\n\t\tif ( excluded_post_types ) {\n\t\t\texcluded_post_types_text = '<code>' + excluded_post_types.join( '</code>, <code>' ) + '</code>';\n\t\t\t$( '.excluded-post-types' ).html( excluded_post_types_text );\n\n\t\t\tif ( '0' === $exclude_post_types_warning.css( 'opacity' ) ) {\n\t\t\t\t$exclude_post_types_warning\n\t\t\t\t\t.css( { opacity: 0 } )\n\t\t\t\t\t.slideDown( 200 )\n\t\t\t\t\t.animate( { opacity: 1 } );\n\t\t\t}\n\t\t} else {\n\t\t\t$exclude_post_types_warning\n\t\t\t\t.css( { opacity: 0 } )\n\t\t\t\t.slideUp( 200 )\n\t\t\t\t.animate( { opacity: 0 } );\n\t\t}\n\t};\n\n\t//Main method that shows migration progress in the UI\n\twpmdb.functions.migrate_table_recursive = function( current_row, primary_keys, iterator ) {\n\t\tlet i = iterator || 0;\n\n\t\tif ( i >= globals.tables_to_migrate.length ) {\n\n\t\t\tif ( 'upload' === globals.stage && wpmdb.current_migration.model.getStageItems( 'find_replace' ).length ) {\n\t\t\t\tglobals.stage = 'find_replace';\n\t\t\t\tglobals.tables_to_migrate = wpmdb.current_migration.model.getStageItems( 'find_replace', 'name' );\n\t\t\t\tglobals.tables_to_migrate = globals.tables_to_migrate.map( function( table ) {\n\t\t\t\t\treturn '_mig_' + table;\n\t\t\t\t} );\n\t\t\t\ti = 0;\n\t\t\t} else if ( 'backup' === globals.stage ) {\n\n\t\t\t\tif ( -1 !== $.inArray( globals.migration_intent, [ 'push', 'pull' ] ) ) {\n\t\t\t\t\tglobals.stage = 'migrate';\n\t\t\t\t} else if ( 'import' === globals.migration_intent ) {\n\t\t\t\t\tglobals.stage = 'upload';\n\t\t\t\t} else {\n\t\t\t\t\tglobals.stage = globals.migration_intent;\n\t\t\t\t}\n\n\t\t\t\twpmdb.current_migration.model.setActiveStage( globals.stage );\n\n\t\t\t\tif ( 'find_replace' !== globals.stage && 'migrate' !== globals.stage ) {\n\t\t\t\t\twpmdb.functions.wpmdb_call_next_hook();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\ti = 0;\n\n\t\t\t\t// should get from model\n\t\t\t\tglobals.tables_to_migrate = wpmdb.functions.get_tables_to_migrate( null, null );\n\n\t\t\t} else {\n\t\t\t\t$( '.progress-label' ).removeClass( 'label-visible' );\n\t\t\t\twpmdb.common.hooks = $.wpmdb.apply_filters( 'wpmdb_before_migration_complete_hooks', wpmdb.common.hooks );\n\t\t\t\twpmdb.common.hooks.push( wpmdb.functions.migration_complete );\n\t\t\t\twpmdb.common.hooks.push( wpmdb.functions.wpmdb_flush );\n\t\t\t\twpmdb.common.hooks = $.wpmdb.apply_filters( 'wpmdb_after_migration_complete_hooks', wpmdb.common.hooks );\n\t\t\t\twpmdb.common.hooks.push( wpmdb.functions.migration_complete_events );\n\t\t\t\twpmdb.common.next_step_in_migration = { fn: wpmdb.functions.wpmdb_call_next_hook };\n\t\t\t\twpmdb.functions.execute_next_step();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tvar last_table = 0;\n\t\tif ( i === ( globals.tables_to_migrate.length - 1 ) ) {\n\t\t\tlast_table = 1;\n\t\t}\n\n\t\tvar gzip = 0;\n\t\tif ( -1 !== $.inArray( globals.migration_intent, [\n\t\t\t\t'push',\n\t\t\t\t'pull'\n\t\t\t] ) && 1 === parseInt( wpmdb.common.connection_data.gzip ) ) {\n\t\t\tgzip = 1;\n\t\t}\n\n\t\tvar request_data = {\n\t\t\taction: 'wpmdb_migrate_table',\n\t\t\tmigration_state_id: wpmdb.migration_state_id,\n\t\t\ttable: globals.tables_to_migrate[ i ],\n\t\t\tstage: globals.stage,\n\t\t\tcurrent_row: current_row,\n\t\t\tlast_table: last_table,\n\t\t\tprimary_keys: primary_keys,\n\t\t\tgzip: gzip,\n\t\t\tnonce: wpmdb_data.nonces.migrate_table\n\t\t};\n\n\t\tif ( -1 !== $.inArray( globals.migration_intent, [ 'push', 'pull' ] ) ) {\n\t\t\trequest_data.bottleneck = wpmdb.common.connection_data.bottleneck;\n\t\t\trequest_data.prefix = wpmdb.common.connection_data.prefix;\n\t\t}\n\n\t\tif ( wpmdb.common.connection_data && wpmdb.common.connection_data.path_current_site && wpmdb.common.connection_data.domain ) {\n\t\t\trequest_data.path_current_site = wpmdb.common.connection_data.path_current_site;\n\t\t\trequest_data.domain_current_site = wpmdb.common.connection_data.domain;\n\t\t}\n\n\t\tglobals.doing_ajax = true;\n\n\t\t$.ajax( {\n\t\t\turl: ajaxurl,\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'text',\n\t\t\tcache: false,\n\t\t\ttimeout: 0,\n\t\t\tdata: request_data,\n\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\tvar progress_text = wpmdb_strings.table_process_problem + ' ' + globals.tables_to_migrate[ i ] + '<br /><br />' + wpmdb_strings.status + ': ' + jqXHR.status + ' ' + jqXHR.statusText + '<br /><br />' + wpmdb_strings.response + ':<br />' + jqXHR.responseText;\n\t\t\t\twpmdb.current_migration.setState( wpmdb_strings.migration_failed, progress_text, 'error' );\n\n\t\t\t\tglobals.doing_ajax = false;\n\t\t\t\tconsole.log( jqXHR );\n\t\t\t\tconsole.log( textStatus );\n\t\t\t\tconsole.log( errorThrown );\n\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\twpmdb.functions.migration_complete_events();\n\n\t\t\t},\n\t\t\tsuccess: function( data ) {\n\t\t\t\tglobals.doing_ajax = false;\n\t\t\t\tdata = $.trim( data );\n\t\t\t\tvar row_information = wpmdb.functions.wpmdb_parse_json( data );\n\t\t\t\tvar error_text = '';\n\n\t\t\t\tif ( false === row_information || null === row_information ) {\n\n\t\t\t\t\t// should update model\n\t\t\t\t\tif ( '' === data || null === data ) {\n\t\t\t\t\t\terror_text = wpmdb_strings.table_process_problem_empty_response + ' ' + globals.tables_to_migrate[ i ];\n\t\t\t\t\t} else {\n\t\t\t\t\t\terror_text = globals.get_ajax_errors( data, null, null );\n\t\t\t\t\t}\n\n\t\t\t\t\twpmdb.current_migration.setState( wpmdb_strings.migration_failed, error_text, 'error' );\n\t\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\t\twpmdb.functions.migration_complete_events();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( 'undefined' !== typeof row_information.wpmdb_error && 1 === row_information.wpmdb_error ) {\n\t\t\t\t\twpmdb.current_migration.setState( wpmdb_strings.migration_failed, row_information.body, 'error' );\n\t\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\t\twpmdb.functions.migration_complete_events();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar item_name = globals.tables_to_migrate[ i ];\n\t\t\t\tif ( 'import' === globals.migration_intent && 'find_replace' === globals.stage ) {\n\t\t\t\t\titem_name = item_name.replace( wpmdb_data.this_temp_prefix, '' );\n\t\t\t\t}\n\n\t\t\t\t//successful iteration\n\t\t\t\twpmdb.current_migration.setText();\n\t\t\t\twpmdb.current_migration.model.getStageModel( globals.stage ).setItemRowsTransferred( item_name, row_information.current_row );\n\n\t\t\t\t// We need the returned file name for delivery or display to the user.\n\t\t\t\tif ( 1 === last_table && 'savefile' === globals.migration_intent ) {\n\t\t\t\t\tif ( 'undefined' !== typeof row_information.dump_filename ) {\n\t\t\t\t\t\tglobals.dump_filename = row_information.dump_filename;\n\t\t\t\t\t}\n\t\t\t\t\tif ( 'undefined' !== typeof row_information.dump_path ) {\n\t\t\t\t\t\tglobals.dump_path = row_information.dump_path;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( -1 === parseInt( row_information.current_row ) ) {\n\t\t\t\t\ti++;\n\t\t\t\t\trow_information.current_row = '';\n\t\t\t\t\trow_information.primary_keys = '';\n\t\t\t\t}\n\n\t\t\t\twpmdb.common.next_step_in_migration = {\n\t\t\t\t\tfn: wpmdb.functions.migrate_table_recursive,\n\t\t\t\t\targs: [ row_information.current_row, row_information.primary_keys, i ]\n\t\t\t\t};\n\t\t\t\twpmdb.functions.execute_next_step();\n\t\t\t}\n\t\t} );\n\n\t};\n\n\twpmdb.functions.migration_complete_events = function() {\n\t\tif ( false === wpmdb.common.migration_error ) {\n\t\t\tif ( '' === wpmdb.common.non_fatal_errors ) {\n\t\t\t\tif ( 'savefile' !== globals.migration_intent && true === $( '#save_computer' ).is( ':checked' ) ) {\n\t\t\t\t\twpmdb.current_migration.setText();\n\t\t\t\t}\n\n\t\t\t\tglobals.completed_msg = globals.completed_msg + ' <div class=\"dashicons dashicons-yes\"></div>';\n\n\t\t\t\tif ( true === globals.migration_cancelled ) {\n\t\t\t\t\tvar cancel_success = wpmdb_strings.migration_cancelled_success;\n\n\t\t\t\t\tif ( 'find_replace' === globals.migration_intent ) {\n\t\t\t\t\t\tcancel_success = wpmdb_strings.find_replace_cancelled_success;\n\t\t\t\t\t}\n\n\t\t\t\t\twpmdb.current_migration.setState( globals.completed_msg, cancel_success, 'cancelled' );\n\t\t\t\t} else {\n\t\t\t\t\twpmdb.current_migration.setState( globals.completed_msg, '', 'complete' );\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\twpmdb.current_migration.setState( wpmdb_strings.completed_with_some_errors, wpmdb.common.non_fatal_errors, 'error' );\n\t\t\t}\n\t\t}\n\n\t\t$( '.migration-controls' ).addClass( 'hidden' );\n\n\t\t// reset migration variables so consecutive migrations work correctly\n\t\twpmdb.common.hooks = [];\n\t\twpmdb.common.call_stack = [];\n\t\twpmdb.common.migration_error = false;\n\t\tglobals.currently_migrating = false;\n\t\tglobals.migration_completed = true;\n\t\tglobals.migration_paused = false;\n\t\tglobals.migration_cancelled = false;\n\t\tglobals.doing_ajax = false;\n\t\twpmdb.common.non_fatal_errors = '';\n\t\tglobals.tables_to_migrate = [];\n\n\t\t$( '.progress-label' ).remove();\n\t\t$( '.migration-progress-ajax-spinner' ).remove();\n\t\t$( '.close-progress-content' ).show();\n\t\t$( '#overlay' ).css( 'cursor', 'pointer' );\n\t\twpmdb.current_migration.model.setMigrationComplete();\n\t};\n\n\twpmdb.functions.migration_complete = function() {\n\n\t\t$( '.migration-controls' ).addClass( 'hidden' );\n\n\t\tif ( 'savefile' === globals.migration_intent ) {\n\t\t\tglobals.currently_migrating = false;\n\t\t\tvar migrate_complete_text = wpmdb_strings.migration_complete;\n\t\t\tif ( $( '#save_computer' ).is( ':checked' ) ) {\n\t\t\t\tvar url = wpmdb_data.this_download_url + encodeURIComponent( globals.dump_filename );\n\t\t\t\tif ( $( '#gzip_file' ).is( ':checked' ) ) {\n\t\t\t\t\turl += '&gzip=1';\n\t\t\t\t}\n\t\t\t\twindow.location = url;\n\t\t\t} else {\n\t\t\t\tmigrate_complete_text = wpmdb_strings.completed_dump_located_at + ' ' + globals.dump_path;\n\t\t\t}\n\n\t\t\tif ( false === wpmdb.common.migration_error ) {\n\n\t\t\t\twpmdb.functions.migration_complete_events();\n\t\t\t\twpmdb.current_migration.setState( globals.completed_msg, migrate_complete_text, 'complete' );\n\n\t\t\t}\n\n\t\t} else { // rename temp tables, delete old tables\n\n\t\t\twpmdb.current_migration.setState( null, wpmdb_strings.finalizing_migration, 'finalizing' );\n\n\t\t\tvar request_data = {\n\t\t\t\taction: 'wpmdb_finalize_migration',\n\t\t\t\tmigration_state_id: wpmdb.migration_state_id,\n\t\t\t\ttables: globals.tables_to_migrate.join( ',' ),\n\t\t\t\tnonce: wpmdb_data.nonces.finalize_migration\n\t\t\t};\n\n\t\t\tif ( -1 !== $.inArray( globals.migration_intent, [ 'push', 'pull' ] ) ) {\n\t\t\t\trequest_data.prefix = wpmdb.common.connection_data.prefix;\n\t\t\t}\n\n\t\t\tglobals.doing_ajax = true;\n\t\t\t$.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'POST',\n\t\t\t\tdataType: 'json',\n\t\t\t\tcache: false,\n\t\t\t\tdata: request_data,\n\t\t\t\terror: function( jqXHR ) {\n\t\t\t\t\tglobals.doing_ajax = false;\n\t\t\t\t\tlet responseText = wpmdb_strings.finalize_tables_problem;\n\t\t\t\t\tjQueryAjaxError( responseText, jqXHR );\n\t\t\t\t},\n\t\t\t\tsuccess: function( data ) {\n\t\t\t\t\tglobals.doing_ajax = false;\n\t\t\t\t\tif ( 'undefined' !== typeof data && 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error ) {\n\t\t\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\t\t\twpmdb.functions.migration_complete_events();\n\t\t\t\t\t\twpmdb.current_migration.setState( wpmdb_strings.migration_failed, data.body, 'error' );\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\twpmdb.common.next_step_in_migration = { fn: wpmdb.functions.wpmdb_call_next_hook };\n\t\t\t\t\twpmdb.functions.execute_next_step();\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t};\n\n\twpmdb.functions.wpmdb_flush = function() {\n\t\tif ( 'savefile' !== globals.migration_intent ) {\n\t\t\twpmdb.current_migration.setText( wpmdb_strings.flushing );\n\t\t\tglobals.doing_ajax = true;\n\t\t\t$.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'POST',\n\t\t\t\tdataType: 'text',\n\t\t\t\tcache: false,\n\t\t\t\tdata: {\n\t\t\t\t\taction: 'wpmdb_flush',\n\t\t\t\t\tmigration_state_id: wpmdb.migration_state_id,\n\t\t\t\t\tnonce: wpmdb_data.nonces.flush\n\t\t\t\t},\n\t\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\t\tglobals.doing_ajax = false;\n\t\t\t\t\twpmdb.current_migration.setState( wpmdb_strings.migration_failed, wpmdb_strings.flush_problem, 'error' );\n\n\t\t\t\t\talert( jqXHR + ' : ' + textStatus + ' : ' + errorThrown );\n\t\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\t\twpmdb.functions.migration_complete_events();\n\n\t\t\t\t},\n\t\t\t\tsuccess: function( data ) {\n\t\t\t\t\tglobals.doing_ajax = false;\n\t\t\t\t\tif ( '1' !== $.trim( data ) ) {\n\t\t\t\t\t\twpmdb.current_migration.setState( wpmdb_strings.migration_failed, data, 'error' );\n\n\t\t\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\t\t\twpmdb.functions.migration_complete_events();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\twpmdb.common.next_step_in_migration = { fn: wpmdb.functions.wpmdb_call_next_hook };\n\t\t\t\t\twpmdb.functions.execute_next_step();\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t};\n\n\twpmdb.functions.execute_next_step = function( instance = null, run_fn = true ) {\n\n\t\t// if delay is set, set a timeout for delay to recall this function, then return\n\t\tif ( 0 < globals.delay_between_requests && false === globals.flag_skip_delay ) {\n\t\t\tsetTimeout( function() {\n\t\t\t\tglobals.flag_skip_delay = true;\n\t\t\t\twpmdb.functions.execute_next_step( instance );\n\t\t\t}, globals.delay_between_requests );\n\t\t\treturn;\n\t\t} else {\n\t\t\tglobals.flag_skip_delay = false;\n\t\t}\n\n\t\tif ( true === globals.migration_paused ) {\n\t\t\t$( '.migration-progress-ajax-spinner' ).hide();\n\n\t\t\t// Pause the timer\n\t\t\twpmdb.current_migration.pauseTimer();\n\n\t\t\tvar pause_text = '';\n\t\t\tif ( true === globals.is_auto_pause_before_finalize ) {\n\t\t\t\tpause_text = wpmdb_strings.paused_before_finalize;\n\t\t\t\tglobals.is_auto_pause_before_finalize = false;\n\n\t\t\t\tif ( 'find_replace' === wpmdb.functions.wpmdb_migration_type() ) {\n\t\t\t\t\tpause_text = wpmdb_strings.find_replace_paused_before_finalize;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tpause_text = wpmdb_strings.paused;\n\t\t\t}\n\n\t\t\twpmdb.current_migration.setState( null, pause_text, 'paused' );\n\n\t\t\t// Re-bind Pause/Resume button to Resume when we are finally Paused\n\t\t\t$( 'body' ).on( 'click', '.pause-resume', function( event ) {\n\t\t\t\tglobals.set_pause_resume_button( event, instance );\n\t\t\t} );\n\t\t\t$( 'body' ).on( 'click', '.cancel', function( event ) {\n\t\t\t\tglobals.cancel_migration( event );\n\t\t\t} );\n\t\t\t$( '.pause-resume' ).html( wpmdb_strings.resume );\n\n\t\t} else if ( true === globals.migration_cancelled ) {\n\t\t\tglobals.migration_intent = wpmdb.functions.wpmdb_migration_type();\n\n\t\t\tvar progress_msg;\n\n\t\t\tif ( 'savefile' === globals.migration_intent ) {\n\t\t\t\tprogress_msg = wpmdb_strings.removing_local_sql;\n\t\t\t} else if ( 'pull' === globals.migration_intent ) {\n\t\t\t\tif ( 'backup' === globals.stage ) {\n\t\t\t\t\tprogress_msg = wpmdb_strings.removing_local_backup;\n\t\t\t\t} else {\n\t\t\t\t\tprogress_msg = wpmdb_strings.removing_local_temp_tables;\n\t\t\t\t}\n\t\t\t} else if ( 'push' === globals.migration_intent ) {\n\t\t\t\tif ( 'backup' === globals.stage ) {\n\t\t\t\t\tprogress_msg = wpmdb_strings.removing_remote_sql;\n\t\t\t\t} else {\n\t\t\t\t\tprogress_msg = wpmdb_strings.removing_remote_temp_tables;\n\t\t\t\t}\n\t\t\t}\n\t\t\twpmdb.current_migration.setText( progress_msg );\n\n\t\t\tvar request_data = {\n\t\t\t\taction: 'wpmdb_cancel_migration',\n\t\t\t\tmigration_state_id: wpmdb.migration_state_id,\n\t\t\t\tnonce: wpmdb_data.nonces.cancel_migration\n\t\t\t};\n\n\t\t\tglobals.doing_ajax = true;\n\n\t\t\t$.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'POST',\n\t\t\t\tdataType: 'text',\n\t\t\t\tcache: false,\n\t\t\t\tdata: request_data,\n\t\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\t\twpmdb.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' );\n\t\t\t\t\tconsole.log( jqXHR );\n\t\t\t\t\tconsole.log( textStatus );\n\t\t\t\t\tconsole.log( errorThrown );\n\t\t\t\t\tglobals.doing_ajax = false;\n\t\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\t\twpmdb.functions.migration_complete_events();\n\n\t\t\t\t},\n\t\t\t\tsuccess: function( data ) {\n\t\t\t\t\tglobals.doing_ajax = false;\n\t\t\t\t\tdata = $.trim( data );\n\n\t\t\t\t\tif ( ( 'push' === globals.migration_intent && '1' !== data ) || ( 'push' !== globals.migration_intent && '' !== data ) ) {\n\n\t\t\t\t\t\tif ( 'undefined' !== typeof data && 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error ) {\n\t\t\t\t\t\t\tdata = data.wpmdb_error;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\twpmdb.current_migration.setState( wpmdb_strings.migration_cancellation_failed, data, 'error' );\n\t\t\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\t\t\twpmdb.functions.migration_complete_events();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tglobals.completed_msg = wpmdb_strings.migration_cancelled;\n\n\t\t\t\t\tif ( 'find_replace' === globals.migration_intent ) {\n\t\t\t\t\t\tglobals.completed_msg = wpmdb_strings.find_replace_cancelled;\n\t\t\t\t\t}\n\n\t\t\t\t\twpmdb.functions.migration_complete_events();\n\t\t\t\t\twpmdb.current_migration.setStatus( 'cancelled' );\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\tif(run_fn){\n\t\t\t\twpmdb.common.next_step_in_migration.fn.apply( instance, wpmdb.common.next_step_in_migration.args );\n\t\t\t}\n\n\t\t}\n\t};\n\n\twpmdb.functions.maybe_show_prefix_notice = ( prefix ) => {\n\t\tvar $prefix_notice = $( '.prefix-notice' );\n\n\t\t$prefix_notice.hide();\n\n\t\tif ( prefix !== wpmdb_data.this_prefix ) {\n\t\t\t$( '.remote-prefix' ).html( prefix );\n\t\t\tglobals.show_prefix_notice = true;\n\t\t\t$prefix_notice.show();\n\t\t}\n\t};\n\n\twpmdb.functions.maybe_show_mst_warning = function( data ) {\n\t\tconst migration_type = wpmdb.functions.wpmdb_migration_type();\n\t\tlet show_mst_warning = false;\n\n\t\tif ( -1 !== $.inArray( migration_type, [ 'push', 'pull' ] ) && 'undefined' !== typeof data.site_details ) {\n\t\t\tif ( wpmdb_data.site_details.is_multisite !== data.site_details.is_multisite ) {\n\t\t\t\tif ( 'undefined' === typeof wpmdb.mst || 'undefined' === typeof data.mst_available || '1' !== data.mst_available ) {\n\t\t\t\t\tshow_mst_warning = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ( 'import' === migration_type ) {\n\t\t\tif ( 'undefined' !== typeof data.multisite && 'undefined' !== typeof data.subsite_export ) {\n\t\t\t\tif (\n\t\t\t\t\t( 'false' === wpmdb_data.site_details.is_multisite && 'true' === data.multisite && 'true' !== data.subsite_export ) ||\n\t\t\t\t\t( 'true' === wpmdb_data.site_details.is_multisite && 'false' === data.multisite )\n\t\t\t\t) {\n\t\t\t\t\tshow_mst_warning = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tshow_mst_warning = $.wpmdb.apply_filters( 'wpmdb_show_mst_warning', show_mst_warning );\n\n\t\tif ( show_mst_warning ) {\n\t\t\t$( '.mst-required' ).show();\n\t\t}\n\n\t\treturn show_mst_warning;\n\n\t};\n\n\twpmdb.functions.maybe_show_select_table_notice = function() {\n\n\t\t// check that they've selected some tables to migrate\n\t\tif ( $( '#migrate-selected' ).is( ':checked' ) && null === $( '#select-tables' ).val() ) {\n\t\t\tif ( 'import' !== wpmdb.functions.wpmdb_migration_type() ) {\n\t\t\t\talert( wpmdb_strings.please_select_one_table );\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tif ( $( '#import-find-replace' ).is( ':checked' ) && $( '#select-tables' ).is( ':visible' ) ) {\n\t\t\t\t\talert( wpmdb_strings.please_select_one_table_import );\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// check that they've selected some tables to backup\n\t\tif ( 'savefile' !== wpmdb.functions.wpmdb_migration_type() && $( '#backup-manual-select' ).is( ':checked' ) && null === $( '#select-backup' ).val() ) {\n\t\t\talert( wpmdb_strings.please_select_one_table_backup );\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t};\n\n\twpmdb.functions.remove_protocol = function( url ) {\n\t\treturn url.replace( /^https?:/i, '' );\n\t};\n\n\twpmdb.functions.create_table_select = function( tables, table_sizes_hr, selected_tables ) {\n\t\tvar $table_select = document.createElement( 'select' );\n\t\t$( $table_select ).attr( {\n\t\t\tmultiple: 'multiple',\n\t\t\tname: 'select_tables[]',\n\t\t\tid: 'select-tables',\n\t\t\tclass: 'multiselect'\n\t\t} );\n\n\t\tif ( 0 < tables.length ) {\n\t\t\t$.each( tables, function( index, table ) {\n\t\t\t\tif ( $.wpmdb.apply_filters( 'wpmdb_exclude_table', false, table ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar selected = ' ';\n\t\t\t\tif ( undefined !== selected_tables && null !== selected_tables && 0 < selected_tables.length && -1 !== $.inArray( table, selected_tables ) ) {\n\t\t\t\t\tselected = ' selected=\"selected\" ';\n\t\t\t\t}\n\n\t\t\t\tvar size = '';\n\t\t\t\tif ( 0 !== table_sizes_hr.length ) {\n\t\t\t\t\tsize = ' (' + table_sizes_hr[ table ] + ')';\n\t\t\t\t}\n\n\t\t\t\t$( $table_select ).append( '<option' + selected + 'value=\"' + table + '\">' + table + size + '</option>' );\n\t\t\t} );\n\t\t}\n\n\t\treturn $table_select;\n\t};\n\n\t/**\n\t * Returns tables selected for migration.\n\t *\n\t * @returns {array}\n\t *\n\t * Also handler for wpmdb_get_tables_to_migrate filter, disregards input values as it is the primary source.\n\t */\n\twpmdb.functions.get_tables_to_migrate = function() {\n\t\tvar tables = [];\n\t\tvar mig_type = wpmdb.functions.wpmdb_migration_type();\n\t\tvar table_intent = $( 'input[name=table_migrate_option]:checked' ).val();\n\n\t\t// Grab tables as per what the user has selected from the multiselect box or all prefixed tables.\n\t\tif ( 'migrate_select' === table_intent ) {\n\t\t\ttables = $( '#select-tables' ).val();\n\t\t} else {\n\t\t\tif ( 'pull' !== mig_type && 'undefined' !== typeof wpmdb_data.this_prefixed_tables ) {\n\t\t\t\ttables = wpmdb_data.this_prefixed_tables;\n\t\t\t} else if ( 'pull' === mig_type && 'undefined' !== typeof wpmdb.common.connection_data && 'undefined' !== typeof wpmdb.common.connection_data.prefixed_tables ) {\n\t\t\t\ttables = wpmdb.common.connection_data.prefixed_tables;\n\t\t\t}\n\t\t}\n\n\t\treturn tables;\n\t};\n\n\twpmdb.functions.update_migrate_button_text = function() {\n\t\tvar migration_intent = wpmdb.functions.wpmdb_migration_type();\n\t\tvar save_string = ( $( '#save-migration-profile' ).is( ':checked' ) ) ? '_save' : '';\n\t\tvar migrate_string = 'migrate_button_' + ( ( 'savefile' === migration_intent ) ? 'export' : migration_intent ) + save_string;\n\t\t$( '.migrate-db .button-primary' ).val( wpmdb_strings[ migrate_string ] );\n\t};\n\n\t// fired when the connection info box changes (e.g. gets pasted into)\n\twpmdb.functions.connection_box_changed = function() {\n\t\tvar $this = $( '.pull-push-connection-info' );\n\n\t\tif ( -1 === $.inArray( wpmdb.functions.wpmdb_migration_type(), [ 'push', 'pull' ] ) ||\n\t\t ( globals.doing_ajax || $( $this ).hasClass( 'temp-disabled' ) ) && false === wpmdb.force_reconnect ) {\n\t\t\treturn;\n\t\t}\n\n\t\twpmdb.force_reconnect = false;\n\t\tvar data = $( '.pull-push-connection-info' ).val();\n\n\t\tvar connection_info = $.trim( data ).split( '\\n' );\n\t\tvar error = false;\n\t\tvar error_message = '';\n\n\t\tif ( '' === connection_info ) {\n\t\t\terror = true;\n\t\t\terror_message = wpmdb_strings.connection_info_missing;\n\t\t}\n\n\t\t// attempt to format the connection info from a single line\n\t\tif ( 1 === connection_info.length && !error ) {\n\t\t\tvar connection_words = $.trim( data ).split( ' ' );\n\t\t\tif ( 2 === connection_words.length ) {\n\t\t\t\tconnection_info = connection_words;\n\t\t\t}\n\t\t}\n\n\t\tif ( 2 !== connection_info.length && !error ) {\n\t\t\terror = true;\n\t\t\terror_message = wpmdb_strings.connection_info_incorrect;\n\t\t}\n\n\t\tif ( !error && !globals.validate_url( connection_info[ 0 ] ) ) {\n\t\t\terror = true;\n\t\t\terror_message = wpmdb_strings.connection_info_url_invalid;\n\t\t}\n\n\t\tvar key_length = 0;\n\n\t\tif ( 'undefined' !== typeof connection_info[ 1 ] ) {\n\t\t\tkey_length = connection_info[ 1 ].length;\n\t\t}\n\n\t\tif ( !error && 32 !== key_length && 40 !== key_length ) {\n\t\t\terror = true;\n\t\t\terror_message = wpmdb_strings.connection_info_key_invalid;\n\t\t}\n\n\t\tif ( !error && connection_info[ 0 ] === wpmdb_data.connection_info[ 0 ] ) {\n\t\t\terror = true;\n\t\t\terror_message = wpmdb_strings.connection_info_local_url;\n\t\t}\n\n\t\tif ( !error && connection_info[ 1 ] === wpmdb_data.connection_info[ 1 ] ) {\n\t\t\terror = true;\n\t\t\terror_message = wpmdb_strings.connection_info_local_key;\n\t\t}\n\t\tif ( error ) {\n\t\t\t$( '.connection-status' ).html( error_message );\n\t\t\t$( '.connection-status' ).addClass( 'notification-message error-notice migration-error' );\n\t\t\treturn;\n\t\t}\n\n\t\tvar new_connection_info_contents = connection_info[ 0 ] + '\\n' + connection_info[ 1 ];\n\n\t\t// If connection info is a single line\n\t\tif ( 1 === $.trim( data ).split( '\\n' ).length ) {\n\n\t\t\t// Repopulate the input with the info on two lines\n\t\t\t$( '.pull-push-connection-info' ).val( new_connection_info_contents );\n\t\t}\n\n\t\tif ( false === wpmdb_data.openssl_available ) {\n\t\t\tconnection_info[ 0 ] = connection_info[ 0 ].replace( 'https://', 'http://' );\n\t\t\tnew_connection_info_contents = connection_info[ 0 ] + '\\n' + connection_info[ 1 ];\n\t\t\t$( '.pull-push-connection-info' ).val( new_connection_info_contents );\n\t\t}\n\n\t\tglobals.show_prefix_notice = false;\n\t\tglobals.doing_ajax = true;\n\t\tglobals.disable_export_type_controls();\n\n\t\tif ( $( '.basic-access-auth-wrapper' ).is( ':visible' ) ) {\n\t\t\tconnection_info[ 0 ] = connection_info[ 0 ].replace( /\\/\\/(.*)@/, '//' );\n\t\t\tconnection_info[ 0 ] = connection_info[ 0 ].replace( '//', '//' + encodeURIComponent( $.trim( $( '.auth-username' ).val() ) ) + ':' + encodeURIComponent( $.trim( $( '.auth-password' ).val() ) ) + '@' );\n\t\t\tnew_connection_info_contents = connection_info[ 0 ] + '\\n' + connection_info[ 1 ];\n\t\t\t$( '.pull-push-connection-info' ).val( new_connection_info_contents );\n\t\t\t$( '.basic-access-auth-wrapper' ).hide();\n\t\t}\n\n\t\t$( '.step-two' ).hide();\n\t\t$( '.ssl-notice' ).hide();\n\t\t$( '.prefix-notice' ).hide();\n\t\t$( '.connection-status' ).show();\n\n\t\t$( '.connection-status' ).html( wpmdb_strings.establishing_remote_connection );\n\t\t$( '.connection-status' ).removeClass( 'notification-message error-notice migration-error' );\n\t\t$( '.connection-status' ).append( globals.ajax_spinner );\n\n\t\tvar intent = wpmdb.functions.wpmdb_migration_type();\n\n\t\tglobals.profile_name_edited = false;\n\n\t\treturn $.ajax( {\n\t\t\turl: ajaxurl,\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'json',\n\t\t\tcache: false,\n\t\t\tdata: {\n\t\t\t\taction: 'wpmdb_verify_connection_to_remote_site',\n\t\t\t\turl: connection_info[ 0 ],\n\t\t\t\tkey: connection_info[ 1 ],\n\t\t\t\tintent: intent,\n\t\t\t\tnonce: wpmdb_data.nonces.verify_connection_to_remote_site\n\t\t\t},\n\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\t$( '.connection-status' ).html( globals.get_ajax_errors( jqXHR.responseText, '(#100)', jqXHR ) );\n\t\t\t\t$( '.connection-status' ).addClass( 'notification-message error-notice migration-error' );\n\t\t\t\t$( '.ajax-spinner' ).remove();\n\t\t\t\tglobals.doing_ajax = false;\n\t\t\t\tglobals.enable_export_type_controls();\n\t\t\t},\n\t\t\tsuccess: function( data ) {\n\t\t\t\t$( '.ajax-spinner' ).remove();\n\t\t\t\tglobals.doing_ajax = false;\n\t\t\t\tglobals.enable_export_type_controls();\n\n\t\t\t\tif ( 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error ) {\n\t\t\t\t\t$( '.connection-status' ).html( data.body );\n\t\t\t\t\t$( '.connection-status' ).addClass( 'notification-message error-notice migration-error' );\n\n\t\t\t\t\tif ( data.body.indexOf( '401 Unauthorized' ) > -1 ) {\n\t\t\t\t\t\t$( '.basic-access-auth-wrapper' ).show();\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !$( '.pull-push-connection-info' ).hasClass( 'temp-disabled' ) && !$( '.connect-button' ).is( ':visible' ) ) {\n\t\t\t\t\t\t$( '.pull-push-connection-info' ).removeAttr( 'readonly' );\n\t\t\t\t\t\t$( '.connect-button' ).show();\n\t\t\t\t\t}\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( true === wpmdb.functions.maybe_show_mst_warning( data ) ) {\n\t\t\t\t\t$( '.connection-status' ).hide();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tglobals.maybe_show_ssl_warning( connection_info[ 0 ], connection_info[ 1 ], data.scheme );\n\n\t\t\t\tvar profile_name = globals.get_domain_name( data.url );\n\t\t\t\t$( '.create-new-profile' ).val( profile_name );\n\n\t\t\t\t$( '.pull-push-connection-info' ).addClass( 'temp-disabled' );\n\t\t\t\t$( '.pull-push-connection-info' ).attr( 'readonly', 'readonly' );\n\t\t\t\t$( '.connect-button' ).hide();\n\n\t\t\t\t$( '.connection-status' ).hide();\n\t\t\t\t$( '.step-two' ).show();\n\n\t\t\t\twpmdb.functions.maybe_show_prefix_notice( data.prefix );\n\n\t\t\t\tglobals.connection_established = true;\n\t\t\t\tglobals.set_connection_data( data );\n\t\t\t\tglobals.move_connection_info_box();\n\t\t\t\tglobals.change_replace_values();\n\n\t\t\t\tglobals.maybe_show_mixed_cased_table_name_warning();\n\n\t\t\t\tglobals.refresh_table_selects(null, null, this);\n\n\t\t\t\tglobals.$push_select_backup = $( globals.$pull_select ).clone();\n\t\t\t\t$( globals.$push_select_backup ).attr( {\n\t\t\t\t\tname: 'select_backup[]',\n\t\t\t\t\tid: 'select-backup'\n\t\t\t\t} );\n\n\t\t\t\tvar $post_type_select = document.createElement( 'select' );\n\t\t\t\t$( $post_type_select ).attr( {\n\t\t\t\t\tmultiple: 'multiple',\n\t\t\t\t\tname: 'select_post_types[]',\n\t\t\t\t\tid: 'select-post-types',\n\t\t\t\t\tclass: 'multiselect'\n\t\t\t\t} );\n\n\t\t\t\t$.each( wpmdb.common.connection_data.post_types, function( index, value ) {\n\t\t\t\t\t$( $post_type_select ).append( '<option value=\"' + value + '\">' + value + '</option>' );\n\t\t\t\t} );\n\n\t\t\t\tglobals.$pull_post_type_select = $post_type_select;\n\n\t\t\t\t$( '#new-path-missing-warning, #new-url-missing-warning' ).hide();\n\n\t\t\t\tif ( 'pull' === wpmdb.functions.wpmdb_migration_type() ) {\n\t\t\t\t\t$( '#new-url' ).val( wpmdb.functions.remove_protocol( wpmdb_data.this_url ) );\n\t\t\t\t\t$( '#new-path' ).val( wpmdb_data.this_path );\n\t\t\t\t\tif ( 'true' === wpmdb_data.is_multisite ) {\n\t\t\t\t\t\t$( '#new-domain' ).val( wpmdb_data.this_domain );\n\t\t\t\t\t\t$( '.replace-row.pin .old-replace-col input[type=\"text\"]' ).val( wpmdb.functions.remove_protocol( data.url ) );\n\t\t\t\t\t}\n\t\t\t\t\t$( '#old-url' ).val( wpmdb.functions.remove_protocol( data.url ) );\n\t\t\t\t\t$( '#old-path' ).val( data.path );\n\n\t\t\t\t\t$.wpmdb.do_action( 'wpmdb_update_pull_table_select' );\n\t\t\t\t\t$( '#select-post-types' ).remove();\n\t\t\t\t\t$( '.exclude-post-types-warning' ).after( globals.$pull_post_type_select );\n\t\t\t\t\twpmdb.functions.exclude_post_types_warning();\n\t\t\t\t\t$( '.table-prefix' ).html( data.prefix );\n\t\t\t\t\t$( '.backup-table-prefix' ).html( wpmdb_data.site_details.prefix );\n\t\t\t\t\t$( '.uploads-dir' ).html( wpmdb_data.this_uploads_dir );\n\t\t\t\t} else {\n\t\t\t\t\t$( '#new-url' ).val( wpmdb.functions.remove_protocol( data.url ) );\n\t\t\t\t\t$( '#new-path' ).val( data.path );\n\n\t\t\t\t\tif ( 'true' === wpmdb_data.is_multisite ) {\n\t\t\t\t\t\t$( '.replace-row.pin .old-replace-col input[type=\"text\"]' ).val( wpmdb.functions.remove_protocol( wpmdb_data.this_url ) );\n\t\t\t\t\t}\n\t\t\t\t\t$.wpmdb.do_action( 'wpmdb_update_push_table_select' );\n\t\t\t\t\t$( '#select-backup' ).remove();\n\t\t\t\t\t$( '.backup-tables-wrap' ).prepend( globals.$push_select_backup );\n\t\t\t\t}\n\n\t\t\t\twpmdb.common.next_step_in_migration = {\n\t\t\t\t\tfn: $.wpmdb.do_action,\n\t\t\t\t\targs: [ 'verify_connection_to_remote_site', wpmdb.common.connection_data ]\n\t\t\t\t};\n\t\t\t\twpmdb.functions.execute_next_step();\n\t\t\t}\n\n\t\t} );\n\n\t};\n\n\t/**\n\t *\n\t * ========= DOM ready =========\n\t *\n\t * Mostly direct DOM manipulation specific code\n\t *\n\t */\n\t$( document ).ready( function() {\n\t\twpmdb.migration_state_id = '';\n\n\t\t$( '#plugin-compatibility' ).change( function( e ) {\n\t\t\tvar install = '1';\n\t\t\tvar $status = $( this ).closest( 'td' ).next( 'td' ).find( '.setting-status' );\n\n\t\t\tif ( !$( this ).is( ':checked' ) ) {\n\t\t\t\tinstall = '0';\n\t\t\t}\n\n\t\t\t$( '.plugin-compatibility-wrap' ).toggle();\n\n\t\t\t$status.find( '.ajax-success-msg' ).remove();\n\t\t\t$status.append( globals.ajax_spinner );\n\t\t\t$( '#plugin-compatibility' ).attr( 'disabled', 'disabled' );\n\t\t\t$( '.plugin-compatibility' ).addClass( 'disabled' );\n\n\t\t\t$.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'POST',\n\t\t\t\tdataType: 'text',\n\t\t\t\tcache: false,\n\t\t\t\tdata: {\n\t\t\t\t\taction: 'wpmdb_plugin_compatibility',\n\t\t\t\t\tinstall: install,\n\t\t\t\t\tnonce: wpmdb_data.nonces.plugin_compatibility\n\t\t\t\t},\n\t\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\t\talert( 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 );\n\t\t\t\t\t$( '.ajax-spinner' ).remove();\n\t\t\t\t\t$( '#plugin-compatibility' ).removeAttr( 'disabled' );\n\t\t\t\t\t$( '.plugin-compatibility' ).removeClass( 'disabled' );\n\t\t\t\t},\n\t\t\t\tsuccess: function( data ) {\n\t\t\t\t\tif ( '' !== $.trim( data ) ) {\n\t\t\t\t\t\talert( data );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$status.append( '<span class=\"ajax-success-msg\">' + wpmdb_strings.saved + '</span>' );\n\t\t\t\t\t\t$( '.ajax-success-msg' ).fadeOut( 2000, function() {\n\t\t\t\t\t\t\t$( this ).remove();\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\t$( '.ajax-spinner' ).remove();\n\t\t\t\t\t$( '#plugin-compatibility' ).removeAttr( 'disabled' );\n\t\t\t\t\t$( '.plugin-compatibility' ).removeClass( 'disabled' );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t} );\n\n\t\tif ( $( '#plugin-compatibility' ).is( ':checked' ) ) {\n\t\t\t$( '.plugin-compatibility-wrap' ).show();\n\t\t}\n\n\t\tif ( 0 <= navigator.userAgent.indexOf( 'MSIE' ) || 0 <= navigator.userAgent.indexOf( 'Trident' ) ) {\n\t\t\t$( '.ie-warning' ).show();\n\t\t}\n\n\t\tif ( 0 <= navigator.userAgent.indexOf( 'Edge' ) ) {\n\t\t\t$( '.edge-warning' ).show();\n\t\t}\n\n\t\tif ( 0 === wpmdb_data.valid_licence ) {\n\t\t\t$( '#savefile' ).prop( 'checked', true );\n\t\t}\n\t\tvar max_request_size_container = $( '.max-request-size' );\n\t\tvar max_request_size_slider = $( '.slider', max_request_size_container );\n\t\tmax_request_size_slider.slider( {\n\t\t\trange: 'min',\n\t\t\tvalue: parseInt( wpmdb_data.max_request / 1024 ),\n\t\t\tmin: 512,\n\t\t\tmax: parseInt( wpmdb_data.bottleneck / 1024 ),\n\t\t\tstep: 256,\n\t\t\tcreate: function( event, ui ) {\n\t\t\t\tvar display_info = globals.get_max_request_display_info( wpmdb_data.max_request / 1024 );\n\t\t\t\tglobals.set_slider_value( max_request_size_container, wpmdb_data.max_request / 1024, display_info.unit, display_info.amount );\n\t\t\t},\n\t\t\tslide: function( event, ui ) {\n\t\t\t\tvar display_info = globals.get_max_request_display_info( ui.value );\n\t\t\t\tglobals.set_slider_value( max_request_size_container, ui.value, display_info.unit, display_info.amount );\n\t\t\t},\n\t\t\tstop: function( event, ui ) {\n\t\t\t\t$( '.slider-success-msg' ).remove();\n\t\t\t\t$( '.amount', max_request_size_container ).after( '<img src=\"' + globals.spinner_url + '\" alt=\"\" class=\"slider-spinner general-spinner\" />' );\n\t\t\t\tmax_request_size_slider.slider( 'disable' );\n\n\t\t\t\t$.ajax( {\n\t\t\t\t\turl: ajaxurl,\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\tcache: false,\n\t\t\t\t\tdata: {\n\t\t\t\t\t\taction: 'wpmdb_update_max_request_size',\n\t\t\t\t\t\tmax_request_size: parseInt( ui.value ),\n\t\t\t\t\t\tnonce: wpmdb_data.nonces.update_max_request_size\n\t\t\t\t\t},\n\t\t\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\t\t\tmax_request_size_slider.slider( 'enable' );\n\t\t\t\t\t\t$( '.slider-spinner', max_request_size_container ).remove();\n\t\t\t\t\t\talert( wpmdb_strings.max_request_size_problem );\n\t\t\t\t\t\tvar display_info = globals.get_max_request_display_info( wpmdb_data.max_request / 1024 );\n\t\t\t\t\t\tglobals.set_slider_value( max_request_size_container, wpmdb_data.max_request / 1024, display_info.unit, display_info.amount );\n\t\t\t\t\t\tmax_request_size_slider.slider( 'enable' );\n\t\t\t\t\t},\n\t\t\t\t\tsuccess: function() {\n\t\t\t\t\t\tmax_request_size_slider.slider( 'enable' );\n\t\t\t\t\t\t$( '.slider-label-wrapper', max_request_size_container ).append( '<span class=\"slider-success-msg\">' + wpmdb_strings.saved + '</span>' );\n\t\t\t\t\t\t$( '.slider-success-msg', max_request_size_container ).fadeOut( 2000, function() {\n\t\t\t\t\t\t\t$( this ).remove();\n\t\t\t\t\t\t} );\n\t\t\t\t\t\t$( '.slider-spinner', max_request_size_container ).remove();\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\tvar delay_between_requests_container = $( '.delay-between-requests' );\n\t\tvar delay_between_requests_slider = $( '.slider', delay_between_requests_container );\n\t\tdelay_between_requests_slider.slider( {\n\t\t\trange: 'min',\n\t\t\tvalue: parseInt( wpmdb_data.delay_between_requests / 1000 ),\n\t\t\tmin: 0,\n\t\t\tmax: 10,\n\t\t\tstep: 1,\n\t\t\tcreate: function( event, ui ) {\n\t\t\t\tglobals.set_slider_value( delay_between_requests_container, wpmdb_data.delay_between_requests / 1000, 's' );\n\t\t\t},\n\t\t\tslide: function( event, ui ) {\n\t\t\t\tglobals.set_slider_value( delay_between_requests_container, ui.value, 's' );\n\t\t\t},\n\t\t\tstop: function( event, ui ) {\n\t\t\t\t$( '.slider-success-msg' ).remove();\n\t\t\t\t$( '.amount', delay_between_requests_container ).after( '<img src=\"' + globals.spinner_url + '\" alt=\"\" class=\"slider-spinner general-spinner\" />' );\n\t\t\t\tdelay_between_requests_slider.slider( 'disable' );\n\n\t\t\t\t$.ajax( {\n\t\t\t\t\turl: ajaxurl,\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\tcache: false,\n\t\t\t\t\tdata: {\n\t\t\t\t\t\taction: 'wpmdb_update_delay_between_requests',\n\t\t\t\t\t\tdelay_between_requests: parseInt( ui.value * 1000 ),\n\t\t\t\t\t\tnonce: wpmdb_data.nonces.update_delay_between_requests\n\t\t\t\t\t},\n\t\t\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\t\t\tdelay_between_requests_slider.slider( 'enable' );\n\t\t\t\t\t\t$( '.slider-spinner', delay_between_requests_container ).remove();\n\t\t\t\t\t\talert( wpmdb_strings.delay_between_requests_problem );\n\t\t\t\t\t\tglobals.set_slider_value( delay_between_requests_container, wpmdb_data.delay_between_requests / 1000, 's' );\n\t\t\t\t\t\tdelay_between_requests_slider.slider( 'enable' );\n\t\t\t\t\t},\n\t\t\t\t\tsuccess: function() {\n\t\t\t\t\t\twpmdb_data.delay_between_requests = parseInt( ui.value * 1000 );\n\t\t\t\t\t\tdelay_between_requests_slider.slider( 'enable' );\n\t\t\t\t\t\t$( '.slider-label-wrapper', delay_between_requests_container ).append( '<span class=\"slider-success-msg\">' + wpmdb_strings.saved + '</span>' );\n\t\t\t\t\t\t$( '.slider-success-msg', delay_between_requests_container ).fadeOut( 2000, function() {\n\t\t\t\t\t\t\t$( this ).remove();\n\t\t\t\t\t\t} );\n\t\t\t\t\t\t$( '.slider-spinner', delay_between_requests_container ).remove();\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\t$( '.help-tab .video' ).each( function() {\n\t\t\tvar $container = $( this ),\n\t\t\t\t$viewer = $( '.video-viewer' );\n\n\t\t\t$( 'a', this ).click( function( e ) {\n\t\t\t\te.preventDefault();\n\n\t\t\t\t$viewer.attr( 'src', '//www.youtube.com/embed/' + $container.data( 'video-id' ) + '?autoplay=1' );\n\t\t\t\t$viewer.show();\n\t\t\t\tvar offset = $viewer.offset();\n\t\t\t\t$( window ).scrollTop( offset.top - 50 );\n\t\t\t} );\n\t\t} );\n\n\t\t$( '.backup-options' ).show();\n\t\t$( '.keep-active-plugins' ).show();\n\t\tif ( 'savefile' === wpmdb.functions.wpmdb_migration_type() ) {\n\t\t\t$( '.backup-options' ).hide();\n\t\t\t$( '.keep-active-plugins' ).hide();\n\t\t}\n\n\t\tglobals.last_replace_switch = wpmdb.functions.wpmdb_migration_type();\n\n\t\t/**\n\t\t * Handle 'Check License Again' functionality found in expired license messages.\n\t\t */\n\t\t$( '.content-tab' ).on( 'click', '.check-my-licence-again', function( e ) {\n\t\t\te.preventDefault();\n\t\t\tglobals.checked_licence = false;\n\t\t\t$( e.target ).replaceWith( 'Checking... ' + globals.ajax_spinner );\n\t\t\tglobals.check_licence( null, 'all' );\n\t\t} );\n\n\t\t$.wpmdb.add_action( 'wpmdb_refresh_table_selects', globals.refresh_table_selects, '', globals );\n\n\t\tfunction update_push_table_select() {\n\t\t\t$( '#select-tables' ).remove();\n\t\t\t$( '.select-tables-wrap' ).prepend( globals.$push_select );\n\t\t\t$( '#select-tables' ).change();\n\t\t}\n\n\t\t$.wpmdb.add_action( 'wpmdb_update_push_table_select', update_push_table_select );\n\n\t\tfunction update_pull_table_select() {\n\t\t\t$( '#select-tables' ).remove();\n\t\t\t$( '.select-tables-wrap' ).prepend( globals.$pull_select );\n\t\t\t$( '#select-tables' ).change();\n\t\t}\n\n\t\t$.wpmdb.add_action( 'wpmdb_update_pull_table_select', update_pull_table_select );\n\n\t\tfunction disable_table_migration_options() {\n\t\t\t$( '#migrate-selected' ).parents( '.option-section' ).children( '.header-expand-collapse' ).children( '.expand-collapse-arrow' ).removeClass( 'collapsed' );\n\t\t\t$( '.table-select-wrap' ).show();\n\t\t\t$( '#migrate-only-with-prefix' ).prop( 'checked', false );\n\t\t\t$( '#migrate-selected' ).prop( 'checked', true );\n\t\t\t$( '.table-migrate-options' ).hide();\n\t\t\t$( '.select-tables-wrap' ).show();\n\t\t}\n\n\t\t$.wpmdb.add_action( 'wpmdb_disable_table_migration_options', disable_table_migration_options );\n\n\t\tfunction enable_table_migration_options() {\n\t\t\t$( '.table-migrate-options' ).show();\n\t\t}\n\n\t\t$.wpmdb.add_action( 'wpmdb_enable_table_migration_options', enable_table_migration_options );\n\n\t\tfunction select_all_tables() {\n\t\t\t$( '#select-tables' ).children( 'option' ).prop( 'selected', true );\n\t\t\t$( '#select-tables' ).change();\n\t\t}\n\n\t\t$.wpmdb.add_action( 'wpmdb_select_all_tables', select_all_tables );\n\n\t\tfunction base_old_url( value, args ) {\n\t\t\treturn globals.remove_protocol( wpmdb_data.this_url );\n\t\t}\n\n\t\t$.wpmdb.add_filter( 'wpmdb_base_old_url', base_old_url );\n\n\t\t// automatically validate connection info if we're loading a saved profile\n\t\tglobals.establish_remote_connection_from_saved_profile();\n\n\t\t// add to <a> tags which act as JS event buttons, will not jump page to top and will deselect the button\n\t\t$( 'body' ).on( 'click', '.js-action-link', function( e ) {\n\t\t\te.preventDefault();\n\t\t\t$( this ).blur();\n\t\t} );\n\n\t\t$( '.licence-input' ).keypress( function( e ) {\n\t\t\tif ( 13 === e.which ) {\n\t\t\t\te.preventDefault();\n\t\t\t\t$( '.register-licence' ).click();\n\t\t\t}\n\t\t} );\n\n\t\t// registers your licence\n\t\t$( 'body' ).on( 'click', '.register-licence', function( e ) {\n\t\t\te.preventDefault();\n\n\t\t\tif ( globals.doing_licence_registration_ajax ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar licence_key = $.trim( $( '.licence-input' ).val() );\n\t\t\tvar $licence_status = $( '.licence-status' );\n\n\t\t\t$licence_status.removeClass( 'notification-message error-notice success-notice' );\n\n\t\t\tif ( '' === licence_key ) {\n\t\t\t\t$licence_status.html( '<div class=\"notification-message error-notice\">' + wpmdb_strings.enter_license_key + '</div>' );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$licence_status.empty().removeClass( 'success' );\n\t\t\tglobals.doing_licence_registration_ajax = true;\n\t\t\t$( '.button.register-licence' ).after( '<img src=\"' + globals.spinner_url + '\" alt=\"\" class=\"register-licence-ajax-spinner general-spinner\" />' );\n\n\t\t\t$.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'POST',\n\t\t\t\tdataType: 'JSON',\n\t\t\t\tcache: false,\n\t\t\t\tdata: {\n\t\t\t\t\taction: 'wpmdb_activate_licence',\n\t\t\t\t\tlicence_key: licence_key,\n\t\t\t\t\tnonce: wpmdb_data.nonces.activate_licence,\n\t\t\t\t\tcontext: 'licence'\n\t\t\t\t},\n\t\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\t\tglobals.doing_licence_registration_ajax = false;\n\t\t\t\t\t$( '.register-licence-ajax-spinner' ).remove();\n\t\t\t\t\t$licence_status.html( wpmdb_strings.register_license_problem );\n\t\t\t\t},\n\t\t\t\tsuccess: function( data ) {\n\t\t\t\t\t$( '.register-licence-ajax-spinner' ).remove();\n\n\t\t\t\t\tif ( 'undefined' !== typeof data.errors ) {\n\t\t\t\t\t\tvar msg = '';\n\t\t\t\t\t\tfor ( var key in data.errors ) {\n\t\t\t\t\t\t\tmsg += data.errors[ key ];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$licence_status.html( msg );\n\n\t\t\t\t\t\tif ( 'undefined' !== typeof data.masked_licence ) {\n\t\t\t\t\t\t\tglobals.enable_pro_licence( data, licence_key );\n\t\t\t\t\t\t\t$( '.migrate-tab .invalid-licence' ).hide();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if ( 'undefined' !== typeof data.wpmdb_error && 'undefined' !== typeof data.body ) {\n\t\t\t\t\t\t$licence_status.html( data.body );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( 1 === Number( data.is_first_activation ) ) {\n\t\t\t\t\t\t\twpmdb_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' );\n\t\t\t\t\t\t\twpmdb_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\n\t\t\t\t\t\t\t$licence_status.after(\n\t\t\t\t\t\t\t\t'<div id=\"welcome-wrap\">' +\n\t\t\t\t\t\t\t\t'<img id=\"welcome-img\" src=\"' + wpmdb_data.this_plugin_url + 'asset/dist/img/mdb-banner.svg\" />' +\n\t\t\t\t\t\t\t\t'<div class=\"welcome-text\">' +\n\t\t\t\t\t\t\t\t'<h3>' + wpmdb_strings.welcome_title + '</h3>' +\n\t\t\t\t\t\t\t\t'<p>' + wpmdb_strings.welcome_text + '</p>' +\n\t\t\t\t\t\t\t\t'</div>' +\n\t\t\t\t\t\t\t\t'</div>'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$licence_status.html( wpmdb_strings.license_registered ).delay( 5000 ).fadeOut( 1000, function() {\n\t\t\t\t\t\t\t$( this ).css( { visibility: 'hidden', display: 'block' } ).slideUp();\n\t\t\t\t\t\t} );\n\t\t\t\t\t\t$licence_status.addClass( 'success notification-message success-notice' );\n\t\t\t\t\t\tglobals.enable_pro_licence( data, licence_key );\n\t\t\t\t\t\t$( '.invalid-licence' ).hide();\n\t\t\t\t\t}\n\n\t\t\t\t\tglobals.doing_licence_registration_ajax = false;\n\t\t\t\t}\n\t\t\t} );\n\n\t\t} );\n\n\t\t// clears the debug log\n\t\t$( '.clear-log' ).click( function() {\n\t\t\t$( '.ajax-spinner, .ajax-success-msg' ).remove();\n\t\t\t$( this ).after( globals.ajax_spinner );\n\t\t\t$( '.debug-log-textarea' ).val( '' );\n\t\t\t$.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'POST',\n\t\t\t\tdataType: 'text',\n\t\t\t\tcache: false,\n\t\t\t\tdata: {\n\t\t\t\t\taction: 'wpmdb_clear_log',\n\t\t\t\t\tnonce: wpmdb_data.nonces.clear_log\n\t\t\t\t},\n\t\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\t\t$( '.ajax-spinner' ).remove();\n\t\t\t\t\talert( wpmdb_strings.clear_log_problem );\n\t\t\t\t},\n\t\t\t\tsuccess: function( data ) {\n\t\t\t\t\t$( '.ajax-spinner, .ajax-success-msg' ).remove();\n\t\t\t\t\tglobals.refresh_debug_log();\n\t\t\t\t\t$( '.clear-log' ).after( '<span class=\"ajax-success-msg\">' + wpmdb_strings.clear_error_log + '</span>' );\n\t\t\t\t\t$( '.ajax-success-msg' ).fadeOut( 2000, function() {\n\t\t\t\t\t\t$( this ).remove();\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\n\t\t// select all tables\n\t\t$( '.multiselect-select-all' ).click( function() {\n\t\t\tvar multiselect = $( this ).parents( '.select-wrap' ).children( '.multiselect' );\n\t\t\t$( 'option', multiselect ).prop( 'selected', 1 );\n\t\t\t$( multiselect ).focus().trigger( 'change' );\n\t\t} );\n\n\t\t// deselect all tables\n\t\t$( '.multiselect-deselect-all' ).click( function() {\n\t\t\tvar multiselect = $( this ).parents( '.select-wrap' ).children( '.multiselect' );\n\t\t\t$( 'option', multiselect ).removeAttr( 'selected' );\n\t\t\t$( multiselect ).focus().trigger( 'change' );\n\t\t} );\n\n\t\t// invert table selection\n\t\t$( '.multiselect-invert-selection' ).click( function() {\n\t\t\tvar multiselect = $( this ).parents( '.select-wrap' ).children( '.multiselect' );\n\t\t\t$( 'option', multiselect ).each( function() {\n\t\t\t\t$( this ).attr( 'selected', !$( this ).attr( 'selected' ) );\n\t\t\t} );\n\t\t\t$( multiselect ).focus().trigger( 'change' );\n\t\t} );\n\n\t\t// on option select hide all \"advanced\" option divs and show the correct div for the option selected\n\t\t$( '.option-group input[type=radio]' ).change( function() {\n\t\t\tvar group = $( this ).closest( '.option-group' );\n\t\t\t$( 'ul', group ).hide();\n\t\t\tvar parent = $( this ).closest( 'li' );\n\t\t\t$( 'ul', parent ).show();\n\t\t} );\n\n\t\t// on page load, expand hidden divs for selected options (browser form cache)\n\t\t$( '.option-group' ).each( function() {\n\t\t\t$( '.option-group input[type=radio]' ).each( function() {\n\t\t\t\tif ( $( this ).is( ':checked' ) ) {\n\t\t\t\t\tvar parent = $( this ).closest( 'li' );\n\t\t\t\t\t$( 'ul', parent ).show();\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\n\t\t// expand and collapse content on click\n\t\t$( '.header-expand-collapse' ).click( function() {\n\t\t\tvar target = null;\n\n\t\t\tif ( undefined !== $( this ).data( 'next' ) ) {\n\t\t\t\ttarget = $( this ).data( 'next' );\n\t\t\t}\n\n\t\t\tif ( $( '.expand-collapse-arrow', this ).hasClass( 'collapsed' ) ) {\n\t\t\t\t$( '.expand-collapse-arrow', this ).removeClass( 'collapsed' );\n\t\t\t\tif ( target ) {\n\t\t\t\t\t$( target ).show();\n\t\t\t\t} else {\n\t\t\t\t\t$( this ).next().show();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$( '.expand-collapse-arrow', this ).addClass( 'collapsed' );\n\t\t\t\tif ( target ) {\n\t\t\t\t\t$( target ).hide();\n\t\t\t\t} else {\n\t\t\t\t\t$( this ).next().hide();\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\t$( '.checkbox-label input[type=checkbox]' ).change( function() {\n\t\t\tif ( $( this ).is( ':checked' ) ) {\n\t\t\t\t$( this ).parent().next().show();\n\t\t\t} else {\n\t\t\t\t$( this ).parent().next().hide();\n\t\t\t}\n\t\t} );\n\n\t\t// warning for excluding post types\n\t\t$( '.select-post-types-wrap' ).on( 'change', '#select-post-types', function() {\n\t\t\twpmdb.functions.exclude_post_types_warning();\n\t\t} );\n\n\t\tif ( $( '#exclude-post-types' ).is( ':checked' ) ) {\n\t\t\tif ( $( '#select-post-types' ).val() ) {\n\t\t\t\t$( '.exclude-post-types-warning' ).css( { display: 'block', opacity: 1 } );\n\t\t\t}\n\t\t}\n\n\t\t// special expand and collapse content on click for save migration profile\n\t\t$( '#save-migration-profile' ).change( function() {\n\t\t\twpmdb.functions.update_migrate_button_text();\n\t\t\tif ( $( this ).is( ':checked' ) ) {\n\t\t\t\t$( '.save-settings-button' ).show();\n\t\t\t} else {\n\t\t\t\t$( '.save-settings-button' ).hide();\n\t\t\t}\n\t\t} );\n\n\t\tif ( $( '#save-migration-profile' ).is( ':checked' ) ) {\n\t\t\t$( '.save-settings-button' ).show();\n\t\t}\n\n\t\t$( '.create-new-profile' ).focus( function() {\n\t\t\t$( '#create_new' ).prop( 'checked', true );\n\t\t} );\n\n\t\t$( '.checkbox-label input[type=checkbox]' ).each( function() {\n\t\t\tif ( $( this ).is( ':checked' ) ) {\n\t\t\t\t$( this ).parent().next().show();\n\t\t\t}\n\t\t} );\n\n\t\t// AJAX migrate button\n\t\t$( '.migrate-db-button' ).click( function( event ) {\n\t\t\t$( this ).blur();\n\n\t\t\tevent.preventDefault();\n\t\t\twpmdb.migration_state_id = '';\n\n\t\t\tif ( false === $.wpmdb.apply_filters( 'wpmdb_migration_profile_ready', true ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( true === wpmdb.functions.maybe_show_select_table_notice() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar new_url_missing = false;\n\t\t\tvar new_file_path_missing = false;\n\t\t\tif ( $( '#new-url' ).length && !$( '#new-url' ).val() ) {\n\t\t\t\t$( '#new-url-missing-warning' ).show();\n\t\t\t\t$( '#new-url' ).focus();\n\t\t\t\t$( 'html,body' ).scrollTop( 0 );\n\t\t\t\tnew_url_missing = true;\n\t\t\t}\n\n\t\t\tif ( $( '#new-path' ).length && !$( '#new-path' ).val() ) {\n\t\t\t\t$( '#new-path-missing-warning' ).show();\n\t\t\t\tif ( false === new_url_missing ) {\n\t\t\t\t\t$( '#new-path' ).focus();\n\t\t\t\t\t$( 'html,body' ).scrollTop( 0 );\n\t\t\t\t}\n\t\t\t\tnew_file_path_missing = true;\n\t\t\t}\n\n\t\t\tif ( true === new_url_missing || true === new_file_path_missing ) {\n\t\t\t\tif ( 'import' === wpmdb.functions.wpmdb_migration_type() ) {\n\t\t\t\t\tif ( $( '#import-find-replace' ).is( ':checked' ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// also save profile\n\t\t\tif ( $( '#save-migration-profile' ).is( ':checked' ) ) {\n\t\t\t\tglobals.save_active_profile();\n\t\t\t}\n\n\t\t\tglobals.form_data = $( $( '#migrate-form' )[ 0 ].elements ).not( '.auth-credentials' ).serialize();\n\n\t\t\tglobals.migration_intent = wpmdb.functions.wpmdb_migration_type();\n\n\t\t\tglobals.stage = 'backup';\n\n\t\t\tif ( 'savefile' === globals.migration_intent ) {\n\t\t\t\tglobals.stage = 'migrate';\n\t\t\t}\n\n\t\t\tif ( false === $( '#create-backup' ).is( ':checked' ) ) {\n\t\t\t\tif ( -1 !== $.inArray( globals.migration_intent, [ 'savefile', 'push', 'pull' ] ) ) {\n\t\t\t\t\tglobals.stage = 'migrate';\n\t\t\t\t} else if ( 'import' === globals.migration_intent ) {\n\t\t\t\t\tglobals.stage = 'upload';\n\t\t\t\t} else {\n\t\t\t\t\tglobals.stage = globals.migration_intent;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twpmdb.current_migration = wpmdb.migration_progress_controller.newMigration( {\n\t\t\t\tlocalTableSizes: wpmdb_data.this_table_sizes,\n\t\t\t\tlocalTableRows: wpmdb_data.this_table_rows,\n\t\t\t\tremoteTableSizes: 'undefined' !== typeof wpmdb.common.connection_data ? wpmdb.common.connection_data.table_sizes : null,\n\t\t\t\tremoteTableRows: 'undefined' !== typeof wpmdb.common.connection_data ? wpmdb.common.connection_data.table_rows : null,\n\t\t\t\tmigrationIntent: wpmdb.functions.wpmdb_migration_type()\n\t\t\t} );\n\n\t\t\tvar backup_option = $( 'input[name=backup_option]:checked' ).val();\n\t\t\tvar table_option = $( 'input[name=table_migrate_option]:checked' ).val();\n\t\t\tvar selected_tables = '';\n\t\t\tvar data_type = '';\n\n\t\t\t// set up backup stage\n\t\t\tif ( 'backup' === globals.stage ) {\n\t\t\t\tif ( 'migrate_only_with_prefix' === table_option && 'backup_selected' === backup_option && 'import' !== globals.migration_intent ) {\n\t\t\t\t\tbackup_option = 'backup_only_with_prefix';\n\t\t\t\t}\n\t\t\t\tif ( 'push' === globals.migration_intent ) {\n\t\t\t\t\tdata_type = 'remote';\n\t\t\t\t\tif ( 'backup_only_with_prefix' === backup_option ) {\n\t\t\t\t\t\tglobals.tables_to_migrate = wpmdb.common.connection_data.prefixed_tables;\n\t\t\t\t\t} else if ( 'backup_selected' === backup_option ) {\n\t\t\t\t\t\tselected_tables = $( '#select-tables' ).val();\n\t\t\t\t\t\tselected_tables = $.wpmdb.apply_filters( 'wpmdb_backup_selected_tables', selected_tables );\n\t\t\t\t\t\tglobals.tables_to_migrate = globals.get_intersect( selected_tables, wpmdb.common.connection_data.tables );\n\t\t\t\t\t} else if ( 'backup_manual_select' === backup_option ) {\n\t\t\t\t\t\tglobals.tables_to_migrate = $( '#select-backup' ).val();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tdata_type = 'local';\n\t\t\t\t\tif ( 'backup_only_with_prefix' === backup_option ) {\n\t\t\t\t\t\tglobals.tables_to_migrate = wpmdb_data.this_prefixed_tables;\n\t\t\t\t\t} else if ( 'backup_selected' === backup_option ) {\n\t\t\t\t\t\tselected_tables = $( '#select-tables' ).val();\n\t\t\t\t\t\tselected_tables = $.wpmdb.apply_filters( 'wpmdb_backup_selected_tables', selected_tables );\n\t\t\t\t\t\tglobals.tables_to_migrate = globals.get_intersect( selected_tables, wpmdb_data.this_tables );\n\t\t\t\t\t} else if ( 'backup_manual_select' === backup_option ) {\n\t\t\t\t\t\tglobals.tables_to_migrate = $( '#select-backup' ).val();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\twpmdb.current_migration.model.addStage( 'backup', globals.tables_to_migrate, data_type, {\n\t\t\t\t\tstrings: {\n\t\t\t\t\t\tmigrated: wpmdb_strings.backed_up\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t// set up migration stage\n\t\t\tif ( 'pull' === globals.migration_intent ) {\n\t\t\t\tdata_type = 'remote';\n\t\t\t} else {\n\t\t\t\tdata_type = 'local';\n\t\t\t}\n\n\t\t\tif ( 'find_replace' === globals.migration_intent ) {\n\t\t\t\twpmdb.current_migration.model.addStage( 'find_replace', wpmdb.functions.get_tables_to_migrate( null, null ), data_type, {\n\t\t\t\t\tstrings: {\n\t\t\t\t\t\tmigrated: wpmdb_strings.searched,\n\t\t\t\t\t\tstage_title: wpmdb_strings.migrate_button_find_replace\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} else if ( -1 !== $.inArray( globals.migration_intent, [ 'savefile', 'push', 'pull' ] ) ) {\n\t\t\t\twpmdb.current_migration.model.addStage( 'migrate', wpmdb.functions.get_tables_to_migrate( null, null ), data_type );\n\t\t\t}\n\n\t\t\t// add any additional migration stages via hook\n\t\t\t$.wpmdb.do_action( 'wpmdb_add_migration_stages', {\n\t\t\t\tdata_type: data_type,\n\t\t\t\ttables_to_migrate: wpmdb.functions.get_tables_to_migrate( null, null )\n\t\t\t} );\n\n\t\t\tvar table_intent = $( 'input[name=table_migrate_option]:checked' ).val();\n\t\t\tvar connection_info = $.trim( $( '.pull-push-connection-info' ).val() ).split( '\\n' );\n\t\t\tvar table_rows = '';\n\n\t\t\tglobals.remote_site = connection_info[ 0 ];\n\t\t\tglobals.secret_key = connection_info[ 1 ];\n\n\t\t\tvar static_migration_label = globals.get_migration_status_label( globals.remote_site, globals.migration_intent, 'migrating' );\n\t\t\tglobals.completed_msg = globals.get_migration_status_label( globals.remote_site, globals.migration_intent, 'completed' );\n\n\t\t\tif ( -1 !== $.inArray( globals.stage, [ 'find_replace', 'backup', 'migrate' ] ) ) {\n\t\t\t\tglobals.tables_to_migrate = wpmdb.current_migration.model.getStageItems( globals.stage, 'name' );\n\t\t\t}\n\n\t\t\twpmdb.current_migration.model.setActiveStage( globals.stage );\n\n\t\t\twpmdb.current_migration.setTitle( static_migration_label );\n\n\t\t\twpmdb.current_migration.startTimer();\n\n\t\t\tglobals.currently_migrating = true;\n\t\t\twpmdb.current_migration.setStatus( 'active' );\n\n\t\t\tvar request_data = {\n\t\t\t\taction: 'wpmdb_initiate_migration',\n\t\t\t\tintent: globals.migration_intent,\n\t\t\t\turl: globals.remote_site,\n\t\t\t\tkey: globals.secret_key,\n\t\t\t\tform_data: globals.form_data,\n\t\t\t\tstage: globals.stage,\n\t\t\t\tnonce: wpmdb_data.nonces.initiate_migration\n\t\t\t};\n\n\t\t\trequest_data.site_details = {\n\t\t\t\tlocal: wpmdb_data.site_details\n\t\t\t};\n\n\t\t\tif ( -1 !== $.inArray( globals.migration_intent, [ 'push', 'pull' ] ) ) {\n\t\t\t\trequest_data.temp_prefix = wpmdb.common.connection_data.temp_prefix;\n\t\t\t\trequest_data.site_details.remote = wpmdb.common.connection_data.site_details;\n\t\t\t}\n\n\t\t\t// site_details can have a very large number of elements that blows out PHP's max_input_vars\n\t\t\t// so we reduce it down to one variable for this one POST.\n\t\t\trequest_data.site_details = JSON.stringify( request_data.site_details );\n\n\t\t\trequest_data = $.wpmdb.apply_filters( 'wpmdb_initiate_migration_request_data', request_data, request_data );\n\n\t\t\tglobals.doing_ajax = true;\n\n\t\t\t$.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'POST',\n\t\t\t\tdataType: 'json',\n\t\t\t\tcache: false,\n\t\t\t\tdata: request_data,\n\t\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\n\t\t\t\t\twpmdb.current_migration.setState( wpmdb_strings.migration_failed, globals.get_ajax_errors( jqXHR.responseText, '(#112)', jqXHR ), 'error' );\n\n\t\t\t\t\tconsole.log( jqXHR );\n\t\t\t\t\tconsole.log( textStatus );\n\t\t\t\t\tconsole.log( errorThrown );\n\t\t\t\t\tglobals.doing_ajax = false;\n\t\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\t\twpmdb.functions.migration_complete_events();\n\n\t\t\t\t},\n\t\t\t\tsuccess: function( data ) {\n\t\t\t\t\tglobals.doing_ajax = false;\n\t\t\t\t\tif ( 'undefined' !== typeof data && 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error ) {\n\t\t\t\t\t\twpmdb.common.migration_error = true;\n\t\t\t\t\t\twpmdb.functions.migration_complete_events();\n\t\t\t\t\t\twpmdb.current_migration.setState( wpmdb_strings.migration_failed, data.body, 'error' );\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\twpmdb.migration_state_id = data.migration_state_id;\n\n\t\t\t\t\tvar i = 0;\n\n\t\t\t\t\t// Set delay between requests - use max of local/remote values, 0 if doing export\n\t\t\t\t\tglobals.delay_between_requests = 0;\n\t\t\t\t\tif ( 'savefile' !== globals.migration_intent && 'undefined' !== typeof wpmdb.common.connection_data && 'undefined' !== typeof wpmdb.common.connection_data.delay_between_requests || 'import' === globals.migration_intent ) {\n\t\t\t\t\t\tif ( 'import' === globals.migration_intent ) {\n\t\t\t\t\t\t\tglobals.delay_between_requests = wpmdb_data.delay_between_requests;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tglobals.delay_between_requests = Math.max( parseInt( wpmdb_data.delay_between_requests ), parseInt( wpmdb.common.connection_data.delay_between_requests ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( -1 !== $.inArray( globals.migration_intent, [ 'savefile', 'push', 'pull', 'find_replace' ] ) ) {\n\t\t\t\t\t\twpmdb.common.next_step_in_migration = {\n\t\t\t\t\t\t\tfn: wpmdb.functions.migrate_table_recursive,\n\t\t\t\t\t\t\targs: [ '-1', '']\n\t\t\t\t\t\t};\n\t\t\t\t\t\twpmdb.functions.execute_next_step();\n\t\t\t\t\t}\n\n\t\t\t\t\t$.wpmdb.do_action( 'wpmdb_migration_initiated', globals.stage );\n\t\t\t\t}\n\n\t\t\t} ); // end ajax\n\n\t\t} );\n\n\t\tglobals.update_migrate_button_text();\n\n\t\t// close progress pop up once migration is completed\n\t\t$( 'body' ).on( 'click', '.close-progress-content-button', function( e ) {\n\t\t\tglobals.hide_overlay();\n\t\t\twpmdb.current_migration.restoreTitleElem();\n\t\t\twpmdb.functions.maybe_reload_page();\n\t\t} );\n\n\t\t$( 'body' ).on( 'click', '#overlay', function( e ) {\n\t\t\tif ( true === globals.migration_completed && e.target === this ) {\n\t\t\t\tglobals.hide_overlay();\n\t\t\t\twpmdb.current_migration.restoreTitleElem();\n\t\t\t\twpmdb.functions.maybe_reload_page();\n\t\t\t}\n\t\t} );\n\n\t\t// AJAX save button profile\n\t\t$( '.save-settings-button' ).click( function( event ) {\n\t\t\tevent.preventDefault();\n\t\t\tif ( '' === $.trim( $( '.create-new-profile' ).val() ) && $( '#create_new' ).is( ':checked' ) ) {\n\t\t\t\talert( wpmdb_strings.enter_name_for_profile );\n\t\t\t\t$( '.create-new-profile' ).focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tglobals.save_active_profile();\n\t\t} );\n\n\t\t// move around textarea depending on whether or not the push/pull options are selected\n\t\tglobals.move_connection_info_box();\n\n\t\t$( '.migrate-selection.option-group input[type=radio]' ).change( function() {\n\t\t\tglobals.move_connection_info_box();\n\t\t\twpmdb.migration_selection = wpmdb.functions.wpmdb_migration_type();\n\t\t\tif ( globals.connection_established ) {\n\t\t\t\tglobals.change_replace_values();\n\t\t\t}\n\t\t\twpmdb.functions.update_migrate_button_text();\n\t\t} );\n\n\t\t// hide second section if pull or push is selected with no connection established\n\t\tif ( ( 'pull' === wpmdb.functions.wpmdb_migration_type() || 'push' === wpmdb.functions.wpmdb_migration_type() ) && !globals.connection_established ) {\n\t\t\t$( '.step-two' ).hide();\n\t\t\t$( '.connection-status' ).show();\n\t\t}\n\n\t\t// show / hide GUID helper description\n\t\t$( '.general-helper' ).click( function( e ) {\n\t\t\te.preventDefault();\n\t\t\tvar icon = $( this ),\n\t\t\t\tbubble = $( this ).next();\n\n\t\t\t// Close any that are already open\n\t\t\t$( '.helper-message' ).not( bubble ).hide();\n\n\t\t\tvar position = icon.position();\n\t\t\tif ( bubble.hasClass( 'bottom' ) ) {\n\t\t\t\tvar bubble_offset = 1;\n\n\t\t\t\tif ( true === bubble.hasClass( 'compatibility-help' ) ) {\n\t\t\t\t\tbubble_offset = 6;\n\t\t\t\t} else if ( $( this ).is( ':first-child' ) ) {\n\t\t\t\t\tbubble_offset = 3;\n\t\t\t\t}\n\t\t\t\tbubble.css( {\n\t\t\t\t\tleft: ( ( position.left - bubble.width() / 2 ) - bubble_offset ) + 'px',\n\t\t\t\t\ttop: ( position.top + icon.height() + 9 ) + 'px'\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tbubble.css( {\n\t\t\t\t\tleft: ( position.left + icon.width() + 9 ) + 'px',\n\t\t\t\t\ttop: ( position.top + icon.height() / 2 - 18 ) + 'px'\n\t\t\t\t} );\n\t\t\t}\n\t\t\tbubble.toggle();\n\t\t\te.stopPropagation();\n\t\t} );\n\n\t\t$( 'body' ).click( function() {\n\t\t\t$( '.helper-message' ).hide();\n\t\t} );\n\n\t\t$( '.helper-message' ).click( function( e ) {\n\t\t\te.stopPropagation();\n\t\t} );\n\n\t\t$( 'body' ).on( 'click', '.show-errors-toggle', function( e ) {\n\t\t\te.preventDefault();\n\t\t\t$( this ).next( '.migration-php-errors' ).toggle();\n\t\t} );\n\n\t\t// migrate / settings tabs\n\t\t$( '.nav-tab' ).click( function() {\n\t\t\tvar hash = $( this ).attr( 'data-div-name' );\n\t\t\thash = hash.replace( '-tab', '' );\n\t\t\twindow.location.hash = hash;\n\t\t\tglobals.switch_to_plugin_tab( hash, false );\n\t\t} );\n\n\t\t$( 'body' ).on( 'click', 'a[href^=\"#\"]', function( event ) {\n\t\t\tvar href = $( event.target ).attr( 'href' );\n\t\t\tvar tab_name = href.substr( 1 );\n\n\t\t\tif ( tab_name ) {\n\t\t\t\tvar nav_tab = $( '.' + tab_name );\n\t\t\t\tif ( 1 === nav_tab.length ) {\n\t\t\t\t\tnav_tab.trigger( 'click' );\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\t// repeatable fields\n\t\t$( 'body' ).on( 'click', '.add-row', function() {\n\t\t\tvar $parent_tr = $( this ).parents( 'tr' );\n\t\t\t$parent_tr.before( $( '.original-repeatable-field' ).clone().removeClass( 'original-repeatable-field' ) );\n\t\t\t$parent_tr.prev().find( '.old-replace-col input' ).focus();\n\t\t} );\n\n\t\t// repeatable fields\n\t\t$( 'body' ).on( 'click', '.replace-remove-row', function() {\n\t\t\t$( this ).parents( 'tr' ).remove();\n\t\t\tif ( 2 >= $( '.replace-row' ).length ) {\n\t\t\t\t$( '.no-replaces-message' ).show();\n\t\t\t}\n\n\t\t\tvar prev_id = $( this ).prev().attr( 'id' );\n\t\t\tif ( 'new-url' === prev_id || 'new-path' === prev_id ) {\n\t\t\t\t$( '#' + prev_id + '-missing-warning' ).hide();\n\t\t\t}\n\t\t} );\n\n\t\t// Hide New URL & New Path Warnings on change.\n\t\t$( 'body' )\n\t\t\t.on( 'change', '#new-url', function() {\n\t\t\t\t$( '#new-url-missing-warning' ).hide();\n\t\t\t} )\n\t\t\t.on( 'change', '#new-path', function() {\n\t\t\t\t$( '#new-path-missing-warning' ).hide();\n\t\t\t} );\n\n\t\t// Copy Find field to associated Replace field on arrow click.\n\t\t$( 'body' ).on( 'click', '.arrow-col', function() {\n\t\t\tvar replace_row_arrow = this;\n\n\t\t\tif ( $( replace_row_arrow ).hasClass( 'disabled' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar original_value = $( replace_row_arrow ).prev( 'td' ).find( 'input' ).val();\n\t\t\tvar new_value_input = $( replace_row_arrow ).next( 'td' ).find( 'input' );\n\t\t\tnew_value_input.val( original_value );\n\n\t\t\t// Hide New URL or New Path Warning if changed.\n\t\t\tif ( 'new-url' === new_value_input.prop( 'id' ) ) {\n\t\t\t\t$( '#new-url-missing-warning' ).hide();\n\t\t\t} else if ( 'new-path' === new_value_input.prop( 'id' ) ) {\n\t\t\t\t$( '#new-path-missing-warning' ).hide();\n\t\t\t}\n\t\t} );\n\n\t\t$( '.add-replace' ).click( function() {\n\t\t\t$( '.replace-fields' ).prepend( $( '.original-repeatable-field' ).clone().removeClass( 'original-repeatable-field' ) );\n\t\t\t$( '.no-replaces-message' ).hide();\n\t\t} );\n\n\t\t$( '#find-and-replace-sort tbody' ).sortable( {\n\t\t\titems: '> tr:not(.pin)',\n\t\t\thandle: 'td:first',\n\t\t\tstart: function() {\n\t\t\t\t$( '.sort-handle' ).css( 'cursor', '-webkit-grabbing' );\n\t\t\t\t$( '.sort-handle' ).css( 'cursor', '-moz-grabbing' );\n\t\t\t},\n\t\t\tstop: function() {\n\t\t\t\t$( '.sort-handle' ).css( 'cursor', '-webkit-grab' );\n\t\t\t\t$( '.sort-handle' ).css( 'cursor', '-moz-grab' );\n\t\t\t}\n\t\t} );\n\n\t\tvar hash = '';\n\n\t\t// check for hash in url (settings || migrate) switch tabs accordingly\n\t\tif ( window.location.hash ) {\n\t\t\thash = window.location.hash.substring( 1 );\n\t\t\tglobals.switch_to_plugin_tab( hash, false );\n\t\t}\n\n\t\tif ( '' !== globals.get_query_var( 'install-plugin' ) ) {\n\t\t\thash = 'addons';\n\t\t\tglobals.checked_licence = true;\n\t\t\tglobals.switch_to_plugin_tab( hash, true );\n\t\t}\n\n\t\t// process notice links clicks, eg. dismiss, reminder\n\t\t$( '.notice-link' ).click( function( e ) {\n\t\t\te.preventDefault();\n\n\t\t\t// process notice links clicks, eg. dismiss, reminder\n\t\t\twpmdb.functions.ajax_handle_dismissible_notice( wpmdb_data.nonces.process_notice_link, function( ele ) {\n\t\t\t\t$( ele ).closest( '.inline-message' ).hide();\n\t\t\t}, $( this ) );\n\t\t} );\n\n\t\t// When read-only connection info is copied, convert it to one line\n\t\t$( '#connection_info' ).on( 'copy', function( e ) {\n\t\t\tvar $this = $( this );\n\n\t\t\t// Test for two lines\n\t\t\tvar lines = $this.val().split( '\\n' );\n\t\t\tif ( 2 === lines.length ) {\n\n\t\t\t\t// Wrapping in a try in case there's no browser support\n\t\t\t\ttry {\n\n\t\t\t\t\t// Combine the two lines into one\n\t\t\t\t\te.originalEvent.clipboardData.setData( 'text/plain', lines.join( ' ' ) );\n\t\t\t\t\te.preventDefault(); // Default behaviour is to copy any selected text\n\t\t\t\t}\n\t\t\t\tcatch ( err ) {\n\n\t\t\t\t\t// Do nothing. Allow normal copying\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\t// regenerates the saved secret key\n\t\t$( '.reset-api-key' ).click( function() {\n\t\t\tvar answer = confirm( wpmdb_strings.reset_api_key );\n\n\t\t\tif ( !answer || globals.doing_reset_api_key_ajax ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tglobals.doing_reset_api_key_ajax = true;\n\t\t\t$( '.reset-api-key' ).after( '<img src=\"' + globals.spinner_url + '\" alt=\"\" class=\"reset-api-key-ajax-spinner general-spinner\" />' );\n\n\t\t\t$.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'POST',\n\t\t\t\tdataType: 'text',\n\t\t\t\tcache: false,\n\t\t\t\tdata: {\n\t\t\t\t\taction: 'wpmdb_reset_api_key',\n\t\t\t\t\tnonce: wpmdb_data.nonces.reset_api_key\n\t\t\t\t},\n\t\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\t\talert( wpmdb_strings.reset_api_key_problem );\n\t\t\t\t\t$( '.reset-api-key-ajax-spinner' ).remove();\n\t\t\t\t\tglobals.doing_reset_api_key_ajax = false;\n\t\t\t\t},\n\t\t\t\tsuccess: function( data ) {\n\t\t\t\t\t$( '.reset-api-key-ajax-spinner' ).remove();\n\t\t\t\t\tglobals.doing_reset_api_key_ajax = false;\n\t\t\t\t\t$( '.connection-info' ).html( data );\n\t\t\t\t\twpmdb_data.connection_info = $.trim( data ).split( '\\n' );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t} );\n\n\t\t// Copy the connection info to the clipboard\n\t\t$( '.copy-api-key' ).click( function() {\n\n\t\t\tvar $el = $( this );\n\n\t\t\t// Get connection_info input\n\t\t\tvar $connection_info = $( '#connection_info' );\n\n\t\t\t// Get the connection info\n\t\t\tvar two_lines = $connection_info.val();\n\n\t\t\t// Make it one line, if it's two\n\t\t\tvar one_line = two_lines.replace( '\\n', ' ' );\n\n\t\t\t// Replace two lines with one\n\t\t\t$connection_info.val( one_line );\n\n\t\t\t// Select the input val\n\t\t\t$connection_info.select();\n\n\t\t\ttry {\n\n\t\t\t\t// Copy connection_info\n\t\t\t\tdocument.execCommand( 'copy' );\n\n\t\t\t\t// Unselect connection_info input\n\t\t\t\t$connection_info.blur();\n\n\t\t\t\t// show confirmation\n\t\t\t\t$el.css( 'color', 'transparent' );\n\t\t\t\tvar $confirmation = $( '.copy-api-key-confirmation' ).show();\n\n\t\t\t\t// fadeout confirmation\n\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t$confirmation.fadeOut( 'fast' );\n\t\t\t\t\tsetTimeout( function() {\n\t\t\t\t\t\t$el.css( 'color', '' );\n\t\t\t\t\t}, 200 );\n\n\t\t\t\t}, 1000 );\n\t\t\t}\n\t\t\tcatch ( err ) {\n\t\t\t\talert( 'please press Ctrl/Cmd+C to copy' );\n\t\t\t}\n\n\t\t\t// Replace the input val with the two lines\n\t\t\t$connection_info.val( two_lines );\n\t\t} );\n\n\t\t$( 'input[name=table_migrate_option]' ).change( function() {\n\t\t\t$( '.select-tables-wrap' ).hide();\n\n\t\t\tif ( 'migrate_select' === $( this ).val() ) {\n\t\t\t\t$( '.select-tables-wrap' ).show();\n\t\t\t}\n\t\t} );\n\n\t\t$( '.show-multiselect' ).each( function() {\n\t\t\tif ( $( this ).is( ':checked' ) ) {\n\t\t\t\t$( this ).parents( '.option-section' ).children( '.header-expand-collapse' ).children( '.expand-collapse-arrow' ).removeClass( 'collapsed' );\n\t\t\t\t$( this ).parents( '.expandable-content' ).show();\n\t\t\t\t$( this ).parents( '.expandable-content' ).children( '.select-wrap' ).toggle();\n\t\t\t}\n\t\t} );\n\n\t\t$( 'input[name=backup_option]' ).change( function() {\n\t\t\t$( '.backup-tables-wrap' ).hide();\n\t\t\tif ( 'backup_manual_select' === $( this ).val() ) {\n\t\t\t\t$( '.backup-tables-wrap' ).show();\n\t\t\t}\n\t\t} );\n\n\t\tif ( $( '#backup-manual-select' ).is( ':checked' ) ) {\n\t\t\t$( '.backup-tables-wrap' ).show();\n\t\t}\n\n\t\t$( '.plugin-compatibility-save' ).click( function() {\n\t\t\tif ( globals.doing_plugin_compatibility_ajax ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$( this ).addClass( 'disabled' );\n\t\t\tvar select_element = $( '#selected-plugins' );\n\t\t\t$( select_element ).attr( 'disabled', 'disabled' );\n\n\t\t\t$( '.plugin-compatibility-success-msg' ).remove();\n\n\t\t\tglobals.doing_plugin_compatibility_ajax = true;\n\t\t\t$( this ).after( '<img src=\"' + globals.spinner_url + '\" alt=\"\" class=\"plugin-compatibility-spinner general-spinner\" />' );\n\n\t\t\t$.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'POST',\n\t\t\t\tdataType: 'text',\n\t\t\t\tcache: false,\n\t\t\t\tdata: {\n\t\t\t\t\taction: 'wpmdb_whitelist_plugins',\n\t\t\t\t\twhitelist_plugins: $( select_element ).val(),\n\t\t\t\t\tnonce: wpmdb_data.nonces.whitelist_plugins\n\t\t\t\t},\n\t\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\t\talert( 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 );\n\t\t\t\t\t$( select_element ).removeAttr( 'disabled' );\n\t\t\t\t\t$( '.plugin-compatibility-save' ).removeClass( 'disabled' );\n\t\t\t\t\tglobals.doing_plugin_compatibility_ajax = false;\n\t\t\t\t\t$( '.plugin-compatibility-spinner' ).remove();\n\t\t\t\t},\n\t\t\t\tsuccess: function( data ) {\n\t\t\t\t\tif ( '' !== $.trim( data ) ) {\n\t\t\t\t\t\talert( data );\n\t\t\t\t\t}\n\t\t\t\t\t$( select_element ).removeAttr( 'disabled' );\n\t\t\t\t\t$( '.plugin-compatibility-save' ).removeClass( 'disabled' );\n\t\t\t\t\tglobals.doing_plugin_compatibility_ajax = false;\n\t\t\t\t\t$( '.plugin-compatibility-spinner' ).remove();\n\t\t\t\t\t$( '.plugin-compatibility-save' ).after( '<span class=\"plugin-compatibility-success-msg\">' + wpmdb_strings.saved + '</span>' );\n\t\t\t\t\t$( '.plugin-compatibility-success-msg' ).fadeOut( 2000 );\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\n\t\t// delete a profile from the migrate form area\n\t\t$( 'body' ).on( 'click', '.delete-profile', function() {\n\t\t\tvar name = $( this ).next().clone();\n\t\t\t$( 'input', name ).remove();\n\t\t\tname = $.trim( $( name ).html() );\n\t\t\tvar answer = confirm( wpmdb_strings.remove_profile.replace( '{{profile}}', name ) );\n\n\t\t\tif ( !answer ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar $profile_li = $( this ).parent();\n\n\t\t\tif ( $profile_li.find( 'input:checked' ).length ) {\n\t\t\t\tvar $new_profile_li = $profile_li.siblings().last();\n\t\t\t\t$new_profile_li.find( 'input[type=radio]' ).prop( 'checked', 'checked' );\n\t\t\t\t$new_profile_li.find( 'input[type=text]' ).focus();\n\t\t\t\t$( '#migrate-form .crumbs .crumb:last' ).text( 'New Profile' );\n\n\t\t\t\tif ( 'function' === typeof window.history.pushState ) {\n\t\t\t\t\tvar updated_url = window.location.href.replace( '#migrate', '' ).replace( /&wpmdb-profile=-?\\d+/, '' ) + '&wpmdb-profile=-1';\n\t\t\t\t\twindow.history.pushState( { updated_profile_id: -1 }, null, updated_url );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$profile_li.fadeOut( 500 );\n\n\t\t\t$.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'POST',\n\t\t\t\tdataType: 'text',\n\t\t\t\tcache: false,\n\t\t\t\tdata: {\n\t\t\t\t\taction: 'wpmdb_delete_migration_profile',\n\t\t\t\t\tprofile_id: $( this ).attr( 'data-profile-id' ),\n\t\t\t\t\tnonce: wpmdb_data.nonces.delete_migration_profile\n\t\t\t\t},\n\t\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\t\talert( wpmdb_strings.remove_profile_problem );\n\t\t\t\t},\n\t\t\t\tsuccess: function( data ) {\n\t\t\t\t\tif ( '-1' === data ) {\n\t\t\t\t\t\talert( wpmdb_strings.remove_profile_not_found );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\n\t\t} );\n\n\t\t// deletes a profile from the main profile selection screen\n\t\t$( '.main-list-delete-profile-link' ).click( function() {\n\t\t\tvar name = $( this ).prev().html();\n\t\t\tvar answer = confirm( wpmdb_strings.remove_profile.replace( '{{profile}}', name ) );\n\n\t\t\tif ( !answer ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$( this ).parent().fadeOut( 500 );\n\n\t\t\t$.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'POST',\n\t\t\t\tdataType: 'text',\n\t\t\t\tcache: false,\n\t\t\t\tdata: {\n\t\t\t\t\taction: 'wpmdb_delete_migration_profile',\n\t\t\t\t\tprofile_id: $( this ).attr( 'data-profile-id' ),\n\t\t\t\t\tnonce: wpmdb_data.nonces.delete_migration_profile\n\t\t\t\t},\n\t\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\t\talert( wpmdb_strings.remove_profile_problem );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t} );\n\n\t\t// warn the user when editing the connection info after a connection has been established\n\t\t$( 'body' ).on( 'click', '.temp-disabled', function() {\n\t\t\tvar answer = confirm( wpmdb_strings.change_connection_info );\n\n\t\t\tif ( answer ) {\n\t\t\t\t$( '.ssl-notice' ).hide();\n\t\t\t\t$( '.different-plugin-version-notice' ).hide();\n\t\t\t\t$( '.migrate-db-button' ).show();\n\t\t\t\t$( '.temp-disabled' ).removeAttr( 'readonly' );\n\t\t\t\t$( '.temp-disabled' ).removeClass( 'temp-disabled' );\n\t\t\t\t$( '.connect-button' ).show();\n\t\t\t\t$( '.step-two' ).hide();\n\t\t\t\t$( '.connection-status' ).show().html( wpmdb_strings.enter_connection_info );\n\t\t\t\tglobals.connection_established = false;\n\t\t\t}\n\t\t} );\n\n\t\t// ajax request for settings page when checking/unchecking setting radio buttons\n\t\t$( '.settings-tab input[type=checkbox]' ).change( function() {\n\t\t\tif ( 'plugin-compatibility' === $( this ).attr( 'id' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar checked = $( this ).is( ':checked' );\n\t\t\tvar setting = $( this ).attr( 'id' );\n\t\t\tvar $status = $( this ).closest( 'td' ).next( 'td' ).find( '.setting-status' );\n\n\t\t\t$( '.ajax-success-msg' ).remove();\n\t\t\t$status.after( globals.ajax_spinner );\n\n\t\t\t$.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'POST',\n\t\t\t\tdataType: 'text',\n\t\t\t\tcache: false,\n\t\t\t\tdata: {\n\t\t\t\t\taction: 'wpmdb_save_setting',\n\t\t\t\t\tchecked: checked,\n\t\t\t\t\tsetting: setting,\n\t\t\t\t\tnonce: wpmdb_data.nonces.save_setting\n\t\t\t\t},\n\t\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\t\talert( wpmdb_strings.save_settings_problem );\n\t\t\t\t\t$( '.ajax-spinner' ).remove();\n\t\t\t\t},\n\t\t\t\tsuccess: function( data ) {\n\t\t\t\t\t$( '.ajax-spinner' ).remove();\n\t\t\t\t\t$status.append( '<span class=\"ajax-success-msg\">' + wpmdb_strings.saved + '</span>' );\n\t\t\t\t\t$( '.ajax-success-msg' ).fadeOut( 2000, function() {\n\t\t\t\t\t\t$( this ).remove();\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t} );\n\n\t\t// disable form submissions\n\t\t$( '.migrate-form' ).submit( function( e ) {\n\t\t\te.preventDefault();\n\t\t} );\n\n\t\t// fire connection_box_changed when the connect button is pressed\n\t\t$( '.connect-button' ).click( function( event ) {\n\t\t\tevent.preventDefault();\n\t\t\t$( this ).blur();\n\t\t\twpmdb.functions.connection_box_changed();\n\t\t} );\n\n\t\t// send paste even to connection_box_changed() function\n\t\t$( '.pull-push-connection-info' ).bind( 'paste', function( e ) {\n\t\t\tvar $this = this;\n\t\t\tsetTimeout( function() {\n\t\t\t\twpmdb.functions.connection_box_changed();\n\t\t\t}, 0 );\n\n\t\t} );\n\n\t\t$( 'body' ).on( 'click', '.try-again', function() {\n\t\t\t$( '.pull-push-connection-info' ).removeClass( 'temp-disabled' );\n\t\t\twpmdb.functions.connection_box_changed();\n\t\t} );\n\n\t\t$( 'body' ).on( 'click', '.try-http', function() {\n\t\t\tvar connection_info = $.trim( $( '.pull-push-connection-info' ).val() ).split( '\\n' );\n\t\t\tvar new_url = connection_info[ 0 ].replace( 'https', 'http' );\n\t\t\tvar new_contents = new_url + '\\n' + connection_info[ 1 ];\n\t\t\t$( '.pull-push-connection-info' ).val( new_contents );\n\t\t\twpmdb.functions.connection_box_changed();\n\t\t} );\n\n\t\t$( '.create-new-profile' ).change( function() {\n\t\t\tglobals.profile_name_edited = true;\n\t\t} );\n\n\t\t$( 'body' ).on( 'click', '.temporarily-disable-ssl', function() {\n\t\t\tvar hash = '';\n\t\t\tif ( window.location.hash ) {\n\t\t\t\thash = window.location.hash.substring( 1 );\n\t\t\t}\n\t\t\t$( this ).attr( 'href', $( this ).attr( 'href' ) + '&hash=' + hash );\n\t\t} );\n\n\t\t// Sets the initial Pause/Resume button event to Pause\n\t\t$( 'body' ).on( 'click', '.pause-resume', function( event ) {\n\t\t\tglobals.set_pause_resume_button( event );\n\t\t} );\n\n\t\t$( 'body' ).on( 'click', '.cancel', function( event ) {\n\t\t\tglobals.cancel_migration( event );\n\t\t} );\n\n\t\t$( '.enter-licence' ).click( function() {\n\t\t\t$( '.settings' ).click();\n\t\t\t$( '.licence-input' ).focus();\n\t\t} );\n\n\t\t$( 'body' ).on( 'click', '.copy-licence-to-remote-site', function() {\n\t\t\t$( '.connection-status' ).html( wpmdb_strings.copying_license );\n\t\t\t$( '.connection-status' ).removeClass( 'notification-message error-notice migration-error' );\n\t\t\t$( '.connection-status' ).append( globals.ajax_spinner );\n\n\t\t\tvar connection_info = $.trim( $( '.pull-push-connection-info' ).val() ).split( '\\n' );\n\n\t\t\tglobals.doing_ajax = true;\n\t\t\tglobals.disable_export_type_controls();\n\n\t\t\t$.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'POST',\n\t\t\t\tdataType: 'json',\n\t\t\t\tcache: false,\n\t\t\t\tdata: {\n\t\t\t\t\taction: 'wpmdb_copy_licence_to_remote_site',\n\t\t\t\t\turl: connection_info[ 0 ],\n\t\t\t\t\tkey: connection_info[ 1 ],\n\t\t\t\t\tnonce: wpmdb_data.nonces.copy_licence_to_remote_site\n\t\t\t\t},\n\t\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\t\t$( '.connection-status' ).html( globals.get_ajax_errors( jqXHR.responseText, '(#143)', jqXHR ) );\n\t\t\t\t\t$( '.connection-status' ).addClass( 'notification-message error-notice migration-error' );\n\t\t\t\t\t$( '.ajax-spinner' ).remove();\n\t\t\t\t\tglobals.doing_ajax = false;\n\t\t\t\t\tglobals.enable_export_type_controls();\n\t\t\t\t},\n\t\t\t\tsuccess: function( data ) {\n\t\t\t\t\t$( '.ajax-spinner' ).remove();\n\t\t\t\t\tglobals.doing_ajax = false;\n\t\t\t\t\tglobals.enable_export_type_controls();\n\n\t\t\t\t\tif ( 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error ) {\n\t\t\t\t\t\t$( '.connection-status' ).html( data.body );\n\t\t\t\t\t\t$( '.connection-status' ).addClass( 'notification-message error-notice migration-error' );\n\n\t\t\t\t\t\tif ( data.body.indexOf( '401 Unauthorized' ) > -1 ) {\n\t\t\t\t\t\t\t$( '.basic-access-auth-wrapper' ).show();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\twpmdb.functions.connection_box_changed();\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\n\t\t$( 'body' ).on( 'click', '.reactivate-licence', function( e ) {\n\t\t\tglobals.doing_ajax = true;\n\n\t\t\t$( '.invalid-licence' ).empty().html( wpmdb_strings.attempting_to_activate_licence );\n\t\t\t$( '.invalid-licence' ).append( globals.ajax_spinner );\n\n\t\t\t$.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\ttype: 'POST',\n\t\t\t\tdataType: 'json',\n\t\t\t\tcache: false,\n\t\t\t\tdata: {\n\t\t\t\t\taction: 'wpmdb_reactivate_licence',\n\t\t\t\t\tnonce: wpmdb_data.nonces.reactivate_licence\n\t\t\t\t},\n\t\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\t\t$( '.invalid-licence' ).html( wpmdb_strings.activate_licence_problem );\n\t\t\t\t\t$( '.invalid-licence' ).append( '<br /><br />' + wpmdb_strings.status + ': ' + jqXHR.status + ' ' + jqXHR.statusText + '<br /><br />' + wpmdb_strings.response + '<br />' + jqXHR.responseText );\n\t\t\t\t\t$( '.ajax-spinner' ).remove();\n\t\t\t\t\tglobals.doing_ajax = false;\n\t\t\t\t},\n\t\t\t\tsuccess: function( data ) {\n\t\t\t\t\t$( '.ajax-spinner' ).remove();\n\t\t\t\t\tglobals.doing_ajax = false;\n\n\t\t\t\t\tif ( 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error ) {\n\t\t\t\t\t\t$( '.invalid-licence' ).html( data.body );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( 'undefined' !== typeof data.wpmdb_dbrains_api_down && 1 === data.wpmdb_dbrains_api_down ) {\n\t\t\t\t\t\t$( '.invalid-licence' ).html( wpmdb_strings.temporarily_activated_licence );\n\t\t\t\t\t\t$( '.invalid-licence' ).append( data.body );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t$( '.invalid-licence' ).empty().html( wpmdb_strings.licence_reactivated );\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}\n\t\t\t} );\n\n\t\t} );\n\n\t\t$( 'input[name=table_migrate_option]' ).change( function() {\n\t\t\tglobals.maybe_show_mixed_cased_table_name_warning();\n\t\t\t$.wpmdb.do_action( 'wpmdb_tables_to_migrate_changed' );\n\t\t} );\n\n\t\t$( 'body' ).on( 'change', '#select-tables', function() {\n\t\t\tglobals.maybe_show_mixed_cased_table_name_warning();\n\t\t\t$.wpmdb.do_action( 'wpmdb_tables_to_migrate_changed' );\n\t\t} );\n\n\t\t$.wpmdb.add_filter( 'wpmdb_get_table_prefix', globals.get_table_prefix );\n\t\t$.wpmdb.add_filter( 'wpmdb_get_tables_to_migrate', wpmdb.functions.get_tables_to_migrate );\n\t\t$.wpmdb.add_action( 'wpmdb_lock_replace_url', globals.lock_replace_url );\n\t\t$.wpmdb.add_action( 'wpmdb_pin_replace_url', globals.pin_replace_url );\n\t\t$.wpmdb.add_action( 'move_connection_info_box', wpmdb.functions.exclude_post_types_warning );\n\n\t\t$.wpmdb.add_filter( 'wpmdb_before_migration_complete_hooks', function( hooks ) {\n\t\t\tglobals.pause_before_finalize = !!$( 'input[name=pause_before_finalize]:checked' ).length;\n\t\t\tif ( true === globals.pause_before_finalize && 'savefile' !== globals.migration_intent ) {\n\t\t\t\tglobals.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\n\t\t\t\twindow.is_auto_pause_before_finalize = true;\n\t\t\t}\n\t\t\treturn hooks;\n\t\t} );\n\n\t\t$( '.wpmdb-switch' ).on( 'click', function( e ) {\n\t\t\tif ( !$( this ).hasClass( 'disabled' ) ) {\n\t\t\t\tglobals.set_checkbox( $( this ).attr( 'id' ) );\n\t\t\t}\n\t\t} );\n\n\t\t$( '#beta_optin-wrap' ).on( 'click', function( e ) {\n\t\t\tvar switch_on = $( this ).find( 'span.on' ).hasClass( 'checked' );\n\t\t\tif ( switch_on ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( !wpmdb_data.is_beta_plugins_installed ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar answer = confirm( wpmdb_strings.rollback_beta_to_stable );\n\n\t\t\tif ( !answer ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\twindow.location = wpmdb_data.rollback_to_stable_url;\n\t\t} );\n\n\t} );\n})( jQuery, wpmdb );\n\n\n\n// WEBPACK FOOTER //\n// ./src/wp-migrate-db-pro/asset/src/js/script.js","// allow enable/disable of usage tracking from non-dismissable notice\njQuery( function() {\n\tjQuery('.wpmdb-opt-usage-tracking').on( 'click', function(e) {\n\t\te.preventDefault();\n\t\tvar optIn = e.target.classList.contains('opt-yes') ? true : false\n\n\t\tjQuery('.wpmdb-usage-tracking-notice .links').text( (optIn) ? \"Thanks!\" : \"Done.\" );\n\t\tjQuery('.wpmdb-usage-tracking-notice').delay(1000).fadeOut(200);\n\n\t\tvar $switch = jQuery('#allow_tracking-wrap');\n\t\tif( optIn ) {\n\t\t\tif( ! $switch.hasClass('on') ) {\n\t\t\t\t$switch.trigger('click');\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tif( $switch.hasClass('on') ) {\n\t\t\t\t$switch.trigger('click');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t$switch.find('input[type=checkbox]').trigger('change');\n\t} );\n});\n\n\n\n// WEBPACK FOOTER //\n// ./src/wp-migrate-db-pro/asset/src/js/usage-tracking-notice.js","/*** IMPORTS FROM imports-loader ***/\nvar $ = window.jQuery;\n\n// removed by extract-text-webpack-plugin\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/imports-loader?$=>window.jQuery!./src/wp-migrate-db-pro/asset/src/sass/_migration-progress.scss\n// module id = 29\n// module chunks = 0","/*** IMPORTS FROM imports-loader ***/\nvar $ = window.jQuery;\n\n// removed by extract-text-webpack-plugin\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/imports-loader?$=>window.jQuery!./src/wp-migrate-db-pro/asset/src/sass/_progress-upgrade.scss\n// module id = 30\n// module chunks = 0","/*** IMPORTS FROM imports-loader ***/\nvar $ = window.jQuery;\n\n// removed by extract-text-webpack-plugin\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/imports-loader?$=>window.jQuery!./src/wp-migrate-db-pro/asset/src/sass/plugin-update-styles.scss\n// module id = 31\n// module chunks = 0","/*** IMPORTS FROM imports-loader ***/\nvar $ = window.jQuery;\n\n// removed by extract-text-webpack-plugin\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/imports-loader?$=>window.jQuery!./src/wp-migrate-db-pro/asset/src/sass/styles.scss\n// module id = 32\n// module chunks = 0"],"sourceRoot":""}
|
asset/dist/css/styles.css
DELETED
@@ -1 +0,0 @@
|
|
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/js/script-102.js
DELETED
@@ -1,5310 +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 |
-
'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>' + ' — ';
|
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(/\{"/g, '{#q!#').replace(/\"}/g, '#q!#}').replace(/,"/g, ',#q!#').replace(/":/g, '#q!#:').replace(/:"/g, ':#q!#').replace(/"/g, '\\"').replace(/#q!#/g, '"').replace(/>/g, '>').replace(/</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> ');
|
2771 |
-
}
|
2772 |
-
|
2773 |
-
return label.replace(/\%s(\S*)\s?/, '<span class=domain-label>' + domain + '$1</span> ');
|
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 + ' <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]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
asset/dist/js/script-102.min.js
DELETED
@@ -1 +0,0 @@
|
|
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> — "),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(/\{"/g,"{#q!#").replace(/\"}/g,"#q!#}").replace(/,"/g,",#q!#").replace(/":/g,"#q!#:").replace(/:"/g,":#q!#").replace(/"/g,'\\"').replace(/#q!#/g,'"').replace(/>/g,">").replace(/</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> "):s.replace(/\%s(\S*)\s?/,"<span class=domain-label>"+c+"$1</span> ")),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+=' <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
@@ -14,7 +14,6 @@ class WPMDB_Base {
|
|
14 |
protected $dbrains_api_url;
|
15 |
protected $transient_timeout;
|
16 |
protected $transient_retry_timeout;
|
17 |
-
protected $dbrains_api_base = 'https://api.deliciousbrains.com';
|
18 |
protected $dbrains_api_status_url = 'http://s3.amazonaws.com/cdn.deliciousbrains.com/status.json';
|
19 |
protected $multipart_boundary = 'bWH4JVmYCnf6GfXacrcc';
|
20 |
protected $attempting_to_connect_to;
|
@@ -37,9 +36,10 @@ class WPMDB_Base {
|
|
37 |
public $mu_plugin_dest;
|
38 |
public $filesystem;
|
39 |
|
|
|
|
|
40 |
function __construct( $plugin_file_path ) {
|
41 |
$this->load_settings();
|
42 |
-
$this->maybe_schema_update();
|
43 |
|
44 |
$this->plugin_file_path = $plugin_file_path;
|
45 |
$this->plugin_dir_path = plugin_dir_path( $plugin_file_path );
|
@@ -72,6 +72,7 @@ class WPMDB_Base {
|
|
72 |
}
|
73 |
|
74 |
add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
|
|
|
75 |
|
76 |
// in case admin_init isn't run (tests/cli), we'll just instantiate the fs class without wpfs and allow it to be overwritten when/if admin_init is run
|
77 |
if ( class_exists( 'WPMDB_Filesystem' ) ) {
|
@@ -80,6 +81,7 @@ class WPMDB_Base {
|
|
80 |
}
|
81 |
|
82 |
// List of properties that can be accessed by the get() method
|
|
|
83 |
$this->gettable_properties = array(
|
84 |
'settings',
|
85 |
'plugin_base',
|
@@ -88,6 +90,7 @@ class WPMDB_Base {
|
|
88 |
'error',
|
89 |
'state_data',
|
90 |
'is_pro',
|
|
|
91 |
);
|
92 |
|
93 |
//Setup strings for license responses
|
@@ -207,6 +210,7 @@ class WPMDB_Base {
|
|
207 |
$migration_state_id = $this->state_data[ $state_key ];
|
208 |
}
|
209 |
|
|
|
210 |
if ( true !== $this->get_migration_state( $migration_state_id ) ) {
|
211 |
exit;
|
212 |
}
|
@@ -245,15 +249,19 @@ class WPMDB_Base {
|
|
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.
|
249 |
),
|
250 |
'wp-migrate-db-pro-cli/wp-migrate-db-pro-cli.php' => array(
|
251 |
'name' => 'CLI',
|
252 |
-
'required_version' => '1.3.
|
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 |
|
@@ -262,15 +270,7 @@ class WPMDB_Base {
|
|
262 |
$this->transient_timeout = 60 * 60 * 12;
|
263 |
$this->transient_retry_timeout = 60 * 60 * 2;
|
264 |
|
265 |
-
|
266 |
-
$this->dbrains_api_base = DBRAINS_API_BASE;
|
267 |
-
}
|
268 |
-
|
269 |
-
if ( $this->open_ssl_enabled() == false ) {
|
270 |
-
$this->dbrains_api_base = str_replace( 'https://', 'http://', $this->dbrains_api_base );
|
271 |
-
}
|
272 |
-
|
273 |
-
$this->dbrains_api_url = $this->dbrains_api_base . '/?wc-api=delicious-brains';
|
274 |
|
275 |
// allow developers to change the temporary prefix applied to the tables
|
276 |
$this->temp_prefix = apply_filters( 'wpmdb_temporary_prefix', $this->temp_prefix );
|
@@ -281,6 +281,20 @@ class WPMDB_Base {
|
|
281 |
add_action( 'wpmdb_notices', array( $this, 'version_update_notice' ) );
|
282 |
}
|
283 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
/**
|
285 |
* Loads the settings into the settings class property, sets some defaults if no existing settings are found.
|
286 |
*/
|
@@ -316,6 +330,7 @@ class WPMDB_Base {
|
|
316 |
'delay_between_requests' => 0,
|
317 |
'prog_tables_hidden' => true,
|
318 |
'pause_before_finalize' => false,
|
|
|
319 |
);
|
320 |
|
321 |
// if we still don't have settings exist this must be a fresh install, set up some default settings
|
@@ -365,7 +380,7 @@ class WPMDB_Base {
|
|
365 |
|
366 |
function template( $template, $dir = '', $args = array() ) {
|
367 |
global $wpdb;
|
368 |
-
// TODO: Refactor to remove extract().
|
369 |
extract( $args, EXTR_OVERWRITE );
|
370 |
$dir = ( ! empty( $dir ) ) ? trailingslashit( $dir ) : $dir;
|
371 |
include $this->template_dir . $dir . $template . '.php';
|
@@ -481,7 +496,6 @@ class WPMDB_Base {
|
|
481 |
* @return bool|null
|
482 |
*/
|
483 |
public function handle_remote_post_response( $response, $url, $scope, $expecting_serial, $state_data = array() ) {
|
484 |
-
|
485 |
if ( is_wp_error( $response ) ) {
|
486 |
if ( 0 === strpos( $url, 'https://' ) && 'ajax_verify_connection_to_remote_site' == $scope ) {
|
487 |
return true;
|
@@ -564,7 +578,7 @@ class WPMDB_Base {
|
|
564 |
}
|
565 |
} else {
|
566 |
|
567 |
-
$url =
|
568 |
|
569 |
$this->error = sprintf( __( 'A response was expected from the remote, instead we got nothing. (#146 - scope: %1$s) Please review %2$s for possible solutions.', 'wp-migrate-db' ), $scope, sprintf( '<a href="%s" target="_blank">%s</a>', $url, __( 'our documentation', 'wp-migrate-db' ) ) );
|
570 |
}
|
@@ -664,10 +678,21 @@ class WPMDB_Base {
|
|
664 |
$error .= 'WPMDB Error: ' . $wpmdb_error . "\n\n";
|
665 |
|
666 |
if ( ! empty( $this->attempting_to_connect_to ) ) {
|
667 |
-
$
|
|
|
668 |
}
|
669 |
|
670 |
if ( $additional_error_var !== false ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
671 |
$error .= print_r( $additional_error_var, true ) . "\n\n";
|
672 |
}
|
673 |
|
@@ -716,6 +741,19 @@ class WPMDB_Base {
|
|
716 |
return false;
|
717 |
}
|
718 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
719 |
function filter_post_elements( $post_array, $accepted_elements ) {
|
720 |
$accepted_elements[] = 'sig';
|
721 |
|
@@ -780,7 +818,6 @@ class WPMDB_Base {
|
|
780 |
if ( false !== get_site_transient( 'wpmdb_temporarily_disable_ssl' ) && 0 === strpos( $this->dbrains_api_url, 'https://' ) ) {
|
781 |
$url = substr_replace( $url, 'http', 0, 5 );
|
782 |
}
|
783 |
-
|
784 |
return $url;
|
785 |
}
|
786 |
|
@@ -1117,7 +1154,14 @@ class WPMDB_Base {
|
|
1117 |
return $response;
|
1118 |
}
|
1119 |
|
1120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1121 |
if ( preg_match( '@b[0-9]+$@', $ver ) ) {
|
1122 |
return true;
|
1123 |
}
|
@@ -1125,6 +1169,29 @@ class WPMDB_Base {
|
|
1125 |
return false;
|
1126 |
}
|
1127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1128 |
function get_required_version( $slug ) {
|
1129 |
$plugin_file = sprintf( '%1$s/%1$s.php', $slug );
|
1130 |
|
@@ -1142,26 +1209,30 @@ class WPMDB_Base {
|
|
1142 |
return false;
|
1143 |
}
|
1144 |
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
}
|
1151 |
|
1152 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1153 |
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
&& isset( $data[ $slug ]['beta_version'] )
|
1159 |
-
&& version_compare( $data[ $slug ]['version'], $data[ $slug ]['beta_version'], '<' )
|
1160 |
-
) {
|
1161 |
-
return $data[ $slug ]['beta_version'];
|
1162 |
}
|
1163 |
|
1164 |
-
return $data[ $slug ]['
|
1165 |
}
|
1166 |
|
1167 |
function get_upgrade_data() {
|
@@ -1326,7 +1397,11 @@ class WPMDB_Base {
|
|
1326 |
|
1327 |
if ( version_compare( $installed_version, $latest_version, '<' ) ) { ?>
|
1328 |
<div style="display: block;" class="updated warning inline-message">
|
1329 |
-
|
|
|
|
|
|
|
|
|
1330 |
<?php printf( __( '%1$s %2$s is now available. You currently have %3$s installed. <a href="%4$s">%5$s</a>', 'wp-migrate-db' ), $this->plugin_title, $latest_version, $installed_version, $update_url, _x( 'Update Now', 'Download and install a new version of the plugin', 'wp-migrate-db' ) ); ?>
|
1331 |
</div>
|
1332 |
<?php
|
@@ -1452,7 +1527,7 @@ class WPMDB_Base {
|
|
1452 |
$message = $this->get_contextual_message_string( $messages, 'connection_failed', $message_context );
|
1453 |
|
1454 |
if ( defined( 'WP_HTTP_BLOCK_EXTERNAL' ) && WP_HTTP_BLOCK_EXTERNAL ) {
|
1455 |
-
$url_parts = $this->parse_url( $this->
|
1456 |
$host = $url_parts['host'];
|
1457 |
if ( ! defined( 'WP_ACCESSIBLE_HOSTS' ) || strpos( WP_ACCESSIBLE_HOSTS, $host ) === false ) {
|
1458 |
$message = sprintf( $this->get_contextual_message_string( $messages, 'http_block_external', $message_context ), esc_attr( $host ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/wp_http_block_external/?utm_campaign=error%2Bmessages&utm_source=MDB%2BPaid&utm_medium=insideplugin' );
|
@@ -1589,9 +1664,9 @@ class WPMDB_Base {
|
|
1589 |
$suhosin_limit = min( wp_convert_hr_to_bytes( $suhosin_request_limit ), wp_convert_hr_to_bytes( $suhosin_post_limit ) );
|
1590 |
}
|
1591 |
|
1592 |
-
// we have to account for HTTP headers and other bloating, here we minus 1kb for bloat
|
1593 |
$post_max_upper_size = apply_filters( 'wpmdb_post_max_upper_size', 26214400 );
|
1594 |
|
|
|
1595 |
$calculated_bottleneck = min( ( $this->get_post_max_size() - 1024 ), $post_max_upper_size );
|
1596 |
|
1597 |
if( 0 >= $calculated_bottleneck ) {
|
@@ -1750,7 +1825,11 @@ class WPMDB_Base {
|
|
1750 |
/**
|
1751 |
* Performs a schema update if required.
|
1752 |
*/
|
1753 |
-
function maybe_schema_update() {
|
|
|
|
|
|
|
|
|
1754 |
$schema_version = get_site_option( 'wpmdb_schema_version' );
|
1755 |
$update_schema = false;
|
1756 |
|
@@ -1782,6 +1861,18 @@ class WPMDB_Base {
|
|
1782 |
$schema_version = 1;
|
1783 |
}
|
1784 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1785 |
if ( true === $update_schema ) {
|
1786 |
update_site_option( 'wpmdb_schema_version', $schema_version );
|
1787 |
}
|
@@ -1917,7 +2008,7 @@ class WPMDB_Base {
|
|
1917 |
*
|
1918 |
* @return string
|
1919 |
*/
|
1920 |
-
function get_caller_function() {
|
1921 |
list( , , $caller ) = debug_backtrace( false );
|
1922 |
|
1923 |
if ( ! empty( $caller['function'] ) ) {
|
@@ -1929,6 +2020,24 @@ class WPMDB_Base {
|
|
1929 |
return $caller;
|
1930 |
}
|
1931 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1932 |
/**
|
1933 |
* Scramble string.
|
1934 |
*
|
@@ -1938,7 +2047,7 @@ class WPMDB_Base {
|
|
1938 |
*/
|
1939 |
function scramble( $input ) {
|
1940 |
if ( ! empty( $input ) ) {
|
1941 |
-
$input = 'WPMDB-SCRAMBLED' . str_rot13( $input );
|
1942 |
}
|
1943 |
|
1944 |
return $input;
|
@@ -1956,7 +2065,7 @@ class WPMDB_Base {
|
|
1956 |
if ( 0 === strpos( $input, 'WPMDB-SCRAMBLED' ) ) {
|
1957 |
// If the string begins with WPMDB-SCRAMBED we can unscramble.
|
1958 |
// As the scrambled string could be multiple segments of scrambling (from stow) we remove indicators in one go.
|
1959 |
-
$input = str_replace( 'WPMDB-SCRAMBLED', '', $input );
|
1960 |
$input = str_rot13( $input );
|
1961 |
} elseif ( false !== strpos( $input, 'WPMDB-SCRAMBLED' ) ) {
|
1962 |
// Starts with non-scrambled data (error), but with scrambled string following.
|
@@ -2203,6 +2312,8 @@ class WPMDB_Base {
|
|
2203 |
'is_subdomain_install' => esc_html( ( is_multisite() && is_subdomain_install() ) ? 'true' : 'false' ),
|
2204 |
);
|
2205 |
|
|
|
|
|
2206 |
return $site_details;
|
2207 |
}
|
2208 |
|
@@ -2253,4 +2364,42 @@ class WPMDB_Base {
|
|
2253 |
|
2254 |
return $bytes;
|
2255 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2256 |
}
|
14 |
protected $dbrains_api_url;
|
15 |
protected $transient_timeout;
|
16 |
protected $transient_retry_timeout;
|
|
|
17 |
protected $dbrains_api_status_url = 'http://s3.amazonaws.com/cdn.deliciousbrains.com/status.json';
|
18 |
protected $multipart_boundary = 'bWH4JVmYCnf6GfXacrcc';
|
19 |
protected $attempting_to_connect_to;
|
36 |
public $mu_plugin_dest;
|
37 |
public $filesystem;
|
38 |
|
39 |
+
const DBRAINS_API_BASE = 'https://api.deliciousbrains.com';
|
40 |
+
|
41 |
function __construct( $plugin_file_path ) {
|
42 |
$this->load_settings();
|
|
|
43 |
|
44 |
$this->plugin_file_path = $plugin_file_path;
|
45 |
$this->plugin_dir_path = plugin_dir_path( $plugin_file_path );
|
72 |
}
|
73 |
|
74 |
add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
|
75 |
+
add_action( 'admin_init', array( $this, 'maybe_schema_update' ) );
|
76 |
|
77 |
// in case admin_init isn't run (tests/cli), we'll just instantiate the fs class without wpfs and allow it to be overwritten when/if admin_init is run
|
78 |
if ( class_exists( 'WPMDB_Filesystem' ) ) {
|
81 |
}
|
82 |
|
83 |
// List of properties that can be accessed by the get() method
|
84 |
+
//@TODO this needs to be refactored
|
85 |
$this->gettable_properties = array(
|
86 |
'settings',
|
87 |
'plugin_base',
|
90 |
'error',
|
91 |
'state_data',
|
92 |
'is_pro',
|
93 |
+
'default_profile'
|
94 |
);
|
95 |
|
96 |
//Setup strings for license responses
|
210 |
$migration_state_id = $this->state_data[ $state_key ];
|
211 |
}
|
212 |
|
213 |
+
// Always pass migration_state_id or $state_key with every AJAX request
|
214 |
if ( true !== $this->get_migration_state( $migration_state_id ) ) {
|
215 |
exit;
|
216 |
}
|
249 |
$this->addons = array(
|
250 |
'wp-migrate-db-pro-media-files/wp-migrate-db-pro-media-files.php' => array(
|
251 |
'name' => 'Media Files',
|
252 |
+
'required_version' => '1.4.10',
|
253 |
),
|
254 |
'wp-migrate-db-pro-cli/wp-migrate-db-pro-cli.php' => array(
|
255 |
'name' => 'CLI',
|
256 |
+
'required_version' => '1.3.3',
|
257 |
),
|
258 |
'wp-migrate-db-pro-multisite-tools/wp-migrate-db-pro-multisite-tools.php' => array(
|
259 |
'name' => 'Multisite Tools',
|
260 |
+
'required_version' => '1.2.1',
|
261 |
+
),
|
262 |
+
'wp-migrate-db-pro-theme-plugin-files/wp-migrate-db-pro-theme-plugin-files.php' => array(
|
263 |
+
'name' => 'Theme & Plugin Files',
|
264 |
+
'required_version' => '1.0',
|
265 |
),
|
266 |
);
|
267 |
|
270 |
$this->transient_timeout = 60 * 60 * 12;
|
271 |
$this->transient_retry_timeout = 60 * 60 * 2;
|
272 |
|
273 |
+
$this->dbrains_api_url = $this->get_dbrains_api_base() . '/?wc-api=delicious-brains';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
|
275 |
// allow developers to change the temporary prefix applied to the tables
|
276 |
$this->temp_prefix = apply_filters( 'wpmdb_temporary_prefix', $this->temp_prefix );
|
281 |
add_action( 'wpmdb_notices', array( $this, 'version_update_notice' ) );
|
282 |
}
|
283 |
|
284 |
+
public function get_dbrains_api_base() {
|
285 |
+
$dbrains_api_base = self::DBRAINS_API_BASE;
|
286 |
+
|
287 |
+
if ( defined( 'DBRAINS_API_BASE' ) ) {
|
288 |
+
$dbrains_api_base = DBRAINS_API_BASE;
|
289 |
+
}
|
290 |
+
|
291 |
+
if ( false === $this->open_ssl_enabled() ) {
|
292 |
+
$dbrains_api_base = str_replace( 'https://', 'http://', $dbrains_api_base );
|
293 |
+
}
|
294 |
+
|
295 |
+
return $dbrains_api_base;
|
296 |
+
}
|
297 |
+
|
298 |
/**
|
299 |
* Loads the settings into the settings class property, sets some defaults if no existing settings are found.
|
300 |
*/
|
330 |
'delay_between_requests' => 0,
|
331 |
'prog_tables_hidden' => true,
|
332 |
'pause_before_finalize' => false,
|
333 |
+
'allow_tracking' => null,
|
334 |
);
|
335 |
|
336 |
// if we still don't have settings exist this must be a fresh install, set up some default settings
|
380 |
|
381 |
function template( $template, $dir = '', $args = array() ) {
|
382 |
global $wpdb;
|
383 |
+
// @TODO: Refactor to remove extract().
|
384 |
extract( $args, EXTR_OVERWRITE );
|
385 |
$dir = ( ! empty( $dir ) ) ? trailingslashit( $dir ) : $dir;
|
386 |
include $this->template_dir . $dir . $template . '.php';
|
496 |
* @return bool|null
|
497 |
*/
|
498 |
public function handle_remote_post_response( $response, $url, $scope, $expecting_serial, $state_data = array() ) {
|
|
|
499 |
if ( is_wp_error( $response ) ) {
|
500 |
if ( 0 === strpos( $url, 'https://' ) && 'ajax_verify_connection_to_remote_site' == $scope ) {
|
501 |
return true;
|
578 |
}
|
579 |
} else {
|
580 |
|
581 |
+
$url = 'https://deliciousbrains.com/wp-migrate-db-pro/doc/a-response-was-expected-from-the-remote/?utm_campaign=error+messages&utm_source=MDB+Paid&utm_medium=insideplugin';
|
582 |
|
583 |
$this->error = sprintf( __( 'A response was expected from the remote, instead we got nothing. (#146 - scope: %1$s) Please review %2$s for possible solutions.', 'wp-migrate-db' ), $scope, sprintf( '<a href="%s" target="_blank">%s</a>', $url, __( 'our documentation', 'wp-migrate-db' ) ) );
|
584 |
}
|
678 |
$error .= 'WPMDB Error: ' . $wpmdb_error . "\n\n";
|
679 |
|
680 |
if ( ! empty( $this->attempting_to_connect_to ) ) {
|
681 |
+
$ip = $this->get_remote_ip( $this->attempting_to_connect_to );
|
682 |
+
$error .= 'Attempted to connect to: ' . $this->attempting_to_connect_to . ' (' . ( $ip ? $ip : 'ip lookup failed' ) . ')' . "\n\n";
|
683 |
}
|
684 |
|
685 |
if ( $additional_error_var !== false ) {
|
686 |
+
|
687 |
+
// don't print the whole response object to the log
|
688 |
+
if ( is_array( $additional_error_var ) && isset( $additional_error_var['http_response'] ) ) {
|
689 |
+
if ( isset( $additional_error_var['http_response'] ) && ( $additional_error_var['http_response'] instanceof WP_HTTP_Requests_Response ) ) {
|
690 |
+
$response = $additional_error_var['http_response']->get_response_object();
|
691 |
+
$additional_error_var['url'] = $response->url;
|
692 |
+
}
|
693 |
+
unset( $additional_error_var['http_response'] );
|
694 |
+
}
|
695 |
+
|
696 |
$error .= print_r( $additional_error_var, true ) . "\n\n";
|
697 |
}
|
698 |
|
741 |
return false;
|
742 |
}
|
743 |
|
744 |
+
function get_remote_ip( $url ) {
|
745 |
+
$parsed_url = WPMDB_Utils::parse_url( $url );
|
746 |
+
if ( ! isset( $parsed_url['host'] ) ) {
|
747 |
+
return false;
|
748 |
+
}
|
749 |
+
// '.' appended to host name to avoid issues with nslookup caching - see documentation of gethostbyname for more info
|
750 |
+
$host = $parsed_url['host'] . '.';
|
751 |
+
|
752 |
+
$ip = gethostbyname( $host );
|
753 |
+
|
754 |
+
return ( $ip === $host ) ? false : $ip;
|
755 |
+
}
|
756 |
+
|
757 |
function filter_post_elements( $post_array, $accepted_elements ) {
|
758 |
$accepted_elements[] = 'sig';
|
759 |
|
818 |
if ( false !== get_site_transient( 'wpmdb_temporarily_disable_ssl' ) && 0 === strpos( $this->dbrains_api_url, 'https://' ) ) {
|
819 |
$url = substr_replace( $url, 'http', 0, 5 );
|
820 |
}
|
|
|
821 |
return $url;
|
822 |
}
|
823 |
|
1154 |
return $response;
|
1155 |
}
|
1156 |
|
1157 |
+
/**
|
1158 |
+
* Is the version a beta version?
|
1159 |
+
*
|
1160 |
+
* @param string $ver
|
1161 |
+
*
|
1162 |
+
* @return bool
|
1163 |
+
*/
|
1164 |
+
public function is_beta_version( $ver ) {
|
1165 |
if ( preg_match( '@b[0-9]+$@', $ver ) ) {
|
1166 |
return true;
|
1167 |
}
|
1169 |
return false;
|
1170 |
}
|
1171 |
|
1172 |
+
/**
|
1173 |
+
* Has tbe beta optin been turned on?
|
1174 |
+
*
|
1175 |
+
* @return bool
|
1176 |
+
*/
|
1177 |
+
public function has_beta_optin() {
|
1178 |
+
if ( ! isset( $this->settings['beta_optin'] ) ) {
|
1179 |
+
return false;
|
1180 |
+
}
|
1181 |
+
|
1182 |
+
return (bool) $this->settings['beta_optin'];
|
1183 |
+
}
|
1184 |
+
|
1185 |
+
/**
|
1186 |
+
* Sets the value of the beta optin setting
|
1187 |
+
*
|
1188 |
+
* @param bool $value
|
1189 |
+
*/
|
1190 |
+
function set_beta_optin( $value = true ) {
|
1191 |
+
$this->settings['beta_optin'] = $value;
|
1192 |
+
update_site_option( 'wpmdb_settings', $this->settings );
|
1193 |
+
}
|
1194 |
+
|
1195 |
function get_required_version( $slug ) {
|
1196 |
$plugin_file = sprintf( '%1$s/%1$s.php', $slug );
|
1197 |
|
1209 |
return false;
|
1210 |
}
|
1211 |
|
1212 |
+
$latest_version = empty ( $data[ $slug ]['version'] ) ? false : $data[ $slug ]['version'];
|
1213 |
+
|
1214 |
+
if ( ! isset( $data[ $slug ]['beta_version'] ) ) {
|
1215 |
+
// No beta version available
|
1216 |
+
return $latest_version;
|
1217 |
}
|
1218 |
|
1219 |
+
if ( version_compare( $data[ $slug ]['version'], $data[ $slug ]['beta_version'], '>' ) ) {
|
1220 |
+
// Stable version greater than the beta
|
1221 |
+
return $latest_version;
|
1222 |
+
}
|
1223 |
+
|
1224 |
+
if ( WPMDB_Beta_Manager::is_rolling_back_plugins() ) {
|
1225 |
+
// We are in the process of rolling back to stable versions
|
1226 |
+
return $latest_version;
|
1227 |
+
}
|
1228 |
|
1229 |
+
if ( ! $this->has_beta_optin() ) {
|
1230 |
+
// Not opted in to beta updates
|
1231 |
+
// The required version isn't a beta version
|
1232 |
+
return $latest_version;
|
|
|
|
|
|
|
|
|
1233 |
}
|
1234 |
|
1235 |
+
return $data[ $slug ]['beta_version'];
|
1236 |
}
|
1237 |
|
1238 |
function get_upgrade_data() {
|
1397 |
|
1398 |
if ( version_compare( $installed_version, $latest_version, '<' ) ) { ?>
|
1399 |
<div style="display: block;" class="updated warning inline-message">
|
1400 |
+
<?php if ( $this->is_beta_version( $latest_version ) ) : ?>
|
1401 |
+
<strong><?php _ex( 'Beta Update Available', 'A new version of the plugin is available', 'wp-migrate-db' ); ?></strong> —
|
1402 |
+
<?php else: ?>
|
1403 |
+
<strong><?php _ex( 'Update Available', 'A new version of the plugin is available', 'wp-migrate-db' ); ?></strong> —
|
1404 |
+
<?php endif; ?>
|
1405 |
<?php printf( __( '%1$s %2$s is now available. You currently have %3$s installed. <a href="%4$s">%5$s</a>', 'wp-migrate-db' ), $this->plugin_title, $latest_version, $installed_version, $update_url, _x( 'Update Now', 'Download and install a new version of the plugin', 'wp-migrate-db' ) ); ?>
|
1406 |
</div>
|
1407 |
<?php
|
1527 |
$message = $this->get_contextual_message_string( $messages, 'connection_failed', $message_context );
|
1528 |
|
1529 |
if ( defined( 'WP_HTTP_BLOCK_EXTERNAL' ) && WP_HTTP_BLOCK_EXTERNAL ) {
|
1530 |
+
$url_parts = $this->parse_url( $this->get_dbrains_api_base() );
|
1531 |
$host = $url_parts['host'];
|
1532 |
if ( ! defined( 'WP_ACCESSIBLE_HOSTS' ) || strpos( WP_ACCESSIBLE_HOSTS, $host ) === false ) {
|
1533 |
$message = sprintf( $this->get_contextual_message_string( $messages, 'http_block_external', $message_context ), esc_attr( $host ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/wp_http_block_external/?utm_campaign=error%2Bmessages&utm_source=MDB%2BPaid&utm_medium=insideplugin' );
|
1664 |
$suhosin_limit = min( wp_convert_hr_to_bytes( $suhosin_request_limit ), wp_convert_hr_to_bytes( $suhosin_post_limit ) );
|
1665 |
}
|
1666 |
|
|
|
1667 |
$post_max_upper_size = apply_filters( 'wpmdb_post_max_upper_size', 26214400 );
|
1668 |
|
1669 |
+
// we have to account for HTTP headers and other bloating, here we minus 1kb for bloat
|
1670 |
$calculated_bottleneck = min( ( $this->get_post_max_size() - 1024 ), $post_max_upper_size );
|
1671 |
|
1672 |
if( 0 >= $calculated_bottleneck ) {
|
1825 |
/**
|
1826 |
* Performs a schema update if required.
|
1827 |
*/
|
1828 |
+
public function maybe_schema_update() {
|
1829 |
+
if ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) {
|
1830 |
+
return;
|
1831 |
+
}
|
1832 |
+
|
1833 |
$schema_version = get_site_option( 'wpmdb_schema_version' );
|
1834 |
$update_schema = false;
|
1835 |
|
1861 |
$schema_version = 1;
|
1862 |
}
|
1863 |
|
1864 |
+
if ( $schema_version < 2 ) {
|
1865 |
+
if ( $this->is_beta_version( $this->plugin_version ) ) {
|
1866 |
+
// If the current installed version is a beta version then turn on the beta optin
|
1867 |
+
$this->set_beta_optin();
|
1868 |
+
// Dismiss the notice also, so it won't keep coming back
|
1869 |
+
update_user_meta( get_current_user_id(), 'wpmdb_dismiss_beta_optin', true );
|
1870 |
+
}
|
1871 |
+
|
1872 |
+
$update_schema = true;
|
1873 |
+
$schema_version = 2;
|
1874 |
+
}
|
1875 |
+
|
1876 |
if ( true === $update_schema ) {
|
1877 |
update_site_option( 'wpmdb_schema_version', $schema_version );
|
1878 |
}
|
2008 |
*
|
2009 |
* @return string
|
2010 |
*/
|
2011 |
+
public function get_caller_function() {
|
2012 |
list( , , $caller ) = debug_backtrace( false );
|
2013 |
|
2014 |
if ( ! empty( $caller['function'] ) ) {
|
2020 |
return $caller;
|
2021 |
}
|
2022 |
|
2023 |
+
/**
|
2024 |
+
* Has a specific method been called in the stack trace.
|
2025 |
+
*
|
2026 |
+
* @param string $method
|
2027 |
+
*
|
2028 |
+
* @return bool
|
2029 |
+
*/
|
2030 |
+
public function has_method_been_called( $method ) {
|
2031 |
+
$stack = debug_backtrace();
|
2032 |
+
foreach ( $stack as $caller ) {
|
2033 |
+
if ( $method === $caller['function'] ) {
|
2034 |
+
return true;
|
2035 |
+
}
|
2036 |
+
}
|
2037 |
+
|
2038 |
+
return false;
|
2039 |
+
}
|
2040 |
+
|
2041 |
/**
|
2042 |
* Scramble string.
|
2043 |
*
|
2047 |
*/
|
2048 |
function scramble( $input ) {
|
2049 |
if ( ! empty( $input ) ) {
|
2050 |
+
$input = 'WPMDB-SCRAMBLED' . str_replace( array( '/', '\\' ), array( '%#047%', '%#092%' ), str_rot13( $input ) );
|
2051 |
}
|
2052 |
|
2053 |
return $input;
|
2065 |
if ( 0 === strpos( $input, 'WPMDB-SCRAMBLED' ) ) {
|
2066 |
// If the string begins with WPMDB-SCRAMBED we can unscramble.
|
2067 |
// As the scrambled string could be multiple segments of scrambling (from stow) we remove indicators in one go.
|
2068 |
+
$input = str_replace( array( 'WPMDB-SCRAMBLED', '%#047%', '%#092%' ), array( '', '/', '\\' ), $input );
|
2069 |
$input = str_rot13( $input );
|
2070 |
} elseif ( false !== strpos( $input, 'WPMDB-SCRAMBLED' ) ) {
|
2071 |
// Starts with non-scrambled data (error), but with scrambled string following.
|
2312 |
'is_subdomain_install' => esc_html( ( is_multisite() && is_subdomain_install() ) ? 'true' : 'false' ),
|
2313 |
);
|
2314 |
|
2315 |
+
$site_details = apply_filters( 'wpmdb_site_details', $site_details );
|
2316 |
+
|
2317 |
return $site_details;
|
2318 |
}
|
2319 |
|
2364 |
|
2365 |
return $bytes;
|
2366 |
}
|
2367 |
+
|
2368 |
+
/**
|
2369 |
+
* Verify a remote response is valid
|
2370 |
+
*
|
2371 |
+
* @param mixed $response Response
|
2372 |
+
*
|
2373 |
+
* @return mixed Response if valid, error otherwise
|
2374 |
+
*/
|
2375 |
+
public function verify_remote_post_response( $response ) {
|
2376 |
+
if ( false === $response ) {
|
2377 |
+
$return = array( 'wpmdb_error' => 1, 'body' => $this->error );
|
2378 |
+
$error_msg = 'Failed attempting to verify remote post response (#114mf)';
|
2379 |
+
$this->log_error( $error_msg, $this->error );
|
2380 |
+
$result = $this->end_ajax( json_encode( $return ) );
|
2381 |
+
|
2382 |
+
return $result;
|
2383 |
+
}
|
2384 |
+
|
2385 |
+
if ( ! is_serialized( trim( $response ) ) ) {
|
2386 |
+
$return = array( 'wpmdb_error' => 1, 'body' => $response );
|
2387 |
+
$error_msg = 'Failed as the response is not serialized string (#115mf)';
|
2388 |
+
$this->log_error( $error_msg, $response );
|
2389 |
+
$result = $this->end_ajax( json_encode( $return ) );
|
2390 |
+
|
2391 |
+
return $result;
|
2392 |
+
}
|
2393 |
+
|
2394 |
+
$response = unserialize( trim( $response ) );
|
2395 |
+
|
2396 |
+
if ( isset( $response['wpmdb_error'] ) ) {
|
2397 |
+
$this->log_error( $response['wpmdb_error'], $response );
|
2398 |
+
$result = $this->end_ajax( json_encode( $response ) );
|
2399 |
+
|
2400 |
+
return $result;
|
2401 |
+
}
|
2402 |
+
|
2403 |
+
return $response;
|
2404 |
+
}
|
2405 |
}
|
class/wpmdb-cli.php
CHANGED
@@ -319,6 +319,10 @@ class WPMDB_CLI extends WPMDB_Base {
|
|
319 |
|
320 |
if ( 'find_replace' === $this->profile['action'] ) {
|
321 |
$progress_label = __( 'Running find & replace', 'wp-migrate-db-cli' );
|
|
|
|
|
|
|
|
|
322 |
}
|
323 |
|
324 |
$progress_label = apply_filters( 'wpmdb_cli_progress_label', $progress_label, $stage, $tables );
|
@@ -465,6 +469,10 @@ class WPMDB_CLI extends WPMDB_Base {
|
|
465 |
++$stage_iterator;
|
466 |
$args['stage'] = 'migrate';
|
467 |
|
|
|
|
|
|
|
|
|
468 |
if ( 'import' === $args['intent'] ) {
|
469 |
break;
|
470 |
}
|
319 |
|
320 |
if ( 'find_replace' === $this->profile['action'] ) {
|
321 |
$progress_label = __( 'Running find & replace', 'wp-migrate-db-cli' );
|
322 |
+
|
323 |
+
if ( 1 === $stage ) {
|
324 |
+
$progress_label = __( 'Performing backup', 'wp-migrate-db-cli' );
|
325 |
+
}
|
326 |
}
|
327 |
|
328 |
$progress_label = apply_filters( 'wpmdb_cli_progress_label', $progress_label, $stage, $tables );
|
469 |
++$stage_iterator;
|
470 |
$args['stage'] = 'migrate';
|
471 |
|
472 |
+
if ( 'find_replace' === $args['intent'] ) {
|
473 |
+
$args['stage'] = 'find_replace';
|
474 |
+
}
|
475 |
+
|
476 |
if ( 'import' === $args['intent'] ) {
|
477 |
break;
|
478 |
}
|
class/wpmdb-command.php
CHANGED
@@ -99,6 +99,16 @@ class WPMDB_Command extends WP_CLI_Command {
|
|
99 |
* Should be used in conjunction with the --find=<strings> argument, see it's
|
100 |
* documentation for further explanation of the find & replace functionality.
|
101 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
* [--exclude-post-revisions]
|
103 |
* : Exclude post revisions from the find & replace.
|
104 |
*
|
@@ -195,7 +205,6 @@ class WPMDB_Command extends WP_CLI_Command {
|
|
195 |
WP_CLI::error( WPMDB_CLI::cleanup_message( $result->get_error_message() ) );
|
196 |
}
|
197 |
}
|
198 |
-
|
199 |
}
|
200 |
|
201 |
WP_CLI::add_command( 'migratedb', 'WPMDB_Command' );
|
99 |
* Should be used in conjunction with the --find=<strings> argument, see it's
|
100 |
* documentation for further explanation of the find & replace functionality.
|
101 |
*
|
102 |
+
* [--backup=<prefix|selected|table_one,table_two,table_etc>]
|
103 |
+
* : Perform a backup of the destination site's database tables before replacing it.
|
104 |
+
*
|
105 |
+
* Accepted values:
|
106 |
+
*
|
107 |
+
* * prefix - Backup only tables that begin with your installation's
|
108 |
+
* table prefix (e.g. wp_)
|
109 |
+
* * selected - Backup only tables selected for migration (as in --include-tables)
|
110 |
+
* * A comma separated list of the tables to backup.
|
111 |
+
*
|
112 |
* [--exclude-post-revisions]
|
113 |
* : Exclude post revisions from the find & replace.
|
114 |
*
|
205 |
WP_CLI::error( WPMDB_CLI::cleanup_message( $result->get_error_message() ) );
|
206 |
}
|
207 |
}
|
|
|
208 |
}
|
209 |
|
210 |
WP_CLI::add_command( 'migratedb', 'WPMDB_Command' );
|
class/wpmdb-compatibility.php
CHANGED
@@ -88,7 +88,7 @@ class WPMDB_Compatibility {
|
|
88 |
* Remove TGM Plugin Activation 'force_activation' admin_init action hook if present.
|
89 |
*
|
90 |
* This is to stop excluded plugins being deactivated after a migration, when a theme uses TGMPA to require a
|
91 |
-
* plugin to be always active.
|
92 |
*/
|
93 |
public function wpmdbc_tgmpa_compatibility() {
|
94 |
$remove_function = false;
|
@@ -108,7 +108,7 @@ class WPMDB_Compatibility {
|
|
108 |
foreach ( $admin_init_functions as $priority => $functions ) {
|
109 |
foreach ( $functions as $key => $function ) {
|
110 |
// searching for function this way as can't rely on the calling class being named TGM_Plugin_Activation
|
111 |
-
if ( false !== strpos( $key, 'force_activation' ) ) {
|
112 |
|
113 |
if ( is_array( $wp_filter['admin_init'] ) ) {
|
114 |
// for core versions prior to WP 4.7
|
@@ -220,6 +220,8 @@ class WPMDB_Compatibility {
|
|
220 |
'wpmdb_get_log',
|
221 |
'wpmdb_flush',
|
222 |
'wpmdb_remote_flush',
|
|
|
|
|
223 |
) ) ) {
|
224 |
return false;
|
225 |
}
|
@@ -272,4 +274,4 @@ class WPMDB_Compatibility {
|
|
272 |
|
273 |
return false;
|
274 |
}
|
275 |
-
}
|
88 |
* Remove TGM Plugin Activation 'force_activation' admin_init action hook if present.
|
89 |
*
|
90 |
* This is to stop excluded plugins being deactivated after a migration, when a theme uses TGMPA to require a
|
91 |
+
* plugin to be always active. Also applies to the WDS-Required-Plugins by removing `activate_if_not` action
|
92 |
*/
|
93 |
public function wpmdbc_tgmpa_compatibility() {
|
94 |
$remove_function = false;
|
108 |
foreach ( $admin_init_functions as $priority => $functions ) {
|
109 |
foreach ( $functions as $key => $function ) {
|
110 |
// searching for function this way as can't rely on the calling class being named TGM_Plugin_Activation
|
111 |
+
if ( false !== strpos( $key, 'force_activation' ) || false !== strpos( $key, 'activate_if_not' ) ) {
|
112 |
|
113 |
if ( is_array( $wp_filter['admin_init'] ) ) {
|
114 |
// for core versions prior to WP 4.7
|
220 |
'wpmdb_get_log',
|
221 |
'wpmdb_flush',
|
222 |
'wpmdb_remote_flush',
|
223 |
+
'wpmdb_get_themes',
|
224 |
+
'wpmdb_get_plugins',
|
225 |
) ) ) {
|
226 |
return false;
|
227 |
}
|
274 |
|
275 |
return false;
|
276 |
}
|
277 |
+
}
|
class/wpmdb-filesystem.php
CHANGED
@@ -431,7 +431,12 @@ class WPMDB_Filesystem {
|
|
431 |
*/
|
432 |
public function scandir( $abs_path ) {
|
433 |
|
|
|
|
|
|
|
|
|
434 |
$dirlist = @scandir( $abs_path );
|
|
|
435 |
if ( false === $dirlist ) {
|
436 |
if ( $this->use_filesystem ) {
|
437 |
$abs_path = $this->get_sanitized_path( $abs_path );
|
@@ -446,19 +451,73 @@ class WPMDB_Filesystem {
|
|
446 |
|
447 |
// normalize return to look somewhat like the return value for WP_Filesystem::dirlist
|
448 |
foreach ( $dirlist as $entry ) {
|
449 |
-
if ( '.' === $entry || '..' === $entry ) {
|
450 |
continue;
|
451 |
}
|
452 |
-
|
453 |
-
|
454 |
-
'type' => $this->is_dir( $abs_path . '/' . $entry ) ? 'd' : 'f',
|
455 |
-
);
|
456 |
}
|
457 |
|
458 |
return $return;
|
459 |
|
460 |
}
|
461 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
462 |
/**
|
463 |
* Light wrapper for move_uploaded_file with chmod
|
464 |
*
|
@@ -486,7 +545,7 @@ class WPMDB_Filesystem {
|
|
486 |
* @param string $source_abs_path
|
487 |
* @param string $destination_abs_path
|
488 |
* @param bool $overwrite
|
489 |
-
* @param mixed
|
490 |
*
|
491 |
* @return bool
|
492 |
*
|
@@ -537,7 +596,7 @@ class WPMDB_Filesystem {
|
|
537 |
// Taken in part from WP_Filesystem_Direct
|
538 |
if ( ! $overwrite && $this->file_exists( $destination_abs_path ) ) {
|
539 |
return false;
|
540 |
-
} elseif (
|
541 |
return true;
|
542 |
} else {
|
543 |
if ( $this->copy( $source_abs_path, $destination_abs_path, $overwrite ) && $this->file_exists( $destination_abs_path ) ) {
|
@@ -549,6 +608,8 @@ class WPMDB_Filesystem {
|
|
549 |
}
|
550 |
}
|
551 |
|
|
|
|
|
552 |
if ( ! $return && $this->use_filesystem ) {
|
553 |
$source_abs_path = $this->get_sanitized_path( $source_abs_path );
|
554 |
$destination_abs_path = $this->get_sanitized_path( $destination_abs_path );
|
@@ -558,4 +619,50 @@ class WPMDB_Filesystem {
|
|
558 |
|
559 |
return $return;
|
560 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
431 |
*/
|
432 |
public function scandir( $abs_path ) {
|
433 |
|
434 |
+
if ( is_link( $abs_path ) ) {
|
435 |
+
return false;
|
436 |
+
}
|
437 |
+
|
438 |
$dirlist = @scandir( $abs_path );
|
439 |
+
|
440 |
if ( false === $dirlist ) {
|
441 |
if ( $this->use_filesystem ) {
|
442 |
$abs_path = $this->get_sanitized_path( $abs_path );
|
451 |
|
452 |
// normalize return to look somewhat like the return value for WP_Filesystem::dirlist
|
453 |
foreach ( $dirlist as $entry ) {
|
454 |
+
if ( '.' === $entry || '..' === $entry || is_link( $abs_path . $entry ) ) {
|
455 |
continue;
|
456 |
}
|
457 |
+
|
458 |
+
$return[ $entry ] = $this->get_file_info( $entry, $abs_path );
|
|
|
|
|
459 |
}
|
460 |
|
461 |
return $return;
|
462 |
|
463 |
}
|
464 |
|
465 |
+
/**
|
466 |
+
* @param string $entry
|
467 |
+
* @param string $abs_path
|
468 |
+
*
|
469 |
+
* @return array
|
470 |
+
*/
|
471 |
+
public function get_file_info( $entry, $abs_path ) {
|
472 |
+
$abs_path = $this->slash_one_direction( $abs_path );
|
473 |
+
$full_path = realpath( trailingslashit( $abs_path ) . $entry );
|
474 |
+
|
475 |
+
$return = array();
|
476 |
+
$return['name'] = $entry;
|
477 |
+
$return['relative_path'] = str_replace( $abs_path, '', $full_path );
|
478 |
+
$return['wp_content_path'] = str_replace( $this->slash_one_direction( WP_CONTENT_DIR ) . DIRECTORY_SEPARATOR, '', $full_path );
|
479 |
+
$return['subpath'] = preg_replace( '#^(themes|plugins)#', '', $return['wp_content_path'] );
|
480 |
+
$return['absolute_path'] = $full_path;
|
481 |
+
$return['type'] = $this->is_dir( $abs_path . DIRECTORY_SEPARATOR . $entry ) ? 'd' : 'f';
|
482 |
+
$return['size'] = $this->filesize( $abs_path . DIRECTORY_SEPARATOR . $entry );
|
483 |
+
|
484 |
+
$exploded = explode( DIRECTORY_SEPARATOR, $return['subpath'] );
|
485 |
+
$return['folder_name'] = isset( $exploded[1] ) ? $exploded[1] : $return['relative_path'];
|
486 |
+
|
487 |
+
return $return;
|
488 |
+
}
|
489 |
+
|
490 |
+
/**
|
491 |
+
* List all files in a directory recursively
|
492 |
+
*
|
493 |
+
* @param $abs_path
|
494 |
+
*
|
495 |
+
* @return array|bool
|
496 |
+
*/
|
497 |
+
public function scandir_recursive( $abs_path ) {
|
498 |
+
$dirlist = $this->scandir( $abs_path );
|
499 |
+
|
500 |
+
if ( ! $dirlist ) {
|
501 |
+
return $dirlist;
|
502 |
+
}
|
503 |
+
|
504 |
+
foreach ( $dirlist as $key => $entry ) {
|
505 |
+
if ( 'd' === $entry['type'] ) {
|
506 |
+
$current_dir = trailingslashit( $entry['name'] );
|
507 |
+
$current_path = trailingslashit( $abs_path ) . $current_dir;
|
508 |
+
$contents = $this->scandir_recursive( $current_path );
|
509 |
+
unset( $dirlist[ $key ] );
|
510 |
+
foreach ( $contents as $filename => $value ) {
|
511 |
+
$contents[ $current_dir . $filename ] = $value;
|
512 |
+
unset( $contents[ $filename ] );
|
513 |
+
}
|
514 |
+
$dirlist += $contents;
|
515 |
+
}
|
516 |
+
}
|
517 |
+
|
518 |
+
return $dirlist;
|
519 |
+
}
|
520 |
+
|
521 |
/**
|
522 |
* Light wrapper for move_uploaded_file with chmod
|
523 |
*
|
545 |
* @param string $source_abs_path
|
546 |
* @param string $destination_abs_path
|
547 |
* @param bool $overwrite
|
548 |
+
* @param mixed $perms
|
549 |
*
|
550 |
* @return bool
|
551 |
*
|
596 |
// Taken in part from WP_Filesystem_Direct
|
597 |
if ( ! $overwrite && $this->file_exists( $destination_abs_path ) ) {
|
598 |
return false;
|
599 |
+
} elseif ( rename( $source_abs_path, $destination_abs_path ) ) {
|
600 |
return true;
|
601 |
} else {
|
602 |
if ( $this->copy( $source_abs_path, $destination_abs_path, $overwrite ) && $this->file_exists( $destination_abs_path ) ) {
|
608 |
}
|
609 |
}
|
610 |
|
611 |
+
//@TODO clean up temp location if using the rcopy() method
|
612 |
+
|
613 |
if ( ! $return && $this->use_filesystem ) {
|
614 |
$source_abs_path = $this->get_sanitized_path( $source_abs_path );
|
615 |
$destination_abs_path = $this->get_sanitized_path( $destination_abs_path );
|
619 |
|
620 |
return $return;
|
621 |
}
|
622 |
+
|
623 |
+
/**
|
624 |
+
*
|
625 |
+
* Recursively copy files, alternative to rename()
|
626 |
+
*
|
627 |
+
* @param $source
|
628 |
+
* @param $dest
|
629 |
+
*
|
630 |
+
* @return bool
|
631 |
+
*/
|
632 |
+
public function rcopy( $source, $dest ) {
|
633 |
+
|
634 |
+
// @TODO should probably throw on Maintenance Mode if using this as it takes much longer to complete vs. rename()
|
635 |
+
|
636 |
+
$this->rmdir( $dest, true );
|
637 |
+
$this->mkdir( $dest, 0755 );
|
638 |
+
|
639 |
+
$return = true;
|
640 |
+
|
641 |
+
$iterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $source, RecursiveDirectoryIterator::SKIP_DOTS ), RecursiveIteratorIterator::SELF_FIRST );
|
642 |
+
|
643 |
+
foreach ( $iterator as $item ) {
|
644 |
+
|