Plugin Directory

Changeset 3378798


Ignore:
Timestamp:
10/15/2025 10:23:28 AM (2 months ago)
Author:
themeum
Message:

Update to version 2.4.0 from GitHub

Location:
tutor-lms-migration-tool
Files:
60 added
24 edited
1 copied

Legend:

Unmodified
Added
Removed
  • tutor-lms-migration-tool/tags/2.4.0/assets/css/admin.css

    r2997569 r3378798  
    1 .tutor-progress{
     1.tutor-progress {
    22    height: 4px;
    33    width: 80%;
    4     background: #E3E6EB;
     4    background: #e3e6eb;
    55    border-radius: 30px;
    66    position: relative;
     
    88    margin-bottom: 25px;
    99}
    10 .tutor-progress::before{
     10
     11.tutor-progress::before {
    1112    content: '';
    1213    position: absolute;
     
    1718    transition: 300ms;
    1819}
    19 .lp-migration-singlebox {
     20
     21.lp-migration-singlebox,
     22.wc-migration-singlebox {
    2023    display: grid;
    2124    grid-template-columns: 3% 80%;
     
    2326    grid-gap: 15px;
    2427}
     28
     29.wc-migration-singlebox {
     30    min-height: auto;
     31}
     32
    2533/* css spinner */
    2634.backup-now-btn {
     
    3341    cursor: pointer;
    3442}
     43
    3544.backup-now-btn:not(:disabled):hover {
    3645    color: var(--tutor-color-primary);
    3746}
    38 .backup-now-btn:disabled {
     47
     48.backup-now-btn:disabled {
    3949    color: #86878a;
    4050}
     51
    4152.j-spinner {
    4253    --spinner-size: 22px;
     
    5162    box-sizing: border-box;
    5263    animation: none;
    53     background: #CDCFD5;
     64    background: #cdcfd5;
    5465    background-size: 55%;
    5566    background-position: 5px 7px;
    5667    background-repeat: no-repeat;
    5768    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 {
    6172    border: none;
    6273    animation: none;
     
    6677    background-repeat: no-repeat;
    6778    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 {
    7182    border: none;
    7283    background-color: transparent;
     
    7586    background-repeat: no-repeat;
    7687    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
    8091@-webkit-keyframes spinner-circle-rotate {
    8192    100% {
     
    8394    }
    8495}
     96
    8597.lp-migration-checkbox label:not(:first-child) .lp-migration-singlebox {
    8698    margin-top: 20px;
    8799}
    88 .lp-migration-singlebox-checkbox{
     100
     101.lp-migration-singlebox-checkbox {
    89102    position: relative;
    90103    margin-top: 3px;
    91104}
    92 .lp-migration-singlebox-checkbox input{
     105
     106.lp-migration-singlebox-checkbox input {
    93107    position: absolute;
    94108    right: -20px;
     
    96110    cursor: pointer;
    97111}
    98 .lp-migration-singlebox-checkbox .checkmark{
     112
     113.lp-migration-singlebox-checkbox .checkmark {
    99114    position: absolute;
    100115    top: 0;
     
    102117    width: 24px;
    103118    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: '';
    108124    position: absolute;
    109125    display: none;
    110126}
    111 .lp-migration-singlebox-checkbox .checkmark:after{
     127
     128.lp-migration-singlebox-checkbox .checkmark:after {
    112129    top: 3px;
    113130    left: 8px;
     
    119136    transform: rotate(45deg);
    120137}
    121 .lp-migration-singlebox-checkbox input:checked ~ .checkmark:after{
     138
     139.lp-migration-singlebox-checkbox input:checked~.checkmark:after {
    122140    display: block;
    123141}
    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
    127147/* migration-modal */
    128148.lp-migration-modal-wrap {
    129149    position: fixed;
    130     background: rgba(0,0,0, 0.5);
     150    background: rgba(0, 0, 0, 0.5);
    131151    top: 0;
    132152    bottom: 0;
     
    136156    z-index: 9999;
    137157}
     158
    138159.lp-migration-modal {
    139160    max-width: 730px;
     
    144165    transform: translate(-50%, -50%);
    145166}
     167
    146168.lp-migration-modal-wrap.active {
    147169    display: block;
     
    149171
    150172.lp-migration-alert {
    151     background: #FFFFFF;
    152     border: 1px solid #E0E2EA;
     173    background: #ffffff;
     174    border: 1px solid #e0e2ea;
    153175    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.05);
    154176    border-radius: 6px;
    155177    min-width: 350px;
    156178}
    157 @media (min-width : 576px) {
     179
     180@media (min-width: 576px) {
    158181    .lp-migration-alert {
    159182        width: 600px;
    160183    }
    161184}
     185
    162186.migration-failed-btn:last-child {
    163187    margin-left: 30px;
    164188}
     189
    165190.lp-migration-modal-icon img {
    166191    width: 80px;
    167192}
     193
    168194.modal-close {
    169195    position: absolute;
     
    177203    align-items: center;
    178204}
     205
    179206.modal-close-line {
    180207    position: absolute;
     
    182209    height: 20px;
    183210    top: 22px;
    184     background: #9CA0AC;
    185 }
     211    background: #9ca0ac;
     212}
     213
    186214.modal-close-line.error-close-line-one,
    187215.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 {
    189217    transform: rotate(42deg);
    190218}
     219
    191220.modal-close-line.error-close-line-two,
    192221.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 {
    194223    transform: rotate(134deg);
    195224}
     225
    196226.lp-modal-alert {
    197227    background-color: white;
     
    203233    position: relative;
    204234}
     235
    205236.lp-modal-alert .lp-modal-icon {
    206237    border-radius: 50%;
     
    212243    width: 80px;
    213244}
     245
    214246.lp-modal-alert .lp-modal-icon.lp-modal-error:after,
    215247.lp-modal-alert .lp-modal-icon.lp-modal-error:before {
     
    221253    width: 60px;
    222254}
     255
    223256.lp-modal-alert .lp-modal-icon.lp-modal-error:before {
    224257    border-radius: 120px 0 0 120px;
     
    228261    transform: rotate(-45deg);
    229262}
     263
    230264.lp-modal-alert .lp-modal-icon.lp-modal-error:after {
    231265    border-radius: 0 120px 120px 0;
     
    235269    transform: rotate(-45deg);
    236270}
     271
    237272.lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-placeholder {
    238273    border-radius: 50%;
     
    246281    z-index: 2;
    247282}
     283
    248284.lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-fix {
    249285    background-color: #fff;
     
    256292    z-index: 1;
    257293}
     294
    258295.lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line {
    259     background-color: #A5DC86;
     296    background-color: #a5dc86;
    260297    border-radius: 2px;
    261298    display: block;
     
    264301    z-index: 2;
    265302}
     303
    266304.lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line.lp-modal-tip {
    267305    left: 14px;
     
    270308    width: 25px;
    271309}
     310
    272311.lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line.lp-modal-long {
    273312    right: 8px;
     
    276315    width: 47px;
    277316}
     317
    278318.lp-modal-alert .lp-modal-icon.lp-modal-error {
    279     border-color: #F27474;
    280 }
     319    border-color: #f27474;
     320}
     321
    281322.lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-x-mark {
    282323    display: block;
     
    284325    z-index: 2;
    285326}
     327
    286328.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
    289332.lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line {
    290     background-color: #FF2624;
     333    background-color: #ff2624;
    291334    top: 37px;
    292335    width: 47px;
    293336}
     337
    294338.lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line.lp-modal-left {
    295339    left: 17px;
    296340    transform: rotate(45deg);
    297341}
     342
    298343.lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line.lp-modal-right {
    299344    right: 16px;
    300345    transform: rotate(-45deg);
    301346}
     347
    302348.lp-modal-icon.lp-modal-error.animate:after {
    303349    animation: rotatePlaceholder 4.25s ease-in;
    304350}
     351
    305352.animateXLeft {
    306     animation: animateXLeft .75s;
    307 }
     353    animation: animateXLeft 0.75s;
     354}
     355
    308356.animateXRight {
    309     animation: animateXRight .75s;
    310 }
     357    animation: animateXRight 0.75s;
     358}
     359
    311360@keyframes rotatePlaceholder {
    312     0%,5% {
     361
     362    0%,
     363    5% {
    313364        transform: rotate(-45deg);
    314365    }
    315     100%,12% {
     366
     367    100%,
     368    12% {
    316369        transform: rotate(-405deg);
    317370    }
    318371}
     372
    319373@keyframes animateXLeft {
     374
    320375    0%,
    321376    65% {
     
    324379        width: 0;
    325380    }
     381
    326382    84% {
    327383        left: 14px;
     
    329385        width: 47px;
    330386    }
     387
    331388    100% {
    332389        left: 17px;
     
    335392    }
    336393}
     394
    337395@keyframes animateXRight {
     396
    338397    0%,
    339398    65% {
     
    342401        width: 0;
    343402    }
     403
    344404    84% {
    345405        right: 14px;
     
    347407        width: 47px;
    348408    }
     409
    349410    100% {
    350411        right: 16px;
     
    353414    }
    354415}
     416
    355417/* modal success */
    356 .lp-success-modal ,
     418.lp-success-modal,
    357419.lp-error-modal {
    358420    position: fixed;
     
    362424    display: none;
    363425    z-index: 999999;
    364     background: rgba(0,0,0, 0.3);
     426    background: rgba(0, 0, 0, 0.3);
    365427    width: 100%;
    366428    height: 100%;
    367429}
     430
    368431.lp-error-modal.active,
    369432.lp-success-modal.active {
     
    372435    align-items: center;
    373436}
     437
    374438.lp-modal-alert {
    375439    background-color: #fff;
     
    377441    border-radius: 4px;
    378442}
     443
    379444.lp-modal-alert .lp-modal-icon {
    380445    border-radius: 50%;
     
    388453}
    389454
    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
    393459.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 {
    395461    background: #fff;
    396462    content: '';
     
    401467    width: 60px;
    402468}
    403 .lp-modal-alert .lp-modal-icon.lp-modal-success:before{
     469
     470.lp-modal-alert .lp-modal-icon.lp-modal-success:before {
    404471    border-radius: 120px 0 0 120px;
    405472    left: -33px;
     
    408475    transform: rotate(-45deg);
    409476}
    410 .lp-modal-alert .lp-modal-icon.lp-modal-success:after{
     477
     478.lp-modal-alert .lp-modal-icon.lp-modal-success:after {
    411479    border-radius: 0 120px 120px 0;
    412480    left: 30px;
     
    415483    transform: rotate(-45deg);
    416484}
    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 {
    418487    border-radius: 50%;
    419     border: 4px solid #24A148;
     488    border: 4px solid #24a148;
    420489    box-sizing: content-box;
    421490    height: 80px;
     
    426495    z-index: 2;
    427496}
    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 {
    429499    background-color: #fff;
    430500    height: 90px;
     
    436506    z-index: 1;
    437507}
    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;
    440511    border-radius: 2px;
    441512    display: block;
     
    444515    z-index: 2;
    445516}
    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 {
    447519    left: 14px;
    448520    top: 46px;
     
    450522    width: 25px;
    451523}
    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 {
    453526    right: 8px;
    454527    top: 38px;
     
    456529    width: 47px;
    457530}
     531
    458532.lp-modal-alert .lp-modal-icon.lp-modal-warning:after {
    459533    background-color: #fff;
     
    466540    z-index: 1;
    467541}
     542
    468543.animateSuccessTip {
    469     animation: animateSuccessTip .75s;
    470 }
     544    animation: animateSuccessTip 0.75s;
     545}
     546
    471547.animateSuccessLong {
    472     animation: animateSuccessLong .75s;
    473 }
     548    animation: animateSuccessLong 0.75s;
     549}
     550
    474551.lp-modal-icon.lp-modal-success.animate:after {
    475552    animation: rotatePlaceholder 4.25s ease-in;
    476553}
     554
    477555@keyframes animateSuccessTip {
    478     0%,54% {
     556
     557    0%,
     558    54% {
    479559        width: 0;
    480560        left: 1px;
    481561        top: 19px;
    482562    }
     563
    483564    70% {
    484565        width: 50px;
     
    486567        top: 37px;
    487568    }
     569
    488570    84% {
    489571        width: 17px;
     
    491573        top: 48px;
    492574    }
     575
    493576    100% {
    494577        width: 25px;
     
    497580    }
    498581}
     582
    499583@keyframes animateSuccessLong {
    500     0%,65% {
     584
     585    0%,
     586    65% {
    501587        width: 0;
    502588        right: 46px;
    503589        top: 54px;
    504590    }
     591
    505592    84% {
    506593        width: 55px;
     
    508595        top: 35px;
    509596    }
     597
    510598    100% {
    511599        width: 47px;
     
    514602    }
    515603}
     604
    516605@keyframes rotatePlaceholder {
    517     0%,5% {
     606
     607    0%,
     608    5% {
    518609        -webkit-transform: rotate(-45deg);
    519610        transform: rotate(-45deg);
    520611    }
    521     100%,12% {
     612
     613    100%,
     614    12% {
    522615        -webkit-transform: rotate(-405deg);
    523616        transform: rotate(-405deg);
    524617    }
    525618}
     619
    526620.tutor-install-notice {
    527     padding: 20px;
    528     display: block
    529 }
     621    padding: 20px;
     622    display: block;
     623}
     624
    530625.tutor-install-notice .tutor-install-notice-inner {
    531     min-height: 64px
    532 }
     626    min-height: 64px;
     627}
     628
    533629.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
    537634.tutor-install-notice-button {
    538     float: right
    539 }
     635    float: right;
     636}
     637
    540638.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
    545644.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
    551651.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
    557658.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%);
    564667    background-position: top, right, bottom, left;
    565668    background-repeat: repeat-x, repeat-y;
     
    568671    border-radius: 6px;
    569672    text-align: center;
    570 
    571 }
     673}
     674
    572675.tutor-migration-upload-area {
    573676    border-radius: 6px;
     
    578681    margin: 0 auto;
    579682}
     683
    580684.tutor-migration-upload-area .tutor-migration-upload-circle {
    581685    width: 80px;
    582686    height: 80px;
    583     background: #E9EDFB;
     687    background: #e9edfb;
    584688    border-radius: 50%;
    585689}
     690
    586691.tutor-migration-upload-area span.file_name {
    587692    display: block;
    588693    margin-top: 10px;
    589694}
     695
    590696.tutor-migration-upload-area button {
    591697    color: white;
    592698    display: inline-block;
    593699}
     700
    594701.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
    597708.tutor-migration-top {
    598709    display: grid;
     
    601712    border-radius: 6px 6px 0px 0px;
    602713}
     714
    603715.tutor-migration-top-subtitle {
    604     color: #5B616F;
    605 }
     716    color: #5b616f;
     717}
     718
    606719.tutor-migration-page #tutor-migration-wrapper #tutor-auto-migrate-tab {
    607720    border-radius: 0px 0px 6px 6px;
    608721}
     722
    609723.tutor-migration-page #tutor-migration-wrapper {
    610724    background-color: #f0f0f1;
     
    612726    overflow: hidden;
    613727}
     728
    614729#tutor-migration-wrapper .tutor-nav {
    615730    padding: 0px 48px 0px 48px;
    616731}
     732
    617733#tutor-migration-wrapper .tutor-nav .tutor-nav-item.is-active {
    618     background: #F4F6F9;
     734    background: #f4f6f9;
    619735    border-radius: 6px 6px 0px 0px;
    620736    border-color: transparent;
    621737}
     738
    622739#tutor-migration-wrapper .tutor-nav .tutor-nav-item .tutor-nav-link {
    623740    border: 1px solid transparent;
    624741    color: var(--tutor-body-color);
    625     color: #757C8E;
    626 }
     742    color: #757c8e;
     743    padding-block: 10px;
     744}
     745
    627746#tutor-migration-wrapper .tutor-nav .tutor-nav-item .tutor-nav-link.is-active {
    628     border: 1px solid #CDCFD5;
     747    border: 1px solid #e0e2ea;
    629748    color: var(--tutor-body-color) !important;
    630749}
     750
    631751.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 {
    635756    border-bottom-color: #F4F6F9;
    636757    border-width: 3px 3px 3px 4px;
    637     background: #F4F6F9;
     758    background: #f4f6f9;
    638759    border-radius: 6px 6px 0px 0px;
    639760    border-color: transparent;
    640761}
     762
    641763#tutor-migration-wrapper .tutor-nav:not(.tutor-nav-pills):not(.tutor-nav-tabs) .tutor-nav-link.is-active {
    642764    border-bottom-color: transparent;
    643765}
     766
    644767.tutor-tab-item-wrap {
    645     background: #F4F6F9;
    646 }
     768    background: #f4f6f9;
     769}
     770
    647771.tutor-migration-history {
    648772    background: #f0f0f1;
    649773}
     774
    650775.tutor-migration-history-heading {
    651776    background: #f0f0f1;
    652     color: #5B616F;
    653 }
     777    color: #5b616f;
     778}
     779
    654780.tutor-migration-history-time {
    655     color: #41454F;
    656 }
     781    color: #41454f;
     782}
     783
    657784.tutor-migration-area {
    658     border: 1px solid #E0E2EA;
     785    border: 1px solid #e0e2ea;
    659786    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.05);
    660787    border-radius: 6px;
    661788}
     789
    662790.tutor-migration-tab,
    663791.tutor-migration-tab-item {
     792    --tutor-border-color: #e0e2ea;
     793
    664794    background-color: #fff;
    665795}
     796
    666797.tutor-migration-tab-item {
    667798    border-radius: 0px 0px 6px 6px;
    668799}
    669 #tutor-migration-browse-file-link a{
     800
     801#tutor-migration-browse-file-link a {
    670802    text-decoration: underline;
    671803}
     804
    672805span.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) {
    676931    #tutor-migration-wrapper .migrate-now-btn-wrapper {
    677932        margin-top: 20px;
    678         justify-content : flex-start !important;
    679     }
     933        justify-content: flex-start !important;
     934    }
     935
    680936    .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  
     1const { __ } = wp.i18n;
     2
    13jQuery(document).ready(function ($) {
    24    'use strict';
    3     const {__} = wp.i18n;
     5    const { __ } = wp.i18n;
    46    $(document).on("click", ".install-tutor-button", function (t) {
    57        t.preventDefault();
     
    6264        var $that = $(this);
    6365        var $formData = $(this).serialize() + '&action=' + $that.attr('action');
    64      
    6566
    6667        let final_types = 'lp';
     
    6970            migration_vendor = 'ld';
    7071        }
    71         if($that.attr('action') == 'lif_migrate_all_data_to_tutor') {
     72        if ($that.attr('action') == 'lif_migrate_all_data_to_tutor') {
    7273            final_types = 'lif';
    7374            migration_vendor = 'lif';
     
    172173                    clearTimeout(checkProgress);
    173174                    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,
    177178                        action: 'insert_tutor_migration_data'
    178179                    });
     
    180181
    181182                const res = data.data;
    182                 const { total_course_count = 0, failed = []} = res || {};
    183                
     183                const { total_course_count = 0, failed = [] } = res || {};
     184
    184185                if (Number(total_course_count) > 0) {
    185186                    if (failed.length > 0) {
     
    189190                    }
    190191                } else {
    191                      $('.lp-error-modal').addClass('active');
     192                    $('.lp-error-modal').addClass('active');
    192193                }
    193194            },
     
    221222        removeItem.removeClass('active');
    222223    }
     224
    223225    // migrate now button click
    224226    $(migrateBtn).on('click', function (event) {
     
    228230        }
    229231    });
    230    
     232
    231233    // migrate now button click
    232234    $(migrateStartBtn).on('click', function (event) {
    233235        event.preventDefault();
     236        $('#wc-sales-data-migration-form').submit();
    234237        if (totalItemsMigrateCounts > 0) {
    235238            migrationModal.removeClass('active');
     
    272275    var manualMigrateNowBtn = $('#manual-migrate-now-btn');
    273276
    274     $(document).on('click', '#tutor-migration-browse-file-link a', function(event) {
     277    $(document).on('click', '#tutor-migration-browse-file-link a', function (event) {
    275278        event.preventDefault();
    276279        $('#tutor-migration-browse-file').click();
    277280    });
    278281    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) {
    280283        var inputEl = $('#tutor-migration-browse-file');
    281         if(this.files[0]) {
     284        if (this.files[0]) {
    282285            manualMigrateNowBtn.removeAttr('disabled');
    283286            getFilesAndUpdateDOM(this.files[0], inputEl);
     
    289292    var getFilesAndUpdateDOM = (files, inputEl) => {
    290293        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}`);
    294297        } else {
    295             dropZone.removeClass('file-attached');
    296             dropZone.find('.file-info').html('');
     298            dropZone.removeClass('file-attached');
     299            dropZone.find('.file-info').html('');
    297300        }
    298301    };
    299302
    300     $(document).on('click', '.backup-now-btn', function(event) {
     303    $(document).on('click', '.backup-now-btn', function (event) {
    301304        event.preventDefault();
    302305        let button = $(this);
    303306        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(),
    308311            action: 'insert_tutor_migration_data'
    309312        });
     
    311314    })
    312315
    313     $(document).on('click', '#manual-migrate-now-btn', function(event) {
     316    $(document).on('click', '#manual-migrate-now-btn', function (event) {
    314317        let button = $(this);
    315318        var fileType = $('input[name="tutor_import_file"]')[0].files[0].type;
    316         if(fileType != 'text/xml') {
     319        if (fileType != 'text/xml') {
    317320            alert('Not supported file. Upload xml file here!');
    318321            return;
     
    320323        var action_name = $('#tutor-manual-migrate-form input[name="tutor_action"]').val();
    321324        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
    324327        var formData = new FormData();
    325328        formData.append("tutor_import_file", $('input[name="tutor_import_file"]')[0].files[0]);
     
    337340            },
    338341            success: function (res) {
    339                 console.log(res);
    340342                if (res.success) {
    341343                    $('.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(),
    345347                        action: 'insert_tutor_migration_data'
    346348                    });
     
    356358    });
    357359
     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
    358834}); /* ./ jQuery */
    359835
     
    363839
    364840dropZoneInputs.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) => {
    387863    //     const files = e.target.files;
    388     //  getFilesAndUpdateDOM(files, inputEl, dropZone);
    389     // });
    390    
     864    //  getFilesAndUpdateDOM(files, inputEl, dropZone);
     865    // });
     866
    391867});
    392868
    393869const 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}`;
    398874        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    }
    403879};
  • tutor-lms-migration-tool/tags/2.4.0/classes/Utils.php

    r3132123 r3378798  
    1 <?php
     1<?php
     2
     3use Tutor\Helpers\QueryHelper;
    24
    35class Utils {
    46
    5     public function fetch_history($vendor) {
    6         global $wpdb;
    7         $result = $wpdb->get_results(
    8             $wpdb->prepare(
    9                 "SELECT  * FROM {$wpdb->prefix}tutor_migration
     7    public function fetch_history( $vendor ) {
     8        global $wpdb;
     9        $result = $wpdb->get_results(
     10            $wpdb->prepare(
     11                "SELECT  * FROM {$wpdb->prefix}tutor_migration
    1012                WHERE `migration_vendor` = %s
    1113                ORDER BY ID DESC
    1214                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    }
    2129
    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     }
    2630
    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    }
    3235
    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    }
    3643
    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    }
    4148
    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    }
    4653
    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    }
    5171
    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    }
    8287}
  • tutor-lms-migration-tool/tags/2.4.0/inc/Functions.php

    r3327915 r3378798  
    1616use Themeum\TutorLMSMigrationTool\Factories\ProductFactory;
    1717use Themeum\TutorLMSMigrationTool\Factories\ReviewFactory;
     18use Themeum\TutorLMSMigrationTool\Factories\SalesDataFactory;
    1819
    1920if ( ! function_exists( 'tlmt_has_tutor_pro' ) ) {
     
    371372    }
    372373}
     374
     375if ( ! 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  
    1010
    1111namespace Themeum\TutorLMSMigrationTool;
     12
     13use Themeum\TutorLMSMigrationTool\SalesData\InitSalesMigration;
     14use Themeum\TutorLMSMigrationTool\SalesData\MigrationHandler;
    1215
    1316if ( ! defined( 'ABSPATH' ) ) {
     
    3841    private function boot() {
    3942        new ActionHandler();
     43
     44        // Init WC to Native sales data migration.
     45        new InitSalesMigration();
     46        new MigrationHandler();
    4047    }
    4148}
  • tutor-lms-migration-tool/tags/2.4.0/inc/MigrationTypes.php

    r3327915 r3378798  
    2121    const LP_TO_TUTOR  = 'learnpress_to_tutor';
    2222    const LIF_TO_TUTOR = 'lifter_to_tutor';
     23
     24    // sales data migration types.
     25    const WC_TO_NATIVE = 'woocommerce_to_native';
    2326}
  • tutor-lms-migration-tool/tags/2.4.0/readme.txt

    r3329380 r3378798  
    22Contributors: themeum
    33Donate link: https://www.themeum.com
    4 Tags: lms, migration, course, elearning, education
     4Tags: LMS, migration, course, elearning, education
    55Requires at least: 5.0
    66Tested up to: 6.8
    77Requires PHP: 7.4
    8 Stable tag: 2.3.1
     8Stable tag: 2.4.0
    99License: GPLv3
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    1919No 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.
    2020
    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
     23The 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.
    2424
    2525Currently Tutor LMS Migration support migration options from
    2626
    2727* LearnDash
    28 * LearnPress &
    29 * LifterLMS
     28* LearnPress
     29* LifterLMS &
     30* WooCommerce to Tutor LMS Native eCommerce migration
    3031
    3132= Pre-requisites =
    3233
    33 To get started with migrating your information from LearnDash/LearnPress/Lifter LMS 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 required
    36 
    37   * Tutor LMS (Version 3.6 or later)
     34To 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)
    3839
    3940And the following plugins for their respective migrations
    4041
    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)
    4447
    4548You need the mentioned versions or later of the plugin for the migration to work properly.
     
    4750= Get Started =
    4851
    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 Migration supports the migration of the following data types:
     52fter 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:
    5255
    5356  * Courses
     
    6063  * Course Reviews
    6164
    62 LearnPress Migration supports the migration of the following data types:
     65**LearnPress Migration** supports the migration of the following data types:
    6366
    6467  * Courses
     
    7275  * Course Complete Status
    7376
    74 LifterLMS Migration supports the migration of the following data types:
     77**LifterLMS Migration** supports the migration of the following data types:
    7578
    7679  * Courses
     
    8184  * Enrollment
    8285
     86**WooCommerce Migration** supports the migration of the following data types:
     87
     88  * Orders
     89  * Subscriptions
     90  * Coupons
     91
    8392For 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.
    8493
     
    98107= Automatic installation =
    99108
    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.
     109The 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
     111On 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.
    103112
    104113= Manual installation =
     
    110119== Frequently Asked Questions ==
    111120
    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
     123Yes, 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
     127You 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/).
    119128
    120129== Screenshots ==
     
    127136== Changelog ==
    128137
    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
     140New: Migrate orders from WooCommerce to Tutor Native, including associated enrollments, customers, and earnings.
     141New: Migrate subscriptions from WooCommerce to Tutor Native, including related enrollments, customers, and earnings.
     142New: Migrate coupons from WooCommerce to Tutor Native.
     143
     144= 2.3.0 - 14 July, 2025 =
    134145
    135146New: 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  
    55 * Description: A migration toolkit that allows you to migrate data from other LMS platforms to Tutor LMS.
    66 * Author: Themeum
    7  * Version: 2.3.1
     7 * Version: 2.4.0
    88 * Author URI: http://themeum.com
    99 * Requires at least: 5.3
     
    3131 */
    3232
    33 define( 'TLMT_VERSION', '2.3.1' );
     33define( 'TLMT_VERSION', '2.4.0' );
    3434define( 'TLMT_FILE', __FILE__ );
    3535define( 'TLMT_PATH', plugin_dir_path( TLMT_FILE ) );
     
    8585
    8686// Init.
    87 new Init();
     87add_action(
     88    'plugins_loaded',
     89    function() {
     90        new Init();
     91    }
     92);
    8893
    8994if ( is_plugin_active( 'tutor/tutor.php' ) ) {
  • tutor-lms-migration-tool/tags/2.4.0/vendor/composer/autoload_classmap.php

    r3329380 r3378798  
    2020    'Themeum\\TutorLMSMigrationTool\\Factories\\ProductFactory' => $baseDir . '/inc/Factories/ProductFactory.php',
    2121    'Themeum\\TutorLMSMigrationTool\\Factories\\ReviewFactory' => $baseDir . '/inc/Factories/ReviewFactory.php',
     22    'Themeum\\TutorLMSMigrationTool\\Factories\\SalesDataFactory' => $baseDir . '/inc/Factories/SalesDataFactory.php',
    2223    'Themeum\\TutorLMSMigrationTool\\Factories\\StudentProgressFactory' => $baseDir . '/inc/Factories/StudentProgressFactory.php',
    2324    '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',
    2427    'Themeum\\TutorLMSMigrationTool\\Interfaces\\Order' => $baseDir . '/inc/Interfaces/Order.php',
    2528    'Themeum\\TutorLMSMigrationTool\\Interfaces\\Post' => $baseDir . '/inc/Interfaces/Post.php',
     
    4245    'Themeum\\TutorLMSMigrationTool\\LDMigration\\StudentProgress' => $baseDir . '/inc/LDMigration/StudentProgress.php',
    4346    'Themeum\\TutorLMSMigrationTool\\MigrationLogger' => $baseDir . '/inc/MigrationLogger.php',
     47    'Themeum\\TutorLMSMigrationTool\\MigrationMapper' => $baseDir . '/inc/MigrationMapper.php',
    4448    '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',
    4563    'TutorLMSMigrationTool' => $baseDir . '/classes/TutorLMSMigrationTool.php',
    4664    'Utils' => $baseDir . '/classes/Utils.php',
  • tutor-lms-migration-tool/tags/2.4.0/vendor/composer/autoload_static.php

    r3329380 r3378798  
    3939        'Themeum\\TutorLMSMigrationTool\\Factories\\ProductFactory' => __DIR__ . '/../..' . '/inc/Factories/ProductFactory.php',
    4040        'Themeum\\TutorLMSMigrationTool\\Factories\\ReviewFactory' => __DIR__ . '/../..' . '/inc/Factories/ReviewFactory.php',
     41        'Themeum\\TutorLMSMigrationTool\\Factories\\SalesDataFactory' => __DIR__ . '/../..' . '/inc/Factories/SalesDataFactory.php',
    4142        'Themeum\\TutorLMSMigrationTool\\Factories\\StudentProgressFactory' => __DIR__ . '/../..' . '/inc/Factories/StudentProgressFactory.php',
    4243        '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',
    4346        'Themeum\\TutorLMSMigrationTool\\Interfaces\\Order' => __DIR__ . '/../..' . '/inc/Interfaces/Order.php',
    4447        'Themeum\\TutorLMSMigrationTool\\Interfaces\\Post' => __DIR__ . '/../..' . '/inc/Interfaces/Post.php',
     
    6164        'Themeum\\TutorLMSMigrationTool\\LDMigration\\StudentProgress' => __DIR__ . '/../..' . '/inc/LDMigration/StudentProgress.php',
    6265        'Themeum\\TutorLMSMigrationTool\\MigrationLogger' => __DIR__ . '/../..' . '/inc/MigrationLogger.php',
     66        'Themeum\\TutorLMSMigrationTool\\MigrationMapper' => __DIR__ . '/../..' . '/inc/MigrationMapper.php',
    6367        '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',
    6482        'TutorLMSMigrationTool' => __DIR__ . '/../..' . '/classes/TutorLMSMigrationTool.php',
    6583        'Utils' => __DIR__ . '/../..' . '/classes/Utils.php',
  • tutor-lms-migration-tool/tags/2.4.0/vendor/composer/installed.php

    r3329380 r3378798  
    22    'root' => array(
    33        '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',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        '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',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
  • tutor-lms-migration-tool/tags/2.4.0/views/migration_ld.php

    r3327915 r3378798  
    1 <?php
    2 /**
    3  * Migration page
    4  *
    5  * @package TutorLMSMigrationTool\Views
    6  * @author Themeum <[email protected]>
    7  * @link https://themeum.com
    8  * @since 2.3.0
    9  */
    10 
    11 if ( ! defined( 'ABSPATH' ) ) {
    12     exit;
    13 }
    14 ?>
    151<div class="tutor-migration-page">
    16     <?php
    17     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    
    302    <div id="tutor-migration-wrapper">
    313        <div class="tutor-migration-area">
    324            <div class="tutor-migration-top tutor-px-48 tutor-pt-32 tutor-pb-40">
    33                 <div class=""> 
     5                <div class="">
    346                    <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
    368                    </div>
    379                    <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.
    3911                    </div>
    4012                </div>
    4113                <div class="tutor-d-flex tutor-justify-end tutor-align-center">
    42                     <img style src="<?php echo esc_url( TLMT_URL . 'assets/img/learndash.jpg' ); ?>" alt="import">
     14                    <img src="assets/img/learndash.jpg" alt="import">
    4315                </div>
    4416            </div>
     
    4820                    <li class="tutor-nav-item">
    4921                        <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
    5123                        </a>
    5224                    </li>
    5325                    <li class="tutor-nav-item">
    5426                        <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>
    6133                        </div>
    6234                    </li>
    6335                    <li class="tutor-nav-item tutor-nav-more tutor-d-none">
    6436                        <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>
    6638                            <span class="tutor-nav-more-icon tutor-icon-times"></span>
    6739                        </a>
     
    7446                <div id="tutor-auto-migrate-tab" class="tutor-tab-item is-active">
    7547                    <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">
    7849                            <div class="lp-migration-checkbox">
    7950                                <div id="sectionCourse">
    80                                     <label for="courses">
     51                                    <label>
    8152                                        <div class="lp-migration-singlebox">
    8253                                            <div class="lp-migration-singlebox-checkbox">
     
    8758                                                <div class="tutor-fs-6 tutor-fw-medium tutor-color-black tutor-mb-4 tutor-course-content-title">Courses</div>
    8859                                                <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.
    9061                                                </div>
    9162                                                <div class="tutor-progress tutor-mb-8" data-percent="0" style="--tutor-progress: 0%;"></div>
     
    9566                                </div>
    9667                                <div id="sectionOrders" class="tutor-py-16">
    97                                     <label for="sales-data">
     68                                    <label>
    9869                                        <div class="lp-migration-singlebox">
    9970                                            <div class="lp-migration-singlebox-checkbox">
     
    10273                                            <div class="lp-migration-singlebox-desc">
    10374                                                <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
    10576                                                </div>
    10677                                                <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.
    10879                                                </div>
    10980                                                <div class="tutor-progress tutor-mb-8" data-percent="0" style="--tutor-progress: 0%;"></div>
     
    11384                                </div>
    11485                                <div id="sectionReviews" class="tutor-py-16">
    115                                     <label for="reviews">
     86                                    <label>
    11687                                        <div class="lp-migration-singlebox">
    11788                                            <div class="lp-migration-singlebox-checkbox">
     
    12091                                            <div class="lp-migration-singlebox-desc">
    12192                                                <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
    12394                                                </div>
    12495                                                <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.
    12697                                                </div>
    12798                                                <div class="tutor-progress tutor-mb-8" data-percent="0" style="--tutor-progress: 0%;"></div>
     
    135106                    </div>
    136107                    <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
    140112                <div id="tutor-manual-migrate-tab" class="tutor-tab-item">
    141113                    <div class="tutor-tab-item-wrap tutor-p-48">
     
    144116                                <span class="tutor-fs-3 tutor-fw-medium tutor-color-primary tutor-icon-import"></span>
    145117                            </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>
    154124                                <span class="file-info tutor-fw-medium backup-now-subtile tutor-fs-6"></span>
    155125                            </form>
     
    160130                        <div class="tutor-row tutor-align-center">
    161131                            <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>
    171136                            </div>
    172137                            <div class="migrate-now-btn-wrapper tutor-col-md-4 tutor-d-flex tutor-justify-end">
    173138                                <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
    175140                                </button>
    176141                            </div>
     
    179144                </div>
    180145            </div>
    181             <!-- ./ tutor migration tab -->
    182146        </div>
    183147
    184148        <!-- migration history area -->
    185         <?php if ( count( $tutor_migration_history ) ) : ?>
    186149        <div class="tutor-migration-history">
    187150            <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
    189152            </div>
    190153            <div class="tutor-table-responsive">
     
    192155                    <thead>
    193156                        <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>
    199159                        </tr>
    200160                    </thead>
    201161                    <tbody>
    202                         <?php foreach ( $tutor_migration_history as $tutor_history ) : ?>
    203162                        <tr>
    204163                            <td>
    205164                                <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>
    222169                                <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>
    226171                                </div>
    227172                            </td>
    228173                        </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>
    230186                    </tbody>
    231187                </table>
    232188            </div>
    233189        </div>
    234         <?php endif; ?>
    235         <!-- ./ tutor-migration-history -->
    236     </div>
    237 </div>
    238 
     190    </div>
     191</div>
     192
     193<!-- Modal: Confirmation -->
    239194<div class="lp-migration-modal-wrap">
    240195    <div class="lp-migration-modal">
    241196        <div class="lp-migration-alert lp-import flex-center tutor-flex-column tutor-py-60 tutor-text-center">
    242197            <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">
    244199            </div>
    245200            <div class="migration-modal-btn-group flex-center tutor-flex-column">
    246201                <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?
    250203                </div>
    251204                <div class="tutor-d-flex">
    252205                    <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>
    254207                    </a>
    255208                    <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
    259210                    </a>
    260211                </div>
     
    268219</div>
    269220
    270 
     221<!-- Modal: Success -->
    271222<div class="lp-success-modal-wrap">
    272223    <div class="lp-success-modal">
     
    282233                <span class="modal-close-line success-close-line-two"></span>
    283234            </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
    292243            </a>
    293244        </div>
     
    295246</div>
    296247
     248<!-- Modal: Error -->
    297249<div class="lp-error-modal-wrap">
    298250    <div class="lp-error-modal">
    299251        <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">
    301253            <div class="modal-close success-modal-close">
    302254                <span class="modal-close-line success-close-line-one"></span>
    303255                <span class="modal-close-line success-close-line-two"></span>
    304256            </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
    313265            </a>
    314266        </div>
  • tutor-lms-migration-tool/trunk/assets/css/admin.css

    r2997569 r3378798  
    1 .tutor-progress{
     1.tutor-progress {
    22    height: 4px;
    33    width: 80%;
    4     background: #E3E6EB;
     4    background: #e3e6eb;
    55    border-radius: 30px;
    66    position: relative;
     
    88    margin-bottom: 25px;
    99}
    10 .tutor-progress::before{
     10
     11.tutor-progress::before {
    1112    content: '';
    1213    position: absolute;
     
    1718    transition: 300ms;
    1819}
    19 .lp-migration-singlebox {
     20
     21.lp-migration-singlebox,
     22.wc-migration-singlebox {
    2023    display: grid;
    2124    grid-template-columns: 3% 80%;
     
    2326    grid-gap: 15px;
    2427}
     28
     29.wc-migration-singlebox {
     30    min-height: auto;
     31}
     32
    2533/* css spinner */
    2634.backup-now-btn {
     
    3341    cursor: pointer;
    3442}
     43
    3544.backup-now-btn:not(:disabled):hover {
    3645    color: var(--tutor-color-primary);
    3746}
    38 .backup-now-btn:disabled {
     47
     48.backup-now-btn:disabled {
    3949    color: #86878a;
    4050}
     51
    4152.j-spinner {
    4253    --spinner-size: 22px;
     
    5162    box-sizing: border-box;
    5263    animation: none;
    53     background: #CDCFD5;
     64    background: #cdcfd5;
    5465    background-size: 55%;
    5566    background-position: 5px 7px;
    5667    background-repeat: no-repeat;
    5768    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 {
    6172    border: none;
    6273    animation: none;
     
    6677    background-repeat: no-repeat;
    6778    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 {
    7182    border: none;
    7283    background-color: transparent;
     
    7586    background-repeat: no-repeat;
    7687    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
    8091@-webkit-keyframes spinner-circle-rotate {
    8192    100% {
     
    8394    }
    8495}
     96
    8597.lp-migration-checkbox label:not(:first-child) .lp-migration-singlebox {
    8698    margin-top: 20px;
    8799}
    88 .lp-migration-singlebox-checkbox{
     100
     101.lp-migration-singlebox-checkbox {
    89102    position: relative;
    90103    margin-top: 3px;
    91104}
    92 .lp-migration-singlebox-checkbox input{
     105
     106.lp-migration-singlebox-checkbox input {
    93107    position: absolute;
    94108    right: -20px;
     
    96110    cursor: pointer;
    97111}
    98 .lp-migration-singlebox-checkbox .checkmark{
     112
     113.lp-migration-singlebox-checkbox .checkmark {
    99114    position: absolute;
    100115    top: 0;
     
    102117    width: 24px;
    103118    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: '';
    108124    position: absolute;
    109125    display: none;
    110126}
    111 .lp-migration-singlebox-checkbox .checkmark:after{
     127
     128.lp-migration-singlebox-checkbox .checkmark:after {
    112129    top: 3px;
    113130    left: 8px;
     
    119136    transform: rotate(45deg);
    120137}
    121 .lp-migration-singlebox-checkbox input:checked ~ .checkmark:after{
     138
     139.lp-migration-singlebox-checkbox input:checked~.checkmark:after {
    122140    display: block;
    123141}
    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
    127147/* migration-modal */
    128148.lp-migration-modal-wrap {
    129149    position: fixed;
    130     background: rgba(0,0,0, 0.5);
     150    background: rgba(0, 0, 0, 0.5);
    131151    top: 0;
    132152    bottom: 0;
     
    136156    z-index: 9999;
    137157}
     158
    138159.lp-migration-modal {
    139160    max-width: 730px;
     
    144165    transform: translate(-50%, -50%);
    145166}
     167
    146168.lp-migration-modal-wrap.active {
    147169    display: block;
     
    149171
    150172.lp-migration-alert {
    151     background: #FFFFFF;
    152     border: 1px solid #E0E2EA;
     173    background: #ffffff;
     174    border: 1px solid #e0e2ea;
    153175    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.05);
    154176    border-radius: 6px;
    155177    min-width: 350px;
    156178}
    157 @media (min-width : 576px) {
     179
     180@media (min-width: 576px) {
    158181    .lp-migration-alert {
    159182        width: 600px;
    160183    }
    161184}
     185
    162186.migration-failed-btn:last-child {
    163187    margin-left: 30px;
    164188}
     189
    165190.lp-migration-modal-icon img {
    166191    width: 80px;
    167192}
     193
    168194.modal-close {
    169195    position: absolute;
     
    177203    align-items: center;
    178204}
     205
    179206.modal-close-line {
    180207    position: absolute;
     
    182209    height: 20px;
    183210    top: 22px;
    184     background: #9CA0AC;
    185 }
     211    background: #9ca0ac;
     212}
     213
    186214.modal-close-line.error-close-line-one,
    187215.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 {
    189217    transform: rotate(42deg);
    190218}
     219
    191220.modal-close-line.error-close-line-two,
    192221.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 {
    194223    transform: rotate(134deg);
    195224}
     225
    196226.lp-modal-alert {
    197227    background-color: white;
     
    203233    position: relative;
    204234}
     235
    205236.lp-modal-alert .lp-modal-icon {
    206237    border-radius: 50%;
     
    212243    width: 80px;
    213244}
     245
    214246.lp-modal-alert .lp-modal-icon.lp-modal-error:after,
    215247.lp-modal-alert .lp-modal-icon.lp-modal-error:before {
     
    221253    width: 60px;
    222254}
     255
    223256.lp-modal-alert .lp-modal-icon.lp-modal-error:before {
    224257    border-radius: 120px 0 0 120px;
     
    228261    transform: rotate(-45deg);
    229262}
     263
    230264.lp-modal-alert .lp-modal-icon.lp-modal-error:after {
    231265    border-radius: 0 120px 120px 0;
     
    235269    transform: rotate(-45deg);
    236270}
     271
    237272.lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-placeholder {
    238273    border-radius: 50%;
     
    246281    z-index: 2;
    247282}
     283
    248284.lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-fix {
    249285    background-color: #fff;
     
    256292    z-index: 1;
    257293}
     294
    258295.lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line {
    259     background-color: #A5DC86;
     296    background-color: #a5dc86;
    260297    border-radius: 2px;
    261298    display: block;
     
    264301    z-index: 2;
    265302}
     303
    266304.lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line.lp-modal-tip {
    267305    left: 14px;
     
    270308    width: 25px;
    271309}
     310
    272311.lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line.lp-modal-long {
    273312    right: 8px;
     
    276315    width: 47px;
    277316}
     317
    278318.lp-modal-alert .lp-modal-icon.lp-modal-error {
    279     border-color: #F27474;
    280 }
     319    border-color: #f27474;
     320}
     321
    281322.lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-x-mark {
    282323    display: block;
     
    284325    z-index: 2;
    285326}
     327
    286328.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
    289332.lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line {
    290     background-color: #FF2624;
     333    background-color: #ff2624;
    291334    top: 37px;
    292335    width: 47px;
    293336}
     337
    294338.lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line.lp-modal-left {
    295339    left: 17px;
    296340    transform: rotate(45deg);
    297341}
     342
    298343.lp-modal-alert .lp-modal-icon.lp-modal-error .lp-modal-line.lp-modal-right {
    299344    right: 16px;
    300345    transform: rotate(-45deg);
    301346}
     347
    302348.lp-modal-icon.lp-modal-error.animate:after {
    303349    animation: rotatePlaceholder 4.25s ease-in;
    304350}
     351
    305352.animateXLeft {
    306     animation: animateXLeft .75s;
    307 }
     353    animation: animateXLeft 0.75s;
     354}
     355
    308356.animateXRight {
    309     animation: animateXRight .75s;
    310 }
     357    animation: animateXRight 0.75s;
     358}
     359
    311360@keyframes rotatePlaceholder {
    312     0%,5% {
     361
     362    0%,
     363    5% {
    313364        transform: rotate(-45deg);
    314365    }
    315     100%,12% {
     366
     367    100%,
     368    12% {
    316369        transform: rotate(-405deg);
    317370    }
    318371}
     372
    319373@keyframes animateXLeft {
     374
    320375    0%,
    321376    65% {
     
    324379        width: 0;
    325380    }
     381
    326382    84% {
    327383        left: 14px;
     
    329385        width: 47px;
    330386    }
     387
    331388    100% {
    332389        left: 17px;
     
    335392    }
    336393}
     394
    337395@keyframes animateXRight {
     396
    338397    0%,
    339398    65% {
     
    342401        width: 0;
    343402    }
     403
    344404    84% {
    345405        right: 14px;
     
    347407        width: 47px;
    348408    }
     409
    349410    100% {
    350411        right: 16px;
     
    353414    }
    354415}
     416
    355417/* modal success */
    356 .lp-success-modal ,
     418.lp-success-modal,
    357419.lp-error-modal {
    358420    position: fixed;
     
    362424    display: none;
    363425    z-index: 999999;
    364     background: rgba(0,0,0, 0.3);
     426    background: rgba(0, 0, 0, 0.3);
    365427    width: 100%;
    366428    height: 100%;
    367429}
     430
    368431.lp-error-modal.active,
    369432.lp-success-modal.active {
     
    372435    align-items: center;
    373436}
     437
    374438.lp-modal-alert {
    375439    background-color: #fff;
     
    377441    border-radius: 4px;
    378442}
     443
    379444.lp-modal-alert .lp-modal-icon {
    380445    border-radius: 50%;
     
    388453}
    389454
    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
    393459.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 {
    395461    background: #fff;
    396462    content: '';
     
    401467    width: 60px;
    402468}
    403 .lp-modal-alert .lp-modal-icon.lp-modal-success:before{
     469
     470.lp-modal-alert .lp-modal-icon.lp-modal-success:before {
    404471    border-radius: 120px 0 0 120px;
    405472    left: -33px;
     
    408475    transform: rotate(-45deg);
    409476}
    410 .lp-modal-alert .lp-modal-icon.lp-modal-success:after{
     477
     478.lp-modal-alert .lp-modal-icon.lp-modal-success:after {
    411479    border-radius: 0 120px 120px 0;
    412480    left: 30px;
     
    415483    transform: rotate(-45deg);
    416484}
    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 {
    418487    border-radius: 50%;
    419     border: 4px solid #24A148;
     488    border: 4px solid #24a148;
    420489    box-sizing: content-box;
    421490    height: 80px;
     
    426495    z-index: 2;
    427496}
    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 {
    429499    background-color: #fff;
    430500    height: 90px;
     
    436506    z-index: 1;
    437507}
    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;
    440511    border-radius: 2px;
    441512    display: block;
     
    444515    z-index: 2;
    445516}
    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 {
    447519    left: 14px;
    448520    top: 46px;
     
    450522    width: 25px;
    451523}
    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 {
    453526    right: 8px;
    454527    top: 38px;
     
    456529    width: 47px;
    457530}
     531
    458532.lp-modal-alert .lp-modal-icon.lp-modal-warning:after {
    459533    background-color: #fff;
     
    466540    z-index: 1;
    467541}
     542
    468543.animateSuccessTip {
    469     animation: animateSuccessTip .75s;
    470 }
     544    animation: animateSuccessTip 0.75s;
     545}
     546
    471547.animateSuccessLong {
    472     animation: animateSuccessLong .75s;
    473 }
     548    animation: animateSuccessLong 0.75s;
     549}
     550
    474551.lp-modal-icon.lp-modal-success.animate:after {
    475552    animation: rotatePlaceholder 4.25s ease-in;
    476553}
     554
    477555@keyframes animateSuccessTip {
    478     0%,54% {
     556
     557    0%,
     558    54% {
    479559        width: 0;
    480560        left: 1px;
    481561        top: 19px;
    482562    }
     563
    483564    70% {
    484565        width: 50px;
     
    486567        top: 37px;
    487568    }
     569
    488570    84% {
    489571        width: 17px;
     
    491573        top: 48px;
    492574    }
     575
    493576    100% {
    494577        width: 25px;
     
    497580    }
    498581}
     582
    499583@keyframes animateSuccessLong {
    500     0%,65% {
     584
     585    0%,
     586    65% {
    501587        width: 0;
    502588        right: 46px;
    503589        top: 54px;
    504590    }
     591
    505592    84% {
    506593        width: 55px;
     
    508595        top: 35px;
    509596    }
     597
    510598    100% {
    511599        width: 47px;
     
    514602    }
    515603}
     604
    516605@keyframes rotatePlaceholder {
    517     0%,5% {
     606
     607    0%,
     608    5% {
    518609        -webkit-transform: rotate(-45deg);
    519610        transform: rotate(-45deg);
    520611    }
    521     100%,12% {
     612
     613    100%,
     614    12% {
    522615        -webkit-transform: rotate(-405deg);
    523616        transform: rotate(-405deg);
    524617    }
    525618}
     619
    526620.tutor-install-notice {
    527     padding: 20px;
    528     display: block
    529 }
     621    padding: 20px;
     622    display: block;
     623}
     624
    530625.tutor-install-notice .tutor-install-notice-inner {
    531     min-height: 64px
    532 }
     626    min-height: 64px;
     627}
     628
    533629.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
    537634.tutor-install-notice-button {
    538     float: right
    539 }
     635    float: right;
     636}
     637
    540638.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
    545644.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
    551651.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
    557658.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%);
    564667    background-position: top, right, bottom, left;
    565668    background-repeat: repeat-x, repeat-y;
     
    568671    border-radius: 6px;
    569672    text-align: center;
    570 
    571 }
     673}
     674
    572675.tutor-migration-upload-area {
    573676    border-radius: 6px;
     
    578681    margin: 0 auto;
    579682}
     683
    580684.tutor-migration-upload-area .tutor-migration-upload-circle {
    581685    width: 80px;
    582686    height: 80px;
    583     background: #E9EDFB;
     687    background: #e9edfb;
    584688    border-radius: 50%;
    585689}
     690
    586691.tutor-migration-upload-area span.file_name {
    587692    display: block;
    588693    margin-top: 10px;
    589694}
     695
    590696.tutor-migration-upload-area button {
    591697    color: white;
    592698    display: inline-block;
    593699}
     700
    594701.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
    597708.tutor-migration-top {
    598709    display: grid;
     
    601712    border-radius: 6px 6px 0px 0px;
    602713}
     714
    603715.tutor-migration-top-subtitle {
    604     color: #5B616F;
    605 }
     716    color: #5b616f;
     717}
     718
    606719.tutor-migration-page #tutor-migration-wrapper #tutor-auto-migrate-tab {
    607720    border-radius: 0px 0px 6px 6px;
    608721}
     722
    609723.tutor-migration-page #tutor-migration-wrapper {
    610724    background-color: #f0f0f1;
     
    612726    overflow: hidden;
    613727}
     728
    614729#tutor-migration-wrapper .tutor-nav {
    615730    padding: 0px 48px 0px 48px;
    616731}
     732
    617733#tutor-migration-wrapper .tutor-nav .tutor-nav-item.is-active {
    618     background: #F4F6F9;
     734    background: #f4f6f9;
    619735    border-radius: 6px 6px 0px 0px;
    620736    border-color: transparent;
    621737}
     738
    622739#tutor-migration-wrapper .tutor-nav .tutor-nav-item .tutor-nav-link {
    623740    border: 1px solid transparent;
    624741    color: var(--tutor-body-color);
    625     color: #757C8E;
    626 }
     742    color: #757c8e;
     743    padding-block: 10px;
     744}
     745
    627746#tutor-migration-wrapper .tutor-nav .tutor-nav-item .tutor-nav-link.is-active {
    628     border: 1px solid #CDCFD5;
     747    border: 1px solid #e0e2ea;
    629748    color: var(--tutor-body-color) !important;
    630749}
     750
    631751.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 {
    635756    border-bottom-color: #F4F6F9;
    636757    border-width: 3px 3px 3px 4px;
    637     background: #F4F6F9;
     758    background: #f4f6f9;
    638759    border-radius: 6px 6px 0px 0px;
    639760    border-color: transparent;
    640761}
     762
    641763#tutor-migration-wrapper .tutor-nav:not(.tutor-nav-pills):not(.tutor-nav-tabs) .tutor-nav-link.is-active {
    642764    border-bottom-color: transparent;
    643765}
     766
    644767.tutor-tab-item-wrap {
    645     background: #F4F6F9;
    646 }
     768    background: #f4f6f9;
     769}
     770
    647771.tutor-migration-history {
    648772    background: #f0f0f1;
    649773}
     774
    650775.tutor-migration-history-heading {
    651776    background: #f0f0f1;
    652     color: #5B616F;
    653 }
     777    color: #5b616f;
     778}
     779
    654780.tutor-migration-history-time {
    655     color: #41454F;
    656 }
     781    color: #41454f;
     782}
     783
    657784.tutor-migration-area {
    658     border: 1px solid #E0E2EA;
     785    border: 1px solid #e0e2ea;
    659786    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.05);
    660787    border-radius: 6px;
    661788}
     789
    662790.tutor-migration-tab,
    663791.tutor-migration-tab-item {
     792    --tutor-border-color: #e0e2ea;
     793
    664794    background-color: #fff;
    665795}
     796
    666797.tutor-migration-tab-item {
    667798    border-radius: 0px 0px 6px 6px;
    668799}
    669 #tutor-migration-browse-file-link a{
     800
     801#tutor-migration-browse-file-link a {
    670802    text-decoration: underline;
    671803}
     804
    672805span.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) {
    676931    #tutor-migration-wrapper .migrate-now-btn-wrapper {
    677932        margin-top: 20px;
    678         justify-content : flex-start !important;
    679     }
     933        justify-content: flex-start !important;
     934    }
     935
    680936    .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  
     1const { __ } = wp.i18n;
     2
    13jQuery(document).ready(function ($) {
    24    'use strict';
    3     const {__} = wp.i18n;
     5    const { __ } = wp.i18n;
    46    $(document).on("click", ".install-tutor-button", function (t) {
    57        t.preventDefault();
     
    6264        var $that = $(this);
    6365        var $formData = $(this).serialize() + '&action=' + $that.attr('action');
    64      
    6566
    6667        let final_types = 'lp';
     
    6970            migration_vendor = 'ld';
    7071        }
    71         if($that.attr('action') == 'lif_migrate_all_data_to_tutor') {
     72        if ($that.attr('action') == 'lif_migrate_all_data_to_tutor') {
    7273            final_types = 'lif';
    7374            migration_vendor = 'lif';
     
    172173                    clearTimeout(checkProgress);
    173174                    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,
    177178                        action: 'insert_tutor_migration_data'
    178179                    });
     
    180181
    181182                const res = data.data;
    182                 const { total_course_count = 0, failed = []} = res || {};
    183                
     183                const { total_course_count = 0, failed = [] } = res || {};
     184
    184185                if (Number(total_course_count) > 0) {
    185186                    if (failed.length > 0) {
     
    189190                    }
    190191                } else {
    191                      $('.lp-error-modal').addClass('active');
     192                    $('.lp-error-modal').addClass('active');
    192193                }
    193194            },
     
    221222        removeItem.removeClass('active');
    222223    }
     224
    223225    // migrate now button click
    224226    $(migrateBtn).on('click', function (event) {
     
    228230        }
    229231    });
    230    
     232
    231233    // migrate now button click
    232234    $(migrateStartBtn).on('click', function (event) {
    233235        event.preventDefault();
     236        $('#wc-sales-data-migration-form').submit();
    234237        if (totalItemsMigrateCounts > 0) {
    235238            migrationModal.removeClass('active');
     
    272275    var manualMigrateNowBtn = $('#manual-migrate-now-btn');
    273276
    274     $(document).on('click', '#tutor-migration-browse-file-link a', function(event) {
     277    $(document).on('click', '#tutor-migration-browse-file-link a', function (event) {
    275278        event.preventDefault();
    276279        $('#tutor-migration-browse-file').click();
    277280    });
    278281    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) {
    280283        var inputEl = $('#tutor-migration-browse-file');
    281         if(this.files[0]) {
     284        if (this.files[0]) {
    282285            manualMigrateNowBtn.removeAttr('disabled');
    283286            getFilesAndUpdateDOM(this.files[0], inputEl);
     
    289292    var getFilesAndUpdateDOM = (files, inputEl) => {
    290293        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}`);
    294297        } else {
    295             dropZone.removeClass('file-attached');
    296             dropZone.find('.file-info').html('');
     298            dropZone.removeClass('file-attached');
     299            dropZone.find('.file-info').html('');
    297300        }
    298301    };
    299302
    300     $(document).on('click', '.backup-now-btn', function(event) {
     303    $(document).on('click', '.backup-now-btn', function (event) {
    301304        event.preventDefault();
    302305        let button = $(this);
    303306        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(),
    308311            action: 'insert_tutor_migration_data'
    309312        });
     
    311314    })
    312315
    313     $(document).on('click', '#manual-migrate-now-btn', function(event) {
     316    $(document).on('click', '#manual-migrate-now-btn', function (event) {
    314317        let button = $(this);
    315318        var fileType = $('input[name="tutor_import_file"]')[0].files[0].type;
    316         if(fileType != 'text/xml') {
     319        if (fileType != 'text/xml') {
    317320            alert('Not supported file. Upload xml file here!');
    318321            return;
     
    320323        var action_name = $('#tutor-manual-migrate-form input[name="tutor_action"]').val();
    321324        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
    324327        var formData = new FormData();
    325328        formData.append("tutor_import_file", $('input[name="tutor_import_file"]')[0].files[0]);
     
    337340            },
    338341            success: function (res) {
    339                 console.log(res);
    340342                if (res.success) {
    341343                    $('.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(),
    345347                        action: 'insert_tutor_migration_data'
    346348                    });
     
    356358    });
    357359
     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
    358834}); /* ./ jQuery */
    359835
     
    363839
    364840dropZoneInputs.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) => {
    387863    //     const files = e.target.files;
    388     //  getFilesAndUpdateDOM(files, inputEl, dropZone);
    389     // });
    390    
     864    //  getFilesAndUpdateDOM(files, inputEl, dropZone);
     865    // });
     866
    391867});
    392868
    393869const 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}`;
    398874        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    }
    403879};
  • tutor-lms-migration-tool/trunk/classes/Utils.php

    r3132123 r3378798  
    1 <?php
     1<?php
     2
     3use Tutor\Helpers\QueryHelper;
    24
    35class Utils {
    46
    5     public function fetch_history($vendor) {
    6         global $wpdb;
    7         $result = $wpdb->get_results(
    8             $wpdb->prepare(
    9                 "SELECT  * FROM {$wpdb->prefix}tutor_migration
     7    public function fetch_history( $vendor ) {
     8        global $wpdb;
     9        $result = $wpdb->get_results(
     10            $wpdb->prepare(
     11                "SELECT  * FROM {$wpdb->prefix}tutor_migration
    1012                WHERE `migration_vendor` = %s
    1113                ORDER BY ID DESC
    1214                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    }
    2129
    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     }
    2630
    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    }
    3235
    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    }
    3643
    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    }
    4148
    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    }
    4653
    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    }
    5171
    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    }
    8287}
  • tutor-lms-migration-tool/trunk/inc/Functions.php

    r3327915 r3378798  
    1616use Themeum\TutorLMSMigrationTool\Factories\ProductFactory;
    1717use Themeum\TutorLMSMigrationTool\Factories\ReviewFactory;
     18use Themeum\TutorLMSMigrationTool\Factories\SalesDataFactory;
    1819
    1920if ( ! function_exists( 'tlmt_has_tutor_pro' ) ) {
     
    371372    }
    372373}
     374
     375if ( ! 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  
    1010
    1111namespace Themeum\TutorLMSMigrationTool;
     12
     13use Themeum\TutorLMSMigrationTool\SalesData\InitSalesMigration;
     14use Themeum\TutorLMSMigrationTool\SalesData\MigrationHandler;
    1215
    1316if ( ! defined( 'ABSPATH' ) ) {
     
    3841    private function boot() {
    3942        new ActionHandler();
     43
     44        // Init WC to Native sales data migration.
     45        new InitSalesMigration();
     46        new MigrationHandler();
    4047    }
    4148}
  • tutor-lms-migration-tool/trunk/inc/MigrationTypes.php

    r3327915 r3378798  
    2121    const LP_TO_TUTOR  = 'learnpress_to_tutor';
    2222    const LIF_TO_TUTOR = 'lifter_to_tutor';
     23
     24    // sales data migration types.
     25    const WC_TO_NATIVE = 'woocommerce_to_native';
    2326}
  • tutor-lms-migration-tool/trunk/readme.txt

    r3329380 r3378798  
    22Contributors: themeum
    33Donate link: https://www.themeum.com
    4 Tags: lms, migration, course, elearning, education
     4Tags: LMS, migration, course, elearning, education
    55Requires at least: 5.0
    66Tested up to: 6.8
    77Requires PHP: 7.4
    8 Stable tag: 2.3.1
     8Stable tag: 2.4.0
    99License: GPLv3
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    1919No 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.
    2020
    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
     23The 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.
    2424
    2525Currently Tutor LMS Migration support migration options from
    2626
    2727* LearnDash
    28 * LearnPress &
    29 * LifterLMS
     28* LearnPress
     29* LifterLMS &
     30* WooCommerce to Tutor LMS Native eCommerce migration
    3031
    3132= Pre-requisites =
    3233
    33 To get started with migrating your information from LearnDash/LearnPress/Lifter LMS 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 required
    36 
    37   * Tutor LMS (Version 3.6 or later)
     34To 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)
    3839
    3940And the following plugins for their respective migrations
    4041
    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)
    4447
    4548You need the mentioned versions or later of the plugin for the migration to work properly.
     
    4750= Get Started =
    4851
    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 Migration supports the migration of the following data types:
     52fter 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:
    5255
    5356  * Courses
     
    6063  * Course Reviews
    6164
    62 LearnPress Migration supports the migration of the following data types:
     65**LearnPress Migration** supports the migration of the following data types:
    6366
    6467  * Courses
     
    7275  * Course Complete Status
    7376
    74 LifterLMS Migration supports the migration of the following data types:
     77**LifterLMS Migration** supports the migration of the following data types:
    7578
    7679  * Courses
     
    8184  * Enrollment
    8285
     86**WooCommerce Migration** supports the migration of the following data types:
     87
     88  * Orders
     89  * Subscriptions
     90  * Coupons
     91
    8392For 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.
    8493
     
    98107= Automatic installation =
    99108
    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.
     109The 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
     111On 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.
    103112
    104113= Manual installation =
     
    110119== Frequently Asked Questions ==
    111120
    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
     123Yes, 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
     127You 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/).
    119128
    120129== Screenshots ==
     
    127136== Changelog ==
    128137
    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
     140New: Migrate orders from WooCommerce to Tutor Native, including associated enrollments, customers, and earnings.
     141New: Migrate subscriptions from WooCommerce to Tutor Native, including related enrollments, customers, and earnings.
     142New: Migrate coupons from WooCommerce to Tutor Native.
     143
     144= 2.3.0 - 14 July, 2025 =
    134145
    135146New: Added support for migrating assignments from LearnDash to Tutor LMS.
  • tutor-lms-migration-tool/trunk/tutor-lms-migration-tool.php

    r3329380 r3378798  
    55 * Description: A migration toolkit that allows you to migrate data from other LMS platforms to Tutor LMS.
    66 * Author: Themeum
    7  * Version: 2.3.1
     7 * Version: 2.4.0
    88 * Author URI: http://themeum.com
    99 * Requires at least: 5.3
     
    3131 */
    3232
    33 define( 'TLMT_VERSION', '2.3.1' );
     33define( 'TLMT_VERSION', '2.4.0' );
    3434define( 'TLMT_FILE', __FILE__ );
    3535define( 'TLMT_PATH', plugin_dir_path( TLMT_FILE ) );
     
    8585
    8686// Init.
    87 new Init();
     87add_action(
     88    'plugins_loaded',
     89    function() {
     90        new Init();
     91    }
     92);
    8893
    8994if ( is_plugin_active( 'tutor/tutor.php' ) ) {
  • tutor-lms-migration-tool/trunk/vendor/composer/autoload_classmap.php

    r3329380 r3378798  
    2020    'Themeum\\TutorLMSMigrationTool\\Factories\\ProductFactory' => $baseDir . '/inc/Factories/ProductFactory.php',
    2121    'Themeum\\TutorLMSMigrationTool\\Factories\\ReviewFactory' => $baseDir . '/inc/Factories/ReviewFactory.php',
     22    'Themeum\\TutorLMSMigrationTool\\Factories\\SalesDataFactory' => $baseDir . '/inc/Factories/SalesDataFactory.php',
    2223    'Themeum\\TutorLMSMigrationTool\\Factories\\StudentProgressFactory' => $baseDir . '/inc/Factories/StudentProgressFactory.php',
    2324    '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',
    2427    'Themeum\\TutorLMSMigrationTool\\Interfaces\\Order' => $baseDir . '/inc/Interfaces/Order.php',
    2528    'Themeum\\TutorLMSMigrationTool\\Interfaces\\Post' => $baseDir . '/inc/Interfaces/Post.php',
     
    4245    'Themeum\\TutorLMSMigrationTool\\LDMigration\\StudentProgress' => $baseDir . '/inc/LDMigration/StudentProgress.php',
    4346    'Themeum\\TutorLMSMigrationTool\\MigrationLogger' => $baseDir . '/inc/MigrationLogger.php',
     47    'Themeum\\TutorLMSMigrationTool\\MigrationMapper' => $baseDir . '/inc/MigrationMapper.php',
    4448    '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',
    4563    'TutorLMSMigrationTool' => $baseDir . '/classes/TutorLMSMigrationTool.php',
    4664    'Utils' => $baseDir . '/classes/Utils.php',
  • tutor-lms-migration-tool/trunk/vendor/composer/autoload_static.php

    r3329380 r3378798  
    3939        'Themeum\\TutorLMSMigrationTool\\Factories\\ProductFactory' => __DIR__ . '/../..' . '/inc/Factories/ProductFactory.php',
    4040        'Themeum\\TutorLMSMigrationTool\\Factories\\ReviewFactory' => __DIR__ . '/../..' . '/inc/Factories/ReviewFactory.php',
     41        'Themeum\\TutorLMSMigrationTool\\Factories\\SalesDataFactory' => __DIR__ . '/../..' . '/inc/Factories/SalesDataFactory.php',
    4142        'Themeum\\TutorLMSMigrationTool\\Factories\\StudentProgressFactory' => __DIR__ . '/../..' . '/inc/Factories/StudentProgressFactory.php',
    4243        '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',
    4346        'Themeum\\TutorLMSMigrationTool\\Interfaces\\Order' => __DIR__ . '/../..' . '/inc/Interfaces/Order.php',
    4447        'Themeum\\TutorLMSMigrationTool\\Interfaces\\Post' => __DIR__ . '/../..' . '/inc/Interfaces/Post.php',
     
    6164        'Themeum\\TutorLMSMigrationTool\\LDMigration\\StudentProgress' => __DIR__ . '/../..' . '/inc/LDMigration/StudentProgress.php',
    6265        'Themeum\\TutorLMSMigrationTool\\MigrationLogger' => __DIR__ . '/../..' . '/inc/MigrationLogger.php',
     66        'Themeum\\TutorLMSMigrationTool\\MigrationMapper' => __DIR__ . '/../..' . '/inc/MigrationMapper.php',
    6367        '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',
    6482        'TutorLMSMigrationTool' => __DIR__ . '/../..' . '/classes/TutorLMSMigrationTool.php',
    6583        'Utils' => __DIR__ . '/../..' . '/classes/Utils.php',
  • tutor-lms-migration-tool/trunk/vendor/composer/installed.php

    r3329380 r3378798  
    22    'root' => array(
    33        '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',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        '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',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
  • tutor-lms-migration-tool/trunk/views/migration_ld.php

    r3327915 r3378798  
    1 <?php
    2 /**
    3  * Migration page
    4  *
    5  * @package TutorLMSMigrationTool\Views
    6  * @author Themeum <[email protected]>
    7  * @link https://themeum.com
    8  * @since 2.3.0
    9  */
    10 
    11 if ( ! defined( 'ABSPATH' ) ) {
    12     exit;
    13 }
    14 ?>
    151<div class="tutor-migration-page">
    16     <?php
    17     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    
    302    <div id="tutor-migration-wrapper">
    313        <div class="tutor-migration-area">
    324            <div class="tutor-migration-top tutor-px-48 tutor-pt-32 tutor-pb-40">
    33                 <div class=""> 
     5                <div class="">
    346                    <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
    368                    </div>
    379                    <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.
    3911                    </div>
    4012                </div>
    4113                <div class="tutor-d-flex tutor-justify-end tutor-align-center">
    42                     <img style src="<?php echo esc_url( TLMT_URL . 'assets/img/learndash.jpg' ); ?>" alt="import">
     14                    <img src="assets/img/learndash.jpg" alt="import">
    4315                </div>
    4416            </div>
     
    4820                    <li class="tutor-nav-item">
    4921                        <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
    5123                        </a>
    5224                    </li>
    5325                    <li class="tutor-nav-item">
    5426                        <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>
    6133                        </div>
    6234                    </li>
    6335                    <li class="tutor-nav-item tutor-nav-more tutor-d-none">
    6436                        <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>
    6638                            <span class="tutor-nav-more-icon tutor-icon-times"></span>
    6739                        </a>
     
    7446                <div id="tutor-auto-migrate-tab" class="tutor-tab-item is-active">
    7547                    <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">
    7849                            <div class="lp-migration-checkbox">
    7950                                <div id="sectionCourse">
    80                                     <label for="courses">
     51                                    <label>
    8152                                        <div class="lp-migration-singlebox">
    8253                                            <div class="lp-migration-singlebox-checkbox">
     
    8758                                                <div class="tutor-fs-6 tutor-fw-medium tutor-color-black tutor-mb-4 tutor-course-content-title">Courses</div>
    8859                                                <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.
    9061                                                </div>
    9162                                                <div class="tutor-progress tutor-mb-8" data-percent="0" style="--tutor-progress: 0%;"></div>
     
    9566                                </div>
    9667                                <div id="sectionOrders" class="tutor-py-16">
    97                                     <label for="sales-data">
     68                                    <label>
    9869                                        <div class="lp-migration-singlebox">
    9970                                            <div class="lp-migration-singlebox-checkbox">
     
    10273                                            <div class="lp-migration-singlebox-desc">
    10374                                                <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
    10576                                                </div>
    10677                                                <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.
    10879                                                </div>
    10980                                                <div class="tutor-progress tutor-mb-8" data-percent="0" style="--tutor-progress: 0%;"></div>
     
    11384                                </div>
    11485                                <div id="sectionReviews" class="tutor-py-16">
    115                                     <label for="reviews">
     86                                    <label>
    11687                                        <div class="lp-migration-singlebox">
    11788                                            <div class="lp-migration-singlebox-checkbox">
     
    12091                                            <div class="lp-migration-singlebox-desc">
    12192                                                <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
    12394                                                </div>
    12495                                                <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.
    12697                                                </div>
    12798                                                <div class="tutor-progress tutor-mb-8" data-percent="0" style="--tutor-progress: 0%;"></div>
     
    135106                    </div>
    136107                    <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
    140112                <div id="tutor-manual-migrate-tab" class="tutor-tab-item">
    141113                    <div class="tutor-tab-item-wrap tutor-p-48">
     
    144116                                <span class="tutor-fs-3 tutor-fw-medium tutor-color-primary tutor-icon-import"></span>
    145117                            </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>
    154124                                <span class="file-info tutor-fw-medium backup-now-subtile tutor-fs-6"></span>
    155125                            </form>
     
    160130                        <div class="tutor-row tutor-align-center">
    161131                            <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>
    171136                            </div>
    172137                            <div class="migrate-now-btn-wrapper tutor-col-md-4 tutor-d-flex tutor-justify-end">
    173138                                <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
    175140                                </button>
    176141                            </div>
     
    179144                </div>
    180145            </div>
    181             <!-- ./ tutor migration tab -->
    182146        </div>
    183147
    184148        <!-- migration history area -->
    185         <?php if ( count( $tutor_migration_history ) ) : ?>
    186149        <div class="tutor-migration-history">
    187150            <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
    189152            </div>
    190153            <div class="tutor-table-responsive">
     
    192155                    <thead>
    193156                        <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>
    199159                        </tr>
    200160                    </thead>
    201161                    <tbody>
    202                         <?php foreach ( $tutor_migration_history as $tutor_history ) : ?>
    203162                        <tr>
    204163                            <td>
    205164                                <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>
    222169                                <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>
    226171                                </div>
    227172                            </td>
    228173                        </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>
    230186                    </tbody>
    231187                </table>
    232188            </div>
    233189        </div>
    234         <?php endif; ?>
    235         <!-- ./ tutor-migration-history -->
    236     </div>
    237 </div>
    238 
     190    </div>
     191</div>
     192
     193<!-- Modal: Confirmation -->
    239194<div class="lp-migration-modal-wrap">
    240195    <div class="lp-migration-modal">
    241196        <div class="lp-migration-alert lp-import flex-center tutor-flex-column tutor-py-60 tutor-text-center">
    242197            <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">
    244199            </div>
    245200            <div class="migration-modal-btn-group flex-center tutor-flex-column">
    246201                <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?
    250203                </div>
    251204                <div class="tutor-d-flex">
    252205                    <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>
    254207                    </a>
    255208                    <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
    259210                    </a>
    260211                </div>
     
    268219</div>
    269220
    270 
     221<!-- Modal: Success -->
    271222<div class="lp-success-modal-wrap">
    272223    <div class="lp-success-modal">
     
    282233                <span class="modal-close-line success-close-line-two"></span>
    283234            </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
    292243            </a>
    293244        </div>
     
    295246</div>
    296247
     248<!-- Modal: Error -->
    297249<div class="lp-error-modal-wrap">
    298250    <div class="lp-error-modal">
    299251        <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">
    301253            <div class="modal-close success-modal-close">
    302254                <span class="modal-close-line success-close-line-one"></span>
    303255                <span class="modal-close-line success-close-line-two"></span>
    304256            </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
    313265            </a>
    314266        </div>
Note: See TracChangeset for help on using the changeset viewer.