Changeset 3378798
- Timestamp:
- 10/15/2025 10:23:28 AM (2 months ago)
- Location:
- tutor-lms-migration-tool
- Files:
-
- 60 added
- 24 edited
- 1 copied
-
tags/2.4.0 (copied) (copied from tutor-lms-migration-tool/trunk)
-
tags/2.4.0/assets/css/admin.css (modified) (56 diffs)
-
tags/2.4.0/assets/img/arrow-split.svg (added)
-
tags/2.4.0/assets/img/tutor-logo-new.svg (added)
-
tags/2.4.0/assets/img/woocommerce.svg (added)
-
tags/2.4.0/assets/js/admin.js (modified) (15 diffs)
-
tags/2.4.0/classes/Utils.php (modified) (1 diff)
-
tags/2.4.0/inc/Factories/SalesDataFactory.php (added)
-
tags/2.4.0/inc/Functions.php (modified) (2 diffs)
-
tags/2.4.0/inc/Init.php (modified) (2 diffs)
-
tags/2.4.0/inc/Interfaces/DataTransformer.php (added)
-
tags/2.4.0/inc/Interfaces/MigrationTemplate.php (added)
-
tags/2.4.0/inc/MigrationMapper.php (added)
-
tags/2.4.0/inc/MigrationTypes.php (modified) (1 diff)
-
tags/2.4.0/inc/SalesData (added)
-
tags/2.4.0/inc/SalesData/InitSalesMigration.php (added)
-
tags/2.4.0/inc/SalesData/JobHandler.php (added)
-
tags/2.4.0/inc/SalesData/MigrationHandler.php (added)
-
tags/2.4.0/inc/SalesData/WooToNative (added)
-
tags/2.4.0/inc/SalesData/WooToNative/Coupons (added)
-
tags/2.4.0/inc/SalesData/WooToNative/Coupons/Coupons.php (added)
-
tags/2.4.0/inc/SalesData/WooToNative/Customers (added)
-
tags/2.4.0/inc/SalesData/WooToNative/Customers/Customers.php (added)
-
tags/2.4.0/inc/SalesData/WooToNative/Helper.php (added)
-
tags/2.4.0/inc/SalesData/WooToNative/Orders (added)
-
tags/2.4.0/inc/SalesData/WooToNative/Orders/Earnings.php (added)
-
tags/2.4.0/inc/SalesData/WooToNative/Orders/Orders.php (added)
-
tags/2.4.0/inc/SalesData/WooToNative/Subscriptions (added)
-
tags/2.4.0/inc/SalesData/WooToNative/Subscriptions/Subscriptions.php (added)
-
tags/2.4.0/inc/SalesData/WooToNative/Subscriptions/Transformers (added)
-
tags/2.4.0/inc/SalesData/WooToNative/Subscriptions/Transformers/EnrollmentDataTransformer.php (added)
-
tags/2.4.0/inc/SalesData/WooToNative/Subscriptions/Transformers/OrderDataTransformer.php (added)
-
tags/2.4.0/inc/SalesData/WooToNative/Subscriptions/Transformers/PlanDataTransformer.php (added)
-
tags/2.4.0/inc/SalesData/WooToNative/Subscriptions/Transformers/SubscriptionDataTransformer.php (added)
-
tags/2.4.0/inc/SalesDataTypes.php (added)
-
tags/2.4.0/phpcs.xml.dist (added)
-
tags/2.4.0/readme.txt (modified) (9 diffs)
-
tags/2.4.0/tutor-lms-migration-tool.php (modified) (3 diffs)
-
tags/2.4.0/vendor/composer/autoload_classmap.php (modified) (2 diffs)
-
tags/2.4.0/vendor/composer/autoload_static.php (modified) (2 diffs)
-
tags/2.4.0/vendor/composer/installed.php (modified) (2 diffs)
-
tags/2.4.0/views/migration_ld.php (modified) (16 diffs)
-
tags/2.4.0/views/migration_wc.php (added)
-
trunk/assets/css/admin.css (modified) (56 diffs)
-
trunk/assets/img/arrow-split.svg (added)
-
trunk/assets/img/tutor-logo-new.svg (added)
-
trunk/assets/img/woocommerce.svg (added)
-
trunk/assets/js/admin.js (modified) (15 diffs)
-
trunk/classes/Utils.php (modified) (1 diff)
-
trunk/inc/Factories/SalesDataFactory.php (added)
-
trunk/inc/Functions.php (modified) (2 diffs)
-
trunk/inc/Init.php (modified) (2 diffs)
-
trunk/inc/Interfaces/DataTransformer.php (added)
-
trunk/inc/Interfaces/MigrationTemplate.php (added)
-
trunk/inc/MigrationMapper.php (added)
-
trunk/inc/MigrationTypes.php (modified) (1 diff)
-
trunk/inc/SalesData (added)
-
trunk/inc/SalesData/InitSalesMigration.php (added)
-
trunk/inc/SalesData/JobHandler.php (added)
-
trunk/inc/SalesData/MigrationHandler.php (added)
-
trunk/inc/SalesData/WooToNative (added)
-
trunk/inc/SalesData/WooToNative/Coupons (added)
-
trunk/inc/SalesData/WooToNative/Coupons/Coupons.php (added)
-
trunk/inc/SalesData/WooToNative/Customers (added)
-
trunk/inc/SalesData/WooToNative/Customers/Customers.php (added)
-
trunk/inc/SalesData/WooToNative/Helper.php (added)
-
trunk/inc/SalesData/WooToNative/Orders (added)
-
trunk/inc/SalesData/WooToNative/Orders/Earnings.php (added)
-
trunk/inc/SalesData/WooToNative/Orders/Orders.php (added)
-
trunk/inc/SalesData/WooToNative/Subscriptions (added)
-
trunk/inc/SalesData/WooToNative/Subscriptions/Subscriptions.php (added)
-
trunk/inc/SalesData/WooToNative/Subscriptions/Transformers (added)
-
trunk/inc/SalesData/WooToNative/Subscriptions/Transformers/EnrollmentDataTransformer.php (added)
-
trunk/inc/SalesData/WooToNative/Subscriptions/Transformers/OrderDataTransformer.php (added)
-
trunk/inc/SalesData/WooToNative/Subscriptions/Transformers/PlanDataTransformer.php (added)
-
trunk/inc/SalesData/WooToNative/Subscriptions/Transformers/SubscriptionDataTransformer.php (added)
-
trunk/inc/SalesDataTypes.php (added)
-
trunk/phpcs.xml.dist (added)
-
trunk/readme.txt (modified) (9 diffs)
-
trunk/tutor-lms-migration-tool.php (modified) (3 diffs)
-
trunk/vendor/composer/autoload_classmap.php (modified) (2 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/views/migration_ld.php (modified) (16 diffs)
-
trunk/views/migration_wc.php (added)
Legend:
- Unmodified
- Added
- Removed
-
tutor-lms-migration-tool/tags/2.4.0/assets/css/admin.css
r2997569 r3378798 1 .tutor-progress {1 .tutor-progress { 2 2 height: 4px; 3 3 width: 80%; 4 background: # E3E6EB;4 background: #e3e6eb; 5 5 border-radius: 30px; 6 6 position: relative; … … 8 8 margin-bottom: 25px; 9 9 } 10 .tutor-progress::before{ 10 11 .tutor-progress::before { 11 12 content: ''; 12 13 position: absolute; … … 17 18 transition: 300ms; 18 19 } 19 .lp-migration-singlebox { 20 21 .lp-migration-singlebox, 22 .wc-migration-singlebox { 20 23 display: grid; 21 24 grid-template-columns: 3% 80%; … … 23 26 grid-gap: 15px; 24 27 } 28 29 .wc-migration-singlebox { 30 min-height: auto; 31 } 32 25 33 /* css spinner */ 26 34 .backup-now-btn { … … 33 41 cursor: pointer; 34 42 } 43 35 44 .backup-now-btn:not(:disabled):hover { 36 45 color: var(--tutor-color-primary); 37 46 } 38 .backup-now-btn:disabled { 47 48 .backup-now-btn:disabled { 39 49 color: #86878a; 40 50 } 51 41 52 .j-spinner { 42 53 --spinner-size: 22px; … … 51 62 box-sizing: border-box; 52 63 animation: none; 53 background: # CDCFD5;64 background: #cdcfd5; 54 65 background-size: 55%; 55 66 background-position: 5px 7px; 56 67 background-repeat: no-repeat; 57 68 background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='9'%3E%3Cpath fill='%23FFF' fill-rule='evenodd' d='M4.571 8.8L0 4.569l1.28-1.184 3.291 3.046L11.52 0l1.28 1.185z'/%3E%3C/svg%3E"); 58 59 } 60 .j-spinner.tmtl_done {69 } 70 71 .j-spinner.tmtl_done { 61 72 border: none; 62 73 animation: none; … … 66 77 background-repeat: no-repeat; 67 78 background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='9'%3E%3Cpath fill='%23FFF' fill-rule='evenodd' d='M4.571 8.8L0 4.569l1.28-1.184 3.291 3.046L11.52 0l1.28 1.185z'/%3E%3C/svg%3E"); 68 69 } 70 .j-spinner.tmtl_spin {79 } 80 81 .j-spinner.tmtl_spin { 71 82 border: none; 72 83 background-color: transparent; … … 75 86 background-repeat: no-repeat; 76 87 background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='22 22 44 44'%3E%3Ccircle class='background' cx='44' cy='44' r='19' fill='none' stroke-width='6' stroke='%23dddddd'%3E%3C/circle%3E%3Ccircle class='spinner-circle-dash' cx='44' cy='44' r='19' fill='none' stroke-width='6' stroke='%23007cba' stroke-dasharray='119.38052083641213' stroke-dashoffset='-80'%3E%3C/circle%3E%3C/svg%3E"); 77 animation: spinner-circle-rotate .4s linear infinite;78 79 } 88 animation: spinner-circle-rotate 0.4s linear infinite; 89 } 90 80 91 @-webkit-keyframes spinner-circle-rotate { 81 92 100% { … … 83 94 } 84 95 } 96 85 97 .lp-migration-checkbox label:not(:first-child) .lp-migration-singlebox { 86 98 margin-top: 20px; 87 99 } 88 .lp-migration-singlebox-checkbox{ 100 101 .lp-migration-singlebox-checkbox { 89 102 position: relative; 90 103 margin-top: 3px; 91 104 } 92 .lp-migration-singlebox-checkbox input{ 105 106 .lp-migration-singlebox-checkbox input { 93 107 position: absolute; 94 108 right: -20px; … … 96 110 cursor: pointer; 97 111 } 98 .lp-migration-singlebox-checkbox .checkmark{ 112 113 .lp-migration-singlebox-checkbox .checkmark { 99 114 position: absolute; 100 115 top: 0; … … 102 117 width: 24px; 103 118 height: 24px; 104 background:#EFEFEF; 105 } 106 .lp-migration-singlebox-checkbox .checkmark:after{ 107 content: ""; 119 background: #efefef; 120 } 121 122 .lp-migration-singlebox-checkbox .checkmark:after { 123 content: ''; 108 124 position: absolute; 109 125 display: none; 110 126 } 111 .lp-migration-singlebox-checkbox .checkmark:after{ 127 128 .lp-migration-singlebox-checkbox .checkmark:after { 112 129 top: 3px; 113 130 left: 8px; … … 119 136 transform: rotate(45deg); 120 137 } 121 .lp-migration-singlebox-checkbox input:checked ~ .checkmark:after{ 138 139 .lp-migration-singlebox-checkbox input:checked~.checkmark:after { 122 140 display: block; 123 141 } 124 .lp-migration-singlebox-checkbox input:checked ~ .checkmark{ 125 background:#0352CC; 126 } 142 143 .lp-migration-singlebox-checkbox input:checked~.checkmark { 144 background: #0352cc; 145 } 146 127 147 /* migration-modal */ 128 148 .lp-migration-modal-wrap { 129 149 position: fixed; 130 background: rgba(0, 0,0, 0.5);150 background: rgba(0, 0, 0, 0.5); 131 151 top: 0; 132 152 bottom: 0; … … 136 156 z-index: 9999; 137 157 } 158 138 159 .lp-migration-modal { 139 160 max-width: 730px; … … 144 165 transform: translate(-50%, -50%); 145 166 } 167 146 168 .lp-migration-modal-wrap.active { 147 169 display: block; … … 149 171 150 172 .lp-migration-alert { 151 background: # FFFFFF;152 border: 1px solid # E0E2EA;173 background: #ffffff; 174 border: 1px solid #e0e2ea; 153 175 box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.05); 154 176 border-radius: 6px; 155 177 min-width: 350px; 156 178 } 157 @media (min-width : 576px) { 179 180 @media (min-width: 576px) { 158 181 .lp-migration-alert { 159 182 width: 600px; 160 183 } 161 184 } 185 162 186 .migration-failed-btn:last-child { 163 187 margin-left: 30px; 164 188 } 189 165 190 .lp-migration-modal-icon img { 166 191 width: 80px; 167 192 } 193 168 194 .modal-close { 169 195 position: absolute; … … 177 203 align-items: center; 178 204 } 205 179 206 .modal-close-line { 180 207 position: absolute; … … 182 209 height: 20px; 183 210 top: 22px; 184 background: #9CA0AC; 185 } 211 background: #9ca0ac; 212 } 213 186 214 .modal-close-line.error-close-line-one, 187 215 .modal-close-line.success-close-line-one, 188 .modal-close-line.migration-modal-close-line-one {216 .modal-close-line.migration-modal-close-line-one { 189 217 transform: rotate(42deg); 190 218 } 219 191 220 .modal-close-line.error-close-line-two, 192 221 .modal-close-line.success-close-line-two, 193 .modal-close-line.migration-modal-close-line-two {222 .modal-close-line.migration-modal-close-line-two { 194 223 transform: rotate(134deg); 195 224 } 225 196 226 .lp-modal-alert { 197 227 background-color: white; … … 203 233 position: relative; 204 234 } 235 205 236 .lp-modal-alert .lp-modal-icon { 206 237 border-radius: 50%; … … 212 243 width: 80px; 213 244 } 245 214 246 .lp-modal-alert .lp-modal-icon.lp-modal-error:after, 215 247 .lp-modal-alert .lp-modal-icon.lp-modal-error:before { … … 221 253 width: 60px; 222 254 } 255 223 256 .lp-modal-alert .lp-modal-icon.lp-modal-error:before { 224 257 border-radius: 120px 0 0 120px; … … 228 261 transform: rotate(-45deg); 229 262 } 263 230 264 .lp-modal-alert .lp-modal-icon.lp-modal-error:after { 231 265 border-radius: 0 120px 120px 0; … … 235 269 transform: rotate(-45deg); 236 270 } 271 237 272 .lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-placeholder { 238 273 border-radius: 50%; … … 246 281 z-index: 2; 247 282 } 283 248 284 .lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-fix { 249 285 background-color: #fff; … … 256 292 z-index: 1; 257 293 } 294 258 295 .lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line { 259 background-color: # A5DC86;296 background-color: #a5dc86; 260 297 border-radius: 2px; 261 298 display: block; … … 264 301 z-index: 2; 265 302 } 303 266 304 .lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line.lp-modal-tip { 267 305 left: 14px; … … 270 308 width: 25px; 271 309 } 310 272 311 .lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line.lp-modal-long { 273 312 right: 8px; … … 276 315 width: 47px; 277 316 } 317 278 318 .lp-modal-alert .lp-modal-icon.lp-modal-error { 279 border-color: #F27474; 280 } 319 border-color: #f27474; 320 } 321 281 322 .lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-x-mark { 282 323 display: block; … … 284 325 z-index: 2; 285 326 } 327 286 328 .lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-placeholder { 287 border: 4px solid #FF2624; 288 } 329 border: 4px solid #ff2624; 330 } 331 289 332 .lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line { 290 background-color: # FF2624;333 background-color: #ff2624; 291 334 top: 37px; 292 335 width: 47px; 293 336 } 337 294 338 .lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line.lp-modal-left { 295 339 left: 17px; 296 340 transform: rotate(45deg); 297 341 } 342 298 343 .lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line.lp-modal-right { 299 344 right: 16px; 300 345 transform: rotate(-45deg); 301 346 } 347 302 348 .lp-modal-icon.lp-modal-error.animate:after { 303 349 animation: rotatePlaceholder 4.25s ease-in; 304 350 } 351 305 352 .animateXLeft { 306 animation: animateXLeft .75s; 307 } 353 animation: animateXLeft 0.75s; 354 } 355 308 356 .animateXRight { 309 animation: animateXRight .75s; 310 } 357 animation: animateXRight 0.75s; 358 } 359 311 360 @keyframes rotatePlaceholder { 312 0%,5% { 361 362 0%, 363 5% { 313 364 transform: rotate(-45deg); 314 365 } 315 100%,12% { 366 367 100%, 368 12% { 316 369 transform: rotate(-405deg); 317 370 } 318 371 } 372 319 373 @keyframes animateXLeft { 374 320 375 0%, 321 376 65% { … … 324 379 width: 0; 325 380 } 381 326 382 84% { 327 383 left: 14px; … … 329 385 width: 47px; 330 386 } 387 331 388 100% { 332 389 left: 17px; … … 335 392 } 336 393 } 394 337 395 @keyframes animateXRight { 396 338 397 0%, 339 398 65% { … … 342 401 width: 0; 343 402 } 403 344 404 84% { 345 405 right: 14px; … … 347 407 width: 47px; 348 408 } 409 349 410 100% { 350 411 right: 16px; … … 353 414 } 354 415 } 416 355 417 /* modal success */ 356 .lp-success-modal ,418 .lp-success-modal, 357 419 .lp-error-modal { 358 420 position: fixed; … … 362 424 display: none; 363 425 z-index: 999999; 364 background: rgba(0, 0,0, 0.3);426 background: rgba(0, 0, 0, 0.3); 365 427 width: 100%; 366 428 height: 100%; 367 429 } 430 368 431 .lp-error-modal.active, 369 432 .lp-success-modal.active { … … 372 435 align-items: center; 373 436 } 437 374 438 .lp-modal-alert { 375 439 background-color: #fff; … … 377 441 border-radius: 4px; 378 442 } 443 379 444 .lp-modal-alert .lp-modal-icon { 380 445 border-radius: 50%; … … 388 453 } 389 454 390 .lp-modal-alert .lp-modal-icon.lp-modal-success{ 391 border-color: #A5DC86; 392 } 455 .lp-modal-alert .lp-modal-icon.lp-modal-success { 456 border-color: #a5dc86; 457 } 458 393 459 .lp-modal-alert .lp-modal-icon.lp-modal-success:after, 394 .lp-modal-alert .lp-modal-icon.lp-modal-success:before {460 .lp-modal-alert .lp-modal-icon.lp-modal-success:before { 395 461 background: #fff; 396 462 content: ''; … … 401 467 width: 60px; 402 468 } 403 .lp-modal-alert .lp-modal-icon.lp-modal-success:before{ 469 470 .lp-modal-alert .lp-modal-icon.lp-modal-success:before { 404 471 border-radius: 120px 0 0 120px; 405 472 left: -33px; … … 408 475 transform: rotate(-45deg); 409 476 } 410 .lp-modal-alert .lp-modal-icon.lp-modal-success:after{ 477 478 .lp-modal-alert .lp-modal-icon.lp-modal-success:after { 411 479 border-radius: 0 120px 120px 0; 412 480 left: 30px; … … 415 483 transform: rotate(-45deg); 416 484 } 417 .lp-modal-alert .lp-modal-icon.lp-modal-success .lp-modal-placeholder{ 485 486 .lp-modal-alert .lp-modal-icon.lp-modal-success .lp-modal-placeholder { 418 487 border-radius: 50%; 419 border: 4px solid #24 A148;488 border: 4px solid #24a148; 420 489 box-sizing: content-box; 421 490 height: 80px; … … 426 495 z-index: 2; 427 496 } 428 .lp-modal-alert .lp-modal-icon.lp-modal-success .lp-modal-fix{ 497 498 .lp-modal-alert .lp-modal-icon.lp-modal-success .lp-modal-fix { 429 499 background-color: #fff; 430 500 height: 90px; … … 436 506 z-index: 1; 437 507 } 438 .lp-modal-alert .lp-modal-icon.lp-modal-success .lp-modal-line{ 439 background-color: #24A148; 508 509 .lp-modal-alert .lp-modal-icon.lp-modal-success .lp-modal-line { 510 background-color: #24a148; 440 511 border-radius: 2px; 441 512 display: block; … … 444 515 z-index: 2; 445 516 } 446 .lp-modal-alert .lp-modal-icon.lp-modal-success .lp-modal-line.lp-modal-tip{ 517 518 .lp-modal-alert .lp-modal-icon.lp-modal-success .lp-modal-line.lp-modal-tip { 447 519 left: 14px; 448 520 top: 46px; … … 450 522 width: 25px; 451 523 } 452 .lp-modal-alert .lp-modal-icon.lp-modal-success .lp-modal-line.lp-modal-long{ 524 525 .lp-modal-alert .lp-modal-icon.lp-modal-success .lp-modal-line.lp-modal-long { 453 526 right: 8px; 454 527 top: 38px; … … 456 529 width: 47px; 457 530 } 531 458 532 .lp-modal-alert .lp-modal-icon.lp-modal-warning:after { 459 533 background-color: #fff; … … 466 540 z-index: 1; 467 541 } 542 468 543 .animateSuccessTip { 469 animation: animateSuccessTip .75s; 470 } 544 animation: animateSuccessTip 0.75s; 545 } 546 471 547 .animateSuccessLong { 472 animation: animateSuccessLong .75s; 473 } 548 animation: animateSuccessLong 0.75s; 549 } 550 474 551 .lp-modal-icon.lp-modal-success.animate:after { 475 552 animation: rotatePlaceholder 4.25s ease-in; 476 553 } 554 477 555 @keyframes animateSuccessTip { 478 0%,54% { 556 557 0%, 558 54% { 479 559 width: 0; 480 560 left: 1px; 481 561 top: 19px; 482 562 } 563 483 564 70% { 484 565 width: 50px; … … 486 567 top: 37px; 487 568 } 569 488 570 84% { 489 571 width: 17px; … … 491 573 top: 48px; 492 574 } 575 493 576 100% { 494 577 width: 25px; … … 497 580 } 498 581 } 582 499 583 @keyframes animateSuccessLong { 500 0%,65% { 584 585 0%, 586 65% { 501 587 width: 0; 502 588 right: 46px; 503 589 top: 54px; 504 590 } 591 505 592 84% { 506 593 width: 55px; … … 508 595 top: 35px; 509 596 } 597 510 598 100% { 511 599 width: 47px; … … 514 602 } 515 603 } 604 516 605 @keyframes rotatePlaceholder { 517 0%,5% { 606 607 0%, 608 5% { 518 609 -webkit-transform: rotate(-45deg); 519 610 transform: rotate(-45deg); 520 611 } 521 100%,12% { 612 613 100%, 614 12% { 522 615 -webkit-transform: rotate(-405deg); 523 616 transform: rotate(-405deg); 524 617 } 525 618 } 619 526 620 .tutor-install-notice { 527 padding: 20px; 528 display: block 529 } 621 padding: 20px; 622 display: block; 623 } 624 530 625 .tutor-install-notice .tutor-install-notice-inner { 531 min-height: 64px 532 } 626 min-height: 64px; 627 } 628 533 629 .notice.notice-error.tutor-install-notice .tutor-install-notice-icon { 534 float: left; 535 width: 65px 536 } 630 float: left; 631 width: 65px; 632 } 633 537 634 .tutor-install-notice-button { 538 float: right 539 } 635 float: right; 636 } 637 540 638 .tutor-install-notice-icon img { 541 width: 64px; 542 border-radius: 4px; 543 display: block 544 } 639 width: 64px; 640 border-radius: 4px; 641 display: block; 642 } 643 545 644 .tutor-install-notice-content { 546 flex-grow: 1; 547 padding-left: 20px; 548 padding-right: 20px; 549 display: inline-block 550 } 645 flex-grow: 1; 646 padding-left: 20px; 647 padding-right: 20px; 648 display: inline-block; 649 } 650 551 651 .tutor-install-notice-button .button { 552 padding: 6px 30px; 553 height: auto; 554 line-height: 20px; 555 text-transform: capitalize 556 } 652 padding: 6px 30px; 653 height: auto; 654 line-height: 20px; 655 text-transform: capitalize; 656 } 657 557 658 .tutor-install-notice-button { 558 margin-top: 14px 559 } 560 561 562 .tutor-migration-upload-area { 563 background-image: linear-gradient(to right, #E3E6EB 50%, rgba(255, 255, 255, 0) 0%), linear-gradient(#E3E6EB 49%, rgba(255, 255, 255, 0) 0%), linear-gradient(to right, #E3E6EB 50%, rgba(255, 255, 255, 0) 0%), linear-gradient(#E3E6EB 50%, rgba(255, 255, 255, 0) 0%); 659 margin-top: 14px; 660 } 661 662 .tutor-migration-upload-area { 663 background-image: linear-gradient(to right, #e3e6eb 50%, rgba(255, 255, 255, 0) 0%), 664 linear-gradient(#e3e6eb 49%, rgba(255, 255, 255, 0) 0%), 665 linear-gradient(to right, #e3e6eb 50%, rgba(255, 255, 255, 0) 0%), 666 linear-gradient(#e3e6eb 50%, rgba(255, 255, 255, 0) 0%); 564 667 background-position: top, right, bottom, left; 565 668 background-repeat: repeat-x, repeat-y; … … 568 671 border-radius: 6px; 569 672 text-align: center; 570 571 } 673 } 674 572 675 .tutor-migration-upload-area { 573 676 border-radius: 6px; … … 578 681 margin: 0 auto; 579 682 } 683 580 684 .tutor-migration-upload-area .tutor-migration-upload-circle { 581 685 width: 80px; 582 686 height: 80px; 583 background: # E9EDFB;687 background: #e9edfb; 584 688 border-radius: 50%; 585 689 } 690 586 691 .tutor-migration-upload-area span.file_name { 587 692 display: block; 588 693 margin-top: 10px; 589 694 } 695 590 696 .tutor-migration-upload-area button { 591 697 color: white; 592 698 display: inline-block; 593 699 } 700 594 701 .tutor-migration-upload-area.dragover { 595 background-image: linear-gradient(to right, var(--tutor-color-primary) 50%, rgba(255, 255, 255, 0) 0%),linear-gradient(var(--tutor-color-primary) 49%, rgba(255, 255, 255, 0) 0%),linear-gradient(to right, var(--tutor-color-primary) 50%, rgba(255, 255, 255, 0) 0%),linear-gradient(var(--tutor-color-primary) 50%, rgba(255, 255, 255, 0) 0%); 596 } 702 background-image: linear-gradient(to right, var(--tutor-color-primary) 50%, rgba(255, 255, 255, 0) 0%), 703 linear-gradient(var(--tutor-color-primary) 49%, rgba(255, 255, 255, 0) 0%), 704 linear-gradient(to right, var(--tutor-color-primary) 50%, rgba(255, 255, 255, 0) 0%), 705 linear-gradient(var(--tutor-color-primary) 50%, rgba(255, 255, 255, 0) 0%); 706 } 707 597 708 .tutor-migration-top { 598 709 display: grid; … … 601 712 border-radius: 6px 6px 0px 0px; 602 713 } 714 603 715 .tutor-migration-top-subtitle { 604 color: #5B616F; 605 } 716 color: #5b616f; 717 } 718 606 719 .tutor-migration-page #tutor-migration-wrapper #tutor-auto-migrate-tab { 607 720 border-radius: 0px 0px 6px 6px; 608 721 } 722 609 723 .tutor-migration-page #tutor-migration-wrapper { 610 724 background-color: #f0f0f1; … … 612 726 overflow: hidden; 613 727 } 728 614 729 #tutor-migration-wrapper .tutor-nav { 615 730 padding: 0px 48px 0px 48px; 616 731 } 732 617 733 #tutor-migration-wrapper .tutor-nav .tutor-nav-item.is-active { 618 background: # F4F6F9;734 background: #f4f6f9; 619 735 border-radius: 6px 6px 0px 0px; 620 736 border-color: transparent; 621 737 } 738 622 739 #tutor-migration-wrapper .tutor-nav .tutor-nav-item .tutor-nav-link { 623 740 border: 1px solid transparent; 624 741 color: var(--tutor-body-color); 625 color: #757C8E; 626 } 742 color: #757c8e; 743 padding-block: 10px; 744 } 745 627 746 #tutor-migration-wrapper .tutor-nav .tutor-nav-item .tutor-nav-link.is-active { 628 border: 1px solid # CDCFD5;747 border: 1px solid #e0e2ea; 629 748 color: var(--tutor-body-color) !important; 630 749 } 750 631 751 .backup-now-subtile { 632 color: #5B616F; 633 } 634 .tutor-nav:not(.tutor-nav-pills):not(.tutor-nav-tabs) .tutor-nav-link.is-active { 752 color: #5b616f; 753 } 754 755 .tutor-migration-tab>.tutor-nav:not(.tutor-nav-pills):not(.tutor-nav-tabs) .tutor-nav-link.is-active { 635 756 border-bottom-color: #F4F6F9; 636 757 border-width: 3px 3px 3px 4px; 637 background: # F4F6F9;758 background: #f4f6f9; 638 759 border-radius: 6px 6px 0px 0px; 639 760 border-color: transparent; 640 761 } 762 641 763 #tutor-migration-wrapper .tutor-nav:not(.tutor-nav-pills):not(.tutor-nav-tabs) .tutor-nav-link.is-active { 642 764 border-bottom-color: transparent; 643 765 } 766 644 767 .tutor-tab-item-wrap { 645 background: #F4F6F9; 646 } 768 background: #f4f6f9; 769 } 770 647 771 .tutor-migration-history { 648 772 background: #f0f0f1; 649 773 } 774 650 775 .tutor-migration-history-heading { 651 776 background: #f0f0f1; 652 color: #5B616F; 653 } 777 color: #5b616f; 778 } 779 654 780 .tutor-migration-history-time { 655 color: #41454F; 656 } 781 color: #41454f; 782 } 783 657 784 .tutor-migration-area { 658 border: 1px solid # E0E2EA;785 border: 1px solid #e0e2ea; 659 786 box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.05); 660 787 border-radius: 6px; 661 788 } 789 662 790 .tutor-migration-tab, 663 791 .tutor-migration-tab-item { 792 --tutor-border-color: #e0e2ea; 793 664 794 background-color: #fff; 665 795 } 796 666 797 .tutor-migration-tab-item { 667 798 border-radius: 0px 0px 6px 6px; 668 799 } 669 #tutor-migration-browse-file-link a{ 800 801 #tutor-migration-browse-file-link a { 670 802 text-decoration: underline; 671 803 } 804 672 805 span.tutor-icon-brand-lifter:before { 673 content: "\e962"; 674 } 675 @media (max-width: 991px) { 806 content: '\e962'; 807 } 808 809 .tutor-migration-tab .tutor-nav-link.disabled { 810 cursor: not-allowed; 811 opacity: 0.5; 812 pointer-events: none; 813 } 814 815 .migration-complete-report { 816 display: flex; 817 flex-direction: column; 818 align-items: center; 819 justify-content: center; 820 gap: 20px; 821 margin-bottom: 28px; 822 } 823 824 .migration-complete-report .migration-complete-report-item-wrapper { 825 border-radius: 6px; 826 background-color: #F6F8FD; 827 align-items: flex-start; 828 } 829 830 .migration-complete-report .migration-complete-report-item-wrapper { 831 width: 500px; 832 } 833 834 .migration-complete-report .migration-complete-report-item { 835 display: flex; 836 flex-direction: row; 837 align-items: center; 838 justify-content: flex-start; 839 gap: 10px; 840 padding: 12px 16px; 841 border-radius: 6px; 842 background-color: #F6F8FD; 843 } 844 845 .migration-complete-report .migration-complete-report-item [data-report-details-toggle] { 846 cursor: pointer; 847 display: flex; 848 align-self: center; 849 justify-content: center; 850 } 851 852 .migration-complete-report .migration-complete-report-item .migration-complete-report-icon { 853 display: flex; 854 align-self: center; 855 } 856 857 .migration-complete-report .migration-complete-report-item .migration-complete-report-icon[data-icon="check-filled-white"] { 858 color: #00C57A; 859 } 860 861 .migration-complete-report .migration-complete-report-item .migration-complete-report-icon[data-icon="cross-circle"] { 862 color: #F7393B; 863 } 864 865 .migration-complete-report .migration-complete-report-item .migration-complete-report-text { 866 display: flex; 867 flex-direction: column; 868 gap: 8px; 869 align-items: flex-start; 870 } 871 872 .migration-complete-report .migration-complete-report-with-action { 873 width: 100%; 874 display: flex; 875 flex-direction: row; 876 justify-content: space-between; 877 } 878 879 .migration-complete-report .migration-complete-report-details { 880 display: flex; 881 flex-direction: column; 882 gap: 8px; 883 padding: 0px 16px 16px 16px; 884 max-height: 300px; 885 overflow-y: auto; 886 } 887 888 .migration-complete-report .migration-complete-report-details .migration-complete-report-details-item { 889 display: flex; 890 flex-direction: column; 891 gap: 8px; 892 text-align: left; 893 } 894 895 .migration-complete-report .migration-complete-report-details .migration-complete-report-details-title { 896 color: #5b616f; 897 font-size: 12px; 898 font-weight: 500; 899 } 900 901 .migration-complete-report .migration-complete-report-details .migration-complete-report-details-ids { 902 display: flex; 903 flex-direction: row; 904 flex-wrap: wrap; 905 gap: 8px; 906 } 907 908 .migration-complete-report .migration-complete-report-details .migration-complete-report-details-ids .migration-complete-report-details-ids-item { 909 color: #5b616f; 910 font-size: 12px; 911 font-weight: 500; 912 padding: 4px 8px; 913 border-radius: 4px; 914 background-color: white; 915 } 916 917 .tutor-wc-migration-history-row { 918 .tutor-btn { 919 opacity: 0; 920 float: right; 921 transition: opacity 0.2s ease; 922 } 923 924 &:hover .tutor-btn, 925 .tutor-btn.is-loading { 926 opacity: 1; 927 } 928 } 929 930 @media (max-width: 991px) { 676 931 #tutor-migration-wrapper .migrate-now-btn-wrapper { 677 932 margin-top: 20px; 678 justify-content : flex-start !important; 679 } 933 justify-content: flex-start !important; 934 } 935 680 936 .lp-migration-alert { 681 grid-template-columns : unset;682 } 683 } 937 grid-template-columns: unset; 938 } 939 } -
tutor-lms-migration-tool/tags/2.4.0/assets/js/admin.js
r3327915 r3378798 1 const { __ } = wp.i18n; 2 1 3 jQuery(document).ready(function ($) { 2 4 'use strict'; 3 const { __} = wp.i18n;5 const { __ } = wp.i18n; 4 6 $(document).on("click", ".install-tutor-button", function (t) { 5 7 t.preventDefault(); … … 62 64 var $that = $(this); 63 65 var $formData = $(this).serialize() + '&action=' + $that.attr('action'); 64 65 66 66 67 let final_types = 'lp'; … … 69 70 migration_vendor = 'ld'; 70 71 } 71 if ($that.attr('action') == 'lif_migrate_all_data_to_tutor') {72 if ($that.attr('action') == 'lif_migrate_all_data_to_tutor') { 72 73 final_types = 'lif'; 73 74 migration_vendor = 'lif'; … … 172 173 clearTimeout(checkProgress); 173 174 clearTimeout(countProgress); 174 $.post(ajaxurl, { 175 migration_type : 'Imported',176 migration_vendor : migration_vendor,175 $.post(ajaxurl, { 176 migration_type: 'Imported', 177 migration_vendor: migration_vendor, 177 178 action: 'insert_tutor_migration_data' 178 179 }); … … 180 181 181 182 const res = data.data; 182 const { total_course_count = 0, failed = [] } = res || {};183 183 const { total_course_count = 0, failed = [] } = res || {}; 184 184 185 if (Number(total_course_count) > 0) { 185 186 if (failed.length > 0) { … … 189 190 } 190 191 } else { 191 $('.lp-error-modal').addClass('active');192 $('.lp-error-modal').addClass('active'); 192 193 } 193 194 }, … … 221 222 removeItem.removeClass('active'); 222 223 } 224 223 225 // migrate now button click 224 226 $(migrateBtn).on('click', function (event) { … … 228 230 } 229 231 }); 230 232 231 233 // migrate now button click 232 234 $(migrateStartBtn).on('click', function (event) { 233 235 event.preventDefault(); 236 $('#wc-sales-data-migration-form').submit(); 234 237 if (totalItemsMigrateCounts > 0) { 235 238 migrationModal.removeClass('active'); … … 272 275 var manualMigrateNowBtn = $('#manual-migrate-now-btn'); 273 276 274 $(document).on('click', '#tutor-migration-browse-file-link a', function (event) {277 $(document).on('click', '#tutor-migration-browse-file-link a', function (event) { 275 278 event.preventDefault(); 276 279 $('#tutor-migration-browse-file').click(); 277 280 }); 278 281 var dropZone = $('.tutor-migration-drag-drop-zone'); 279 $(document).on('change', '#tutor-migration-browse-file', function (event){282 $(document).on('change', '#tutor-migration-browse-file', function (event) { 280 283 var inputEl = $('#tutor-migration-browse-file'); 281 if (this.files[0]) {284 if (this.files[0]) { 282 285 manualMigrateNowBtn.removeAttr('disabled'); 283 286 getFilesAndUpdateDOM(this.files[0], inputEl); … … 289 292 var getFilesAndUpdateDOM = (files, inputEl) => { 290 293 if (files) { 291 inputEl.files = files;292 dropZone.addClass('file-attached');293 dropZone.find('.file-info').html(`File attached - ${files.name}`);294 inputEl.files = files; 295 dropZone.addClass('file-attached'); 296 dropZone.find('.file-info').html(`File attached - ${files.name}`); 294 297 } else { 295 dropZone.removeClass('file-attached');296 dropZone.find('.file-info').html('');298 dropZone.removeClass('file-attached'); 299 dropZone.find('.file-info').html(''); 297 300 } 298 301 }; 299 302 300 $(document).on('click', '.backup-now-btn', function (event) {303 $(document).on('click', '.backup-now-btn', function (event) { 301 304 event.preventDefault(); 302 305 let button = $(this); 303 306 let form = button.closest('form#tutor_migration_export_form'); 304 305 $.post(ajaxurl, { 306 migration_type : 'Exported',307 migration_vendor : form.children("#tutor_migration_vendor").val(),307 308 $.post(ajaxurl, { 309 migration_type: 'Exported', 310 migration_vendor: form.children("#tutor_migration_vendor").val(), 308 311 action: 'insert_tutor_migration_data' 309 312 }); … … 311 314 }) 312 315 313 $(document).on('click', '#manual-migrate-now-btn', function (event) {316 $(document).on('click', '#manual-migrate-now-btn', function (event) { 314 317 let button = $(this); 315 318 var fileType = $('input[name="tutor_import_file"]')[0].files[0].type; 316 if (fileType != 'text/xml') {319 if (fileType != 'text/xml') { 317 320 alert('Not supported file. Upload xml file here!'); 318 321 return; … … 320 323 var action_name = $('#tutor-manual-migrate-form input[name="tutor_action"]').val(); 321 324 let tutor_nonce = $("#tutor-manual-migrate-form input[name='_tutor_nonce']").val(); 322 let http_referer = $("#tutor-manual-migrate-form input[name='_wp_http_referer']").val();323 325 let http_referer = $("#tutor-manual-migrate-form input[name='_wp_http_referer']").val(); 326 324 327 var formData = new FormData(); 325 328 formData.append("tutor_import_file", $('input[name="tutor_import_file"]')[0].files[0]); … … 337 340 }, 338 341 success: function (res) { 339 console.log(res);340 342 if (res.success) { 341 343 $('.lp-success-modal').addClass('active'); 342 $.post(ajaxurl, { 343 migration_type : 'Imported',344 migration_vendor : $('#tutor_migration_vendor').val(),344 $.post(ajaxurl, { 345 migration_type: 'Imported', 346 migration_vendor: $('#tutor_migration_vendor').val(), 345 347 action: 'insert_tutor_migration_data' 346 348 }); … … 356 358 }); 357 359 360 361 /** 362 * 363 * @param {string} addonBaseName 364 * @returns boolean 365 */ 366 367 function isAddonEnabled(addonBaseName) { 368 return !!window._tutorobject?.addons_data?.find( 369 (addon) => addon.base_name === addonBaseName && addon.is_enabled 370 ); 371 } 372 373 374 /** 375 * WooCommerce Migration Block 376 * 377 * @author Themeum <[email protected]> 378 * @link https://themeum.com 379 * @since 2.4.0 380 */ 381 382 // WooCommerce Migration Configuration 383 const WOO_CONFIG = { 384 TABS: { 385 CUSTOM: 'tutor-wc-custom-migrate-tab', 386 AUTO: 'tutor-wc-auto-migrate-tab' 387 }, 388 SELECTORS: { 389 migrationPage: '.tutor-migration-page', 390 migrateBtn: '.migrate-now-btn', 391 navLink: '.tutor-nav-link', 392 activeNavLink: '.tutor-nav-link.is-active', 393 form: '#wc-sales-data-migration-form' 394 }, 395 SECTION_MAP: { 396 orders: "#sectionOrders .j-spinner", 397 coupons: "#sectionCoupons .j-spinner", 398 subscriptions: "#sectionSubscriptions .j-spinner" 399 }, 400 CHECKBOX_CONFIGS: [ 401 { id: 'woo-orders', name: 'job_requirements[]', value: 'orders' }, 402 { id: 'woo-coupons', name: 'job_requirements[]', value: 'coupons' }, 403 { id: 'woo-subscriptions', name: 'job_requirements[]', value: 'subscriptions' } 404 ], 405 WOO_SUBSCRIPTIONS_ADDON_BASE_NAME: 'wc-subscriptions', 406 WOO_MIGRATION_SUCCESS_TITLE: '[data-woo-migration-success-title]', 407 WOO_MIGRATION_SUCCESS_DESC: '[data-woo-migration-success-desc]', 408 WOO_REPORT_ITEMS: { 409 SUCCESS: '[data-woo-migration-report-item="success"]', 410 FAILED: '[data-woo-migration-report-item="failed"]', 411 }, 412 WOO_REPORT_DESCRIPTIONS: { 413 SUCCESS: '[data-woo-migration-report="success"]', 414 FAILED: '[data-woo-migration-report="failed"]', 415 }, 416 WOO_REPORT_DETAILS: '.migration-complete-report-details', 417 WOO_REPORT_DETAILS_TOGGLE: '[data-report-details-toggle]', 418 }; 419 420 const $wooMigrationPage = $(WOO_CONFIG.SELECTORS.migrationPage); 421 const $wooMigrateBtn = $wooMigrationPage.find(WOO_CONFIG.SELECTORS.migrateBtn); 422 const $wooCheckboxes = $wooMigrationPage.find(`#${WOO_CONFIG.TABS.CUSTOM} input[type="checkbox"]`); 423 424 // Store original checkbox state 425 let wooOriginalCheckboxes = []; 426 427 function getWooActiveTab() { 428 return $wooMigrationPage.find(WOO_CONFIG.SELECTORS.activeNavLink).data('tutorNavTarget'); 429 } 430 431 function toggleWooMigrateBtn() { 432 setTimeout(function () { 433 const isCustomTab = getWooActiveTab() === WOO_CONFIG.TABS.CUSTOM; 434 const shouldDisable = isCustomTab && !$wooCheckboxes.is(':checked'); 435 $wooMigrateBtn.prop('disabled', shouldDisable); 436 }, 0); 437 } 438 439 function toggleWooSpinners(tab, mode) { 440 $(`#${tab}`).find('span.j-spinner').each(function () { 441 const $spinner = $(this); 442 $spinner.removeClass('tmtl_spin tmtl_done'); 443 444 if (mode === 'spin') { 445 $spinner.addClass('tmtl_spin'); 446 } else if (mode === 'done') { 447 $spinner.addClass('tmtl_done'); 448 } 449 }); 450 } 451 452 function storeWooCheckboxState() { 453 const $checkboxes = $(`#${WOO_CONFIG.TABS.CUSTOM}`).find('input[type="checkbox"]'); 454 wooOriginalCheckboxes = []; 455 456 $checkboxes.each(function () { 457 const $checkbox = $(this); 458 wooOriginalCheckboxes.push({ 459 id: $checkbox.attr('id'), 460 name: $checkbox.attr('name'), 461 value: $checkbox.attr('value'), 462 class: $checkbox.attr('class'), 463 checked: $checkbox.is(':checked') 464 }); 465 }); 466 } 467 468 function replaceWooCheckboxesWithSpinners() { 469 storeWooCheckboxState(); 470 471 const $checkedCheckboxes = $(`#${WOO_CONFIG.TABS.CUSTOM}`).find('input[type="checkbox"]:checked'); 472 $checkedCheckboxes.each(function () { 473 const inputId = $(this).attr('id'); 474 $(this).replaceWith( 475 `<span id="spinner-${inputId}" class="j-spinner tmtl_spin" data-original-id="${inputId}"></span>` 476 ); 477 }); 478 const $uncheckedCheckboxes = $(`#${WOO_CONFIG.TABS.CUSTOM}`).find('input[type="checkbox"]:not(:checked)'); 479 $uncheckedCheckboxes.each(function () { 480 $(this).attr('disabled', 'disabled'); 481 }); 482 } 483 484 function revertWooCheckboxes() { 485 $(`#${WOO_CONFIG.TABS.CUSTOM}`).find('span.j-spinner').remove(); 486 $(`#${WOO_CONFIG.TABS.CUSTOM}`).find('input[type="checkbox"]:not(:checked):is([disabled])').remove(); 487 488 for (const config of WOO_CONFIG.CHECKBOX_CONFIGS) { 489 const checkboxHtml = ` 490 <input 491 id="${config.id}" 492 type="checkbox" 493 name="${config.name}" 494 value="${config.value}" 495 class="tutor-form-check-input lp-migration-singlebox-checkbox" 496 >`; 497 498 $(`label[for="${config.id}"]`) 499 .closest('.tutor-form-check') 500 .prepend(checkboxHtml); 501 }; 502 503 toggleWooMigrateBtn(); 504 } 505 506 function updateWooProgressSpinners(response) { 507 if (!response.requirements) return; 508 509 const activeTab = getWooActiveTab(); 510 511 for (const [key, requirement] of Object.entries(response.requirements)) { 512 const $spinner = $(`#${activeTab} ${WOO_CONFIG.SECTION_MAP[key]}`); 513 514 if (!$spinner.length) { 515 return; 516 } 517 518 $spinner.toggleClass('tmtl_spin', !requirement.is_done) 519 .toggleClass('tmtl_done', requirement.is_done); 520 }; 521 } 522 523 /** 524 * Generate progress message 525 * 526 * @since 2.4.0 527 * @param {Object} optionsValue - Migration options data. 528 * @param {'succeed' | 'failed'} type - Type of progress to report. 529 * @return {string} 530 */ 531 function generateProgressMessage(optionsValue, type = 'succeed') { 532 if (!optionsValue?.requirements || typeof optionsValue.requirements !== 'object') { 533 return ''; 534 } 535 536 const messageParts = []; 537 538 for (const [key, requirement] of Object.entries(optionsValue.requirements)) { 539 if (Array.isArray(requirement[type])) { 540 const count = requirement[type].length; 541 const capitalizedKey = key.charAt(0).toUpperCase() + key.slice(1).toLowerCase(); 542 543 if (count > 0) { 544 messageParts.push(`${capitalizedKey} (${count})`); 545 } 546 } 547 } 548 549 return messageParts.join(', '); 550 } 551 552 /** 553 * Generate Error Report Details 554 * 555 * @param {Object} optionsValue - Migration options data. 556 * 557 * @return {string} 558 */ 559 function generateErrorReportDetails(optionsValue) { 560 const reportDetails = []; 561 for (const [key, requirement] of Object.entries(optionsValue?.requirements)) { 562 if (Array.isArray(requirement.failed)) { 563 if (requirement.failed.length === 0) continue; 564 565 const failedIds = requirement.failed.map((failedId) => `<div class="migration-complete-report-details-ids-item">${failedId}</div>`).join(''); 566 reportDetails.push(` 567 <div class="migration-complete-report-details-item"> 568 <div class="migration-complete-report-details-title"> 569 ${key.charAt(0).toUpperCase() + key.slice(1).toLowerCase()} 570 </div> 571 <div class="migration-complete-report-details-ids"> 572 ${failedIds} 573 </div> 574 </div> 575 `); 576 } 577 } 578 return reportDetails.join(''); 579 } 580 581 function handleWooMigrationSuccess(response) { 582 const succeedReport = generateProgressMessage(response, 'succeed'); 583 const failedReport = generateProgressMessage(response, 'failed'); 584 const activeTab = getWooActiveTab(); 585 586 const hasSuccess = succeedReport.length > 0; 587 const hasFailed = failedReport.length > 0; 588 589 $(hasSuccess ? '.lp-success-modal' : '.lp-error-modal').addClass('active'); 590 591 const [title, description] = hasSuccess && hasFailed 592 ? [__('Migration Complete with Errors', 'tutor-lms-migration-tool'), __('The migration process has finished, but some items could not be imported. ', 'tutor-lms-migration-tool')] 593 : [__('Migration Successful!', 'tutor-lms-migration-tool'), __('Your data has been successfully migrated from WooCommerce to Tutor LMS native eCommerce.', 'tutor-lms-migration-tool')]; 594 595 $(WOO_CONFIG.WOO_MIGRATION_SUCCESS_TITLE).text(__(title, 'tutor-lms-migration-tool')); 596 $(WOO_CONFIG.WOO_MIGRATION_SUCCESS_DESC).text(__(description, 'tutor-lms-migration-tool')); 597 598 $wooMigrateBtn.removeAttr('disabled'); 599 window.onbeforeunload = null; 600 $('.tutor-migration-tab .tutor-nav-link').removeClass('disabled'); 601 toggleWooSpinners(activeTab, 'stop'); 602 603 if (activeTab === WOO_CONFIG.TABS.CUSTOM) { 604 revertWooCheckboxes(); 605 } 606 607 $(WOO_CONFIG.WOO_REPORT_ITEMS.SUCCESS).toggle(hasSuccess); 608 $(WOO_CONFIG.WOO_REPORT_ITEMS.FAILED).toggle(hasFailed); 609 610 if (hasSuccess) { 611 $(WOO_CONFIG.WOO_REPORT_DESCRIPTIONS.SUCCESS).text(succeedReport); 612 } 613 614 if (hasFailed) { 615 $(WOO_CONFIG.WOO_REPORT_DESCRIPTIONS.FAILED).text(failedReport); 616 $(WOO_CONFIG.WOO_REPORT_DETAILS).html(generateErrorReportDetails(response)); 617 } 618 619 getWooMigrationHistory(); 620 } 621 622 function handleWooMigrationError() { 623 $('.lp-error-modal').addClass('active'); 624 const activeTab = getWooActiveTab(); 625 toggleWooSpinners(activeTab, 'stop'); 626 $('.tutor-migration-tab .tutor-nav-link') 627 .removeClass('disabled'); 628 $wooMigrateBtn.removeAttr('disabled'); 629 window.onbeforeunload = null; 630 631 if (activeTab === WOO_CONFIG.TABS.CUSTOM) { 632 revertWooCheckboxes(); 633 } 634 } 635 636 function pollWooMigrationProgress(jobId) { 637 $.ajax({ 638 url: ajaxurl, 639 type: 'POST', 640 data: { 641 action: 'tlmt_migrate_sales_data', 642 job_id: jobId 643 }, 644 success: function (data) { 645 const activeTab = getWooActiveTab(); 646 const response = data.data; 647 648 if (!response) { 649 console.error("Invalid WooCommerce migration progress response", response); 650 return; 651 } 652 653 updateWooProgressSpinners(response); 654 655 const progress = parseInt(response.progress, 10); 656 657 if (progress < 100) { 658 pollWooMigrationProgress(jobId); 659 } else { 660 handleWooMigrationSuccess(response); 661 } 662 }, 663 error: function (xhr, status, error) { 664 console.error("WooCommerce migration polling failed", { status, error, response: xhr.responseText }); 665 handleWooMigrationError(); 666 throw new Error("WooCommerce migration polling failed"); 667 } 668 }); 669 } 670 671 function handleWooMigrationStart() { 672 $wooMigrateBtn.attr('disabled', 'disabled'); 673 $('.tutor-migration-tab .tutor-nav-link') 674 .addClass('disabled'); 675 676 if (getWooActiveTab() === WOO_CONFIG.TABS.CUSTOM) { 677 replaceWooCheckboxesWithSpinners(); 678 } else { 679 toggleWooSpinners(WOO_CONFIG.TABS.AUTO, 'spin'); 680 } 681 682 window.onbeforeunload = function () { 683 return 'Migration is in progress. Are you sure you want to leave?'; 684 }; 685 } 686 687 function prepareWooFormData(form) { 688 const formData = new FormData(form); 689 formData.append('action', 'tlmt_migrate_sales_data'); 690 formData.append('job_id', 0); 691 692 if (getWooActiveTab() !== WOO_CONFIG.TABS.CUSTOM) { 693 formData.delete('job_requirements[]'); 694 formData.append('job_requirements[]', 'orders'); 695 formData.append('job_requirements[]', 'coupons'); 696 if (isAddonEnabled(WOO_CONFIG.WOO_SUBSCRIPTIONS_ADDON_BASE_NAME)) { 697 formData.append('job_requirements[]', 'subscriptions'); 698 } 699 } 700 701 return formData; 702 } 703 704 function getWooMigrationHistory() { 705 $.ajax({ 706 url: ajaxurl, 707 type: 'POST', 708 data: { 709 action: 'tmlt_get_sales_data_history', 710 }, 711 success: function (data) { 712 const history = data.data; 713 const $migrationHistory = $('.tutor-migration-history'); 714 715 if (!history.length) { 716 $migrationHistory.addClass('tutor-d-none'); 717 return; 718 } 719 720 $migrationHistory.removeClass('tutor-d-none'); 721 722 const $tbody = $('.tutor-migration-history tbody') 723 $tbody.empty(); 724 725 history.forEach((item) => { 726 const $row = $(` 727 <tr class="tutor-wc-migration-history-row"> 728 <td> 729 <div class="tutor-migration-history-time tutor-fs-7 tutor-pl-24 tutor-fw-normal"> 730 ${item.title} 731 </div> 732 </td> 733 <td> 734 <div class="tutor-migration-history-time tutor-fs-7 tutor-pl-24 tutor-fw-normal"> 735 ${item.started_at} 736 </div> 737 </td> 738 <td> 739 <div class="tutor-btn tutor-btn-outline-primary tutor-btn-sm tutor-mr-4 tutor-wc-history-delete-btn" 740 data-wc-option-id="${item.id}"> 741 Delete 742 </div> 743 </td> 744 </tr> 745 `); 746 $tbody.append($row); 747 }); 748 }, 749 error: function (xhr, status, error) { 750 console.error("Failed to get WooCommerce migration history", { status, error, response: xhr.responseText }); 751 throw new Error("Failed to get WooCommerce migration history"); 752 } 753 }); 754 } 755 756 // WooCommerce Migration Event Handlers 757 $wooMigrationPage.find(WOO_CONFIG.SELECTORS.navLink).on('click', function (e) { 758 e.preventDefault(); 759 toggleWooMigrateBtn(); 760 }); 761 762 $(WOO_CONFIG.WOO_REPORT_DETAILS_TOGGLE).on('click', function (e) { 763 e.preventDefault(); 764 $(WOO_CONFIG.WOO_REPORT_DETAILS).toggleClass('tutor-d-none'); 765 }); 766 767 $wooCheckboxes.on('change', toggleWooMigrateBtn); 768 769 $(document).on('submit', WOO_CONFIG.SELECTORS.form, function (event) { 770 event.preventDefault(); 771 772 const formData = prepareWooFormData(this); 773 774 $.ajax({ 775 url: ajaxurl, 776 type: 'POST', 777 data: formData, 778 processData: false, 779 contentType: false, 780 beforeSend: handleWooMigrationStart, 781 success: function (data) { 782 const activeTab = getWooActiveTab(); 783 const response = data.data; 784 if (response && response.job_id && response.progress < 100) { 785 pollWooMigrationProgress(response.job_id); 786 return; 787 } 788 789 handleWooMigrationSuccess(response); 790 }, 791 error: handleWooMigrationError, 792 }); 793 }); 794 795 // Delete history 796 $(document).on('click', '.tutor-wc-history-delete-btn', function (event) { 797 event.preventDefault(); 798 799 const $btn = $(this); 800 const optionId = $btn.data('wc-option-id'); 801 if (!optionId) return; 802 803 $.ajax({ 804 url: ajaxurl, 805 type: 'POST', 806 data: { 807 action: 'tlmt_delete_sales_data_history', 808 option_id: optionId, 809 }, 810 beforeSend: function () { 811 $btn.addClass('is-loading'); 812 $btn.prop('disabled', true); 813 $btn.text(''); 814 }, 815 success: function (data) { 816 if (data.status_code === 200) { 817 $btn.closest('tr').remove(); 818 } else { 819 $btn.removeClass('is-loading').prop('disabled', false).text('Delete'); 820 } 821 getWooMigrationHistory(); 822 }, 823 error: function (xhr, status, error) { 824 console.error('Failed to delete history', { status, error, response: xhr.responseText }); 825 $btn.removeClass('is-loading').prop('disabled', false).text('Delete'); 826 }, 827 }); 828 }); 829 830 831 // Initialize WooCommerce migration 832 toggleWooMigrateBtn(); 833 358 834 }); /* ./ jQuery */ 359 835 … … 363 839 364 840 dropZoneInputs.forEach((inputEl) => { 365 const dropZone = inputEl.closest('.tutor-migration-drag-drop-zone');366 ['dragover', 'dragleave', 'dragend'].forEach((dragEvent) => {367 if (dragEvent === 'dragover') {368 dropZone.addEventListener(dragEvent, (e) => {369 e.preventDefault();370 dropZone.classList.add('dragover');371 });372 } else {373 dropZone.addEventListener(dragEvent, (e) => {374 dropZone.classList.remove('dragover');375 });376 }377 });378 379 dropZone.addEventListener('drop', (e) => {380 e.preventDefault();381 const files = e.dataTransfer.files;382 getFilesAndUpdateDOM(files, inputEl, dropZone);383 dropZone.classList.remove('dragover');384 });385 386 // inputEl.addEventListener('change', (e) => {841 const dropZone = inputEl.closest('.tutor-migration-drag-drop-zone'); 842 ['dragover', 'dragleave', 'dragend'].forEach((dragEvent) => { 843 if (dragEvent === 'dragover') { 844 dropZone.addEventListener(dragEvent, (e) => { 845 e.preventDefault(); 846 dropZone.classList.add('dragover'); 847 }); 848 } else { 849 dropZone.addEventListener(dragEvent, (e) => { 850 dropZone.classList.remove('dragover'); 851 }); 852 } 853 }); 854 855 dropZone.addEventListener('drop', (e) => { 856 e.preventDefault(); 857 const files = e.dataTransfer.files; 858 getFilesAndUpdateDOM(files, inputEl, dropZone); 859 dropZone.classList.remove('dragover'); 860 }); 861 862 // inputEl.addEventListener('change', (e) => { 387 863 // const files = e.target.files; 388 // getFilesAndUpdateDOM(files, inputEl, dropZone);389 // });390 864 // getFilesAndUpdateDOM(files, inputEl, dropZone); 865 // }); 866 391 867 }); 392 868 393 869 const getFilesAndUpdateDOM = (files, inputEl, dropZone) => { 394 if (files.length) {395 inputEl.files = files;396 dropZone.classList.add('file-attached');397 dropZone.querySelector('.file-info').innerHTML = `File attached - ${files[0].name}`;870 if (files.length) { 871 inputEl.files = files; 872 dropZone.classList.add('file-attached'); 873 dropZone.querySelector('.file-info').innerHTML = `File attached - ${files[0].name}`; 398 874 document.querySelector('#manual-migrate-now-btn').removeAttribute('disabled'); 399 } else {400 dropZone.classList.remove('file-attached');401 dropZone.querySelector('.file-info').innerHTML = '';402 }875 } else { 876 dropZone.classList.remove('file-attached'); 877 dropZone.querySelector('.file-info').innerHTML = ''; 878 } 403 879 }; -
tutor-lms-migration-tool/tags/2.4.0/classes/Utils.php
r3132123 r3378798 1 <?php 1 <?php 2 3 use Tutor\Helpers\QueryHelper; 2 4 3 5 class Utils { 4 6 5 public function fetch_history($vendor) {6 global $wpdb;7 $result = $wpdb->get_results(8 $wpdb->prepare(9 "SELECT * FROM {$wpdb->prefix}tutor_migration7 public function fetch_history( $vendor ) { 8 global $wpdb; 9 $result = $wpdb->get_results( 10 $wpdb->prepare( 11 "SELECT * FROM {$wpdb->prefix}tutor_migration 10 12 WHERE `migration_vendor` = %s 11 13 ORDER BY ID DESC 12 14 LIMIT %d, %d", 13 $vendor, 0, 20 14 ) 15 ); 16 return $result; 17 } 18 /** 19 * LearnDash functions. 20 */ 15 $vendor, 16 0, 17 20 18 ) 19 ); 20 return $result; 21 } 22 /** 23 * LearnDash functions. 24 */ 25 public function ld_course_count() { 26 global $wpdb; 27 return (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'sfwd-courses' AND post_status = 'publish';" ); 28 } 21 29 22 public function ld_course_count(){23 global $wpdb;24 return (int) $wpdb->get_var("SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'sfwd-courses' AND post_status = 'publish';");25 }26 30 27 28 public function ld_orders_count(){ 29 global $wpdb; 30 return (int) $wpdb->get_var("SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'sfwd-transactions' AND post_status = 'publish';"); 31 } 31 public function ld_orders_count() { 32 global $wpdb; 33 return (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'sfwd-transactions' AND post_status = 'publish';" ); 34 } 32 35 33 /** 34 * LearnPress functions. 35 */ 36 /** 37 * LearnPress functions. 38 */ 39 public function lp_course_count() { 40 global $wpdb; 41 return (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'lp_course' AND post_status = 'publish';" ); 42 } 36 43 37 public function lp_course_count(){38 global $wpdb;39 return (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'lp_course' AND post_status = 'publish';" );40 }44 public function lp_orders_count() { 45 global $wpdb; 46 return (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'lp_order';" ); 47 } 41 48 42 public function lp_orders_count(){43 global $wpdb;44 return (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'lp_order';" );45 }49 public function lp_reviews_count() { 50 global $wpdb; 51 return (int) $wpdb->get_var( "SELECT COUNT(comments.comment_ID) FROM {$wpdb->comments} comments INNER JOIN {$wpdb->commentmeta} cm ON cm.comment_id = comments.comment_ID AND cm.meta_key = '_lpr_rating' WHERE comments.comment_type = 'review';" ); 52 } 46 53 47 public function lp_reviews_count(){ 48 global $wpdb; 49 return (int) $wpdb->get_var( "SELECT COUNT(comments.comment_ID) FROM {$wpdb->comments} comments INNER JOIN {$wpdb->commentmeta} cm ON cm.comment_id = comments.comment_ID AND cm.meta_key = '_lpr_rating' WHERE comments.comment_type = 'review';" ); 50 } 54 /** 55 * Lifter lms functions . 56 * 57 * @return void 58 */ 59 public function lfter_course_count() { 60 global $wpdb; 61 return (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'course' AND post_status = 'publish';" ); 62 } 63 public function lifter_orders_count() { 64 global $wpdb; 65 return (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'llms_order';" ); 66 } 67 public function lifter_reviews_count() { 68 global $wpdb; 69 return (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type='llms_review';" ); 70 } 51 71 52 /** 53 * Lifter lms functions . 54 * 55 * @return void 56 */ 57 58 public function lfter_course_count(){ 59 global $wpdb; 60 return (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'course' AND post_status = 'publish';" ); 61 } 62 public function lifter_orders_count(){ 63 global $wpdb; 64 return (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'llms_order';" ); 65 } 66 public function lifter_reviews_count(){ 67 global $wpdb; 68 return (int) $wpdb->get_var("SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type='llms_review';"); 69 } 70 71 /** 72 * Check if user has access to tutor courses. 73 * 74 * @return void 75 */ 76 public static function check_course_access(){ 77 if ( ! current_user_can( 'publish_tutor_courses' ) ) { 78 wp_send_json( array( 'success'=> false, 'message' => tutor_utils()->error_message() ) ); 79 } 80 } 81 72 /** 73 * Check if user has access to tutor courses. 74 * 75 * @return void 76 */ 77 public static function check_course_access() { 78 if ( current_user_can( 'manage_options' ) || ! current_user_can( 'publish_tutor_courses' ) ) { 79 wp_send_json( 80 array( 81 'success' => false, 82 'message' => tutor_utils()->error_message(), 83 ) 84 ); 85 } 86 } 82 87 } -
tutor-lms-migration-tool/tags/2.4.0/inc/Functions.php
r3327915 r3378798 16 16 use Themeum\TutorLMSMigrationTool\Factories\ProductFactory; 17 17 use Themeum\TutorLMSMigrationTool\Factories\ReviewFactory; 18 use Themeum\TutorLMSMigrationTool\Factories\SalesDataFactory; 18 19 19 20 if ( ! function_exists( 'tlmt_has_tutor_pro' ) ) { … … 371 372 } 372 373 } 374 375 if ( ! function_exists( 'tlmt_get_sales_data_object' ) ) { 376 /** 377 * Get readable formatted time using a timestamp 378 * 379 * @since 2.3.0 380 * 381 * @param string $data_type Data type like: orders, subscriptions, etc. 382 * @param string $migration_type Migration type like: woocommerce_to_native. 383 * 384 * @throws \Throwable Throw invalid argument exception if 385 * data or migration type is not supported. 386 * @return MigrationTemplate object 387 */ 388 function tlmt_get_sales_data_object( $data_type, $migration_type ) { 389 try { 390 return SalesDataFactory::create( $data_type, $migration_type ); 391 } catch ( \Throwable $th ) { 392 throw $th; 393 } 394 } 395 } -
tutor-lms-migration-tool/tags/2.4.0/inc/Init.php
r3327915 r3378798 10 10 11 11 namespace Themeum\TutorLMSMigrationTool; 12 13 use Themeum\TutorLMSMigrationTool\SalesData\InitSalesMigration; 14 use Themeum\TutorLMSMigrationTool\SalesData\MigrationHandler; 12 15 13 16 if ( ! defined( 'ABSPATH' ) ) { … … 38 41 private function boot() { 39 42 new ActionHandler(); 43 44 // Init WC to Native sales data migration. 45 new InitSalesMigration(); 46 new MigrationHandler(); 40 47 } 41 48 } -
tutor-lms-migration-tool/tags/2.4.0/inc/MigrationTypes.php
r3327915 r3378798 21 21 const LP_TO_TUTOR = 'learnpress_to_tutor'; 22 22 const LIF_TO_TUTOR = 'lifter_to_tutor'; 23 24 // sales data migration types. 25 const WC_TO_NATIVE = 'woocommerce_to_native'; 23 26 } -
tutor-lms-migration-tool/tags/2.4.0/readme.txt
r3329380 r3378798 2 2 Contributors: themeum 3 3 Donate link: https://www.themeum.com 4 Tags: lms, migration, course, elearning, education4 Tags: LMS, migration, course, elearning, education 5 5 Requires at least: 5.0 6 6 Tested up to: 6.8 7 7 Requires PHP: 7.4 8 Stable tag: 2. 3.18 Stable tag: 2.4.0 9 9 License: GPLv3 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 19 19 No need to hassle with complicated migration settings when you can use Tutor LMS Migration Tool with its easy user interface. With its simple one-click auto migration settings you can have all the information from your old LMS plugin transferred without any database error. 20 20 21 = UPDATES =22 23 In this version of Tutor LMS Migration Tool, we are introducing migration options from major LMS plugin to Tutor LMS. We have a roadmap to bring you compatibility support for migration with many other plugins in the future.21 = KEY FEATURES = 22 23 The Tutor LMS Migration Tool allows you to seamlessly migrate data from major LMS plugins and WooCommerce into Tutor LMS. We're also actively working on expanding compatibility with more plugins and platforms in future updates. 24 24 25 25 Currently Tutor LMS Migration support migration options from 26 26 27 27 * LearnDash 28 * LearnPress & 29 * LifterLMS 28 * LearnPress 29 * LifterLMS & 30 * WooCommerce to Tutor LMS Native eCommerce migration 30 31 31 32 = Pre-requisites = 32 33 33 To get started with migrating your information from LearnDash/LearnPress/LifterLMS to Tutor LMS in the easiest way, you need to make sure you have the following plugins installed.34 35 **Note:** Currently the Tutor LMS Migration Tool supports migration from LearnDash, LearnPress, and LifterLMS to Tutor LMS. We are working hard to bring migration options from other LMS to Tutor LMS as soon as possible. But as it only supports migration from LearnPress/LearnDash the following plugins are required36 37 * Tutor LMS ( Version 3.6or later)34 To get started with migrating your data from existing LMS to Tutor LMS in the easiest way, you need to make sure you have the following plugins installed. 35 36 **Note:** Currently the Tutor LMS Migration Tool supports migration from LearnDash, LearnPress, LifterLMS, and WooCommerce to Tutor LMS. 37 38 * Tutor LMS (v3.8 or later) 38 39 39 40 And the following plugins for their respective migrations 40 41 41 * For LearnDash ( Version 4.0 or later) 42 * For LearnPress (Version 4.0 or later) 43 * For LifterLMS ( Version 8.0 or later) 42 * For LearnDash (v4.0 or later) 43 * For LearnPress (v4.0 or later) 44 * For LifterLMS (v8.0 or later) 45 * For WooCommerce (v10.0 or later) 46 * For WooCommerce Subscriptions (v7.8 or later) 44 47 45 48 You need the mentioned versions or later of the plugin for the migration to work properly. … … 47 50 = Get Started = 48 51 49 After you install the migration plugin in your WordPress site you will find the migration option in the Tools menu of Tutor LMS. 50 51 LearnDash Migrationsupports the migration of the following data types:52 fter installing the Migration Tool plugin on your WordPress site, you’ll find the migration option under the Tools menu in Tutor LMS. Below is a list of available data which you can migrate to Tutor LMS: 53 54 **LearnDash Migration** supports the migration of the following data types: 52 55 53 56 * Courses … … 60 63 * Course Reviews 61 64 62 LearnPress Migrationsupports the migration of the following data types:65 **LearnPress Migration** supports the migration of the following data types: 63 66 64 67 * Courses … … 72 75 * Course Complete Status 73 76 74 LifterLMS Migrationsupports the migration of the following data types:77 **LifterLMS Migration** supports the migration of the following data types: 75 78 76 79 * Courses … … 81 84 * Enrollment 82 85 86 **WooCommerce Migration** supports the migration of the following data types: 87 88 * Orders 89 * Subscriptions 90 * Coupons 91 83 92 For quick migrations, click on the "Migrate Now" button to get your migration process started. Sit back and enjoy while the Tutor LMS Migration Tool handles all your database information during the migration process. After the migration tool is done, you can start using Tutor LMS from where you left off in your previous LMS. 84 93 … … 98 107 = Automatic installation = 99 108 100 The automatic installation is the easiest way to install any plugin in WordPress. You can perform an automatic installation of Tutor by logging in to your WordPress dashboard, navigating to the "Plugins" menu and click on the "Add New"button.101 102 This will open up a page showing all the available plugins in WordPress. In the search field, type Tutor. The search result will show you our Tutor plugin, you can then see the detailed info by clicking on "More Details" and to install just click on the "Install Now"button.109 The easiest way to install any plugin in WordPress is through automatic installation. To install Tutor LMS Migration Tool this way, log in to your WordPress dashboard, navigate to the Plugins menu, and click the Add New button. 110 111 On the Add Plugins page, use the search bar to type “Tutor LMS Migration Tool”. Once the plugin appears in the search results, simply click the Install Now button. 103 112 104 113 = Manual installation = … … 110 119 == Frequently Asked Questions == 111 120 112 = Is This Plugin has any Dependency? =113 114 Yes, You need to install the [Tutor LMS](https://wordpress.org/plugins/tutor/) plugin in order to use this plugin. Take a backaup of your full website before migrate.115 116 = I need migrate others LMS data to Tutor LMS, what should I do? =117 118 We will add others LMS migration to this plugin, so you can migrate it. Or if you don't required any previous data, just delete other LMS and move to Tutor LMS.121 = Is this plugin has any dependency? = 122 123 Yes, you need to install the [Tutor LMS](https://wordpress.org/plugins/tutor/) plugin in order to use this plugin. Take a backaup of your full website before migrating your data. 124 125 = I want to migrate data from another LMS to Tutor LMS. How can I do that? = 126 127 You can use the Tutor LMS Migration Tool to transfer data from another LMS platforms to Tutor LMS. To learn more about the full process, please check the [official migration documentation](https://docs.themeum.com/tutor-lms/migration/). 119 128 120 129 == Screenshots == … … 127 136 == Changelog == 128 137 129 = 2.3.1 - 17 July, 2025 = 130 131 Fix: Fixed an issue where the vendor autoload file was missing. 132 133 = 2.3.0 - 15 July, 2025 = 138 = 2.4.0 - 15 October, 2025 = 139 140 New: Migrate orders from WooCommerce to Tutor Native, including associated enrollments, customers, and earnings. 141 New: Migrate subscriptions from WooCommerce to Tutor Native, including related enrollments, customers, and earnings. 142 New: Migrate coupons from WooCommerce to Tutor Native. 143 144 = 2.3.0 - 14 July, 2025 = 134 145 135 146 New: Added support for migrating assignments from LearnDash to Tutor LMS. -
tutor-lms-migration-tool/tags/2.4.0/tutor-lms-migration-tool.php
r3329380 r3378798 5 5 * Description: A migration toolkit that allows you to migrate data from other LMS platforms to Tutor LMS. 6 6 * Author: Themeum 7 * Version: 2. 3.17 * Version: 2.4.0 8 8 * Author URI: http://themeum.com 9 9 * Requires at least: 5.3 … … 31 31 */ 32 32 33 define( 'TLMT_VERSION', '2. 3.1' );33 define( 'TLMT_VERSION', '2.4.0' ); 34 34 define( 'TLMT_FILE', __FILE__ ); 35 35 define( 'TLMT_PATH', plugin_dir_path( TLMT_FILE ) ); … … 85 85 86 86 // Init. 87 new Init(); 87 add_action( 88 'plugins_loaded', 89 function() { 90 new Init(); 91 } 92 ); 88 93 89 94 if ( is_plugin_active( 'tutor/tutor.php' ) ) { -
tutor-lms-migration-tool/tags/2.4.0/vendor/composer/autoload_classmap.php
r3329380 r3378798 20 20 'Themeum\\TutorLMSMigrationTool\\Factories\\ProductFactory' => $baseDir . '/inc/Factories/ProductFactory.php', 21 21 'Themeum\\TutorLMSMigrationTool\\Factories\\ReviewFactory' => $baseDir . '/inc/Factories/ReviewFactory.php', 22 'Themeum\\TutorLMSMigrationTool\\Factories\\SalesDataFactory' => $baseDir . '/inc/Factories/SalesDataFactory.php', 22 23 'Themeum\\TutorLMSMigrationTool\\Factories\\StudentProgressFactory' => $baseDir . '/inc/Factories/StudentProgressFactory.php', 23 24 'Themeum\\TutorLMSMigrationTool\\Init' => $baseDir . '/inc/Init.php', 25 'Themeum\\TutorLMSMigrationTool\\Interfaces\\DataTransformer' => $baseDir . '/inc/Interfaces/DataTransformer.php', 26 'Themeum\\TutorLMSMigrationTool\\Interfaces\\MigrationTemplate' => $baseDir . '/inc/Interfaces/MigrationTemplate.php', 24 27 'Themeum\\TutorLMSMigrationTool\\Interfaces\\Order' => $baseDir . '/inc/Interfaces/Order.php', 25 28 'Themeum\\TutorLMSMigrationTool\\Interfaces\\Post' => $baseDir . '/inc/Interfaces/Post.php', … … 42 45 'Themeum\\TutorLMSMigrationTool\\LDMigration\\StudentProgress' => $baseDir . '/inc/LDMigration/StudentProgress.php', 43 46 'Themeum\\TutorLMSMigrationTool\\MigrationLogger' => $baseDir . '/inc/MigrationLogger.php', 47 'Themeum\\TutorLMSMigrationTool\\MigrationMapper' => $baseDir . '/inc/MigrationMapper.php', 44 48 'Themeum\\TutorLMSMigrationTool\\MigrationTypes' => $baseDir . '/inc/MigrationTypes.php', 49 'Themeum\\TutorLMSMigrationTool\\SalesDataTypes' => $baseDir . '/inc/SalesDataTypes.php', 50 'Themeum\\TutorLMSMigrationTool\\SalesData\\InitSalesMigration' => $baseDir . '/inc/SalesData/InitSalesMigration.php', 51 'Themeum\\TutorLMSMigrationTool\\SalesData\\JobHandler' => $baseDir . '/inc/SalesData/JobHandler.php', 52 'Themeum\\TutorLMSMigrationTool\\SalesData\\MigrationHandler' => $baseDir . '/inc/SalesData/MigrationHandler.php', 53 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Coupons\\Coupons' => $baseDir . '/inc/SalesData/WooToNative/Coupons/Coupons.php', 54 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Customers\\Customers' => $baseDir . '/inc/SalesData/WooToNative/Customers/Customers.php', 55 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Helper' => $baseDir . '/inc/SalesData/WooToNative/Helper.php', 56 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Orders\\Earnings' => $baseDir . '/inc/SalesData/WooToNative/Orders/Earnings.php', 57 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Orders\\Orders' => $baseDir . '/inc/SalesData/WooToNative/Orders/Orders.php', 58 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Subscriptions\\Subscriptions' => $baseDir . '/inc/SalesData/WooToNative/Subscriptions/Subscriptions.php', 59 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Subscriptions\\Transformers\\EnrollmentDataTransformer' => $baseDir . '/inc/SalesData/WooToNative/Subscriptions/Transformers/EnrollmentDataTransformer.php', 60 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Subscriptions\\Transformers\\OrderDataTransformer' => $baseDir . '/inc/SalesData/WooToNative/Subscriptions/Transformers/OrderDataTransformer.php', 61 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Subscriptions\\Transformers\\PlanDataTransformer' => $baseDir . '/inc/SalesData/WooToNative/Subscriptions/Transformers/PlanDataTransformer.php', 62 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Subscriptions\\Transformers\\SubscriptionDataTransformer' => $baseDir . '/inc/SalesData/WooToNative/Subscriptions/Transformers/SubscriptionDataTransformer.php', 45 63 'TutorLMSMigrationTool' => $baseDir . '/classes/TutorLMSMigrationTool.php', 46 64 'Utils' => $baseDir . '/classes/Utils.php', -
tutor-lms-migration-tool/tags/2.4.0/vendor/composer/autoload_static.php
r3329380 r3378798 39 39 'Themeum\\TutorLMSMigrationTool\\Factories\\ProductFactory' => __DIR__ . '/../..' . '/inc/Factories/ProductFactory.php', 40 40 'Themeum\\TutorLMSMigrationTool\\Factories\\ReviewFactory' => __DIR__ . '/../..' . '/inc/Factories/ReviewFactory.php', 41 'Themeum\\TutorLMSMigrationTool\\Factories\\SalesDataFactory' => __DIR__ . '/../..' . '/inc/Factories/SalesDataFactory.php', 41 42 'Themeum\\TutorLMSMigrationTool\\Factories\\StudentProgressFactory' => __DIR__ . '/../..' . '/inc/Factories/StudentProgressFactory.php', 42 43 'Themeum\\TutorLMSMigrationTool\\Init' => __DIR__ . '/../..' . '/inc/Init.php', 44 'Themeum\\TutorLMSMigrationTool\\Interfaces\\DataTransformer' => __DIR__ . '/../..' . '/inc/Interfaces/DataTransformer.php', 45 'Themeum\\TutorLMSMigrationTool\\Interfaces\\MigrationTemplate' => __DIR__ . '/../..' . '/inc/Interfaces/MigrationTemplate.php', 43 46 'Themeum\\TutorLMSMigrationTool\\Interfaces\\Order' => __DIR__ . '/../..' . '/inc/Interfaces/Order.php', 44 47 'Themeum\\TutorLMSMigrationTool\\Interfaces\\Post' => __DIR__ . '/../..' . '/inc/Interfaces/Post.php', … … 61 64 'Themeum\\TutorLMSMigrationTool\\LDMigration\\StudentProgress' => __DIR__ . '/../..' . '/inc/LDMigration/StudentProgress.php', 62 65 'Themeum\\TutorLMSMigrationTool\\MigrationLogger' => __DIR__ . '/../..' . '/inc/MigrationLogger.php', 66 'Themeum\\TutorLMSMigrationTool\\MigrationMapper' => __DIR__ . '/../..' . '/inc/MigrationMapper.php', 63 67 'Themeum\\TutorLMSMigrationTool\\MigrationTypes' => __DIR__ . '/../..' . '/inc/MigrationTypes.php', 68 'Themeum\\TutorLMSMigrationTool\\SalesDataTypes' => __DIR__ . '/../..' . '/inc/SalesDataTypes.php', 69 'Themeum\\TutorLMSMigrationTool\\SalesData\\InitSalesMigration' => __DIR__ . '/../..' . '/inc/SalesData/InitSalesMigration.php', 70 'Themeum\\TutorLMSMigrationTool\\SalesData\\JobHandler' => __DIR__ . '/../..' . '/inc/SalesData/JobHandler.php', 71 'Themeum\\TutorLMSMigrationTool\\SalesData\\MigrationHandler' => __DIR__ . '/../..' . '/inc/SalesData/MigrationHandler.php', 72 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Coupons\\Coupons' => __DIR__ . '/../..' . '/inc/SalesData/WooToNative/Coupons/Coupons.php', 73 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Customers\\Customers' => __DIR__ . '/../..' . '/inc/SalesData/WooToNative/Customers/Customers.php', 74 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Helper' => __DIR__ . '/../..' . '/inc/SalesData/WooToNative/Helper.php', 75 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Orders\\Earnings' => __DIR__ . '/../..' . '/inc/SalesData/WooToNative/Orders/Earnings.php', 76 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Orders\\Orders' => __DIR__ . '/../..' . '/inc/SalesData/WooToNative/Orders/Orders.php', 77 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Subscriptions\\Subscriptions' => __DIR__ . '/../..' . '/inc/SalesData/WooToNative/Subscriptions/Subscriptions.php', 78 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Subscriptions\\Transformers\\EnrollmentDataTransformer' => __DIR__ . '/../..' . '/inc/SalesData/WooToNative/Subscriptions/Transformers/EnrollmentDataTransformer.php', 79 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Subscriptions\\Transformers\\OrderDataTransformer' => __DIR__ . '/../..' . '/inc/SalesData/WooToNative/Subscriptions/Transformers/OrderDataTransformer.php', 80 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Subscriptions\\Transformers\\PlanDataTransformer' => __DIR__ . '/../..' . '/inc/SalesData/WooToNative/Subscriptions/Transformers/PlanDataTransformer.php', 81 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Subscriptions\\Transformers\\SubscriptionDataTransformer' => __DIR__ . '/../..' . '/inc/SalesData/WooToNative/Subscriptions/Transformers/SubscriptionDataTransformer.php', 64 82 'TutorLMSMigrationTool' => __DIR__ . '/../..' . '/classes/TutorLMSMigrationTool.php', 65 83 'Utils' => __DIR__ . '/../..' . '/classes/Utils.php', -
tutor-lms-migration-tool/tags/2.4.0/vendor/composer/installed.php
r3329380 r3378798 2 2 'root' => array( 3 3 'name' => 'themeum/tutor-lms-migration-tool', 4 'pretty_version' => '2. 3.1',5 'version' => '2. 3.1.0',6 'reference' => ' 39a5a88c3a7901113390ba6827cf4cea7e7e587f',4 'pretty_version' => '2.4.0', 5 'version' => '2.4.0.0', 6 'reference' => 'e847c98a59425cbe1a0161a5e5b13c7086f4c85b', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 'themeum/tutor-lms-migration-tool' => array( 14 'pretty_version' => '2. 3.1',15 'version' => '2. 3.1.0',16 'reference' => ' 39a5a88c3a7901113390ba6827cf4cea7e7e587f',14 'pretty_version' => '2.4.0', 15 'version' => '2.4.0.0', 16 'reference' => 'e847c98a59425cbe1a0161a5e5b13c7086f4c85b', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../', -
tutor-lms-migration-tool/tags/2.4.0/views/migration_ld.php
r3327915 r3378798 1 <?php2 /**3 * Migration page4 *5 * @package TutorLMSMigrationTool\Views6 * @author Themeum <[email protected]>7 * @link https://themeum.com8 * @since 2.3.09 */10 11 if ( ! defined( 'ABSPATH' ) ) {12 exit;13 }14 ?>15 1 <div class="tutor-migration-page"> 16 <?php17 global $wpdb;18 19 $utils = new Utils();20 21 $tutor_migration_history = $utils->fetch_history( 'ld' );22 23 $courses_count = $utils->ld_course_count();24 25 $orders_count = $utils->ld_orders_count();26 27 $items_count = $courses_count + $orders_count;28 ?>29 30 2 <div id="tutor-migration-wrapper"> 31 3 <div class="tutor-migration-area"> 32 4 <div class="tutor-migration-top tutor-px-48 tutor-pt-32 tutor-pb-40"> 33 <div class=""> 5 <div class=""> 34 6 <div class="tutor-fs-3 tutor-fw-medium tutor-color-black tutor-course-content-title"> 35 <?php esc_html_e( 'Migration', 'tutor-lms-migration-tool' ); ?>7 Migration 36 8 </div> 37 9 <div class="tutor-migration-top-subtitle tutor-fs-6"> 38 <?php esc_html_e( 'Seamlessly migrate your Learndash courses to Tutor LMS with the Tutor LMS Migration Tool.', 'tutor-lms-migration-tool' ); ?>10 Seamlessly migrate your Learndash courses to Tutor LMS with the Tutor LMS Migration Tool. 39 11 </div> 40 12 </div> 41 13 <div class="tutor-d-flex tutor-justify-end tutor-align-center"> 42 <img s tyle src="<?php echo esc_url( TLMT_URL . 'assets/img/learndash.jpg' ); ?>" alt="import">14 <img src="assets/img/learndash.jpg" alt="import"> 43 15 </div> 44 16 </div> … … 48 20 <li class="tutor-nav-item"> 49 21 <a class="tutor-nav-link is-active" href="#" data-tutor-nav-target="tutor-auto-migrate-tab"> 50 <?php esc_html_e( 'Auto Migrate', 'tutor-lms-migration-tool' ); ?>22 Auto Migrate 51 23 </a> 52 24 </li> 53 25 <li class="tutor-nav-item"> 54 26 <div class="tutor-d-flex tutor-align-center"> 55 <a class="tutor-nav-link" data-tutor-nav-target="" style="cursor: default; padding-right: 8px;">56 <?php esc_html_e( 'Upload File', 'tutor-lms-migration-tool' ); ?>57 </a>58 <span class="tutor-rounded-pill tutor-border tutor-px-8" style="border-radius: 10px;">59 <?php esc_html_e( 'Coming soon', 'tutor-lms-migration-tool' ); ?>60 </span>27 <a class="tutor-nav-link" style="cursor: default; padding-right: 8px;"> 28 Upload File 29 </a> 30 <span class="tutor-rounded-pill tutor-border tutor-px-8" style="border-radius: 10px;"> 31 Coming soon 32 </span> 61 33 </div> 62 34 </li> 63 35 <li class="tutor-nav-item tutor-nav-more tutor-d-none"> 64 36 <a class="tutor-nav-link tutor-nav-more-item" href="#"> 65 <span class="tutor-mr-4"> <?php esc_html_e( 'More', 'tutor-lms-migration-tool' ); ?></span>37 <span class="tutor-mr-4">More</span> 66 38 <span class="tutor-nav-more-icon tutor-icon-times"></span> 67 39 </a> … … 74 46 <div id="tutor-auto-migrate-tab" class="tutor-tab-item is-active"> 75 47 <div class="tutor-tab-item-wrap tutor-pt-32 tutor-pb-40 tutor-p-48"> 76 <form id="tlmt-lp-migrate-to-tutor-lms" action="ld_migrate_all_data_to_tutor" method="post"> 77 <?php tutor_nonce_field(); ?> 48 <form id="tlmt-lp-migrate-to-tutor-lms"> 78 49 <div class="lp-migration-checkbox"> 79 50 <div id="sectionCourse"> 80 <label for="courses">51 <label> 81 52 <div class="lp-migration-singlebox"> 82 53 <div class="lp-migration-singlebox-checkbox"> … … 87 58 <div class="tutor-fs-6 tutor-fw-medium tutor-color-black tutor-mb-4 tutor-course-content-title">Courses</div> 88 59 <div class="tutor-color-muted tutor-fs-6 tutor-fw-normal tutor-pb-16"> 89 <?php esc_html_e( 'Transfer courses, lessons, quizzes, assignments, etc to Tutor LMS.', 'tutor-lms-migration-tool' ); ?>60 Transfer courses, lessons, quizzes, assignments, etc to Tutor LMS. 90 61 </div> 91 62 <div class="tutor-progress tutor-mb-8" data-percent="0" style="--tutor-progress: 0%;"></div> … … 95 66 </div> 96 67 <div id="sectionOrders" class="tutor-py-16"> 97 <label for="sales-data">68 <label> 98 69 <div class="lp-migration-singlebox"> 99 70 <div class="lp-migration-singlebox-checkbox"> … … 102 73 <div class="lp-migration-singlebox-desc"> 103 74 <div class="tutor-fs-6 tutor-fw-medium tutor-color-black tutor-mb-4 tutor-course-content-title"> 104 <?php esc_html_e( 'Sales Data', 'tutor-lms-migration-tool' ); ?>75 Sales Data 105 76 </div> 106 77 <div class="tutor-color-muted tutor-fs-6 tutor-fw-normal tutor-pb-16"> 107 <?php esc_html_e( 'Migrate revenue and sales data to Tutor LMS.', 'tutor-lms-migration-tool' ); ?>78 Migrate revenue and sales data to Tutor LMS. 108 79 </div> 109 80 <div class="tutor-progress tutor-mb-8" data-percent="0" style="--tutor-progress: 0%;"></div> … … 113 84 </div> 114 85 <div id="sectionReviews" class="tutor-py-16"> 115 <label for="reviews">86 <label> 116 87 <div class="lp-migration-singlebox"> 117 88 <div class="lp-migration-singlebox-checkbox"> … … 120 91 <div class="lp-migration-singlebox-desc"> 121 92 <div class="tutor-fs-6 tutor-fw-medium tutor-color-black tutor-mb-4 tutor-course-content-title"> 122 <?php esc_html_e( 'Reviews', 'tutor-lms-migration-tool' ); ?>93 Reviews 123 94 </div> 124 95 <div class="tutor-color-muted tutor-fs-6 tutor-fw-normal tutor-pb-16"> 125 <?php esc_html_e( 'All of the course reviews will be carried over to Tutor LMS.', 'tutor-lms-migration-tool' ); ?>96 All of the course reviews will be carried over to Tutor LMS. 126 97 </div> 127 98 <div class="tutor-progress tutor-mb-8" data-percent="0" style="--tutor-progress: 0%;"></div> … … 135 106 </div> 136 107 <div class="tutor-backup-area tutor-px-48 tutor-py-36 tutor-border-top"> 137 <?php require __DIR__ . '/components/migrate-now.php'; ?> 138 </div> 139 </div> 108 <button class="tutor-btn tutor-btn-primary tutor-btn-lg">Migrate Now</button> 109 </div> 110 </div> 111 140 112 <div id="tutor-manual-migrate-tab" class="tutor-tab-item"> 141 113 <div class="tutor-tab-item-wrap tutor-p-48"> … … 144 116 <span class="tutor-fs-3 tutor-fw-medium tutor-color-primary tutor-icon-import"></span> 145 117 </div> 146 <form id="tutor-manual-migrate-form" method="post" enctype="multipart/form-data"> 147 <?php tutor_nonce_field(); ?> 148 <input type="hidden" name="tutor_action" value="tutor_import_from_ld"> 149 <div id="tutor-migration-browse-file-link" class="tutor-fs-5 tutor-fw-medium"> 150 <div class="tutor-color-black"> <?php esc_html_e( 'Drag & Drop XML file here', 'tutor-lms-migration-tool' ); ?> </div> 151 or <a href="" class="tutor-color-primary"> <?php esc_html_e( 'Browse File', 'tutor-lms-migration-tool' ); ?> </a> 152 </div> 153 <input id="tutor-migration-browse-file" name="tutor_import_file" hidden type="file" accept=".xml" required> 118 <form id="tutor-manual-migrate-form"> 119 <input type="file" id="tutor-migration-browse-file" hidden accept=".xml" required> 120 <div id="tutor-migration-browse-file-link" class="tutor-fs-5 tutor-fw-medium"> 121 <div class="tutor-color-black">Drag & Drop XML file here</div> 122 or <a href="#" class="tutor-color-primary">Browse File</a> 123 </div> 154 124 <span class="file-info tutor-fw-medium backup-now-subtile tutor-fs-6"></span> 155 125 </form> … … 160 130 <div class="tutor-row tutor-align-center"> 161 131 <div class="tutor-col-md-8 tutor-d-flex tutor-flex-wrap"> 162 <sapn class="backup-now-subtile tutor-fs-7"><?php esc_html_e( 'Please take a complete a backup for safety.', 'tutor-lms-migration-tool' ); ?></sapn> 163 <form id="tutor_migration_export_form" method="post"> 164 <?php tutor_nonce_field(); ?> 165 <input type="hidden" id="tutor_migration_vendor" name="tutor_migration_vendor" value="ld"> 166 <input type="hidden" name="tutor_action" value="tutor_ld_export_xml"> 167 <button <?php echo ! $items_count ? 'disabled' : ''; ?> type="submit" class="backup-now-btn tutor-fs-7 tutor-fw-medium tutor-color-black"> 168 <?php esc_html_e( 'Backup Now', 'tutor-lms-migration-tool' ); ?> 169 </button> 170 </form> 132 <span class="backup-now-subtile tutor-fs-7">Please take a complete backup for safety.</span> 133 <button type="submit" class="backup-now-btn tutor-fs-7 tutor-fw-medium tutor-color-black"> 134 Backup Now 135 </button> 171 136 </div> 172 137 <div class="migrate-now-btn-wrapper tutor-col-md-4 tutor-d-flex tutor-justify-end"> 173 138 <button type="submit" id="manual-migrate-now-btn" class="tutor-btn tutor-btn-primary tutor-btn-lg" disabled> 174 <?php esc_html_e( 'Migrate Now', 'tutor-lms-migration-tool' ); ?>139 Migrate Now 175 140 </button> 176 141 </div> … … 179 144 </div> 180 145 </div> 181 <!-- ./ tutor migration tab -->182 146 </div> 183 147 184 148 <!-- migration history area --> 185 <?php if ( count( $tutor_migration_history ) ) : ?>186 149 <div class="tutor-migration-history"> 187 150 <div class="tutor-migration-history-heading tutor-fs-5 tutor-color-subdued tutor-mt-24 tutor-mb-16"> 188 <?php esc_html_e( 'Settings History', 'tutor-lms-migration-tool' ); ?>151 Settings History 189 152 </div> 190 153 <div class="tutor-table-responsive"> … … 192 155 <thead> 193 156 <tr> 194 <th class="tutor-table-rows-sorting" style="padding-left: 38px;"> 195 <?php esc_html_e( 'Date', 'tutor-lms-migration-tool' ); ?> 196 </th> 197 <th class="tutor-table-rows-sorting"> 198 </th> 157 <th style="padding-left: 38px;">Date</th> 158 <th></th> 199 159 </tr> 200 160 </thead> 201 161 <tbody> 202 <?php foreach ( $tutor_migration_history as $tutor_history ) : ?>203 162 <tr> 204 163 <td> 205 164 <div class="tutor-migration-history-time tutor-fs-6 tutor-pl-24 tutor-fw-normal"> 206 <?php 207 echo esc_html( tutor_get_formated_date( get_option( 'date_format' ), $tutor_history->created_at ) ); 208 echo ', ' . date( 'h:i A', strtotime( $tutor_history->created_at ) ); 209 ?> 210 211 </div> 212 </td> 213 <td> 214 <?php 215 $migration_type_class = ''; 216 if ( $tutor_history->migration_type == 'Imported' ) { 217 $migration_type_class = 'success'; 218 } elseif ( $tutor_history->migration_type == 'Exported' ) { 219 $migration_type_class = 'warning'; 220 } 221 ?> 165 Sept 12, 2025, 03:15 PM 166 </div> 167 </td> 168 <td> 222 169 <div class="tutor-d-flex tutor-justify-end tutor-pr-32"> 223 <span class="tutor-badge-label label-<?php echo esc_attr( $migration_type_class ); ?>"> 224 <?php echo esc_html( $tutor_history->migration_type ); ?> 225 </span> 170 <span class="tutor-badge-label label-success">Imported</span> 226 171 </div> 227 172 </td> 228 173 </tr> 229 <?php endforeach; ?> 174 <tr> 175 <td> 176 <div class="tutor-migration-history-time tutor-fs-6 tutor-pl-24 tutor-fw-normal"> 177 Sept 10, 2025, 11:45 AM 178 </div> 179 </td> 180 <td> 181 <div class="tutor-d-flex tutor-justify-end tutor-pr-32"> 182 <span class="tutor-badge-label label-warning">Exported</span> 183 </div> 184 </td> 185 </tr> 230 186 </tbody> 231 187 </table> 232 188 </div> 233 189 </div> 234 <?php endif; ?> 235 <!-- ./ tutor-migration-history --> 236 </div> 237 </div> 238 190 </div> 191 </div> 192 193 <!-- Modal: Confirmation --> 239 194 <div class="lp-migration-modal-wrap"> 240 195 <div class="lp-migration-modal"> 241 196 <div class="lp-migration-alert lp-import flex-center tutor-flex-column tutor-py-60 tutor-text-center"> 242 197 <div class="lp-migration-modal-icon"> 243 <img src=" <?php echo esc_url( TLMT_URL . 'assets/img/yes_no.svg' ); ?>" alt="export">198 <img src="assets/img/yes_no.svg" alt="export"> 244 199 </div> 245 200 <div class="migration-modal-btn-group flex-center tutor-flex-column"> 246 201 <div class="tutor-fs-5 tutor-fw-normal tutor-color-black tutor-mb-32 tutor-mt-16"> 247 <?php esc_html_e( 'Are you sure you want to migrate from', 'tutor-lms-migration-tool' ); ?> 248 <br> 249 <?php esc_html_e( 'LearnDash to Tutor LMS?', 'tutor-lms-migration-tool' ); ?> 202 Are you sure you want to migrate from <br> LearnDash to Tutor LMS? 250 203 </div> 251 204 <div class="tutor-d-flex"> 252 205 <a href="#" class="migration-later-btn tutor-btn tutor-btn-outline-primary tutor-btn-lg tutor-mr-24"> 253 <span> <?php esc_html_e( 'No, Maybe Later!', 'tutor-lms-migration-tool' ); ?></span>206 <span>No, Maybe Later!</span> 254 207 </a> 255 208 <a href="#" class="migration-start-btn tutor-btn tutor-btn-primary tutor-btn-lg"> 256 <?php 257 esc_html_e( 'Yes, Let’s Start', 'tutor-lms-migration-tool' ); 258 ?> 209 Yes, Let’s Start 259 210 </a> 260 211 </div> … … 268 219 </div> 269 220 270 221 <!-- Modal: Success --> 271 222 <div class="lp-success-modal-wrap"> 272 223 <div class="lp-success-modal"> … … 282 233 <span class="modal-close-line success-close-line-two"></span> 283 234 </div> 284 <div class="tutor-fs-3 tutor-fw-normal tutor-color-black tutor-mt-28"> 285 <?php esc_html_e( 'Migration Successful!', 'tutor-lms-migration-tool' ); ?>286 </div> 287 <div class="tutor-fs-6 tutor-fw-normal tutor-color-black tutor-mt-16 tutor-px-12"> 288 <?php esc_html_e( 'Migration from LearnDash to Tutor LMS has been completed. Please check your contents and ensure everything is working as expected.', 'tutor-lms-migration-tool' ); ?>289 </div> 290 <a href=" <?php echo esc_url( admin_url() ); ?>admin.php?page=tutor" class="migration-try-btn migration-done-btn tutor-btn tutor-btn-primary tutor-btn-lg tutor-mt-44 tutor-mb-20">291 <?php esc_html_e( 'Go to courses', 'tutor-lms-migration-tool' ); ?>235 <div class="tutor-fs-3 tutor-fw-normal tutor-color-black tutor-mt-28"> 236 Migration Successful! 237 </div> 238 <div class="tutor-fs-6 tutor-fw-normal tutor-color-black tutor-mt-16 tutor-px-12"> 239 Migration from LearnDash to Tutor LMS has been completed. Please check your contents and ensure everything is working as expected. 240 </div> 241 <a href="#" class="migration-try-btn migration-done-btn tutor-btn tutor-btn-primary tutor-btn-lg tutor-mt-44 tutor-mb-20"> 242 Go to courses 292 243 </a> 293 244 </div> … … 295 246 </div> 296 247 248 <!-- Modal: Error --> 297 249 <div class="lp-error-modal-wrap"> 298 250 <div class="lp-error-modal"> 299 251 <div class="lp-modal-alert tutor-p-40"> 300 <img class="tutor-mt-12" style="width: 80px; height: 80px;" src=" <?php echo esc_url( TLMT_URL . 'assets/img/error-modal-icon.jpg' ); ?>" alt="error-midal-alert-icon">252 <img class="tutor-mt-12" style="width: 80px; height: 80px;" src="assets/img/error-modal-icon.jpg" alt="error-midal-alert-icon"> 301 253 <div class="modal-close success-modal-close"> 302 254 <span class="modal-close-line success-close-line-one"></span> 303 255 <span class="modal-close-line success-close-line-two"></span> 304 256 </div> 305 <div class="tutor-fs-3 tutor-fw-normal tutor-color-black tutor-mt-28"> 306 <?php esc_html_e( 'Migration Failed!', 'tutor-lms-migration-tool' ); ?>307 </div> 308 <div class="tutor-fs-6 tutor-fw-normal tutor-color-black tutor-mt-16 tutor-px-12"> 309 <?php esc_html_e( 'Oops... The migration from LearnDash to Tutor LMS was unsuccessful. Please review everything and try again.', 'tutor-lms-migration-tool' ); ?>310 </div> 311 <a href=" " class="migration-try-again-btn migration-done-btn tutor-btn tutor-btn-primary tutor-btn-lg tutor-mt-44 tutor-mb-20">312 <?php esc_html_e( 'Try Again', 'tutor-lms-migration-tool' ); ?>257 <div class="tutor-fs-3 tutor-fw-normal tutor-color-black tutor-mt-28"> 258 Migration Failed! 259 </div> 260 <div class="tutor-fs-6 tutor-fw-normal tutor-color-black tutor-mt-16 tutor-px-12"> 261 Oops... The migration from LearnDash to Tutor LMS was unsuccessful. Please review everything and try again. 262 </div> 263 <a href="#" class="migration-try-again-btn migration-done-btn tutor-btn tutor-btn-primary tutor-btn-lg tutor-mt-44 tutor-mb-20"> 264 Try Again 313 265 </a> 314 266 </div> -
tutor-lms-migration-tool/trunk/assets/css/admin.css
r2997569 r3378798 1 .tutor-progress {1 .tutor-progress { 2 2 height: 4px; 3 3 width: 80%; 4 background: # E3E6EB;4 background: #e3e6eb; 5 5 border-radius: 30px; 6 6 position: relative; … … 8 8 margin-bottom: 25px; 9 9 } 10 .tutor-progress::before{ 10 11 .tutor-progress::before { 11 12 content: ''; 12 13 position: absolute; … … 17 18 transition: 300ms; 18 19 } 19 .lp-migration-singlebox { 20 21 .lp-migration-singlebox, 22 .wc-migration-singlebox { 20 23 display: grid; 21 24 grid-template-columns: 3% 80%; … … 23 26 grid-gap: 15px; 24 27 } 28 29 .wc-migration-singlebox { 30 min-height: auto; 31 } 32 25 33 /* css spinner */ 26 34 .backup-now-btn { … … 33 41 cursor: pointer; 34 42 } 43 35 44 .backup-now-btn:not(:disabled):hover { 36 45 color: var(--tutor-color-primary); 37 46 } 38 .backup-now-btn:disabled { 47 48 .backup-now-btn:disabled { 39 49 color: #86878a; 40 50 } 51 41 52 .j-spinner { 42 53 --spinner-size: 22px; … … 51 62 box-sizing: border-box; 52 63 animation: none; 53 background: # CDCFD5;64 background: #cdcfd5; 54 65 background-size: 55%; 55 66 background-position: 5px 7px; 56 67 background-repeat: no-repeat; 57 68 background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='9'%3E%3Cpath fill='%23FFF' fill-rule='evenodd' d='M4.571 8.8L0 4.569l1.28-1.184 3.291 3.046L11.52 0l1.28 1.185z'/%3E%3C/svg%3E"); 58 59 } 60 .j-spinner.tmtl_done {69 } 70 71 .j-spinner.tmtl_done { 61 72 border: none; 62 73 animation: none; … … 66 77 background-repeat: no-repeat; 67 78 background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='9'%3E%3Cpath fill='%23FFF' fill-rule='evenodd' d='M4.571 8.8L0 4.569l1.28-1.184 3.291 3.046L11.52 0l1.28 1.185z'/%3E%3C/svg%3E"); 68 69 } 70 .j-spinner.tmtl_spin {79 } 80 81 .j-spinner.tmtl_spin { 71 82 border: none; 72 83 background-color: transparent; … … 75 86 background-repeat: no-repeat; 76 87 background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='22 22 44 44'%3E%3Ccircle class='background' cx='44' cy='44' r='19' fill='none' stroke-width='6' stroke='%23dddddd'%3E%3C/circle%3E%3Ccircle class='spinner-circle-dash' cx='44' cy='44' r='19' fill='none' stroke-width='6' stroke='%23007cba' stroke-dasharray='119.38052083641213' stroke-dashoffset='-80'%3E%3C/circle%3E%3C/svg%3E"); 77 animation: spinner-circle-rotate .4s linear infinite;78 79 } 88 animation: spinner-circle-rotate 0.4s linear infinite; 89 } 90 80 91 @-webkit-keyframes spinner-circle-rotate { 81 92 100% { … … 83 94 } 84 95 } 96 85 97 .lp-migration-checkbox label:not(:first-child) .lp-migration-singlebox { 86 98 margin-top: 20px; 87 99 } 88 .lp-migration-singlebox-checkbox{ 100 101 .lp-migration-singlebox-checkbox { 89 102 position: relative; 90 103 margin-top: 3px; 91 104 } 92 .lp-migration-singlebox-checkbox input{ 105 106 .lp-migration-singlebox-checkbox input { 93 107 position: absolute; 94 108 right: -20px; … … 96 110 cursor: pointer; 97 111 } 98 .lp-migration-singlebox-checkbox .checkmark{ 112 113 .lp-migration-singlebox-checkbox .checkmark { 99 114 position: absolute; 100 115 top: 0; … … 102 117 width: 24px; 103 118 height: 24px; 104 background:#EFEFEF; 105 } 106 .lp-migration-singlebox-checkbox .checkmark:after{ 107 content: ""; 119 background: #efefef; 120 } 121 122 .lp-migration-singlebox-checkbox .checkmark:after { 123 content: ''; 108 124 position: absolute; 109 125 display: none; 110 126 } 111 .lp-migration-singlebox-checkbox .checkmark:after{ 127 128 .lp-migration-singlebox-checkbox .checkmark:after { 112 129 top: 3px; 113 130 left: 8px; … … 119 136 transform: rotate(45deg); 120 137 } 121 .lp-migration-singlebox-checkbox input:checked ~ .checkmark:after{ 138 139 .lp-migration-singlebox-checkbox input:checked~.checkmark:after { 122 140 display: block; 123 141 } 124 .lp-migration-singlebox-checkbox input:checked ~ .checkmark{ 125 background:#0352CC; 126 } 142 143 .lp-migration-singlebox-checkbox input:checked~.checkmark { 144 background: #0352cc; 145 } 146 127 147 /* migration-modal */ 128 148 .lp-migration-modal-wrap { 129 149 position: fixed; 130 background: rgba(0, 0,0, 0.5);150 background: rgba(0, 0, 0, 0.5); 131 151 top: 0; 132 152 bottom: 0; … … 136 156 z-index: 9999; 137 157 } 158 138 159 .lp-migration-modal { 139 160 max-width: 730px; … … 144 165 transform: translate(-50%, -50%); 145 166 } 167 146 168 .lp-migration-modal-wrap.active { 147 169 display: block; … … 149 171 150 172 .lp-migration-alert { 151 background: # FFFFFF;152 border: 1px solid # E0E2EA;173 background: #ffffff; 174 border: 1px solid #e0e2ea; 153 175 box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.05); 154 176 border-radius: 6px; 155 177 min-width: 350px; 156 178 } 157 @media (min-width : 576px) { 179 180 @media (min-width: 576px) { 158 181 .lp-migration-alert { 159 182 width: 600px; 160 183 } 161 184 } 185 162 186 .migration-failed-btn:last-child { 163 187 margin-left: 30px; 164 188 } 189 165 190 .lp-migration-modal-icon img { 166 191 width: 80px; 167 192 } 193 168 194 .modal-close { 169 195 position: absolute; … … 177 203 align-items: center; 178 204 } 205 179 206 .modal-close-line { 180 207 position: absolute; … … 182 209 height: 20px; 183 210 top: 22px; 184 background: #9CA0AC; 185 } 211 background: #9ca0ac; 212 } 213 186 214 .modal-close-line.error-close-line-one, 187 215 .modal-close-line.success-close-line-one, 188 .modal-close-line.migration-modal-close-line-one {216 .modal-close-line.migration-modal-close-line-one { 189 217 transform: rotate(42deg); 190 218 } 219 191 220 .modal-close-line.error-close-line-two, 192 221 .modal-close-line.success-close-line-two, 193 .modal-close-line.migration-modal-close-line-two {222 .modal-close-line.migration-modal-close-line-two { 194 223 transform: rotate(134deg); 195 224 } 225 196 226 .lp-modal-alert { 197 227 background-color: white; … … 203 233 position: relative; 204 234 } 235 205 236 .lp-modal-alert .lp-modal-icon { 206 237 border-radius: 50%; … … 212 243 width: 80px; 213 244 } 245 214 246 .lp-modal-alert .lp-modal-icon.lp-modal-error:after, 215 247 .lp-modal-alert .lp-modal-icon.lp-modal-error:before { … … 221 253 width: 60px; 222 254 } 255 223 256 .lp-modal-alert .lp-modal-icon.lp-modal-error:before { 224 257 border-radius: 120px 0 0 120px; … … 228 261 transform: rotate(-45deg); 229 262 } 263 230 264 .lp-modal-alert .lp-modal-icon.lp-modal-error:after { 231 265 border-radius: 0 120px 120px 0; … … 235 269 transform: rotate(-45deg); 236 270 } 271 237 272 .lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-placeholder { 238 273 border-radius: 50%; … … 246 281 z-index: 2; 247 282 } 283 248 284 .lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-fix { 249 285 background-color: #fff; … … 256 292 z-index: 1; 257 293 } 294 258 295 .lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line { 259 background-color: # A5DC86;296 background-color: #a5dc86; 260 297 border-radius: 2px; 261 298 display: block; … … 264 301 z-index: 2; 265 302 } 303 266 304 .lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line.lp-modal-tip { 267 305 left: 14px; … … 270 308 width: 25px; 271 309 } 310 272 311 .lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line.lp-modal-long { 273 312 right: 8px; … … 276 315 width: 47px; 277 316 } 317 278 318 .lp-modal-alert .lp-modal-icon.lp-modal-error { 279 border-color: #F27474; 280 } 319 border-color: #f27474; 320 } 321 281 322 .lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-x-mark { 282 323 display: block; … … 284 325 z-index: 2; 285 326 } 327 286 328 .lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-placeholder { 287 border: 4px solid #FF2624; 288 } 329 border: 4px solid #ff2624; 330 } 331 289 332 .lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line { 290 background-color: # FF2624;333 background-color: #ff2624; 291 334 top: 37px; 292 335 width: 47px; 293 336 } 337 294 338 .lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line.lp-modal-left { 295 339 left: 17px; 296 340 transform: rotate(45deg); 297 341 } 342 298 343 .lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line.lp-modal-right { 299 344 right: 16px; 300 345 transform: rotate(-45deg); 301 346 } 347 302 348 .lp-modal-icon.lp-modal-error.animate:after { 303 349 animation: rotatePlaceholder 4.25s ease-in; 304 350 } 351 305 352 .animateXLeft { 306 animation: animateXLeft .75s; 307 } 353 animation: animateXLeft 0.75s; 354 } 355 308 356 .animateXRight { 309 animation: animateXRight .75s; 310 } 357 animation: animateXRight 0.75s; 358 } 359 311 360 @keyframes rotatePlaceholder { 312 0%,5% { 361 362 0%, 363 5% { 313 364 transform: rotate(-45deg); 314 365 } 315 100%,12% { 366 367 100%, 368 12% { 316 369 transform: rotate(-405deg); 317 370 } 318 371 } 372 319 373 @keyframes animateXLeft { 374 320 375 0%, 321 376 65% { … … 324 379 width: 0; 325 380 } 381 326 382 84% { 327 383 left: 14px; … … 329 385 width: 47px; 330 386 } 387 331 388 100% { 332 389 left: 17px; … … 335 392 } 336 393 } 394 337 395 @keyframes animateXRight { 396 338 397 0%, 339 398 65% { … … 342 401 width: 0; 343 402 } 403 344 404 84% { 345 405 right: 14px; … … 347 407 width: 47px; 348 408 } 409 349 410 100% { 350 411 right: 16px; … … 353 414 } 354 415 } 416 355 417 /* modal success */ 356 .lp-success-modal ,418 .lp-success-modal, 357 419 .lp-error-modal { 358 420 position: fixed; … … 362 424 display: none; 363 425 z-index: 999999; 364 background: rgba(0, 0,0, 0.3);426 background: rgba(0, 0, 0, 0.3); 365 427 width: 100%; 366 428 height: 100%; 367 429 } 430 368 431 .lp-error-modal.active, 369 432 .lp-success-modal.active { … … 372 435 align-items: center; 373 436 } 437 374 438 .lp-modal-alert { 375 439 background-color: #fff; … … 377 441 border-radius: 4px; 378 442 } 443 379 444 .lp-modal-alert .lp-modal-icon { 380 445 border-radius: 50%; … … 388 453 } 389 454 390 .lp-modal-alert .lp-modal-icon.lp-modal-success{ 391 border-color: #A5DC86; 392 } 455 .lp-modal-alert .lp-modal-icon.lp-modal-success { 456 border-color: #a5dc86; 457 } 458 393 459 .lp-modal-alert .lp-modal-icon.lp-modal-success:after, 394 .lp-modal-alert .lp-modal-icon.lp-modal-success:before {460 .lp-modal-alert .lp-modal-icon.lp-modal-success:before { 395 461 background: #fff; 396 462 content: ''; … … 401 467 width: 60px; 402 468 } 403 .lp-modal-alert .lp-modal-icon.lp-modal-success:before{ 469 470 .lp-modal-alert .lp-modal-icon.lp-modal-success:before { 404 471 border-radius: 120px 0 0 120px; 405 472 left: -33px; … … 408 475 transform: rotate(-45deg); 409 476 } 410 .lp-modal-alert .lp-modal-icon.lp-modal-success:after{ 477 478 .lp-modal-alert .lp-modal-icon.lp-modal-success:after { 411 479 border-radius: 0 120px 120px 0; 412 480 left: 30px; … … 415 483 transform: rotate(-45deg); 416 484 } 417 .lp-modal-alert .lp-modal-icon.lp-modal-success .lp-modal-placeholder{ 485 486 .lp-modal-alert .lp-modal-icon.lp-modal-success .lp-modal-placeholder { 418 487 border-radius: 50%; 419 border: 4px solid #24 A148;488 border: 4px solid #24a148; 420 489 box-sizing: content-box; 421 490 height: 80px; … … 426 495 z-index: 2; 427 496 } 428 .lp-modal-alert .lp-modal-icon.lp-modal-success .lp-modal-fix{ 497 498 .lp-modal-alert .lp-modal-icon.lp-modal-success .lp-modal-fix { 429 499 background-color: #fff; 430 500 height: 90px; … … 436 506 z-index: 1; 437 507 } 438 .lp-modal-alert .lp-modal-icon.lp-modal-success .lp-modal-line{ 439 background-color: #24A148; 508 509 .lp-modal-alert .lp-modal-icon.lp-modal-success .lp-modal-line { 510 background-color: #24a148; 440 511 border-radius: 2px; 441 512 display: block; … … 444 515 z-index: 2; 445 516 } 446 .lp-modal-alert .lp-modal-icon.lp-modal-success .lp-modal-line.lp-modal-tip{ 517 518 .lp-modal-alert .lp-modal-icon.lp-modal-success .lp-modal-line.lp-modal-tip { 447 519 left: 14px; 448 520 top: 46px; … … 450 522 width: 25px; 451 523 } 452 .lp-modal-alert .lp-modal-icon.lp-modal-success .lp-modal-line.lp-modal-long{ 524 525 .lp-modal-alert .lp-modal-icon.lp-modal-success .lp-modal-line.lp-modal-long { 453 526 right: 8px; 454 527 top: 38px; … … 456 529 width: 47px; 457 530 } 531 458 532 .lp-modal-alert .lp-modal-icon.lp-modal-warning:after { 459 533 background-color: #fff; … … 466 540 z-index: 1; 467 541 } 542 468 543 .animateSuccessTip { 469 animation: animateSuccessTip .75s; 470 } 544 animation: animateSuccessTip 0.75s; 545 } 546 471 547 .animateSuccessLong { 472 animation: animateSuccessLong .75s; 473 } 548 animation: animateSuccessLong 0.75s; 549 } 550 474 551 .lp-modal-icon.lp-modal-success.animate:after { 475 552 animation: rotatePlaceholder 4.25s ease-in; 476 553 } 554 477 555 @keyframes animateSuccessTip { 478 0%,54% { 556 557 0%, 558 54% { 479 559 width: 0; 480 560 left: 1px; 481 561 top: 19px; 482 562 } 563 483 564 70% { 484 565 width: 50px; … … 486 567 top: 37px; 487 568 } 569 488 570 84% { 489 571 width: 17px; … … 491 573 top: 48px; 492 574 } 575 493 576 100% { 494 577 width: 25px; … … 497 580 } 498 581 } 582 499 583 @keyframes animateSuccessLong { 500 0%,65% { 584 585 0%, 586 65% { 501 587 width: 0; 502 588 right: 46px; 503 589 top: 54px; 504 590 } 591 505 592 84% { 506 593 width: 55px; … … 508 595 top: 35px; 509 596 } 597 510 598 100% { 511 599 width: 47px; … … 514 602 } 515 603 } 604 516 605 @keyframes rotatePlaceholder { 517 0%,5% { 606 607 0%, 608 5% { 518 609 -webkit-transform: rotate(-45deg); 519 610 transform: rotate(-45deg); 520 611 } 521 100%,12% { 612 613 100%, 614 12% { 522 615 -webkit-transform: rotate(-405deg); 523 616 transform: rotate(-405deg); 524 617 } 525 618 } 619 526 620 .tutor-install-notice { 527 padding: 20px; 528 display: block 529 } 621 padding: 20px; 622 display: block; 623 } 624 530 625 .tutor-install-notice .tutor-install-notice-inner { 531 min-height: 64px 532 } 626 min-height: 64px; 627 } 628 533 629 .notice.notice-error.tutor-install-notice .tutor-install-notice-icon { 534 float: left; 535 width: 65px 536 } 630 float: left; 631 width: 65px; 632 } 633 537 634 .tutor-install-notice-button { 538 float: right 539 } 635 float: right; 636 } 637 540 638 .tutor-install-notice-icon img { 541 width: 64px; 542 border-radius: 4px; 543 display: block 544 } 639 width: 64px; 640 border-radius: 4px; 641 display: block; 642 } 643 545 644 .tutor-install-notice-content { 546 flex-grow: 1; 547 padding-left: 20px; 548 padding-right: 20px; 549 display: inline-block 550 } 645 flex-grow: 1; 646 padding-left: 20px; 647 padding-right: 20px; 648 display: inline-block; 649 } 650 551 651 .tutor-install-notice-button .button { 552 padding: 6px 30px; 553 height: auto; 554 line-height: 20px; 555 text-transform: capitalize 556 } 652 padding: 6px 30px; 653 height: auto; 654 line-height: 20px; 655 text-transform: capitalize; 656 } 657 557 658 .tutor-install-notice-button { 558 margin-top: 14px 559 } 560 561 562 .tutor-migration-upload-area { 563 background-image: linear-gradient(to right, #E3E6EB 50%, rgba(255, 255, 255, 0) 0%), linear-gradient(#E3E6EB 49%, rgba(255, 255, 255, 0) 0%), linear-gradient(to right, #E3E6EB 50%, rgba(255, 255, 255, 0) 0%), linear-gradient(#E3E6EB 50%, rgba(255, 255, 255, 0) 0%); 659 margin-top: 14px; 660 } 661 662 .tutor-migration-upload-area { 663 background-image: linear-gradient(to right, #e3e6eb 50%, rgba(255, 255, 255, 0) 0%), 664 linear-gradient(#e3e6eb 49%, rgba(255, 255, 255, 0) 0%), 665 linear-gradient(to right, #e3e6eb 50%, rgba(255, 255, 255, 0) 0%), 666 linear-gradient(#e3e6eb 50%, rgba(255, 255, 255, 0) 0%); 564 667 background-position: top, right, bottom, left; 565 668 background-repeat: repeat-x, repeat-y; … … 568 671 border-radius: 6px; 569 672 text-align: center; 570 571 } 673 } 674 572 675 .tutor-migration-upload-area { 573 676 border-radius: 6px; … … 578 681 margin: 0 auto; 579 682 } 683 580 684 .tutor-migration-upload-area .tutor-migration-upload-circle { 581 685 width: 80px; 582 686 height: 80px; 583 background: # E9EDFB;687 background: #e9edfb; 584 688 border-radius: 50%; 585 689 } 690 586 691 .tutor-migration-upload-area span.file_name { 587 692 display: block; 588 693 margin-top: 10px; 589 694 } 695 590 696 .tutor-migration-upload-area button { 591 697 color: white; 592 698 display: inline-block; 593 699 } 700 594 701 .tutor-migration-upload-area.dragover { 595 background-image: linear-gradient(to right, var(--tutor-color-primary) 50%, rgba(255, 255, 255, 0) 0%),linear-gradient(var(--tutor-color-primary) 49%, rgba(255, 255, 255, 0) 0%),linear-gradient(to right, var(--tutor-color-primary) 50%, rgba(255, 255, 255, 0) 0%),linear-gradient(var(--tutor-color-primary) 50%, rgba(255, 255, 255, 0) 0%); 596 } 702 background-image: linear-gradient(to right, var(--tutor-color-primary) 50%, rgba(255, 255, 255, 0) 0%), 703 linear-gradient(var(--tutor-color-primary) 49%, rgba(255, 255, 255, 0) 0%), 704 linear-gradient(to right, var(--tutor-color-primary) 50%, rgba(255, 255, 255, 0) 0%), 705 linear-gradient(var(--tutor-color-primary) 50%, rgba(255, 255, 255, 0) 0%); 706 } 707 597 708 .tutor-migration-top { 598 709 display: grid; … … 601 712 border-radius: 6px 6px 0px 0px; 602 713 } 714 603 715 .tutor-migration-top-subtitle { 604 color: #5B616F; 605 } 716 color: #5b616f; 717 } 718 606 719 .tutor-migration-page #tutor-migration-wrapper #tutor-auto-migrate-tab { 607 720 border-radius: 0px 0px 6px 6px; 608 721 } 722 609 723 .tutor-migration-page #tutor-migration-wrapper { 610 724 background-color: #f0f0f1; … … 612 726 overflow: hidden; 613 727 } 728 614 729 #tutor-migration-wrapper .tutor-nav { 615 730 padding: 0px 48px 0px 48px; 616 731 } 732 617 733 #tutor-migration-wrapper .tutor-nav .tutor-nav-item.is-active { 618 background: # F4F6F9;734 background: #f4f6f9; 619 735 border-radius: 6px 6px 0px 0px; 620 736 border-color: transparent; 621 737 } 738 622 739 #tutor-migration-wrapper .tutor-nav .tutor-nav-item .tutor-nav-link { 623 740 border: 1px solid transparent; 624 741 color: var(--tutor-body-color); 625 color: #757C8E; 626 } 742 color: #757c8e; 743 padding-block: 10px; 744 } 745 627 746 #tutor-migration-wrapper .tutor-nav .tutor-nav-item .tutor-nav-link.is-active { 628 border: 1px solid # CDCFD5;747 border: 1px solid #e0e2ea; 629 748 color: var(--tutor-body-color) !important; 630 749 } 750 631 751 .backup-now-subtile { 632 color: #5B616F; 633 } 634 .tutor-nav:not(.tutor-nav-pills):not(.tutor-nav-tabs) .tutor-nav-link.is-active { 752 color: #5b616f; 753 } 754 755 .tutor-migration-tab>.tutor-nav:not(.tutor-nav-pills):not(.tutor-nav-tabs) .tutor-nav-link.is-active { 635 756 border-bottom-color: #F4F6F9; 636 757 border-width: 3px 3px 3px 4px; 637 background: # F4F6F9;758 background: #f4f6f9; 638 759 border-radius: 6px 6px 0px 0px; 639 760 border-color: transparent; 640 761 } 762 641 763 #tutor-migration-wrapper .tutor-nav:not(.tutor-nav-pills):not(.tutor-nav-tabs) .tutor-nav-link.is-active { 642 764 border-bottom-color: transparent; 643 765 } 766 644 767 .tutor-tab-item-wrap { 645 background: #F4F6F9; 646 } 768 background: #f4f6f9; 769 } 770 647 771 .tutor-migration-history { 648 772 background: #f0f0f1; 649 773 } 774 650 775 .tutor-migration-history-heading { 651 776 background: #f0f0f1; 652 color: #5B616F; 653 } 777 color: #5b616f; 778 } 779 654 780 .tutor-migration-history-time { 655 color: #41454F; 656 } 781 color: #41454f; 782 } 783 657 784 .tutor-migration-area { 658 border: 1px solid # E0E2EA;785 border: 1px solid #e0e2ea; 659 786 box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.05); 660 787 border-radius: 6px; 661 788 } 789 662 790 .tutor-migration-tab, 663 791 .tutor-migration-tab-item { 792 --tutor-border-color: #e0e2ea; 793 664 794 background-color: #fff; 665 795 } 796 666 797 .tutor-migration-tab-item { 667 798 border-radius: 0px 0px 6px 6px; 668 799 } 669 #tutor-migration-browse-file-link a{ 800 801 #tutor-migration-browse-file-link a { 670 802 text-decoration: underline; 671 803 } 804 672 805 span.tutor-icon-brand-lifter:before { 673 content: "\e962"; 674 } 675 @media (max-width: 991px) { 806 content: '\e962'; 807 } 808 809 .tutor-migration-tab .tutor-nav-link.disabled { 810 cursor: not-allowed; 811 opacity: 0.5; 812 pointer-events: none; 813 } 814 815 .migration-complete-report { 816 display: flex; 817 flex-direction: column; 818 align-items: center; 819 justify-content: center; 820 gap: 20px; 821 margin-bottom: 28px; 822 } 823 824 .migration-complete-report .migration-complete-report-item-wrapper { 825 border-radius: 6px; 826 background-color: #F6F8FD; 827 align-items: flex-start; 828 } 829 830 .migration-complete-report .migration-complete-report-item-wrapper { 831 width: 500px; 832 } 833 834 .migration-complete-report .migration-complete-report-item { 835 display: flex; 836 flex-direction: row; 837 align-items: center; 838 justify-content: flex-start; 839 gap: 10px; 840 padding: 12px 16px; 841 border-radius: 6px; 842 background-color: #F6F8FD; 843 } 844 845 .migration-complete-report .migration-complete-report-item [data-report-details-toggle] { 846 cursor: pointer; 847 display: flex; 848 align-self: center; 849 justify-content: center; 850 } 851 852 .migration-complete-report .migration-complete-report-item .migration-complete-report-icon { 853 display: flex; 854 align-self: center; 855 } 856 857 .migration-complete-report .migration-complete-report-item .migration-complete-report-icon[data-icon="check-filled-white"] { 858 color: #00C57A; 859 } 860 861 .migration-complete-report .migration-complete-report-item .migration-complete-report-icon[data-icon="cross-circle"] { 862 color: #F7393B; 863 } 864 865 .migration-complete-report .migration-complete-report-item .migration-complete-report-text { 866 display: flex; 867 flex-direction: column; 868 gap: 8px; 869 align-items: flex-start; 870 } 871 872 .migration-complete-report .migration-complete-report-with-action { 873 width: 100%; 874 display: flex; 875 flex-direction: row; 876 justify-content: space-between; 877 } 878 879 .migration-complete-report .migration-complete-report-details { 880 display: flex; 881 flex-direction: column; 882 gap: 8px; 883 padding: 0px 16px 16px 16px; 884 max-height: 300px; 885 overflow-y: auto; 886 } 887 888 .migration-complete-report .migration-complete-report-details .migration-complete-report-details-item { 889 display: flex; 890 flex-direction: column; 891 gap: 8px; 892 text-align: left; 893 } 894 895 .migration-complete-report .migration-complete-report-details .migration-complete-report-details-title { 896 color: #5b616f; 897 font-size: 12px; 898 font-weight: 500; 899 } 900 901 .migration-complete-report .migration-complete-report-details .migration-complete-report-details-ids { 902 display: flex; 903 flex-direction: row; 904 flex-wrap: wrap; 905 gap: 8px; 906 } 907 908 .migration-complete-report .migration-complete-report-details .migration-complete-report-details-ids .migration-complete-report-details-ids-item { 909 color: #5b616f; 910 font-size: 12px; 911 font-weight: 500; 912 padding: 4px 8px; 913 border-radius: 4px; 914 background-color: white; 915 } 916 917 .tutor-wc-migration-history-row { 918 .tutor-btn { 919 opacity: 0; 920 float: right; 921 transition: opacity 0.2s ease; 922 } 923 924 &:hover .tutor-btn, 925 .tutor-btn.is-loading { 926 opacity: 1; 927 } 928 } 929 930 @media (max-width: 991px) { 676 931 #tutor-migration-wrapper .migrate-now-btn-wrapper { 677 932 margin-top: 20px; 678 justify-content : flex-start !important; 679 } 933 justify-content: flex-start !important; 934 } 935 680 936 .lp-migration-alert { 681 grid-template-columns : unset;682 } 683 } 937 grid-template-columns: unset; 938 } 939 } -
tutor-lms-migration-tool/trunk/assets/js/admin.js
r3327915 r3378798 1 const { __ } = wp.i18n; 2 1 3 jQuery(document).ready(function ($) { 2 4 'use strict'; 3 const { __} = wp.i18n;5 const { __ } = wp.i18n; 4 6 $(document).on("click", ".install-tutor-button", function (t) { 5 7 t.preventDefault(); … … 62 64 var $that = $(this); 63 65 var $formData = $(this).serialize() + '&action=' + $that.attr('action'); 64 65 66 66 67 let final_types = 'lp'; … … 69 70 migration_vendor = 'ld'; 70 71 } 71 if ($that.attr('action') == 'lif_migrate_all_data_to_tutor') {72 if ($that.attr('action') == 'lif_migrate_all_data_to_tutor') { 72 73 final_types = 'lif'; 73 74 migration_vendor = 'lif'; … … 172 173 clearTimeout(checkProgress); 173 174 clearTimeout(countProgress); 174 $.post(ajaxurl, { 175 migration_type : 'Imported',176 migration_vendor : migration_vendor,175 $.post(ajaxurl, { 176 migration_type: 'Imported', 177 migration_vendor: migration_vendor, 177 178 action: 'insert_tutor_migration_data' 178 179 }); … … 180 181 181 182 const res = data.data; 182 const { total_course_count = 0, failed = [] } = res || {};183 183 const { total_course_count = 0, failed = [] } = res || {}; 184 184 185 if (Number(total_course_count) > 0) { 185 186 if (failed.length > 0) { … … 189 190 } 190 191 } else { 191 $('.lp-error-modal').addClass('active');192 $('.lp-error-modal').addClass('active'); 192 193 } 193 194 }, … … 221 222 removeItem.removeClass('active'); 222 223 } 224 223 225 // migrate now button click 224 226 $(migrateBtn).on('click', function (event) { … … 228 230 } 229 231 }); 230 232 231 233 // migrate now button click 232 234 $(migrateStartBtn).on('click', function (event) { 233 235 event.preventDefault(); 236 $('#wc-sales-data-migration-form').submit(); 234 237 if (totalItemsMigrateCounts > 0) { 235 238 migrationModal.removeClass('active'); … … 272 275 var manualMigrateNowBtn = $('#manual-migrate-now-btn'); 273 276 274 $(document).on('click', '#tutor-migration-browse-file-link a', function (event) {277 $(document).on('click', '#tutor-migration-browse-file-link a', function (event) { 275 278 event.preventDefault(); 276 279 $('#tutor-migration-browse-file').click(); 277 280 }); 278 281 var dropZone = $('.tutor-migration-drag-drop-zone'); 279 $(document).on('change', '#tutor-migration-browse-file', function (event){282 $(document).on('change', '#tutor-migration-browse-file', function (event) { 280 283 var inputEl = $('#tutor-migration-browse-file'); 281 if (this.files[0]) {284 if (this.files[0]) { 282 285 manualMigrateNowBtn.removeAttr('disabled'); 283 286 getFilesAndUpdateDOM(this.files[0], inputEl); … … 289 292 var getFilesAndUpdateDOM = (files, inputEl) => { 290 293 if (files) { 291 inputEl.files = files;292 dropZone.addClass('file-attached');293 dropZone.find('.file-info').html(`File attached - ${files.name}`);294 inputEl.files = files; 295 dropZone.addClass('file-attached'); 296 dropZone.find('.file-info').html(`File attached - ${files.name}`); 294 297 } else { 295 dropZone.removeClass('file-attached');296 dropZone.find('.file-info').html('');298 dropZone.removeClass('file-attached'); 299 dropZone.find('.file-info').html(''); 297 300 } 298 301 }; 299 302 300 $(document).on('click', '.backup-now-btn', function (event) {303 $(document).on('click', '.backup-now-btn', function (event) { 301 304 event.preventDefault(); 302 305 let button = $(this); 303 306 let form = button.closest('form#tutor_migration_export_form'); 304 305 $.post(ajaxurl, { 306 migration_type : 'Exported',307 migration_vendor : form.children("#tutor_migration_vendor").val(),307 308 $.post(ajaxurl, { 309 migration_type: 'Exported', 310 migration_vendor: form.children("#tutor_migration_vendor").val(), 308 311 action: 'insert_tutor_migration_data' 309 312 }); … … 311 314 }) 312 315 313 $(document).on('click', '#manual-migrate-now-btn', function (event) {316 $(document).on('click', '#manual-migrate-now-btn', function (event) { 314 317 let button = $(this); 315 318 var fileType = $('input[name="tutor_import_file"]')[0].files[0].type; 316 if (fileType != 'text/xml') {319 if (fileType != 'text/xml') { 317 320 alert('Not supported file. Upload xml file here!'); 318 321 return; … … 320 323 var action_name = $('#tutor-manual-migrate-form input[name="tutor_action"]').val(); 321 324 let tutor_nonce = $("#tutor-manual-migrate-form input[name='_tutor_nonce']").val(); 322 let http_referer = $("#tutor-manual-migrate-form input[name='_wp_http_referer']").val();323 325 let http_referer = $("#tutor-manual-migrate-form input[name='_wp_http_referer']").val(); 326 324 327 var formData = new FormData(); 325 328 formData.append("tutor_import_file", $('input[name="tutor_import_file"]')[0].files[0]); … … 337 340 }, 338 341 success: function (res) { 339 console.log(res);340 342 if (res.success) { 341 343 $('.lp-success-modal').addClass('active'); 342 $.post(ajaxurl, { 343 migration_type : 'Imported',344 migration_vendor : $('#tutor_migration_vendor').val(),344 $.post(ajaxurl, { 345 migration_type: 'Imported', 346 migration_vendor: $('#tutor_migration_vendor').val(), 345 347 action: 'insert_tutor_migration_data' 346 348 }); … … 356 358 }); 357 359 360 361 /** 362 * 363 * @param {string} addonBaseName 364 * @returns boolean 365 */ 366 367 function isAddonEnabled(addonBaseName) { 368 return !!window._tutorobject?.addons_data?.find( 369 (addon) => addon.base_name === addonBaseName && addon.is_enabled 370 ); 371 } 372 373 374 /** 375 * WooCommerce Migration Block 376 * 377 * @author Themeum <[email protected]> 378 * @link https://themeum.com 379 * @since 2.4.0 380 */ 381 382 // WooCommerce Migration Configuration 383 const WOO_CONFIG = { 384 TABS: { 385 CUSTOM: 'tutor-wc-custom-migrate-tab', 386 AUTO: 'tutor-wc-auto-migrate-tab' 387 }, 388 SELECTORS: { 389 migrationPage: '.tutor-migration-page', 390 migrateBtn: '.migrate-now-btn', 391 navLink: '.tutor-nav-link', 392 activeNavLink: '.tutor-nav-link.is-active', 393 form: '#wc-sales-data-migration-form' 394 }, 395 SECTION_MAP: { 396 orders: "#sectionOrders .j-spinner", 397 coupons: "#sectionCoupons .j-spinner", 398 subscriptions: "#sectionSubscriptions .j-spinner" 399 }, 400 CHECKBOX_CONFIGS: [ 401 { id: 'woo-orders', name: 'job_requirements[]', value: 'orders' }, 402 { id: 'woo-coupons', name: 'job_requirements[]', value: 'coupons' }, 403 { id: 'woo-subscriptions', name: 'job_requirements[]', value: 'subscriptions' } 404 ], 405 WOO_SUBSCRIPTIONS_ADDON_BASE_NAME: 'wc-subscriptions', 406 WOO_MIGRATION_SUCCESS_TITLE: '[data-woo-migration-success-title]', 407 WOO_MIGRATION_SUCCESS_DESC: '[data-woo-migration-success-desc]', 408 WOO_REPORT_ITEMS: { 409 SUCCESS: '[data-woo-migration-report-item="success"]', 410 FAILED: '[data-woo-migration-report-item="failed"]', 411 }, 412 WOO_REPORT_DESCRIPTIONS: { 413 SUCCESS: '[data-woo-migration-report="success"]', 414 FAILED: '[data-woo-migration-report="failed"]', 415 }, 416 WOO_REPORT_DETAILS: '.migration-complete-report-details', 417 WOO_REPORT_DETAILS_TOGGLE: '[data-report-details-toggle]', 418 }; 419 420 const $wooMigrationPage = $(WOO_CONFIG.SELECTORS.migrationPage); 421 const $wooMigrateBtn = $wooMigrationPage.find(WOO_CONFIG.SELECTORS.migrateBtn); 422 const $wooCheckboxes = $wooMigrationPage.find(`#${WOO_CONFIG.TABS.CUSTOM} input[type="checkbox"]`); 423 424 // Store original checkbox state 425 let wooOriginalCheckboxes = []; 426 427 function getWooActiveTab() { 428 return $wooMigrationPage.find(WOO_CONFIG.SELECTORS.activeNavLink).data('tutorNavTarget'); 429 } 430 431 function toggleWooMigrateBtn() { 432 setTimeout(function () { 433 const isCustomTab = getWooActiveTab() === WOO_CONFIG.TABS.CUSTOM; 434 const shouldDisable = isCustomTab && !$wooCheckboxes.is(':checked'); 435 $wooMigrateBtn.prop('disabled', shouldDisable); 436 }, 0); 437 } 438 439 function toggleWooSpinners(tab, mode) { 440 $(`#${tab}`).find('span.j-spinner').each(function () { 441 const $spinner = $(this); 442 $spinner.removeClass('tmtl_spin tmtl_done'); 443 444 if (mode === 'spin') { 445 $spinner.addClass('tmtl_spin'); 446 } else if (mode === 'done') { 447 $spinner.addClass('tmtl_done'); 448 } 449 }); 450 } 451 452 function storeWooCheckboxState() { 453 const $checkboxes = $(`#${WOO_CONFIG.TABS.CUSTOM}`).find('input[type="checkbox"]'); 454 wooOriginalCheckboxes = []; 455 456 $checkboxes.each(function () { 457 const $checkbox = $(this); 458 wooOriginalCheckboxes.push({ 459 id: $checkbox.attr('id'), 460 name: $checkbox.attr('name'), 461 value: $checkbox.attr('value'), 462 class: $checkbox.attr('class'), 463 checked: $checkbox.is(':checked') 464 }); 465 }); 466 } 467 468 function replaceWooCheckboxesWithSpinners() { 469 storeWooCheckboxState(); 470 471 const $checkedCheckboxes = $(`#${WOO_CONFIG.TABS.CUSTOM}`).find('input[type="checkbox"]:checked'); 472 $checkedCheckboxes.each(function () { 473 const inputId = $(this).attr('id'); 474 $(this).replaceWith( 475 `<span id="spinner-${inputId}" class="j-spinner tmtl_spin" data-original-id="${inputId}"></span>` 476 ); 477 }); 478 const $uncheckedCheckboxes = $(`#${WOO_CONFIG.TABS.CUSTOM}`).find('input[type="checkbox"]:not(:checked)'); 479 $uncheckedCheckboxes.each(function () { 480 $(this).attr('disabled', 'disabled'); 481 }); 482 } 483 484 function revertWooCheckboxes() { 485 $(`#${WOO_CONFIG.TABS.CUSTOM}`).find('span.j-spinner').remove(); 486 $(`#${WOO_CONFIG.TABS.CUSTOM}`).find('input[type="checkbox"]:not(:checked):is([disabled])').remove(); 487 488 for (const config of WOO_CONFIG.CHECKBOX_CONFIGS) { 489 const checkboxHtml = ` 490 <input 491 id="${config.id}" 492 type="checkbox" 493 name="${config.name}" 494 value="${config.value}" 495 class="tutor-form-check-input lp-migration-singlebox-checkbox" 496 >`; 497 498 $(`label[for="${config.id}"]`) 499 .closest('.tutor-form-check') 500 .prepend(checkboxHtml); 501 }; 502 503 toggleWooMigrateBtn(); 504 } 505 506 function updateWooProgressSpinners(response) { 507 if (!response.requirements) return; 508 509 const activeTab = getWooActiveTab(); 510 511 for (const [key, requirement] of Object.entries(response.requirements)) { 512 const $spinner = $(`#${activeTab} ${WOO_CONFIG.SECTION_MAP[key]}`); 513 514 if (!$spinner.length) { 515 return; 516 } 517 518 $spinner.toggleClass('tmtl_spin', !requirement.is_done) 519 .toggleClass('tmtl_done', requirement.is_done); 520 }; 521 } 522 523 /** 524 * Generate progress message 525 * 526 * @since 2.4.0 527 * @param {Object} optionsValue - Migration options data. 528 * @param {'succeed' | 'failed'} type - Type of progress to report. 529 * @return {string} 530 */ 531 function generateProgressMessage(optionsValue, type = 'succeed') { 532 if (!optionsValue?.requirements || typeof optionsValue.requirements !== 'object') { 533 return ''; 534 } 535 536 const messageParts = []; 537 538 for (const [key, requirement] of Object.entries(optionsValue.requirements)) { 539 if (Array.isArray(requirement[type])) { 540 const count = requirement[type].length; 541 const capitalizedKey = key.charAt(0).toUpperCase() + key.slice(1).toLowerCase(); 542 543 if (count > 0) { 544 messageParts.push(`${capitalizedKey} (${count})`); 545 } 546 } 547 } 548 549 return messageParts.join(', '); 550 } 551 552 /** 553 * Generate Error Report Details 554 * 555 * @param {Object} optionsValue - Migration options data. 556 * 557 * @return {string} 558 */ 559 function generateErrorReportDetails(optionsValue) { 560 const reportDetails = []; 561 for (const [key, requirement] of Object.entries(optionsValue?.requirements)) { 562 if (Array.isArray(requirement.failed)) { 563 if (requirement.failed.length === 0) continue; 564 565 const failedIds = requirement.failed.map((failedId) => `<div class="migration-complete-report-details-ids-item">${failedId}</div>`).join(''); 566 reportDetails.push(` 567 <div class="migration-complete-report-details-item"> 568 <div class="migration-complete-report-details-title"> 569 ${key.charAt(0).toUpperCase() + key.slice(1).toLowerCase()} 570 </div> 571 <div class="migration-complete-report-details-ids"> 572 ${failedIds} 573 </div> 574 </div> 575 `); 576 } 577 } 578 return reportDetails.join(''); 579 } 580 581 function handleWooMigrationSuccess(response) { 582 const succeedReport = generateProgressMessage(response, 'succeed'); 583 const failedReport = generateProgressMessage(response, 'failed'); 584 const activeTab = getWooActiveTab(); 585 586 const hasSuccess = succeedReport.length > 0; 587 const hasFailed = failedReport.length > 0; 588 589 $(hasSuccess ? '.lp-success-modal' : '.lp-error-modal').addClass('active'); 590 591 const [title, description] = hasSuccess && hasFailed 592 ? [__('Migration Complete with Errors', 'tutor-lms-migration-tool'), __('The migration process has finished, but some items could not be imported. ', 'tutor-lms-migration-tool')] 593 : [__('Migration Successful!', 'tutor-lms-migration-tool'), __('Your data has been successfully migrated from WooCommerce to Tutor LMS native eCommerce.', 'tutor-lms-migration-tool')]; 594 595 $(WOO_CONFIG.WOO_MIGRATION_SUCCESS_TITLE).text(__(title, 'tutor-lms-migration-tool')); 596 $(WOO_CONFIG.WOO_MIGRATION_SUCCESS_DESC).text(__(description, 'tutor-lms-migration-tool')); 597 598 $wooMigrateBtn.removeAttr('disabled'); 599 window.onbeforeunload = null; 600 $('.tutor-migration-tab .tutor-nav-link').removeClass('disabled'); 601 toggleWooSpinners(activeTab, 'stop'); 602 603 if (activeTab === WOO_CONFIG.TABS.CUSTOM) { 604 revertWooCheckboxes(); 605 } 606 607 $(WOO_CONFIG.WOO_REPORT_ITEMS.SUCCESS).toggle(hasSuccess); 608 $(WOO_CONFIG.WOO_REPORT_ITEMS.FAILED).toggle(hasFailed); 609 610 if (hasSuccess) { 611 $(WOO_CONFIG.WOO_REPORT_DESCRIPTIONS.SUCCESS).text(succeedReport); 612 } 613 614 if (hasFailed) { 615 $(WOO_CONFIG.WOO_REPORT_DESCRIPTIONS.FAILED).text(failedReport); 616 $(WOO_CONFIG.WOO_REPORT_DETAILS).html(generateErrorReportDetails(response)); 617 } 618 619 getWooMigrationHistory(); 620 } 621 622 function handleWooMigrationError() { 623 $('.lp-error-modal').addClass('active'); 624 const activeTab = getWooActiveTab(); 625 toggleWooSpinners(activeTab, 'stop'); 626 $('.tutor-migration-tab .tutor-nav-link') 627 .removeClass('disabled'); 628 $wooMigrateBtn.removeAttr('disabled'); 629 window.onbeforeunload = null; 630 631 if (activeTab === WOO_CONFIG.TABS.CUSTOM) { 632 revertWooCheckboxes(); 633 } 634 } 635 636 function pollWooMigrationProgress(jobId) { 637 $.ajax({ 638 url: ajaxurl, 639 type: 'POST', 640 data: { 641 action: 'tlmt_migrate_sales_data', 642 job_id: jobId 643 }, 644 success: function (data) { 645 const activeTab = getWooActiveTab(); 646 const response = data.data; 647 648 if (!response) { 649 console.error("Invalid WooCommerce migration progress response", response); 650 return; 651 } 652 653 updateWooProgressSpinners(response); 654 655 const progress = parseInt(response.progress, 10); 656 657 if (progress < 100) { 658 pollWooMigrationProgress(jobId); 659 } else { 660 handleWooMigrationSuccess(response); 661 } 662 }, 663 error: function (xhr, status, error) { 664 console.error("WooCommerce migration polling failed", { status, error, response: xhr.responseText }); 665 handleWooMigrationError(); 666 throw new Error("WooCommerce migration polling failed"); 667 } 668 }); 669 } 670 671 function handleWooMigrationStart() { 672 $wooMigrateBtn.attr('disabled', 'disabled'); 673 $('.tutor-migration-tab .tutor-nav-link') 674 .addClass('disabled'); 675 676 if (getWooActiveTab() === WOO_CONFIG.TABS.CUSTOM) { 677 replaceWooCheckboxesWithSpinners(); 678 } else { 679 toggleWooSpinners(WOO_CONFIG.TABS.AUTO, 'spin'); 680 } 681 682 window.onbeforeunload = function () { 683 return 'Migration is in progress. Are you sure you want to leave?'; 684 }; 685 } 686 687 function prepareWooFormData(form) { 688 const formData = new FormData(form); 689 formData.append('action', 'tlmt_migrate_sales_data'); 690 formData.append('job_id', 0); 691 692 if (getWooActiveTab() !== WOO_CONFIG.TABS.CUSTOM) { 693 formData.delete('job_requirements[]'); 694 formData.append('job_requirements[]', 'orders'); 695 formData.append('job_requirements[]', 'coupons'); 696 if (isAddonEnabled(WOO_CONFIG.WOO_SUBSCRIPTIONS_ADDON_BASE_NAME)) { 697 formData.append('job_requirements[]', 'subscriptions'); 698 } 699 } 700 701 return formData; 702 } 703 704 function getWooMigrationHistory() { 705 $.ajax({ 706 url: ajaxurl, 707 type: 'POST', 708 data: { 709 action: 'tmlt_get_sales_data_history', 710 }, 711 success: function (data) { 712 const history = data.data; 713 const $migrationHistory = $('.tutor-migration-history'); 714 715 if (!history.length) { 716 $migrationHistory.addClass('tutor-d-none'); 717 return; 718 } 719 720 $migrationHistory.removeClass('tutor-d-none'); 721 722 const $tbody = $('.tutor-migration-history tbody') 723 $tbody.empty(); 724 725 history.forEach((item) => { 726 const $row = $(` 727 <tr class="tutor-wc-migration-history-row"> 728 <td> 729 <div class="tutor-migration-history-time tutor-fs-7 tutor-pl-24 tutor-fw-normal"> 730 ${item.title} 731 </div> 732 </td> 733 <td> 734 <div class="tutor-migration-history-time tutor-fs-7 tutor-pl-24 tutor-fw-normal"> 735 ${item.started_at} 736 </div> 737 </td> 738 <td> 739 <div class="tutor-btn tutor-btn-outline-primary tutor-btn-sm tutor-mr-4 tutor-wc-history-delete-btn" 740 data-wc-option-id="${item.id}"> 741 Delete 742 </div> 743 </td> 744 </tr> 745 `); 746 $tbody.append($row); 747 }); 748 }, 749 error: function (xhr, status, error) { 750 console.error("Failed to get WooCommerce migration history", { status, error, response: xhr.responseText }); 751 throw new Error("Failed to get WooCommerce migration history"); 752 } 753 }); 754 } 755 756 // WooCommerce Migration Event Handlers 757 $wooMigrationPage.find(WOO_CONFIG.SELECTORS.navLink).on('click', function (e) { 758 e.preventDefault(); 759 toggleWooMigrateBtn(); 760 }); 761 762 $(WOO_CONFIG.WOO_REPORT_DETAILS_TOGGLE).on('click', function (e) { 763 e.preventDefault(); 764 $(WOO_CONFIG.WOO_REPORT_DETAILS).toggleClass('tutor-d-none'); 765 }); 766 767 $wooCheckboxes.on('change', toggleWooMigrateBtn); 768 769 $(document).on('submit', WOO_CONFIG.SELECTORS.form, function (event) { 770 event.preventDefault(); 771 772 const formData = prepareWooFormData(this); 773 774 $.ajax({ 775 url: ajaxurl, 776 type: 'POST', 777 data: formData, 778 processData: false, 779 contentType: false, 780 beforeSend: handleWooMigrationStart, 781 success: function (data) { 782 const activeTab = getWooActiveTab(); 783 const response = data.data; 784 if (response && response.job_id && response.progress < 100) { 785 pollWooMigrationProgress(response.job_id); 786 return; 787 } 788 789 handleWooMigrationSuccess(response); 790 }, 791 error: handleWooMigrationError, 792 }); 793 }); 794 795 // Delete history 796 $(document).on('click', '.tutor-wc-history-delete-btn', function (event) { 797 event.preventDefault(); 798 799 const $btn = $(this); 800 const optionId = $btn.data('wc-option-id'); 801 if (!optionId) return; 802 803 $.ajax({ 804 url: ajaxurl, 805 type: 'POST', 806 data: { 807 action: 'tlmt_delete_sales_data_history', 808 option_id: optionId, 809 }, 810 beforeSend: function () { 811 $btn.addClass('is-loading'); 812 $btn.prop('disabled', true); 813 $btn.text(''); 814 }, 815 success: function (data) { 816 if (data.status_code === 200) { 817 $btn.closest('tr').remove(); 818 } else { 819 $btn.removeClass('is-loading').prop('disabled', false).text('Delete'); 820 } 821 getWooMigrationHistory(); 822 }, 823 error: function (xhr, status, error) { 824 console.error('Failed to delete history', { status, error, response: xhr.responseText }); 825 $btn.removeClass('is-loading').prop('disabled', false).text('Delete'); 826 }, 827 }); 828 }); 829 830 831 // Initialize WooCommerce migration 832 toggleWooMigrateBtn(); 833 358 834 }); /* ./ jQuery */ 359 835 … … 363 839 364 840 dropZoneInputs.forEach((inputEl) => { 365 const dropZone = inputEl.closest('.tutor-migration-drag-drop-zone');366 ['dragover', 'dragleave', 'dragend'].forEach((dragEvent) => {367 if (dragEvent === 'dragover') {368 dropZone.addEventListener(dragEvent, (e) => {369 e.preventDefault();370 dropZone.classList.add('dragover');371 });372 } else {373 dropZone.addEventListener(dragEvent, (e) => {374 dropZone.classList.remove('dragover');375 });376 }377 });378 379 dropZone.addEventListener('drop', (e) => {380 e.preventDefault();381 const files = e.dataTransfer.files;382 getFilesAndUpdateDOM(files, inputEl, dropZone);383 dropZone.classList.remove('dragover');384 });385 386 // inputEl.addEventListener('change', (e) => {841 const dropZone = inputEl.closest('.tutor-migration-drag-drop-zone'); 842 ['dragover', 'dragleave', 'dragend'].forEach((dragEvent) => { 843 if (dragEvent === 'dragover') { 844 dropZone.addEventListener(dragEvent, (e) => { 845 e.preventDefault(); 846 dropZone.classList.add('dragover'); 847 }); 848 } else { 849 dropZone.addEventListener(dragEvent, (e) => { 850 dropZone.classList.remove('dragover'); 851 }); 852 } 853 }); 854 855 dropZone.addEventListener('drop', (e) => { 856 e.preventDefault(); 857 const files = e.dataTransfer.files; 858 getFilesAndUpdateDOM(files, inputEl, dropZone); 859 dropZone.classList.remove('dragover'); 860 }); 861 862 // inputEl.addEventListener('change', (e) => { 387 863 // const files = e.target.files; 388 // getFilesAndUpdateDOM(files, inputEl, dropZone);389 // });390 864 // getFilesAndUpdateDOM(files, inputEl, dropZone); 865 // }); 866 391 867 }); 392 868 393 869 const getFilesAndUpdateDOM = (files, inputEl, dropZone) => { 394 if (files.length) {395 inputEl.files = files;396 dropZone.classList.add('file-attached');397 dropZone.querySelector('.file-info').innerHTML = `File attached - ${files[0].name}`;870 if (files.length) { 871 inputEl.files = files; 872 dropZone.classList.add('file-attached'); 873 dropZone.querySelector('.file-info').innerHTML = `File attached - ${files[0].name}`; 398 874 document.querySelector('#manual-migrate-now-btn').removeAttribute('disabled'); 399 } else {400 dropZone.classList.remove('file-attached');401 dropZone.querySelector('.file-info').innerHTML = '';402 }875 } else { 876 dropZone.classList.remove('file-attached'); 877 dropZone.querySelector('.file-info').innerHTML = ''; 878 } 403 879 }; -
tutor-lms-migration-tool/trunk/classes/Utils.php
r3132123 r3378798 1 <?php 1 <?php 2 3 use Tutor\Helpers\QueryHelper; 2 4 3 5 class Utils { 4 6 5 public function fetch_history($vendor) {6 global $wpdb;7 $result = $wpdb->get_results(8 $wpdb->prepare(9 "SELECT * FROM {$wpdb->prefix}tutor_migration7 public function fetch_history( $vendor ) { 8 global $wpdb; 9 $result = $wpdb->get_results( 10 $wpdb->prepare( 11 "SELECT * FROM {$wpdb->prefix}tutor_migration 10 12 WHERE `migration_vendor` = %s 11 13 ORDER BY ID DESC 12 14 LIMIT %d, %d", 13 $vendor, 0, 20 14 ) 15 ); 16 return $result; 17 } 18 /** 19 * LearnDash functions. 20 */ 15 $vendor, 16 0, 17 20 18 ) 19 ); 20 return $result; 21 } 22 /** 23 * LearnDash functions. 24 */ 25 public function ld_course_count() { 26 global $wpdb; 27 return (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'sfwd-courses' AND post_status = 'publish';" ); 28 } 21 29 22 public function ld_course_count(){23 global $wpdb;24 return (int) $wpdb->get_var("SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'sfwd-courses' AND post_status = 'publish';");25 }26 30 27 28 public function ld_orders_count(){ 29 global $wpdb; 30 return (int) $wpdb->get_var("SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'sfwd-transactions' AND post_status = 'publish';"); 31 } 31 public function ld_orders_count() { 32 global $wpdb; 33 return (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'sfwd-transactions' AND post_status = 'publish';" ); 34 } 32 35 33 /** 34 * LearnPress functions. 35 */ 36 /** 37 * LearnPress functions. 38 */ 39 public function lp_course_count() { 40 global $wpdb; 41 return (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'lp_course' AND post_status = 'publish';" ); 42 } 36 43 37 public function lp_course_count(){38 global $wpdb;39 return (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'lp_course' AND post_status = 'publish';" );40 }44 public function lp_orders_count() { 45 global $wpdb; 46 return (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'lp_order';" ); 47 } 41 48 42 public function lp_orders_count(){43 global $wpdb;44 return (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'lp_order';" );45 }49 public function lp_reviews_count() { 50 global $wpdb; 51 return (int) $wpdb->get_var( "SELECT COUNT(comments.comment_ID) FROM {$wpdb->comments} comments INNER JOIN {$wpdb->commentmeta} cm ON cm.comment_id = comments.comment_ID AND cm.meta_key = '_lpr_rating' WHERE comments.comment_type = 'review';" ); 52 } 46 53 47 public function lp_reviews_count(){ 48 global $wpdb; 49 return (int) $wpdb->get_var( "SELECT COUNT(comments.comment_ID) FROM {$wpdb->comments} comments INNER JOIN {$wpdb->commentmeta} cm ON cm.comment_id = comments.comment_ID AND cm.meta_key = '_lpr_rating' WHERE comments.comment_type = 'review';" ); 50 } 54 /** 55 * Lifter lms functions . 56 * 57 * @return void 58 */ 59 public function lfter_course_count() { 60 global $wpdb; 61 return (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'course' AND post_status = 'publish';" ); 62 } 63 public function lifter_orders_count() { 64 global $wpdb; 65 return (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'llms_order';" ); 66 } 67 public function lifter_reviews_count() { 68 global $wpdb; 69 return (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type='llms_review';" ); 70 } 51 71 52 /** 53 * Lifter lms functions . 54 * 55 * @return void 56 */ 57 58 public function lfter_course_count(){ 59 global $wpdb; 60 return (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'course' AND post_status = 'publish';" ); 61 } 62 public function lifter_orders_count(){ 63 global $wpdb; 64 return (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type = 'llms_order';" ); 65 } 66 public function lifter_reviews_count(){ 67 global $wpdb; 68 return (int) $wpdb->get_var("SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_type='llms_review';"); 69 } 70 71 /** 72 * Check if user has access to tutor courses. 73 * 74 * @return void 75 */ 76 public static function check_course_access(){ 77 if ( ! current_user_can( 'publish_tutor_courses' ) ) { 78 wp_send_json( array( 'success'=> false, 'message' => tutor_utils()->error_message() ) ); 79 } 80 } 81 72 /** 73 * Check if user has access to tutor courses. 74 * 75 * @return void 76 */ 77 public static function check_course_access() { 78 if ( current_user_can( 'manage_options' ) || ! current_user_can( 'publish_tutor_courses' ) ) { 79 wp_send_json( 80 array( 81 'success' => false, 82 'message' => tutor_utils()->error_message(), 83 ) 84 ); 85 } 86 } 82 87 } -
tutor-lms-migration-tool/trunk/inc/Functions.php
r3327915 r3378798 16 16 use Themeum\TutorLMSMigrationTool\Factories\ProductFactory; 17 17 use Themeum\TutorLMSMigrationTool\Factories\ReviewFactory; 18 use Themeum\TutorLMSMigrationTool\Factories\SalesDataFactory; 18 19 19 20 if ( ! function_exists( 'tlmt_has_tutor_pro' ) ) { … … 371 372 } 372 373 } 374 375 if ( ! function_exists( 'tlmt_get_sales_data_object' ) ) { 376 /** 377 * Get readable formatted time using a timestamp 378 * 379 * @since 2.3.0 380 * 381 * @param string $data_type Data type like: orders, subscriptions, etc. 382 * @param string $migration_type Migration type like: woocommerce_to_native. 383 * 384 * @throws \Throwable Throw invalid argument exception if 385 * data or migration type is not supported. 386 * @return MigrationTemplate object 387 */ 388 function tlmt_get_sales_data_object( $data_type, $migration_type ) { 389 try { 390 return SalesDataFactory::create( $data_type, $migration_type ); 391 } catch ( \Throwable $th ) { 392 throw $th; 393 } 394 } 395 } -
tutor-lms-migration-tool/trunk/inc/Init.php
r3327915 r3378798 10 10 11 11 namespace Themeum\TutorLMSMigrationTool; 12 13 use Themeum\TutorLMSMigrationTool\SalesData\InitSalesMigration; 14 use Themeum\TutorLMSMigrationTool\SalesData\MigrationHandler; 12 15 13 16 if ( ! defined( 'ABSPATH' ) ) { … … 38 41 private function boot() { 39 42 new ActionHandler(); 43 44 // Init WC to Native sales data migration. 45 new InitSalesMigration(); 46 new MigrationHandler(); 40 47 } 41 48 } -
tutor-lms-migration-tool/trunk/inc/MigrationTypes.php
r3327915 r3378798 21 21 const LP_TO_TUTOR = 'learnpress_to_tutor'; 22 22 const LIF_TO_TUTOR = 'lifter_to_tutor'; 23 24 // sales data migration types. 25 const WC_TO_NATIVE = 'woocommerce_to_native'; 23 26 } -
tutor-lms-migration-tool/trunk/readme.txt
r3329380 r3378798 2 2 Contributors: themeum 3 3 Donate link: https://www.themeum.com 4 Tags: lms, migration, course, elearning, education4 Tags: LMS, migration, course, elearning, education 5 5 Requires at least: 5.0 6 6 Tested up to: 6.8 7 7 Requires PHP: 7.4 8 Stable tag: 2. 3.18 Stable tag: 2.4.0 9 9 License: GPLv3 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 19 19 No need to hassle with complicated migration settings when you can use Tutor LMS Migration Tool with its easy user interface. With its simple one-click auto migration settings you can have all the information from your old LMS plugin transferred without any database error. 20 20 21 = UPDATES =22 23 In this version of Tutor LMS Migration Tool, we are introducing migration options from major LMS plugin to Tutor LMS. We have a roadmap to bring you compatibility support for migration with many other plugins in the future.21 = KEY FEATURES = 22 23 The Tutor LMS Migration Tool allows you to seamlessly migrate data from major LMS plugins and WooCommerce into Tutor LMS. We're also actively working on expanding compatibility with more plugins and platforms in future updates. 24 24 25 25 Currently Tutor LMS Migration support migration options from 26 26 27 27 * LearnDash 28 * LearnPress & 29 * LifterLMS 28 * LearnPress 29 * LifterLMS & 30 * WooCommerce to Tutor LMS Native eCommerce migration 30 31 31 32 = Pre-requisites = 32 33 33 To get started with migrating your information from LearnDash/LearnPress/LifterLMS to Tutor LMS in the easiest way, you need to make sure you have the following plugins installed.34 35 **Note:** Currently the Tutor LMS Migration Tool supports migration from LearnDash, LearnPress, and LifterLMS to Tutor LMS. We are working hard to bring migration options from other LMS to Tutor LMS as soon as possible. But as it only supports migration from LearnPress/LearnDash the following plugins are required36 37 * Tutor LMS ( Version 3.6or later)34 To get started with migrating your data from existing LMS to Tutor LMS in the easiest way, you need to make sure you have the following plugins installed. 35 36 **Note:** Currently the Tutor LMS Migration Tool supports migration from LearnDash, LearnPress, LifterLMS, and WooCommerce to Tutor LMS. 37 38 * Tutor LMS (v3.8 or later) 38 39 39 40 And the following plugins for their respective migrations 40 41 41 * For LearnDash ( Version 4.0 or later) 42 * For LearnPress (Version 4.0 or later) 43 * For LifterLMS ( Version 8.0 or later) 42 * For LearnDash (v4.0 or later) 43 * For LearnPress (v4.0 or later) 44 * For LifterLMS (v8.0 or later) 45 * For WooCommerce (v10.0 or later) 46 * For WooCommerce Subscriptions (v7.8 or later) 44 47 45 48 You need the mentioned versions or later of the plugin for the migration to work properly. … … 47 50 = Get Started = 48 51 49 After you install the migration plugin in your WordPress site you will find the migration option in the Tools menu of Tutor LMS. 50 51 LearnDash Migrationsupports the migration of the following data types:52 fter installing the Migration Tool plugin on your WordPress site, you’ll find the migration option under the Tools menu in Tutor LMS. Below is a list of available data which you can migrate to Tutor LMS: 53 54 **LearnDash Migration** supports the migration of the following data types: 52 55 53 56 * Courses … … 60 63 * Course Reviews 61 64 62 LearnPress Migrationsupports the migration of the following data types:65 **LearnPress Migration** supports the migration of the following data types: 63 66 64 67 * Courses … … 72 75 * Course Complete Status 73 76 74 LifterLMS Migrationsupports the migration of the following data types:77 **LifterLMS Migration** supports the migration of the following data types: 75 78 76 79 * Courses … … 81 84 * Enrollment 82 85 86 **WooCommerce Migration** supports the migration of the following data types: 87 88 * Orders 89 * Subscriptions 90 * Coupons 91 83 92 For quick migrations, click on the "Migrate Now" button to get your migration process started. Sit back and enjoy while the Tutor LMS Migration Tool handles all your database information during the migration process. After the migration tool is done, you can start using Tutor LMS from where you left off in your previous LMS. 84 93 … … 98 107 = Automatic installation = 99 108 100 The automatic installation is the easiest way to install any plugin in WordPress. You can perform an automatic installation of Tutor by logging in to your WordPress dashboard, navigating to the "Plugins" menu and click on the "Add New"button.101 102 This will open up a page showing all the available plugins in WordPress. In the search field, type Tutor. The search result will show you our Tutor plugin, you can then see the detailed info by clicking on "More Details" and to install just click on the "Install Now"button.109 The easiest way to install any plugin in WordPress is through automatic installation. To install Tutor LMS Migration Tool this way, log in to your WordPress dashboard, navigate to the Plugins menu, and click the Add New button. 110 111 On the Add Plugins page, use the search bar to type “Tutor LMS Migration Tool”. Once the plugin appears in the search results, simply click the Install Now button. 103 112 104 113 = Manual installation = … … 110 119 == Frequently Asked Questions == 111 120 112 = Is This Plugin has any Dependency? =113 114 Yes, You need to install the [Tutor LMS](https://wordpress.org/plugins/tutor/) plugin in order to use this plugin. Take a backaup of your full website before migrate.115 116 = I need migrate others LMS data to Tutor LMS, what should I do? =117 118 We will add others LMS migration to this plugin, so you can migrate it. Or if you don't required any previous data, just delete other LMS and move to Tutor LMS.121 = Is this plugin has any dependency? = 122 123 Yes, you need to install the [Tutor LMS](https://wordpress.org/plugins/tutor/) plugin in order to use this plugin. Take a backaup of your full website before migrating your data. 124 125 = I want to migrate data from another LMS to Tutor LMS. How can I do that? = 126 127 You can use the Tutor LMS Migration Tool to transfer data from another LMS platforms to Tutor LMS. To learn more about the full process, please check the [official migration documentation](https://docs.themeum.com/tutor-lms/migration/). 119 128 120 129 == Screenshots == … … 127 136 == Changelog == 128 137 129 = 2.3.1 - 17 July, 2025 = 130 131 Fix: Fixed an issue where the vendor autoload file was missing. 132 133 = 2.3.0 - 15 July, 2025 = 138 = 2.4.0 - 15 October, 2025 = 139 140 New: Migrate orders from WooCommerce to Tutor Native, including associated enrollments, customers, and earnings. 141 New: Migrate subscriptions from WooCommerce to Tutor Native, including related enrollments, customers, and earnings. 142 New: Migrate coupons from WooCommerce to Tutor Native. 143 144 = 2.3.0 - 14 July, 2025 = 134 145 135 146 New: Added support for migrating assignments from LearnDash to Tutor LMS. -
tutor-lms-migration-tool/trunk/tutor-lms-migration-tool.php
r3329380 r3378798 5 5 * Description: A migration toolkit that allows you to migrate data from other LMS platforms to Tutor LMS. 6 6 * Author: Themeum 7 * Version: 2. 3.17 * Version: 2.4.0 8 8 * Author URI: http://themeum.com 9 9 * Requires at least: 5.3 … … 31 31 */ 32 32 33 define( 'TLMT_VERSION', '2. 3.1' );33 define( 'TLMT_VERSION', '2.4.0' ); 34 34 define( 'TLMT_FILE', __FILE__ ); 35 35 define( 'TLMT_PATH', plugin_dir_path( TLMT_FILE ) ); … … 85 85 86 86 // Init. 87 new Init(); 87 add_action( 88 'plugins_loaded', 89 function() { 90 new Init(); 91 } 92 ); 88 93 89 94 if ( is_plugin_active( 'tutor/tutor.php' ) ) { -
tutor-lms-migration-tool/trunk/vendor/composer/autoload_classmap.php
r3329380 r3378798 20 20 'Themeum\\TutorLMSMigrationTool\\Factories\\ProductFactory' => $baseDir . '/inc/Factories/ProductFactory.php', 21 21 'Themeum\\TutorLMSMigrationTool\\Factories\\ReviewFactory' => $baseDir . '/inc/Factories/ReviewFactory.php', 22 'Themeum\\TutorLMSMigrationTool\\Factories\\SalesDataFactory' => $baseDir . '/inc/Factories/SalesDataFactory.php', 22 23 'Themeum\\TutorLMSMigrationTool\\Factories\\StudentProgressFactory' => $baseDir . '/inc/Factories/StudentProgressFactory.php', 23 24 'Themeum\\TutorLMSMigrationTool\\Init' => $baseDir . '/inc/Init.php', 25 'Themeum\\TutorLMSMigrationTool\\Interfaces\\DataTransformer' => $baseDir . '/inc/Interfaces/DataTransformer.php', 26 'Themeum\\TutorLMSMigrationTool\\Interfaces\\MigrationTemplate' => $baseDir . '/inc/Interfaces/MigrationTemplate.php', 24 27 'Themeum\\TutorLMSMigrationTool\\Interfaces\\Order' => $baseDir . '/inc/Interfaces/Order.php', 25 28 'Themeum\\TutorLMSMigrationTool\\Interfaces\\Post' => $baseDir . '/inc/Interfaces/Post.php', … … 42 45 'Themeum\\TutorLMSMigrationTool\\LDMigration\\StudentProgress' => $baseDir . '/inc/LDMigration/StudentProgress.php', 43 46 'Themeum\\TutorLMSMigrationTool\\MigrationLogger' => $baseDir . '/inc/MigrationLogger.php', 47 'Themeum\\TutorLMSMigrationTool\\MigrationMapper' => $baseDir . '/inc/MigrationMapper.php', 44 48 'Themeum\\TutorLMSMigrationTool\\MigrationTypes' => $baseDir . '/inc/MigrationTypes.php', 49 'Themeum\\TutorLMSMigrationTool\\SalesDataTypes' => $baseDir . '/inc/SalesDataTypes.php', 50 'Themeum\\TutorLMSMigrationTool\\SalesData\\InitSalesMigration' => $baseDir . '/inc/SalesData/InitSalesMigration.php', 51 'Themeum\\TutorLMSMigrationTool\\SalesData\\JobHandler' => $baseDir . '/inc/SalesData/JobHandler.php', 52 'Themeum\\TutorLMSMigrationTool\\SalesData\\MigrationHandler' => $baseDir . '/inc/SalesData/MigrationHandler.php', 53 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Coupons\\Coupons' => $baseDir . '/inc/SalesData/WooToNative/Coupons/Coupons.php', 54 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Customers\\Customers' => $baseDir . '/inc/SalesData/WooToNative/Customers/Customers.php', 55 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Helper' => $baseDir . '/inc/SalesData/WooToNative/Helper.php', 56 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Orders\\Earnings' => $baseDir . '/inc/SalesData/WooToNative/Orders/Earnings.php', 57 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Orders\\Orders' => $baseDir . '/inc/SalesData/WooToNative/Orders/Orders.php', 58 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Subscriptions\\Subscriptions' => $baseDir . '/inc/SalesData/WooToNative/Subscriptions/Subscriptions.php', 59 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Subscriptions\\Transformers\\EnrollmentDataTransformer' => $baseDir . '/inc/SalesData/WooToNative/Subscriptions/Transformers/EnrollmentDataTransformer.php', 60 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Subscriptions\\Transformers\\OrderDataTransformer' => $baseDir . '/inc/SalesData/WooToNative/Subscriptions/Transformers/OrderDataTransformer.php', 61 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Subscriptions\\Transformers\\PlanDataTransformer' => $baseDir . '/inc/SalesData/WooToNative/Subscriptions/Transformers/PlanDataTransformer.php', 62 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Subscriptions\\Transformers\\SubscriptionDataTransformer' => $baseDir . '/inc/SalesData/WooToNative/Subscriptions/Transformers/SubscriptionDataTransformer.php', 45 63 'TutorLMSMigrationTool' => $baseDir . '/classes/TutorLMSMigrationTool.php', 46 64 'Utils' => $baseDir . '/classes/Utils.php', -
tutor-lms-migration-tool/trunk/vendor/composer/autoload_static.php
r3329380 r3378798 39 39 'Themeum\\TutorLMSMigrationTool\\Factories\\ProductFactory' => __DIR__ . '/../..' . '/inc/Factories/ProductFactory.php', 40 40 'Themeum\\TutorLMSMigrationTool\\Factories\\ReviewFactory' => __DIR__ . '/../..' . '/inc/Factories/ReviewFactory.php', 41 'Themeum\\TutorLMSMigrationTool\\Factories\\SalesDataFactory' => __DIR__ . '/../..' . '/inc/Factories/SalesDataFactory.php', 41 42 'Themeum\\TutorLMSMigrationTool\\Factories\\StudentProgressFactory' => __DIR__ . '/../..' . '/inc/Factories/StudentProgressFactory.php', 42 43 'Themeum\\TutorLMSMigrationTool\\Init' => __DIR__ . '/../..' . '/inc/Init.php', 44 'Themeum\\TutorLMSMigrationTool\\Interfaces\\DataTransformer' => __DIR__ . '/../..' . '/inc/Interfaces/DataTransformer.php', 45 'Themeum\\TutorLMSMigrationTool\\Interfaces\\MigrationTemplate' => __DIR__ . '/../..' . '/inc/Interfaces/MigrationTemplate.php', 43 46 'Themeum\\TutorLMSMigrationTool\\Interfaces\\Order' => __DIR__ . '/../..' . '/inc/Interfaces/Order.php', 44 47 'Themeum\\TutorLMSMigrationTool\\Interfaces\\Post' => __DIR__ . '/../..' . '/inc/Interfaces/Post.php', … … 61 64 'Themeum\\TutorLMSMigrationTool\\LDMigration\\StudentProgress' => __DIR__ . '/../..' . '/inc/LDMigration/StudentProgress.php', 62 65 'Themeum\\TutorLMSMigrationTool\\MigrationLogger' => __DIR__ . '/../..' . '/inc/MigrationLogger.php', 66 'Themeum\\TutorLMSMigrationTool\\MigrationMapper' => __DIR__ . '/../..' . '/inc/MigrationMapper.php', 63 67 'Themeum\\TutorLMSMigrationTool\\MigrationTypes' => __DIR__ . '/../..' . '/inc/MigrationTypes.php', 68 'Themeum\\TutorLMSMigrationTool\\SalesDataTypes' => __DIR__ . '/../..' . '/inc/SalesDataTypes.php', 69 'Themeum\\TutorLMSMigrationTool\\SalesData\\InitSalesMigration' => __DIR__ . '/../..' . '/inc/SalesData/InitSalesMigration.php', 70 'Themeum\\TutorLMSMigrationTool\\SalesData\\JobHandler' => __DIR__ . '/../..' . '/inc/SalesData/JobHandler.php', 71 'Themeum\\TutorLMSMigrationTool\\SalesData\\MigrationHandler' => __DIR__ . '/../..' . '/inc/SalesData/MigrationHandler.php', 72 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Coupons\\Coupons' => __DIR__ . '/../..' . '/inc/SalesData/WooToNative/Coupons/Coupons.php', 73 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Customers\\Customers' => __DIR__ . '/../..' . '/inc/SalesData/WooToNative/Customers/Customers.php', 74 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Helper' => __DIR__ . '/../..' . '/inc/SalesData/WooToNative/Helper.php', 75 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Orders\\Earnings' => __DIR__ . '/../..' . '/inc/SalesData/WooToNative/Orders/Earnings.php', 76 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Orders\\Orders' => __DIR__ . '/../..' . '/inc/SalesData/WooToNative/Orders/Orders.php', 77 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Subscriptions\\Subscriptions' => __DIR__ . '/../..' . '/inc/SalesData/WooToNative/Subscriptions/Subscriptions.php', 78 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Subscriptions\\Transformers\\EnrollmentDataTransformer' => __DIR__ . '/../..' . '/inc/SalesData/WooToNative/Subscriptions/Transformers/EnrollmentDataTransformer.php', 79 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Subscriptions\\Transformers\\OrderDataTransformer' => __DIR__ . '/../..' . '/inc/SalesData/WooToNative/Subscriptions/Transformers/OrderDataTransformer.php', 80 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Subscriptions\\Transformers\\PlanDataTransformer' => __DIR__ . '/../..' . '/inc/SalesData/WooToNative/Subscriptions/Transformers/PlanDataTransformer.php', 81 'Themeum\\TutorLMSMigrationTool\\SalesData\\WooToNative\\Subscriptions\\Transformers\\SubscriptionDataTransformer' => __DIR__ . '/../..' . '/inc/SalesData/WooToNative/Subscriptions/Transformers/SubscriptionDataTransformer.php', 64 82 'TutorLMSMigrationTool' => __DIR__ . '/../..' . '/classes/TutorLMSMigrationTool.php', 65 83 'Utils' => __DIR__ . '/../..' . '/classes/Utils.php', -
tutor-lms-migration-tool/trunk/vendor/composer/installed.php
r3329380 r3378798 2 2 'root' => array( 3 3 'name' => 'themeum/tutor-lms-migration-tool', 4 'pretty_version' => '2. 3.1',5 'version' => '2. 3.1.0',6 'reference' => ' 39a5a88c3a7901113390ba6827cf4cea7e7e587f',4 'pretty_version' => '2.4.0', 5 'version' => '2.4.0.0', 6 'reference' => 'e847c98a59425cbe1a0161a5e5b13c7086f4c85b', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 'themeum/tutor-lms-migration-tool' => array( 14 'pretty_version' => '2. 3.1',15 'version' => '2. 3.1.0',16 'reference' => ' 39a5a88c3a7901113390ba6827cf4cea7e7e587f',14 'pretty_version' => '2.4.0', 15 'version' => '2.4.0.0', 16 'reference' => 'e847c98a59425cbe1a0161a5e5b13c7086f4c85b', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../', -
tutor-lms-migration-tool/trunk/views/migration_ld.php
r3327915 r3378798 1 <?php2 /**3 * Migration page4 *5 * @package TutorLMSMigrationTool\Views6 * @author Themeum <[email protected]>7 * @link https://themeum.com8 * @since 2.3.09 */10 11 if ( ! defined( 'ABSPATH' ) ) {12 exit;13 }14 ?>15 1 <div class="tutor-migration-page"> 16 <?php17 global $wpdb;18 19 $utils = new Utils();20 21 $tutor_migration_history = $utils->fetch_history( 'ld' );22 23 $courses_count = $utils->ld_course_count();24 25 $orders_count = $utils->ld_orders_count();26 27 $items_count = $courses_count + $orders_count;28 ?>29 30 2 <div id="tutor-migration-wrapper"> 31 3 <div class="tutor-migration-area"> 32 4 <div class="tutor-migration-top tutor-px-48 tutor-pt-32 tutor-pb-40"> 33 <div class=""> 5 <div class=""> 34 6 <div class="tutor-fs-3 tutor-fw-medium tutor-color-black tutor-course-content-title"> 35 <?php esc_html_e( 'Migration', 'tutor-lms-migration-tool' ); ?>7 Migration 36 8 </div> 37 9 <div class="tutor-migration-top-subtitle tutor-fs-6"> 38 <?php esc_html_e( 'Seamlessly migrate your Learndash courses to Tutor LMS with the Tutor LMS Migration Tool.', 'tutor-lms-migration-tool' ); ?>10 Seamlessly migrate your Learndash courses to Tutor LMS with the Tutor LMS Migration Tool. 39 11 </div> 40 12 </div> 41 13 <div class="tutor-d-flex tutor-justify-end tutor-align-center"> 42 <img s tyle src="<?php echo esc_url( TLMT_URL . 'assets/img/learndash.jpg' ); ?>" alt="import">14 <img src="assets/img/learndash.jpg" alt="import"> 43 15 </div> 44 16 </div> … … 48 20 <li class="tutor-nav-item"> 49 21 <a class="tutor-nav-link is-active" href="#" data-tutor-nav-target="tutor-auto-migrate-tab"> 50 <?php esc_html_e( 'Auto Migrate', 'tutor-lms-migration-tool' ); ?>22 Auto Migrate 51 23 </a> 52 24 </li> 53 25 <li class="tutor-nav-item"> 54 26 <div class="tutor-d-flex tutor-align-center"> 55 <a class="tutor-nav-link" data-tutor-nav-target="" style="cursor: default; padding-right: 8px;">56 <?php esc_html_e( 'Upload File', 'tutor-lms-migration-tool' ); ?>57 </a>58 <span class="tutor-rounded-pill tutor-border tutor-px-8" style="border-radius: 10px;">59 <?php esc_html_e( 'Coming soon', 'tutor-lms-migration-tool' ); ?>60 </span>27 <a class="tutor-nav-link" style="cursor: default; padding-right: 8px;"> 28 Upload File 29 </a> 30 <span class="tutor-rounded-pill tutor-border tutor-px-8" style="border-radius: 10px;"> 31 Coming soon 32 </span> 61 33 </div> 62 34 </li> 63 35 <li class="tutor-nav-item tutor-nav-more tutor-d-none"> 64 36 <a class="tutor-nav-link tutor-nav-more-item" href="#"> 65 <span class="tutor-mr-4"> <?php esc_html_e( 'More', 'tutor-lms-migration-tool' ); ?></span>37 <span class="tutor-mr-4">More</span> 66 38 <span class="tutor-nav-more-icon tutor-icon-times"></span> 67 39 </a> … … 74 46 <div id="tutor-auto-migrate-tab" class="tutor-tab-item is-active"> 75 47 <div class="tutor-tab-item-wrap tutor-pt-32 tutor-pb-40 tutor-p-48"> 76 <form id="tlmt-lp-migrate-to-tutor-lms" action="ld_migrate_all_data_to_tutor" method="post"> 77 <?php tutor_nonce_field(); ?> 48 <form id="tlmt-lp-migrate-to-tutor-lms"> 78 49 <div class="lp-migration-checkbox"> 79 50 <div id="sectionCourse"> 80 <label for="courses">51 <label> 81 52 <div class="lp-migration-singlebox"> 82 53 <div class="lp-migration-singlebox-checkbox"> … … 87 58 <div class="tutor-fs-6 tutor-fw-medium tutor-color-black tutor-mb-4 tutor-course-content-title">Courses</div> 88 59 <div class="tutor-color-muted tutor-fs-6 tutor-fw-normal tutor-pb-16"> 89 <?php esc_html_e( 'Transfer courses, lessons, quizzes, assignments, etc to Tutor LMS.', 'tutor-lms-migration-tool' ); ?>60 Transfer courses, lessons, quizzes, assignments, etc to Tutor LMS. 90 61 </div> 91 62 <div class="tutor-progress tutor-mb-8" data-percent="0" style="--tutor-progress: 0%;"></div> … … 95 66 </div> 96 67 <div id="sectionOrders" class="tutor-py-16"> 97 <label for="sales-data">68 <label> 98 69 <div class="lp-migration-singlebox"> 99 70 <div class="lp-migration-singlebox-checkbox"> … … 102 73 <div class="lp-migration-singlebox-desc"> 103 74 <div class="tutor-fs-6 tutor-fw-medium tutor-color-black tutor-mb-4 tutor-course-content-title"> 104 <?php esc_html_e( 'Sales Data', 'tutor-lms-migration-tool' ); ?>75 Sales Data 105 76 </div> 106 77 <div class="tutor-color-muted tutor-fs-6 tutor-fw-normal tutor-pb-16"> 107 <?php esc_html_e( 'Migrate revenue and sales data to Tutor LMS.', 'tutor-lms-migration-tool' ); ?>78 Migrate revenue and sales data to Tutor LMS. 108 79 </div> 109 80 <div class="tutor-progress tutor-mb-8" data-percent="0" style="--tutor-progress: 0%;"></div> … … 113 84 </div> 114 85 <div id="sectionReviews" class="tutor-py-16"> 115 <label for="reviews">86 <label> 116 87 <div class="lp-migration-singlebox"> 117 88 <div class="lp-migration-singlebox-checkbox"> … … 120 91 <div class="lp-migration-singlebox-desc"> 121 92 <div class="tutor-fs-6 tutor-fw-medium tutor-color-black tutor-mb-4 tutor-course-content-title"> 122 <?php esc_html_e( 'Reviews', 'tutor-lms-migration-tool' ); ?>93 Reviews 123 94 </div> 124 95 <div class="tutor-color-muted tutor-fs-6 tutor-fw-normal tutor-pb-16"> 125 <?php esc_html_e( 'All of the course reviews will be carried over to Tutor LMS.', 'tutor-lms-migration-tool' ); ?>96 All of the course reviews will be carried over to Tutor LMS. 126 97 </div> 127 98 <div class="tutor-progress tutor-mb-8" data-percent="0" style="--tutor-progress: 0%;"></div> … … 135 106 </div> 136 107 <div class="tutor-backup-area tutor-px-48 tutor-py-36 tutor-border-top"> 137 <?php require __DIR__ . '/components/migrate-now.php'; ?> 138 </div> 139 </div> 108 <button class="tutor-btn tutor-btn-primary tutor-btn-lg">Migrate Now</button> 109 </div> 110 </div> 111 140 112 <div id="tutor-manual-migrate-tab" class="tutor-tab-item"> 141 113 <div class="tutor-tab-item-wrap tutor-p-48"> … … 144 116 <span class="tutor-fs-3 tutor-fw-medium tutor-color-primary tutor-icon-import"></span> 145 117 </div> 146 <form id="tutor-manual-migrate-form" method="post" enctype="multipart/form-data"> 147 <?php tutor_nonce_field(); ?> 148 <input type="hidden" name="tutor_action" value="tutor_import_from_ld"> 149 <div id="tutor-migration-browse-file-link" class="tutor-fs-5 tutor-fw-medium"> 150 <div class="tutor-color-black"> <?php esc_html_e( 'Drag & Drop XML file here', 'tutor-lms-migration-tool' ); ?> </div> 151 or <a href="" class="tutor-color-primary"> <?php esc_html_e( 'Browse File', 'tutor-lms-migration-tool' ); ?> </a> 152 </div> 153 <input id="tutor-migration-browse-file" name="tutor_import_file" hidden type="file" accept=".xml" required> 118 <form id="tutor-manual-migrate-form"> 119 <input type="file" id="tutor-migration-browse-file" hidden accept=".xml" required> 120 <div id="tutor-migration-browse-file-link" class="tutor-fs-5 tutor-fw-medium"> 121 <div class="tutor-color-black">Drag & Drop XML file here</div> 122 or <a href="#" class="tutor-color-primary">Browse File</a> 123 </div> 154 124 <span class="file-info tutor-fw-medium backup-now-subtile tutor-fs-6"></span> 155 125 </form> … … 160 130 <div class="tutor-row tutor-align-center"> 161 131 <div class="tutor-col-md-8 tutor-d-flex tutor-flex-wrap"> 162 <sapn class="backup-now-subtile tutor-fs-7"><?php esc_html_e( 'Please take a complete a backup for safety.', 'tutor-lms-migration-tool' ); ?></sapn> 163 <form id="tutor_migration_export_form" method="post"> 164 <?php tutor_nonce_field(); ?> 165 <input type="hidden" id="tutor_migration_vendor" name="tutor_migration_vendor" value="ld"> 166 <input type="hidden" name="tutor_action" value="tutor_ld_export_xml"> 167 <button <?php echo ! $items_count ? 'disabled' : ''; ?> type="submit" class="backup-now-btn tutor-fs-7 tutor-fw-medium tutor-color-black"> 168 <?php esc_html_e( 'Backup Now', 'tutor-lms-migration-tool' ); ?> 169 </button> 170 </form> 132 <span class="backup-now-subtile tutor-fs-7">Please take a complete backup for safety.</span> 133 <button type="submit" class="backup-now-btn tutor-fs-7 tutor-fw-medium tutor-color-black"> 134 Backup Now 135 </button> 171 136 </div> 172 137 <div class="migrate-now-btn-wrapper tutor-col-md-4 tutor-d-flex tutor-justify-end"> 173 138 <button type="submit" id="manual-migrate-now-btn" class="tutor-btn tutor-btn-primary tutor-btn-lg" disabled> 174 <?php esc_html_e( 'Migrate Now', 'tutor-lms-migration-tool' ); ?>139 Migrate Now 175 140 </button> 176 141 </div> … … 179 144 </div> 180 145 </div> 181 <!-- ./ tutor migration tab -->182 146 </div> 183 147 184 148 <!-- migration history area --> 185 <?php if ( count( $tutor_migration_history ) ) : ?>186 149 <div class="tutor-migration-history"> 187 150 <div class="tutor-migration-history-heading tutor-fs-5 tutor-color-subdued tutor-mt-24 tutor-mb-16"> 188 <?php esc_html_e( 'Settings History', 'tutor-lms-migration-tool' ); ?>151 Settings History 189 152 </div> 190 153 <div class="tutor-table-responsive"> … … 192 155 <thead> 193 156 <tr> 194 <th class="tutor-table-rows-sorting" style="padding-left: 38px;"> 195 <?php esc_html_e( 'Date', 'tutor-lms-migration-tool' ); ?> 196 </th> 197 <th class="tutor-table-rows-sorting"> 198 </th> 157 <th style="padding-left: 38px;">Date</th> 158 <th></th> 199 159 </tr> 200 160 </thead> 201 161 <tbody> 202 <?php foreach ( $tutor_migration_history as $tutor_history ) : ?>203 162 <tr> 204 163 <td> 205 164 <div class="tutor-migration-history-time tutor-fs-6 tutor-pl-24 tutor-fw-normal"> 206 <?php 207 echo esc_html( tutor_get_formated_date( get_option( 'date_format' ), $tutor_history->created_at ) ); 208 echo ', ' . date( 'h:i A', strtotime( $tutor_history->created_at ) ); 209 ?> 210 211 </div> 212 </td> 213 <td> 214 <?php 215 $migration_type_class = ''; 216 if ( $tutor_history->migration_type == 'Imported' ) { 217 $migration_type_class = 'success'; 218 } elseif ( $tutor_history->migration_type == 'Exported' ) { 219 $migration_type_class = 'warning'; 220 } 221 ?> 165 Sept 12, 2025, 03:15 PM 166 </div> 167 </td> 168 <td> 222 169 <div class="tutor-d-flex tutor-justify-end tutor-pr-32"> 223 <span class="tutor-badge-label label-<?php echo esc_attr( $migration_type_class ); ?>"> 224 <?php echo esc_html( $tutor_history->migration_type ); ?> 225 </span> 170 <span class="tutor-badge-label label-success">Imported</span> 226 171 </div> 227 172 </td> 228 173 </tr> 229 <?php endforeach; ?> 174 <tr> 175 <td> 176 <div class="tutor-migration-history-time tutor-fs-6 tutor-pl-24 tutor-fw-normal"> 177 Sept 10, 2025, 11:45 AM 178 </div> 179 </td> 180 <td> 181 <div class="tutor-d-flex tutor-justify-end tutor-pr-32"> 182 <span class="tutor-badge-label label-warning">Exported</span> 183 </div> 184 </td> 185 </tr> 230 186 </tbody> 231 187 </table> 232 188 </div> 233 189 </div> 234 <?php endif; ?> 235 <!-- ./ tutor-migration-history --> 236 </div> 237 </div> 238 190 </div> 191 </div> 192 193 <!-- Modal: Confirmation --> 239 194 <div class="lp-migration-modal-wrap"> 240 195 <div class="lp-migration-modal"> 241 196 <div class="lp-migration-alert lp-import flex-center tutor-flex-column tutor-py-60 tutor-text-center"> 242 197 <div class="lp-migration-modal-icon"> 243 <img src=" <?php echo esc_url( TLMT_URL . 'assets/img/yes_no.svg' ); ?>" alt="export">198 <img src="assets/img/yes_no.svg" alt="export"> 244 199 </div> 245 200 <div class="migration-modal-btn-group flex-center tutor-flex-column"> 246 201 <div class="tutor-fs-5 tutor-fw-normal tutor-color-black tutor-mb-32 tutor-mt-16"> 247 <?php esc_html_e( 'Are you sure you want to migrate from', 'tutor-lms-migration-tool' ); ?> 248 <br> 249 <?php esc_html_e( 'LearnDash to Tutor LMS?', 'tutor-lms-migration-tool' ); ?> 202 Are you sure you want to migrate from <br> LearnDash to Tutor LMS? 250 203 </div> 251 204 <div class="tutor-d-flex"> 252 205 <a href="#" class="migration-later-btn tutor-btn tutor-btn-outline-primary tutor-btn-lg tutor-mr-24"> 253 <span> <?php esc_html_e( 'No, Maybe Later!', 'tutor-lms-migration-tool' ); ?></span>206 <span>No, Maybe Later!</span> 254 207 </a> 255 208 <a href="#" class="migration-start-btn tutor-btn tutor-btn-primary tutor-btn-lg"> 256 <?php 257 esc_html_e( 'Yes, Let’s Start', 'tutor-lms-migration-tool' ); 258 ?> 209 Yes, Let’s Start 259 210 </a> 260 211 </div> … … 268 219 </div> 269 220 270 221 <!-- Modal: Success --> 271 222 <div class="lp-success-modal-wrap"> 272 223 <div class="lp-success-modal"> … … 282 233 <span class="modal-close-line success-close-line-two"></span> 283 234 </div> 284 <div class="tutor-fs-3 tutor-fw-normal tutor-color-black tutor-mt-28"> 285 <?php esc_html_e( 'Migration Successful!', 'tutor-lms-migration-tool' ); ?>286 </div> 287 <div class="tutor-fs-6 tutor-fw-normal tutor-color-black tutor-mt-16 tutor-px-12"> 288 <?php esc_html_e( 'Migration from LearnDash to Tutor LMS has been completed. Please check your contents and ensure everything is working as expected.', 'tutor-lms-migration-tool' ); ?>289 </div> 290 <a href=" <?php echo esc_url( admin_url() ); ?>admin.php?page=tutor" class="migration-try-btn migration-done-btn tutor-btn tutor-btn-primary tutor-btn-lg tutor-mt-44 tutor-mb-20">291 <?php esc_html_e( 'Go to courses', 'tutor-lms-migration-tool' ); ?>235 <div class="tutor-fs-3 tutor-fw-normal tutor-color-black tutor-mt-28"> 236 Migration Successful! 237 </div> 238 <div class="tutor-fs-6 tutor-fw-normal tutor-color-black tutor-mt-16 tutor-px-12"> 239 Migration from LearnDash to Tutor LMS has been completed. Please check your contents and ensure everything is working as expected. 240 </div> 241 <a href="#" class="migration-try-btn migration-done-btn tutor-btn tutor-btn-primary tutor-btn-lg tutor-mt-44 tutor-mb-20"> 242 Go to courses 292 243 </a> 293 244 </div> … … 295 246 </div> 296 247 248 <!-- Modal: Error --> 297 249 <div class="lp-error-modal-wrap"> 298 250 <div class="lp-error-modal"> 299 251 <div class="lp-modal-alert tutor-p-40"> 300 <img class="tutor-mt-12" style="width: 80px; height: 80px;" src=" <?php echo esc_url( TLMT_URL . 'assets/img/error-modal-icon.jpg' ); ?>" alt="error-midal-alert-icon">252 <img class="tutor-mt-12" style="width: 80px; height: 80px;" src="assets/img/error-modal-icon.jpg" alt="error-midal-alert-icon"> 301 253 <div class="modal-close success-modal-close"> 302 254 <span class="modal-close-line success-close-line-one"></span> 303 255 <span class="modal-close-line success-close-line-two"></span> 304 256 </div> 305 <div class="tutor-fs-3 tutor-fw-normal tutor-color-black tutor-mt-28"> 306 <?php esc_html_e( 'Migration Failed!', 'tutor-lms-migration-tool' ); ?>307 </div> 308 <div class="tutor-fs-6 tutor-fw-normal tutor-color-black tutor-mt-16 tutor-px-12"> 309 <?php esc_html_e( 'Oops... The migration from LearnDash to Tutor LMS was unsuccessful. Please review everything and try again.', 'tutor-lms-migration-tool' ); ?>310 </div> 311 <a href=" " class="migration-try-again-btn migration-done-btn tutor-btn tutor-btn-primary tutor-btn-lg tutor-mt-44 tutor-mb-20">312 <?php esc_html_e( 'Try Again', 'tutor-lms-migration-tool' ); ?>257 <div class="tutor-fs-3 tutor-fw-normal tutor-color-black tutor-mt-28"> 258 Migration Failed! 259 </div> 260 <div class="tutor-fs-6 tutor-fw-normal tutor-color-black tutor-mt-16 tutor-px-12"> 261 Oops... The migration from LearnDash to Tutor LMS was unsuccessful. Please review everything and try again. 262 </div> 263 <a href="#" class="migration-try-again-btn migration-done-btn tutor-btn tutor-btn-primary tutor-btn-lg tutor-mt-44 tutor-mb-20"> 264 Try Again 313 265 </a> 314 266 </div>
Note: See TracChangeset
for help on using the changeset viewer.