Template Kit – Import - Version 1.0.0-RC2

Version Description

  • 2020-01-09 =
  • Initial public release candidate.
Download this release

Release Info

Developer dtbaker
Plugin Icon 128x128 Template Kit – Import
Version 1.0.0-RC2
Comparing to
See all releases

Version 1.0.0-RC2

assets/css/main.min.css ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .envato-template-kit-import-screen-only,.screen-reader-text,.screen-reader-text span,.ui-helper-hidden-accessible{position:absolute;top:-10000em;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0}
2
+ .envato-template-kit-import-clearfix:after{content:'';display:block;clear:both;width:0;height:0}
3
+ .envato-template-kit-import__wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin:0;min-height:85vh;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;color:#555d66;background:#f1f1f1;margin:0 0 0 -20px}
4
+ .envato-template-kit-import__wrapper .dashicons{vertical-align:bottom}
5
+ .envato-template-kit-import__header{background-color:#fff;border-bottom:1px solid #e0e5e9;padding:30px}
6
+ .envato-template-kit-import__header p{margin-bottom:0}
7
+ .envato-template-kit-import__header-logo{position:absolute;right:26px;top:15px}
8
+ .envato-template-kit-import__tabset{background:#f9f9f9;border-top:1px solid #f1f1f1;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}
9
+ .envato-template-kit-import__tab{border-right:1px solid #e0e5e9;color:#000;cursor:pointer;font-weight:bold;padding:17px 30px 14px;text-decoration:none}
10
+ .envato-template-kit-import__tab:focus,.envato-template-kit-import__tab:active{outline:0;-webkit-box-shadow:none;box-shadow:none}
11
+ .envato-template-kit-import__tab--current{border-bottom:2px solid #837e7e}
12
+ .envato-template-kit-import__tab-panel{background:#f1f1f1;border-top:1px solid #e0e5e9;color:#000;padding:20px 30px;overflow:hidden}
13
+ .envato-template-kit-import__template-kit{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;margin-bottom:40px}
14
+ .envato-template-kit-import__title{font-weight:bold;text-transform:capitalize}
15
+ .envato-template-kit-import__screenshot{margin-right:25px;max-width:300px;height:200px;overflow:hidden}
16
+ .envato-template-kit-import__screenshot img{width:100%;height:auto}
17
+ .envato-template-kit-import__next{margin-left:auto}
18
+ .envato-template-kit-import__upload{background-color:#fff;border:1px solid #e0e5e9;margin-right:auto;margin-left:auto;padding:50px 25px;max-width:900px}
19
+ .envato-template-kit-import__upload-form{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}
20
+ .envato-template-kit-import__upload-btn{background:#f7f7f7;border:1px solid #ccc;border-radius:3px;padding:16px}
21
+ .envato-template-kit-import__upload-btn-next{background:#0085ba;border-color:#0085ba;color:#fff;border-radius:3px;font-size:13px;padding:16px 20px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #0073a1;box-shadow:inset 0 -2px 0 #0073a1}
22
+ .envato-template-kit-import__upload-btn-next:hover,.envato-template-kit-import__upload-btn-next:focus{background:#0090c9;border-color:#007aab;color:#fff}
23
+ .envato-template-kit-import__upload-btn-next:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba;box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba}
24
+ .envato-template-kit-import__upload-btn-next:active{background:#0073a1;border-color:#0073a1;color:#fff}
25
+ .envato-template-kit-import__upload-btn-next-input{background:#0085ba;border-color:#0085ba;color:#fff;border-radius:3px;font-size:13px;padding:16px 20px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #0073a1;box-shadow:inset 0 -2px 0 #0073a1;width:200px}
26
+ .envato-template-kit-import__upload-btn-next-input:hover,.envato-template-kit-import__upload-btn-next-input:focus{background:#0090c9;border-color:#007aab;color:#fff}
27
+ .envato-template-kit-import__upload-btn-next-input:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba;box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba}
28
+ .envato-template-kit-import__upload-btn-next-input:active{background:#0073a1;border-color:#0073a1;color:#fff}
29
+ .envato-template-kit-import__upload-btn-next-link{background:#0085ba;border-color:#0085ba;color:#fff;border-radius:3px;font-size:13px;padding:16px 20px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #0073a1;box-shadow:inset 0 -2px 0 #0073a1;padding-right:87px;padding-left:87px}
30
+ .envato-template-kit-import__upload-btn-next-link:hover,.envato-template-kit-import__upload-btn-next-link:focus{background:#0090c9;border-color:#007aab;color:#fff}
31
+ .envato-template-kit-import__upload-btn-next-link:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba;box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba}
32
+ .envato-template-kit-import__upload-btn-next-link:active{background:#0073a1;border-color:#0073a1;color:#fff}
33
+ .envato-template-kit-import__upload-hidden{display:none}
34
+ .envato-template-kit-import__templates{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;width:100%;margin:40px auto 40px}
35
+ .envato-template-kit-import__template{-webkit-box-flex:0;-webkit-flex:0 0 30%;-ms-flex:0 0 30%;flex:0 0 30%;margin-right:3%;margin-bottom:3%;background:#fff;border:1px solid #ccd6df}
36
+ .envato-template-kit-import__template-screenshot-wrapper{height:300px;overflow:hidden}
37
+ .envato-template-kit-import__template-screenshot{max-width:100%;height:auto}
38
+ .envato-template-kit-import__template-title{text-align:center;padding:20px 0 0;font-size:16px}
39
+ .envato-template-kit-import__template-import-options{text-align:center;padding:20px 0}
40
+ .envato-template-kit-import__button-import{background:#0085ba;border-color:#0085ba;color:#fff;border-radius:3px;font-size:13px;padding:16px 20px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #0073a1;box-shadow:inset 0 -2px 0 #0073a1}
41
+ .envato-template-kit-import__button-import:hover,.envato-template-kit-import__button-import:focus{background:#0090c9;border-color:#007aab;color:#fff}
42
+ .envato-template-kit-import__button-import:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba;box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba}
43
+ .envato-template-kit-import__button-import:active{background:#0073a1;border-color:#0073a1;color:#fff}
44
+ .envato-template-kit-import__button-edit{background:#0085ba;border-color:#0085ba;color:#fff;border-radius:3px;font-size:13px;padding:16px 20px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #0073a1;box-shadow:inset 0 -2px 0 #0073a1}
45
+ .envato-template-kit-import__button-edit:hover,.envato-template-kit-import__button-edit:focus{background:#0090c9;border-color:#007aab;color:#fff}
46
+ .envato-template-kit-import__button-edit:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba;box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba}
47
+ .envato-template-kit-import__button-edit:active{background:#0073a1;border-color:#0073a1;color:#fff}
48
+ .envato-template-kit-import__button-import-again{background:#818a91;border-color:#818a91;color:#fff;border-radius:3px;font-size:13px;padding:16px 20px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #747d85;box-shadow:inset 0 -2px 0 #747d85}
49
+ .envato-template-kit-import__button-import-again:hover,.envato-template-kit-import__button-import-again:focus{background:#899298;border-color:#79828a;color:#fff}
50
+ .envato-template-kit-import__button-import-again:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #818a91;box-shadow:0 0 0 1px #fff,0 0 0 3px #818a91}
51
+ .envato-template-kit-import__button-import-again:active{background:#747d85;border-color:#747d85;color:#fff}
52
+ .envato-template-kit-import__plugins{background:#fff;border:1px solid #ccd6df;margin:40px auto 40px;padding:20px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}
53
+ .envato-template-kit-import__plugin-list-wrapper{-webkit-box-flex:0;-webkit-flex:0 0 690px;-ms-flex:0 0 690px;flex:0 0 690px}
54
+ .envato-template-kit-import__plugin-list{padding-top:10px;padding-left:10px}
55
+ .envato-template-kit-import__plugin{border-bottom:1px solid #ccd6df;padding:10px 0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;width:100%}
56
+ .envato-template-kit-import__plugin-title{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}
57
+ .envato-template-kit-import__plugin-status{-webkit-box-flex:0;-webkit-flex:0 0 200px;-ms-flex:0 0 200px;flex:0 0 200px}
58
+ .envato-template-kit-import__plugin-status--deactivated{background:#0085ba;border-color:#0085ba;color:#fff;border-radius:3px;font-size:13px;padding:5px 15px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #0073a1;box-shadow:inset 0 -2px 0 #0073a1}
59
+ .envato-template-kit-import__plugin-status--deactivated:hover,.envato-template-kit-import__plugin-status--deactivated:focus{background:#0090c9;border-color:#007aab;color:#fff}
60
+ .envato-template-kit-import__plugin-status--deactivated:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba;box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba}
61
+ .envato-template-kit-import__plugin-status--deactivated:active{background:#0073a1;border-color:#0073a1;color:#fff}
62
+ .envato-template-kit-import__plugin-status--deactivated [data-plugin-status="deactivated"]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}
63
+ .envato-template-kit-import__plugin-status--update{background:#0085ba;border-color:#0085ba;color:#fff;border-radius:3px;font-size:13px;padding:5px 15px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #0073a1;box-shadow:inset 0 -2px 0 #0073a1}
64
+ .envato-template-kit-import__plugin-status--update:hover,.envato-template-kit-import__plugin-status--update:focus{background:#0090c9;border-color:#007aab;color:#fff}
65
+ .envato-template-kit-import__plugin-status--update:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba;box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba}
66
+ .envato-template-kit-import__plugin-status--update:active{background:#0073a1;border-color:#0073a1;color:#fff}
67
+ .envato-template-kit-import__plugin-status--update [data-plugin-status="update"]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}
68
+ .envato-template-kit-import__plugin-status--install{background:#0085ba;border-color:#0085ba;color:#fff;border-radius:3px;font-size:13px;padding:5px 15px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #0073a1;box-shadow:inset 0 -2px 0 #0073a1}
69
+ .envato-template-kit-import__plugin-status--install:hover,.envato-template-kit-import__plugin-status--install:focus{background:#0090c9;border-color:#007aab;color:#fff}
70
+ .envato-template-kit-import__plugin-status--install:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba;box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba}
71
+ .envato-template-kit-import__plugin-status--install:active{background:#0073a1;border-color:#0073a1;color:#fff}
72
+ .envato-template-kit-import__plugin-status--install [data-plugin-status="install"]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}
73
+ .envato-template-kit-import__plugin-status--activated{background:#d0d0d0;border-color:#d0d0d0;color:#030303;border-radius:3px;font-size:13px;padding:5px 15px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #c3c3c3;box-shadow:inset 0 -2px 0 #c3c3c3}
74
+ .envato-template-kit-import__plugin-status--activated:hover,.envato-template-kit-import__plugin-status--activated:focus{background:#d8d8d8;border-color:#c8c8c8;color:#030303}
75
+ .envato-template-kit-import__plugin-status--activated:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #d0d0d0;box-shadow:0 0 0 1px #fff,0 0 0 3px #d0d0d0}
76
+ .envato-template-kit-import__plugin-status--activated:active{background:#c3c3c3;border-color:#c3c3c3;color:#030303}
77
+ .envato-template-kit-import__plugin-status--activated [data-plugin-status="activated"]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}
78
+ .envato-template-kit-import__plugin-status--activated [data-plugin-status="activated"] .dashicons-yes{color:#5cb85c}
79
+ .envato-template-kit-import__plugin-status--error{background:#818a91;border-color:#818a91;color:#fff;border-radius:3px;font-size:13px;padding:5px 15px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #747d85;box-shadow:inset 0 -2px 0 #747d85}
80
+ .envato-template-kit-import__plugin-status--error:hover,.envato-template-kit-import__plugin-status--error:focus{background:#899298;border-color:#79828a;color:#fff}
81
+ .envato-template-kit-import__plugin-status--error:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #818a91;box-shadow:0 0 0 1px #fff,0 0 0 3px #818a91}
82
+ .envato-template-kit-import__plugin-status--error:active{background:#747d85;border-color:#747d85;color:#fff}
83
+ .envato-template-kit-import__plugin-status--error [data-plugin-status="error"]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}
84
+ .envato-template-kit-import__plugin-status-text{display:none;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}
85
+ .envato-template-kit-import__plugin-list-next{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;padding:60px}
86
+ .envato-template-kit-import__plugin-list-next-button{background:#0085ba;border-color:#0085ba;color:#fff;border-radius:3px;font-size:13px;padding:16px 20px;border:0;cursor:pointer;text-decoration:none;-webkit-box-shadow:inset 0 -2px 0 #0073a1;box-shadow:inset 0 -2px 0 #0073a1}
87
+ .envato-template-kit-import__plugin-list-next-button:hover,.envato-template-kit-import__plugin-list-next-button:focus{background:#0090c9;border-color:#007aab;color:#fff}
88
+ .envato-template-kit-import__plugin-list-next-button:focus{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba;box-shadow:0 0 0 1px #fff,0 0 0 3px #0085ba}
89
+ .envato-template-kit-import__plugin-list-next-button:active{background:#0073a1;border-color:#0073a1;color:#fff}
assets/images/template-kit-import.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg width="253" height="27" viewBox="0 0 253 27" xmlns="http://www.w3.org/2000/svg"><g id="-Resources" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Desktop" transform="translate(-102 -1229)"><g id="Imported-Layers-Copy-8" transform="translate(102 1229.436)"><path d="M16.45 4.883c-.628-.348-2.427-.133-4.588.536-3.783 2.585-6.975 6.394-7.198 12.51-.04.147-.413-.02-.487-.064-1.021-1.958-1.426-4.02-.573-6.993.159-.265-.36-.59-.455-.498-.186.188-.967 1.019-1.485 1.918C-.905 16.75.775 22.46 5.27 24.958c4.493 2.503 10.168.888 12.67-3.607 2.894-5.187.207-15.52-1.49-16.468" id="Fill-1" fill="#7AAC41"/><path d="M32.535 7.373c-5.328 0-9.196 3.961-9.196 9.419 0 5.502 3.857 9.345 9.381 9.345 2.79 0 5-.873 6.756-2.669.525-.566.581-1.112.581-1.321 0-.89-.661-1.536-1.573-1.536-.46 0-.844.173-1.285.581-.994.927-2.304 1.874-4.479 1.874-3.023 0-5.482-2.27-5.637-5.185h12.034c1.308 0 1.944-.612 1.944-1.87 0-.37 0-.638-.075-1.165-.648-4.68-3.807-7.473-8.45-7.473zm0 2.922c2.89 0 4.743 1.841 4.857 4.813H27.087c.27-2.75 2.596-4.813 5.448-4.813z" id="Fill-2" fill="#131412"/><path d="M52.553 7.373c-2.42 0-4.818 1.392-5.754 3.325V9.504c0-1.851-1.434-1.945-1.722-1.945-.849 0-1.758.511-1.758 1.945v14.428c0 1.921 1.527 2.018 1.833 2.018.306 0 1.833-.097 1.833-2.018v-7.735c0-3.365 1.907-5.716 4.638-5.716 2.644 0 3.93 1.735 3.93 5.307v8.144c0 1.921 1.527 2.018 1.834 2.018.305 0 1.832-.097 1.832-2.018v-9.297c0-3.51-1.751-7.262-6.666-7.262" id="Fill-3" fill="#131412"/><path d="M75.805 7.56c-.847 0-1.46.494-1.827 1.466l-5.015 12.611-4.977-12.611c-.39-.987-1-1.467-1.865-1.467-1.01 0-1.833.79-1.833 1.759 0 .24.027.55.23 1.037l5.764 13.61c.687 1.641 1.816 1.985 2.643 1.985.827 0 1.957-.344 2.646-1.985l5.8-13.685c.2-.48.23-.832.23-1 0-.98-.773-1.72-1.796-1.72" id="Fill-4" fill="#131412"/><path d="M86.465 7.373c-2.345 0-4.529.653-6.149 1.838-.549.379-.816.851-.816 1.446 0 .818.625 1.46 1.424 1.46.346 0 .733-.138 1.088-.387 1.392-.928 2.7-1.36 4.117-1.36 2.71 0 4.266 1.378 4.266 3.782v.398c-6.084.006-12.272.742-12.272 6.034 0 3.81 3.256 5.515 6.482 5.515 2.57 0 4.621-1.018 5.938-2.945v.927c0 1.38.927 1.87 1.723 1.87.167 0 1.646-.053 1.646-1.87v-9.706c0-4.384-2.785-7.002-7.447-7.002zm3.16 9.876h.77v.844c0 3.089-1.966 5.084-5.01 5.084-.825 0-3.52-.192-3.52-2.667 0-2.923 4.428-3.261 7.76-3.261z" id="Fill-5" fill="#131412"/><path d="M103.458 10.89c1.604 0 1.685-1.248 1.685-1.498 0-.742-.443-1.535-1.685-1.535h-3.298V4.52c0-1.49-.967-2.02-1.795-2.02-.307 0-1.833.098-1.833 2.02v15.841c0 3.656 1.803 5.588 5.216 5.588.883 0 1.743-.156 2.305-.418.646-.322 1.015-.85 1.015-1.451 0-.847-.614-1.461-1.462-1.461-.163 0-.396.04-.652.114a2.979 2.979 0 01-.76.109c-1.388 0-2.034-.906-2.034-2.853v-9.1h3.298" id="Fill-6" fill="#131412"/><path d="M115.58 7.373c-5.544 0-9.567 3.93-9.567 9.344 0 2.636.974 5.038 2.743 6.764 1.756 1.713 4.178 2.656 6.824 2.656 5.475 0 9.604-4.05 9.604-9.42 0-5.414-4.04-9.344-9.604-9.344zm0 15.656c-3.803 0-5.79-3.175-5.79-6.312 0-4.31 3-6.273 5.79-6.273 2.788 0 5.79 1.963 5.79 6.273 0 4.337-3.002 6.312-5.79 6.312z" id="Fill-7" fill="#131412"/><path d="M136.306 6.965a7.048 7.048 0 00-3.973 1.214c-1.198.799-2.152 1.924-2.833 3.343-.673 1.403-1.015 2.965-1.015 4.642v.722c0 1.68.354 3.235 1.052 4.62.703 1.396 1.693 2.51 2.94 3.314a7.537 7.537 0 004.15 1.217c2.72 0 4.807-1.023 6.202-3.04a.548.548 0 00-.133-.757l-.61-.433a.547.547 0 00-.747.11c-.574.735-1.239 1.284-1.974 1.632-.739.351-1.66.528-2.738.528a5.552 5.552 0 01-3.089-.933c-.955-.626-1.715-1.503-2.261-2.608-.553-1.118-.833-2.353-.833-3.668v-.397h12.448a.548.548 0 00.547-.547v-.914c0-2.37-.667-4.32-1.982-5.795-1.33-1.493-3.064-2.25-5.15-2.25zm-5.735 7.547c.26-1.547.877-2.85 1.84-3.878 1.077-1.15 2.35-1.71 3.895-1.71.968 0 1.852.254 2.629.754.782.504 1.406 1.223 1.856 2.137.41.832.637 1.737.68 2.697h-10.9z" id="Fill-8" fill="#7AAC41"/><path d="M147.134.223h-.865a.547.547 0 00-.547.547v24.611c0 .303.245.547.547.547h.865a.547.547 0 00.547-.547V.771a.547.547 0 00-.547-.548" id="Fill-9" fill="#7AAC41"/><path d="M157.765 6.965a7.048 7.048 0 00-3.973 1.214c-1.199.799-2.153 1.924-2.833 3.343-.674 1.403-1.016 2.965-1.016 4.642v.722c0 1.68.354 3.235 1.053 4.62.703 1.396 1.693 2.511 2.939 3.314a7.542 7.542 0 004.15 1.217c2.72 0 4.807-1.023 6.202-3.04a.547.547 0 00-.133-.757l-.61-.433a.547.547 0 00-.747.11c-.573.734-1.238 1.283-1.974 1.632-.74.351-1.66.528-2.738.528a5.555 5.555 0 01-3.09-.933c-.954-.626-1.715-1.503-2.26-2.608-.553-1.117-.832-2.352-.832-3.668v-.397h12.447a.548.548 0 00.547-.547v-.914c0-2.37-.667-4.32-1.981-5.795-1.33-1.493-3.064-2.25-5.151-2.25zm-5.736 7.547c.26-1.547.878-2.85 1.841-3.878 1.077-1.15 2.35-1.71 3.895-1.71.98 0 1.839.247 2.627.754.782.504 1.407 1.223 1.857 2.137.408.832.637 1.738.681 2.697h-10.9z" id="Fill-10" fill="#7AAC41"/><path d="M186.634 7.125c-1.531 0-2.935.404-4.174 1.2a6.996 6.996 0 00-2.058 2.01c-.375-.928-.928-1.648-1.653-2.15-1.013-.703-2.318-1.06-3.876-1.06a6.7 6.7 0 00-3.936 1.254 7.243 7.243 0 00-1.654 1.628V7.993a.547.547 0 00-.547-.547h-.88a.547.547 0 00-.548.547v17.336c0 .302.245.548.547.548h.88a.547.547 0 00.548-.548V14.434a7.91 7.91 0 011.323-3.064c1.108-1.538 2.488-2.286 4.219-2.286 1.474 0 2.547.367 3.187 1.09.66.742.998 1.926 1.008 3.518v11.637c0 .302.245.548.547.548h.866a.548.548 0 00.547-.548l-.002-11.486c.056-.776.408-1.605 1.046-2.465 1.132-1.514 2.626-2.264 4.568-2.294 1.489-.026 2.512.354 3.171 1.142.675.806 1.018 2.107 1.018 3.866V25.33c0 .302.245.548.547.548h.865a.547.547 0 00.547-.548V14.015c-.011-2.24-.522-3.959-1.519-5.114-1.018-1.179-2.561-1.776-4.587-1.776" id="Fill-11" fill="#7AAC41"/><path d="M202.937 6.965a7.048 7.048 0 00-3.973 1.214c-1.199.799-2.153 1.924-2.833 3.343-.674 1.403-1.016 2.965-1.016 4.642v.722c0 1.68.354 3.235 1.052 4.62.704 1.396 1.693 2.51 2.94 3.314a7.55 7.55 0 004.15 1.217c2.72 0 4.807-1.023 6.203-3.04a.548.548 0 00-.134-.757l-.61-.433a.547.547 0 00-.747.11c-.574.735-1.238 1.284-1.974 1.633-.739.35-1.66.527-2.738.527a5.55 5.55 0 01-3.089-.933c-.953-.625-1.714-1.503-2.261-2.608-.553-1.118-.832-2.353-.832-3.668v-.397h12.447a.548.548 0 00.547-.547v-.914c0-2.37-.667-4.32-1.981-5.795-1.33-1.493-3.064-2.25-5.151-2.25zm-5.736 7.547c.26-1.547.877-2.85 1.84-3.878 1.077-1.15 2.351-1.71 3.896-1.71.98 0 1.84.247 2.628.754.781.504 1.406 1.223 1.856 2.137.41.833.638 1.738.68 2.697h-10.9z" id="Fill-12" fill="#7AAC41"/><path d="M220.08 7.095a6.74 6.74 0 00-3.969 1.27 7.48 7.48 0 00-1.636 1.586V7.962a.547.547 0 00-.547-.547h-.866a.547.547 0 00-.547.547V25.3c0 .302.246.547.547.547h.866a.548.548 0 00.547-.547V14.27c.362-1.537 1.052-2.806 2.052-3.777.998-.967 2.145-1.437 3.505-1.437 1.447 0 2.503.383 3.139 1.14.66.787 1 2.057 1.01 3.77V25.3c0 .302.244.547.546.547h.865a.548.548 0 00.548-.547V13.985c-.012-2.25-.517-3.972-1.503-5.121-1.007-1.174-2.54-1.769-4.556-1.769" id="Fill-13" fill="#7AAC41"/><path d="M236.947 23.94c-1.746.248-2.73.18-3.197-.505-.335-.494-.506-1.308-.506-2.42V9.246h3.395a.547.547 0 00.547-.548v-.864a.547.547 0 00-.547-.547h-3.395V3.154a.547.547 0 00-.547-.548h-.881a.547.547 0 00-.547.548v4.132h-2.657a.547.547 0 00-.548.547v.864c0 .303.245.547.548.547h2.657v11.887c.013 1.647.322 2.839.949 3.644.65.837 1.707 1.262 3.139 1.262.927 0 1.581-.074 1.998-.226a.547.547 0 00.351-.608l-.144-.818a.55.55 0 00-.615-.446" id="Fill-14" fill="#7AAC41"/><path d="M251.88 18.404c-.424-.696-1.104-1.298-2.02-1.792-.872-.47-2.06-.88-3.532-1.221-1.386-.32-2.448-.655-3.157-.994-.663-.317-1.14-.666-1.415-1.035-.258-.345-.389-.853-.389-1.508 0-.818.364-1.487 1.11-2.045.787-.587 1.89-.885 3.279-.885 1.447 0 2.626.354 3.505 1.052.853.676 1.267 1.49 1.267 2.487 0 .302.245.547.547.547h.881a.547.547 0 00.547-.547c0-1.686-.641-3.046-1.906-4.043-1.227-.965-2.855-1.455-4.841-1.455-1.835 0-3.357.453-4.522 1.347-1.211.927-1.825 2.13-1.825 3.574 0 1.422.49 2.562 1.457 3.388.923.789 2.475 1.407 4.745 1.89 3.33.704 4.95 1.933 4.95 3.76 0 .85-.403 1.563-1.231 2.18-.866.646-2.025.973-3.446.973-1.567 0-2.814-.31-3.705-.92-.85-.585-1.3-1.38-1.373-2.432a.547.547 0 00-.546-.509h-.865a.547.547 0 00-.547.547c0 1.566.676 2.859 2.008 3.844 1.281.949 2.973 1.43 5.028 1.43 1.927 0 3.52-.457 4.732-1.358 1.264-.938 1.904-2.196 1.904-3.74 0-.985-.217-1.837-.64-2.535" id="Fill-15" fill="#7AAC41"/></g></g></g></svg>
assets/js/importer.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(a){window.TemplateKitImport=function(){function t(t){t.preventDefault();var e=a(this).data();return e&&e.templateKitId&&e.nonce&&a.ajax({url:ajaxurl,method:"post",dataType:"json",data:{action:"envato_template_kit_import_process",template_kit_id:parseInt(e.templateKitId,10),template_index:parseInt(e.templateIndex,10),nonce:e.nonce},success:function(t){alert("success")},error:function(){alert("failed to import")}}),!1}function e(t){t.preventDefault();var e=a(this).data();switch(e.pluginStatus){case"deactivated":case"update":case"install":window.location.href=e.pluginUrl;break;case"activated":break;case"error":alert("Unknown error");break;default:alert("Unknown plugin action")}return!1}return{initPluginPage:function(){a(".js-template-kit-plugin").click(e)},initTemplatePage:function(){a(".js-template-kit-import").click(t)}}}}(jQuery);
inc/bootstrap.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import: Bootstrap File
4
+ *
5
+ * This starts things up. Registers the SPL and starts up some classes.
6
+ *
7
+ * @package Envato/Template_Kit_Import
8
+ * @since 0.0.2
9
+ */
10
+
11
+ namespace Envato_Template_Kit_Import;
12
+
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit; // Exit if accessed directly.
15
+ }
16
+
17
+
18
+ spl_autoload_register(
19
+ function ( $class ) {
20
+ $prefix = __NAMESPACE__;
21
+ $base_dir = __DIR__;
22
+ $len = strlen( $prefix );
23
+ if ( strncmp( $prefix, $class, $len ) !== 0 || $class === $prefix ) {
24
+ return;
25
+ }
26
+ $relative_class = strtolower( substr( $class, $len + 1 ) );
27
+ $relative_class = 'class-' . $relative_class;
28
+ $file = $base_dir . DIRECTORY_SEPARATOR . str_replace( array( '\\', '_' ), array( '/', '-' ), $relative_class ) . '.php';
29
+ if ( file_exists( $file ) ) {
30
+ require $file;
31
+ } else {
32
+ die( esc_html( basename( $file ) . ' missing.' ) );
33
+ }
34
+ }
35
+ );
36
+
37
+ require_once __DIR__ . '/helper.php';
38
+
39
+ Plugin::get_instance();
40
+ Importer::get_instance();
41
+ CPT_Kits::get_instance();
inc/class-base.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import:
4
+ *
5
+ * This starts things up. Registers the SPL and starts up some classes.
6
+ *
7
+ * @package Envato/Envato_Template_Kit_Import
8
+ * @since 0.0.2
9
+ */
10
+
11
+ namespace Envato_Template_Kit_Import;
12
+
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit; // Exit if accessed directly.
15
+ }
16
+
17
+
18
+ /**
19
+ * Template Kit Import plugin.
20
+ *
21
+ * The main plugin handler class is responsible for initializing Template Kit Import. The
22
+ * class registers and all the components required to run the plugin.
23
+ *
24
+ * @since 0.0.2
25
+ */
26
+ class Base {
27
+
28
+ const PAGE_SLUG = ENVATO_TEMPLATE_KIT_IMPORT_SLUG;
29
+ /**
30
+ * Holds the plugin instance.
31
+ *
32
+ * @since 0.0.2
33
+ * @access protected
34
+ * @static
35
+ *
36
+ * @var Base
37
+ */
38
+ private static $instances = array();
39
+
40
+ /**
41
+ * Disable class cloning and throw an error on object clone.
42
+ *
43
+ * The whole idea of the singleton design pattern is that there is a single
44
+ * object. Therefore, we don't want the object to be cloned.
45
+ *
46
+ * @access public
47
+ * @since 0.0.2
48
+ */
49
+ public function __clone() {
50
+ // Cloning instances of the class is forbidden.
51
+ _doing_it_wrong( __FUNCTION__, esc_html__( 'Something went wrong.', 'template-kit-import' ), '1.0.0' );
52
+ }
53
+
54
+ /**
55
+ * Disable unserializing of the class.
56
+ *
57
+ * @access public
58
+ * @since 0.0.2
59
+ */
60
+ public function __wakeup() {
61
+ // Unserializing instances of the class is forbidden.
62
+ _doing_it_wrong( __FUNCTION__, esc_html__( 'Something went wrong.', 'template-kit-import' ), '1.0.0' );
63
+ }
64
+
65
+ /**
66
+ * Sets up a single instance of the plugin.
67
+ *
68
+ * @since 0.0.2
69
+ * @access public
70
+ * @static
71
+ *
72
+ * @return static An instance of the class.
73
+ */
74
+ public static function get_instance() {
75
+ $module = get_called_class();
76
+ if ( ! isset( self::$instances[ $module ] ) ) {
77
+ self::$instances[ $module ] = new $module();
78
+ }
79
+
80
+ return self::$instances[ $module ];
81
+ }
82
+
83
+ /**
84
+ * Initializing Template Kit Import plugin.
85
+ *
86
+ * @since 0.0.2
87
+ * @access private
88
+ */
89
+ public function __construct() {
90
+
91
+ add_action( 'init', array( $this, 'init' ), 0 );
92
+
93
+ }
94
+
95
+ public $content = '';
96
+ public $header = '';
97
+
98
+ /**
99
+ * Runs in the init WordPress hook and sets everything up.
100
+ *
101
+ * @since 0.0.2
102
+ * @access public
103
+ */
104
+ public function init() {
105
+
106
+ }
107
+
108
+ public function get_url() {
109
+ return admin_url( 'tools.php?page=' . self::PAGE_SLUG );
110
+ }
111
+
112
+ /**
113
+ * Render a template
114
+ *
115
+ * @param string $default_template_path The path to the template, relative to the plugin's `views` folder
116
+ *
117
+ * @return string
118
+ */
119
+ protected function render_template( $default_template_path, $variables = array() ) {
120
+ do_action( 'elements_render_template_pre', $default_template_path, $this );
121
+ $template_path = ENVATO_TEMPLATE_KIT_IMPORT_DIR . 'views/' . $default_template_path;
122
+ $template_path = apply_filters( 'elements_template_path', $template_path );
123
+ if ( is_file( $template_path ) ) {
124
+ ob_start();
125
+ extract( $variables );
126
+ require $template_path;
127
+ $template_content = apply_filters( 'elements_template_content', ob_get_clean(), $default_template_path, $template_path, $this );
128
+ } else {
129
+ $template_content = '';
130
+ }
131
+ do_action( 'elements_render_template_post', $default_template_path, $this, $template_path, $template_content );
132
+
133
+ return $template_content;
134
+ }
135
+
136
+ }
inc/class-builder-elementor.php ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import: Elementor
4
+ *
5
+ * Elementor template display/import.
6
+ *
7
+ * @package Envato/Envato_Template_Kit_Import
8
+ * @since 0.0.2
9
+ */
10
+
11
+ namespace Envato_Template_Kit_Import;
12
+
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit; // Exit if accessed directly.
15
+ }
16
+
17
+
18
+ /**
19
+ * Elementor builder code.
20
+ *
21
+ * @since 0.0.2
22
+ */
23
+ class Builder_Elementor extends Builder {
24
+
25
+ /*
26
+ * Which builder this is for (e.g. 'elementor' or 'gutenberg')
27
+ *
28
+ * @var string
29
+ */
30
+ public $builder = 'elementor';
31
+
32
+
33
+ /**
34
+ * Imports a template to the Elementor page builder.
35
+ *
36
+ * @param $template_index
37
+ *
38
+ * @return \WP_Error|int
39
+ */
40
+ public function import_template( $template_index ) {
41
+
42
+ if ( ! $this->kit_id ) {
43
+ return new \WP_Error( 'Failed to load kit' );
44
+ }
45
+
46
+ $template_data = $this->get_template_data( $template_index );
47
+
48
+ // Found the template to import from the manifest file.
49
+ $template_kit_folder_name = $this->get_template_kit_temporary_folder();
50
+ $template_json_file = $template_kit_folder_name . $template_data['source'];
51
+ $source = \Elementor\Plugin::$instance->templates_manager->get_source( 'local' );
52
+ $result = $source->import_template( basename( $template_json_file ), $template_json_file );
53
+
54
+ if ( is_wp_error( $result ) ) {
55
+ return new \WP_Error( 'Failed to import template: ' . esc_html( $result->get_error_message() ) );
56
+ }
57
+
58
+ if ( $result[0] && $result[0]['template_id'] ) {
59
+ $imported_template_id = $result[0]['template_id'];
60
+ $this->record_import_event( $template_index, $imported_template_id );
61
+ // Set it to canvas for friendly display:
62
+ update_post_meta( $imported_template_id, '_wp_page_template', 'elementor_canvas' );
63
+ // Record some metadata so we can link back to kit from imported template:
64
+ update_post_meta( $imported_template_id, 'envato_tk_source_kit', $this->kit_id );
65
+ update_post_meta( $imported_template_id, 'envato_tk_source_index', $template_index );
66
+ return $imported_template_id;
67
+ }
68
+
69
+ return new \WP_Error( 'Unknown import error' );
70
+
71
+ }
72
+
73
+
74
+ /**
75
+ * What text to display on input buttons
76
+ *
77
+ * @return string
78
+ */
79
+ public function get_import_button_text() {
80
+ return esc_html__( 'Import into Elementor Library', 'template-kit-import' );
81
+ }
82
+
83
+ /**
84
+ * Get the URL to the list of imported templates.
85
+ *
86
+ * @return string
87
+ */
88
+ public function get_imported_template_edit_url() {
89
+ return admin_url( 'edit.php?post_type=elementor_library&tabs_group=library' );
90
+ }
91
+
92
+ }
inc/class-builder-gutenberg.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import: Elementor
4
+ *
5
+ * Elementor template display/import.
6
+ *
7
+ * @package Envato/Envato_Template_Kit_Import
8
+ * @since 0.0.2
9
+ */
10
+
11
+ namespace Envato_Template_Kit_Import;
12
+
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit; // Exit if accessed directly.
15
+ }
16
+
17
+
18
+ /**
19
+ * Gutenberg builder code.
20
+ *
21
+ * @since 0.0.2
22
+ */
23
+ class Builder_Gutenberg extends Builder {
24
+
25
+ /*
26
+ * Which builder this is for (e.g. 'elementor' or 'gutenberg')
27
+ *
28
+ * @var string
29
+ */
30
+ public $builder = 'gutenberg';
31
+
32
+ }
inc/class-builder.php ADDED
@@ -0,0 +1,223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import:
4
+ *
5
+ * This starts things up. Registers the SPL and starts up some classes.
6
+ *
7
+ * @package Envato/Envato_Template_Kit_Import
8
+ * @since 0.0.2
9
+ */
10
+
11
+ namespace Envato_Template_Kit_Import;
12
+
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit; // Exit if accessed directly.
15
+ }
16
+
17
+
18
+ /**
19
+ * Builder registration and management.
20
+ *
21
+ * @since 0.0.2
22
+ */
23
+ abstract class Builder extends Base {
24
+
25
+ /**
26
+ * Which builder this is for (e.g. 'elementor' or 'gutenberg')
27
+ *
28
+ * @var string
29
+ */
30
+ public $builder = null;
31
+
32
+ /**
33
+ * The current loaded kit ID frmo the CPT database
34
+ *
35
+ * @var int
36
+ */
37
+ public $kit_id = null;
38
+
39
+ /**
40
+ * Checks a template kid ID against the CPT database and loads if it's the correct type.
41
+ *
42
+ * @param $template_kit_id
43
+ *
44
+ * @return int|null
45
+ */
46
+ public function load_kit( $template_kit_id ) {
47
+ $this->kit_id = null;
48
+ $post = get_post( $template_kit_id );
49
+ if ( CPT_Kits::get_instance()->cpt_slug === $post->post_type ) {
50
+ // Confirmed that the required ID is in fact one of our uploaded template kits.
51
+ $builder = get_post_meta( $post->ID, 'envato_tk_builder', true );
52
+ if ( $this->builder === $builder ) {
53
+ $this->kit_id = $post->ID;
54
+ }
55
+ }
56
+ return $this->kit_id;
57
+ }
58
+
59
+ /**
60
+ * Imports a template to the desired page builder
61
+ *
62
+ * @param $template_index
63
+ */
64
+ public function import_template( $template_index ) {
65
+ // Child class needs to override this.
66
+ }
67
+
68
+ /**
69
+ * Gets the imported manifest data from the CPT post meta
70
+ *
71
+ * @return array
72
+ */
73
+ public function get_manifest_data() {
74
+ return get_post_meta( $this->kit_id, 'envato_tk_manifest', true );
75
+ }
76
+
77
+ /**
78
+ * Gets the list of required plugins from metadata
79
+ *
80
+ * @return array
81
+ */
82
+ public function get_required_plugins() {
83
+ $manifest_data = $this->get_manifest_data();
84
+ return Required_Plugin::get_instance()->check_for_required_plugins( ! empty( $manifest_data['required_plugins'] ) ? $manifest_data['required_plugins'] : array() );
85
+ }
86
+
87
+ /**
88
+ * Gets the list of available templates in this kit from metadata
89
+ *
90
+ * @return array
91
+ */
92
+ public function get_available_templates() {
93
+ $manifest = $this->get_manifest_data();
94
+ $manifest_has_changed = false;
95
+ if ( $manifest && ! empty( $manifest['templates'] ) ) {
96
+ $templates = $manifest['templates'];
97
+ $screenshot_base_url = $this->get_template_kit_temporary_url();
98
+ foreach ( $templates as $template_index => $template ) {
99
+ $templates[ $template_index ]['screenshot_url'] = $screenshot_base_url . $template['screenshot'];
100
+ // todo: this will be an array of imports into the page builder library
101
+ // So we can show if the template has been imported already etc.
102
+ if ( ! isset( $templates[ $template_index ]['imports'] ) ) {
103
+ $templates[ $template_index ]['imports'] = array();
104
+ }
105
+ foreach ( $templates[ $template_index ]['imports'] as $import_id => $imported_template_id ) {
106
+ // check it still exists.
107
+ $maybe_exists = get_post( $imported_template_id );
108
+ if ( ! $maybe_exists || $maybe_exists->ID !== (int) $imported_template_id ) {
109
+ $manifest_has_changed = true;
110
+ unset( $manifest['templates'][ $template_index ]['imports'][ $import_id ] );
111
+ }
112
+ }
113
+ }
114
+ if ( $manifest_has_changed ) {
115
+ // we've removed an imported template, need to refresh our manifest data.
116
+ update_post_meta( $this->kit_id, 'envato_tk_manifest', $manifest );
117
+ }
118
+ return $templates;
119
+ }
120
+ return array();
121
+ }
122
+
123
+ /**
124
+ * Gets the local path for the extracted ZIP file on the hosting account.
125
+ * Used to get the path for JSON files so page builders can load them in.
126
+ *
127
+ * @return string
128
+ */
129
+ public function get_template_kit_temporary_folder() {
130
+ $template_kit_folder_name = get_post_meta( $this->kit_id, 'envato_tk_folder_name', true );
131
+ $wp_upload_dir = wp_upload_dir();
132
+ $template_kit_folder_path = $wp_upload_dir['basedir'] . '/template-kits/' . $template_kit_folder_name . '/';
133
+ // Confirm we're pulling this data from the right location:
134
+ if ( strpos( $template_kit_folder_path, $wp_upload_dir['basedir'] ) === 0 ) {
135
+ return $template_kit_folder_path;
136
+ }
137
+ return null;
138
+ }
139
+
140
+ /**
141
+ * Gets the local URL for the extracted ZIP file on the hosting account.
142
+ * Used for screenshot previews and things like that.
143
+ *
144
+ * @return string
145
+ */
146
+ public function get_template_kit_temporary_url() {
147
+ $template_kit_folder_name = get_post_meta( $this->kit_id, 'envato_tk_folder_name', true );
148
+ $wp_upload_dir = wp_upload_dir();
149
+ return $wp_upload_dir['baseurl'] . '/template-kits/' . $template_kit_folder_name . '/';
150
+ }
151
+
152
+ /**
153
+ * Get details from the manifest file about a particular template within this kit.
154
+ *
155
+ * @param $template_index
156
+ *
157
+ * @return bool|array
158
+ */
159
+ public function get_template_data( $template_index ) {
160
+ $templates = $this->get_available_templates();
161
+ if ( isset( $templates[ $template_index ] ) ) {
162
+ return $templates[ $template_index ];
163
+ }
164
+ return false;
165
+ }
166
+
167
+ /**
168
+ * Record an import event.
169
+ * For now we append this data to the stored manifest details in the CPT metadata.
170
+ *
171
+ * @param $template_index
172
+ * @param $imported_template_id
173
+ */
174
+ public function record_import_event( $template_index, $imported_template_id ) {
175
+ $manifest = $this->get_manifest_data();
176
+ if ( $manifest && ! empty( $manifest['templates'] ) ) {
177
+ if ( isset( $manifest['templates'][ $template_index ] ) ) {
178
+ if ( ! isset( $manifest['templates'][ $template_index ]['imports'] ) ) {
179
+ $manifest['templates'][ $template_index ]['imports'] = array();
180
+ }
181
+ // Append import event to manifest file.
182
+ $manifest['templates'][ $template_index ]['imports'][] = array(
183
+ 'imported_template_id' => $imported_template_id,
184
+ );
185
+ }
186
+ }
187
+ update_post_meta( $this->kit_id, 'envato_tk_manifest', $manifest );
188
+
189
+ }
190
+
191
+
192
+ /**
193
+ * What text to display on input buttons
194
+ *
195
+ * @return string
196
+ */
197
+ public function get_import_button_text() {
198
+ return esc_html__( 'Import Template', 'template-kit-import' );
199
+ }
200
+
201
+
202
+ /**
203
+ * Get the URL to the list of imported templates.
204
+ *
205
+ * @return string
206
+ */
207
+ public function get_imported_template_edit_url() {
208
+ return admin_url( 'edit.php?post_type=page' );
209
+ }
210
+
211
+
212
+ /**
213
+ * Get the current template kit name.
214
+ *
215
+ * @return string
216
+ */
217
+ public function get_name() {
218
+ $post = get_post( $this->kit_id );
219
+ return $post->post_title;
220
+ }
221
+
222
+
223
+ }
inc/class-cpt-kits.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import:
4
+ *
5
+ * This starts things up. Registers the SPL and starts up some classes.
6
+ *
7
+ * @package Envato/Envato_Template_Kit_Import
8
+ * @since 0.0.2
9
+ */
10
+
11
+ namespace Envato_Template_Kit_Import;
12
+
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit; // Exit if accessed directly.
15
+ }
16
+
17
+
18
+ /**
19
+ * Collection registration and management.
20
+ *
21
+ * @since 0.0.2
22
+ */
23
+ class CPT_Kits extends CPT {
24
+
25
+ /**
26
+ * Core custom post name for these templates.
27
+ *
28
+ * @var string
29
+ */
30
+ public $cpt_name = 'Imported Kit';
31
+
32
+ /**
33
+ * Core custom post name for these templates.
34
+ *
35
+ * @var string
36
+ */
37
+ public $cpt_slug = 'envato_tk_import';
38
+
39
+ public function __construct() {
40
+ parent::__construct();
41
+
42
+ add_filter( 'wpseo_sitemap_exclude_post_type', array( $this, 'wpseo_sitemap_exclude_post_type' ), 10, 2 );
43
+ }
44
+
45
+ /**
46
+ * We need to manually exclude this post type from Yoast because it doesn't behave nicely.
47
+ *
48
+ * @param $exclude
49
+ * @param $post_type
50
+ *
51
+ * @return bool
52
+ *
53
+ * @since 0.0.9
54
+ */
55
+ public function wpseo_sitemap_exclude_post_type( $exclude, $post_type ) {
56
+ if ( $post_type === $this->cpt_slug ) {
57
+ return true;
58
+ }
59
+
60
+ return $exclude;
61
+ }
62
+
63
+ public function get_all_uploaded_kits() {
64
+ return get_posts(
65
+ array(
66
+ 'post_per_page' => -1,
67
+ 'post_type' => $this->cpt_slug,
68
+ )
69
+ );
70
+ }
71
+
72
+ }
inc/class-cpt.php ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import:
4
+ *
5
+ * This starts things up. Registers the SPL and starts up some classes.
6
+ *
7
+ * @package Envato/Envato_Template_Kit_Import
8
+ * @since 0.0.2
9
+ */
10
+
11
+ namespace Envato_Template_Kit_Import;
12
+
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit; // Exit if accessed directly.
15
+ }
16
+
17
+
18
+ /**
19
+ * CPT.
20
+ *
21
+ * Class to handle everything Custom Post Type related.
22
+ *
23
+ * @since 0.0.2
24
+ */
25
+ abstract class CPT extends Base {
26
+
27
+
28
+ /**
29
+ * Core custom post name for these templates.
30
+ *
31
+ * @var string
32
+ */
33
+ public $cpt_name = '';
34
+
35
+
36
+ /**
37
+ * Core custom post name for these templates.
38
+ *
39
+ * @var string
40
+ */
41
+ public $cpt_slug = '';
42
+
43
+
44
+ /**
45
+ * Core custom post name for these templates.
46
+ *
47
+ * @var string
48
+ */
49
+ public $menu_name = '';
50
+
51
+
52
+ /**
53
+ * Core custom post name for these templates.
54
+ *
55
+ * @var string
56
+ */
57
+ public $menu_parent = ENVATO_TEMPLATE_KIT_IMPORT_SLUG;
58
+
59
+
60
+ /**
61
+ * Do we allow editing
62
+ *
63
+ * @var array
64
+ */
65
+ public $supports = array( 'title', 'author', 'thumbnail', 'elementor', 'page-attributes' );
66
+
67
+
68
+ /**
69
+ * Initializing Elements Content App plugin.
70
+ *
71
+ * @since 0.0.2
72
+ * @access private
73
+ */
74
+ public function __construct() {
75
+
76
+ parent::__construct();
77
+
78
+ add_action( 'init', array( $this, 'register_custom_post_type' ) );
79
+ add_filter( 'parent_file', array( $this, 'override_wordpress_submenu' ) );
80
+ }
81
+
82
+ /**
83
+ * We override the "submenu_file" WordPress global so that the correct submenu is highlighted when on our custom admin page.
84
+ *
85
+ * @param string $this_parent_file Current parent file for menu rendering.
86
+ *
87
+ * @return string
88
+ */
89
+ public function override_wordpress_submenu( $this_parent_file ) {
90
+ global $post, $submenu_file;
91
+ if ( is_admin() && $post && $post->ID && $this->cpt_slug === $post->post_type ) {
92
+ $submenu_file = 'edit.php?post_type=' . $this->cpt_slug; // WPCS: override ok.
93
+ $this_parent_file = $this->menu_parent;
94
+ }
95
+
96
+ return $this_parent_file;
97
+ }
98
+
99
+
100
+ /**
101
+ * Adds our custom submenu page.
102
+ */
103
+ public function admin_menu() {
104
+
105
+ add_submenu_page(
106
+ $this->menu_parent,
107
+ $this->menu_name,
108
+ $this->menu_name,
109
+ 'manage_options',
110
+ 'edit.php?post_type=' . $this->cpt_slug
111
+ );
112
+
113
+ }
114
+
115
+ /**
116
+ * Here is our magical custom post type that stores all our Elementor site wide styles.
117
+ *
118
+ * @since 0.0.2
119
+ */
120
+ public function register_custom_post_type() {
121
+
122
+ register_post_type( $this->cpt_slug, $this->get_cpt_args() );
123
+
124
+ }
125
+
126
+ /**
127
+ * These are the args used to register our CPT.
128
+ *
129
+ * @return array args
130
+ */
131
+ public function get_cpt_args() {
132
+
133
+ $labels = array(
134
+ 'name' => $this->cpt_name . 's',
135
+ 'singular_name' => $this->cpt_name,
136
+ 'menu_name' => $this->cpt_name . 's',
137
+ 'parent_item_colon' => 'Parent ' . $this->cpt_name . ':',
138
+ 'all_items' => 'All ' . $this->cpt_name . 's',
139
+ 'view_item' => 'View ' . $this->cpt_name,
140
+ 'add_new_item' => 'Add New ' . $this->cpt_name,
141
+ 'add_new' => 'New ' . $this->cpt_name,
142
+ 'edit_item' => 'Edit ' . $this->cpt_name,
143
+ 'update_item' => 'Update ' . $this->cpt_name,
144
+ 'search_items' => 'Search ' . $this->cpt_name . 's',
145
+ 'not_found' => 'No ' . $this->cpt_name . 's found',
146
+ 'not_found_in_trash' => 'No ' . $this->cpt_name . 's found in Trash',
147
+ );
148
+
149
+ return array(
150
+ 'description' => $this->cpt_name . 's',
151
+ 'labels' => $labels,
152
+ 'supports' => $this->supports,
153
+ 'taxonomies' => array(),
154
+ 'hierarchical' => true,
155
+ 'public' => defined( 'ENVATO_TEMPLATE_KIT_IMPORT_DEV' ) && ENVATO_TEMPLATE_KIT_IMPORT_DEV,
156
+ 'show_in_menu' => defined( 'ENVATO_TEMPLATE_KIT_IMPORT_DEV' ) && ENVATO_TEMPLATE_KIT_IMPORT_DEV,
157
+ 'show_in_nav_menus' => false,
158
+ 'exclude_from_search' => true,
159
+ 'menu_position' => 36,
160
+ 'menu_icon' => 'dashicons-download',
161
+ 'can_export' => false,
162
+ 'has_archive' => false,
163
+ 'publicly_queryable' => false,
164
+ 'rewrite' => false,
165
+ 'capability_type' => 'post',
166
+ 'capabilities' => array(
167
+ 'create_posts' => 'do_not_allow',
168
+ ),
169
+ 'map_meta_cap' => true,
170
+ );
171
+ }
172
+
173
+
174
+ }
inc/class-importer.php ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import:
4
+ *
5
+ * This starts things up. Registers the SPL and starts up some classes.
6
+ *
7
+ * @package Envato/Envato_Template_Kit_Import
8
+ * @since 0.0.2
9
+ */
10
+
11
+ namespace Envato_Template_Kit_Import;
12
+
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit; // Exit if accessed directly.
15
+ }
16
+
17
+
18
+ /**
19
+ * Importer registration and management.
20
+ *
21
+ * @since 0.0.2
22
+ */
23
+ class Importer extends Base {
24
+
25
+ const PAGE_SLUG = 'template-kit-import';
26
+
27
+ public function __construct() {
28
+ parent::__construct();
29
+
30
+ add_action( 'admin_action_envato_template_kit_import_upload', array( $this, 'handle_zip_upload' ) );
31
+ add_action( 'wp_ajax_envato_template_kit_import_process', array( $this, 'handle_template_import' ) );
32
+ add_action( 'init', array( $this, 'register_importer' ) );
33
+ }
34
+
35
+ /**
36
+ * Called when the user wants to import a single template.
37
+ */
38
+ public function handle_template_import() {
39
+
40
+ $template_kit_id = isset( $_POST['template_kit_id'] ) ? (int) $_POST['template_kit_id'] : -1;
41
+ $template_index = isset( $_POST['template_index'] ) ? (int) $_POST['template_index'] : 0;
42
+
43
+ check_ajax_referer( 'import_template_kit_' . $template_kit_id, 'nonce' );
44
+
45
+ $template_kit = envato_template_kit_import_get_builder( $template_kit_id );
46
+
47
+ if ( ! $template_kit ) {
48
+ wp_send_json_error( 'Invalid Template Kit' );
49
+ }
50
+
51
+ $imported_template_id = $template_kit->import_template( $template_index );
52
+
53
+ if ( is_wp_error( $imported_template_id ) ) {
54
+ wp_send_json_error( $imported_template_id->get_error_message() );
55
+ }
56
+
57
+ wp_send_json_success(
58
+ array(
59
+ 'template_id' => $imported_template_id,
60
+ )
61
+ );
62
+
63
+ }
64
+
65
+ /**
66
+ * Called when the user uploads a zip file.
67
+ */
68
+ public function handle_zip_upload() {
69
+ check_admin_referer( 'envato_template_kit_import' );
70
+
71
+ try {
72
+ if ( $_FILES && ! empty( $_FILES['template_kit'] ) && ! $_FILES['template_kit']['error'] && is_uploaded_file( $_FILES['template_kit']['tmp_name'] ) ) {
73
+
74
+ $temporary_zip_file = $_FILES['template_kit']['tmp_name'];
75
+
76
+ if ( class_exists( '\ZipArchive' ) ) {
77
+ $wp_upload_dir = wp_upload_dir();
78
+ $template_kit_base_path = $wp_upload_dir['basedir'] . '/template-kits/';
79
+ $template_kit_random_folder = md5( time() . NONCE_SALT );
80
+ $template_kit_extract_directory = $template_kit_base_path . $template_kit_random_folder;
81
+ wp_mkdir_p( $template_kit_extract_directory );
82
+ // Prevent directory indexing so people cannot find the random template kit ID folders:
83
+ touch( $template_kit_base_path . 'index.php' );
84
+
85
+ $zip = new \ZipArchive();
86
+ $zip->open( $temporary_zip_file );
87
+ $zip->extractTo( $template_kit_extract_directory );
88
+ $zip->close();
89
+
90
+ unlink( $temporary_zip_file );
91
+
92
+ $extracted_zip_files = scandir( $template_kit_extract_directory );
93
+ if ( $extracted_zip_files && is_array( $extracted_zip_files ) ) {
94
+ $file_names = array_diff( $extracted_zip_files, array( '.', '..' ) );
95
+ } else {
96
+ $file_names = array();
97
+ }
98
+ if ( ! $file_names || ! in_array( 'manifest.json', $file_names, true ) ) {
99
+ wp_die( 'Please upload a valid Template Kit zip file' );
100
+ }
101
+
102
+ // Here we assume we've got a valid template kit extracted to the users hosting account.
103
+ // Time to throw it into the Custom Post Type so that we can proceed to the import step or do other fancy things.
104
+
105
+ $manifest_data = json_decode( file_get_contents( $template_kit_extract_directory . '/manifest.json' ), true );
106
+ // todo: validate manifest data structure.
107
+
108
+ // Check if the user has uploaded this template kit zip file before.
109
+ // We're assuming the unique naming rule will be enough for now, until we get true uuid's implemented.
110
+ $template_kit_hash = md5( $manifest_data['title'] . $manifest_data['page_builder'] );
111
+
112
+ // Check if we've got an existing post for this hash
113
+ $existing_posts = get_posts(
114
+ array(
115
+ 'post_type' => CPT_Kits::get_instance()->cpt_slug,
116
+ 'meta_key' => 'envato_tk_hash',
117
+ 'meta_value' => $template_kit_hash,
118
+ )
119
+ );
120
+ if ( $existing_posts ) {
121
+ $existing_posts = current( $existing_posts );
122
+ $post_id = $existing_posts->ID;
123
+ // Todo: remove the old upload directory from `envato_tk_folder_name` metadata
124
+ $old_zip_path = get_post_meta( $post_id, 'envato_tk_folder_name', true );
125
+ } else {
126
+ // Importing fresh:
127
+ $post_data = array(
128
+ 'post_title' => $manifest_data['title'],
129
+ 'post_type' => CPT_Kits::get_instance()->cpt_slug,
130
+ 'post_status' => 'publish',
131
+ );
132
+ $post_id = wp_insert_post( $post_data, true );
133
+ }
134
+
135
+ if ( $post_id && ! is_wp_error( $post_id ) ) {
136
+ // successfully stored this post. Add some metadata
137
+ update_post_meta( $post_id, 'envato_tk_hash', $template_kit_hash );
138
+ update_post_meta( $post_id, 'envato_tk_manifest', $manifest_data );
139
+ update_post_meta( $post_id, 'envato_tk_folder_name', $template_kit_random_folder );
140
+ update_post_meta( $post_id, 'envato_tk_builder', $manifest_data['page_builder'] );
141
+
142
+ wp_safe_redirect( admin_url( 'tools.php?page=template-kit-import&step=1&imported_template_kit_id=' . $post_id ) );
143
+ exit;
144
+
145
+ }
146
+ } else {
147
+ // no zip source
148
+ wp_die( 'Please enable ZIP extension on this hosting account.' );
149
+ }
150
+ }
151
+ } catch ( \Exception $exception ) {
152
+ wp_die( 'Failed to extract Template Kit zip file.' );
153
+ }
154
+
155
+ wp_die( 'Failed to process Template Kit' );
156
+ }
157
+
158
+
159
+ /**
160
+ * Called when the user visits our main menu item.
161
+ * Displays the welcome screen.
162
+ */
163
+ public function admin_menu_open() {
164
+ $this->content = $this->render_template( 'importer/importer.php' );
165
+ $this->header = $this->render_template( 'header.php' );
166
+ echo $this->render_template( 'wrapper.php' ); // WPCS: XSS ok.
167
+ }
168
+
169
+ /**
170
+ * Hooks into the WordPress importer area
171
+ */
172
+ public function register_importer() {
173
+ require_once ABSPATH . '/wp-admin/includes/import.php';
174
+ add_action(
175
+ 'load-importer-envato_template_kit_import',
176
+ function() {
177
+ wp_safe_redirect( self::get_url() );
178
+ exit;
179
+ }
180
+ );
181
+ register_importer( 'envato_template_kit_import', __( 'Template Kit', 'template-kit-import' ), __( 'Import Template Kit for Page/Site Builders.', 'template-kit-import' ), array( $this, 'admin_menu_open' ) );
182
+ }
183
+
184
+ }
inc/class-plugin.php ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import:
4
+ *
5
+ * This starts things up. Registers the SPL and starts up some classes.
6
+ *
7
+ * @package Envato/Envato_Template_Kit_Import
8
+ * @since 0.0.2
9
+ */
10
+
11
+ namespace Envato_Template_Kit_Import;
12
+
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit; // Exit if accessed directly.
15
+ }
16
+
17
+
18
+ /**
19
+ * Template Kit Import plugin.
20
+ *
21
+ * The main plugin handler class is responsible for initializing Template Kit Import. The
22
+ * class registers and all the components required to run the plugin.
23
+ *
24
+ * @since 0.0.2
25
+ */
26
+ class Plugin extends Base {
27
+
28
+ /**
29
+ * Initializing Template Kit Import plugin.
30
+ *
31
+ * @since 0.0.2
32
+ * @access private
33
+ */
34
+ public function __construct() {
35
+ parent::__construct();
36
+
37
+ add_action( 'admin_menu', array( $this, 'admin_menu' ) );
38
+ add_action( 'plugins_loaded', array( $this, 'db_upgrade_check' ) );
39
+ }
40
+
41
+ /**
42
+ * Sets up the admin menu options.
43
+ *
44
+ * @since 0.0.2
45
+ * @access public
46
+ */
47
+ public function admin_menu() {
48
+
49
+ $page = add_management_page(
50
+ __( 'Template Kit Import', 'template-kit-import' ),
51
+ 'Template Kit',
52
+ 'edit_posts',
53
+ ENVATO_TEMPLATE_KIT_IMPORT_SLUG,
54
+ array( Importer::get_instance(), 'admin_menu_open' )
55
+ );
56
+ add_action( 'admin_print_scripts-' . $page, array( $this, 'admin_page_assets' ) );
57
+ }
58
+
59
+ /**
60
+ * Load assets when the admin page is opened.
61
+ *
62
+ * @since 0.0.2
63
+ * @access private
64
+ */
65
+ public function admin_page_assets() {
66
+ wp_enqueue_style( 'template-kit-import-admin', ENVATO_TEMPLATE_KIT_IMPORT_URI . 'assets/css/main.min.css', array(), filemtime( ENVATO_TEMPLATE_KIT_IMPORT_DIR . 'assets/css/main.min.css' ) );
67
+ wp_enqueue_script( 'template-kit-import-importer', ENVATO_TEMPLATE_KIT_IMPORT_URI . 'assets/js/importer.min.js', array( 'jquery' ), filemtime( ENVATO_TEMPLATE_KIT_IMPORT_DIR . 'assets/js/importer.min.js' ), true );
68
+ }
69
+
70
+ /**
71
+ * Called on load to run certain tasks if the version has changed.
72
+ *
73
+ * @since 0.0.2
74
+ * @access private
75
+ */
76
+ public function db_upgrade_check() {
77
+ if ( get_option( 'envato_template_kit_import_version' ) !== ENVATO_TEMPLATE_KIT_IMPORT_VER ) {
78
+ $this->activation();
79
+ }
80
+ }
81
+
82
+ /**
83
+ * Called on plugin activation.
84
+ *
85
+ * @since 0.0.2
86
+ * @access private
87
+ */
88
+ public function activation() {
89
+ update_option( 'envato_template_kit_import_version', ENVATO_TEMPLATE_KIT_IMPORT_VER );
90
+ if ( ! get_option( 'envato_template_kit_import_install_time' ) ) {
91
+ update_option( 'envato_template_kit_import_install_time', time() );
92
+ }
93
+ }
94
+
95
+ }
inc/class-required-plugin.php ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template Kit Import:
4
+ *
5
+ * This starts things up. Registers the SPL and starts up some classes.
6
+ *
7
+ * @package Envato/Envato_Template_Kit_Import
8
+ * @since 0.0.2
9
+ */
10
+
11
+ namespace Envato_Template_Kit_Import;
12
+
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit; // Exit if accessed directly.
15
+ }
16
+
17
+
18
+ /**
19
+ * Collection registration and management.
20
+ *
21
+ * @since 0.0.2
22
+ */
23
+ class Required_Plugin extends Base {
24
+
25
+ private $current_plugins = array();
26
+
27
+ /**
28
+ * Pass in a list of required plugins to get the status / actions for them.
29
+ *
30
+ * @param $plugin_details
31
+ *
32
+ * @return string
33
+ */
34
+ public function get_plugin_status( $plugin_details ) {
35
+
36
+ //return 'install'; // uncomment this to test no plugins installed.
37
+ //return 'activated'; // uncomment this to test all plugins installed & up to date.
38
+
39
+ if ( empty( $plugin_details['file'] ) ) {
40
+ return 'error';
41
+ }
42
+
43
+ $plugin_slug = dirname( $plugin_details['file'] );
44
+
45
+ if ( ! $this->current_plugins ) {
46
+ $active_plugins = apply_filters( 'active_plugins', get_option( 'active_plugins' ) );
47
+ $active_sitewide_plugins = get_site_option( 'active_sitewide_plugins' );
48
+ if ( ! is_array( $active_plugins ) ) {
49
+ $active_plugins = array();
50
+ }
51
+ if ( ! is_array( $active_sitewide_plugins ) ) {
52
+ $active_sitewide_plugins = array();
53
+ }
54
+ if ( ! function_exists( 'get_plugins' ) ) {
55
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
56
+ }
57
+ $active_plugins = array_merge( $active_plugins, array_keys( $active_sitewide_plugins ) );
58
+ $this->current_plugins['active'] = $active_plugins;
59
+ $this->current_plugins['all'] = get_plugins();
60
+ }
61
+
62
+ // This covers when the user is running Elementor in a custom slug dir (i.e. beta version)
63
+ if ( 'elementor' === $plugin_slug && class_exists( '\Elementor\Plugin' ) && ! in_array( 'elementor/elementor.php', $this->current_plugins['active'], true ) ) {
64
+ foreach ( $this->current_plugins['active'] as $active_plugin_slug ) {
65
+ $all_plugins_details = $this->current_plugins['all'][ $active_plugin_slug ];
66
+ if ( 'elementor' === $all_plugins_details['TextDomain'] ) {
67
+ $this->current_plugins['active'][] = 'elementor/elementor.php';
68
+ $this->current_plugins['all']['elementor/elementor.php'] = $all_plugins_details;
69
+ }
70
+ }
71
+ }
72
+ // Same with Elementor Pro
73
+ if ( 'elementor-pro' === $plugin_slug && class_exists( '\ElementorPro\Plugin' ) && ! in_array( 'elementor-pro/elementor-pro.php', $this->current_plugins['active'], true ) ) {
74
+ foreach ( $this->current_plugins['active'] as $active_plugin_slug ) {
75
+ $all_plugins_details = $this->current_plugins['all'][ $active_plugin_slug ];
76
+ if ( 'elementor-pro' === $all_plugins_details['TextDomain'] ) {
77
+ $this->current_plugins['active'][] = 'elementor-pro/elementor-pro.php';
78
+ $this->current_plugins['all']['elementor-pro/elementor-pro.php'] = $all_plugins_details;
79
+ }
80
+ }
81
+ }
82
+
83
+ if ( in_array( $plugin_details['file'], $this->current_plugins['active'], true ) ) {
84
+ $state = 'activated';
85
+ // check it's the required min version.
86
+ if ( ! empty( $plugin_details['min_version'] ) ) {
87
+ if (
88
+ isset( $this->current_plugins['all'][ $plugin_details['file'] ] ) &&
89
+ ! empty( $this->current_plugins['all'][ $plugin_details['file'] ]['Version'] ) &&
90
+ version_compare( $this->current_plugins['all'][ $plugin_details['file'] ]['Version'], $plugin_details['min_version'], '<' )
91
+ ) {
92
+ $state = 'update';
93
+ }
94
+ }
95
+ } else {
96
+ $state = 'install';
97
+ foreach ( array_keys( $this->current_plugins['all'] ) as $plugin ) {
98
+ if ( strpos( $plugin, $plugin_details['file'] ) !== false ) {
99
+ $state = 'deactivated';
100
+ }
101
+ }
102
+ }
103
+
104
+ return $state;
105
+ }
106
+
107
+ /**
108
+ *
109
+ * This checks if the requested plugins are available locally.
110
+ * We check plugin slug and minimum version number.
111
+ *
112
+ * @param $required_plugins
113
+ *
114
+ * @return array
115
+ */
116
+ public function check_for_required_plugins( $required_plugins ) {
117
+
118
+ foreach ( $required_plugins as $required_plugin_id => $plugin_details ) {
119
+ $plugin_status = $this->get_plugin_status( $plugin_details );
120
+ $plugin_slug = dirname( $plugin_details['file'] );
121
+ // Padd out data in the array ready for frontend consumption:
122
+ $required_plugins[ $required_plugin_id ]['slug'] = $plugin_slug;
123
+ $required_plugins[ $required_plugin_id ]['status'] = $plugin_status;
124
+ $required_plugins[ $required_plugin_id ]['url'] = '';
125
+ switch ( $plugin_status ) {
126
+ case 'deactivated':
127
+ $required_plugins[ $required_plugin_id ]['url'] = add_query_arg( '_wpnonce', wp_create_nonce( 'activate-plugin_' . $plugin_details['file'] ), admin_url( 'plugins.php?action=activate&plugin=' . $plugin_details['file'] ) );
128
+ break;
129
+ case 'update':
130
+ $required_plugins[ $required_plugin_id ]['url'] = admin_url( 'plugins.php' );
131
+ break;
132
+ case 'install':
133
+ $required_plugins[ $required_plugin_id ]['url'] = add_query_arg( '_wpnonce', wp_create_nonce( 'install-plugin_' . $plugin_slug ), admin_url( 'update.php?action=install-plugin&plugin=' . $plugin_slug ) );
134
+ break;
135
+ case 'activated':
136
+ break;
137
+ }
138
+ if ( 'elementor-pro' === $plugin_slug ) {
139
+ $required_plugins[ $required_plugin_id ]['url'] = 'https://envato.com/elements/template-kits/get-elementor-pro.html';
140
+ }
141
+ }
142
+
143
+ return $required_plugins;
144
+
145
+ }
146
+
147
+
148
+ }
inc/helper.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ namespace Envato_Template_Kit_Import;
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
+ }
9
+
10
+
11
+ /**
12
+ * @param $template_kit_id
13
+ *
14
+ * @return bool|Builder_Elementor|Builder_Gutenberg
15
+ */
16
+ function envato_template_kit_import_get_builder( $template_kit_id ) {
17
+ // Grab out the uploaded template kit from the CPT.
18
+ $post = $template_kit_id ? get_post( $template_kit_id ) : false;
19
+ if ( $post && CPT_Kits::get_instance()->cpt_slug === $post->post_type ) {
20
+ // Confirmed that the required ID is in fact one of our uploaded template kits.
21
+ $builder = get_post_meta( $post->ID, 'envato_tk_builder', true );
22
+ if ( 'elementor' === $builder ) {
23
+ $builder_class = new Builder_Elementor();
24
+ $builder_class->load_kit( $post->ID );
25
+ return $builder_class;
26
+ } elseif ( 'gutenberg' === $builder ) {
27
+ $builder_class = new Builder_Gutenberg();
28
+ $builder_class->load_kit( $post->ID );
29
+ return $builder_class;
30
+ }
31
+ }
32
+
33
+ return false;
34
+ }
languages/template-kit-import.pot ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2020 template-kit-import
2
+ # This file is distributed under the same license as the template-kit-import package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: template-kit-import\n"
6
+ "MIME-Version: 1.0\n"
7
+ "Content-Type: text/plain; charset=UTF-8\n"
8
+ "Content-Transfer-Encoding: 8bit\n"
9
+ "Language-Team: Envato <dave.baker@envato.com>\n"
10
+ "Last-Translator: Dave Baker <dave.baker@envato.com>\n"
11
+ "Report-Msgid-Bugs-To: https://envato.com/\n"
12
+ "X-Poedit-Basepath: ..\n"
13
+ "X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
14
+ "X-Poedit-SearchPath-0: .\n"
15
+ "X-Poedit-SearchPathExcluded-0: *.js\n"
16
+ "X-Poedit-SourceCharset: UTF-8\n"
17
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+
19
+ #. translators: %s: PHP version
20
+ #: template-kit-import.php:74
21
+ msgid "Template Kit Import requires PHP version %1$s+, plugin is currently NOT ACTIVE. Please contact the hosting provider. WordPress recommends version %2$s."
22
+ msgstr ""
23
+
24
+ #: template-kit-import.php:79
25
+ msgid "7.2 or above"
26
+ msgstr ""
27
+
28
+ #. translators: %s: WordPress version
29
+ #: template-kit-import.php:98
30
+ msgid "Template Kit Import requires WordPress version %s+. Because you are using an earlier version, the plugin is currently NOT ACTIVE."
31
+ msgstr ""
32
+
33
+ #: inc/class-base.php:51, inc/class-base.php:62
34
+ msgid "Something went wrong."
35
+ msgstr ""
36
+
37
+ #: inc/class-builder-elementor.php:80
38
+ msgid "Import into Elementor Library"
39
+ msgstr ""
40
+
41
+ #: inc/class-builder.php:198
42
+ msgid "Import Template"
43
+ msgstr ""
44
+
45
+ #: inc/class-importer.php:181
46
+ msgid "Template Kit"
47
+ msgstr ""
48
+
49
+ #: inc/class-importer.php:181
50
+ msgid "Import Template Kit for Page/Site Builders."
51
+ msgstr ""
52
+
53
+ #: inc/class-plugin.php:50
54
+ msgid "Template Kit Import"
55
+ msgstr ""
56
+
57
+ #: views/importer/importer.php:33, views/importer/importer.php:46
58
+ msgid "1. Upload"
59
+ msgstr ""
60
+
61
+ #: views/importer/importer.php:37, views/importer/importer.php:50
62
+ msgid "2. Install Plugins"
63
+ msgstr ""
64
+
65
+ #: views/importer/importer.php:41, views/importer/importer.php:54
66
+ msgid "3. Select Templates"
67
+ msgstr ""
68
+
69
+ #: views/importer/step1-upload.php:16
70
+ msgid "Next"
71
+ msgstr ""
72
+
73
+ #. translators: %s Template kit name
74
+ #: views/importer/step2.php:23
75
+ msgid "The %s requires the following plugins to work best, select the plugins you would like to install:"
76
+ msgstr ""
77
+
78
+ #: views/importer/step2.php:39
79
+ msgid "Activate Plugin"
80
+ msgstr ""
81
+
82
+ #: views/importer/step2.php:42
83
+ msgid "Update Plugin"
84
+ msgstr ""
85
+
86
+ #: views/importer/step2.php:45
87
+ msgid "Install Plugin"
88
+ msgstr ""
89
+
90
+ #: views/importer/step2.php:48
91
+ msgid "Plugin Installed"
92
+ msgstr ""
93
+
94
+ #: views/importer/step2.php:52
95
+ msgid "Plugin Error"
96
+ msgstr ""
97
+
98
+ #: views/importer/step3.php:30
99
+ msgid "Edit"
100
+ msgstr ""
101
+
102
+ #: views/importer/step3.php:31
103
+ msgid "Import Again"
104
+ msgstr ""
readme.txt ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Template Kit - Import ===
2
+ Contributors: envato
3
+ Tags: elementor, template, templates
4
+ Requires at least: 5.3
5
+ Tested up to: 5.3.2
6
+ Requires PHP: 5.6
7
+ Stable tag: 1.0.0
8
+ License: GPLv3
9
+ License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
+
11
+ Use this plugin to import Template Kits to WordPress
12
+
13
+ == Description ==
14
+
15
+ A Template Kit is a collection of pre-designed starter templates for a WordPress Site Builder that share a cohesive visual style.
16
+
17
+ You can use this plugin to Import Template kits for Elementor.
18
+
19
+ Once this plugin is activated go to "Tools" > "Template Kit" to begin importing.
20
+
21
+ == Frequently Asked Questions ==
22
+
23
+ **Where can I find Template Kits?**
24
+
25
+ We will update this page with links to where to find Template Kits shortly.
26
+
27
+ **How do I make a Template Kit?**
28
+
29
+ Create your own "Template Kit" for others with the "Template Kit Export" plugin.
30
+
31
+ == Screenshots ==
32
+
33
+ 1. **Screenshot.**
34
+
35
+ == Changelog ==
36
+
37
+ = 1.0.0-RC2 - 2020-01-09 =
38
+ * Initial public release candidate.
src/scss/admin/_global.scss ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .envato-template-kit-import__wrapper {
2
+ display: flex;
3
+ margin: 0;
4
+ min-height: 85vh;
5
+ flex-direction: column;
6
+ color: #555d66;
7
+ background: #f1f1f1;
8
+ margin: 0 0 0 -20px;
9
+
10
+ .dashicons {
11
+ vertical-align: bottom;
12
+ }
13
+ }
14
+
15
+ .envato-template-kit-import__header {
16
+ background-color: #FFFFFF;
17
+ border-bottom: 1px solid #e0e5e9;
18
+ padding: 30px;
19
+
20
+ p {
21
+ margin-bottom: 0;
22
+ }
23
+ }
24
+
25
+ .envato-template-kit-import__header-logo {
26
+ position: absolute;
27
+ right: 26px;
28
+ top: 15px;
29
+ }
src/scss/admin/_plugins.scss ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .envato-template-kit-import{
2
+ &__plugins {
3
+ background: #FFFFFF;
4
+ border: 1px solid $gray-mouse;
5
+ margin: 40px auto 40px;
6
+ padding: 20px;
7
+ display: flex;
8
+ flex-wrap: wrap;
9
+ }
10
+
11
+ &__plugin-list-wrapper {
12
+ flex: 0 0 690px;
13
+ }
14
+
15
+ &__plugin-list {
16
+ padding-top: 10px;
17
+ padding-left: 10px;
18
+ }
19
+
20
+ &__plugin {
21
+ border-bottom: 1px solid $gray-mouse;
22
+ padding: 10px 0;
23
+ display: flex;
24
+ align-items: center;
25
+ width: 100%;
26
+ }
27
+
28
+ &__plugin-title {
29
+ flex: 1;
30
+ }
31
+
32
+ &__plugin-status {
33
+ flex: 0 0 200px;
34
+ &--deactivated {
35
+ @include button($wp-primary, #fff, $buttonSmall);
36
+ [data-plugin-status="deactivated"] {
37
+ display: flex;
38
+ }
39
+ }
40
+ &--update {
41
+ @include button($wp-primary, #fff, $buttonSmall);
42
+ [data-plugin-status="update"] {
43
+ display: flex;
44
+ }
45
+ }
46
+ &--install {
47
+ @include button($wp-primary, #fff, $buttonSmall);
48
+ [data-plugin-status="install"] {
49
+ display: flex;
50
+ }
51
+ }
52
+ &--activated {
53
+ @include button(#D0D0D0, #030303, $buttonSmall);
54
+ [data-plugin-status="activated"] {
55
+ display: flex;
56
+ .dashicons-yes {
57
+ color: $green;
58
+ }
59
+ }
60
+ }
61
+ &--error {
62
+ @include button($gray, #fff, $buttonSmall);
63
+ [data-plugin-status="error"] {
64
+ display: flex;
65
+ }
66
+ }
67
+ }
68
+
69
+ &__plugin-status-text {
70
+ display: none;
71
+ align-items: center;
72
+ justify-content: space-between;
73
+ }
74
+
75
+ &__plugin-list-next {
76
+ flex: 1;
77
+ display: flex;
78
+ justify-content: flex-end;
79
+ align-items: center;
80
+ padding: 60px;
81
+ }
82
+
83
+ &__plugin-list-next-button {
84
+ @include button($wp-primary);
85
+ }
86
+
87
+ }
src/scss/admin/_section.scss ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // .envato-template-kit-import__topnav-wrapper {
2
+ // margin-left: auto;
3
+ // margin-right: 6px;
4
+ // display: flex;
5
+ // align-items: center;
6
+ // justify-content: center;
7
+
8
+ // @media screen and (max-width: 782px) {
9
+ // display: none;
10
+ // }
11
+ // }
12
+
13
+ // .envato-template-kit-import__topnav-section-link {
14
+ // text-decoration: none;
15
+ // padding: 10px;
16
+ // color: #555d66;
17
+ // }
18
+
19
+ // .envato-template-kit-import__section {
20
+ // display: flex;
21
+ // justify-content: center;
22
+ // align-items: stretch;
23
+ // margin: auto;
24
+ // }
25
+
26
+ // .envato-template-kit-import__section-inner {
27
+ // align-items: center;
28
+ // max-width: 1000px;
29
+ // margin: 40px auto;
30
+ // border: 1px solid #E0E5E9;
31
+ // background-color: #FFFFFF;
32
+ // text-align: center;
33
+ // //padding:0px;
34
+ // h2 {
35
+ // font-weight: 300;
36
+ // font-size: 20px;
37
+ // color: #777;
38
+ // margin: 0;
39
+ // padding: 0;
40
+ // line-height: 1.1;
41
+ // }
42
+
43
+ // p {
44
+ // font-size: 14px;
45
+ // }
46
+
47
+ // .button-primary {
48
+ // padding: 2px 40px;
49
+ // font-size: 1.1em;
50
+ // height: auto;
51
+ // margin-top: 15px;
52
+ // }
53
+ // }
54
+
55
+ // .envato-template-kit-import__section-banner {
56
+ // display: block;
57
+ // padding: 20px 40px 30px;
58
+ // border-radius: 4px;
59
+ // margin-top: 30px;
60
+ // text-align: center;
61
+ // margin-bottom: 5px;
62
+
63
+ // p {
64
+ // color: #464646 !important;
65
+ // font-size: 16px;
66
+ // }
67
+
68
+ // a.button-primary {
69
+ // padding: 10px 40px;
70
+ // background: #7aac41;
71
+ // border: 1px solid #65913b;
72
+ // text-shadow: none;
73
+ // box-shadow: none;
74
+ // &:hover{
75
+ // background: #65913b;
76
+ // }
77
+ // }
78
+ // }
79
+
80
+ // .envato-template-kit-import__photos-logo {
81
+ // width: 220px;
82
+ // margin-bottom: 20px;
83
+ // }
84
+
85
+ // .envato-template-kit-import__photos-promo {
86
+ // max-width: 100%;
87
+ // height: auto;
88
+ // }
src/scss/admin/_tabs.scss ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .envato-template-kit-import {
2
+ // Tabs
3
+ &__tabset {
4
+ background: #f9f9f9;
5
+ border-top: 1px solid #f1f1f1;
6
+ display: flex;
7
+
8
+ }
9
+
10
+ &__tab {
11
+ border-right: 1px solid #e0e5e9;
12
+ color: #000;
13
+ cursor: pointer;
14
+ font-weight: bold;
15
+ padding: 17px 30px 14px;
16
+ text-decoration: none;
17
+
18
+ &:focus,
19
+ &:active {
20
+ outline: none;
21
+ box-shadow: none;
22
+ }
23
+
24
+ &--current {
25
+ border-bottom: 2px solid #837E7E;
26
+ }
27
+ }
28
+
29
+ &__tab-panel {
30
+ background: #f1f1f1;
31
+ border-top: 1px solid #e0e5e9;
32
+ color: #000;
33
+ padding: 20px 30px;
34
+ overflow: hidden;
35
+
36
+ }
37
+ }
38
+
src/scss/admin/_templates.scss ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .envato-template-kit-import{
2
+ &__templates {
3
+ display: flex;
4
+ flex-wrap: wrap;
5
+ width: 100%;
6
+ margin: 40px auto 40px;
7
+ }
8
+
9
+ &__template {
10
+ flex: 0 0 30%;
11
+ margin-right: 3%;
12
+ margin-bottom: 3%;
13
+ background: #FFFFFF;
14
+ border: 1px solid $gray-mouse;
15
+ }
16
+
17
+ &__template-screenshot-wrapper {
18
+ height: 300px;
19
+ overflow: hidden;
20
+ }
21
+
22
+ &__template-screenshot {
23
+ max-width: 100%;
24
+ height: auto;
25
+ }
26
+
27
+ &__template-title {
28
+ text-align: center;
29
+ padding: 20px 0 0;
30
+ font-size: 16px;
31
+ }
32
+
33
+ &__template-import-options {
34
+ text-align: center;
35
+ padding: 20px 0;
36
+ }
37
+
38
+ &__button-import {
39
+ @include button($wp-primary);
40
+ }
41
+ &__button-edit {
42
+ @include button($wp-primary);
43
+ }
44
+ &__button-import-again {
45
+ @include button($gray);
46
+ }
47
+ }
src/scss/admin/_upload.scss ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .envato-template-kit-import {
2
+ // Step 1 - Upload
3
+ &__template-kit {
4
+ align-items: center;
5
+ display: flex;
6
+ flex-direction: row;
7
+ margin-bottom: 40px;
8
+ }
9
+
10
+ &__title {
11
+ font-weight: bold;
12
+ text-transform: capitalize;
13
+ }
14
+
15
+ &__screenshot {
16
+ margin-right: 25px;
17
+ max-width: 300px;
18
+ height: 200px;
19
+ overflow: hidden;
20
+
21
+ img {
22
+ width: 100%;
23
+ height: auto;
24
+ }
25
+ }
26
+
27
+ &__next {
28
+ margin-left: auto;
29
+ }
30
+
31
+ // Step 1 - Form
32
+ &__upload {
33
+ background-color: #fff;
34
+ border: 1px solid #e0e5e9;
35
+ margin-right: auto;
36
+ margin-left: auto;
37
+ padding: 50px 25px;
38
+ max-width: 900px;
39
+
40
+ &-form {
41
+ display: flex;
42
+ align-items: center;
43
+ justify-content: space-between;
44
+ }
45
+
46
+ &-btn {
47
+ background: #F7F7F7;
48
+ border: 1px solid #CCCCCC;
49
+ border-radius: 3px;
50
+ padding: 16px;
51
+
52
+ &-next {
53
+ @include button($wp-primary);
54
+ }
55
+ &-next-input {
56
+ @include button($wp-primary);
57
+ width: 200px;
58
+ }
59
+ &-next-link {
60
+ @include button($wp-primary);
61
+ padding-right: 87px;
62
+ padding-left: 87px;
63
+ }
64
+ }
65
+
66
+ &-hidden {
67
+ display: none;
68
+ }
69
+
70
+ }
71
+ }
template-kit-import.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: Template Kit Import
4
+ * Description: Import Template Kits to WordPress
5
+ * Author: Envato
6
+ * Author URI: https://envato.com
7
+ * Version: 1.0.0-RC2
8
+ * License: GPLv3 or later
9
+ * License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
+ *
11
+ * Text Domain: template-kit-import
12
+ *
13
+ * @package Envato/Template_Kit_Import
14
+ *
15
+ * Template Kit Import is free software: you can redistribute it and/or modify
16
+ * it under the terms of the GNU General Public License as published by
17
+ * the Free Software Foundation, either version 3 of the License, or
18
+ * any later version.
19
+ *
20
+ * Template Kit Import is distributed in the hope that it will be useful,
21
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ * GNU General Public License for more details.
24
+ */
25
+
26
+ if ( ! defined( 'ABSPATH' ) ) {
27
+ exit;
28
+ }
29
+
30
+ define( 'ENVATO_TEMPLATE_KIT_IMPORT_SLUG', 'template-kit-import' );
31
+ define( 'ENVATO_TEMPLATE_KIT_IMPORT_VER', '1.0.0-RC2' );
32
+ define( 'ENVATO_TEMPLATE_KIT_IMPORT_FILE', __FILE__ );
33
+ define( 'ENVATO_TEMPLATE_KIT_IMPORT_DIR', plugin_dir_path( ENVATO_TEMPLATE_KIT_IMPORT_FILE ) );
34
+ define( 'ENVATO_TEMPLATE_KIT_IMPORT_URI', plugins_url( '/', ENVATO_TEMPLATE_KIT_IMPORT_FILE ) );
35
+ define( 'ENVATO_TEMPLATE_KIT_IMPORT_PHP_VERSION', '5.6' );
36
+
37
+ add_action( 'plugins_loaded', 'envato_template_kit_import_load_plugin_textdomain' );
38
+
39
+ if ( ! version_compare( PHP_VERSION, ENVATO_TEMPLATE_KIT_IMPORT_PHP_VERSION, '>=' ) ) {
40
+ add_action( 'admin_notices', 'envato_template_kit_import_fail_php_version' );
41
+ } elseif ( ! version_compare( get_bloginfo( 'version' ), '4.6', '>=' ) ) {
42
+ add_action( 'admin_notices', 'envato_template_kit_import_fail_wp_version' );
43
+ } else {
44
+ require ENVATO_TEMPLATE_KIT_IMPORT_DIR . 'inc/bootstrap.php';
45
+ }
46
+
47
+
48
+ /**
49
+ * Load Envato Elements textdomain.
50
+ *
51
+ * Load gettext translate for Envato Elements text domain.
52
+ *
53
+ * @since 0.0.2
54
+ *
55
+ * @return void
56
+ */
57
+ function envato_template_kit_import_load_plugin_textdomain() {
58
+ load_plugin_textdomain( 'template-kit-import' );
59
+ }
60
+
61
+
62
+ /**
63
+ * Envato Elements admin notice for minimum PHP version.
64
+ *
65
+ * Warning when the site doesn't have the minimum required PHP version.
66
+ *
67
+ * @since 0.0.2
68
+ *
69
+ * @return void
70
+ */
71
+ function envato_template_kit_import_fail_php_version() {
72
+ $message = sprintf(
73
+ /* translators: %s: PHP version */
74
+ esc_html__( 'Template Kit Import requires PHP version %1$s+, plugin is currently NOT ACTIVE. Please contact the hosting provider. WordPress recommends version %2$s.', 'template-kit-import' ),
75
+ ENVATO_TEMPLATE_KIT_IMPORT_PHP_VERSION,
76
+ sprintf(
77
+ '<a href="%s" target="_blank">%s</a>',
78
+ esc_url( 'https://wordpress.org/about/requirements/' ),
79
+ esc_html__( '7.2 or above', 'template-kit-import' )
80
+ )
81
+ );
82
+
83
+ $html_message = sprintf( '<div class="error">%s</div> ', wpautop( $message ) );
84
+ echo wp_kses_post( $html_message );
85
+ }
86
+
87
+ /**
88
+ * Envato Elements admin notice for minimum WordPress version.
89
+ *
90
+ * Warning when the site doesn't have the minimum required WordPress version .
91
+ *
92
+ * @since 0.0.2
93
+ *
94
+ * @return void
95
+ */
96
+ function envato_template_kit_import_fail_wp_version() {
97
+ /* translators: %s: WordPress version */
98
+ $message = sprintf( esc_html__( 'Template Kit Import requires WordPress version %s+. Because you are using an earlier version, the plugin is currently NOT ACTIVE.', 'template-kit-import' ), '4.6' );
99
+ $html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) );
100
+ echo wp_kses_post( $html_message );
101
+ }
views/importer/importer.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Envato_Template_Kit_Import;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit; // Exit if accessed directly.
7
+ }
8
+
9
+ $current_active_step = isset( $_GET['step'] ) ? (int) $_GET['step'] : 1;
10
+ $template_kit_id = isset( $_GET['template_kit_id'] ) ? (int) $_GET['template_kit_id'] : 0;
11
+
12
+ $step1_url = Importer::get_instance()->get_url();
13
+ $step2_url = add_query_arg(
14
+ array(
15
+ 'step' => 2,
16
+ 'template_kit_id' => $template_kit_id,
17
+ ),
18
+ Importer::get_instance()->get_url()
19
+ );
20
+ $step3_url = add_query_arg(
21
+ array(
22
+ 'step' => 3,
23
+ 'template_kit_id' => $template_kit_id,
24
+ ),
25
+ Importer::get_instance()->get_url()
26
+ );
27
+ ?>
28
+
29
+ <div class="envato-template-kit-import__tabset">
30
+ <?php if ( $template_kit_id > 0 ) { ?>
31
+ <!-- Tab 1 -->
32
+ <a href="<?php echo esc_url( $step1_url ); ?>" class="envato-template-kit-import__tab<?php echo 1 === $current_active_step ? ' envato-template-kit-import__tab--current' : ''; ?>">
33
+ <?php esc_html_e( '1. Upload', 'template-kit-import' ); ?>
34
+ </a>
35
+ <!-- Tab 2 -->
36
+ <a href="<?php echo esc_url( $step2_url ); ?>" class="envato-template-kit-import__tab<?php echo 2 === $current_active_step ? ' envato-template-kit-import__tab--current' : ''; ?>">
37
+ <?php esc_html_e( '2. Install Plugins', 'template-kit-import' ); ?>
38
+ </a>
39
+ <!-- Tab 3 -->
40
+ <a href="<?php echo esc_url( $step3_url ); ?>" class="envato-template-kit-import__tab<?php echo 3 === $current_active_step ? ' envato-template-kit-import__tab--current' : ''; ?>">
41
+ <?php esc_html_e( '3. Select Templates', 'template-kit-import' ); ?>
42
+ </a>
43
+ <?php } else { ?>
44
+ <!-- Tab 1 -->
45
+ <a href="<?php echo esc_url( $step1_url ); ?>" class="envato-template-kit-import__tab<?php echo 1 === $current_active_step ? ' envato-template-kit-import__tab--current' : ''; ?>">
46
+ <?php esc_html_e( '1. Upload', 'template-kit-import' ); ?>
47
+ </a>
48
+ <!-- Tab 2 -->
49
+ <span class="envato-template-kit-import__tab">
50
+ <?php esc_html_e( '2. Install Plugins', 'template-kit-import' ); ?>
51
+ </span>
52
+ <!-- Tab 3 -->
53
+ <span class="envato-template-kit-import__tab">
54
+ <?php esc_html_e( '3. Select Templates', 'template-kit-import' ); ?>
55
+ </span>
56
+ <?php } ?>
57
+ </div>
58
+ <section class="envato-template-kit-import__tab-panel">
59
+ <?php
60
+ if ( 1 === $current_active_step || 2 === $current_active_step || 3 === $current_active_step ) {
61
+ require __DIR__ . '/step' . $current_active_step . '.php';
62
+ }
63
+ ?>
64
+ </section>
views/importer/step1-upload.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Envato_Template_Kit_Import;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit; // Exit if accessed directly.
7
+ }
8
+
9
+ ?>
10
+
11
+ <div class="envato-template-kit-import__upload">
12
+ <form class="envato-template-kit-import__upload-form" action="<?php echo esc_url( admin_url( 'admin.php?action=envato_template_kit_import_upload' ) ); ?>" method="POST" enctype="multipart/form-data">
13
+ <?php wp_nonce_field( 'envato_template_kit_import' ); ?>
14
+ <label for="file" class="envato-template-kit-import__upload-btn"><span class="dashicons dashicons-upload"></span> Upload Template Kit Zip file</label>
15
+ <input id="file" class="envato-template-kit-import__upload-hidden" type="file" name="template_kit" />
16
+ <input type="submit" name="sign_up" id="sign_up" class="envato-template-kit-import__upload-btn-next-input" data-cy="submit_button" value="<?php esc_attr_e( 'Next', 'template-kit-import' ); ?>"/>
17
+ </form>
18
+ </div>
views/importer/step1.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Envato_Template_Kit_Import;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit; // Exit if accessed directly.
7
+ }
8
+
9
+ $existing_kits = CPT_Kits::get_instance()->get_all_uploaded_kits();
10
+
11
+ ?>
12
+ <div class="envato-template-kit-import__upload">
13
+
14
+ <?php
15
+ if ( ! $existing_kits || isset( $_GET['upload'] ) ) {
16
+ require __DIR__ . '/step1-upload.php';
17
+ } else {
18
+ foreach ( $existing_kits as $template_kit ) {
19
+ // Attempt to load this template kit to confirm it's a valid builder type, and get access to helper methods:
20
+ $template_kit_manager = envato_template_kit_import_get_builder( $template_kit->ID );
21
+ if ( $template_kit_manager ) {
22
+ // Grab a list of templates from this kit, so we can use the first one as a screenshot url:
23
+ $template_kit_templates = $template_kit_manager->get_available_templates();
24
+ ?>
25
+ <div class="envato-template-kit-import__template-kit">
26
+ <div class="envato-template-kit-import__screenshot">
27
+ <img src="<?php echo esc_url( $template_kit_templates[0]['screenshot_url'] ); ?>" alt="<?php echo esc_attr( $template_kit->post_title ); ?>" />
28
+ </div>
29
+ <div class="envato-template-kit-import__template-meta">
30
+ <p class="envato-template-kit-import__title"><?php echo esc_html( $template_kit->post_title ); ?></p>
31
+ </div>
32
+ <div class="envato-template-kit-import__next">
33
+ <a class="envato-template-kit-import__upload-btn-next-link"
34
+ href="<?php echo esc_url( Importer::get_instance()->get_url() ); ?>&step=2&template_kit_id=<?php echo (int) $template_kit->ID; ?>">Next</a>
35
+ </div>
36
+ </div>
37
+ <?php
38
+ }
39
+ }
40
+ ?>
41
+ <a class="envato-template-kit-import__button-import" href="<?php echo esc_url( Importer::get_instance()->get_url() ); ?>&upload">Upload New Template Kit</a>
42
+ <?php
43
+ }
44
+ ?>
45
+ </div>
46
+ <?php
views/importer/step2.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Envato_Template_Kit_Import;
4
+
5
+ if ( ! defined( 'ABSPATH' ) || ! isset( $template_kit_id ) ) {
6
+ exit; // Exit if accessed directly.
7
+ }
8
+
9
+ $template_kit = envato_template_kit_import_get_builder( $template_kit_id );
10
+
11
+ if ( ! $template_kit ) {
12
+ wp_die( 'Invalid Template Kit ID' );
13
+ }
14
+
15
+ $required_plugins = $template_kit->get_required_plugins();
16
+ ?>
17
+
18
+ <div class="envato-template-kit-import__plugins">
19
+ <div class="envato-template-kit-import__plugin-list-wrapper">
20
+ <p>
21
+ <?php
22
+ /* Translators: %s Template kit name */
23
+ printf( esc_html__( 'The %s requires the following plugins to work best, select the plugins you would like to install:', 'template-kit-import' ), '<strong>' . esc_html( $template_kit->get_name() ) . ' - Template Kit</strong>' );
24
+ ?>
25
+ </p>
26
+ <div class="envato-template-kit-import__plugin-list">
27
+ <?php foreach ( $required_plugins as $required_plugin ) { ?>
28
+ <div class="envato-template-kit-import__plugin">
29
+ <span class="envato-template-kit-import__plugin-title">
30
+ <?php echo esc_html( $required_plugin['name'] ); ?>
31
+ </span>
32
+ <span
33
+ class="envato-template-kit-import__plugin-status envato-template-kit-import__plugin-status--btn-small envato-template-kit-import__plugin-status--<?php echo esc_attr( $required_plugin['status'] ); ?> js-template-kit-plugin"
34
+ data-plugin-status="<?php echo esc_attr( $required_plugin['status'] ); ?>"
35
+ data-plugin-file="<?php echo esc_attr( $required_plugin['file'] ); ?>"
36
+ data-plugin-slug="<?php echo esc_attr( $required_plugin['slug'] ); ?>"
37
+ data-plugin-url="<?php echo esc_attr( $required_plugin['url'] ); ?>">
38
+ <span class="envato-template-kit-import__plugin-status-text" data-plugin-status="deactivated">
39
+ <?php esc_html_e( 'Activate Plugin', 'template-kit-import' ); ?>
40
+ </span>
41
+ <span class="envato-template-kit-import__plugin-status-text" data-plugin-status="update">
42
+ <?php esc_html_e( 'Update Plugin', 'template-kit-import' ); ?>
43
+ </span>
44
+ <span class="envato-template-kit-import__plugin-status-text" data-plugin-status="install">
45
+ <?php esc_html_e( 'Install Plugin', 'template-kit-import' ); ?>
46
+ </span>
47
+ <span class="envato-template-kit-import__plugin-status-text" data-plugin-status="activated">
48
+ <?php esc_html_e( 'Plugin Installed', 'template-kit-import' ); ?>
49
+ <span class="dashicons dashicons-yes"></span>
50
+ </span>
51
+ <span class="envato-template-kit-import__plugin-status-text" data-plugin-status="error">
52
+ <?php esc_html_e( 'Plugin Error', 'template-kit-import' ); ?>
53
+ </span>
54
+ </span>
55
+ </div>
56
+ <?php } ?>
57
+ </div>
58
+ </div>
59
+ <div class="envato-template-kit-import__plugin-list-next">
60
+ <a class="envato-template-kit-import__plugin-list-next-button" href="<?php echo esc_url( Importer::get_instance()->get_url() ); ?>&step=3&template_kit_id=<?php echo (int) $template_kit_id; ?>">Next</a>
61
+ </div>
62
+ </div>
63
+
64
+
65
+ <script>
66
+ jQuery( function () {
67
+ window.TemplateKitImport && window.TemplateKitImport().initPluginPage();
68
+ } );
69
+ </script>
70
+
71
+
views/importer/step3.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Envato_Template_Kit_Import;
4
+
5
+ if ( ! defined( 'ABSPATH' ) || ! isset( $template_kit_id ) ) {
6
+ exit; // Exit if accessed directly.
7
+ }
8
+
9
+ $template_kit = envato_template_kit_import_get_builder( $template_kit_id );
10
+
11
+ if ( ! $template_kit ) {
12
+ wp_die( 'Invalid Template Kit ID' );
13
+ }
14
+
15
+ $templates = $template_kit->get_available_templates();
16
+
17
+ ?>
18
+
19
+ <div class="envato-template-kit-import__templates">
20
+ <?php foreach ( $templates as $template_index => $template ) { ?>
21
+ <div class="envato-template-kit-import__template">
22
+ <div class="envato-template-kit-import__template-screenshot-wrapper">
23
+ <img src="<?php echo esc_url( $template['screenshot_url'] ); ?>" alt="<?php echo esc_attr( $template['name'] ); ?>" class="envato-template-kit-import__template-screenshot" />
24
+ </div>
25
+ <div class="envato-template-kit-import__template-title">
26
+ <?php echo esc_html( $template['name'] ); ?>
27
+ </div>
28
+ <div class="envato-template-kit-import__template-import-options">
29
+ <?php if ( $template['imports'] ) { ?>
30
+ <a href="<?php echo esc_url( $template_kit->get_imported_template_edit_url() ); ?>" target="_blank" class="envato-template-kit-import__button-edit"><?php esc_html_e( 'Edit', 'template-kit-import' ); ?></a>
31
+ <button class="envato-template-kit-import__button-import-again js-template-kit-import" data-nonce="<?php echo esc_attr( wp_create_nonce( 'import_template_kit_' . $template_kit_id ) ); ?>" data-template-kit-id="<?php echo (int) $template_kit_id; ?>" data-template-index="<?php echo (int) $template_index; ?>"><?php echo esc_html_e( 'Import Again', 'template-kit-import' ); ?></button>
32
+ <?php } else { ?>
33
+ <button class="envato-template-kit-import__button-import js-template-kit-import" data-nonce="<?php echo esc_attr( wp_create_nonce( 'import_template_kit_' . $template_kit_id ) ); ?>" data-template-kit-id="<?php echo (int) $template_kit_id; ?>" data-template-index="<?php echo (int) $template_index; ?>"><?php echo esc_html( $template_kit->get_import_button_text() ); ?></button>
34
+ <?php } ?>
35
+ </div>
36
+ </div>
37
+ <?php } ?>
38
+ </div>
39
+
40
+ <script>
41
+ jQuery( function () {
42
+ window.TemplateKitImport && window.TemplateKitImport().initTemplatePage();
43
+ } );
44
+ </script>
views/wrapper.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Provide a admin area view for the plugin
4
+ *
5
+ * This file is used to markup the admin-facing aspects of the plugin.
6
+ *
7
+ * @link -
8
+ * @since 1.0.0
9
+ *
10
+ * @package Template_Kit_Import
11
+ * @subpackage Template_Kit_Import/views
12
+ */
13
+
14
+ if ( ! defined( 'ABSPATH' ) ) {
15
+ exit; // Exit if accessed directly.
16
+ }
17
+
18
+ ?>
19
+
20
+ <div class="envato-template-kit-import__wrapper">
21
+ <div class="envato-template-kit-import__header">
22
+ <h1>Template Kit - Import</h1>
23
+ <p>Use this plugin to Import a Template Kit.</p>
24
+ <div class="envato-template-kit-import__header-logo">
25
+ <svg width="27" height="31" viewBox="0 0 27 31" fill="none" xmlns="http://www.w3.org/2000/svg">
26
+ <g opacity="0.1">
27
+ <path d="M23.6409 1.31841C19.4509 -3.59159 5.89088 5.91841 6.00088 18.1784C5.9983 18.3288 5.93743 18.4723 5.83108 18.5786C5.72474 18.685 5.58125 18.7458 5.43088 18.7484C5.33212 18.7473 5.23527 18.721 5.14952 18.672C5.06377 18.623 4.99195 18.5529 4.94088 18.4684C3.54702 15.4348 3.36108 11.9842 4.42088 8.81841C4.46018 8.70236 4.45806 8.57627 4.41488 8.46161C4.3717 8.34694 4.29012 8.25078 4.18403 8.18948C4.07794 8.12819 3.95389 8.10554 3.83298 8.1254C3.71208 8.14526 3.60179 8.2064 3.52088 8.29841C1.26081 10.707 0.00226874 13.8855 0.000875618 17.1884C-0.0192324 18.9209 0.30717 20.6399 0.960899 22.2444C1.61463 23.8489 2.58249 25.3066 3.80761 26.5317C5.03273 27.7568 6.49038 28.7247 8.0949 29.3784C9.69941 30.0321 11.4184 30.3585 13.1509 30.3384C31.6509 29.9184 27.3809 5.69841 23.6409 1.31841Z" fill="#555555"/>
28
+ </g>
29
+ </svg>
30
+ </div>
31
+ </div>
32
+
33
+ <div class="envato-template-kit-import__content">
34
+ <?php echo $this->content; // WPCS: xss ok ?>
35
+ </div>
36
+ </div>