WP Migrate DB - Version 1.0

Version Description

Download this release

Release Info

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

Code changes from version 0.9.2 to 1.0

Files changed (41) hide show
  1. asset/dist/css/styles.css +1 -1
  2. asset/dist/js/{common-092.js → common-10.js} +28 -0
  3. asset/dist/js/{common-092.min.js → common-10.min.js} +1 -1
  4. asset/dist/js/dismissable-notices-10.js +24 -0
  5. asset/dist/js/dismissable-notices-10.min.js +1 -0
  6. asset/dist/js/{hook-092.js → hook-10.js} +0 -0
  7. asset/dist/js/{hook-092.min.js → hook-10.min.js} +0 -0
  8. asset/dist/js/import-10.js +602 -0
  9. asset/dist/js/import-10.min.js +1 -0
  10. asset/dist/js/localStorage-10.js +172 -0
  11. asset/dist/js/localStorage-10.min.js +1 -0
  12. asset/dist/js/{multisite-092.js → multisite-10.js} +0 -0
  13. asset/dist/js/{multisite-092.min.js → multisite-10.min.js} +0 -0
  14. asset/dist/js/{plugin-update-092.js → plugin-update-10.js} +0 -1
  15. asset/dist/js/{plugin-update-092.min.js → plugin-update-10.min.js} +0 -0
  16. asset/dist/js/script-092.min.js +0 -3
  17. asset/dist/js/{script-092.js → script-10.js} +250 -184
  18. asset/dist/js/script-10.min.js +3 -0
  19. class/wpmdb-base.php +339 -120
  20. class/wpmdb-cli.php +49 -7
  21. class/wpmdb-compatibility-plugin-manager.php +252 -0
  22. class/wpmdb-compatibility.php +268 -0
  23. class/wpmdb-filesystem.php +3 -3
  24. class/wpmdb-replace.php +55 -24
  25. class/wpmdb-utils.php +46 -4
  26. class/wpmdb-wpdb.php +60 -0
  27. class/wpmdb.php +538 -203
  28. class/wpmdbpro-import.php +502 -0
  29. compatibility/temp-theme/functions.php +2 -0
  30. compatibility/wp-migrate-db-pro-compatibility.php +21 -129
  31. languages/wp-migrate-db-en.pot +792 -460
  32. readme.txt +24 -15
  33. template/addons.php +5 -4
  34. template/common/checkbox.php +1 -1
  35. template/common/compatibility.php +63 -40
  36. template/common/muplugin-failed-update-warning.php +8 -0
  37. template/migrate.php +28 -25
  38. template/wpmdb/progress-upgrade.php +1 -1
  39. template/wpmdb/sidebar.php +1 -1
  40. template/wpmdb/wordpress-org-support.php +1 -1
  41. wp-migrate-db.php +11 -2
asset/dist/css/styles.css CHANGED
@@ -1 +1 @@
1
- #wpmdb-main{width:742px;position:relative;min-height:950px}.wpmdb h2 ~ .error,.wpmdb h2 ~ .notice,.wpmdb h2 ~ .updated{clear:both}.wpmdb div.updated.warning{max-width:742px;box-sizing:border-box;margin:10px 0}.wpmdb div.updated.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 .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:400px}.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-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 .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{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{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{margin:0px}.wpmdb .different-plugin-version-notice,.wpmdb .directory-permission-notice{background-color:#FFEBE8;border-color:#CC0000}.wpmdb .different-plugin-version-notice a,.wpmdb .directory-permission-notice a{color:#CC0000;text-decoration:underline}.wpmdb .mixed-case-table-name-notice{display:none}.wpmdb .save-migration-profile-wrap li label{font-size:12px;font-weight:normal}.wpmdb .save-migration-profile-wrap li{margin-bottom:5px;padding-left:25px}.wpmdb .save-migration-profile-wrap .indent-wrap{margin-left:0px}.wpmdb .create-new-label{margin-right:8px}.wpmdb .create-new-profile{position:absolute;top:-5px}.wpmdb .replace-remove-row,.wpmdb .delete-profile{background-color:#eee;border:1px solid #ccc;border-radius:50% 50% 50% 50%;cursor:pointer;height:11px;left:5px;margin-left:2px;position:absolute;margin-top:-6px;top:50%;width:11px;display:block;background-position:50% 50%;background-size:6px 6px;background-repeat:no-repeat}.wpmdb .replace-remove-row:after,.wpmdb .delete-profile:after{content:"\00d7";left:2px;position:absolute;top:-3px;color:#aaa;font-size:12px}.wpmdb .replace-remove-row:after{position:relative}.wpmdb .replace-remove-row:hover,.wpmdb .delete-profile:hover{border-color:#aaa}.wpmdb .ajax-success-msg{font-weight:bold;margin-left:9px;position:absolute;display:inline-block}.wpmdb .migrate-db .ajax-success-msg{margin-top:3px}.wpmdb p img.save-profile-ajax-spinner{margin:6px 0 0 10px}.wpmdb .backup-description{left:20px;position:relative}.wpmdb .backup-option-disabled{margin-bottom:0px !important}.wpmdb .settings-tab{display:none}.wpmdb .settings-tab .slider{max-width:416px}.wpmdb .settings-tab .slider-label{display:block;margin-bottom:10px;float:left;width:50%}.wpmdb .settings-tab .slider-label-wrapper{max-width:416px;width:100%;position:relative}.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;height:10px;border-radius:2px;position:relative}.wpmdb .settings-tab .ui-slider-handle{width:20px;height:20px;background-color:#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-color:#86db91;border-color:#eee}.wpmdb .settings-tab .ui-slider-range{background-color:#eee;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 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}.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:after{top:-1px;font-size:22px;height:20px}.wpmdb .settings-tab .setting-status{padding-left:6px}.wpmdb .settings-tab .slider-label span{font-weight:bold}.wpmdb .allow-remote-reqeusts{font-size:14px;font-weight:bold}.wpmdb .connection-info-label{margin-top:15px;margin-bottom:5px;display:block}.wpmdb .connection-info{clear:both;font-size:15px;line-height:21px;font-family:Consolas, Monaco, monospace;padding:10px 10px;height:67px;text-shadow:0px 1px 0px #fff;display:block;margin-bottom:7px;width:418px}.wpmdb .reset-button-wrap{width:418px}.wpmdb .reset-button-wrap .button{float:left;position:relative}.wpmdb .reset-button-wrap .button:first-of-type{margin-right:10px}.wpmdb .reset-button-wrap .button.copy-api-key .copy-api-key-confirmation{display:none;left:0;position:absolute;text-align:center;top:0;height:100%;width:100%;color:#333}.wpmdb .reset-button-wrap .reset-api-key-ajax-spinner{float:left;margin:4px 7px}.wpmdb .masked-licence{margin-top:0px}.wpmdb .bull{font-size:22px;position:relative;top:4px}.wpmdb .plugin-compatibility-wrap{padding:18px 18px 18px 100px;background-color:#e6e6e6;margin-left:0}.wpmdb .plugin-compatibility-wrap p:last-of-type{margin:10px 0 0 0}.wpmdb ul.plugin-compatibility-options{display:block;margin:10px 0 10px 0px}.wpmdb .plugin-compatibility-spinner{position:relative;top:3px;left:10px}.wpmdb .plugin-compatibility-success-msg{position:relative;left:10px;font-weight:bold}.wpmdb .wpmdb-switch{position:relative;display:inline-block;padding:2px;overflow:hidden;border-radius:2px;background-color:#d4d3d3;cursor:pointer}.wpmdb .wpmdb-switch.on{background-color:#ade7b5}.wpmdb .wpmdb-switch span{visibility:hidden;box-sizing:border-box;float:left;display:inline-block;height:100%;font-size:12px;line-height:20px;border-radius:2px;-webkit-border-radius:2px;font-weight:bold;padding:4px 8px;background:#fff;color:#8d8d8d;z-index:1}.wpmdb .wpmdb-switch span.on{color:#82d78b}.wpmdb .wpmdb-switch span.checked{visibility:visible}.wpmdb .wpmdb-switch.disabled{cursor:default;background:#e6e6e6}.wpmdb .wpmdb-switch.disabled span{background:#f1f1f1;color:#d6d6d6}.wpmdb .wpmdb-switch input[type="checkbox"]{position:absolute !important;top:0;left:0;opacity:0;z-index:-1}.wpmdb .help-tab{display:none}.wpmdb .help-tab h3{font-size:18px;font-weight:normal}.wpmdb .help-tab .support{border-bottom:1px solid #ccc;margin-bottom:25px;padding-bottom:18px}.wpmdb .help-tab .support p{width:640px}.wpmdb .help-tab .support .email a{font-size:12px}.wpmdb .help-tab .support .upgrade-to-pro{font-size:16px;font-weight:bold}.wpmdb .help-tab .support .upgrade-to-pro a{white-space:nowrap}.wpmdb .help-tab .support .ajax-spinner{top:2px}.wpmdb .help-tab .debug .ajax-spinner{top:6px}.wpmdb .help-tab .debug .ajax-success-msg{margin-top:5px}.wpmdb .help-tab .video-viewer{margin-bottom:30px;border:1px solid #ccc}.wpmdb .help-tab .videos{width:640px}.wpmdb .help-tab .videos ul>li{margin-bottom:30px;overflow:hidden;position:relative}.wpmdb .help-tab .videos ul>li a{overflow:hidden;display:block;width:320px;height:180px;float:left;margin-right:15px;position:relative;z-index:1;border:1px solid #ccc}.wpmdb .help-tab .videos ul>li a:before,.wpmdb .help-tab .videos ul>li a:after{position:absolute;content:" ";margin:auto;left:0;right:0;top:0;bottom:0}.wpmdb .help-tab .videos ul>li a:before{width:64px;height:64px;border-radius:64px;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=80);opacity:.8;border:1px solid #ddd;background-color:#fff;z-index:2}.wpmdb .help-tab .videos ul>li a:after{filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=80);opacity:.8;border:21.33333px solid transparent;border-top-width:12.8px;border-bottom-width:12.8px;border-left-color:#333;background:transparent;display:block;left:25px;width:0px;height:0px;z-index:3}.wpmdb .help-tab .videos .video:last-child{margin-bottom:0px}.wpmdb .help-tab .videos img{width:320px;height:240px;position:relative;top:50%;margin-top:-120px}.wpmdb .help-tab .debug{width:640px;border-bottom:1px solid #CCCCCC;margin-bottom:25px;padding-bottom:28px}.wpmdb .help-tab .debug textarea{width:100%;min-height:200px;font-family:Consolas, Monaco, monospace;margin-bottom:5px}.wpmdb .help-tab h4{margin:0 0 0.2em 0}.wpmdb .help-tab p{margin:0 0 0.5em 0}.wpmdb .help-tab iframe{display:none}.wpmdb .addons-tab{display:none}.wpmdb .addons-tab .addon{position:relative;width:100%;min-height:138px;padding:25px 30px 30px 165px;box-sizing:border-box;color:#fff;margin-top:15px}.wpmdb .addons-tab .addon .actions{float:right;font-size:14px}.wpmdb .addons-tab .addon .actions>*{margin-right:10px}.wpmdb .addons-tab .addon .actions *:last-child{margin-right:0}.wpmdb .addons-tab .addon .actions .action{background-color:#fff;font-weight:bold;display:inline-block;padding:0.2em 0.4em}.wpmdb .addons-tab .addon .actions .action:hover{background-color:rgba(255,255,255,0.92)}.wpmdb .addons-tab .addon .actions .status{border-bottom:2px solid #fff;padding-bottom:0.1em}.wpmdb .addons-tab .addon h1{font-weight:normal;float:left;margin:0;margin-top:5px;color:#fff}.wpmdb .addons-tab .addon p{font-size:16px;line-height:1.2em;clear:both;margin:0}.wpmdb .addons-tab .addon p a{text-decoration:underline;color:#fff}.wpmdb .addons-tab .addon p a:hover{color:rgba(255,255,255,0.9)}.wpmdb .addons-tab .addon.wp-migrate-db-pro-media-files{background:#3fab3f url(../img/icon-media-files.svg) no-repeat 30px 30px;background-size:110px 85px}.wpmdb .addons-tab .addon.wp-migrate-db-pro-media-files .action{color:#3fab3f}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli{background:#272822 url(../img/icon-cli.svg) no-repeat 30px 30px;background-size:110px 97px;min-height:157px;color:#ddd}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli .action{color:#272822;background-color:#ddd}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli .action:hover{color:#272822;background-color:#eee}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli .status{border-bottom-color:#ddd}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli p a{color:#ddd}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli p a:hover{color:#f7f7f7}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli code{white-space:nowrap;margin:0;padding:0}.wpmdb .addons-tab .addon.wp-migrate-db-pro-multisite-tools{background:#a90000 url(../img/icon-multisite-tools.svg) no-repeat 30px 20px;background-size:110px 118px;min-height:157px}.wpmdb .addons-tab .addon.wp-migrate-db-pro-multisite-tools .action{color:#a90000}.wpmdb-not-pro .wpmdb .wpmdb-main{margin-top:15px}.wpmdb-not-pro .wpmdb .help-tab .support p{width:auto}#wpmdb-sidebar{position:absolute;top:-21px;right:-312px;width:292px}#wpmdb-sidebar .block{padding:20px;border:1px solid #ccc}#wpmdb-sidebar .subscribe{border-top:none}#wpmdb-sidebar .subscribe h2{padding:0;margin:0;margin-bottom:0.5em;color:#666;font-size:20px;line-height:1.2em;float:none}#wpmdb-sidebar .subscribe h3{font-size:16px;margin:0}#wpmdb-sidebar .subscribe p{margin:0}#wpmdb-sidebar .subscribe p.interesting{margin-bottom:1em;line-height:1.4}#wpmdb-sidebar .subscribe .links{margin-bottom:2em}#wpmdb-sidebar .subscribe .links a{text-decoration:none}#wpmdb-sidebar .subscribe .promise{color:#999;font-size:12px;line-height:1.4em}#wpmdb-sidebar .subscribe .field{margin-bottom:0.5em}#wpmdb-sidebar .subscribe .field p{margin-bottom:0.3em}#wpmdb-sidebar .subscribe .field.submit-button{margin-bottom:1em}#wpmdb-sidebar .testimonial{border-top:none}#wpmdb-sidebar .testimonial p{margin:0}#wpmdb-sidebar .testimonial .quote{font-size:20px}#wpmdb-sidebar .testimonial .author{white-space:nowrap;text-align:right}#wpmdb-sidebar .testimonial .stars{white-space:nowrap;margin-bottom:5px}#wpmdb-sidebar .testimonial .via{text-align:right;font-size:12px}#wpmdb-sidebar .testimonial .via a{color:#666}#wpmdb-sidebar .testimonial .via a:before{content:"\f301";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 18px/1 'dashicons';vertical-align:top;margin-right:3px}@media (min--moz-device-pixel-ratio: 1.3), (-webkit-min-device-pixel-ratio: 1.3), (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx){#wpmdb-sidebar .wpmdb-banner{background-image:url(../img/wp-migrate-db-pro@2x.jpg);background-size:292px 292px;width:292px;height:292px;display:block}#wpmdb-sidebar .wpmdb-banner img{display:none}}@media screen and (max-width: 1252px){#wpmdb-sidebar{position:relative;top:auto;right:auto;margin-top:50px}}body.mp6 input[type=checkbox]:disabled{opacity:1;border-color:#ccc}body.mp6 #wpmdb-main{font-size:14px}body.mp6 p{font-size:14px}body.mp6 .wrap>h1{float:left}body.mp6 .wrap h2{float:left}body.mp6 .wpmdb .content-tab{padding-top:15px}body.mp6 .wpmdb .migrate-tab{padding-top:0}body.mp6 .wpmdb input[type=checkbox],body.mp6 .wpmdb input[type=radio]{vertical-align:middle;margin-top:-4px}body.mp6 .wpmdb input[type=text],body.mp6 .wpmdb input[type=password]{padding:3px 5px}body.mp6 .wpmdb input.code{padding-top:6px}body.mp6 .wpmdb label{font-size:14px}body.mp6 .wpmdb h2.nav-tab-wrapper{float:none;margin-bottom:0;width:722px;font-size:23px;line-height:29px;padding:9px 0 0 5px}body.mp6 .wpmdb .help-tab h3{margin-top:0}body.mp6 .wpmdb .temp-disabled{background-color:#f9f9f9}body.mp6 .wpmdb .migration-profile-options li a{border-color:#ccc;color:#555;background-color:#e4e4e4}body.mp6 .wpmdb .migration-profile-options li a:hover{background-color:#fff;color:#464646}body.mp6 .wpmdb .settings-tab .slider-label span{vertical-align:middle}body.mp6 .wpmdb .settings-tab .slider-label-wrapper{font-size:14px}body.mp6 .wpmdb .settings-tab .ui-slider{border-color:#fff;background-color:#fff}body.mp6 .wpmdb .settings-tab .ui-slider-range{background-color:#ade7b5}body.mp6 .wpmdb .settings-tab .option-section li label{font-size:14px}body.mp6 .wpmdb .connection-info,body.mp6 .wpmdb .migrate-tab .pull-push-connection-info{font-weight:bold;font-size:14px}body.mp6 .wpmdb .general-helper{border:0;width:auto;height:auto;top:auto;margin:0}body.mp6 .wpmdb .general-helper:after{content:"\f223";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 22px/1 'dashicons';vertical-align:top;top:auto;left:auto;position:relative}body.mp6 .wpmdb .helper-message{font-size:14px;line-height:1.4em}body.mp6 .wpmdb .right-arrow{display:none}body.mp6 .wpmdb .arrow-col{width:52px}body.mp6 .wpmdb .arrow-col:after{content:"\f344";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 22px/1 'dashicons';vertical-align:top;color:#999}body.mp6 .wpmdb .arrow-col:hover{cursor:pointer}body.mp6 .wpmdb .arrow-col:hover:after{color:#666}body.mp6 .wpmdb .arrow-col.disabled:after{opacity:0.5}body.mp6 .wpmdb .arrow-col.disabled:hover{cursor:default}body.mp6 .wpmdb .arrow-col.disabled:hover:after{color:#999}body.mp6 .wpmdb .find-heading{width:409px}body.mp6 .wpmdb .replace-fields input{width:304px}body.mp6 .wpmdb .replace-right-col span{border-color:#999}body.mp6 .wpmdb .replace-right-col span:hover{border-color:#666}body.mp6 .wpmdb .replace-add-row:after,body.mp6 .wpmdb .replace-add-row:before{background-color:#999}body.mp6 .wpmdb .replace-add-row:hover:after,body.mp6 .wpmdb .replace-add-row:hover:before{background-color:#666}body.mp6 .wpmdb .option-group.migrate-selection>li>label{font-size:16px}body.mp6 .wpmdb .saved-migration-profile-label{font-size:16px}body.mp6 .wpmdb .option-heading,body.mp6 .wpmdb .checkbox-label{font-size:16px}body.mp6 .wpmdb .checkbox-label input[type=checkbox]{top:auto}body.mp6 .wpmdb .return-to-profile-selection{font-size:14px}body.mp6 .wpmdb .option-description{font-size:13px}body.mp6 .wpmdb .save-migration-profile-wrap li{position:relative}body.mp6 .wpmdb .replace-remove-row,body.mp6 .wpmdb .delete-profile{border:0;border-radius:0;height:auto;width:auto;left:0;top:50%;margin-left:0}body.mp6 .wpmdb .replace-remove-row:after,body.mp6 .wpmdb .delete-profile:after{content:"\f153";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 18px/1 'dashicons';vertical-align:middle;color:#999}body.mp6 .wpmdb .replace-remove-row:hover:after,body.mp6 .wpmdb .delete-profile:hover:after{color:#666}body.mp6 .wpmdb .row-action-buttons{position:relative;width:60px}body.mp6 .wpmdb .row-action-buttons .helper-message{width:320px}body.mp6 .wpmdb .row-action-buttons .replace-remove-row{margin-left:4px;border:0;border-radius:50%;height:22px;width:auto;left:0;top:0;display:block;float:left;position:relative;margin-top:0}body.mp6 .wpmdb .row-action-buttons .replace-remove-row:after{display:inline-block;vertical-align:top;top:auto;position:relative;left:auto;height:22px;line-height:22px}body.mp6 .wpmdb .row-action-buttons .general-helper{display:inline-block;position:static;margin-left:4px}body.mp6 .wpmdb .row-action-buttons .general-helper:first-child{margin-left:2px}body.mp6 .wpmdb .row-action-buttons .general-helper:after{display:inline-block;vertical-align:top;top:auto;left:auto;position:relative}body.mp6 .wpmdb .delete-profile:after{color:#ccc}body.mp6 .wpmdb .delete-profile:hover:after{color:#aaa}body.mp6 .wpmdb .addons-tab .addons-content>div:nth-child(1),body.mp6 .wpmdb .addons-tab .addons-content>article:nth-child(1){margin-top:0px}body.mp6 .wpmdb .addons-tab .addon h1{font-weight:300;font-size:25px;margin-top:2px}body.mp6 .wpmdb .addons-tab .addon.wp-migrate-db-pro-cli h1{margin-top:5px}body.mp6 .wpmdb .addons-tab .addon p{font-size:14px;line-height:1.4em}body.mp6 .wpmdb .help-tab .support p,body.mp6 .wpmdb .help-tab .support .email a{font-size:14px}body.mp6 .wpmdb .help-tab div.warning p{font-size:13px}body.mp6 .wpmdb .help-tab .videos h4,body.mp6 .wpmdb .help-tab .videos p{font-size:14px}body.mp6 .wpmdb .inline-message,body.mp6 .wpmdb .notification-message{border-radius:0;border:0;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);padding:10px 14px;font-size:13px}body.mp6 .wpmdb .notification-message{margin-bottom:20px;background-color:#fff}body.mp6 .wpmdb .notification-message.ssl-notice,body.mp6 .wpmdb .notification-message.invalid-licence{margin-bottom:0;margin-top:15px}body.mp6 .wpmdb .notification-message p{font-size:13px;margin-top:0}body.mp6 .wpmdb .notification-message p:last-child{margin:0}body.mp6 .wpmdb .notification-message h4{margin-top:0}body.mp6 .wpmdb .notification-message a{color:#0074a2;text-decoration:none}body.mp6 .wpmdb .notification-message a:hover{color:#2ea2cc}body.mp6 .wpmdb div.notification-message.invalid-licence p:last-child{margin:0.5em 0}body.mp6 .wpmdb div.notification-message.invalid-licence p:last-child a.button{color:#555555}body.mp6 .wpmdb .inline-message.error,body.mp6 .wpmdb .notification-message.error-notice{border-left:4px solid #dd3d36;background-color:#fff}body.mp6 .wpmdb .inline-message.warning,body.mp6 .wpmdb .notification-message.warning-notice{background-color:#fff;border-left:4px solid #ffba00}body.mp6 .wpmdb .inline-message.success,body.mp6 .wpmdb .notification-message.success-notice{border-left:4px solid #7ad03a}body.mp6 .wpmdb .ssl-notice{margin-bottom:0}body.mp6 .wpmdb .different-plugin-version-notice,body.mp6 .wpmdb .directory-permission-notice{margin-bottom:10px}body.mp6 .wpmdb .licence-status{color:#444;float:left;font-weight:normal}body.mp6 #overlay{background-color:rgba(0,0,0,0.5)}body.mp6 .migration-progress-ajax-spinner{top:20px}#overlay{background-color:rgba(255,255,255,0.9);position:fixed;top:0;left:0;width:100%;height:100%;z-index:100000;overflow-x:auto;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-transition:opacity .3s ease-out;transition:opacity .3s ease-out}#overlay.show{opacity:1;display:-webkit-box;display:-ms-flexbox;display:flex}@media screen and (max-width: 700px){#overlay.show{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}}#overlay.hide{opacity:0;display:-webkit-box;display:-ms-flexbox;display:flex}@media screen and (max-width: 1120px){.wpmdb-not-pro #overlay.show{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}}.stage-tabs{margin:0;z-index:5}.stage-tabs .stage-tab{box-sizing:border-box;display:block;float:left;width:auto;height:45px;margin:0 5px -1px 0;background-color:#ddd;border:1px solid #aaa;padding:.5em 1.5em 0;line-height:1.3;text-align:center;text-transform:capitalize;color:#333;-webkit-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out}.stage-tabs .stage-tab.active{background-color:#fff;border-bottom-color:#fff}.stage-tabs .stage-status{display:block;font-size:.8em;font-style:italic}.complete .stage-tabs .stage-tab:not(.active){cursor:pointer}.complete .stage-tabs .stage-tab:not(.active):hover{background-color:#eee}.migration-progress-stages{position:relative;margin:0 -30px 0;background:#fff;overflow-y:auto}.migration-progress-stages .migration-progress-stage-container{top:0;left:0;width:100%;padding:0}.migration-progress-stages .migration-progress-stage-container.queued,.migration-progress-stages .migration-progress-stage-container.complete{display:none}.migration-progress-stages .migration-progress-stage-container.active{display:block}.migration-progress-stages .truncation-notice{margin:-10px 30px 10px;padding:5px 10px;color:#999;text-align:center}.migration-progress-stages .hide-tables .truncation-notice{display:none}.migration-progress-stages .progress-items{position:relative;overflow-y:auto;padding:10px 30px 10px;z-index:0}.migration-progress-stages .item-progress{position:relative;background-color:#eee;overflow:hidden;margin:0 0 .8em 0;-webkit-transition:height .2s ease-in-out, margin .2s ease-in-out;transition:height .2s ease-in-out, margin .2s ease-in-out}.migration-progress-stages .item-progress .dashicons-yes.dashicons{position:absolute;right:.3em;top:0.12em;z-index:20;background:#333;color:#85d937;width:.75em;height:.75em;border-radius:50%;text-indent:-.18em;line-height:.8;vertical-align:2em;font-size:2em;opacity:0;-webkit-transition:opacity .3s ease-in;transition:opacity .3s ease-in;-webkit-transition-delay:.5s;transition-delay:.5s}.migration-progress-stages .item-progress.complete .dashicons-yes{opacity:1}.migration-progress-stages .item-progress .progress-bar{background:#85d937}.migration-progress-stages .item-progress .item-info{margin:0;position:relative;padding:.25em 0 .25em 1em;font-size:1em;z-index:10}.migration-progress-stages .hide-tables .progress-items{height:0px !important;opacity:0}@-webkit-keyframes progress-bg-anim{0%{background-position:0 0}100%{background-position:50px 50px}}@keyframes progress-bg-anim{0%{background-position:0 0}100%{background-position:50px 50px}}.clearfix:before,.clearfix:after{content:"";display:table}.clearfix:after{clear:both}.clearfix{zoom:1}.general-spinner{width:16px;height:16px}.migration-error{color:#a21b1b;display:block;max-height:400px;max-width:100%;overflow:auto;word-wrap:break-word}.migration-php-errors{display:none;margin:20px 0;overflow-y:scroll;height:180px}.progress-overlay-container{display:none;position:relative;background-color:#eee;padding:30px 30px 15px;box-shadow:0 0 10px rgba(0,0,0,0.5);cursor:default;font-size:14px;z-index:1;margin:0 10px;box-sizing:border-box;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;max-height:95%;overflow-y:hidden;-webkit-transition:opacity .3s ease-out, -webkit-transform .5s ease-out;transition:opacity .3s ease-out, transform .5s ease-out;width:700px;min-width:700px;-ms-flex-preferred-size:700px;flex-basis:700px;-webkit-box-flex:0;-ms-flex:0 1 0%;flex:0 1 0%}.progress-overlay-container.show{display:-webkit-box;display:-ms-flexbox;display:flex;opacity:1}.progress-overlay-container.hide{display:-webkit-box;display:-ms-flexbox;display:flex;opacity:0;-webkit-transform:translateY(-100%);transform:translateY(-100%)}.progress-overlay-container>div{-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto}.progress-overlay-container .migration-progress-stages{-webkit-box-flex:100;-ms-flex:100 1 auto;flex:100 1 auto}@media all and (-ms-high-contrast: none){.progress-overlay-container .migration-progress-stages{height:300px}}.progress-overlay-container .progress-title{margin-top:0;font-size:22px;font-weight:normal;width:85%;line-height:1.3}.progress-overlay-container .progress-title .domain-label{white-space:nowrap}.progress-overlay-container .progress-title .dashicons{display:inline;vertical-align:middle;margin-left:-.15em;padding-right:.3em;font-size:42px}.progress-overlay-container .progress-info-wrapper{margin-bottom:10px}.progress-overlay-container .progress-text{clear:left;float:left;width:100%}.progress-overlay-container .timer{position:absolute;top:35px;right:55px}.progress-overlay-container .progress-bar{position:absolute;top:0;left:0;height:100%;-webkit-transition:width 1s ease-out;transition:width 1s ease-out;z-index:0}.progress-overlay-container .stage-progress{display:none;text-transform:capitalize;padding:15px 30px 0;margin:0 -30px;height:65px;box-sizing:border-box;background:#fff;border-top:1px solid #aaa;z-index:100}.progress-overlay-container .stage-progress.active{display:block}.progress-overlay-container .stage-progress .lowercase{text-transform:lowercase}.progress-overlay-container .stage-progress .tables-complete{margin-left:3em}.progress-overlay-container .stage-progress .progress-bar-wrapper{position:relative;height:10px;width:100%;background-color:#eee;margin:15px 0 10px;background-image:-webkit-linear-gradient(135deg, rgba(255,255,255,0.35) 25%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 50%, rgba(255,255,255,0.35) 50%, rgba(255,255,255,0.35) 75%, rgba(0,0,0,0) 75%, rgba(0,0,0,0));background-image:linear-gradient(-45deg, rgba(255,255,255,0.35) 25%,rgba(0,0,0,0) 25%,rgba(0,0,0,0) 50%,rgba(255,255,255,0.35) 50%,rgba(255,255,255,0.35) 75%,rgba(0,0,0,0) 75%,rgba(0,0,0,0));background-size:20px 20px;-webkit-animation:progress-bg-anim 5s linear infinite;animation:progress-bg-anim 5s linear infinite}.progress-overlay-container .stage-progress .progress-bar{background-color:#406fa4}.progress-overlay-container .stage-progress .show-hide-tables{display:block;float:right;cursor:pointer}.progress-overlay-container .progress-tables{overflow:hidden;margin-bottom:2px;padding:0 0 20px 0}.progress-overlay-container .progress-tables-hover-boxes{position:absolute;top:0px;left:0px;display:block;width:100%}.progress-overlay-container .progress-chunk-hover{display:block;float:left;height:35px;position:relative;top:-5px;z-index:1}.progress-overlay-container .progress-chunk{box-sizing:border-box;float:left;display:block;height:6px;border-right:1px solid #ccc;border-bottom:1px solid #ccc;color:#999;position:relative;text-align:center}.progress-overlay-container .progress-chunk>span{padding:0px 3px;white-space:nowrap;text-overflow:ellipsis;margin-top:10px;display:inline-block}.progress-overlay-container .progress-label{padding:5px 10px;border:1px solid #ccc;border-radius:3px;background-color:#fff;font-family:Consolas, Monaco, monospace;font-size:12px;display:inline-block;top:-35px;position:absolute;opacity:0;-webkit-transition:opacity 200ms ease-in-out;transition:opacity 200ms ease-in-out}.progress-overlay-container .label-visible{opacity:1}.progress-overlay-container .progress-label:before{content:"";width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #ccc;display:block;position:absolute;bottom:-5px;left:50%;margin-left:-2px}.progress-overlay-container .progress-label:after{content:"";width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #fff;display:block;position:absolute;bottom:-4px;left:50%;margin-left:-2px}.progress-overlay-container .migration-progress-ajax-spinner{left:7px;position:relative;top:15px}.progress-overlay-container .close-progress-content{color:#999;cursor:pointer;font-size:26px;font-weight:200;position:absolute;right:10px;top:5px;padding:5px;display:none}.progress-overlay-container .close-progress-content:hover{color:#666;border-color:#aaa}.progress-overlay-container .migration-controls{display:block;-webkit-transition:opacity .2s ease-out;transition:opacity .2s ease-out;padding-top:15px}.progress-overlay-container .migration-controls.hidden{opacity:0;pointer-events:none}.progress-overlay-container .migration-controls span{float:left;text-align:center;display:block}.progress-overlay-container .migration-controls span:first-child{margin-right:10px;width:71px}.progress-overlay-container .migration-controls .pause-before-finalize{display:none;float:right;margin-top:5px}.progress-overlay-container .migration-controls #pause-before-finalize{margin-top:0}.progress-overlay-container .pro-version{margin-top:45px;padding-top:40px;position:relative;border-top:1px solid #ccc}.progress-overlay-container .pro-version iframe{position:absolute;top:40px;right:0;display:block}.progress-overlay-container .pro-version-content{padding-right:460px;min-height:255px}.progress-overlay-container .pro-version-content h1{line-height:1em;margin-top:0;font-size:20px}.progress-overlay-container .pro-version-content ul{margin-left:24px}.progress-overlay-container .pro-version-content li{position:relative;font-size:14px;line-height:1.4em;margin-bottom:15px;max-width:580px}.progress-overlay-container .pro-version-content .pro-quote{margin:0 0 20px 0;max-width:570px}.progress-overlay-container .pro-version-content .pro-quote .dashicons-star-filled{font-size:16px;width:16px;height:16px;position:relative;top:2px}.progress-overlay-container .pro-version-content .pro-quote-author{font-style:italic;white-space:nowrap}.progress-overlay-container.wpmdb-error{outline:3px solid #dc3232}@media screen and (max-width: 1096px){.progress-overlay-container .pro-version iframe{position:relative;top:auto;right:auto}.progress-overlay-container .pro-version-content{min-height:0;padding:0 0 20px 0}}.progress-overlay-container:not(.complete) .migration-progress-stages .item-progress:first-child{background-image:-webkit-linear-gradient(135deg, rgba(255,255,255,0.3) 25%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 50%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0.3) 75%, rgba(0,0,0,0) 75%, rgba(0,0,0,0));background-image:linear-gradient(-45deg, rgba(255,255,255,0.3) 25%,rgba(0,0,0,0) 25%,rgba(0,0,0,0) 50%,rgba(255,255,255,0.3) 50%,rgba(255,255,255,0.3) 75%,rgba(0,0,0,0) 75%,rgba(0,0,0,0));background-size:50px 50px;-webkit-animation:progress-bg-anim 2s linear infinite;animation:progress-bg-anim 2s linear infinite}.progress-overlay-container.paused .active.stage-progress .progress-bar-wrapper{-webkit-animation-play-state:paused;animation-play-state:paused}.progress-overlay-container.paused .migration-progress-stages .item-progress:first-child{-webkit-animation-play-state:paused;animation-play-state:paused}.progress-overlay-container .migration-progress-stages .determining-media .item-progress:first-child{background-image:none;-webkit-animation:none;animation:none}.progress-overlay-container.cancelled .stage-tabs,.progress-overlay-container.cancelled .migration-progress-stages,.progress-overlay-container.cancelled .stage-progress.active,.progress-overlay-container.wpmdb-error .stage-tabs,.progress-overlay-container.wpmdb-error .migration-progress-stages,.progress-overlay-container.wpmdb-error .stage-progress.active{display:none}.migrate-tab>.pro-version{display:none}#overlay .pro-version{width:42%;padding-left:0;padding-right:0;-ms-flex-preferred-size:42%;flex-basis:42%;max-width:515px;min-width:400px;max-height:100%;-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2;font-size:14px;display:block;-webkit-transition:-webkit-transform .3s ease-out, opacity .3s ease-out, margin-left .2s .3s ease-in-out;transition:transform .3s ease-out, opacity .3s ease-out, margin-left .2s .3s ease-in-out}#overlay .pro-version.remove{margin-left:-525px !important}#overlay .pro-version .pro-version-content{padding:0 30px}#overlay .pro-version .pro-version-content h1{font-size:22px;font-weight:bold;margin:0 0 30px}#overlay .pro-version .pro-version-content li{margin-bottom:10px;padding-left:35px;position:relative}#overlay .pro-version .pro-version-content li .dashicons{display:block;position:absolute;font-size:2em;top:-3px;left:0}#overlay .pro-version .pro-version-content .pro-quote{border:1px solid #bbb;border-radius:3px;padding:15px 15px 15px 100px;margin:30px 0;position:relative;background:url("../img/mor10.png") no-repeat 15px 31px;background-size:51px 51px}@media (min--moz-device-pixel-ratio: 1.3), (-webkit-min-device-pixel-ratio: 1.3), (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx){#overlay .pro-version .pro-version-content .pro-quote{background-image:url("../img/mor10@2x.png")}}#overlay .pro-version .pro-version-content .pro-quote p{margin:0;font-size:13px}#overlay .pro-version .pro-version-content .pro-quote .pro-quote-author{font-size:14px;font-weight:bold;color:#999;margin-bottom:5px}#overlay .pro-version .pro-version-content .pro-quote .pro-quote-author .dashicons{float:right;color:#999}#overlay .pro-version .pro-version-content .pro-quote .stars{position:absolute;bottom:0;left:0;width:100%;height:0;overflow:visible;text-align:center}#overlay .pro-version .pro-version-content .pro-quote .stars span{background:#eee;color:#999;margin-top:-.5em}#overlay .pro-version .pro-version-content .pro-quote .stars span:first-child{padding-left:.1em}#overlay .pro-version .pro-version-content .pro-quote .stars span:last-child{padding-right:.1em}#overlay .pro-version iframe,#overlay .pro-version .iframe{width:100%;height:289px;background:#000}#overlay .pro-version .button{display:block;position:relative;width:250px;margin:20px auto 10px;text-align:center}#overlay .pro-version .close-pro-version{color:#999;cursor:pointer;font-size:26px;font-weight:200;position:absolute;right:10px;top:5px;padding:5px;display:block}#overlay .pro-version .close-pro-version:hover{color:#666;border-color:#aaa}
1
+ #wpmdb-main{width:742px;position:relative;min-height:950px}.wpmdb h2 ~ .error,.wpmdb h2 ~ .notice,.wpmdb h2 ~ .updated{clear:both}.wpmdb div.updated.warning,.wpmdb div.below-title.warning{max-width:742px;box-sizing:border-box;margin:10px 0}.wpmdb div.updated.warning p,.wpmdb div.below-title.warning p{font-size:13px;margin:0.5em 0}.wpmdb a{text-decoration:none}.wpmdb li{margin-bottom:5px;position:relative}.wpmdb ul{margin:0}.wpmdb input[type=checkbox],.wpmdb input[type=radio]{margin-right:5px;vertical-align:baseline;margin-top:0}.wpmdb input[type=text],.wpmdb input[type=password]{padding:5px}.wpmdb input[disabled=disabled]{cursor:default}.wpmdb label.disabled{color:#888;cursor:default}.wpmdb .option-section{border-bottom:1px solid #ccc;padding-bottom:20px;margin-bottom:20px}.wpmdb .option-section h3{font-size:18px;font-weight:normal}.wpmdb p.migrate-db{overflow:hidden;min-height:29px}.wpmdb p.migrate-db input{float:left}.wpmdb p.migrate-db img{float:left;margin:3px 0 0 5px}.wpmdb p.migrate-db .save-settings-button{margin-left:10px;display:none}.wpmdb .indent-wrap{margin-left:24px}.wpmdb .expandable-content{display:none;margin-top:10px}.wpmdb .expandable-content li:last-child{margin-bottom:0px}.wpmdb .header-wrapper{margin-bottom:10px}.wpmdb .header-expand-collapse{cursor:pointer;display:inline-block}.wpmdb .option-description{font-size:12px;color:#999;margin-left:8px;font-weight:normal}.wpmdb .option-group li:last-child{margin-bottom:0}.wpmdb .connection-status{display:none;overflow:auto}.wpmdb .connection-status.error{color:#9D1818}.wpmdb .copy-licence-to-remote-site{display:inline-block}.wpmdb .ajax-spinner{left:6px;position:relative;top:3px}.wpmdb div.message{margin:15px 0 0}.wpmdb .licence-wrap h3{margin:0 0 10px 0}.wpmdb .licence-input{clear:both;display:block;font-family:Consolas, Monaco, monospace;font-size:14px;margin-bottom:7px;padding:10px;width:418px}.wpmdb .register-licence{float:left;outline:none}.wpmdb .licence-status{color:#A21B1B;font-weight:bold;clear:both;padding-top:0.5em;margin:0}.wpmdb .licence-status.success{color:#333}.wpmdb .register-licence-ajax-spinner{margin:4px 0 0 8px}.wpmdb .return-to-profile-selection{margin-bottom:15px;display:inline-block}.wpmdb .return-to-profile-selection.bottom{margin-top:10px}.wpmdb h2.nav-tab-wrapper{margin-top:10px;margin-bottom:20px;padding-left:5px}.wpmdb h2.nav-tab-wrapper a.nav-tab-active{color:#464646;cursor:default}.wpmdb label{display:inline-block;clear:both}.wpmdb .migration-profile-options li{position:relative;width:520px}.wpmdb .migration-profile-options li a{padding:5px 10px;width:500px;border:1px solid #ddd;margin:0px 0px 7px;display:block;font-size:14px;color:#333}.wpmdb .migration-profile-options li a:hover{border-color:#bbb}.wpmdb .main-list-delete-profile-link{color:#999999;font-size:26px;font-weight:200;position:absolute;right:7px;top:4px;cursor:pointer}.wpmdb .main-list-delete-profile-link:hover{color:#444}.wpmdb .crumbs{overflow:hidden;border-bottom:1px solid #ccc;padding:12px 0}.wpmdb .crumbs .crumb{position:relative;display:block;float:left;margin-right:4px;padding-right:3px;font-size:13px;font-weight:bold}.wpmdb .crumbs span.crumb{padding-left:25px}.wpmdb .crumbs span.crumb:before{content:"\f345";position:absolute;left:0;top:0;display:inline-block;-webkit-font-smoothing:antialiased;font:normal 18px/1 'dashicons';vertical-align:middle}.wpmdb .option-group li{margin-bottom:5px}.wpmdb .option-group>li{margin-bottom:8px}.wpmdb .option-group li>label{font-size:14px;font-weight:bold}.wpmdb .option-group ul{display:none;margin:10px 0px 10px 25px}.wpmdb .option-group ul label{font-size:12px;font-weight:normal}.wpmdb .option-heading,.wpmdb .checkbox-label{font-size:14px;font-weight:bold}.wpmdb .checkbox-label input[type=checkbox]{margin-right:7px;position:relative;top:-1px}.wpmdb .expand-collapse-arrow{margin-right:9px}.wpmdb .migrate-selection{padding-top:20px}.wpmdb .migrate-connection-info{min-width:675px;margin:0}.wpmdb .migrate-tab .pull-push-connection-info{width:418px;height:65px;color:#333;font-family:Consolas, Monaco, monospace;font-size:15px;line-height:21px;padding:10px}.wpmdb .migrate-tab.import .table-options,.wpmdb .migrate-tab.import .exclude-post-types-options,.wpmdb .migrate-tab.import .advanced-options{margin-left:24px}.wpmdb .migrate-tab.import .import-find-replace-option,.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 .find-replace-rows,.wpmdb .migrate-tab.import .table-options,.wpmdb .migrate-tab.import .backup-options,.wpmdb .migrate-tab.import .exclude-post-types-options{border-top:1px solid #ccc;padding-top:20px}.wpmdb .basic-access-auth-wrapper{display:none;margin-bottom:5px}.wpmdb .auth-username,.wpmdb .auth-password{width:206px;margin-top:3px}.wpmdb .auth-password{width:207px}.wpmdb .connection-info-wrapper{display:none;width:670px}.wpmdb .connect-button{margin-top:2px}.wpmdb .temp-disabled{background-color:#EEEEEE;color:#888888;font-family:Consolas, Monaco, monospace;text-shadow:0 1px 0 #FFFFFF}.wpmdb .push-list ul{margin-bottom:0px}.wpmdb .find-heading,.wpmdb .replace-heading{float:left}.wpmdb .find-heading{width:382px}.wpmdb .replace-fields{border-collapse:collapse;border-spacing:0px}.wpmdb .replace-fields input{width:295px}.wpmdb .replace-fields tr td{padding-bottom:7px}.wpmdb .replace-fields tr:last-child td{padding-bottom:0px}.wpmdb .arrow-col{width:93px;text-align:center;vertical-align:middle}.wpmdb .right-arrow{font-size:36px;color:#aaa}.wpmdb .replace-right-col span{border-radius:50%;border:1px solid #ccc;background-color:#eee;width:16px;height:16px;display:inline-block;position:relative;top:4px;cursor:pointer}.wpmdb .replace-right-col span:hover{border-color:#aaa}.wpmdb .pin .sort-handle-col{opacity:0.5;cursor:default}.wpmdb .pin .sort-handle{cursor:default !important}.wpmdb .sort-handle-col{width:20px;cursor:-moz-grab}.wpmdb .sort-handle:before{content:"\f214";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 20px/1 'dashicons';vertical-align:top;color:#aaa;background-color:transparent !important;margin-right:4px}.wpmdb .original-repeatable-field{display:none}.wpmdb .no-replaces-message{display:none;margin-bottom:0px}.wpmdb .inline-message.missing-replace{margin-top:15px;display:none}.wpmdb #new-path-missing-warning{margin-top:5px}.wpmdb .tables-header{display:inline-block}.wpmdb .expand-collapse-arrow{display:inline-block;position:relative;top:-2px;font-size:11px}.wpmdb .collapsed{-webkit-transform:scale(1) rotate(-90deg) translateX(0px) translateY(0px) skewX(0deg) skewY(0deg);transform:scale(1) rotate(-90deg) translateX(0px) translateY(0px) skewX(0deg) skewY(0deg)}.wpmdb .select-deselect-divider{margin:0 6px}.wpmdb .select-wrap{display:none;margin-top:12px}.wpmdb .select-wrap .find-replace-msg{display:none}.wpmdb .select-post-types-wrap{display:block}.wpmdb .exclude-post-types-warning{font-size:13px;font-weight:bold;color:#9c1f1f}.wpmdb .exclude-post-types-warning p{margin:0 0 12px 0}.wpmdb .exclude-post-types-warning .find-replace-msg{display:none}.wpmdb .multiselect{min-width:550px;min-height:180px;margin-bottom:10px}.wpmdb .table-migrate-options li label{font-size:12px;font-weight:normal}.wpmdb .table-migrate-options li{margin-bottom:5px}.wpmdb .general-helper{border-radius:50%;border:1px solid #ccc;background-color:#eee;width:15px;height:15px;display:inline-block;position:relative;top:4px;margin-top:-4px;cursor:pointer;margin-left:2px}.wpmdb .general-helper:hover{border-color:#aaa}.wpmdb .general-helper:after{content:"?";color:#999999;font-size:10px;font-weight:bold;left:4px;position:absolute;top:-1px}.wpmdb .helper-message{padding:10px 16px;border-radius:3px;background-color:#fff;position:absolute;width:500px;z-index:9999;display:none;box-shadow:0px 0px 10px rgba(0,0,0,0.2)}.wpmdb .inline-message{padding:10px;border-radius:3px;margin-top:5px}.wpmdb .inline-message.error{border:1px solid #CC0000;background-color:#FFEBE8}.wpmdb .inline-message.warning{background-color:#FFFFE0;border:1px solid #E6DB55}.wpmdb .helper-message:after{content:'';border-bottom:8px solid transparent;border-right:8px solid #fff;border-top:8px solid transparent;display:block;height:0;left:-7px;position:absolute;top:11px;width:0}.wpmdb .helper-message.bottom:before{content:'';border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #aaa;border-top:0;display:block;height:0;left:50%;margin-left:-8px;position:absolute;top:-9px;width:0}.wpmdb .helper-message.bottom:after{content:'';border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #fff;border-top:0;display:block;height:0;left:50%;margin-left:-8px;position:absolute;top:-8px;width:0}.wpmdb .label-disabled{color:#888}.wpmdb .prefix-notice,.wpmdb .ssl-notice,.wpmdb .different-plugin-version-notice,.wpmdb .directory-permission-notice,.wpmdb .unrecognized-import-file-notice{background-color:#FFFFE0;border:1px solid #E6DB55;padding:15px;border-radius:3px;margin-bottom:15px;display:none}.wpmdb .prefix-notice p,.wpmdb .ssl-notice p,.wpmdb .different-plugin-version-notice p,.wpmdb .directory-permission-notice p,.wpmdb .unrecognized-import-file-notice p{margin-top:0px}.wpmdb .prefix-notice p:last-child,.wpmdb .ssl-notice p:last-child,.wpmdb .different-plugin-version-notice p:last-child,.wpmdb .directory-permission-notice p:last-child,.wpmdb .unrecognized-import-file-notice p:last-child{margin:0px}.wpmdb .different-plugin-version-notice,.wpmdb .directory-permission-notice{background-color:#FFEBE8;border-color:#CC0000}.wpmdb .different-plugin-version-notice a,.wpmdb .directory-permission-notice a{color:#CC0000;text-decoration:underline}.wpmdb .mixed-case-table-name-notice{display:none}.wpmdb .save-migration-profile-wrap li label{font-size:12px;font-weight:normal}.wpmdb .save-migration-profile-wrap li{margin-bottom:5px;padding-left:25px}.wpmdb .save-migration-profile-wrap .indent-wrap{margin-left:0px}.wpmdb .create-new-label{margin-right:8px}.wpmdb .create-new-profile{position:absolute;top:-5px}.wpmdb .replace-remove-row,.wpmdb .delete-profile{background-color:#eee;border:1px solid #ccc;border-radius:50% 50% 50% 50%;cursor:pointer;height:11px;left:5px;margin-left:2px;position:absolute;margin-top:-6px;top:50%;width:11px;display:block;background-position:50% 50%;background-size:6px 6px;background-repeat:no-repeat}.wpmdb .replace-remove-row:after,.wpmdb .delete-profile:after{content:"\00d7";left:2px;position:absolute;top:-3px;color:#aaa;font-size:12px}.wpmdb .replace-remove-row:after{position:relative}.wpmdb .replace-remove-row:hover,.wpmdb .delete-profile:hover{border-color:#aaa}.wpmdb .ajax-success-msg{font-weight:bold;margin-left:9px;position:absolute;display:inline-block}.wpmdb .migrate-db .ajax-success-msg{margin-top:3px}.wpmdb p img.save-profile-ajax-spinner{margin:6px 0 0 10px}.wpmdb .backup-description{left:20px;position:relative}.wpmdb .backup-option-disabled{margin-bottom:0px !important}.wpmdb .settings-tab{display:none}.wpmdb .settings-tab .slider{max-width:416px}.wpmdb .settings-tab .slider-label{display:block;margin-bottom:10px;float:left;width:50%}.wpmdb .settings-tab .slider-label span{vertical-align:middle}.wpmdb .settings-tab .slider-label-wrapper{max-width:416px;width:100%;position:relative;font-size:14px}.wpmdb .settings-tab .amount{width:50%;text-align:right;display:block;float:left}.wpmdb .settings-tab .slider-spinner{position:absolute;right:-35px;bottom:-13px}.wpmdb .settings-tab .slider-success-msg{right:-63px;bottom:-14px;position:absolute;font-weight:bold}.wpmdb .settings-tab .ui-slider{border:2px solid #fff;background:#fff;height:10px;border-radius:2px;position:relative;opacity:1}.wpmdb .settings-tab .ui-slider-handle{width:20px;height:20px;background:#ade7b5;border:2px solid #fff;border-radius:50%;display:block;position:absolute;top:-7px;outline:none;margin-left:-11px}.wpmdb .settings-tab .ui-slider-handle:active{background:#86db91;border-color:#eee}.wpmdb .settings-tab .ui-slider-range{background:#ade7b5;height:100%}.wpmdb .settings-tab .form-table{margin-top:0}.wpmdb .settings-tab .form-table h3,.wpmdb .settings-tab .form-table h4,.wpmdb .settings-tab .form-table p{margin:0;line-height:1.2}.wpmdb .settings-tab .form-table p.has-margin{margin-bottom:10px}.wpmdb .settings-tab .form-table h3{font-weight:normal}.wpmdb .settings-tab .form-table h4{font-size:15px}.wpmdb .settings-tab .form-table h4 .helper-message{font-weight:normal}.wpmdb .settings-tab .form-table h4 img.ajax-spinner{position:absolute;float:left;top:auto;left:auto;margin-top:1px}.wpmdb .settings-tab .form-table h4 .setting-status .ajax-success-msg{margin-left:6px}.wpmdb .settings-tab .form-table tr td{padding:10px 0}.wpmdb .settings-tab .form-table tr.wpmdb-setting-title td{padding-bottom:0}.wpmdb .settings-tab .form-table tr.wpmdb-setting-title td h3{margin:10px 0}.wpmdb .settings-tab .form-table tr:first-child td{padding-top:0}.wpmdb .settings-tab .form-table tr:first-child td h3{margin-top:0}.wpmdb .settings-tab .form-table tr td:first-child{vertical-align:top;min-width:100px;width:100px}@media screen and (max-width: 782px){.wpmdb .settings-tab .form-table tr td:first-child{width:auto}}.wpmdb .settings-tab .form-table tr.option-section.compatibility-mode td{padding-bottom:0}.wpmdb .settings-tab .form-table tr.option-section.compatibility-mode>td{padding:20px 0}.wpmdb .settings-tab .form-table tr.option-section.compatibility-mode .notification-message{margin:15px 0 0 0}.wpmdb .settings-tab .form-table tr.option-section.compatibility-mode .expandable-content{margin-top:15px}.wpmdb .settings-tab .form-table tr.option-section label{font-weight:normal;position:relative}.wpmdb .settings-tab .form-table tr.option-section li{margin-bottom:5px}.wpmdb .settings-tab .form-table tr.option-section li:last-child{margin-bottom:0px}.wpmdb .settings-tab .form-table tr.option-section.allow-remote-requests-wrap .ajax-spinner,.wpmdb .settings-tab .form-table tr.option-section.plugin-compatibility-section .ajax-spinner{right:-23px;left:inherit;top:0px;position:absolute}.wpmdb .settings-tab .form-table tr.option-section .bubble .ajax-spinner{right:-45px}.wpmdb .settings-tab .form-table tr.option-section .bubble .ajax-success-msg{right:-65px}.wpmdb .settings-tab .form-table tr.option-section td{padding-bottom:20px}.wpmdb .settings-tab .form-table tr.licence-wrap td{padding-top:0}.wpmdb .settings-tab .form-table tr.licence-wrap td .notification-message{margin:10px 0 0 0}.wpmdb .settings-tab .form-table tr.licence-wrap td #welcome-wrap{height:170px;padding-top:20px;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);clear:both}.wpmdb .settings-tab .form-table tr.licence-wrap td #welcome-wrap #welcome-img{width:170px;height:170px;float:left}.wpmdb .settings-tab .form-table tr.licence-wrap td #welcome-wrap .welcome-text{height:130px;padding:20px 25px 20px 195px;background:#fff}.wpmdb .settings-tab .form-table tr.licence-wrap td #welcome-wrap .welcome-text h3{font-weight:lighter;font-size:22px;margin-bottom:10px}.wpmdb .settings-tab .form-table tr.licence-wrap td #welcome-wrap .welcome-text p{font-size:15px;line-height:1.5}.wpmdb .settings-tab .form-table tr.licence-wrap td #welcome-wrap .welcome-text a{font-weight:bold}.wpmdb .settings-tab .form-table tr.plugin-compatibility-section td{padding-top:0}.wpmdb .settings-tab .form-table .general-helper{width:20px}.wpmdb .settings-tab .form-table .general-helper:after{top:-1px;font-size:22px;height:20px;left:-1px}.wpmdb .settings-tab .setting-status{padding-left:6px}.wpmdb .settings-tab .slider-label span{font-weight:bold}.wpmdb .allow-remote-reqeusts{font-size:14px;font-weight:bold}.wpmdb .connection-info-label{margin-top:15px;margin-bottom:5px;display:block}.wpmdb .connection-info{clear:both;font-size:15px;line-height:21px;font-family:Consolas, Monaco, monospace;padding:10px 10px;height:67px;text-shadow:0px 1px 0px #fff;display:block;margin-bottom:7px;width:418px}.wpmdb .reset-button-wrap{width:418px}.wpmdb .reset-button-wrap .button{float:left;position:relative}.wpmdb .reset-button-wrap .button:first-of-type{margin-right:10px}.wpmdb .reset-button-wrap .button.copy-api-key .copy-api-key-confirmation{display:none;left:0;position:absolute;text-align:center;top:0;height:100%;width:100%;color:#333}.wpmdb .reset-button-wrap .reset-api-key-ajax-spinner{float:left;margin:4px 7px}.wpmdb .masked-licence{margin-top:0px}.wpmdb .bull{font-size:22px;position:relative;top:4px}.wpmdb .plugin-compatibility-wrap{padding:18px 18px 18px 100px;background-color:#e6e6e6;margin-left:0}.wpmdb .plugin-compatibility-wrap p:last-of-type{margin:10px 0 0 0}.wpmdb ul.plugin-compatibility-options{display:block;margin:10px 0 10px 0px}.wpmdb .plugin-compatibility-spinner{position:relative;top:3px;left:10px}.wpmdb .plugin-compatibility-success-msg{position:relative;left:10px;font-weight:bold}.wpmdb .wpmdb-switch{position:relative;display:inline-block;padding:2px;overflow:hidden;border-radius:2px;background-color:#d4d3d3;cursor:pointer}.wpmdb .wpmdb-switch.on{background-color:#ade7b5}.wpmdb .wpmdb-switch span{visibility:hidden;box-sizing:border-box;float:left;display:inline-block;height:100%;font-size:12px;line-height:20px;border-radius:2px;-webkit-border-radius:2px;font-weight:bold;padding:4px 8px;background:#fff;color:#8d8d8d;z-index:1}.wpmdb .wpmdb-switch span.on{color:#82d78b}.wpmdb .wpmdb-switch span.checked{visibility:visible}.wpmdb .wpmdb-switch.disabled{cursor:default;background:#e6e6e6}.wpmdb .wpmdb-switch.disabled span{background:#f1f1f1;color:#d6d6d6}.wpmdb .wpmdb-switch input[type="checkbox"]{position:absolute !important;top:0;left:0;opacity:0;z-index:-1}.wpmdb .help-tab{display:none}.wpmdb .help-tab h3{font-size:18px;font-weight:normal}.wpmdb .help-tab .support{border-bottom:1px solid #ccc;margin-bottom:25px;padding-bottom:18px}.wpmdb .help-tab .support p{width:640px}.wpmdb .help-tab .support .email a{font-size:12px}.wpmdb .help-tab .support .upgrade-to-pro{font-size:16px;font-weight:bold}.wpmdb .help-tab .support .upgrade-to-pro a{white-space:nowrap}.wpmdb .help-tab .support .ajax-spinner{top:2px}.wpmdb .help-tab .debug .ajax-spinner{top:6px}.wpmdb .help-tab .debug .ajax-success-msg{margin-top:5px}.wpmdb .help-tab .video-viewer{margin-bottom:30px;border:1px solid #ccc}.wpmdb .help-tab .videos{width:640px}.wpmdb .help-tab .videos ul>li{margin-bottom:30px;overflow:hidden;position:relative}.wpmdb .help-tab .videos ul>li a{overflow:hidden;display:block;width:320px;height:180px;float:left;margin-right:15px;position:relative;z-index:1;border:1px solid #ccc}.wpmdb .help-tab .videos ul>li a:before,.wpmdb .help-tab .videos ul>li a:after{position:absolute;content:" ";margin:auto;left:0;right:0;top:0;bottom:0}.wpmdb .help-tab .videos ul>li a:before{width:64px;height:64px;border-radius:64px;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=80);opacity:.8;border:1px solid #ddd;background-color:#fff;z-index:2}.wpmdb .help-tab .videos ul>li a:after{filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=80);opacity:.8;border:21.33333px solid transparent;border-top-width:12.8px;border-bottom-width:12.8px;border-left-color:#333;background:transparent;display:block;left:25px;width:0px;height:0px;z-index:3}.wpmdb .help-tab .videos .video:last-child{margin-bottom:0px}.wpmdb .help-tab .videos img{width:320px;height:240px;position:relative;top:50%;margin-top:-120px}.wpmdb .help-tab .debug{width:640px;border-bottom:1px solid #CCCCCC;margin-bottom:25px;padding-bottom:28px}.wpmdb .help-tab .debug textarea{width:100%;min-height:200px;font-family:Consolas, Monaco, monospace;margin-bottom:5px}.wpmdb .help-tab h4{margin:0 0 0.2em 0}.wpmdb .help-tab p{margin:0 0 0.5em 0}.wpmdb .help-tab iframe{display:none}.wpmdb .addons-tab{display:none}.wpmdb .addons-tab .addon{position:relative;width:100%;min-height:138px;padding:25px 30px 30px 165px;box-sizing:border-box;color:#fff;margin-top:15px}.wpmdb .addons-tab .addon .actions{float:right;font-size:14px}.wpmdb .addons-tab .addon .actions>*{margin-right:10px}.wpmdb .addons-tab .addon .actions *:last-child{margin-right:0}.wpmdb .addons-tab .addon .actions .action{background-color:#fff;font-weight:bold;display:inline-block;padding:0.2em 0.4em}.wpmdb .addons-tab .addon .actions .action:hover{background-color:rgba(255,255,255,0.92)}.wpmdb .addons-tab .addon .actions .status{border-bottom:2px solid #fff;padding-bottom:0.1em}.wpmdb .addons-tab .addon h1{font-weight:normal;float:left;margin:0;margin-top:5px;color:#fff}.wpmdb .addons-tab .addon p{font-size:16px;line-height:1.2em;clear:both;margin:0}.wpmdb .addons-tab .addon p a{text-decoration:underline;color:#fff}.wpmdb .addons-tab .addon p a:hover{color:rgba(255,255,255,0.9)}.wpmdb .addons-tab .addon.wp-migrate-db-pro-media-files{background:#3fab3f url(../img/icon-media-files.svg) no-repeat 30px 30px;background-size:110px 85px}.wpmdb .addons-tab .addon.wp-migrate-db-pro-media-files .action{color:#3fab3f}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli{background:#272822 url(../img/icon-cli.svg) no-repeat 30px 30px;background-size:110px 97px;min-height:157px;color:#ddd}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli .action{color:#272822;background-color:#ddd}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli .action:hover{color:#272822;background-color:#eee}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli .status{border-bottom-color:#ddd}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli p a{color:#ddd}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli p a:hover{color:#f7f7f7}.wpmdb .addons-tab .addon.wp-migrate-db-pro-cli code{white-space:nowrap;margin:0;padding:0}.wpmdb .addons-tab .addon.wp-migrate-db-pro-multisite-tools{background:#a90000 url(../img/icon-multisite-tools.svg) no-repeat 30px 20px;background-size:110px 118px;min-height:157px}.wpmdb .addons-tab .addon.wp-migrate-db-pro-multisite-tools .action{color:#a90000}.wpmdb-not-pro .wpmdb .wpmdb-main{margin-top:15px}.wpmdb-not-pro .wpmdb .help-tab .support p{width:auto}#wpmdb-sidebar{position:absolute;top:-21px;right:-312px;width:292px}#wpmdb-sidebar .block{padding:20px;border:1px solid #ccc}#wpmdb-sidebar .subscribe{border-top:none}#wpmdb-sidebar .subscribe h2{padding:0;margin:0;margin-bottom:0.5em;color:#666;font-size:20px;line-height:1.2em;float:none}#wpmdb-sidebar .subscribe h3{font-size:16px;margin:0}#wpmdb-sidebar .subscribe p{margin:0}#wpmdb-sidebar .subscribe p.interesting{margin-bottom:1em;line-height:1.4}#wpmdb-sidebar .subscribe .links{margin-bottom:2em}#wpmdb-sidebar .subscribe .links a{text-decoration:none}#wpmdb-sidebar .subscribe .promise{color:#999;font-size:12px;line-height:1.4em}#wpmdb-sidebar .subscribe .field{margin-bottom:0.5em}#wpmdb-sidebar .subscribe .field p{margin-bottom:0.3em}#wpmdb-sidebar .subscribe .field.submit-button{margin-bottom:1em}#wpmdb-sidebar .testimonial{border-top:none}#wpmdb-sidebar .testimonial p{margin:0}#wpmdb-sidebar .testimonial .quote{font-size:20px}#wpmdb-sidebar .testimonial .author{white-space:nowrap;text-align:right}#wpmdb-sidebar .testimonial .stars{white-space:nowrap;margin-bottom:5px}#wpmdb-sidebar .testimonial .via{text-align:right;font-size:12px}#wpmdb-sidebar .testimonial .via a{color:#666}#wpmdb-sidebar .testimonial .via a:before{content:"\f301";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 18px/1 'dashicons';vertical-align:top;margin-right:3px}@media (min--moz-device-pixel-ratio: 1.3), (-webkit-min-device-pixel-ratio: 1.3), (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx){#wpmdb-sidebar .wpmdb-banner{background-image:url(../img/wp-migrate-db-pro@2x.jpg);background-size:292px 292px;width:292px;height:292px;display:block}#wpmdb-sidebar .wpmdb-banner img{display:none}}@media screen and (max-width: 1252px){#wpmdb-sidebar{position:relative;top:auto;right:auto;margin-top:50px}}body.mp6 input[type=checkbox]:disabled{opacity:1;border-color:#ccc}body.mp6 #wpmdb-main{font-size:14px}body.mp6 p{font-size:14px}body.mp6 .wrap>h1{float:left}body.mp6 .wrap h2{float:left}body.mp6 .wpmdb .content-tab{padding-top:15px}body.mp6 .wpmdb .migrate-tab{padding-top:0}body.mp6 .wpmdb input[type=checkbox],body.mp6 .wpmdb input[type=radio]{vertical-align:middle;margin-top:-4px}body.mp6 .wpmdb input[type=text],body.mp6 .wpmdb input[type=password]{padding:3px 5px}body.mp6 .wpmdb input.code{padding-top:6px}body.mp6 .wpmdb label{font-size:14px}body.mp6 .wpmdb h2.nav-tab-wrapper{float:none;margin-bottom:0;width:722px;font-size:23px;line-height:29px;padding:9px 0 0 5px}body.mp6 .wpmdb .help-tab h3{margin-top:0}body.mp6 .wpmdb .temp-disabled{background-color:#f9f9f9}body.mp6 .wpmdb .migration-profile-options li a{border-color:#ccc;color:#555;background-color:#e4e4e4}body.mp6 .wpmdb .migration-profile-options li a:hover{background-color:#fff;color:#464646}body.mp6 .wpmdb .connection-info,body.mp6 .wpmdb .migrate-tab .pull-push-connection-info{font-weight:bold;font-size:14px}body.mp6 .wpmdb .general-helper{border:0;width:auto;height:auto;top:auto;margin:0}body.mp6 .wpmdb .general-helper:after{content:"\f223";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 22px/1 'dashicons';vertical-align:top;top:auto;left:auto;position:relative}body.mp6 .wpmdb .helper-message{font-size:14px;line-height:1.4em}body.mp6 .wpmdb .right-arrow{display:none}body.mp6 .wpmdb .arrow-col{width:52px}body.mp6 .wpmdb .arrow-col:after{content:"\f344";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 22px/1 'dashicons';vertical-align:top;color:#999}body.mp6 .wpmdb .arrow-col:hover{cursor:pointer}body.mp6 .wpmdb .arrow-col:hover:after{color:#666}body.mp6 .wpmdb .arrow-col.disabled:after{opacity:0.5}body.mp6 .wpmdb .arrow-col.disabled:hover{cursor:default}body.mp6 .wpmdb .arrow-col.disabled:hover:after{color:#999}body.mp6 .wpmdb .find-heading{width:409px}body.mp6 .wpmdb .replace-fields input{width:304px}body.mp6 .wpmdb .replace-right-col span{border-color:#999}body.mp6 .wpmdb .replace-right-col span:hover{border-color:#666}body.mp6 .wpmdb .replace-add-row:after,body.mp6 .wpmdb .replace-add-row:before{background-color:#999}body.mp6 .wpmdb .replace-add-row:hover:after,body.mp6 .wpmdb .replace-add-row:hover:before{background-color:#666}body.mp6 .wpmdb .option-group.migrate-selection>li>label{font-size:16px}body.mp6 .wpmdb .saved-migration-profile-label{font-size:16px}body.mp6 .wpmdb .option-heading,body.mp6 .wpmdb .checkbox-label{font-size:16px}body.mp6 .wpmdb .checkbox-label input[type=checkbox]{top:auto}body.mp6 .wpmdb .return-to-profile-selection{font-size:14px}body.mp6 .wpmdb .option-description{font-size:13px}body.mp6 .wpmdb .save-migration-profile-wrap li{position:relative}body.mp6 .wpmdb .replace-remove-row,body.mp6 .wpmdb .delete-profile{border:0;border-radius:0;height:auto;width:auto;left:0;top:50%;margin-left:0}body.mp6 .wpmdb .replace-remove-row:after,body.mp6 .wpmdb .delete-profile:after{content:"\f153";display:inline-block;-webkit-font-smoothing:antialiased;font:normal 18px/1 'dashicons';vertical-align:middle;color:#999}body.mp6 .wpmdb .replace-remove-row:hover:after,body.mp6 .wpmdb .delete-profile:hover:after{color:#666}body.mp6 .wpmdb .row-action-buttons{position:relative;width:60px}body.mp6 .wpmdb .row-action-buttons .helper-message{width:320px}body.mp6 .wpmdb .row-action-buttons .replace-remove-row{margin-left:4px;border:0;border-radius:50%;height:22px;width:auto;left:0;top:0;display:block;float:left;position:relative;margin-top:0}body.mp6 .wpmdb .row-action-buttons .replace-remove-row:after{display:inline-block;vertical-align:top;top:auto;position:relative;left:auto;height:22px;line-height:22px}body.mp6 .wpmdb .row-action-buttons .general-helper{display:inline-block;position:static;margin-left:4px}body.mp6 .wpmdb .row-action-buttons .general-helper:first-child{margin-left:2px}body.mp6 .wpmdb .row-action-buttons .general-helper:after{display:inline-block;vertical-align:top;top:auto;left:auto;position:relative}body.mp6 .wpmdb .delete-profile:after{color:#ccc}body.mp6 .wpmdb .delete-profile:hover:after{color:#aaa}body.mp6 .wpmdb .addons-tab .addons-content>div:nth-child(1),body.mp6 .wpmdb .addons-tab .addons-content>article:nth-child(1){margin-top:0px}body.mp6 .wpmdb .addons-tab .addon h1{font-weight:300;font-size:25px;margin-top:2px}body.mp6 .wpmdb .addons-tab .addon.wp-migrate-db-pro-cli h1{margin-top:5px}body.mp6 .wpmdb .addons-tab .addon p{font-size:14px;line-height:1.4em}body.mp6 .wpmdb .help-tab .support p,body.mp6 .wpmdb .help-tab .support .email a{font-size:14px}body.mp6 .wpmdb .help-tab div.warning p{font-size:13px}body.mp6 .wpmdb .help-tab .videos h4,body.mp6 .wpmdb .help-tab .videos p{font-size:14px}body.mp6 .wpmdb .inline-message,body.mp6 .wpmdb .notification-message{border-radius:0;border:0;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);padding:10px 14px;font-size:13px}body.mp6 .wpmdb .notification-message{margin-bottom:20px;background-color:#fff}body.mp6 .wpmdb .notification-message.ssl-notice,body.mp6 .wpmdb .notification-message.invalid-licence,body.mp6 .wpmdb .notification-message.unrecognized-import-file-notice{margin-bottom:0;margin-top:15px}body.mp6 .wpmdb .notification-message.backup-option-disabled{line-height:1.8em}body.mp6 .wpmdb .notification-message.backup-option-disabled a{text-decoration:underline}body.mp6 .wpmdb .notification-message.backup-option-disabled a:hover{text-decoration:none}body.mp6 .wpmdb .notification-message.backup-option-disabled .upload-directory-location{font-weight:bold}body.mp6 .wpmdb .notification-message p{font-size:13px;margin-top:0}body.mp6 .wpmdb .notification-message p:last-child{margin:0}body.mp6 .wpmdb .notification-message h4{margin-top:0}body.mp6 .wpmdb .notification-message a{color:#0074a2;text-decoration:none}body.mp6 .wpmdb .notification-message a:hover{color:#2ea2cc}body.mp6 .wpmdb div.notification-message.invalid-licence p:last-child{margin:0.5em 0}body.mp6 .wpmdb div.notification-message.invalid-licence p:last-child a.button{color:#555555}body.mp6 .wpmdb .inline-message.error,body.mp6 .wpmdb .notification-message.error-notice{border-left:4px solid #dd3d36;background-color:#fff}body.mp6 .wpmdb .inline-message.warning,body.mp6 .wpmdb .notification-message.warning-notice{background-color:#fff;border-left:4px solid #ffba00}body.mp6 .wpmdb .inline-message.success,body.mp6 .wpmdb .notification-message.success-notice{border-left:4px solid #7ad03a}body.mp6 .wpmdb .ssl-notice{margin-bottom:0}body.mp6 .wpmdb .different-plugin-version-notice,body.mp6 .wpmdb .directory-permission-notice{margin-bottom:10px}body.mp6 .wpmdb .licence-status{color:#444;float:left;font-weight:normal}body.mp6 #overlay{background-color:rgba(0,0,0,0.5)}body.mp6 .migration-progress-ajax-spinner{top:20px}#overlay{background-color:rgba(255,255,255,0.9);position:fixed;top:0;left:0;width:100%;height:100%;z-index:100000;overflow-x:auto;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-transition:opacity .3s ease-out;transition:opacity .3s ease-out}#overlay.show{opacity:1;display:-webkit-box;display:-ms-flexbox;display:flex}@media screen and (max-width: 700px){#overlay.show{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}}#overlay.hide{opacity:0;display:-webkit-box;display:-ms-flexbox;display:flex}@media screen and (max-width: 1120px){.wpmdb-not-pro #overlay.show{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}}.stage-tabs{margin:0;z-index:5}.stage-tabs .stage-tab{box-sizing:border-box;display:block;float:left;width:auto;height:45px;margin:0 5px -1px 0;background-color:#ddd;border:1px solid #aaa;padding:.5em 1.5em 0;line-height:1.3;text-align:center;text-transform:capitalize;color:#333;-webkit-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out}.stage-tabs .stage-tab.active{background-color:#fff;border-bottom-color:#fff}.stage-tabs .stage-status{display:block;font-size:.8em;font-style:italic}.complete .stage-tabs .stage-tab:not(.active){cursor:pointer}.complete .stage-tabs .stage-tab:not(.active):hover{background-color:#eee}.migration-progress-stages{position:relative;margin:0 -30px 0;background:#fff;overflow-y:auto}.migration-progress-stages .migration-progress-stage-container{top:0;left:0;width:100%;padding:0}.migration-progress-stages .migration-progress-stage-container.queued,.migration-progress-stages .migration-progress-stage-container.complete{display:none}.migration-progress-stages .migration-progress-stage-container.active{display:block}.migration-progress-stages .migration-progress-stage-container.find_replace .progress-items .item-progress .size{display:none}.migration-progress-stages .migration-progress-stage-container.upload .progress-items,.migration-progress-stages .migration-progress-stage-container.import .progress-items{height:0px !important;opacity:0}.migration-progress-stages .truncation-notice{margin:-10px 30px 10px;padding:5px 10px;color:#999;text-align:center}.migration-progress-stages .hide-tables .truncation-notice{display:none}.migration-progress-stages .progress-items{position:relative;overflow-y:auto;padding:10px 30px 10px;z-index:0}.migration-progress-stages .item-progress{position:relative;background-color:#eee;overflow:hidden;margin:0 0 .8em 0;-webkit-transition:height .2s ease-in-out, margin .2s ease-in-out;transition:height .2s ease-in-out, margin .2s ease-in-out}.migration-progress-stages .item-progress .dashicons-yes.dashicons{position:absolute;right:.3em;top:0.12em;z-index:20;background:#333;color:#85d937;width:.75em;height:.75em;border-radius:50%;text-indent:-.18em;line-height:.8;vertical-align:2em;font-size:2em;opacity:0;-webkit-transition:opacity .3s ease-in;transition:opacity .3s ease-in;-webkit-transition-delay:.5s;transition-delay:.5s}.migration-progress-stages .item-progress.complete .dashicons-yes{opacity:1}.migration-progress-stages .item-progress .progress-bar{background:#85d937}.migration-progress-stages .item-progress .item-info{margin:0;position:relative;padding:.25em 0 .25em 1em;font-size:1em;z-index:10}.migration-progress-stages .hide-tables .progress-items{height:0px !important;opacity:0}@-webkit-keyframes progress-bg-anim{0%{background-position:0 0}100%{background-position:50px 50px}}@keyframes progress-bg-anim{0%{background-position:0 0}100%{background-position:50px 50px}}.clearfix:before,.clearfix:after{content:"";display:table}.clearfix:after{clear:both}.clearfix{zoom:1}.general-spinner{width:16px;height:16px}.migration-error{color:#a21b1b;display:block;max-height:400px;max-width:100%;overflow:auto;word-wrap:break-word}.migration-php-errors{display:none;margin:20px 0;overflow-y:scroll;height:180px}.progress-overlay-container{display:none;position:relative;background-color:#eee;padding:30px 30px 15px;box-shadow:0 0 10px rgba(0,0,0,0.5);cursor:default;font-size:14px;z-index:1;margin:0 10px;box-sizing:border-box;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;max-height:95%;overflow-y:hidden;-webkit-transition:opacity .3s ease-out, -webkit-transform .5s ease-out;transition:opacity .3s ease-out, transform .5s ease-out;width:700px;min-width:700px;-ms-flex-preferred-size:700px;flex-basis:700px;-webkit-box-flex:0;-ms-flex:0 1 0%;flex:0 1 0%}.progress-overlay-container.show{display:-webkit-box;display:-ms-flexbox;display:flex;opacity:1}.progress-overlay-container.hide{display:-webkit-box;display:-ms-flexbox;display:flex;opacity:0;-webkit-transform:translateY(-100%);transform:translateY(-100%)}.progress-overlay-container>div{-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto}.progress-overlay-container .migration-progress-stages{-webkit-box-flex:100;-ms-flex:100 1 auto;flex:100 1 auto}@media all and (-ms-high-contrast: none){.progress-overlay-container .migration-progress-stages{height:300px}}.progress-overlay-container .progress-title{margin-top:0;font-size:22px;font-weight:normal;width:85%;line-height:1.3}.progress-overlay-container .progress-title .domain-label{white-space:nowrap}.progress-overlay-container .progress-title .dashicons{display:inline;vertical-align:middle;margin-left:-.15em;padding-right:.3em;font-size:42px}.progress-overlay-container .progress-info-wrapper{margin-bottom:10px}.progress-overlay-container .progress-text{clear:left;float:left;width:100%}.progress-overlay-container .timer{position:absolute;top:35px;right:55px}.progress-overlay-container .progress-bar{position:absolute;top:0;left:0;height:100%;-webkit-transition:width 1s ease-out;transition:width 1s ease-out;z-index:0}.progress-overlay-container .stage-progress{display:none;text-transform:capitalize;padding:15px 30px 0;margin:0 -30px;height:65px;box-sizing:border-box;background:#fff;border-top:1px solid #aaa;z-index:100}.progress-overlay-container .stage-progress.active{display:block}.progress-overlay-container .stage-progress .lowercase{text-transform:lowercase}.progress-overlay-container .stage-progress .items-complete{margin-left:3em}.progress-overlay-container .stage-progress .progress-bar-wrapper{position:relative;height:10px;width:100%;background-color:#eee;margin:15px 0 10px;background-image:-webkit-linear-gradient(135deg, rgba(255,255,255,0.35) 25%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 50%, rgba(255,255,255,0.35) 50%, rgba(255,255,255,0.35) 75%, rgba(0,0,0,0) 75%, rgba(0,0,0,0));background-image:linear-gradient(-45deg, rgba(255,255,255,0.35) 25%,rgba(0,0,0,0) 25%,rgba(0,0,0,0) 50%,rgba(255,255,255,0.35) 50%,rgba(255,255,255,0.35) 75%,rgba(0,0,0,0) 75%,rgba(0,0,0,0));background-size:20px 20px;-webkit-animation:progress-bg-anim 5s linear infinite;animation:progress-bg-anim 5s linear infinite}.progress-overlay-container .stage-progress .progress-bar{background-color:#406fa4}.progress-overlay-container .stage-progress .show-hide-tables{display:block;float:right;cursor:pointer}.progress-overlay-container .stage-progress.import .show-hide-tables,.progress-overlay-container .stage-progress.upload .show-hide-tables{display:none}.progress-overlay-container .stage-progress.import .items-complete-wrap,.progress-overlay-container .stage-progress.upload .items-complete-wrap{display:none}.progress-overlay-container .stage-progress.find_replace .size-complete-wrap{display:none}.progress-overlay-container .stage-progress.find_replace .items-complete{margin-left:9em}.progress-overlay-container .progress-tables{overflow:hidden;margin-bottom:2px;padding:0 0 20px 0}.progress-overlay-container .progress-tables-hover-boxes{position:absolute;top:0px;left:0px;display:block;width:100%}.progress-overlay-container .progress-chunk-hover{display:block;float:left;height:35px;position:relative;top:-5px;z-index:1}.progress-overlay-container .progress-chunk{box-sizing:border-box;float:left;display:block;height:6px;border-right:1px solid #ccc;border-bottom:1px solid #ccc;color:#999;position:relative;text-align:center}.progress-overlay-container .progress-chunk>span{padding:0px 3px;white-space:nowrap;text-overflow:ellipsis;margin-top:10px;display:inline-block}.progress-overlay-container .progress-label{padding:5px 10px;border:1px solid #ccc;border-radius:3px;background-color:#fff;font-family:Consolas, Monaco, monospace;font-size:12px;display:inline-block;top:-35px;position:absolute;opacity:0;-webkit-transition:opacity 200ms ease-in-out;transition:opacity 200ms ease-in-out}.progress-overlay-container .label-visible{opacity:1}.progress-overlay-container .progress-label:before{content:"";width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #ccc;display:block;position:absolute;bottom:-5px;left:50%;margin-left:-2px}.progress-overlay-container .progress-label:after{content:"";width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #fff;display:block;position:absolute;bottom:-4px;left:50%;margin-left:-2px}.progress-overlay-container .migration-progress-ajax-spinner{left:7px;position:relative;top:15px}.progress-overlay-container .close-progress-content{color:#999;cursor:pointer;font-size:26px;font-weight:200;position:absolute;right:10px;top:5px;padding:5px;display:none}.progress-overlay-container .close-progress-content:hover{color:#666;border-color:#aaa}.progress-overlay-container .migration-controls{display:block;-webkit-transition:opacity .2s ease-out;transition:opacity .2s ease-out;padding-top:15px}.progress-overlay-container .migration-controls.hidden{opacity:0;pointer-events:none}.progress-overlay-container .migration-controls span{float:left;text-align:center;display:block}.progress-overlay-container .migration-controls span:first-child{margin-right:10px;width:71px}.progress-overlay-container .migration-controls .pause-before-finalize{display:none;float:right;margin-top:5px}.progress-overlay-container .migration-controls #pause-before-finalize{margin-top:0}.progress-overlay-container .pro-version{margin-top:45px;padding-top:40px;position:relative;border-top:1px solid #ccc}.progress-overlay-container .pro-version iframe{position:absolute;top:40px;right:0;display:block}.progress-overlay-container .pro-version-content{padding-right:460px;min-height:255px}.progress-overlay-container .pro-version-content h1{line-height:1em;margin-top:0;font-size:20px}.progress-overlay-container .pro-version-content ul{margin-left:24px}.progress-overlay-container .pro-version-content li{position:relative;font-size:14px;line-height:1.4em;margin-bottom:15px;max-width:580px}.progress-overlay-container .pro-version-content .pro-quote{margin:0 0 20px 0;max-width:570px}.progress-overlay-container .pro-version-content .pro-quote .dashicons-star-filled{font-size:16px;width:16px;height:16px;position:relative;top:2px}.progress-overlay-container .pro-version-content .pro-quote-author{font-style:italic;white-space:nowrap}.progress-overlay-container.wpmdb-error{outline:3px solid #dc3232}@media screen and (max-width: 1096px){.progress-overlay-container .pro-version iframe{position:relative;top:auto;right:auto}.progress-overlay-container .pro-version-content{min-height:0;padding:0 0 20px 0}}.progress-overlay-container:not(.complete) .migration-progress-stages .item-progress:first-child{background-image:-webkit-linear-gradient(135deg, rgba(255,255,255,0.3) 25%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 50%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0.3) 75%, rgba(0,0,0,0) 75%, rgba(0,0,0,0));background-image:linear-gradient(-45deg, rgba(255,255,255,0.3) 25%,rgba(0,0,0,0) 25%,rgba(0,0,0,0) 50%,rgba(255,255,255,0.3) 50%,rgba(255,255,255,0.3) 75%,rgba(0,0,0,0) 75%,rgba(0,0,0,0));background-size:50px 50px;-webkit-animation:progress-bg-anim 2s linear infinite;animation:progress-bg-anim 2s linear infinite}.progress-overlay-container.paused .active.stage-progress .progress-bar-wrapper{-webkit-animation-play-state:paused;animation-play-state:paused}.progress-overlay-container.paused .migration-progress-stages .item-progress:first-child{-webkit-animation-play-state:paused;animation-play-state:paused}.progress-overlay-container .migration-progress-stages .determining-media .item-progress:first-child{background-image:none;-webkit-animation:none;animation:none}.progress-overlay-container.cancelled .stage-tabs,.progress-overlay-container.cancelled .migration-progress-stages,.progress-overlay-container.cancelled .stage-progress.active,.progress-overlay-container.wpmdb-error .stage-tabs,.progress-overlay-container.wpmdb-error .migration-progress-stages,.progress-overlay-container.wpmdb-error .stage-progress.active{display:none}.migrate-tab>.pro-version{display:none}#overlay .pro-version{width:42%;padding-left:0;padding-right:0;-ms-flex-preferred-size:42%;flex-basis:42%;max-width:515px;min-width:400px;max-height:100%;-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2;font-size:14px;display:block;-webkit-transition:-webkit-transform .3s ease-out, opacity .3s ease-out, margin-left .2s .3s ease-in-out;transition:transform .3s ease-out, opacity .3s ease-out, margin-left .2s .3s ease-in-out}#overlay .pro-version.remove{margin-left:-525px !important}#overlay .pro-version .pro-version-content{padding:0 30px}#overlay .pro-version .pro-version-content h1{font-size:22px;font-weight:bold;margin:0 0 30px}#overlay .pro-version .pro-version-content li{margin-bottom:10px;padding-left:35px;position:relative}#overlay .pro-version .pro-version-content li .dashicons{display:block;position:absolute;font-size:2em;top:-3px;left:0}#overlay .pro-version .pro-version-content .pro-quote{border:1px solid #bbb;border-radius:3px;padding:15px 15px 15px 100px;margin:30px 0;position:relative;background:url("../img/mor10.png") no-repeat 15px 31px;background-size:51px 51px}@media (min--moz-device-pixel-ratio: 1.3), (-webkit-min-device-pixel-ratio: 1.3), (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx){#overlay .pro-version .pro-version-content .pro-quote{background-image:url("../img/mor10@2x.png")}}#overlay .pro-version .pro-version-content .pro-quote p{margin:0;font-size:13px}#overlay .pro-version .pro-version-content .pro-quote .pro-quote-author{font-size:14px;font-weight:bold;color:#999;margin-bottom:5px}#overlay .pro-version .pro-version-content .pro-quote .pro-quote-author .dashicons{float:right;color:#999}#overlay .pro-version .pro-version-content .pro-quote .stars{position:absolute;bottom:0;left:0;width:100%;height:0;overflow:visible;text-align:center}#overlay .pro-version .pro-version-content .pro-quote .stars span{background:#eee;color:#999;margin-top:-.5em}#overlay .pro-version .pro-version-content .pro-quote .stars span:first-child{padding-left:.1em}#overlay .pro-version .pro-version-content .pro-quote .stars span:last-child{padding-right:.1em}#overlay .pro-version iframe,#overlay .pro-version .iframe{width:100%;height:289px;background:#000}#overlay .pro-version .button{display:block;position:relative;width:250px;margin:20px auto 10px;text-align:center}#overlay .pro-version .close-pro-version{color:#999;cursor:pointer;font-size:26px;font-weight:200;position:absolute;right:10px;top:5px;padding:5px;display:block}#overlay .pro-version .close-pro-version:hover{color:#666;border-color:#aaa}
asset/dist/js/{common-092.js → common-10.js} RENAMED
@@ -193,3 +193,31 @@ wpmdb.functions.convertKBSizeToHRFixed = function( size, dec, kbSize ) {
193
  }
194
  return hrSizeArray[ 0 ] + ' ' + hrSizeArray[ 1 ];
195
  };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
  }
194
  return hrSizeArray[ 0 ] + ' ' + hrSizeArray[ 1 ];
195
  };
196
+
197
+ wpmdb.functions.ajax_handle_dismissible_notice = function( nonce, callback, ele ) {
198
+ jQuery.ajax( {
199
+ url: ajaxurl,
200
+ type: 'POST',
201
+ dataType: 'text',
202
+ cache: false,
203
+ data: {
204
+ action: 'wpmdb_process_notice_link',
205
+ nonce: nonce,
206
+ notice: jQuery( ele ).data( 'notice' ),
207
+ type: jQuery( ele ).data( 'type' ),
208
+ reminder: jQuery( ele ).data( 'reminder' )
209
+ },
210
+ beforeSend: callback( ele )
211
+ } );
212
+ };
213
+
214
+ wpmdb.functions.get_spinner_url = function() {
215
+ var admin_url = ajaxurl.replace( '/admin-ajax.php', '' ), spinner_url = admin_url + '/images/spinner';
216
+
217
+ if ( 2 < window.devicePixelRatio ) {
218
+ spinner_url += '-2x';
219
+ }
220
+ spinner_url += '.gif';
221
+
222
+ return spinner_url;
223
+ };
asset/dist/js/{common-092.min.js → common-10.min.js} RENAMED
@@ -1 +1 @@
1
- function wpmdb_toggle_migration_action_text(){jQuery(".action-text").hide(),jQuery(".action-text."+jQuery("input[name=action]:checked").val()).show()}function wpmdb_migration_type(){var a=jQuery("input[name=action]:checked");return 0===a.length?"":a.val()}function wpmdb_call_next_hook(){wpmdb.common.call_stack.length||(wpmdb.common.call_stack=wpmdb.common.hooks);var a=wpmdb.common.call_stack[0];wpmdb.common.call_stack.shift(),a.call(this)}function wpmdb_add_commas(a){a+="";for(var b=a.split("."),c=b[0],d=1<b.length?"."+b[1]:"",e=/(\d+)(\d{3})/;e.test(c);)c=c.replace(e,"$1,$2");return c+d}function wpmdb_parse_json(a){var b={};try{b=jQuery.parseJSON(a)}catch(c){return!1}return b}function wpmdbGetAjaxErrors(a,b,c,d){var e=!1,f="",g=wpmdb_parse_json(c);if(!1===g){e=!0,a=wpmdb_strings.ajax_json_message,b="(#144)";var h=c;c=wpmdb_strings.ajax_json_errors+" "+b,c+='<br><a class="show-errors-toggle" href="#">'+wpmdb_strings.view_error_messages+"</a> ",c+='<div class="migration-php-errors">'+h+"</div>"}return(e||"undefined"!==d)&&(f+="<strong>"+a+"</strong> &mdash; "),e||"undefined"===d||(f+=wpmdb_strings.status+": "+d.status+" "+d.statusText,f+="<br /><br />"+wpmdb_strings.response+":<br />"),e||(c+=" "+b),f+=c}var wpmdb=wpmdb||{};wpmdb.common={hooks:[],call_stack:[],non_fatal_errors:"",migration_error:!1},wpmdb.functions={},wpmdb.preg_quote=function(a,b){return String(a).replace(new RegExp("[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\"+(b||"")+"-]","g"),"\\$&")},wpmdb.table_is=function(a,b,c){if((a+b).toLowerCase()===c.toLowerCase())return!0;var d=wpmdb.preg_quote(c),e=new RegExp(a+"([0-9]+)_"+b,"i"),f=e.exec(d);return null!=f},wpmdb.subsite_for_table=function(a,b){var c=wpmdb.preg_quote(b),d=new RegExp(a+"([0-9]+)_","i"),e=d.exec(c);return null===e?1:e[1]},wpmdb.functions.convertKBSizeToHR=function(a,b,c,d){var e,f;if(c=c||1e3,b=b||2,a=parseInt(a),c>Math.abs(a))e=[a.toFixed(0),"KB"];else{f=["MB","GB","TB","PB","EB","ZB","YB"];var g=-1;do a/=c,++g;while(Math.abs(a)>=c&&g<f.length-1);e=[Math.round(a*Math.pow(10,b))/Math.pow(10,b),f[g]]}return d||(e=e[0]+" "+e[1]),e},wpmdb.functions.convertKBSizeToHRFixed=function(a,b,c){b=b||2;var d=wpmdb.functions.convertKBSizeToHR(a,b,c,!0);return"KB"!==d[1]?d[0].toFixed(2)+" "+d[1]:d[0]+" "+d[1]};
1
+ function wpmdb_toggle_migration_action_text(){jQuery(".action-text").hide(),jQuery(".action-text."+jQuery("input[name=action]:checked").val()).show()}function wpmdb_migration_type(){var a=jQuery("input[name=action]:checked");return 0===a.length?"":a.val()}function wpmdb_call_next_hook(){wpmdb.common.call_stack.length||(wpmdb.common.call_stack=wpmdb.common.hooks);var a=wpmdb.common.call_stack[0];wpmdb.common.call_stack.shift(),a.call(this)}function wpmdb_add_commas(a){a+="";for(var b=a.split("."),c=b[0],d=1<b.length?"."+b[1]:"",e=/(\d+)(\d{3})/;e.test(c);)c=c.replace(e,"$1,$2");return c+d}function wpmdb_parse_json(a){var b={};try{b=jQuery.parseJSON(a)}catch(c){return!1}return b}function wpmdbGetAjaxErrors(a,b,c,d){var e=!1,f="",g=wpmdb_parse_json(c);if(!1===g){e=!0,a=wpmdb_strings.ajax_json_message,b="(#144)";var h=c;c=wpmdb_strings.ajax_json_errors+" "+b,c+='<br><a class="show-errors-toggle" href="#">'+wpmdb_strings.view_error_messages+"</a> ",c+='<div class="migration-php-errors">'+h+"</div>"}return(e||"undefined"!==d)&&(f+="<strong>"+a+"</strong> &mdash; "),e||"undefined"===d||(f+=wpmdb_strings.status+": "+d.status+" "+d.statusText,f+="<br /><br />"+wpmdb_strings.response+":<br />"),e||(c+=" "+b),f+=c}var wpmdb=wpmdb||{};wpmdb.common={hooks:[],call_stack:[],non_fatal_errors:"",migration_error:!1},wpmdb.functions={},wpmdb.preg_quote=function(a,b){return String(a).replace(new RegExp("[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\"+(b||"")+"-]","g"),"\\$&")},wpmdb.table_is=function(a,b,c){if((a+b).toLowerCase()===c.toLowerCase())return!0;var d=wpmdb.preg_quote(c),e=new RegExp(a+"([0-9]+)_"+b,"i"),f=e.exec(d);return null!=f},wpmdb.subsite_for_table=function(a,b){var c=wpmdb.preg_quote(b),d=new RegExp(a+"([0-9]+)_","i"),e=d.exec(c);return null===e?1:e[1]},wpmdb.functions.convertKBSizeToHR=function(a,b,c,d){var e,f;if(c=c||1e3,b=b||2,a=parseInt(a),c>Math.abs(a))e=[a.toFixed(0),"KB"];else{f=["MB","GB","TB","PB","EB","ZB","YB"];var g=-1;do a/=c,++g;while(Math.abs(a)>=c&&g<f.length-1);e=[Math.round(a*Math.pow(10,b))/Math.pow(10,b),f[g]]}return d||(e=e[0]+" "+e[1]),e},wpmdb.functions.convertKBSizeToHRFixed=function(a,b,c){b=b||2;var d=wpmdb.functions.convertKBSizeToHR(a,b,c,!0);return"KB"!==d[1]?d[0].toFixed(2)+" "+d[1]:d[0]+" "+d[1]},wpmdb.functions.ajax_handle_dismissible_notice=function(a,b,c){jQuery.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_process_notice_link",nonce:a,notice:jQuery(c).data("notice"),type:jQuery(c).data("type"),reminder:jQuery(c).data("reminder")},beforeSend:b(c)})},wpmdb.functions.get_spinner_url=function(){var a=ajaxurl.replace("/admin-ajax.php",""),b=a+"/images/spinner";return 2<window.devicePixelRatio&&(b+="-2x"),b+=".gif"};
asset/dist/js/dismissable-notices-10.js ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function( $ ) {
2
+
3
+ //If there's an error message visible about the mu-plugins folder not being writable
4
+ if ( 0 < $( '.wpmdb-compat-plugin-row-error' ).length ) {
5
+ $( '[data-slug="wp-migrate-db-pro"]' ).addClass( 'wpmdbpro-has-message' );
6
+ }
7
+
8
+ //For the free plugin the update class needs to be present
9
+ $( '.wpmdbpro-custom' ).prev().addClass( 'update' );
10
+
11
+ $( '.notice-link-plugins-page' ).click( function( e ) {
12
+ e.preventDefault();
13
+ var self = jQuery( this );
14
+
15
+ wpmdb.functions.ajax_handle_dismissible_notice( wpmdb_nonces.process_notice_link, function( ele ) {
16
+ $( ele ).closest( '.wpmdbpro-custom' ).hide();
17
+
18
+ // remove .wpmdb-has-message class from parent TR to add the bottom border back in
19
+ $( ele ).closest( 'tr' ).siblings( 'tr.wpmdbpro-has-message' ).removeClass( 'wpmdbpro-has-message' );
20
+ }, self );
21
+
22
+ $( '.wpmdbpro-custom' ).prev().removeClass( 'update' );
23
+ } );
24
+ })( jQuery );
asset/dist/js/dismissable-notices-10.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(a){0<a(".wpmdb-compat-plugin-row-error").length&&a('[data-slug="wp-migrate-db-pro"]').addClass("wpmdbpro-has-message"),a(".wpmdbpro-custom").prev().addClass("update"),a(".notice-link-plugins-page").click(function(b){b.preventDefault();var c=jQuery(this);wpmdb.functions.ajax_handle_dismissible_notice(wpmdb_nonces.process_notice_link,function(b){a(b).closest(".wpmdbpro-custom").hide(),a(b).closest("tr").siblings("tr.wpmdbpro-has-message").removeClass("wpmdbpro-has-message")},c),a(".wpmdbpro-custom").prev().removeClass("update")})}(jQuery);
asset/dist/js/{hook-092.js → hook-10.js} RENAMED
File without changes
asset/dist/js/{hook-092.min.js → hook-10.min.js} RENAMED
File without changes
asset/dist/js/import-10.js ADDED
@@ -0,0 +1,602 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function( $, wpmdb ) {
2
+
3
+ var import_selected = false;
4
+ var $import_select = $( '#select-tables' ).clone();
5
+ var tables_to_search = [];
6
+ var tables_to_import = [];
7
+ var unrecognized_import_file = false;
8
+ var import_prefix = '';
9
+ var import_info = {};
10
+ var ajax_spinner = '<img src="' + wpmdb.functions.get_spinner_url() + '" alt="" class="ajax-spinner general-spinner" />';
11
+
12
+ /**
13
+ * Returns the migration status label for imports
14
+ *
15
+ * @param string label
16
+ * @param object args
17
+ *
18
+ * @returns {string}
19
+ */
20
+ function import_migration_status_label( label, args ) {
21
+ if ( 'import' === args.intent ) {
22
+ if ( 'completed' === args.stage ) {
23
+ label = wpmdb_strings.import_label_completed;
24
+ } else {
25
+ label = wpmdb_strings.import_label_migrating;
26
+ }
27
+ }
28
+
29
+ return label;
30
+ }
31
+ $.wpmdb.add_filter( 'wpmdb_get_migration_status_label', import_migration_status_label );
32
+
33
+ /**
34
+ * Updates the connection info box for imports
35
+ *
36
+ * @param object args
37
+ */
38
+ function import_connection_info_box( args ) {
39
+ var $import_file_status = $( '.import-file-status' );
40
+
41
+ if ( 'import' === args.migration_type ) {
42
+
43
+ if ( ! import_selected ) {
44
+ $( '.step-two' ).hide();
45
+
46
+ if ( $import_file_status.hasClass( 'profile-loaded' ) ) {
47
+ $import_file_status.attr( 'class', 'import-file-status profile-loaded notification-message success-notice' );
48
+ $import_file_status.html( wpmdb_strings.import_profile_loaded );
49
+ } else {
50
+ $import_file_status.html( wpmdb_strings.please_select_sql_file );
51
+ }
52
+
53
+ $import_file_status.show();
54
+ } else {
55
+ if ( unrecognized_import_file ) {
56
+ $( '.unrecognized-import-file-notice' ).show();
57
+ }
58
+ }
59
+
60
+ maybe_show_find_replace_options();
61
+
62
+ $( '.mst-options' ).hide();
63
+ $( '.import-find-replace-option, .import-active-plugin-option' ).show();
64
+ } else {
65
+ $( '.find-replace-rows, .table-options, .advanced-options, .exclude-post-types-options, label[for="backup-selected"]' ).show();
66
+ $( '.import-find-replace-option, .find-replace-options, .import-file-status, .import-active-plugin-option, .unrecognized-import-file-notice' ).hide();
67
+
68
+ if ( 'search_all_imported' === $( 'input[name=table_migrate_option]:checked' ).val() ) {
69
+ $( 'input[name=table_migrate_option][value=migrate_only_with_prefix]' ).prop( 'checked', true );
70
+ }
71
+ }
72
+ }
73
+ $.wpmdb.add_action( 'move_connection_info_box', import_connection_info_box );
74
+
75
+ /**
76
+ * Starts the upload process for the import
77
+ *
78
+ * @param stage
79
+ */
80
+ function maybe_initiate_import( stage ) {
81
+ if ( 'import' === wpmdb_migration_type() ) {
82
+ if ( 'backup' === stage ) {
83
+ wpmdb.common.hooks.push( wpmdb.functions.migrate_table_recursive );
84
+ }
85
+
86
+ wpmdb.common.hooks.push( wpmdb.functions.upload_file_recursive );
87
+ wpmdb.common.next_step_in_migration = { fn: wpmdb_call_next_hook };
88
+ wpmdb.functions.execute_next_step();
89
+ }
90
+ }
91
+ $.wpmdb.add_action( 'wpmdb_migration_initiated', maybe_initiate_import );
92
+
93
+ /**
94
+ * Restores the import select when changing migration types
95
+ */
96
+ function update_import_table_select() {
97
+ $( '#select-tables' ).remove();
98
+ $( '.select-tables-wrap' ).prepend( $import_select );
99
+ $( '#select-tables' ).change();
100
+ }
101
+ $.wpmdb.add_action( 'wpmdb_update_import_table_select', update_import_table_select );
102
+
103
+ /**
104
+ * Updates the selected tables for the "Backup tables that will be replaced during the import" option
105
+ *
106
+ * @param tables_to_backup
107
+ *
108
+ * @return array
109
+ */
110
+ function backup_selected_for_import( tables_to_backup ) {
111
+ if ( 'import' === wpmdb_migration_type() ) {
112
+ tables_to_backup = tables_to_import;
113
+ }
114
+
115
+ return tables_to_backup;
116
+ }
117
+ $.wpmdb.add_filter( 'wpmdb_backup_selected_tables', backup_selected_for_import );
118
+
119
+ /**
120
+ * Adds the import migration stage
121
+ *
122
+ * object args
123
+ */
124
+ function add_import_stage( args ) {
125
+ if ( 'import' === wpmdb_migration_type() ) {
126
+ wpmdb.current_migration.model.addStage( 'upload', [], 'local', {
127
+ strings: {
128
+ stage_title: wpmdb_strings.upload
129
+ }
130
+ } );
131
+
132
+ wpmdb.current_migration.model.addStage( 'import', [], 'local', {
133
+ strings: {
134
+ stage_title: wpmdb_strings.migrate_button_import
135
+ }
136
+ } );
137
+
138
+ if ( $( '#import-find-replace' ).is( ':checked' ) ) {
139
+ tables_to_search = args.tables_to_migrate;
140
+ wpmdb.current_migration.model.addStage( 'find_replace', [], 'local', {
141
+ strings: {
142
+ migrated: wpmdb_strings.searched,
143
+ stage_title: wpmdb_strings.migrate_button_find_replace
144
+ }
145
+ } );
146
+ }
147
+ }
148
+ }
149
+ $.wpmdb.add_action( 'wpmdb_add_migration_stages', add_import_stage );
150
+
151
+ /**
152
+ * Adds any info necessary to begin an import
153
+ *
154
+ * @param object request_data
155
+ *
156
+ * @return {object}
157
+ */
158
+ function initiate_import_request_data( request_data ) {
159
+ if ( 'import' === wpmdb_migration_type() ) {
160
+ request_data.import_info = import_info;
161
+ }
162
+
163
+ return request_data;
164
+ }
165
+ $.wpmdb.add_filter( 'wpmdb_initiate_migration_request_data', initiate_import_request_data );
166
+
167
+ /**
168
+ * Gets more information about the import file and loads step-two
169
+ *
170
+ * @param event
171
+ */
172
+ function get_import_info( event ) {
173
+ var files = event.target.files; // FileList object
174
+ var file = files[0];
175
+ var reader = new FileReader();
176
+ var $import_file_status = $( '.import-file-status' );
177
+ var $backup_selected_option = $( 'label[for="backup-selected"]' );
178
+ var $prefix_notice = $( '.prefix-notice' );
179
+ var $unrecognized_file_notice = $( '.unrecognized-import-file-notice' );
180
+ var $step_two = $( '.step-two' );
181
+
182
+ $import_file_status.hide().attr( 'class', 'import-file-status' );
183
+ $prefix_notice.hide();
184
+ $unrecognized_file_notice.hide();
185
+ $step_two.hide();
186
+
187
+ if ( ! files.length ) {
188
+ if ( import_selected ) {
189
+ $step_two.hide();
190
+ $import_file_status.text( wpmdb_strings.please_select_sql_file ).show();
191
+ import_selected = false;
192
+ }
193
+ return;
194
+ } else {
195
+
196
+ if ( '.sql' === file.name.slice( -4 ) || '.sql.gz' === file.name.slice( -7 ) ) {
197
+ import_selected = true;
198
+ } else {
199
+ $import_file_status.addClass( 'notification-message error-notice migration-error' ).text( wpmdb_strings.invalid_sql_file ).show();
200
+ $step_two.hide();
201
+ return;
202
+ }
203
+ }
204
+
205
+ import_prefix = '';
206
+
207
+ $import_file_status.text( wpmdb_strings.parsing_sql_file ).append( ajax_spinner ).show();
208
+
209
+ reader.onloadend = function( event ) {
210
+ if ( event.target.readyState !== FileReader.DONE ) {
211
+ return;
212
+ }
213
+
214
+ $.ajax( {
215
+ url: ajaxurl,
216
+ type: 'POST',
217
+ dataType: 'json',
218
+ cache: false,
219
+ data: {
220
+ action: 'wpmdb_get_import_info',
221
+ file_data: event.target.result,
222
+ nonce: wpmdb_data.nonces.import_file
223
+ },
224
+ error: function( jqXHR, textStatus, errorThrown ) {
225
+ console.log( jqXHR, textStatus, errorThrown );
226
+ },
227
+ success: function( data ) {
228
+ $( '.ajax-spinner' ).remove();
229
+ $import_file_status.hide();
230
+ $step_two.show();
231
+
232
+ if ( 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error ) {
233
+ $import_file_status.text( data.body ).addClass( 'notification-message error-notice migration-error' ).show();
234
+ $step_two.hide();
235
+ } else {
236
+ var localStorage_form_data = wpmdb.functions.get_localStorage_form_data();
237
+ import_info = data;
238
+
239
+ if ( 'undefined' !== typeof data.prefix ) {
240
+ import_prefix = data.prefix;
241
+ $( '.table-prefix' ).text( data.prefix );
242
+ wpmdb.functions.maybe_show_prefix_notice( data.prefix );
243
+ }
244
+
245
+ if ( 'undefined' !== typeof data.tables ) {
246
+ tables_to_import = data.tables;
247
+ $backup_selected_option.show();
248
+
249
+ // Update the find & replace values
250
+ if ( ! localStorage_form_data ) {
251
+ $( '#old-url' ).val( wpmdb.functions.remove_protocol( data.URL ) );
252
+ $( '#old-path' ).val( data.path );
253
+ $( '#new-url' ).val( wpmdb.functions.remove_protocol( wpmdb_data.this_url ) );
254
+ $( '#new-path' ).val( wpmdb_data.this_path );
255
+ }
256
+
257
+ // Update the select with tables that will be imported
258
+ var loaded_tables = [];
259
+ var loaded_post_types = [];
260
+
261
+ if ( localStorage_form_data ) {
262
+ loaded_tables = localStorage_form_data.select_tables;
263
+ loaded_post_types = localStorage_form_data.select_post_types;
264
+ wpmdb.functions.remove_localStorage_form_data();
265
+ } else {
266
+ if ( 'migrate_only_with_prefix' === $( 'input[name=table_migrate_option]:checked' ).val() && ! $import_file_status.hasClass( 'profile-loaded' ) ) {
267
+ $( 'input[name=table_migrate_option][value=search_all_imported]' ).prop( 'checked', true );
268
+ }
269
+ }
270
+
271
+ if ( false === wpmdb_default_profile && 'undefined' !== typeof wpmdb_loaded_tables ) {
272
+ loaded_tables = wpmdb_loaded_tables;
273
+ loaded_post_types = wpmdb_loaded_post_types;
274
+ }
275
+ $import_select = wpmdb.functions.create_table_select( data.tables, [], loaded_tables );
276
+ $.wpmdb.do_action( 'wpmdb_update_import_table_select' );
277
+
278
+ if ( 'undefined' !== typeof data.post_types ) {
279
+ var $post_type_select = document.createElement( 'select' );
280
+ $( $post_type_select ).attr( {
281
+ multiple: 'multiple',
282
+ name: 'select_post_types[]',
283
+ id: 'select-post-types',
284
+ class: 'multiselect'
285
+ } );
286
+
287
+ $.each( data.post_types, function( index, value ) {
288
+ var selected = $.inArray( value, loaded_post_types );
289
+ if ( -1 !== selected || ( true === wpmdb_convert_exclude_revisions && 'revision' !== value ) ) {
290
+ selected = true;
291
+ } else {
292
+ selected = false;
293
+ }
294
+
295
+ var opt = document.createElement( 'option' );
296
+ opt.value = value;
297
+ opt.text = value;
298
+ opt.selected = selected;
299
+ $post_type_select.add( opt, null );
300
+ } );
301
+
302
+ $( '#select-post-types' ).remove();
303
+ $( '.exclude-post-types-warning' ).after( $post_type_select );
304
+ }
305
+
306
+ if ( unrecognized_import_file ) {
307
+ unrecognized_import_file = false;
308
+ maybe_show_find_replace_options();
309
+ }
310
+ } else {
311
+ $unrecognized_file_notice.show();
312
+ $backup_selected_option.hide();
313
+ $( '.table-options' ).hide();
314
+ unrecognized_import_file = true;
315
+ }
316
+ }
317
+ }
318
+ } );
319
+ };
320
+
321
+ var blob = file.slice( 0, 1024 * 1000 );
322
+ reader.readAsDataURL( blob );
323
+ }
324
+ $( '#import-file' ).on( 'change', get_import_info );
325
+
326
+ /**
327
+ * Displays the find and replace options for imports
328
+ *
329
+ * @param event
330
+ */
331
+ function maybe_show_find_replace_options( event ) {
332
+ if ( $( '#import-find-replace' ).is( ':checked' ) ) {
333
+ $( '.find-replace-rows, .find-replace-options' ).show();
334
+
335
+ if ( $( '.find-replace-options-toggle .expand-collapse-arrow' ).hasClass( 'collapsed' ) ) {
336
+ $( '.table-options, .advanced-options, .exclude-post-types-options' ).hide();
337
+ } else {
338
+ $( '.advanced-options, .exclude-post-types-options' ).show();
339
+
340
+ if ( ! unrecognized_import_file ) {
341
+ $( '.table-options' ).show();
342
+ } else {
343
+ $( '.table-options' ).hide();
344
+ }
345
+ }
346
+ } else {
347
+ $( '.find-replace-rows, .table-options, .exclude-post-types-options, .advanced-options, .find-replace-options' ).hide();
348
+ }
349
+ }
350
+ $( '#import-find-replace' ).on( 'click', maybe_show_find_replace_options );
351
+
352
+ function maybe_show_table_options( event ) {
353
+ if ( ! unrecognized_import_file ) {
354
+ return;
355
+ }
356
+
357
+ setTimeout( function() {
358
+ if ( $( '.find-replace-options-toggle .expand-collapse-arrow' ).hasClass( 'collapsed' ) ) {
359
+ return;
360
+ }
361
+
362
+ $( '.table-options' ).hide();
363
+ }, 1 );
364
+ }
365
+ $( '.find-replace-options-toggle' ).on( 'click', maybe_show_table_options );
366
+
367
+ /**
368
+ * Recursively upload an import file
369
+ *
370
+ * @param int start
371
+ */
372
+ wpmdb.functions.upload_file_recursive = function( start ) {
373
+ start = 'undefined' === typeof start ? 0 : start;
374
+
375
+ var file = document.getElementById( 'import-file' ).files[0];
376
+ var slice_size = 1000 * 1024; // 1 MB
377
+ var next_slice = start + slice_size + 1;
378
+ var reader = new FileReader();
379
+
380
+ if ( 0 === start ) {
381
+ wpmdb.current_migration.model.addStageItem( 'upload', file.name, file.size / 1000, Math.ceil( file.size / slice_size ) );
382
+ }
383
+
384
+ reader.onloadend = function( event ) {
385
+ if ( event.target.readyState !== FileReader.DONE ) {
386
+ return;
387
+ }
388
+
389
+ $.ajax( {
390
+ url: ajaxurl,
391
+ type: 'POST',
392
+ dataType: 'json',
393
+ cache: false,
394
+ data: {
395
+ action: 'wpmdb_upload_file',
396
+ file_data: event.target.result,
397
+ file: file.name,
398
+ file_type: file.type,
399
+ migration_state_id: wpmdb.migration_state_id,
400
+ stage: 'import',
401
+ import_info: import_info,
402
+ nonce: wpmdb_data.nonces.import_file
403
+ },
404
+ error: function( jqXHR, textStatus, errorThrown ) {
405
+ console.log( jqXHR, textStatus, errorThrown );
406
+ wpmdb.common.migration_error = true;
407
+ wpmdb.functions.migration_complete_events();
408
+ },
409
+ success: function( data ) {
410
+ wpmdb.current_migration.setText();
411
+
412
+ if ( 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error ) {
413
+ wpmdb.common.migration_error = true;
414
+ wpmdb.functions.migration_complete_events();
415
+ wpmdb.current_migration.setState( wpmdb_strings.migration_failed, data.body, 'error' );
416
+
417
+ return;
418
+ }
419
+
420
+ var size_done = start + slice_size;
421
+
422
+ wpmdb.current_migration.setText( wpmdb_strings.uploading_file_to_server );
423
+ wpmdb.current_migration.model.getStageModel( 'upload' ).setItemRowsTransferred( file.name, Math.ceil( size_done / slice_size ) );
424
+
425
+ if ( next_slice < file.size ) {
426
+ wpmdb.common.next_step_in_migration = {
427
+ fn: wpmdb.functions.upload_file_recursive,
428
+ args: [ next_slice ]
429
+ };
430
+ } else {
431
+ wpmdb.common.next_step_in_migration = {
432
+ fn: wpmdb.functions.upload_import_successful,
433
+ args: [ file ]
434
+ };
435
+ }
436
+
437
+ wpmdb.functions.execute_next_step();
438
+ }
439
+ } );
440
+ };
441
+
442
+ var blob = file.slice( start, next_slice );
443
+ reader.readAsDataURL( blob );
444
+ };
445
+
446
+ /**
447
+ * Prepares the import stage
448
+ *
449
+ * @param file
450
+ */
451
+ wpmdb.functions.upload_import_successful = function( file ) {
452
+
453
+ $.ajax( {
454
+ type: 'POST',
455
+ url: ajaxurl,
456
+ data: {
457
+ action: 'wpmdb_prepare_import_file',
458
+ migration_state_id: wpmdb.migration_state_id,
459
+ nonce: wpmdb_data.nonces.import_file
460
+ },
461
+ dataType: 'json',
462
+ error: function( jqXHR, textStatus, errorThrown ) {
463
+ console.log( jqXHR, textStatus, errorThrown );
464
+ wpmdb.common.migration_error = true;
465
+ wpmdb.functions.migration_complete_events();
466
+ },
467
+ success: function( response ) {
468
+ var item_name = file.name;
469
+ var migration_text = wpmdb_strings.importing_file_to_db;
470
+
471
+ if ( '.gz' === item_name.slice( -3 ) ) {
472
+ item_name = file.name.slice( 0, -3 );
473
+ }
474
+
475
+ migration_text = migration_text.replace( /\%s\s?/, item_name );
476
+ wpmdb.current_migration.setText( migration_text );
477
+
478
+ wpmdb.current_migration.model.addStageItem( 'import', item_name, response.import_size / 1000, response.num_chunks );
479
+ wpmdb.current_migration.model.setActiveStage( 'import' );
480
+
481
+ wpmdb.common.next_step_in_migration = {
482
+ fn: wpmdb.functions.import_file_recursive,
483
+ args: [ {
484
+ import_filename: response.import_file,
485
+ item_name: item_name,
486
+ chunk: 0,
487
+ current_query: ''
488
+ } ]
489
+ };
490
+
491
+ wpmdb.functions.execute_next_step();
492
+ }
493
+ } );
494
+ };
495
+
496
+ /**
497
+ * Recursively imports chunks to the database
498
+ *
499
+ * @param object args
500
+ */
501
+ wpmdb.functions.import_file_recursive = function( args ) {
502
+
503
+ $.ajax( {
504
+ type: 'POST',
505
+ url: ajaxurl,
506
+ data: {
507
+ action: 'wpmdb_import_file',
508
+ migration_state_id: wpmdb.migration_state_id,
509
+ chunk: args.chunk,
510
+ current_query: args.current_query,
511
+ import_file: args.import_filename,
512
+ nonce: wpmdb_data.nonces.import_file
513
+ },
514
+ dataType: 'json',
515
+ error: function( jqXHR, textStatus, errorThrown ) {
516
+ console.log( jqXHR, textStatus, errorThrown );
517
+ wpmdb.common.migration_error = true;
518
+ wpmdb.functions.migration_complete_events();
519
+ },
520
+ success: function( response ) {
521
+ if ( 'undefined' !== typeof response.wpmdb_error && 1 === response.wpmdb_error ) {
522
+ wpmdb.common.migration_error = true;
523
+ wpmdb.functions.migration_complete_events();
524
+ wpmdb.current_migration.setState( wpmdb_strings.migration_failed, response.body, 'error' );
525
+ return;
526
+ }
527
+
528
+ wpmdb.current_migration.model.getStageModel( 'import' ).setItemRowsTransferred( args.item_name, response.chunk );
529
+
530
+ if ( response.chunk >= response.num_chunks ) {
531
+
532
+ wpmdb.current_migration.model.getStageModel( 'import' ).setItemRowsTransferred( args.item_name, ++response.chunk );
533
+
534
+ if ( $( '#import-find-replace' ).is( ':checked' ) ) {
535
+
536
+ if ( unrecognized_import_file ) {
537
+ $.each( response.table_sizes, function( table, size ) {
538
+ if ( table.startsWith( wpmdb_data.this_temp_prefix ) && wpmdb_data.alter_table_name !== table ) {
539
+ var table_name = table.replace( wpmdb_data.this_temp_prefix, '' );
540
+ wpmdb.current_migration.model.addStageItem( 'find_replace', table_name, response.table_sizes[ table ], response.table_rows[ table ] );
541
+ }
542
+ } );
543
+ } else {
544
+ var table_migrate_option = $( 'input[name=table_migrate_option]:checked' ).val();
545
+
546
+ if ( 'migrate_only_with_prefix' === table_migrate_option ) {
547
+ tables_to_search = tables_to_import.filter( function( table ) {
548
+ return import_prefix === table.substring( 0, import_prefix.length );
549
+ } );
550
+ } else if ( 'search_all_imported' === table_migrate_option ) {
551
+ tables_to_search = tables_to_import;
552
+ }
553
+
554
+ $.each( tables_to_search, function( key, table ) {
555
+ var imported_table = wpmdb_data.this_temp_prefix + table;
556
+ if ( response.table_sizes.hasOwnProperty( imported_table ) ) {
557
+ wpmdb.current_migration.model.addStageItem( 'find_replace', table, response.table_sizes[ imported_table ], response.table_rows[ imported_table ] );
558
+ }
559
+ } );
560
+ }
561
+
562
+ tables_to_search = [];
563
+
564
+ wpmdb.current_migration.model.setActiveStage( 'find_replace' );
565
+ wpmdb.common.next_step_in_migration = {
566
+ fn: wpmdb.functions.migrate_table_recursive,
567
+ args: [ 0 ]
568
+ };
569
+ wpmdb.functions.execute_next_step();
570
+ return;
571
+ } else {
572
+ $( '.progress-label' ).removeClass( 'label-visible' );
573
+ wpmdb.common.hooks = $.wpmdb.apply_filters( 'wpmdb_before_migration_complete_hooks', wpmdb.common.hooks );
574
+ wpmdb.common.hooks.push( wpmdb.functions.migration_complete );
575
+ wpmdb.common.hooks.push( wpmdb.functions.wpmdb_flush );
576
+ wpmdb.common.hooks = $.wpmdb.apply_filters( 'wpmdb_after_migration_complete_hooks', wpmdb.common.hooks );
577
+ wpmdb.common.hooks.push( wpmdb.functions.migration_complete_events );
578
+ wpmdb.common.next_step_in_migration = { fn: wpmdb_call_next_hook };
579
+ }
580
+
581
+ } else {
582
+ wpmdb.common.next_step_in_migration = {
583
+ fn: wpmdb.functions.import_file_recursive,
584
+ args: [ {
585
+ import_filename: args.import_filename,
586
+ item_name: args.item_name,
587
+ chunk: response.chunk,
588
+ current_query: response.current_query
589
+ } ]
590
+ };
591
+ }
592
+
593
+ wpmdb.functions.execute_next_step();
594
+ }
595
+ } );
596
+ };
597
+
598
+ wpmdb.functions.get_tables_to_import = function() {
599
+ return tables_to_import;
600
+ };
601
+
602
+ })( jQuery, wpmdb );
asset/dist/js/import-10.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(a,b){function c(a,b){return"import"===b.intent&&(a="completed"===b.stage?wpmdb_strings.import_label_completed:wpmdb_strings.import_label_migrating),a}function d(b){var c=a(".import-file-status");"import"===b.migration_type?(m?q&&a(".unrecognized-import-file-notice").show():(a(".step-two").hide(),c.hasClass("profile-loaded")?(c.attr("class","import-file-status profile-loaded notification-message success-notice"),c.html(wpmdb_strings.import_profile_loaded)):c.html(wpmdb_strings.please_select_sql_file),c.show()),k(),a(".mst-options").hide(),a(".import-find-replace-option, .import-active-plugin-option").show()):(a('.find-replace-rows, .table-options, .advanced-options, .exclude-post-types-options, label[for="backup-selected"]').show(),a(".import-find-replace-option, .find-replace-options, .import-file-status, .import-active-plugin-option, .unrecognized-import-file-notice").hide(),"search_all_imported"===a("input[name=table_migrate_option]:checked").val()&&a("input[name=table_migrate_option][value=migrate_only_with_prefix]").prop("checked",!0))}function e(a){"import"===wpmdb_migration_type()&&("backup"===a&&b.common.hooks.push(b.functions.migrate_table_recursive),b.common.hooks.push(b.functions.upload_file_recursive),b.common.next_step_in_migration={fn:wpmdb_call_next_hook},b.functions.execute_next_step())}function f(){a("#select-tables").remove(),a(".select-tables-wrap").prepend(n),a("#select-tables").change()}function g(a){return"import"===wpmdb_migration_type()&&(a=p),a}function h(c){"import"===wpmdb_migration_type()&&(b.current_migration.model.addStage("upload",[],"local",{strings:{stage_title:wpmdb_strings.upload}}),b.current_migration.model.addStage("import",[],"local",{strings:{stage_title:wpmdb_strings.migrate_button_import}}),a("#import-find-replace").is(":checked")&&(o=c.tables_to_migrate,b.current_migration.model.addStage("find_replace",[],"local",{strings:{migrated:wpmdb_strings.searched,stage_title:wpmdb_strings.migrate_button_find_replace}})))}function i(a){return"import"===wpmdb_migration_type()&&(a.import_info=s),a}function j(c){var d=c.target.files,e=d[0],f=new FileReader,g=a(".import-file-status"),h=a('label[for="backup-selected"]'),i=a(".prefix-notice"),j=a(".unrecognized-import-file-notice"),l=a(".step-two");if(g.hide().attr("class","import-file-status"),i.hide(),j.hide(),l.hide(),!d.length)return void(m&&(l.hide(),g.text(wpmdb_strings.please_select_sql_file).show(),m=!1));if(".sql"!==e.name.slice(-4)&&".sql.gz"!==e.name.slice(-7))return g.addClass("notification-message error-notice migration-error").text(wpmdb_strings.invalid_sql_file).show(),void l.hide();m=!0,r="",g.text(wpmdb_strings.parsing_sql_file).append(t).show(),f.onloadend=function(c){c.target.readyState===FileReader.DONE&&a.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_get_import_info",file_data:c.target.result,nonce:wpmdb_data.nonces.import_file},error:function(a,b,c){console.log(a,b,c)},success:function(c){if(a(".ajax-spinner").remove(),g.hide(),l.show(),"undefined"!=typeof c.wpmdb_error&&1===c.wpmdb_error)g.text(c.body).addClass("notification-message error-notice migration-error").show(),l.hide();else{var d=b.functions.get_localStorage_form_data();if(s=c,"undefined"!=typeof c.prefix&&(r=c.prefix,a(".table-prefix").text(c.prefix),b.functions.maybe_show_prefix_notice(c.prefix)),"undefined"!=typeof c.tables){p=c.tables,h.show(),d||(a("#old-url").val(b.functions.remove_protocol(c.URL)),a("#old-path").val(c.path),a("#new-url").val(b.functions.remove_protocol(wpmdb_data.this_url)),a("#new-path").val(wpmdb_data.this_path));var e=[],f=[];if(d?(e=d.select_tables,f=d.select_post_types,b.functions.remove_localStorage_form_data()):"migrate_only_with_prefix"!==a("input[name=table_migrate_option]:checked").val()||g.hasClass("profile-loaded")||a("input[name=table_migrate_option][value=search_all_imported]").prop("checked",!0),!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_tables&&(e=wpmdb_loaded_tables,f=wpmdb_loaded_post_types),n=b.functions.create_table_select(c.tables,[],e),a.wpmdb.do_action("wpmdb_update_import_table_select"),"undefined"!=typeof c.post_types){var i=document.createElement("select");a(i).attr({multiple:"multiple",name:"select_post_types[]",id:"select-post-types","class":"multiselect"}),a.each(c.post_types,function(b,c){var d=a.inArray(c,f);d=-1!==d||!0===wpmdb_convert_exclude_revisions&&"revision"!==c;var e=document.createElement("option");e.value=c,e.text=c,e.selected=d,i.add(e,null)}),a("#select-post-types").remove(),a(".exclude-post-types-warning").after(i)}q&&(q=!1,k())}else j.show(),h.hide(),a(".table-options").hide(),q=!0}}})};var o=e.slice(0,1024e3);f.readAsDataURL(o)}function k(b){a("#import-find-replace").is(":checked")?(a(".find-replace-rows, .find-replace-options").show(),a(".find-replace-options-toggle .expand-collapse-arrow").hasClass("collapsed")?a(".table-options, .advanced-options, .exclude-post-types-options").hide():(a(".advanced-options, .exclude-post-types-options").show(),q?a(".table-options").hide():a(".table-options").show())):a(".find-replace-rows, .table-options, .exclude-post-types-options, .advanced-options, .find-replace-options").hide()}function l(b){q&&setTimeout(function(){a(".find-replace-options-toggle .expand-collapse-arrow").hasClass("collapsed")||a(".table-options").hide()},1)}var m=!1,n=a("#select-tables").clone(),o=[],p=[],q=!1,r="",s={},t='<img src="'+b.functions.get_spinner_url()+'" alt="" class="ajax-spinner general-spinner" />';a.wpmdb.add_filter("wpmdb_get_migration_status_label",c),a.wpmdb.add_action("move_connection_info_box",d),a.wpmdb.add_action("wpmdb_migration_initiated",e),a.wpmdb.add_action("wpmdb_update_import_table_select",f),a.wpmdb.add_filter("wpmdb_backup_selected_tables",g),a.wpmdb.add_action("wpmdb_add_migration_stages",h),a.wpmdb.add_filter("wpmdb_initiate_migration_request_data",i),a("#import-file").on("change",j),a("#import-find-replace").on("click",k),a(".find-replace-options-toggle").on("click",l),b.functions.upload_file_recursive=function(c){c="undefined"==typeof c?0:c;var d=document.getElementById("import-file").files[0],e=1024e3,f=c+e+1,g=new FileReader;0===c&&b.current_migration.model.addStageItem("upload",d.name,d.size/1e3,Math.ceil(d.size/e)),g.onloadend=function(g){g.target.readyState===FileReader.DONE&&a.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_upload_file",file_data:g.target.result,file:d.name,file_type:d.type,migration_state_id:b.migration_state_id,stage:"import",import_info:s,nonce:wpmdb_data.nonces.import_file},error:function(a,c,d){console.log(a,c,d),b.common.migration_error=!0,b.functions.migration_complete_events()},success:function(a){if(b.current_migration.setText(),"undefined"!=typeof a.wpmdb_error&&1===a.wpmdb_error)return b.common.migration_error=!0,b.functions.migration_complete_events(),void b.current_migration.setState(wpmdb_strings.migration_failed,a.body,"error");var g=c+e;b.current_migration.setText(wpmdb_strings.uploading_file_to_server),b.current_migration.model.getStageModel("upload").setItemRowsTransferred(d.name,Math.ceil(g/e)),f<d.size?b.common.next_step_in_migration={fn:b.functions.upload_file_recursive,args:[f]}:b.common.next_step_in_migration={fn:b.functions.upload_import_successful,args:[d]},b.functions.execute_next_step()}})};var h=d.slice(c,f);g.readAsDataURL(h)},b.functions.upload_import_successful=function(c){a.ajax({type:"POST",url:ajaxurl,data:{action:"wpmdb_prepare_import_file",migration_state_id:b.migration_state_id,nonce:wpmdb_data.nonces.import_file},dataType:"json",error:function(a,c,d){console.log(a,c,d),b.common.migration_error=!0,b.functions.migration_complete_events()},success:function(a){var d=c.name,e=wpmdb_strings.importing_file_to_db;".gz"===d.slice(-3)&&(d=c.name.slice(0,-3)),e=e.replace(/\%s\s?/,d),b.current_migration.setText(e),b.current_migration.model.addStageItem("import",d,a.import_size/1e3,a.num_chunks),b.current_migration.model.setActiveStage("import"),b.common.next_step_in_migration={fn:b.functions.import_file_recursive,args:[{import_filename:a.import_file,item_name:d,chunk:0,current_query:""}]},b.functions.execute_next_step()}})},b.functions.import_file_recursive=function(c){a.ajax({type:"POST",url:ajaxurl,data:{action:"wpmdb_import_file",migration_state_id:b.migration_state_id,chunk:c.chunk,current_query:c.current_query,import_file:c.import_filename,nonce:wpmdb_data.nonces.import_file},dataType:"json",error:function(a,c,d){console.log(a,c,d),b.common.migration_error=!0,b.functions.migration_complete_events()},success:function(d){if("undefined"!=typeof d.wpmdb_error&&1===d.wpmdb_error)return b.common.migration_error=!0,b.functions.migration_complete_events(),void b.current_migration.setState(wpmdb_strings.migration_failed,d.body,"error");if(b.current_migration.model.getStageModel("import").setItemRowsTransferred(c.item_name,d.chunk),d.chunk>=d.num_chunks){if(b.current_migration.model.getStageModel("import").setItemRowsTransferred(c.item_name,++d.chunk),a("#import-find-replace").is(":checked")){if(q)a.each(d.table_sizes,function(a,c){if(a.startsWith(wpmdb_data.this_temp_prefix)&&wpmdb_data.alter_table_name!==a){var e=a.replace(wpmdb_data.this_temp_prefix,"");b.current_migration.model.addStageItem("find_replace",e,d.table_sizes[a],d.table_rows[a])}});else{var e=a("input[name=table_migrate_option]:checked").val();"migrate_only_with_prefix"===e?o=p.filter(function(a){return r===a.substring(0,r.length)}):"search_all_imported"===e&&(o=p),a.each(o,function(a,c){var e=wpmdb_data.this_temp_prefix+c;d.table_sizes.hasOwnProperty(e)&&b.current_migration.model.addStageItem("find_replace",c,d.table_sizes[e],d.table_rows[e])})}return o=[],b.current_migration.model.setActiveStage("find_replace"),b.common.next_step_in_migration={fn:b.functions.migrate_table_recursive,args:[0]},void b.functions.execute_next_step()}a(".progress-label").removeClass("label-visible"),b.common.hooks=a.wpmdb.apply_filters("wpmdb_before_migration_complete_hooks",b.common.hooks),b.common.hooks.push(b.functions.migration_complete),b.common.hooks.push(b.functions.wpmdb_flush),b.common.hooks=a.wpmdb.apply_filters("wpmdb_after_migration_complete_hooks",b.common.hooks),b.common.hooks.push(b.functions.migration_complete_events),b.common.next_step_in_migration={fn:wpmdb_call_next_hook}}else b.common.next_step_in_migration={fn:b.functions.import_file_recursive,args:[{import_filename:c.import_filename,item_name:c.item_name,chunk:d.chunk,current_query:d.current_query}]};b.functions.execute_next_step()}})},b.functions.get_tables_to_import=function(){return p}}(jQuery,wpmdb);
asset/dist/js/localStorage-10.js ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function( $, wpmdb ) {
2
+
3
+ $( document ).ready( function() {
4
+
5
+ wpmdb.functions.localStorage_available = function() {
6
+ try {
7
+ localStorage.setItem( 'wpmdb_test', 'wpmdb_test' );
8
+ localStorage.removeItem( 'wpmdb_test', 'wpmdb_test' );
9
+ return true;
10
+ }
11
+ catch ( e ) {
12
+ return false;
13
+ }
14
+ };
15
+
16
+ wpmdb.functions.maybe_reload_page = function() {
17
+ var migration_type = wpmdb_migration_type();
18
+
19
+ if ( ! wpmdb.functions.localStorage_available() ||
20
+ 'cancelled' === wpmdb.current_migration.status ||
21
+ true === wpmdb.common.migration_error ||
22
+ -1 === $.inArray( migration_type, [ 'pull', 'import', 'find_replace' ] )
23
+ ) {
24
+ return;
25
+ }
26
+
27
+ if ( 'true' === wpmdb_data.is_multisite &&
28
+ $( '#mst-select-subsite' ).is( ':checked' ) &&
29
+ wpmdb_data.this_domain !== $( '#mst-selected-subsite option:selected' ).text()
30
+ ) {
31
+ return;
32
+ }
33
+
34
+ var tables_to_migrate = wpmdb.functions.get_tables_to_migrate();
35
+
36
+ if ( 'import' === migration_type ) {
37
+ tables_to_migrate = wpmdb.functions.get_tables_to_import();
38
+ }
39
+
40
+ if ( -1 === $.inArray( wpmdb_data.this_prefix + 'options', tables_to_migrate ) &&
41
+ -1 === $.inArray( wpmdb_data.this_prefix + 'usermeta', tables_to_migrate ) ) {
42
+ return;
43
+ }
44
+
45
+ wpmdb.functions.set_localStorage_form_data();
46
+ location.reload();
47
+ };
48
+
49
+ wpmdb.functions.set_localStorage_form_data = function() {
50
+ var data = {};
51
+
52
+ $.each( $( '#migrate-form' ).serializeArray(), function( index, field ) {
53
+ if ( '[]' === field.name.substr( -2 ) ) {
54
+ var field_name = field.name.slice( 0, -2 );
55
+ if ( 'undefined' === typeof data[ field_name ] ) {
56
+ data[ field_name ] = [];
57
+ }
58
+ data[ field_name ].push( field.value );
59
+ } else {
60
+ data[ field.name ] = field.value;
61
+ }
62
+ } );
63
+
64
+ localStorage.setItem( 'wpmdb_migrate_form', JSON.stringify( data ) );
65
+ };
66
+
67
+ wpmdb.functions.get_localStorage_form_data = function() {
68
+ var form_data = localStorage.getItem( 'wpmdb_migrate_form' );
69
+
70
+ if ( null === form_data ) {
71
+ return false;
72
+ }
73
+
74
+ try {
75
+ form_data = JSON.parse( form_data );
76
+ }
77
+ catch ( err ) {
78
+ return false;
79
+ }
80
+
81
+ return form_data;
82
+ };
83
+
84
+ wpmdb.functions.remove_localStorage_form_data = function() {
85
+ localStorage.removeItem( 'wpmdb_migrate_form' );
86
+ };
87
+
88
+ wpmdb.functions.load_data_from_localStorage = function() {
89
+ var form_data = wpmdb.functions.get_localStorage_form_data();
90
+
91
+ if ( ! form_data ) {
92
+ return;
93
+ }
94
+
95
+ $.each( form_data, function( name, value ) {
96
+ var $input = $( '[name="' + name + '"]' );
97
+ var input_type = $input.attr( 'type' );
98
+
99
+ if ( 'action' === name ) {
100
+ wpmdb.migration_selection = value;
101
+ $( '#' + value ).prop( 'checked', true );
102
+ } else {
103
+ if ( 'radio' === input_type ) {
104
+ $( '[name="' + name + '"][value="' + value + '"]' ).prop( 'checked', true );
105
+ } else if ( 'checkbox' === input_type ) {
106
+ $input.prop( 'checked', true );
107
+
108
+ if ( $input.parent().hasClass( 'checkbox-label' ) ) {
109
+ $input.parent().next().show();
110
+ }
111
+ } else {
112
+ $input.val( value );
113
+ }
114
+ }
115
+ } );
116
+
117
+ $( '.option-group input[type=radio]' ).change();
118
+ $( '.' + wpmdb.migration_selection + '-list ul' ).show();
119
+
120
+ $.when( wpmdb.functions.connection_box_changed() ).done( function() {
121
+ if ( 'migrate_select' === $( 'input[name=table_migrate_option]:checked' ).val() ) {
122
+ if ( 'undefined' !== typeof form_data.select_tables ) {
123
+ $( '#select-tables' ).val( form_data.select_tables );
124
+ }
125
+
126
+ $( '.table-options .expandable-content, .select-tables-wrap' ).show();
127
+ $( '.table-options .expand-collapse-arrow' ).removeClass( 'collapsed' );
128
+ } else {
129
+ $( '.select-tables-wrap' ).hide();
130
+ }
131
+
132
+ if ( 'backup_manual_select' === $( 'input[name=backup_option]:checked' ).val() ) {
133
+ if ( 'undefined' !== typeof form_data.select_backup ) {
134
+ $( '#select-backup' ).val( form_data.select_backup );
135
+ }
136
+
137
+ $( '.backup-tables-wrap' ).show();
138
+ }
139
+
140
+ if ( 'undefined' !== typeof form_data.select_post_types ) {
141
+ $( '#select-post-types' ).val( form_data.select_post_types );
142
+ wpmdb.functions.exclude_post_types_warning();
143
+ }
144
+
145
+ if ( 'undefined' !== typeof form_data.replace_old ) {
146
+
147
+ $( '.replace-row' ).not( '.original-repeatable-field' ).remove();
148
+
149
+ var n = 1;
150
+ $.each( form_data.replace_old, function( index, value ) {
151
+ if ( ! $( '.replace-row:nth-child(' + n + ')' ).length ) {
152
+ $( '.replace-row' ).last().after( $( '.original-repeatable-field' ).clone().removeClass( 'original-repeatable-field' ) );
153
+ }
154
+
155
+ $( '.replace-row:nth-child(' + n + ') [name="replace_old[]"]' ).val( value );
156
+ $( '.replace-row:nth-child(' + n + ') [name="replace_new[]"]' ).val( form_data.replace_new[ index ] );
157
+ n++;
158
+ } );
159
+ }
160
+ } );
161
+
162
+ wpmdb.functions.update_migrate_button_text();
163
+
164
+ if ( 'import' !== wpmdb_migration_type() ) {
165
+ wpmdb.functions.remove_localStorage_form_data();
166
+ }
167
+ };
168
+ wpmdb.functions.load_data_from_localStorage();
169
+
170
+ } );
171
+
172
+ } )( jQuery, wpmdb );
asset/dist/js/localStorage-10.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(a,b){a(document).ready(function(){b.functions.localStorage_available=function(){try{return localStorage.setItem("wpmdb_test","wpmdb_test"),localStorage.removeItem("wpmdb_test","wpmdb_test"),!0}catch(a){return!1}},b.functions.maybe_reload_page=function(){var c=wpmdb_migration_type();if(b.functions.localStorage_available()&&"cancelled"!==b.current_migration.status&&!0!==b.common.migration_error&&-1!==a.inArray(c,["pull","import","find_replace"])&&("true"!==wpmdb_data.is_multisite||!a("#mst-select-subsite").is(":checked")||wpmdb_data.this_domain===a("#mst-selected-subsite option:selected").text())){var d=b.functions.get_tables_to_migrate();"import"===c&&(d=b.functions.get_tables_to_import()),-1===a.inArray(wpmdb_data.this_prefix+"options",d)&&-1===a.inArray(wpmdb_data.this_prefix+"usermeta",d)||(b.functions.set_localStorage_form_data(),location.reload())}},b.functions.set_localStorage_form_data=function(){var b={};a.each(a("#migrate-form").serializeArray(),function(a,c){if("[]"===c.name.substr(-2)){var d=c.name.slice(0,-2);"undefined"==typeof b[d]&&(b[d]=[]),b[d].push(c.value)}else b[c.name]=c.value}),localStorage.setItem("wpmdb_migrate_form",JSON.stringify(b))},b.functions.get_localStorage_form_data=function(){var a=localStorage.getItem("wpmdb_migrate_form");if(null===a)return!1;try{a=JSON.parse(a)}catch(b){return!1}return a},b.functions.remove_localStorage_form_data=function(){localStorage.removeItem("wpmdb_migrate_form")},b.functions.load_data_from_localStorage=function(){var c=b.functions.get_localStorage_form_data();c&&(a.each(c,function(c,d){var e=a('[name="'+c+'"]'),f=e.attr("type");"action"===c?(b.migration_selection=d,a("#"+d).prop("checked",!0)):"radio"===f?a('[name="'+c+'"][value="'+d+'"]').prop("checked",!0):"checkbox"===f?(e.prop("checked",!0),e.parent().hasClass("checkbox-label")&&e.parent().next().show()):e.val(d)}),a(".option-group input[type=radio]").change(),a("."+b.migration_selection+"-list ul").show(),a.when(b.functions.connection_box_changed()).done(function(){if("migrate_select"===a("input[name=table_migrate_option]:checked").val()?("undefined"!=typeof c.select_tables&&a("#select-tables").val(c.select_tables),a(".table-options .expandable-content, .select-tables-wrap").show(),a(".table-options .expand-collapse-arrow").removeClass("collapsed")):a(".select-tables-wrap").hide(),"backup_manual_select"===a("input[name=backup_option]:checked").val()&&("undefined"!=typeof c.select_backup&&a("#select-backup").val(c.select_backup),a(".backup-tables-wrap").show()),"undefined"!=typeof c.select_post_types&&(a("#select-post-types").val(c.select_post_types),b.functions.exclude_post_types_warning()),"undefined"!=typeof c.replace_old){a(".replace-row").not(".original-repeatable-field").remove();var d=1;a.each(c.replace_old,function(b,e){a(".replace-row:nth-child("+d+")").length||a(".replace-row").last().after(a(".original-repeatable-field").clone().removeClass("original-repeatable-field")),a(".replace-row:nth-child("+d+') [name="replace_old[]"]').val(e),a(".replace-row:nth-child("+d+') [name="replace_new[]"]').val(c.replace_new[b]),d++})}}),b.functions.update_migrate_button_text(),"import"!==wpmdb_migration_type()&&b.functions.remove_localStorage_form_data())},b.functions.load_data_from_localStorage()})}(jQuery,wpmdb);
asset/dist/js/{multisite-092.js → multisite-10.js} RENAMED
File without changes
asset/dist/js/{multisite-092.min.js → multisite-10.min.js} RENAMED
File without changes
asset/dist/js/{plugin-update-092.js → plugin-update-10.js} RENAMED
@@ -79,5 +79,4 @@
79
  $( '.wpmdbpro-custom' ).prev().addClass( 'wpmdbpro-has-message' );
80
 
81
  } );
82
-
83
  })( jQuery );
79
  $( '.wpmdbpro-custom' ).prev().addClass( 'wpmdbpro-has-message' );
80
 
81
  } );
 
82
  })( jQuery );
asset/dist/js/{plugin-update-092.min.js → plugin-update-10.min.js} RENAMED
File without changes
asset/dist/js/script-092.min.js DELETED
@@ -1,3 +0,0 @@
1
- !function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){var d=jQuery,e=a("MigrationProgress-model"),f=a("MigrationProgress-view"),g=d('<div id="overlay" class="hide"></div>'),h=d(".progress-content").clone().addClass("hide"),i=d(".pro-version").addClass("hide");g.append(i);var j={migration:{model:{},view:{},$progress:{},$wrapper:{},$overlay:{},status:"active",title:"",text:"",timerCount:0,elapsedInterval:0,currentStageNum:0,counterDisplay:!1,originalTitle:document.title,setTitle:function(a){this.$progress.find(".progress-title").html(a),this.title=a},setStatus:function(a){this.$progress.removeClass(this.status).addClass("error"===a?"wpmdb-error":a),"error"===a&&this.$progress.find(".progress-text").addClass("migration-error"),this.status=a,this.updateTitleElem()},setText:function(a){"string"!=typeof a&&(a=""),0>=a.indexOf("wpmdb_error")&&(a=this.decodeErrorObject(a)),this.$progress.find(".progress-text").html(a),this.text=a},setState:function(a,b,c){null!==a&&this.setTitle(a),null!==b&&this.setText(b),null!==c&&this.setStatus(c)},startTimer:function(){this.timerCount=0,this.counterDisplay=d(".timer"),this.elapsedInterval=setInterval(this.incrementTimer,1e3)},pauseTimer:function(){clearInterval(this.elapsedInterval)},resumeTimer:function(){this.elapsedInterval=setInterval(this.incrementTimer,1e3)},incrementTimer:function(){wpmdb.current_migration.timerCount=wpmdb.current_migration.timerCount+1,wpmdb.current_migration.displayCount()},displayCount:function(){var a=Math.floor(this.timerCount/3600)%24,b=Math.floor(this.timerCount/60)%60,c=this.timerCount%60,d=this.pad(a,2,0)+":"+this.pad(b,2,0)+":"+this.pad(c,2,0);this.counterDisplay.html(d)},updateTitleElem:function(){var a=this.model.get("activeStageName"),b=this.model.getStageModel(a),c=Math.max(0,b.getTotalProgressPercent()),d=this.model.get("stages").length,e=this.currentStageNum,f=this.status,g=wpmdb_strings.title_progress;"complete"===b.get("status")&&0===b.get("totalSize")&&(c=100),g=g.replace("%1$s",c+"%"),g=g.replace("%2$s",e),g=g.replace("%3$s",d),1===d&&(g=c+"%"),wpmdb_strings["title_"+f]&&(g=wpmdb_strings["title_"+f]),g=g+" - "+this.originalTitle,document.title=g},restoreTitleElem:function(){document.title=this.originalTitle},pad:function(a,b,c){return c=c||"0",a+="",a.length>=b?a:new Array(b-a.length+1).join(c)+a},decodeErrorObject:function(a){var b=a.replace(/\{&quot;/g,"{#q!#").replace(/\&quot;}/g,"#q!#}").replace(/,&quot;/g,",#q!#").replace(/&quot;:/g,"#q!#:").replace(/:&quot;/g,":#q!#").replace(/&quot;/g,'\\"').replace(/#q!#/g,'"').replace(/&gt;/g,">").replace(/&lt;/g,"<");try{b=JSON.parse(b)}catch(c){return a}return"object"==typeof b&&"undefined"!=typeof b.body?b:a},fixProgressStageWidthForScrollBar:function(){var a=Math.abs(this.$wrapper[0].offsetWidth-this.$wrapper[0].clientWidth),b=this.$wrapper.find(".active .progress-items"),c=parseInt(b.css("padding-left"),10),d=parseInt(b.css("padding-right"),10);(0!==a||0===a&&d!==c)&&b.css("padding-right",c-a+"px")}},newMigration:function(a){d("#overlay").remove(),d(".progress-content").remove(),this.migration.$overlay=g.clone(),d("#wpwrap").append(this.migration.$overlay),this.migration.model=new e(a),this.migration.view=new f({model:this.migration.model}),this.migration.$progress=h.clone(),this.migration.$wrapper=this.migration.view.$el,this.migration.$progress.find(".migration-progress-stages").replaceWith(this.migration.$wrapper),this.migration.$proVersion=this.migration.$overlay.find(".pro-version");var b=this.migration.$proVersion.find("iframe").remove().clone();this.migration.$overlay.prepend(this.migration.$progress);var c=this;return setTimeout(function(){c.migration.$overlay.add(c.migration.$progress).add(c.migration.$proVersion).removeClass("hide").addClass("show"),c.migration.$proVersion.length&&setTimeout(function(){c.migration.$proVersion.find(".iframe").append(b)},500)},0),this.migration.currentStageNum=0,this.migration.$proVersion.on("click",".close-pro-version",function(){c.migration.$proVersion.find("iframe").remove(),c.migration.$proVersion.addClass("hide remove"),setTimeout(function(){c.migration.$proVersion.remove()},500)}),this.migration.model.on("migrationComplete",function(){c.utils.updateProgTableVisibilitySetting(),c.utils.updatePauseBeforeFinalizeSetting(),c.migration.pauseTimer()}),d(window).on("resize",_.debounce(this.migration.fixProgressStageWidthForScrollBar.bind(this.migration),100)),this.migration.model.on("change:activeStage",this.migration.fixProgressStageWidthForScrollBar.bind(this.migration)),this.migration},utils:a("MigrationProgress-utils")};b.exports=j},{"MigrationProgress-model":2,"MigrationProgress-utils":3,"MigrationProgress-view":4}],2:[function(a,b,c){var d=a("MigrationProgressStage-model"),e=jQuery,f=Backbone.Model.extend({defaults:{_initialStages:null,stages:null,activeStageName:null,stageModels:null,localTableRows:null,localTableSizes:null,remoteTableRows:null,remoteTableSizes:null,migrationStatus:"active",migrationIntent:"savefile"},initialize:function(){this.set("stageModels",{}),this.set("_initialStages",this.get("stages")),this.set("stages",[]),_.each(this.get("_initialStages"),function(a,b,c){this.addStage(a.name,b,c)},this)},addStage:function(a,b,c,d){var f,g=[];return _.each(b,function(a){var b,d;"remote"===c?(b=this.get("remoteTableSizes")[a],d=this.get("remoteTableRows")[a]):(b=this.get("localTableSizes")[a],d=this.get("localTableRows")[a]),g.push({name:a,size:b,rows:d})},this),f={name:a,items:g,dataType:c},"object"==typeof d&&(f=e.extend(f,d)),this.addStageModel(f),this.trigger("stage:added",this.get("stageModels")[a]),this.get("stageModels")[a].on("change",function(){this.trigger("change")},this),this.getStageModel(f.name)},addStageItem:function(a,b,c,d){this.getStageModel(a).addItem(b,c,d)},addStageModel:function(a){var b=this.get("stages"),c=this.get("stageModels"),e=new d(a);b.push(a),c[a.name]=e,this.set("stages",b),this.set("stageModels",c)},getStageModel:function(a){return this.get("stageModels")[a]},getStageItems:function(a,b){var c=this.getStageModel(a),d=c.get("items");return void 0===b?d:d.map(function(a){return a[b]})},setActiveStage:function(a){this.setStageComplete(),this.set("activeStageName",a),this.getStageModel(a).set("status","active"),this.trigger("change:activeStage")},setStageComplete:function(a){a||(a=this.get("activeStageName")),null!==a&&this.getStageModel(a).set("status","complete"),wpmdb.current_migration.currentStageNum=wpmdb.current_migration.currentStageNum+1},setMigrationComplete:function(){var a=this.getStageModel(this.get("activeStageName"));this.setStageComplete(),this.trigger("migrationComplete"),this.set("migrationStatus","complete"),a.activateTab()}});b.exports=f},{"MigrationProgressStage-model":5}],3:[function(a,b,c){var d=jQuery;b.exports={updateProgTableVisibilitySetting:function(){wpmdb_data.prog_tables_visibility_changed&&(wpmdb_data.prog_tables_visibility_changed=!1,d.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_setting",nonce:wpmdb_data.nonces.save_setting,setting:"prog_tables_hidden",checked:Boolean(wpmdb_data.prog_tables_hidden)},error:function(a,b,c){console.log("Could not save progress item visibility setting",c)}}))},updatePauseBeforeFinalizeSetting:function(){wpmdb_data.pause_before_finalize_changed&&(wpmdb_data.pause_before_finalize_changed=!1,d.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_setting",nonce:wpmdb_data.nonces.save_setting,setting:"pause_before_finalize",checked:Boolean(wpmdb_data.pause_before_finalize)},error:function(a,b,c){console.log("Could not save pause before finalize setting",c)}}))}}},{}],4:[function(a,b,c){var d=a("./MigrationProgressStage-view.js"),e=(jQuery,Backbone.View.extend({tagName:"div",className:"migration-progress-stages",id:"migration-progress-stages",self:this,initialize:function(){this.$el.empty(),this.model.on("stage:added",function(a){this.addStageView(a)},this),_.each(this.model.get("stageModels"),this.addStageView,this)},addStageView:function(a){var b=new d({model:a});a.trigger("view:initialized",b),this.$el.append(b.$el),this.$el.parent().find(".stage-tabs").append(b.$tabElem)}}));b.exports=e},{"./MigrationProgressStage-view.js":6}],5:[function(a,b,c){var d=jQuery,e=Backbone.Model.extend({defaults:{status:"queued",_initialItems:null,items:null,lookupItems:null,totalSize:0,totalTransferred:0,dataType:"local",name:"",itemsComplete:0,itemsCompleteArr:[],strings:null},initialize:function(){this.initStrings(),this.set("_initialItems",this.get("items").slice()),this.set("items",[]),this.set("lookupItems",{}),this.set("itemsCompleteArr",[]),_.each(this.get("_initialItems"),function(a){this.addItem(a.name,a.size,a.rows)},this),this.on("view:initialized",this.triggerItemViewInit),this.on("change",function(){wpmdb.current_migration.updateTitleElem()})},initStrings:function(){var a={stage_title:this.get("name"),migrated:wpmdb_strings.migrated,queued:wpmdb_strings.queued,active:wpmdb_strings.running,complete:wpmdb_strings.complete,hide:wpmdb_strings.hide,show:wpmdb_strings.show,itemsName:wpmdb_strings.tables},b=this.get("strings");b="object"==typeof b?b:{},b=d.extend(a,b),b.items_migrated=b.itemsName+" "+b.migrated,b.hide_items=b.hide+" "+b.itemsName,b.show_items=b.show+" "+b.itemsName,this.set("strings",b)},addItem:function(a,b,c){var d=this.get("items"),e={name:a,size:b||1,rows:c||b,stageName:this.get("name"),$el:null,transferred:0,rowsTransferred:0,complete:!1};d.push(e),this.get("lookupItems")[a]=d.length-1,this.set("totalSize",parseInt(this.get("totalSize"))+parseInt(b)),this.trigger("item:added",e)},triggerItemViewInit:function(){var a=this.get("items"),b=this;_.each(a,function(a){b.trigger("item:added",a)})},getTotalSizeTransferred:function(){return this.get("totalTransferred")},countItemsComplete:function(){return this.get("itemsComplete")},getTotalProgressPercent:function(){var a=this.getTotalSizeTransferred(),b=this.get("totalSize");return 0>=a||0>=b?0:Math.min(100,Math.floor(a/b*100))},activateTab:function(){this.trigger("activateTab"),wpmdb.current_migration.model.trigger("change:activeStage")},setItemComplete:function(a){var b=this.get("itemsCompleteArr");if(!~b.indexOf(a)){b.push(a);var c=this.getItemByName(a),d=this.get("totalTransferred"),e=this.get("itemsComplete");this.set("itemsComplete",++e),d+=c.size-c.transferred,this.set("totalTransferred",d),c.transferred=c.size,c.complete=!0,c.rowsTransferred=c.rows,this.trigger("change change:items",c)}},setItemRowsTransferred:function(a,b){var c,d,e=this.getItemByName(a),f=this.get("totalTransferred");return c=-1===parseInt(b)?1:Math.min(1,b/e.rows),1===c?void this.setItemComplete(a):(d=e.size*c,f+=d-e.transferred,this.set("totalTransferred",f),e.transferred=d,e.rowsTransferred=b,void this.trigger("change change:items",e))},getItemByName:function(a){var b=this.get("items")[this.get("lookupItems")[a]]||{};return a===b.name?b:this.determineItemByName(a)},determineItemByName:function(a){for(var b=this.get("items"),c=0;c<b.length;c++){var d=b[c];if(a===d.name)return this.get("lookupItems").itemName=c,d}}});b.exports=e},{}],6:[function(a,b,c){var d=jQuery,e=Backbone.View.extend({tagName:"div",className:"migration-progress-stage-container hide-tables",$totalProgressElem:null,$tabElem:null,$showHideTablesElem:null,$pauseBeforeFinalizeElem:null,$pauseBeforeFinalizeCheckbox:null,$itemsContainer:null,itemViews:null,maxDomNodes:100,visibleDomNodes:0,queuedElements:null,$truncationNotice:null,$truncationNoticeHiddenItems:null,initialize:function(){this.$el.empty(),this.$el.attr("data-stage",this.model.get("name")).addClass("queued "+this.model.get("name")),this.queuedElements=[],this.initTotalProgressElem(),wpmdb.current_migration.view.$el.parent().find(".stage-tabs").after(this.$totalProgressElem),this.$itemsContainer=d("<div class=progress-items />"),this.$el.append(this.$itemsContainer),this.initTabElem(),this.model.on("item:added",this.maybeAddElementToView,this),_.each(this.model.get("itemModels"),this.maybeAddElementToView,this),this.model.on("change",function(){this.updateProgressElem(),this.updateStageTotals()},this),this.model.on("change:status",function(a){this.$el.removeClass("queued active").addClass(this.model.get("status")),this.$totalProgressElem.removeClass("queued active").addClass(this.model.get("status")),this.$tabElem.removeClass("queued active").addClass(this.model.get("status")).find(".stage-status").text(this.model.get("strings")[this.model.get("status")])},this),this.model.on("change:items",function(a){a.name&&this.setItemProgress(a)},this),this.model.on("activateTab",function(){"complete"===wpmdb.current_migration.model.get("migrationStatus")&&(this.$totalProgressElem.addClass("active").siblings().removeClass("active"),this.$tabElem.addClass("active").siblings().removeClass("active"),this.$el.addClass("active").siblings().removeClass("active"))},this)},initTotalProgressElem:function(){this.initShowHideTablesElem(),this.initPauseBeforeFinalizeElem(),this.$totalProgressElem=d('<div class="stage-progress '+this.model.get("name")+'" />').append("<span class=percent-complete>0</span>% "+this.model.get("strings").complete+" ").append("(<span class=size-complete>0 MB</span> / <span class=size-total>0 MB</span>) ").append("<span class=tables-complete>0</span> <span class=lowercase >of</span> <span class=tables-total>0</span> "+this.model.get("strings").items_migrated).append(this.$showHideTablesElem).append("<div class=progress-bar-wrapper><div class=progress-bar /></div>"),this.updateStageTotals()},initShowHideTablesElem:function(){this.$showHideTablesElem=d("<a class=show-hide-tables/>").text(this.model.get("strings").show_items);var a=this;this.$showHideTablesElem.on("click show-hide-progress-tables",function(){var b;a.$el.hasClass("hide-tables")?(b=!1,a.$el.add(a.$el.siblings()).removeClass("hide-tables"),a.$showHideTablesElem.text(a.model.get("strings").hide_items)):(b=!0,a.$el.add(a.$el.siblings()).addClass("hide-tables"),a.$showHideTablesElem.text(a.model.get("strings").show_items)),Boolean(b)!==Boolean(wpmdb_data.prog_tables_hidden)&&(wpmdb_data.prog_tables_visibility_changed=!0,wpmdb_data.prog_tables_hidden=b)}),wpmdb_data.prog_tables_hidden||this.$showHideTablesElem.triggerHandler("show-hide-progress-tables"),this.model.on("change:status activateTab",function(){wpmdb_data.prog_tables_hidden?a.$showHideTablesElem.text(a.model.get("strings").show_items):a.$showHideTablesElem.text(a.model.get("strings").hide_items)})},initPauseBeforeFinalizeElem:function(){this.$pauseBeforeFinalizeElem=d(".pause-before-finalize"),this.$pauseBeforeFinalizeCheckbox=this.$pauseBeforeFinalizeElem.find("input[type=checkbox]");var a=this,b=!1,c=wpmdb.current_migration.model.get("migrationIntent");wpmdb_data.pause_before_finalize&&(b=!0),this.$pauseBeforeFinalizeCheckbox.prop("checked",b),-1!==d.inArray(c,["push","pull","find_replace"])?("find_replace"===c&&d("#pause-before-finalize-label").text(wpmdb_strings.pause_before_finalize_find_replace),this.$pauseBeforeFinalizeElem.show()):this.$pauseBeforeFinalizeElem.hide(),wpmdb.current_migration.model.on("change:activeStage",function(){"media"===wpmdb.current_migration.model.get("activeStageName")&&a.$pauseBeforeFinalizeElem.hide()}),this.$pauseBeforeFinalizeElem.on("click",function(){var b=Boolean(a.$pauseBeforeFinalizeCheckbox.is(":checked"));b!==Boolean(wpmdb_data.pause_before_finalize)&&(wpmdb_data.pause_before_finalize_changed=!0,wpmdb_data.pause_before_finalize=b)})},initTabElem:function(){var a=this;this.$tabElem=d("<a class=stage-tab>").append("<span class=stage-title>"+this.model.get("strings").stage_title+"</span> ").append("<span class=stage-status>"+this.model.get("strings").queued+"</span> ").on("click",function(){a.model.activateTab()})},updateProgressElem:function(){var a=Math.max(0,this.model.getTotalProgressPercent()),b=wpmdb.functions.convertKBSizeToHRFixed(Math.min(this.model.getTotalSizeTransferred(),this.model.get("totalSize"))),c=Math.min(this.model.countItemsComplete(),this.model.get("items").length);"complete"===this.model.get("status")&&0===this.model.get("totalSize")&&(a=100,this.$showHideTablesElem.fadeOut()),this.$totalProgressElem.find(".percent-complete").text(a),this.$totalProgressElem.find(".size-complete").text(b),this.$totalProgressElem.find(".tables-complete").text(wpmdb_add_commas(c)),this.$totalProgressElem.find(".progress-bar-wrapper .progress-bar").css({width:a+"%"})},updateStageTotals:function(){var a=this.model.get("items").length;this.$totalProgressElem.find(".tables-total").text(wpmdb_add_commas(a)),this.$totalProgressElem.find(".size-total").text(wpmdb.functions.convertKBSizeToHR(this.model.get("totalSize")))},initializeItemElement:function(a){var b=d('<div class="item-progress" />'),c=d('<div class="progress-bar"/>').css("width","0%"),e=d("<p>").addClass("item-info").append(d('<span class="name" />').text(a.name)).append(" ").append(d('<span class="size" />').text("("+wpmdb.functions.convertKBSizeToHRFixed(a.size)+")"));return b.append(e),b.append(c),b.append('<span class="dashicons dashicons-yes"/>'),b.attr("id","item-"+a.name),b.attr("data-stage",this.model.get("name")),a.$el=b,a.$progress=c,a.$title=e,a},maybeAddElementToView:function(a){this.visibleDomNodes<this.maxDomNodes?(++this.visibleDomNodes,this.$itemsContainer.append(this.initializeItemElement(a).$el)):(this.queuedElements.push(a),this.$truncationNotice?this.updateTruncationNotice():this.showTruncationNotice())},showTruncationNotice:function(){this.$truncationNotice||(this.$truncationNotice=d('<div class="truncation-notice" >'+wpmdb_strings.progress_items_truncated_msg.replace("%1$s",'<span class="hidden-items">'+wpmdb_add_commas(this.queuedElements.length)+"</span>")+"</div>"),this.$truncationNoticeHiddenItems=this.$truncationNotice.find(".hidden-items"),this.$itemsContainer.after(this.$truncationNotice))},updateTruncationNotice:function(){this.$truncationNoticeHiddenItems.text(wpmdb_add_commas(this.queuedElements.length))},getNextElementForView:function(a){var b;return this.queuedElements.length&&(a&&this.queuedElements.push(a),b=this.queuedElements.shift(),a=b instanceof d?b:this.initializeItemElement(b).$el),a},setItemProgress:function(a){var b=Math.min(100,Math.ceil(100*(a.transferred/a.size)));a.$progress.css("width",b+"%"),b>=100&&this.elemComplete(a)},elemComplete:function(a){var b=a.$el.addClass("complete");if(1!==this.model.get("items").length){var c=this.getNextElementForView(b),d=b.height(),e=b.css("margin-bottom"),f=c.clone().css({height:0,marginBottom:0}).addClass("clone");f.appendTo(this.$itemsContainer),b.css({height:d,marginBottom:e}),setTimeout(function(){b.css({height:0,marginBottom:0}),f.css({height:d,marginBottom:e}),setTimeout(function(){b.css({height:"auto",marginBottom:e}).remove(),f.remove(),this.$itemsContainer.find(".item-progress:not(.clone)").last().after(c.css({height:"auto",marginBottom:e}))}.bind(this),250)}.bind(this),1e3)}}});b.exports=e},{}],7:[function(a,b,c){!function(b,c){function d(a,b){var c,d,e=[],f={},g=b.length;for(c=0;g>c;c++)f[b[c]]=!0;for(g=a.length,c=0;g>c;c++)d=a[c],d in f&&e.push(d);return e}function e(a){a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var b=new RegExp("[\\?&]"+a+"=([^&#]*)"),c=b.exec(location.search);return null===c?"":decodeURIComponent(c[1].replace(/\+/g," "))}function f(a,c,d){var e=a.substr(0,a.indexOf(":"));return d!==e&&-1!==a.indexOf("https")?(b(".ssl-notice").show(),N=!0,a=a.replace("https","http"),void b(".pull-push-connection-info").val(a+"\n"+c)):void(N=!1)}function g(a){a!==wpmdb_data.this_prefix&&(b(".remote-prefix").html(a),M=!0,"pull"===wpmdb_migration_type()?b(".prefix-notice.pull").show():b(".prefix-notice.push").show())}function h(){if("undefined"!=typeof c.common.connection_data&&!1!==c.common.connection_data){var a=wpmdb_migration_type(),d=s(null,null);b(".mixed-case-table-name-notice").hide(),null!==d&&(d=d.join(""),d!==d.toLowerCase()&&("1"===c.common.connection_data.lower_case_table_names||"push"!==a&&"savefile"!==a)&&("1"!==wpmdb_data.lower_case_table_names&&"pull"===a||("push"===a||"savefile"===a?b(".mixed-case-table-name-notice.push").show():b(".mixed-case-table-name-notice.pull").show())))}}function i(a){var b=a,c=b.replace(/\/\/(.*)@/,"//").replace("http://","").replace("https://","").replace("www.","");return c}function j(a,b,c){var d=i(b);return"completed"===c?a.replace(/\%s\s?/,"<span class=domain-label>"+d+"</span>&nbsp;"):a.replace(/\%s(\S*)\s?/,"<span class=domain-label>"+d+"$1</span>&nbsp;")}function k(a,b,c){var d="",e="";switch(b){case"push":d=wpmdb_strings.push_migration_label_migrating,e=wpmdb_strings.push_migration_label_completed;break;case"pull":d=wpmdb_strings.pull_migration_label_migrating,e=wpmdb_strings.pull_migration_label_completed;break;case"find_replace":d=wpmdb_strings.find_replace_label_migrating,e=wpmdb_strings.find_replace_label_completed;break;case"savefile":d=wpmdb_strings.exporting_please_wait,e=wpmdb_strings.exporting_complete}var f=d;return"completed"===c&&(f=e),"push"!==b&&"pull"!==b||(f=j(f,a,c)),f}function l(a){return a.replace(/^https?:/i,"")}function m(){b(".option-group").each(function(a){b("input",this).attr("disabled","disabled"),b("label",this).css("cursor","default")})}function n(){b(".option-group").each(function(a){b("input",this).removeAttr("disabled"),b("label",this).css("cursor","pointer")})}function o(a,c,d,e){var f=c;void 0!==e&&(f=e),b(".slider",a).slider("value",parseInt(c)),b(".amount",a).html(wpmdb_add_commas(f)+" "+d)}function p(a){!0===U?(U=!1,F=!0,c.current_migration.setState(V,W,"active"),b(".pause-resume").html(wpmdb_strings.pause),c.current_migration.resumeTimer(),c.functions.execute_next_step()):(U=!0,F=!1,Z=wpmdb_strings.migration_paused,V=b(".progress-title").html(),W=b(".progress-text",".progress-wrapper-primary").html(),X=b(".progress-text",".progress-wrapper-secondary ").html(),"find_replace"===x&&(Z=wpmdb_strings.find_replace_paused),c.current_migration.setState(Z,wpmdb_strings.completing_current_request,null),b("body").off("click",".pause-resume"),b("body").off("click",".cancel"))}function q(a,c,d){var e=document.createElement("select");return b(e).attr({multiple:"multiple",name:"select_tables[]",id:"select-tables","class":"multiselect"}),0<a.length&&b.each(a,function(a,f){if(!b.wpmdb.apply_filters("wpmdb_exclude_table",!1,f)){var g=" ";void 0!==d&&null!==d&&0<d.length&&-1!==b.inArray(f,d)&&(g=' selected="selected" '),b(e).append("<option"+g+'value="'+f+'">'+f+" ("+c[f]+")</option>")}}),e}function r(a,b){var d=wpmdb_data.this_temp_prefix;return"pull"===wpmdb_migration_type()&&"undefined"!=typeof c.common.connection_data&&"undefined"!=typeof c.common.connection_data.temp_prefix&&(d=c.common.connection_data.temp_prefix),d===b.substring(0,d.length)?!0:a}function s(a,d){var e="",f=wpmdb_migration_type(),g=b("input[name=table_migrate_option]:checked").val();return"migrate_select"===g?e=b("#select-tables").val():("pull"!==f&&"undefined"!=typeof wpmdb_data.this_prefixed_tables&&(e=wpmdb_data.this_prefixed_tables),"pull"===f&&"undefined"!=typeof c.common.connection_data&&"undefined"!=typeof c.common.connection_data.prefixed_tables&&(e=c.common.connection_data.prefixed_tables)),e}function t(a,c){return b(".table-select-wrap .table-prefix").text()}function u(a){!0===a?(b('.replace-row.pin .replace-right-col input[type="text"]').attr("readonly","readonly"),b(".replace-row.pin .arrow-col").addClass("disabled")):(b('.replace-row.pin .replace-right-col input[type="text"]').removeAttr("readonly"),b(".replace-row.pin .arrow-col").removeClass("disabled"))}function v(a){c.common.previous_connection_data=c.common.connection_data,c.common.connection_data=a,b.wpmdb.do_action("wpmdb_connection_data_updated",a)}function w(a){var b={};return b.unit="MB",b.amount=(a/1024).toFixed(2),b}var x,y,z,A,B,C,D=!1,E="",F=!1,G=!1,H=!1,I=!1,J=!1,K=!1,L=!1,M=!1,N=!1,O=!1,P=!1,Q=!1,R="",S="",T="",U=!1,V="",W="",X="",Y="",Z="",$=!1,_=!1,aa=0,ba=400,ca=!1,da=!1;c.migration_progress_controller=a("MigrationProgress-controller"),c.current_migration=null,c.migration_selection=wpmdb_migration_type();var ea=ajaxurl.replace("/admin-ajax.php",""),fa=ea+"/images/spinner";2<window.devicePixelRatio&&(fa+="-2x"),fa+=".gif";var ga='<img src="'+fa+'" alt="" class="ajax-spinner general-spinner" />';window.onbeforeunload=function(a){return Q?(a=a||window.event,a&&(a.returnValue=wpmdb_strings.sure),wpmdb_strings.sure):void 0},b.wpmdb.add_filter("wpmdb_exclude_table",r),b(document).ready(function(){function a(a){var c=!G;L=!0,b.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_check_licence",licence:a,context:"all",nonce:wpmdb_data.nonces.check_licence},error:function(a,b,c){alert(wpmdb_strings.license_check_problem)},success:function(a){var d,e,f,g=b(".support-content"),h=b(".addons-content"),i=b(".licence-status:not(.notification-message)");if("undefined"!=typeof a.dbrains_api_down)e=a.dbrains_api_down+a.message,f=a.dbrains_api_down;else if("undefined"!=typeof a.errors){if("undefined"!=typeof a.errors.subscription_expired)d=a.errors.subscription_expired.licence,e=a.errors.subscription_expired.support,f=a.errors.subscription_expired.addons;else{var j="";for(var k in a.errors)j+=a.errors[k];e=j,f=j}"undefined"!=typeof a.addon_content&&(f+="\n"+a.addon_content)}else e=a.message,f=a.addon_content;c&&i.stop().fadeOut(ba,function(){"undefined"==typeof d&&(b(this).css({visibility:"hidden",display:"block"}).slideUp(),d=""),b(this).empty().html(d).stop().fadeIn(ba)}),g.stop().fadeOut(ba,function(){b(this).empty().html(e).stop().fadeIn(ba)}),h.stop().fadeOut(ba,function(){b(this).empty().html(f).stop().fadeIn(ba)})}})}function j(){void 0!==wpmdb_data&&void 0!==wpmdb_data.this_tables&&void 0!==wpmdb_data.this_table_sizes_hr&&(Aa=q(wpmdb_data.this_tables,wpmdb_data.this_table_sizes_hr,b(Aa).val())),void 0!==c.common.connection_data&&void 0!==c.common.connection_data.tables&&void 0!==c.common.connection_data.table_sizes_hr&&(Ba=q(c.common.connection_data.tables,c.common.connection_data.table_sizes_hr,b(Ba).val()))}function r(){b("#select-tables").remove(),b(".select-tables-wrap").prepend(Aa),b("#select-tables").change()}function V(){b("#select-tables").remove(),b(".select-tables-wrap").prepend(Ba),b("#select-tables").change()}function W(){b("#migrate-selected").parents(".option-section").children(".header-expand-collapse").children(".expand-collapse-arrow").removeClass("collapsed"),b(".table-select-wrap").show(),b("#migrate-only-with-prefix").prop("checked",!1),b("#migrate-selected").prop("checked",!0),b(".table-migrate-options").hide(),b(".select-tables-wrap").show()}function X(){b(".table-migrate-options").show()}function Z(){b("#select-tables").children("option").prop("selected",!0),b("#select-tables").change()}function ea(a,b){return l(wpmdb_data.this_url)}function ha(){var a=wpmdb_migration_type(),d=b.trim(b(".pull-push-connection-info").val()).split("\n");if("undefined"!=typeof wpmdb_default_profile&&!0!==wpmdb_default_profile&&"savefile"!==a&&"find_replace"!==a&&!F&&wpmdb_data.is_pro){F=!0,m(),b(".connection-status").html(wpmdb_strings.establishing_remote_connection),b(".connection-status").removeClass("notification-message error-notice migration-error"),b(".connection-status").append(ga);var e=wpmdb_migration_type();b.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_verify_connection_to_remote_site",url:d[0],key:d[1],intent:e,nonce:wpmdb_data.nonces.verify_connection_to_remote_site,convert_post_type_selection:wpmdb_convert_post_type_selection,profile:wpmdb_data.profile},error:function(a,c,d){b(".connection-status").html(pa(a.responseText,"(#102)",a)),b(".connection-status").addClass("notification-message error-notice migration-error"),b(".ajax-spinner").remove(),F=!1,n()},success:function(a){if(b(".ajax-spinner").remove(),F=!1,n(),"undefined"!=typeof a.wpmdb_error&&1===a.wpmdb_error)return b(".connection-status").html(a.body),b(".connection-status").addClass("notification-message error-notice migration-error"),void(a.body.indexOf("401 Unauthorized")>-1&&b(".basic-access-auth-wrapper").show());f(d[0],d[1],a.scheme),g(a.prefix),b(".pull-push-connection-info").addClass("temp-disabled"),b(".pull-push-connection-info").attr("readonly","readonly"),b(".connect-button").hide(),b(".connection-status").hide(),b(".step-two").show(),D=!0,v(a),na(),h();var e="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_tables&&(e=wpmdb_loaded_tables),Ba=q(c.common.connection_data.tables,c.common.connection_data.table_sizes_hr,e);var i="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_post_types&&("undefined"!=typeof a.select_post_types?(b("#exclude-post-types").attr("checked","checked"),b(".post-type-select-wrap").show(),i=a.select_post_types):i=wpmdb_loaded_post_types);var j=document.createElement("select");b(j).attr({multiple:"multiple",name:"select_post_types[]",id:"select-post-types","class":"multiselect"}),b.each(c.common.connection_data.post_types,function(a,c){var d=b.inArray(c,i);d=-1!==d||!0===wpmdb_convert_exclude_revisions&&"revision"!==c?' selected="selected" ':" ",b(j).append("<option"+d+'value="'+c+'">'+c+"</option>")}),Da=j;var k="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_tables_backup&&(k=wpmdb_loaded_tables_backup);var l=document.createElement("select");b(l).attr({multiple:"multiple",name:"select_backup[]",id:"select-backup","class":"multiselect"}),b.each(c.common.connection_data.tables,function(a,d){var e=b.inArray(d,k);e=-1!==e?' selected="selected" ':" ",b(l).append("<option"+e+'value="'+d+'">'+d+" ("+c.common.connection_data.table_sizes_hr[d]+")</option>")}),Ea=l,"pull"===wpmdb_migration_type()?(b.wpmdb.do_action("wpmdb_update_pull_table_select"),b("#select-post-types").remove(),b(".exclude-post-types-warning").after(Da),b("#select-backup").remove(),b(".backup-tables-wrap").prepend(Fa),b(".table-prefix").html(a.prefix),b(".uploads-dir").html(wpmdb_data.this_uploads_dir)):(b("#select-backup").remove(),b(".backup-tables-wrap").prepend(Ea)),b.wpmdb.do_action("verify_connection_to_remote_site",c.common.connection_data)}})}}function ia(c,d){b(".licence-input, .register-licence").remove(),b(".licence-not-entered").prepend(c.masked_licence),b(".support-content").empty().html("<p>"+wpmdb_strings.fetching_license+'<img src="'+fa+'" alt="" class="ajax-spinner general-spinner" /></p>'),a(d),b(".migrate-selection label").removeClass("disabled"),b(".migrate-selection input").removeAttr("disabled")}function ja(){b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_get_log",nonce:wpmdb_data.nonces.get_log},error:function(a,b,c){alert(wpmdb_strings.update_log_problem)},success:function(a){b(".debug-log-textarea").val(a)}})}function ka(){var a=b("#select-post-types").val(),c="",d=b(".exclude-post-types-warning"),e=d.find(".migrate-msg"),f=d.find(".find-replace-msg");"find_replace"===wpmdb_migration_type()?(e.hide(),f.show()):(f.hide(),e.show()),a?(c="<code>"+a.join("</code>, <code>")+"</code>",b(".excluded-post-types").html(c),"0"===d.css("opacity")&&d.css({opacity:0}).slideDown(200).animate({opacity:1})):d.css({opacity:0}).slideUp(200).animate({opacity:0})}function la(){b("#overlay").removeClass("show").addClass("hide"),b("#overlay > div").removeClass("show").addClass("hide"),c.current_migration.$proVersion.find("iframe").remove(),setTimeout(function(){b("#overlay").remove()},500),P=!1}function ma(){var a;if(b(".save-settings-button").blur(),!I){if(b("#migrate-selected").is(":checked")&&null===b("#select-tables").val())return void alert(wpmdb_strings.please_select_one_table);
2
- if("savefile"!==wpmdb_migration_type()&&b("#backup-manual-select").is(":checked")&&null===b("#select-backup").val())return void alert(wpmdb_strings.please_select_one_table_backup);var c=!1;b("#create_new").is(":checked")&&(c=!0);var d=b(".create-new-profile").val();I=!0,a=b(b("#migrate-form")[0].elements).not(".auth-credentials").serialize(),b(".save-settings-button").attr("disabled","disabled").after('<img src="'+fa+'" alt="" class="save-profile-ajax-spinner general-spinner" />'),F=!0,b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_profile",profile:a,nonce:wpmdb_data.nonces.save_profile},error:function(a,c,d){F=!1,alert(wpmdb_strings.save_profile_problem),b(".save-settings-button").removeAttr("disabled"),b(".save-profile-ajax-spinner").remove(),b(".save-settings-button").after('<span class="ajax-success-msg">'+wpmdb_strings.saved+"</span>"),b(".ajax-success-msg").fadeOut(2e3,function(){b(this).remove()}),I=!1},success:function(a){var e=parseInt(b("#migrate-form input[name=save_migration_profile_option]:checked").val(),10)+1;if(F=!1,b(".save-settings-button").removeAttr("disabled"),b(".save-profile-ajax-spinner").remove(),b(".save-settings-button").after('<span class="ajax-success-msg">'+wpmdb_strings.saved+"</span>"),b(".ajax-success-msg").fadeOut(2e3,function(){b(this).remove()}),I=!1,b(".create-new-profile").val(""),c){var f=parseInt(a,10),g=f+1,h=b('<li><span class="delete-profile" data-profile-id="'+g+'"></span><label for="profile-'+g+'"><input id="profile-'+g+'" value="'+f+'" name="save_migration_profile_option" type="radio"></label></li>');h.find("label").append(document.createTextNode(" "+d)),e=g,b("#create_new").parents("li").before(h),b("#profile-"+g).attr("checked","checked")}var i=window.location.href.replace("#migrate","").replace(/&wpmdb-profile=-?\d+/,"")+"&wpmdb-profile="+e,j=b("#migrate-form input[name=save_migration_profile_option]:checked").parent().text().trim();if("function"==typeof window.history.pushState){if(b("#migrate-form .crumbs").length)b("#migrate-form .crumbs .crumb:last").text(j);else{var k=b('<div class="crumbs" />').append('<a class="crumb" href="'+wpmdb_data.this_plugin_base+'"> Saved Profiles </a>').append('<span class="crumb">'+j+"</span>");b("#migrate-form").prepend(k)}window.history.pushState({updated_profile_id:e},null,i)}}})}}function na(){b(".connection-status").hide(),b(".prefix-notice").hide(),b(".ssl-notice").hide(),b(".different-plugin-version-notice").hide(),b(".step-two").show(),b(".backup-options").show(),b(".keep-active-plugins").show(),b(".directory-permission-notice").hide(),b("#create-backup").removeAttr("disabled"),b("#create-backup-label").removeClass("disabled"),b(".backup-option-disabled").hide(),b(".compatibility-older-mysql").hide();var a,d=b.trim(b(".pull-push-connection-info").val()).split("\n");if(wpmdb_toggle_migration_action_text(),b.wpmdb.do_action("move_connection_info_box",{migration_type:wpmdb_migration_type(),last_migration_type:E}),"pull"===wpmdb_migration_type()){if(b(".pull-list li").append(Ga),Ga.show(function(){var a=b(this).find(".pull-push-connection-info");a.val()||a.focus()}),("push"===c.migration_selection||"savefile"===c.migration_selection)&&2===d.length)return c.force_reconnect=!0,b(".pull-list li").append(Ga),b(".pull-push-connection-info").removeClass("temp-disabled").attr("readonly","readonly"),b(".connect-button").hide(),void ta();D?(b(".connection-status").hide(),b(".step-two").show(),b(".table-prefix").html(c.common.connection_data.prefix),b(".backup-table-prefix").html(wpmdb_data.site_details.prefix),b(".uploads-dir").html(wpmdb_data.this_uploads_dir),!1===K&&(a=i(c.common.connection_data.url),b(".create-new-profile").val(a)),!0===M&&b(".prefix-notice.pull").show(),!0===N&&b(".ssl-notice").show(),!0===O&&(b(".different-plugin-version-notice").show(),b(".step-two").hide()),wpmdb_toggle_migration_action_text(),!1===wpmdb_data.write_permission&&(b("#create-backup").prop("checked",!1),b("#create-backup").attr("disabled","disabled"),b("#create-backup-label").addClass("disabled"),b(".backup-option-disabled").show(),b(".upload-directory-location").html(wpmdb_data.this_upload_dir_long))):(b(".connection-status").show(),b(".step-two").hide())}else if("push"===wpmdb_migration_type()){if(b(".push-list li").append(Ga),Ga.show(function(){var a=b(this).find(".pull-push-connection-info");a.val()||a.focus()}),("pull"===c.migration_selection||"savefile"===c.migration_selection)&&2===d.length)return c.force_reconnect=!0,b(".push-list li").append(Ga),b(".pull-push-connection-info").removeClass("temp-disabled").attr("readonly","readonly"),b(".connect-button").hide(),void ta();D?(b(".connection-status").hide(),b(".step-two").show(),b(".table-prefix").html(wpmdb_data.this_prefix),b(".backup-table-prefix").html(c.common.connection_data.prefix),b(".uploads-dir").html(c.common.connection_data.uploads_dir),!1===K&&(a=i(c.common.connection_data.url),b(".create-new-profile").val(a)),!0===M&&b(".prefix-notice.push").show(),!0===N&&b(".ssl-notice").show(),!0===O&&(b(".different-plugin-version-notice").show(),b(".step-two").hide()),wpmdb_toggle_migration_action_text(),"0"===c.common.connection_data.write_permissions&&(b("#create-backup").prop("checked",!1),b("#create-backup").attr("disabled","disabled"),b("#create-backup-label").addClass("disabled"),b(".backup-option-disabled").show(),b(".upload-directory-location").html(c.common.connection_data.upload_dir_long))):(b(".connection-status").show(),b(".step-two").hide())}else if(("savefile"===wpmdb_migration_type()||"find_replace"===wpmdb_migration_type())&&(b(".connection-status").hide(),b(".step-two").show(),b(".table-prefix").html(wpmdb_data.this_prefix),!1===K&&b(".create-new-profile").val(""),"savefile"===wpmdb_migration_type()&&(b(".backup-options").hide(),b(".compatibility-older-mysql").show()),b(".keep-active-plugins").hide(),!1===wpmdb_data.write_permission&&(b(".directory-permission-notice").show(),b(".step-two").hide()),"find_replace"===wpmdb_migration_type()&&"true"===wpmdb_data.is_multisite)){var e=b(".old-replace-col").eq(1);e.parent().removeClass("pin").find(".replace-remove-row").show(),e.find("input").removeAttr("readonly")}h()}function oa(){var a=null,d=null;null!==c.common.previous_connection_data&&"object"==typeof c.common.previous_connection_data&&c.common.previous_connection_data.url!==c.common.connection_data.url&&(a=l(c.common.previous_connection_data.url),d=c.common.previous_connection_data.path),"push"===wpmdb_migration_type()||"savefile"===wpmdb_migration_type()?("pull"===E?b(".replace-row").each(function(){var a=b(".old-replace-col input",this).val();b(".old-replace-col input",this).val(b(".replace-right-col input",this).val()),b(".replace-right-col input",this).val(a)}):"push"===E&&"push"===wpmdb_migration_type()&&null!==a&&null!==d&&b(".replace-row").each(function(){var e=b(".replace-right-col input",this).val();e===d&&b(".replace-right-col input",this).val(c.common.connection_data.path),e===a&&b(".replace-right-col input",this).val(l(c.common.connection_data.url))}),b.wpmdb.do_action("wpmdb_update_push_table_select"),b("#select-post-types").remove(),b(".exclude-post-types-warning").after(Ca),ka(),b("#select-backup").remove(),b(".backup-tables-wrap").prepend(Ea)):"pull"===wpmdb_migration_type()&&(""===E||"push"===E||"savefile"===E?b(".replace-row").each(function(){var a=b(".old-replace-col input",this).val();b(".old-replace-col input",this).val(b(".replace-right-col input",this).val()),b(".replace-right-col input",this).val(a)}):"pull"===E&&"pull"===wpmdb_migration_type()&&null!==a&&null!==d&&b(".replace-row").each(function(){var e=b(".old-replace-col input",this).val();e===d&&b(".old-replace-col input",this).val(c.common.connection_data.path),e===a&&b(".old-replace-col input",this).val(l(c.common.connection_data.url))}),b.wpmdb.do_action("wpmdb_update_pull_table_select"),b("#select-post-types").remove(),b(".exclude-post-types-warning").after(Da),ka(),b("#select-backup").remove(),b(".backup-tables-wrap").prepend(Fa)),E=wpmdb_migration_type()}function pa(a,b,c){return wpmdbGetAjaxErrors(wpmdb_strings.connection_local_server_problem,b,a,c)}function qa(a){return/^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)){0})(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)}function ra(c,d){b(".nav-tab").removeClass("nav-tab-active"),b(".nav-tab."+c).addClass("nav-tab-active"),b(".content-tab").hide(),b("."+c+"-tab").show(),"settings"===c&&!0===sa()&&(b("p.licence-status").append("Checking License... ").append(ga),a()),"help"===c&&(ja(),!0===sa()&&(b(".support-content p").append(ga),a())),"addons"===c&&!0!==d&&!0===sa()&&(b(".addons-content p").append(ga),a())}function sa(){return!1===L&&"1"===wpmdb_data.has_licence&&"true"===wpmdb_data.is_pro}function ta(){var a=b(".pull-push-connection-info");if(!F&&!b(a).hasClass("temp-disabled")||!1!==c.force_reconnect){c.force_reconnect=!1;var d=b(".pull-push-connection-info").val(),e=b.trim(d).split("\n"),k=!1,o="";if(""===e&&(k=!0,o=wpmdb_strings.connection_info_missing),1===e.length&&!k){var p=b.trim(d).split(" ");2===p.length&&(e=p)}2===e.length||k||(k=!0,o=wpmdb_strings.connection_info_incorrect),k||qa(e[0])||(k=!0,o=wpmdb_strings.connection_info_url_invalid);var q=0;if("undefined"!=typeof e[1]&&(q=e[1].length),k||32===q||40===q||(k=!0,o=wpmdb_strings.connection_info_key_invalid),k||e[0]!==wpmdb_data.connection_info[0]||(k=!0,o=wpmdb_strings.connection_info_local_url),k||e[1]!==wpmdb_data.connection_info[1]||(k=!0,o=wpmdb_strings.connection_info_local_key),k)return b(".connection-status").html(o),void b(".connection-status").addClass("notification-message error-notice migration-error");var r=e[0]+"\n"+e[1];1===b.trim(d).split("\n").length&&b(".pull-push-connection-info").val(r),!1===wpmdb_data.openssl_available&&(e[0]=e[0].replace("https://","http://"),r=e[0]+"\n"+e[1],b(".pull-push-connection-info").val(r)),M=!1,F=!0,m(),b(".basic-access-auth-wrapper").is(":visible")&&(e[0]=e[0].replace(/\/\/(.*)@/,"//"),e[0]=e[0].replace("//","//"+encodeURIComponent(b.trim(b(".auth-username").val()))+":"+encodeURIComponent(b.trim(b(".auth-password").val()))+"@"),r=e[0]+"\n"+e[1],b(".pull-push-connection-info").val(r),b(".basic-access-auth-wrapper").hide()),b(".step-two").hide(),b(".ssl-notice").hide(),b(".prefix-notice").hide(),b(".connection-status").show(),b(".connection-status").html(wpmdb_strings.establishing_remote_connection),b(".connection-status").removeClass("notification-message error-notice migration-error"),b(".connection-status").append(ga);var s=wpmdb_migration_type();K=!1,b.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_verify_connection_to_remote_site",url:e[0],key:e[1],intent:s,nonce:wpmdb_data.nonces.verify_connection_to_remote_site},error:function(a,c,d){b(".connection-status").html(pa(a.responseText,"(#100)",a)),b(".connection-status").addClass("notification-message error-notice migration-error"),b(".ajax-spinner").remove(),F=!1,n()},success:function(a){if(b(".ajax-spinner").remove(),F=!1,n(),"undefined"!=typeof a.wpmdb_error&&1===a.wpmdb_error)return b(".connection-status").html(a.body),b(".connection-status").addClass("notification-message error-notice migration-error"),a.body.indexOf("401 Unauthorized")>-1&&b(".basic-access-auth-wrapper").show(),void(b(".pull-push-connection-info").hasClass("temp-disabled")||b(".connect-button").is(":visible")||(b(".pull-push-connection-info").removeAttr("readonly"),b(".connect-button").show()));f(e[0],e[1],a.scheme);var d=i(a.url);b(".create-new-profile").val(d),b(".pull-push-connection-info").addClass("temp-disabled"),b(".pull-push-connection-info").attr("readonly","readonly"),b(".connect-button").hide(),b(".connection-status").hide(),b(".step-two").show(),g(a.prefix),D=!0,v(a),na(),oa(),h(),j(),Ea=b(Ba).clone(),b(Ea).attr({name:"select_backup[]",id:"select-backup"});var k=document.createElement("select");b(k).attr({multiple:"multiple",name:"select_post_types[]",id:"select-post-types","class":"multiselect"}),b.each(c.common.connection_data.post_types,function(a,c){b(k).append('<option value="'+c+'">'+c+"</option>")}),Da=k,b("#new-path-missing-warning, #new-url-missing-warning").hide(),"pull"===wpmdb_migration_type()?(b("#new-url").val(l(wpmdb_data.this_url)),b("#new-path").val(wpmdb_data.this_path),"true"===wpmdb_data.is_multisite&&(b("#new-domain").val(wpmdb_data.this_domain),b('.replace-row.pin .old-replace-col input[type="text"]').val(l(a.url))),b("#old-url").val(l(a.url)),b("#old-path").val(a.path),b.wpmdb.do_action("wpmdb_update_pull_table_select"),b("#select-post-types").remove(),b(".exclude-post-types-warning").after(Da),ka(),b(".table-prefix").html(a.prefix),b(".backup-table-prefix").html(wpmdb_data.site_details.prefix),b(".uploads-dir").html(wpmdb_data.this_uploads_dir)):(b("#new-url").val(l(a.url)),b("#new-path").val(a.path),"true"===wpmdb_data.is_multisite&&b('.replace-row.pin .old-replace-col input[type="text"]').val(l(wpmdb_data.this_url)),b.wpmdb.do_action("wpmdb_update_push_table_select"),b("#select-backup").remove(),b(".backup-tables-wrap").prepend(Ea)),c.common.next_step_in_migration={fn:b.wpmdb.do_action,args:["verify_connection_to_remote_site",c.common.connection_data]},c.functions.execute_next_step()}})}}function ua(a){$=!0,Y=wpmdb_strings.cancelling_migration,b(".migration-controls").css({visibility:"hidden"}),"find_replace"===x&&(Y=wpmdb_strings.cancelling_find_replace),c.current_migration.setState(Y,wpmdb_strings.completing_current_request,"cancelling"),!0===U&&(U=!1,c.functions.execute_next_step())}function va(a){var c=b("#"+a),d=c.find("input[type=checkbox]");c.toggleClass("on").find("span").toggleClass("checked");var e=c.find("span.on").hasClass("checked");d.attr("checked",e).trigger("change")}c.migration_state_id="",b("#plugin-compatibility").change(function(a){var c="1",d=b(this).closest("td").next("td").find(".setting-status");if(b(this).is(":checked")){var e=confirm(wpmdb_strings.mu_plugin_confirmation);if(!e)return void b(this).prop("checked",!1)}else c="0";b(".plugin-compatibility-wrap").toggle(),d.find(".ajax-success-msg").remove(),d.append(ga),b("#plugin-compatibility").attr("disabled","disabled"),b(".plugin-compatibility").addClass("disabled"),b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_plugin_compatibility",install:c,nonce:wpmdb_data.nonces.plugin_compatibility},error:function(a,c,d){alert(wpmdb_strings.plugin_compatibility_settings_problem+"\r\n\r\n"+wpmdb_strings.status+" "+a.status+" "+a.statusText+"\r\n\r\n"+wpmdb_strings.response+"\r\n"+a.responseText),b(".ajax-spinner").remove(),b("#plugin-compatibility").removeAttr("disabled"),b(".plugin-compatibility").removeClass("disabled")},success:function(a){""!==b.trim(a)?alert(a):(d.append('<span class="ajax-success-msg">'+wpmdb_strings.saved+"</span>"),b(".ajax-success-msg").fadeOut(2e3,function(){b(this).remove()})),b(".ajax-spinner").remove(),b("#plugin-compatibility").removeAttr("disabled"),b(".plugin-compatibility").removeClass("disabled")}})}),b("#plugin-compatibility").is(":checked")&&b(".plugin-compatibility-wrap").show(),(0<=navigator.userAgent.indexOf("MSIE")||0<=navigator.userAgent.indexOf("Trident"))&&b(".ie-warning").show(),0===wpmdb_data.valid_licence&&b("#savefile").prop("checked",!0);var wa=b(".max-request-size"),xa=b(".slider",wa);xa.slider({range:"min",value:parseInt(wpmdb_data.max_request/1024),min:512,max:parseInt(wpmdb_data.bottleneck/1024),step:256,create:function(a,b){var c=w(wpmdb_data.max_request/1024);o(wa,wpmdb_data.max_request/1024,c.unit,c.amount)},slide:function(a,b){var c=w(b.value);o(wa,b.value,c.unit,c.amount)},stop:function(a,c){b(".slider-success-msg").remove(),b(".amount",wa).after('<img src="'+fa+'" alt="" class="slider-spinner general-spinner" />'),xa.slider("disable"),b.ajax({url:ajaxurl,type:"POST",cache:!1,data:{action:"wpmdb_update_max_request_size",max_request_size:parseInt(c.value),nonce:wpmdb_data.nonces.update_max_request_size},error:function(a,c,d){xa.slider("enable"),b(".slider-spinner",wa).remove(),alert(wpmdb_strings.max_request_size_problem);var e=w(wpmdb_data.max_request/1024);o(wa,wpmdb_data.max_request/1024,e.unit,e.amount),xa.slider("enable")},success:function(){xa.slider("enable"),b(".slider-label-wrapper",wa).append('<span class="slider-success-msg">'+wpmdb_strings.saved+"</span>"),b(".slider-success-msg",wa).fadeOut(2e3,function(){b(this).remove()}),b(".slider-spinner",wa).remove()}})}});var ya=b(".delay-between-requests"),za=b(".slider",ya);za.slider({range:"min",value:parseInt(wpmdb_data.delay_between_requests/1e3),min:0,max:10,step:1,create:function(a,b){o(ya,wpmdb_data.delay_between_requests/1e3,"s")},slide:function(a,b){o(ya,b.value,"s")},stop:function(a,c){b(".slider-success-msg").remove(),b(".amount",ya).after('<img src="'+fa+'" alt="" class="slider-spinner general-spinner" />'),za.slider("disable"),b.ajax({url:ajaxurl,type:"POST",cache:!1,data:{action:"wpmdb_update_delay_between_requests",delay_between_requests:parseInt(1e3*c.value),nonce:wpmdb_data.nonces.update_delay_between_requests},error:function(a,c,d){za.slider("enable"),b(".slider-spinner",ya).remove(),alert(wpmdb_strings.delay_between_requests_problem),o(ya,wpmdb_data.delay_between_requests/1e3,"s"),za.slider("enable")},success:function(){wpmdb_data.delay_between_requests=parseInt(1e3*c.value),za.slider("enable"),b(".slider-label-wrapper",ya).append('<span class="slider-success-msg">'+wpmdb_strings.saved+"</span>"),b(".slider-success-msg",ya).fadeOut(2e3,function(){b(this).remove()}),b(".slider-spinner",ya).remove()}})}});var Aa=b("#select-tables").clone(),Ba=b("#select-tables").clone(),Ca=b("#select-post-types").clone(),Da=b("#select-post-types").clone(),Ea=b("#select-backup").clone(),Fa=b("#select-backup").clone();b(".help-tab .video").each(function(){var a=b(this),c=b(".video-viewer");b("a",this).click(function(d){d.preventDefault(),c.attr("src","//www.youtube.com/embed/"+a.data("video-id")+"?autoplay=1"),c.show();var e=c.offset();b(window).scrollTop(e.top-50)})}),b(".backup-options").show(),b(".keep-active-plugins").show(),"savefile"===wpmdb_migration_type()&&(b(".backup-options").hide(),b(".keep-active-plugins").hide()),E=wpmdb_migration_type(),b(".content-tab").on("click",".check-my-licence-again",function(c){c.preventDefault(),L=!1,b(c.target).replaceWith("Checking... "+ga),a(null,"all")}),b.wpmdb.add_action("wpmdb_refresh_table_selects",j),b.wpmdb.add_action("wpmdb_update_push_table_select",r),b.wpmdb.add_action("wpmdb_update_pull_table_select",V),b.wpmdb.add_action("wpmdb_disable_table_migration_options",W),b.wpmdb.add_action("wpmdb_enable_table_migration_options",X),b.wpmdb.add_action("wpmdb_select_all_tables",Z),b.wpmdb.add_filter("wpmdb_base_old_url",ea),ha(),b("body").on("click",".js-action-link",function(a){a.preventDefault(),b(this).blur()}),b(".licence-input").keypress(function(a){13===a.which&&(a.preventDefault(),b(".register-licence").click())}),b("body").on("click",".register-licence",function(a){if(a.preventDefault(),!G){var c=b.trim(b(".licence-input").val()),d=b(".licence-status");if(d.removeClass("notification-message error-notice success-notice"),""===c)return void d.html('<div class="notification-message error-notice">'+wpmdb_strings.enter_license_key+"</div>");d.empty().removeClass("success"),G=!0,b(".button.register-licence").after('<img src="'+fa+'" alt="" class="register-licence-ajax-spinner general-spinner" />'),b.ajax({url:ajaxurl,type:"POST",dataType:"JSON",cache:!1,data:{action:"wpmdb_activate_licence",licence_key:c,nonce:wpmdb_data.nonces.activate_licence,context:"licence"},error:function(a,c,e){G=!1,b(".register-licence-ajax-spinner").remove(),d.html(wpmdb_strings.register_license_problem)},success:function(a){if(b(".register-licence-ajax-spinner").remove(),"undefined"!=typeof a.errors){var e="";for(var f in a.errors)e+=a.errors[f];d.html(e),"undefined"!=typeof a.masked_licence&&(ia(a,c),b(".migrate-tab .invalid-licence").hide())}else"undefined"!=typeof a.wpmdb_error&&"undefined"!=typeof a.body?d.html(a.body):(1===Number(a.is_first_activation)&&(wpmdb_strings.welcome_text=wpmdb_strings.welcome_text.replace("%1$s","https://deliciousbrains.com/wp-migrate-db-pro/doc/quick-start-guide/"),wpmdb_strings.welcome_text=wpmdb_strings.welcome_text.replace("%2$s","https://deliciousbrains.com/wp-migrate-db-pro/videos/"),d.after('<div id="welcome-wrap"><img id="welcome-img" src="'+wpmdb_data.this_plugin_url+'asset/dist/img/welcome.jpg" /><div class="welcome-text"><h3>'+wpmdb_strings.welcome_title+"</h3><p>"+wpmdb_strings.welcome_text+"</p></div></div>")),d.html(wpmdb_strings.license_registered).delay(5e3).fadeOut(1e3,function(){b(this).css({visibility:"hidden",display:"block"}).slideUp()}),d.addClass("success notification-message success-notice"),ia(a,c),b(".invalid-licence").hide());G=!1}})}}),b(".clear-log").click(function(){b(".ajax-spinner, .ajax-success-msg").remove(),b(this).after(ga),b(".debug-log-textarea").val(""),b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_clear_log",nonce:wpmdb_data.nonces.clear_log},error:function(a,c,d){b(".ajax-spinner").remove(),alert(wpmdb_strings.clear_log_problem)},success:function(a){b(".ajax-spinner, .ajax-success-msg").remove(),ja(),b(".clear-log").after('<span class="ajax-success-msg">'+wpmdb_strings.clear_error_log+"</span>"),b(".ajax-success-msg").fadeOut(2e3,function(){b(this).remove()})}})}),b(".multiselect-select-all").click(function(){var a=b(this).parents(".select-wrap").children(".multiselect");b("option",a).prop("selected",1),b(a).focus().trigger("change")}),b(".multiselect-deselect-all").click(function(){var a=b(this).parents(".select-wrap").children(".multiselect");b("option",a).removeAttr("selected"),b(a).focus().trigger("change")}),b(".multiselect-invert-selection").click(function(){var a=b(this).parents(".select-wrap").children(".multiselect");b("option",a).each(function(){b(this).attr("selected",!b(this).attr("selected"))}),b(a).focus().trigger("change")}),b(".option-group input[type=radio]").change(function(){var a=b(this).closest(".option-group");b("ul",a).hide();var c=b(this).closest("li");b("ul",c).show()}),b(".option-group").each(function(){b(".option-group input[type=radio]").each(function(){if(b(this).is(":checked")){var a=b(this).closest("li");b("ul",a).show()}})}),b(".header-expand-collapse").click(function(){b(".expand-collapse-arrow",this).hasClass("collapsed")?(b(".expand-collapse-arrow",this).removeClass("collapsed"),b(this).next().show()):(b(".expand-collapse-arrow",this).addClass("collapsed"),b(this).next().hide())}),b(".checkbox-label input[type=checkbox]").change(function(){b(this).is(":checked")?b(this).parent().next().show():b(this).parent().next().hide()}),b(".select-post-types-wrap").on("change","#select-post-types",function(){ka()}),b("#exclude-post-types").is(":checked")&&b("#select-post-types").val()&&b(".exclude-post-types-warning").css({display:"block",opacity:1}),b("#save-migration-profile").change(function(){c.functions.update_migrate_button_text(),b(this).is(":checked")?b(".save-settings-button").show():b(".save-settings-button").hide()}),b("#save-migration-profile").is(":checked")&&b(".save-settings-button").show(),b(".create-new-profile").focus(function(){b("#create_new").prop("checked",!0)}),b(".checkbox-label input[type=checkbox]").each(function(){b(this).is(":checked")&&b(this).parent().next().show()}),b(".migrate-db-button").click(function(a){if(b(this).blur(),a.preventDefault(),c.migration_state_id="",!1!==b.wpmdb.apply_filters("wpmdb_migration_profile_ready",!0)){if(b("#migrate-selected").is(":checked")&&null===b("#select-tables").val())return void alert(wpmdb_strings.please_select_one_table);if("savefile"!==wpmdb_migration_type()&&b("#backup-manual-select").is(":checked")&&null===b("#select-backup").val())return void alert(wpmdb_strings.please_select_one_table_backup);var e=!1,f=!1;if(b("#new-url").length&&!b("#new-url").val()&&(b("#new-url-missing-warning").show(),b("#new-url").focus(),b("html,body").scrollTop(0),e=!0),b("#new-path").length&&!b("#new-path").val()&&(b("#new-path-missing-warning").show(),!1===e&&(b("#new-path").focus(),b("html,body").scrollTop(0)),f=!0),!0!==e&&!0!==f){b("#save-migration-profile").is(":checked")&&ma(),A=b(b("#migrate-form")[0].elements).not(".auth-credentials").serialize(),x=wpmdb_migration_type(),B="backup","savefile"===x&&(B="migrate"),!1===b("#create-backup").is(":checked")&&(B="migrate"),c.current_migration=c.migration_progress_controller.newMigration({localTableSizes:wpmdb_data.this_table_sizes,localTableRows:wpmdb_data.this_table_rows,remoteTableSizes:"undefined"!=typeof c.common.connection_data?c.common.connection_data.table_sizes:null,remoteTableRows:"undefined"!=typeof c.common.connection_data?c.common.connection_data.table_rows:null,migrationIntent:wpmdb_migration_type()});var g=b("input[name=backup_option]:checked").val(),h=b("input[name=table_migrate_option]:checked").val(),i="",j="";"backup"===B&&("migrate_only_with_prefix"===h&&"backup_selected"===g&&(g="backup_only_with_prefix"),"push"===x?(j="remote","backup_only_with_prefix"===g?T=c.common.connection_data.prefixed_tables:"backup_selected"===g?(i=b("#select-tables").val(),i=b.wpmdb.apply_filters("wpmdb_backup_selected_tables",i),T=d(i,c.common.connection_data.tables)):"backup_manual_select"===g&&(T=b("#select-backup").val())):(j="local","backup_only_with_prefix"===g?T=wpmdb_data.this_prefixed_tables:"backup_selected"===g?(i=b("#select-tables").val(),i=b.wpmdb.apply_filters("wpmdb_backup_selected_tables",i),T=d(i,wpmdb_data.this_tables)):"backup_manual_select"===g&&(T=b("#select-backup").val())),c.current_migration.model.addStage("backup",T,j,{strings:{migrated:wpmdb_strings.backed_up}})),j=-1!==b.inArray(x,["push","savefile","find_replace"])?"local":"remote","find_replace"===x?("backup"!==B&&(B="find_replace"),c.current_migration.model.addStage("find_replace",s(null,null),j,{strings:{migrated:wpmdb_strings.searched,stage_title:wpmdb_strings.migrate_button_find_replace}})):c.current_migration.model.addStage("migrate",s(null,null),j),b.wpmdb.do_action("wpmdb_add_migration_stages",{data_type:j,tables_to_migrate:s(null,null)});var l=(b("input[name=table_migrate_option]:checked").val(),b.trim(b(".pull-push-connection-info").val()).split("\n"));y=l[0],z=l[1];var m=k(y,x,"migrating");C=k(y,x,"completed"),T="find_replace"===B?c.current_migration.model.getStageItems("find_replace","name"):"backup"===B?c.current_migration.model.getStageItems("backup","name"):c.current_migration.model.getStageItems("migrate","name"),c.current_migration.model.setActiveStage(B),c.current_migration.setTitle(m),c.current_migration.startTimer(),Q=!0,c.current_migration.setStatus("active");var n={action:"wpmdb_initiate_migration",intent:x,url:y,key:z,form_data:A,stage:B,nonce:wpmdb_data.nonces.initiate_migration};n.site_details={local:wpmdb_data.site_details},-1===b.inArray(x,["savefile","find_replace"])&&(n.temp_prefix=c.common.connection_data.temp_prefix,n.site_details.remote=c.common.connection_data.site_details),n.site_details=JSON.stringify(n.site_details),F=!0,b.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:n,error:function(a,b,d){c.current_migration.setState(wpmdb_strings.migration_failed,pa(a.responseText,"(#112)",a),"error"),console.log(a),console.log(b),console.log(d),F=!1,c.common.migration_error=!0,c.functions.migration_complete_events()},success:function(a){if(F=!1,"undefined"!=typeof a&&"undefined"!=typeof a.wpmdb_error&&1===a.wpmdb_error)return c.common.migration_error=!0,c.functions.migration_complete_events(),void c.current_migration.setState(wpmdb_strings.migration_failed,a.body,"error");c.migration_state_id=a.migration_state_id;var d=0;aa=0,"savefile"!==x&&"undefined"!=typeof c.common.connection_data&&"undefined"!=typeof c.common.connection_data.delay_between_requests&&(aa=Math.max(parseInt(wpmdb_data.delay_between_requests),parseInt(c.common.connection_data.delay_between_requests))),c.functions.migrate_table_recursive=function(a,e){if(d>=T.length){if("backup"!==B)return b(".progress-label").removeClass("label-visible"),c.common.hooks=b.wpmdb.apply_filters("wpmdb_before_migration_complete_hooks",c.common.hooks),c.common.hooks.push(c.functions.migration_complete),c.common.hooks.push(c.functions.wpmdb_flush),c.common.hooks=b.wpmdb.apply_filters("wpmdb_after_migration_complete_hooks",c.common.hooks),c.common.hooks.push(c.functions.migration_complete_events),c.common.next_step_in_migration={fn:wpmdb_call_next_hook},void c.functions.execute_next_step();B="migrate","find_replace"===x&&(B="find_replace"),c.current_migration.model.setActiveStage(B),d=0,T=s(null,null)}var f=0;d===T.length-1&&(f=1);var g=0;"savefile"!==x&&"find_replace"!==x&&1===parseInt(c.common.connection_data.gzip)&&(g=1);var h={action:"wpmdb_migrate_table",migration_state_id:c.migration_state_id,table:T[d],stage:B,current_row:a,last_table:f,primary_keys:e,gzip:g,nonce:wpmdb_data.nonces.migrate_table};"savefile"!==x&&"find_replace"!==x&&(h.bottleneck=c.common.connection_data.bottleneck,h.prefix=c.common.connection_data.prefix),c.common.connection_data&&c.common.connection_data.path_current_site&&c.common.connection_data.domain&&(h.path_current_site=c.common.connection_data.path_current_site,h.domain_current_site=c.common.connection_data.domain),F=!0,b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,timeout:0,data:h,error:function(a,b,e){var f=wpmdb_strings.table_process_problem+" "+T[d]+"<br /><br />"+wpmdb_strings.status+": "+a.status+" "+a.statusText+"<br /><br />"+wpmdb_strings.response+":<br />"+a.responseText;c.current_migration.setState(wpmdb_strings.migration_failed,f,"error"),F=!1,console.log(a),console.log(b),console.log(e),c.common.migration_error=!0,c.functions.migration_complete_events()},success:function(a){F=!1,a=b.trim(a);var e=wpmdb_parse_json(a),g="";return!1===e||null===e?(g=""===a||null===a?wpmdb_strings.table_process_problem_empty_response+" "+T[d]:pa(a,null,null),c.current_migration.setState(wpmdb_strings.migration_failed,g,"error"),c.common.migration_error=!0,void c.functions.migration_complete_events()):"undefined"!=typeof e.wpmdb_error&&1===e.wpmdb_error?(c.current_migration.setState(wpmdb_strings.migration_failed,e.body,"error"),c.common.migration_error=!0,void c.functions.migration_complete_events()):(c.current_migration.setText(),c.current_migration.model.getStageModel(B).setItemRowsTransferred(T[d],e.current_row),1===f&&"savefile"===x&&("undefined"!=typeof e.dump_filename&&(R=e.dump_filename),"undefined"!=typeof e.dump_path&&(S=e.dump_path)),-1===parseInt(e.current_row)&&(d++,e.current_row="",e.primary_keys=""),c.common.next_step_in_migration={fn:c.functions.migrate_table_recursive,args:[e.current_row,e.primary_keys]
3
- },void c.functions.execute_next_step())}})},c.common.next_step_in_migration={fn:c.functions.migrate_table_recursive,args:["-1",""]},c.functions.execute_next_step()}})}}}),c.functions.migration_complete_events=function(){if(!1===c.common.migration_error)if(""===c.common.non_fatal_errors)if("savefile"!==x&&!0===b("#save_computer").is(":checked")&&c.current_migration.setText(),C+='&nbsp;<div class="dashicons dashicons-yes"></div>',!0===$){var a=wpmdb_strings.migration_cancelled_success;"find_replace"===x&&(a=wpmdb_strings.find_replace_cancelled_success),c.current_migration.setState(C,a,"cancelled")}else c.current_migration.setState(C,"","complete");else c.current_migration.setState(wpmdb_strings.completed_with_some_errors,c.common.non_fatal_errors,"error");b(".migration-controls").addClass("hidden"),c.common.hooks=[],c.common.call_stack=[],c.common.migration_error=!1,Q=!1,P=!0,U=!1,$=!1,F=!1,c.common.non_fatal_errors="",b(".progress-label").remove(),b(".migration-progress-ajax-spinner").remove(),b(".close-progress-content").show(),b("#overlay").css("cursor","pointer"),c.current_migration.model.setMigrationComplete()},c.functions.migration_complete=function(){if(b(".migration-controls").addClass("hidden"),"savefile"===x){Q=!1;var a=wpmdb_strings.migration_complete;if(b("#save_computer").is(":checked")){var d=wpmdb_data.this_download_url+encodeURIComponent(R);b("#gzip_file").is(":checked")&&(d+="&gzip=1"),window.location=d}else a=wpmdb_strings.completed_dump_located_at+" "+S;!1===c.common.migration_error&&(c.functions.migration_complete_events(),c.current_migration.setState(C,a,"complete"))}else{c.current_migration.setState(null,wpmdb_strings.finalizing_migration,"finalizing");var e={action:"wpmdb_finalize_migration",migration_state_id:c.migration_state_id,tables:T.join(","),nonce:wpmdb_data.nonces.finalize_migration};"find_replace"!==x&&(e.prefix=c.common.connection_data.prefix),F=!0,b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:e,error:function(a,b,d){F=!1,c.current_migration.setState(wpmdb_strings.migration_failed,wpmdb_strings.finalize_tables_problem,"error"),alert(a+" : "+b+" : "+d),c.common.migration_error=!0,c.functions.migration_complete_events()},success:function(a){return F=!1,"1"!==b.trim(a)?(c.current_migration.setState(wpmdb_strings.migration_failed,a,"error"),c.common.migration_error=!0,void c.functions.migration_complete_events()):(c.common.next_step_in_migration={fn:wpmdb_call_next_hook},void c.functions.execute_next_step())}})}},c.functions.wpmdb_flush=function(){"savefile"!==x&&(c.current_migration.setText(wpmdb_strings.flushing),F=!0,b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_flush",migration_state_id:c.migration_state_id,nonce:wpmdb_data.nonces.flush},error:function(a,b,d){F=!1,c.current_migration.setState(wpmdb_strings.migration_failed,wpmdb_strings.flush_problem,"error"),alert(a+" : "+b+" : "+d),c.common.migration_error=!0,c.functions.migration_complete_events()},success:function(a){return F=!1,"1"!==b.trim(a)?(c.current_migration.setState(wpmdb_strings.migration_failed,a,"error"),c.common.migration_error=!0,void c.functions.migration_complete_events()):(c.common.next_step_in_migration={fn:wpmdb_call_next_hook},void c.functions.execute_next_step())}}))},c.functions.update_migrate_button_text=function(){var a=wpmdb_migration_type(),c=b("#save-migration-profile").is(":checked")?"_save":"",d="migrate_button_"+("savefile"===a?"export":a)+c;b(".migrate-db .button-primary").val(wpmdb_strings[d])},c.functions.update_migrate_button_text(),b("body").on("click",".close-progress-content-button",function(a){la(),c.current_migration.restoreTitleElem()}),b("body").on("click","#overlay",function(a){!0===P&&a.target===this&&(la(),c.current_migration.restoreTitleElem())}),b(".save-settings-button").click(function(a){return a.preventDefault(),""===b.trim(b(".create-new-profile").val())&&b("#create_new").is(":checked")?(alert(wpmdb_strings.enter_name_for_profile),void b(".create-new-profile").focus()):void ma()});var Ga=b(".connection-info-wrapper");na(),b(".migrate-selection.option-group input[type=radio]").change(function(){na(),c.migration_selection=wpmdb_migration_type(),D&&oa(),c.functions.update_migrate_button_text()}),"pull"!==wpmdb_migration_type()&&"push"!==wpmdb_migration_type()||D||(b(".step-two").hide(),b(".connection-status").show()),b(".general-helper").click(function(a){a.preventDefault();var c=b(this),d=b(this).next();b(".helper-message").not(d).hide();var e=c.position();if(d.hasClass("bottom")){var f=1;b(this).is(":first-child")&&(f=3),d.css({left:e.left-d.width()/2-f+"px",top:e.top+c.height()+9+"px"})}else d.css({left:e.left+c.width()+9+"px",top:e.top+c.height()/2-18+"px"});d.toggle(),a.stopPropagation()}),b("body").click(function(){b(".helper-message").hide()}),b(".helper-message").click(function(a){a.stopPropagation()}),b("body").on("click",".show-errors-toggle",function(a){a.preventDefault(),b(this).next(".migration-php-errors").toggle()}),b(".nav-tab").click(function(){var a=b(this).attr("data-div-name");a=a.replace("-tab",""),window.location.hash=a,ra(a,!1)}),b("body").on("click",'a[href^="#"]',function(a){var c=b(a.target).attr("href"),d=c.substr(1);if(d){var e=b("."+d);1===e.length&&(e.trigger("click"),a.preventDefault())}}),b("body").on("click",".add-row",function(){var a=b(this).parents("tr");a.before(b(".original-repeatable-field").clone().removeClass("original-repeatable-field")),a.prev().find(".old-replace-col input").focus()}),b("body").on("click",".replace-remove-row",function(){b(this).parents("tr").remove(),2>=b(".replace-row").length&&b(".no-replaces-message").show();var a=b(this).prev().attr("id");"new-url"!==a&&"new-path"!==a||b("#"+a+"-missing-warning").hide()}),b("body").on("change","#new-url",function(){b("#new-url-missing-warning").hide()}).on("change","#new-path",function(){b("#new-path-missing-warning").hide()}),b("body").on("click",".arrow-col",function(){var a=this;if(!b(a).hasClass("disabled")){var c=b(a).prev("td").find("input").val(),d=b(a).next("td").find("input");d.val(c),"new-url"===d.prop("id")?b("#new-url-missing-warning").hide():"new-path"===d.prop("id")&&b("#new-path-missing-warning").hide()}}),b(".add-replace").click(function(){b(".replace-fields").prepend(b(".original-repeatable-field").clone().removeClass("original-repeatable-field")),b(".no-replaces-message").hide()}),b("#find-and-replace-sort tbody").sortable({items:"> tr:not(.pin)",handle:"td:first",start:function(){b(".sort-handle").css("cursor","-webkit-grabbing"),b(".sort-handle").css("cursor","-moz-grabbing")},stop:function(){b(".sort-handle").css("cursor","-webkit-grab"),b(".sort-handle").css("cursor","-moz-grab")}});var Ha="";window.location.hash&&(Ha=window.location.hash.substring(1),ra(Ha,!1)),""!==e("install-plugin")&&(Ha="addons",L=!0,ra(Ha,!0)),b(".notice-link").click(function(a){a.preventDefault(),b(this).closest(".inline-message").hide(),b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_process_notice_link",nonce:wpmdb_data.nonces.process_notice_link,notice:b(this).data("notice"),type:b(this).data("type"),reminder:b(this).data("reminder")}})}),b("#connection_info").on("copy",function(a){var c=b(this),d=c.val().split("\n");if(2===d.length)try{a.originalEvent.clipboardData.setData("text/plain",d.join(" ")),a.preventDefault()}catch(e){}}),b(".reset-api-key").click(function(){var a=confirm(wpmdb_strings.reset_api_key);a&&!H&&(H=!0,b(".reset-api-key").after('<img src="'+fa+'" alt="" class="reset-api-key-ajax-spinner general-spinner" />'),b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_reset_api_key",nonce:wpmdb_data.nonces.reset_api_key},error:function(a,c,d){alert(wpmdb_strings.reset_api_key_problem),b(".reset-api-key-ajax-spinner").remove(),H=!1},success:function(a){b(".reset-api-key-ajax-spinner").remove(),H=!1,b(".connection-info").html(a),wpmdb_data.connection_info=b.trim(a).split("\n")}}))}),b(".copy-api-key").click(function(){var a=b(this),c=b("#connection_info"),d=c.val(),e=d.replace("\n"," ");c.val(e),c.select();try{document.execCommand("copy"),c.blur(),a.css("color","transparent");var f=b(".copy-api-key-confirmation").show();setTimeout(function(){f.fadeOut("fast"),setTimeout(function(){a.css("color","")},200)},1e3)}catch(g){alert("please press Ctrl/Cmd+C to copy")}c.val(d)}),b("input.multiselect-toggle").change(function(){b(this).parents(".expandable-content").children(".select-wrap").toggle()}),b(".show-multiselect").each(function(){b(this).is(":checked")&&(b(this).parents(".option-section").children(".header-expand-collapse").children(".expand-collapse-arrow").removeClass("collapsed"),b(this).parents(".expandable-content").show(),b(this).parents(".expandable-content").children(".select-wrap").toggle())}),b("input[name=backup_option]").change(function(){b(".backup-tables-wrap").hide(),"backup_manual_select"===b(this).val()&&b(".backup-tables-wrap").show()}),b("#backup-manual-select").is(":checked")&&b(".backup-tables-wrap").show(),b(".plugin-compatibility-save").click(function(){if(!J){b(this).addClass("disabled");var a=b("#selected-plugins");b(a).attr("disabled","disabled"),b(".plugin-compatibility-success-msg").remove(),J=!0,b(this).after('<img src="'+fa+'" alt="" class="plugin-compatibility-spinner general-spinner" />'),b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_blacklist_plugins",blacklist_plugins:b(a).val(),nonce:wpmdb_data.nonces.blacklist_plugins},error:function(c,d,e){alert(wpmdb_strings.blacklist_problem+"\r\n\r\n"+wpmdb_strings.status+" "+c.status+" "+c.statusText+"\r\n\r\n"+wpmdb_strings.response+"\r\n"+c.responseText),b(a).removeAttr("disabled"),b(".plugin-compatibility-save").removeClass("disabled"),J=!1,b(".plugin-compatibility-spinner").remove()},success:function(c){""!==b.trim(c)&&alert(c),b(a).removeAttr("disabled"),b(".plugin-compatibility-save").removeClass("disabled"),J=!1,b(".plugin-compatibility-spinner").remove(),b(".plugin-compatibility-save").after('<span class="plugin-compatibility-success-msg">'+wpmdb_strings.saved+"</span>"),b(".plugin-compatibility-success-msg").fadeOut(2e3)}})}}),b("body").on("click",".delete-profile",function(){var a=b(this).next().clone();b("input",a).remove(),a=b.trim(b(a).html());var c=confirm(wpmdb_strings.remove_profile.replace("{{profile}}",a));if(c){var d=b(this).parent();if(d.find("input:checked").length){var e=d.siblings().last();if(e.find("input[type=radio]").prop("checked","checked"),e.find("input[type=text]").focus(),b("#migrate-form .crumbs .crumb:last").text("New Profile"),"function"==typeof window.history.pushState){var f=window.location.href.replace("#migrate","").replace(/&wpmdb-profile=-?\d+/,"")+"&wpmdb-profile=-1";window.history.pushState({updated_profile_id:-1},null,f)}}d.fadeOut(500),b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_delete_migration_profile",profile_id:b(this).attr("data-profile-id"),nonce:wpmdb_data.nonces.delete_migration_profile},error:function(a,b,c){alert(wpmdb_strings.remove_profile_problem)},success:function(a){"-1"===a&&alert(wpmdb_strings.remove_profile_not_found)}})}}),b(".main-list-delete-profile-link").click(function(){var a=b(this).prev().html(),c=confirm(wpmdb_strings.remove_profile.replace("{{profile}}",a));c&&(b(this).parent().fadeOut(500),b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_delete_migration_profile",profile_id:b(this).attr("data-profile-id"),nonce:wpmdb_data.nonces.delete_migration_profile},error:function(a,b,c){alert(wpmdb_strings.remove_profile_problem)}}))}),b("body").on("click",".temp-disabled",function(){var a=confirm(wpmdb_strings.change_connection_info);a&&(b(".ssl-notice").hide(),b(".different-plugin-version-notice").hide(),b(".migrate-db-button").show(),b(".temp-disabled").removeAttr("readonly"),b(".temp-disabled").removeClass("temp-disabled"),b(".connect-button").show(),b(".step-two").hide(),b(".connection-status").show().html(wpmdb_strings.enter_connection_info),D=!1)}),b(".settings-tab input[type=checkbox]").change(function(){if("plugin-compatibility"!==b(this).attr("id")){var a=b(this).is(":checked"),c=b(this).attr("id"),d=b(this).closest("td").next("td").find(".setting-status");b(".ajax-success-msg").remove(),d.after(ga),b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_setting",checked:a,setting:c,nonce:wpmdb_data.nonces.save_setting},error:function(a,c,d){alert(wpmdb_strings.save_settings_problem),b(".ajax-spinner").remove()},success:function(a){b(".ajax-spinner").remove(),d.append('<span class="ajax-success-msg">'+wpmdb_strings.saved+"</span>"),b(".ajax-success-msg").fadeOut(2e3,function(){b(this).remove()})}})}}),b(".migrate-form").submit(function(a){a.preventDefault()}),b(".connect-button").click(function(a){a.preventDefault(),b(this).blur(),ta()}),b(".pull-push-connection-info").bind("paste",function(a){setTimeout(function(){ta()},0)}),b("body").on("click",".try-again",function(){b(".pull-push-connection-info").removeClass("temp-disabled"),ta()}),b("body").on("click",".try-http",function(){var a=b.trim(b(".pull-push-connection-info").val()).split("\n"),c=a[0].replace("https","http"),d=c+"\n"+a[1];b(".pull-push-connection-info").val(d),ta()}),b(".create-new-profile").change(function(){K=!0}),b("body").on("click",".temporarily-disable-ssl",function(){var a="";window.location.hash&&(a=window.location.hash.substring(1)),b(this).attr("href",b(this).attr("href")+"&hash="+a)}),b("body").on("click",".pause-resume",function(a){p(a)}),b("body").on("click",".cancel",function(a){ua(a)}),b(".enter-licence").click(function(){b(".settings").click(),b(".licence-input").focus()}),c.functions.execute_next_step=function(){if(aa>0&&!1===_)return void setTimeout(function(){_=!0,c.functions.execute_next_step()},aa);if(_=!1,!0===U){b(".migration-progress-ajax-spinner").hide(),c.current_migration.pauseTimer();var a="";return!0===da?(a=wpmdb_strings.paused_before_finalize,da=!1,"find_replace"===wpmdb_migration_type()&&(a=wpmdb_strings.find_replace_paused_before_finalize)):a=wpmdb_strings.paused,c.current_migration.setState(null,a,"paused"),b("body").on("click",".pause-resume",function(a){p(a)}),b("body").on("click",".cancel",function(a){ua(a)}),void b(".pause-resume").html(wpmdb_strings.resume)}if(!0===$){x=wpmdb_migration_type();var d;"savefile"===x?d=wpmdb_strings.removing_local_sql:"pull"===x?d="backup"===B?wpmdb_strings.removing_local_backup:wpmdb_strings.removing_local_temp_tables:"push"===x&&(d="backup"===B?wpmdb_strings.removing_remote_sql:wpmdb_strings.removing_remote_temp_tables),c.current_migration.setText(d);var e={action:"wpmdb_cancel_migration",migration_state_id:c.migration_state_id,nonce:wpmdb_data.nonces.cancel_migration};F=!0,b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:e,error:function(a,b,d){c.current_migration.setState(wpmdb_strings.migration_cancellation_failed,wpmdb_strings.manually_remove_temp_files+"<br /><br />"+wpmdb_strings.status+": "+a.status+" "+a.statusText+"<br /><br />"+wpmdb_strings.response+":<br />"+a.responseText,"error"),console.log(a),console.log(b),console.log(d),F=!1,c.common.migration_error=!0,c.functions.migration_complete_events()},success:function(a){return F=!1,a=b.trim(a),"push"===x&&"1"!==a||"push"!==x&&""!==a?(c.current_migration.setState(wpmdb_strings.migration_cancellation_failed,a,"error"),c.common.migration_error=!0,void c.functions.migration_complete_events()):(C=wpmdb_strings.migration_cancelled,"find_replace"===x&&(C=wpmdb_strings.find_replace_cancelled),c.functions.migration_complete_events(),void c.current_migration.setStatus("cancelled"))}})}else c.common.next_step_in_migration.fn.apply(null,c.common.next_step_in_migration.args)},b("body").on("click",".copy-licence-to-remote-site",function(){b(".connection-status").html(wpmdb_strings.copying_license),b(".connection-status").removeClass("notification-message error-notice migration-error"),b(".connection-status").append(ga);var a=b.trim(b(".pull-push-connection-info").val()).split("\n");F=!0,m(),b.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_copy_licence_to_remote_site",url:a[0],key:a[1],nonce:wpmdb_data.nonces.copy_licence_to_remote_site},error:function(a,c,d){b(".connection-status").html(pa(a.responseText,"(#143)",a)),b(".connection-status").addClass("notification-message error-notice migration-error"),b(".ajax-spinner").remove(),F=!1,n()},success:function(a){return b(".ajax-spinner").remove(),F=!1,n(),"undefined"!=typeof a.wpmdb_error&&1===a.wpmdb_error?(b(".connection-status").html(a.body),b(".connection-status").addClass("notification-message error-notice migration-error"),void(a.body.indexOf("401 Unauthorized")>-1&&b(".basic-access-auth-wrapper").show())):void ta()}})}),b("body").on("click",".reactivate-licence",function(a){F=!0,b(".invalid-licence").empty().html(wpmdb_strings.attempting_to_activate_licence),b(".invalid-licence").append(ga),b.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_reactivate_licence",nonce:wpmdb_data.nonces.reactivate_licence},error:function(a,c,d){b(".invalid-licence").html(wpmdb_strings.activate_licence_problem),b(".invalid-licence").append("<br /><br />"+wpmdb_strings.status+": "+a.status+" "+a.statusText+"<br /><br />"+wpmdb_strings.response+"<br />"+a.responseText),b(".ajax-spinner").remove(),F=!1},success:function(a){return b(".ajax-spinner").remove(),F=!1,"undefined"!=typeof a.wpmdb_error&&1===a.wpmdb_error?void b(".invalid-licence").html(a.body):"undefined"!=typeof a.wpmdb_dbrains_api_down&&1===a.wpmdb_dbrains_api_down?(b(".invalid-licence").html(wpmdb_strings.temporarily_activated_licence),void b(".invalid-licence").append(a.body)):(b(".invalid-licence").empty().html(wpmdb_strings.licence_reactivated),void location.reload())}})}),b("input[name=table_migrate_option]").change(function(){h(),b.wpmdb.do_action("wpmdb_tables_to_migrate_changed")}),b("body").on("change","#select-tables",function(){h(),b.wpmdb.do_action("wpmdb_tables_to_migrate_changed")}),b.wpmdb.add_filter("wpmdb_get_table_prefix",t),b.wpmdb.add_filter("wpmdb_get_tables_to_migrate",s),b.wpmdb.add_action("wpmdb_lock_replace_url",u),b.wpmdb.add_action("move_connection_info_box",ka),b.wpmdb.add_filter("wpmdb_before_migration_complete_hooks",function(a){return ca=!!b("input[name=pause_before_finalize]:checked").length,!0===ca&&"savefile"!==x&&(p(null),da=!0),a}),b(".wpmdb-switch").on("click",function(a){b(this).hasClass("disabled")||va(b(this).attr("id"))})})}(jQuery,wpmdb)},{"MigrationProgress-controller":1}]},{},[1,2,3,4,5,6,7]);
 
 
 
asset/dist/js/{script-092.js → script-10.js} RENAMED
@@ -475,7 +475,7 @@ var MigrationProgressStage = Backbone.Model.extend( {
475
  var items = this.get( 'items' );
476
  var item = {
477
  name: name,
478
- size: size || 1,
479
  rows: rows || size,
480
  stageName: this.get( 'name' ),
481
  $el: null,
@@ -652,8 +652,8 @@ var MigrationProgressStageView = Backbone.View.extend( {
652
 
653
  this.$totalProgressElem = $( '<div class="stage-progress ' + this.model.get( 'name' ) + '" />' )
654
  .append( '<span class=percent-complete>0</span>% ' + this.model.get( 'strings' ).complete + ' ' )
655
- .append( '(<span class=size-complete>0 MB</span> / <span class=size-total>0 MB</span>) ' )
656
- .append( '<span class=tables-complete>0</span> <span class=lowercase >of</span> <span class=tables-total>0</span> ' + this.model.get( 'strings' ).items_migrated )
657
  .append( this.$showHideTablesElem )
658
  .append( '<div class=progress-bar-wrapper><div class=progress-bar /></div>' );
659
 
@@ -708,7 +708,7 @@ var MigrationProgressStageView = Backbone.View.extend( {
708
  this.$pauseBeforeFinalizeCheckbox.prop( 'checked', isChecked );
709
 
710
  // only display on certain migrations
711
- if ( -1 !== $.inArray( migrationIntent, [ 'push', 'pull', 'find_replace' ] ) ) {
712
  if ( 'find_replace' === migrationIntent ) {
713
  $( '#pause-before-finalize-label' ).text( wpmdb_strings.pause_before_finalize_find_replace );
714
  }
@@ -753,13 +753,13 @@ var MigrationProgressStageView = Backbone.View.extend( {
753
 
754
  this.$totalProgressElem.find( '.percent-complete' ).text( percentDone );
755
  this.$totalProgressElem.find( '.size-complete' ).text( sizeDone );
756
- this.$totalProgressElem.find( '.tables-complete' ).text( wpmdb_add_commas( tablesDone ) );
757
  this.$totalProgressElem.find( '.progress-bar-wrapper .progress-bar' ).css( { width: percentDone + '%' } );
758
  },
759
  updateStageTotals: function() {
760
  var itemCount = this.model.get( 'items' ).length;
761
- this.$totalProgressElem.find( '.tables-total' ).text( wpmdb_add_commas( itemCount ) );
762
- this.$totalProgressElem.find( '.size-total' ).text( wpmdb.functions.convertKBSizeToHR( this.model.get( 'totalSize' ) ) );
763
  },
764
  initializeItemElement: function( item ) {
765
  var $el = $( '<div class="item-progress" />' );
@@ -890,7 +890,7 @@ module.exports = MigrationProgressStageView;
890
  var stage;
891
  var elapsed_interval;
892
  var completed_msg;
893
- var tables_to_migrate = '';
894
  var migration_paused = false;
895
  var previous_progress_title = '';
896
  var previous_progress_text_primary = '';
@@ -903,20 +903,18 @@ module.exports = MigrationProgressStageView;
903
  var fade_duration = 400;
904
  var pause_before_finalize = false;
905
  var is_auto_pause_before_finalize = false;
 
 
906
 
907
  wpmdb.migration_progress_controller = require( 'MigrationProgress-controller' );
908
  wpmdb.current_migration = null;
909
  wpmdb.migration_selection = wpmdb_migration_type();
910
 
911
- var admin_url = ajaxurl.replace( '/admin-ajax.php', '' ), spinner_url = admin_url + '/images/spinner';
912
-
913
- if ( 2 < window.devicePixelRatio ) {
914
- spinner_url += '-2x';
915
- }
916
- spinner_url += '.gif';
917
- var ajax_spinner = '<img src="' + spinner_url + '" alt="" class="ajax-spinner general-spinner" />';
918
-
919
  window.onbeforeunload = function( e ) {
 
 
 
 
920
  if ( currently_migrating ) {
921
  e = e || window.event;
922
 
@@ -976,17 +974,13 @@ module.exports = MigrationProgressStageView;
976
  return;
977
  }
978
 
979
- function maybe_show_prefix_notice( prefix ) {
980
  if ( prefix !== wpmdb_data.this_prefix ) {
981
  $( '.remote-prefix' ).html( prefix );
982
  show_prefix_notice = true;
983
- if ( 'pull' === wpmdb_migration_type() ) {
984
- $( '.prefix-notice.pull' ).show();
985
- } else {
986
- $( '.prefix-notice.push' ).show();
987
- }
988
  }
989
- }
990
 
991
  function maybe_show_mixed_cased_table_name_warning() {
992
  if ( 'undefined' === typeof wpmdb.common.connection_data || false === wpmdb.common.connection_data ) {
@@ -994,7 +988,7 @@ module.exports = MigrationProgressStageView;
994
  }
995
 
996
  var migration_intent = wpmdb_migration_type();
997
- var tables_to_migrate = get_tables_to_migrate( null, null );
998
 
999
  $( '.mixed-case-table-name-notice' ).hide();
1000
 
@@ -1039,6 +1033,30 @@ module.exports = MigrationProgressStageView;
1039
  }
1040
  }
1041
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1042
  function get_domain_name( url ) {
1043
  var temp_url = url;
1044
  var domain = temp_url.replace( /\/\/(.*)@/, '//' ).replace( 'http://', '' ).replace( 'https://', '' ).replace( 'www.', '' );
@@ -1088,12 +1106,17 @@ module.exports = MigrationProgressStageView;
1088
  label = update_domain_placeholder( label, url, stage );
1089
  }
1090
 
 
 
 
 
 
1091
  return label;
1092
  }
1093
 
1094
- function remove_protocol( url ) {
1095
  return url.replace( /^https?:/i, '' );
1096
- }
1097
 
1098
  function disable_export_type_controls() {
1099
  $( '.option-group' ).each( function( index ) {
@@ -1150,7 +1173,7 @@ module.exports = MigrationProgressStageView;
1150
  }
1151
  }
1152
 
1153
- function create_table_select( tables, table_sizes_hr, selected_tables ) {
1154
  var $table_select = document.createElement( 'select' );
1155
  $( $table_select ).attr( {
1156
  multiple: 'multiple',
@@ -1169,15 +1192,21 @@ module.exports = MigrationProgressStageView;
1169
  if ( undefined !== selected_tables && null !== selected_tables && 0 < selected_tables.length && -1 !== $.inArray( table, selected_tables ) ) {
1170
  selected = ' selected="selected" ';
1171
  }
1172
- $( $table_select ).append( '<option' + selected + 'value="' + table + '">' + table + ' (' + table_sizes_hr[ table ] + ')</option>' );
 
 
 
 
 
 
1173
  } );
1174
  }
1175
 
1176
  return $table_select;
1177
- }
1178
 
1179
  /**
1180
- * Filter temporary tables out of create_table_select().
1181
  *
1182
  * @param exclude
1183
  * @param table_name
@@ -1203,12 +1232,12 @@ module.exports = MigrationProgressStageView;
1203
  *
1204
  * @param value
1205
  * @param args
1206
- * @returns {string}
1207
  *
1208
  * Also handler for wpmdb_get_tables_to_migrate filter, disregards input values as it is the primary source.
1209
  */
1210
- function get_tables_to_migrate( value, args ) {
1211
- var tables = '';
1212
  var mig_type = wpmdb_migration_type();
1213
  var table_intent = $( 'input[name=table_migrate_option]:checked' ).val();
1214
 
@@ -1218,14 +1247,13 @@ module.exports = MigrationProgressStageView;
1218
  } else {
1219
  if ( 'pull' !== mig_type && 'undefined' !== typeof wpmdb_data.this_prefixed_tables ) {
1220
  tables = wpmdb_data.this_prefixed_tables;
1221
- }
1222
- if ( 'pull' === mig_type && 'undefined' !== typeof wpmdb.common.connection_data && 'undefined' !== typeof wpmdb.common.connection_data.prefixed_tables ) {
1223
  tables = wpmdb.common.connection_data.prefixed_tables;
1224
  }
1225
  }
1226
 
1227
  return tables;
1228
- }
1229
 
1230
  function get_table_prefix( value, args ) {
1231
  return $( '.table-select-wrap .table-prefix' ).text();
@@ -1269,14 +1297,7 @@ module.exports = MigrationProgressStageView;
1269
  var install = '1';
1270
  var $status = $( this ).closest( 'td' ).next( 'td' ).find( '.setting-status' );
1271
 
1272
- if ( $( this ).is( ':checked' ) ) {
1273
- var answer = confirm( wpmdb_strings.mu_plugin_confirmation );
1274
-
1275
- if ( ! answer ) {
1276
- $( this ).prop( 'checked', false );
1277
- return;
1278
- }
1279
- } else {
1280
  install = '0';
1281
  }
1282
 
@@ -1538,6 +1559,9 @@ module.exports = MigrationProgressStageView;
1538
  .fadeIn( fade_duration );
1539
  } );
1540
 
 
 
 
1541
  }
1542
  } );
1543
  }
@@ -1551,13 +1575,14 @@ module.exports = MigrationProgressStageView;
1551
  $( e.target ).replaceWith( 'Checking... ' + ajax_spinner );
1552
  check_licence( null, 'all' );
1553
  } );
 
1554
  function refresh_table_selects() {
1555
  if ( undefined !== wpmdb_data && undefined !== wpmdb_data.this_tables && undefined !== wpmdb_data.this_table_sizes_hr ) {
1556
- $push_select = create_table_select( wpmdb_data.this_tables, wpmdb_data.this_table_sizes_hr, $( $push_select ).val() );
1557
  }
1558
 
1559
  if ( undefined !== wpmdb.common.connection_data && undefined !== wpmdb.common.connection_data.tables && undefined !== wpmdb.common.connection_data.table_sizes_hr ) {
1560
- $pull_select = create_table_select( wpmdb.common.connection_data.tables, wpmdb.common.connection_data.table_sizes_hr, $( $pull_select ).val() );
1561
  }
1562
  }
1563
 
@@ -1604,7 +1629,7 @@ module.exports = MigrationProgressStageView;
1604
  $.wpmdb.add_action( 'wpmdb_select_all_tables', select_all_tables );
1605
 
1606
  function base_old_url( value, args ) {
1607
- return remove_protocol( wpmdb_data.this_url );
1608
  }
1609
 
1610
  $.wpmdb.add_filter( 'wpmdb_base_old_url', base_old_url );
@@ -1616,6 +1641,7 @@ module.exports = MigrationProgressStageView;
1616
  true === wpmdb_default_profile ||
1617
  'savefile' === action ||
1618
  'find_replace' === action ||
 
1619
  doing_ajax ||
1620
  ! wpmdb_data.is_pro ) {
1621
  return;
@@ -1668,7 +1694,7 @@ module.exports = MigrationProgressStageView;
1668
  }
1669
 
1670
  maybe_show_ssl_warning( connection_info[ 0 ], connection_info[ 1 ], data.scheme );
1671
- maybe_show_prefix_notice( data.prefix );
1672
 
1673
  $( '.pull-push-connection-info' ).addClass( 'temp-disabled' );
1674
  $( '.pull-push-connection-info' ).attr( 'readonly', 'readonly' );
@@ -1687,7 +1713,7 @@ module.exports = MigrationProgressStageView;
1687
  loaded_tables = wpmdb_loaded_tables;
1688
  }
1689
 
1690
- $pull_select = create_table_select( wpmdb.common.connection_data.tables, wpmdb.common.connection_data.table_sizes_hr, loaded_tables );
1691
 
1692
  var loaded_post_types = '';
1693
  if ( false === wpmdb_default_profile && 'undefined' !== typeof wpmdb_loaded_post_types ) {
@@ -1847,8 +1873,8 @@ module.exports = MigrationProgressStageView;
1847
  $licence_status.html( data.body );
1848
  } else {
1849
  if ( 1 === Number( data.is_first_activation ) ) {
1850
- wpmdb_strings.welcome_text = wpmdb_strings.welcome_text.replace( '%1$s', 'https://deliciousbrains.com/wp-migrate-db-pro/doc/quick-start-guide/' );
1851
- wpmdb_strings.welcome_text = wpmdb_strings.welcome_text.replace( '%2$s', 'https://deliciousbrains.com/wp-migrate-db-pro/videos/' );
1852
 
1853
  $licence_status.after(
1854
  '<div id="welcome-wrap">' +
@@ -1967,12 +1993,26 @@ module.exports = MigrationProgressStageView;
1967
 
1968
  // expand and collapse content on click
1969
  $( '.header-expand-collapse' ).click( function() {
 
 
 
 
 
 
1970
  if ( $( '.expand-collapse-arrow', this ).hasClass( 'collapsed' ) ) {
1971
  $( '.expand-collapse-arrow', this ).removeClass( 'collapsed' );
1972
- $( this ).next().show();
 
 
 
 
1973
  } else {
1974
  $( '.expand-collapse-arrow', this ).addClass( 'collapsed' );
1975
- $( this ).next().hide();
 
 
 
 
1976
  }
1977
  } );
1978
 
@@ -1986,23 +2026,13 @@ module.exports = MigrationProgressStageView;
1986
 
1987
  // warning for excluding post types
1988
  $( '.select-post-types-wrap' ).on( 'change', '#select-post-types', function() {
1989
- exclude_post_types_warning();
1990
  } );
1991
 
1992
- function exclude_post_types_warning() {
1993
  var excluded_post_types = $( '#select-post-types' ).val();
1994
  var excluded_post_types_text = '';
1995
  var $exclude_post_types_warning = $( '.exclude-post-types-warning' );
1996
- var $exclude_post_types_migrate_msg = $exclude_post_types_warning.find( '.migrate-msg' );
1997
- var $exclude_post_types_find_replace_msg = $exclude_post_types_warning.find( '.find-replace-msg' );
1998
-
1999
- if ( 'find_replace' === wpmdb_migration_type() ) {
2000
- $exclude_post_types_migrate_msg.hide();
2001
- $exclude_post_types_find_replace_msg.show();
2002
- } else {
2003
- $exclude_post_types_find_replace_msg.hide();
2004
- $exclude_post_types_migrate_msg.show();
2005
- }
2006
 
2007
  if ( excluded_post_types ) {
2008
  excluded_post_types_text = '<code>' + excluded_post_types.join( '</code>, <code>' ) + '</code>';
@@ -2020,7 +2050,7 @@ module.exports = MigrationProgressStageView;
2020
  .slideUp( 200 )
2021
  .animate( { opacity: 0 } );
2022
  }
2023
- }
2024
 
2025
  if ( $( '#exclude-post-types' ).is( ':checked' ) ) {
2026
  if ( $( '#select-post-types' ).val() ) {
@@ -2062,15 +2092,7 @@ module.exports = MigrationProgressStageView;
2062
  return;
2063
  }
2064
 
2065
- // check that they've selected some tables to migrate
2066
- if ( $( '#migrate-selected' ).is( ':checked' ) && null === $( '#select-tables' ).val() ) {
2067
- alert( wpmdb_strings.please_select_one_table );
2068
- return;
2069
- }
2070
-
2071
- // check that they've selected some tables to backup
2072
- if ( 'savefile' !== wpmdb_migration_type() && $( '#backup-manual-select' ).is( ':checked' ) && null === $( '#select-backup' ).val() ) {
2073
- alert( wpmdb_strings.please_select_one_table_backup );
2074
  return;
2075
  }
2076
 
@@ -2093,7 +2115,13 @@ module.exports = MigrationProgressStageView;
2093
  }
2094
 
2095
  if ( true === new_url_missing || true === new_file_path_missing ) {
2096
- return;
 
 
 
 
 
 
2097
  }
2098
 
2099
  // also save profile
@@ -2112,7 +2140,13 @@ module.exports = MigrationProgressStageView;
2112
  }
2113
 
2114
  if ( false === $( '#create-backup' ).is( ':checked' ) ) {
2115
- stage = 'migrate';
 
 
 
 
 
 
2116
  }
2117
 
2118
  wpmdb.current_migration = wpmdb.migration_progress_controller.newMigration( {
@@ -2130,7 +2164,7 @@ module.exports = MigrationProgressStageView;
2130
 
2131
  // set up backup stage
2132
  if ( 'backup' === stage ) {
2133
- if ( 'migrate_only_with_prefix' === table_option && 'backup_selected' === backup_option ) {
2134
  backup_option = 'backup_only_with_prefix';
2135
  }
2136
  if ( 'push' === migration_intent ) {
@@ -2165,31 +2199,27 @@ module.exports = MigrationProgressStageView;
2165
  }
2166
 
2167
  // set up migration stage
2168
- if ( -1 !== $.inArray( migration_intent, [ 'push', 'savefile', 'find_replace' ] ) ) {
2169
- data_type = 'local';
2170
- } else {
2171
  data_type = 'remote';
 
 
2172
  }
2173
 
2174
  if ( 'find_replace' === migration_intent ) {
2175
- if ( 'backup' !== stage ) {
2176
- stage = 'find_replace';
2177
- }
2178
-
2179
- wpmdb.current_migration.model.addStage( 'find_replace', get_tables_to_migrate( null, null ), data_type, {
2180
  strings: {
2181
  migrated: wpmdb_strings.searched,
2182
  stage_title: wpmdb_strings.migrate_button_find_replace
2183
  }
2184
  } );
2185
- } else {
2186
- wpmdb.current_migration.model.addStage( 'migrate', get_tables_to_migrate( null, null ), data_type );
2187
  }
2188
 
2189
  // add any additional migration stages via hook
2190
  $.wpmdb.do_action( 'wpmdb_add_migration_stages', {
2191
  'data_type': data_type,
2192
- 'tables_to_migrate': get_tables_to_migrate( null, null )
2193
  } );
2194
 
2195
  var table_intent = $( 'input[name=table_migrate_option]:checked' ).val();
@@ -2202,12 +2232,8 @@ module.exports = MigrationProgressStageView;
2202
  var static_migration_label = get_migration_status_label( remote_site, migration_intent, 'migrating' );
2203
  completed_msg = get_migration_status_label( remote_site, migration_intent, 'completed' );
2204
 
2205
- if ( 'find_replace' === stage ) {
2206
- tables_to_migrate = wpmdb.current_migration.model.getStageItems( 'find_replace', 'name' );
2207
- } else if ( 'backup' === stage ) {
2208
- tables_to_migrate = wpmdb.current_migration.model.getStageItems( 'backup', 'name' );
2209
- } else {
2210
- tables_to_migrate = wpmdb.current_migration.model.getStageItems( 'migrate', 'name' );
2211
  }
2212
 
2213
  wpmdb.current_migration.model.setActiveStage( stage );
@@ -2233,7 +2259,7 @@ module.exports = MigrationProgressStageView;
2233
  local: wpmdb_data.site_details
2234
  };
2235
 
2236
- if ( -1 === $.inArray( migration_intent, [ 'savefile', 'find_replace' ] ) ) {
2237
  request_data.temp_prefix = wpmdb.common.connection_data.temp_prefix;
2238
  request_data.site_details.remote = wpmdb.common.connection_data.site_details;
2239
  }
@@ -2242,6 +2268,8 @@ module.exports = MigrationProgressStageView;
2242
  // so we reduce it down to one variable for this one POST.
2243
  request_data.site_details = JSON.stringify( request_data.site_details );
2244
 
 
 
2245
  doing_ajax = true;
2246
 
2247
  $.ajax( {
@@ -2278,26 +2306,46 @@ module.exports = MigrationProgressStageView;
2278
 
2279
  // Set delay between requests - use max of local/remote values, 0 if doing export
2280
  delay_between_requests = 0;
2281
- if ( 'savefile' !== migration_intent && 'undefined' !== typeof wpmdb.common.connection_data && 'undefined' !== typeof wpmdb.common.connection_data.delay_between_requests ) {
2282
- delay_between_requests = Math.max( parseInt( wpmdb_data.delay_between_requests ), parseInt( wpmdb.common.connection_data.delay_between_requests ) );
 
 
 
 
2283
  }
2284
 
2285
  wpmdb.functions.migrate_table_recursive = function( current_row, primary_keys ) {
2286
 
2287
  if ( i >= tables_to_migrate.length ) {
2288
- if ( 'backup' === stage ) {
2289
 
2290
- stage = 'migrate';
2291
- if ( 'find_replace' === migration_intent ) {
2292
- stage = 'find_replace';
 
 
 
 
 
 
 
 
 
 
 
 
2293
  }
2294
 
2295
  wpmdb.current_migration.model.setActiveStage( stage );
2296
 
 
 
 
 
 
2297
  i = 0;
2298
 
2299
  // should get from model
2300
- tables_to_migrate = get_tables_to_migrate( null, null );
2301
 
2302
  } else {
2303
  $( '.progress-label' ).removeClass( 'label-visible' );
@@ -2319,7 +2367,7 @@ module.exports = MigrationProgressStageView;
2319
  }
2320
 
2321
  var gzip = 0;
2322
- if ( 'savefile' !== migration_intent && 'find_replace' !== migration_intent && 1 === parseInt( wpmdb.common.connection_data.gzip ) ) {
2323
  gzip = 1;
2324
  }
2325
 
@@ -2335,7 +2383,7 @@ module.exports = MigrationProgressStageView;
2335
  nonce: wpmdb_data.nonces.migrate_table
2336
  };
2337
 
2338
- if ( 'savefile' !== migration_intent && 'find_replace' !== migration_intent ) {
2339
  request_data.bottleneck = wpmdb.common.connection_data.bottleneck;
2340
  request_data.prefix = wpmdb.common.connection_data.prefix;
2341
  }
@@ -2394,9 +2442,14 @@ module.exports = MigrationProgressStageView;
2394
  return;
2395
  }
2396
 
 
 
 
 
 
2397
  //successful iteration, update model
2398
  wpmdb.current_migration.setText();
2399
- wpmdb.current_migration.model.getStageModel( stage ).setItemRowsTransferred( tables_to_migrate[ i ], row_information.current_row );
2400
 
2401
  // We need the returned file name for delivery or display to the user.
2402
  if ( 1 === last_table && 'savefile' === migration_intent ) {
@@ -2424,12 +2477,15 @@ module.exports = MigrationProgressStageView;
2424
 
2425
  };
2426
 
2427
- wpmdb.common.next_step_in_migration = {
2428
- fn: wpmdb.functions.migrate_table_recursive,
2429
- args: [ '-1', '' ]
2430
- };
2431
- wpmdb.functions.execute_next_step();
 
 
2432
 
 
2433
  }
2434
 
2435
  } ); // end ajax
@@ -2474,6 +2530,7 @@ module.exports = MigrationProgressStageView;
2474
  migration_cancelled = false;
2475
  doing_ajax = false;
2476
  wpmdb.common.non_fatal_errors = '';
 
2477
 
2478
  $( '.progress-label' ).remove();
2479
  $( '.migration-progress-ajax-spinner' ).remove();
@@ -2517,7 +2574,7 @@ module.exports = MigrationProgressStageView;
2517
  nonce: wpmdb_data.nonces.finalize_migration
2518
  };
2519
 
2520
- if ( 'find_replace' !== migration_intent ) {
2521
  request_data.prefix = wpmdb.common.connection_data.prefix;
2522
  }
2523
 
@@ -2605,12 +2662,14 @@ module.exports = MigrationProgressStageView;
2605
  $( 'body' ).on( 'click', '.close-progress-content-button', function( e ) {
2606
  hide_overlay();
2607
  wpmdb.current_migration.restoreTitleElem();
 
2608
  } );
2609
 
2610
  $( 'body' ).on( 'click', '#overlay', function( e ) {
2611
  if ( true === migration_completed && e.target === this ) {
2612
  hide_overlay();
2613
  wpmdb.current_migration.restoreTitleElem();
 
2614
  }
2615
  } );
2616
 
@@ -2643,15 +2702,7 @@ module.exports = MigrationProgressStageView;
2643
  return;
2644
  }
2645
 
2646
- // check that they've selected some tables to migrate
2647
- if ( $( '#migrate-selected' ).is( ':checked' ) && null === $( '#select-tables' ).val() ) {
2648
- alert( wpmdb_strings.please_select_one_table );
2649
- return;
2650
- }
2651
-
2652
- // check that they've selected some tables to backup
2653
- if ( 'savefile' !== wpmdb_migration_type() && $( '#backup-manual-select' ).is( ':checked' ) && null === $( '#select-backup' ).val() ) {
2654
- alert( wpmdb_strings.please_select_one_table_backup );
2655
  return;
2656
  }
2657
 
@@ -2756,6 +2807,8 @@ module.exports = MigrationProgressStageView;
2756
  'last_migration_type': last_replace_switch
2757
  } );
2758
 
 
 
2759
  if ( 'pull' === wpmdb_migration_type() ) {
2760
  $( '.pull-list li' ).append( $connection_info_box );
2761
  $connection_info_box.show( function() {
@@ -2769,7 +2822,7 @@ module.exports = MigrationProgressStageView;
2769
  $( '.pull-list li' ).append( $connection_info_box );
2770
  $( '.pull-push-connection-info' ).removeClass( 'temp-disabled' ).attr( 'readonly', 'readonly' );
2771
  $( '.connect-button' ).hide();
2772
- connection_box_changed();
2773
  return;
2774
  }
2775
  if ( connection_established ) {
@@ -2783,7 +2836,7 @@ module.exports = MigrationProgressStageView;
2783
  $( '.create-new-profile' ).val( profile_name );
2784
  }
2785
  if ( true === show_prefix_notice ) {
2786
- $( '.prefix-notice.pull' ).show();
2787
  }
2788
  if ( true === show_ssl_notice ) {
2789
  $( '.ssl-notice' ).show();
@@ -2793,12 +2846,8 @@ module.exports = MigrationProgressStageView;
2793
  $( '.step-two' ).hide();
2794
  }
2795
  wpmdb_toggle_migration_action_text();
2796
- if ( false === wpmdb_data.write_permission ) {
2797
- $( '#create-backup' ).prop( 'checked', false );
2798
- $( '#create-backup' ).attr( 'disabled', 'disabled' );
2799
- $( '#create-backup-label' ).addClass( 'disabled' );
2800
- $( '.backup-option-disabled' ).show();
2801
- $( '.upload-directory-location' ).html( wpmdb_data.this_upload_dir_long );
2802
  }
2803
  } else {
2804
  $( '.connection-status' ).show();
@@ -2817,7 +2866,7 @@ module.exports = MigrationProgressStageView;
2817
  $( '.push-list li' ).append( $connection_info_box );
2818
  $( '.pull-push-connection-info' ).removeClass( 'temp-disabled' ).attr( 'readonly', 'readonly' );
2819
  $( '.connect-button' ).hide();
2820
- connection_box_changed();
2821
  return;
2822
  }
2823
  if ( connection_established ) {
@@ -2831,7 +2880,7 @@ module.exports = MigrationProgressStageView;
2831
  $( '.create-new-profile' ).val( profile_name );
2832
  }
2833
  if ( true === show_prefix_notice ) {
2834
- $( '.prefix-notice.push' ).show();
2835
  }
2836
  if ( true === show_ssl_notice ) {
2837
  $( '.ssl-notice' ).show();
@@ -2842,24 +2891,26 @@ module.exports = MigrationProgressStageView;
2842
  }
2843
  wpmdb_toggle_migration_action_text();
2844
  if ( '0' === wpmdb.common.connection_data.write_permissions ) {
2845
- $( '#create-backup' ).prop( 'checked', false );
2846
- $( '#create-backup' ).attr( 'disabled', 'disabled' );
2847
- $( '#create-backup-label' ).addClass( 'disabled' );
2848
- $( '.backup-option-disabled' ).show();
2849
- $( '.upload-directory-location' ).html( wpmdb.common.connection_data.upload_dir_long );
2850
  }
2851
  } else {
2852
  $( '.connection-status' ).show();
2853
  $( '.step-two' ).hide();
2854
  }
2855
- } else if ( 'savefile' === wpmdb_migration_type() || 'find_replace' === wpmdb_migration_type() ) {
2856
  $( '.connection-status' ).hide();
2857
- $( '.step-two' ).show();
2858
  $( '.table-prefix' ).html( wpmdb_data.this_prefix );
2859
  if ( false === profile_name_edited ) {
2860
  $( '.create-new-profile' ).val( '' );
2861
  }
2862
 
 
 
 
 
 
 
 
2863
  if ( 'savefile' === wpmdb_migration_type() ) {
2864
  $( '.backup-options' ).hide();
2865
  $( '.compatibility-older-mysql' ).show();
@@ -2871,12 +2922,16 @@ module.exports = MigrationProgressStageView;
2871
  $( '.step-two' ).hide();
2872
  }
2873
 
2874
- if ( 'find_replace' === wpmdb_migration_type() ) {
2875
  if ( 'true' === wpmdb_data.is_multisite ) {
2876
  var $old_replace_col = $( '.old-replace-col' ).eq( 1 );
2877
  $old_replace_col.parent().removeClass( 'pin' ).find( '.replace-remove-row' ).show();
2878
  $old_replace_col.find( 'input' ).removeAttr( 'readonly' );
2879
  }
 
 
 
 
2880
  }
2881
 
2882
  }
@@ -2884,6 +2939,14 @@ module.exports = MigrationProgressStageView;
2884
  maybe_show_mixed_cased_table_name_warning();
2885
  }
2886
 
 
 
 
 
 
 
 
 
2887
  // move around textarea depending on whether or not the push/pull options are selected
2888
  var $connection_info_box = $( '.connection-info-wrapper' );
2889
  move_connection_info_box();
@@ -2901,7 +2964,7 @@ module.exports = MigrationProgressStageView;
2901
  var old_url = null;
2902
  var old_path = null;
2903
  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 ) {
2904
- old_url = remove_protocol( wpmdb.common.previous_connection_data.url );
2905
  old_path = wpmdb.common.previous_connection_data.path;
2906
  }
2907
 
@@ -2919,14 +2982,14 @@ module.exports = MigrationProgressStageView;
2919
  $( '.replace-right-col input', this ).val( wpmdb.common.connection_data.path );
2920
  }
2921
  if ( old_val === old_url ) {
2922
- $( '.replace-right-col input', this ).val( remove_protocol( wpmdb.common.connection_data.url ) );
2923
  }
2924
  } );
2925
  }
2926
  $.wpmdb.do_action( 'wpmdb_update_push_table_select' );
2927
  $( '#select-post-types' ).remove();
2928
  $( '.exclude-post-types-warning' ).after( $push_post_type_select );
2929
- exclude_post_types_warning();
2930
  $( '#select-backup' ).remove();
2931
  $( '.backup-tables-wrap' ).prepend( $push_select_backup );
2932
  } else if ( 'pull' === wpmdb_migration_type() ) {
@@ -2943,14 +3006,14 @@ module.exports = MigrationProgressStageView;
2943
  $( '.old-replace-col input', this ).val( wpmdb.common.connection_data.path );
2944
  }
2945
  if ( old_val === old_url ) {
2946
- $( '.old-replace-col input', this ).val( remove_protocol( wpmdb.common.connection_data.url ) );
2947
  }
2948
  } );
2949
  }
2950
  $.wpmdb.do_action( 'wpmdb_update_pull_table_select' );
2951
  $( '#select-post-types' ).remove();
2952
  $( '.exclude-post-types-warning' ).after( $pull_post_type_select );
2953
- exclude_post_types_warning();
2954
  $( '#select-backup' ).remove();
2955
  $( '.backup-tables-wrap' ).prepend( $pull_select_backup );
2956
  }
@@ -2976,10 +3039,11 @@ module.exports = MigrationProgressStageView;
2976
  if ( bubble.hasClass( 'bottom' ) ) {
2977
  var bubble_offset = 1;
2978
 
2979
- if ( $( this ).is( ':first-child' ) ) {
 
 
2980
  bubble_offset = 3;
2981
  }
2982
-
2983
  bubble.css( {
2984
  'left': ( ( position.left - bubble.width() / 2 ) - bubble_offset ) + 'px',
2985
  'top': ( position.top + icon.height() + 9 ) + 'px'
@@ -3165,20 +3229,11 @@ module.exports = MigrationProgressStageView;
3165
  // process notice links clicks, eg. dismiss, reminder
3166
  $( '.notice-link' ).click( function( e ) {
3167
  e.preventDefault();
3168
- $( this ).closest( '.inline-message' ).hide();
3169
- $.ajax( {
3170
- url: ajaxurl,
3171
- type: 'POST',
3172
- dataType: 'text',
3173
- cache: false,
3174
- data: {
3175
- action: 'wpmdb_process_notice_link',
3176
- nonce: wpmdb_data.nonces.process_notice_link,
3177
- notice: $( this ).data( 'notice' ),
3178
- type: $( this ).data( 'type' ),
3179
- reminder: $( this ).data( 'reminder' )
3180
- }
3181
- } );
3182
  } );
3183
 
3184
  // When read-only connection info is copied, convert it to one line
@@ -3287,9 +3342,12 @@ module.exports = MigrationProgressStageView;
3287
  $connection_info.val( two_lines );
3288
  } );
3289
 
3290
- // show / hide table select box when specific settings change
3291
- $( 'input.multiselect-toggle' ).change( function() {
3292
- $( this ).parents( '.expandable-content' ).children( '.select-wrap' ).toggle();
 
 
 
3293
  } );
3294
 
3295
  $( '.show-multiselect' ).each( function() {
@@ -3330,9 +3388,9 @@ module.exports = MigrationProgressStageView;
3330
  dataType: 'text',
3331
  cache: false,
3332
  data: {
3333
- action: 'wpmdb_blacklist_plugins',
3334
- blacklist_plugins: $( select_element ).val(),
3335
- nonce: wpmdb_data.nonces.blacklist_plugins
3336
  },
3337
  error: function( jqXHR, textStatus, errorThrown ) {
3338
  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 );
@@ -3497,21 +3555,21 @@ module.exports = MigrationProgressStageView;
3497
  $( '.connect-button' ).click( function( event ) {
3498
  event.preventDefault();
3499
  $( this ).blur();
3500
- connection_box_changed();
3501
  } );
3502
 
3503
  // send paste even to connection_box_changed() function
3504
  $( '.pull-push-connection-info' ).bind( 'paste', function( e ) {
3505
  var $this = this;
3506
  setTimeout( function() {
3507
- connection_box_changed();
3508
  }, 0 );
3509
 
3510
  } );
3511
 
3512
  $( 'body' ).on( 'click', '.try-again', function() {
3513
  $( '.pull-push-connection-info' ).removeClass( 'temp-disabled' );
3514
- connection_box_changed();
3515
  } );
3516
 
3517
  $( 'body' ).on( 'click', '.try-http', function() {
@@ -3519,7 +3577,7 @@ module.exports = MigrationProgressStageView;
3519
  var new_url = connection_info[ 0 ].replace( 'https', 'http' );
3520
  var new_contents = new_url + '\n' + connection_info[ 1 ];
3521
  $( '.pull-push-connection-info' ).val( new_contents );
3522
- connection_box_changed();
3523
  } );
3524
 
3525
  $( '.create-new-profile' ).change( function() {
@@ -3535,12 +3593,14 @@ module.exports = MigrationProgressStageView;
3535
  } );
3536
 
3537
  // fired when the connection info box changes (e.g. gets pasted into)
3538
- function connection_box_changed() {
3539
  var $this = $( '.pull-push-connection-info' );
3540
 
3541
- if ( ( doing_ajax || $( $this ).hasClass( 'temp-disabled' ) ) && false === wpmdb.force_reconnect ) {
 
3542
  return;
3543
  }
 
3544
  wpmdb.force_reconnect = false;
3545
  var data = $( '.pull-push-connection-info' ).val();
3546
 
@@ -3638,7 +3698,7 @@ module.exports = MigrationProgressStageView;
3638
 
3639
  profile_name_edited = false;
3640
 
3641
- $.ajax( {
3642
  url: ajaxurl,
3643
  type: 'POST',
3644
  dataType: 'json',
@@ -3690,7 +3750,7 @@ module.exports = MigrationProgressStageView;
3690
  $( '.connection-status' ).hide();
3691
  $( '.step-two' ).show();
3692
 
3693
- maybe_show_prefix_notice( data.prefix );
3694
 
3695
  connection_established = true;
3696
  set_connection_data( data );
@@ -3724,28 +3784,28 @@ module.exports = MigrationProgressStageView;
3724
  $( '#new-path-missing-warning, #new-url-missing-warning' ).hide();
3725
 
3726
  if ( 'pull' === wpmdb_migration_type() ) {
3727
- $( '#new-url' ).val( remove_protocol( wpmdb_data.this_url ) );
3728
  $( '#new-path' ).val( wpmdb_data.this_path );
3729
  if ( 'true' === wpmdb_data.is_multisite ) {
3730
  $( '#new-domain' ).val( wpmdb_data.this_domain );
3731
- $( '.replace-row.pin .old-replace-col input[type="text"]' ).val( remove_protocol( data.url ) );
3732
  }
3733
- $( '#old-url' ).val( remove_protocol( data.url ) );
3734
  $( '#old-path' ).val( data.path );
3735
 
3736
  $.wpmdb.do_action( 'wpmdb_update_pull_table_select' );
3737
  $( '#select-post-types' ).remove();
3738
  $( '.exclude-post-types-warning' ).after( $pull_post_type_select );
3739
- exclude_post_types_warning();
3740
  $( '.table-prefix' ).html( data.prefix );
3741
  $( '.backup-table-prefix' ).html( wpmdb_data.site_details.prefix );
3742
  $( '.uploads-dir' ).html( wpmdb_data.this_uploads_dir );
3743
  } else {
3744
- $( '#new-url' ).val( remove_protocol( data.url ) );
3745
  $( '#new-path' ).val( data.path );
3746
 
3747
  if ( 'true' === wpmdb_data.is_multisite ) {
3748
- $( '.replace-row.pin .old-replace-col input[type="text"]' ).val( remove_protocol( wpmdb_data.this_url ) );
3749
  }
3750
  $.wpmdb.do_action( 'wpmdb_update_push_table_select' );
3751
  $( '#select-backup' ).remove();
@@ -3761,7 +3821,7 @@ module.exports = MigrationProgressStageView;
3761
 
3762
  } );
3763
 
3764
- }
3765
 
3766
  // Sets the initial Pause/Resume button event to Pause
3767
  $( 'body' ).on( 'click', '.pause-resume', function( event ) {
@@ -3885,7 +3945,13 @@ module.exports = MigrationProgressStageView;
3885
  success: function( data ) {
3886
  doing_ajax = false;
3887
  data = $.trim( data );
 
3888
  if ( ( 'push' === migration_intent && '1' !== data ) || ( 'push' !== migration_intent && '' !== data ) ) {
 
 
 
 
 
3889
  wpmdb.current_migration.setState( wpmdb_strings.migration_cancellation_failed, data, 'error' );
3890
  wpmdb.common.migration_error = true;
3891
  wpmdb.functions.migration_complete_events();
@@ -3950,7 +4016,7 @@ module.exports = MigrationProgressStageView;
3950
 
3951
  return;
3952
  }
3953
- connection_box_changed();
3954
  }
3955
  } );
3956
  } );
@@ -4009,9 +4075,9 @@ module.exports = MigrationProgressStageView;
4009
  } );
4010
 
4011
  $.wpmdb.add_filter( 'wpmdb_get_table_prefix', get_table_prefix );
4012
- $.wpmdb.add_filter( 'wpmdb_get_tables_to_migrate', get_tables_to_migrate );
4013
  $.wpmdb.add_action( 'wpmdb_lock_replace_url', lock_replace_url );
4014
- $.wpmdb.add_action( 'move_connection_info_box', exclude_post_types_warning );
4015
 
4016
  $.wpmdb.add_filter( 'wpmdb_before_migration_complete_hooks', function( hooks ) {
4017
  pause_before_finalize = $( 'input[name=pause_before_finalize]:checked' ).length ? true : false;
475
  var items = this.get( 'items' );
476
  var item = {
477
  name: name,
478
+ size: size,
479
  rows: rows || size,
480
  stageName: this.get( 'name' ),
481
  $el: null,
652
 
653
  this.$totalProgressElem = $( '<div class="stage-progress ' + this.model.get( 'name' ) + '" />' )
654
  .append( '<span class=percent-complete>0</span>% ' + this.model.get( 'strings' ).complete + ' ' )
655
+ .append( '<span class="size-complete-wrap">(<span class=size-complete>0 MB</span> / <span class=size-total>0 MB</span>) </span>' )
656
+ .append( '<span class="items-complete-wrap"><span class=items-complete>0</span> <span class=lowercase >of</span> <span class=items-total>0</span> ' + this.model.get( 'strings' ).items_migrated + '</span>' )
657
  .append( this.$showHideTablesElem )
658
  .append( '<div class=progress-bar-wrapper><div class=progress-bar /></div>' );
659
 
708
  this.$pauseBeforeFinalizeCheckbox.prop( 'checked', isChecked );
709
 
710
  // only display on certain migrations
711
+ if ( -1 !== $.inArray( migrationIntent, [ 'push', 'pull', 'find_replace', 'import' ] ) ) {
712
  if ( 'find_replace' === migrationIntent ) {
713
  $( '#pause-before-finalize-label' ).text( wpmdb_strings.pause_before_finalize_find_replace );
714
  }
753
 
754
  this.$totalProgressElem.find( '.percent-complete' ).text( percentDone );
755
  this.$totalProgressElem.find( '.size-complete' ).text( sizeDone );
756
+ this.$totalProgressElem.find( '.items-complete' ).text( wpmdb_add_commas( tablesDone ) );
757
  this.$totalProgressElem.find( '.progress-bar-wrapper .progress-bar' ).css( { width: percentDone + '%' } );
758
  },
759
  updateStageTotals: function() {
760
  var itemCount = this.model.get( 'items' ).length;
761
+ this.$totalProgressElem.find( '.items-total' ).text( wpmdb_add_commas( itemCount ) );
762
+ this.$totalProgressElem.find( '.size-total' ).text( wpmdb.functions.convertKBSizeToHRFixed( this.model.get( 'totalSize' ) ) );
763
  },
764
  initializeItemElement: function( item ) {
765
  var $el = $( '<div class="item-progress" />' );
890
  var stage;
891
  var elapsed_interval;
892
  var completed_msg;
893
+ var tables_to_migrate = [];
894
  var migration_paused = false;
895
  var previous_progress_title = '';
896
  var previous_progress_text_primary = '';
903
  var fade_duration = 400;
904
  var pause_before_finalize = false;
905
  var is_auto_pause_before_finalize = false;
906
+ var spinner_url = wpmdb.functions.get_spinner_url();
907
+ var ajax_spinner = '<img src="' + spinner_url + '" alt="" class="ajax-spinner general-spinner" />';
908
 
909
  wpmdb.migration_progress_controller = require( 'MigrationProgress-controller' );
910
  wpmdb.current_migration = null;
911
  wpmdb.migration_selection = wpmdb_migration_type();
912
 
 
 
 
 
 
 
 
 
913
  window.onbeforeunload = function( e ) {
914
+ if ( 'import' === wpmdb_migration_type() && ! $( '.step-two' ).is( ':visible' ) ) {
915
+ wpmdb.functions.remove_localStorage_form_data();
916
+ }
917
+
918
  if ( currently_migrating ) {
919
  e = e || window.event;
920
 
974
  return;
975
  }
976
 
977
+ wpmdb.functions.maybe_show_prefix_notice = function( prefix ) {
978
  if ( prefix !== wpmdb_data.this_prefix ) {
979
  $( '.remote-prefix' ).html( prefix );
980
  show_prefix_notice = true;
981
+ $( '.prefix-notice' ).show();
 
 
 
 
982
  }
983
+ };
984
 
985
  function maybe_show_mixed_cased_table_name_warning() {
986
  if ( 'undefined' === typeof wpmdb.common.connection_data || false === wpmdb.common.connection_data ) {
988
  }
989
 
990
  var migration_intent = wpmdb_migration_type();
991
+ var tables_to_migrate = wpmdb.functions.get_tables_to_migrate( null, null );
992
 
993
  $( '.mixed-case-table-name-notice' ).hide();
994
 
1033
  }
1034
  }
1035
 
1036
+ wpmdb.functions.maybe_show_select_table_notice = function() {
1037
+
1038
+ // check that they've selected some tables to migrate
1039
+ if ( $( '#migrate-selected' ).is( ':checked' ) && null === $( '#select-tables' ).val() ) {
1040
+ if ( 'import' !== wpmdb_migration_type() ) {
1041
+ alert( wpmdb_strings.please_select_one_table );
1042
+ return true;
1043
+ } else {
1044
+ if ( $( '#import-find-replace' ).is( ':checked' ) && $( '#select-tables' ).is( ':visible' ) ) {
1045
+ alert( wpmdb_strings.please_select_one_table_import );
1046
+ return true;
1047
+ }
1048
+ }
1049
+ }
1050
+
1051
+ // check that they've selected some tables to backup
1052
+ if ( 'savefile' !== wpmdb_migration_type() && $( '#backup-manual-select' ).is( ':checked' ) && null === $( '#select-backup' ).val() ) {
1053
+ alert( wpmdb_strings.please_select_one_table_backup );
1054
+ return true;
1055
+ }
1056
+
1057
+ return false;
1058
+ };
1059
+
1060
  function get_domain_name( url ) {
1061
  var temp_url = url;
1062
  var domain = temp_url.replace( /\/\/(.*)@/, '//' ).replace( 'http://', '' ).replace( 'https://', '' ).replace( 'www.', '' );
1106
  label = update_domain_placeholder( label, url, stage );
1107
  }
1108
 
1109
+ label = $.wpmdb.apply_filters( 'wpmdb_get_migration_status_label', label, {
1110
+ intent: intent,
1111
+ stage: stage
1112
+ } );
1113
+
1114
  return label;
1115
  }
1116
 
1117
+ wpmdb.functions.remove_protocol = function( url ) {
1118
  return url.replace( /^https?:/i, '' );
1119
+ };
1120
 
1121
  function disable_export_type_controls() {
1122
  $( '.option-group' ).each( function( index ) {
1173
  }
1174
  }
1175
 
1176
+ wpmdb.functions.create_table_select = function( tables, table_sizes_hr, selected_tables ) {
1177
  var $table_select = document.createElement( 'select' );
1178
  $( $table_select ).attr( {
1179
  multiple: 'multiple',
1192
  if ( undefined !== selected_tables && null !== selected_tables && 0 < selected_tables.length && -1 !== $.inArray( table, selected_tables ) ) {
1193
  selected = ' selected="selected" ';
1194
  }
1195
+
1196
+ var size = '';
1197
+ if ( 0 !== table_sizes_hr.length ) {
1198
+ size = ' (' + table_sizes_hr[ table ] + ')';
1199
+ }
1200
+
1201
+ $( $table_select ).append( '<option' + selected + 'value="' + table + '">' + table + size + '</option>' );
1202
  } );
1203
  }
1204
 
1205
  return $table_select;
1206
+ };
1207
 
1208
  /**
1209
+ * Filter temporary tables out of wpmdb.functions.create_table_select().
1210
  *
1211
  * @param exclude
1212
  * @param table_name
1232
  *
1233
  * @param value
1234
  * @param args
1235
+ * @returns {array}
1236
  *
1237
  * Also handler for wpmdb_get_tables_to_migrate filter, disregards input values as it is the primary source.
1238
  */
1239
+ wpmdb.functions.get_tables_to_migrate = function( value, args ) {
1240
+ var tables = [];
1241
  var mig_type = wpmdb_migration_type();
1242
  var table_intent = $( 'input[name=table_migrate_option]:checked' ).val();
1243
 
1247
  } else {
1248
  if ( 'pull' !== mig_type && 'undefined' !== typeof wpmdb_data.this_prefixed_tables ) {
1249
  tables = wpmdb_data.this_prefixed_tables;
1250
+ } else if ( 'pull' === mig_type && 'undefined' !== typeof wpmdb.common.connection_data && 'undefined' !== typeof wpmdb.common.connection_data.prefixed_tables ) {
 
1251
  tables = wpmdb.common.connection_data.prefixed_tables;
1252
  }
1253
  }
1254
 
1255
  return tables;
1256
+ };
1257
 
1258
  function get_table_prefix( value, args ) {
1259
  return $( '.table-select-wrap .table-prefix' ).text();
1297
  var install = '1';
1298
  var $status = $( this ).closest( 'td' ).next( 'td' ).find( '.setting-status' );
1299
 
1300
+ if ( !$( this ).is( ':checked' ) ) {
 
 
 
 
 
 
 
1301
  install = '0';
1302
  }
1303
 
1559
  .fadeIn( fade_duration );
1560
  } );
1561
 
1562
+ if ( $( '#plugin-compatibility' ).is( ':not(:checked)' ) ) {
1563
+ $( '#compatibility-header' ).click();
1564
+ }
1565
  }
1566
  } );
1567
  }
1575
  $( e.target ).replaceWith( 'Checking... ' + ajax_spinner );
1576
  check_licence( null, 'all' );
1577
  } );
1578
+
1579
  function refresh_table_selects() {
1580
  if ( undefined !== wpmdb_data && undefined !== wpmdb_data.this_tables && undefined !== wpmdb_data.this_table_sizes_hr ) {
1581
+ $push_select = wpmdb.functions.create_table_select( wpmdb_data.this_tables, wpmdb_data.this_table_sizes_hr, $( $push_select ).val() );
1582
  }
1583
 
1584
  if ( undefined !== wpmdb.common.connection_data && undefined !== wpmdb.common.connection_data.tables && undefined !== wpmdb.common.connection_data.table_sizes_hr ) {
1585
+ $pull_select = wpmdb.functions.create_table_select( wpmdb.common.connection_data.tables, wpmdb.common.connection_data.table_sizes_hr, $( $pull_select ).val() );
1586
  }
1587
  }
1588
 
1629
  $.wpmdb.add_action( 'wpmdb_select_all_tables', select_all_tables );
1630
 
1631
  function base_old_url( value, args ) {
1632
+ return wpmdb.functions.remove_protocol( wpmdb_data.this_url );
1633
  }
1634
 
1635
  $.wpmdb.add_filter( 'wpmdb_base_old_url', base_old_url );
1641
  true === wpmdb_default_profile ||
1642
  'savefile' === action ||
1643
  'find_replace' === action ||
1644
+ 'import' === action ||
1645
  doing_ajax ||
1646
  ! wpmdb_data.is_pro ) {
1647
  return;
1694
  }
1695
 
1696
  maybe_show_ssl_warning( connection_info[ 0 ], connection_info[ 1 ], data.scheme );
1697
+ wpmdb.functions.maybe_show_prefix_notice( data.prefix );
1698
 
1699
  $( '.pull-push-connection-info' ).addClass( 'temp-disabled' );
1700
  $( '.pull-push-connection-info' ).attr( 'readonly', 'readonly' );
1713
  loaded_tables = wpmdb_loaded_tables;
1714
  }
1715
 
1716
+ $pull_select = wpmdb.functions.create_table_select( wpmdb.common.connection_data.tables, wpmdb.common.connection_data.table_sizes_hr, loaded_tables );
1717
 
1718
  var loaded_post_types = '';
1719
  if ( false === wpmdb_default_profile && 'undefined' !== typeof wpmdb_loaded_post_types ) {
1873
  $licence_status.html( data.body );
1874
  } else {
1875
  if ( 1 === Number( data.is_first_activation ) ) {
1876
+ wpmdb_strings.welcome_text = wpmdb_strings.welcome_text.replace( '%1$s', 'https://deliciousbrains.com/wp-migrate-db-pro/doc/quick-start-guide/?utm_campaign=support%2Bdocs&utm_source=MDB%2BPaid&utm_medium=insideplugin' );
1877
+ wpmdb_strings.welcome_text = wpmdb_strings.welcome_text.replace( '%2$s', 'https://deliciousbrains.com/wp-migrate-db-pro/videos/?utm_campaign=support%2Bdocs&utm_source=MDB%2BPaid&utm_medium=insideplugin' );
1878
 
1879
  $licence_status.after(
1880
  '<div id="welcome-wrap">' +
1993
 
1994
  // expand and collapse content on click
1995
  $( '.header-expand-collapse' ).click( function() {
1996
+ var target = null;
1997
+
1998
+ if ( undefined !== $( this ).data( 'next' ) ) {
1999
+ target = $( this ).data( 'next' );
2000
+ }
2001
+
2002
  if ( $( '.expand-collapse-arrow', this ).hasClass( 'collapsed' ) ) {
2003
  $( '.expand-collapse-arrow', this ).removeClass( 'collapsed' );
2004
+ if ( target ) {
2005
+ $( target ).show();
2006
+ } else {
2007
+ $( this ).next().show();
2008
+ }
2009
  } else {
2010
  $( '.expand-collapse-arrow', this ).addClass( 'collapsed' );
2011
+ if ( target ) {
2012
+ $( target ).hide();
2013
+ } else {
2014
+ $( this ).next().hide();
2015
+ }
2016
  }
2017
  } );
2018
 
2026
 
2027
  // warning for excluding post types
2028
  $( '.select-post-types-wrap' ).on( 'change', '#select-post-types', function() {
2029
+ wpmdb.functions.exclude_post_types_warning();
2030
  } );
2031
 
2032
+ wpmdb.functions.exclude_post_types_warning = function() {
2033
  var excluded_post_types = $( '#select-post-types' ).val();
2034
  var excluded_post_types_text = '';
2035
  var $exclude_post_types_warning = $( '.exclude-post-types-warning' );
 
 
 
 
 
 
 
 
 
 
2036
 
2037
  if ( excluded_post_types ) {
2038
  excluded_post_types_text = '<code>' + excluded_post_types.join( '</code>, <code>' ) + '</code>';
2050
  .slideUp( 200 )
2051
  .animate( { opacity: 0 } );
2052
  }
2053
+ };
2054
 
2055
  if ( $( '#exclude-post-types' ).is( ':checked' ) ) {
2056
  if ( $( '#select-post-types' ).val() ) {
2092
  return;
2093
  }
2094
 
2095
+ if ( true === wpmdb.functions.maybe_show_select_table_notice() ) {
 
 
 
 
 
 
 
 
2096
  return;
2097
  }
2098
 
2115
  }
2116
 
2117
  if ( true === new_url_missing || true === new_file_path_missing ) {
2118
+ if ( 'import' === wpmdb_migration_type() ) {
2119
+ if ( $( '#import-find-replace' ).is( ':checked' ) ) {
2120
+ return;
2121
+ }
2122
+ } else {
2123
+ return;
2124
+ }
2125
  }
2126
 
2127
  // also save profile
2140
  }
2141
 
2142
  if ( false === $( '#create-backup' ).is( ':checked' ) ) {
2143
+ if ( -1 !== $.inArray( migration_intent, [ 'savefile', 'push', 'pull' ] ) ) {
2144
+ stage = 'migrate';
2145
+ } else if ( 'import' === migration_intent ) {
2146
+ stage = 'upload';
2147
+ } else {
2148
+ stage = migration_intent;
2149
+ }
2150
  }
2151
 
2152
  wpmdb.current_migration = wpmdb.migration_progress_controller.newMigration( {
2164
 
2165
  // set up backup stage
2166
  if ( 'backup' === stage ) {
2167
+ if ( 'migrate_only_with_prefix' === table_option && 'backup_selected' === backup_option && 'import' !== migration_intent ) {
2168
  backup_option = 'backup_only_with_prefix';
2169
  }
2170
  if ( 'push' === migration_intent ) {
2199
  }
2200
 
2201
  // set up migration stage
2202
+ if ( 'pull' === migration_intent ) {
 
 
2203
  data_type = 'remote';
2204
+ } else {
2205
+ data_type = 'local';
2206
  }
2207
 
2208
  if ( 'find_replace' === migration_intent ) {
2209
+ wpmdb.current_migration.model.addStage( 'find_replace', wpmdb.functions.get_tables_to_migrate( null, null ), data_type, {
 
 
 
 
2210
  strings: {
2211
  migrated: wpmdb_strings.searched,
2212
  stage_title: wpmdb_strings.migrate_button_find_replace
2213
  }
2214
  } );
2215
+ } else if ( -1 !== $.inArray( migration_intent, [ 'savefile', 'push', 'pull' ] ) ) {
2216
+ wpmdb.current_migration.model.addStage( 'migrate', wpmdb.functions.get_tables_to_migrate( null, null ), data_type );
2217
  }
2218
 
2219
  // add any additional migration stages via hook
2220
  $.wpmdb.do_action( 'wpmdb_add_migration_stages', {
2221
  'data_type': data_type,
2222
+ 'tables_to_migrate': wpmdb.functions.get_tables_to_migrate( null, null )
2223
  } );
2224
 
2225
  var table_intent = $( 'input[name=table_migrate_option]:checked' ).val();
2232
  var static_migration_label = get_migration_status_label( remote_site, migration_intent, 'migrating' );
2233
  completed_msg = get_migration_status_label( remote_site, migration_intent, 'completed' );
2234
 
2235
+ if ( -1 !== $.inArray( stage, [ 'find_replace', 'backup', 'migrate' ] ) ) {
2236
+ tables_to_migrate = wpmdb.current_migration.model.getStageItems( stage, 'name' );
 
 
 
 
2237
  }
2238
 
2239
  wpmdb.current_migration.model.setActiveStage( stage );
2259
  local: wpmdb_data.site_details
2260
  };
2261
 
2262
+ if ( -1 !== $.inArray( migration_intent, [ 'push', 'pull' ] ) ) {
2263
  request_data.temp_prefix = wpmdb.common.connection_data.temp_prefix;
2264
  request_data.site_details.remote = wpmdb.common.connection_data.site_details;
2265
  }
2268
  // so we reduce it down to one variable for this one POST.
2269
  request_data.site_details = JSON.stringify( request_data.site_details );
2270
 
2271
+ request_data = $.wpmdb.apply_filters( 'wpmdb_initiate_migration_request_data', request_data, request_data );
2272
+
2273
  doing_ajax = true;
2274
 
2275
  $.ajax( {
2306
 
2307
  // Set delay between requests - use max of local/remote values, 0 if doing export
2308
  delay_between_requests = 0;
2309
+ if ( 'savefile' !== migration_intent && 'undefined' !== typeof wpmdb.common.connection_data && 'undefined' !== typeof wpmdb.common.connection_data.delay_between_requests || 'import' === migration_intent ) {
2310
+ if ( 'import' === migration_intent ) {
2311
+ delay_between_requests = wpmdb_data.delay_between_requests;
2312
+ } else {
2313
+ delay_between_requests = Math.max( parseInt( wpmdb_data.delay_between_requests ), parseInt( wpmdb.common.connection_data.delay_between_requests ) );
2314
+ }
2315
  }
2316
 
2317
  wpmdb.functions.migrate_table_recursive = function( current_row, primary_keys ) {
2318
 
2319
  if ( i >= tables_to_migrate.length ) {
 
2320
 
2321
+ if ( 'upload' === stage && wpmdb.current_migration.model.getStageItems( 'find_replace' ).length ) {
2322
+ stage = 'find_replace';
2323
+ tables_to_migrate = wpmdb.current_migration.model.getStageItems( 'find_replace', 'name' );
2324
+ tables_to_migrate = tables_to_migrate.map( function( table ) {
2325
+ return '_mig_' + table;
2326
+ } );
2327
+ i = 0;
2328
+ } else if ( 'backup' === stage ) {
2329
+
2330
+ if ( -1 !== $.inArray( migration_intent, [ 'push', 'pull' ] ) ) {
2331
+ stage = 'migrate';
2332
+ } else if ( 'import' === migration_intent ) {
2333
+ stage = 'upload';
2334
+ } else {
2335
+ stage = migration_intent;
2336
  }
2337
 
2338
  wpmdb.current_migration.model.setActiveStage( stage );
2339
 
2340
+ if ( 'find_replace' !== stage && 'migrate' !== stage ) {
2341
+ wpmdb_call_next_hook();
2342
+ return;
2343
+ }
2344
+
2345
  i = 0;
2346
 
2347
  // should get from model
2348
+ tables_to_migrate = wpmdb.functions.get_tables_to_migrate( null, null );
2349
 
2350
  } else {
2351
  $( '.progress-label' ).removeClass( 'label-visible' );
2367
  }
2368
 
2369
  var gzip = 0;
2370
+ if ( -1 !== $.inArray( migration_intent, [ 'push', 'pull' ] ) && 1 === parseInt( wpmdb.common.connection_data.gzip ) ) {
2371
  gzip = 1;
2372
  }
2373
 
2383
  nonce: wpmdb_data.nonces.migrate_table
2384
  };
2385
 
2386
+ if ( -1 !== $.inArray( migration_intent, [ 'push', 'pull' ] ) ) {
2387
  request_data.bottleneck = wpmdb.common.connection_data.bottleneck;
2388
  request_data.prefix = wpmdb.common.connection_data.prefix;
2389
  }
2442
  return;
2443
  }
2444
 
2445
+ var item_name = tables_to_migrate[ i ];
2446
+ if ( 'import' === migration_intent && 'find_replace' === stage ) {
2447
+ item_name = item_name.replace( wpmdb_data.this_temp_prefix, '' );
2448
+ }
2449
+
2450
  //successful iteration, update model
2451
  wpmdb.current_migration.setText();
2452
+ wpmdb.current_migration.model.getStageModel( stage ).setItemRowsTransferred( item_name, row_information.current_row );
2453
 
2454
  // We need the returned file name for delivery or display to the user.
2455
  if ( 1 === last_table && 'savefile' === migration_intent ) {
2477
 
2478
  };
2479
 
2480
+ if ( -1 !== $.inArray( migration_intent, [ 'savefile', 'push', 'pull', 'find_replace' ] ) ) {
2481
+ wpmdb.common.next_step_in_migration = {
2482
+ fn: wpmdb.functions.migrate_table_recursive,
2483
+ args: [ '-1', '' ]
2484
+ };
2485
+ wpmdb.functions.execute_next_step();
2486
+ }
2487
 
2488
+ $.wpmdb.do_action( 'wpmdb_migration_initiated', stage );
2489
  }
2490
 
2491
  } ); // end ajax
2530
  migration_cancelled = false;
2531
  doing_ajax = false;
2532
  wpmdb.common.non_fatal_errors = '';
2533
+ tables_to_migrate = [];
2534
 
2535
  $( '.progress-label' ).remove();
2536
  $( '.migration-progress-ajax-spinner' ).remove();
2574
  nonce: wpmdb_data.nonces.finalize_migration
2575
  };
2576
 
2577
+ if ( -1 !== $.inArray( migration_intent, [ 'push', 'pull' ] ) ) {
2578
  request_data.prefix = wpmdb.common.connection_data.prefix;
2579
  }
2580
 
2662
  $( 'body' ).on( 'click', '.close-progress-content-button', function( e ) {
2663
  hide_overlay();
2664
  wpmdb.current_migration.restoreTitleElem();
2665
+ wpmdb.functions.maybe_reload_page();
2666
  } );
2667
 
2668
  $( 'body' ).on( 'click', '#overlay', function( e ) {
2669
  if ( true === migration_completed && e.target === this ) {
2670
  hide_overlay();
2671
  wpmdb.current_migration.restoreTitleElem();
2672
+ wpmdb.functions.maybe_reload_page();
2673
  }
2674
  } );
2675
 
2702
  return;
2703
  }
2704
 
2705
+ if ( true === wpmdb.functions.maybe_show_select_table_notice() ) {
 
 
 
 
 
 
 
 
2706
  return;
2707
  }
2708
 
2807
  'last_migration_type': last_replace_switch
2808
  } );
2809
 
2810
+ $( '.migrate-tab' ).attr( 'class', 'migrate-tab content-tab' ).addClass( wpmdb_migration_type() );
2811
+
2812
  if ( 'pull' === wpmdb_migration_type() ) {
2813
  $( '.pull-list li' ).append( $connection_info_box );
2814
  $connection_info_box.show( function() {
2822
  $( '.pull-list li' ).append( $connection_info_box );
2823
  $( '.pull-push-connection-info' ).removeClass( 'temp-disabled' ).attr( 'readonly', 'readonly' );
2824
  $( '.connect-button' ).hide();
2825
+ wpmdb.functions.connection_box_changed();
2826
  return;
2827
  }
2828
  if ( connection_established ) {
2836
  $( '.create-new-profile' ).val( profile_name );
2837
  }
2838
  if ( true === show_prefix_notice ) {
2839
+ $( '.prefix-notice' ).show();
2840
  }
2841
  if ( true === show_ssl_notice ) {
2842
  $( '.ssl-notice' ).show();
2846
  $( '.step-two' ).hide();
2847
  }
2848
  wpmdb_toggle_migration_action_text();
2849
+ if ( 'false' === wpmdb_data.write_permission ) {
2850
+ show_backup_disabled_msg( wpmdb_data.this_upload_dir_long );
 
 
 
 
2851
  }
2852
  } else {
2853
  $( '.connection-status' ).show();
2866
  $( '.push-list li' ).append( $connection_info_box );
2867
  $( '.pull-push-connection-info' ).removeClass( 'temp-disabled' ).attr( 'readonly', 'readonly' );
2868
  $( '.connect-button' ).hide();
2869
+ wpmdb.functions.connection_box_changed();
2870
  return;
2871
  }
2872
  if ( connection_established ) {
2880
  $( '.create-new-profile' ).val( profile_name );
2881
  }
2882
  if ( true === show_prefix_notice ) {
2883
+ $( '.prefix-notice' ).show();
2884
  }
2885
  if ( true === show_ssl_notice ) {
2886
  $( '.ssl-notice' ).show();
2891
  }
2892
  wpmdb_toggle_migration_action_text();
2893
  if ( '0' === wpmdb.common.connection_data.write_permissions ) {
2894
+ show_backup_disabled_msg( wpmdb.common.connection_data.upload_dir_long );
 
 
 
 
2895
  }
2896
  } else {
2897
  $( '.connection-status' ).show();
2898
  $( '.step-two' ).hide();
2899
  }
2900
+ } else if ( -1 !== $.inArray( wpmdb_migration_type(), [ 'savefile', 'find_replace', 'import' ] ) ) {
2901
  $( '.connection-status' ).hide();
 
2902
  $( '.table-prefix' ).html( wpmdb_data.this_prefix );
2903
  if ( false === profile_name_edited ) {
2904
  $( '.create-new-profile' ).val( '' );
2905
  }
2906
 
2907
+ if ( 'import' !== wpmdb_migration_type() ) {
2908
+ $( '.step-two' ).show();
2909
+ $.wpmdb.do_action( 'wpmdb_update_push_table_select' );
2910
+ } else {
2911
+ $.wpmdb.do_action( 'wpmdb_update_import_table_select' );
2912
+ }
2913
+
2914
  if ( 'savefile' === wpmdb_migration_type() ) {
2915
  $( '.backup-options' ).hide();
2916
  $( '.compatibility-older-mysql' ).show();
2922
  $( '.step-two' ).hide();
2923
  }
2924
 
2925
+ if ( 'find_replace' === wpmdb_migration_type() || 'import' === wpmdb_migration_type() ) {
2926
  if ( 'true' === wpmdb_data.is_multisite ) {
2927
  var $old_replace_col = $( '.old-replace-col' ).eq( 1 );
2928
  $old_replace_col.parent().removeClass( 'pin' ).find( '.replace-remove-row' ).show();
2929
  $old_replace_col.find( 'input' ).removeAttr( 'readonly' );
2930
  }
2931
+
2932
+ if ( 'false' === wpmdb_data.write_permission ) {
2933
+ show_backup_disabled_msg( wpmdb_data.this_upload_dir_long );
2934
+ }
2935
  }
2936
 
2937
  }
2939
  maybe_show_mixed_cased_table_name_warning();
2940
  }
2941
 
2942
+ function show_backup_disabled_msg( upload_dir ) {
2943
+ $( '#create-backup' ).prop( 'checked', false );
2944
+ $( '#create-backup' ).attr( 'disabled', 'disabled' );
2945
+ $( '#create-backup-label' ).addClass( 'disabled' );
2946
+ $( '.backup-option-disabled' ).show();
2947
+ $( '.upload-directory-location' ).html( upload_dir );
2948
+ }
2949
+
2950
  // move around textarea depending on whether or not the push/pull options are selected
2951
  var $connection_info_box = $( '.connection-info-wrapper' );
2952
  move_connection_info_box();
2964
  var old_url = null;
2965
  var old_path = null;
2966
  if ( null !== wpmdb.common.previous_connection_data && 'object' === typeof wpmdb.common.previous_connection_data && wpmdb.common.previous_connection_data.url !== wpmdb.common.connection_data.url ) {
2967
+ old_url = wpmdb.functions.remove_protocol( wpmdb.common.previous_connection_data.url );
2968
  old_path = wpmdb.common.previous_connection_data.path;
2969
  }
2970
 
2982
  $( '.replace-right-col input', this ).val( wpmdb.common.connection_data.path );
2983
  }
2984
  if ( old_val === old_url ) {
2985
+ $( '.replace-right-col input', this ).val( wpmdb.functions.remove_protocol( wpmdb.common.connection_data.url ) );
2986
  }
2987
  } );
2988
  }
2989
  $.wpmdb.do_action( 'wpmdb_update_push_table_select' );
2990
  $( '#select-post-types' ).remove();
2991
  $( '.exclude-post-types-warning' ).after( $push_post_type_select );
2992
+ wpmdb.functions.exclude_post_types_warning();
2993
  $( '#select-backup' ).remove();
2994
  $( '.backup-tables-wrap' ).prepend( $push_select_backup );
2995
  } else if ( 'pull' === wpmdb_migration_type() ) {
3006
  $( '.old-replace-col input', this ).val( wpmdb.common.connection_data.path );
3007
  }
3008
  if ( old_val === old_url ) {
3009
+ $( '.old-replace-col input', this ).val( wpmdb.functions.remove_protocol( wpmdb.common.connection_data.url ) );
3010
  }
3011
  } );
3012
  }
3013
  $.wpmdb.do_action( 'wpmdb_update_pull_table_select' );
3014
  $( '#select-post-types' ).remove();
3015
  $( '.exclude-post-types-warning' ).after( $pull_post_type_select );
3016
+ wpmdb.functions.exclude_post_types_warning();
3017
  $( '#select-backup' ).remove();
3018
  $( '.backup-tables-wrap' ).prepend( $pull_select_backup );
3019
  }
3039
  if ( bubble.hasClass( 'bottom' ) ) {
3040
  var bubble_offset = 1;
3041
 
3042
+ if ( true === bubble.hasClass( 'compatibility-help' ) ) {
3043
+ bubble_offset = 6;
3044
+ } else if ( $( this ).is( ':first-child' ) ) {
3045
  bubble_offset = 3;
3046
  }
 
3047
  bubble.css( {
3048
  'left': ( ( position.left - bubble.width() / 2 ) - bubble_offset ) + 'px',
3049
  'top': ( position.top + icon.height() + 9 ) + 'px'
3229
  // process notice links clicks, eg. dismiss, reminder
3230
  $( '.notice-link' ).click( function( e ) {
3231
  e.preventDefault();
3232
+
3233
+ // process notice links clicks, eg. dismiss, reminder
3234
+ wpmdb.functions.ajax_handle_dismissible_notice( wpmdb_data.nonces.process_notice_link, function( ele ) {
3235
+ $( ele ).closest( '.inline-message' ).hide();
3236
+ }, $( this ) );
 
 
 
 
 
 
 
 
 
3237
  } );
3238
 
3239
  // When read-only connection info is copied, convert it to one line
3342
  $connection_info.val( two_lines );
3343
  } );
3344
 
3345
+ $( 'input[name=table_migrate_option]' ).change( function() {
3346
+ $( '.select-tables-wrap' ).hide();
3347
+
3348
+ if ( 'migrate_select' === $( this ).val() ) {
3349
+ $( '.select-tables-wrap' ).show();
3350
+ }
3351
  } );
3352
 
3353
  $( '.show-multiselect' ).each( function() {
3388
  dataType: 'text',
3389
  cache: false,
3390
  data: {
3391
+ action: 'wpmdb_whitelist_plugins',
3392
+ whitelist_plugins: $( select_element ).val(),
3393
+ nonce: wpmdb_data.nonces.whitelist_plugins
3394
  },
3395
  error: function( jqXHR, textStatus, errorThrown ) {
3396
  alert( wpmdb_strings.blacklist_problem + '\r\n\r\n' + wpmdb_strings.status + ' ' + jqXHR.status + ' ' + jqXHR.statusText + '\r\n\r\n' + wpmdb_strings.response + '\r\n' + jqXHR.responseText );
3555
  $( '.connect-button' ).click( function( event ) {
3556
  event.preventDefault();
3557
  $( this ).blur();
3558
+ wpmdb.functions.connection_box_changed();
3559
  } );
3560
 
3561
  // send paste even to connection_box_changed() function
3562
  $( '.pull-push-connection-info' ).bind( 'paste', function( e ) {
3563
  var $this = this;
3564
  setTimeout( function() {
3565
+ wpmdb.functions.connection_box_changed();
3566
  }, 0 );
3567
 
3568
  } );
3569
 
3570
  $( 'body' ).on( 'click', '.try-again', function() {
3571
  $( '.pull-push-connection-info' ).removeClass( 'temp-disabled' );
3572
+ wpmdb.functions.connection_box_changed();
3573
  } );
3574
 
3575
  $( 'body' ).on( 'click', '.try-http', function() {
3577
  var new_url = connection_info[ 0 ].replace( 'https', 'http' );
3578
  var new_contents = new_url + '\n' + connection_info[ 1 ];
3579
  $( '.pull-push-connection-info' ).val( new_contents );
3580
+ wpmdb.functions.connection_box_changed();
3581
  } );
3582
 
3583
  $( '.create-new-profile' ).change( function() {
3593
  } );
3594
 
3595
  // fired when the connection info box changes (e.g. gets pasted into)
3596
+ wpmdb.functions.connection_box_changed = function() {
3597
  var $this = $( '.pull-push-connection-info' );
3598
 
3599
+ if ( -1 === $.inArray( wpmdb_migration_type(), [ 'push', 'pull' ] ) ||
3600
+ ( doing_ajax || $( $this ).hasClass( 'temp-disabled' ) ) && false === wpmdb.force_reconnect ) {
3601
  return;
3602
  }
3603
+
3604
  wpmdb.force_reconnect = false;
3605
  var data = $( '.pull-push-connection-info' ).val();
3606
 
3698
 
3699
  profile_name_edited = false;
3700
 
3701
+ return $.ajax( {
3702
  url: ajaxurl,
3703
  type: 'POST',
3704
  dataType: 'json',
3750
  $( '.connection-status' ).hide();
3751
  $( '.step-two' ).show();
3752
 
3753
+ wpmdb.functions.maybe_show_prefix_notice( data.prefix );
3754
 
3755
  connection_established = true;
3756
  set_connection_data( data );
3784
  $( '#new-path-missing-warning, #new-url-missing-warning' ).hide();
3785
 
3786
  if ( 'pull' === wpmdb_migration_type() ) {
3787
+ $( '#new-url' ).val( wpmdb.functions.remove_protocol( wpmdb_data.this_url ) );
3788
  $( '#new-path' ).val( wpmdb_data.this_path );
3789
  if ( 'true' === wpmdb_data.is_multisite ) {
3790
  $( '#new-domain' ).val( wpmdb_data.this_domain );
3791
+ $( '.replace-row.pin .old-replace-col input[type="text"]' ).val( wpmdb.functions.remove_protocol( data.url ) );
3792
  }
3793
+ $( '#old-url' ).val( wpmdb.functions.remove_protocol( data.url ) );
3794
  $( '#old-path' ).val( data.path );
3795
 
3796
  $.wpmdb.do_action( 'wpmdb_update_pull_table_select' );
3797
  $( '#select-post-types' ).remove();
3798
  $( '.exclude-post-types-warning' ).after( $pull_post_type_select );
3799
+ wpmdb.functions.exclude_post_types_warning();
3800
  $( '.table-prefix' ).html( data.prefix );
3801
  $( '.backup-table-prefix' ).html( wpmdb_data.site_details.prefix );
3802
  $( '.uploads-dir' ).html( wpmdb_data.this_uploads_dir );
3803
  } else {
3804
+ $( '#new-url' ).val( wpmdb.functions.remove_protocol( data.url ) );
3805
  $( '#new-path' ).val( data.path );
3806
 
3807
  if ( 'true' === wpmdb_data.is_multisite ) {
3808
+ $( '.replace-row.pin .old-replace-col input[type="text"]' ).val( wpmdb.functions.remove_protocol( wpmdb_data.this_url ) );
3809
  }
3810
  $.wpmdb.do_action( 'wpmdb_update_push_table_select' );
3811
  $( '#select-backup' ).remove();
3821
 
3822
  } );
3823
 
3824
+ };
3825
 
3826
  // Sets the initial Pause/Resume button event to Pause
3827
  $( 'body' ).on( 'click', '.pause-resume', function( event ) {
3945
  success: function( data ) {
3946
  doing_ajax = false;
3947
  data = $.trim( data );
3948
+
3949
  if ( ( 'push' === migration_intent && '1' !== data ) || ( 'push' !== migration_intent && '' !== data ) ) {
3950
+
3951
+ if ( 'undefined' !== typeof data && 'undefined' !== typeof data.wpmdb_error && 1 === data.wpmdb_error ) {
3952
+ data = data.wpmdb_error;
3953
+ }
3954
+
3955
  wpmdb.current_migration.setState( wpmdb_strings.migration_cancellation_failed, data, 'error' );
3956
  wpmdb.common.migration_error = true;
3957
  wpmdb.functions.migration_complete_events();
4016
 
4017
  return;
4018
  }
4019
+ wpmdb.functions.connection_box_changed();
4020
  }
4021
  } );
4022
  } );
4075
  } );
4076
 
4077
  $.wpmdb.add_filter( 'wpmdb_get_table_prefix', get_table_prefix );
4078
+ $.wpmdb.add_filter( 'wpmdb_get_tables_to_migrate', wpmdb.functions.get_tables_to_migrate );
4079
  $.wpmdb.add_action( 'wpmdb_lock_replace_url', lock_replace_url );
4080
+ $.wpmdb.add_action( 'move_connection_info_box', wpmdb.functions.exclude_post_types_warning );
4081
 
4082
  $.wpmdb.add_filter( 'wpmdb_before_migration_complete_hooks', function( hooks ) {
4083
  pause_before_finalize = $( 'input[name=pause_before_finalize]:checked' ).length ? true : false;
asset/dist/js/script-10.min.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ !function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){var d=jQuery,e=a("MigrationProgress-model"),f=a("MigrationProgress-view"),g=d('<div id="overlay" class="hide"></div>'),h=d(".progress-content").clone().addClass("hide"),i=d(".pro-version").addClass("hide");g.append(i);var j={migration:{model:{},view:{},$progress:{},$wrapper:{},$overlay:{},status:"active",title:"",text:"",timerCount:0,elapsedInterval:0,currentStageNum:0,counterDisplay:!1,originalTitle:document.title,setTitle:function(a){this.$progress.find(".progress-title").html(a),this.title=a},setStatus:function(a){this.$progress.removeClass(this.status).addClass("error"===a?"wpmdb-error":a),"error"===a&&this.$progress.find(".progress-text").addClass("migration-error"),this.status=a,this.updateTitleElem()},setText:function(a){"string"!=typeof a&&(a=""),0>=a.indexOf("wpmdb_error")&&(a=this.decodeErrorObject(a)),this.$progress.find(".progress-text").html(a),this.text=a},setState:function(a,b,c){null!==a&&this.setTitle(a),null!==b&&this.setText(b),null!==c&&this.setStatus(c)},startTimer:function(){this.timerCount=0,this.counterDisplay=d(".timer"),this.elapsedInterval=setInterval(this.incrementTimer,1e3)},pauseTimer:function(){clearInterval(this.elapsedInterval)},resumeTimer:function(){this.elapsedInterval=setInterval(this.incrementTimer,1e3)},incrementTimer:function(){wpmdb.current_migration.timerCount=wpmdb.current_migration.timerCount+1,wpmdb.current_migration.displayCount()},displayCount:function(){var a=Math.floor(this.timerCount/3600)%24,b=Math.floor(this.timerCount/60)%60,c=this.timerCount%60,d=this.pad(a,2,0)+":"+this.pad(b,2,0)+":"+this.pad(c,2,0);this.counterDisplay.html(d)},updateTitleElem:function(){var a=this.model.get("activeStageName"),b=this.model.getStageModel(a),c=Math.max(0,b.getTotalProgressPercent()),d=this.model.get("stages").length,e=this.currentStageNum,f=this.status,g=wpmdb_strings.title_progress;"complete"===b.get("status")&&0===b.get("totalSize")&&(c=100),g=g.replace("%1$s",c+"%"),g=g.replace("%2$s",e),g=g.replace("%3$s",d),1===d&&(g=c+"%"),wpmdb_strings["title_"+f]&&(g=wpmdb_strings["title_"+f]),g=g+" - "+this.originalTitle,document.title=g},restoreTitleElem:function(){document.title=this.originalTitle},pad:function(a,b,c){return c=c||"0",a+="",a.length>=b?a:new Array(b-a.length+1).join(c)+a},decodeErrorObject:function(a){var b=a.replace(/\{&quot;/g,"{#q!#").replace(/\&quot;}/g,"#q!#}").replace(/,&quot;/g,",#q!#").replace(/&quot;:/g,"#q!#:").replace(/:&quot;/g,":#q!#").replace(/&quot;/g,'\\"').replace(/#q!#/g,'"').replace(/&gt;/g,">").replace(/&lt;/g,"<");try{b=JSON.parse(b)}catch(c){return a}return"object"==typeof b&&"undefined"!=typeof b.body?b:a},fixProgressStageWidthForScrollBar:function(){var a=Math.abs(this.$wrapper[0].offsetWidth-this.$wrapper[0].clientWidth),b=this.$wrapper.find(".active .progress-items"),c=parseInt(b.css("padding-left"),10),d=parseInt(b.css("padding-right"),10);(0!==a||0===a&&d!==c)&&b.css("padding-right",c-a+"px")}},newMigration:function(a){d("#overlay").remove(),d(".progress-content").remove(),this.migration.$overlay=g.clone(),d("#wpwrap").append(this.migration.$overlay),this.migration.model=new e(a),this.migration.view=new f({model:this.migration.model}),this.migration.$progress=h.clone(),this.migration.$wrapper=this.migration.view.$el,this.migration.$progress.find(".migration-progress-stages").replaceWith(this.migration.$wrapper),this.migration.$proVersion=this.migration.$overlay.find(".pro-version");var b=this.migration.$proVersion.find("iframe").remove().clone();this.migration.$overlay.prepend(this.migration.$progress);var c=this;return setTimeout(function(){c.migration.$overlay.add(c.migration.$progress).add(c.migration.$proVersion).removeClass("hide").addClass("show"),c.migration.$proVersion.length&&setTimeout(function(){c.migration.$proVersion.find(".iframe").append(b)},500)},0),this.migration.currentStageNum=0,this.migration.$proVersion.on("click",".close-pro-version",function(){c.migration.$proVersion.find("iframe").remove(),c.migration.$proVersion.addClass("hide remove"),setTimeout(function(){c.migration.$proVersion.remove()},500)}),this.migration.model.on("migrationComplete",function(){c.utils.updateProgTableVisibilitySetting(),c.utils.updatePauseBeforeFinalizeSetting(),c.migration.pauseTimer()}),d(window).on("resize",_.debounce(this.migration.fixProgressStageWidthForScrollBar.bind(this.migration),100)),this.migration.model.on("change:activeStage",this.migration.fixProgressStageWidthForScrollBar.bind(this.migration)),this.migration},utils:a("MigrationProgress-utils")};b.exports=j},{"MigrationProgress-model":2,"MigrationProgress-utils":3,"MigrationProgress-view":4}],2:[function(a,b,c){var d=a("MigrationProgressStage-model"),e=jQuery,f=Backbone.Model.extend({defaults:{_initialStages:null,stages:null,activeStageName:null,stageModels:null,localTableRows:null,localTableSizes:null,remoteTableRows:null,remoteTableSizes:null,migrationStatus:"active",migrationIntent:"savefile"},initialize:function(){this.set("stageModels",{}),this.set("_initialStages",this.get("stages")),this.set("stages",[]),_.each(this.get("_initialStages"),function(a,b,c){this.addStage(a.name,b,c)},this)},addStage:function(a,b,c,d){var f,g=[];return _.each(b,function(a){var b,d;"remote"===c?(b=this.get("remoteTableSizes")[a],d=this.get("remoteTableRows")[a]):(b=this.get("localTableSizes")[a],d=this.get("localTableRows")[a]),g.push({name:a,size:b,rows:d})},this),f={name:a,items:g,dataType:c},"object"==typeof d&&(f=e.extend(f,d)),this.addStageModel(f),this.trigger("stage:added",this.get("stageModels")[a]),this.get("stageModels")[a].on("change",function(){this.trigger("change")},this),this.getStageModel(f.name)},addStageItem:function(a,b,c,d){this.getStageModel(a).addItem(b,c,d)},addStageModel:function(a){var b=this.get("stages"),c=this.get("stageModels"),e=new d(a);b.push(a),c[a.name]=e,this.set("stages",b),this.set("stageModels",c)},getStageModel:function(a){return this.get("stageModels")[a]},getStageItems:function(a,b){var c=this.getStageModel(a),d=c.get("items");return void 0===b?d:d.map(function(a){return a[b]})},setActiveStage:function(a){this.setStageComplete(),this.set("activeStageName",a),this.getStageModel(a).set("status","active"),this.trigger("change:activeStage")},setStageComplete:function(a){a||(a=this.get("activeStageName")),null!==a&&this.getStageModel(a).set("status","complete"),wpmdb.current_migration.currentStageNum=wpmdb.current_migration.currentStageNum+1},setMigrationComplete:function(){var a=this.getStageModel(this.get("activeStageName"));this.setStageComplete(),this.trigger("migrationComplete"),this.set("migrationStatus","complete"),a.activateTab()}});b.exports=f},{"MigrationProgressStage-model":5}],3:[function(a,b,c){var d=jQuery;b.exports={updateProgTableVisibilitySetting:function(){wpmdb_data.prog_tables_visibility_changed&&(wpmdb_data.prog_tables_visibility_changed=!1,d.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_setting",nonce:wpmdb_data.nonces.save_setting,setting:"prog_tables_hidden",checked:Boolean(wpmdb_data.prog_tables_hidden)},error:function(a,b,c){console.log("Could not save progress item visibility setting",c)}}))},updatePauseBeforeFinalizeSetting:function(){wpmdb_data.pause_before_finalize_changed&&(wpmdb_data.pause_before_finalize_changed=!1,d.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_setting",nonce:wpmdb_data.nonces.save_setting,setting:"pause_before_finalize",checked:Boolean(wpmdb_data.pause_before_finalize)},error:function(a,b,c){console.log("Could not save pause before finalize setting",c)}}))}}},{}],4:[function(a,b,c){var d=a("./MigrationProgressStage-view.js"),e=(jQuery,Backbone.View.extend({tagName:"div",className:"migration-progress-stages",id:"migration-progress-stages",self:this,initialize:function(){this.$el.empty(),this.model.on("stage:added",function(a){this.addStageView(a)},this),_.each(this.model.get("stageModels"),this.addStageView,this)},addStageView:function(a){var b=new d({model:a});a.trigger("view:initialized",b),this.$el.append(b.$el),this.$el.parent().find(".stage-tabs").append(b.$tabElem)}}));b.exports=e},{"./MigrationProgressStage-view.js":6}],5:[function(a,b,c){var d=jQuery,e=Backbone.Model.extend({defaults:{status:"queued",_initialItems:null,items:null,lookupItems:null,totalSize:0,totalTransferred:0,dataType:"local",name:"",itemsComplete:0,itemsCompleteArr:[],strings:null},initialize:function(){this.initStrings(),this.set("_initialItems",this.get("items").slice()),this.set("items",[]),this.set("lookupItems",{}),this.set("itemsCompleteArr",[]),_.each(this.get("_initialItems"),function(a){this.addItem(a.name,a.size,a.rows)},this),this.on("view:initialized",this.triggerItemViewInit),this.on("change",function(){wpmdb.current_migration.updateTitleElem()})},initStrings:function(){var a={stage_title:this.get("name"),migrated:wpmdb_strings.migrated,queued:wpmdb_strings.queued,active:wpmdb_strings.running,complete:wpmdb_strings.complete,hide:wpmdb_strings.hide,show:wpmdb_strings.show,itemsName:wpmdb_strings.tables},b=this.get("strings");b="object"==typeof b?b:{},b=d.extend(a,b),b.items_migrated=b.itemsName+" "+b.migrated,b.hide_items=b.hide+" "+b.itemsName,b.show_items=b.show+" "+b.itemsName,this.set("strings",b)},addItem:function(a,b,c){var d=this.get("items"),e={name:a,size:b,rows:c||b,stageName:this.get("name"),$el:null,transferred:0,rowsTransferred:0,complete:!1};d.push(e),this.get("lookupItems")[a]=d.length-1,this.set("totalSize",parseInt(this.get("totalSize"))+parseInt(b)),this.trigger("item:added",e)},triggerItemViewInit:function(){var a=this.get("items"),b=this;_.each(a,function(a){b.trigger("item:added",a)})},getTotalSizeTransferred:function(){return this.get("totalTransferred")},countItemsComplete:function(){return this.get("itemsComplete")},getTotalProgressPercent:function(){var a=this.getTotalSizeTransferred(),b=this.get("totalSize");return 0>=a||0>=b?0:Math.min(100,Math.floor(a/b*100))},activateTab:function(){this.trigger("activateTab"),wpmdb.current_migration.model.trigger("change:activeStage")},setItemComplete:function(a){var b=this.get("itemsCompleteArr");if(!~b.indexOf(a)){b.push(a);var c=this.getItemByName(a),d=this.get("totalTransferred"),e=this.get("itemsComplete");this.set("itemsComplete",++e),d+=c.size-c.transferred,this.set("totalTransferred",d),c.transferred=c.size,c.complete=!0,c.rowsTransferred=c.rows,this.trigger("change change:items",c)}},setItemRowsTransferred:function(a,b){var c,d,e=this.getItemByName(a),f=this.get("totalTransferred");return c=-1===parseInt(b)?1:Math.min(1,b/e.rows),1===c?void this.setItemComplete(a):(d=e.size*c,f+=d-e.transferred,this.set("totalTransferred",f),e.transferred=d,e.rowsTransferred=b,void this.trigger("change change:items",e))},getItemByName:function(a){var b=this.get("items")[this.get("lookupItems")[a]]||{};return a===b.name?b:this.determineItemByName(a)},determineItemByName:function(a){for(var b=this.get("items"),c=0;c<b.length;c++){var d=b[c];if(a===d.name)return this.get("lookupItems").itemName=c,d}}});b.exports=e},{}],6:[function(a,b,c){var d=jQuery,e=Backbone.View.extend({tagName:"div",className:"migration-progress-stage-container hide-tables",$totalProgressElem:null,$tabElem:null,$showHideTablesElem:null,$pauseBeforeFinalizeElem:null,$pauseBeforeFinalizeCheckbox:null,$itemsContainer:null,itemViews:null,maxDomNodes:100,visibleDomNodes:0,queuedElements:null,$truncationNotice:null,$truncationNoticeHiddenItems:null,initialize:function(){this.$el.empty(),this.$el.attr("data-stage",this.model.get("name")).addClass("queued "+this.model.get("name")),this.queuedElements=[],this.initTotalProgressElem(),wpmdb.current_migration.view.$el.parent().find(".stage-tabs").after(this.$totalProgressElem),this.$itemsContainer=d("<div class=progress-items />"),this.$el.append(this.$itemsContainer),this.initTabElem(),this.model.on("item:added",this.maybeAddElementToView,this),_.each(this.model.get("itemModels"),this.maybeAddElementToView,this),this.model.on("change",function(){this.updateProgressElem(),this.updateStageTotals()},this),this.model.on("change:status",function(a){this.$el.removeClass("queued active").addClass(this.model.get("status")),this.$totalProgressElem.removeClass("queued active").addClass(this.model.get("status")),this.$tabElem.removeClass("queued active").addClass(this.model.get("status")).find(".stage-status").text(this.model.get("strings")[this.model.get("status")])},this),this.model.on("change:items",function(a){a.name&&this.setItemProgress(a)},this),this.model.on("activateTab",function(){"complete"===wpmdb.current_migration.model.get("migrationStatus")&&(this.$totalProgressElem.addClass("active").siblings().removeClass("active"),this.$tabElem.addClass("active").siblings().removeClass("active"),this.$el.addClass("active").siblings().removeClass("active"))},this)},initTotalProgressElem:function(){this.initShowHideTablesElem(),this.initPauseBeforeFinalizeElem(),this.$totalProgressElem=d('<div class="stage-progress '+this.model.get("name")+'" />').append("<span class=percent-complete>0</span>% "+this.model.get("strings").complete+" ").append('<span class="size-complete-wrap">(<span class=size-complete>0 MB</span> / <span class=size-total>0 MB</span>) </span>').append('<span class="items-complete-wrap"><span class=items-complete>0</span> <span class=lowercase >of</span> <span class=items-total>0</span> '+this.model.get("strings").items_migrated+"</span>").append(this.$showHideTablesElem).append("<div class=progress-bar-wrapper><div class=progress-bar /></div>"),this.updateStageTotals()},initShowHideTablesElem:function(){this.$showHideTablesElem=d("<a class=show-hide-tables/>").text(this.model.get("strings").show_items);var a=this;this.$showHideTablesElem.on("click show-hide-progress-tables",function(){var b;a.$el.hasClass("hide-tables")?(b=!1,a.$el.add(a.$el.siblings()).removeClass("hide-tables"),a.$showHideTablesElem.text(a.model.get("strings").hide_items)):(b=!0,a.$el.add(a.$el.siblings()).addClass("hide-tables"),a.$showHideTablesElem.text(a.model.get("strings").show_items)),Boolean(b)!==Boolean(wpmdb_data.prog_tables_hidden)&&(wpmdb_data.prog_tables_visibility_changed=!0,wpmdb_data.prog_tables_hidden=b)}),wpmdb_data.prog_tables_hidden||this.$showHideTablesElem.triggerHandler("show-hide-progress-tables"),this.model.on("change:status activateTab",function(){wpmdb_data.prog_tables_hidden?a.$showHideTablesElem.text(a.model.get("strings").show_items):a.$showHideTablesElem.text(a.model.get("strings").hide_items)})},initPauseBeforeFinalizeElem:function(){this.$pauseBeforeFinalizeElem=d(".pause-before-finalize"),this.$pauseBeforeFinalizeCheckbox=this.$pauseBeforeFinalizeElem.find("input[type=checkbox]");var a=this,b=!1,c=wpmdb.current_migration.model.get("migrationIntent");wpmdb_data.pause_before_finalize&&(b=!0),this.$pauseBeforeFinalizeCheckbox.prop("checked",b),-1!==d.inArray(c,["push","pull","find_replace","import"])?("find_replace"===c&&d("#pause-before-finalize-label").text(wpmdb_strings.pause_before_finalize_find_replace),this.$pauseBeforeFinalizeElem.show()):this.$pauseBeforeFinalizeElem.hide(),wpmdb.current_migration.model.on("change:activeStage",function(){"media"===wpmdb.current_migration.model.get("activeStageName")&&a.$pauseBeforeFinalizeElem.hide()}),this.$pauseBeforeFinalizeElem.on("click",function(){var b=Boolean(a.$pauseBeforeFinalizeCheckbox.is(":checked"));b!==Boolean(wpmdb_data.pause_before_finalize)&&(wpmdb_data.pause_before_finalize_changed=!0,wpmdb_data.pause_before_finalize=b)})},initTabElem:function(){var a=this;this.$tabElem=d("<a class=stage-tab>").append("<span class=stage-title>"+this.model.get("strings").stage_title+"</span> ").append("<span class=stage-status>"+this.model.get("strings").queued+"</span> ").on("click",function(){a.model.activateTab()})},updateProgressElem:function(){var a=Math.max(0,this.model.getTotalProgressPercent()),b=wpmdb.functions.convertKBSizeToHRFixed(Math.min(this.model.getTotalSizeTransferred(),this.model.get("totalSize"))),c=Math.min(this.model.countItemsComplete(),this.model.get("items").length);"complete"===this.model.get("status")&&0===this.model.get("totalSize")&&(a=100,this.$showHideTablesElem.fadeOut()),this.$totalProgressElem.find(".percent-complete").text(a),this.$totalProgressElem.find(".size-complete").text(b),this.$totalProgressElem.find(".items-complete").text(wpmdb_add_commas(c)),this.$totalProgressElem.find(".progress-bar-wrapper .progress-bar").css({width:a+"%"})},updateStageTotals:function(){var a=this.model.get("items").length;this.$totalProgressElem.find(".items-total").text(wpmdb_add_commas(a)),this.$totalProgressElem.find(".size-total").text(wpmdb.functions.convertKBSizeToHRFixed(this.model.get("totalSize")))},initializeItemElement:function(a){var b=d('<div class="item-progress" />'),c=d('<div class="progress-bar"/>').css("width","0%"),e=d("<p>").addClass("item-info").append(d('<span class="name" />').text(a.name)).append(" ").append(d('<span class="size" />').text("("+wpmdb.functions.convertKBSizeToHRFixed(a.size)+")"));return b.append(e),b.append(c),b.append('<span class="dashicons dashicons-yes"/>'),b.attr("id","item-"+a.name),b.attr("data-stage",this.model.get("name")),a.$el=b,a.$progress=c,a.$title=e,a},maybeAddElementToView:function(a){this.visibleDomNodes<this.maxDomNodes?(++this.visibleDomNodes,this.$itemsContainer.append(this.initializeItemElement(a).$el)):(this.queuedElements.push(a),this.$truncationNotice?this.updateTruncationNotice():this.showTruncationNotice())},showTruncationNotice:function(){this.$truncationNotice||(this.$truncationNotice=d('<div class="truncation-notice" >'+wpmdb_strings.progress_items_truncated_msg.replace("%1$s",'<span class="hidden-items">'+wpmdb_add_commas(this.queuedElements.length)+"</span>")+"</div>"),this.$truncationNoticeHiddenItems=this.$truncationNotice.find(".hidden-items"),this.$itemsContainer.after(this.$truncationNotice))},updateTruncationNotice:function(){this.$truncationNoticeHiddenItems.text(wpmdb_add_commas(this.queuedElements.length))},getNextElementForView:function(a){var b;return this.queuedElements.length&&(a&&this.queuedElements.push(a),b=this.queuedElements.shift(),a=b instanceof d?b:this.initializeItemElement(b).$el),a},setItemProgress:function(a){var b=Math.min(100,Math.ceil(100*(a.transferred/a.size)));a.$progress.css("width",b+"%"),b>=100&&this.elemComplete(a)},elemComplete:function(a){var b=a.$el.addClass("complete");if(1!==this.model.get("items").length){var c=this.getNextElementForView(b),d=b.height(),e=b.css("margin-bottom"),f=c.clone().css({height:0,marginBottom:0}).addClass("clone");f.appendTo(this.$itemsContainer),b.css({height:d,marginBottom:e}),setTimeout(function(){b.css({height:0,marginBottom:0}),f.css({height:d,marginBottom:e}),setTimeout(function(){b.css({height:"auto",marginBottom:e}).remove(),f.remove(),this.$itemsContainer.find(".item-progress:not(.clone)").last().after(c.css({height:"auto",marginBottom:e}))}.bind(this),250)}.bind(this),1e3)}}});b.exports=e},{}],7:[function(a,b,c){!function(b,c){function d(a,b){var c,d,e=[],f={},g=b.length;for(c=0;g>c;c++)f[b[c]]=!0;for(g=a.length,c=0;g>c;c++)d=a[c],d in f&&e.push(d);return e}function e(a){a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var b=new RegExp("[\\?&]"+a+"=([^&#]*)"),c=b.exec(location.search);return null===c?"":decodeURIComponent(c[1].replace(/\+/g," "))}function f(a,c,d){var e=a.substr(0,a.indexOf(":"));return d!==e&&-1!==a.indexOf("https")?(b(".ssl-notice").show(),J=!0,a=a.replace("https","http"),void b(".pull-push-connection-info").val(a+"\n"+c)):void(J=!1)}function g(){if("undefined"!=typeof c.common.connection_data&&!1!==c.common.connection_data){var a=wpmdb_migration_type(),d=c.functions.get_tables_to_migrate(null,null);b(".mixed-case-table-name-notice").hide(),null!==d&&(d=d.join(""),d!==d.toLowerCase()&&("1"===c.common.connection_data.lower_case_table_names||"push"!==a&&"savefile"!==a)&&("1"!==wpmdb_data.lower_case_table_names&&"pull"===a||("push"===a||"savefile"===a?b(".mixed-case-table-name-notice.push").show():b(".mixed-case-table-name-notice.pull").show())))}}function h(a){var b=a,c=b.replace(/\/\/(.*)@/,"//").replace("http://","").replace("https://","").replace("www.","");return c}function i(a,b,c){var d=h(b);return"completed"===c?a.replace(/\%s\s?/,"<span class=domain-label>"+d+"</span>&nbsp;"):a.replace(/\%s(\S*)\s?/,"<span class=domain-label>"+d+"$1</span>&nbsp;")}function j(a,c,d){var e="",f="";switch(c){case"push":e=wpmdb_strings.push_migration_label_migrating,f=wpmdb_strings.push_migration_label_completed;break;case"pull":e=wpmdb_strings.pull_migration_label_migrating,f=wpmdb_strings.pull_migration_label_completed;break;case"find_replace":e=wpmdb_strings.find_replace_label_migrating,f=wpmdb_strings.find_replace_label_completed;break;case"savefile":e=wpmdb_strings.exporting_please_wait,f=wpmdb_strings.exporting_complete}var g=e;return"completed"===d&&(g=f),"push"!==c&&"pull"!==c||(g=i(g,a,d)),g=b.wpmdb.apply_filters("wpmdb_get_migration_status_label",g,{intent:c,stage:d})}function k(){b(".option-group").each(function(a){b("input",this).attr("disabled","disabled"),b("label",this).css("cursor","default")})}function l(){b(".option-group").each(function(a){b("input",this).removeAttr("disabled"),b("label",this).css("cursor","pointer")})}function m(a,c,d,e){var f=c;void 0!==e&&(f=e),b(".slider",a).slider("value",parseInt(c)),b(".amount",a).html(wpmdb_add_commas(f)+" "+d)}function n(a){!0===Q?(Q=!1,B=!0,c.current_migration.setState(R,S,"active"),b(".pause-resume").html(wpmdb_strings.pause),c.current_migration.resumeTimer(),c.functions.execute_next_step()):(Q=!0,B=!1,V=wpmdb_strings.migration_paused,R=b(".progress-title").html(),S=b(".progress-text",".progress-wrapper-primary").html(),T=b(".progress-text",".progress-wrapper-secondary ").html(),"find_replace"===t&&(V=wpmdb_strings.find_replace_paused),c.current_migration.setState(V,wpmdb_strings.completing_current_request,null),b("body").off("click",".pause-resume"),b("body").off("click",".cancel"))}function o(a,b){var d=wpmdb_data.this_temp_prefix;return"pull"===wpmdb_migration_type()&&"undefined"!=typeof c.common.connection_data&&"undefined"!=typeof c.common.connection_data.temp_prefix&&(d=c.common.connection_data.temp_prefix),d===b.substring(0,d.length)?!0:a}function p(a,c){return b(".table-select-wrap .table-prefix").text()}function q(a){!0===a?(b('.replace-row.pin .replace-right-col input[type="text"]').attr("readonly","readonly"),b(".replace-row.pin .arrow-col").addClass("disabled")):(b('.replace-row.pin .replace-right-col input[type="text"]').removeAttr("readonly"),b(".replace-row.pin .arrow-col").removeClass("disabled"))}function r(a){c.common.previous_connection_data=c.common.connection_data,c.common.connection_data=a,b.wpmdb.do_action("wpmdb_connection_data_updated",a)}function s(a){var b={};return b.unit="MB",b.amount=(a/1024).toFixed(2),b}var t,u,v,w,x,y,z=!1,A="",B=!1,C=!1,D=!1,E=!1,F=!1,G=!1,H=!1,I=!1,J=!1,K=!1,L=!1,M=!1,N="",O="",P=[],Q=!1,R="",S="",T="",U="",V="",W=!1,X=!1,Y=0,Z=400,$=!1,_=!1,aa=c.functions.get_spinner_url(),ba='<img src="'+aa+'" alt="" class="ajax-spinner general-spinner" />';c.migration_progress_controller=a("MigrationProgress-controller"),c.current_migration=null,c.migration_selection=wpmdb_migration_type(),window.onbeforeunload=function(a){return"import"!==wpmdb_migration_type()||b(".step-two").is(":visible")||c.functions.remove_localStorage_form_data(),M?(a=a||window.event,a&&(a.returnValue=wpmdb_strings.sure),wpmdb_strings.sure):void 0},c.functions.maybe_show_prefix_notice=function(a){a!==wpmdb_data.this_prefix&&(b(".remote-prefix").html(a),I=!0,b(".prefix-notice").show())},c.functions.maybe_show_select_table_notice=function(){if(b("#migrate-selected").is(":checked")&&null===b("#select-tables").val()){if("import"!==wpmdb_migration_type())return alert(wpmdb_strings.please_select_one_table),!0;if(b("#import-find-replace").is(":checked")&&b("#select-tables").is(":visible"))return alert(wpmdb_strings.please_select_one_table_import),!0}return"savefile"!==wpmdb_migration_type()&&b("#backup-manual-select").is(":checked")&&null===b("#select-backup").val()?(alert(wpmdb_strings.please_select_one_table_backup),!0):!1},c.functions.remove_protocol=function(a){return a.replace(/^https?:/i,"")},c.functions.create_table_select=function(a,c,d){var e=document.createElement("select");return b(e).attr({multiple:"multiple",name:"select_tables[]",id:"select-tables","class":"multiselect"}),0<a.length&&b.each(a,function(a,f){if(!b.wpmdb.apply_filters("wpmdb_exclude_table",!1,f)){var g=" ";void 0!==d&&null!==d&&0<d.length&&-1!==b.inArray(f,d)&&(g=' selected="selected" ');var h="";0!==c.length&&(h=" ("+c[f]+")"),b(e).append("<option"+g+'value="'+f+'">'+f+h+"</option>")}}),e},b.wpmdb.add_filter("wpmdb_exclude_table",o),c.functions.get_tables_to_migrate=function(a,d){var e=[],f=wpmdb_migration_type(),g=b("input[name=table_migrate_option]:checked").val();return"migrate_select"===g?e=b("#select-tables").val():"pull"!==f&&"undefined"!=typeof wpmdb_data.this_prefixed_tables?e=wpmdb_data.this_prefixed_tables:"pull"===f&&"undefined"!=typeof c.common.connection_data&&"undefined"!=typeof c.common.connection_data.prefixed_tables&&(e=c.common.connection_data.prefixed_tables),e},b(document).ready(function(){function a(a){var c=!C;H=!0,b.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_check_licence",licence:a,context:"all",nonce:wpmdb_data.nonces.check_licence},error:function(a,b,c){alert(wpmdb_strings.license_check_problem)},success:function(a){var d,e,f,g=b(".support-content"),h=b(".addons-content"),i=b(".licence-status:not(.notification-message)");if("undefined"!=typeof a.dbrains_api_down)e=a.dbrains_api_down+a.message,f=a.dbrains_api_down;else if("undefined"!=typeof a.errors){if("undefined"!=typeof a.errors.subscription_expired)d=a.errors.subscription_expired.licence,e=a.errors.subscription_expired.support,f=a.errors.subscription_expired.addons;else{var j="";for(var k in a.errors)j+=a.errors[k];e=j,f=j}"undefined"!=typeof a.addon_content&&(f+="\n"+a.addon_content)}else e=a.message,f=a.addon_content;c&&i.stop().fadeOut(Z,function(){"undefined"==typeof d&&(b(this).css({visibility:"hidden",display:"block"}).slideUp(),d=""),b(this).empty().html(d).stop().fadeIn(Z)}),g.stop().fadeOut(Z,function(){b(this).empty().html(e).stop().fadeIn(Z)}),h.stop().fadeOut(Z,function(){b(this).empty().html(f).stop().fadeIn(Z)}),b("#plugin-compatibility").is(":not(:checked)")&&b("#compatibility-header").click()}})}function i(){void 0!==wpmdb_data&&void 0!==wpmdb_data.this_tables&&void 0!==wpmdb_data.this_table_sizes_hr&&(va=c.functions.create_table_select(wpmdb_data.this_tables,wpmdb_data.this_table_sizes_hr,b(va).val())),void 0!==c.common.connection_data&&void 0!==c.common.connection_data.tables&&void 0!==c.common.connection_data.table_sizes_hr&&(wa=c.functions.create_table_select(c.common.connection_data.tables,c.common.connection_data.table_sizes_hr,b(wa).val()))}function o(){b("#select-tables").remove(),b(".select-tables-wrap").prepend(va),b("#select-tables").change()}function R(){b("#select-tables").remove(),b(".select-tables-wrap").prepend(wa),b("#select-tables").change()}function S(){b("#migrate-selected").parents(".option-section").children(".header-expand-collapse").children(".expand-collapse-arrow").removeClass("collapsed"),b(".table-select-wrap").show(),b("#migrate-only-with-prefix").prop("checked",!1),b("#migrate-selected").prop("checked",!0),b(".table-migrate-options").hide(),b(".select-tables-wrap").show()}function T(){b(".table-migrate-options").show()}function V(){b("#select-tables").children("option").prop("selected",!0),b("#select-tables").change()}function ca(a,b){return c.functions.remove_protocol(wpmdb_data.this_url)}function da(){var a=wpmdb_migration_type(),d=b.trim(b(".pull-push-connection-info").val()).split("\n");if("undefined"!=typeof wpmdb_default_profile&&!0!==wpmdb_default_profile&&"savefile"!==a&&"find_replace"!==a&&"import"!==a&&!B&&wpmdb_data.is_pro){B=!0,k(),b(".connection-status").html(wpmdb_strings.establishing_remote_connection),b(".connection-status").removeClass("notification-message error-notice migration-error"),b(".connection-status").append(ba);var e=wpmdb_migration_type();b.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_verify_connection_to_remote_site",url:d[0],key:d[1],intent:e,nonce:wpmdb_data.nonces.verify_connection_to_remote_site,convert_post_type_selection:wpmdb_convert_post_type_selection,profile:wpmdb_data.profile},error:function(a,c,d){b(".connection-status").html(la(a.responseText,"(#102)",a)),b(".connection-status").addClass("notification-message error-notice migration-error"),b(".ajax-spinner").remove(),B=!1,l()},success:function(a){if(b(".ajax-spinner").remove(),B=!1,l(),"undefined"!=typeof a.wpmdb_error&&1===a.wpmdb_error)return b(".connection-status").html(a.body),b(".connection-status").addClass("notification-message error-notice migration-error"),void(a.body.indexOf("401 Unauthorized")>-1&&b(".basic-access-auth-wrapper").show());f(d[0],d[1],a.scheme),c.functions.maybe_show_prefix_notice(a.prefix),b(".pull-push-connection-info").addClass("temp-disabled"),b(".pull-push-connection-info").attr("readonly","readonly"),b(".connect-button").hide(),b(".connection-status").hide(),b(".step-two").show(),z=!0,r(a),ia(),g();var e="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_tables&&(e=wpmdb_loaded_tables),wa=c.functions.create_table_select(c.common.connection_data.tables,c.common.connection_data.table_sizes_hr,e);var h="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_post_types&&("undefined"!=typeof a.select_post_types?(b("#exclude-post-types").attr("checked","checked"),b(".post-type-select-wrap").show(),h=a.select_post_types):h=wpmdb_loaded_post_types);var i=document.createElement("select");b(i).attr({multiple:"multiple",name:"select_post_types[]",id:"select-post-types","class":"multiselect"}),b.each(c.common.connection_data.post_types,function(a,c){var d=b.inArray(c,h);d=-1!==d||!0===wpmdb_convert_exclude_revisions&&"revision"!==c?' selected="selected" ':" ",b(i).append("<option"+d+'value="'+c+'">'+c+"</option>")}),ya=i;var j="";!1===wpmdb_default_profile&&"undefined"!=typeof wpmdb_loaded_tables_backup&&(j=wpmdb_loaded_tables_backup);var k=document.createElement("select");b(k).attr({multiple:"multiple",name:"select_backup[]",id:"select-backup","class":"multiselect"}),b.each(c.common.connection_data.tables,function(a,d){var e=b.inArray(d,j);e=-1!==e?' selected="selected" ':" ",b(k).append("<option"+e+'value="'+d+'">'+d+" ("+c.common.connection_data.table_sizes_hr[d]+")</option>")}),za=k,"pull"===wpmdb_migration_type()?(b.wpmdb.do_action("wpmdb_update_pull_table_select"),b("#select-post-types").remove(),b(".exclude-post-types-warning").after(ya),b("#select-backup").remove(),b(".backup-tables-wrap").prepend(Aa),b(".table-prefix").html(a.prefix),b(".uploads-dir").html(wpmdb_data.this_uploads_dir)):(b("#select-backup").remove(),b(".backup-tables-wrap").prepend(za)),b.wpmdb.do_action("verify_connection_to_remote_site",c.common.connection_data)}})}}function ea(c,d){b(".licence-input, .register-licence").remove(),b(".licence-not-entered").prepend(c.masked_licence),b(".support-content").empty().html("<p>"+wpmdb_strings.fetching_license+'<img src="'+aa+'" alt="" class="ajax-spinner general-spinner" /></p>'),a(d),b(".migrate-selection label").removeClass("disabled"),b(".migrate-selection input").removeAttr("disabled")}function fa(){b.ajax({url:ajaxurl,
2
+ type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_get_log",nonce:wpmdb_data.nonces.get_log},error:function(a,b,c){alert(wpmdb_strings.update_log_problem)},success:function(a){b(".debug-log-textarea").val(a)}})}function ga(){b("#overlay").removeClass("show").addClass("hide"),b("#overlay > div").removeClass("show").addClass("hide"),c.current_migration.$proVersion.find("iframe").remove(),setTimeout(function(){b("#overlay").remove()},500),L=!1}function ha(){var a;if(b(".save-settings-button").blur(),!E&&!0!==c.functions.maybe_show_select_table_notice()){var d=!1;b("#create_new").is(":checked")&&(d=!0);var e=b(".create-new-profile").val();E=!0,a=b(b("#migrate-form")[0].elements).not(".auth-credentials").serialize(),b(".save-settings-button").attr("disabled","disabled").after('<img src="'+aa+'" alt="" class="save-profile-ajax-spinner general-spinner" />'),B=!0,b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_profile",profile:a,nonce:wpmdb_data.nonces.save_profile},error:function(a,c,d){B=!1,alert(wpmdb_strings.save_profile_problem),b(".save-settings-button").removeAttr("disabled"),b(".save-profile-ajax-spinner").remove(),b(".save-settings-button").after('<span class="ajax-success-msg">'+wpmdb_strings.saved+"</span>"),b(".ajax-success-msg").fadeOut(2e3,function(){b(this).remove()}),E=!1},success:function(a){var c=parseInt(b("#migrate-form input[name=save_migration_profile_option]:checked").val(),10)+1;if(B=!1,b(".save-settings-button").removeAttr("disabled"),b(".save-profile-ajax-spinner").remove(),b(".save-settings-button").after('<span class="ajax-success-msg">'+wpmdb_strings.saved+"</span>"),b(".ajax-success-msg").fadeOut(2e3,function(){b(this).remove()}),E=!1,b(".create-new-profile").val(""),d){var f=parseInt(a,10),g=f+1,h=b('<li><span class="delete-profile" data-profile-id="'+g+'"></span><label for="profile-'+g+'"><input id="profile-'+g+'" value="'+f+'" name="save_migration_profile_option" type="radio"></label></li>');h.find("label").append(document.createTextNode(" "+e)),c=g,b("#create_new").parents("li").before(h),b("#profile-"+g).attr("checked","checked")}var i=window.location.href.replace("#migrate","").replace(/&wpmdb-profile=-?\d+/,"")+"&wpmdb-profile="+c,j=b("#migrate-form input[name=save_migration_profile_option]:checked").parent().text().trim();if("function"==typeof window.history.pushState){if(b("#migrate-form .crumbs").length)b("#migrate-form .crumbs .crumb:last").text(j);else{var k=b('<div class="crumbs" />').append('<a class="crumb" href="'+wpmdb_data.this_plugin_base+'"> Saved Profiles </a>').append('<span class="crumb">'+j+"</span>");b("#migrate-form").prepend(k)}window.history.pushState({updated_profile_id:c},null,i)}}})}}function ia(){b(".connection-status").hide(),b(".prefix-notice").hide(),b(".ssl-notice").hide(),b(".different-plugin-version-notice").hide(),b(".step-two").show(),b(".backup-options").show(),b(".keep-active-plugins").show(),b(".directory-permission-notice").hide(),b("#create-backup").removeAttr("disabled"),b("#create-backup-label").removeClass("disabled"),b(".backup-option-disabled").hide(),b(".compatibility-older-mysql").hide();var a,d=b.trim(b(".pull-push-connection-info").val()).split("\n");if(wpmdb_toggle_migration_action_text(),b.wpmdb.do_action("move_connection_info_box",{migration_type:wpmdb_migration_type(),last_migration_type:A}),b(".migrate-tab").attr("class","migrate-tab content-tab").addClass(wpmdb_migration_type()),"pull"===wpmdb_migration_type()){if(b(".pull-list li").append(Ba),Ba.show(function(){var a=b(this).find(".pull-push-connection-info");a.val()||a.focus()}),("push"===c.migration_selection||"savefile"===c.migration_selection)&&2===d.length)return c.force_reconnect=!0,b(".pull-list li").append(Ba),b(".pull-push-connection-info").removeClass("temp-disabled").attr("readonly","readonly"),b(".connect-button").hide(),void c.functions.connection_box_changed();z?(b(".connection-status").hide(),b(".step-two").show(),b(".table-prefix").html(c.common.connection_data.prefix),b(".backup-table-prefix").html(wpmdb_data.site_details.prefix),b(".uploads-dir").html(wpmdb_data.this_uploads_dir),!1===G&&(a=h(c.common.connection_data.url),b(".create-new-profile").val(a)),!0===I&&b(".prefix-notice").show(),!0===J&&b(".ssl-notice").show(),!0===K&&(b(".different-plugin-version-notice").show(),b(".step-two").hide()),wpmdb_toggle_migration_action_text(),"false"===wpmdb_data.write_permission&&ja(wpmdb_data.this_upload_dir_long)):(b(".connection-status").show(),b(".step-two").hide())}else if("push"===wpmdb_migration_type()){if(b(".push-list li").append(Ba),Ba.show(function(){var a=b(this).find(".pull-push-connection-info");a.val()||a.focus()}),("pull"===c.migration_selection||"savefile"===c.migration_selection)&&2===d.length)return c.force_reconnect=!0,b(".push-list li").append(Ba),b(".pull-push-connection-info").removeClass("temp-disabled").attr("readonly","readonly"),b(".connect-button").hide(),void c.functions.connection_box_changed();z?(b(".connection-status").hide(),b(".step-two").show(),b(".table-prefix").html(wpmdb_data.this_prefix),b(".backup-table-prefix").html(c.common.connection_data.prefix),b(".uploads-dir").html(c.common.connection_data.uploads_dir),!1===G&&(a=h(c.common.connection_data.url),b(".create-new-profile").val(a)),!0===I&&b(".prefix-notice").show(),!0===J&&b(".ssl-notice").show(),!0===K&&(b(".different-plugin-version-notice").show(),b(".step-two").hide()),wpmdb_toggle_migration_action_text(),"0"===c.common.connection_data.write_permissions&&ja(c.common.connection_data.upload_dir_long)):(b(".connection-status").show(),b(".step-two").hide())}else if(-1!==b.inArray(wpmdb_migration_type(),["savefile","find_replace","import"])&&(b(".connection-status").hide(),b(".table-prefix").html(wpmdb_data.this_prefix),!1===G&&b(".create-new-profile").val(""),"import"!==wpmdb_migration_type()?(b(".step-two").show(),b.wpmdb.do_action("wpmdb_update_push_table_select")):b.wpmdb.do_action("wpmdb_update_import_table_select"),"savefile"===wpmdb_migration_type()&&(b(".backup-options").hide(),b(".compatibility-older-mysql").show()),b(".keep-active-plugins").hide(),!1===wpmdb_data.write_permission&&(b(".directory-permission-notice").show(),b(".step-two").hide()),"find_replace"===wpmdb_migration_type()||"import"===wpmdb_migration_type())){if("true"===wpmdb_data.is_multisite){var e=b(".old-replace-col").eq(1);e.parent().removeClass("pin").find(".replace-remove-row").show(),e.find("input").removeAttr("readonly")}"false"===wpmdb_data.write_permission&&ja(wpmdb_data.this_upload_dir_long)}g()}function ja(a){b("#create-backup").prop("checked",!1),b("#create-backup").attr("disabled","disabled"),b("#create-backup-label").addClass("disabled"),b(".backup-option-disabled").show(),b(".upload-directory-location").html(a)}function ka(){var a=null,d=null;null!==c.common.previous_connection_data&&"object"==typeof c.common.previous_connection_data&&c.common.previous_connection_data.url!==c.common.connection_data.url&&(a=c.functions.remove_protocol(c.common.previous_connection_data.url),d=c.common.previous_connection_data.path),"push"===wpmdb_migration_type()||"savefile"===wpmdb_migration_type()?("pull"===A?b(".replace-row").each(function(){var a=b(".old-replace-col input",this).val();b(".old-replace-col input",this).val(b(".replace-right-col input",this).val()),b(".replace-right-col input",this).val(a)}):"push"===A&&"push"===wpmdb_migration_type()&&null!==a&&null!==d&&b(".replace-row").each(function(){var e=b(".replace-right-col input",this).val();e===d&&b(".replace-right-col input",this).val(c.common.connection_data.path),e===a&&b(".replace-right-col input",this).val(c.functions.remove_protocol(c.common.connection_data.url))}),b.wpmdb.do_action("wpmdb_update_push_table_select"),b("#select-post-types").remove(),b(".exclude-post-types-warning").after(xa),c.functions.exclude_post_types_warning(),b("#select-backup").remove(),b(".backup-tables-wrap").prepend(za)):"pull"===wpmdb_migration_type()&&(""===A||"push"===A||"savefile"===A?b(".replace-row").each(function(){var a=b(".old-replace-col input",this).val();b(".old-replace-col input",this).val(b(".replace-right-col input",this).val()),b(".replace-right-col input",this).val(a)}):"pull"===A&&"pull"===wpmdb_migration_type()&&null!==a&&null!==d&&b(".replace-row").each(function(){var e=b(".old-replace-col input",this).val();e===d&&b(".old-replace-col input",this).val(c.common.connection_data.path),e===a&&b(".old-replace-col input",this).val(c.functions.remove_protocol(c.common.connection_data.url))}),b.wpmdb.do_action("wpmdb_update_pull_table_select"),b("#select-post-types").remove(),b(".exclude-post-types-warning").after(ya),c.functions.exclude_post_types_warning(),b("#select-backup").remove(),b(".backup-tables-wrap").prepend(Aa)),A=wpmdb_migration_type()}function la(a,b,c){return wpmdbGetAjaxErrors(wpmdb_strings.connection_local_server_problem,b,a,c)}function ma(a){return/^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)){0})(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)}function na(c,d){b(".nav-tab").removeClass("nav-tab-active"),b(".nav-tab."+c).addClass("nav-tab-active"),b(".content-tab").hide(),b("."+c+"-tab").show(),"settings"===c&&!0===oa()&&(b("p.licence-status").append("Checking License... ").append(ba),a()),"help"===c&&(fa(),!0===oa()&&(b(".support-content p").append(ba),a())),"addons"===c&&!0!==d&&!0===oa()&&(b(".addons-content p").append(ba),a())}function oa(){return!1===H&&"1"===wpmdb_data.has_licence&&"true"===wpmdb_data.is_pro}function pa(a){W=!0,U=wpmdb_strings.cancelling_migration,b(".migration-controls").css({visibility:"hidden"}),"find_replace"===t&&(U=wpmdb_strings.cancelling_find_replace),c.current_migration.setState(U,wpmdb_strings.completing_current_request,"cancelling"),!0===Q&&(Q=!1,c.functions.execute_next_step())}function qa(a){var c=b("#"+a),d=c.find("input[type=checkbox]");c.toggleClass("on").find("span").toggleClass("checked");var e=c.find("span.on").hasClass("checked");d.attr("checked",e).trigger("change")}c.migration_state_id="",b("#plugin-compatibility").change(function(a){var c="1",d=b(this).closest("td").next("td").find(".setting-status");b(this).is(":checked")||(c="0"),b(".plugin-compatibility-wrap").toggle(),d.find(".ajax-success-msg").remove(),d.append(ba),b("#plugin-compatibility").attr("disabled","disabled"),b(".plugin-compatibility").addClass("disabled"),b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_plugin_compatibility",install:c,nonce:wpmdb_data.nonces.plugin_compatibility},error:function(a,c,d){alert(wpmdb_strings.plugin_compatibility_settings_problem+"\r\n\r\n"+wpmdb_strings.status+" "+a.status+" "+a.statusText+"\r\n\r\n"+wpmdb_strings.response+"\r\n"+a.responseText),b(".ajax-spinner").remove(),b("#plugin-compatibility").removeAttr("disabled"),b(".plugin-compatibility").removeClass("disabled")},success:function(a){""!==b.trim(a)?alert(a):(d.append('<span class="ajax-success-msg">'+wpmdb_strings.saved+"</span>"),b(".ajax-success-msg").fadeOut(2e3,function(){b(this).remove()})),b(".ajax-spinner").remove(),b("#plugin-compatibility").removeAttr("disabled"),b(".plugin-compatibility").removeClass("disabled")}})}),b("#plugin-compatibility").is(":checked")&&b(".plugin-compatibility-wrap").show(),(0<=navigator.userAgent.indexOf("MSIE")||0<=navigator.userAgent.indexOf("Trident"))&&b(".ie-warning").show(),0===wpmdb_data.valid_licence&&b("#savefile").prop("checked",!0);var ra=b(".max-request-size"),sa=b(".slider",ra);sa.slider({range:"min",value:parseInt(wpmdb_data.max_request/1024),min:512,max:parseInt(wpmdb_data.bottleneck/1024),step:256,create:function(a,b){var c=s(wpmdb_data.max_request/1024);m(ra,wpmdb_data.max_request/1024,c.unit,c.amount)},slide:function(a,b){var c=s(b.value);m(ra,b.value,c.unit,c.amount)},stop:function(a,c){b(".slider-success-msg").remove(),b(".amount",ra).after('<img src="'+aa+'" alt="" class="slider-spinner general-spinner" />'),sa.slider("disable"),b.ajax({url:ajaxurl,type:"POST",cache:!1,data:{action:"wpmdb_update_max_request_size",max_request_size:parseInt(c.value),nonce:wpmdb_data.nonces.update_max_request_size},error:function(a,c,d){sa.slider("enable"),b(".slider-spinner",ra).remove(),alert(wpmdb_strings.max_request_size_problem);var e=s(wpmdb_data.max_request/1024);m(ra,wpmdb_data.max_request/1024,e.unit,e.amount),sa.slider("enable")},success:function(){sa.slider("enable"),b(".slider-label-wrapper",ra).append('<span class="slider-success-msg">'+wpmdb_strings.saved+"</span>"),b(".slider-success-msg",ra).fadeOut(2e3,function(){b(this).remove()}),b(".slider-spinner",ra).remove()}})}});var ta=b(".delay-between-requests"),ua=b(".slider",ta);ua.slider({range:"min",value:parseInt(wpmdb_data.delay_between_requests/1e3),min:0,max:10,step:1,create:function(a,b){m(ta,wpmdb_data.delay_between_requests/1e3,"s")},slide:function(a,b){m(ta,b.value,"s")},stop:function(a,c){b(".slider-success-msg").remove(),b(".amount",ta).after('<img src="'+aa+'" alt="" class="slider-spinner general-spinner" />'),ua.slider("disable"),b.ajax({url:ajaxurl,type:"POST",cache:!1,data:{action:"wpmdb_update_delay_between_requests",delay_between_requests:parseInt(1e3*c.value),nonce:wpmdb_data.nonces.update_delay_between_requests},error:function(a,c,d){ua.slider("enable"),b(".slider-spinner",ta).remove(),alert(wpmdb_strings.delay_between_requests_problem),m(ta,wpmdb_data.delay_between_requests/1e3,"s"),ua.slider("enable")},success:function(){wpmdb_data.delay_between_requests=parseInt(1e3*c.value),ua.slider("enable"),b(".slider-label-wrapper",ta).append('<span class="slider-success-msg">'+wpmdb_strings.saved+"</span>"),b(".slider-success-msg",ta).fadeOut(2e3,function(){b(this).remove()}),b(".slider-spinner",ta).remove()}})}});var va=b("#select-tables").clone(),wa=b("#select-tables").clone(),xa=b("#select-post-types").clone(),ya=b("#select-post-types").clone(),za=b("#select-backup").clone(),Aa=b("#select-backup").clone();b(".help-tab .video").each(function(){var a=b(this),c=b(".video-viewer");b("a",this).click(function(d){d.preventDefault(),c.attr("src","//www.youtube.com/embed/"+a.data("video-id")+"?autoplay=1"),c.show();var e=c.offset();b(window).scrollTop(e.top-50)})}),b(".backup-options").show(),b(".keep-active-plugins").show(),"savefile"===wpmdb_migration_type()&&(b(".backup-options").hide(),b(".keep-active-plugins").hide()),A=wpmdb_migration_type(),b(".content-tab").on("click",".check-my-licence-again",function(c){c.preventDefault(),H=!1,b(c.target).replaceWith("Checking... "+ba),a(null,"all")}),b.wpmdb.add_action("wpmdb_refresh_table_selects",i),b.wpmdb.add_action("wpmdb_update_push_table_select",o),b.wpmdb.add_action("wpmdb_update_pull_table_select",R),b.wpmdb.add_action("wpmdb_disable_table_migration_options",S),b.wpmdb.add_action("wpmdb_enable_table_migration_options",T),b.wpmdb.add_action("wpmdb_select_all_tables",V),b.wpmdb.add_filter("wpmdb_base_old_url",ca),da(),b("body").on("click",".js-action-link",function(a){a.preventDefault(),b(this).blur()}),b(".licence-input").keypress(function(a){13===a.which&&(a.preventDefault(),b(".register-licence").click())}),b("body").on("click",".register-licence",function(a){if(a.preventDefault(),!C){var c=b.trim(b(".licence-input").val()),d=b(".licence-status");if(d.removeClass("notification-message error-notice success-notice"),""===c)return void d.html('<div class="notification-message error-notice">'+wpmdb_strings.enter_license_key+"</div>");d.empty().removeClass("success"),C=!0,b(".button.register-licence").after('<img src="'+aa+'" alt="" class="register-licence-ajax-spinner general-spinner" />'),b.ajax({url:ajaxurl,type:"POST",dataType:"JSON",cache:!1,data:{action:"wpmdb_activate_licence",licence_key:c,nonce:wpmdb_data.nonces.activate_licence,context:"licence"},error:function(a,c,e){C=!1,b(".register-licence-ajax-spinner").remove(),d.html(wpmdb_strings.register_license_problem)},success:function(a){if(b(".register-licence-ajax-spinner").remove(),"undefined"!=typeof a.errors){var e="";for(var f in a.errors)e+=a.errors[f];d.html(e),"undefined"!=typeof a.masked_licence&&(ea(a,c),b(".migrate-tab .invalid-licence").hide())}else"undefined"!=typeof a.wpmdb_error&&"undefined"!=typeof a.body?d.html(a.body):(1===Number(a.is_first_activation)&&(wpmdb_strings.welcome_text=wpmdb_strings.welcome_text.replace("%1$s","https://deliciousbrains.com/wp-migrate-db-pro/doc/quick-start-guide/?utm_campaign=support%2Bdocs&utm_source=MDB%2BPaid&utm_medium=insideplugin"),wpmdb_strings.welcome_text=wpmdb_strings.welcome_text.replace("%2$s","https://deliciousbrains.com/wp-migrate-db-pro/videos/?utm_campaign=support%2Bdocs&utm_source=MDB%2BPaid&utm_medium=insideplugin"),d.after('<div id="welcome-wrap"><img id="welcome-img" src="'+wpmdb_data.this_plugin_url+'asset/dist/img/welcome.jpg" /><div class="welcome-text"><h3>'+wpmdb_strings.welcome_title+"</h3><p>"+wpmdb_strings.welcome_text+"</p></div></div>")),d.html(wpmdb_strings.license_registered).delay(5e3).fadeOut(1e3,function(){b(this).css({visibility:"hidden",display:"block"}).slideUp()}),d.addClass("success notification-message success-notice"),ea(a,c),b(".invalid-licence").hide());C=!1}})}}),b(".clear-log").click(function(){b(".ajax-spinner, .ajax-success-msg").remove(),b(this).after(ba),b(".debug-log-textarea").val(""),b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_clear_log",nonce:wpmdb_data.nonces.clear_log},error:function(a,c,d){b(".ajax-spinner").remove(),alert(wpmdb_strings.clear_log_problem)},success:function(a){b(".ajax-spinner, .ajax-success-msg").remove(),fa(),b(".clear-log").after('<span class="ajax-success-msg">'+wpmdb_strings.clear_error_log+"</span>"),b(".ajax-success-msg").fadeOut(2e3,function(){b(this).remove()})}})}),b(".multiselect-select-all").click(function(){var a=b(this).parents(".select-wrap").children(".multiselect");b("option",a).prop("selected",1),b(a).focus().trigger("change")}),b(".multiselect-deselect-all").click(function(){var a=b(this).parents(".select-wrap").children(".multiselect");b("option",a).removeAttr("selected"),b(a).focus().trigger("change")}),b(".multiselect-invert-selection").click(function(){var a=b(this).parents(".select-wrap").children(".multiselect");b("option",a).each(function(){b(this).attr("selected",!b(this).attr("selected"))}),b(a).focus().trigger("change")}),b(".option-group input[type=radio]").change(function(){var a=b(this).closest(".option-group");b("ul",a).hide();var c=b(this).closest("li");b("ul",c).show()}),b(".option-group").each(function(){b(".option-group input[type=radio]").each(function(){if(b(this).is(":checked")){var a=b(this).closest("li");b("ul",a).show()}})}),b(".header-expand-collapse").click(function(){var a=null;void 0!==b(this).data("next")&&(a=b(this).data("next")),b(".expand-collapse-arrow",this).hasClass("collapsed")?(b(".expand-collapse-arrow",this).removeClass("collapsed"),a?b(a).show():b(this).next().show()):(b(".expand-collapse-arrow",this).addClass("collapsed"),a?b(a).hide():b(this).next().hide())}),b(".checkbox-label input[type=checkbox]").change(function(){b(this).is(":checked")?b(this).parent().next().show():b(this).parent().next().hide()}),b(".select-post-types-wrap").on("change","#select-post-types",function(){c.functions.exclude_post_types_warning()}),c.functions.exclude_post_types_warning=function(){var a=b("#select-post-types").val(),c="",d=b(".exclude-post-types-warning");a?(c="<code>"+a.join("</code>, <code>")+"</code>",b(".excluded-post-types").html(c),"0"===d.css("opacity")&&d.css({opacity:0}).slideDown(200).animate({opacity:1})):d.css({opacity:0}).slideUp(200).animate({opacity:0})},b("#exclude-post-types").is(":checked")&&b("#select-post-types").val()&&b(".exclude-post-types-warning").css({display:"block",opacity:1}),b("#save-migration-profile").change(function(){c.functions.update_migrate_button_text(),b(this).is(":checked")?b(".save-settings-button").show():b(".save-settings-button").hide()}),b("#save-migration-profile").is(":checked")&&b(".save-settings-button").show(),b(".create-new-profile").focus(function(){b("#create_new").prop("checked",!0)}),b(".checkbox-label input[type=checkbox]").each(function(){b(this).is(":checked")&&b(this).parent().next().show()}),b(".migrate-db-button").click(function(a){if(b(this).blur(),a.preventDefault(),c.migration_state_id="",!1!==b.wpmdb.apply_filters("wpmdb_migration_profile_ready",!0)&&!0!==c.functions.maybe_show_select_table_notice()){var e=!1,f=!1;if(b("#new-url").length&&!b("#new-url").val()&&(b("#new-url-missing-warning").show(),b("#new-url").focus(),b("html,body").scrollTop(0),e=!0),b("#new-path").length&&!b("#new-path").val()&&(b("#new-path-missing-warning").show(),!1===e&&(b("#new-path").focus(),b("html,body").scrollTop(0)),f=!0),!0===e||!0===f){if("import"!==wpmdb_migration_type())return;if(b("#import-find-replace").is(":checked"))return}b("#save-migration-profile").is(":checked")&&ha(),w=b(b("#migrate-form")[0].elements).not(".auth-credentials").serialize(),t=wpmdb_migration_type(),x="backup","savefile"===t&&(x="migrate"),!1===b("#create-backup").is(":checked")&&(x=-1!==b.inArray(t,["savefile","push","pull"])?"migrate":"import"===t?"upload":t),c.current_migration=c.migration_progress_controller.newMigration({localTableSizes:wpmdb_data.this_table_sizes,localTableRows:wpmdb_data.this_table_rows,remoteTableSizes:"undefined"!=typeof c.common.connection_data?c.common.connection_data.table_sizes:null,remoteTableRows:"undefined"!=typeof c.common.connection_data?c.common.connection_data.table_rows:null,migrationIntent:wpmdb_migration_type()});var g=b("input[name=backup_option]:checked").val(),h=b("input[name=table_migrate_option]:checked").val(),i="",k="";"backup"===x&&("migrate_only_with_prefix"===h&&"backup_selected"===g&&"import"!==t&&(g="backup_only_with_prefix"),"push"===t?(k="remote","backup_only_with_prefix"===g?P=c.common.connection_data.prefixed_tables:"backup_selected"===g?(i=b("#select-tables").val(),i=b.wpmdb.apply_filters("wpmdb_backup_selected_tables",i),P=d(i,c.common.connection_data.tables)):"backup_manual_select"===g&&(P=b("#select-backup").val())):(k="local","backup_only_with_prefix"===g?P=wpmdb_data.this_prefixed_tables:"backup_selected"===g?(i=b("#select-tables").val(),i=b.wpmdb.apply_filters("wpmdb_backup_selected_tables",i),P=d(i,wpmdb_data.this_tables)):"backup_manual_select"===g&&(P=b("#select-backup").val())),c.current_migration.model.addStage("backup",P,k,{strings:{migrated:wpmdb_strings.backed_up}})),k="pull"===t?"remote":"local","find_replace"===t?c.current_migration.model.addStage("find_replace",c.functions.get_tables_to_migrate(null,null),k,{strings:{migrated:wpmdb_strings.searched,stage_title:wpmdb_strings.migrate_button_find_replace}}):-1!==b.inArray(t,["savefile","push","pull"])&&c.current_migration.model.addStage("migrate",c.functions.get_tables_to_migrate(null,null),k),b.wpmdb.do_action("wpmdb_add_migration_stages",{data_type:k,tables_to_migrate:c.functions.get_tables_to_migrate(null,null)});var l=(b("input[name=table_migrate_option]:checked").val(),b.trim(b(".pull-push-connection-info").val()).split("\n"));u=l[0],v=l[1];var m=j(u,t,"migrating");y=j(u,t,"completed"),-1!==b.inArray(x,["find_replace","backup","migrate"])&&(P=c.current_migration.model.getStageItems(x,"name")),c.current_migration.model.setActiveStage(x),c.current_migration.setTitle(m),c.current_migration.startTimer(),M=!0,c.current_migration.setStatus("active");var n={action:"wpmdb_initiate_migration",intent:t,url:u,key:v,form_data:w,stage:x,nonce:wpmdb_data.nonces.initiate_migration};n.site_details={local:wpmdb_data.site_details},-1!==b.inArray(t,["push","pull"])&&(n.temp_prefix=c.common.connection_data.temp_prefix,n.site_details.remote=c.common.connection_data.site_details),n.site_details=JSON.stringify(n.site_details),n=b.wpmdb.apply_filters("wpmdb_initiate_migration_request_data",n,n),B=!0,b.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:n,error:function(a,b,d){c.current_migration.setState(wpmdb_strings.migration_failed,la(a.responseText,"(#112)",a),"error"),console.log(a),console.log(b),console.log(d),B=!1,c.common.migration_error=!0,c.functions.migration_complete_events()},success:function(a){if(B=!1,"undefined"!=typeof a&&"undefined"!=typeof a.wpmdb_error&&1===a.wpmdb_error)return c.common.migration_error=!0,c.functions.migration_complete_events(),void c.current_migration.setState(wpmdb_strings.migration_failed,a.body,"error");c.migration_state_id=a.migration_state_id;var d=0;Y=0,("savefile"!==t&&"undefined"!=typeof c.common.connection_data&&"undefined"!=typeof c.common.connection_data.delay_between_requests||"import"===t)&&(Y="import"===t?wpmdb_data.delay_between_requests:Math.max(parseInt(wpmdb_data.delay_between_requests),parseInt(c.common.connection_data.delay_between_requests))),c.functions.migrate_table_recursive=function(a,e){if(d>=P.length)if("upload"===x&&c.current_migration.model.getStageItems("find_replace").length)x="find_replace",P=c.current_migration.model.getStageItems("find_replace","name"),P=P.map(function(a){return"_mig_"+a}),d=0;else{if("backup"!==x)return b(".progress-label").removeClass("label-visible"),c.common.hooks=b.wpmdb.apply_filters("wpmdb_before_migration_complete_hooks",c.common.hooks),c.common.hooks.push(c.functions.migration_complete),c.common.hooks.push(c.functions.wpmdb_flush),c.common.hooks=b.wpmdb.apply_filters("wpmdb_after_migration_complete_hooks",c.common.hooks),c.common.hooks.push(c.functions.migration_complete_events),c.common.next_step_in_migration={fn:wpmdb_call_next_hook},void c.functions.execute_next_step();if(x=-1!==b.inArray(t,["push","pull"])?"migrate":"import"===t?"upload":t,c.current_migration.model.setActiveStage(x),"find_replace"!==x&&"migrate"!==x)return void wpmdb_call_next_hook();d=0,P=c.functions.get_tables_to_migrate(null,null)}var f=0;d===P.length-1&&(f=1);var g=0;-1!==b.inArray(t,["push","pull"])&&1===parseInt(c.common.connection_data.gzip)&&(g=1);var h={action:"wpmdb_migrate_table",migration_state_id:c.migration_state_id,table:P[d],stage:x,current_row:a,last_table:f,primary_keys:e,gzip:g,nonce:wpmdb_data.nonces.migrate_table};-1!==b.inArray(t,["push","pull"])&&(h.bottleneck=c.common.connection_data.bottleneck,h.prefix=c.common.connection_data.prefix),c.common.connection_data&&c.common.connection_data.path_current_site&&c.common.connection_data.domain&&(h.path_current_site=c.common.connection_data.path_current_site,h.domain_current_site=c.common.connection_data.domain),B=!0,b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,timeout:0,data:h,error:function(a,b,e){var f=wpmdb_strings.table_process_problem+" "+P[d]+"<br /><br />"+wpmdb_strings.status+": "+a.status+" "+a.statusText+"<br /><br />"+wpmdb_strings.response+":<br />"+a.responseText;c.current_migration.setState(wpmdb_strings.migration_failed,f,"error"),B=!1,console.log(a),console.log(b),console.log(e),c.common.migration_error=!0,c.functions.migration_complete_events()},success:function(a){B=!1,a=b.trim(a);var e=wpmdb_parse_json(a),g="";if(!1===e||null===e)return g=""===a||null===a?wpmdb_strings.table_process_problem_empty_response+" "+P[d]:la(a,null,null),c.current_migration.setState(wpmdb_strings.migration_failed,g,"error"),c.common.migration_error=!0,void c.functions.migration_complete_events();if("undefined"!=typeof e.wpmdb_error&&1===e.wpmdb_error)return c.current_migration.setState(wpmdb_strings.migration_failed,e.body,"error"),c.common.migration_error=!0,void c.functions.migration_complete_events();var h=P[d];"import"===t&&"find_replace"===x&&(h=h.replace(wpmdb_data.this_temp_prefix,"")),c.current_migration.setText(),c.current_migration.model.getStageModel(x).setItemRowsTransferred(h,e.current_row),1===f&&"savefile"===t&&("undefined"!=typeof e.dump_filename&&(N=e.dump_filename),"undefined"!=typeof e.dump_path&&(O=e.dump_path)),-1===parseInt(e.current_row)&&(d++,e.current_row="",e.primary_keys=""),c.common.next_step_in_migration={fn:c.functions.migrate_table_recursive,args:[e.current_row,e.primary_keys]},c.functions.execute_next_step()}})},-1!==b.inArray(t,["savefile","push","pull","find_replace"])&&(c.common.next_step_in_migration={fn:c.functions.migrate_table_recursive,args:["-1",""]},c.functions.execute_next_step()),b.wpmdb.do_action("wpmdb_migration_initiated",x)}})}}),c.functions.migration_complete_events=function(){if(!1===c.common.migration_error)if(""===c.common.non_fatal_errors)if("savefile"!==t&&!0===b("#save_computer").is(":checked")&&c.current_migration.setText(),y+='&nbsp;<div class="dashicons dashicons-yes"></div>',!0===W){var a=wpmdb_strings.migration_cancelled_success;"find_replace"===t&&(a=wpmdb_strings.find_replace_cancelled_success),c.current_migration.setState(y,a,"cancelled")}else c.current_migration.setState(y,"","complete");else c.current_migration.setState(wpmdb_strings.completed_with_some_errors,c.common.non_fatal_errors,"error");b(".migration-controls").addClass("hidden"),c.common.hooks=[],c.common.call_stack=[],c.common.migration_error=!1,M=!1,L=!0,Q=!1,W=!1,B=!1,c.common.non_fatal_errors="",P=[],b(".progress-label").remove(),b(".migration-progress-ajax-spinner").remove(),b(".close-progress-content").show(),b("#overlay").css("cursor","pointer"),c.current_migration.model.setMigrationComplete()},c.functions.migration_complete=function(){if(b(".migration-controls").addClass("hidden"),"savefile"===t){M=!1;var a=wpmdb_strings.migration_complete;if(b("#save_computer").is(":checked")){var d=wpmdb_data.this_download_url+encodeURIComponent(N);b("#gzip_file").is(":checked")&&(d+="&gzip=1"),window.location=d}else a=wpmdb_strings.completed_dump_located_at+" "+O;!1===c.common.migration_error&&(c.functions.migration_complete_events(),c.current_migration.setState(y,a,"complete"))}else{c.current_migration.setState(null,wpmdb_strings.finalizing_migration,"finalizing");var e={action:"wpmdb_finalize_migration",migration_state_id:c.migration_state_id,tables:P.join(","),nonce:wpmdb_data.nonces.finalize_migration};-1!==b.inArray(t,["push","pull"])&&(e.prefix=c.common.connection_data.prefix),B=!0,b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:e,error:function(a,b,d){B=!1,c.current_migration.setState(wpmdb_strings.migration_failed,wpmdb_strings.finalize_tables_problem,"error"),alert(a+" : "+b+" : "+d),c.common.migration_error=!0,c.functions.migration_complete_events()},success:function(a){return B=!1,"1"!==b.trim(a)?(c.current_migration.setState(wpmdb_strings.migration_failed,a,"error"),c.common.migration_error=!0,void c.functions.migration_complete_events()):(c.common.next_step_in_migration={fn:wpmdb_call_next_hook},void c.functions.execute_next_step())}})}},c.functions.wpmdb_flush=function(){"savefile"!==t&&(c.current_migration.setText(wpmdb_strings.flushing),B=!0,b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,
3
+ data:{action:"wpmdb_flush",migration_state_id:c.migration_state_id,nonce:wpmdb_data.nonces.flush},error:function(a,b,d){B=!1,c.current_migration.setState(wpmdb_strings.migration_failed,wpmdb_strings.flush_problem,"error"),alert(a+" : "+b+" : "+d),c.common.migration_error=!0,c.functions.migration_complete_events()},success:function(a){return B=!1,"1"!==b.trim(a)?(c.current_migration.setState(wpmdb_strings.migration_failed,a,"error"),c.common.migration_error=!0,void c.functions.migration_complete_events()):(c.common.next_step_in_migration={fn:wpmdb_call_next_hook},void c.functions.execute_next_step())}}))},c.functions.update_migrate_button_text=function(){var a=wpmdb_migration_type(),c=b("#save-migration-profile").is(":checked")?"_save":"",d="migrate_button_"+("savefile"===a?"export":a)+c;b(".migrate-db .button-primary").val(wpmdb_strings[d])},c.functions.update_migrate_button_text(),b("body").on("click",".close-progress-content-button",function(a){ga(),c.current_migration.restoreTitleElem(),c.functions.maybe_reload_page()}),b("body").on("click","#overlay",function(a){!0===L&&a.target===this&&(ga(),c.current_migration.restoreTitleElem(),c.functions.maybe_reload_page())}),b(".save-settings-button").click(function(a){return a.preventDefault(),""===b.trim(b(".create-new-profile").val())&&b("#create_new").is(":checked")?(alert(wpmdb_strings.enter_name_for_profile),void b(".create-new-profile").focus()):void ha()});var Ba=b(".connection-info-wrapper");ia(),b(".migrate-selection.option-group input[type=radio]").change(function(){ia(),c.migration_selection=wpmdb_migration_type(),z&&ka(),c.functions.update_migrate_button_text()}),"pull"!==wpmdb_migration_type()&&"push"!==wpmdb_migration_type()||z||(b(".step-two").hide(),b(".connection-status").show()),b(".general-helper").click(function(a){a.preventDefault();var c=b(this),d=b(this).next();b(".helper-message").not(d).hide();var e=c.position();if(d.hasClass("bottom")){var f=1;!0===d.hasClass("compatibility-help")?f=6:b(this).is(":first-child")&&(f=3),d.css({left:e.left-d.width()/2-f+"px",top:e.top+c.height()+9+"px"})}else d.css({left:e.left+c.width()+9+"px",top:e.top+c.height()/2-18+"px"});d.toggle(),a.stopPropagation()}),b("body").click(function(){b(".helper-message").hide()}),b(".helper-message").click(function(a){a.stopPropagation()}),b("body").on("click",".show-errors-toggle",function(a){a.preventDefault(),b(this).next(".migration-php-errors").toggle()}),b(".nav-tab").click(function(){var a=b(this).attr("data-div-name");a=a.replace("-tab",""),window.location.hash=a,na(a,!1)}),b("body").on("click",'a[href^="#"]',function(a){var c=b(a.target).attr("href"),d=c.substr(1);if(d){var e=b("."+d);1===e.length&&(e.trigger("click"),a.preventDefault())}}),b("body").on("click",".add-row",function(){var a=b(this).parents("tr");a.before(b(".original-repeatable-field").clone().removeClass("original-repeatable-field")),a.prev().find(".old-replace-col input").focus()}),b("body").on("click",".replace-remove-row",function(){b(this).parents("tr").remove(),2>=b(".replace-row").length&&b(".no-replaces-message").show();var a=b(this).prev().attr("id");"new-url"!==a&&"new-path"!==a||b("#"+a+"-missing-warning").hide()}),b("body").on("change","#new-url",function(){b("#new-url-missing-warning").hide()}).on("change","#new-path",function(){b("#new-path-missing-warning").hide()}),b("body").on("click",".arrow-col",function(){var a=this;if(!b(a).hasClass("disabled")){var c=b(a).prev("td").find("input").val(),d=b(a).next("td").find("input");d.val(c),"new-url"===d.prop("id")?b("#new-url-missing-warning").hide():"new-path"===d.prop("id")&&b("#new-path-missing-warning").hide()}}),b(".add-replace").click(function(){b(".replace-fields").prepend(b(".original-repeatable-field").clone().removeClass("original-repeatable-field")),b(".no-replaces-message").hide()}),b("#find-and-replace-sort tbody").sortable({items:"> tr:not(.pin)",handle:"td:first",start:function(){b(".sort-handle").css("cursor","-webkit-grabbing"),b(".sort-handle").css("cursor","-moz-grabbing")},stop:function(){b(".sort-handle").css("cursor","-webkit-grab"),b(".sort-handle").css("cursor","-moz-grab")}});var Ca="";window.location.hash&&(Ca=window.location.hash.substring(1),na(Ca,!1)),""!==e("install-plugin")&&(Ca="addons",H=!0,na(Ca,!0)),b(".notice-link").click(function(a){a.preventDefault(),c.functions.ajax_handle_dismissible_notice(wpmdb_data.nonces.process_notice_link,function(a){b(a).closest(".inline-message").hide()},b(this))}),b("#connection_info").on("copy",function(a){var c=b(this),d=c.val().split("\n");if(2===d.length)try{a.originalEvent.clipboardData.setData("text/plain",d.join(" ")),a.preventDefault()}catch(e){}}),b(".reset-api-key").click(function(){var a=confirm(wpmdb_strings.reset_api_key);a&&!D&&(D=!0,b(".reset-api-key").after('<img src="'+aa+'" alt="" class="reset-api-key-ajax-spinner general-spinner" />'),b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_reset_api_key",nonce:wpmdb_data.nonces.reset_api_key},error:function(a,c,d){alert(wpmdb_strings.reset_api_key_problem),b(".reset-api-key-ajax-spinner").remove(),D=!1},success:function(a){b(".reset-api-key-ajax-spinner").remove(),D=!1,b(".connection-info").html(a),wpmdb_data.connection_info=b.trim(a).split("\n")}}))}),b(".copy-api-key").click(function(){var a=b(this),c=b("#connection_info"),d=c.val(),e=d.replace("\n"," ");c.val(e),c.select();try{document.execCommand("copy"),c.blur(),a.css("color","transparent");var f=b(".copy-api-key-confirmation").show();setTimeout(function(){f.fadeOut("fast"),setTimeout(function(){a.css("color","")},200)},1e3)}catch(g){alert("please press Ctrl/Cmd+C to copy")}c.val(d)}),b("input[name=table_migrate_option]").change(function(){b(".select-tables-wrap").hide(),"migrate_select"===b(this).val()&&b(".select-tables-wrap").show()}),b(".show-multiselect").each(function(){b(this).is(":checked")&&(b(this).parents(".option-section").children(".header-expand-collapse").children(".expand-collapse-arrow").removeClass("collapsed"),b(this).parents(".expandable-content").show(),b(this).parents(".expandable-content").children(".select-wrap").toggle())}),b("input[name=backup_option]").change(function(){b(".backup-tables-wrap").hide(),"backup_manual_select"===b(this).val()&&b(".backup-tables-wrap").show()}),b("#backup-manual-select").is(":checked")&&b(".backup-tables-wrap").show(),b(".plugin-compatibility-save").click(function(){if(!F){b(this).addClass("disabled");var a=b("#selected-plugins");b(a).attr("disabled","disabled"),b(".plugin-compatibility-success-msg").remove(),F=!0,b(this).after('<img src="'+aa+'" alt="" class="plugin-compatibility-spinner general-spinner" />'),b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_whitelist_plugins",whitelist_plugins:b(a).val(),nonce:wpmdb_data.nonces.whitelist_plugins},error:function(c,d,e){alert(wpmdb_strings.blacklist_problem+"\r\n\r\n"+wpmdb_strings.status+" "+c.status+" "+c.statusText+"\r\n\r\n"+wpmdb_strings.response+"\r\n"+c.responseText),b(a).removeAttr("disabled"),b(".plugin-compatibility-save").removeClass("disabled"),F=!1,b(".plugin-compatibility-spinner").remove()},success:function(c){""!==b.trim(c)&&alert(c),b(a).removeAttr("disabled"),b(".plugin-compatibility-save").removeClass("disabled"),F=!1,b(".plugin-compatibility-spinner").remove(),b(".plugin-compatibility-save").after('<span class="plugin-compatibility-success-msg">'+wpmdb_strings.saved+"</span>"),b(".plugin-compatibility-success-msg").fadeOut(2e3)}})}}),b("body").on("click",".delete-profile",function(){var a=b(this).next().clone();b("input",a).remove(),a=b.trim(b(a).html());var c=confirm(wpmdb_strings.remove_profile.replace("{{profile}}",a));if(c){var d=b(this).parent();if(d.find("input:checked").length){var e=d.siblings().last();if(e.find("input[type=radio]").prop("checked","checked"),e.find("input[type=text]").focus(),b("#migrate-form .crumbs .crumb:last").text("New Profile"),"function"==typeof window.history.pushState){var f=window.location.href.replace("#migrate","").replace(/&wpmdb-profile=-?\d+/,"")+"&wpmdb-profile=-1";window.history.pushState({updated_profile_id:-1},null,f)}}d.fadeOut(500),b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_delete_migration_profile",profile_id:b(this).attr("data-profile-id"),nonce:wpmdb_data.nonces.delete_migration_profile},error:function(a,b,c){alert(wpmdb_strings.remove_profile_problem)},success:function(a){"-1"===a&&alert(wpmdb_strings.remove_profile_not_found)}})}}),b(".main-list-delete-profile-link").click(function(){var a=b(this).prev().html(),c=confirm(wpmdb_strings.remove_profile.replace("{{profile}}",a));c&&(b(this).parent().fadeOut(500),b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_delete_migration_profile",profile_id:b(this).attr("data-profile-id"),nonce:wpmdb_data.nonces.delete_migration_profile},error:function(a,b,c){alert(wpmdb_strings.remove_profile_problem)}}))}),b("body").on("click",".temp-disabled",function(){var a=confirm(wpmdb_strings.change_connection_info);a&&(b(".ssl-notice").hide(),b(".different-plugin-version-notice").hide(),b(".migrate-db-button").show(),b(".temp-disabled").removeAttr("readonly"),b(".temp-disabled").removeClass("temp-disabled"),b(".connect-button").show(),b(".step-two").hide(),b(".connection-status").show().html(wpmdb_strings.enter_connection_info),z=!1)}),b(".settings-tab input[type=checkbox]").change(function(){if("plugin-compatibility"!==b(this).attr("id")){var a=b(this).is(":checked"),c=b(this).attr("id"),d=b(this).closest("td").next("td").find(".setting-status");b(".ajax-success-msg").remove(),d.after(ba),b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:{action:"wpmdb_save_setting",checked:a,setting:c,nonce:wpmdb_data.nonces.save_setting},error:function(a,c,d){alert(wpmdb_strings.save_settings_problem),b(".ajax-spinner").remove()},success:function(a){b(".ajax-spinner").remove(),d.append('<span class="ajax-success-msg">'+wpmdb_strings.saved+"</span>"),b(".ajax-success-msg").fadeOut(2e3,function(){b(this).remove()})}})}}),b(".migrate-form").submit(function(a){a.preventDefault()}),b(".connect-button").click(function(a){a.preventDefault(),b(this).blur(),c.functions.connection_box_changed()}),b(".pull-push-connection-info").bind("paste",function(a){setTimeout(function(){c.functions.connection_box_changed()},0)}),b("body").on("click",".try-again",function(){b(".pull-push-connection-info").removeClass("temp-disabled"),c.functions.connection_box_changed()}),b("body").on("click",".try-http",function(){var a=b.trim(b(".pull-push-connection-info").val()).split("\n"),d=a[0].replace("https","http"),e=d+"\n"+a[1];b(".pull-push-connection-info").val(e),c.functions.connection_box_changed()}),b(".create-new-profile").change(function(){G=!0}),b("body").on("click",".temporarily-disable-ssl",function(){var a="";window.location.hash&&(a=window.location.hash.substring(1)),b(this).attr("href",b(this).attr("href")+"&hash="+a)}),c.functions.connection_box_changed=function(){var a=b(".pull-push-connection-info");if(-1!==b.inArray(wpmdb_migration_type(),["push","pull"])&&(!B&&!b(a).hasClass("temp-disabled")||!1!==c.force_reconnect)){c.force_reconnect=!1;var d=b(".pull-push-connection-info").val(),e=b.trim(d).split("\n"),j=!1,m="";if(""===e&&(j=!0,m=wpmdb_strings.connection_info_missing),1===e.length&&!j){var n=b.trim(d).split(" ");2===n.length&&(e=n)}2===e.length||j||(j=!0,m=wpmdb_strings.connection_info_incorrect),j||ma(e[0])||(j=!0,m=wpmdb_strings.connection_info_url_invalid);var o=0;if("undefined"!=typeof e[1]&&(o=e[1].length),j||32===o||40===o||(j=!0,m=wpmdb_strings.connection_info_key_invalid),j||e[0]!==wpmdb_data.connection_info[0]||(j=!0,m=wpmdb_strings.connection_info_local_url),j||e[1]!==wpmdb_data.connection_info[1]||(j=!0,m=wpmdb_strings.connection_info_local_key),j)return b(".connection-status").html(m),void b(".connection-status").addClass("notification-message error-notice migration-error");var p=e[0]+"\n"+e[1];1===b.trim(d).split("\n").length&&b(".pull-push-connection-info").val(p),!1===wpmdb_data.openssl_available&&(e[0]=e[0].replace("https://","http://"),p=e[0]+"\n"+e[1],b(".pull-push-connection-info").val(p)),I=!1,B=!0,k(),b(".basic-access-auth-wrapper").is(":visible")&&(e[0]=e[0].replace(/\/\/(.*)@/,"//"),e[0]=e[0].replace("//","//"+encodeURIComponent(b.trim(b(".auth-username").val()))+":"+encodeURIComponent(b.trim(b(".auth-password").val()))+"@"),p=e[0]+"\n"+e[1],b(".pull-push-connection-info").val(p),b(".basic-access-auth-wrapper").hide()),b(".step-two").hide(),b(".ssl-notice").hide(),b(".prefix-notice").hide(),b(".connection-status").show(),b(".connection-status").html(wpmdb_strings.establishing_remote_connection),b(".connection-status").removeClass("notification-message error-notice migration-error"),b(".connection-status").append(ba);var q=wpmdb_migration_type();return G=!1,b.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_verify_connection_to_remote_site",url:e[0],key:e[1],intent:q,nonce:wpmdb_data.nonces.verify_connection_to_remote_site},error:function(a,c,d){b(".connection-status").html(la(a.responseText,"(#100)",a)),b(".connection-status").addClass("notification-message error-notice migration-error"),b(".ajax-spinner").remove(),B=!1,l()},success:function(a){if(b(".ajax-spinner").remove(),B=!1,l(),"undefined"!=typeof a.wpmdb_error&&1===a.wpmdb_error)return b(".connection-status").html(a.body),b(".connection-status").addClass("notification-message error-notice migration-error"),a.body.indexOf("401 Unauthorized")>-1&&b(".basic-access-auth-wrapper").show(),void(b(".pull-push-connection-info").hasClass("temp-disabled")||b(".connect-button").is(":visible")||(b(".pull-push-connection-info").removeAttr("readonly"),b(".connect-button").show()));f(e[0],e[1],a.scheme);var d=h(a.url);b(".create-new-profile").val(d),b(".pull-push-connection-info").addClass("temp-disabled"),b(".pull-push-connection-info").attr("readonly","readonly"),b(".connect-button").hide(),b(".connection-status").hide(),b(".step-two").show(),c.functions.maybe_show_prefix_notice(a.prefix),z=!0,r(a),ia(),ka(),g(),i(),za=b(wa).clone(),b(za).attr({name:"select_backup[]",id:"select-backup"});var j=document.createElement("select");b(j).attr({multiple:"multiple",name:"select_post_types[]",id:"select-post-types","class":"multiselect"}),b.each(c.common.connection_data.post_types,function(a,c){b(j).append('<option value="'+c+'">'+c+"</option>")}),ya=j,b("#new-path-missing-warning, #new-url-missing-warning").hide(),"pull"===wpmdb_migration_type()?(b("#new-url").val(c.functions.remove_protocol(wpmdb_data.this_url)),b("#new-path").val(wpmdb_data.this_path),"true"===wpmdb_data.is_multisite&&(b("#new-domain").val(wpmdb_data.this_domain),b('.replace-row.pin .old-replace-col input[type="text"]').val(c.functions.remove_protocol(a.url))),b("#old-url").val(c.functions.remove_protocol(a.url)),b("#old-path").val(a.path),b.wpmdb.do_action("wpmdb_update_pull_table_select"),b("#select-post-types").remove(),b(".exclude-post-types-warning").after(ya),c.functions.exclude_post_types_warning(),b(".table-prefix").html(a.prefix),b(".backup-table-prefix").html(wpmdb_data.site_details.prefix),b(".uploads-dir").html(wpmdb_data.this_uploads_dir)):(b("#new-url").val(c.functions.remove_protocol(a.url)),b("#new-path").val(a.path),"true"===wpmdb_data.is_multisite&&b('.replace-row.pin .old-replace-col input[type="text"]').val(c.functions.remove_protocol(wpmdb_data.this_url)),b.wpmdb.do_action("wpmdb_update_push_table_select"),b("#select-backup").remove(),b(".backup-tables-wrap").prepend(za)),c.common.next_step_in_migration={fn:b.wpmdb.do_action,args:["verify_connection_to_remote_site",c.common.connection_data]},c.functions.execute_next_step()}})}},b("body").on("click",".pause-resume",function(a){n(a)}),b("body").on("click",".cancel",function(a){pa(a)}),b(".enter-licence").click(function(){b(".settings").click(),b(".licence-input").focus()}),c.functions.execute_next_step=function(){if(Y>0&&!1===X)return void setTimeout(function(){X=!0,c.functions.execute_next_step()},Y);if(X=!1,!0===Q){b(".migration-progress-ajax-spinner").hide(),c.current_migration.pauseTimer();var a="";return!0===_?(a=wpmdb_strings.paused_before_finalize,_=!1,"find_replace"===wpmdb_migration_type()&&(a=wpmdb_strings.find_replace_paused_before_finalize)):a=wpmdb_strings.paused,c.current_migration.setState(null,a,"paused"),b("body").on("click",".pause-resume",function(a){n(a)}),b("body").on("click",".cancel",function(a){pa(a)}),void b(".pause-resume").html(wpmdb_strings.resume)}if(!0===W){t=wpmdb_migration_type();var d;"savefile"===t?d=wpmdb_strings.removing_local_sql:"pull"===t?d="backup"===x?wpmdb_strings.removing_local_backup:wpmdb_strings.removing_local_temp_tables:"push"===t&&(d="backup"===x?wpmdb_strings.removing_remote_sql:wpmdb_strings.removing_remote_temp_tables),c.current_migration.setText(d);var e={action:"wpmdb_cancel_migration",migration_state_id:c.migration_state_id,nonce:wpmdb_data.nonces.cancel_migration};B=!0,b.ajax({url:ajaxurl,type:"POST",dataType:"text",cache:!1,data:e,error:function(a,b,d){c.current_migration.setState(wpmdb_strings.migration_cancellation_failed,wpmdb_strings.manually_remove_temp_files+"<br /><br />"+wpmdb_strings.status+": "+a.status+" "+a.statusText+"<br /><br />"+wpmdb_strings.response+":<br />"+a.responseText,"error"),console.log(a),console.log(b),console.log(d),B=!1,c.common.migration_error=!0,c.functions.migration_complete_events()},success:function(a){return B=!1,a=b.trim(a),"push"===t&&"1"!==a||"push"!==t&&""!==a?("undefined"!=typeof a&&"undefined"!=typeof a.wpmdb_error&&1===a.wpmdb_error&&(a=a.wpmdb_error),c.current_migration.setState(wpmdb_strings.migration_cancellation_failed,a,"error"),c.common.migration_error=!0,void c.functions.migration_complete_events()):(y=wpmdb_strings.migration_cancelled,"find_replace"===t&&(y=wpmdb_strings.find_replace_cancelled),c.functions.migration_complete_events(),void c.current_migration.setStatus("cancelled"))}})}else c.common.next_step_in_migration.fn.apply(null,c.common.next_step_in_migration.args)},b("body").on("click",".copy-licence-to-remote-site",function(){b(".connection-status").html(wpmdb_strings.copying_license),b(".connection-status").removeClass("notification-message error-notice migration-error"),b(".connection-status").append(ba);var a=b.trim(b(".pull-push-connection-info").val()).split("\n");B=!0,k(),b.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_copy_licence_to_remote_site",url:a[0],key:a[1],nonce:wpmdb_data.nonces.copy_licence_to_remote_site},error:function(a,c,d){b(".connection-status").html(la(a.responseText,"(#143)",a)),b(".connection-status").addClass("notification-message error-notice migration-error"),b(".ajax-spinner").remove(),B=!1,l()},success:function(a){return b(".ajax-spinner").remove(),B=!1,l(),"undefined"!=typeof a.wpmdb_error&&1===a.wpmdb_error?(b(".connection-status").html(a.body),b(".connection-status").addClass("notification-message error-notice migration-error"),void(a.body.indexOf("401 Unauthorized")>-1&&b(".basic-access-auth-wrapper").show())):void c.functions.connection_box_changed()}})}),b("body").on("click",".reactivate-licence",function(a){B=!0,b(".invalid-licence").empty().html(wpmdb_strings.attempting_to_activate_licence),b(".invalid-licence").append(ba),b.ajax({url:ajaxurl,type:"POST",dataType:"json",cache:!1,data:{action:"wpmdb_reactivate_licence",nonce:wpmdb_data.nonces.reactivate_licence},error:function(a,c,d){b(".invalid-licence").html(wpmdb_strings.activate_licence_problem),b(".invalid-licence").append("<br /><br />"+wpmdb_strings.status+": "+a.status+" "+a.statusText+"<br /><br />"+wpmdb_strings.response+"<br />"+a.responseText),b(".ajax-spinner").remove(),B=!1},success:function(a){return b(".ajax-spinner").remove(),B=!1,"undefined"!=typeof a.wpmdb_error&&1===a.wpmdb_error?void b(".invalid-licence").html(a.body):"undefined"!=typeof a.wpmdb_dbrains_api_down&&1===a.wpmdb_dbrains_api_down?(b(".invalid-licence").html(wpmdb_strings.temporarily_activated_licence),void b(".invalid-licence").append(a.body)):(b(".invalid-licence").empty().html(wpmdb_strings.licence_reactivated),void location.reload())}})}),b("input[name=table_migrate_option]").change(function(){g(),b.wpmdb.do_action("wpmdb_tables_to_migrate_changed")}),b("body").on("change","#select-tables",function(){g(),b.wpmdb.do_action("wpmdb_tables_to_migrate_changed")}),b.wpmdb.add_filter("wpmdb_get_table_prefix",p),b.wpmdb.add_filter("wpmdb_get_tables_to_migrate",c.functions.get_tables_to_migrate),b.wpmdb.add_action("wpmdb_lock_replace_url",q),b.wpmdb.add_action("move_connection_info_box",c.functions.exclude_post_types_warning),b.wpmdb.add_filter("wpmdb_before_migration_complete_hooks",function(a){return $=!!b("input[name=pause_before_finalize]:checked").length,!0===$&&"savefile"!==t&&(n(null),_=!0),a}),b(".wpmdb-switch").on("click",function(a){b(this).hasClass("disabled")||qa(b(this).attr("id"))})})}(jQuery,wpmdb)},{"MigrationProgress-controller":1}]},{},[1,2,3,4,5,6,7]);
class/wpmdb-base.php CHANGED
@@ -19,7 +19,6 @@ class WPMDB_Base {
19
  protected $multipart_boundary = 'bWH4JVmYCnf6GfXacrcc';
20
  protected $attempting_to_connect_to;
21
  protected $error;
22
- protected $temp_prefix = '_mig_';
23
  protected $invalid_content_verification_error;
24
  protected $addons;
25
  protected $doing_cli_migration = false;
@@ -30,7 +29,13 @@ class WPMDB_Base {
30
  protected $state_data;
31
  protected $form_data;
32
  protected $migration_state;
33
- protected $filesystem;
 
 
 
 
 
 
34
 
35
  function __construct( $plugin_file_path ) {
36
  $this->load_settings();
@@ -43,6 +48,9 @@ class WPMDB_Base {
43
  $this->template_dir = $this->plugin_dir_path . 'template' . DIRECTORY_SEPARATOR;
44
  $this->plugin_title = ucwords( str_ireplace( '-', ' ', basename( $plugin_file_path ) ) );
45
  $this->plugin_title = str_ireplace( array( 'db', 'wp', '.php' ), array( 'DB', 'WP', '' ), $this->plugin_title );
 
 
 
46
 
47
  // We need to set $this->plugin_slug here because it was set here
48
  // in Media Files prior to version 1.1.2. If we remove it the customer
@@ -71,6 +79,68 @@ class WPMDB_Base {
71
  add_action( 'admin_init', array( $this, 'init_wpmdb_filesystem' ) );
72
  }
73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  }
75
 
76
  /**
@@ -143,6 +213,23 @@ class WPMDB_Base {
143
  return $this->state_data;
144
  }
145
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  function load_plugin_textdomain() {
147
  load_plugin_textdomain( 'wp-migrate-db', false, dirname( plugin_basename( $this->plugin_file_path ) ) . '/languages/' );
148
  }
@@ -157,19 +244,19 @@ class WPMDB_Base {
157
  $this->addons = array(
158
  'wp-migrate-db-pro-media-files/wp-migrate-db-pro-media-files.php' => array(
159
  'name' => 'Media Files',
160
- 'required_version' => '1.4.7',
161
  ),
162
  'wp-migrate-db-pro-cli/wp-migrate-db-pro-cli.php' => array(
163
  'name' => 'CLI',
164
- 'required_version' => '1.3',
165
  ),
166
  'wp-migrate-db-pro-multisite-tools/wp-migrate-db-pro-multisite-tools.php' => array(
167
  'name' => 'Multisite Tools',
168
- 'required_version' => '1.1.5',
169
  ),
170
  );
171
 
172
- $this->invalid_content_verification_error = __( 'Invalid content verification signature, please verify the connection information on the remote site and try again.', 'wp-migrate-db' );
173
 
174
  $this->transient_timeout = 60 * 60 * 12;
175
  $this->transient_retry_timeout = 60 * 60 * 2;
@@ -223,7 +310,7 @@ class WPMDB_Base {
223
  'profiles' => array(),
224
  'licence' => '',
225
  'verify_ssl' => false,
226
- 'blacklist_plugins' => array(),
227
  'max_request' => min( 1024 * 1024, $this->get_bottleneck( 'max' ) ),
228
  'delay_between_requests' => 0,
229
  'prog_tables_hidden' => true,
@@ -357,17 +444,55 @@ class WPMDB_Base {
357
  remove_filter( 'wpmdb_after_response', array( $this, 'unscramble' ) );
358
  }
359
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
360
  if ( is_wp_error( $response ) ) {
361
  if ( 0 === strpos( $url, 'https://' ) && 'ajax_verify_connection_to_remote_site' == $scope ) {
362
- return $this->retry_remote_post( $url, $data, $scope, $args, $expecting_serial );
363
  } elseif ( isset( $response->errors['http_request_failed'][0] ) && strstr( $response->errors['http_request_failed'][0], 'timed out' ) ) {
364
  $this->error = sprintf( __( 'The connection to the remote server has timed out, no changes have been committed. (#134 - scope: %s)', 'wp-migrate-db' ), $scope );
365
  } elseif ( isset( $response->errors['http_request_failed'][0] ) && ( strstr( $response->errors['http_request_failed'][0], 'Could not resolve host' ) || strstr( $response->errors['http_request_failed'][0], "Couldn't resolve host" ) || strstr( $response->errors['http_request_failed'][0], "couldn't connect to host" ) ) ) {
366
- $this->error = sprintf( __( 'We could not find: %s. Are you sure this is the correct URL?', 'wp-migrate-db' ), $this->state_data['url'] );
367
- $url_bits = $this->parse_url( $this->state_data['url'] );
368
- if ( strstr( $this->state_data['url'], 'dev.' ) || strstr( $this->state_data['url'], '.dev' ) || ! strstr( $url_bits['host'], '.' ) ) {
 
369
  $this->error .= '<br />';
370
- if ( 'pull' == $this->state_data['intent'] ) {
371
  $this->error .= __( 'It appears that you might be trying to pull from a local environment. This will not work if <u>this</u> website happens to be located on a remote server, it would be impossible for this server to contact your local environment.', 'wp-migrate-db' );
372
  } else {
373
  $this->error .= __( 'It appears that you might be trying to push to a local environment. This will not work if <u>this</u> website happens to be located on a remote server, it would be impossible for this server to contact your local environment.', 'wp-migrate-db' );
@@ -378,12 +503,12 @@ class WPMDB_Base {
378
  $url_parts = $this->parse_url( $url );
379
  $host = $url_parts['host'];
380
  if ( ! defined( 'WP_ACCESSIBLE_HOSTS' ) || ( defined( 'WP_ACCESSIBLE_HOSTS' ) && ! in_array( $host, explode( ',', WP_ACCESSIBLE_HOSTS ) ) ) ) {
381
- $this->error = sprintf( __( 'We\'ve detected that <code>WP_HTTP_BLOCK_EXTERNAL</code> is enabled and the host <strong>%1$s</strong> has not been added to <code>WP_ACCESSIBLE_HOSTS</code>. Please disable <code>WP_HTTP_BLOCK_EXTERNAL</code> or add <strong>%1$s</strong> to <code>WP_ACCESSIBLE_HOSTS</code> to continue. <a href="%2$s" target="_blank">More information</a>. (#147 - scope: %3$s)', 'wp-migrate-db' ), esc_attr( $host ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/wp_http_block_external/', $scope );
382
  }
383
  } elseif ( isset( $response->errors['http_request_failed'][0] ) && strstr( $response->errors['http_request_failed'][0], 'port 443: Connection refused' ) ) {
384
  $this->error = sprintf( __( 'Couldn\'t connect over HTTPS. You might want to try regular HTTP instead. (#121 - scope: %s)', 'wp-migrate-db' ), $scope );
385
  } elseif ( isset( $response->errors['http_request_failed'][0] ) && strstr( $response->errors['http_request_failed'][0], 'SSL' ) ) { // OpenSSL/cURL/MAMP Error
386
- $this->error = sprintf( __( '<strong>SSL Connection error:</strong> (#121 - scope: %s) This typically means that the version of SSL that your local site is using to connect to the remote is incompatible or, more likely, being rejected by the remote server because it\'s insecure. <a href="%s" target="_blank">See our documentation</a> for possible solutions.', 'wp-migrate-db' ), $scope, 'https://deliciousbrains.com/wp-migrate-db-pro/doc/ssl-errors/' );
387
  } else {
388
  $this->error = sprintf( __( 'The connection failed, an unexpected error occurred, please contact support. (#121 - scope: %s)', 'wp-migrate-db' ), $scope );
389
  }
@@ -391,60 +516,87 @@ class WPMDB_Base {
391
  $this->log_error( $this->error, $response );
392
 
393
  return false;
 
 
394
  } elseif ( 200 > (int) $response['response']['code'] || 399 < (int) $response['response']['code'] ) {
395
- if ( 401 === (int) $response['response']['code'] ) {
396
- $this->error = __( 'The remote site is protected with Basic Authentication. Please enter the username and password above to continue. (401 Unauthorized)', 'wp-migrate-db' );
397
- $this->log_error( $this->error, $response );
398
 
399
- return false;
400
- } elseif ( 0 === strpos( $url, 'https://' ) && 'ajax_verify_connection_to_remote_site' == $scope ) {
401
- return $this->retry_remote_post( $url, $data, $scope, $args, $expecting_serial );
402
- } else {
403
- $this->error = sprintf( __( 'Unable to connect to the remote server, please check the connection details - %1$s %2$s (#129 - scope: %3$s)', 'wp-migrate-db' ), $response['response']['code'], $response['response']['message'], $scope );
404
- $this->log_error( $this->error, $response );
405
 
406
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
407
  }
 
408
  } elseif ( empty( $response['body'] ) ) {
409
  if ( '0' === $response['body'] && 'ajax_verify_connection_to_remote_site' == $scope ) {
410
  if ( 0 === strpos( $url, 'https://' ) ) {
411
- return $this->retry_remote_post( $url, $data, $scope, $args, $expecting_serial );
412
  } else {
413
  $this->error = sprintf( __( 'WP Migrate DB Pro does not seem to be installed or active on the remote site. (#131 - scope: %s)', 'wp-migrate-db' ), $scope );
414
  }
415
  } else {
416
- $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="https://deliciousbrains.com/wp-migrate-db-pro/doc/a-response-was-expected-from-the-remote/" target="_blank">%1$s</a>', __( 'our documentation', 'wp-migrate-db' ) ) );
 
 
 
417
  }
418
  $this->log_error( $this->error, $response );
419
 
420
  return false;
 
421
  } elseif ( $expecting_serial && false == is_serialized( $response['body'] ) ) {
422
  if ( 0 === strpos( $url, 'https://' ) && 'ajax_verify_connection_to_remote_site' == $scope ) {
423
- return $this->retry_remote_post( $url, $data, $scope, $args, $expecting_serial );
424
  }
425
  $this->error = __( 'There was a problem with the AJAX request, we were expecting a serialized response, instead we received:<br />', 'wp-migrate-db' ) . esc_html( $response['body'] );
426
  $this->log_error( $this->error, $response );
427
 
428
  return false;
429
- } elseif ( $expecting_serial && 'ajax_verify_connection_to_remote_site' == $scope ) {
 
 
430
  $unserialized_response = WPMDB_Utils::unserialize( $response['body'], __METHOD__ );
 
431
  if ( false !== $unserialized_response && isset( $unserialized_response['error'] ) && '1' == $unserialized_response['error'] && 0 === strpos( $url, 'https://' ) ) {
432
- if ( false === strpos( $unserialized_response['message'], '(#122)' ) ) {
433
- return $this->retry_remote_post( $url, $data, $scope, $args, $expecting_serial );
434
- }
435
- }
436
- }
437
 
438
- return trim( $response['body'] );
439
- }
440
 
441
- function retry_remote_post( $url, $data, $scope, $args = array(), $expecting_serial = false ) {
442
- $url = substr_replace( $url, 'http', 0, 5 );
443
- if ( $response = $this->remote_post( $url, $data, $scope, $args, $expecting_serial ) ) {
444
- return $response;
 
 
445
  }
446
 
447
- return false;
448
  }
449
 
450
  function array_to_multipart( $data ) {
@@ -495,7 +647,20 @@ class WPMDB_Base {
495
 
496
  function log_error( $wpmdb_error, $additional_error_var = false ) {
497
  $error_header = "********************************************\n****** Log date: " . date( 'Y/m/d H:i:s' ) . " ******\n********************************************\n\n";
498
- $error = $error_header . 'WPMDB Error: ' . $wpmdb_error . "\n\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
499
 
500
  if ( ! empty( $this->attempting_to_connect_to ) ) {
501
  $error .= 'Attempted to connect to: ' . $this->attempting_to_connect_to . "\n\n";
@@ -599,16 +764,22 @@ class WPMDB_Base {
599
  }
600
 
601
  function get_dbrains_api_url( $request, $args = array() ) {
602
- $url = $this->dbrains_api_url;
603
- $args['request'] = $request;
604
- $args['version'] = $GLOBALS['wpmdb_meta'][ $this->core_slug ]['version'];
605
- $url = add_query_arg( $args, $url );
 
 
 
 
 
 
 
 
606
  if ( false !== get_site_transient( 'wpmdb_temporarily_disable_ssl' ) && 0 === strpos( $this->dbrains_api_url, 'https://' ) ) {
607
  $url = substr_replace( $url, 'http', 0, 5 );
608
  }
609
 
610
- $url .= '&locale=' . urlencode( get_locale() );
611
-
612
  return $url;
613
  }
614
 
@@ -700,6 +871,26 @@ class WPMDB_Base {
700
  return $upload_info[ $type ];
701
  }
702
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
703
  /**
704
  * Main function for communicating with the Delicious Brains API.
705
  *
@@ -744,7 +935,7 @@ class WPMDB_Base {
744
 
745
  $disable_ssl_url = network_admin_url( $this->plugin_base . '&nonce=' . wp_create_nonce( 'wpmdb-disable-ssl' ) . '&wpmdb-disable-ssl=1' );
746
  $connection_failed_message = '<div class="updated warning inline-message">';
747
- $connection_failed_message .= sprintf( __( '<strong>Could not connect to api.deliciousbrains.com</strong> &mdash; You will not receive update notifications or be able to activate your license until this is fixed. This issue is often caused by an improperly configured SSL server (https). We recommend <a href="%1$s" target="_blank">fixing the SSL configuration on your server</a>, but if you need a quick fix you can:%2$s', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/could-not-connect-deliciousbrains-com/', sprintf( '<p><a href="%1$s" class="temporarily-disable-ssl button">%2$s</a></p>', $disable_ssl_url, __( 'Temporarily disable SSL for connections to api.deliciousbrains.com', 'wp-migrate-db' ) ) );
748
  $connection_failed_message .= '</div>';
749
 
750
  if ( defined( 'WP_HTTP_BLOCK_EXTERNAL' ) && WP_HTTP_BLOCK_EXTERNAL ) {
@@ -752,7 +943,7 @@ class WPMDB_Base {
752
  $host = $url_parts['host'];
753
  if ( ! defined( 'WP_ACCESSIBLE_HOSTS' ) || strpos( WP_ACCESSIBLE_HOSTS, $host ) === false ) {
754
  $connection_failed_message = '<div class="updated warning inline-message">';
755
- $connection_failed_message .= sprintf( __( 'We\'ve detected that <code>WP_HTTP_BLOCK_EXTERNAL</code> is enabled and the host <strong>%1$s</strong> has not been added to <code>WP_ACCESSIBLE_HOSTS</code>. Please disable <code>WP_HTTP_BLOCK_EXTERNAL</code> or add <strong>%1$s</strong> to <code>WP_ACCESSIBLE_HOSTS</code> to continue. <a href="%2$s" target="_blank">More information</a>.', 'wp-migrate-db' ), esc_attr( $host ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/wp_http_block_external/' );
756
  $connection_failed_message .= '</div>';
757
  }
758
  }
@@ -833,7 +1024,7 @@ class WPMDB_Base {
833
  $data = @file_get_contents( $response['filename'] );
834
 
835
  if ( ! $data ) {
836
- return new WP_Error( 'wpmdbpro_download_error_empty', sprintf( __( 'Error retrieving download from deliciousbrain.com. Please try again or download manually from <a href="%1$s">%2$s</a>.', 'wp-migrate-db' ), 'https://deliciousbrains.com/my-account/', _x( 'My Account', 'Delicious Brains account', 'wp-migrate-db' ) ) );
837
  }
838
 
839
  $decoded_data = json_decode( $data, true );
@@ -914,8 +1105,8 @@ class WPMDB_Base {
914
  }
915
 
916
  $args = array(
917
- 'licence_key' => $licence_key,
918
- 'site_url' => home_url( '', 'http' ),
919
  );
920
 
921
  $response = $this->dbrains_api_request( 'check_support_access', $args );
@@ -1166,17 +1357,72 @@ class WPMDB_Base {
1166
  return $this->plugin_file_path;
1167
  }
1168
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1169
  /**
1170
  * Returns a formatted message dependant on the status of the licence.
1171
  *
1172
  * @param bool $trans
1173
  * @param string $context
1174
  *
1175
- * @return array|string|void
1176
  */
1177
  function get_licence_status_message( $trans = false, $context = null ) {
1178
  $licence = $this->get_licence_key();
1179
  $api_response_provided = true;
 
 
 
 
 
 
 
1180
 
1181
  if ( empty( $licence ) && ! $trans ) {
1182
  $message = sprintf( __( '<strong>Activate Your License</strong> &mdash; Please <a href="%s" class="%s">enter your license key</a> to enable push and pull functionality, priority support and plugin updates.', 'wp-migrate-db' ), network_admin_url( $this->plugin_base . '#settings' ), 'js-action-link enter-licence' );
@@ -1201,30 +1447,27 @@ class WPMDB_Base {
1201
 
1202
  $errors = $trans['errors'];
1203
 
1204
- $check_licence_again_url = network_admin_url( $this->plugin_base . '&nonce=' . wp_create_nonce( 'wpmdb-check-licence' ) . '&wpmdb-check-licence=1' );
1205
-
1206
  if ( isset( $errors['connection_failed'] ) ) {
1207
- $disable_ssl_url = network_admin_url( $this->plugin_base . '&nonce=' . wp_create_nonce( 'wpmdb-disable-ssl' ) . '&wpmdb-disable-ssl=1' );
1208
- $message = sprintf( __( '<strong>Could not connect to api.deliciousbrains.com</strong> &mdash; You will not receive update notifications or be able to activate your license until this is fixed. This issue is often caused by an improperly configured SSL server (https). We recommend <a href="%1$s" target="_blank">fixing the SSL configuration on your server</a>, but if you need a quick fix you can:%2$s', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/could-not-connect-deliciousbrains-com/', sprintf( '<p><a href="%1$s" class="temporarily-disable-ssl button">%2$s</a></p>', $disable_ssl_url, __( 'Temporarily disable SSL for connections to api.deliciousbrains.com', 'wp-migrate-db' ) ) );
1209
 
1210
  if ( defined( 'WP_HTTP_BLOCK_EXTERNAL' ) && WP_HTTP_BLOCK_EXTERNAL ) {
1211
  $url_parts = $this->parse_url( $this->dbrains_api_base );
1212
  $host = $url_parts['host'];
1213
  if ( ! defined( 'WP_ACCESSIBLE_HOSTS' ) || strpos( WP_ACCESSIBLE_HOSTS, $host ) === false ) {
1214
- $message = sprintf( __( 'We\'ve detected that <code>WP_HTTP_BLOCK_EXTERNAL</code> is enabled and the host <strong>%1$s</strong> has not been added to <code>WP_ACCESSIBLE_HOSTS</code>. Please disable <code>WP_HTTP_BLOCK_EXTERNAL</code> or add <strong>%1$s</strong> to <code>WP_ACCESSIBLE_HOSTS</code> to continue. <a href="%2$s" target="_blank">More information</a>.', 'wp-migrate-db' ), esc_attr( $host ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/wp_http_block_external/' );
1215
  }
1216
  }
1217
 
1218
  // Don't cache the license response so we can try again
1219
  delete_site_transient( 'wpmdb_licence_response' );
1220
  } elseif ( isset( $errors['subscription_cancelled'] ) ) {
1221
- $message = sprintf( __( '<strong>Your License Was Cancelled</strong> &mdash; Please visit <a href="%s" target="_blank">My Account</a> to renew or upgrade your license and enable push and pull.', 'wp-migrate-db' ), 'https://deliciousbrains.com/my-account/' );
1222
- $message .= sprintf( '<br /><a href="%s" class="check-my-licence-again" >%s</a>', $check_licence_again_url, __( 'Check my license again', 'wp-migrate-db' ) );
 
1223
  } elseif ( isset( $errors['subscription_expired'] ) ) {
1224
 
1225
- $message_base = sprintf( '<strong>%s</strong> &mdash; ', __( 'Your License Has Expired', 'wp-migrate-db' ) );
1226
- $message_end = sprintf( __( 'Login to <a href="%s">My Account</a> to renew. ', 'wp-migrate-db' ), 'https://deliciousbrains.com/my-account/' );
1227
- $message_end .= sprintf( ' <a href="%s" class="check-my-licence-again">%s</a>', $check_licence_again_url, __( 'Check my license again', 'wp-migrate-db' ) );
1228
 
1229
  $contextual_messages = array(
1230
  'default' => $message_base . $message_end,
@@ -1244,24 +1487,24 @@ class WPMDB_Base {
1244
  }
1245
 
1246
  } elseif ( isset( $errors['no_activations_left'] ) ) {
1247
- $message = sprintf( __( '<strong>No Activations Left</strong> &mdash; Please visit <a href="%s" target="_blank">My Account</a> to upgrade your license or deactivate a previous activation and enable push and pull.', 'wp-migrate-db' ), 'https://deliciousbrains.com/my-account/' );
1248
- $message .= sprintf( ' <a href="%s" class="check-my-licence-again">%s</a>', $check_licence_again_url, __( 'Check my license again', 'wp-migrate-db' ) );
 
1249
  } elseif ( isset( $errors['licence_not_found'] ) ) {
 
1250
  if ( ! $api_response_provided ) {
1251
- $message = sprintf( __( '<strong>Your License Was Not Found</strong> &mdash; Perhaps you made a typo when defining your WPMDB_LICENCE constant in your wp-config.php? Please visit <a href="%s" target="_blank">My Account</a> to double check your license key.', 'wp-migrate-db' ), 'https://deliciousbrains.com/my-account/' );
1252
- $message .= sprintf( ' <a href="%s" class="check-my-licence-again">%s</a>', $check_licence_again_url, __( 'Check my license again', 'wp-migrate-db' ) );
1253
  } else {
1254
  $error = reset( $errors );
1255
- $message = __( '<strong>Your License Was Not Found</strong> &mdash; ', 'wp-migrate-db' );
1256
- $message .= $error;
1257
  }
 
1258
  } elseif ( isset( $errors['activation_deactivated'] ) ) {
1259
- $message = sprintf( '<strong>%s</strong> &mdash; ', __( 'Your License Is Inactive', 'wp-migrate-db' ) );
1260
- $message .= sprintf( '%s <a href="#" class="js-action-link reactivate-licence">%s</a>', __( 'Your license has been deactivated for this install.', 'wp-migrate-db' ), __( 'Reactivate License', 'wp-migrate-db' ) );
1261
  } else {
1262
  $error = reset( $errors );
1263
- $message = sprintf( __( '<strong>An Unexpected Error Occurred</strong> &mdash; Please contact us at <a href="%1$s">%2$s</a> and quote the following:', 'wp-migrate-db' ), 'mailto:nom@deliciousbrains.com', 'nom@deliciousbrains.com' );
1264
- $message .= sprintf( '<p>%s</p>', $error );
1265
  }
1266
 
1267
  return $message;
@@ -1337,12 +1580,12 @@ class WPMDB_Base {
1337
  $suhosin_post_limit = false;
1338
 
1339
  if ( function_exists( 'ini_get' ) ) {
1340
- $suhosin_request_limit = $this->return_bytes( ini_get( 'suhosin.request.max_value_length' ) );
1341
- $suhosin_post_limit = $this->return_bytes( ini_get( 'suhosin.post.max_value_length' ) );
1342
  }
1343
 
1344
  if ( $suhosin_request_limit && $suhosin_post_limit ) {
1345
- $suhosin_limit = min( $suhosin_request_limit, $suhosin_post_limit );
1346
  }
1347
 
1348
  // we have to account for HTTP headers and other bloating, here we minus 1kb for bloat
@@ -1365,35 +1608,6 @@ class WPMDB_Base {
1365
  return apply_filters( 'wpmdb_bottleneck', $calculated_bottleneck );
1366
  }
1367
 
1368
- function return_bytes( $val ) {
1369
- if ( is_numeric( $val ) ) {
1370
- return $val;
1371
- }
1372
-
1373
- if ( empty( $val ) ) {
1374
- return false;
1375
- }
1376
-
1377
- $val = trim( $val );
1378
- $last = strtolower( $val[ strlen( $val ) - 1 ] );
1379
-
1380
- switch ( $last ) {
1381
- // The 'G' modifier is available since PHP 5.1.0
1382
- case 'g':
1383
- $val *= 1024;
1384
- case 'm':
1385
- $val *= 1024;
1386
- case 'k':
1387
- $val *= 1024;
1388
- break;
1389
- default :
1390
- $val = false;
1391
- break;
1392
- }
1393
-
1394
- return $val;
1395
- }
1396
-
1397
  /**
1398
  * Returns the php ini value for post_max_size in bytes
1399
  *
@@ -1496,13 +1710,13 @@ class WPMDB_Base {
1496
  * Standard notice display check
1497
  * Returns dismiss and reminder links html for templates where necessary
1498
  *
1499
- * @param string $notice The name of the notice e.g. license-key-warning
1500
- * @param bool $dismiss If the notice has a dismiss link
1501
- * @param bool|int $reminder If the notice has a reminder link, this will be the number of seconds
1502
  *
1503
  * @return array|bool
1504
  */
1505
- function check_notice( $notice, $dismiss = false, $reminder = false ) {
1506
  if ( true === apply_filters( 'wpmdb_hide_' . $notice, false ) ) {
1507
  return false;
1508
  }
@@ -1513,7 +1727,11 @@ class WPMDB_Base {
1513
  if ( get_user_meta( $current_user->ID, 'wpmdb_dismiss_' . $notice ) ) {
1514
  return false;
1515
  }
1516
- $notice_links['dismiss'] = '<a href="#" class="notice-link" data-notice="' . $notice . '" data-type="dismiss">' . _x( 'Dismiss', 'dismiss notice permanently', 'wp-migrate-db' ) . '</a>';
 
 
 
 
1517
  }
1518
 
1519
  if ( $reminder ) {
@@ -1522,7 +1740,7 @@ class WPMDB_Base {
1522
  return false;
1523
  }
1524
  }
1525
- $notice_links['reminder'] = '<a href="#" class="notice-link" data-notice="' . $notice . '" data-type="reminder" data-reminder="' . $reminder . '">' . __( 'Remind Me Later', 'wp-migrate-db' ) . '</a>';
1526
  }
1527
 
1528
  return ( count( $notice_links ) > 0 ) ? $notice_links : true;
@@ -1972,15 +2190,16 @@ class WPMDB_Base {
1972
  $uploads = wp_upload_dir();
1973
 
1974
  $site_details = array(
1975
- 'is_multisite' => esc_html( is_multisite() ? 'true' : 'false' ),
1976
- 'site_url' => esc_html( addslashes( site_url() ) ),
1977
- 'home_url' => esc_html( addslashes( home_url() ) ),
1978
- 'prefix' => esc_html( $table_prefix ),
1979
- 'uploads_baseurl' => esc_html( addslashes( trailingslashit( $uploads['baseurl'] ) ) ),
1980
- 'uploads' => $this->uploads_info(),
1981
- 'uploads_dir' => esc_html( addslashes( $this->get_short_uploads_dir() ) ),
1982
- 'subsites' => $this->subsites_list(),
1983
- 'subsites_info' => $this->subsites_info(),
 
1984
  );
1985
 
1986
  return $site_details;
19
  protected $multipart_boundary = 'bWH4JVmYCnf6GfXacrcc';
20
  protected $attempting_to_connect_to;
21
  protected $error;
 
22
  protected $invalid_content_verification_error;
23
  protected $addons;
24
  protected $doing_cli_migration = false;
29
  protected $state_data;
30
  protected $form_data;
31
  protected $migration_state;
32
+ protected $license_response_messages = array();
33
+ protected $gettable_properties = array();
34
+ protected $temp_prefix = '_mig_';
35
+ public $mu_plugin_dir;
36
+ public $mu_plugin_source;
37
+ public $mu_plugin_dest;
38
+ public $filesystem;
39
 
40
  function __construct( $plugin_file_path ) {
41
  $this->load_settings();
48
  $this->template_dir = $this->plugin_dir_path . 'template' . DIRECTORY_SEPARATOR;
49
  $this->plugin_title = ucwords( str_ireplace( '-', ' ', basename( $plugin_file_path ) ) );
50
  $this->plugin_title = str_ireplace( array( 'db', 'wp', '.php' ), array( 'DB', 'WP', '' ), $this->plugin_title );
51
+ $this->mu_plugin_dir = ( defined( 'WPMU_PLUGIN_DIR' ) && defined( 'WPMU_PLUGIN_URL' ) ) ? WPMU_PLUGIN_DIR : trailingslashit( WP_CONTENT_DIR ) . 'mu-plugins';
52
+ $this->mu_plugin_source = trailingslashit( $this->plugin_dir_path ) . 'compatibility/wp-migrate-db-pro-compatibility.php';
53
+ $this->mu_plugin_dest = trailingslashit( $this->mu_plugin_dir ) . 'wp-migrate-db-pro-compatibility.php';
54
 
55
  // We need to set $this->plugin_slug here because it was set here
56
  // in Media Files prior to version 1.1.2. If we remove it the customer
79
  add_action( 'admin_init', array( $this, 'init_wpmdb_filesystem' ) );
80
  }
81
 
82
+ // List of properties that can be accessed by the get() method
83
+ $this->gettable_properties = array(
84
+ 'settings',
85
+ 'plugin_base',
86
+ 'temp_prefix',
87
+ 'plugin_version',
88
+ 'error',
89
+ 'state_data',
90
+ );
91
+
92
+ //Setup strings for license responses
93
+ $this->setup_license_responses();
94
+ }
95
+
96
+ public function setup_license_responses() {
97
+
98
+ $disable_ssl_url = network_admin_url( $this->plugin_base . '&nonce=' . wp_create_nonce( 'wpmdb-disable-ssl' ) . '&wpmdb-disable-ssl=1' );
99
+ $check_licence_again_url = network_admin_url( $this->plugin_base . '&nonce=' . wp_create_nonce( 'wpmdb-check-licence' ) . '&wpmdb-check-licence=1' );
100
+
101
+ // List of potential license responses. Keys must must exist in both arrays, otherwise the default error message will be shown.
102
+ $this->license_response_messages = array(
103
+ 'connection_failed' => array(
104
+ 'ui' => sprintf( __( '<strong>Could not connect to api.deliciousbrains.com</strong> &mdash; You will not receive update notifications or be able to activate your license until this is fixed. This issue is often caused by an improperly configured SSL server (https). We recommend <a href="%1$s" target="_blank">fixing the SSL configuration on your server</a>, but if you need a quick fix you can:%2$s', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/could-not-connect-deliciousbrains-com/?utm_campaign=error%2Bmessages&utm_source=MDB%2BPaid&utm_medium=insideplugin', sprintf( '<p><a href="%1$s" class="temporarily-disable-ssl button">%2$s</a></p>', $disable_ssl_url, __( 'Temporarily disable SSL for connections to api.deliciousbrains.com', 'wp-migrate-db' ) ) ),
105
+ 'cli' => __( 'Could not connect to api.deliciousbrains.com - You will not receive update notifications or be able to activate your license until this is fixed. This issue is often caused by an improperly configured SSL server (https). We recommend fixing the SSL configuration on your server, but if you need a quick fix you can temporarily disable SSL for connections to api.deliciousbrains.com by adding `define( \'DBRAINS_API_BASE\', \'http://api.deliciousbrains.com\' );` to your wp-config.php file.', 'wp-migrate-db' ),
106
+ ),
107
+ 'http_block_external' => array(
108
+ 'ui' => __( 'We\'ve detected that <code>WP_HTTP_BLOCK_EXTERNAL</code> is enabled and the host <strong>%1$s</strong> has not been added to <code>WP_ACCESSIBLE_HOSTS</code>. Please disable <code>WP_HTTP_BLOCK_EXTERNAL</code> or add <strong>%1$s</strong> to <code>WP_ACCESSIBLE_HOSTS</code> to continue. <a href="%2$s" target="_blank">More information</a>.', 'wp-migrate-db' ),
109
+ 'cli' => __( 'We\'ve detected that WP_HTTP_BLOCK_EXTERNAL is enabled and the host %1$s has not been added to WP_ACCESSIBLE_HOSTS. Please disable WP_HTTP_BLOCK_EXTERNAL or add %1$s to WP_ACCESSIBLE_HOSTS to continue.', 'wp-migrate-db' ),
110
+ ),
111
+ 'subscription_cancelled' => array(
112
+ 'ui' => sprintf( __( '<strong>Your License Was Cancelled</strong> &mdash; Please visit <a href="%s" target="_blank">My Account</a> to renew or upgrade your license and enable push and pull. <br /><a href="%s" class="check-my-licence-again" >%s</a>', 'wp-migrate-db' ), 'https://deliciousbrains.com/my-account/?utm_campaign=support%2Bdocs&utm_source=MDB%2BPaid&utm_medium=insideplugin', $check_licence_again_url, __( 'Check my license again', 'wp-migrate-db' ) ),
113
+ 'cli' => sprintf( __( 'Your License Was Cancelled - Please login to your account (%s) to renew or upgrade your license and enable push and pull.', 'wp-migrate-db' ), 'https://deliciousbrains.com/my-account/?utm_campaign=support%2Bdocs&utm_source=MDB%2BPaid&utm_medium=insideplugin' ),
114
+ ),
115
+ 'subscription_expired_base' => array(
116
+ 'ui' => sprintf( '<strong>%s</strong> &mdash; ', __( 'Your License Has Expired', 'wp-migrate-db' ) ),
117
+ 'cli' => sprintf( '%s - ', __( 'Your License Has Expired', 'wp-migrate-db' ) ),
118
+ ),
119
+ 'subscription_expired_end' => array(
120
+ 'ui' => sprintf( __( 'Login to <a href="%s">My Account</a> to renew. <a href="%s" class="check-my-licence-again">%s</a>', 'wp-migrate-db' ), 'https://deliciousbrains.com/my-account/?utm_campaign=support%2Bdocs&utm_source=MDB%2BPaid&utm_medium=insideplugin', $check_licence_again_url, __( 'Check my license again', 'wp-migrate-db' ) ),
121
+ 'cli' => sprintf( __( 'Login to your account to renew (%s)', 'wp-migrate-db' ), 'https://deliciousbrains.com/my-account/' ),
122
+ ),
123
+ 'no_activations_left' => array(
124
+ 'ui' => sprintf( __( '<strong>No Activations Left</strong> &mdash; Please visit <a href="%s" target="_blank">My Account</a> to upgrade your license or deactivate a previous activation and enable push and pull. <a href="%s" class="check-my-licence-again">%s</a>', 'wp-migrate-db' ), 'https://deliciousbrains.com/my-account/?utm_campaign=support%2Bdocs&utm_source=MDB%2BPaid&utm_medium=insideplugin', $check_licence_again_url, __( 'Check my license again', 'wp-migrate-db' ) ),
125
+ 'cli' => sprintf( __( 'No Activations Left - Please visit your account (%s) to upgrade your license or deactivate a previous activation and enable push and pull.', 'wp-migrate-db' ), 'https://deliciousbrains.com/my-account/?utm_campaign=support%2Bdocs&utm_source=MDB%2BPaid&utm_medium=insideplugin' ),
126
+ ),
127
+ 'licence_not_found_api_failed' => array(
128
+ 'ui' => sprintf( __( '<strong>Your License Was Not Found</strong> &mdash; Perhaps you made a typo when defining your WPMDB_LICENCE constant in your wp-config.php? Please visit <a href="%s" target="_blank">My Account</a> to double check your license key. <a href="%s" class="check-my-licence-again">%s</a>', 'wp-migrate-db' ), 'https://deliciousbrains.com/my-account/?utm_campaign=error%2Bmessages&utm_source=MDB%2BPaid&utm_medium=insideplugin', $check_licence_again_url, __( 'Check my license again', 'wp-migrate-db' ) ),
129
+ 'cli' => sprintf( __( 'Your License Was Not Found - Perhaps you made a typo when defining your WPMDB_LICENCE constant in your wp-config.php? Please visit your account (%s) to double check your license key.', 'wp-migrate-db' ), 'https://deliciousbrains.com/my-account/' ),
130
+ ),
131
+ 'licence_not_found_api' => array(
132
+ 'ui' => __( '<strong>Your License Was Not Found</strong> &mdash; %s', 'wp-migrate-db' ),
133
+ 'cli' => __( 'Your License Was Not Found - %s', 'wp-migrate-db' ),
134
+ ),
135
+ 'activation_deactivated' => array(
136
+ 'ui' => sprintf( '<strong>%s</strong> &mdash; %s <a href="#" class="js-action-link reactivate-licence">%s</a>', __( 'Your License Is Inactive', 'wp-migrate-db' ), __( 'Your license has been deactivated for this install.', 'wp-migrate-db' ), __( 'Reactivate your license', 'wp-migrate-db' ), 'https://deliciousbrains.com/my-account' ),
137
+ 'cli' => sprintf( '%s - %s %s at %s', __( 'Your License Is Inactive', 'wp-migrate-db' ), __( 'Your license has been deactivated for this install.', 'wp-migrate-db' ), __( 'Reactivate your license', 'wp-migrate-db' ), 'https://deliciousbrains.com/my-account' ),
138
+ ),
139
+ 'default' => array(
140
+ 'ui' => __( '<strong>An Unexpected Error Occurred</strong> &mdash; Please contact us at <a href="%1$s">%2$s</a> and quote the following: <p>%3$s</p>', 'wp-migrate-db' ),
141
+ 'cli' => __( 'An Unexpected Error Occurred - Please contact us at %2$s and quote the following: %3$s', 'wp-migrate-db' ),
142
+ ),
143
+ );
144
  }
145
 
146
  /**
213
  return $this->state_data;
214
  }
215
 
216
+ /**
217
+ * Utility method to access private and protected properties
218
+ *
219
+ * @param $property
220
+ *
221
+ * @return mixed
222
+ * @throws Exception
223
+ *
224
+ */
225
+ public function get( $property ) {
226
+ if ( ! in_array( $property, $this->gettable_properties ) ) {
227
+ throw new Exception( $property . ' property not gettable' );
228
+ }
229
+
230
+ return $this->{$property};
231
+ }
232
+
233
  function load_plugin_textdomain() {
234
  load_plugin_textdomain( 'wp-migrate-db', false, dirname( plugin_basename( $this->plugin_file_path ) ) . '/languages/' );
235
  }
244
  $this->addons = array(
245
  'wp-migrate-db-pro-media-files/wp-migrate-db-pro-media-files.php' => array(
246
  'name' => 'Media Files',
247
+ 'required_version' => '1.4.8',
248
  ),
249
  'wp-migrate-db-pro-cli/wp-migrate-db-pro-cli.php' => array(
250
  'name' => 'CLI',
251
+ 'required_version' => '1.3.1',
252
  ),
253
  'wp-migrate-db-pro-multisite-tools/wp-migrate-db-pro-multisite-tools.php' => array(
254
  'name' => 'Multisite Tools',
255
+ 'required_version' => '1.1.6',
256
  ),
257
  );
258
 
259
+ $this->invalid_content_verification_error = __( 'Invalid content verification signature, please verify the connection information on the remote site and try again.', 'wp-migrate-db' ) . sprintf( _x( ' Remote URL: %s ', 'Ex. Remote URL: http://wp.dev', 'wp-migrate-db' ), home_url() );
260
 
261
  $this->transient_timeout = 60 * 60 * 12;
262
  $this->transient_retry_timeout = 60 * 60 * 2;
310
  'profiles' => array(),
311
  'licence' => '',
312
  'verify_ssl' => false,
313
+ 'whitelist_plugins' => array(),
314
  'max_request' => min( 1024 * 1024, $this->get_bottleneck( 'max' ) ),
315
  'delay_between_requests' => 0,
316
  'prog_tables_hidden' => true,
444
  remove_filter( 'wpmdb_after_response', array( $this, 'unscramble' ) );
445
  }
446
 
447
+ $response_status = $this->handle_remote_post_response( $response, $url, $scope, $expecting_serial, $this->state_data );
448
+
449
+ if ( false === $response_status ) {
450
+ return false;
451
+ } else if ( true === $response_status ) {
452
+ return $this->retry_remote_post( $url, $data, $scope, $expecting_serial );
453
+ }
454
+
455
+ return trim( $response['body'] );
456
+ }
457
+
458
+ function retry_remote_post( $url, $data, $scope, $args = array(), $expecting_serial = false ) {
459
+ $url = substr_replace( $url, 'http', 0, 5 );
460
+ if ( $response = $this->remote_post( $url, $data, $scope, $args, $expecting_serial ) ) {
461
+ return $response;
462
+ }
463
+
464
+ return false;
465
+ }
466
+
467
+ /**
468
+ *
469
+ *
470
+ * Returns true, false or null
471
+ *
472
+ * False is an error, true triggers retry_remote_post() which tries the request on plain HTTP, and null is a successful response
473
+ *
474
+ * @param $response
475
+ * @param $url
476
+ * @param $scope
477
+ * @param $expecting_serial
478
+ * @param array $state_data
479
+ *
480
+ * @return bool|null
481
+ */
482
+ public function handle_remote_post_response( $response, $url, $scope, $expecting_serial, $state_data = array() ) {
483
+
484
  if ( is_wp_error( $response ) ) {
485
  if ( 0 === strpos( $url, 'https://' ) && 'ajax_verify_connection_to_remote_site' == $scope ) {
486
+ return true;
487
  } elseif ( isset( $response->errors['http_request_failed'][0] ) && strstr( $response->errors['http_request_failed'][0], 'timed out' ) ) {
488
  $this->error = sprintf( __( 'The connection to the remote server has timed out, no changes have been committed. (#134 - scope: %s)', 'wp-migrate-db' ), $scope );
489
  } elseif ( isset( $response->errors['http_request_failed'][0] ) && ( strstr( $response->errors['http_request_failed'][0], 'Could not resolve host' ) || strstr( $response->errors['http_request_failed'][0], "Couldn't resolve host" ) || strstr( $response->errors['http_request_failed'][0], "couldn't connect to host" ) ) ) {
490
+ $this->error = sprintf( __( 'We could not find: %s. Are you sure this is the correct URL?', 'wp-migrate-db' ), $state_data['url'] );
491
+ $url_bits = $this->parse_url( $state_data['url'] );
492
+
493
+ if ( strstr( $state_data['url'], 'dev.' ) || strstr( $state_data['url'], '.dev' ) || ! strstr( $url_bits['host'], '.' ) ) {
494
  $this->error .= '<br />';
495
+ if ( 'pull' == $state_data['intent'] ) {
496
  $this->error .= __( 'It appears that you might be trying to pull from a local environment. This will not work if <u>this</u> website happens to be located on a remote server, it would be impossible for this server to contact your local environment.', 'wp-migrate-db' );
497
  } else {
498
  $this->error .= __( 'It appears that you might be trying to push to a local environment. This will not work if <u>this</u> website happens to be located on a remote server, it would be impossible for this server to contact your local environment.', 'wp-migrate-db' );
503
  $url_parts = $this->parse_url( $url );
504
  $host = $url_parts['host'];
505
  if ( ! defined( 'WP_ACCESSIBLE_HOSTS' ) || ( defined( 'WP_ACCESSIBLE_HOSTS' ) && ! in_array( $host, explode( ',', WP_ACCESSIBLE_HOSTS ) ) ) ) {
506
+ $this->error = sprintf( __( 'We\'ve detected that <code>WP_HTTP_BLOCK_EXTERNAL</code> is enabled and the host <strong>%1$s</strong> has not been added to <code>WP_ACCESSIBLE_HOSTS</code>. Please disable <code>WP_HTTP_BLOCK_EXTERNAL</code> or add <strong>%1$s</strong> to <code>WP_ACCESSIBLE_HOSTS</code> to continue. <a href="%2$s" target="_blank">More information</a>. (#147 - scope: %3$s)', 'wp-migrate-db' ), 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', $scope );
507
  }
508
  } elseif ( isset( $response->errors['http_request_failed'][0] ) && strstr( $response->errors['http_request_failed'][0], 'port 443: Connection refused' ) ) {
509
  $this->error = sprintf( __( 'Couldn\'t connect over HTTPS. You might want to try regular HTTP instead. (#121 - scope: %s)', 'wp-migrate-db' ), $scope );
510
  } elseif ( isset( $response->errors['http_request_failed'][0] ) && strstr( $response->errors['http_request_failed'][0], 'SSL' ) ) { // OpenSSL/cURL/MAMP Error
511
+ $this->error = sprintf( __( '<strong>HTTPS Connection Error:</strong> (#121 - scope: %s) This typically means that the version of OpenSSL that your local site is using to connect to the remote is incompatible or, more likely, being rejected by the remote server because it\'s insecure. <a href="%s" target="_blank">See our documentation</a> for possible solutions.', 'wp-migrate-db' ), $scope, 'https://deliciousbrains.com/wp-migrate-db-pro/doc/ssl-errors/?utm_campaign=error%2Bmessages&utm_source=MDB%2BPaid&utm_medium=insideplugin' );
512
  } else {
513
  $this->error = sprintf( __( 'The connection failed, an unexpected error occurred, please contact support. (#121 - scope: %s)', 'wp-migrate-db' ), $scope );
514
  }
516
  $this->log_error( $this->error, $response );
517
 
518
  return false;
519
+
520
+ //Check response codes and respond accordingly
521
  } elseif ( 200 > (int) $response['response']['code'] || 399 < (int) $response['response']['code'] ) {
 
 
 
522
 
523
+ $return = null;
524
+ switch ( (int) $response['response']['code'] ) {
525
+ case 401:
526
+ $this->error = __( 'The remote site is protected with Basic Authentication. Please enter the username and password above to continue. (401 Unauthorized)', 'wp-migrate-db' );
527
+ $this->log_error( $this->error, $response );
 
528
 
529
+ $return = false;
530
+ break;
531
+
532
+ //Explicitly do no retry http URL if remote returns 500 error
533
+ case 500:
534
+ $this->error = $this->error = sprintf( __( 'Unable to connect to the remote server, the remote server responded with: %1$s %2$s (scope: %3$s)', 'wp-migrate-db' ), $response['response']['code'], $response['response']['message'], $scope );;
535
+ $this->log_error( $this->error, $response );
536
+
537
+ $return = false;
538
+ break;
539
+
540
+ case 0 === strpos( $url, 'https://' ) && 'ajax_verify_connection_to_remote_site' == $scope:
541
+ $return = true;
542
+ break;
543
+
544
+ default:
545
+ //other status codes less than 200 or over 400
546
+ $this->error = sprintf( __( 'Unable to connect to the remote server, please check the connection details - %1$s %2$s (#129 - scope: %3$s)', 'wp-migrate-db' ), $response['response']['code'], $response['response']['message'], $scope );
547
+ $this->log_error( $this->error, $response );
548
+
549
+ $return = false;
550
+ break;
551
+ }
552
+
553
+ if ( ! is_null( $return ) ) {
554
+ return $return;
555
  }
556
+
557
  } elseif ( empty( $response['body'] ) ) {
558
  if ( '0' === $response['body'] && 'ajax_verify_connection_to_remote_site' == $scope ) {
559
  if ( 0 === strpos( $url, 'https://' ) ) {
560
+ return true;
561
  } else {
562
  $this->error = sprintf( __( 'WP Migrate DB Pro does not seem to be installed or active on the remote site. (#131 - scope: %s)', 'wp-migrate-db' ), $scope );
563
  }
564
  } else {
565
+
566
+ $url = urlencode( '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' );
567
+
568
+ $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' ) ) );
569
  }
570
  $this->log_error( $this->error, $response );
571
 
572
  return false;
573
+
574
  } elseif ( $expecting_serial && false == is_serialized( $response['body'] ) ) {
575
  if ( 0 === strpos( $url, 'https://' ) && 'ajax_verify_connection_to_remote_site' == $scope ) {
576
+ return true;
577
  }
578
  $this->error = __( 'There was a problem with the AJAX request, we were expecting a serialized response, instead we received:<br />', 'wp-migrate-db' ) . esc_html( $response['body'] );
579
  $this->log_error( $this->error, $response );
580
 
581
  return false;
582
+
583
+ } elseif ( $expecting_serial && ( 'ajax_verify_connection_to_remote_site' == $scope || 'ajax_copy_licence_to_remote_site' == $scope ) ) {
584
+
585
  $unserialized_response = WPMDB_Utils::unserialize( $response['body'], __METHOD__ );
586
+
587
  if ( false !== $unserialized_response && isset( $unserialized_response['error'] ) && '1' == $unserialized_response['error'] && 0 === strpos( $url, 'https://' ) ) {
 
 
 
 
 
588
 
589
+ if ( stristr( $unserialized_response['message'], 'Invalid content verification signature' ) ) {
 
590
 
591
+ //Check if remote address returned is the same as what was requested. Apache sometimes returns a random HTTPS site.
592
+ if ( false === strpos( $unserialized_response['message'], sprintf( 'Remote URL: %s', $state_data['url'] ) ) ) {
593
+ return true;
594
+ }
595
+ }
596
+ }
597
  }
598
 
599
+ return null;
600
  }
601
 
602
  function array_to_multipart( $data ) {
647
 
648
  function log_error( $wpmdb_error, $additional_error_var = false ) {
649
  $error_header = "********************************************\n****** Log date: " . date( 'Y/m/d H:i:s' ) . " ******\n********************************************\n\n";
650
+ $error = $error_header;
651
+ if ( isset( $this->state_data['intent'] ) ) {
652
+ $error .= 'Intent: ' . $this->state_data['intent'] . "\n";
653
+ }
654
+ if ( isset( $this->state_data['action'] ) ) {
655
+ $error .= 'Action: ' . $this->state_data['action'] . "\n";
656
+ }
657
+ if ( isset( $this->state_data['local'] ) && isset( $this->state_data['local']['site_url'] ) ) {
658
+ $error .= 'Local: ' . $this->state_data['site_details']['local']['site_url'] . "\n";
659
+ }
660
+ if ( isset( $this->state_data['remote'] ) && isset( $this->state_data['remote']['site_url'] ) ) {
661
+ $error .= 'Remote: ' . $this->state_data['site_details']['remote']['site_url'] . "\n\n";
662
+ }
663
+ $error .= 'WPMDB Error: ' . $wpmdb_error . "\n\n";
664
 
665
  if ( ! empty( $this->attempting_to_connect_to ) ) {
666
  $error .= 'Attempted to connect to: ' . $this->attempting_to_connect_to . "\n\n";
764
  }
765
 
766
  function get_dbrains_api_url( $request, $args = array() ) {
767
+ $url = $this->dbrains_api_url;
768
+ $args['request'] = $request;
769
+ $args['version'] = $GLOBALS['wpmdb_meta'][ $this->core_slug ]['version'];
770
+ $args['php_version'] = urlencode( phpversion() );
771
+ $args['locale'] = urlencode( get_locale() );
772
+ $args['wordpress_version'] = urlencode( get_bloginfo( 'version' ) );
773
+
774
+ if ( 'check_support_access' == $request || 'activate_licence' == $request ) {
775
+ $args['last_used'] = urlencode( $this->get_last_usage_time() );
776
+ }
777
+
778
+ $url = add_query_arg( $args, $url );
779
  if ( false !== get_site_transient( 'wpmdb_temporarily_disable_ssl' ) && 0 === strpos( $this->dbrains_api_url, 'https://' ) ) {
780
  $url = substr_replace( $url, 'http', 0, 5 );
781
  }
782
 
 
 
783
  return $url;
784
  }
785
 
871
  return $upload_info[ $type ];
872
  }
873
 
874
+ /**
875
+ * Adds/updates the `wpmdb_usage` option with most recent 'qualified' plugin use,
876
+ * stores time as well as the action (push/pull/export/find-replace)
877
+ *
878
+ * @param string $action
879
+ */
880
+ function log_usage( $action = '' ) {
881
+ update_site_option( 'wpmdb_usage', array( 'action' => $action, 'time' => time() ) );
882
+ }
883
+
884
+ /**
885
+ * Gets just the timestamp of the latest usage to send with the API requests
886
+ *
887
+ * @return int
888
+ */
889
+ function get_last_usage_time() {
890
+ $option = get_site_option( 'wpmdb_usage' );
891
+ return ( $option && $option['time'] ) ? $option['time'] : 0;
892
+ }
893
+
894
  /**
895
  * Main function for communicating with the Delicious Brains API.
896
  *
935
 
936
  $disable_ssl_url = network_admin_url( $this->plugin_base . '&nonce=' . wp_create_nonce( 'wpmdb-disable-ssl' ) . '&wpmdb-disable-ssl=1' );
937
  $connection_failed_message = '<div class="updated warning inline-message">';
938
+ $connection_failed_message .= sprintf( __( '<strong>Could not connect to api.deliciousbrains.com</strong> &mdash; You will not receive update notifications or be able to activate your license until this is fixed. This issue is often caused by an improperly configured SSL server (https). We recommend <a href="%1$s" target="_blank">fixing the SSL configuration on your server</a>, but if you need a quick fix you can:%2$s', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/could-not-connect-deliciousbrains-com/?utm_campaign=error%2Bmessages&utm_source=MDB%2BPaid&utm_medium=insideplugin', sprintf( '<p><a href="%1$s" class="temporarily-disable-ssl button">%2$s</a></p>', $disable_ssl_url, __( 'Temporarily disable SSL for connections to api.deliciousbrains.com', 'wp-migrate-db' ) ) );
939
  $connection_failed_message .= '</div>';
940
 
941
  if ( defined( 'WP_HTTP_BLOCK_EXTERNAL' ) && WP_HTTP_BLOCK_EXTERNAL ) {
943
  $host = $url_parts['host'];
944
  if ( ! defined( 'WP_ACCESSIBLE_HOSTS' ) || strpos( WP_ACCESSIBLE_HOSTS, $host ) === false ) {
945
  $connection_failed_message = '<div class="updated warning inline-message">';
946
+ $connection_failed_message .= sprintf( __( 'We\'ve detected that <code>WP_HTTP_BLOCK_EXTERNAL</code> is enabled and the host <strong>%1$s</strong> has not been added to <code>WP_ACCESSIBLE_HOSTS</code>. Please disable <code>WP_HTTP_BLOCK_EXTERNAL</code> or add <strong>%1$s</strong> to <code>WP_ACCESSIBLE_HOSTS</code> to continue. <a href="%2$s" target="_blank">More information</a>.', 'wp-migrate-db' ), 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' );
947
  $connection_failed_message .= '</div>';
948
  }
949
  }
1024
  $data = @file_get_contents( $response['filename'] );
1025
 
1026
  if ( ! $data ) {
1027
+ return new WP_Error( 'wpmdbpro_download_error_empty', sprintf( __( 'Error retrieving download from deliciousbrain.com. Please try again or download manually from <a href="%1$s">%2$s</a>.', 'wp-migrate-db' ), 'https://deliciousbrains.com/my-account/?utm_campaign=error%2Bmessages&utm_source=MDB%2BPaid&utm_medium=insideplugin', _x( 'My Account', 'Delicious Brains account', 'wp-migrate-db' ) ) );
1028
  }
1029
 
1030
  $decoded_data = json_decode( $data, true );
1105
  }
1106
 
1107
  $args = array(
1108
+ 'licence_key' => urlencode( $licence_key ),
1109
+ 'site_url' => urlencode( untrailingslashit( network_home_url( '', 'http' ) ) ),
1110
  );
1111
 
1112
  $response = $this->dbrains_api_request( 'check_support_access', $args );
1357
  return $this->plugin_file_path;
1358
  }
1359
 
1360
+ /**
1361
+ *
1362
+ * Get a message from the $messages array parameter based on a context
1363
+ *
1364
+ * Assumes the $messages array exists in the format of a nested array.
1365
+ *
1366
+ * Also assumes the nested array of strings has a key of 'default'
1367
+ *
1368
+ * Ex:
1369
+ *
1370
+ * array(
1371
+ * 'key1' => array(
1372
+ * 'ui' => 'Some message',
1373
+ * 'cli' => 'Another message',
1374
+ * ...
1375
+ * ),
1376
+ *
1377
+ * 'key2' => array(
1378
+ * 'ui' => 'Some message',
1379
+ * 'cli' => 'Another message',
1380
+ * ...
1381
+ * ),
1382
+ *
1383
+ * 'default' => array(
1384
+ * 'ui' => 'Some message',
1385
+ * 'cli' => 'Another message',
1386
+ * ...
1387
+ * ),
1388
+ * )
1389
+ *
1390
+ * @param array $messages
1391
+ * @param $key
1392
+ * @param string $context
1393
+ *
1394
+ * @return mixed
1395
+ */
1396
+ function get_contextual_message_string( $messages, $key, $context = 'ui' ) {
1397
+ $message = $messages[ $key ];
1398
+
1399
+ if ( isset( $message[ $context ] ) ) {
1400
+ return $message[ $context ];
1401
+ } else if ( isset( $message['default'] ) ) {
1402
+ return $message['default'];
1403
+ }
1404
+
1405
+ return '';
1406
+ }
1407
+
1408
  /**
1409
  * Returns a formatted message dependant on the status of the licence.
1410
  *
1411
  * @param bool $trans
1412
  * @param string $context
1413
  *
1414
+ * @return array|mixed|string
1415
  */
1416
  function get_licence_status_message( $trans = false, $context = null ) {
1417
  $licence = $this->get_licence_key();
1418
  $api_response_provided = true;
1419
+ $message_context = 'ui';
1420
+ $messages = $this->license_response_messages;
1421
+ $message = '';
1422
+
1423
+ if ( $this->doing_cli_migration ) {
1424
+ $message_context = 'cli';
1425
+ }
1426
 
1427
  if ( empty( $licence ) && ! $trans ) {
1428
  $message = sprintf( __( '<strong>Activate Your License</strong> &mdash; Please <a href="%s" class="%s">enter your license key</a> to enable push and pull functionality, priority support and plugin updates.', 'wp-migrate-db' ), network_admin_url( $this->plugin_base . '#settings' ), 'js-action-link enter-licence' );
1447
 
1448
  $errors = $trans['errors'];
1449
 
 
 
1450
  if ( isset( $errors['connection_failed'] ) ) {
1451
+ $message = $this->get_contextual_message_string( $messages, 'connection_failed', $message_context );
 
1452
 
1453
  if ( defined( 'WP_HTTP_BLOCK_EXTERNAL' ) && WP_HTTP_BLOCK_EXTERNAL ) {
1454
  $url_parts = $this->parse_url( $this->dbrains_api_base );
1455
  $host = $url_parts['host'];
1456
  if ( ! defined( 'WP_ACCESSIBLE_HOSTS' ) || strpos( WP_ACCESSIBLE_HOSTS, $host ) === false ) {
1457
+ $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' );
1458
  }
1459
  }
1460
 
1461
  // Don't cache the license response so we can try again
1462
  delete_site_transient( 'wpmdb_licence_response' );
1463
  } elseif ( isset( $errors['subscription_cancelled'] ) ) {
1464
+
1465
+ $message = $this->get_contextual_message_string( $messages, 'subscription_cancelled', $message_context );
1466
+
1467
  } elseif ( isset( $errors['subscription_expired'] ) ) {
1468
 
1469
+ $message_base = $this->get_contextual_message_string( $messages, 'subscription_expired_base', $message_context );
1470
+ $message_end = $this->get_contextual_message_string( $messages, 'subscription_expired_end', $message_context );
 
1471
 
1472
  $contextual_messages = array(
1473
  'default' => $message_base . $message_end,
1487
  }
1488
 
1489
  } elseif ( isset( $errors['no_activations_left'] ) ) {
1490
+
1491
+ $message = $this->get_contextual_message_string( $messages, 'no_activations_left', $message_context );
1492
+
1493
  } elseif ( isset( $errors['licence_not_found'] ) ) {
1494
+
1495
  if ( ! $api_response_provided ) {
1496
+ $message = $this->get_contextual_message_string( $messages, 'licence_not_found_api_failed', $message_context );
 
1497
  } else {
1498
  $error = reset( $errors );
1499
+ $message = sprintf( $this->get_contextual_message_string( $messages, 'licence_not_found_api', $message_context ), $error );
 
1500
  }
1501
+
1502
  } elseif ( isset( $errors['activation_deactivated'] ) ) {
1503
+ $message = $this->get_contextual_message_string( $messages, 'activation_deactivated', $message_context );
1504
+
1505
  } else {
1506
  $error = reset( $errors );
1507
+ $message = sprintf( $this->get_contextual_message_string( $messages, 'default', $message_context ), 'mailto:nom@deliciousbrains.com', 'nom@deliciousbrains.com', $error );
 
1508
  }
1509
 
1510
  return $message;
1580
  $suhosin_post_limit = false;
1581
 
1582
  if ( function_exists( 'ini_get' ) ) {
1583
+ $suhosin_request_limit = trim( ini_get( 'suhosin.request.max_value_length' ) );
1584
+ $suhosin_post_limit = trim( ini_get( 'suhosin.post.max_value_length' ) );
1585
  }
1586
 
1587
  if ( $suhosin_request_limit && $suhosin_post_limit ) {
1588
+ $suhosin_limit = min( wp_convert_hr_to_bytes( $suhosin_request_limit ), wp_convert_hr_to_bytes( $suhosin_post_limit ) );
1589
  }
1590
 
1591
  // we have to account for HTTP headers and other bloating, here we minus 1kb for bloat
1608
  return apply_filters( 'wpmdb_bottleneck', $calculated_bottleneck );
1609
  }
1610
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1611
  /**
1612
  * Returns the php ini value for post_max_size in bytes
1613
  *
1710
  * Standard notice display check
1711
  * Returns dismiss and reminder links html for templates where necessary
1712
  *
1713
+ * @param string $notice The name of the notice e.g. license-key-warning
1714
+ * @param bool|string $dismiss If the notice has a dismiss link. Pass "SHOW_ONCE" to auto-dismiss after first presentation.
1715
+ * @param bool|int $reminder If the notice has a reminder link, this will be the number of seconds
1716
  *
1717
  * @return array|bool
1718
  */
1719
+ function check_notice( $notice, $dismiss = false, $reminder = false, $css_class = 'notice-link' ) {
1720
  if ( true === apply_filters( 'wpmdb_hide_' . $notice, false ) ) {
1721
  return false;
1722
  }
1727
  if ( get_user_meta( $current_user->ID, 'wpmdb_dismiss_' . $notice ) ) {
1728
  return false;
1729
  }
1730
+ $notice_links['dismiss'] = '<a href="#" class="' . esc_attr( $css_class ) . '" data-notice="' . $notice . '" data-type="dismiss">' . _x( 'Dismiss', 'dismiss notice permanently', 'wp-migrate-db' ) . '</a>';
1731
+
1732
+ if ( 'SHOW_ONCE' === $dismiss ) {
1733
+ update_user_meta( $current_user->ID, 'wpmdb_dismiss_' . $notice, true );
1734
+ }
1735
  }
1736
 
1737
  if ( $reminder ) {
1740
  return false;
1741
  }
1742
  }
1743
+ $notice_links['reminder'] = '<a href="#" class="' . esc_attr( $css_class ) . '" data-notice="' . $notice . '" data-type="reminder" data-reminder="' . $reminder . '">' . __( 'Remind Me Later', 'wp-migrate-db' ) . '</a>';
1744
  }
1745
 
1746
  return ( count( $notice_links ) > 0 ) ? $notice_links : true;
2190
  $uploads = wp_upload_dir();
2191
 
2192
  $site_details = array(
2193
+ 'is_multisite' => esc_html( is_multisite() ? 'true' : 'false' ),
2194
+ 'site_url' => esc_html( addslashes( site_url() ) ),
2195
+ 'home_url' => esc_html( addslashes( home_url() ) ),
2196
+ 'prefix' => esc_html( $table_prefix ),
2197
+ 'uploads_baseurl' => esc_html( addslashes( trailingslashit( $uploads['baseurl'] ) ) ),
2198
+ 'uploads' => $this->uploads_info(),
2199
+ 'uploads_dir' => esc_html( addslashes( $this->get_short_uploads_dir() ) ),
2200
+ 'subsites' => $this->subsites_list(),
2201
+ 'subsites_info' => $this->subsites_info(),
2202
+ 'is_subdomain_install' => esc_html( ( is_multisite() && is_subdomain_install() ) ? 'true' : 'false' ),
2203
  );
2204
 
2205
  return $site_details;
class/wpmdb-cli.php CHANGED
@@ -89,10 +89,11 @@ class WPMDB_CLI extends WPMDB_Base {
89
  * Performs CLI migration given a profile data.
90
  *
91
  * @param int|array $profile Profile key or array.
 
92
  *
93
  * @return bool|WP_Error Returns true if succeed or WP_Error if failed.
94
  */
95
- public function cli_migration( $profile ) {
96
  $pre_check = $this->pre_cli_migration_check( $profile );
97
  if ( is_wp_error( $pre_check ) ) {
98
  return $pre_check;
@@ -120,11 +121,23 @@ class WPMDB_CLI extends WPMDB_Base {
120
  $this->post_data['intent'] = 'find_replace';
121
  }
122
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  // Ensure local site_details available.
124
  $this->post_data['site_details']['local'] = $this->site_details();
125
 
126
  // Check for tables specified in migration profile that do not exist in the source database
127
- if ( ! empty( $this->profile['select_tables'] ) ) {
128
  $source_tables = apply_filters( 'wpmdb_cli_filter_source_tables', $this->get_tables() );
129
 
130
  if ( ! empty( $source_tables ) ) {
@@ -158,13 +171,24 @@ class WPMDB_CLI extends WPMDB_Base {
158
 
159
  $this->post_data['migration_state_id'] = $this->migration['migration_state_id'];
160
 
161
- $tables_to_process = $this->migrate_tables();
 
 
 
 
 
 
 
 
 
162
  if ( is_wp_error( $tables_to_process ) ) {
163
  return $tables_to_process;
164
  }
165
 
166
  $this->post_data['tables'] = implode( ',', $tables_to_process );
167
 
 
 
168
  $finalize = $this->finalize_migration();
169
  if ( is_wp_error( $finalize ) || 'savefile' === $this->profile['action'] ) {
170
  return $finalize;
@@ -287,7 +311,7 @@ class WPMDB_CLI extends WPMDB_Base {
287
  * @param array $tables
288
  * @param int $stage
289
  *
290
- * @return \cli\progress\Bar
291
  */
292
  function get_progress_bar( $tables, $stage ) {
293
 
@@ -303,7 +327,7 @@ class WPMDB_CLI extends WPMDB_Base {
303
 
304
  $count = $this->get_total_rows_from_table_list( $tables, $stage );
305
 
306
- return new \cli\progress\Bar( $progress_label, $count );
307
  }
308
 
309
  /**
@@ -440,6 +464,11 @@ class WPMDB_CLI extends WPMDB_Base {
440
 
441
  ++$stage_iterator;
442
  $args['stage'] = 'migrate';
 
 
 
 
 
443
  $tables = $tables_to_migrate;
444
  $table_rows = $this->get_row_counts_from_table_list( $tables, $stage_iterator );
445
 
@@ -594,7 +623,7 @@ class WPMDB_CLI extends WPMDB_Base {
594
  public function get_profile_data_from_args( $args, $assoc_args ) {
595
 
596
  //load correct cli class
597
- if ( function_exists( 'wp_migrate_db_pro_cli_addon' ) ) {
598
  $wpmdb_cli = wp_migrate_db_pro_cli_addon();
599
  } elseif ( function_exists( 'wpmdb_pro_cli' ) ) {
600
  $wpmdb_cli = wpmdb_pro_cli();
@@ -617,6 +646,12 @@ class WPMDB_CLI extends WPMDB_Base {
617
  return $wpmdb_cli->cli_error( $message );
618
  }
619
 
 
 
 
 
 
 
620
  if ( empty( $assoc_args['action'] ) ) {
621
  return $wpmdb_cli->cli_error( __( 'Missing action parameter', 'wp-migrate-db-cli' ) );
622
  }
@@ -634,11 +669,18 @@ class WPMDB_CLI extends WPMDB_Base {
634
  $replace_old = str_getcsv( $assoc_args['find'] );
635
  } else {
636
  if ( 'find_replace' === $assoc_args['action'] ) {
637
- return $wpmdb_cli->cli_error( __( 'Missing find and replace values.', 'wp-migrate-db-cli' ) );
 
 
 
638
  }
639
  }
640
  if ( ! empty( $assoc_args['replace'] ) ) {
641
  $replace_new = str_getcsv( $assoc_args['replace'] );
 
 
 
 
642
  }
643
  if ( count( $replace_old ) !== count( $replace_new ) ) {
644
  return $wpmdb_cli->cli_error( sprintf( __( '%1$s and %2$s must contain the same number of values', 'wp-migrate-db-cli' ), '--find', '--replace' ) );
89
  * Performs CLI migration given a profile data.
90
  *
91
  * @param int|array $profile Profile key or array.
92
+ * @param array $assoc_args
93
  *
94
  * @return bool|WP_Error Returns true if succeed or WP_Error if failed.
95
  */
96
+ public function cli_migration( $profile, $assoc_args = array() ) {
97
  $pre_check = $this->pre_cli_migration_check( $profile );
98
  if ( is_wp_error( $pre_check ) ) {
99
  return $pre_check;
121
  $this->post_data['intent'] = 'find_replace';
122
  }
123
 
124
+ if ( 'import' === $this->profile['action'] ) {
125
+ $this->post_data['intent'] = 'import';
126
+
127
+ if ( ! isset( $this->profile['import_file'] ) ) {
128
+ if ( isset( $assoc_args['import-file'] ) ) {
129
+ $this->profile['import_file'] = $assoc_args['import-file'];
130
+ } else {
131
+ return $this->cli_error( __( 'Missing path to import file. Use --import-file=/path/to/import.sql.gz', 'wp-migrate-db' ) );
132
+ }
133
+ }
134
+ }
135
+
136
  // Ensure local site_details available.
137
  $this->post_data['site_details']['local'] = $this->site_details();
138
 
139
  // Check for tables specified in migration profile that do not exist in the source database
140
+ if ( ! empty( $this->profile['select_tables'] ) && 'import' !== $this->profile['action'] ) {
141
  $source_tables = apply_filters( 'wpmdb_cli_filter_source_tables', $this->get_tables() );
142
 
143
  if ( ! empty( $source_tables ) ) {
171
 
172
  $this->post_data['migration_state_id'] = $this->migration['migration_state_id'];
173
 
174
+ if ( 'import' === $this->profile['action'] ) {
175
+ if ( $this->profile['create_backup'] ) {
176
+ $tables_to_process = $this->migrate_tables();
177
+ } else {
178
+ $tables_to_process = $this->get_tables_to_migrate();
179
+ }
180
+ } else {
181
+ $tables_to_process = $this->migrate_tables();
182
+ }
183
+
184
  if ( is_wp_error( $tables_to_process ) ) {
185
  return $tables_to_process;
186
  }
187
 
188
  $this->post_data['tables'] = implode( ',', $tables_to_process );
189
 
190
+ do_action( 'wpmdb_cli_during_cli_migration', $this->post_data, $this->profile );
191
+
192
  $finalize = $this->finalize_migration();
193
  if ( is_wp_error( $finalize ) || 'savefile' === $this->profile['action'] ) {
194
  return $finalize;
311
  * @param array $tables
312
  * @param int $stage
313
  *
314
+ * @return cli\progress\Bar|WP_CLI\NoOp
315
  */
316
  function get_progress_bar( $tables, $stage ) {
317
 
327
 
328
  $count = $this->get_total_rows_from_table_list( $tables, $stage );
329
 
330
+ return WP_CLI\Utils\make_progress_bar( $progress_label, $count );
331
  }
332
 
333
  /**
464
 
465
  ++$stage_iterator;
466
  $args['stage'] = 'migrate';
467
+
468
+ if ( 'import' === $args['intent'] ) {
469
+ break;
470
+ }
471
+
472
  $tables = $tables_to_migrate;
473
  $table_rows = $this->get_row_counts_from_table_list( $tables, $stage_iterator );
474
 
623
  public function get_profile_data_from_args( $args, $assoc_args ) {
624
 
625
  //load correct cli class
626
+ if ( function_exists( 'wp_migrate_db_pro_cli_addon' ) && function_exists( 'wp_migrate_db_pro' ) ) {
627
  $wpmdb_cli = wp_migrate_db_pro_cli_addon();
628
  } elseif ( function_exists( 'wpmdb_pro_cli' ) ) {
629
  $wpmdb_cli = wpmdb_pro_cli();
646
  return $wpmdb_cli->cli_error( $message );
647
  }
648
 
649
+ foreach ( $assoc_args as $key => $value ) {
650
+ if ( empty( $value) ) {
651
+ WP_CLI::warning( __( '--' . $key . ' parameter needs a value.', 'wp-migrate-db-cli' ) );
652
+ }
653
+ }
654
+
655
  if ( empty( $assoc_args['action'] ) ) {
656
  return $wpmdb_cli->cli_error( __( 'Missing action parameter', 'wp-migrate-db-cli' ) );
657
  }
669
  $replace_old = str_getcsv( $assoc_args['find'] );
670
  } else {
671
  if ( 'find_replace' === $assoc_args['action'] ) {
672
+ if ( empty( $assoc_args['replace'] ) ) {
673
+ return $wpmdb_cli->cli_error( __( 'Missing find and replace values.', 'wp-migrate-db-cli' ) );
674
+ }
675
+ return $wpmdb_cli->cli_error( __( 'Find value is required.', 'wp-migrate-db-cli' ) );
676
  }
677
  }
678
  if ( ! empty( $assoc_args['replace'] ) ) {
679
  $replace_new = str_getcsv( $assoc_args['replace'] );
680
+ } else {
681
+ if ( 'find_replace' === $assoc_args['action'] ) {
682
+ return $wpmdb_cli->cli_error( __( 'Replace value is required.', 'wp-migrate-db-cli' ) );
683
+ }
684
  }
685
  if ( count( $replace_old ) !== count( $replace_new ) ) {
686
  return $wpmdb_cli->cli_error( sprintf( __( '%1$s and %2$s must contain the same number of values', 'wp-migrate-db-cli' ), '--find', '--replace' ) );
class/wpmdb-compatibility-plugin-manager.php ADDED
@@ -0,0 +1,252 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class WPMDB_Compatibility_Plugin_Manager
4
+ *
5
+ * Class to handle the copying and removing of the Compatibility Mode MU plugin for WP Migrate DB Pro
6
+ *
7
+ */
8
+ class WPMDB_Compatibility_Plugin_Manager {
9
+
10
+ protected $wpmdb;
11
+ protected $mu_plugin_source;
12
+ protected $mu_plugin_dest;
13
+ protected $filesystem;
14
+ protected $settings;
15
+ protected $compatibility_plugin_version;
16
+ protected $mu_plugin_dir;
17
+
18
+ /**
19
+ * WPMDB_Compatibility_Plugin_Manager constructor.
20
+ *
21
+ * @param $wpmdb - WPMDB class passed as a constructor dependency
22
+ */
23
+ public function __construct( $wpmdb ) {
24
+ $this->wpmdb = $wpmdb;
25
+ $this->filesystem = $wpmdb->filesystem;
26
+ $this->settings = $wpmdb->get( 'settings' );
27
+
28
+ //Version of the compatibility plugin, to force an update of the MU plugin, increment this value
29
+ $this->compatibility_plugin_version = '1.1';
30
+
31
+ $this->mu_plugin_dir = $wpmdb->mu_plugin_dir;
32
+ $this->mu_plugin_source = $wpmdb->mu_plugin_source;
33
+ $this->mu_plugin_dest = $wpmdb->mu_plugin_dest;
34
+
35
+ //Checks the compatibility mode MU plugin version and updates if it's out of date
36
+ add_action( 'wp_ajax_wpmdb_plugin_compatibility', array( $this, 'ajax_plugin_compatibility' ) );
37
+ add_action( 'admin_init', array( $this, 'muplugin_version_check' ), 1 );
38
+ add_action( 'wpmdb_notices', array( $this, 'template_muplugin_update_fail' ) );
39
+ //Fired in the register_deactivation_hook() call in both the pro and non-pro plugins
40
+ add_action( 'wp_migrate_db_remove_compatibility_plugin', array( $this, 'remove_muplugin_on_deactivation' ) );
41
+ }
42
+
43
+ /**
44
+ * Triggered with the `admin_init` hook on the WP Migrate DB Pro dashboard page
45
+ *
46
+ * The 'compatibility_plugin_version' option key signifies that the latest compatibility plugin has been installed. If it's not present, copy the plugin, enabling it by default.
47
+ *
48
+ * Otherwise check the 'compatibility_plugin_version' option to see if the MU plugin needs updating.
49
+ *
50
+ * @return bool|string
51
+ */
52
+ public function muplugin_version_check() {
53
+ if ( isset( $_GET['page'] ) && in_array( $_GET['page'], array( 'wp-migrate-db-pro', 'wp-migrate-db' ) ) ) {
54
+ if ( true === $this->is_muplugin_update_required() ) {
55
+ return $this->copy_muplugin();
56
+ }
57
+ }
58
+
59
+ return false;
60
+ }
61
+
62
+ /**
63
+ * Checks if the compatibility mu-plugin is installed
64
+ *
65
+ * @return bool $installed
66
+ */
67
+ public function is_muplugin_installed() {
68
+ $plugins = wp_get_mu_plugins();
69
+ $muplugin_filename = 'wp-migrate-db-pro-compatibility.php';
70
+ $installed = false;
71
+
72
+ foreach ( $plugins as $plugin ) {
73
+ if ( false !== strpos( $plugin, $muplugin_filename ) ) {
74
+ $installed = true;
75
+ }
76
+ }
77
+
78
+ return $installed;
79
+ }
80
+
81
+ /**
82
+ *
83
+ * Utility function to check if the mu-plugin directory and compatibility plugin are both writable
84
+ *
85
+ *
86
+ * @return bool
87
+ */
88
+ public function is_muplugin_writable() {
89
+ //Assumes by default we can create the mu-plugins folder and compatibility plugin if they don't exist
90
+ $mu_folder_writable = true;
91
+ $mu_plugin_writable = true;
92
+
93
+ //If the mu-plugins folder exists, make sure it's writable.
94
+ if ( true === $this->filesystem->is_dir( $this->mu_plugin_dir ) ) {
95
+ $mu_folder_writable = $this->filesystem->is_writable( $this->mu_plugin_dir );
96
+ }
97
+
98
+ //If the mu-plugins/wp-migrate-db-pro-compatibility.php file exists, make sure it's writable.
99
+ if ( true === $this->filesystem->file_exists( $this->mu_plugin_dest ) ) {
100
+ $mu_plugin_writable = $this->filesystem->is_writable( $this->mu_plugin_dest );
101
+ }
102
+
103
+ if ( false === $mu_folder_writable || false === $mu_plugin_writable ) {
104
+ return false;
105
+ }
106
+
107
+ return true;
108
+ }
109
+
110
+ /**
111
+ * Checks if the compatibility mu-plugin requires an update based on the 'compatibility_plugin_version' setting in
112
+ * the database
113
+ *
114
+ * @param $wpmdb_settings
115
+ *
116
+ * @return bool
117
+ */
118
+ public function is_muplugin_update_required( $wpmdb_settings = false ) {
119
+ $update_required = false;
120
+
121
+ if ( false === $wpmdb_settings ) {
122
+ $wpmdb_settings = $this->settings;
123
+ }
124
+
125
+ if ( ! isset( $wpmdb_settings['compatibility_plugin_version'] ) ) {
126
+ $update_required = true;
127
+ } else if ( version_compare( $this->compatibility_plugin_version, $wpmdb_settings['compatibility_plugin_version'], '>' ) && $this->is_muplugin_installed() ) {
128
+ $update_required = true;
129
+ }
130
+
131
+ return $update_required;
132
+ }
133
+
134
+ /**
135
+ * Preemptively shows a warning warning on WPMDB pages if the mu-plugins folder isn't writable
136
+ */
137
+ function template_muplugin_update_fail() {
138
+ if ( $this->is_muplugin_update_required() && false === $this->is_muplugin_writable() ) {
139
+ $notice_links = $this->wpmdb->check_notice( 'muplugin_failed_update_' . $this->compatibility_plugin_version , 'SHOW_ONCE' );
140
+ if ( is_array( $notice_links ) ) {
141
+ $this->wpmdb->template( 'muplugin-failed-update-warning', 'common', $notice_links );
142
+ }
143
+ }
144
+ }
145
+
146
+ /**
147
+ * Handler for ajax request to turn on or off Compatibility Mode.
148
+ */
149
+ public function ajax_plugin_compatibility() {
150
+ $this->wpmdb->check_ajax_referer( 'plugin_compatibility' );
151
+ $message = false;
152
+
153
+ $key_rules = array(
154
+ 'action' => 'key',
155
+ 'install' => 'numeric',
156
+ );
157
+ $state_data = $this->wpmdb->set_post_data( $key_rules );
158
+ $do_install = ( '1' === trim( $state_data['install'] ) ) ? true : false;
159
+ $plugin_toggled = $this->toggle_muplugin( $do_install );
160
+
161
+ //If there's an error message, display it
162
+ if ( true !== $plugin_toggled ) {
163
+ $message = $plugin_toggled;
164
+ }
165
+
166
+ $this->wpmdb->end_ajax( $message );
167
+ }
168
+
169
+
170
+ /**
171
+ *
172
+ * Toggles the compatibility plugin based on the $do_install param.
173
+ *
174
+ * @param $do_install
175
+ *
176
+ * @return bool|string|void
177
+ */
178
+ public function toggle_muplugin( $do_install ) {
179
+ if ( true === $do_install ) {
180
+ return $this->copy_muplugin();
181
+ } else {
182
+ return $this->remove_muplugin();
183
+ }
184
+ }
185
+
186
+ /**
187
+ *
188
+ * Copies the compatibility plugin as well as updates the version number in the database
189
+ *
190
+ * @return bool|string
191
+ */
192
+ public function copy_muplugin() {
193
+ $wpmdb_settings = $this->settings;
194
+
195
+ // Make the mu-plugins folder if it doesn't already exist, if the folder does exist it's left as-is.
196
+ if ( ! $this->filesystem->mkdir( $this->mu_plugin_dir ) ) {
197
+ return sprintf( esc_html__( 'The following directory could not be created: %s', 'wp-migrate-db' ), $this->mu_plugin_dir );
198
+ }
199
+
200
+ if ( ! $this->filesystem->copy( $this->mu_plugin_source, $this->mu_plugin_dest ) ) {
201
+ return sprintf( __( 'The compatibility plugin could not be activated because your mu-plugin directory is currently not writable. Please update the permissions of the mu-plugins folder: %s', 'wp-migrate-db' ), $this->mu_plugin_dir );
202
+ }
203
+
204
+ if ( $this->is_muplugin_update_required() ) {
205
+ // Update version number in the database
206
+ $wpmdb_settings['compatibility_plugin_version'] = $this->compatibility_plugin_version;
207
+
208
+ // Remove blacklist_plugins key as it's no longer used.
209
+ if ( isset( $wpmdb_settings['blacklist_plugins'] ) ) {
210
+ unset( $wpmdb_settings['blacklist_plugins'] );
211
+ }
212
+
213
+ update_site_option( 'wpmdb_settings', $wpmdb_settings );
214
+ }
215
+
216
+ return true;
217
+ }
218
+
219
+ /**
220
+ *
221
+ * Removes the compatibility plugin
222
+ *
223
+ * @return bool|string
224
+ */
225
+ public function remove_muplugin() {
226
+ if ( $this->filesystem->file_exists( $this->mu_plugin_dest ) && ! $this->filesystem->unlink( $this->mu_plugin_dest ) ) {
227
+ return sprintf( __( 'The compatibility plugin could not be deactivated because your mu-plugin directory is currently not writable. Please update the permissions of the mu-plugins folder: %s', 'wp-migrate-db' ), $this->mu_plugin_dir );
228
+ }
229
+
230
+ return true;
231
+ }
232
+
233
+ /**
234
+ *
235
+ * Fired on the `wp_migrate_db_remove_compatibility_plugin` action. Removes the compatibility plugin on deactivation
236
+ *
237
+ * @return bool|string
238
+ */
239
+ public function remove_muplugin_on_deactivation() {
240
+ $plugin_removed = $this->remove_muplugin();
241
+
242
+ if ( true === $plugin_removed ) {
243
+ $wpmdb_settings = $this->settings;
244
+ unset( $wpmdb_settings['compatibility_plugin_version'] );
245
+
246
+ update_site_option( 'wpmdb_settings', $wpmdb_settings );
247
+ return true;
248
+ }
249
+
250
+ return $plugin_removed;
251
+ }
252
+ }
class/wpmdb-compatibility.php ADDED
@@ -0,0 +1,268 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WPMDB_Compatibility {
4
+
5
+ protected $muplugin_class_dir;
6
+ protected $muplugin_dir;
7
+ protected $default_whitelisted_plugins;
8
+
9
+ public function __construct() {
10
+
11
+ $this->muplugin_class_dir = plugin_dir_path( __FILE__ );
12
+ $this->muplugin_dir = ( defined( 'WPMU_PLUGIN_DIR' ) && defined( 'WPMU_PLUGIN_URL' ) ) ? WPMU_PLUGIN_DIR : trailingslashit( WP_CONTENT_DIR ) . 'mu-plugins';
13
+
14
+ add_action( 'admin_init', array( $this, 'wpmdbc_tgmpa_compatibility' ), 1 );
15
+ add_filter( 'option_active_plugins', array( $this, 'wpmdbc_include_plugins' ) );
16
+ add_filter( 'site_option_active_sitewide_plugins', array( $this, 'wpmdbc_include_site_plugins' ) );
17
+ add_filter( 'stylesheet_directory', array( $this, 'wpmdbc_disable_theme' ) );
18
+ add_filter( 'template_directory', array( $this, 'wpmdbc_disable_theme' ) );
19
+ add_action( 'muplugins_loaded', array( $this, 'wpmdbc_plugins_loaded' ) );
20
+ add_action( 'after_setup_theme', array( $this, 'wpmdbc_after_theme_setup' ) );
21
+
22
+ $this->default_whitelisted_plugins = $this->wpmdbc_set_default_whitelist();
23
+ }
24
+
25
+ /**
26
+ * During the `wpmdb_flush` and `wpmdb_remote_flush` actions, start output buffer in case theme spits out errors
27
+ */
28
+ public function wpmdbc_plugins_loaded() {
29
+ if ( $this->wpmdbc_is_wpmdb_flush_call() ) {
30
+ ob_start();
31
+ }
32
+ }
33
+
34
+ /**
35
+ * During the `wpmdb_flush` and `wpmdb_remote_flush` actions, if buffer isn't empty, log content and flush buffer.
36
+ */
37
+ public function wpmdbc_after_theme_setup() {
38
+ if ( $this->wpmdbc_is_wpmdb_flush_call() ) {
39
+ if ( ob_get_length() ) {
40
+ error_log( ob_get_clean() );
41
+ }
42
+ }
43
+ }
44
+
45
+ /**
46
+ *
47
+ * Disables the theme during MDB AJAX requests
48
+ *
49
+ * Called from the `stylesheet_directory` hook
50
+ *
51
+ * @param $stylesheet_dir
52
+ *
53
+ * @return string
54
+ */
55
+ public function wpmdbc_disable_theme( $stylesheet_dir ) {
56
+ $force_enable_theme = apply_filters( 'wpmdb_compatibility_enable_theme', false );
57
+
58
+ if ( $this->wpmdbc_is_compatibility_mode_request() && ! $force_enable_theme ) {
59
+ $theme_dir = realpath( dirname( __FILE__ ) . '/../compatibility' );
60
+ $stylesheet = 'temp-theme';
61
+ $theme_root = "$theme_dir/$stylesheet";
62
+
63
+ return $theme_root;
64
+ }
65
+
66
+ return $stylesheet_dir;
67
+ }
68
+
69
+ public function wpmdbc_set_default_whitelist() {
70
+
71
+ // Allow users to filter whitelisted plugins
72
+ $filtered_plugins = apply_filters( 'wpmdb_compatibility_plugin_whitelist', array() );
73
+
74
+ // List of default plugins that should be whitelisted. Can be partial names or slugs
75
+ $wpmdb_plugins = array(
76
+ 'wpmdb', // Some tweaks plugins start with this string
77
+ 'wp-migrate-db',
78
+ );
79
+
80
+ return array_merge( $filtered_plugins, $wpmdb_plugins );
81
+ }
82
+
83
+ /**
84
+ * Remove TGM Plugin Activation 'force_activation' admin_init action hook if present.
85
+ *
86
+ * This is to stop excluded plugins being deactivated after a migration, when a theme uses TGMPA to require a
87
+ * plugin to be always active.
88
+ */
89
+ public function wpmdbc_tgmpa_compatibility() {
90
+ $remove_function = false;
91
+
92
+ // run on wpmdb page
93
+ if ( isset( $_GET['page'] ) && 'wp-migrate-db-pro' == $_GET['page'] ) {
94
+ $remove_function = true;
95
+ }
96
+ // run on wpmdb ajax requests
97
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX && isset( $_POST['action'] ) && false !== strpos( $_POST['action'], 'wpmdb' ) ) {
98
+ $remove_function = true;
99
+ }
100
+
101
+ if ( $remove_function ) {
102
+ global $wp_filter;
103
+ $admin_init_functions = $wp_filter['admin_init'];
104
+ foreach ( $admin_init_functions as $priority => $functions ) {
105
+ foreach ( $functions as $key => $function ) {
106
+ // searching for function this way as can't rely on the calling class being named TGM_Plugin_Activation
107
+ if ( false !== strpos( $key, 'force_activation' ) ) {
108
+
109
+ if ( is_array( $wp_filter['admin_init'] ) ) {
110
+ // for core versions prior to WP 4.7
111
+ unset( $wp_filter['admin_init'][ $priority ][ $key ] );
112
+ } else {
113
+ unset( $wp_filter['admin_init']->callbacks[ $priority ][ $key ] );
114
+ }
115
+
116
+ return;
117
+ }
118
+ }
119
+ }
120
+ }
121
+ }
122
+
123
+ /**
124
+ * remove blog-active plugins
125
+ *
126
+ * @param array $plugins numerically keyed array of plugin names
127
+ *
128
+ * @return array
129
+ */
130
+ public function wpmdbc_include_plugins( $plugins ) {
131
+ if ( ! is_array( $plugins ) || empty( $plugins ) ) {
132
+ return $plugins;
133
+ }
134
+
135
+ if ( ! $this->wpmdbc_is_compatibility_mode_request() ) {
136
+ return $plugins;
137
+ }
138
+
139
+ $whitelist_plugins = $this->wpmdbc_get_whitelist_plugins();
140
+ $default_whitelist = $this->default_whitelisted_plugins;
141
+
142
+ foreach ( $plugins as $key => $plugin ) {
143
+ if ( true === $this->wpmdbc_plugin_in_default_whitelist( $plugin, $default_whitelist ) || isset( $whitelist_plugins[ $plugin ] ) ) {
144
+ continue;
145
+ }
146
+
147
+ unset( $plugins[ $key ] );
148
+ }
149
+
150
+ return $plugins;
151
+ }
152
+
153
+ /**
154
+ * remove network-active plugins
155
+ *
156
+ * @param array $plugins array of plugins keyed by name (name=>timestamp pairs)
157
+ *
158
+ * @return array
159
+ */
160
+ public function wpmdbc_include_site_plugins( $plugins ) {
161
+ if ( ! is_array( $plugins ) || empty( $plugins ) ) {
162
+ return $plugins;
163
+ }
164
+
165
+ if ( ! $this->wpmdbc_is_compatibility_mode_request() ) {
166
+ return $plugins;
167
+ }
168
+
169
+ $whitelist_plugins = $this->wpmdbc_get_whitelist_plugins();
170
+ $default_whitelist = $this->default_whitelisted_plugins;
171
+
172
+ foreach ( array_keys( $plugins ) as $plugin ) {
173
+ if ( true === $this->wpmdbc_plugin_in_default_whitelist( $plugin, $default_whitelist ) || isset( $whitelist_plugins[ $plugin ] ) ) {
174
+ continue;
175
+ }
176
+ unset( $plugins[ $plugin ] );
177
+ }
178
+
179
+ return $plugins;
180
+ }
181
+
182
+ /**
183
+ * @return bool
184
+ */
185
+ public function wpmdbc_is_wpmdb_ajax_call() {
186
+ if ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) && ( isset( $_POST['action'] ) && false !== strpos( $_POST['action'], 'wpmdb' ) ) ) {
187
+ return true;
188
+ }
189
+
190
+ return false;
191
+ }
192
+
193
+ /**
194
+ * @return bool
195
+ */
196
+ public function wpmdbc_is_wpmdb_flush_call() {
197
+ if ( $this->wpmdbc_is_wpmdb_ajax_call() && in_array( $_POST['action'], array( 'wpmdb_flush', 'wpmdb_remote_flush' ) ) ) {
198
+ return true;
199
+ }
200
+
201
+ return false;
202
+ }
203
+
204
+ /**
205
+ * Should the current request be processed by Compatibility Mode?
206
+ *
207
+ * @return bool
208
+ */
209
+ public function wpmdbc_is_compatibility_mode_request() {
210
+ //Requests that shouldn't be handled by compatibility mode
211
+ if ( ! $this->wpmdbc_is_wpmdb_ajax_call() || in_array( $_POST['action'], array(
212
+ 'wpmdb_get_log',
213
+ 'wpmdb_flush',
214
+ 'wpmdb_remote_flush',
215
+ ) )
216
+ ) {
217
+ return false;
218
+ }
219
+
220
+ return true;
221
+ }
222
+
223
+ /**
224
+ * Returns an array of plugin slugs to be blacklisted.
225
+ *
226
+ * @return array
227
+ */
228
+ public function wpmdbc_get_whitelist_plugins() {
229
+ $whitelist_plugins = array();
230
+
231
+ $wpmdb_settings = get_site_option( 'wpmdb_settings' );
232
+
233
+ if ( ! empty( $wpmdb_settings['whitelist_plugins'] ) ) {
234
+ $whitelist_plugins = array_flip( $wpmdb_settings['whitelist_plugins'] );
235
+ }
236
+
237
+ return $whitelist_plugins;
238
+ }
239
+
240
+ /**
241
+ *
242
+ * Checks if $plugin is in the $whitelisted_plugins property array
243
+ *
244
+ * @param $plugin
245
+ * @param $whitelisted_plugins
246
+ *
247
+ * @return bool
248
+ */
249
+ public function wpmdbc_plugin_in_default_whitelist( $plugin, $whitelisted_plugins ) {
250
+
251
+ if ( ! is_array( $whitelisted_plugins ) ) {
252
+ return false;
253
+ }
254
+
255
+ if ( in_array( $plugin, $whitelisted_plugins ) ) {
256
+ return true;
257
+ }
258
+
259
+ // strpos() check to see if the item slug is in the current $plugin name
260
+ foreach ( $whitelisted_plugins as $item ) {
261
+ if ( false !== strpos( $plugin, $item ) ) {
262
+ return true;
263
+ }
264
+ }
265
+
266
+ return false;
267
+ }
268
+ }
class/wpmdb-filesystem.php CHANGED
@@ -239,7 +239,7 @@ class WPMDB_Filesystem {
239
  }
240
 
241
  /**
242
- * Is the specified pat a directory?
243
  *
244
  * @param string $abs_path
245
  *
@@ -486,7 +486,7 @@ class WPMDB_Filesystem {
486
  * @param string $source_abs_path
487
  * @param string $destination_abs_path
488
  * @param bool $overwrite
489
- * @param int $perms
490
  *
491
  * @return bool
492
  *
@@ -503,7 +503,7 @@ class WPMDB_Filesystem {
503
  return false;
504
  }
505
 
506
- $return = copy( $source_abs_path, $destination_abs_path );
507
  if ( $perms && $return ) {
508
  $this->chmod( $destination_abs_path, $perms );
509
  }
239
  }
240
 
241
  /**
242
+ * Is the specified path a directory?
243
  *
244
  * @param string $abs_path
245
  *
486
  * @param string $source_abs_path
487
  * @param string $destination_abs_path
488
  * @param bool $overwrite
489
+ * @param mixed $perms
490
  *
491
  * @return bool
492
  *
503
  return false;
504
  }
505
 
506
+ $return = @copy( $source_abs_path, $destination_abs_path );
507
  if ( $perms && $return ) {
508
  $this->chmod( $destination_abs_path, $perms );
509
  }
class/wpmdb-replace.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
 
3
  final class WPMDB_Replace {
 
4
  protected $search;
5
  protected $replace;
6
  protected $subdomain_replaces_on;
@@ -19,7 +20,16 @@ final class WPMDB_Replace {
19
  private $row;
20
 
21
  function __construct( $args ) {
22
- $keys = array( 'table', 'search', 'replace', 'intent', 'base_domain', 'site_domain', 'wpmdb', 'site_details' );
 
 
 
 
 
 
 
 
 
23
 
24
  if ( ! is_array( $args ) ) {
25
  throw new InvalidArgumentException( 'WPMDB_Replace constructor expects the argument to be an array' );
@@ -65,7 +75,12 @@ final class WPMDB_Replace {
65
  * @return bool
66
  */
67
  function has_same_base_domain() {
68
- $destination_url = isset( $this->destination_url ) ? $this->destination_url : $this->site_details['local']['site_url'];
 
 
 
 
 
69
  if ( stripos( $destination_url, $this->site_domain ) ) {
70
  return true;
71
  }
@@ -101,21 +116,32 @@ final class WPMDB_Replace {
101
  * @return bool
102
  */
103
  function detect_protocol_mismatch() {
104
- if ( ! isset( $this->site_details['remote'] ) ) {
105
  return false;
106
  }
107
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  /**
109
  * Filters the site_urls used to check if there is a protocol mismatch.
110
  *
111
  * @param array
112
  */
113
- $wpmdb_home_urls = apply_filters( 'wpmdb_replace_site_urls', array(
114
- // TODO: rewrite unit tests that only pass site_url so that we can rely on home_url's existence
115
- 'local' => isset( $this->site_details['local']['home_url'] ) ? $this->site_details['local']['home_url'] : $this->site_details['local']['site_url'],
116
- 'remote' => isset( $this->site_details['remote']['home_url'] ) ? $this->site_details['remote']['home_url'] : $this->site_details['remote']['site_url'],
117
- )
118
- );
119
 
120
  $local_url_is_https = false === stripos( $wpmdb_home_urls['local'], 'https' ) ? false : true;
121
  $remote_url_is_https = false === stripos( $wpmdb_home_urls['remote'], 'https' ) ? false : true;
@@ -146,29 +172,30 @@ final class WPMDB_Replace {
146
  *
147
  * Can be filtered to disable entirely.
148
  *
149
- * @param $new
 
150
  *
151
  * @return mixed
152
  */
153
- function do_protocol_replace( $new ) {
154
  /**
155
  * Filters $do_protocol_replace, return false to prevent protocol replacement.
156
  *
157
- * @param bool true If the replace should be skipped.
158
- * @param string $this->destination_url The URL of the target site.
159
  */
160
- $do_protocol_replace = apply_filters( 'wpmdb_replace_destination_protocol', true, $this->destination_url );
161
 
162
  if ( true !== $do_protocol_replace ) {
163
  return $new;
164
  }
165
 
166
- $parsed_destination = wp_parse_url( $this->destination_url );
167
  unset( $parsed_destination['scheme'] );
168
 
169
- $protocol_search = $this->source_protocol . '://' . implode( '', $parsed_destination );
170
- $protocol_replace = $this->destination_url;
171
- $new = str_ireplace( $protocol_search, $protocol_replace, $new, $count );
172
 
173
  return $new;
174
  }
@@ -187,7 +214,7 @@ final class WPMDB_Replace {
187
  }
188
 
189
  if ( true === $this->is_protocol_mismatch ) {
190
- $new = $this->do_protocol_replace( $new );
191
  }
192
 
193
  return $new;
@@ -199,10 +226,10 @@ final class WPMDB_Replace {
199
  *
200
  * Mostly from https://github.com/interconnectit/Search-Replace-DB
201
  *
202
- * @param mixed $data Used to pass any subordinate arrays back to in.
203
- * @param bool $serialized Does the array passed via $data need serialising.
204
- * @param bool $parent_serialized Passes whether the original data passed in was serialized
205
- * @param bool $filtered Should we apply before and after filters successively
206
  *
207
  * @return mixed The original array with all elements replaced as needed.
208
  */
@@ -217,7 +244,11 @@ final class WPMDB_Replace {
217
  $successive_filter = $filtered;
218
 
219
  if ( true === $filtered ) {
220
- list( $data, $before_fired, $successive_filter ) = apply_filters( 'wpmdb_before_replace_custom_data', array( $data, $before_fired, $successive_filter ), $this );
 
 
 
 
221
  }
222
 
223
  // some unserialized data cannot be re-serialized eg. SimpleXMLElements
1
  <?php
2
 
3
  final class WPMDB_Replace {
4
+
5
  protected $search;
6
  protected $replace;
7
  protected $subdomain_replaces_on;
20
  private $row;
21
 
22
  function __construct( $args ) {
23
+ $keys = array(
24
+ 'table',
25
+ 'search',
26
+ 'replace',
27
+ 'intent',
28
+ 'base_domain',
29
+ 'site_domain',
30
+ 'wpmdb',
31
+ 'site_details',
32
+ );
33
 
34
  if ( ! is_array( $args ) ) {
35
  throw new InvalidArgumentException( 'WPMDB_Replace constructor expects the argument to be an array' );
75
  * @return bool
76
  */
77
  function has_same_base_domain() {
78
+ if( 'push' !== $this->intent || 'pull' !== $this->intent ) {
79
+ $destination_url = $this->base_domain;
80
+ } else {
81
+ $destination_url = isset( $this->destination_url ) ? $this->destination_url : $this->site_details['local']['site_url'];
82
+ }
83
+
84
  if ( stripos( $destination_url, $this->site_domain ) ) {
85
  return true;
86
  }
116
  * @return bool
117
  */
118
  function detect_protocol_mismatch() {
119
+ if ( ! isset( $this->site_details['remote'] ) && 'import' !== $this->intent ) {
120
  return false;
121
  }
122
 
123
+ $wpmdb_home_urls = array(
124
+ // TODO: rewrite unit tests that only pass site_url so that we can rely on home_url's existence
125
+ 'local' => isset( $this->site_details['local']['home_url'] ) ? $this->site_details['local']['home_url'] : $this->site_details['local']['site_url'],
126
+ );
127
+
128
+ if ( 'import' !== $this->intent ) {
129
+ $wpmdb_home_urls['remote'] = isset( $this->site_details['remote']['home_url'] ) ? $this->site_details['remote']['home_url'] : $this->site_details['remote']['site_url'];
130
+ } else {
131
+ $this->state_data = $this->wpmdb->set_post_data();
132
+
133
+ if ( ! isset( $this->state_data['import_info'] ) || ! isset( $this->state_data['import_info']['protocol'] ) ) {
134
+ return false;
135
+ }
136
+ $wpmdb_home_urls['remote'] = $this->state_data['import_info']['protocol'] . ':' . $this->state_data['import_info']['URL'];
137
+ }
138
+
139
  /**
140
  * Filters the site_urls used to check if there is a protocol mismatch.
141
  *
142
  * @param array
143
  */
144
+ $wpmdb_home_urls = apply_filters( 'wpmdb_replace_site_urls', $wpmdb_home_urls );
 
 
 
 
 
145
 
146
  $local_url_is_https = false === stripos( $wpmdb_home_urls['local'], 'https' ) ? false : true;
147
  $remote_url_is_https = false === stripos( $wpmdb_home_urls['remote'], 'https' ) ? false : true;
172
  *
173
  * Can be filtered to disable entirely.
174
  *
175
+ * @param string $new
176
+ * @param string $destination_url
177
  *
178
  * @return mixed
179
  */
180
+ function do_protocol_replace( $new, $destination_url ) {
181
  /**
182
  * Filters $do_protocol_replace, return false to prevent protocol replacement.
183
  *
184
+ * @param bool true If the replace should be skipped.
185
+ * @param string $destination_url The URL of the target site.
186
  */
187
+ $do_protocol_replace = apply_filters( 'wpmdb_replace_destination_protocol', true, $destination_url );
188
 
189
  if ( true !== $do_protocol_replace ) {
190
  return $new;
191
  }
192
 
193
+ $parsed_destination = wp_parse_url( $destination_url );
194
  unset( $parsed_destination['scheme'] );
195
 
196
+ $protocol_search = $this->source_protocol . '://' . implode( '', $parsed_destination );
197
+ $protocol_replace = $destination_url;
198
+ $new = str_ireplace( $protocol_search, $protocol_replace, $new, $count );
199
 
200
  return $new;
201
  }
214
  }
215
 
216
  if ( true === $this->is_protocol_mismatch ) {
217
+ $new = $this->do_protocol_replace( $new, $this->destination_url );
218
  }
219
 
220
  return $new;
226
  *
227
  * Mostly from https://github.com/interconnectit/Search-Replace-DB
228
  *
229
+ * @param mixed $data Used to pass any subordinate arrays back to in.
230
+ * @param bool $serialized Does the array passed via $data need serialising.
231
+ * @param bool $parent_serialized Passes whether the original data passed in was serialized
232
+ * @param bool $filtered Should we apply before and after filters successively
233
  *
234
  * @return mixed The original array with all elements replaced as needed.
235
  */
244
  $successive_filter = $filtered;
245
 
246
  if ( true === $filtered ) {
247
+ list( $data, $before_fired, $successive_filter ) = apply_filters( 'wpmdb_before_replace_custom_data', array(
248
+ $data,
249
+ $before_fired,
250
+ $successive_filter,
251
+ ), $this );
252
  }
253
 
254
  // some unserialized data cannot be re-serialized eg. SimpleXMLElements
class/wpmdb-utils.php CHANGED
@@ -61,12 +61,12 @@ class WPMDB_Utils {
61
  }
62
  }
63
  }
64
-
65
  /**
66
  * Return unserialized object or array
67
  *
68
- * @param string $serialized_string Serialized string.
69
- * @param string $method The name of the caller method.
70
  *
71
  * @return mixed, false on failure
72
  */
@@ -94,7 +94,7 @@ class WPMDB_Utils {
94
  *
95
  * @return string|array
96
  */
97
- public static function safe_wp_unslash( $arg ){
98
  if ( function_exists( 'wp_unslash' ) ) {
99
  return wp_unslash( $arg );
100
  } else {
@@ -102,4 +102,46 @@ class WPMDB_Utils {
102
  }
103
  }
104
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  }
61
  }
62
  }
63
  }
64
+
65
  /**
66
  * Return unserialized object or array
67
  *
68
+ * @param string $serialized_string Serialized string.
69
+ * @param string $method The name of the caller method.
70
  *
71
  * @return mixed, false on failure
72
  */
94
  *
95
  * @return string|array
96
  */
97
+ public static function safe_wp_unslash( $arg ) {
98
  if ( function_exists( 'wp_unslash' ) ) {
99
  return wp_unslash( $arg );
100
  } else {
102
  }
103
  }
104
 
105
+ /**
106
+ * Use gzdecode if available, otherwise fall back to gzinflate
107
+ *
108
+ * @param string $data
109
+ *
110
+ * @return string|bool
111
+ */
112
+ public static function gzdecode( $data ) {
113
+ if ( ! function_exists( 'gzdecode' ) ) {
114
+ return @gzinflate( substr( $data, 10, -8 ) );
115
+ }
116
+
117
+ return @gzdecode( $data );
118
+ }
119
+
120
+ /*
121
+ * Require wpmdb-wpdb and create new instance
122
+ *
123
+ * @return WPMDB_WPDB
124
+ */
125
+ public static function make_wpmdb_wpdb_instance() {
126
+ if ( ! class_exists( 'WPMDB_WPDB' ) ) {
127
+ require_once dirname( __FILE__ ) . '/wpmdb-wpdb.php';
128
+ }
129
+
130
+ return new WPMDB_WPDB();
131
+ }
132
+
133
+ /**
134
+ * Wrapper for replacing first instance of string
135
+ *
136
+ * @return string
137
+ */
138
+ public static function str_replace_first( $search, $replace, $string ) {
139
+ $pos = strpos( $string, $search );
140
+
141
+ if ( false !== $pos ) {
142
+ $string = substr_replace( $string, $replace, $pos, strlen( $search ) );
143
+ }
144
+
145
+ return $string;
146
+ }
147
  }
class/wpmdb-wpdb.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WPMDB_WPDB extends WPDB {
4
+
5
+ /**
6
+ * @var string
7
+ */
8
+ public $last_stripped_query;
9
+
10
+ public function __construct() {
11
+ global $wpdb;
12
+ parent::__construct( $wpdb->dbuser, $wpdb->dbpassword, $wpdb->dbname, $wpdb->dbhost );
13
+
14
+ // TODO: Determine if it's better to extend $wpdb or just rep some of its methods
15
+ }
16
+
17
+ /**
18
+ * Find the first table name referenced in a query.
19
+ *
20
+ * @param string $query The query to search.
21
+ *
22
+ * @return string|false $table The table name found, or false if a table couldn't be found.
23
+ */
24
+ public function get_table_from_query( $query ) {
25
+ return parent::get_table_from_query( $query );
26
+ }
27
+
28
+ /**
29
+ * Strips any invalid characters from the query and caches the stripped query for later use
30
+ *
31
+ * @param string $query Query to convert.
32
+ *
33
+ * @return string|WP_Error The converted query, or a WP_Error object if the conversion fails.
34
+ */
35
+ public function strip_invalid_text_from_query( $query ) {
36
+ $query = apply_filters( 'wpmdb_before_strip_invalid_text_from_query', $query );
37
+ $fallback = false;
38
+ if ( method_exists( $this, 'strip_invalid_text_from_query' ) ) {
39
+ $query = parent::strip_invalid_text_from_query( $query );
40
+ $this->flush();
41
+ } else {
42
+ $fallback = true;
43
+ }
44
+ $this->last_stripped_query = apply_filters( 'wpmdb_after_strip_invalid_text_from_query', $query, $fallback );
45
+
46
+ return $this->last_stripped_query;
47
+ }
48
+
49
+ /**
50
+ * Determine if a query has invalid text.
51
+ *
52
+ * @param $query query to check
53
+ *
54
+ * @return bool
55
+ */
56
+ public function query_has_invalid_text( $query ) {
57
+ return ( $query !== $this->strip_invalid_text_from_query( $query ) );
58
+ }
59
+
60
+ }
class/wpmdb.php CHANGED
@@ -25,13 +25,14 @@ class WPMDB extends WPMDB_Base {
25
  protected $query_template = '';
26
  protected $query_size = 0;
27
  protected $first_select = true;
 
28
  public $target_db_version = '';
 
29
 
30
  function __construct( $plugin_file_path ) {
31
  parent::__construct( $plugin_file_path );
32
 
33
  $this->plugin_version = $GLOBALS['wpmdb_meta'][ $this->core_slug ]['version'];
34
-
35
  $this->max_insert_string_len = 50000; // 50000 is the default as defined by PhpMyAdmin
36
 
37
  add_filter( 'plugin_action_links_' . $this->plugin_basename, array( $this, 'plugin_action_links' ) );
@@ -45,8 +46,7 @@ class WPMDB extends WPMDB_Base {
45
  add_action( 'wp_ajax_wpmdb_migrate_table', array( $this, 'ajax_migrate_table' ) );
46
  add_action( 'wp_ajax_wpmdb_clear_log', array( $this, 'ajax_clear_log' ) );
47
  add_action( 'wp_ajax_wpmdb_get_log', array( $this, 'ajax_get_log' ) );
48
- add_action( 'wp_ajax_wpmdb_plugin_compatibility', array( $this, 'ajax_plugin_compatibility' ) );
49
- add_action( 'wp_ajax_wpmdb_blacklist_plugins', array( $this, 'ajax_blacklist_plugins' ) );
50
  add_action( 'wp_ajax_wpmdb_update_max_request_size', array( $this, 'ajax_update_max_request_size' ) );
51
  add_action( 'wp_ajax_wpmdb_update_delay_between_requests', array( $this, 'ajax_update_delay_between_requests' ) );
52
  add_action( 'wp_ajax_wpmdb_cancel_migration', array( $this, 'ajax_cancel_migration' ) );
@@ -79,6 +79,7 @@ class WPMDB extends WPMDB_Base {
79
  'exclude_post_revisions',
80
  'compatibility_older_mysql',
81
  'export_dest',
 
82
  );
83
 
84
  $this->default_profile = array(
@@ -93,7 +94,7 @@ class WPMDB extends WPMDB_Base {
93
  'select_post_types' => array(),
94
  'backup_option' => 'backup_only_with_prefix',
95
  'exclude_transients' => '1',
96
- 'compatibility_older_mysql' => '1',
97
  );
98
 
99
  $this->checkbox_options = array(
@@ -106,6 +107,7 @@ class WPMDB extends WPMDB_Base {
106
  'exclude_post_types' => '0',
107
  'exclude_transients' => '0',
108
  'compatibility_older_mysql' => '0',
 
109
  );
110
 
111
  $this->plugin_tabs = array(
@@ -136,6 +138,69 @@ class WPMDB extends WPMDB_Base {
136
  } else {
137
  add_action( 'admin_menu', array( $this, 'admin_menu' ) );
138
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  }
140
 
141
  /**
@@ -159,54 +224,19 @@ class WPMDB extends WPMDB_Base {
159
  return $this->create_alter_table_query;
160
  }
161
 
162
- /**
163
- * Handler for ajax request to turn on or off Compatibility Mode.
164
- */
165
- function ajax_plugin_compatibility() {
166
- $this->check_ajax_referer( 'plugin_compatibility' );
167
-
168
- $key_rules = array(
169
- 'action' => 'key',
170
- 'install' => 'numeric',
171
- );
172
- $this->set_post_data( $key_rules );
173
-
174
- $mu_dir = ( defined( 'WPMU_PLUGIN_DIR' ) && defined( 'WPMU_PLUGIN_URL' ) ) ? WPMU_PLUGIN_DIR : trailingslashit( WP_CONTENT_DIR ) . 'mu-plugins';
175
- $source = trailingslashit( $this->plugin_dir_path ) . 'compatibility/wp-migrate-db-pro-compatibility.php';
176
- $dest = trailingslashit( $mu_dir ) . 'wp-migrate-db-pro-compatibility.php';
177
- if ( '1' === trim( $this->state_data['install'] ) ) { // install MU plugin
178
- if ( ! wp_mkdir_p( $mu_dir ) ) {
179
- printf( esc_html__( 'The following directory could not be created: %s', 'wp-migrate-db' ), $mu_dir );
180
- exit;
181
- }
182
-
183
- if ( ! @copy( $source, $dest ) ) {
184
- printf( esc_html__( 'Could not copy the compatibility plugin from %1$s to %2$s', 'wp-migrate-db' ), $source, $dest );
185
- exit;
186
- }
187
- } else { // uninstall MU plugin
188
- // TODO: Use WP_Filesystem API.
189
- if ( file_exists( $dest ) && ! @unlink( $dest ) ) {
190
- printf( esc_html__( 'Could not remove the compatibility plugin from %s', 'wp-migrate-db' ), $dest );
191
- exit;
192
- }
193
- }
194
- exit;
195
- }
196
-
197
  /**
198
  * Handler for updating the plugins that are not to be loaded during a request (Compatibility Mode).
199
  */
200
- function ajax_blacklist_plugins() {
201
- $this->check_ajax_referer( 'blacklist_plugins' );
202
 
203
  $key_rules = array(
204
  'action' => 'key',
205
- 'blacklist_plugins' => 'array',
206
  );
207
  $this->set_post_data( $key_rules );
208
 
209
- $this->settings['blacklist_plugins'] = (array) $this->state_data['blacklist_plugins'];
210
  update_site_option( 'wpmdb_settings', $this->settings );
211
  exit;
212
  }
@@ -300,7 +330,9 @@ class WPMDB extends WPMDB_Base {
300
  unset( $form_data['exclude_post_revisions'] );
301
  }
302
 
303
- return $form_data;
 
 
304
  }
305
 
306
  /**
@@ -374,6 +406,8 @@ class WPMDB extends WPMDB_Base {
374
  echo esc_html( home_url() );
375
  echo "\r\n";
376
 
 
 
377
  echo 'Database Name: ';
378
  echo esc_html( $wpdb->dbname );
379
  echo "\r\n";
@@ -382,8 +416,9 @@ class WPMDB extends WPMDB_Base {
382
  echo esc_html( $table_prefix );
383
  echo "\r\n";
384
 
385
- echo 'WordPress: ';
386
- echo bloginfo( 'version' );
 
387
  if ( is_multisite() ) {
388
  $multisite_type = defined( 'SUBDOMAIN_INSTALL' ) && SUBDOMAIN_INSTALL ? 'Sub-domain' : 'Sub-directory';
389
  echo ' Multisite (' . $multisite_type . ')';
@@ -410,8 +445,22 @@ class WPMDB extends WPMDB_Base {
410
  if ( defined( 'BLOG_ID_CURRENT_SITE' ) ) {
411
  echo 'Blog ID Current Site: ';
412
  echo BLOG_ID_CURRENT_SITE;
 
413
  }
 
 
414
  }
 
 
 
 
 
 
 
 
 
 
 
415
  echo "\r\n";
416
 
417
  echo 'Web Server: ';
@@ -424,18 +473,17 @@ class WPMDB extends WPMDB_Base {
424
  }
425
  echo "\r\n";
426
 
427
- echo 'MySQL: ';
428
- echo esc_html( empty( $wpdb->use_mysqli ) ? mysql_get_server_info() : mysqli_get_server_info( $wpdb->dbh ) );
429
- echo "\r\n";
430
-
431
- echo 'ext/mysqli: ';
432
- echo empty( $wpdb->use_mysqli ) ? 'no' : 'yes';
433
- echo "\r\n";
434
 
435
  echo 'WP Memory Limit: ';
436
  echo esc_html( WP_MEMORY_LIMIT );
437
  echo "\r\n";
438
 
 
 
 
 
 
 
439
  echo 'Blocked External HTTP Requests: ';
440
  if ( ! defined( 'WP_HTTP_BLOCK_EXTERNAL' ) || ! WP_HTTP_BLOCK_EXTERNAL ) {
441
  echo 'None';
@@ -450,8 +498,46 @@ class WPMDB extends WPMDB_Base {
450
  }
451
  echo "\r\n";
452
 
453
- echo 'WPMDB Bottleneck: ';
454
- echo esc_html( size_format( $this->get_bottleneck() ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
455
  echo "\r\n";
456
 
457
  echo 'WP Locale: ';
@@ -462,34 +548,26 @@ class WPMDB extends WPMDB_Base {
462
  echo esc_html( DB_CHARSET );
463
  echo "\r\n";
464
 
465
- if ( function_exists( 'ini_get' ) && $suhosin_limit = ini_get( 'suhosin.post.max_value_length' ) ) {
466
- echo 'Suhosin Post Max Value Length: ';
467
- echo esc_html( is_numeric( $suhosin_limit ) ? size_format( $suhosin_limit ) : $suhosin_limit );
468
- echo "\r\n";
469
- }
470
 
471
- if ( function_exists( 'ini_get' ) && $suhosin_limit = ini_get( 'suhosin.request.max_value_length' ) ) {
472
- echo 'Suhosin Request Max Value Length: ';
473
- echo esc_html( is_numeric( $suhosin_limit ) ? size_format( $suhosin_limit ) : $suhosin_limit );
474
- echo "\r\n";
475
- }
476
 
477
  echo 'Debug Mode: ';
478
  echo esc_html( ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? 'Yes' : 'No' );
479
  echo "\r\n";
480
 
481
- echo 'WP Max Upload Size: ';
482
- echo esc_html( size_format( wp_max_upload_size() ) );
483
  echo "\r\n";
484
 
485
- echo 'PHP Post Max Size: ';
486
- echo esc_html( size_format( $this->get_post_max_size() ) );
487
  echo "\r\n";
488
 
489
- echo 'PHP Time Limit: ';
490
- if ( function_exists( 'ini_get' ) ) {
491
- echo esc_html( ini_get( 'max_execution_time' ) );
492
- }
493
  echo "\r\n";
494
 
495
  echo 'PHP Error Log: ';
@@ -498,40 +576,37 @@ class WPMDB extends WPMDB_Base {
498
  }
499
  echo "\r\n";
500
 
501
- echo 'fsockopen: ';
502
- if ( function_exists( 'fsockopen' ) ) {
503
- echo 'Enabled';
504
- } else {
505
- echo 'Disabled';
506
- }
507
  echo "\r\n";
508
 
509
- echo 'OpenSSL: ';
510
- if ( $this->open_ssl_enabled() ) {
511
- echo esc_html( OPENSSL_VERSION_TEXT );
512
- } else {
513
- echo 'Disabled';
514
- }
515
  echo "\r\n";
516
 
517
- echo 'cURL: ';
518
- if ( function_exists( 'curl_init' ) ) {
519
- echo 'Enabled';
520
- } else {
521
- echo 'Disabled';
522
- }
523
  echo "\r\n";
524
 
525
- echo 'Enable SSL verification setting: ';
526
- if ( 1 == $this->settings['verify_ssl'] ) {
527
- echo 'Yes';
528
- } else {
529
- echo 'No';
 
 
 
 
 
530
  }
 
 
 
 
 
531
  echo "\r\n";
532
 
533
  echo 'Compatibility Mode: ';
534
- if ( isset( $GLOBALS['wpmdb_compatibility'] ) ) {
535
  echo 'Yes';
536
  } else {
537
  echo 'No';
@@ -544,6 +619,42 @@ class WPMDB extends WPMDB_Base {
544
  echo esc_html( $delay_between_requests ) . ' s';
545
  echo "\r\n\r\n";
546
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
547
  do_action( 'wpmdb_diagnostic_info' );
548
  if ( has_action( 'wpmdb_diagnostic_info' ) ) {
549
  echo "\r\n";
@@ -563,12 +674,10 @@ class WPMDB extends WPMDB_Base {
563
 
564
  echo "Active Plugins:\r\n";
565
 
566
- if ( isset( $GLOBALS['wpmdb_compatibility'] ) ) {
567
- remove_filter( 'option_active_plugins', 'wpmdbc_exclude_plugins' );
568
- remove_filter( 'site_option_active_sitewide_plugins', 'wpmdbc_exclude_site_plugins' );
569
- $blacklist = array_flip( (array) $this->settings['blacklist_plugins'] );
570
  } else {
571
- $blacklist = array();
572
  }
573
 
574
  $active_plugins = (array) get_option( 'active_plugins', array() );
@@ -579,13 +688,8 @@ class WPMDB extends WPMDB_Base {
579
  }
580
 
581
  foreach ( $active_plugins as $plugin ) {
582
- $suffix = ( isset( $blacklist[ $plugin ] ) ) ? '*' : '';
583
- $this->print_plugin_details( WP_PLUGIN_DIR . '/' . $plugin, $suffix );
584
- }
585
-
586
- if ( isset( $GLOBALS['wpmdb_compatibility'] ) ) {
587
- add_filter( 'option_active_plugins', 'wpmdbc_exclude_plugins' );
588
- add_filter( 'site_option_active_sitewide_plugins', 'wpmdbc_exclude_site_plugins' );
589
  }
590
 
591
  $mu_plugins = wp_get_mu_plugins();
@@ -602,13 +706,13 @@ class WPMDB extends WPMDB_Base {
602
  }
603
  }
604
 
605
- function print_plugin_details( $plugin_path, $suffix = '' ) {
606
  $plugin_data = get_plugin_data( $plugin_path );
607
  if ( empty( $plugin_data['Name'] ) ) {
608
  return;
609
  }
610
 
611
- printf( "%s%s (v%s) by %s\r\n", $plugin_data['Name'], $suffix, $plugin_data['Version'], $plugin_data['AuthorName'] );
612
  }
613
 
614
  function remove_wp_plugin_dir( $name ) {
@@ -659,15 +763,74 @@ class WPMDB extends WPMDB_Base {
659
  if ( false === $wpdb->query( $query ) ) {
660
  $return = ob_get_clean();
661
  $return = array( 'wpmdb_error' => 1, 'body' => $return );
662
- $result = $this->end_ajax( json_encode( $return ) );
663
 
664
- return $result;
 
 
 
 
 
 
 
 
 
665
  }
666
  }
667
 
668
  return true;
669
  }
670
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
671
  /**
672
  * Called for each database table to be migrated.
673
  *
@@ -690,6 +853,7 @@ class WPMDB extends WPMDB_Base {
690
  'prefix' => 'string',
691
  'path_current_site' => 'string',
692
  'domain_current_site' => 'text',
 
693
  );
694
  $this->set_post_data( $key_rules );
695
 
@@ -697,7 +861,9 @@ class WPMDB extends WPMDB_Base {
697
 
698
  $this->form_data = $this->parse_migration_form_data( $this->state_data['form_data'] );
699
 
700
- $result = '';
 
 
701
 
702
  // checks if we're performing a backup, if so, continue with the backup and exit immediately after
703
  if ( $this->state_data['stage'] == 'backup' && $this->state_data['intent'] != 'savefile' ) {
@@ -750,7 +916,7 @@ class WPMDB extends WPMDB_Base {
750
 
751
  // Pull and push need to be handled differently for obvious reasons,
752
  // and trigger different code depending on the migration intent (push or pull).
753
- if ( in_array( $this->state_data['intent'], array( 'push', 'savefile', 'find_replace' ) ) ) {
754
  $this->maximum_chunk_size = $this->get_bottleneck();
755
 
756
  if ( isset( $this->state_data['bottleneck'] ) ) {
@@ -898,34 +1064,48 @@ class WPMDB extends WPMDB_Base {
898
  $this->check_ajax_referer( 'initiate-migration' );
899
 
900
  $key_rules = array(
901
- 'action' => 'key',
902
- 'intent' => 'key',
903
- 'url' => 'url',
904
- 'key' => 'string',
905
- 'form_data' => 'string',
906
- 'stage' => 'key',
907
- 'nonce' => 'key',
908
- 'temp_prefix' => 'string',
909
- 'site_details' => 'json_array',
910
- 'export_dest' => 'string',
 
911
  );
912
  $this->set_post_data( $key_rules );
913
 
914
  $this->form_data = $this->parse_migration_form_data( $this->state_data['form_data'] );
915
 
 
 
916
  // A little bit of house keeping.
917
  WPMDB_Migration_State::cleanup();
918
 
919
- if ( in_array( $this->state_data['intent'], array( 'find_replace', 'savefile' ) ) ) {
920
  $return = array(
921
  'code' => 200,
922
  'message' => 'OK',
923
  'body' => json_encode( array( 'error' => 0 ) ),
924
  );
925
 
 
 
 
 
 
 
 
 
 
 
 
926
  if ( in_array( $this->state_data['stage'], array( 'backup', 'migrate' ) ) ) {
927
  $return['dump_path'] = $this->get_sql_dump_info( $this->state_data['stage'], 'path' );
928
- $return['dump_filename'] = basename( $return['dump_path'] );
929
  $return['dump_url'] = $this->get_sql_dump_info( $this->state_data['stage'], 'url' );
930
  $dump_filename_no_extension = substr( $return['dump_filename'], 0, -4 );
931
 
@@ -948,6 +1128,16 @@ class WPMDB extends WPMDB_Base {
948
 
949
  $upload_path = $this->get_upload_info( 'path' );
950
 
 
 
 
 
 
 
 
 
 
 
951
  $this->fp = $this->open( $upload_path . DIRECTORY_SEPARATOR . $return['dump_filename'] );
952
  $this->db_backup_header();
953
  $this->close( $this->fp );
@@ -955,7 +1145,6 @@ class WPMDB extends WPMDB_Base {
955
 
956
  $return['dump_filename'] = $dump_filename_no_extension;
957
  }
958
-
959
  } else { // does one last check that our verification string is valid
960
  $data = array(
961
  'action' => 'wpmdb_remote_initiate_migration',
@@ -1008,7 +1197,7 @@ class WPMDB extends WPMDB_Base {
1008
  }
1009
 
1010
  if ( ! empty( $this->form_data['create_backup'] ) && $this->state_data['intent'] == 'pull' ) {
1011
- $return['dump_filename'] = basename( $this->get_sql_dump_info( 'backup', 'path' ) );
1012
  $return['dump_filename'] = substr( $return['dump_filename'], 0, -4 );
1013
  $return['dump_url'] = $this->get_sql_dump_info( 'backup', 'url' );
1014
  }
@@ -1104,28 +1293,43 @@ class WPMDB extends WPMDB_Base {
1104
  */
1105
  function finalize_migration() {
1106
  $this->set_post_data();
1107
- $tables = explode( ',', $this->state_data['tables'] );
1108
- $temp_prefix = ( isset( $this->state_data['temp_prefix'] ) ) ? $this->state_data['temp_prefix'] : $this->temp_prefix;
1109
- $temp_tables = array();
1110
- $type = $this->state_data['intent'];
 
1111
 
1112
  if ( isset( $this->state_data['type'] ) && 'push' === $this->state_data['type'] ) {
1113
  $type = 'push';
1114
  }
1115
 
1116
- if ( 'find_replace' === $this->state_data['intent'] ) {
1117
  $location = home_url();
1118
  } else {
1119
  $location = ( isset( $this->state_data['location'] ) ) ? $this->state_data['location'] : $this->state_data['url'];
1120
  }
1121
-
1122
- foreach ( $tables as $table ) {
1123
- $temp_tables[] = $temp_prefix . apply_filters(
 
 
 
 
 
 
 
 
 
 
 
 
 
1124
  'wpmdb_finalize_target_table_name',
1125
  $table,
1126
  $type,
1127
  $this->state_data['site_details']
1128
  );
 
1129
  }
1130
 
1131
  $sql = "SET FOREIGN_KEY_CHECKS=0;\n";
@@ -1139,7 +1343,6 @@ class WPMDB extends WPMDB_Base {
1139
  $sql .= "\n";
1140
  }
1141
 
1142
- $alter_table_name = $this->get_alter_table_name();
1143
  $sql .= $this->get_alter_queries();
1144
  $sql .= 'DROP TABLE IF EXISTS ' . $this->backquote( $alter_table_name ) . ";\n";
1145
 
@@ -1150,7 +1353,7 @@ class WPMDB extends WPMDB_Base {
1150
  return $result;
1151
  }
1152
 
1153
- if ( ! isset( $this->state_data['location'] ) && 'find_replace' !== $this->state_data['intent'] ) {
1154
  $data = array();
1155
  $data['action'] = 'wpmdb_fire_migration_complete';
1156
  $data['url'] = home_url();
@@ -1610,8 +1813,18 @@ class WPMDB extends WPMDB_Base {
1610
  $extension = '.sql';
1611
  $dump_name = sanitize_file_name( $dump_name );
1612
 
1613
- if ( $this->gzip() && isset( $this->form_data['gzip_file'] ) && $this->form_data['gzip_file'] ) {
1614
- $extension .= '.gz';
 
 
 
 
 
 
 
 
 
 
1615
  }
1616
 
1617
  return $dump_name . $extension;
@@ -1620,7 +1833,7 @@ class WPMDB extends WPMDB_Base {
1620
  function options_page() {
1621
  $this->template( 'options' );
1622
  }
1623
-
1624
  /**
1625
  * Load Tools HTML template for tools menu on sites in a Network to help users find WPMDB in Multisite
1626
  *
@@ -1638,19 +1851,19 @@ class WPMDB extends WPMDB_Base {
1638
  $this->set_post_data();
1639
 
1640
  if ( ! isset( $this->domain_replace ) ) {
1641
- if ( is_multisite() && ! empty( $this->state_data['domain_current_site'] ) ) {
1642
- $this->domain_replace = $this->state_data['domain_current_site'];
1643
- } elseif ( is_multisite() && ! empty( $this->form_data['replace_new'][1] ) ) {
1644
- $url = $this->form_data['replace_new'][1];
1645
- $url = $this->parse_url( $url );
1646
-
1647
- if ( isset( $url['host'] ) ) {
1648
- $this->domain_replace = $url['host'];
1649
- } else {
1650
- $this->domain_replace = false;
 
 
1651
  }
1652
- } else {
1653
- $this->domain_replace = false;
1654
  }
1655
  }
1656
 
@@ -1840,6 +2053,8 @@ class WPMDB extends WPMDB_Base {
1840
  }
1841
 
1842
  $this->query_template = 'INSERT INTO ' . $this->backquote( $table_to_insert ) . ' ( ' . $fields . ") VALUES\n";
 
 
1843
  }
1844
 
1845
  $this->query_buffer = $this->query_template;
@@ -1907,7 +2122,8 @@ class WPMDB extends WPMDB_Base {
1907
  }
1908
 
1909
  if ( ! $table_structure ) {
1910
- $this->error = __( 'Failed to retrieve table structure, please ensure your database is online. (#125)', 'wp-migrate-db' );
 
1911
  }
1912
 
1913
  return $table_structure;
@@ -1926,7 +2142,8 @@ class WPMDB extends WPMDB_Base {
1926
  }
1927
 
1928
  if ( ! is_array( $table_structure ) ) {
1929
- $return = array( 'wpmdb_error' => 1, 'body' => __( 'Failed to get table structure.', 'wpmdb' ) );
 
1930
  $result = $this->end_ajax( json_encode( $return ) );
1931
  return $result;
1932
  }
@@ -1950,9 +2167,9 @@ class WPMDB extends WPMDB_Base {
1950
  ) {
1951
  $defs[ strtolower( $struct->Field ) ] = ( null === $struct->Default ) ? 'NULL' : $struct->Default;
1952
  $ints[ strtolower( $struct->Field ) ] = '1';
1953
- } elseif ( 0 === strpos( $struct->Type, 'binary' ) ) {
1954
  $bins[ strtolower( $struct->Field ) ] = '1';
1955
- } elseif ( 0 === strpos( $struct->Type, 'bit' ) ) {
1956
  $bits[ strtolower( $struct->Field ) ] = '1';
1957
  }
1958
 
@@ -1997,10 +2214,10 @@ class WPMDB extends WPMDB_Base {
1997
  function pre_process_data( $table, $target_table_name, $temp_table_name ) {
1998
  if ( 0 !== $this->row_tracker ) return;
1999
 
2000
- if ( 'find_replace' === $this->form_data['action'] ) {
2001
  if ( 'backup' === $this->state_data['stage'] ) {
2002
  $this->build_table_header( $table, $target_table_name, $temp_table_name );
2003
- } else {
2004
  $create = $this->create_temp_table( $table );
2005
 
2006
  if ( true !== $create ) {
@@ -2244,13 +2461,14 @@ class WPMDB extends WPMDB_Base {
2244
  $join = array();
2245
  $where = 'WHERE 1=1';
2246
  $order_by = '';
 
2247
 
2248
  // We need ORDER BY here because with LIMIT, sometimes it will return
2249
  // the same results from the previous query and we'll have duplicate insert statements
2250
  if ( 'backup' != $this->state_data['stage'] && false === empty( $this->form_data['exclude_spam'] ) ) {
2251
- if ( $this->table_is( 'comments', $table ) ) {
2252
  $where .= ' AND comment_approved != "spam"';
2253
- } elseif ( $this->table_is( 'commentmeta', $table ) ) {
2254
  $tables = $this->get_ms_compat_table_names( array( 'commentmeta', 'comments' ), $table );
2255
  $join[] = sprintf( 'INNER JOIN %1$s ON %1$s.comment_ID = %2$s.comment_id', $this->backquote( $tables['comments_table'] ), $this->backquote( $tables['commentmeta_table'] ) );
2256
  $where .= sprintf( ' AND %1$s.comment_approved != \'spam\'', $this->backquote( $tables['comments_table'] ) );
@@ -2259,17 +2477,17 @@ class WPMDB extends WPMDB_Base {
2259
 
2260
  if ( 'backup' != $this->state_data['stage'] && isset( $this->form_data['exclude_post_types'] ) && ! empty( $this->form_data['select_post_types'] ) ) {
2261
  $post_types = '\'' . implode( '\', \'', $this->form_data['select_post_types'] ) . '\'';
2262
- if ( $this->table_is( 'posts', $table ) ) {
2263
  $where .= ' AND `post_type` NOT IN ( ' . $post_types . ' )';
2264
- } elseif ( $this->table_is( 'postmeta', $table ) ) {
2265
  $tables = $this->get_ms_compat_table_names( array( 'postmeta', 'posts' ), $table );
2266
  $join[] = sprintf( 'INNER JOIN %1$s ON %1$s.ID = %2$s.post_id', $this->backquote( $tables['posts_table'] ), $this->backquote( $tables['postmeta_table'] ) );
2267
  $where .= sprintf( ' AND %1$s.post_type NOT IN ( ' . $post_types . ' )', $this->backquote( $tables['posts_table'] ) );
2268
- } elseif ( $this->table_is( 'comments', $table ) ) {
2269
  $tables = $this->get_ms_compat_table_names( array( 'comments', 'posts' ), $table );
2270
  $join[] = sprintf( 'INNER JOIN %1$s ON %1$s.ID = %2$s.comment_post_ID', $this->backquote( $tables['posts_table'] ), $this->backquote( $tables['comments_table'] ) );
2271
  $where .= sprintf( ' AND %1$s.post_type NOT IN ( ' . $post_types . ' )', $this->backquote( $tables['posts_table'] ) );
2272
- } elseif ( $this->table_is( 'commentmeta', $table ) ) {
2273
  $tables = $this->get_ms_compat_table_names( array( 'commentmeta', 'posts', 'comments' ), $table );
2274
  $join[] = sprintf( 'INNER JOIN %1$s ON %1$s.comment_ID = %2$s.comment_id', $this->backquote( $tables['comments_table'] ), $this->backquote( $tables['commentmeta_table'] ) );
2275
  $join[] = sprintf( 'INNER JOIN %2$s ON %2$s.ID = %1$s.comment_post_ID', $this->backquote( $tables['comments_table'] ), $this->backquote( $tables['posts_table'] ) );
@@ -2277,7 +2495,7 @@ class WPMDB extends WPMDB_Base {
2277
  }
2278
  }
2279
 
2280
- if ( 'backup' != $this->state_data['stage'] && true === apply_filters( 'wpmdb_exclude_transients', true ) && isset( $this->form_data['exclude_transients'] ) && '1' === $this->form_data['exclude_transients'] && ( $this->table_is( 'options', $table ) || ( isset( $wpdb->sitemeta ) && $wpdb->sitemeta == $table ) ) ) {
2281
  $col_name = 'option_name';
2282
 
2283
  if ( isset( $wpdb->sitemeta ) && $wpdb->sitemeta == $table ) {
@@ -2288,7 +2506,7 @@ class WPMDB extends WPMDB_Base {
2288
  }
2289
 
2290
  // don't export/migrate wpmdb specific option rows unless we're performing a backup
2291
- if ( 'backup' != $this->state_data['stage'] && ( $this->table_is( 'options', $table ) || ( isset( $wpdb->sitemeta ) && $wpdb->sitemeta == $table ) ) ) {
2292
  $col_name = 'option_name';
2293
 
2294
  if ( isset( $wpdb->sitemeta ) && $wpdb->sitemeta == $table ) {
@@ -2437,9 +2655,9 @@ class WPMDB extends WPMDB_Base {
2437
  continue;
2438
  }
2439
 
2440
- if ( is_multisite() && ( $wpdb->site == $table || $wpdb->blogs == $table ) ) {
2441
 
2442
- if ( ! in_array( $this->state_data['stage'], array( 'backup', 'find_replace' ) ) ) {
2443
 
2444
  if ( 'path' == $key ) {
2445
  $old_path_current_site = $this->get_path_current_site();
@@ -2447,6 +2665,8 @@ class WPMDB extends WPMDB_Base {
2447
 
2448
  if ( ! empty( $this->state_data['path_current_site'] ) ) {
2449
  $new_path_current_site = $this->state_data['path_current_site'];
 
 
2450
  } elseif ( ! empty ( $this->form_data['replace_new'][1] ) ) {
2451
  $new_path_current_site = $this->get_path_from_url( $this->form_data['replace_new'][1] );
2452
  }
@@ -2459,16 +2679,29 @@ class WPMDB extends WPMDB_Base {
2459
  }
2460
  }
2461
 
2462
- if ( 'domain' == $key ) {
2463
  if ( ! empty( $this->state_data['domain_current_site'] ) ) {
2464
  $main_domain_replace = $this->state_data['domain_current_site'];
 
 
2465
  } elseif ( ! empty ( $this->form_data['replace_new'][1] ) ) {
2466
  $url = $this->parse_url( $this->form_data['replace_new'][1] );
2467
  $main_domain_replace = $url['host'];
2468
  }
2469
 
2470
  $domain_replaces = array();
2471
- $main_domain_find = sprintf( '/%s/', preg_quote( $this->get_domain_current_site(), '/' ) );
 
 
 
 
 
 
 
 
 
 
 
2472
  if ( isset( $main_domain_replace ) ) {
2473
  $domain_replaces[ $main_domain_find ] = $main_domain_replace;
2474
  }
@@ -2509,7 +2742,12 @@ class WPMDB extends WPMDB_Base {
2509
  // Determine what to do with updates.
2510
  if ( 'find_replace' === $this->state_data['stage'] ) {
2511
  if ( $updates_pending && ! empty( $where_sql ) ) {
2512
- $table_to_update = $this->backquote( $this->temp_prefix . $table );
 
 
 
 
 
2513
  $query .= 'UPDATE ' . $table_to_update . ' SET ' . implode( ', ', $update_sql ) . ' WHERE ' . implode( ' AND ', array_filter( $where_sql ) ) . ";\n";
2514
  }
2515
  } else {
@@ -2671,8 +2909,8 @@ class WPMDB extends WPMDB_Base {
2671
  function get_ms_compat_table_names( $tables, $queried_table ) {
2672
  global $wpdb;
2673
 
2674
- // default table prefix
2675
- $prefix = $wpdb->base_prefix;
2676
  $prefix_escaped = preg_quote( $prefix, '/' );
2677
 
2678
  // if multisite, extract blog ID from queried table name and add to prefix
@@ -2693,12 +2931,59 @@ class WPMDB extends WPMDB_Base {
2693
  }
2694
 
2695
  function db_backup_header() {
 
 
2696
  $charset = ( defined( 'DB_CHARSET' ) ? DB_CHARSET : 'utf8' );
2697
  $this->stow( '# ' . __( 'WordPress MySQL database migration', 'wp-migrate-db' ) . "\n", false );
2698
  $this->stow( "#\n", false );
2699
  $this->stow( '# ' . sprintf( __( 'Generated: %s', 'wp-migrate-db' ), date( 'l j. F Y H:i T' ) ) . "\n", false );
2700
  $this->stow( '# ' . sprintf( __( 'Hostname: %s', 'wp-migrate-db' ), DB_HOST ) . "\n", false );
2701
  $this->stow( '# ' . sprintf( __( 'Database: %s', 'wp-migrate-db' ), $this->backquote( DB_NAME ) ) . "\n", false );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2702
  $this->stow( "# --------------------------------------------------------\n\n", false );
2703
  $this->stow( "/*!40101 SET NAMES $charset */;\n\n", false );
2704
  $this->stow( "SET sql_mode='NO_AUTO_VALUE_ON_ZERO';\n\n", false );
@@ -2748,7 +3033,7 @@ class WPMDB extends WPMDB_Base {
2748
  return true;
2749
  }
2750
 
2751
- if ( $this->form_data['action'] == 'savefile' || $this->state_data['stage'] == 'backup' ) {
2752
  if ( $this->gzip() && isset( $this->form_data['gzip_file'] ) && $this->form_data['gzip_file'] ) {
2753
  if ( ! @gzwrite( $this->fp, $query_line ) ) {
2754
  $this->error = __( 'Failed to write the gzipped SQL data to the file. (#127)', 'wp-migrate-db' );
@@ -2778,7 +3063,7 @@ class WPMDB extends WPMDB_Base {
2778
  function transfer_chunk() {
2779
  $this->set_post_data();
2780
 
2781
- if ( 'savefile' === $this->state_data['intent'] || 'find_replace' === $this->state_data['intent'] || 'backup' === $this->state_data['stage'] ) {
2782
 
2783
  if ( 'find_replace' === $this->state_data['stage'] ) {
2784
  $this->process_chunk( $this->query_buffer );
@@ -2839,10 +3124,16 @@ class WPMDB extends WPMDB_Base {
2839
  }
2840
 
2841
  if ( '1' !== $response ) {
 
 
 
 
 
 
 
2842
  $return = array( 'wpmdb_error' => 1, 'body' => $response );
2843
- $result = $this->end_ajax( json_encode( $return ) );
2844
 
2845
- return $result;
2846
  }
2847
 
2848
  $result = $this->end_ajax( json_encode(
@@ -2910,18 +3201,18 @@ class WPMDB extends WPMDB_Base {
2910
  array( $this, 'options_page' ) );
2911
  $this->after_admin_menu( $hook_suffix );
2912
  }
2913
-
2914
  /**
2915
  * Add a tools menu item to sites on a Multisite network
2916
  *
2917
  */
2918
  function network_tools_admin_menu() {
2919
- add_management_page(
2920
  $this->get_plugin_title(),
2921
  $this->get_plugin_title(),
2922
  'manage_network_options',
2923
  $this->core_slug,
2924
- array( $this, 'subsite_tools_options_page' )
2925
  );
2926
  }
2927
 
@@ -3100,6 +3391,9 @@ class WPMDB extends WPMDB_Base {
3100
  $src = $plugins_url . "asset/dist/js/script{$ver_string}{$min}.js";
3101
  wp_enqueue_script( 'wp-migrate-db-pro-script', $src, array( 'jquery', 'backbone' ), $version, true );
3102
 
 
 
 
3103
  wp_localize_script( 'wp-migrate-db-pro-script',
3104
  'wpmdb_strings',
3105
  array(
@@ -3115,6 +3409,7 @@ class WPMDB extends WPMDB_Base {
3115
  'update_log_problem' => __( 'An error occurred when trying to update the debug log. Please contact support. (#133)', 'wp-migrate-db' ),
3116
  'please_select_one_table' => __( 'Please select at least one table to migrate.', 'wp-migrate-db' ),
3117
  'please_select_one_table_backup' => __( 'Please select at least one table for backup.', 'wp-migrate-db' ),
 
3118
  'enter_name_for_profile' => __( 'Please enter a name for your migration profile.', 'wp-migrate-db' ),
3119
  'save_profile_problem' => __( 'An error occurred when attempting to save the migration profile. Please see the Help tab for details on how to request support. (#118)', 'wp-migrate-db' ),
3120
  'exporting_complete' => _x( 'Export complete', 'Data has been successfully exported', 'wp-migrate-db' ),
@@ -3184,6 +3479,8 @@ class WPMDB extends WPMDB_Base {
3184
  'push_migration_label_completed' => __( 'Push to %s complete', 'wp-migrate-db' ),
3185
  'find_replace_label_migrating' => __( 'Running Find & Replace…', 'wp-migrate-db' ),
3186
  'find_replace_label_completed' => __( 'Find & Replace complete', 'wp-migrate-db' ),
 
 
3187
  'copying_license' => __( 'Copying license to the remote site, please wait', 'wp-migrate-db' ),
3188
  'attempting_to_activate_licence' => __( 'Attempting to activate your license, please wait…', 'wp-migrate-db' ),
3189
  'licence_reactivated' => __( 'License successfully activated, please wait…', 'wp-migrate-db' ),
@@ -3201,6 +3498,8 @@ class WPMDB extends WPMDB_Base {
3201
  'migrate_button_pull_save' => _x( 'Pull &amp; Save', 'Transfer the remote database to this site and save migration profile', 'wp-migrate-db' ),
3202
  'migrate_button_export' => _x( 'Export', 'Download a copy of the database', 'wp-migrate-db' ),
3203
  'migrate_button_export_save' => _x( 'Export &amp; Save', 'Download a copy of the database and save migration profile', 'wp-migrate-db' ),
 
 
3204
  'migrate_button_find_replace' => _x( 'Find &amp; Replace', 'Run a find and replace on the database', 'wp-migrate-db' ),
3205
  'migrate_button_find_replace_save' => _x( 'Find &amp; Replace &amp; Save', 'Run a find and replace and save migration profile', 'wp-migrate-db' ),
3206
  'tables' => _x( 'Tables', 'database tables', 'wp-migrate-db'),
@@ -3221,6 +3520,13 @@ class WPMDB extends WPMDB_Base {
3221
  'title_error' => __( 'Failed', 'wp-migrate-db' ),
3222
  'progress_items_truncated_msg' => __( '%1$s items are not shown to maintain browser performance', 'wp-migrate-db' ),
3223
  'clear_error_log' => _x( 'Cleared', 'Error log emptied', 'wp-migrate-db' ),
 
 
 
 
 
 
 
3224
  )
3225
  );
3226
 
@@ -3246,17 +3552,23 @@ class WPMDB extends WPMDB_Base {
3246
  $salt = substr( $filename, $last_dash, 6 );
3247
  $filename_no_salt = str_replace( $salt, '', $filename );
3248
 
 
3249
  if ( file_exists( $diskfile ) ) {
3250
- header( 'Content-Description: File Transfer' );
3251
- header( 'Content-Type: application/octet-stream' );
3252
- header( 'Content-Length: ' . filesize( $diskfile ) );
3253
- header( 'Content-Disposition: attachment; filename=' . $filename_no_salt );
3254
- $success = readfile( $diskfile );
3255
- // TODO: Use WP_Filesystem API.
3256
- unlink( $diskfile );
3257
- exit;
 
 
 
 
 
3258
  } else {
3259
- wp_die( __( 'Could not find the file to download:', 'wp-migrate-db' ) . '<br />' . esc_html( $diskfile ) );
3260
  }
3261
  }
3262
 
@@ -3288,8 +3600,9 @@ class WPMDB extends WPMDB_Base {
3288
  'process_notice_link' => wp_create_nonce( 'process-notice-link' ),
3289
  'flush' => wp_create_nonce( 'flush' ),
3290
  'plugin_compatibility' => wp_create_nonce( 'plugin_compatibility' ),
3291
- 'blacklist_plugins' => wp_create_nonce( 'blacklist_plugins' ),
3292
- 'cancel_migration' => wp_create_nonce( 'cancel_migration' )
 
3293
  ) );
3294
 
3295
  $data = apply_filters( 'wpmdb_data', array(
@@ -3328,6 +3641,7 @@ class WPMDB extends WPMDB_Base {
3328
  'lower_case_table_names' => esc_html( $this->get_lower_case_table_names_setting() ),
3329
  'subsites' => $site_details['subsites'], // TODO: Remove backwards compatibility.
3330
  'site_details' => $this->site_details(),
 
3331
  ) );
3332
 
3333
  wp_localize_script( 'wp-migrate-db-pro-script', 'wpmdb_data', $data );
@@ -3442,6 +3756,26 @@ class WPMDB extends WPMDB_Base {
3442
  case 'find_replace' :
3443
  $this->delete_temporary_tables( $this->temp_prefix );
3444
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3445
  default:
3446
  break;
3447
  }
@@ -3462,15 +3796,14 @@ class WPMDB extends WPMDB_Base {
3462
 
3463
  $dump_file = $this->get_upload_info( 'path' ) . DIRECTORY_SEPARATOR . $dump_file;
3464
 
3465
- if ( empty( $dump_file ) || false == file_exists( $dump_file ) ) {
3466
- _e( 'MySQL export file not found.', 'wp-migrate-db' );
3467
- exit;
3468
  }
3469
 
3470
- // TODO: Use WP_Filesystem API.
3471
- if ( false === @unlink( $dump_file ) ) {
3472
- _e( 'Could not delete the MySQL export file.', 'wp-migrate-db' );
3473
- exit;
3474
  }
3475
  }
3476
 
@@ -3480,7 +3813,7 @@ class WPMDB extends WPMDB_Base {
3480
 
3481
  function template_compatibility() {
3482
  $args = array(
3483
- 'plugin_compatibility_checked' => ( isset( $GLOBALS['wpmdb_compatibility'] ) ? true : false ),
3484
  );
3485
  $this->template( 'compatibility', 'common', $args );
3486
  }
@@ -3591,8 +3924,10 @@ class WPMDB extends WPMDB_Base {
3591
  if ( version_compare( $db_version, '5.6', '<' ) ) {
3592
  // Convert utf8m4_unicode_520_ci collation to utf8mb4_unicode_ci if less than mysql 5.6
3593
  $create_table = str_replace( 'utf8mb4_unicode_520_ci', 'utf8mb4_unicode_ci', $create_table );
 
3594
  } elseif ( apply_filters( 'wpmdb_convert_to_520', true ) ) {
3595
  $create_table = str_replace( 'utf8mb4_unicode_ci', 'utf8mb4_unicode_520_ci', $create_table );
 
3596
  }
3597
 
3598
  if ( version_compare( $db_version, '5.5.3', '<' ) ) {
@@ -3622,7 +3957,7 @@ class WPMDB extends WPMDB_Base {
3622
  }
3623
 
3624
  if ( true === $abort_utf8mb4 && 0 !== $replace_count ) {
3625
- $return = sprintf( __( 'The source site supports utf8mb4 data but the target does not, aborting migration to avoid possible data corruption. Please see %1$s for more information. (#148)', 'wp-migrate-db-pro' ), sprintf( '<a href="https://deliciousbrains.com/wp-migrate-db-pro/doc/source-site-supports-utf8mb4/">%1$s</a>', __( 'our documentation', 'wp-migrate-db-pro' ) ) );
3626
  $return = array( 'wpmdb_error' => 1, 'body' => $return );
3627
  $result = $this->end_ajax( json_encode( $return ) );
3628
 
@@ -3683,7 +4018,7 @@ class WPMDB extends WPMDB_Base {
3683
 
3684
  <p><?php _e( "As a result, uppercase characters in table names will be converted to lowercase during the migration.", 'wp-migrate-db' ); ?></p>
3685
 
3686
- <p><?php printf( __( 'You can read more about this in <a href="%s">our documentation</a>, proceed with caution.', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/mixed-case-table-names/' ); ?></p>
3687
  <?php
3688
  return wptexturize( ob_get_clean() );
3689
  }
25
  protected $query_template = '';
26
  protected $query_size = 0;
27
  protected $first_select = true;
28
+ public $wpdb;
29
  public $target_db_version = '';
30
+ public $compatibility_plugin_manager;
31
 
32
  function __construct( $plugin_file_path ) {
33
  parent::__construct( $plugin_file_path );
34
 
35
  $this->plugin_version = $GLOBALS['wpmdb_meta'][ $this->core_slug ]['version'];
 
36
  $this->max_insert_string_len = 50000; // 50000 is the default as defined by PhpMyAdmin
37
 
38
  add_filter( 'plugin_action_links_' . $this->plugin_basename, array( $this, 'plugin_action_links' ) );
46
  add_action( 'wp_ajax_wpmdb_migrate_table', array( $this, 'ajax_migrate_table' ) );
47
  add_action( 'wp_ajax_wpmdb_clear_log', array( $this, 'ajax_clear_log' ) );
48
  add_action( 'wp_ajax_wpmdb_get_log', array( $this, 'ajax_get_log' ) );
49
+ add_action( 'wp_ajax_wpmdb_whitelist_plugins', array( $this, 'ajax_whitelist_plugins' ) );
 
50
  add_action( 'wp_ajax_wpmdb_update_max_request_size', array( $this, 'ajax_update_max_request_size' ) );
51
  add_action( 'wp_ajax_wpmdb_update_delay_between_requests', array( $this, 'ajax_update_delay_between_requests' ) );
52
  add_action( 'wp_ajax_wpmdb_cancel_migration', array( $this, 'ajax_cancel_migration' ) );
79
  'exclude_post_revisions',
80
  'compatibility_older_mysql',
81
  'export_dest',
82
+ 'import_find_replace',
83
  );
84
 
85
  $this->default_profile = array(
94
  'select_post_types' => array(),
95
  'backup_option' => 'backup_only_with_prefix',
96
  'exclude_transients' => '1',
97
+ 'compatibility_older_mysql' => '0',
98
  );
99
 
100
  $this->checkbox_options = array(
107
  'exclude_post_types' => '0',
108
  'exclude_transients' => '0',
109
  'compatibility_older_mysql' => '0',
110
+ 'import_find_replace' => '0',
111
  );
112
 
113
  $this->plugin_tabs = array(
138
  } else {
139
  add_action( 'admin_menu', array( $this, 'admin_menu' ) );
140
  }
141
+
142
+ if ( class_exists( 'WPMDB_Compatibility_Plugin_Manager' ) ) {
143
+ // Initialize the WPMDB_Compatibility_Plugin_Manager class to handle the `Compatibility Mode' MU Plugin
144
+ $this->compatibility_plugin_manager = new WPMDB_Compatibility_Plugin_Manager( $this );
145
+ }
146
+
147
+ // Add some custom JS into the WP admin pages
148
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_common_js' ) );
149
+
150
+ add_action( 'wp_ajax_wpmdb_process_notice_link', array( $this, 'ajax_process_notice_link' ) );
151
+ }
152
+
153
+ public function enqueue_common_js( $hook ) {
154
+
155
+ if ( 'plugins.php' != $hook ) {
156
+ return;
157
+ }
158
+
159
+ $ver_string = '-' . str_replace( '.', '', $this->plugin_version );
160
+ $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
161
+
162
+ $src = plugins_url( "asset/dist/js/common{$ver_string}{$min}.js", dirname( __FILE__ ) );
163
+ wp_enqueue_script( 'wp-migrate-db-pro-common', $src, array( 'jquery' ), false, true );
164
+
165
+ $src = plugins_url( "asset/dist/js/dismissable-notices{$ver_string}{$min}.js", dirname( __FILE__ ) );
166
+ wp_enqueue_script( 'wp-migrate-db-pro-dismissable-notices', $src, array( 'jquery' ), false, true );
167
+
168
+ wp_localize_script( 'wp-migrate-db-pro-dismissable-notices', 'wpmdb_nonces', array( 'process_notice_link' => wp_create_nonce( 'process-notice-link' ) ) );
169
+ }
170
+
171
+ /**
172
+ * Handler for ajax request to process a link click in a notice, e.g. licence deactivated ... re-check.
173
+ *
174
+ * @return bool|null
175
+ */
176
+ function ajax_process_notice_link() {
177
+ $this->check_ajax_referer( 'process-notice-link' );
178
+
179
+ $key_rules = array(
180
+ 'action' => 'key',
181
+ 'nonce' => 'key',
182
+ 'notice' => 'key',
183
+ 'type' => 'key',
184
+ 'reminder' => 'int',
185
+ );
186
+
187
+ $_POST = WPMDB_Sanitize::sanitize_data( $_POST, $key_rules, __METHOD__ );
188
+
189
+ if ( false === $_POST ) {
190
+ exit;
191
+ }
192
+
193
+ global $current_user;
194
+ $key = 'wpmdb_' . $_POST['type'] . '_' . $_POST['notice'];
195
+ $value = true;
196
+ if ( 'reminder' == $_POST['type'] && isset( $_POST['reminder'] ) ) {
197
+ $value = strtotime( 'now' ) + ( is_numeric( $_POST['reminder'] ) ? $_POST['reminder'] : 604800 );
198
+ }
199
+ update_user_meta( $current_user->ID, $key, $value );
200
+
201
+ $result = $this->end_ajax();
202
+
203
+ return $result;
204
  }
205
 
206
  /**
224
  return $this->create_alter_table_query;
225
  }
226
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
227
  /**
228
  * Handler for updating the plugins that are not to be loaded during a request (Compatibility Mode).
229
  */
230
+ function ajax_whitelist_plugins() {
231
+ $this->check_ajax_referer( 'whitelist_plugins' );
232
 
233
  $key_rules = array(
234
  'action' => 'key',
235
+ 'whitelist_plugins' => 'array',
236
  );
237
  $this->set_post_data( $key_rules );
238
 
239
+ $this->settings['whitelist_plugins'] = (array) $this->state_data['whitelist_plugins'];
240
  update_site_option( 'wpmdb_settings', $this->settings );
241
  exit;
242
  }
330
  unset( $form_data['exclude_post_revisions'] );
331
  }
332
 
333
+ $this->form_data = $form_data;
334
+
335
+ return $this->form_data;
336
  }
337
 
338
  /**
406
  echo esc_html( home_url() );
407
  echo "\r\n";
408
 
409
+ echo "\r\n";
410
+
411
  echo 'Database Name: ';
412
  echo esc_html( $wpdb->dbname );
413
  echo "\r\n";
416
  echo esc_html( $table_prefix );
417
  echo "\r\n";
418
 
419
+ echo "\r\n";
420
+
421
+ echo 'WordPress: ' . get_bloginfo( 'version' );
422
  if ( is_multisite() ) {
423
  $multisite_type = defined( 'SUBDOMAIN_INSTALL' ) && SUBDOMAIN_INSTALL ? 'Sub-domain' : 'Sub-directory';
424
  echo ' Multisite (' . $multisite_type . ')';
445
  if ( defined( 'BLOG_ID_CURRENT_SITE' ) ) {
446
  echo 'Blog ID Current Site: ';
447
  echo BLOG_ID_CURRENT_SITE;
448
+ echo "\r\n";
449
  }
450
+ } else {
451
+ echo "\r\n";
452
  }
453
+
454
+ echo "\r\n";
455
+
456
+ foreach ( array_reverse( $GLOBALS['wpmdb_meta'] ) as $wpmdb_plugin => $wpmdb_plugin_info ) {
457
+ if ( strlen( $wpmdb_plugin ) > strlen( 'wp-migrate-db-pro' ) ) {
458
+ $wpmdb_plugin = str_replace( 'wp-migrate-db-pro-', '', $wpmdb_plugin );
459
+ }
460
+ $wpmdb_plugin = ucwords( str_replace( array( 'wp', 'db', 'cli', '-' ), array( 'WP', 'DB', 'CLI',' '), $wpmdb_plugin ) );
461
+ echo $wpmdb_plugin . ": " . $wpmdb_plugin_info['version'] . "\r\n";
462
+ }
463
+
464
  echo "\r\n";
465
 
466
  echo 'Web Server: ';
473
  }
474
  echo "\r\n";
475
 
 
 
 
 
 
 
 
476
 
477
  echo 'WP Memory Limit: ';
478
  echo esc_html( WP_MEMORY_LIMIT );
479
  echo "\r\n";
480
 
481
+ echo 'PHP Time Limit: ';
482
+ if ( function_exists( 'ini_get' ) ) {
483
+ echo esc_html( ini_get( 'max_execution_time' ) );
484
+ }
485
+ echo "\r\n";
486
+
487
  echo 'Blocked External HTTP Requests: ';
488
  if ( ! defined( 'WP_HTTP_BLOCK_EXTERNAL' ) || ! WP_HTTP_BLOCK_EXTERNAL ) {
489
  echo 'None';
498
  }
499
  echo "\r\n";
500
 
501
+ echo 'fsockopen: ';
502
+ if ( function_exists( 'fsockopen' ) ) {
503
+ echo 'Enabled';
504
+ } else {
505
+ echo 'Disabled';
506
+ }
507
+ echo "\r\n";
508
+
509
+ echo 'OpenSSL: ';
510
+ if ( $this->open_ssl_enabled() ) {
511
+ echo esc_html( OPENSSL_VERSION_TEXT );
512
+ } else {
513
+ echo 'Disabled';
514
+ }
515
+ echo "\r\n";
516
+
517
+ echo 'cURL: ';
518
+ if ( function_exists( 'curl_init' ) ) {
519
+ echo 'Enabled';
520
+ } else {
521
+ echo 'Disabled';
522
+ }
523
+ echo "\r\n";
524
+
525
+ echo 'Enable SSL verification setting: ';
526
+ if ( 1 == $this->settings['verify_ssl'] ) {
527
+ echo 'Yes';
528
+ } else {
529
+ echo 'No';
530
+ }
531
+
532
+ echo "\r\n";
533
+ echo "\r\n";
534
+
535
+ echo 'MySQL: ';
536
+ echo esc_html( empty( $wpdb->use_mysqli ) ? mysql_get_server_info() : mysqli_get_server_info( $wpdb->dbh ) );
537
+ echo "\r\n";
538
+
539
+ echo 'ext/mysqli: ';
540
+ echo empty( $wpdb->use_mysqli ) ? 'no' : 'yes';
541
  echo "\r\n";
542
 
543
  echo 'WP Locale: ';
548
  echo esc_html( DB_CHARSET );
549
  echo "\r\n";
550
 
551
+ echo 'WPMDB_STRIP_INVALID_TEXT: ';
552
+ echo esc_html( ( defined( 'WPMDB_STRIP_INVALID_TEXT' ) && WPMDB_STRIP_INVALID_TEXT ) ? 'Yes' : 'No' );
553
+ echo "\r\n";
 
 
554
 
555
+ echo "\r\n";
 
 
 
 
556
 
557
  echo 'Debug Mode: ';
558
  echo esc_html( ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? 'Yes' : 'No' );
559
  echo "\r\n";
560
 
561
+ echo 'Debug Log: ';
562
+ echo esc_html( ( defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) ? 'Yes' : 'No' );
563
  echo "\r\n";
564
 
565
+ echo 'Debug Display: ';
566
+ echo esc_html( ( defined( 'WP_DEBUG_DISPLAY' ) && WP_DEBUG_DISPLAY ) ? 'Yes' : 'No' );
567
  echo "\r\n";
568
 
569
+ echo 'Script Debug: ';
570
+ echo esc_html( ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? 'Yes' : 'No' );
 
 
571
  echo "\r\n";
572
 
573
  echo 'PHP Error Log: ';
576
  }
577
  echo "\r\n";
578
 
579
+
 
 
 
 
 
580
  echo "\r\n";
581
 
582
+ echo 'WP Max Upload Size: ';
583
+ echo esc_html( size_format( wp_max_upload_size() ) );
 
 
 
 
584
  echo "\r\n";
585
 
586
+ echo 'PHP Post Max Size: ';
587
+ echo esc_html( size_format( $this->get_post_max_size() ) );
 
 
 
 
588
  echo "\r\n";
589
 
590
+ if ( function_exists( 'ini_get' ) && $suhosin_limit = ini_get( 'suhosin.post.max_value_length' ) ) {
591
+ echo 'Suhosin Post Max Value Length: ';
592
+ echo esc_html( is_numeric( $suhosin_limit ) ? size_format( $suhosin_limit ) : $suhosin_limit );
593
+ echo "\r\n";
594
+ }
595
+
596
+ if ( function_exists( 'ini_get' ) && $suhosin_limit = ini_get( 'suhosin.request.max_value_length' ) ) {
597
+ echo 'Suhosin Request Max Value Length: ';
598
+ echo esc_html( is_numeric( $suhosin_limit ) ? size_format( $suhosin_limit ) : $suhosin_limit );
599
+ echo "\r\n";
600
  }
601
+
602
+ echo "\r\n";
603
+
604
+ echo 'WPMDB Bottleneck: ';
605
+ echo esc_html( size_format( $this->get_bottleneck() ) );
606
  echo "\r\n";
607
 
608
  echo 'Compatibility Mode: ';
609
+ if ( isset( $GLOBALS['wpmdb_compatibility']['active'] ) ) {
610
  echo 'Yes';
611
  } else {
612
  echo 'No';
619
  echo esc_html( $delay_between_requests ) . ' s';
620
  echo "\r\n\r\n";
621
 
622
+ echo 'WP_HOME: ';
623
+ echo esc_html( ( defined( 'WP_HOME' ) && WP_HOME ) ? WP_HOME : 'Not defined' );
624
+ echo "\r\n";
625
+
626
+ echo 'WP_SITEURL: ';
627
+ echo esc_html( ( defined( 'WP_SITEURL' ) && WP_SITEURL ) ? esc_html( WP_SITEURL ) : 'Not defined' );
628
+ echo "\r\n";
629
+
630
+ echo 'WP_CONTENT_URL: ';
631
+ echo esc_html( ( defined( 'WP_CONTENT_URL' ) && WP_CONTENT_URL ) ? WP_CONTENT_URL : 'Not defined' );
632
+ echo "\r\n";
633
+
634
+ echo 'WP_CONTENT_DIR: ';
635
+ echo esc_html( ( defined( 'WP_CONTENT_DIR' ) && WP_CONTENT_DIR ) ? WP_CONTENT_DIR : 'Not defined' );
636
+ echo "\r\n";
637
+
638
+ echo 'WP_PLUGIN_DIR: ';
639
+ echo esc_html( ( defined( 'WP_PLUGIN_DIR' ) ) ? WP_PLUGIN_DIR : 'Not defined' );
640
+ echo "\r\n";
641
+
642
+ echo 'WP_PLUGIN_URL: ';
643
+ echo esc_html( ( defined( 'WP_PLUGIN_URL' ) ) ? WP_PLUGIN_URL : 'Not defined' );
644
+ echo "\r\n";
645
+
646
+ if ( is_multisite() ) {
647
+ echo 'UPLOADS Constant: ';
648
+ echo esc_html( ( defined( 'UPLOADS' ) && UPLOADS ) ? UPLOADS : 'Not defined' );
649
+ echo "\r\n";
650
+
651
+ echo 'UPLOADBLOGSDIR Constant: ';
652
+ echo esc_html( ( defined( 'UPLOADBLOGSDIR' ) && UPLOADS ) ? UPLOADBLOGSDIR : 'Not defined' );
653
+ echo "\r\n";
654
+ }
655
+
656
+ echo "\r\n";
657
+
658
  do_action( 'wpmdb_diagnostic_info' );
659
  if ( has_action( 'wpmdb_diagnostic_info' ) ) {
660
  echo "\r\n";
674
 
675
  echo "Active Plugins:\r\n";
676
 
677
+ if ( isset( $GLOBALS['wpmdb_compatibility']['active'] ) ) {
678
+ $whitelist = array_flip( (array) $this->settings['whitelist_plugins'] );
 
 
679
  } else {
680
+ $whitelist = array();
681
  }
682
 
683
  $active_plugins = (array) get_option( 'active_plugins', array() );
688
  }
689
 
690
  foreach ( $active_plugins as $plugin ) {
691
+ $prefix = ( isset( $whitelist[ $plugin ] ) ) ? '*' : '';
692
+ $this->print_plugin_details( WP_PLUGIN_DIR . '/' . $plugin, $prefix );
 
 
 
 
 
693
  }
694
 
695
  $mu_plugins = wp_get_mu_plugins();
706
  }
707
  }
708
 
709
+ function print_plugin_details( $plugin_path, $prefix = '' ) {
710
  $plugin_data = get_plugin_data( $plugin_path );
711
  if ( empty( $plugin_data['Name'] ) ) {
712
  return;
713
  }
714
 
715
+ printf( "%s%s (v%s) by %s\r\n", $prefix, $plugin_data['Name'], $plugin_data['Version'], $plugin_data['AuthorName'] );
716
  }
717
 
718
  function remove_wp_plugin_dir( $name ) {
763
  if ( false === $wpdb->query( $query ) ) {
764
  $return = ob_get_clean();
765
  $return = array( 'wpmdb_error' => 1, 'body' => $return );
 
766
 
767
+ $invalid_text = $this->maybe_strip_invalid_text_and_retry( $query );
768
+ if ( false !== $invalid_text ) {
769
+ $return = $invalid_text;
770
+ }
771
+
772
+ if ( true !== $return ) {
773
+ $result = $this->end_ajax( json_encode( $return ) );
774
+
775
+ return $result;
776
+ }
777
  }
778
  }
779
 
780
  return true;
781
  }
782
 
783
+ /**
784
+ * Check if query failed due to invalid text and retry stripped query if WPMDB_STRIP_INVALID is defined as true
785
+ *
786
+ * @param string $query
787
+ * @param string $context
788
+ *
789
+ * @return array|bool|WP_Error
790
+ */
791
+ function maybe_strip_invalid_text_and_retry( $query, $context = 'default' ) {
792
+ global $wpdb;
793
+ $return = true;
794
+ // For insert/update queries, check if it's due to invalid text
795
+ if ( ! $wpdb->last_error && ( strstr( $query, 'INSERT' ) || strstr( $query, 'UPDATE' ) ) ) {
796
+ // Only instantiate WPMDB_WPDB if needed
797
+ if ( ! $this->wpdb ) {
798
+ $this->wpdb = WPMDB_Utils::make_wpmdb_wpdb_instance();
799
+ }
800
+ if ( $this->wpdb->query_has_invalid_text( $query ) ) {
801
+ if ( ! ( defined( 'WPMDB_STRIP_INVALID_TEXT' ) && WPMDB_STRIP_INVALID_TEXT ) ) {
802
+ $table = $this->wpdb->get_table_from_query( $query );
803
+ $table = str_replace( $this->temp_prefix, '', $table );
804
+
805
+ if ( 'import' === $context ) {
806
+ $message = sprintf( __( 'The imported table `%1s` contains characters which are invalid in the target schema.<br><br>If this is a WP Migrate DB Pro export file, ensure that the `Compatible with older versions of MySQL` setting under `Advanced Options` is unchecked and try exporting again.<br><br> See&nbsp;<a href="%2s">our documentation</a> for more information.', 'wp-migrate-db' ), $table, 'https://deliciousbrains.com/wp-migrate-db-pro/doc/invalid-text/#imports' );
807
+ $return = new WP_Error( 'import_sql_execution_failed', $message );
808
+ } else {
809
+ $message = sprintf( __( 'The table `%1s` contains characters which are invalid in the target database. See&nbsp;<a href="%2s">our documentation</a> for more information.', 'wp-migrate-db' ), $table, 'https://deliciousbrains.com/wp-migrate-db-pro/doc/invalid-text/' );
810
+ $return = array(
811
+ 'wpmdb_error' => 1,
812
+ 'body' => $message,
813
+ );
814
+ }
815
+
816
+ $this->log_error( $message );
817
+ error_log( $message . ":\n" . $query );
818
+
819
+ } else {
820
+ if ( false === $wpdb->query( $this->wpdb->last_stripped_query ) ) {
821
+ $error = ob_get_clean();
822
+
823
+ $return = new WP_Error( 'strip_invalid_text_query_failed', 'Failed to import the stripped SQL query: ' . $error );
824
+ } else {
825
+ $return = true;
826
+ }
827
+ }
828
+ }
829
+ }
830
+
831
+ return $return;
832
+ }
833
+
834
  /**
835
  * Called for each database table to be migrated.
836
  *
853
  'prefix' => 'string',
854
  'path_current_site' => 'string',
855
  'domain_current_site' => 'text',
856
+ 'import_info' => 'array',
857
  );
858
  $this->set_post_data( $key_rules );
859
 
861
 
862
  $this->form_data = $this->parse_migration_form_data( $this->state_data['form_data'] );
863
 
864
+ if ( 'import' === $this->state_data['intent'] && ! $this->table_exists( $this->state_data['table'] ) ) {
865
+ return $this->end_ajax( json_encode( array( 'current_row' => -1 ) ) );
866
+ }
867
 
868
  // checks if we're performing a backup, if so, continue with the backup and exit immediately after
869
  if ( $this->state_data['stage'] == 'backup' && $this->state_data['intent'] != 'savefile' ) {
916
 
917
  // Pull and push need to be handled differently for obvious reasons,
918
  // and trigger different code depending on the migration intent (push or pull).
919
+ if ( in_array( $this->state_data['intent'], array( 'push', 'savefile', 'find_replace', 'import' ) ) ) {
920
  $this->maximum_chunk_size = $this->get_bottleneck();
921
 
922
  if ( isset( $this->state_data['bottleneck'] ) ) {
1064
  $this->check_ajax_referer( 'initiate-migration' );
1065
 
1066
  $key_rules = array(
1067
+ 'action' => 'key',
1068
+ 'intent' => 'key',
1069
+ 'url' => 'url',
1070
+ 'key' => 'string',
1071
+ 'form_data' => 'string',
1072
+ 'stage' => 'key',
1073
+ 'nonce' => 'key',
1074
+ 'temp_prefix' => 'string',
1075
+ 'site_details' => 'json_array',
1076
+ 'export_dest' => 'string',
1077
+ 'import_info' => 'array',
1078
  );
1079
  $this->set_post_data( $key_rules );
1080
 
1081
  $this->form_data = $this->parse_migration_form_data( $this->state_data['form_data'] );
1082
 
1083
+ $this->log_usage( $this->state_data['intent'] );
1084
+
1085
  // A little bit of house keeping.
1086
  WPMDB_Migration_State::cleanup();
1087
 
1088
+ if ( in_array( $this->state_data['intent'], array( 'find_replace', 'savefile', 'import' ) ) ) {
1089
  $return = array(
1090
  'code' => 200,
1091
  'message' => 'OK',
1092
  'body' => json_encode( array( 'error' => 0 ) ),
1093
  );
1094
 
1095
+ if ( 'import' === $this->state_data['intent'] ) {
1096
+ $return['import_path'] = $this->get_sql_dump_info( 'import', 'path' );
1097
+ $return['import_filename'] = wp_basename( $return['import_path'], '.sql' );
1098
+
1099
+ if ( $this->gzip() && isset( $this->state_data['import_info']['import_gzipped'] ) && 'true' === $this->state_data['import_info']['import_gzipped'] ) {
1100
+ $return['import_path'] .= '.gz';
1101
+ }
1102
+
1103
+ $this->delete_temporary_tables( $this->temp_prefix );
1104
+ }
1105
+
1106
  if ( in_array( $this->state_data['stage'], array( 'backup', 'migrate' ) ) ) {
1107
  $return['dump_path'] = $this->get_sql_dump_info( $this->state_data['stage'], 'path' );
1108
+ $return['dump_filename'] = wp_basename( $return['dump_path'] );
1109
  $return['dump_url'] = $this->get_sql_dump_info( $this->state_data['stage'], 'url' );
1110
  $dump_filename_no_extension = substr( $return['dump_filename'], 0, -4 );
1111
 
1128
 
1129
  $upload_path = $this->get_upload_info( 'path' );
1130
 
1131
+ if ( false === $this->filesystem->is_writable( $upload_path ) ) {
1132
+ $error = sprintf( __( '<p><strong>Export Failed</strong> — We can\'t save your export to the following folder:<br><strong>%s</strong></p><p>Please adjust the permissions on this folder. <a href="%s" target="_blank">See our documentation for more information »</a></p>', 'wp-migrate-db' ), $upload_path, 'https://deliciousbrains.com/wp-migrate-db-pro/doc/uploads-folder-permissions/?utm_campaign=error%2Bmessages&utm_source=MDB%2BPaid&utm_medium=insideplugin' );
1133
+ $return = array(
1134
+ 'wpmdb_error' => 1,
1135
+ 'body' => $error,
1136
+ );
1137
+ $result = $this->end_ajax( json_encode( $return ) );
1138
+ return $result;
1139
+ }
1140
+
1141
  $this->fp = $this->open( $upload_path . DIRECTORY_SEPARATOR . $return['dump_filename'] );
1142
  $this->db_backup_header();
1143
  $this->close( $this->fp );
1145
 
1146
  $return['dump_filename'] = $dump_filename_no_extension;
1147
  }
 
1148
  } else { // does one last check that our verification string is valid
1149
  $data = array(
1150
  'action' => 'wpmdb_remote_initiate_migration',
1197
  }
1198
 
1199
  if ( ! empty( $this->form_data['create_backup'] ) && $this->state_data['intent'] == 'pull' ) {
1200
+ $return['dump_filename'] = wp_basename( $this->get_sql_dump_info( 'backup', 'path' ) );
1201
  $return['dump_filename'] = substr( $return['dump_filename'], 0, -4 );
1202
  $return['dump_url'] = $this->get_sql_dump_info( 'backup', 'url' );
1203
  }
1293
  */
1294
  function finalize_migration() {
1295
  $this->set_post_data();
1296
+ $tables = explode( ',', $this->state_data['tables'] );
1297
+ $temp_prefix = ( isset( $this->state_data['temp_prefix'] ) ) ? $this->state_data['temp_prefix'] : $this->temp_prefix;
1298
+ $temp_tables = array();
1299
+ $type = $this->state_data['intent'];
1300
+ $alter_table_name = $this->get_alter_table_name();
1301
 
1302
  if ( isset( $this->state_data['type'] ) && 'push' === $this->state_data['type'] ) {
1303
  $type = 'push';
1304
  }
1305
 
1306
+ if ( 'find_replace' === $this->state_data['intent'] || 'import' === $this->state_data['intent'] ) {
1307
  $location = home_url();
1308
  } else {
1309
  $location = ( isset( $this->state_data['location'] ) ) ? $this->state_data['location'] : $this->state_data['url'];
1310
  }
1311
+
1312
+ if ( 'import' === $this->state_data['intent'] ) {
1313
+ $temp_tables = $this->get_tables( 'temp' );
1314
+ $tables = array();
1315
+
1316
+ foreach ( $temp_tables as $key => $temp_table ) {
1317
+ if ( $alter_table_name === $temp_table ) {
1318
+ unset( $temp_tables[ $key ] );
1319
+ continue;
1320
+ }
1321
+
1322
+ $tables[] = substr( $temp_table, strlen( $temp_prefix ) );
1323
+ }
1324
+ } else {
1325
+ foreach ( $tables as $table ) {
1326
+ $temp_tables[] = $temp_prefix . apply_filters(
1327
  'wpmdb_finalize_target_table_name',
1328
  $table,
1329
  $type,
1330
  $this->state_data['site_details']
1331
  );
1332
+ }
1333
  }
1334
 
1335
  $sql = "SET FOREIGN_KEY_CHECKS=0;\n";
1343
  $sql .= "\n";
1344
  }
1345
 
 
1346
  $sql .= $this->get_alter_queries();
1347
  $sql .= 'DROP TABLE IF EXISTS ' . $this->backquote( $alter_table_name ) . ";\n";
1348
 
1353
  return $result;
1354
  }
1355
 
1356
+ if ( ! isset( $this->state_data['location'] ) && ! in_array( $this->state_data['intent'], array( 'find_replace', 'import' ) ) ) {
1357
  $data = array();
1358
  $data['action'] = 'wpmdb_fire_migration_complete';
1359
  $data['url'] = home_url();
1813
  $extension = '.sql';
1814
  $dump_name = sanitize_file_name( $dump_name );
1815
 
1816
+ if ( 'backup' === $this->state_data['stage'] ) {
1817
+ return $dump_name . $extension;
1818
+ }
1819
+
1820
+ if ( 'import' === $this->state_data['intent'] ) {
1821
+ if ( isset( $this->state_data['import_info']['import_gzipped'] ) && 'true' === $this->state_data['import_info']['import_gzipped'] ) {
1822
+ $extension .= '.gz';
1823
+ }
1824
+ } else {
1825
+ if ( $this->gzip() && isset( $this->form_data['gzip_file'] ) && $this->form_data['gzip_file'] ) {
1826
+ $extension .= '.gz';
1827
+ }
1828
  }
1829
 
1830
  return $dump_name . $extension;
1833
  function options_page() {
1834
  $this->template( 'options' );
1835
  }
1836
+
1837
  /**
1838
  * Load Tools HTML template for tools menu on sites in a Network to help users find WPMDB in Multisite
1839
  *
1851
  $this->set_post_data();
1852
 
1853
  if ( ! isset( $this->domain_replace ) ) {
1854
+ $this->domain_replace = false;
1855
+
1856
+ if ( is_multisite() && ! empty( $this->find_replace_pairs ) ) {
1857
+ $grep = preg_grep( sprintf( '/^(\/\/|http:\/\/|https:\/\/|)%s/', $this->get_domain_current_site() ), $this->find_replace_pairs['replace_old'] );
1858
+ if ( $grep ) {
1859
+ $domain_find_keys = array_keys( $grep );
1860
+ $url = $this->parse_url( $this->find_replace_pairs['replace_new'][ $domain_find_keys[0] ] );
1861
+ if ( isset( $url['host'] ) ) {
1862
+ $this->domain_replace = $url['host'];
1863
+ } elseif ( ! empty( $this->state_data['domain_current_site'] ) ) {
1864
+ $this->domain_replace = $this->state_data['domain_current_site'];
1865
+ }
1866
  }
 
 
1867
  }
1868
  }
1869
 
2053
  }
2054
 
2055
  $this->query_template = 'INSERT INTO ' . $this->backquote( $table_to_insert ) . ' ( ' . $fields . ") VALUES\n";
2056
+ } else {
2057
+ $this->query_template = '';
2058
  }
2059
 
2060
  $this->query_buffer = $this->query_template;
2122
  }
2123
 
2124
  if ( ! $table_structure ) {
2125
+ $this->error = sprintf( __( 'Failed to retrieve table structure for table \'%s\', please ensure your database is online. (#125)', 'wp-migrate-db' ), $table );
2126
+ return false;
2127
  }
2128
 
2129
  return $table_structure;
2142
  }
2143
 
2144
  if ( ! is_array( $table_structure ) ) {
2145
+ $this->log_error( $this->error );
2146
+ $return = array( 'wpmdb_error' => 1, 'body' => $this->error );
2147
  $result = $this->end_ajax( json_encode( $return ) );
2148
  return $result;
2149
  }
2167
  ) {
2168
  $defs[ strtolower( $struct->Field ) ] = ( null === $struct->Default ) ? 'NULL' : $struct->Default;
2169
  $ints[ strtolower( $struct->Field ) ] = '1';
2170
+ } elseif ( 0 === strpos( $struct->Type, 'binary' ) || apply_filters( 'wpmdb_process_column_as_binary', false, $struct ) ) {
2171
  $bins[ strtolower( $struct->Field ) ] = '1';
2172
+ } elseif ( 0 === strpos( $struct->Type, 'bit' ) || apply_filters( 'wpmdb_process_column_as_bit', false, $struct ) ) {
2173
  $bits[ strtolower( $struct->Field ) ] = '1';
2174
  }
2175
 
2214
  function pre_process_data( $table, $target_table_name, $temp_table_name ) {
2215
  if ( 0 !== $this->row_tracker ) return;
2216
 
2217
+ if ( in_array( $this->form_data['action'], array( 'find_replace', 'import') ) ) {
2218
  if ( 'backup' === $this->state_data['stage'] ) {
2219
  $this->build_table_header( $table, $target_table_name, $temp_table_name );
2220
+ } else if ( 'find_replace' === $this->form_data['action'] ) {
2221
  $create = $this->create_temp_table( $table );
2222
 
2223
  if ( true !== $create ) {
2461
  $join = array();
2462
  $where = 'WHERE 1=1';
2463
  $order_by = '';
2464
+ $prefix = ( 'import' === $this->state_data['intent'] ) ? $this->temp_prefix . $wpdb->base_prefix : '';
2465
 
2466
  // We need ORDER BY here because with LIMIT, sometimes it will return
2467
  // the same results from the previous query and we'll have duplicate insert statements
2468
  if ( 'backup' != $this->state_data['stage'] && false === empty( $this->form_data['exclude_spam'] ) ) {
2469
+ if ( $this->table_is( 'comments', $table, 'table', $prefix ) ) {
2470
  $where .= ' AND comment_approved != "spam"';
2471
+ } elseif ( $this->table_is( 'commentmeta', $table, 'table', $prefix ) ) {
2472
  $tables = $this->get_ms_compat_table_names( array( 'commentmeta', 'comments' ), $table );
2473
  $join[] = sprintf( 'INNER JOIN %1$s ON %1$s.comment_ID = %2$s.comment_id', $this->backquote( $tables['comments_table'] ), $this->backquote( $tables['commentmeta_table'] ) );
2474
  $where .= sprintf( ' AND %1$s.comment_approved != \'spam\'', $this->backquote( $tables['comments_table'] ) );
2477
 
2478
  if ( 'backup' != $this->state_data['stage'] && isset( $this->form_data['exclude_post_types'] ) && ! empty( $this->form_data['select_post_types'] ) ) {
2479
  $post_types = '\'' . implode( '\', \'', $this->form_data['select_post_types'] ) . '\'';
2480
+ if ( $this->table_is( 'posts', $table, 'table', $prefix ) ) {
2481
  $where .= ' AND `post_type` NOT IN ( ' . $post_types . ' )';
2482
+ } elseif ( $this->table_is( 'postmeta', $table, 'table', $prefix ) ) {
2483
  $tables = $this->get_ms_compat_table_names( array( 'postmeta', 'posts' ), $table );
2484
  $join[] = sprintf( 'INNER JOIN %1$s ON %1$s.ID = %2$s.post_id', $this->backquote( $tables['posts_table'] ), $this->backquote( $tables['postmeta_table'] ) );
2485
  $where .= sprintf( ' AND %1$s.post_type NOT IN ( ' . $post_types . ' )', $this->backquote( $tables['posts_table'] ) );
2486
+ } elseif ( $this->table_is( 'comments', $table, 'table', $prefix ) ) {
2487
  $tables = $this->get_ms_compat_table_names( array( 'comments', 'posts' ), $table );
2488
  $join[] = sprintf( 'INNER JOIN %1$s ON %1$s.ID = %2$s.comment_post_ID', $this->backquote( $tables['posts_table'] ), $this->backquote( $tables['comments_table'] ) );
2489
  $where .= sprintf( ' AND %1$s.post_type NOT IN ( ' . $post_types . ' )', $this->backquote( $tables['posts_table'] ) );
2490
+ } elseif ( $this->table_is( 'commentmeta', $table, 'table', $prefix ) ) {
2491
  $tables = $this->get_ms_compat_table_names( array( 'commentmeta', 'posts', 'comments' ), $table );
2492
  $join[] = sprintf( 'INNER JOIN %1$s ON %1$s.comment_ID = %2$s.comment_id', $this->backquote( $tables['comments_table'] ), $this->backquote( $tables['commentmeta_table'] ) );
2493
  $join[] = sprintf( 'INNER JOIN %2$s ON %2$s.ID = %1$s.comment_post_ID', $this->backquote( $tables['comments_table'] ), $this->backquote( $tables['posts_table'] ) );
2495
  }
2496
  }
2497
 
2498
+ if ( 'backup' != $this->state_data['stage'] && true === apply_filters( 'wpmdb_exclude_transients', true ) && isset( $this->form_data['exclude_transients'] ) && '1' === $this->form_data['exclude_transients'] && ( $this->table_is( 'options', $table, 'table', $prefix ) || ( isset( $wpdb->sitemeta ) && $wpdb->sitemeta == $table ) ) ) {
2499
  $col_name = 'option_name';
2500
 
2501
  if ( isset( $wpdb->sitemeta ) && $wpdb->sitemeta == $table ) {
2506
  }
2507
 
2508
  // don't export/migrate wpmdb specific option rows unless we're performing a backup
2509
+ if ( 'backup' != $this->state_data['stage'] && ( $this->table_is( 'options', $table, 'table', $prefix ) || ( isset( $wpdb->sitemeta ) && $wpdb->sitemeta == $table ) ) ) {
2510
  $col_name = 'option_name';
2511
 
2512
  if ( isset( $wpdb->sitemeta ) && $wpdb->sitemeta == $table ) {
2655
  continue;
2656
  }
2657
 
2658
+ if ( is_multisite() && in_array( $table, array( $wpdb->site, $wpdb->blogs, $this->temp_prefix . $wpdb->blogs, $this->temp_prefix . $wpdb->site ) ) ) {
2659
 
2660
+ if ( 'backup' !== $this->state_data['stage'] ) {
2661
 
2662
  if ( 'path' == $key ) {
2663
  $old_path_current_site = $this->get_path_current_site();
2665
 
2666
  if ( ! empty( $this->state_data['path_current_site'] ) ) {
2667
  $new_path_current_site = $this->state_data['path_current_site'];
2668
+ } elseif ( 'find_replace' === $this->state_data['stage'] ) {
2669
+ $new_path_current_site = $this->get_path_current_site();
2670
  } elseif ( ! empty ( $this->form_data['replace_new'][1] ) ) {
2671
  $new_path_current_site = $this->get_path_from_url( $this->form_data['replace_new'][1] );
2672
  }
2679
  }
2680
  }
2681
 
2682
+ if ( 'domain' == $key ) { // wp_blogs and wp_sites tables
2683
  if ( ! empty( $this->state_data['domain_current_site'] ) ) {
2684
  $main_domain_replace = $this->state_data['domain_current_site'];
2685
+ } elseif( 'find_replace' === $this->state_data['stage'] || 'savefile' === $this->state_data['intent'] ) {
2686
+ $main_domain_replace = $this->get_domain_replace() ?: $this->get_domain_current_site();
2687
  } elseif ( ! empty ( $this->form_data['replace_new'][1] ) ) {
2688
  $url = $this->parse_url( $this->form_data['replace_new'][1] );
2689
  $main_domain_replace = $url['host'];
2690
  }
2691
 
2692
  $domain_replaces = array();
2693
+ $main_domain_find = $this->get_domain_current_site();
2694
+
2695
+ if ( 'find_replace' === $this->state_data['stage'] ) {
2696
+ // Check if the domain field in the DB is being searched for in the find & replace
2697
+ $old_domain_find = sprintf( '/^(\/\/|http:\/\/|https:\/\/|)%s/', $data_to_fix );
2698
+
2699
+ if ( preg_grep( $old_domain_find, $this->find_replace_pairs['replace_old'] ) ) {
2700
+ $main_domain_find = $data_to_fix;
2701
+ }
2702
+ }
2703
+
2704
+ $main_domain_find = sprintf( '/%s/', preg_quote( $main_domain_find, '/' ) );
2705
  if ( isset( $main_domain_replace ) ) {
2706
  $domain_replaces[ $main_domain_find ] = $main_domain_replace;
2707
  }
2742
  // Determine what to do with updates.
2743
  if ( 'find_replace' === $this->state_data['stage'] ) {
2744
  if ( $updates_pending && ! empty( $where_sql ) ) {
2745
+ $table_to_update = $table;
2746
+
2747
+ if ( 'import' !== $this->form_data['action'] ) {
2748
+ $table_to_update = $this->backquote( $this->temp_prefix . $table );
2749
+ }
2750
+
2751
  $query .= 'UPDATE ' . $table_to_update . ' SET ' . implode( ', ', $update_sql ) . ' WHERE ' . implode( ' AND ', array_filter( $where_sql ) ) . ";\n";
2752
  }
2753
  } else {
2909
  function get_ms_compat_table_names( $tables, $queried_table ) {
2910
  global $wpdb;
2911
 
2912
+ $temp_prefix = ( 'import' === $this->state_data['intent'] ) ? $this->temp_prefix : '';
2913
+ $prefix = $temp_prefix . $wpdb->base_prefix;
2914
  $prefix_escaped = preg_quote( $prefix, '/' );
2915
 
2916
  // if multisite, extract blog ID from queried table name and add to prefix
2931
  }
2932
 
2933
  function db_backup_header() {
2934
+ global $wpdb;
2935
+
2936
  $charset = ( defined( 'DB_CHARSET' ) ? DB_CHARSET : 'utf8' );
2937
  $this->stow( '# ' . __( 'WordPress MySQL database migration', 'wp-migrate-db' ) . "\n", false );
2938
  $this->stow( "#\n", false );
2939
  $this->stow( '# ' . sprintf( __( 'Generated: %s', 'wp-migrate-db' ), date( 'l j. F Y H:i T' ) ) . "\n", false );
2940
  $this->stow( '# ' . sprintf( __( 'Hostname: %s', 'wp-migrate-db' ), DB_HOST ) . "\n", false );
2941
  $this->stow( '# ' . sprintf( __( 'Database: %s', 'wp-migrate-db' ), $this->backquote( DB_NAME ) ) . "\n", false );
2942
+
2943
+ $url = preg_replace( '(^https?:)', '', home_url(), 1 );
2944
+ $key = array_search( $url, $this->form_data['replace_old'] );
2945
+
2946
+ if ( false !== $key ) {
2947
+ $url = $this->form_data['replace_new'][ $key ];
2948
+ } else {
2949
+ // Protocol might have been added in
2950
+ $key = array_search( home_url(), $this->form_data['replace_old'] );
2951
+
2952
+ if ( false !== $key ) {
2953
+ $url = $this->form_data['replace_new'][ $key ];
2954
+ }
2955
+ }
2956
+
2957
+ $this->stow( '# URL: ' . esc_html( addslashes( $url ) ) . "\n", false );
2958
+
2959
+ $path = $this->get_absolute_root_file_path();
2960
+ $key = array_search( $path, $this->form_data['replace_old'] );
2961
+
2962
+ if ( false !== $key ) {
2963
+ $path = $this->form_data['replace_new'][ $key ];
2964
+ }
2965
+
2966
+ $this->stow( '# Path: ' . esc_html( addslashes( $path ) ) . "\n", false );
2967
+
2968
+ $included_tables = $this->get_tables( 'prefix' );
2969
+
2970
+ if ( 'savefile' === $this->state_data['intent'] && isset( $this->form_data['table_migrate_option'] ) && 'migrate_select' === $this->form_data['table_migrate_option'] ) {
2971
+ $included_tables = $this->form_data['select_tables'];
2972
+ }
2973
+
2974
+ $included_tables = apply_filters( 'wpmdb_backup_header_included_tables', $included_tables );
2975
+
2976
+ $this->stow( '# Tables: ' . implode( ', ', $included_tables ) . "\n", false );
2977
+ $this->stow( '# Table Prefix: ' . $wpdb->base_prefix . "\n" );
2978
+ $this->stow( '# Post Types: ' . implode( ', ', $this->get_post_types() ) . "\n", false );
2979
+
2980
+ $protocol = 'http';
2981
+ if ( 'https' === substr( home_url(), 0, 5 ) ) {
2982
+ $protocol = 'https';
2983
+ }
2984
+
2985
+ $this->stow( '# Protocol: ' . $protocol . "\n", false );
2986
+
2987
  $this->stow( "# --------------------------------------------------------\n\n", false );
2988
  $this->stow( "/*!40101 SET NAMES $charset */;\n\n", false );
2989
  $this->stow( "SET sql_mode='NO_AUTO_VALUE_ON_ZERO';\n\n", false );
3033
  return true;
3034
  }
3035
 
3036
+ if ( 'savefile' === $this->form_data['action'] || in_array( $this->state_data['stage'], array( 'backup', 'import' ) ) ) {
3037
  if ( $this->gzip() && isset( $this->form_data['gzip_file'] ) && $this->form_data['gzip_file'] ) {
3038
  if ( ! @gzwrite( $this->fp, $query_line ) ) {
3039
  $this->error = __( 'Failed to write the gzipped SQL data to the file. (#127)', 'wp-migrate-db' );
3063
  function transfer_chunk() {
3064
  $this->set_post_data();
3065
 
3066
+ if ( in_array( $this->state_data['intent'], array( 'savefile', 'find_replace', 'import' ) ) || 'backup' == $this->state_data['stage'] ) {
3067
 
3068
  if ( 'find_replace' === $this->state_data['stage'] ) {
3069
  $this->process_chunk( $this->query_buffer );
3124
  }
3125
 
3126
  if ( '1' !== $response ) {
3127
+ $decoded_response = json_decode( $response, 1 );
3128
+ if ( $decoded_response && isset( $decoded_response['wpmdb_error'] ) && isset( $decoded_response['body'] ) ) {
3129
+ // $response is already json_encoded wpmdb_error object
3130
+ $this->log_error( 'transfer_chunk received error response: ' . $decoded_response['body'] );
3131
+
3132
+ return $this->end_ajax( $response );
3133
+ }
3134
  $return = array( 'wpmdb_error' => 1, 'body' => $response );
 
3135
 
3136
+ return $this->end_ajax( json_encode( $return ) );
3137
  }
3138
 
3139
  $result = $this->end_ajax( json_encode(
3201
  array( $this, 'options_page' ) );
3202
  $this->after_admin_menu( $hook_suffix );
3203
  }
3204
+
3205
  /**
3206
  * Add a tools menu item to sites on a Multisite network
3207
  *
3208
  */
3209
  function network_tools_admin_menu() {
3210
+ add_management_page(
3211
  $this->get_plugin_title(),
3212
  $this->get_plugin_title(),
3213
  'manage_network_options',
3214
  $this->core_slug,
3215
+ array( $this, 'subsite_tools_options_page' )
3216
  );
3217
  }
3218
 
3391
  $src = $plugins_url . "asset/dist/js/script{$ver_string}{$min}.js";
3392
  wp_enqueue_script( 'wp-migrate-db-pro-script', $src, array( 'jquery', 'backbone' ), $version, true );
3393
 
3394
+ $src = $plugins_url . "asset/dist/js/localStorage{$ver_string}{$min}.js";
3395
+ wp_enqueue_script( 'wp-migrate-db-pro-localstorage', $src, array( 'wp-migrate-db-pro-script' ), $version, true );
3396
+
3397
  wp_localize_script( 'wp-migrate-db-pro-script',
3398
  'wpmdb_strings',
3399
  array(
3409
  'update_log_problem' => __( 'An error occurred when trying to update the debug log. Please contact support. (#133)', 'wp-migrate-db' ),
3410
  'please_select_one_table' => __( 'Please select at least one table to migrate.', 'wp-migrate-db' ),
3411
  'please_select_one_table_backup' => __( 'Please select at least one table for backup.', 'wp-migrate-db' ),
3412
+ 'please_select_one_table_import' => __( 'Please select at least one table for the find & replace', 'wp-migrate-db' ),
3413
  'enter_name_for_profile' => __( 'Please enter a name for your migration profile.', 'wp-migrate-db' ),
3414
  'save_profile_problem' => __( 'An error occurred when attempting to save the migration profile. Please see the Help tab for details on how to request support. (#118)', 'wp-migrate-db' ),
3415
  'exporting_complete' => _x( 'Export complete', 'Data has been successfully exported', 'wp-migrate-db' ),
3479
  'push_migration_label_completed' => __( 'Push to %s complete', 'wp-migrate-db' ),
3480
  'find_replace_label_migrating' => __( 'Running Find & Replace…', 'wp-migrate-db' ),
3481
  'find_replace_label_completed' => __( 'Find & Replace complete', 'wp-migrate-db' ),
3482
+ 'import_label_migrating' => __( 'Importing…', 'wp-migrate-db' ),
3483
+ 'import_label_completed' => __( 'Import complete', 'wp-migrate-db' ),
3484
  'copying_license' => __( 'Copying license to the remote site, please wait', 'wp-migrate-db' ),
3485
  'attempting_to_activate_licence' => __( 'Attempting to activate your license, please wait…', 'wp-migrate-db' ),
3486
  'licence_reactivated' => __( 'License successfully activated, please wait…', 'wp-migrate-db' ),
3498
  'migrate_button_pull_save' => _x( 'Pull &amp; Save', 'Transfer the remote database to this site and save migration profile', 'wp-migrate-db' ),
3499
  'migrate_button_export' => _x( 'Export', 'Download a copy of the database', 'wp-migrate-db' ),
3500
  'migrate_button_export_save' => _x( 'Export &amp; Save', 'Download a copy of the database and save migration profile', 'wp-migrate-db' ),
3501
+ 'migrate_button_import' => _x( 'Import', 'Import an SQL file into the database', 'wp-migrate-db' ),
3502
+ 'migrate_button_import_save' => _x( 'Import &amp; Save', 'Import an SQL file and save migration profile', 'wp-migrate-db' ),
3503
  'migrate_button_find_replace' => _x( 'Find &amp; Replace', 'Run a find and replace on the database', 'wp-migrate-db' ),
3504
  'migrate_button_find_replace_save' => _x( 'Find &amp; Replace &amp; Save', 'Run a find and replace and save migration profile', 'wp-migrate-db' ),
3505
  'tables' => _x( 'Tables', 'database tables', 'wp-migrate-db'),
3520
  'title_error' => __( 'Failed', 'wp-migrate-db' ),
3521
  'progress_items_truncated_msg' => __( '%1$s items are not shown to maintain browser performance', 'wp-migrate-db' ),
3522
  'clear_error_log' => _x( 'Cleared', 'Error log emptied', 'wp-migrate-db' ),
3523
+ 'parsing_sql_file' => __( 'Parsing SQL file, please wait', 'wp-migrate-db' ),
3524
+ 'invalid_sql_file' => __( 'The selected file does not have a recognized file type. Please upload a valid SQL file to continue.', 'wp-migrate-db' ),
3525
+ 'please_select_sql_file' => __( 'Please select an SQL export file above to continue.', 'wp-migrate-db' ),
3526
+ 'import_profile_loaded' => sprintf( '<strong>%s</strong> &mdash; %s', __( 'Profile Loaded', 'wp-migrate-db' ), __( 'The selected profile has been loaded, please select an SQL export file above to continue.', 'wp-migrate-db' ) ),
3527
+ 'uploading_file_to_server' => __( 'Uploading file to the server', 'wp-migrate-db' ),
3528
+ 'importing_file_to_db' => __( 'Importing data from %s', 'wp-migrate-db' ),
3529
+ 'upload' => __( 'Upload', 'wp-migrate-db' ),
3530
  )
3531
  );
3532
 
3552
  $salt = substr( $filename, $last_dash, 6 );
3553
  $filename_no_salt = str_replace( $salt, '', $filename );
3554
 
3555
+
3556
  if ( file_exists( $diskfile ) ) {
3557
+ if ( ! headers_sent() ) {
3558
+ header( 'Content-Description: File Transfer' );
3559
+ header( 'Content-Type: application/octet-stream' );
3560
+ header( 'Content-Length: ' . $this->filesystem->filesize( $diskfile ) );
3561
+ header( 'Content-Disposition: attachment; filename=' . $filename_no_salt );
3562
+ readfile( $diskfile );
3563
+ $this->filesystem->unlink( $diskfile );
3564
+ exit;
3565
+ } else {
3566
+ $last_error = error_get_last();
3567
+ $msg = isset( $last_error['message'] ) ? '<p>Error: ' . $last_error['message'] . '</p>' : '';
3568
+ wp_die( sprintf( __( '<h3>Output prevented download. </h3> %s', 'wp-migrate-db' ), $msg ) );
3569
+ }
3570
  } else {
3571
+ wp_die( __( 'Could not find the file to download:', 'wp-migrate-db' ) . '<br>' . esc_html( $diskfile ) );
3572
  }
3573
  }
3574
 
3600
  'process_notice_link' => wp_create_nonce( 'process-notice-link' ),
3601
  'flush' => wp_create_nonce( 'flush' ),
3602
  'plugin_compatibility' => wp_create_nonce( 'plugin_compatibility' ),
3603
+ 'import_file' => wp_create_nonce( 'import-file' ),
3604
+ 'whitelist_plugins' => wp_create_nonce( 'whitelist_plugins' ),
3605
+ 'cancel_migration' => wp_create_nonce( 'cancel_migration' ),
3606
  ) );
3607
 
3608
  $data = apply_filters( 'wpmdb_data', array(
3641
  'lower_case_table_names' => esc_html( $this->get_lower_case_table_names_setting() ),
3642
  'subsites' => $site_details['subsites'], // TODO: Remove backwards compatibility.
3643
  'site_details' => $this->site_details(),
3644
+ 'alter_table_name' => $this->get_alter_table_name(),
3645
  ) );
3646
 
3647
  wp_localize_script( 'wp-migrate-db-pro-script', 'wpmdb_data', $data );
3756
  case 'find_replace' :
3757
  $this->delete_temporary_tables( $this->temp_prefix );
3758
  break;
3759
+ case 'import' :
3760
+ if ( 'backup' === $this->state_data['stage'] && ! empty( $this->state_data['dumpfile_created'] ) ) {
3761
+ $this->delete_export_file( $this->state_data['dump_filename'], true );
3762
+ } else {
3763
+ // Import might have been deleted already
3764
+ if ( $this->filesystem->file_exists( $this->state_data['import_path'] ) ) {
3765
+ if ( 'true' === $this->state_data['import_info']['import_gzipped'] ) {
3766
+ $this->delete_export_file( $this->state_data['import_filename'], false );
3767
+
3768
+ // File might not be decompressed yet
3769
+ if ( $this->filesystem->file_exists( substr( $this->state_data['import_path'], 0, -3 ) ) ) {
3770
+ $this->delete_export_file( $this->state_data['import_filename'], true );
3771
+ }
3772
+ } else {
3773
+ $this->delete_export_file( $this->state_data['import_filename'], true );
3774
+ }
3775
+ }
3776
+ $this->delete_temporary_tables( $this->temp_prefix );
3777
+ }
3778
+ break;
3779
  default:
3780
  break;
3781
  }
3796
 
3797
  $dump_file = $this->get_upload_info( 'path' ) . DIRECTORY_SEPARATOR . $dump_file;
3798
 
3799
+ if ( empty( $dump_file ) || false === $this->filesystem->file_exists( $dump_file ) ) {
3800
+ $return = array( 'wpmdb_error' => 1, 'body' => __( 'MySQL export file not found.', 'wp-migrate-db' ) );
3801
+ return $this->end_ajax( json_encode( $return ) );
3802
  }
3803
 
3804
+ if ( false === $this->filesystem->unlink( $dump_file ) ) {
3805
+ $return = array( 'wpmdb_error' => 1, 'body' => __( 'Could not delete the MySQL export file.', 'wp-migrate-db' ) );
3806
+ return $this->end_ajax( json_encode( $return ) );
 
3807
  }
3808
  }
3809
 
3813
 
3814
  function template_compatibility() {
3815
  $args = array(
3816
+ 'plugin_compatibility_checked' => ( $this->compatibility_plugin_manager->is_muplugin_installed() ? true : false ),
3817
  );
3818
  $this->template( 'compatibility', 'common', $args );
3819
  }
3924
  if ( version_compare( $db_version, '5.6', '<' ) ) {
3925
  // Convert utf8m4_unicode_520_ci collation to utf8mb4_unicode_ci if less than mysql 5.6
3926
  $create_table = str_replace( 'utf8mb4_unicode_520_ci', 'utf8mb4_unicode_ci', $create_table );
3927
+ $create_table = str_replace( 'utf8_unicode_520_ci', 'utf8_unicode_ci', $create_table );
3928
  } elseif ( apply_filters( 'wpmdb_convert_to_520', true ) ) {
3929
  $create_table = str_replace( 'utf8mb4_unicode_ci', 'utf8mb4_unicode_520_ci', $create_table );
3930
+ $create_table = str_replace( 'utf8_unicode_ci', 'utf8_unicode_520_ci', $create_table );
3931
  }
3932
 
3933
  if ( version_compare( $db_version, '5.5.3', '<' ) ) {
3957
  }
3958
 
3959
  if ( true === $abort_utf8mb4 && 0 !== $replace_count ) {
3960
+ $return = sprintf( __( 'The source site supports utf8mb4 data but the target does not, aborting migration to avoid possible data corruption. Please see %1$s for more information. (#148)', 'wp-migrate-db-pro' ), sprintf( '<a href="https://deliciousbrains.com/wp-migrate-db-pro/doc/source-site-supports-utf8mb4/?utm_campaign=error%2Bmessages&utm_source=MDB%2BPaid&utm_medium=insideplugin">%1$s</a>', __( 'our documentation', 'wp-migrate-db-pro' ) ) );
3961
  $return = array( 'wpmdb_error' => 1, 'body' => $return );
3962
  $result = $this->end_ajax( json_encode( $return ) );
3963
 
4018
 
4019
  <p><?php _e( "As a result, uppercase characters in table names will be converted to lowercase during the migration.", 'wp-migrate-db' ); ?></p>
4020
 
4021
+ <p><?php printf( __( 'You can read more about this in <a href="%s">our documentation</a>, proceed with caution.', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/mixed-case-table-names/?utm_campaign=error%2Bmessages&utm_source=MDB%2BPaid&utm_medium=insideplugin' ); ?></p>
4022
  <?php
4023
  return wptexturize( ob_get_clean() );
4024
  }
class/wpmdbpro-import.php ADDED
@@ -0,0 +1,502 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class WPMDBPro_Import
5
+ *
6
+ * Handles importing a SQL file to the database
7
+ */
8
+ class WPMDBPro_Import {
9
+
10
+ /**
11
+ * Stores the chunk size used for imports
12
+ *
13
+ * @var int $chunk_size
14
+ */
15
+ protected $chunk_size = 10000;
16
+
17
+ /**
18
+ * State data for the migration
19
+ *
20
+ * @var array $state_data
21
+ */
22
+ protected $state_data;
23
+
24
+ /**
25
+ * Stores a reference to WPMDBPro
26
+ *
27
+ * @var object $wpmdbpro
28
+ */
29
+ protected $wpmdbpro;
30
+
31
+ public function __construct( $wpmdbpro ) {
32
+ $this->wpmdbpro = $wpmdbpro;
33
+
34
+ add_action( 'wpmdb_load_assets', array( $this, 'enqueue_import_script' ) );
35
+ add_action( 'wp_ajax_wpmdb_get_import_info', array( $this, 'ajax_get_import_info' ) );
36
+ add_action( 'wp_ajax_wpmdb_upload_file', array( $this, 'ajax_upload_file' ) );
37
+ add_action( 'wp_ajax_wpmdb_prepare_import_file', array( $this, 'ajax_prepare_import_file' ) );
38
+ add_action( 'wp_ajax_wpmdb_import_file', array( $this, 'ajax_import_file' ) );
39
+ }
40
+
41
+ public function enqueue_import_script( $hook ) {
42
+ $ver_string = '-' . str_replace( '.', '', $this->wpmdbpro->get( 'plugin_version' ) );
43
+ $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
44
+ $src = plugins_url( "asset/dist/js/import{$ver_string}{$min}.js", dirname( __FILE__ ) );
45
+ wp_enqueue_script( 'wp-migrate-db-pro-import-script', $src, array( 'jquery' ), false, true );
46
+ }
47
+
48
+ /**
49
+ * Returns info about the import file.
50
+ *
51
+ * @return array|bool
52
+ */
53
+ public function ajax_get_import_info() {
54
+ $this->wpmdbpro->check_ajax_referer( 'import-file' );
55
+
56
+ $data = $this->decode_chunk( $_POST['file_data'] );
57
+ $is_gzipped = false;
58
+
59
+ if ( false !== $data && $this->str_is_gzipped( $data ) ) {
60
+ if ( ! $this->wpmdbpro->gzip() ) {
61
+ $error_msg = __( 'The server is not compatible with gzip, please decompress the import file and try again.', 'wp-migrate-db' );
62
+ $return = array( 'wpmdb_error' => 1, 'body' => $error_msg );
63
+ $this->wpmdbpro->log_error( $error_msg );
64
+ return $this->wpmdbpro->end_ajax( json_encode( $return ) );
65
+ }
66
+
67
+ $data = WPMDB_Utils::gzdecode( $data );
68
+ $is_gzipped = true;
69
+ }
70
+
71
+ if ( ! $data ) {
72
+ $error_msg = __( 'Unable to read data from the import file', 'wp-migrate-db' );
73
+ $return = array( 'wpmdb_error' => 1, 'body' => $error_msg );
74
+ $this->wpmdbpro->log_error( $error_msg );
75
+ $result = $this->wpmdbpro->end_ajax( json_encode( $return ) );
76
+
77
+ return $result;
78
+ }
79
+
80
+ $return = $this->parse_file_header( $data );
81
+ $return['import_gzipped'] = $is_gzipped;
82
+
83
+ return $this->wpmdbpro->end_ajax( json_encode( $return ) );
84
+ }
85
+
86
+ /**
87
+ * Parses info from the export file header.
88
+ *
89
+ * @param $data
90
+ *
91
+ * @return array
92
+ */
93
+ public function parse_file_header( $data ) {
94
+ $lines = explode( PHP_EOL, $data );
95
+ $return = array();
96
+
97
+ if ( is_array( $lines ) && 10 <= count( $lines ) ) {
98
+ if ( '# URL:' === substr( $lines[5], 0, 6 ) ) {
99
+ $return['URL'] = substr( $lines[5], 7 );
100
+ }
101
+
102
+ if ( '# Path:' === substr( $lines[6], 0, 7 ) ) {
103
+ $return['path'] = substr( $lines[6], 8 );
104
+ }
105
+
106
+ if ( '# Tables:' === substr( $lines[7], 0, 9 ) ) {
107
+ $return['tables'] = explode( ', ', substr( $lines[7], 10 ) );
108
+ }
109
+
110
+ if ( '# Table Prefix:' === substr( $lines[8], 0, 15 ) ) {
111
+ $return['prefix'] = substr( $lines[8], 16 );
112
+ }
113
+
114
+ if ( '# Post Types:' === substr( $lines[9], 0, 13 ) ) {
115
+ $return['post_types'] = explode( ', ', substr( $lines[9], 14 ) );
116
+ }
117
+
118
+ if ( '# Protocol:' === substr( $lines[10], 0, 11 ) ) {
119
+ $return['protocol'] = substr( $lines[10], 12 );
120
+ }
121
+ }
122
+
123
+ return $return;
124
+ }
125
+
126
+ /**
127
+ * Uploads the import file to the server.
128
+ *
129
+ * @return void
130
+ */
131
+ public function ajax_upload_file() {
132
+ $this->wpmdbpro->check_ajax_referer( 'import-file' );
133
+ $this->state_data = $this->wpmdbpro->set_post_data();
134
+ if ( ! empty( $this->state_data['form_data'] ) ) {
135
+ $this->wpmdbpro->parse_migration_form_data( $this->state_data['form_data'] );
136
+ }
137
+
138
+ $file_data = $this->decode_chunk( $this->state_data['file_data'] );
139
+
140
+ if ( false === $file_data ) {
141
+ $error_msg = __( 'An error occurred while uploading the file.', 'wp-migrate-db' );
142
+ $return = array( 'wpmdb_error' => 1, 'body' => $error_msg );
143
+ $this->wpmdbpro->log_error( $error_msg );
144
+
145
+ return $this->wpmdbpro->end_ajax( json_encode( $return ) );
146
+ }
147
+
148
+ // Store the data in the file.
149
+ $fp = fopen( $this->state_data['import_path'], 'a' );
150
+ fwrite( $fp, $file_data );
151
+ fclose( $fp );
152
+ }
153
+
154
+ /**
155
+ * Prepares for import of a SQL file.
156
+ *
157
+ * @return mixed
158
+ */
159
+ public function ajax_prepare_import_file() {
160
+ $this->wpmdbpro->check_ajax_referer( 'import-file' );
161
+ $this->state_data = $this->wpmdbpro->set_post_data();
162
+
163
+ $file = $this->state_data['import_path'];
164
+
165
+ if ( $this->file_is_gzipped( $file ) ) {
166
+
167
+ $file = $this->decompress_file( $this->state_data['import_path'] );
168
+
169
+ if ( false === $file ) {
170
+ $error_msg = __( 'An error occurred while decompressing the import file.', 'wp-migrate-db' );
171
+ $return = array( 'wpmdb_error' => 1, 'body' => $error_msg );
172
+ $this->wpmdbpro->log_error( $error_msg );
173
+ $result = $this->wpmdbpro->end_ajax( json_encode( $return ) );
174
+
175
+ return $result;
176
+ }
177
+ }
178
+
179
+ $return = array(
180
+ 'num_chunks' => $this->get_num_chunks_in_file( $file ),
181
+ 'import_file' => $file,
182
+ 'import_size' => $this->wpmdbpro->filesystem->filesize( $file ),
183
+ );
184
+
185
+ return $this->wpmdbpro->end_ajax( json_encode( $return ) );
186
+ }
187
+
188
+ /**
189
+ * Handles AJAX requests to import a SQL file.
190
+ *
191
+ * @return mixed
192
+ */
193
+ public function ajax_import_file() {
194
+ $this->wpmdbpro->check_ajax_referer( 'import-file' );
195
+ $this->state_data = $this->wpmdbpro->set_post_data();
196
+
197
+ $file = $this->state_data['import_file'];
198
+ $chunk = isset( $this->state_data['chunk'] ) ? $this->state_data['chunk'] : 0;
199
+ $num_chunks = isset( $this->state_data['num_chunks'] ) ? $this->state_data['num_chunks'] : $this->get_num_chunks_in_file( $file );
200
+ $current_query = isset( $this->state_data['current_query'] ) ? base64_decode( $this->state_data['current_query'] ) : '';
201
+
202
+ $import = $this->import_chunk( $file, $chunk, $current_query );
203
+
204
+ if ( is_wp_error( $import ) ) {
205
+ $error_msg = $import->get_error_message();
206
+ $return = array( 'wpmdb_error' => 1, 'body' => $error_msg );
207
+ $this->wpmdbpro->log_error( $error_msg );
208
+
209
+ return $this->wpmdbpro->end_ajax( json_encode( $return ) );
210
+ }
211
+
212
+ $return = array(
213
+ 'chunk' => ++$chunk,
214
+ 'num_chunks' => $num_chunks,
215
+ 'current_query' => base64_encode( $import['current_query'] ),
216
+ );
217
+
218
+ // Return updated table sizes
219
+ if ( $chunk >= $num_chunks ) {
220
+
221
+ $this->wpmdbpro->delete_export_file( $this->state_data['import_filename'], true );
222
+
223
+ if ( 'true' === $this->state_data['import_info']['import_gzipped'] ) {
224
+ $this->wpmdbpro->delete_export_file( $this->state_data['import_filename'], false );
225
+ }
226
+
227
+ $return['table_sizes'] = $this->wpmdbpro->get_table_sizes();
228
+ $return['table_rows'] = $this->wpmdbpro->get_table_row_count();
229
+ }
230
+
231
+ return $this->wpmdbpro->end_ajax( json_encode( $return ) );
232
+ }
233
+
234
+ /**
235
+ * Gets the file data from the base64 encoded chunk
236
+ *
237
+ * @param string $data
238
+ *
239
+ * @return string|bool
240
+ */
241
+ public function decode_chunk( $data ) {
242
+ $data = explode( ';base64,', $data );
243
+
244
+ if ( ! is_array( $data ) || ! isset( $data[1] ) ) {
245
+ return false;
246
+ }
247
+
248
+ $data = base64_decode( $data[1] );
249
+ if ( ! $data ) {
250
+ return false;
251
+ }
252
+
253
+ return $data;
254
+ }
255
+
256
+ /**
257
+ * Gets the SplFileObject for the provided file
258
+ *
259
+ * @param string $file
260
+ * @param int $line
261
+ *
262
+ * @return object SplFileObject|WP_Error
263
+ */
264
+ public function get_file_object( $file, $line = 0 ) {
265
+ if ( ! $this->wpmdbpro->filesystem->file_exists( $file ) || ! $this->wpmdbpro->filesystem->is_readable( $file ) ) {
266
+ return new WP_Error( 'invalid_import_file', __( 'The import file could not be read.', 'wp-migrate-db' ) );
267
+ }
268
+
269
+ $file = new SplFileObject( $file );
270
+ $file->seek( $line );
271
+
272
+ return $file;
273
+ }
274
+
275
+ /**
276
+ * Returns the number of chunks in a SQL file
277
+ *
278
+ * @param $file
279
+ *
280
+ * @return int|object WP_Error
281
+ */
282
+ public function get_num_chunks_in_file( $file ) {
283
+ $file = $this->get_file_object( $file, PHP_INT_MAX );
284
+
285
+ if ( is_wp_error( $file ) ) {
286
+ return $file;
287
+ }
288
+
289
+ $lines = $file->key();
290
+
291
+ return ceil( $lines / $this->chunk_size );
292
+ }
293
+
294
+ /**
295
+ * Imports a chunk of a provided SQL file into the database
296
+ *
297
+ * @param string $file
298
+ * @param int $chunk
299
+ * @param string $current_query
300
+ *
301
+ * @return array|object WP_Error
302
+ */
303
+ public function import_chunk( $file, $chunk = 0, $current_query = '' ) {
304
+ global $wpdb;
305
+
306
+ $start = $chunk * $this->chunk_size;
307
+ $start = ( $start > 0 ) ? $start - 1 : $start;
308
+ $lines = 0;
309
+ $file = $this->get_file_object( $file, $start );
310
+
311
+ if ( is_wp_error( $file ) ) {
312
+ return $file;
313
+ }
314
+
315
+ while ( ! $file->eof() ) {
316
+ $line = trim( $file->fgets() );
317
+ $lines++;
318
+
319
+ if ( $lines > $this->chunk_size ) {
320
+ // Bail if we've exceeded the chunk size
321
+ return array(
322
+ 'import_complete' => false,
323
+ 'current_query' => $current_query,
324
+ );
325
+ }
326
+
327
+ if ( empty( $line ) || '' === $line ) {
328
+ // Skip empty/new lines
329
+ continue;
330
+ }
331
+
332
+ if ( '--' === substr( $line, 0, 2 ) ||
333
+ '/* ' === substr( $line, 0, 3 ) ||
334
+ '#' === substr( $line, 0, 1 )
335
+ ) {
336
+ // Skip if it's a comment
337
+ continue;
338
+ }
339
+
340
+ if ( preg_match( '/\/\*![0-9]{5} SET (.*)\*\/;/', $line, $matches ) ) {
341
+ // Skip user and system defined MySQL variables
342
+ continue;
343
+ }
344
+
345
+ $current_query .= $line;
346
+
347
+ if ( ';' !== substr( $line, -1, 1 ) ) {
348
+ // Doesn't have a semicolon at the end, not the end of the query
349
+ continue;
350
+ }
351
+
352
+ // Run the query
353
+ ob_start();
354
+ $wpdb->show_errors();
355
+
356
+ $current_query = $this->convert_to_temp_query( $current_query );
357
+ if ( false === $wpdb->query( $current_query ) ) {
358
+ $error = ob_get_clean();
359
+ $error_msg = sprintf( __( 'Failed to import the SQL query: %s', 'wp-migrate-db' ), esc_html( $error ) );
360
+ $return = new WP_Error( 'import_sql_execution_failed', $error_msg );
361
+
362
+ $invalid_text = $this->wpmdbpro->maybe_strip_invalid_text_and_retry( $current_query, 'import' );
363
+ if ( false !== $invalid_text ) {
364
+ $return = $invalid_text;
365
+ }
366
+
367
+ if ( is_wp_error( $return ) ) {
368
+ return $return;
369
+ }
370
+ }
371
+
372
+ ob_end_clean();
373
+
374
+ // Reset the temp variable
375
+ $current_query = '';
376
+ }
377
+
378
+ return array( 'import_complete' => true, 'current_query' => $current_query );
379
+ }
380
+
381
+ /**
382
+ * Decompress a file
383
+ *
384
+ * @param string $file The file to decompress
385
+ * @param string $dest The destination of the decompressed file
386
+ *
387
+ * @return string|boolean
388
+ */
389
+ public function decompress_file( $file, $dest = '' ) {
390
+ $error = false;
391
+
392
+ if ( ! $this->wpmdbpro->filesystem->file_exists( $file ) || ! $this->wpmdbpro->filesystem->is_readable( $file ) ) {
393
+ return $error;
394
+ }
395
+
396
+ $tmp_file = wp_tempnam();
397
+
398
+ if ( '' === $dest ) {
399
+ $dest = ( '.gz' === substr( $file, -3 ) ) ? substr( $file, 0, -3 ) : $file;
400
+ }
401
+
402
+ if ( $fp_in = gzopen( $file, 'rb' ) ) {
403
+
404
+ if ( $fp_out = fopen( $tmp_file, 'w' ) ) {
405
+
406
+ while ( ! gzeof( $fp_in ) ) {
407
+ $string = gzread( $fp_in, '4096' );
408
+ fwrite( $fp_out, $string, strlen( $string ) );
409
+ }
410
+
411
+ fclose( $fp_out );
412
+
413
+ $this->wpmdbpro->filesystem->move( $tmp_file, $dest );
414
+ } else {
415
+ $error = true;
416
+ }
417
+
418
+ gzclose( $fp_in );
419
+ } else {
420
+ $error = true;
421
+ }
422
+
423
+ if ( $error ) {
424
+ return false;
425
+ }
426
+
427
+ return $dest;
428
+ }
429
+
430
+ /**
431
+ * Converts a query to run on temporary tables
432
+ *
433
+ * @param $query
434
+ *
435
+ * @return string
436
+ */
437
+ public function convert_to_temp_query( $query ) {
438
+ $temp_prefix = $this->wpmdbpro->get( 'temp_prefix' );
439
+
440
+ if ( substr( $query, 0, 13 ) === 'INSERT INTO `' ) {
441
+ $query = WPMDB_Utils::str_replace_first( 'INSERT INTO `', 'INSERT INTO `' . $temp_prefix, $query );
442
+ } elseif ( substr( $query, 0, 14 ) === 'CREATE TABLE `' ) {
443
+ $query = WPMDB_Utils::str_replace_first( 'CREATE TABLE `', 'CREATE TABLE `' . $temp_prefix, $query );
444
+ } elseif ( substr( $query, 0, 22 ) === 'DROP TABLE IF EXISTS `' ) {
445
+ $query = WPMDB_Utils::str_replace_first( 'DROP TABLE IF EXISTS `', 'DROP TABLE IF EXISTS `' . $temp_prefix, $query );
446
+ } elseif ( substr( $query, 0, 13 ) === 'LOCK TABLES `' ) {
447
+ $query = WPMDB_Utils::str_replace_first( 'LOCK TABLES `', 'LOCK TABLES `' . $temp_prefix, $query );
448
+ } elseif ( substr( $query, 0, 13 ) === 'ALTER TABLE `' || substr( $query, 9, 13 ) === 'ALTER TABLE `' ) {
449
+ $query = WPMDB_Utils::str_replace_first( 'ALTER TABLE `', 'ALTER TABLE `' . $temp_prefix, $query );
450
+ }
451
+
452
+ return $query;
453
+ }
454
+
455
+ /**
456
+ * Checks if a string is compressed via gzip
457
+ *
458
+ * @param string $string
459
+ *
460
+ * @return bool
461
+ */
462
+ public function str_is_gzipped( $string ) {
463
+ $is_gzipped = false;
464
+ $tmp_file = wp_tempnam();
465
+
466
+ $fh = fopen( $tmp_file, 'a' );
467
+ fwrite( $fh, $string );
468
+
469
+
470
+ if ( $this->file_is_gzipped( $tmp_file ) ) {
471
+ $is_gzipped = true;
472
+ }
473
+
474
+ $this->wpmdbpro->filesystem->unlink( $tmp_file );
475
+
476
+ return $is_gzipped;
477
+ }
478
+
479
+ /**
480
+ * Checks if the provided file is gzipped
481
+ *
482
+ * @param string $file
483
+ *
484
+ * @return bool
485
+ */
486
+ public function file_is_gzipped( $file ) {
487
+ $is_gzipped = false;
488
+
489
+ if ( ! $this->wpmdbpro->filesystem->is_file( $file ) ) {
490
+ return $is_gzipped;
491
+ }
492
+
493
+ $content_type = mime_content_type( $file );
494
+
495
+ if ( in_array( $content_type, array( 'application/x-gzip', 'application/gzip' ) ) ) {
496
+ $is_gzipped = true;
497
+ }
498
+
499
+ return $is_gzipped;
500
+ }
501
+
502
+ }
compatibility/temp-theme/functions.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ //Silence is golden.
compatibility/wp-migrate-db-pro-compatibility.php CHANGED
@@ -1,145 +1,37 @@
1
  <?php
2
  /*
3
- Plugin Name: WP Migrate DB Pro Compatibility
4
  Plugin URI: http://deliciousbrains.com/wp-migrate-db-pro/
5
- Description: Prevents 3rd party plugins from being loaded during WP Migrate DB Pro specific operations
6
  Author: Delicious Brains
7
  Version: 1.1
8
  Author URI: http://deliciousbrains.com
9
  */
10
 
11
- $GLOBALS['wpmdb_compatibility'] = true;
12
 
13
- /**
14
- * Remove TGM Plugin Activation 'force_activation' admin_init action hook if present.
15
- *
16
- * This is to stop excluded plugins being deactivated after a migration, when a theme uses TGMPA to require a plugin to be always active.
17
- */
18
- function wpmdbc_tgmpa_compatibility() {
19
- $remove_function = false;
20
 
21
- // run on wpmdb page
22
- if ( isset( $_GET['page'] ) && 'wp-migrate-db-pro' == $_GET['page'] ) {
23
- $remove_function = true;
24
- }
25
- // run on wpmdb ajax requests
26
- if ( defined( 'DOING_AJAX' ) && DOING_AJAX && isset( $_POST['action'] ) && false !== strpos( $_POST['action'], 'wpmdb' ) ) {
27
- $remove_function = true;
28
- }
29
 
30
- if ( $remove_function ) {
31
- global $wp_filter;
32
- $admin_init_functions = $wp_filter['admin_init'];
33
- foreach ( $admin_init_functions as $priority => $functions ) {
34
- foreach ( $functions as $key => $function ) {
35
- // searching for function this way as can't rely on the calling class being named TGM_Plugin_Activation
36
- if ( false !== strpos( $key, 'force_activation' ) ) {
37
- unset( $wp_filter['admin_init'][ $priority ][ $key ] );
38
 
39
- return;
40
- }
41
- }
42
- }
43
- }
44
  }
45
-
46
- add_action( 'admin_init', 'wpmdbc_tgmpa_compatibility', 1 );
47
-
48
- /**
49
- * remove blog-active plugins
50
- *
51
- * @param array $plugins numerically keyed array of plugin names
52
- *
53
- * @return array
54
- */
55
- function wpmdbc_exclude_plugins( $plugins ) {
56
- if ( ! is_array( $plugins ) || empty( $plugins ) ) {
57
- return $plugins;
58
- }
59
-
60
- if ( ! wpmdbc_is_compatibility_mode_request() ) {
61
- return $plugins;
62
- }
63
-
64
- $blacklist_plugins = wpmdbc_get_blacklist_plugins();
65
-
66
- if ( ! empty( $blacklist_plugins ) ) {
67
- foreach ( $plugins as $key => $plugin ) {
68
- if ( false !== strpos( $plugin, 'wp-migrate-db-pro' ) || ! isset( $blacklist_plugins[ $plugin ] ) ) {
69
- continue;
70
- }
71
- unset( $plugins[ $key ] );
72
- }
73
- }
74
-
75
- return $plugins;
76
- }
77
-
78
- add_filter( 'option_active_plugins', 'wpmdbc_exclude_plugins' );
79
-
80
- /**
81
- * remove network-active plugins
82
- *
83
- * @param array $plugins array of plugins keyed by name (name=>timestamp pairs)
84
- *
85
- * @return array
86
- */
87
- function wpmdbc_exclude_site_plugins( $plugins ) {
88
- if ( ! is_array( $plugins ) || empty( $plugins ) ) {
89
- return $plugins;
90
- }
91
-
92
- if ( ! wpmdbc_is_compatibility_mode_request() ) {
93
- return $plugins;
94
- }
95
-
96
- $blacklist_plugins = wpmdbc_get_blacklist_plugins();
97
-
98
- if ( ! empty( $blacklist_plugins ) ) {
99
- foreach ( array_keys( $plugins ) as $plugin ) {
100
- if ( false !== strpos( $plugin, 'wp-migrate-db-pro' ) || ! isset( $blacklist_plugins[ $plugin ] ) ) {
101
- continue;
102
- }
103
- unset( $plugins[ $plugin ] );
104
- }
105
- }
106
-
107
- return $plugins;
108
- }
109
-
110
- add_filter( 'site_option_active_sitewide_plugins', 'wpmdbc_exclude_site_plugins' );
111
-
112
- /**
113
- * Should the current request be processed by Compatibility Mode?
114
- *
115
- * @return bool
116
- */
117
- function wpmdbc_is_compatibility_mode_request() {
118
- if ( ! defined( 'DOING_AJAX' ) ||
119
- ! DOING_AJAX ||
120
- ! isset( $_POST['action'] ) ||
121
- false === strpos( $_POST['action'], 'wpmdb' ) ||
122
- in_array( $_POST['action'], array( 'wpmdb_flush', 'wpmdb_remote_flush' ) )
123
- ) {
124
- return false;
125
- }
126
-
127
- return true;
128
  }
129
 
130
- /**
131
- * Returns an array of plugin slugs to be blacklisted.
132
- *
133
- * @return array
134
- */
135
- function wpmdbc_get_blacklist_plugins() {
136
- $blacklist_plugins = array();
137
-
138
- $wpmdb_settings = get_site_option( 'wpmdb_settings' );
139
-
140
- if ( ! empty( $wpmdb_settings['blacklist_plugins'] ) ) {
141
- $blacklist_plugins = array_flip( $wpmdb_settings['blacklist_plugins'] );
142
- }
143
-
144
- return $blacklist_plugins;
145
  }
1
  <?php
2
  /*
3
+ Plugin Name: WP Migrate DB Compatibility
4
  Plugin URI: http://deliciousbrains.com/wp-migrate-db-pro/
5
+ Description: Prevents 3rd party plugins from being loaded during WP Migrate DB specific operations
6
  Author: Delicious Brains
7
  Version: 1.1
8
  Author URI: http://deliciousbrains.com
9
  */
10
 
11
+ $GLOBALS['wpmdb_compatibility']['active'] = true;
12
 
13
+ if ( defined( 'WP_PLUGIN_DIR' ) ) {
14
+ $plugins_dir = trailingslashit( WP_PLUGIN_DIR );
 
 
 
 
 
15
 
16
+ } else if ( defined( 'WPMU_PLUGIN_DIR' ) ) {
17
+ $plugins_dir = trailingslashit( WPMU_PLUGIN_DIR );
 
 
 
 
 
 
18
 
19
+ } else if ( defined( 'WP_CONTENT_DIR' ) ) {
20
+ $plugins_dir = trailingslashit( WP_CONTENT_DIR ) . 'plugins/';
 
 
 
 
 
 
21
 
22
+ } else {
23
+ $plugins_dir = plugin_dir_path( __FILE__ ) . '../plugins/';
 
 
 
24
  }
25
+ $compat_class_path = 'class/wpmdb-compatibility.php';
26
+ $wpmdbpro_compatibility_class = $plugins_dir . 'wp-migrate-db-pro/' . $compat_class_path;
27
+ $wpmdb_compatibility_class = $plugins_dir . 'wp-migrate-db/' . $compat_class_path;
28
+
29
+ if ( file_exists( $wpmdbpro_compatibility_class ) ) {
30
+ include_once $wpmdbpro_compatibility_class;
31
+ } elseif ( file_exists( $wpmdb_compatibility_class ) ) {
32
+ include_once $wpmdb_compatibility_class;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  }
34
 
35
+ if ( class_exists( 'WPMDB_Compatibility' ) ) {
36
+ new WPMDB_Compatibility();
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  }
languages/wp-migrate-db-en.pot CHANGED
@@ -8,7 +8,7 @@ msgid ""
8
  msgstr ""
9
  "Project-Id-Version: wp-migrate-db\n"
10
  "Report-Msgid-Bugs-To: nom@deliciousbrains.com\n"
11
- "POT-Creation-Date: 2016-12-16 09:10-0500\n"
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,25 +17,192 @@ msgstr ""
17
  "Content-Type: text/plain; charset=UTF-8\n"
18
  "Content-Transfer-Encoding: 8bit\n"
19
 
20
- #: class/wpmdb-base.php:172
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  msgid ""
22
  "Invalid content verification signature, please verify the connection "
23
  "information on the remote site and try again."
24
  msgstr ""
25
 
26
- #: class/wpmdb-base.php:364
 
 
 
 
 
 
27
  #, php-format
28
  msgid ""
29
  "The connection to the remote server has timed out, no changes have been "
30
  "committed. (#134 - scope: %s)"
31
  msgstr ""
32
 
33
- #: class/wpmdb-base.php:366
34
  #, php-format
35
  msgid "We could not find: %s. Are you sure this is the correct URL?"
36
  msgstr ""
37
 
38
- #: class/wpmdb-base.php:371
39
  msgid ""
40
  "It appears that you might be trying to pull from a local environment. This "
41
  "will not work if <u>this</u> website happens to be located on a remote "
@@ -43,7 +210,7 @@ msgid ""
43
  "environment."
44
  msgstr ""
45
 
46
- #: class/wpmdb-base.php:373
47
  msgid ""
48
  "It appears that you might be trying to push to a local environment. This "
49
  "will not work if <u>this</u> website happens to be located on a remote "
@@ -51,7 +218,7 @@ msgid ""
51
  "environment."
52
  msgstr ""
53
 
54
- #: class/wpmdb-base.php:381
55
  #, php-format
56
  msgid ""
57
  "We've detected that <code>WP_HTTP_BLOCK_EXTERNAL</code> is enabled and the "
@@ -61,133 +228,112 @@ msgid ""
61
  "\" target=\"_blank\">More information</a>. (#147 - scope: %3$s)"
62
  msgstr ""
63
 
64
- #: class/wpmdb-base.php:384
65
  #, php-format
66
  msgid ""
67
  "Couldn't connect over HTTPS. You might want to try regular HTTP instead. "
68
  "(#121 - scope: %s)"
69
  msgstr ""
70
 
71
- #: class/wpmdb-base.php:386
72
  #, php-format
73
  msgid ""
74
- "<strong>SSL Connection error:</strong> (#121 - scope: %s) This typically "
75
- "means that the version of SSL that your local site is using to connect to "
76
- "the remote is incompatible or, more likely, being rejected by the remote "
77
  "server because it's insecure. <a href=\"%s\" target=\"_blank\">See our "
78
  "documentation</a> for possible solutions."
79
  msgstr ""
80
 
81
- #: class/wpmdb-base.php:388
82
  #, php-format
83
  msgid ""
84
  "The connection failed, an unexpected error occurred, please contact support. "
85
  "(#121 - scope: %s)"
86
  msgstr ""
87
 
88
- #: class/wpmdb-base.php:396
89
  msgid ""
90
  "The remote site is protected with Basic Authentication. Please enter the "
91
  "username and password above to continue. (401 Unauthorized)"
92
  msgstr ""
93
 
94
- #: class/wpmdb-base.php:403
 
 
 
 
 
 
 
95
  #, php-format
96
  msgid ""
97
  "Unable to connect to the remote server, please check the connection details "
98
  "- %1$s %2$s (#129 - scope: %3$s)"
99
  msgstr ""
100
 
101
- #: class/wpmdb-base.php:413
102
  #, php-format
103
  msgid ""
104
  "WP Migrate DB Pro does not seem to be installed or active on the remote "
105
  "site. (#131 - scope: %s)"
106
  msgstr ""
107
 
108
- #: class/wpmdb-base.php:416
109
  #, php-format
110
  msgid ""
111
  "A response was expected from the remote, instead we got nothing. (#146 - "
112
  "scope: %1$s) Please review %2$s for possible solutions."
113
  msgstr ""
114
 
115
- #: class/wpmdb-base.php:416
116
- #: class/wpmdb.php:3625
117
  msgid "our documentation"
118
  msgstr ""
119
 
120
- #: class/wpmdb-base.php:425
121
  msgid ""
122
  "There was a problem with the AJAX request, we were expecting a serialized "
123
  "response, instead we received:<br />"
124
  msgstr ""
125
 
126
- #: class/wpmdb-base.php:747
127
- #: class/wpmdb-base.php:1208
128
- #, php-format
129
- msgid ""
130
- "<strong>Could not connect to api.deliciousbrains.com</strong> &mdash; You "
131
- "will not receive update notifications or be able to activate your license "
132
- "until this is fixed. This issue is often caused by an improperly configured "
133
- "SSL server (https). We recommend <a href=\"%1$s\" target=\"_blank\">fixing "
134
- "the SSL configuration on your server</a>, but if you need a quick fix you "
135
- "can:%2$s"
136
- msgstr ""
137
-
138
- #: class/wpmdb-base.php:747
139
- #: class/wpmdb-base.php:1208
140
- msgid "Temporarily disable SSL for connections to api.deliciousbrains.com"
141
- msgstr ""
142
-
143
- #: class/wpmdb-base.php:755
144
- #: class/wpmdb-base.php:1214
145
- #, php-format
146
- msgid ""
147
- "We've detected that <code>WP_HTTP_BLOCK_EXTERNAL</code> is enabled and the "
148
- "host <strong>%1$s</strong> has not been added to <code>WP_ACCESSIBLE_HOSTS</"
149
- "code>. Please disable <code>WP_HTTP_BLOCK_EXTERNAL</code> or add <strong>"
150
- "%1$s</strong> to <code>WP_ACCESSIBLE_HOSTS</code> to continue. <a href=\"%2$s"
151
- "\" target=\"_blank\">More information</a>."
152
- msgstr ""
153
-
154
- #: class/wpmdb-base.php:800
155
  msgid ""
156
  "<strong>Delicious Brains API is Down — </strong>Unfortunately we're "
157
  "experiencing some problems with our server."
158
  msgstr ""
159
 
160
- #: class/wpmdb-base.php:804
161
  #, php-format
162
  msgctxt "ex. 2 hours ago"
163
  msgid "%s ago"
164
  msgstr ""
165
 
166
- #: class/wpmdb-base.php:809
167
  msgid "Here's the most recent update on its status"
168
  msgstr ""
169
 
170
- #: class/wpmdb-base.php:836
171
  #, php-format
172
  msgid ""
173
  "Error retrieving download from deliciousbrain.com. Please try again or "
174
  "download manually from <a href=\"%1$s\">%2$s</a>."
175
  msgstr ""
176
 
177
- #: class/wpmdb-base.php:836
178
  msgctxt "Delicious Brains account"
179
  msgid "My Account"
180
  msgstr ""
181
 
182
- #: class/wpmdb-base.php:895
183
- #: class/wpmdb.php:113
184
- #: class/wpmdb.php:314
185
- #: class/wpmdbpro.php:1571
186
  msgctxt "Plugin configuration and preferences"
187
  msgid "Settings"
188
  msgstr ""
189
 
190
- #: class/wpmdb-base.php:896
191
  #, php-format
192
  msgid ""
193
  "To finish activating WP Migrate DB Pro, please go to %1$s and enter your "
@@ -195,31 +341,31 @@ msgid ""
195
  "\">purchase one</a>."
196
  msgstr ""
197
 
198
- #: class/wpmdb-base.php:1127
199
- #: class/wpmdb-base.php:1137
200
  msgctxt "A new version of the plugin is available"
201
  msgid "Update Available"
202
  msgstr ""
203
 
204
- #: class/wpmdb-base.php:1128
205
  #, php-format
206
  msgid "A new version of %1$s is now available. %2$s"
207
  msgstr ""
208
 
209
- #: class/wpmdb-base.php:1128
210
- #: class/wpmdb-base.php:1138
211
  msgctxt "Download and install a new version of the plugin"
212
  msgid "Update Now"
213
  msgstr ""
214
 
215
- #: class/wpmdb-base.php:1138
216
  #, php-format
217
  msgid ""
218
  "%1$s %2$s is now available. You currently have %3$s installed. <a href=\"%4$s"
219
  "\">%5$s</a>"
220
  msgstr ""
221
 
222
- #: class/wpmdb-base.php:1182
223
  #, php-format
224
  msgid ""
225
  "<strong>Activate Your License</strong> &mdash; Please <a href=\"%s\" class="
@@ -227,120 +373,54 @@ msgid ""
227
  "priority support and plugin updates."
228
  msgstr ""
229
 
230
- #: class/wpmdb-base.php:1199
231
  msgid ""
232
  "<strong>We've temporarily activated your license and will complete the "
233
  "activation once the Delicious Brains API is available again.</strong>"
234
  msgstr ""
235
 
236
- #: class/wpmdb-base.php:1221
237
- #, php-format
238
- msgid ""
239
- "<strong>Your License Was Cancelled</strong> &mdash; Please visit <a href=\"%s"
240
- "\" target=\"_blank\">My Account</a> to renew or upgrade your license and "
241
- "enable push and pull."
242
- msgstr ""
243
-
244
- #: class/wpmdb-base.php:1222
245
- #: class/wpmdb-base.php:1227
246
- #: class/wpmdb-base.php:1248
247
- #: class/wpmdb-base.php:1252
248
- #: class/wpmdbpro.php:1028
249
- #: class/wpmdbpro.php:1578
250
- msgid "Check my license again"
251
- msgstr ""
252
-
253
- #: class/wpmdb-base.php:1225
254
- msgid "Your License Has Expired"
255
- msgstr ""
256
-
257
- #: class/wpmdb-base.php:1226
258
- #, php-format
259
- msgid "Login to <a href=\"%s\">My Account</a> to renew. "
260
- msgstr ""
261
-
262
- #: class/wpmdb-base.php:1231
263
  msgid "Updates are only available to those with an active license. "
264
  msgstr ""
265
 
266
- #: class/wpmdb-base.php:1232
267
  msgid "Only active licenses can download and install addons. "
268
  msgstr ""
269
 
270
- #: class/wpmdb-base.php:1233
271
  msgid "Only active licenses can submit support requests. "
272
  msgstr ""
273
 
274
- #: class/wpmdb-base.php:1234
275
  msgid ""
276
  "All features will continue to work, but you won't be able to receive updates "
277
  "or email support. "
278
  msgstr ""
279
 
280
- #: class/wpmdb-base.php:1247
281
- #, php-format
282
- msgid ""
283
- "<strong>No Activations Left</strong> &mdash; Please visit <a href=\"%s\" "
284
- "target=\"_blank\">My Account</a> to upgrade your license or deactivate a "
285
- "previous activation and enable push and pull."
286
- msgstr ""
287
-
288
- #: class/wpmdb-base.php:1251
289
- #, php-format
290
- msgid ""
291
- "<strong>Your License Was Not Found</strong> &mdash; Perhaps you made a typo "
292
- "when defining your WPMDB_LICENCE constant in your wp-config.php? Please "
293
- "visit <a href=\"%s\" target=\"_blank\">My Account</a> to double check your "
294
- "license key."
295
- msgstr ""
296
-
297
- #: class/wpmdb-base.php:1255
298
- msgid "<strong>Your License Was Not Found</strong> &mdash; "
299
- msgstr ""
300
-
301
- #: class/wpmdb-base.php:1259
302
- msgid "Your License Is Inactive"
303
- msgstr ""
304
-
305
- #: class/wpmdb-base.php:1260
306
- msgid "Your license has been deactivated for this install."
307
- msgstr ""
308
-
309
- #: class/wpmdb-base.php:1260
310
- msgid "Reactivate License"
311
- msgstr ""
312
-
313
- #: class/wpmdb-base.php:1263
314
- #, php-format
315
- msgid ""
316
- "<strong>An Unexpected Error Occurred</strong> &mdash; Please contact us at "
317
- "<a href=\"%1$s\">%2$s</a> and quote the following:"
318
- msgstr ""
319
-
320
- #: class/wpmdb-base.php:1302
321
  #, php-format
322
  msgid "Invalid nonce for: %s"
323
  msgstr ""
324
 
325
- #: class/wpmdb-base.php:1310
326
  #, php-format
327
  msgid "Access denied for: %s"
328
  msgstr ""
329
 
330
- #: class/wpmdb-base.php:1516
331
  msgctxt "dismiss notice permanently"
332
  msgid "Dismiss"
333
  msgstr ""
334
 
335
- #: class/wpmdb-base.php:1525
336
  msgid "Remind Me Later"
337
  msgstr ""
338
 
339
- #: class/wpmdb-base.php:1627
340
  msgid "Failed to save migration state. Please contact support."
341
  msgstr ""
342
 
343
- #: class/wpmdb-base.php:1650
344
  msgid "Failed to retrieve migration state. Please contact support."
345
  msgstr ""
346
 
@@ -349,75 +429,91 @@ msgstr ""
349
  msgid "CLI addon requires PHP %1$s+"
350
  msgstr ""
351
 
352
- #: class/wpmdb-cli.php:103
353
  msgid "Profile not found or unable to be generated from params."
354
  msgstr ""
355
 
356
- #: class/wpmdb-cli.php:142
 
 
 
 
357
  #, php-format
358
  msgid "The following table(s) do not exist in the %1$s database: %2$s"
359
  msgstr ""
360
 
361
- #: class/wpmdb-cli.php:191
362
  #, php-format
363
  msgid ""
364
  "We were expecting a JSON response, instead we received: %2$s (function name: "
365
  "%1$s)"
366
  msgstr ""
367
 
368
- #: class/wpmdb-cli.php:247
369
  msgid "Initiating migration..."
370
  msgstr ""
371
 
372
- #: class/wpmdb-cli.php:294
373
  msgid "Exporting tables"
374
  msgstr ""
375
 
376
- #: class/wpmdb-cli.php:297
377
  msgid "Running find & replace"
378
  msgstr ""
379
 
380
- #: class/wpmdb-cli.php:371
381
  msgid "No tables selected for migration."
382
  msgstr ""
383
 
384
- #: class/wpmdb-cli.php:464
385
  msgid "Cleaning up..."
386
  msgstr ""
387
 
388
- #: class/wpmdb-cli.php:548
389
  msgid "Unable to move exported file."
390
  msgstr ""
391
 
392
- #: class/wpmdb-cli.php:608
393
  msgid "Parameter errors: "
394
  msgstr ""
395
 
396
- #: class/wpmdb-cli.php:610
397
  #, php-format
398
  msgid "unknown %s parameter"
399
  msgstr ""
400
 
401
- #: class/wpmdb-cli.php:614
402
  msgid ""
403
  "Please make sure that you have activated the appropriate addons for WP "
404
  "Migrate DB Pro."
405
  msgstr ""
406
 
407
- #: class/wpmdb-cli.php:621
 
 
 
 
408
  msgid "Missing action parameter"
409
  msgstr ""
410
 
411
- #: class/wpmdb-cli.php:637
412
  msgid "Missing find and replace values."
413
  msgstr ""
414
 
415
- #: class/wpmdb-cli.php:644
 
 
 
 
 
 
 
 
416
  #, php-format
417
  msgid "%1$s and %2$s must contain the same number of values"
418
  msgstr ""
419
 
420
- #: class/wpmdb-cli.php:692
421
  #, php-format
422
  msgid ""
423
  "Cannot write to file \"%1$s\". Please ensure that the specified directory "
@@ -438,11 +534,32 @@ msgid "Export saved to: %s"
438
  msgstr ""
439
 
440
  #: class/wpmdb-command.php:190
441
- #: class/wpmdb.php:3186
442
  msgid "Find & Replace complete"
443
  msgstr ""
444
 
445
- #: class/wpmdb-replace.php:282
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
446
  msgid ""
447
  "Failed attempting to do the recursive unserialize replace. Please contact "
448
  "support."
@@ -541,301 +658,314 @@ msgstr ""
541
  msgid "WPMDB Error: Data cannot be unserialized. %s"
542
  msgstr ""
543
 
544
- #: class/wpmdb.php:112
545
  msgctxt "Configure a migration or export"
546
  msgid "Migrate"
547
  msgstr ""
548
 
549
- #: class/wpmdb.php:114
550
  msgctxt "Plugin extensions"
551
  msgid "Addons"
552
  msgstr ""
553
 
554
- #: class/wpmdb.php:115
555
  msgctxt "Get help or contact support"
556
  msgid "Help"
557
  msgstr ""
558
 
559
- #: class/wpmdb.php:179
560
  #, php-format
561
- msgid "The following directory could not be created: %s"
 
 
 
 
 
562
  msgstr ""
563
 
564
- #: class/wpmdb.php:184
565
  #, php-format
566
- msgid "Could not copy the compatibility plugin from %1$s to %2$s"
 
 
 
567
  msgstr ""
568
 
569
- #: class/wpmdb.php:190
570
  #, php-format
571
- msgid "Could not remove the compatibility plugin from %s"
 
 
 
 
572
  msgstr ""
573
 
574
- #: class/wpmdb.php:984
575
- #: class/wpmdbpro.php:328
576
- #: class/wpmdbpro.php:1415
577
  msgid ""
578
  "Failed attempting to unserialize the response from the remote server. Please "
579
  "contact support."
580
  msgstr ""
581
 
582
- #: class/wpmdb.php:1910
 
583
  msgid ""
584
- "Failed to retrieve table structure, please ensure your database is online. "
585
- "(#125)"
586
  msgstr ""
587
 
588
- #: class/wpmdb.php:1929
589
- msgid "Failed to get table structure."
590
- msgstr ""
591
-
592
- #: class/wpmdb.php:2007
593
  #, php-format
594
  msgid "Error creating temporary table. Table \"%s\" does not exist."
595
  msgstr ""
596
 
597
- #: class/wpmdb.php:2113
598
  #, php-format
599
  msgid "Delete any existing table %s"
600
  msgstr ""
601
 
602
- #: class/wpmdb.php:2124
603
  #, php-format
604
  msgid "Table structure of table %s"
605
  msgstr ""
606
 
607
- #: class/wpmdb.php:2132
608
  msgid ""
609
  "Failed to generate the create table query, please ensure your database is "
610
  "online. (#126)"
611
  msgstr ""
612
 
613
- #: class/wpmdb.php:2188
614
  #, php-format
615
  msgid "Data contents of table %s"
616
  msgstr ""
617
 
618
- #: class/wpmdb.php:2206
619
  #, php-format
620
  msgid "End of data contents of table %s"
621
  msgstr ""
622
 
623
- #: class/wpmdb.php:2697
624
  msgid "WordPress MySQL database migration"
625
  msgstr ""
626
 
627
- #: class/wpmdb.php:2699
628
  #, php-format
629
  msgid "Generated: %s"
630
  msgstr ""
631
 
632
- #: class/wpmdb.php:2700
633
  #, php-format
634
  msgid "Hostname: %s"
635
  msgstr ""
636
 
637
- #: class/wpmdb.php:2701
638
  #, php-format
639
  msgid "Database: %s"
640
  msgstr ""
641
 
642
- #: class/wpmdb.php:2754
643
  msgid "Failed to write the gzipped SQL data to the file. (#127)"
644
  msgstr ""
645
 
646
- #: class/wpmdb.php:2761
647
  msgid "Failed to write the SQL data to the file. (#128)"
648
  msgstr ""
649
 
650
- #: class/wpmdb.php:2904
651
- #: class/wpmdb.php:2929
652
- #: class/wpmdbpro.php:1375
653
  msgid "Migrate DB Pro"
654
  msgstr ""
655
 
656
- #: class/wpmdb.php:2904
657
- #: class/wpmdb.php:2929
658
- #: class/wpmdb.php:3532
659
  msgid "Migrate DB"
660
  msgstr ""
661
 
662
- #: class/wpmdb.php:3106
663
  msgid ""
664
  "A problem occurred when trying to change the maximum request size, please "
665
  "try again."
666
  msgstr ""
667
 
668
- #: class/wpmdb.php:3107
669
- #: class/wpmdbpro.php:1028
670
  msgid "A problem occurred when trying to check the license, please try again."
671
  msgstr ""
672
 
673
- #: class/wpmdb.php:3108
674
  msgid "Establishing connection to remote server, please wait"
675
  msgstr ""
676
 
677
- #: class/wpmdb.php:3109
678
  msgid ""
679
  "A problem occurred when attempting to connect to the local server, please "
680
  "check the details and try again."
681
  msgstr ""
682
 
683
- #: class/wpmdb.php:3110
684
  msgid "Please enter your license key."
685
  msgstr ""
686
 
687
- #: class/wpmdb.php:3111
688
  msgid ""
689
  "A problem occurred when trying to register the license, please try again."
690
  msgstr ""
691
 
692
- #: class/wpmdb.php:3112
693
  msgid ""
694
  "Your license has been activated. You will now receive automatic updates and "
695
  "access to email support."
696
  msgstr ""
697
 
698
- #: class/wpmdb.php:3113
699
  msgid "Fetching license details, please wait…"
700
  msgstr ""
701
 
702
- #: class/wpmdb.php:3114
703
  msgid ""
704
  "An error occurred when trying to clear the debug log. Please contact "
705
  "support. (#132)"
706
  msgstr ""
707
 
708
- #: class/wpmdb.php:3115
709
  msgid ""
710
  "An error occurred when trying to update the debug log. Please contact "
711
  "support. (#133)"
712
  msgstr ""
713
 
714
- #: class/wpmdb.php:3116
715
  msgid "Please select at least one table to migrate."
716
  msgstr ""
717
 
718
- #: class/wpmdb.php:3117
719
  msgid "Please select at least one table for backup."
720
  msgstr ""
721
 
722
- #: class/wpmdb.php:3118
 
 
 
 
723
  msgid "Please enter a name for your migration profile."
724
  msgstr ""
725
 
726
- #: class/wpmdb.php:3119
727
  msgid ""
728
  "An error occurred when attempting to save the migration profile. Please see "
729
  "the Help tab for details on how to request support. (#118)"
730
  msgstr ""
731
 
732
- #: class/wpmdb.php:3120
733
  msgctxt "Data has been successfully exported"
734
  msgid "Export complete"
735
  msgstr ""
736
 
737
- #: class/wpmdb.php:3121
738
  msgid "Exporting, please wait…"
739
  msgstr ""
740
 
741
- #: class/wpmdb.php:3122
742
  msgid "please wait…"
743
  msgstr ""
744
 
745
- #: class/wpmdb.php:3123
746
  msgctxt "Finished successfully"
747
  msgid "complete"
748
  msgstr ""
749
 
750
- #: class/wpmdb.php:3124
751
  msgctxt "Copy of data between servers did not complete"
752
  msgid "Migration failed"
753
  msgstr ""
754
 
755
- #: class/wpmdb.php:3125
756
  msgctxt "Saving a copy of the data before import"
757
  msgid "Backing up"
758
  msgstr ""
759
 
760
- #: class/wpmdb.php:3126
761
  msgctxt "In line to be processed"
762
  msgid "Queued"
763
  msgstr ""
764
 
765
- #: class/wpmdb.php:3127
766
  msgctxt "Copying data between servers"
767
  msgid "Migrating"
768
  msgstr ""
769
 
770
- #: class/wpmdb.php:3128
771
  msgctxt "Process is active"
772
  msgid "Running"
773
  msgstr ""
774
 
775
- #: class/wpmdb.php:3129
776
  msgctxt "Current request status"
777
  msgid "Status"
778
  msgstr ""
779
 
780
- #: class/wpmdb.php:3130
781
  msgctxt "The message the server responded with"
782
  msgid "Response"
783
  msgstr ""
784
 
785
- #: class/wpmdb.php:3131
786
  msgid ""
787
  "A problem occurred when attempting to process the following table (#113)"
788
  msgstr ""
789
 
790
- #: class/wpmdb.php:3132
791
  msgid ""
792
  "A problem occurred when processing the following table. We were expecting a "
793
  "response in JSON format but instead received an empty response."
794
  msgstr ""
795
 
796
- #: class/wpmdb.php:3133
797
  msgid "Migration completed with some errors"
798
  msgstr ""
799
 
800
- #: class/wpmdb.php:3134
801
  msgid "Migration complete, your backup is located at:"
802
  msgstr ""
803
 
804
- #: class/wpmdb.php:3135
805
  msgid "A problem occurred when finalizing the backup. (#140)"
806
  msgstr ""
807
 
808
- #: class/wpmdb.php:3136
809
  msgctxt "The settings were saved successfully"
810
  msgid "Saved"
811
  msgstr ""
812
 
813
- #: class/wpmdb.php:3137
814
  msgid ""
815
  "Any sites setup to use the current secret key will no longer be able to "
816
  "connect. You will need to update those sites with the newly generated secret "
817
  "key. Do you wish to continue?"
818
  msgstr ""
819
 
820
- #: class/wpmdb.php:3138
821
  msgid ""
822
  "An error occurred when trying to generate the secret key. Please see the "
823
  "Help tab for details on how to request support. (#105)"
824
  msgstr ""
825
 
826
- #: class/wpmdb.php:3139
827
  msgid ""
828
  "You are about to remove the migration profile \"{{profile}}\". This cannot "
829
  "be undone. Do you wish to continue?"
830
  msgstr ""
831
 
832
- #: class/wpmdb.php:3140
833
  msgid ""
834
  "An error occurred when trying to delete the profile. Please see the Help tab "
835
  "for details on how to request support. (#106)"
836
  msgstr ""
837
 
838
- #: class/wpmdb.php:3141
839
  msgid ""
840
  "The selected migration profile could not be deleted because it was not "
841
  "found.\n"
@@ -843,265 +973,273 @@ msgid ""
843
  "migration profiles."
844
  msgstr ""
845
 
846
- #: class/wpmdb.php:3142
847
  msgid ""
848
  "If you change the connection details, you will lose any replaces and table "
849
  "selections you have made below. Do you wish to continue?"
850
  msgstr ""
851
 
852
- #: class/wpmdb.php:3143
853
- #: template/migrate.php:118
854
  msgid "Please enter the connection information above to continue."
855
  msgstr ""
856
 
857
- #: class/wpmdb.php:3144
858
  msgid ""
859
  "An error occurred when trying to save the settings. Please try again. If the "
860
  "problem persists, please see the Help tab for details on how to request "
861
  "support. (#108)"
862
  msgstr ""
863
 
864
- #: class/wpmdb.php:3145
865
  msgid ""
866
  "The connection information appears to be missing, please enter it to "
867
  "continue."
868
  msgstr ""
869
 
870
- #: class/wpmdb.php:3146
871
  msgid ""
872
  "The connection information appears to be incorrect, it should consist of two "
873
  "lines. The first being the remote server's URL and the second being the "
874
  "secret key."
875
  msgstr ""
876
 
877
- #: class/wpmdb.php:3147
878
  msgid ""
879
  "The URL on the first line appears to be invalid, please check it and try "
880
  "again."
881
  msgstr ""
882
 
883
- #: class/wpmdb.php:3148
884
  msgid ""
885
  "The secret key on the second line appears to be invalid. It should be a 40 "
886
  "character string that consists of letters, numbers and special characters "
887
  "only."
888
  msgstr ""
889
 
890
- #: class/wpmdb.php:3149
891
  msgid ""
892
  "It appears you've entered the URL for this website, you need to provide the "
893
  "URL of the remote website instead."
894
  msgstr ""
895
 
896
- #: class/wpmdb.php:3150
897
  msgid ""
898
  "Looks like your remote secret key is the same as the secret key for this "
899
  "site. To fix this, go to the <a href=\"#settings\">Settings tab</a> and "
900
  "click \"Reset Secret Key\""
901
  msgstr ""
902
 
903
- #: class/wpmdb.php:3151
904
  msgid "Time Elapsed:"
905
  msgstr ""
906
 
907
- #: class/wpmdb.php:3152
908
  #: template/migrate-progress.php:17
909
  msgctxt "Temporarily stop migrating"
910
  msgid "Pause"
911
  msgstr ""
912
 
913
- #: class/wpmdb.php:3153
914
  msgctxt "The migration has been temporarily stopped"
915
  msgid "Migration Paused"
916
  msgstr ""
917
 
918
- #: class/wpmdb.php:3154
919
  msgctxt "The find & replace has been temporarily stopped"
920
  msgid "Find &amp; Replace Paused"
921
  msgstr ""
922
 
923
- #: class/wpmdb.php:3155
924
  msgctxt "Restart migrating after it was paused"
925
  msgid "Resume"
926
  msgstr ""
927
 
928
- #: class/wpmdb.php:3156
929
  msgid "Completing current request"
930
  msgstr ""
931
 
932
- #: class/wpmdb.php:3157
933
  msgctxt "The migration is being cancelled"
934
  msgid "Cancelling migration"
935
  msgstr ""
936
 
937
- #: class/wpmdb.php:3158
938
  msgctxt "The find & replace is being cancelled"
939
  msgid "Cancelling find &amp; replace"
940
  msgstr ""
941
 
942
- #: class/wpmdb.php:3159
943
  msgctxt "The migration has been temporarily stopped"
944
  msgid "Paused"
945
  msgstr ""
946
 
947
- #: class/wpmdb.php:3160
948
  msgid "Pause before finalizing the updates"
949
  msgstr ""
950
 
951
- #: class/wpmdb.php:3161
952
  msgid ""
953
  "Automatically paused before migrated tables are replaced. Click \"Resume\" "
954
  "or \"Cancel\" when ready."
955
  msgstr ""
956
 
957
- #: class/wpmdb.php:3162
958
  msgid ""
959
  "Automatically paused before the find &amp; replace was finalized. Click "
960
  "\"Resume\" or \"Cancel\" when ready."
961
  msgstr ""
962
 
963
- #: class/wpmdb.php:3163
964
  msgid "Removing the local MySQL export file"
965
  msgstr ""
966
 
967
- #: class/wpmdb.php:3164
968
  msgid "Removing the local backup MySQL export file"
969
  msgstr ""
970
 
971
- #: class/wpmdb.php:3165
972
  msgid "Removing the local temporary tables"
973
  msgstr ""
974
 
975
- #: class/wpmdb.php:3166
976
  msgid "Removing the remote backup MySQL export file"
977
  msgstr ""
978
 
979
- #: class/wpmdb.php:3167
980
  msgid "Removing the remote temporary tables"
981
  msgstr ""
982
 
983
- #: class/wpmdb.php:3168
984
  msgid "Migration cancellation failed"
985
  msgstr ""
986
 
987
- #: class/wpmdb.php:3169
988
  msgid ""
989
  "A problem occurred while cancelling the migration, you may have to manually "
990
  "delete some temporary files / tables."
991
  msgstr ""
992
 
993
- #: class/wpmdb.php:3170
994
  msgctxt "The migration has been cancelled"
995
  msgid "Migration cancelled"
996
  msgstr ""
997
 
998
- #: class/wpmdb.php:3171
999
  msgid ""
1000
  "The migration has been stopped and all temporary files and data have been "
1001
  "cleaned up."
1002
  msgstr ""
1003
 
1004
- #: class/wpmdb.php:3172
1005
  msgctxt "The migration has been cancelled"
1006
  msgid "Find &amp; replace cancelled"
1007
  msgstr ""
1008
 
1009
- #: class/wpmdb.php:3173
1010
  msgid ""
1011
  "The find &amp; replace has been cancelled and all temporary data has been "
1012
  "cleaned up."
1013
  msgstr ""
1014
 
1015
- #: class/wpmdb.php:3174
1016
  msgctxt "The migration completed successfully"
1017
  msgid "Migration complete"
1018
  msgstr ""
1019
 
1020
- #: class/wpmdb.php:3175
1021
  msgctxt "The migration is in the last stages"
1022
  msgid "Finalizing migration"
1023
  msgstr ""
1024
 
1025
- #: class/wpmdb.php:3176
1026
  msgctxt "The caches and rewrite rules for the target are being flushed"
1027
  msgid "Flushing caches and rewrite rules"
1028
  msgstr ""
1029
 
1030
- #: class/wpmdb.php:3177
1031
  msgid "A problem occurred when trying to add plugins to backlist."
1032
  msgstr ""
1033
 
1034
- #: class/wpmdb.php:3178
1035
  msgid ""
1036
  "If confirmed we will install an additional WordPress 'Must Use' plugin. This "
1037
  "plugin will allow us to control which plugins are loaded during WP Migrate "
1038
  "DB Pro specific operations. Do you wish to continue?"
1039
  msgstr ""
1040
 
1041
- #: class/wpmdb.php:3179
1042
  msgid ""
1043
  "A problem occurred when trying to change the plugin compatibility setting."
1044
  msgstr ""
1045
 
1046
- #: class/wpmdb.php:3180
1047
  msgctxt "Confirmation required"
1048
  msgid "Sure?"
1049
  msgstr ""
1050
 
1051
- #: class/wpmdb.php:3181
1052
  #, php-format
1053
  msgid "Pulling from %s…"
1054
  msgstr ""
1055
 
1056
- #: class/wpmdb.php:3182
1057
  #, php-format
1058
  msgid "Pull from %s complete"
1059
  msgstr ""
1060
 
1061
- #: class/wpmdb.php:3183
1062
  #, php-format
1063
  msgid "Pushing to %s…"
1064
  msgstr ""
1065
 
1066
- #: class/wpmdb.php:3184
1067
  #, php-format
1068
  msgid "Push to %s complete"
1069
  msgstr ""
1070
 
1071
- #: class/wpmdb.php:3185
1072
  msgid "Running Find & Replace…"
1073
  msgstr ""
1074
 
1075
- #: class/wpmdb.php:3187
 
 
 
 
 
 
 
 
1076
  msgid "Copying license to the remote site, please wait"
1077
  msgstr ""
1078
 
1079
- #: class/wpmdb.php:3188
1080
  msgid "Attempting to activate your license, please wait…"
1081
  msgstr ""
1082
 
1083
- #: class/wpmdb.php:3189
1084
  msgid "License successfully activated, please wait…"
1085
  msgstr ""
1086
 
1087
- #: class/wpmdb.php:3190
1088
  msgid ""
1089
  "An error occurred when trying to reactivate your license. Please provide the "
1090
  "following information when requesting support:"
1091
  msgstr ""
1092
 
1093
- #: class/wpmdb.php:3191
1094
  msgid ""
1095
  "<strong>We've temporarily activated your licence and will complete the "
1096
  "activation once the Delicious Brains API is available again.</strong><br /"
1097
  ">Please refresh this page to continue."
1098
  msgstr ""
1099
 
1100
- #: class/wpmdb.php:3192
1101
  msgid "JSON Decoding Failure"
1102
  msgstr ""
1103
 
1104
- #: class/wpmdb.php:3193
1105
  msgid ""
1106
  "Our AJAX request was expecting JSON but we received something else. Often "
1107
  "this is caused by your theme and/or plugins spitting out PHP errors. If you "
@@ -1110,103 +1248,113 @@ msgid ""
1110
  "disable errors from showing up."
1111
  msgstr ""
1112
 
1113
- #: class/wpmdb.php:3194
1114
  msgid "View error messages"
1115
  msgstr ""
1116
 
1117
- #: class/wpmdb.php:3195
1118
  #, php-format
1119
  msgid "Waiting %s seconds before executing next step"
1120
  msgstr ""
1121
 
1122
- #: class/wpmdb.php:3196
1123
  msgid ""
1124
  "A problem occurred when trying to change the delay between requests, please "
1125
  "try again."
1126
  msgstr ""
1127
 
1128
- #: class/wpmdb.php:3197
1129
  msgid "A problem occurred when flushing caches and rewrite rules. (#145)"
1130
  msgstr ""
1131
 
1132
- #: class/wpmdb.php:3198
1133
  msgctxt "Transfer this database to the remote site"
1134
  msgid "Push"
1135
  msgstr ""
1136
 
1137
- #: class/wpmdb.php:3199
1138
  msgctxt "Transfer this database to the remote site and save migration profile"
1139
  msgid "Push &amp; Save"
1140
  msgstr ""
1141
 
1142
- #: class/wpmdb.php:3200
1143
  msgctxt "Transfer the remote database to this site"
1144
  msgid "Pull"
1145
  msgstr ""
1146
 
1147
- #: class/wpmdb.php:3201
1148
  msgctxt "Transfer the remote database to this site and save migration profile"
1149
  msgid "Pull &amp; Save"
1150
  msgstr ""
1151
 
1152
- #: class/wpmdb.php:3202
1153
- #: template/migrate.php:368
1154
  msgctxt "Download a copy of the database"
1155
  msgid "Export"
1156
  msgstr ""
1157
 
1158
- #: class/wpmdb.php:3203
1159
  msgctxt "Download a copy of the database and save migration profile"
1160
  msgid "Export &amp; Save"
1161
  msgstr ""
1162
 
1163
- #: class/wpmdb.php:3204
 
 
 
 
 
 
 
 
 
 
1164
  msgctxt "Run a find and replace on the database"
1165
  msgid "Find &amp; Replace"
1166
  msgstr ""
1167
 
1168
- #: class/wpmdb.php:3205
1169
  msgctxt "Run a find and replace and save migration profile"
1170
  msgid "Find &amp; Replace &amp; Save"
1171
  msgstr ""
1172
 
1173
- #: class/wpmdb.php:3206
1174
  msgctxt "database tables"
1175
  msgid "Tables"
1176
  msgstr ""
1177
 
1178
- #: class/wpmdb.php:3207
1179
  msgid "Files"
1180
  msgstr ""
1181
 
1182
- #: class/wpmdb.php:3208
1183
  msgctxt "Transferred"
1184
  msgid "Migrated"
1185
  msgstr ""
1186
 
1187
- #: class/wpmdb.php:3209
1188
  msgid "Backed Up"
1189
  msgstr ""
1190
 
1191
- #: class/wpmdb.php:3210
1192
  msgid "Searched"
1193
  msgstr ""
1194
 
1195
- #: class/wpmdb.php:3211
1196
  msgctxt "Obscure from view"
1197
  msgid "Hide"
1198
  msgstr ""
1199
 
1200
- #: class/wpmdb.php:3212
1201
  msgctxt "Reveal"
1202
  msgid "Show"
1203
  msgstr ""
1204
 
1205
- #: class/wpmdb.php:3213
1206
  msgid "Welcome to WP Migrate DB Pro! &#127881;"
1207
  msgstr ""
1208
 
1209
- #: class/wpmdb.php:3214
1210
  #, php-format
1211
  msgid ""
1212
  "Hey, this is the first time activating your license, nice! Your migrations "
@@ -1216,70 +1364,112 @@ msgid ""
1216
  "submit a support request."
1217
  msgstr ""
1218
 
1219
- #: class/wpmdb.php:3215
1220
  #, php-format
1221
  msgid "%1$s Stage %2$s of %3$s"
1222
  msgstr ""
1223
 
1224
- #: class/wpmdb.php:3216
1225
  msgid "Paused"
1226
  msgstr ""
1227
 
1228
- #: class/wpmdb.php:3217
1229
  msgid "Cancelling"
1230
  msgstr ""
1231
 
1232
- #: class/wpmdb.php:3218
1233
  msgid "Cancelled"
1234
  msgstr ""
1235
 
1236
- #: class/wpmdb.php:3219
1237
  msgid "Finalizing"
1238
  msgstr ""
1239
 
1240
- #: class/wpmdb.php:3220
1241
  msgid "Complete"
1242
  msgstr ""
1243
 
1244
- #: class/wpmdb.php:3221
1245
  msgid "Failed"
1246
  msgstr ""
1247
 
1248
- #: class/wpmdb.php:3222
1249
  #, php-format
1250
  msgid "%1$s items are not shown to maintain browser performance"
1251
  msgstr ""
1252
 
1253
- #: class/wpmdb.php:3223
1254
  msgctxt "Error log emptied"
1255
  msgid "Cleared"
1256
  msgstr ""
1257
 
1258
- #: class/wpmdb.php:3259
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1259
  msgid "Could not find the file to download:"
1260
  msgstr ""
1261
 
1262
- #: class/wpmdb.php:3466
1263
  msgid "MySQL export file not found."
1264
  msgstr ""
1265
 
1266
- #: class/wpmdb.php:3472
1267
  msgid "Could not delete the MySQL export file."
1268
  msgstr ""
1269
 
1270
- #: class/wpmdb.php:3538
1271
  msgid ""
1272
  "WP Migrate DB and WP Migrate DB Pro cannot both be active. We've "
1273
  "automatically deactivated WP Migrate DB."
1274
  msgstr ""
1275
 
1276
- #: class/wpmdb.php:3540
1277
  msgid ""
1278
  "WP Migrate DB and WP Migrate DB Pro cannot both be active. We've "
1279
  "automatically deactivated WP Migrate DB Pro."
1280
  msgstr ""
1281
 
1282
- #: class/wpmdb.php:3625
1283
  #, php-format
1284
  msgid ""
1285
  "The source site supports utf8mb4 data but the target does not, aborting "
@@ -1287,29 +1477,29 @@ msgid ""
1287
  "information. (#148)"
1288
  msgstr ""
1289
 
1290
- #: class/wpmdb.php:3676
1291
  msgid "Warning: Mixed Case Table Names"
1292
  msgstr ""
1293
 
1294
- #: class/wpmdb.php:3679
1295
  msgid ""
1296
  "Whoa! We've detected that your <b>local</b> site has the MySQL setting "
1297
  "<code>lower_case_table_names</code> set to <code>1</code>."
1298
  msgstr ""
1299
 
1300
- #: class/wpmdb.php:3681
1301
  msgid ""
1302
  "Whoa! We've detected that your <b>remote</b> site has the MySQL setting "
1303
  "<code>lower_case_table_names</code> set to <code>1</code>."
1304
  msgstr ""
1305
 
1306
- #: class/wpmdb.php:3684
1307
  msgid ""
1308
  "As a result, uppercase characters in table names will be converted to "
1309
  "lowercase during the migration."
1310
  msgstr ""
1311
 
1312
- #: class/wpmdb.php:3686
1313
  #, php-format
1314
  msgid ""
1315
  "You can read more about this in <a href=\"%s\">our documentation</a>, "
@@ -1324,73 +1514,105 @@ msgid ""
1324
  "Now</a></strong>"
1325
  msgstr ""
1326
 
1327
- #: class/wpmdbpro.php:174
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1328
  msgid "UI Walkthrough"
1329
  msgstr ""
1330
 
1331
- #: class/wpmdbpro.php:175
1332
  msgid ""
1333
  "A brief walkthrough of the WP Migrate DB plugin showing all of the different "
1334
  "options and explaining them."
1335
  msgstr ""
1336
 
1337
- #: class/wpmdbpro.php:178
1338
  msgid "Pulling Live Data Into Your Local Development&nbsp;Environment"
1339
  msgstr ""
1340
 
1341
- #: class/wpmdbpro.php:179
1342
  msgid ""
1343
  "This screencast demonstrates how you can pull data from a remote, live "
1344
  "WordPress install and update the data in your local development environment."
1345
  msgstr ""
1346
 
1347
- #: class/wpmdbpro.php:182
1348
  msgid "Pushing Local Development Data to a Staging&nbsp;Environment"
1349
  msgstr ""
1350
 
1351
- #: class/wpmdbpro.php:183
1352
  msgid ""
1353
  "This screencast demonstrates how you can push a local WordPress database "
1354
  "you've been using for development to a staging environment."
1355
  msgstr ""
1356
 
1357
- #: class/wpmdbpro.php:186
1358
  msgid "WP Migrate DB Pro Media Files Addon 1.3 and CLI Addon 1.1"
1359
  msgstr ""
1360
 
1361
- #: class/wpmdbpro.php:187
1362
  msgid ""
1363
  "A demonstration of what's new in WP Migrate DB Pro Media Files Addon 1.3 and "
1364
  "CLI Addon 1.1."
1365
  msgstr ""
1366
 
1367
- #: class/wpmdbpro.php:294
1368
  msgid ""
1369
  "Please activate your license before attempting a pull or push migration."
1370
  msgstr ""
1371
 
1372
- #: class/wpmdbpro.php:594
1373
  msgid ""
1374
  "The connection succeeded but the remote site is configured to reject pull "
1375
  "connections. You can change this in the \"settings\" tab on the remote site. "
1376
  "(#141)"
1377
  msgstr ""
1378
 
1379
- #: class/wpmdbpro.php:656
1380
  msgid ""
1381
  "The connection succeeded but the remote site is configured to reject pull "
1382
  "connections. You can change this in the \"settings\" tab on the remote site. "
1383
  "(#110)"
1384
  msgstr ""
1385
 
1386
- #: class/wpmdbpro.php:658
1387
  msgid ""
1388
  "The connection succeeded but the remote site is configured to reject push "
1389
  "connections. You can change this in the \"settings\" tab on the remote site. "
1390
  "(#110)"
1391
  msgstr ""
1392
 
1393
- #: class/wpmdbpro.php:737
 
 
 
 
 
1394
  #, php-format
1395
  msgid ""
1396
  "<b>Version Mismatch</b> &mdash; We've detected you have version %1$s of WP "
@@ -1398,7 +1620,7 @@ msgid ""
1398
  "the Plugins page on both installs and check for updates."
1399
  msgstr ""
1400
 
1401
- #: class/wpmdbpro.php:739
1402
  #, php-format
1403
  msgid ""
1404
  "<b>Version Mismatch</b> &mdash; We've detected you have version %1$s of WP "
@@ -1406,163 +1628,159 @@ msgid ""
1406
  "\"%4$s\">Plugins page</a> on both installs and check for updates."
1407
  msgstr ""
1408
 
1409
- #: class/wpmdbpro.php:753
1410
- msgctxt "Asking to try and connect to remote server after verification error"
1411
- msgid "Try again?"
1412
- msgstr ""
1413
-
1414
- #: class/wpmdbpro.php:766
1415
  #, php-format
1416
  msgid ""
1417
  "Activate remote license &mdash; Looks like you don't have a WP Migrate DB "
1418
  "Pro license active at %s."
1419
  msgstr ""
1420
 
1421
- #: class/wpmdbpro.php:768
1422
  #, php-format
1423
  msgid "Copy %1$s license key to %2$s and activate it"
1424
  msgstr ""
1425
 
1426
- #: class/wpmdbpro.php:779
1427
  msgid ""
1428
  "The connection succeeded but the remote site is configured to reject pull "
1429
  "connections. You can change this in the \"settings\" tab on the remote site. "
1430
  "(#122)"
1431
  msgstr ""
1432
 
1433
- #: class/wpmdbpro.php:781
1434
  msgid ""
1435
  "The connection succeeded but the remote site is configured to reject push "
1436
  "connections. You can change this in the \"settings\" tab on the remote site. "
1437
  "(#122)"
1438
  msgstr ""
1439
 
1440
- #: class/wpmdbpro.php:783
1441
  msgctxt "Attempt to connect to the remote server again"
1442
  msgid "Try again?"
1443
  msgstr ""
1444
 
1445
- #: class/wpmdbpro.php:931
1446
  msgctxt "Delete license"
1447
  msgid "Remove"
1448
  msgstr ""
1449
 
1450
- #: class/wpmdbpro.php:1115
1451
  msgid ""
1452
  "If you have an <strong>active license</strong>, you may send an email to the "
1453
  "following address."
1454
  msgstr ""
1455
 
1456
- #: class/wpmdbpro.php:1117
1457
  msgid ""
1458
  "Please copy the Diagnostic Info &amp; Error Log info below into a text file "
1459
  "and attach it to your email. Do the same for any other site involved in your "
1460
  "email."
1461
  msgstr ""
1462
 
1463
- #: class/wpmdbpro.php:1148
1464
  msgctxt "License does not allow use of addons"
1465
  msgid "Addons Unavailable"
1466
  msgstr ""
1467
 
1468
- #: class/wpmdbpro.php:1148
1469
  #, php-format
1470
  msgid ""
1471
  "Addons are not included with the Personal license. Visit <a href=\"%s\" "
1472
  "target=\"_blank\">My Account</a> to upgrade in just a few clicks."
1473
  msgstr ""
1474
 
1475
- #: class/wpmdbpro.php:1163
1476
  msgctxt "Installed on website but not activated"
1477
  msgid "Installed"
1478
  msgstr ""
1479
 
1480
- #: class/wpmdbpro.php:1165
1481
  msgctxt "Installed and activated on website"
1482
  msgid "Activated"
1483
  msgstr ""
1484
 
1485
- #: class/wpmdbpro.php:1168
1486
  msgctxt "Enable addon so it may be used"
1487
  msgid "Activate"
1488
  msgstr ""
1489
 
1490
- #: class/wpmdbpro.php:1172
1491
  msgctxt "Download and activate addon"
1492
  msgid "Install"
1493
  msgstr ""
1494
 
1495
- #: class/wpmdbpro.php:1178
1496
  #: template/common/debug-info.php:4
1497
  msgctxt "Download to your computer"
1498
  msgid "Download"
1499
  msgstr ""
1500
 
1501
- #: class/wpmdbpro.php:1304
1502
  msgid "Could not upload the SQL to the server. (#135)"
1503
  msgstr ""
1504
 
1505
- #: class/wpmdbpro.php:1310
1506
  msgid "Could not read the SQL file we uploaded to the server. (#136)"
1507
  msgstr ""
1508
 
1509
- #: class/wpmdbpro.php:1329
1510
  msgid ""
1511
  "The connection succeeded but the remote site is configured to reject push "
1512
  "connections. You can change this in the \"settings\" tab on the remote site. "
1513
  "(#139)"
1514
  msgstr ""
1515
 
1516
- #: class/wpmdbpro.php:1561
1517
  #, php-format
1518
  msgid "There is a new version of %s available."
1519
  msgstr ""
1520
 
1521
- #: class/wpmdbpro.php:1563
1522
  #, php-format
1523
  msgid "View version %s details"
1524
  msgstr ""
1525
 
1526
- #: class/wpmdbpro.php:1573
1527
  #, php-format
1528
  msgid ""
1529
  "To update, go to %1$s and enter your license key. If you don't have a "
1530
  "license key, you may <a href=\"%2$s\">purchase one</a>."
1531
  msgstr ""
1532
 
1533
- #: class/wpmdbpro.php:1575
1534
  #, php-format
1535
  msgid ""
1536
  "To finish activating %1$s, please go to %2$s and enter your license key. If "
1537
  "you don't have a license key, you may <a href=\"%3$s\">purchase one</a>."
1538
  msgstr ""
1539
 
1540
- #: class/wpmdbpro.php:1651
 
1541
  msgid "Could not retrieve version details. Please try again."
1542
  msgstr ""
1543
 
1544
- #: template/addons.php:7
1545
  msgid "Fetching addon details, please wait..."
1546
  msgstr ""
1547
 
1548
- #: template/addons.php:12
1549
  msgctxt "License must be activated to use addons"
1550
  msgid "Activate Your License"
1551
  msgstr ""
1552
 
1553
- #: template/addons.php:12
1554
  msgid ""
1555
  "Please switch to the Settings tab and activate your license. If your license "
1556
  "includes the addons below, you will be able to install them from here with "
1557
  "one-click."
1558
  msgstr ""
1559
 
1560
- #: template/addons.php:16
1561
  msgctxt "Addons are available with a developer license and better"
1562
  msgid "Get Addons"
1563
  msgstr ""
1564
 
1565
- #: template/addons.php:16
1566
  #, php-format
1567
  msgid ""
1568
  "The following addons are available with the WP Migrate DB Pro Developer "
@@ -1570,11 +1788,11 @@ msgid ""
1570
  "com</a> to purchase in just a few clicks."
1571
  msgstr ""
1572
 
1573
- #: template/addons.php:22
1574
  msgid "Media Files"
1575
  msgstr ""
1576
 
1577
- #: template/addons.php:23
1578
  #, php-format
1579
  msgid ""
1580
  "Allows you to push and pull your files in the Media Library between two "
@@ -1583,22 +1801,22 @@ msgid ""
1583
  "another. <a href=\"%s\">More Details &rarr;</a>"
1584
  msgstr ""
1585
 
1586
- #: template/addons.php:29
1587
  msgid "CLI"
1588
  msgstr ""
1589
 
1590
- #: template/addons.php:30
1591
  #, php-format
1592
  msgid ""
1593
  "Integrates WP Migrate DB Pro with WP-CLI allowing you to run migrations from "
1594
  "the command line: %s <a href=\"%s\">More Details &rarr;</a>"
1595
  msgstr ""
1596
 
1597
- #: template/addons.php:36
1598
  msgid "Multisite Tools"
1599
  msgstr ""
1600
 
1601
- #: template/addons.php:37
1602
  #, php-format
1603
  msgid ""
1604
  "Export a subsite as an SQL file that can then be imported as a single site "
@@ -1614,51 +1832,53 @@ msgstr ""
1614
  msgid "Saved Profiles"
1615
  msgstr ""
1616
 
1617
- #: template/common/compatibility.php:2
1618
  msgid "Compatibility"
1619
  msgstr ""
1620
 
1621
- #: template/common/compatibility.php:9
1622
- msgid "Plugin Compatibility Mode"
1623
- msgstr ""
1624
-
1625
  #: template/common/compatibility.php:11
 
1626
  msgid ""
1627
- "Some plugins add a lot of overhead to each request, requiring extra memory "
1628
- "and CPU. And some plugins even interfere with migrations and cause them to "
1629
- "fail. We recommend only loading plugins that affect migration requests, for "
1630
- "example a plugin that hooks into WP Migrate DB."
 
 
 
1631
  msgstr ""
1632
 
1633
- #: template/common/compatibility.php:15
 
1634
  msgid ""
1635
- "Avoid plugin conflicts and improve performance by not loading plugins for "
1636
- "migration requests."
 
1637
  msgstr ""
1638
 
1639
- #: template/common/compatibility.php:35
1640
- #: template/pro/backup.php:45
1641
  #: template/pro/exclude-post-types.php:33
1642
- #: template/pro/select-tables.php:43
1643
  msgid "Select All"
1644
  msgstr ""
1645
 
1646
- #: template/common/compatibility.php:37
1647
- #: template/pro/backup.php:47
1648
  #: template/pro/exclude-post-types.php:35
1649
- #: template/pro/select-tables.php:45
1650
  msgid "Deselect All"
1651
  msgstr ""
1652
 
1653
- #: template/common/compatibility.php:39
1654
- #: template/pro/backup.php:49
1655
  #: template/pro/exclude-post-types.php:37
1656
- #: template/pro/select-tables.php:47
1657
  msgid "Invert Selection"
1658
  msgstr ""
1659
 
1660
- #: template/common/compatibility.php:42
1661
- msgid "Save Changes"
1662
  msgstr ""
1663
 
1664
  #: template/common/debug-info.php:2
@@ -1685,6 +1905,17 @@ msgid ""
1685
  "with time outs, try throttling this setting down."
1686
  msgstr ""
1687
 
 
 
 
 
 
 
 
 
 
 
 
1688
  #: template/migrate-progress.php:6
1689
  msgid "Please wait while migration is running…"
1690
  msgstr ""
@@ -1702,63 +1933,63 @@ msgstr ""
1702
  msgid "Pause before replacing migrated tables"
1703
  msgstr ""
1704
 
1705
- #: template/migrate.php:71
1706
  msgid "Export File"
1707
  msgstr ""
1708
 
1709
- #: template/migrate.php:77
1710
  msgid "Save as file to your computer"
1711
  msgstr ""
1712
 
1713
- #: template/migrate.php:84
1714
  msgid "Compress file with gzip"
1715
  msgstr ""
1716
 
1717
- #: template/migrate.php:94
1718
  msgid "Find & Replace"
1719
  msgstr ""
1720
 
1721
- #: template/migrate.php:94
1722
  msgid "Run a find & replace on this site's db"
1723
  msgstr ""
1724
 
1725
- #: template/migrate.php:100
1726
  msgid "Connection Info - Site URL &amp; Secret Key"
1727
  msgstr ""
1728
 
1729
- #: template/migrate.php:111
1730
- msgid "SSL Disabled"
1731
  msgstr ""
1732
 
1733
- #: template/migrate.php:111
1734
  msgid ""
1735
- "We couldn't connect over SSL but regular http (no SSL) appears to be working "
1736
- "so we've switched to that. If you run a push or pull, your data will be "
1737
  "transmitted unencrypted. Most people are fine with this, but just a heads up."
1738
  msgstr ""
1739
 
1740
- #: template/migrate.php:121
1741
  msgid "Cannot Access Uploads Directory"
1742
  msgstr ""
1743
 
1744
- #: template/migrate.php:123
1745
  msgid ""
1746
  "We require write permissions to the standard WordPress uploads directory. "
1747
  "Without this permission exports are unavailable. Please grant 755 "
1748
  "permissions on the following directory:"
1749
  msgstr ""
1750
 
1751
- #: template/migrate.php:134
1752
  msgctxt "Source text to be replaced"
1753
  msgid "Find"
1754
  msgstr ""
1755
 
1756
- #: template/migrate.php:135
1757
  msgctxt "Text to replace in source"
1758
  msgid "Replace"
1759
  msgstr ""
1760
 
1761
- #: template/migrate.php:177
1762
  #, php-format
1763
  msgid ""
1764
  "This find & replace will find the domain name of your remote site and "
@@ -1767,7 +1998,7 @@ msgid ""
1767
  "target=\"_blank\">Find & Replace Documentation</a>"
1768
  msgstr ""
1769
 
1770
- #: template/migrate.php:198
1771
  #, php-format
1772
  msgid ""
1773
  "This find and replace is mostly for 3rd party plugins that store the "
@@ -1776,7 +2007,7 @@ msgid ""
1776
  "migration. <a href=\"%s\" target=\"_blank\">Find & Replace Documentation</a>"
1777
  msgstr ""
1778
 
1779
- #: template/migrate.php:238
1780
  #, php-format
1781
  msgid ""
1782
  "<strong>New URL Missing</strong> &mdash; Please enter the protocol-relative "
@@ -1786,7 +2017,7 @@ msgid ""
1786
  "fields."
1787
  msgstr ""
1788
 
1789
- #: template/migrate.php:240
1790
  #, php-format
1791
  msgid ""
1792
  "<strong>New URL Missing</strong> &mdash; Please enter the protocol-relative "
@@ -1795,7 +2026,7 @@ msgid ""
1795
  "documentation</a> on find and replace fields."
1796
  msgstr ""
1797
 
1798
- #: template/migrate.php:244
1799
  #, php-format
1800
  msgid ""
1801
  "<strong>New File Path Missing</strong> &mdash; Please enter the root file "
@@ -1805,15 +2036,15 @@ msgid ""
1805
  "find and replace fields."
1806
  msgstr ""
1807
 
1808
- #: template/migrate.php:253
1809
  msgid "Advanced Options"
1810
  msgstr ""
1811
 
1812
- #: template/migrate.php:262
1813
  msgid "Replace GUIDs"
1814
  msgstr ""
1815
 
1816
- #: template/migrate.php:268
1817
  #, php-format
1818
  msgid ""
1819
  "Although the <a href=\"%s\" target=\"_blank\">WordPress Codex emphasizes</a> "
@@ -1823,38 +2054,37 @@ msgid ""
1823
  "want to migrate the site live to somedomain.com."
1824
  msgstr ""
1825
 
1826
- #: template/migrate.php:274
1827
  msgid "Exclude spam comments"
1828
  msgstr ""
1829
 
1830
- #: template/migrate.php:280
1831
  msgid ""
1832
  "Do not migrate the 'active_plugins' setting (i.e. which plugins are "
1833
  "activated/deactivated)"
1834
  msgstr ""
1835
 
1836
- #: template/migrate.php:292
1837
  msgid "Compatible with older versions of MySQL (pre-5.5)"
1838
  msgstr ""
1839
 
1840
- #: template/migrate.php:308
1841
  msgid "Save Migration Profile"
1842
  msgstr ""
1843
 
1844
- #: template/migrate.php:308
1845
  msgid "Save the above settings for the next time you do a similiar migration"
1846
  msgstr ""
1847
 
1848
- #: template/migrate.php:330
1849
  msgid "Create new profile"
1850
  msgstr ""
1851
 
1852
- #: template/migrate.php:339
1853
- #: template/migrate.php:349
1854
  msgid "Warning: Different Table Prefixes"
1855
  msgstr ""
1856
 
1857
- #: template/migrate.php:341
1858
  msgid ""
1859
  "Whoa! We've detected that the database table prefix differs between "
1860
  "installations. Clicking the Migrate button below will create new database "
@@ -1862,27 +2092,29 @@ msgid ""
1862
  "span>\"."
1863
  msgstr ""
1864
 
1865
- #: template/migrate.php:343
1866
  #, php-format
1867
  msgid ""
1868
- "However, your local install is configured to use table prefix \"%1$s\" and "
1869
- "will ignore the migrated tables. So, <b>AFTER</b> migration is complete, you "
1870
- "will need to edit your local install's wp-config.php and change the \"%1$s\" "
1871
- "variable to \"<span class=\"remote-prefix\"></span>\"."
1872
  msgstr ""
1873
 
1874
- #: template/migrate.php:345
 
1875
  msgid ""
1876
- "This will allow your local install the use the migrated tables. Once you do "
1877
- "this, you shouldn't have to do it again."
 
1878
  msgstr ""
1879
 
1880
- #: template/migrate.php:351
1881
  #, php-format
1882
  msgid ""
1883
- "Whoa! We've detected that the database table prefix differs between "
1884
- "installations. Clicking the Migrate button below will create new database "
1885
- "tables in the remote database with prefix \"%s\"."
 
1886
  msgstr ""
1887
 
1888
  #: template/migrate.php:353
@@ -1895,13 +2127,34 @@ msgid ""
1895
  "span>\" variable to \"%s\"."
1896
  msgstr ""
1897
 
1898
- #: template/migrate.php:355
 
1899
  msgid ""
1900
- "This will allow your remote install the use the migrated tables. Once you do "
 
 
 
 
 
 
 
 
1901
  "this, you shouldn't have to do it again."
1902
  msgstr ""
1903
 
1904
- #: template/migrate.php:369
 
 
 
 
 
 
 
 
 
 
 
 
1905
  msgctxt "Save current migration settings"
1906
  msgid "Save Profile"
1907
  msgstr ""
@@ -1959,28 +2212,55 @@ msgstr ""
1959
  msgid "Backup the database before running the find &amp; replace"
1960
  msgstr ""
1961
 
1962
- #: template/pro/backup.php:8
 
 
 
 
1963
  msgid "An SQL file will be saved to"
1964
  msgstr ""
1965
 
1966
- #: template/pro/backup.php:16
1967
  msgid "Backup all tables with prefix"
1968
  msgstr ""
1969
 
1970
- #: template/pro/backup.php:22
1971
  msgid "Backup only tables selected for migration"
1972
  msgstr ""
1973
 
1974
- #: template/pro/backup.php:28
 
 
 
 
1975
  msgid "Backup only selected tables below"
1976
  msgstr ""
1977
 
1978
- #: template/pro/backup.php:52
 
 
 
 
 
 
 
 
 
 
 
 
1979
  #, php-format
1980
  msgid ""
1981
- "The backup option has been disabled as your local uploads directory is "
1982
- "currently not writeable. The following directory should have 755 "
1983
- "permissions: <span class=\"upload-directory-location\">%s</span></p>"
 
 
 
 
 
 
 
1984
  msgstr ""
1985
 
1986
  #: template/pro/block-external-warning.php:4
@@ -2034,6 +2314,23 @@ msgid ""
2034
  "replace:"
2035
  msgstr ""
2036
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2037
  #: template/pro/licence-info.php:2
2038
  msgid "Email Support"
2039
  msgstr ""
@@ -2146,13 +2443,33 @@ msgid "Tables"
2146
  msgstr ""
2147
 
2148
  #: template/pro/select-tables.php:13
2149
- msgid "Migrate all tables with prefix"
2150
  msgstr ""
2151
 
2152
  #: template/pro/select-tables.php:19
 
 
 
 
 
 
 
 
 
 
 
 
2153
  msgid "Migrate only selected tables below"
2154
  msgstr ""
2155
 
 
 
 
 
 
 
 
 
2156
  #: template/pro/toggle-remote-requests.php:2
2157
  msgid "Permissions"
2158
  msgstr ""
@@ -2173,6 +2490,21 @@ msgstr ""
2173
  msgid "Process requests to push data to this install, overwriting its data."
2174
  msgstr ""
2175
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2176
  #: template/pro/videos.php:2
2177
  msgctxt "Tutorial videos"
2178
  msgid "Videos"
8
  msgstr ""
9
  "Project-Id-Version: wp-migrate-db\n"
10
  "Report-Msgid-Bugs-To: nom@deliciousbrains.com\n"
11
+ "POT-Creation-Date: 2017-08-11 21:40-0400\n"
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
17
  "Content-Type: text/plain; charset=UTF-8\n"
18
  "Content-Transfer-Encoding: 8bit\n"
19
 
20
+ #: class/wpmdb-base.php:104
21
+ #: class/wpmdb-base.php:938
22
+ #, php-format
23
+ msgid ""
24
+ "<strong>Could not connect to api.deliciousbrains.com</strong> &mdash; You "
25
+ "will not receive update notifications or be able to activate your license "
26
+ "until this is fixed. This issue is often caused by an improperly configured "
27
+ "SSL server (https). We recommend <a href=\"%1$s\" target=\"_blank\">fixing "
28
+ "the SSL configuration on your server</a>, but if you need a quick fix you "
29
+ "can:%2$s"
30
+ msgstr ""
31
+
32
+ #: class/wpmdb-base.php:104
33
+ #: class/wpmdb-base.php:938
34
+ msgid "Temporarily disable SSL for connections to api.deliciousbrains.com"
35
+ msgstr ""
36
+
37
+ #: class/wpmdb-base.php:105
38
+ msgid ""
39
+ "Could not connect to api.deliciousbrains.com - You will not receive update "
40
+ "notifications or be able to activate your license until this is fixed. This "
41
+ "issue is often caused by an improperly configured SSL server (https). We "
42
+ "recommend fixing the SSL configuration on your server, but if you need a "
43
+ "quick fix you can temporarily disable SSL for connections to api."
44
+ "deliciousbrains.com by adding `define( 'DBRAINS_API_BASE', 'http://api."
45
+ "deliciousbrains.com' );` to your wp-config.php file."
46
+ msgstr ""
47
+
48
+ #: class/wpmdb-base.php:108
49
+ #: class/wpmdb-base.php:946
50
+ #, php-format
51
+ msgid ""
52
+ "We've detected that <code>WP_HTTP_BLOCK_EXTERNAL</code> is enabled and the "
53
+ "host <strong>%1$s</strong> has not been added to <code>WP_ACCESSIBLE_HOSTS</"
54
+ "code>. Please disable <code>WP_HTTP_BLOCK_EXTERNAL</code> or add <strong>"
55
+ "%1$s</strong> to <code>WP_ACCESSIBLE_HOSTS</code> to continue. <a href=\"%2$s"
56
+ "\" target=\"_blank\">More information</a>."
57
+ msgstr ""
58
+
59
+ #: class/wpmdb-base.php:109
60
+ #, php-format
61
+ msgid ""
62
+ "We've detected that WP_HTTP_BLOCK_EXTERNAL is enabled and the host %1$s has "
63
+ "not been added to WP_ACCESSIBLE_HOSTS. Please disable WP_HTTP_BLOCK_EXTERNAL "
64
+ "or add %1$s to WP_ACCESSIBLE_HOSTS to continue."
65
+ msgstr ""
66
+
67
+ #: class/wpmdb-base.php:112
68
+ #, php-format
69
+ msgid ""
70
+ "<strong>Your License Was Cancelled</strong> &mdash; Please visit <a href=\"%s"
71
+ "\" target=\"_blank\">My Account</a> to renew or upgrade your license and "
72
+ "enable push and pull. <br /><a href=\"%s\" class=\"check-my-licence-again\" >"
73
+ "%s</a>"
74
+ msgstr ""
75
+
76
+ #: class/wpmdb-base.php:112
77
+ #: class/wpmdb-base.php:120
78
+ #: class/wpmdb-base.php:124
79
+ #: class/wpmdb-base.php:128
80
+ #: class/wpmdbpro.php:1084
81
+ #: class/wpmdbpro.php:1641
82
+ msgid "Check my license again"
83
+ msgstr ""
84
+
85
+ #: class/wpmdb-base.php:113
86
+ #, php-format
87
+ msgid ""
88
+ "Your License Was Cancelled - Please login to your account (%s) to renew or "
89
+ "upgrade your license and enable push and pull."
90
+ msgstr ""
91
+
92
+ #: class/wpmdb-base.php:116
93
+ #: class/wpmdb-base.php:117
94
+ msgid "Your License Has Expired"
95
+ msgstr ""
96
+
97
+ #: class/wpmdb-base.php:120
98
+ #, php-format
99
+ msgid ""
100
+ "Login to <a href=\"%s\">My Account</a> to renew. <a href=\"%s\" class="
101
+ "\"check-my-licence-again\">%s</a>"
102
+ msgstr ""
103
+
104
+ #: class/wpmdb-base.php:121
105
+ #, php-format
106
+ msgid "Login to your account to renew (%s)"
107
+ msgstr ""
108
+
109
+ #: class/wpmdb-base.php:124
110
+ #, php-format
111
+ msgid ""
112
+ "<strong>No Activations Left</strong> &mdash; Please visit <a href=\"%s\" "
113
+ "target=\"_blank\">My Account</a> to upgrade your license or deactivate a "
114
+ "previous activation and enable push and pull. <a href=\"%s\" class=\"check-"
115
+ "my-licence-again\">%s</a>"
116
+ msgstr ""
117
+
118
+ #: class/wpmdb-base.php:125
119
+ #, php-format
120
+ msgid ""
121
+ "No Activations Left - Please visit your account (%s) to upgrade your license "
122
+ "or deactivate a previous activation and enable push and pull."
123
+ msgstr ""
124
+
125
+ #: class/wpmdb-base.php:128
126
+ #, php-format
127
+ msgid ""
128
+ "<strong>Your License Was Not Found</strong> &mdash; Perhaps you made a typo "
129
+ "when defining your WPMDB_LICENCE constant in your wp-config.php? Please "
130
+ "visit <a href=\"%s\" target=\"_blank\">My Account</a> to double check your "
131
+ "license key. <a href=\"%s\" class=\"check-my-licence-again\">%s</a>"
132
+ msgstr ""
133
+
134
+ #: class/wpmdb-base.php:129
135
+ #, php-format
136
+ msgid ""
137
+ "Your License Was Not Found - Perhaps you made a typo when defining your "
138
+ "WPMDB_LICENCE constant in your wp-config.php? Please visit your account (%s) "
139
+ "to double check your license key."
140
+ msgstr ""
141
+
142
+ #: class/wpmdb-base.php:132
143
+ #, php-format
144
+ msgid "<strong>Your License Was Not Found</strong> &mdash; %s"
145
+ msgstr ""
146
+
147
+ #: class/wpmdb-base.php:133
148
+ #, php-format
149
+ msgid "Your License Was Not Found - %s"
150
+ msgstr ""
151
+
152
+ #: class/wpmdb-base.php:136
153
+ #: class/wpmdb-base.php:137
154
+ msgid "Your License Is Inactive"
155
+ msgstr ""
156
+
157
+ #: class/wpmdb-base.php:136
158
+ #: class/wpmdb-base.php:137
159
+ msgid "Your license has been deactivated for this install."
160
+ msgstr ""
161
+
162
+ #: class/wpmdb-base.php:136
163
+ #: class/wpmdb-base.php:137
164
+ msgid "Reactivate your license"
165
+ msgstr ""
166
+
167
+ #: class/wpmdb-base.php:140
168
+ #, php-format
169
+ msgid ""
170
+ "<strong>An Unexpected Error Occurred</strong> &mdash; Please contact us at "
171
+ "<a href=\"%1$s\">%2$s</a> and quote the following: <p>%3$s</p>"
172
+ msgstr ""
173
+
174
+ #: class/wpmdb-base.php:141
175
+ #, php-format
176
+ msgid ""
177
+ "An Unexpected Error Occurred - Please contact us at %2$s and quote the "
178
+ "following: %3$s"
179
+ msgstr ""
180
+
181
+ #: class/wpmdb-base.php:259
182
  msgid ""
183
  "Invalid content verification signature, please verify the connection "
184
  "information on the remote site and try again."
185
  msgstr ""
186
 
187
+ #: class/wpmdb-base.php:259
188
+ #, php-format
189
+ msgctxt "Ex. Remote URL: http://wp.dev"
190
+ msgid " Remote URL: %s "
191
+ msgstr ""
192
+
193
+ #: class/wpmdb-base.php:488
194
  #, php-format
195
  msgid ""
196
  "The connection to the remote server has timed out, no changes have been "
197
  "committed. (#134 - scope: %s)"
198
  msgstr ""
199
 
200
+ #: class/wpmdb-base.php:490
201
  #, php-format
202
  msgid "We could not find: %s. Are you sure this is the correct URL?"
203
  msgstr ""
204
 
205
+ #: class/wpmdb-base.php:496
206
  msgid ""
207
  "It appears that you might be trying to pull from a local environment. This "
208
  "will not work if <u>this</u> website happens to be located on a remote "
210
  "environment."
211
  msgstr ""
212
 
213
+ #: class/wpmdb-base.php:498
214
  msgid ""
215
  "It appears that you might be trying to push to a local environment. This "
216
  "will not work if <u>this</u> website happens to be located on a remote "
218
  "environment."
219
  msgstr ""
220
 
221
+ #: class/wpmdb-base.php:506
222
  #, php-format
223
  msgid ""
224
  "We've detected that <code>WP_HTTP_BLOCK_EXTERNAL</code> is enabled and the "
228
  "\" target=\"_blank\">More information</a>. (#147 - scope: %3$s)"
229
  msgstr ""
230
 
231
+ #: class/wpmdb-base.php:509
232
  #, php-format
233
  msgid ""
234
  "Couldn't connect over HTTPS. You might want to try regular HTTP instead. "
235
  "(#121 - scope: %s)"
236
  msgstr ""
237
 
238
+ #: class/wpmdb-base.php:511
239
  #, php-format
240
  msgid ""
241
+ "<strong>HTTPS Connection Error:</strong> (#121 - scope: %s) This typically "
242
+ "means that the version of OpenSSL that your local site is using to connect "
243
+ "to the remote is incompatible or, more likely, being rejected by the remote "
244
  "server because it's insecure. <a href=\"%s\" target=\"_blank\">See our "
245
  "documentation</a> for possible solutions."
246
  msgstr ""
247
 
248
+ #: class/wpmdb-base.php:513
249
  #, php-format
250
  msgid ""
251
  "The connection failed, an unexpected error occurred, please contact support. "
252
  "(#121 - scope: %s)"
253
  msgstr ""
254
 
255
+ #: class/wpmdb-base.php:526
256
  msgid ""
257
  "The remote site is protected with Basic Authentication. Please enter the "
258
  "username and password above to continue. (401 Unauthorized)"
259
  msgstr ""
260
 
261
+ #: class/wpmdb-base.php:534
262
+ #, php-format
263
+ msgid ""
264
+ "Unable to connect to the remote server, the remote server responded with: "
265
+ "%1$s %2$s (scope: %3$s)"
266
+ msgstr ""
267
+
268
+ #: class/wpmdb-base.php:546
269
  #, php-format
270
  msgid ""
271
  "Unable to connect to the remote server, please check the connection details "
272
  "- %1$s %2$s (#129 - scope: %3$s)"
273
  msgstr ""
274
 
275
+ #: class/wpmdb-base.php:562
276
  #, php-format
277
  msgid ""
278
  "WP Migrate DB Pro does not seem to be installed or active on the remote "
279
  "site. (#131 - scope: %s)"
280
  msgstr ""
281
 
282
+ #: class/wpmdb-base.php:568
283
  #, php-format
284
  msgid ""
285
  "A response was expected from the remote, instead we got nothing. (#146 - "
286
  "scope: %1$s) Please review %2$s for possible solutions."
287
  msgstr ""
288
 
289
+ #: class/wpmdb-base.php:568
290
+ #: class/wpmdb.php:3960
291
  msgid "our documentation"
292
  msgstr ""
293
 
294
+ #: class/wpmdb-base.php:578
295
  msgid ""
296
  "There was a problem with the AJAX request, we were expecting a serialized "
297
  "response, instead we received:<br />"
298
  msgstr ""
299
 
300
+ #: class/wpmdb-base.php:991
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
301
  msgid ""
302
  "<strong>Delicious Brains API is Down — </strong>Unfortunately we're "
303
  "experiencing some problems with our server."
304
  msgstr ""
305
 
306
+ #: class/wpmdb-base.php:995
307
  #, php-format
308
  msgctxt "ex. 2 hours ago"
309
  msgid "%s ago"
310
  msgstr ""
311
 
312
+ #: class/wpmdb-base.php:1000
313
  msgid "Here's the most recent update on its status"
314
  msgstr ""
315
 
316
+ #: class/wpmdb-base.php:1027
317
  #, php-format
318
  msgid ""
319
  "Error retrieving download from deliciousbrain.com. Please try again or "
320
  "download manually from <a href=\"%1$s\">%2$s</a>."
321
  msgstr ""
322
 
323
+ #: class/wpmdb-base.php:1027
324
  msgctxt "Delicious Brains account"
325
  msgid "My Account"
326
  msgstr ""
327
 
328
+ #: class/wpmdb-base.php:1086
329
+ #: class/wpmdb.php:115
330
+ #: class/wpmdb.php:346
331
+ #: class/wpmdbpro.php:1634
332
  msgctxt "Plugin configuration and preferences"
333
  msgid "Settings"
334
  msgstr ""
335
 
336
+ #: class/wpmdb-base.php:1087
337
  #, php-format
338
  msgid ""
339
  "To finish activating WP Migrate DB Pro, please go to %1$s and enter your "
341
  "\">purchase one</a>."
342
  msgstr ""
343
 
344
+ #: class/wpmdb-base.php:1318
345
+ #: class/wpmdb-base.php:1328
346
  msgctxt "A new version of the plugin is available"
347
  msgid "Update Available"
348
  msgstr ""
349
 
350
+ #: class/wpmdb-base.php:1319
351
  #, php-format
352
  msgid "A new version of %1$s is now available. %2$s"
353
  msgstr ""
354
 
355
+ #: class/wpmdb-base.php:1319
356
+ #: class/wpmdb-base.php:1329
357
  msgctxt "Download and install a new version of the plugin"
358
  msgid "Update Now"
359
  msgstr ""
360
 
361
+ #: class/wpmdb-base.php:1329
362
  #, php-format
363
  msgid ""
364
  "%1$s %2$s is now available. You currently have %3$s installed. <a href=\"%4$s"
365
  "\">%5$s</a>"
366
  msgstr ""
367
 
368
+ #: class/wpmdb-base.php:1428
369
  #, php-format
370
  msgid ""
371
  "<strong>Activate Your License</strong> &mdash; Please <a href=\"%s\" class="
373
  "priority support and plugin updates."
374
  msgstr ""
375
 
376
+ #: class/wpmdb-base.php:1445
377
  msgid ""
378
  "<strong>We've temporarily activated your license and will complete the "
379
  "activation once the Delicious Brains API is available again.</strong>"
380
  msgstr ""
381
 
382
+ #: class/wpmdb-base.php:1474
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
383
  msgid "Updates are only available to those with an active license. "
384
  msgstr ""
385
 
386
+ #: class/wpmdb-base.php:1475
387
  msgid "Only active licenses can download and install addons. "
388
  msgstr ""
389
 
390
+ #: class/wpmdb-base.php:1476
391
  msgid "Only active licenses can submit support requests. "
392
  msgstr ""
393
 
394
+ #: class/wpmdb-base.php:1477
395
  msgid ""
396
  "All features will continue to work, but you won't be able to receive updates "
397
  "or email support. "
398
  msgstr ""
399
 
400
+ #: class/wpmdb-base.php:1545
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
401
  #, php-format
402
  msgid "Invalid nonce for: %s"
403
  msgstr ""
404
 
405
+ #: class/wpmdb-base.php:1553
406
  #, php-format
407
  msgid "Access denied for: %s"
408
  msgstr ""
409
 
410
+ #: class/wpmdb-base.php:1730
411
  msgctxt "dismiss notice permanently"
412
  msgid "Dismiss"
413
  msgstr ""
414
 
415
+ #: class/wpmdb-base.php:1743
416
  msgid "Remind Me Later"
417
  msgstr ""
418
 
419
+ #: class/wpmdb-base.php:1845
420
  msgid "Failed to save migration state. Please contact support."
421
  msgstr ""
422
 
423
+ #: class/wpmdb-base.php:1868
424
  msgid "Failed to retrieve migration state. Please contact support."
425
  msgstr ""
426
 
429
  msgid "CLI addon requires PHP %1$s+"
430
  msgstr ""
431
 
432
+ #: class/wpmdb-cli.php:104
433
  msgid "Profile not found or unable to be generated from params."
434
  msgstr ""
435
 
436
+ #: class/wpmdb-cli.php:131
437
+ msgid "Missing path to import file. Use --import-file=/path/to/import.sql.gz"
438
+ msgstr ""
439
+
440
+ #: class/wpmdb-cli.php:155
441
  #, php-format
442
  msgid "The following table(s) do not exist in the %1$s database: %2$s"
443
  msgstr ""
444
 
445
+ #: class/wpmdb-cli.php:215
446
  #, php-format
447
  msgid ""
448
  "We were expecting a JSON response, instead we received: %2$s (function name: "
449
  "%1$s)"
450
  msgstr ""
451
 
452
+ #: class/wpmdb-cli.php:271
453
  msgid "Initiating migration..."
454
  msgstr ""
455
 
456
+ #: class/wpmdb-cli.php:318
457
  msgid "Exporting tables"
458
  msgstr ""
459
 
460
+ #: class/wpmdb-cli.php:321
461
  msgid "Running find & replace"
462
  msgstr ""
463
 
464
+ #: class/wpmdb-cli.php:395
465
  msgid "No tables selected for migration."
466
  msgstr ""
467
 
468
+ #: class/wpmdb-cli.php:493
469
  msgid "Cleaning up..."
470
  msgstr ""
471
 
472
+ #: class/wpmdb-cli.php:577
473
  msgid "Unable to move exported file."
474
  msgstr ""
475
 
476
+ #: class/wpmdb-cli.php:637
477
  msgid "Parameter errors: "
478
  msgstr ""
479
 
480
+ #: class/wpmdb-cli.php:639
481
  #, php-format
482
  msgid "unknown %s parameter"
483
  msgstr ""
484
 
485
+ #: class/wpmdb-cli.php:643
486
  msgid ""
487
  "Please make sure that you have activated the appropriate addons for WP "
488
  "Migrate DB Pro."
489
  msgstr ""
490
 
491
+ #: class/wpmdb-cli.php:651
492
+ msgid "--"
493
+ msgstr ""
494
+
495
+ #: class/wpmdb-cli.php:656
496
  msgid "Missing action parameter"
497
  msgstr ""
498
 
499
+ #: class/wpmdb-cli.php:673
500
  msgid "Missing find and replace values."
501
  msgstr ""
502
 
503
+ #: class/wpmdb-cli.php:675
504
+ msgid "Find value is required."
505
+ msgstr ""
506
+
507
+ #: class/wpmdb-cli.php:682
508
+ msgid "Replace value is required."
509
+ msgstr ""
510
+
511
+ #: class/wpmdb-cli.php:686
512
  #, php-format
513
  msgid "%1$s and %2$s must contain the same number of values"
514
  msgstr ""
515
 
516
+ #: class/wpmdb-cli.php:734
517
  #, php-format
518
  msgid ""
519
  "Cannot write to file \"%1$s\". Please ensure that the specified directory "
534
  msgstr ""
535
 
536
  #: class/wpmdb-command.php:190
537
+ #: class/wpmdb.php:3481
538
  msgid "Find & Replace complete"
539
  msgstr ""
540
 
541
+ #: class/wpmdb-compatibility-plugin-manager.php:197
542
+ #, php-format
543
+ msgid "The following directory could not be created: %s"
544
+ msgstr ""
545
+
546
+ #: class/wpmdb-compatibility-plugin-manager.php:201
547
+ #, php-format
548
+ msgid ""
549
+ "The compatibility plugin could not be activated because your mu-plugin "
550
+ "directory is currently not writable. Please update the permissions of the "
551
+ "mu-plugins folder: %s"
552
+ msgstr ""
553
+
554
+ #: class/wpmdb-compatibility-plugin-manager.php:227
555
+ #, php-format
556
+ msgid ""
557
+ "The compatibility plugin could not be deactivated because your mu-plugin "
558
+ "directory is currently not writable. Please update the permissions of the "
559
+ "mu-plugins folder: %s"
560
+ msgstr ""
561
+
562
+ #: class/wpmdb-replace.php:313
563
  msgid ""
564
  "Failed attempting to do the recursive unserialize replace. Please contact "
565
  "support."
658
  msgid "WPMDB Error: Data cannot be unserialized. %s"
659
  msgstr ""
660
 
661
+ #: class/wpmdb.php:114
662
  msgctxt "Configure a migration or export"
663
  msgid "Migrate"
664
  msgstr ""
665
 
666
+ #: class/wpmdb.php:116
667
  msgctxt "Plugin extensions"
668
  msgid "Addons"
669
  msgstr ""
670
 
671
+ #: class/wpmdb.php:117
672
  msgctxt "Get help or contact support"
673
  msgid "Help"
674
  msgstr ""
675
 
676
+ #: class/wpmdb.php:806
677
  #, php-format
678
+ msgid ""
679
+ "The imported table `%1s` contains characters which are invalid in the target "
680
+ "schema.<br><br>If this is a WP Migrate DB Pro export file, ensure that the "
681
+ "`Compatible with older versions of MySQL` setting under `Advanced Options` "
682
+ "is unchecked and try exporting again.<br><br> See&nbsp;<a href=\"%2s\">our "
683
+ "documentation</a> for more information."
684
  msgstr ""
685
 
686
+ #: class/wpmdb.php:809
687
  #, php-format
688
+ msgid ""
689
+ "The table `%1s` contains characters which are invalid in the target "
690
+ "database. See&nbsp;<a href=\"%2s\">our documentation</a> for more "
691
+ "information."
692
  msgstr ""
693
 
694
+ #: class/wpmdb.php:1132
695
  #, php-format
696
+ msgid ""
697
+ "<p><strong>Export Failed</strong> — We can't save your export to the "
698
+ "following folder:<br><strong>%s</strong></p><p>Please adjust the permissions "
699
+ "on this folder. <a href=\"%s\" target=\"_blank\">See our documentation for "
700
+ "more information »</a></p>"
701
  msgstr ""
702
 
703
+ #: class/wpmdb.php:1173
704
+ #: class/wpmdbpro.php:381
705
+ #: class/wpmdbpro.php:1478
706
  msgid ""
707
  "Failed attempting to unserialize the response from the remote server. Please "
708
  "contact support."
709
  msgstr ""
710
 
711
+ #: class/wpmdb.php:2125
712
+ #, php-format
713
  msgid ""
714
+ "Failed to retrieve table structure for table '%s', please ensure your "
715
+ "database is online. (#125)"
716
  msgstr ""
717
 
718
+ #: class/wpmdb.php:2224
 
 
 
 
719
  #, php-format
720
  msgid "Error creating temporary table. Table \"%s\" does not exist."
721
  msgstr ""
722
 
723
+ #: class/wpmdb.php:2330
724
  #, php-format
725
  msgid "Delete any existing table %s"
726
  msgstr ""
727
 
728
+ #: class/wpmdb.php:2341
729
  #, php-format
730
  msgid "Table structure of table %s"
731
  msgstr ""
732
 
733
+ #: class/wpmdb.php:2349
734
  msgid ""
735
  "Failed to generate the create table query, please ensure your database is "
736
  "online. (#126)"
737
  msgstr ""
738
 
739
+ #: class/wpmdb.php:2405
740
  #, php-format
741
  msgid "Data contents of table %s"
742
  msgstr ""
743
 
744
+ #: class/wpmdb.php:2423
745
  #, php-format
746
  msgid "End of data contents of table %s"
747
  msgstr ""
748
 
749
+ #: class/wpmdb.php:2937
750
  msgid "WordPress MySQL database migration"
751
  msgstr ""
752
 
753
+ #: class/wpmdb.php:2939
754
  #, php-format
755
  msgid "Generated: %s"
756
  msgstr ""
757
 
758
+ #: class/wpmdb.php:2940
759
  #, php-format
760
  msgid "Hostname: %s"
761
  msgstr ""
762
 
763
+ #: class/wpmdb.php:2941
764
  #, php-format
765
  msgid "Database: %s"
766
  msgstr ""
767
 
768
+ #: class/wpmdb.php:3039
769
  msgid "Failed to write the gzipped SQL data to the file. (#127)"
770
  msgstr ""
771
 
772
+ #: class/wpmdb.php:3046
773
  msgid "Failed to write the SQL data to the file. (#128)"
774
  msgstr ""
775
 
776
+ #: class/wpmdb.php:3195
777
+ #: class/wpmdb.php:3220
778
+ #: class/wpmdbpro.php:1438
779
  msgid "Migrate DB Pro"
780
  msgstr ""
781
 
782
+ #: class/wpmdb.php:3195
783
+ #: class/wpmdb.php:3220
784
+ #: class/wpmdb.php:3865
785
  msgid "Migrate DB"
786
  msgstr ""
787
 
788
+ #: class/wpmdb.php:3400
789
  msgid ""
790
  "A problem occurred when trying to change the maximum request size, please "
791
  "try again."
792
  msgstr ""
793
 
794
+ #: class/wpmdb.php:3401
795
+ #: class/wpmdbpro.php:1084
796
  msgid "A problem occurred when trying to check the license, please try again."
797
  msgstr ""
798
 
799
+ #: class/wpmdb.php:3402
800
  msgid "Establishing connection to remote server, please wait"
801
  msgstr ""
802
 
803
+ #: class/wpmdb.php:3403
804
  msgid ""
805
  "A problem occurred when attempting to connect to the local server, please "
806
  "check the details and try again."
807
  msgstr ""
808
 
809
+ #: class/wpmdb.php:3404
810
  msgid "Please enter your license key."
811
  msgstr ""
812
 
813
+ #: class/wpmdb.php:3405
814
  msgid ""
815
  "A problem occurred when trying to register the license, please try again."
816
  msgstr ""
817
 
818
+ #: class/wpmdb.php:3406
819
  msgid ""
820
  "Your license has been activated. You will now receive automatic updates and "
821
  "access to email support."
822
  msgstr ""
823
 
824
+ #: class/wpmdb.php:3407
825
  msgid "Fetching license details, please wait…"
826
  msgstr ""
827
 
828
+ #: class/wpmdb.php:3408
829
  msgid ""
830
  "An error occurred when trying to clear the debug log. Please contact "
831
  "support. (#132)"
832
  msgstr ""
833
 
834
+ #: class/wpmdb.php:3409
835
  msgid ""
836
  "An error occurred when trying to update the debug log. Please contact "
837
  "support. (#133)"
838
  msgstr ""
839
 
840
+ #: class/wpmdb.php:3410
841
  msgid "Please select at least one table to migrate."
842
  msgstr ""
843
 
844
+ #: class/wpmdb.php:3411
845
  msgid "Please select at least one table for backup."
846
  msgstr ""
847
 
848
+ #: class/wpmdb.php:3412
849
+ msgid "Please select at least one table for the find & replace"
850
+ msgstr ""
851
+
852
+ #: class/wpmdb.php:3413
853
  msgid "Please enter a name for your migration profile."
854
  msgstr ""
855
 
856
+ #: class/wpmdb.php:3414
857
  msgid ""
858
  "An error occurred when attempting to save the migration profile. Please see "
859
  "the Help tab for details on how to request support. (#118)"
860
  msgstr ""
861
 
862
+ #: class/wpmdb.php:3415
863
  msgctxt "Data has been successfully exported"
864
  msgid "Export complete"
865
  msgstr ""
866
 
867
+ #: class/wpmdb.php:3416
868
  msgid "Exporting, please wait…"
869
  msgstr ""
870
 
871
+ #: class/wpmdb.php:3417
872
  msgid "please wait…"
873
  msgstr ""
874
 
875
+ #: class/wpmdb.php:3418
876
  msgctxt "Finished successfully"
877
  msgid "complete"
878
  msgstr ""
879
 
880
+ #: class/wpmdb.php:3419
881
  msgctxt "Copy of data between servers did not complete"
882
  msgid "Migration failed"
883
  msgstr ""
884
 
885
+ #: class/wpmdb.php:3420
886
  msgctxt "Saving a copy of the data before import"
887
  msgid "Backing up"
888
  msgstr ""
889
 
890
+ #: class/wpmdb.php:3421
891
  msgctxt "In line to be processed"
892
  msgid "Queued"
893
  msgstr ""
894
 
895
+ #: class/wpmdb.php:3422
896
  msgctxt "Copying data between servers"
897
  msgid "Migrating"
898
  msgstr ""
899
 
900
+ #: class/wpmdb.php:3423
901
  msgctxt "Process is active"
902
  msgid "Running"
903
  msgstr ""
904
 
905
+ #: class/wpmdb.php:3424
906
  msgctxt "Current request status"
907
  msgid "Status"
908
  msgstr ""
909
 
910
+ #: class/wpmdb.php:3425
911
  msgctxt "The message the server responded with"
912
  msgid "Response"
913
  msgstr ""
914
 
915
+ #: class/wpmdb.php:3426
916
  msgid ""
917
  "A problem occurred when attempting to process the following table (#113)"
918
  msgstr ""
919
 
920
+ #: class/wpmdb.php:3427
921
  msgid ""
922
  "A problem occurred when processing the following table. We were expecting a "
923
  "response in JSON format but instead received an empty response."
924
  msgstr ""
925
 
926
+ #: class/wpmdb.php:3428
927
  msgid "Migration completed with some errors"
928
  msgstr ""
929
 
930
+ #: class/wpmdb.php:3429
931
  msgid "Migration complete, your backup is located at:"
932
  msgstr ""
933
 
934
+ #: class/wpmdb.php:3430
935
  msgid "A problem occurred when finalizing the backup. (#140)"
936
  msgstr ""
937
 
938
+ #: class/wpmdb.php:3431
939
  msgctxt "The settings were saved successfully"
940
  msgid "Saved"
941
  msgstr ""
942
 
943
+ #: class/wpmdb.php:3432
944
  msgid ""
945
  "Any sites setup to use the current secret key will no longer be able to "
946
  "connect. You will need to update those sites with the newly generated secret "
947
  "key. Do you wish to continue?"
948
  msgstr ""
949
 
950
+ #: class/wpmdb.php:3433
951
  msgid ""
952
  "An error occurred when trying to generate the secret key. Please see the "
953
  "Help tab for details on how to request support. (#105)"
954
  msgstr ""
955
 
956
+ #: class/wpmdb.php:3434
957
  msgid ""
958
  "You are about to remove the migration profile \"{{profile}}\". This cannot "
959
  "be undone. Do you wish to continue?"
960
  msgstr ""
961
 
962
+ #: class/wpmdb.php:3435
963
  msgid ""
964
  "An error occurred when trying to delete the profile. Please see the Help tab "
965
  "for details on how to request support. (#106)"
966
  msgstr ""
967
 
968
+ #: class/wpmdb.php:3436
969
  msgid ""
970
  "The selected migration profile could not be deleted because it was not "
971
  "found.\n"
973
  "migration profiles."
974
  msgstr ""
975
 
976
+ #: class/wpmdb.php:3437
977
  msgid ""
978
  "If you change the connection details, you will lose any replaces and table "
979
  "selections you have made below. Do you wish to continue?"
980
  msgstr ""
981
 
982
+ #: class/wpmdb.php:3438
983
+ #: template/migrate.php:119
984
  msgid "Please enter the connection information above to continue."
985
  msgstr ""
986
 
987
+ #: class/wpmdb.php:3439
988
  msgid ""
989
  "An error occurred when trying to save the settings. Please try again. If the "
990
  "problem persists, please see the Help tab for details on how to request "
991
  "support. (#108)"
992
  msgstr ""
993
 
994
+ #: class/wpmdb.php:3440
995
  msgid ""
996
  "The connection information appears to be missing, please enter it to "
997
  "continue."
998
  msgstr ""
999
 
1000
+ #: class/wpmdb.php:3441
1001
  msgid ""
1002
  "The connection information appears to be incorrect, it should consist of two "
1003
  "lines. The first being the remote server's URL and the second being the "
1004
  "secret key."
1005
  msgstr ""
1006
 
1007
+ #: class/wpmdb.php:3442
1008
  msgid ""
1009
  "The URL on the first line appears to be invalid, please check it and try "
1010
  "again."
1011
  msgstr ""
1012
 
1013
+ #: class/wpmdb.php:3443
1014
  msgid ""
1015
  "The secret key on the second line appears to be invalid. It should be a 40 "
1016
  "character string that consists of letters, numbers and special characters "
1017
  "only."
1018
  msgstr ""
1019
 
1020
+ #: class/wpmdb.php:3444
1021
  msgid ""
1022
  "It appears you've entered the URL for this website, you need to provide the "
1023
  "URL of the remote website instead."
1024
  msgstr ""
1025
 
1026
+ #: class/wpmdb.php:3445
1027
  msgid ""
1028
  "Looks like your remote secret key is the same as the secret key for this "
1029
  "site. To fix this, go to the <a href=\"#settings\">Settings tab</a> and "
1030
  "click \"Reset Secret Key\""
1031
  msgstr ""
1032
 
1033
+ #: class/wpmdb.php:3446
1034
  msgid "Time Elapsed:"
1035
  msgstr ""
1036
 
1037
+ #: class/wpmdb.php:3447
1038
  #: template/migrate-progress.php:17
1039
  msgctxt "Temporarily stop migrating"
1040
  msgid "Pause"
1041
  msgstr ""
1042
 
1043
+ #: class/wpmdb.php:3448
1044
  msgctxt "The migration has been temporarily stopped"
1045
  msgid "Migration Paused"
1046
  msgstr ""
1047
 
1048
+ #: class/wpmdb.php:3449
1049
  msgctxt "The find & replace has been temporarily stopped"
1050
  msgid "Find &amp; Replace Paused"
1051
  msgstr ""
1052
 
1053
+ #: class/wpmdb.php:3450
1054
  msgctxt "Restart migrating after it was paused"
1055
  msgid "Resume"
1056
  msgstr ""
1057
 
1058
+ #: class/wpmdb.php:3451
1059
  msgid "Completing current request"
1060
  msgstr ""
1061
 
1062
+ #: class/wpmdb.php:3452
1063
  msgctxt "The migration is being cancelled"
1064
  msgid "Cancelling migration"
1065
  msgstr ""
1066
 
1067
+ #: class/wpmdb.php:3453
1068
  msgctxt "The find & replace is being cancelled"
1069
  msgid "Cancelling find &amp; replace"
1070
  msgstr ""
1071
 
1072
+ #: class/wpmdb.php:3454
1073
  msgctxt "The migration has been temporarily stopped"
1074
  msgid "Paused"
1075
  msgstr ""
1076
 
1077
+ #: class/wpmdb.php:3455
1078
  msgid "Pause before finalizing the updates"
1079
  msgstr ""
1080
 
1081
+ #: class/wpmdb.php:3456
1082
  msgid ""
1083
  "Automatically paused before migrated tables are replaced. Click \"Resume\" "
1084
  "or \"Cancel\" when ready."
1085
  msgstr ""
1086
 
1087
+ #: class/wpmdb.php:3457
1088
  msgid ""
1089
  "Automatically paused before the find &amp; replace was finalized. Click "
1090
  "\"Resume\" or \"Cancel\" when ready."
1091
  msgstr ""
1092
 
1093
+ #: class/wpmdb.php:3458
1094
  msgid "Removing the local MySQL export file"
1095
  msgstr ""
1096
 
1097
+ #: class/wpmdb.php:3459
1098
  msgid "Removing the local backup MySQL export file"
1099
  msgstr ""
1100
 
1101
+ #: class/wpmdb.php:3460
1102
  msgid "Removing the local temporary tables"
1103
  msgstr ""
1104
 
1105
+ #: class/wpmdb.php:3461
1106
  msgid "Removing the remote backup MySQL export file"
1107
  msgstr ""
1108
 
1109
+ #: class/wpmdb.php:3462
1110
  msgid "Removing the remote temporary tables"
1111
  msgstr ""
1112
 
1113
+ #: class/wpmdb.php:3463
1114
  msgid "Migration cancellation failed"
1115
  msgstr ""
1116
 
1117
+ #: class/wpmdb.php:3464
1118
  msgid ""
1119
  "A problem occurred while cancelling the migration, you may have to manually "
1120
  "delete some temporary files / tables."
1121
  msgstr ""
1122
 
1123
+ #: class/wpmdb.php:3465
1124
  msgctxt "The migration has been cancelled"
1125
  msgid "Migration cancelled"
1126
  msgstr ""
1127
 
1128
+ #: class/wpmdb.php:3466
1129
  msgid ""
1130
  "The migration has been stopped and all temporary files and data have been "
1131
  "cleaned up."
1132
  msgstr ""
1133
 
1134
+ #: class/wpmdb.php:3467
1135
  msgctxt "The migration has been cancelled"
1136
  msgid "Find &amp; replace cancelled"
1137
  msgstr ""
1138
 
1139
+ #: class/wpmdb.php:3468
1140
  msgid ""
1141
  "The find &amp; replace has been cancelled and all temporary data has been "
1142
  "cleaned up."
1143
  msgstr ""
1144
 
1145
+ #: class/wpmdb.php:3469
1146
  msgctxt "The migration completed successfully"
1147
  msgid "Migration complete"
1148
  msgstr ""
1149
 
1150
+ #: class/wpmdb.php:3470
1151
  msgctxt "The migration is in the last stages"
1152
  msgid "Finalizing migration"
1153
  msgstr ""
1154
 
1155
+ #: class/wpmdb.php:3471
1156
  msgctxt "The caches and rewrite rules for the target are being flushed"
1157
  msgid "Flushing caches and rewrite rules"
1158
  msgstr ""
1159
 
1160
+ #: class/wpmdb.php:3472
1161
  msgid "A problem occurred when trying to add plugins to backlist."
1162
  msgstr ""
1163
 
1164
+ #: class/wpmdb.php:3473
1165
  msgid ""
1166
  "If confirmed we will install an additional WordPress 'Must Use' plugin. This "
1167
  "plugin will allow us to control which plugins are loaded during WP Migrate "
1168
  "DB Pro specific operations. Do you wish to continue?"
1169
  msgstr ""
1170
 
1171
+ #: class/wpmdb.php:3474
1172
  msgid ""
1173
  "A problem occurred when trying to change the plugin compatibility setting."
1174
  msgstr ""
1175
 
1176
+ #: class/wpmdb.php:3475
1177
  msgctxt "Confirmation required"
1178
  msgid "Sure?"
1179
  msgstr ""
1180
 
1181
+ #: class/wpmdb.php:3476
1182
  #, php-format
1183
  msgid "Pulling from %s…"
1184
  msgstr ""
1185
 
1186
+ #: class/wpmdb.php:3477
1187
  #, php-format
1188
  msgid "Pull from %s complete"
1189
  msgstr ""
1190
 
1191
+ #: class/wpmdb.php:3478
1192
  #, php-format
1193
  msgid "Pushing to %s…"
1194
  msgstr ""
1195
 
1196
+ #: class/wpmdb.php:3479
1197
  #, php-format
1198
  msgid "Push to %s complete"
1199
  msgstr ""
1200
 
1201
+ #: class/wpmdb.php:3480
1202
  msgid "Running Find & Replace…"
1203
  msgstr ""
1204
 
1205
+ #: class/wpmdb.php:3482
1206
+ msgid "Importing…"
1207
+ msgstr ""
1208
+
1209
+ #: class/wpmdb.php:3483
1210
+ msgid "Import complete"
1211
+ msgstr ""
1212
+
1213
+ #: class/wpmdb.php:3484
1214
  msgid "Copying license to the remote site, please wait"
1215
  msgstr ""
1216
 
1217
+ #: class/wpmdb.php:3485
1218
  msgid "Attempting to activate your license, please wait…"
1219
  msgstr ""
1220
 
1221
+ #: class/wpmdb.php:3486
1222
  msgid "License successfully activated, please wait…"
1223
  msgstr ""
1224
 
1225
+ #: class/wpmdb.php:3487
1226
  msgid ""
1227
  "An error occurred when trying to reactivate your license. Please provide the "
1228
  "following information when requesting support:"
1229
  msgstr ""
1230
 
1231
+ #: class/wpmdb.php:3488
1232
  msgid ""
1233
  "<strong>We've temporarily activated your licence and will complete the "
1234
  "activation once the Delicious Brains API is available again.</strong><br /"
1235
  ">Please refresh this page to continue."
1236
  msgstr ""
1237
 
1238
+ #: class/wpmdb.php:3489
1239
  msgid "JSON Decoding Failure"
1240
  msgstr ""
1241
 
1242
+ #: class/wpmdb.php:3490
1243
  msgid ""
1244
  "Our AJAX request was expecting JSON but we received something else. Often "
1245
  "this is caused by your theme and/or plugins spitting out PHP errors. If you "
1248
  "disable errors from showing up."
1249
  msgstr ""
1250
 
1251
+ #: class/wpmdb.php:3491
1252
  msgid "View error messages"
1253
  msgstr ""
1254
 
1255
+ #: class/wpmdb.php:3492
1256
  #, php-format
1257
  msgid "Waiting %s seconds before executing next step"
1258
  msgstr ""
1259
 
1260
+ #: class/wpmdb.php:3493
1261
  msgid ""
1262
  "A problem occurred when trying to change the delay between requests, please "
1263
  "try again."
1264
  msgstr ""
1265
 
1266
+ #: class/wpmdb.php:3494
1267
  msgid "A problem occurred when flushing caches and rewrite rules. (#145)"
1268
  msgstr ""
1269
 
1270
+ #: class/wpmdb.php:3495
1271
  msgctxt "Transfer this database to the remote site"
1272
  msgid "Push"
1273
  msgstr ""
1274
 
1275
+ #: class/wpmdb.php:3496
1276
  msgctxt "Transfer this database to the remote site and save migration profile"
1277
  msgid "Push &amp; Save"
1278
  msgstr ""
1279
 
1280
+ #: class/wpmdb.php:3497
1281
  msgctxt "Transfer the remote database to this site"
1282
  msgid "Pull"
1283
  msgstr ""
1284
 
1285
+ #: class/wpmdb.php:3498
1286
  msgctxt "Transfer the remote database to this site and save migration profile"
1287
  msgid "Pull &amp; Save"
1288
  msgstr ""
1289
 
1290
+ #: class/wpmdb.php:3499
1291
+ #: template/migrate.php:371
1292
  msgctxt "Download a copy of the database"
1293
  msgid "Export"
1294
  msgstr ""
1295
 
1296
+ #: class/wpmdb.php:3500
1297
  msgctxt "Download a copy of the database and save migration profile"
1298
  msgid "Export &amp; Save"
1299
  msgstr ""
1300
 
1301
+ #: class/wpmdb.php:3501
1302
+ msgctxt "Import an SQL file into the database"
1303
+ msgid "Import"
1304
+ msgstr ""
1305
+
1306
+ #: class/wpmdb.php:3502
1307
+ msgctxt "Import an SQL file and save migration profile"
1308
+ msgid "Import &amp; Save"
1309
+ msgstr ""
1310
+
1311
+ #: class/wpmdb.php:3503
1312
  msgctxt "Run a find and replace on the database"
1313
  msgid "Find &amp; Replace"
1314
  msgstr ""
1315
 
1316
+ #: class/wpmdb.php:3504
1317
  msgctxt "Run a find and replace and save migration profile"
1318
  msgid "Find &amp; Replace &amp; Save"
1319
  msgstr ""
1320
 
1321
+ #: class/wpmdb.php:3505
1322
  msgctxt "database tables"
1323
  msgid "Tables"
1324
  msgstr ""
1325
 
1326
+ #: class/wpmdb.php:3506
1327
  msgid "Files"
1328
  msgstr ""
1329
 
1330
+ #: class/wpmdb.php:3507
1331
  msgctxt "Transferred"
1332
  msgid "Migrated"
1333
  msgstr ""
1334
 
1335
+ #: class/wpmdb.php:3508
1336
  msgid "Backed Up"
1337
  msgstr ""
1338
 
1339
+ #: class/wpmdb.php:3509
1340
  msgid "Searched"
1341
  msgstr ""
1342
 
1343
+ #: class/wpmdb.php:3510
1344
  msgctxt "Obscure from view"
1345
  msgid "Hide"
1346
  msgstr ""
1347
 
1348
+ #: class/wpmdb.php:3511
1349
  msgctxt "Reveal"
1350
  msgid "Show"
1351
  msgstr ""
1352
 
1353
+ #: class/wpmdb.php:3512
1354
  msgid "Welcome to WP Migrate DB Pro! &#127881;"
1355
  msgstr ""
1356
 
1357
+ #: class/wpmdb.php:3513
1358
  #, php-format
1359
  msgid ""
1360
  "Hey, this is the first time activating your license, nice! Your migrations "
1364
  "submit a support request."
1365
  msgstr ""
1366
 
1367
+ #: class/wpmdb.php:3514
1368
  #, php-format
1369
  msgid "%1$s Stage %2$s of %3$s"
1370
  msgstr ""
1371
 
1372
+ #: class/wpmdb.php:3515
1373
  msgid "Paused"
1374
  msgstr ""
1375
 
1376
+ #: class/wpmdb.php:3516
1377
  msgid "Cancelling"
1378
  msgstr ""
1379
 
1380
+ #: class/wpmdb.php:3517
1381
  msgid "Cancelled"
1382
  msgstr ""
1383
 
1384
+ #: class/wpmdb.php:3518
1385
  msgid "Finalizing"
1386
  msgstr ""
1387
 
1388
+ #: class/wpmdb.php:3519
1389
  msgid "Complete"
1390
  msgstr ""
1391
 
1392
+ #: class/wpmdb.php:3520
1393
  msgid "Failed"
1394
  msgstr ""
1395
 
1396
+ #: class/wpmdb.php:3521
1397
  #, php-format
1398
  msgid "%1$s items are not shown to maintain browser performance"
1399
  msgstr ""
1400
 
1401
+ #: class/wpmdb.php:3522
1402
  msgctxt "Error log emptied"
1403
  msgid "Cleared"
1404
  msgstr ""
1405
 
1406
+ #: class/wpmdb.php:3523
1407
+ msgid "Parsing SQL file, please wait"
1408
+ msgstr ""
1409
+
1410
+ #: class/wpmdb.php:3524
1411
+ msgid ""
1412
+ "The selected file does not have a recognized file type. Please upload a "
1413
+ "valid SQL file to continue."
1414
+ msgstr ""
1415
+
1416
+ #: class/wpmdb.php:3525
1417
+ msgid "Please select an SQL export file above to continue."
1418
+ msgstr ""
1419
+
1420
+ #: class/wpmdb.php:3526
1421
+ msgid "Profile Loaded"
1422
+ msgstr ""
1423
+
1424
+ #: class/wpmdb.php:3526
1425
+ msgid ""
1426
+ "The selected profile has been loaded, please select an SQL export file above "
1427
+ "to continue."
1428
+ msgstr ""
1429
+
1430
+ #: class/wpmdb.php:3527
1431
+ msgid "Uploading file to the server"
1432
+ msgstr ""
1433
+
1434
+ #: class/wpmdb.php:3528
1435
+ #, php-format
1436
+ msgid "Importing data from %s"
1437
+ msgstr ""
1438
+
1439
+ #: class/wpmdb.php:3529
1440
+ msgid "Upload"
1441
+ msgstr ""
1442
+
1443
+ #: class/wpmdb.php:3568
1444
+ #, php-format
1445
+ msgid "<h3>Output prevented download. </h3> %s"
1446
+ msgstr ""
1447
+
1448
+ #: class/wpmdb.php:3571
1449
  msgid "Could not find the file to download:"
1450
  msgstr ""
1451
 
1452
+ #: class/wpmdb.php:3800
1453
  msgid "MySQL export file not found."
1454
  msgstr ""
1455
 
1456
+ #: class/wpmdb.php:3805
1457
  msgid "Could not delete the MySQL export file."
1458
  msgstr ""
1459
 
1460
+ #: class/wpmdb.php:3871
1461
  msgid ""
1462
  "WP Migrate DB and WP Migrate DB Pro cannot both be active. We've "
1463
  "automatically deactivated WP Migrate DB."
1464
  msgstr ""
1465
 
1466
+ #: class/wpmdb.php:3873
1467
  msgid ""
1468
  "WP Migrate DB and WP Migrate DB Pro cannot both be active. We've "
1469
  "automatically deactivated WP Migrate DB Pro."
1470
  msgstr ""
1471
 
1472
+ #: class/wpmdb.php:3960
1473
  #, php-format
1474
  msgid ""
1475
  "The source site supports utf8mb4 data but the target does not, aborting "
1477
  "information. (#148)"
1478
  msgstr ""
1479
 
1480
+ #: class/wpmdb.php:4011
1481
  msgid "Warning: Mixed Case Table Names"
1482
  msgstr ""
1483
 
1484
+ #: class/wpmdb.php:4014
1485
  msgid ""
1486
  "Whoa! We've detected that your <b>local</b> site has the MySQL setting "
1487
  "<code>lower_case_table_names</code> set to <code>1</code>."
1488
  msgstr ""
1489
 
1490
+ #: class/wpmdb.php:4016
1491
  msgid ""
1492
  "Whoa! We've detected that your <b>remote</b> site has the MySQL setting "
1493
  "<code>lower_case_table_names</code> set to <code>1</code>."
1494
  msgstr ""
1495
 
1496
+ #: class/wpmdb.php:4019
1497
  msgid ""
1498
  "As a result, uppercase characters in table names will be converted to "
1499
  "lowercase during the migration."
1500
  msgstr ""
1501
 
1502
+ #: class/wpmdb.php:4021
1503
  #, php-format
1504
  msgid ""
1505
  "You can read more about this in <a href=\"%s\">our documentation</a>, "
1514
  "Now</a></strong>"
1515
  msgstr ""
1516
 
1517
+ #: class/wpmdbpro-import.php:61
1518
+ msgid ""
1519
+ "The server is not compatible with gzip, please decompress the import file "
1520
+ "and try again."
1521
+ msgstr ""
1522
+
1523
+ #: class/wpmdbpro-import.php:72
1524
+ msgid "Unable to read data from the import file"
1525
+ msgstr ""
1526
+
1527
+ #: class/wpmdbpro-import.php:141
1528
+ msgid "An error occurred while uploading the file."
1529
+ msgstr ""
1530
+
1531
+ #: class/wpmdbpro-import.php:170
1532
+ msgid "An error occurred while decompressing the import file."
1533
+ msgstr ""
1534
+
1535
+ #: class/wpmdbpro-import.php:266
1536
+ msgid "The import file could not be read."
1537
+ msgstr ""
1538
+
1539
+ #: class/wpmdbpro-import.php:359
1540
+ #, php-format
1541
+ msgid "Failed to import the SQL query: %s"
1542
+ msgstr ""
1543
+
1544
+ #: class/wpmdbpro.php:262
1545
  msgid "UI Walkthrough"
1546
  msgstr ""
1547
 
1548
+ #: class/wpmdbpro.php:263
1549
  msgid ""
1550
  "A brief walkthrough of the WP Migrate DB plugin showing all of the different "
1551
  "options and explaining them."
1552
  msgstr ""
1553
 
1554
+ #: class/wpmdbpro.php:266
1555
  msgid "Pulling Live Data Into Your Local Development&nbsp;Environment"
1556
  msgstr ""
1557
 
1558
+ #: class/wpmdbpro.php:267
1559
  msgid ""
1560
  "This screencast demonstrates how you can pull data from a remote, live "
1561
  "WordPress install and update the data in your local development environment."
1562
  msgstr ""
1563
 
1564
+ #: class/wpmdbpro.php:270
1565
  msgid "Pushing Local Development Data to a Staging&nbsp;Environment"
1566
  msgstr ""
1567
 
1568
+ #: class/wpmdbpro.php:271
1569
  msgid ""
1570
  "This screencast demonstrates how you can push a local WordPress database "
1571
  "you've been using for development to a staging environment."
1572
  msgstr ""
1573
 
1574
+ #: class/wpmdbpro.php:274
1575
  msgid "WP Migrate DB Pro Media Files Addon 1.3 and CLI Addon 1.1"
1576
  msgstr ""
1577
 
1578
+ #: class/wpmdbpro.php:275
1579
  msgid ""
1580
  "A demonstration of what's new in WP Migrate DB Pro Media Files Addon 1.3 and "
1581
  "CLI Addon 1.1."
1582
  msgstr ""
1583
 
1584
+ #: class/wpmdbpro.php:347
1585
  msgid ""
1586
  "Please activate your license before attempting a pull or push migration."
1587
  msgstr ""
1588
 
1589
+ #: class/wpmdbpro.php:647
1590
  msgid ""
1591
  "The connection succeeded but the remote site is configured to reject pull "
1592
  "connections. You can change this in the \"settings\" tab on the remote site. "
1593
  "(#141)"
1594
  msgstr ""
1595
 
1596
+ #: class/wpmdbpro.php:709
1597
  msgid ""
1598
  "The connection succeeded but the remote site is configured to reject pull "
1599
  "connections. You can change this in the \"settings\" tab on the remote site. "
1600
  "(#110)"
1601
  msgstr ""
1602
 
1603
+ #: class/wpmdbpro.php:711
1604
  msgid ""
1605
  "The connection succeeded but the remote site is configured to reject push "
1606
  "connections. You can change this in the \"settings\" tab on the remote site. "
1607
  "(#110)"
1608
  msgstr ""
1609
 
1610
+ #: class/wpmdbpro.php:792
1611
+ msgctxt "Asking to try and connect to remote server after verification error"
1612
+ msgid "Try again?"
1613
+ msgstr ""
1614
+
1615
+ #: class/wpmdbpro.php:804
1616
  #, php-format
1617
  msgid ""
1618
  "<b>Version Mismatch</b> &mdash; We've detected you have version %1$s of WP "
1620
  "the Plugins page on both installs and check for updates."
1621
  msgstr ""
1622
 
1623
+ #: class/wpmdbpro.php:806
1624
  #, php-format
1625
  msgid ""
1626
  "<b>Version Mismatch</b> &mdash; We've detected you have version %1$s of WP "
1628
  "\"%4$s\">Plugins page</a> on both installs and check for updates."
1629
  msgstr ""
1630
 
1631
+ #: class/wpmdbpro.php:823
 
 
 
 
 
1632
  #, php-format
1633
  msgid ""
1634
  "Activate remote license &mdash; Looks like you don't have a WP Migrate DB "
1635
  "Pro license active at %s."
1636
  msgstr ""
1637
 
1638
+ #: class/wpmdbpro.php:825
1639
  #, php-format
1640
  msgid "Copy %1$s license key to %2$s and activate it"
1641
  msgstr ""
1642
 
1643
+ #: class/wpmdbpro.php:836
1644
  msgid ""
1645
  "The connection succeeded but the remote site is configured to reject pull "
1646
  "connections. You can change this in the \"settings\" tab on the remote site. "
1647
  "(#122)"
1648
  msgstr ""
1649
 
1650
+ #: class/wpmdbpro.php:838
1651
  msgid ""
1652
  "The connection succeeded but the remote site is configured to reject push "
1653
  "connections. You can change this in the \"settings\" tab on the remote site. "
1654
  "(#122)"
1655
  msgstr ""
1656
 
1657
+ #: class/wpmdbpro.php:840
1658
  msgctxt "Attempt to connect to the remote server again"
1659
  msgid "Try again?"
1660
  msgstr ""
1661
 
1662
+ #: class/wpmdbpro.php:988
1663
  msgctxt "Delete license"
1664
  msgid "Remove"
1665
  msgstr ""
1666
 
1667
+ #: class/wpmdbpro.php:1171
1668
  msgid ""
1669
  "If you have an <strong>active license</strong>, you may send an email to the "
1670
  "following address."
1671
  msgstr ""
1672
 
1673
+ #: class/wpmdbpro.php:1173
1674
  msgid ""
1675
  "Please copy the Diagnostic Info &amp; Error Log info below into a text file "
1676
  "and attach it to your email. Do the same for any other site involved in your "
1677
  "email."
1678
  msgstr ""
1679
 
1680
+ #: class/wpmdbpro.php:1204
1681
  msgctxt "License does not allow use of addons"
1682
  msgid "Addons Unavailable"
1683
  msgstr ""
1684
 
1685
+ #: class/wpmdbpro.php:1204
1686
  #, php-format
1687
  msgid ""
1688
  "Addons are not included with the Personal license. Visit <a href=\"%s\" "
1689
  "target=\"_blank\">My Account</a> to upgrade in just a few clicks."
1690
  msgstr ""
1691
 
1692
+ #: class/wpmdbpro.php:1219
1693
  msgctxt "Installed on website but not activated"
1694
  msgid "Installed"
1695
  msgstr ""
1696
 
1697
+ #: class/wpmdbpro.php:1221
1698
  msgctxt "Installed and activated on website"
1699
  msgid "Activated"
1700
  msgstr ""
1701
 
1702
+ #: class/wpmdbpro.php:1224
1703
  msgctxt "Enable addon so it may be used"
1704
  msgid "Activate"
1705
  msgstr ""
1706
 
1707
+ #: class/wpmdbpro.php:1228
1708
  msgctxt "Download and activate addon"
1709
  msgid "Install"
1710
  msgstr ""
1711
 
1712
+ #: class/wpmdbpro.php:1234
1713
  #: template/common/debug-info.php:4
1714
  msgctxt "Download to your computer"
1715
  msgid "Download"
1716
  msgstr ""
1717
 
1718
+ #: class/wpmdbpro.php:1367
1719
  msgid "Could not upload the SQL to the server. (#135)"
1720
  msgstr ""
1721
 
1722
+ #: class/wpmdbpro.php:1373
1723
  msgid "Could not read the SQL file we uploaded to the server. (#136)"
1724
  msgstr ""
1725
 
1726
+ #: class/wpmdbpro.php:1392
1727
  msgid ""
1728
  "The connection succeeded but the remote site is configured to reject push "
1729
  "connections. You can change this in the \"settings\" tab on the remote site. "
1730
  "(#139)"
1731
  msgstr ""
1732
 
1733
+ #: class/wpmdbpro.php:1624
1734
  #, php-format
1735
  msgid "There is a new version of %s available."
1736
  msgstr ""
1737
 
1738
+ #: class/wpmdbpro.php:1626
1739
  #, php-format
1740
  msgid "View version %s details"
1741
  msgstr ""
1742
 
1743
+ #: class/wpmdbpro.php:1636
1744
  #, php-format
1745
  msgid ""
1746
  "To update, go to %1$s and enter your license key. If you don't have a "
1747
  "license key, you may <a href=\"%2$s\">purchase one</a>."
1748
  msgstr ""
1749
 
1750
+ #: class/wpmdbpro.php:1638
1751
  #, php-format
1752
  msgid ""
1753
  "To finish activating %1$s, please go to %2$s and enter your license key. If "
1754
  "you don't have a license key, you may <a href=\"%3$s\">purchase one</a>."
1755
  msgstr ""
1756
 
1757
+ #: class/wpmdbpro.php:1725
1758
+ #: class/wpmdbpro.php:1736
1759
  msgid "Could not retrieve version details. Please try again."
1760
  msgstr ""
1761
 
1762
+ #: template/addons.php:8
1763
  msgid "Fetching addon details, please wait..."
1764
  msgstr ""
1765
 
1766
+ #: template/addons.php:13
1767
  msgctxt "License must be activated to use addons"
1768
  msgid "Activate Your License"
1769
  msgstr ""
1770
 
1771
+ #: template/addons.php:13
1772
  msgid ""
1773
  "Please switch to the Settings tab and activate your license. If your license "
1774
  "includes the addons below, you will be able to install them from here with "
1775
  "one-click."
1776
  msgstr ""
1777
 
1778
+ #: template/addons.php:17
1779
  msgctxt "Addons are available with a developer license and better"
1780
  msgid "Get Addons"
1781
  msgstr ""
1782
 
1783
+ #: template/addons.php:17
1784
  #, php-format
1785
  msgid ""
1786
  "The following addons are available with the WP Migrate DB Pro Developer "
1788
  "com</a> to purchase in just a few clicks."
1789
  msgstr ""
1790
 
1791
+ #: template/addons.php:23
1792
  msgid "Media Files"
1793
  msgstr ""
1794
 
1795
+ #: template/addons.php:24
1796
  #, php-format
1797
  msgid ""
1798
  "Allows you to push and pull your files in the Media Library between two "
1801
  "another. <a href=\"%s\">More Details &rarr;</a>"
1802
  msgstr ""
1803
 
1804
+ #: template/addons.php:30
1805
  msgid "CLI"
1806
  msgstr ""
1807
 
1808
+ #: template/addons.php:31
1809
  #, php-format
1810
  msgid ""
1811
  "Integrates WP Migrate DB Pro with WP-CLI allowing you to run migrations from "
1812
  "the command line: %s <a href=\"%s\">More Details &rarr;</a>"
1813
  msgstr ""
1814
 
1815
+ #: template/addons.php:37
1816
  msgid "Multisite Tools"
1817
  msgstr ""
1818
 
1819
+ #: template/addons.php:38
1820
  #, php-format
1821
  msgid ""
1822
  "Export a subsite as an SQL file that can then be imported as a single site "
1832
  msgid "Saved Profiles"
1833
  msgstr ""
1834
 
1835
+ #: template/common/compatibility.php:6
1836
  msgid "Compatibility"
1837
  msgstr ""
1838
 
 
 
 
 
1839
  #: template/common/compatibility.php:11
1840
+ #, php-format
1841
  msgid ""
1842
+ "The compatibility plugin cannot be %s because the mu-plugin directory is not "
1843
+ "currently writable. Please update the permissions of the mu-plugins "
1844
+ "folder: <strong>%s</strong>"
1845
+ msgstr ""
1846
+
1847
+ #: template/common/compatibility.php:27
1848
+ msgid "Plugin Compatibility Mode"
1849
  msgstr ""
1850
 
1851
+ #: template/common/compatibility.php:32
1852
+ #, php-format
1853
  msgid ""
1854
+ "Enabling this feature will enhance performance and reduce the likelihood of "
1855
+ "a third-party plugin interfering with migrations. <a href=\"%1$s\" target="
1856
+ "\"_blank\">Learn More »</a>"
1857
  msgstr ""
1858
 
1859
+ #: template/common/compatibility.php:53
1860
+ #: template/pro/backup.php:47
1861
  #: template/pro/exclude-post-types.php:33
1862
+ #: template/pro/select-tables.php:56
1863
  msgid "Select All"
1864
  msgstr ""
1865
 
1866
+ #: template/common/compatibility.php:55
1867
+ #: template/pro/backup.php:49
1868
  #: template/pro/exclude-post-types.php:35
1869
+ #: template/pro/select-tables.php:58
1870
  msgid "Deselect All"
1871
  msgstr ""
1872
 
1873
+ #: template/common/compatibility.php:57
1874
+ #: template/pro/backup.php:51
1875
  #: template/pro/exclude-post-types.php:37
1876
+ #: template/pro/select-tables.php:60
1877
  msgid "Invert Selection"
1878
  msgstr ""
1879
 
1880
+ #: template/common/compatibility.php:60
1881
+ msgid "Enable Selected Plugins for Migration Requests"
1882
  msgstr ""
1883
 
1884
  #: template/common/debug-info.php:2
1905
  "with time outs, try throttling this setting down."
1906
  msgstr ""
1907
 
1908
+ #: template/common/muplugin-failed-update-warning.php:3
1909
+ msgid "<strong>Compatibility Plugin Update Failed</strong> &mdash; "
1910
+ msgstr ""
1911
+
1912
+ #: template/common/muplugin-failed-update-warning.php:4
1913
+ msgid ""
1914
+ "We could not update the Compatibility Mode plugin because the mu-plugins "
1915
+ "folder is not writable. Please update the permissions of the mu-plugins "
1916
+ "folder to enable Compatibility Mode. "
1917
+ msgstr ""
1918
+
1919
  #: template/migrate-progress.php:6
1920
  msgid "Please wait while migration is running…"
1921
  msgstr ""
1933
  msgid "Pause before replacing migrated tables"
1934
  msgstr ""
1935
 
1936
+ #: template/migrate.php:72
1937
  msgid "Export File"
1938
  msgstr ""
1939
 
1940
+ #: template/migrate.php:78
1941
  msgid "Save as file to your computer"
1942
  msgstr ""
1943
 
1944
+ #: template/migrate.php:85
1945
  msgid "Compress file with gzip"
1946
  msgstr ""
1947
 
1948
+ #: template/migrate.php:95
1949
  msgid "Find & Replace"
1950
  msgstr ""
1951
 
1952
+ #: template/migrate.php:95
1953
  msgid "Run a find & replace on this site's db"
1954
  msgstr ""
1955
 
1956
+ #: template/migrate.php:101
1957
  msgid "Connection Info - Site URL &amp; Secret Key"
1958
  msgstr ""
1959
 
1960
+ #: template/migrate.php:112
1961
+ msgid "HTTPS Disabled"
1962
  msgstr ""
1963
 
1964
+ #: template/migrate.php:112
1965
  msgid ""
1966
+ "We couldn't connect over HTTPS but regular HTTP appears to be working so "
1967
+ "we've switched to that. If you run a push or pull, your data will be "
1968
  "transmitted unencrypted. Most people are fine with this, but just a heads up."
1969
  msgstr ""
1970
 
1971
+ #: template/migrate.php:124
1972
  msgid "Cannot Access Uploads Directory"
1973
  msgstr ""
1974
 
1975
+ #: template/migrate.php:126
1976
  msgid ""
1977
  "We require write permissions to the standard WordPress uploads directory. "
1978
  "Without this permission exports are unavailable. Please grant 755 "
1979
  "permissions on the following directory:"
1980
  msgstr ""
1981
 
1982
+ #: template/migrate.php:139
1983
  msgctxt "Source text to be replaced"
1984
  msgid "Find"
1985
  msgstr ""
1986
 
1987
+ #: template/migrate.php:140
1988
  msgctxt "Text to replace in source"
1989
  msgid "Replace"
1990
  msgstr ""
1991
 
1992
+ #: template/migrate.php:182
1993
  #, php-format
1994
  msgid ""
1995
  "This find & replace will find the domain name of your remote site and "
1998
  "target=\"_blank\">Find & Replace Documentation</a>"
1999
  msgstr ""
2000
 
2001
+ #: template/migrate.php:203
2002
  #, php-format
2003
  msgid ""
2004
  "This find and replace is mostly for 3rd party plugins that store the "
2007
  "migration. <a href=\"%s\" target=\"_blank\">Find & Replace Documentation</a>"
2008
  msgstr ""
2009
 
2010
+ #: template/migrate.php:243
2011
  #, php-format
2012
  msgid ""
2013
  "<strong>New URL Missing</strong> &mdash; Please enter the protocol-relative "
2017
  "fields."
2018
  msgstr ""
2019
 
2020
+ #: template/migrate.php:245
2021
  #, php-format
2022
  msgid ""
2023
  "<strong>New URL Missing</strong> &mdash; Please enter the protocol-relative "
2026
  "documentation</a> on find and replace fields."
2027
  msgstr ""
2028
 
2029
+ #: template/migrate.php:249
2030
  #, php-format
2031
  msgid ""
2032
  "<strong>New File Path Missing</strong> &mdash; Please enter the root file "
2036
  "find and replace fields."
2037
  msgstr ""
2038
 
2039
+ #: template/migrate.php:258
2040
  msgid "Advanced Options"
2041
  msgstr ""
2042
 
2043
+ #: template/migrate.php:267
2044
  msgid "Replace GUIDs"
2045
  msgstr ""
2046
 
2047
+ #: template/migrate.php:273
2048
  #, php-format
2049
  msgid ""
2050
  "Although the <a href=\"%s\" target=\"_blank\">WordPress Codex emphasizes</a> "
2054
  "want to migrate the site live to somedomain.com."
2055
  msgstr ""
2056
 
2057
+ #: template/migrate.php:279
2058
  msgid "Exclude spam comments"
2059
  msgstr ""
2060
 
2061
+ #: template/migrate.php:285
2062
  msgid ""
2063
  "Do not migrate the 'active_plugins' setting (i.e. which plugins are "
2064
  "activated/deactivated)"
2065
  msgstr ""
2066
 
2067
+ #: template/migrate.php:297
2068
  msgid "Compatible with older versions of MySQL (pre-5.5)"
2069
  msgstr ""
2070
 
2071
+ #: template/migrate.php:315
2072
  msgid "Save Migration Profile"
2073
  msgstr ""
2074
 
2075
+ #: template/migrate.php:315
2076
  msgid "Save the above settings for the next time you do a similiar migration"
2077
  msgstr ""
2078
 
2079
+ #: template/migrate.php:337
2080
  msgid "Create new profile"
2081
  msgstr ""
2082
 
2083
+ #: template/migrate.php:346
 
2084
  msgid "Warning: Different Table Prefixes"
2085
  msgstr ""
2086
 
2087
+ #: template/migrate.php:348
2088
  msgid ""
2089
  "Whoa! We've detected that the database table prefix differs between "
2090
  "installations. Clicking the Migrate button below will create new database "
2092
  "span>\"."
2093
  msgstr ""
2094
 
2095
+ #: template/migrate.php:349
2096
  #, php-format
2097
  msgid ""
2098
+ "Whoa! We've detected that the database table prefix differs between "
2099
+ "installations. Clicking the Migrate button below will create new database "
2100
+ "tables in the remote database with prefix \"%s\"."
 
2101
  msgstr ""
2102
 
2103
+ #: template/migrate.php:350
2104
+ #, php-format
2105
  msgid ""
2106
+ "Whoa! We've detected that the database table prefix in the import file does "
2107
+ "not match the database prefix of this install. Clicking the Import button "
2108
+ "below will create new database tables with the prefix \"%s\"."
2109
  msgstr ""
2110
 
2111
+ #: template/migrate.php:352
2112
  #, php-format
2113
  msgid ""
2114
+ "However, your local install is configured to use table prefix \"%1$s\" and "
2115
+ "will ignore the migrated tables. So, <b>AFTER</b> migration is complete, you "
2116
+ "will need to edit your local install's wp-config.php and change the \"%1$s\" "
2117
+ "variable to \"<span class=\"remote-prefix\"></span>\"."
2118
  msgstr ""
2119
 
2120
  #: template/migrate.php:353
2127
  "span>\" variable to \"%s\"."
2128
  msgstr ""
2129
 
2130
+ #: template/migrate.php:354
2131
+ #, php-format
2132
  msgid ""
2133
+ "However, this install is configured to use the table prefix \"%1$s\" and "
2134
+ "will ignore the imported tables. So, <b>AFTER</b> the import is complete, "
2135
+ "you will need to edit this install's wp-config.php file and change the value "
2136
+ "of the \"$table_prefix\" variable to \"%2$s\"."
2137
+ msgstr ""
2138
+
2139
+ #: template/migrate.php:356
2140
+ msgid ""
2141
+ "This will allow your local install to use the migrated tables. Once you do "
2142
  "this, you shouldn't have to do it again."
2143
  msgstr ""
2144
 
2145
+ #: template/migrate.php:357
2146
+ msgid ""
2147
+ "This will allow your remote install to use the migrated tables. Once you do "
2148
+ "this, you shouldn't have to do it again."
2149
+ msgstr ""
2150
+
2151
+ #: template/migrate.php:358
2152
+ msgid ""
2153
+ "That will allow this install to use the imported tables. Once you do this, "
2154
+ "you shouldn't have to do it again."
2155
+ msgstr ""
2156
+
2157
+ #: template/migrate.php:372
2158
  msgctxt "Save current migration settings"
2159
  msgid "Save Profile"
2160
  msgstr ""
2212
  msgid "Backup the database before running the find &amp; replace"
2213
  msgstr ""
2214
 
2215
+ #: template/pro/backup.php:7
2216
+ msgid "Backup the database before running the import"
2217
+ msgstr ""
2218
+
2219
+ #: template/pro/backup.php:9
2220
  msgid "An SQL file will be saved to"
2221
  msgstr ""
2222
 
2223
+ #: template/pro/backup.php:17
2224
  msgid "Backup all tables with prefix"
2225
  msgstr ""
2226
 
2227
+ #: template/pro/backup.php:23
2228
  msgid "Backup only tables selected for migration"
2229
  msgstr ""
2230
 
2231
+ #: template/pro/backup.php:24
2232
+ msgid "Backup only the tables that will be replaced during the import"
2233
+ msgstr ""
2234
+
2235
+ #: template/pro/backup.php:30
2236
  msgid "Backup only selected tables below"
2237
  msgstr ""
2238
 
2239
+ #: template/pro/backup.php:56
2240
+ msgid ""
2241
+ "The backup option has been disabled because the local uploads directory is "
2242
+ "not writable."
2243
+ msgstr ""
2244
+
2245
+ #: template/pro/backup.php:59
2246
+ msgid ""
2247
+ "The backup option has been disabled because the remote uploads directory is "
2248
+ "not writable."
2249
+ msgstr ""
2250
+
2251
+ #: template/pro/backup.php:61
2252
  #, php-format
2253
  msgid ""
2254
+ "We can't save the backup to the following folder: <br><span class=\"upload-"
2255
+ "directory-location\">%s</span>"
2256
+ msgstr ""
2257
+
2258
+ #: template/pro/backup.php:62
2259
+ msgid ""
2260
+ "Please adjust the permissions on this folder. <a href=\"https://"
2261
+ "deliciousbrains.com/wp-migrate-db-pro/doc/uploads-folder-permissions/?"
2262
+ "utm_campaign=error%2Bmessages&utm_source=MDB%2BPaid&utm_medium=insideplugin"
2263
+ "\" target=\"_blank\">See our documentation for more information »</a>"
2264
  msgstr ""
2265
 
2266
  #: template/pro/block-external-warning.php:4
2314
  "replace:"
2315
  msgstr ""
2316
 
2317
+ #: template/pro/find-replace-options.php:4
2318
+ msgid "Find & Replace Options"
2319
+ msgstr ""
2320
+
2321
+ #: template/pro/import-active-plugins-option.php:5
2322
+ msgid "Do not import the \"active plugins\" setting"
2323
+ msgstr ""
2324
+
2325
+ #: template/pro/import-find-replace-option.php:5
2326
+ msgid "Run a find & replace on the import"
2327
+ msgstr ""
2328
+
2329
+ #: template/pro/import-radio-button.php:4
2330
+ msgctxt "Import data from a SQL file"
2331
+ msgid "Import"
2332
+ msgstr ""
2333
+
2334
  #: template/pro/licence-info.php:2
2335
  msgid "Email Support"
2336
  msgstr ""
2443
  msgstr ""
2444
 
2445
  #: template/pro/select-tables.php:13
2446
+ msgid "Run the find & replace all imported tables"
2447
  msgstr ""
2448
 
2449
  #: template/pro/select-tables.php:19
2450
+ msgid "Migrate all tables with prefix"
2451
+ msgstr ""
2452
+
2453
+ #: template/pro/select-tables.php:20
2454
+ msgid "Search in all tables with prefix"
2455
+ msgstr ""
2456
+
2457
+ #: template/pro/select-tables.php:21
2458
+ msgid "Run the find & replace on all imported tables with prefix"
2459
+ msgstr ""
2460
+
2461
+ #: template/pro/select-tables.php:30
2462
  msgid "Migrate only selected tables below"
2463
  msgstr ""
2464
 
2465
+ #: template/pro/select-tables.php:31
2466
+ msgid "Search only in selected tables below"
2467
+ msgstr ""
2468
+
2469
+ #: template/pro/select-tables.php:32
2470
+ msgid "Run the find & replace on the imported tables selected below"
2471
+ msgstr ""
2472
+
2473
  #: template/pro/toggle-remote-requests.php:2
2474
  msgid "Permissions"
2475
  msgstr ""
2490
  msgid "Process requests to push data to this install, overwriting its data."
2491
  msgstr ""
2492
 
2493
+ #: template/pro/unrecognized-import-file.php:2
2494
+ msgid "Unrecognized File"
2495
+ msgstr ""
2496
+
2497
+ #: template/pro/unrecognized-import-file.php:2
2498
+ msgid ""
2499
+ "This file does not appear to have been generated by WP Migrate DB Pro. "
2500
+ "Importing files generated by phpMyAdmin, WP-CLI, etc. should work, but we "
2501
+ "recommend using WP Migrate DB Pro's Export feature."
2502
+ msgstr ""
2503
+
2504
+ #: template/pro/unrecognized-import-file.php:2
2505
+ msgid "Why?"
2506
+ msgstr ""
2507
+
2508
  #: template/pro/videos.php:2
2509
  msgctxt "Tutorial videos"
2510
  msgid "Videos"
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: bradt, deliciousbrains
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5VPMGLLK94XJC
4
  Tags: migrate, migration, export, data dump, backup, database, mysql
5
  Requires at least: 3.6
6
- Tested up to: 4.8
7
- Stable tag: 0.9.2
8
  License: GPLv2
9
 
10
  Migrates your database by running find & replace on URLs and file paths, handling serialized data, and saving an SQL file.
@@ -32,11 +32,13 @@ Example: <code>s:5:"hello"</code> becomes <code>s:11:"hello world"</code>
32
  * Phenomenal email support
33
  * Stress tested on massive databases
34
  * Solid security
35
- * [Media Files addon](https://deliciousbrains.com/wp-migrate-db-pro/doc/media-files-addon/?utm_source=wordpress.org&utm_medium=web&utm_content=desc&utm_campaign=freeplugin)
36
- * [CLI addon](https://deliciousbrains.com/wp-migrate-db-pro/doc/cli-addon/?utm_source=wordpress.org&utm_medium=web&utm_content=desc&utm_campaign=freeplugin)
37
- * [Multisite Tools addon](https://deliciousbrains.com/wp-migrate-db-pro/doc/multisite-tools-addon/?utm_source=wordpress.org&utm_medium=web&utm_content=desc&utm_campaign=freeplugin)
38
 
39
- See the video below or [visit the web site](http://deliciousbrains.com/wp-migrate-db-pro/?utm_source=wordpress.org&utm_medium=web&utm_content=desc&utm_campaign=freeplugin) to learn more about the pro version.
 
 
40
 
41
  https://www.youtube.com/watch?v=fHFcH4bCzmU
42
 
@@ -49,7 +51,7 @@ https://www.youtube.com/watch?v=fHFcH4bCzmU
49
 
50
  = Why wouldn't I just use WordPress' built-in XML export/import to migrate my site? =
51
 
52
- WP Migrate DB will migrate your entire WordPress database, WordPress' built-in tools will not. For more details, please see our blog post, [WordPress XML Export/Import vs. WP Migrate DB Pro](https://deliciousbrains.com/wordpress-xml-export-import-vs-wp-migrate-db-pro/?utm_source=wordpress.org&utm_medium=web&utm_content=faq&utm_campaign=freeplugin).
53
 
54
  = Will you migrate my site for me? =
55
 
@@ -57,11 +59,11 @@ Sorry, but we do not offer site migration services at the moment.
57
 
58
  = Does the plugin support multisite? =
59
 
60
- Yes, but the [Multisite Tools addon](https://deliciousbrains.com/wp-migrate-db-pro/doc/multisite-tools-addon/?utm_source=wordpress.org&utm_medium=web&utm_content=faq&utm_campaign=freeplugin) for the [pro version](http://deliciousbrains.com/wp-migrate-db-pro/?utm_source=wordpress.org&utm_medium=web&utm_content=faq&utm_campaign=freeplugin) does a lot more with multisite like migrating a subsite as a single-site install.
61
 
62
  = Does the plugin migrate files as well? =
63
 
64
- No, it only operates on the database. The pro version's [Media Files addon](https://deliciousbrains.com/wp-migrate-db-pro/doc/media-files-addon/?utm_source=wordpress.org&utm_medium=web&utm_content=faq&utm_campaign=freeplugin) allows you to migrate media files.
65
 
66
  = Why do I end up with a wp-login.php download instead of the exported SQL file? =
67
 
@@ -69,15 +71,15 @@ It is likely you have a download manager plugin or extension installed in your w
69
 
70
  = Does the plugin handle serialized data? =
71
 
72
- Yep, it will run a find &amp; replace on your serialized data and migrate it without corrupting it. See [our documentation](https://deliciousbrains.com/wp-migrate-db-pro/doc/serialized-data/?utm_source=wordpress.org&utm_medium=web&utm_content=faq&utm_campaign=freeplugin) for details.
73
 
74
  = What are the requirements? =
75
 
76
- They are the same as the [requirements for WP Migrate DB Pro](https://deliciousbrains.com/wp-migrate-db-pro/pricing/?utm_source=wordpress.org&utm_medium=web&utm_content=faq&utm_campaign=freeplugin#requirements).
77
 
78
  = Do you offer email support? =
79
 
80
- If you upgrade to [WP Migrate DB Pro](http://deliciousbrains.com/wp-migrate-db-pro/?utm_source=wordpress.org&utm_medium=web&utm_content=faq&utm_campaign=freeplugin), we will gladly provide you with email support. We take pride in delivering exceptional customer support. We do not provide email support for the free version.
81
 
82
  == Screenshots ==
83
 
@@ -87,6 +89,13 @@ If you upgrade to [WP Migrate DB Pro](http://deliciousbrains.com/wp-migrate-db-p
87
 
88
  == Changelog ==
89
 
 
 
 
 
 
 
 
90
  = WP Migrate DB 0.9.2 - 2016-12-16 =
91
 
92
  * Bug Fix: Fixing 500 error for exports due to missing dependency on the WPMDB_Filesystem class
@@ -99,7 +108,7 @@ If you upgrade to [WP Migrate DB Pro](http://deliciousbrains.com/wp-migrate-db-p
99
  = WP Migrate DB 0.9 - 2016-10-20 =
100
 
101
  * New: In-place Find &amp; Replace functionality added - a find and replace can now be run on a site's own database
102
- * New: CLI [find-replace](https://deliciousbrains.com/wp-migrate-db-pro/doc/cli-find-replace-subcommand/) subcommand added
103
  * Improvement: Removed `font-family` declarations from stylesheets
104
  * Improvement: Truncate WP Migrate DB Pro diagnostic log to always be < 1MB, to help with memory exhaustion errors
105
  * Improvement: Added help tooltips for the default find and replace fields
@@ -138,7 +147,7 @@ If you upgrade to [WP Migrate DB Pro](http://deliciousbrains.com/wp-migrate-db-p
138
 
139
  = WP Migrate DB 0.7 - 2015-06-12 =
140
 
141
- * New: [WP-CLI export subcommand](https://deliciousbrains.com/wp-migrate-db-pro/doc/cli-export-subcommand/)
142
  * New: Quick copy find textbox value to replace textbox by clicking arrow icon in between (hat tip Jonathan Perlman)
143
  * New: Added filters to hook into find & replace routine and deal with encoded data ([example](https://github.com/deliciousbrains/wp-migrate-db-pro-tweaks/blob/master/wp-migrate-db-pro-tweaks.php#L316-L413))
144
  * Improvement: Greatly reduced data passed through each HTTP request for better security and reliability
@@ -213,7 +222,7 @@ If you upgrade to [WP Migrate DB Pro](http://deliciousbrains.com/wp-migrate-db-p
213
  * Bug fix: [Find & replace is case-sensitive but shouldn't](https://github.com/bradt/wp-migrate-db/issues/13)
214
 
215
  = WP Migrate DB 0.4.4 - 2013-05-19 =
216
- * [Pro version has arrived!](http://deliciousbrains.com/wp-migrate-db-pro/?utm_source=wordpress.org&utm_medium=web&utm_content=changelog&utm_campaign=freeplugin) Added some info to the sidebar.
217
  * Updated required version to WordPress 3.0+
218
  * Bug fix: [Does not handle serialized objects](https://github.com/bradt/wp-migrate-db/issues/11)
219
  * Bug fix: [Admin menu disappears when DISALLOW_FILE_MODS is true](https://github.com/bradt/wp-migrate-db/issues/8)
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5VPMGLLK94XJC
4
  Tags: migrate, migration, export, data dump, backup, database, mysql
5
  Requires at least: 3.6
6
+ Tested up to: 4.8.1
7
+ Stable tag: 1.0
8
  License: GPLv2
9
 
10
  Migrates your database by running find & replace on URLs and file paths, handling serialized data, and saving an SQL file.
32
  * Phenomenal email support
33
  * Stress tested on massive databases
34
  * Solid security
35
+ * [Media Files addon](https://deliciousbrains.com/wp-migrate-db-pro/doc/media-files-addon/?utm_campaign=addons%2Binstall&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=description)
36
+ * [CLI addon](https://deliciousbrains.com/wp-migrate-db-pro/doc/cli-addon/?utm_campaign=addons%2Binstall&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting)
37
+ * [Multisite Tools addon](https://deliciousbrains.com/wp-migrate-db-pro/doc/multisite-tools-addon/?utm_campaign=addons%2Binstall&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=description)
38
 
39
+ [Compare pro vs free ](https://deliciousbrains.com/wp-migrate-db-pro/upgrade/?utm_campaign=WP%2BMigrate%2BDB%2BPro%2BUpgrade&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting)
40
+
41
+ See the video below or [visit the web site](http://deliciousbrains.com/wp-migrate-db-pro/?utm_campaign=WP%2BMigrate%2BDB%2BPro&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=description) to learn more about the pro version.
42
 
43
  https://www.youtube.com/watch?v=fHFcH4bCzmU
44
 
51
 
52
  = Why wouldn't I just use WordPress' built-in XML export/import to migrate my site? =
53
 
54
+ WP Migrate DB will migrate your entire WordPress database, WordPress' built-in tools will not. For more details, please see our blog post, [WordPress XML Export/Import vs. WP Migrate DB Pro](https://deliciousbrains.com/wordpress-xml-export-import-vs-wp-migrate-db-pro/?utm_campaign=support%2Bdocs&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting).
55
 
56
  = Will you migrate my site for me? =
57
 
59
 
60
  = Does the plugin support multisite? =
61
 
62
+ Yes, but the [Multisite Tools addon](https://deliciousbrains.com/wp-migrate-db-pro/doc/multisite-tools-addon/?utm_campaign=addons%2Binstall&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=faqs) for the [pro version](http://deliciousbrains.com/wp-migrate-db-pro/?utm_campaign=WP%2BMigrate%2BDB%2BPro&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=faqs%2Bmultisite) does a lot more with multisite like migrating a subsite as a single-site install.
63
 
64
  = Does the plugin migrate files as well? =
65
 
66
+ No, it only operates on the database. The pro version's [Media Files addon](https://deliciousbrains.com/wp-migrate-db-pro/doc/media-files-addon/?utm_campaign=addons%2Binstall&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=faqs) allows you to migrate media files.
67
 
68
  = Why do I end up with a wp-login.php download instead of the exported SQL file? =
69
 
71
 
72
  = Does the plugin handle serialized data? =
73
 
74
+ Yep, it will run a find &amp; replace on your serialized data and migrate it without corrupting it. See [our documentation](https://deliciousbrains.com/wp-migrate-db-pro/doc/serialized-data/?utm_campaign=support%2Bdocs&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting) for details.
75
 
76
  = What are the requirements? =
77
 
78
+ They are the same as the [requirements for WP Migrate DB Pro](https://deliciousbrains.com/wp-migrate-db-pro/pricing/?utm_campaign=WP%2BMigrate%2BDB%2BPro&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=requirements#requirements.
79
 
80
  = Do you offer email support? =
81
 
82
+ If you upgrade to [WP Migrate DB Pro](http://deliciousbrains.com/wp-migrate-db-pro/?utm_campaign=WP%2BMigrate%2BDB%2BPro&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=faqs%2Bemail%2Bsupport), we will gladly provide you with email support. We take pride in delivering exceptional customer support. We do not provide email support for the free version.
83
 
84
  == Screenshots ==
85
 
89
 
90
  == Changelog ==
91
 
92
+ = WP Migrate DB 1.0 - 2017-08-11 =
93
+ * New: Plugins and themes are disabled by default for HTTP requests made by WP Migrate DB Pro for better performance and compatibility
94
+ * Improvement: Page is reloaded automatically after migrations that alter the wp_options, wp_users, and wp_usermeta tables
95
+ * Improvement: Additional constants added to the diagnostic log for better debugging by our support team
96
+ * Improvement: Compatibility mode directory permission errors are now dismissable and fewer notices are displayed
97
+ * Bug Fix: Find & Replace not operating on `wp_site` and `wp_blogs` tables on multisite
98
+
99
  = WP Migrate DB 0.9.2 - 2016-12-16 =
100
 
101
  * Bug Fix: Fixing 500 error for exports due to missing dependency on the WPMDB_Filesystem class
108
  = WP Migrate DB 0.9 - 2016-10-20 =
109
 
110
  * New: In-place Find &amp; Replace functionality added - a find and replace can now be run on a site's own database
111
+ * New: CLI [find-replace](https://deliciousbrains.com/wp-migrate-db-pro/doc/cli-find-replace-subcommand/?utm_campaign=changelogs&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=MDB09) subcommand added
112
  * Improvement: Removed `font-family` declarations from stylesheets
113
  * Improvement: Truncate WP Migrate DB Pro diagnostic log to always be < 1MB, to help with memory exhaustion errors
114
  * Improvement: Added help tooltips for the default find and replace fields
147
 
148
  = WP Migrate DB 0.7 - 2015-06-12 =
149
 
150
+ * New: [WP-CLI export subcommand](https://deliciousbrains.com/wp-migrate-db-pro/doc/cli-export-subcommand/?utm_campaign=changelogs&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=MDB07)
151
  * New: Quick copy find textbox value to replace textbox by clicking arrow icon in between (hat tip Jonathan Perlman)
152
  * New: Added filters to hook into find & replace routine and deal with encoded data ([example](https://github.com/deliciousbrains/wp-migrate-db-pro-tweaks/blob/master/wp-migrate-db-pro-tweaks.php#L316-L413))
153
  * Improvement: Greatly reduced data passed through each HTTP request for better security and reliability
222
  * Bug fix: [Find & replace is case-sensitive but shouldn't](https://github.com/bradt/wp-migrate-db/issues/13)
223
 
224
  = WP Migrate DB 0.4.4 - 2013-05-19 =
225
+ * [Pro version has arrived!](http://deliciousbrains.com/wp-migrate-db-pro/?utm_campaign=changelogs&utm_source=wordpress.org&utm_medium=free%2Bplugin%2Blisting&utm_content=MDB044) Added some info to the sidebar.
226
  * Updated required version to WordPress 3.0+
227
  * Bug fix: [Does not handle serialized objects](https://github.com/bradt/wp-migrate-db/issues/11)
228
  * Bug fix: [Admin menu disappears when DISALLOW_FILE_MODS is true](https://github.com/bradt/wp-migrate-db/issues/8)
template/addons.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
  $licence = $this->get_licence_key();
 
3
  ?>
4
  <div class="addons-tab content-tab">
5
  <div class="addons-content">
@@ -13,28 +14,28 @@
13
  </p>
14
  <?php else: ?>
15
  <p class="inline-message warning">
16
- <strong><?php _ex( 'Get Addons', 'Addons are available with a developer license and better', 'wp-migrate-db' ); ?></strong> &ndash; <?php printf( __( 'The following addons are available with the WP Migrate DB Pro Developer license and better. Visit <a href="%s" target="_blank">deliciousbrains.com</a> to purchase in just a few clicks.', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/?utm_source=insideplugin&utm_medium=web&utm_content=addons-tab&utm_campaign=freeplugin' ); ?>
17
  </p>
18
  <?php endif; ?>
19
 
20
  <article class="addon wp-migrate-db-pro-media-files">
21
  <div class="desc">
22
  <h1><?php _e( 'Media Files', 'wp-migrate-db' ); ?></h1>
23
- <p><?php printf( __( 'Allows you to push and pull your files in the Media Library between two WordPress installs. It can compare both libraries and only migrate those missing or updated, or it can do a complete copy of one site\'s library to another. <a href="%s">More Details &rarr;</a>', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/media-files-addon/' ); ?></p>
24
  </div>
25
  </article>
26
 
27
  <article class="addon wp-migrate-db-pro-cli">
28
  <div class="desc">
29
  <h1><?php _e( 'CLI', 'wp-migrate-db' ); ?></h1>
30
- <p><?php printf( __( 'Integrates WP Migrate DB Pro with WP-CLI allowing you to run migrations from the command line: %s <a href="%s">More Details &rarr;</a>', 'wp-migrate-db' ), '<code>wp migratedb &lt;push|pull&gt; &lt;url&gt; &lt;secret-key&gt;</code> <code>[--find=&lt;strings&gt;] [--replace=&lt;strings&gt;] ...</code>', 'https://deliciousbrains.com/wp-migrate-db-pro/doc/cli-addon/' ); ?></p>
31
  </div>
32
  </article>
33
 
34
  <article class="addon wp-migrate-db-pro-multisite-tools">
35
  <div class="desc">
36
  <h1><?php _e( 'Multisite Tools', 'wp-migrate-db' ); ?></h1>
37
- <p><?php printf( __( 'Export a subsite as an SQL file that can then be imported as a single site install. <a href="%s">More Details &rarr;</a>', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/multisite-tools-addon/' ); ?></p>
38
  </div>
39
  </article>
40
 
1
  <?php
2
  $licence = $this->get_licence_key();
3
+ $is_pro = $this->is_pro ? 'MDB%2BPaid' : 'MDB%2BFree';
4
  ?>
5
  <div class="addons-tab content-tab">
6
  <div class="addons-content">
14
  </p>
15
  <?php else: ?>
16
  <p class="inline-message warning">
17
+ <strong><?php _ex( 'Get Addons', 'Addons are available with a developer license and better', 'wp-migrate-db' ); ?></strong> &ndash; <?php printf( __( 'The following addons are available with the WP Migrate DB Pro Developer license and better. Visit <a href="%s" target="_blank">deliciousbrains.com</a> to purchase in just a few clicks.', 'wp-migrate-db' ), "https://deliciousbrains.com/wp-migrate-db-pro/?utm_campaign=WP%2BMigrate%2BDB%2BPro%2BUpgrade&utm_source=$is_pro&utm_medium=insideplugin" ); ?>
18
  </p>
19
  <?php endif; ?>
20
 
21
  <article class="addon wp-migrate-db-pro-media-files">
22
  <div class="desc">
23
  <h1><?php _e( 'Media Files', 'wp-migrate-db' ); ?></h1>
24
+ <p><?php printf( __( 'Allows you to push and pull your files in the Media Library between two WordPress installs. It can compare both libraries and only migrate those missing or updated, or it can do a complete copy of one site\'s library to another. <a href="%s">More Details &rarr;</a>', 'wp-migrate-db' ), "https://deliciousbrains.com/wp-migrate-db-pro/doc/media-files-addon/?utm_campaign=addons%2Binstall&utm_source=$is_pro&utm_medium=insideplugin" ); ?></p>
25
  </div>
26
  </article>
27
 
28
  <article class="addon wp-migrate-db-pro-cli">
29
  <div class="desc">
30
  <h1><?php _e( 'CLI', 'wp-migrate-db' ); ?></h1>
31
+ <p><?php printf( __( 'Integrates WP Migrate DB Pro with WP-CLI allowing you to run migrations from the command line: %s <a href="%s">More Details &rarr;</a>', 'wp-migrate-db' ), '<code>wp migratedb &lt;push|pull&gt; &lt;url&gt; &lt;secret-key&gt;</code> <code>[--find=&lt;strings&gt;] [--replace=&lt;strings&gt;] ...</code>', "https://deliciousbrains.com/wp-migrate-db-pro/doc/cli-addon/?utm_campaign=addons%2Binstall&utm_source=$is_pro&utm_medium=insideplugin" ); ?></p>
32
  </div>
33
  </article>
34
 
35
  <article class="addon wp-migrate-db-pro-multisite-tools">
36
  <div class="desc">
37
  <h1><?php _e( 'Multisite Tools', 'wp-migrate-db' ); ?></h1>
38
+ <p><?php printf( __( 'Export a subsite as an SQL file that can then be imported as a single site install. <a href="%s">More Details &rarr;</a>', 'wp-migrate-db' ), "https://deliciousbrains.com/wp-migrate-db-pro/doc/multisite-tools-addon/?utm_campaign=addons%2Binstall&utm_source=$is_pro&utm_medium=insideplugin" ); ?></p>
39
  </div>
40
  </article>
41
 
template/common/checkbox.php CHANGED
@@ -3,7 +3,7 @@ $value = ( isset( $value ) ) ? $value : $this->settings[$key];
3
  $class = ( isset( $class ) ) ? 'class="' . $class . '"' : '';
4
  $disabled = ( isset( $disabled ) && $disabled ) ? ' disabled' : '';
5
  ?>
6
- <div id="<?php echo $key; ?>-wrap" data-checkbox="<?php echo $key; ?>" class="wpmdb-switch<?php echo $disabled . $value ? ' on' : ''; ?>">
7
  <span class="on <?php echo $value ? 'checked' : ''; ?>">ON</span>
8
  <span class="off <?php echo ! $value ? 'checked' : ''; ?>">OFF</span>
9
  <input type="hidden" name="<?php echo $key; ?>" value="0" />
3
  $class = ( isset( $class ) ) ? 'class="' . $class . '"' : '';
4
  $disabled = ( isset( $disabled ) && $disabled ) ? ' disabled' : '';
5
  ?>
6
+ <div id="<?php echo $key; ?>-wrap" data-checkbox="<?php echo $key; ?>" class="wpmdb-switch<?php echo $disabled . $value ? ' on' : ''; echo $disabled; ?>">
7
  <span class="on <?php echo $value ? 'checked' : ''; ?>">ON</span>
8
  <span class="off <?php echo ! $value ? 'checked' : ''; ?>">OFF</span>
9
  <input type="hidden" name="<?php echo $key; ?>" value="0" />
template/common/compatibility.php CHANGED
@@ -1,46 +1,69 @@
1
- <tr class="wpmdb-setting-title">
2
- <td colspan="2"><h3><?php _e( 'Compatibility', 'wp-migrate-db' ); ?></h3></td>
3
- </tr>
4
 
5
- <tr>
6
- <td><?php $this->template( 'checkbox', 'common', array( 'key' => 'plugin-compatibility', 'value' => $plugin_compatibility_checked ) ); ?></td>
7
- <td>
8
- <h4>
9
- <?php _e( 'Plugin Compatibility Mode', 'wp-migrate-db' ); ?> <a href="#" class="general-helper plugin-compatibility-helper js-action-link"></a>
10
- <div class="plugin-compatibility-message helper-message bottom">
11
- <?php _e( 'Some plugins add a lot of overhead to each request, requiring extra memory and CPU. And some plugins even interfere with migrations and cause them to fail. We recommend only loading plugins that affect migration requests, for example a plugin that hooks into WP Migrate DB.', 'wp-migrate-db' ); ?></br>
12
- </div>
13
- <span class="setting-status"></span>
14
- </h4>
15
- <p><?php _e( 'Avoid plugin conflicts and improve performance by not loading plugins for migration requests.', 'wp-migrate-db' ); ?></p>
16
- </td>
17
- </tr>
18
 
19
- <tr class="plugin-compatibility-section">
20
- <td colspan="2">
21
- <div class="indent-wrap expandable-content plugin-compatibility-wrap select-wrap">
22
- <select autocomplete="off" class="multiselect" id="selected-plugins" name="selected_plugins[]" multiple="multiple">
23
- <?php
24
- $blacklist = array_flip( (array) $this->settings['blacklist_plugins'] );
25
- foreach ( get_plugins() as $key => $plugin ) {
26
- if ( 0 === strpos( $key, 'wp-migrate-db' ) ) {
27
- continue;
28
- }
29
- $selected = ( isset( $blacklist[ $key ] ) ) ? ' selected' : '';
30
- printf( '<option value="%s"%s>%s</option>', $key, $selected, $plugin['Name'] );
31
- }
32
  ?>
33
- </select>
34
- <br>
35
- <a class="multiselect-select-all js-action-link" href="#"><?php _e( 'Select All', 'wp-migrate-db' ); ?></a>
36
- <span class="select-deselect-divider">/</span>
37
- <a class="multiselect-deselect-all js-action-link" href="#"><?php _e( 'Deselect All', 'wp-migrate-db' ); ?></a>
38
- <span class="select-deselect-divider">/</span>
39
- <a class="multiselect-invert-selection js-action-link" href="#"><?php _e( 'Invert Selection', 'wp-migrate-db' ); ?></a>
40
-
41
- <p>
42
- <span class="button plugin-compatibility-save"><?php _e( 'Save Changes', 'wp-migrate-db' ); ?></span>
43
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  </div>
45
  </td>
46
  </tr>
1
+ <tr class="wpmdb-setting-title option-section compatibility-mode">
2
+ <td colspan="2">
 
3
 
4
+ <div class="header-expand-collapse clearfix" data-next=".compat-block" id="compatibility-header">
5
+ <div class="expand-collapse-arrow collapsed">&#x25BC;</div>
6
+ <div class="option-heading tables-header"><?php _e( 'Compatibility', 'wp-migrate-db' ); ?></div>
7
+ </div>
 
 
 
 
 
 
 
 
 
8
 
9
+ <div class="compatibility-mode-disabled"<?php if ( $this->compatibility_plugin_manager->is_muplugin_writable() ): ?> style="display: none;"<?php endif; ?>>
10
+ <div class="inline-message error-notice notification-message">
11
+ <?php printf( __( 'The compatibility plugin cannot be %s because the mu-plugin directory is not currently writable. Please update the permissions of the mu-plugins folder: <strong>%s</strong>', 'wp-migrate-db' ), ( $this->compatibility_plugin_manager->is_muplugin_installed() ? 'disabled' : 'enabled' ), $this->mu_plugin_dir );
 
 
 
 
 
 
 
 
 
 
12
  ?>
13
+ </div>
14
+ </div>
15
+
16
+ <div class="indent-wrap expandable-content compat-block">
17
+ <table>
18
+
19
+ <tr>
20
+ <td><?php $this->template( 'checkbox', 'common', array(
21
+ 'key' => 'plugin-compatibility',
22
+ 'value' => $plugin_compatibility_checked,
23
+ 'disabled' => ! $this->compatibility_plugin_manager->is_muplugin_writable(),
24
+ ) ); ?></td>
25
+ <td>
26
+ <h4>
27
+ <?php _e( 'Plugin Compatibility Mode', 'wp-migrate-db' ); ?>
28
+
29
+ <span class="setting-status"></span>
30
+ </h4>
31
+
32
+ <p class="has-margin"><?php printf( __( 'Enabling this feature will enhance performance and reduce the likelihood of a third-party plugin interfering with migrations. <a href="%1$s" target="_blank">Learn More »</a>', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/compatibility-mode/' ); ?></p>
33
+ </td>
34
+ </tr>
35
+
36
+ <tr class="plugin-compatibility-section">
37
+ <td colspan="2">
38
+ <div class="indent-wrap expandable-content plugin-compatibility-wrap select-wrap">
39
+ <p class="has-margin"><label for="selected_plugins">Plugins to enable for migration requests:</label></p>
40
+ <select autocomplete="off" class="multiselect" id="selected-plugins" name="selected_plugins[]" multiple="multiple">
41
+ <?php
42
+ $whitelist = array_flip( (array) $this->settings['whitelist_plugins'] );
43
+ foreach ( get_plugins() as $key => $plugin ) {
44
+ if ( 0 === strpos( $key, 'wp-migrate-db' ) ) {
45
+ continue;
46
+ }
47
+ $selected = ( isset( $whitelist[ $key ] ) ) ? ' selected' : '';
48
+ printf( '<option value="%s"%s>%s</option>', $key, $selected, $plugin['Name'] );
49
+ }
50
+ ?>
51
+ </select>
52
+ <br>
53
+ <a class="multiselect-select-all js-action-link" href="#"><?php _e( 'Select All', 'wp-migrate-db' ); ?></a>
54
+ <span class="select-deselect-divider">/</span>
55
+ <a class="multiselect-deselect-all js-action-link" href="#"><?php _e( 'Deselect All', 'wp-migrate-db' ); ?></a>
56
+ <span class="select-deselect-divider">/</span>
57
+ <a class="multiselect-invert-selection js-action-link" href="#"><?php _e( 'Invert Selection', 'wp-migrate-db' ); ?></a>
58
+
59
+ <p>
60
+ <span class="button plugin-compatibility-save"><?php _e( 'Enable Selected Plugins for Migration Requests', 'wp-migrate-db' ); ?></span>
61
+ </p>
62
+ </div>
63
+ </td>
64
+ </tr>
65
+ </table>
66
+
67
  </div>
68
  </td>
69
  </tr>
template/common/muplugin-failed-update-warning.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <div class="below-title warning inline-message">
2
+ <?php
3
+ _e( '<strong>Compatibility Plugin Update Failed</strong> &mdash; ', 'wp-migrate-db' );
4
+ _e( 'We could not update the Compatibility Mode plugin because the mu-plugins folder is not writable. Please update the permissions of the mu-plugins folder to enable Compatibility Mode. ', 'wp-migrate-db' );
5
+
6
+ echo $dismiss;
7
+ ?>
8
+ </div>
template/migrate.php CHANGED
@@ -7,9 +7,10 @@ if ( isset( $_GET['wpmdb-profile'] ) ) {
7
  } else {
8
  $loaded_profile = $this->default_profile;
9
  }
10
-
11
  $is_default_profile = isset( $loaded_profile['default_profile'] );
12
 
 
 
13
  $convert_exclude_revisions = false;
14
  $convert_post_type_selection = false;
15
  if ( ! $is_default_profile ) {
@@ -87,7 +88,7 @@ $breadcrumbs_params = array(
87
  <?php endif; ?>
88
  </ul>
89
  </li>
90
- <?php $this->template_part( array( 'pull_push_radio_buttons' ), $loaded_profile ); ?>
91
  <li>
92
  <label for="find_replace">
93
  <input id="find_replace" type="radio" value="find_replace" name="action"<?php echo ( 'find_replace' === $loaded_profile['action'] ) ? ' checked="checked"' : ''; ?> />
@@ -108,15 +109,17 @@ $breadcrumbs_params = array(
108
  </div>
109
 
110
  <div class="notification-message warning-notice ssl-notice inline-message">
111
- <strong><?php _e( 'SSL Disabled', 'wp-migrate-db' ); ?></strong> &mdash; <?php _e( 'We couldn\'t connect over SSL but regular http (no SSL) appears to be working so we\'ve switched to that. If you run a push or pull, your data will be transmitted unencrypted. Most people are fine with this, but just a heads up.', 'wp-migrate-db' ); ?>
112
  </div>
113
 
114
- <?php $this->template_part( array( 'invalid_licence_warning' ) ); ?>
115
 
116
  </div>
117
 
118
  <p class="connection-status"><?php _e( 'Please enter the connection information above to continue.', 'wp-migrate-db' ); ?></p>
119
 
 
 
120
  <div class="notification-message error-notice directory-permission-notice inline-message" style="display: none;">
121
  <strong><?php _e( 'Cannot Access Uploads Directory', 'wp-migrate-db' ); ?></strong> &mdash;
122
  <?php
@@ -129,7 +132,9 @@ $breadcrumbs_params = array(
129
 
130
  <?php do_action( 'wpmdb_before_migration_options' ); ?>
131
 
132
- <div class="option-section">
 
 
133
  <div class="header-wrapper clearfix">
134
  <div class="option-heading find-heading"><?php _ex( 'Find', 'Source text to be replaced', 'wp-migrate-db' ); ?></div>
135
  <div class="option-heading replace-heading"><?php _ex( 'Replace', 'Text to replace in source', 'wp-migrate-db' ); ?></div>
@@ -174,7 +179,7 @@ $breadcrumbs_params = array(
174
  <span class="replace-remove-row" data-profile-id="0" style="<?php echo $style; ?>"></span>
175
  <a href="#" class="general-helper domain-replace-helper js-action-link"></a>
176
  <div class="domain-replace-info helper-message bottom">
177
- <?php printf( __( 'This find & replace will find the domain name of your remote site and replace it with the domain name of this site. We\'ve left out the protocol so that both http:// and https:// will be found and replaced. <a href="%s" target="_blank">Find & Replace Documentation</a>', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/find-and-replace/' ); ?>
178
  </div>
179
  </td>
180
  </tr>
@@ -195,7 +200,7 @@ $breadcrumbs_params = array(
195
  <span class="replace-remove-row" data-profile-id="0"></span>
196
  <a href="#" class="general-helper path-replace-helper js-action-link"></a>
197
  <div class="path-replace-info helper-message bottom">
198
- <?php printf( __( 'This find and replace is mostly for 3rd party plugins that store the website’s root file path in the database. This set of fields will ensure that these values are updated to the correct root file path during the migration. <a href="%s" target="_blank">Find & Replace Documentation</a>', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/find-and-replace/' ); ?>
199
  </div>
200
  </td>
201
  </tr>
@@ -240,14 +245,14 @@ $breadcrumbs_params = array(
240
  $new_url_missing_warning = __( '<strong>New URL Missing</strong> &mdash; Please enter the protocol-relative URL of the remote website in the "New URL" field. If you are unsure of what this URL should be, please consult <a href="%s" target="_blank">our documentation</a> on find and replace fields.', 'wp-migrate-db' );
241
  }
242
  ?>
243
- <div id="new-url-missing-warning" class="warning inline-message missing-replace"><?php printf( $new_url_missing_warning, 'https://deliciousbrains.com/wp-migrate-db-pro/doc/find-and-replace/' ); ?></div>
244
- <div id="new-path-missing-warning" class="warning inline-message missing-replace"><?php printf( __( '<strong>New File Path Missing</strong> &mdash; Please enter the root file path of the remote website in the "New file path" field or remove the whole row entirely. If you are unsure of what the file path should be, please consult <a href="%s" target="_blank">our documentation</a> on find and replace fields.', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/doc/find-and-replace/' ); ?></div>
245
 
246
  </div>
247
 
248
- <?php $this->template_part( array( 'select_tables', 'exclude_post_types' ), $loaded_profile ); ?>
249
 
250
- <div class="option-section">
251
  <div class="header-expand-collapse clearfix">
252
  <div class="expand-collapse-arrow collapsed">&#x25BC;</div>
253
  <div class="option-heading tables-header"><?php _e( 'Advanced Options', 'wp-migrate-db' ); ?></div>
@@ -300,6 +305,8 @@ $breadcrumbs_params = array(
300
 
301
  <?php $this->template_part( array( 'backup' ), $loaded_profile ); ?>
302
 
 
 
303
  <?php do_action( 'wpmdb_after_advanced_options' ); ?>
304
 
305
  <div class="option-section save-migration-profile-wrap">
@@ -335,24 +342,20 @@ $breadcrumbs_params = array(
335
  </div>
336
  </div>
337
 
338
- <div class="notification-message warning-notice prefix-notice pull">
339
- <h4><?php _e( 'Warning: Different Table Prefixes', 'wp-migrate-db' ); ?></h4>
340
-
341
- <p><?php _e( 'Whoa! We\'ve detected that the database table prefix differs between installations. Clicking the Migrate button below will create new database tables in your local database with prefix "<span class="remote-prefix"></span>".', 'wp-migrate-db' ); ?></p>
342
-
343
- <p><?php printf( __( 'However, your local install is configured to use table prefix "%1$s" and will ignore the migrated tables. So, <b>AFTER</b> migration is complete, you will need to edit your local install\'s wp-config.php and change the "%1$s" variable to "<span class="remote-prefix"></span>".', 'wp-migrate-db' ), $wpdb->base_prefix, $wpdb->base_prefix ); ?></p>
344
-
345
- <p><?php _e( 'This will allow your local install the use the migrated tables. Once you do this, you shouldn\'t have to do it again.', 'wp-migrate-db' ); ?></p>
346
- </div>
347
-
348
- <div class="notification-message warning-notice prefix-notice push">
349
  <h4><?php _e( 'Warning: Different Table Prefixes', 'wp-migrate-db' ); ?></h4>
350
 
351
- <p><?php printf( __( 'Whoa! We\'ve detected that the database table prefix differs between installations. Clicking the Migrate button below will create new database tables in the remote database with prefix "%s".', 'wp-migrate-db' ), $wpdb->base_prefix ); ?></p>
 
 
352
 
353
- <p><?php printf( __( 'However, your remote install is configured to use table prefix "<span class="remote-prefix"></span>" and will ignore the migrated tables. So, <b>AFTER</b> migration is complete, you will need to edit your remote install\'s wp-config.php and change the "<span class="remote-prefix"></span>" variable to "%s".', 'wp-migrate-db' ), $wpdb->base_prefix ); ?></p>
 
 
354
 
355
- <p><?php _e( 'This will allow your remote install the use the migrated tables. Once you do this, you shouldn\'t have to do it again.', 'wp-migrate-db' ); ?></p>
 
 
356
  </div>
357
 
358
  <div class="notification-message warning-notice mixed-case-table-name-notice pull">
7
  } else {
8
  $loaded_profile = $this->default_profile;
9
  }
 
10
  $is_default_profile = isset( $loaded_profile['default_profile'] );
11
 
12
+ $tracking_base = $this->is_pro ? 'MDB%2BPaid' : 'MDB%2BFree';
13
+
14
  $convert_exclude_revisions = false;
15
  $convert_post_type_selection = false;
16
  if ( ! $is_default_profile ) {
88
  <?php endif; ?>
89
  </ul>
90
  </li>
91
+ <?php $this->template_part( array( 'import_radio_button', 'pull_push_radio_buttons' ), $loaded_profile ); ?>
92
  <li>
93
  <label for="find_replace">
94
  <input id="find_replace" type="radio" value="find_replace" name="action"<?php echo ( 'find_replace' === $loaded_profile['action'] ) ? ' checked="checked"' : ''; ?> />
109
  </div>
110
 
111
  <div class="notification-message warning-notice ssl-notice inline-message">
112
+ <strong><?php _e( 'HTTPS Disabled', 'wp-migrate-db' ); ?></strong> &mdash; <?php _e( 'We couldn\'t connect over HTTPS but regular HTTP appears to be working so we\'ve switched to that. If you run a push or pull, your data will be transmitted unencrypted. Most people are fine with this, but just a heads up.', 'wp-migrate-db' ); ?>
113
  </div>
114
 
115
+ <?php $this->template_part( array( 'invalid_licence_warning', 'unrecognized_import_file' ) ); ?>
116
 
117
  </div>
118
 
119
  <p class="connection-status"><?php _e( 'Please enter the connection information above to continue.', 'wp-migrate-db' ); ?></p>
120
 
121
+ <?php $this->template_part( array( 'import_file_status' ) ); ?>
122
+
123
  <div class="notification-message error-notice directory-permission-notice inline-message" style="display: none;">
124
  <strong><?php _e( 'Cannot Access Uploads Directory', 'wp-migrate-db' ); ?></strong> &mdash;
125
  <?php
132
 
133
  <?php do_action( 'wpmdb_before_migration_options' ); ?>
134
 
135
+ <?php $this->template_part( array( 'import_find_replace_option' ) ); ?>
136
+
137
+ <div class="option-section find-replace-rows">
138
  <div class="header-wrapper clearfix">
139
  <div class="option-heading find-heading"><?php _ex( 'Find', 'Source text to be replaced', 'wp-migrate-db' ); ?></div>
140
  <div class="option-heading replace-heading"><?php _ex( 'Replace', 'Text to replace in source', 'wp-migrate-db' ); ?></div>
179
  <span class="replace-remove-row" data-profile-id="0" style="<?php echo $style; ?>"></span>
180
  <a href="#" class="general-helper domain-replace-helper js-action-link"></a>
181
  <div class="domain-replace-info helper-message bottom">
182
+ <?php printf( __( 'This find & replace will find the domain name of your remote site and replace it with the domain name of this site. We\'ve left out the protocol so that both http:// and https:// will be found and replaced. <a href="%s" target="_blank">Find & Replace Documentation</a>', 'wp-migrate-db' ), "https://deliciousbrains.com/wp-migrate-db-pro/doc/find-and-replace/?utm_campaign=support%2Bdocs&utm_source={$tracking_base}&utm_medium=insideplugin&utm_content=new%2Burl%2Bhelp%2Bbubble" ); ?>
183
  </div>
184
  </td>
185
  </tr>
200
  <span class="replace-remove-row" data-profile-id="0"></span>
201
  <a href="#" class="general-helper path-replace-helper js-action-link"></a>
202
  <div class="path-replace-info helper-message bottom">
203
+ <?php printf( __( 'This find and replace is mostly for 3rd party plugins that store the website’s root file path in the database. This set of fields will ensure that these values are updated to the correct root file path during the migration. <a href="%s" target="_blank">Find & Replace Documentation</a>', 'wp-migrate-db' ), "https://deliciousbrains.com/wp-migrate-db-pro/doc/find-and-replace/?utm_campaign=support%2Bdocs&utm_source={$tracking_base}&utm_medium=insideplugin&utm_content=new%2Bfile%2Bpath%2Bhelp%2Bbubble" ); ?>
204
  </div>
205
  </td>
206
  </tr>
245
  $new_url_missing_warning = __( '<strong>New URL Missing</strong> &mdash; Please enter the protocol-relative URL of the remote website in the "New URL" field. If you are unsure of what this URL should be, please consult <a href="%s" target="_blank">our documentation</a> on find and replace fields.', 'wp-migrate-db' );
246
  }
247
  ?>
248
+ <div id="new-url-missing-warning" class="warning inline-message missing-replace"><?php printf( $new_url_missing_warning, "https://deliciousbrains.com/wp-migrate-db-pro/doc/find-and-replace/?utm_campaign=support%2Bdocs&utm_source={$tracking_base}&utm_medium=insideplugin&utm_content=new%2Burl%2Bvalidation" ); ?></div>
249
+ <div id="new-path-missing-warning" class="warning inline-message missing-replace"><?php printf( __( '<strong>New File Path Missing</strong> &mdash; Please enter the root file path of the remote website in the "New file path" field or remove the whole row entirely. If you are unsure of what the file path should be, please consult <a href="%s" target="_blank">our documentation</a> on find and replace fields.', 'wp-migrate-db' ), "https://deliciousbrains.com/wp-migrate-db-pro/doc/find-and-replace/?utm_campaign=support%2Bdocs&utm_source={$tracking_base}&utm_medium=insideplugin&utm_content=new%2Bfile%2Bpath%2Bvalidation" ); ?></div>
250
 
251
  </div>
252
 
253
+ <?php $this->template_part( array( 'find_replace_options', 'select_tables', 'exclude_post_types' ), $loaded_profile ); ?>
254
 
255
+ <div class="option-section advanced-options">
256
  <div class="header-expand-collapse clearfix">
257
  <div class="expand-collapse-arrow collapsed">&#x25BC;</div>
258
  <div class="option-heading tables-header"><?php _e( 'Advanced Options', 'wp-migrate-db' ); ?></div>
305
 
306
  <?php $this->template_part( array( 'backup' ), $loaded_profile ); ?>
307
 
308
+ <?php $this->template_part( array( 'import_active_plugins_option' ), $loaded_profile ); ?>
309
+
310
  <?php do_action( 'wpmdb_after_advanced_options' ); ?>
311
 
312
  <div class="option-section save-migration-profile-wrap">
342
  </div>
343
  </div>
344
 
345
+ <div class="notification-message warning-notice prefix-notice">
 
 
 
 
 
 
 
 
 
 
346
  <h4><?php _e( 'Warning: Different Table Prefixes', 'wp-migrate-db' ); ?></h4>
347
 
348
+ <p class="action-text pull"><?php _e( 'Whoa! We\'ve detected that the database table prefix differs between installations. Clicking the Migrate button below will create new database tables in your local database with prefix "<span class="remote-prefix"></span>".', 'wp-migrate-db' ); ?></p>
349
+ <p class="action-text push"><?php printf( __( 'Whoa! We\'ve detected that the database table prefix differs between installations. Clicking the Migrate button below will create new database tables in the remote database with prefix "%s".', 'wp-migrate-db' ), $wpdb->base_prefix ); ?></p>
350
+ <p class="action-text import"><?php printf( __( 'Whoa! We\'ve detected that the database table prefix in the import file does not match the database prefix of this install. Clicking the Import button below will create new database tables with the prefix "%s".', 'wp-migrate-db' ), '<span class="remote-prefix"></span>' ); ?></p>
351
 
352
+ <p class="action-text pull"><?php printf( __( 'However, your local install is configured to use table prefix "%1$s" and will ignore the migrated tables. So, <b>AFTER</b> migration is complete, you will need to edit your local install\'s wp-config.php and change the "%1$s" variable to "<span class="remote-prefix"></span>".', 'wp-migrate-db' ), $wpdb->base_prefix, $wpdb->base_prefix ); ?></p>
353
+ <p class="action-text push"><?php printf( __( 'However, your remote install is configured to use table prefix "<span class="remote-prefix"></span>" and will ignore the migrated tables. So, <b>AFTER</b> migration is complete, you will need to edit your remote install\'s wp-config.php and change the "<span class="remote-prefix"></span>" variable to "%s".', 'wp-migrate-db' ), $wpdb->base_prefix ); ?></p>
354
+ <p class="action-text import"><?php printf( __( 'However, this install is configured to use the table prefix "%1$s" and will ignore the imported tables. So, <b>AFTER</b> the import is complete, you will need to edit this install\'s wp-config.php file and change the value of the "$table_prefix" variable to "%2$s".', 'wp-migrate-db' ), $wpdb->base_prefix, '<span class="remote-prefix"></span>' ); ?></p>
355
 
356
+ <p class="action-text pull"><?php _e( 'This will allow your local install to use the migrated tables. Once you do this, you shouldn\'t have to do it again.', 'wp-migrate-db' ); ?></p>
357
+ <p class="action-text push"><?php _e( 'This will allow your remote install to use the migrated tables. Once you do this, you shouldn\'t have to do it again.', 'wp-migrate-db' ); ?></p>
358
+ <p class="action-text import"><?php _e ( 'That will allow this install to use the imported tables. Once you do this, you shouldn\'t have to do it again.', 'wp-migrate-db' ); ?></p>
359
  </div>
360
 
361
  <div class="notification-message warning-notice mixed-case-table-name-notice pull">
template/wpmdb/progress-upgrade.php CHANGED
@@ -21,7 +21,7 @@
21
  <iframe width="515" height="289" src="//www.youtube.com/embed/fHFcH4bCzmU?rel=0&showinfo=0&autoplay=0&wmode=transparent&theme=light" frameborder="0" allowfullscreen></iframe>
22
  </div>
23
 
24
- <a class="button" href="https://deliciousbrains.com/wp-migrate-db-pro/?utm_source=insideplugin&utm_medium=web&utm_content=progress-bar&utm_campaign=freeplugin" target="_blank"><?php _e( 'More About The Pro Version', 'wp-migrate-db' ); ?> &rarr;</a>
25
  <span class="close-pro-version close-pro-version-button" >×</span>
26
 
27
  </div>
21
  <iframe width="515" height="289" src="//www.youtube.com/embed/fHFcH4bCzmU?rel=0&showinfo=0&autoplay=0&wmode=transparent&theme=light" frameborder="0" allowfullscreen></iframe>
22
  </div>
23
 
24
+ <a class="button" href="https://deliciousbrains.com/wp-migrate-db-pro/?utm_campaign=WP%2BMigrate%2BDB%2BPro%2BUpgrade&utm_source=MDB%2BFree&utm_medium=insideplugin" target="_blank"><?php _e( 'More About The Pro Version', 'wp-migrate-db' ); ?> &rarr;</a>
25
  <span class="close-pro-version close-pro-version-button" >×</span>
26
 
27
  </div>
template/wpmdb/sidebar.php CHANGED
@@ -1,6 +1,6 @@
1
  <div id="wpmdb-sidebar">
2
 
3
- <a class="wpmdb-banner" target="_blank" href="https://deliciousbrains.com/wp-migrate-db-pro/?utm_source=insideplugin&utm_medium=web&utm_content=sidebar&utm_campaign=freeplugin"><img src="<?php echo plugins_url( 'asset/dist/img/wp-migrate-db-pro.jpg', $this->plugin_file_path ); ?>" width="292" height="292" alt="<?php _e( 'WP Migrate DB Pro &mdash; Push and pull your database from one WordPress install to another in 1-click.', 'wp-migrate-db' ); ?>" /></a>
4
 
5
  <form method="post" action="https://deliciousbrains.com/email-subscribe/" target="_blank" class="subscribe block">
6
  <h2><?php _e( 'Get 20% Off!', 'wp-migrate-db' ); ?></h2>
1
  <div id="wpmdb-sidebar">
2
 
3
+ <a class="wpmdb-banner" target="_blank" href="https://deliciousbrains.com/wp-migrate-db-pro/?utm_campaign=WP%2BMigrate%2BDB%2BPro%2BUpgrade&utm_source=MDB%2BFree&utm_medium=insideplugin"><img src="<?php echo plugins_url( 'asset/dist/img/wp-migrate-db-pro.jpg', $this->plugin_file_path ); ?>" width="292" height="292" alt="<?php _e( 'WP Migrate DB Pro &mdash; Push and pull your database from one WordPress install to another in 1-click.', 'wp-migrate-db' ); ?>" /></a>
4
 
5
  <form method="post" action="https://deliciousbrains.com/email-subscribe/" target="_blank" class="subscribe block">
6
  <h2><?php _e( 'Get 20% Off!', 'wp-migrate-db' ); ?></h2>
template/wpmdb/wordpress-org-support.php CHANGED
@@ -5,7 +5,7 @@
5
 
6
  <p><?php printf( __( 'You may ask the WordPress community for help by posting to the <a href="%s">WordPress.org support forum</a>. Response time can range from a few days to a few weeks and will likely be from a non-developer.', 'wp-migrate-db' ), 'http://wordpress.org/support/plugin/wp-migrate-db' ); ?></p>
7
 
8
- <p class="upgrade-to-pro"><?php printf( __( 'If you want a <strong>timely response via email from a developer</strong> who works on this plugin, <a href="%s">upgrade to WP Migrate DB Pro</a> and send us an email.', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/?utm_source=insideplugin&utm_medium=web&utm_content=help-tab&utm_campaign=freeplugin' ); ?></p>
9
 
10
  <p><?php printf( __( 'If you\'ve found a bug, please <a href="%s">submit an issue at Github</a>.', 'wp-migrate-db' ), 'https://github.com/bradt/wp-migrate-db/issues' ); ?></p>
11
 
5
 
6
  <p><?php printf( __( 'You may ask the WordPress community for help by posting to the <a href="%s">WordPress.org support forum</a>. Response time can range from a few days to a few weeks and will likely be from a non-developer.', 'wp-migrate-db' ), 'http://wordpress.org/support/plugin/wp-migrate-db' ); ?></p>
7
 
8
+ <p class="upgrade-to-pro"><?php printf( __( 'If you want a <strong>timely response via email from a developer</strong> who works on this plugin, <a href="%s">upgrade to WP Migrate DB Pro</a> and send us an email.', 'wp-migrate-db' ), 'https://deliciousbrains.com/wp-migrate-db-pro/?utm_campaign=WP%2BMigrate%2BDB%2BPro%2BUpgrade&utm_source=MDB%2BFree&utm_medium=insideplugin' ); ?></p>
9
 
10
  <p><?php printf( __( 'If you\'ve found a bug, please <a href="%s">submit an issue at Github</a>.', 'wp-migrate-db' ), 'https://github.com/bradt/wp-migrate-db/issues' ); ?></p>
11
 
wp-migrate-db.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: WP Migrate DB
4
  Plugin URI: http://wordpress.org/plugins/wp-migrate-db/
5
  Description: Exports your database as a MySQL data dump (much like phpMyAdmin), does a find and replace on URLs and file paths, then allows you to save it to your computer.
6
  Author: Delicious Brains
7
- Version: 0.9.2
8
  Author URI: http://deliciousbrains.com
9
  Network: True
10
  Text Domain: wp-migrate-db
@@ -22,7 +22,7 @@ Domain Path: /languages/
22
  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23
  // **********************************************************************
24
 
25
- $GLOBALS['wpmdb_meta']['wp-migrate-db']['version'] = '0.9.2';
26
 
27
  if ( ! class_exists( 'WPMDB_Utils' ) ) {
28
  require dirname( __FILE__ ) . '/class/wpmdb-utils.php';
@@ -57,9 +57,14 @@ function wp_migrate_db() {
57
  require_once $abspath . '/class/wpmdb-replace.php';
58
  require_once $abspath . '/class/wpmdb-migration-state.php';
59
  require_once $abspath . '/class/wpmdb-sanitize.php';
 
 
60
 
61
  $wpmdb = new WPMDB( __FILE__ );
62
 
 
 
 
63
  return $wpmdb;
64
  }
65
 
@@ -95,3 +100,7 @@ function wpmdb_cli() {
95
  }
96
 
97
  add_action( 'activated_plugin', array( 'WPMDB_Utils', 'deactivate_other_instances' ) );
 
 
 
 
4
  Plugin URI: http://wordpress.org/plugins/wp-migrate-db/
5
  Description: Exports your database as a MySQL data dump (much like phpMyAdmin), does a find and replace on URLs and file paths, then allows you to save it to your computer.
6
  Author: Delicious Brains
7
+ Version: 1.0
8
  Author URI: http://deliciousbrains.com
9
  Network: True
10
  Text Domain: wp-migrate-db
22
  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23
  // **********************************************************************
24
 
25
+ $GLOBALS['wpmdb_meta']['wp-migrate-db']['version'] = '1.0';
26
 
27
  if ( ! class_exists( 'WPMDB_Utils' ) ) {
28
  require dirname( __FILE__ ) . '/class/wpmdb-utils.php';
57
  require_once $abspath . '/class/wpmdb-replace.php';
58
  require_once $abspath . '/class/wpmdb-migration-state.php';
59
  require_once $abspath . '/class/wpmdb-sanitize.php';
60
+ require_once $abspath . '/class/wpmdb-filesystem.php';
61
+ require_once $abspath . '/class/wpmdb-compatibility-plugin-manager.php';
62
 
63
  $wpmdb = new WPMDB( __FILE__ );
64
 
65
+ // Remove the compatibility plugin when the plugin is deactivated
66
+ register_deactivation_hook( __FILE__, 'wpmdb_remove_mu_plugin' );
67
+
68
  return $wpmdb;
69
  }
70
 
100
  }
101
 
102
  add_action( 'activated_plugin', array( 'WPMDB_Utils', 'deactivate_other_instances' ) );
103
+
104
+ function wpmdb_remove_mu_plugin(){
105
+ do_action( 'wp_migrate_db_remove_compatibility_plugin' );
106
+ }