Initial commit: Atomaste website
@@ -0,0 +1,31 @@
|
||||
# Hostinger wordpress plugin
|
||||
|
||||
## CLI Commands
|
||||
|
||||
== Usage ==
|
||||
|
||||
## Build Commands
|
||||
|
||||
### Install packages
|
||||
|
||||
$ npm install
|
||||
|
||||
### Compiling Assets
|
||||
|
||||
$ npm run prod
|
||||
|
||||
## Gutenberg Blocks
|
||||
|
||||
$ cd gutenberg/edit-pages-panel
|
||||
|
||||
### Install packages
|
||||
|
||||
$ npm install
|
||||
|
||||
### Compiling Assets
|
||||
|
||||
$ npm run build
|
||||
|
||||
### Watch Assets
|
||||
|
||||
$ npm run start
|
||||
BIN
Atomaste Reference/public_html/wp-content/plugins/hostinger-easy-onboarding/assets/.DS_Store
vendored
Normal file
@@ -0,0 +1 @@
|
||||
@font-face{font-family:DMSans;font-weight:400;src:url(../fonts/DMSans-Regular.ttf)}@font-face{font-family:DMSans;font-weight:500;src:url(../fonts/DMSans-Medium.ttf)}@font-face{font-family:DMSans;font-weight:700;src:url(../fonts/DMSans-Bold.ttf)}#wp__notice-list .notice-hst{margin-top:25px;padding-bottom:7.5px;padding-top:7.5px}#wp__notice-list .notice-hst .components-button{margin-right:3px}.notice.notice-info.hts-omnisend{padding:12px;position:relative}#wpadminbar #wp-admin-bar-hostinger_admin_bar .ab-item{align-items:center;display:flex}#wpadminbar #wp-admin-bar-hostinger_admin_bar .ab-item svg{fill:#9ca1a7;margin-right:6px;max-height:22px}#wpadminbar #wp-admin-bar-hostinger_admin_bar:hover svg{fill:#72aee6}#wpadminbar #wp-admin-bar-hostinger_admin_bar .ab-sub-wrapper .ab-item svg{fill:#9ca1a7;margin-left:3px;max-height:18px}#wpadminbar #wp-admin-bar-hostinger_admin_bar .ab-sub-wrapper .ab-item:hover svg{fill:#72aee6}body:not(.folded) .hostinger-onboarding-reminder{padding-left:160px;width:calc(100% - 160px)}@media(max-width:782px){body:not(.folded) .hostinger-onboarding-reminder{padding-left:0;width:100%}}body .folded .hostinger-onboarding-reminder{padding-left:36px;width:calc(100% - 36px)}@media(max-width:782px){body .folded .hostinger-onboarding-reminder{padding-left:0;width:100%}}body.hostinger-onboarding-reminder-visible #wpbody-content{padding-top:56px}body.hostinger-onboarding-reminder-visible .woocommerce-mobile-app-banner{display:none!important}.hostinger-onboarding-reminder{background:#ebe4ff;height:60px;left:0;position:fixed;top:32px;z-index:2000}@media(max-width:782px){.hostinger-onboarding-reminder{left:0;top:46px;width:100%}}@media(max-width:650px){.hostinger-onboarding-reminder{height:auto;padding-bottom:10px;padding-top:10px}}.hostinger-onboarding-reminder__wrap{align-items:center;display:flex;height:100%;justify-content:center;position:relative}@media(max-width:650px){.hostinger-onboarding-reminder__wrap{flex-wrap:wrap;padding-left:25px;padding-right:25px}}.hostinger-onboarding-reminder__logo{margin-right:8px}@media(max-width:650px){.hostinger-onboarding-reminder__logo{margin-bottom:2px;margin-right:0;text-align:center;width:100%}}.hostinger-onboarding-reminder__logo svg{height:24px;width:24px}.hostinger-onboarding-reminder__text{font-feature-settings:"clig" off,"liga" off;color:#673de6;font-family:DMSans;font-size:14px;font-style:normal;font-weight:400;line-height:24px;margin-right:24px}@media(max-width:650px){.hostinger-onboarding-reminder__text{margin-bottom:8px;margin-right:0;text-align:center;width:100%}}.hostinger-onboarding-reminder__cta a{align-items:center;background:#673de6;border-radius:8px;color:#fff;display:flex;font-size:12px;font-style:normal;font-weight:600;gap:8px;justify-content:center;line-height:20px;padding:6px 16px;text-align:center;text-decoration:none}.hostinger-onboarding-reminder__cta a:hover{background:#5025d1}
|
||||
@@ -0,0 +1 @@
|
||||
#hostinger-preview-banner{box-sizing:border-box!important;display:none!important}
|
||||
@@ -0,0 +1,3 @@
|
||||
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 2.5V9.5L9.5 6L4 2.5Z" fill="#673DE6"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 194 B |
@@ -0,0 +1,3 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M7.99566 3C7.99566 3 3.62009 3 2.52188 3.29127C1.93386 3.45896 1.44967 3.95317 1.28537 4.56217C1.00001 5.68309 1 8.00442 1 8.00442C1 8.00442 1.00001 10.3346 1.28537 11.4378C1.44967 12.0468 1.92521 12.5322 2.52188 12.6999C3.62874 13 7.99566 13 7.99566 13C7.99566 13 12.3799 13 13.4781 12.7087C14.0748 12.541 14.5503 12.0645 14.706 11.4467C15 10.3346 15 8.01325 15 8.01325C15 8.01325 15.0086 5.68309 14.706 4.56217C14.5503 3.95317 14.0748 3.4678 13.4781 3.30893C12.3799 3.00001 7.99566 3 7.99566 3ZM6.60342 5.8597L10.244 8.00442L6.60342 10.1403V5.8597Z" fill="#673DE6"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 681 B |
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 107 KiB |
|
After Width: | Height: | Size: 172 KiB |
|
After Width: | Height: | Size: 55 KiB |
|
After Width: | Height: | Size: 61 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 17 KiB |
@@ -0,0 +1,9 @@
|
||||
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M48 24C48 37.2548 37.2548 48 24 48C10.7452 48 0 37.2548 0 24C0 10.7452 10.7452 0 24 0C37.2548 0 48 10.7452 48 24ZM45.3333 24C45.3333 35.7821 35.7821 45.3333 24 45.3333C12.2179 45.3333 2.66667 35.7821 2.66667 24C2.66667 12.2179 12.2179 2.66667 24 2.66667C35.7821 2.66667 45.3333 12.2179 45.3333 24Z" fill="#EBE4FF"/>
|
||||
<mask id="mask0_7023_11690" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="48" height="48">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M48 24C48 37.2548 37.2548 48 24 48C10.7452 48 0 37.2548 0 24C0 10.7452 10.7452 0 24 0C37.2548 0 48 10.7452 48 24ZM45.3333 24C45.3333 35.7821 35.7821 45.3333 24 45.3333C12.2179 45.3333 2.66667 35.7821 2.66667 24C2.66667 12.2179 12.2179 2.66667 24 2.66667C35.7821 2.66667 45.3333 12.2179 45.3333 24Z" fill="white"/>
|
||||
</mask>
|
||||
<g mask="url(#mask0_7023_11690)">
|
||||
<path d="M24 0H48V48H0.333333L0 24H24V0Z" fill="#673DE6"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1,3 @@
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM8 15L3 10L4.41 8.59L8 12.17L15.59 4.58L17 6L8 15Z" fill="#00B090"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 313 B |
@@ -0,0 +1,3 @@
|
||||
<svg width="12" height="8" viewBox="0 0 12 8" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M6 0L0 6L1.41 7.41L6 2.83L10.59 7.41L12 6L6 0Z" fill="#673DE6"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 215 B |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 15 KiB |
@@ -0,0 +1,4 @@
|
||||
<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="32" cy="32" r="32" fill="#673DE6"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M42.6665 18.6667H21.3332C19.8665 18.6667 18.6665 19.8667 18.6665 21.3333V45.3333L23.9998 40H42.6665C44.1332 40 45.3332 38.8 45.3332 37.3333V21.3333C45.3332 19.8667 44.1332 18.6667 42.6665 18.6667Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 413 B |
|
After Width: | Height: | Size: 18 KiB |
@@ -0,0 +1,3 @@
|
||||
<svg width="93" height="108" viewBox="0 0 93 108" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M66.5145 0V32.2221L92.8421 47.4468V13.2693L66.5145 0ZM0.000915527 0.00183105V50.5657H85.6265L59.5744 36.4074L25.6372 36.3911V13.6097L0.000915527 0.00183105ZM66.5145 94.0237V71.4387L32.3155 71.4152C32.3474 71.5655 5.83099 57.0306 5.83099 57.0306L92.8421 57.4371V108L66.5145 94.0237ZM0.000912095 60.9814L0 94.0237L25.6372 107.292V75.8458L0.000912095 60.9814Z" fill="#673DE6"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 529 B |
|
After Width: | Height: | Size: 86 KiB |
@@ -0,0 +1,4 @@
|
||||
<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="32" cy="32" r="32" fill="#673DE6"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M31.9998 18.6667C24.6398 18.6667 18.6665 24.64 18.6665 32C18.6665 39.36 24.6398 45.3333 31.9998 45.3333C39.3598 45.3333 45.3332 39.36 45.3332 32C45.3332 24.64 39.3598 18.6667 31.9998 18.6667ZM33.3332 38.6667H30.6665V30.6667H33.3332V38.6667ZM33.3332 28H30.6665V25.3333H33.3332V28Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 496 B |
@@ -0,0 +1,12 @@
|
||||
<svg width="150" height="30" viewBox="0 0 150 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M116.794 12.1443C117.377 11.4191 118.324 11.0564 119.634 11.0564C120.224 11.0564 120.768 11.1311 121.267 11.281C121.766 11.4311 122.208 11.6077 122.593 11.8114L123.404 9.56366C123.308 9.5038 123.149 9.41956 122.926 9.31168C122.704 9.20354 122.421 9.09867 122.078 8.99708C121.735 8.89498 121.327 8.8052 120.852 8.72699C120.377 8.64928 119.845 8.6098 119.256 8.6098C118.39 8.6098 117.575 8.75415 116.812 9.04209C116.048 9.32978 115.384 9.75226 114.819 10.3098C114.253 10.8671 113.809 11.5481 113.484 12.351C113.159 13.1545 112.997 14.0777 112.997 15.1211C112.997 16.1521 113.144 17.0695 113.439 17.8722C113.734 18.6754 114.152 19.3532 114.692 19.9044C115.233 20.4561 115.886 20.8754 116.65 21.1636C117.413 21.451 118.264 21.5951 119.201 21.5951C120.296 21.5951 121.216 21.5196 121.961 21.37C122.707 21.2204 123.248 21.0798 123.585 20.9478V14.7793H120.771V19.1133C120.603 19.1495 120.407 19.1734 120.185 19.1852C119.962 19.197 119.694 19.203 119.382 19.203C118.804 19.203 118.3 19.1042 117.867 18.9065C117.434 18.7086 117.074 18.4297 116.785 18.0699C116.496 17.71 116.28 17.2815 116.135 16.7843C115.991 16.2869 115.919 15.7319 115.919 15.1211C115.919 13.8617 116.211 12.8698 116.794 12.1443Z" fill="#1D1E20"/>
|
||||
<path d="M72.0958 19.1221C71.8373 19.1885 71.5096 19.2212 71.1129 19.2212C70.3195 19.2212 69.6488 19.1402 69.102 18.978C68.5545 18.8166 68.0944 18.634 67.7222 18.4298L66.9282 20.6597C67.0967 20.756 67.304 20.8576 67.5504 20.9657C67.7971 21.0736 68.0919 21.1754 68.4344 21.2712C68.7772 21.3671 69.1709 21.4478 69.6158 21.5142C70.0607 21.5801 70.5598 21.6133 71.1129 21.6133C72.7601 21.6133 73.9927 21.2924 74.8103 20.6506C75.628 20.0093 76.0371 19.107 76.0371 17.9439C76.0371 17.3449 75.9587 16.8357 75.8028 16.4157C75.6462 15.996 75.4086 15.6301 75.0903 15.3185C74.7715 15.0069 74.3715 14.7341 73.8908 14.5002C73.4096 14.2663 72.8444 14.0297 72.1954 13.7895C71.8824 13.6817 71.5967 13.577 71.3386 13.4749C71.0799 13.3733 70.8514 13.2592 70.6529 13.1334C70.4546 13.0074 70.301 12.8666 70.1931 12.7107C70.0849 12.5553 70.0304 12.3632 70.0304 12.1351C70.0304 11.7518 70.178 11.4669 70.4726 11.2811C70.7671 11.0955 71.2511 11.0019 71.9248 11.0019C72.5258 11.0019 73.0398 11.0713 73.4668 11.2089C73.8933 11.3469 74.2812 11.5059 74.6303 11.6857L75.4416 9.47369C75.0449 9.25792 74.5397 9.05976 73.9268 8.87995C73.3135 8.7004 72.5858 8.60986 71.7442 8.60986C71.0345 8.60986 70.3974 8.69738 69.8322 8.8709C69.267 9.04517 68.7863 9.29338 68.3895 9.61728C67.9926 9.94144 67.6861 10.3337 67.4695 10.7955C67.2531 11.2569 67.1449 11.7755 67.1449 12.3511C67.1449 12.9267 67.247 13.4151 67.4516 13.8165C67.6559 14.2186 67.9207 14.5603 68.245 14.842C68.5696 15.1239 68.9363 15.3578 69.3452 15.5433C69.754 15.7289 70.1628 15.8942 70.5719 16.0375C71.5096 16.3498 72.1709 16.6403 72.5558 16.9104C72.9404 17.1797 73.1331 17.519 73.1331 17.9263C73.1331 18.1182 73.1031 18.2922 73.0428 18.4479C72.9826 18.6038 72.8741 18.7386 72.718 18.852C72.5619 18.9667 72.3543 19.0565 72.0958 19.1221Z" fill="#1D1E20"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M64.0374 15.1209C64.0374 16.1877 63.8778 17.1262 63.5597 17.935C63.2407 18.7445 62.8046 19.4219 62.2518 19.9671C61.6987 20.5131 61.0401 20.9235 60.2767 21.1991C59.5133 21.4753 58.6923 21.6131 57.8149 21.6131C56.9609 21.6131 56.1556 21.4753 55.3979 21.1991C54.6403 20.9235 53.9787 20.5131 53.4138 19.9671C52.8483 19.4219 52.4039 18.7445 52.0791 17.935C51.7545 17.1262 51.5918 16.1877 51.5918 15.1209C51.5918 14.0537 51.7603 13.1154 52.097 12.3064C52.4334 11.4969 52.8877 10.8164 53.4589 10.2649C54.0297 9.71341 54.6912 9.29998 55.4431 9.02411C56.1942 8.74799 56.9851 8.60992 57.8149 8.60992C58.6684 8.60992 59.4739 8.74799 60.2318 9.02411C60.9892 9.29998 61.6505 9.71341 62.2157 10.2649C62.7807 10.8164 63.2258 11.4969 63.5504 12.3064C63.8753 13.1154 64.0374 14.0537 64.0374 15.1209ZM54.4953 15.1209C54.4953 15.732 54.5703 16.2835 54.7206 16.7752C54.8709 17.267 55.0875 17.6895 55.3703 18.0431C55.6522 18.3972 55.9983 18.6695 56.4074 18.8612C56.8159 19.0535 57.2848 19.1496 57.8142 19.1496C58.331 19.1496 58.7971 19.0535 59.2122 18.8612C59.6266 18.6695 59.9757 18.3972 60.2579 18.0431C60.5404 17.6895 60.7573 17.267 60.9076 16.7752C61.0579 16.2835 61.1331 15.732 61.1331 15.1209C61.1331 14.5091 61.0579 13.9546 60.9076 13.4569C60.7573 12.9595 60.5404 12.5342 60.2579 12.1802C59.9757 11.8266 59.6266 11.5535 59.2122 11.3621C58.7971 11.1702 58.331 11.0744 57.8142 11.0744C57.2848 11.0744 56.8159 11.1732 56.4074 11.3709C55.9983 11.5688 55.6522 11.8447 55.3703 12.1985C55.0875 12.5521 54.8709 12.9776 54.7206 13.475C54.5703 13.9729 54.4953 14.5214 54.4953 15.1209Z" fill="#1D1E20"/>
|
||||
<path d="M45.1119 8.89819H47.9258V21.3612H45.1119V16.0739H40.3862V21.3612H37.5723V8.89819H40.3862V13.6637H45.1119V8.89819Z" fill="#1D1E20"/>
|
||||
<path d="M88.4331 8.89832V11.2904H84.6633V21.3613H81.8497V11.2904H78.0796V8.89832H88.4331Z" fill="#1D1E20"/>
|
||||
<path d="M94.372 21.3615H91.5581V8.89832H94.372V21.3615Z" fill="#1D1E20"/>
|
||||
<path d="M106.968 21.3613C106.162 19.9347 105.291 18.5261 104.352 17.135C103.414 15.744 102.416 14.4313 101.358 13.1963V21.3613H98.5806V8.89832H100.871C101.268 9.29364 101.707 9.77924 102.188 10.3549C102.669 10.9305 103.158 11.5451 103.658 12.1985C104.157 12.8518 104.653 13.5293 105.146 14.2304C105.639 14.9318 106.102 15.606 106.535 16.2535V8.89832H109.331V21.3613H106.968Z" fill="#1D1E20"/>
|
||||
<path d="M127.522 21.3613V8.89832H135.963V11.2542H130.336V13.6998H135.332V16.0021H130.336V19.0054H136.378V21.3613H127.522Z" fill="#1D1E20"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M147.746 9.75226C146.748 9.0866 145.311 8.75415 143.435 8.75415C142.918 8.75415 142.332 8.77804 141.677 8.82632C141.021 8.87385 140.387 8.95835 139.774 9.07755V21.3612H142.587V16.8107H143.977C144.217 17.0989 144.459 17.4196 144.701 17.7736C144.942 18.1272 145.187 18.5014 145.434 18.8972C145.682 19.2931 145.923 19.701 146.158 20.1204C146.393 20.5401 146.626 20.9536 146.855 21.3612H150C149.784 20.9058 149.55 20.4413 149.297 19.9673C149.045 19.494 148.783 19.0386 148.513 18.601C148.242 18.1634 147.968 17.7437 147.692 17.3419C147.415 16.9402 147.151 16.5836 146.898 16.2716C147.656 15.9602 148.236 15.5312 148.639 14.986C149.042 14.4406 149.243 13.7296 149.243 12.8547C149.243 11.4517 148.744 10.4177 147.746 9.75226ZM143.047 11.1641C143.209 11.1522 143.392 11.1462 143.597 11.1462C144.498 11.1462 145.18 11.2752 145.643 11.5325C146.106 11.791 146.338 12.225 146.338 12.8366C146.338 13.4724 146.109 13.9223 145.652 14.1856C145.196 14.4496 144.438 14.5809 143.38 14.5809H142.587V11.2C142.731 11.1885 142.885 11.1764 143.047 11.1641Z" fill="#1D1E20"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.000249566 14.046V0.000497794L7.08916 3.78046V10.1086L16.4735 10.1132L23.6774 14.046H0.000249566ZM18.3925 8.95058V0L25.6725 3.6859V13.1797L18.3925 8.95058ZM18.3924 26.1177V19.8441L8.93577 19.8375C8.9446 19.8793 1.6123 15.8418 1.6123 15.8418L25.6725 15.9547V30L18.3924 26.1177ZM0 26.1177L0.000252212 16.9393L7.08916 21.0683V29.8033L0 26.1177Z" fill="#1D1E20"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 120 KiB |
@@ -0,0 +1,3 @@
|
||||
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 2.5V9.5L9.5 6L4 2.5Z" fill="#673DE6"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 194 B |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 61 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 89 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 121 KiB |
|
After Width: | Height: | Size: 121 KiB |
@@ -0,0 +1,15 @@
|
||||
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M48 24C48 37.2548 37.2548 48 24 48C10.7452 48 0 37.2548 0 24C0 10.7452 10.7452 0 24 0C37.2548 0 48 10.7452 48 24ZM45.3333 24C45.3333 35.7821 35.7821 45.3333 24 45.3333C12.2179 45.3333 2.66667 35.7821 2.66667 24C2.66667 12.2179 12.2179 2.66667 24 2.66667C35.7821 2.66667 45.3333 12.2179 45.3333 24Z" fill="#EBE4FF"/>
|
||||
<mask id="mask0_7023_11585" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="48" height="48">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M48 24C48 37.2548 37.2548 48 24 48C10.7452 48 0 37.2548 0 24C0 10.7452 10.7452 0 24 0C37.2548 0 48 10.7452 48 24ZM45.3333 24C45.3333 35.7821 35.7821 45.3333 24 45.3333C12.2179 45.3333 2.66667 35.7821 2.66667 24C2.66667 12.2179 12.2179 2.66667 24 2.66667C35.7821 2.66667 45.3333 12.2179 45.3333 24Z" fill="white"/>
|
||||
</mask>
|
||||
<g mask="url(#mask0_7023_11585)">
|
||||
<circle cx="24" cy="24" r="24" fill="#00B090"/>
|
||||
</g>
|
||||
<mask id="mask1_7023_11585" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="15" y="17" width="19" height="15">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M33.4438 19.0002L20.9992 31.4448L15.0547 25.5002L16.9992 23.5557L20.9992 27.5557L31.4992 17.0557L33.4438 19.0002Z" fill="#00B090"/>
|
||||
</mask>
|
||||
<g mask="url(#mask1_7023_11585)">
|
||||
<path d="M17 22.5L14 25.5L21 32.5L34.5 19L31.5 16L21 26.5L17 22.5Z" fill="#00B090"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,10 @@
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_8754_23615)">
|
||||
<path d="M19.5834 5.42252C19.4701 5.01855 19.2495 4.65281 18.945 4.36419C18.6319 4.06669 18.2482 3.85389 17.83 3.74586C16.265 3.33336 9.99503 3.33336 9.99503 3.33336C7.38113 3.30362 4.76788 3.43442 2.17003 3.72502C1.75185 3.84103 1.36883 4.05859 1.05503 4.35836C0.746693 4.65502 0.523359 5.02086 0.406693 5.42169C0.126437 6.93148 -0.00973061 8.46448 2.6038e-05 10C-0.00997396 11.5342 0.125859 13.0667 0.406693 14.5784C0.520859 14.9775 0.743359 15.3417 1.05253 15.6359C1.36169 15.93 1.74669 16.1425 2.17003 16.255C3.75586 16.6667 9.99503 16.6667 9.99503 16.6667C12.6122 16.6965 15.2288 16.5657 17.83 16.275C18.2482 16.167 18.6319 15.9542 18.945 15.6567C19.2534 15.3625 19.4725 14.9967 19.5825 14.5984C19.8701 13.0892 20.0099 11.5555 20 10.0192C20.0217 8.47636 19.882 6.93549 19.5834 5.42169V5.42252ZM8.00169 12.8534V7.14752L13.2184 10.0009L8.00169 12.8534Z" fill="#673DE6"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_8754_23615">
|
||||
<rect width="20" height="20" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1 @@
|
||||
jQuery(document).on("ready",(function(){!function(){if(hostinger_easy_onboarding_global.ai_block_inject){var e=hostinger_easy_onboarding_global.ai_block_inject.user_id,o=localStorage.getItem("WP_DATA_USER_".concat(e));o||(o={"core/block-editor":{preferences:{insertUsage:{"hostinger-ai-plugin/block":{time:(new Date).getDate(),count:1}}}}},localStorage.setItem("WP_DATA_USER_".concat(e),JSON.stringify(o)))}}()}));
|
||||
@@ -0,0 +1,98 @@
|
||||
/*!
|
||||
* vue-router v4.5.0
|
||||
* (c) 2024 Eduardo San Martin Morote
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/*!
|
||||
* The buffer module from node.js, for the browser.
|
||||
*
|
||||
* @author Feross Aboukhadijeh <http://feross.org>
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/*!
|
||||
* XRegExp 5.1.1
|
||||
* <xregexp.com>
|
||||
* Steven Levithan (c) 2007-present MIT License
|
||||
*/
|
||||
|
||||
/*!
|
||||
* XRegExp Unicode Categories 5.1.1
|
||||
* <xregexp.com>
|
||||
* Steven Levithan (c) 2010-present MIT License
|
||||
* Unicode data by Mathias Bynens <mathiasbynens.be>
|
||||
*/
|
||||
|
||||
/*!
|
||||
* XRegExp Unicode Properties 5.1.1
|
||||
* <xregexp.com>
|
||||
* Steven Levithan (c) 2012-present MIT License
|
||||
* Unicode data by Mathias Bynens <mathiasbynens.be>
|
||||
*/
|
||||
|
||||
/*!
|
||||
* XRegExp Unicode Scripts 5.1.1
|
||||
* <xregexp.com>
|
||||
* Steven Levithan (c) 2010-present MIT License
|
||||
* Unicode data by Mathias Bynens <mathiasbynens.be>
|
||||
*/
|
||||
|
||||
/*!
|
||||
* pinia v2.3.0
|
||||
* (c) 2024 Eduardo San Martin Morote
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/*! #__NO_SIDE_EFFECTS__ */
|
||||
|
||||
/*! @name @videojs/http-streaming @version 3.16.2 @license Apache-2.0 */
|
||||
|
||||
/*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */
|
||||
|
||||
/*! @name m3u8-parser @version 7.2.0 @license Apache-2.0 */
|
||||
|
||||
/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
|
||||
|
||||
/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */
|
||||
|
||||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||||
|
||||
/*! js-cookie v3.0.5 | MIT */
|
||||
|
||||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Lodash <https://lodash.com/>
|
||||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||||
* Released under MIT license <https://lodash.com/license>
|
||||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license
|
||||
* slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
|
||||
* Copyright (c) 2014 David Björklund
|
||||
* Available under the MIT license
|
||||
* <https://github.com/kesla/parse-headers/blob/master/LICENCE>
|
||||
*/
|
||||
|
||||
/**
|
||||
* @vue/runtime-core v3.5.13
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
|
||||
/**
|
||||
* @vue/runtime-dom v3.5.13
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
|
||||
/**
|
||||
* @vue/shared v3.5.13
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
@@ -0,0 +1 @@
|
||||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
||||
@@ -0,0 +1 @@
|
||||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
||||
@@ -0,0 +1 @@
|
||||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[857],{4106:(e,t,a)=>{a.d(t,{A:()=>s});var n=a(6798),l=a.n(n)()((function(e){return e[1]}));l.push([e.id,".base-modal__title-container[data-v-1f1ef0be]{align-items:center;display:flex;justify-content:flex-start;margin-bottom:4px}.base-modal__title-container--centered[data-v-1f1ef0be]{justify-content:center}.base-modal__title[data-v-1f1ef0be]{color:var(--dark);font-size:20px;font-weight:700;margin:0}.base-modal__subtitle[data-v-1f1ef0be]{color:var(--gray);font-size:14px;margin-bottom:24px;margin-top:4px}.base-modal__subtitle--centered[data-v-1f1ef0be]{text-align:center}",""]);const s=l},5857:(e,t,a)=>{a.r(t),a.d(t,{default:()=>u});var n=a(9726),l={class:"base-modal"},s={key:1,class:"base-modal__title"};const o=(0,n.pM)({__name:"BaseModal",props:{title:{},subtitle:{},titleIcon:{},titleAlignment:{default:"left"}},setup:function(e){return function(e,t){var a=(0,n.g2)("HIcon");return(0,n.uX)(),(0,n.CE)("div",l,[(0,n.Lk)("span",{class:(0,n.C4)(["base-modal__title-container",{"base-modal__title-container--centered":"centered"===e.titleAlignment}])},[e.titleIcon?((0,n.uX)(),(0,n.Wv)(a,{key:0,class:"h-mr-8",name:e.titleIcon.name,color:e.titleIcon.color},null,8,["name","color"])):(0,n.Q3)("",!0),e.title?((0,n.uX)(),(0,n.CE)("h2",s,(0,n.v_)(e.title),1)):(0,n.Q3)("",!0)],2),e.subtitle?((0,n.uX)(),(0,n.CE)("p",{key:0,class:(0,n.C4)(["base-modal__subtitle",{"base-modal__subtitle--centered":"centered"===e.titleAlignment}])},(0,n.v_)(e.subtitle),3)):(0,n.Q3)("",!0),(0,n.RG)(e.$slots,"default")])}}});var i=a(100),r=a.n(i),c=a(4106),d={insert:"head",singleton:!1};r()(c.A,d);c.A.locals;const u=(0,a(6262).A)(o,[["__scopeId","data-v-1f1ef0be"]])}}]);
|
||||
@@ -0,0 +1 @@
|
||||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
||||
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "hostinger/hostinger-easy-onboarding",
|
||||
"minimum-stability": "dev",
|
||||
"repositories": [
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "git@github.com:hostinger/hostinger-wp-helper.git"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "git@github.com:hostinger/hostinger-wp-menu-manager.git"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "git@github.com:hostinger/hostinger-wp-surveys.git"
|
||||
},
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "git@github.com:hostinger/hostinger-wp-amplitude.git"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=8.0",
|
||||
"yahnis-elsts/plugin-update-checker": "^5.4",
|
||||
"hostinger/hostinger-wp-helper": "dev-main",
|
||||
"hostinger/hostinger-wp-menu-manager": "dev-main",
|
||||
"hostinger/hostinger-wp-surveys": "dev-main",
|
||||
"hostinger/hostinger-wp-amplitude": "dev-main"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Hostinger\\EasyOnboarding\\": "includes/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
},
|
||||
"require-dev": {
|
||||
"squizlabs/php_codesniffer": "^3.7",
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
|
||||
"phpcompatibility/phpcompatibility-wp": "*",
|
||||
"wp-coding-standards/wpcs": "^3.0"
|
||||
},
|
||||
"scripts": {
|
||||
},
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
"dealerdirect/phpcodesniffer-composer-installer": true
|
||||
},
|
||||
"platform-check": false
|
||||
}
|
||||
}
|
||||
843
Atomaste Reference/public_html/wp-content/plugins/hostinger-easy-onboarding/composer.lock
generated
Normal file
@@ -0,0 +1,843 @@
|
||||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "355c18229fe47c20ad676cad3dd03349",
|
||||
"packages": [
|
||||
{
|
||||
"name": "hostinger/hostinger-wp-amplitude",
|
||||
"version": "dev-main",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:hostinger/hostinger-wp-amplitude.git",
|
||||
"reference": "dca118cc19ab89523024ed071ebc344581859557"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/hostinger/hostinger-wp-amplitude/zipball/dca118cc19ab89523024ed071ebc344581859557",
|
||||
"reference": "dca118cc19ab89523024ed071ebc344581859557",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"hostinger/hostinger-wp-helper": "dev-main",
|
||||
"php": ">=8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9.6",
|
||||
"squizlabs/php_codesniffer": "^3.0"
|
||||
},
|
||||
"default-branch": true,
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Hostinger\\Amplitude\\": "src/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Hostinger\\Amplitude\\Tests\\": "tests/phpunit"
|
||||
}
|
||||
},
|
||||
"license": [
|
||||
"proprietary"
|
||||
],
|
||||
"description": "A PHP package with amplitude events for WordPress plugins",
|
||||
"support": {
|
||||
"source": "https://github.com/hostinger/hostinger-wp-amplitude/tree/main",
|
||||
"issues": "https://github.com/hostinger/hostinger-wp-amplitude/issues"
|
||||
},
|
||||
"time": "2024-12-12T09:23:58+00:00"
|
||||
},
|
||||
{
|
||||
"name": "hostinger/hostinger-wp-helper",
|
||||
"version": "dev-main",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:hostinger/hostinger-wp-helper.git",
|
||||
"reference": "cc2cc0fb4e27299459fe6a4402d618fcd7ef026e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/hostinger/hostinger-wp-helper/zipball/cc2cc0fb4e27299459fe6a4402d618fcd7ef026e",
|
||||
"reference": "cc2cc0fb4e27299459fe6a4402d618fcd7ef026e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"php": ">=8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9.6",
|
||||
"yoast/phpunit-polyfills": "^2.0"
|
||||
},
|
||||
"default-branch": true,
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Hostinger\\WpHelper\\": "src/",
|
||||
"Hostinger\\Tests\\": "tests/phpunit"
|
||||
}
|
||||
},
|
||||
"description": "A PHP package with core functions for Hostinger WordPress plugins.",
|
||||
"support": {
|
||||
"source": "https://github.com/hostinger/hostinger-wp-helper/tree/main",
|
||||
"issues": "https://github.com/hostinger/hostinger-wp-helper/issues"
|
||||
},
|
||||
"time": "2024-12-02T07:25:44+00:00"
|
||||
},
|
||||
{
|
||||
"name": "hostinger/hostinger-wp-menu-manager",
|
||||
"version": "dev-main",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:hostinger/hostinger-wp-menu-manager.git",
|
||||
"reference": "13ec41032a861dd8e7f388d99e1113e8dc982d6c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/hostinger/hostinger-wp-menu-manager/zipball/13ec41032a861dd8e7f388d99e1113e8dc982d6c",
|
||||
"reference": "13ec41032a861dd8e7f388d99e1113e8dc982d6c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"hostinger/hostinger-wp-helper": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9.6",
|
||||
"squizlabs/php_codesniffer": "^3.0",
|
||||
"yoast/phpunit-polyfills": "^2.0"
|
||||
},
|
||||
"default-branch": true,
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Hostinger\\WpMenuManager\\": "src/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Hostinger\\WpMenuManager\\Tests\\": "tests/phpunit"
|
||||
}
|
||||
},
|
||||
"license": [
|
||||
"proprietary"
|
||||
],
|
||||
"description": "Package for managing Hostinger WordPress menus and pages.",
|
||||
"support": {
|
||||
"source": "https://github.com/hostinger/hostinger-wp-menu-manager/tree/main",
|
||||
"issues": "https://github.com/hostinger/hostinger-wp-menu-manager/issues"
|
||||
},
|
||||
"time": "2025-01-08T10:39:58+00:00"
|
||||
},
|
||||
{
|
||||
"name": "hostinger/hostinger-wp-surveys",
|
||||
"version": "dev-main",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:hostinger/hostinger-wp-surveys.git",
|
||||
"reference": "1fa637dce2b35c15c34f75b30f97602410801554"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/hostinger/hostinger-wp-surveys/zipball/1fa637dce2b35c15c34f75b30f97602410801554",
|
||||
"reference": "1fa637dce2b35c15c34f75b30f97602410801554",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"hostinger/hostinger-wp-helper": "dev-main",
|
||||
"php": ">=8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"10up/wp_mock": "^1.0",
|
||||
"brain/monkey": "^2.6",
|
||||
"phpunit/phpunit": "^9.6",
|
||||
"squizlabs/php_codesniffer": "^3.0"
|
||||
},
|
||||
"default-branch": true,
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Hostinger\\Surveys\\": "src/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Hostinger\\Surveys\\Tests\\": "tests/phpunit"
|
||||
}
|
||||
},
|
||||
"license": [
|
||||
"proprietary"
|
||||
],
|
||||
"description": "A PHP package with surveys for WordPress plugins",
|
||||
"support": {
|
||||
"source": "https://github.com/hostinger/hostinger-wp-surveys/tree/main",
|
||||
"issues": "https://github.com/hostinger/hostinger-wp-surveys/issues"
|
||||
},
|
||||
"time": "2024-11-12T11:30:31+00:00"
|
||||
},
|
||||
{
|
||||
"name": "yahnis-elsts/plugin-update-checker",
|
||||
"version": "v5.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/YahnisElsts/plugin-update-checker.git",
|
||||
"reference": "845d65da93bcff31649ede00d9d73b1beadbb7f0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/YahnisElsts/plugin-update-checker/zipball/845d65da93bcff31649ede00d9d73b1beadbb7f0",
|
||||
"reference": "845d65da93bcff31649ede00d9d73b1beadbb7f0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"php": ">=5.6.20"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"load-v5p5.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Yahnis Elsts",
|
||||
"email": "whiteshadow@w-shadow.com",
|
||||
"homepage": "https://w-shadow.com/",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "A custom update checker for WordPress plugins and themes. Useful if you can't host your plugin in the official WP repository but still want it to support automatic updates.",
|
||||
"homepage": "https://github.com/YahnisElsts/plugin-update-checker/",
|
||||
"keywords": [
|
||||
"automatic updates",
|
||||
"plugin updates",
|
||||
"theme updates",
|
||||
"wordpress"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/YahnisElsts/plugin-update-checker/issues",
|
||||
"source": "https://github.com/YahnisElsts/plugin-update-checker/tree/v5.5"
|
||||
},
|
||||
"time": "2024-10-16T14:25:00+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
{
|
||||
"name": "dealerdirect/phpcodesniffer-composer-installer",
|
||||
"version": "v0.7.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git",
|
||||
"reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db",
|
||||
"reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"composer-plugin-api": "^1.0 || ^2.0",
|
||||
"php": ">=5.3",
|
||||
"squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"composer/composer": "*",
|
||||
"php-parallel-lint/php-parallel-lint": "^1.3.1",
|
||||
"phpcompatibility/php-compatibility": "^9.0"
|
||||
},
|
||||
"type": "composer-plugin",
|
||||
"extra": {
|
||||
"class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Franck Nijhof",
|
||||
"email": "franck.nijhof@dealerdirect.com",
|
||||
"homepage": "http://www.frenck.nl",
|
||||
"role": "Developer / IT Manager"
|
||||
},
|
||||
{
|
||||
"name": "Contributors",
|
||||
"homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors"
|
||||
}
|
||||
],
|
||||
"description": "PHP_CodeSniffer Standards Composer Installer Plugin",
|
||||
"homepage": "http://www.dealerdirect.com",
|
||||
"keywords": [
|
||||
"PHPCodeSniffer",
|
||||
"PHP_CodeSniffer",
|
||||
"code quality",
|
||||
"codesniffer",
|
||||
"composer",
|
||||
"installer",
|
||||
"phpcbf",
|
||||
"phpcs",
|
||||
"plugin",
|
||||
"qa",
|
||||
"quality",
|
||||
"standard",
|
||||
"standards",
|
||||
"style guide",
|
||||
"stylecheck",
|
||||
"tests"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues",
|
||||
"source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer"
|
||||
},
|
||||
"time": "2022-02-04T12:51:07+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpcompatibility/php-compatibility",
|
||||
"version": "9.3.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHPCompatibility/PHPCompatibility.git",
|
||||
"reference": "9fb324479acf6f39452e0655d2429cc0d3914243"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243",
|
||||
"reference": "9fb324479acf6f39452e0655d2429cc0d3914243",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"squizlabs/php_codesniffer": "^2.3 || ^3.0.2"
|
||||
},
|
||||
"conflict": {
|
||||
"squizlabs/php_codesniffer": "2.6.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0"
|
||||
},
|
||||
"suggest": {
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.",
|
||||
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
|
||||
},
|
||||
"type": "phpcodesniffer-standard",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL-3.0-or-later"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Wim Godden",
|
||||
"homepage": "https://github.com/wimg",
|
||||
"role": "lead"
|
||||
},
|
||||
{
|
||||
"name": "Juliette Reinders Folmer",
|
||||
"homepage": "https://github.com/jrfnl",
|
||||
"role": "lead"
|
||||
},
|
||||
{
|
||||
"name": "Contributors",
|
||||
"homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors"
|
||||
}
|
||||
],
|
||||
"description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.",
|
||||
"homepage": "http://techblog.wimgodden.be/tag/codesniffer/",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"phpcs",
|
||||
"standards"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues",
|
||||
"source": "https://github.com/PHPCompatibility/PHPCompatibility"
|
||||
},
|
||||
"time": "2019-12-27T09:44:58+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpcompatibility/phpcompatibility-paragonie",
|
||||
"version": "1.3.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git",
|
||||
"reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/293975b465e0e709b571cbf0c957c6c0a7b9a2ac",
|
||||
"reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"phpcompatibility/php-compatibility": "^9.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
|
||||
"paragonie/random_compat": "dev-master",
|
||||
"paragonie/sodium_compat": "dev-master"
|
||||
},
|
||||
"suggest": {
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
|
||||
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
|
||||
},
|
||||
"type": "phpcodesniffer-standard",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL-3.0-or-later"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Wim Godden",
|
||||
"role": "lead"
|
||||
},
|
||||
{
|
||||
"name": "Juliette Reinders Folmer",
|
||||
"role": "lead"
|
||||
}
|
||||
],
|
||||
"description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.",
|
||||
"homepage": "http://phpcompatibility.com/",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"paragonie",
|
||||
"phpcs",
|
||||
"polyfill",
|
||||
"standards",
|
||||
"static analysis"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues",
|
||||
"security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy",
|
||||
"source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/PHPCompatibility",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/jrfnl",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://opencollective.com/php_codesniffer",
|
||||
"type": "open_collective"
|
||||
}
|
||||
],
|
||||
"time": "2024-04-24T21:30:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpcompatibility/phpcompatibility-wp",
|
||||
"version": "dev-master",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git",
|
||||
"reference": "fd4181347ee2b93e6e581acb48f8c271b763a738"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/fd4181347ee2b93e6e581acb48f8c271b763a738",
|
||||
"reference": "fd4181347ee2b93e6e581acb48f8c271b763a738",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"phpcompatibility/php-compatibility": "^9.0",
|
||||
"phpcompatibility/phpcompatibility-paragonie": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^1.0"
|
||||
},
|
||||
"suggest": {
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
|
||||
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
|
||||
},
|
||||
"default-branch": true,
|
||||
"type": "phpcodesniffer-standard",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL-3.0-or-later"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Wim Godden",
|
||||
"role": "lead"
|
||||
},
|
||||
{
|
||||
"name": "Juliette Reinders Folmer",
|
||||
"role": "lead"
|
||||
}
|
||||
],
|
||||
"description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.",
|
||||
"homepage": "http://phpcompatibility.com/",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"phpcs",
|
||||
"standards",
|
||||
"static analysis",
|
||||
"wordpress"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues",
|
||||
"security": "https://github.com/PHPCompatibility/PHPCompatibilityWP/security/policy",
|
||||
"source": "https://github.com/PHPCompatibility/PHPCompatibilityWP"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/PHPCompatibility",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/jrfnl",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://opencollective.com/php_codesniffer",
|
||||
"type": "open_collective"
|
||||
}
|
||||
],
|
||||
"time": "2024-10-16T19:34:28+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpcsstandards/phpcsextra",
|
||||
"version": "dev-develop",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHPCSStandards/PHPCSExtra.git",
|
||||
"reference": "31ef149a1ee85ec0d355e58418d78d927e89d185"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/31ef149a1ee85ec0d355e58418d78d927e89d185",
|
||||
"reference": "31ef149a1ee85ec0d355e58418d78d927e89d185",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.4",
|
||||
"phpcsstandards/phpcsutils": "^1.0.9",
|
||||
"squizlabs/php_codesniffer": "^3.8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"php-parallel-lint/php-console-highlighter": "^1.0",
|
||||
"php-parallel-lint/php-parallel-lint": "^1.3.2",
|
||||
"phpcsstandards/phpcsdevcs": "^1.1.6",
|
||||
"phpcsstandards/phpcsdevtools": "^1.2.1",
|
||||
"phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0"
|
||||
},
|
||||
"default-branch": true,
|
||||
"type": "phpcodesniffer-standard",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-stable": "1.x-dev",
|
||||
"dev-develop": "1.x-dev"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL-3.0-or-later"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Juliette Reinders Folmer",
|
||||
"homepage": "https://github.com/jrfnl",
|
||||
"role": "lead"
|
||||
},
|
||||
{
|
||||
"name": "Contributors",
|
||||
"homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors"
|
||||
}
|
||||
],
|
||||
"description": "A collection of sniffs and standards for use with PHP_CodeSniffer.",
|
||||
"keywords": [
|
||||
"PHP_CodeSniffer",
|
||||
"phpcbf",
|
||||
"phpcodesniffer-standard",
|
||||
"phpcs",
|
||||
"standards",
|
||||
"static analysis"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues",
|
||||
"security": "https://github.com/PHPCSStandards/PHPCSExtra/security/policy",
|
||||
"source": "https://github.com/PHPCSStandards/PHPCSExtra"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/PHPCSStandards",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/jrfnl",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://opencollective.com/php_codesniffer",
|
||||
"type": "open_collective"
|
||||
}
|
||||
],
|
||||
"time": "2024-11-11T18:03:33+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpcsstandards/phpcsutils",
|
||||
"version": "dev-develop",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHPCSStandards/PHPCSUtils.git",
|
||||
"reference": "33dd7776e8a78ddaad1500899ad8c536a7764d4a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/33dd7776e8a78ddaad1500899ad8c536a7764d4a",
|
||||
"reference": "33dd7776e8a78ddaad1500899ad8c536a7764d4a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0",
|
||||
"php": ">=5.4",
|
||||
"squizlabs/php_codesniffer": "^3.10.1 || 4.0.x-dev@dev"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-filter": "*",
|
||||
"php-parallel-lint/php-console-highlighter": "^1.0",
|
||||
"php-parallel-lint/php-parallel-lint": "^1.3.2",
|
||||
"phpcsstandards/phpcsdevcs": "^1.1.6",
|
||||
"yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0 || ^3.0.0"
|
||||
},
|
||||
"default-branch": true,
|
||||
"type": "phpcodesniffer-standard",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-stable": "1.x-dev",
|
||||
"dev-develop": "1.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"PHPCSUtils/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL-3.0-or-later"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Juliette Reinders Folmer",
|
||||
"homepage": "https://github.com/jrfnl",
|
||||
"role": "lead"
|
||||
},
|
||||
{
|
||||
"name": "Contributors",
|
||||
"homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors"
|
||||
}
|
||||
],
|
||||
"description": "A suite of utility functions for use with PHP_CodeSniffer",
|
||||
"homepage": "https://phpcsutils.com/",
|
||||
"keywords": [
|
||||
"PHP_CodeSniffer",
|
||||
"phpcbf",
|
||||
"phpcodesniffer-standard",
|
||||
"phpcs",
|
||||
"phpcs3",
|
||||
"standards",
|
||||
"static analysis",
|
||||
"tokens",
|
||||
"utility"
|
||||
],
|
||||
"support": {
|
||||
"docs": "https://phpcsutils.com/",
|
||||
"issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues",
|
||||
"security": "https://github.com/PHPCSStandards/PHPCSUtils/security/policy",
|
||||
"source": "https://github.com/PHPCSStandards/PHPCSUtils"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/PHPCSStandards",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/jrfnl",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://opencollective.com/php_codesniffer",
|
||||
"type": "open_collective"
|
||||
}
|
||||
],
|
||||
"time": "2024-12-12T07:44:32+00:00"
|
||||
},
|
||||
{
|
||||
"name": "squizlabs/php_codesniffer",
|
||||
"version": "dev-master",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
|
||||
"reference": "b43e1d8e8c73dcfafdc07db8cbefd066444f4a23"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/b43e1d8e8c73dcfafdc07db8cbefd066444f4a23",
|
||||
"reference": "b43e1d8e8c73dcfafdc07db8cbefd066444f4a23",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-simplexml": "*",
|
||||
"ext-tokenizer": "*",
|
||||
"ext-xmlwriter": "*",
|
||||
"php": ">=5.4.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4"
|
||||
},
|
||||
"default-branch": true,
|
||||
"bin": [
|
||||
"bin/phpcbf",
|
||||
"bin/phpcs"
|
||||
],
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.x-dev"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Greg Sherwood",
|
||||
"role": "Former lead"
|
||||
},
|
||||
{
|
||||
"name": "Juliette Reinders Folmer",
|
||||
"role": "Current lead"
|
||||
},
|
||||
{
|
||||
"name": "Contributors",
|
||||
"homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors"
|
||||
}
|
||||
],
|
||||
"description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
|
||||
"homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer",
|
||||
"keywords": [
|
||||
"phpcs",
|
||||
"standards",
|
||||
"static analysis"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues",
|
||||
"security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy",
|
||||
"source": "https://github.com/PHPCSStandards/PHP_CodeSniffer",
|
||||
"wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/PHPCSStandards",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/jrfnl",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://opencollective.com/php_codesniffer",
|
||||
"type": "open_collective"
|
||||
}
|
||||
],
|
||||
"time": "2025-01-01T02:52:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "wp-coding-standards/wpcs",
|
||||
"version": "3.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/WordPress/WordPress-Coding-Standards.git",
|
||||
"reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/9333efcbff231f10dfd9c56bb7b65818b4733ca7",
|
||||
"reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-filter": "*",
|
||||
"ext-libxml": "*",
|
||||
"ext-tokenizer": "*",
|
||||
"ext-xmlreader": "*",
|
||||
"php": ">=5.4",
|
||||
"phpcsstandards/phpcsextra": "^1.2.1",
|
||||
"phpcsstandards/phpcsutils": "^1.0.10",
|
||||
"squizlabs/php_codesniffer": "^3.9.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"php-parallel-lint/php-console-highlighter": "^1.0.0",
|
||||
"php-parallel-lint/php-parallel-lint": "^1.3.2",
|
||||
"phpcompatibility/php-compatibility": "^9.0",
|
||||
"phpcsstandards/phpcsdevtools": "^1.2.0",
|
||||
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-iconv": "For improved results",
|
||||
"ext-mbstring": "For improved results"
|
||||
},
|
||||
"type": "phpcodesniffer-standard",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Contributors",
|
||||
"homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors"
|
||||
}
|
||||
],
|
||||
"description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions",
|
||||
"keywords": [
|
||||
"phpcs",
|
||||
"standards",
|
||||
"static analysis",
|
||||
"wordpress"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues",
|
||||
"source": "https://github.com/WordPress/WordPress-Coding-Standards",
|
||||
"wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://opencollective.com/php_codesniffer",
|
||||
"type": "custom"
|
||||
}
|
||||
],
|
||||
"time": "2024-03-25T16:39:00+00:00"
|
||||
}
|
||||
],
|
||||
"aliases": [],
|
||||
"minimum-stability": "dev",
|
||||
"stability-flags": {
|
||||
"hostinger/hostinger-wp-amplitude": 20,
|
||||
"hostinger/hostinger-wp-helper": 20,
|
||||
"hostinger/hostinger-wp-menu-manager": 20,
|
||||
"hostinger/hostinger-wp-surveys": 20
|
||||
},
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
"php": ">=8.0"
|
||||
},
|
||||
"platform-dev": {},
|
||||
"plugin-api-version": "2.6.0"
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
# This file is for unifying the coding style for different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
# WordPress Coding Standards
|
||||
# https://make.wordpress.org/core/handbook/coding-standards/
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
indent_style = tab
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react-dom', 'react-jsx-runtime', 'regenerator-runtime', 'wp-components', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins'), 'version' => 'd11a3b8fef94acf5b7cc');
|
||||
@@ -0,0 +1 @@
|
||||
button.components-button.has-icon.is-secondary svg{margin-left:6px}.preview-page-button,.store-setup-button{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border:1px solid #ccc;border-radius:3px}.preview-page-button .components-button,.store-setup-button .components-button{background-color:#fff;border:none;-webkit-box-shadow:none;box-shadow:none;color:#2f2f2f}.preview-page-button .components-button:hover,.store-setup-button .components-button:hover{background-color:#f9f9f9;-webkit-box-shadow:none!important;box-shadow:none!important;color:#2f2f2f}.preview-page-button svg,.store-setup-button svg{color:transparent;height:18px;margin-left:5px;width:18px}@media(max-width:510px){.editor-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;gap:16px;height:auto}.editor-header__toolbar{clip-path:none;padding-top:15px}.editor-header__center,.editor-header__settings,.editor-header__toolbar{grid-column:auto;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.editor-header__settings{-ms-flex-wrap:wrap;flex-wrap:wrap;padding:0 15px 15px}.editor-header:has(>.editor-header__center){grid-template:none}.editor-header__center>:first-child{-webkit-margin-start:0;margin-inline-start:0}.editor-header__center>:last-child{-webkit-margin-end:0;margin-inline-end:0}.editor-header__toolbar .table-of-contents{display:block}}.editor-header__settings a:has(svg path[d="M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"]){display:none!important}
|
||||
@@ -0,0 +1 @@
|
||||
button.components-button.has-icon.is-secondary svg{margin-right:6px}.preview-page-button,.store-setup-button{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border:1px solid #ccc;border-radius:3px}.preview-page-button .components-button,.store-setup-button .components-button{background-color:#fff;border:none;-webkit-box-shadow:none;box-shadow:none;color:#2f2f2f}.preview-page-button .components-button:hover,.store-setup-button .components-button:hover{background-color:#f9f9f9;-webkit-box-shadow:none!important;box-shadow:none!important;color:#2f2f2f}.preview-page-button svg,.store-setup-button svg{color:transparent;height:18px;margin-right:5px;width:18px}@media(max-width:510px){.editor-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;gap:16px;height:auto}.editor-header__toolbar{clip-path:none;padding-top:15px}.editor-header__center,.editor-header__settings,.editor-header__toolbar{grid-column:auto;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.editor-header__settings{-ms-flex-wrap:wrap;flex-wrap:wrap;padding:0 15px 15px}.editor-header:has(>.editor-header__center){grid-template:none}.editor-header__center>:first-child{-webkit-margin-start:0;margin-inline-start:0}.editor-header__center>:last-child{-webkit-margin-end:0;margin-inline-end:0}.editor-header__toolbar .table-of-contents{display:block}}.editor-header__settings a:has(svg path[d="M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"]){display:none!important}
|
||||
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin Name: Hostinger Easy Onboarding
|
||||
* Plugin URI: https://hostinger.com
|
||||
* Description: Hostinger Easy Onboarding WordPress plugin.
|
||||
* Version: 2.0.53
|
||||
* Requires at least: 5.5
|
||||
* Requires PHP: 8.0
|
||||
* Author: Hostinger
|
||||
* License: GPL v3
|
||||
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
||||
* Author URI: https://www.hostinger.com
|
||||
* Text Domain: hostinger-easy-onboarding
|
||||
* Domain Path: /languages
|
||||
*
|
||||
* @package Hostinger Easy Onboarding
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
if (! defined('HOSTINGER_EASY_ONBOARDING_VERSION')) {
|
||||
define('HOSTINGER_EASY_ONBOARDING_VERSION', '2.0.53');
|
||||
}
|
||||
|
||||
if ( ! defined( 'HOSTINGER_EASY_ONBOARDING_ABSPATH' ) ) {
|
||||
define( 'HOSTINGER_EASY_ONBOARDING_ABSPATH', plugin_dir_path( __FILE__ ) );
|
||||
}
|
||||
|
||||
if ( ! defined( 'HOSTINGER_EASY_ONBOARDING_PLUGIN_FILE' ) ) {
|
||||
define( 'HOSTINGER_EASY_ONBOARDING_PLUGIN_FILE', __FILE__ );
|
||||
}
|
||||
|
||||
if ( ! defined( 'HOSTINGER_EASY_ONBOARDING_PLUGIN_URL' ) ) {
|
||||
define( 'HOSTINGER_EASY_ONBOARDING_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
||||
}
|
||||
|
||||
if ( ! defined( 'HOSTINGER_EASY_ONBOARDING_ASSETS_URL' ) ) {
|
||||
define( 'HOSTINGER_EASY_ONBOARDING_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' );
|
||||
}
|
||||
|
||||
if (! defined('HOSTINGER_EASY_ONBOARDING_GUTENBERG_URL')) {
|
||||
define('HOSTINGER_EASY_ONBOARDING_GUTENBERG_URL', plugin_dir_url(__FILE__) . 'gutenberg');
|
||||
}
|
||||
|
||||
if ( ! defined( 'HOSTINGER_EASY_ONBOARDING_WP_CONFIG_PATH' ) ) {
|
||||
define( 'HOSTINGER_EASY_ONBOARDING_WP_CONFIG_PATH', ABSPATH . '.private/config.json' );
|
||||
}
|
||||
|
||||
if ( ! defined( 'HOSTINGER_EASY_ONBOARDING_WP_TOKEN' ) ) {
|
||||
$hostinger_dir_parts = explode( '/', __DIR__ );
|
||||
$hostinger_server_root_path = '/' . $hostinger_dir_parts[1] . '/' . $hostinger_dir_parts[2];
|
||||
define( 'HOSTINGER_EASY_ONBOARDING_WP_TOKEN', $hostinger_server_root_path . '/.api_token' );
|
||||
}
|
||||
|
||||
if ( ! defined( 'HOSTINGER_EASY_ONBOARDING_REST_URI' ) ) {
|
||||
define( 'HOSTINGER_EASY_ONBOARDING_REST_URI', 'https://rest-hosting.hostinger.com' );
|
||||
}
|
||||
|
||||
if ( ! defined( 'HOSTINGER_EASY_ONBOARDING_REST_API_BASE' ) ) {
|
||||
define( 'HOSTINGER_EASY_ONBOARDING_REST_API_BASE', 'hostinger-easy-onboarding/v1' );
|
||||
}
|
||||
|
||||
if ( ! defined( 'HOSTINGER_EASY_ONBOARDING_MINIMUM_PHP_VERSION' ) ) {
|
||||
define( 'HOSTINGER_EASY_ONBOARDING_MINIMUM_PHP_VERSION', '8.0' );
|
||||
}
|
||||
|
||||
if ( ! version_compare( phpversion(), HOSTINGER_EASY_ONBOARDING_MINIMUM_PHP_VERSION, '>=' ) ) {
|
||||
|
||||
add_action( 'admin_notices', function () {
|
||||
?>
|
||||
<div class="notice notice-error is-dismissible hts-theme-settings">
|
||||
<p>
|
||||
<?php /* translators: %s php version */ ?>
|
||||
<strong><?php echo __( 'Attention:', 'hostinger-easy-onboarding' ); ?></strong> <?php echo sprintf( __( 'The Hostinger Easy Onboarding plugin requires minimum PHP version of <b>%s</b>. ', 'hostinger-easy-onboarding' ), HOSTINGER_EASY_ONBOARDING_MINIMUM_PHP_VERSION ); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php /* translators: %s php version */ ?>
|
||||
<?php echo sprintf( __( 'You are running <b>%s</b> PHP version.', 'hostinger-easy-onboarding' ), phpversion() ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
);
|
||||
|
||||
add_action( 'admin_head', function () { ?>
|
||||
<style>
|
||||
.notice.notice-error {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.notice.notice-error.hts-theme-settings {
|
||||
display: block !important;
|
||||
}
|
||||
</style>
|
||||
<?php } );
|
||||
|
||||
} else {
|
||||
require_once __DIR__ . '/loader.php';
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\EasyOnboarding;
|
||||
|
||||
use Hostinger\EasyOnboarding\Admin\Onboarding\WelcomeCards;
|
||||
use Hostinger\EasyOnboarding\DefaultOptions;
|
||||
use Hostinger\WpHelper\Utils;
|
||||
use Hostinger\EasyOnboarding\WooCommerce\Options as WooCommerceOptions;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
class Activator {
|
||||
|
||||
public static function activate(): void {
|
||||
$options = new DefaultOptions();
|
||||
$options->add_options();
|
||||
|
||||
self::update_installation_state_on_activation();
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves installation state.
|
||||
*/
|
||||
public static function update_installation_state_on_activation(): void {
|
||||
$installation_state = get_option( 'hts_new_installation', false );
|
||||
|
||||
if ( $installation_state !== 'old' ) {
|
||||
add_option( 'hts_new_installation', 'new' );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\EasyOnboarding\Admin;
|
||||
|
||||
use Hostinger\EasyOnboarding\Admin\Onboarding\Onboarding;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
class Actions {
|
||||
public const AI_STEP = 'ai_step';
|
||||
public const STORE_TASKS = 'store_tasks';
|
||||
public const SETUP_STORE = 'setup_store';
|
||||
public const ADD_PRODUCT = 'add_product';
|
||||
public const ADD_PAYMENT = 'add_payment_method';
|
||||
public const ADD_SHIPPING = 'add_shipping_method';
|
||||
public const DOMAIN_IS_CONNECTED = 'connect_domain';
|
||||
|
||||
public const AMAZON_AFFILIATE = 'amazon_affiliate';
|
||||
|
||||
public const GOOGLE_KIT = 'google_kit';
|
||||
public const ACTIONS_LIST = array(
|
||||
self::DOMAIN_IS_CONNECTED,
|
||||
);
|
||||
|
||||
public const STORE_ACTIONS_LIST = array(
|
||||
self::SETUP_STORE,
|
||||
self::ADD_PRODUCT,
|
||||
self::ADD_PAYMENT,
|
||||
self::ADD_SHIPPING
|
||||
);
|
||||
|
||||
public static function get_category_action_lists(): array {
|
||||
return array(
|
||||
Onboarding::HOSTINGER_EASY_ONBOARDING_WEBSITE_STEP_CATEGORY_ID => self::get_action_list(),
|
||||
Onboarding::HOSTINGER_EASY_ONBOARDING_STORE_STEP_CATEGORY_ID => self::get_store_action_list()
|
||||
);
|
||||
}
|
||||
|
||||
public static function get_action_list(): array {
|
||||
$list = self::ACTIONS_LIST;
|
||||
|
||||
if ( ! empty( Onboarding::get_first_step_data() ) ) {
|
||||
$list[] = self::AI_STEP;
|
||||
}
|
||||
|
||||
if ( is_plugin_active( 'hostinger-affiliate-plugin/hostinger-affiliate-plugin.php' ) ) {
|
||||
$list[] = self::AMAZON_AFFILIATE;
|
||||
}
|
||||
|
||||
if( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
|
||||
$list[] = self::STORE_TASKS;
|
||||
}
|
||||
|
||||
$list[] = self::GOOGLE_KIT;
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
public static function get_store_action_list(): array {
|
||||
return self::STORE_ACTIONS_LIST;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\EasyOnboarding\Admin;
|
||||
|
||||
use Hostinger\EasyOnboarding\Admin\Onboarding\Onboarding;
|
||||
use Hostinger\EasyOnboarding\Admin\Actions as Admin_Actions;
|
||||
use Hostinger\EasyOnboarding\Admin\Hooks as Admin_Hooks;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
class Ajax {
|
||||
public function __construct() {
|
||||
add_action( 'init', array( $this, 'define_ajax_events' ), 0 );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function define_ajax_events(): void {
|
||||
$events = array(
|
||||
'identify_action',
|
||||
);
|
||||
|
||||
foreach ( $events as $event ) {
|
||||
add_action( 'wp_ajax_hostinger_' . $event, array( $this, $event ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function identify_action(): void {
|
||||
$nonce = isset( $_POST['nonce'] ) ? sanitize_text_field( $_POST['nonce'] ) : '';
|
||||
$security_check = $this->request_security_check( $nonce );
|
||||
|
||||
if ( ! empty( $security_check ) ) {
|
||||
wp_send_json_error( $security_check );
|
||||
}
|
||||
|
||||
$action = sanitize_text_field( $_POST['action_name'] ) ?? '';
|
||||
|
||||
if ( in_array( $action, Admin_Actions::ACTIONS_LIST, true ) ) {
|
||||
setcookie( $action, $action, time() + ( 86400 ), '/' );
|
||||
wp_send_json_success( $action );
|
||||
} else {
|
||||
wp_send_json_error( 'Invalid action' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $nonce
|
||||
*
|
||||
* @return false|string
|
||||
*/
|
||||
public function request_security_check( $nonce ) {
|
||||
if ( ! wp_verify_nonce( $nonce, 'hts-ajax-nonce' ) ) {
|
||||
return 'Invalid nonce';
|
||||
}
|
||||
|
||||
if ( ! current_user_can( 'manage_options' ) ) {
|
||||
return 'Lack of permissions';
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,429 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\EasyOnboarding\Admin;
|
||||
|
||||
use Hostinger\Admin\Menu;
|
||||
use Hostinger\EasyOnboarding\Helper;
|
||||
use Hostinger\EasyOnboarding\Rest\StepRoutes;
|
||||
use Hostinger\WpHelper\Utils;
|
||||
use Hostinger\WpMenuManager\Menus;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Class Hostinger_Admin_Assets
|
||||
*
|
||||
* Handles the enqueueing of styles and scripts for the Hostinger admin pages.
|
||||
*/
|
||||
class Assets {
|
||||
/**
|
||||
* @var Helper Instance of the Hostinger_Helper class.
|
||||
*/
|
||||
private Helper $helper;
|
||||
|
||||
/**
|
||||
* @var Utils
|
||||
*/
|
||||
private Utils $utils;
|
||||
|
||||
public function __construct() {
|
||||
$this->helper = new Helper();
|
||||
$this->utils = new Utils();
|
||||
|
||||
add_action('admin_enqueue_scripts', array($this, 'admin_styles'));
|
||||
add_action('admin_enqueue_scripts', array($this, 'admin_scripts'));
|
||||
add_action('enqueue_block_editor_assets', array($this, 'gutenberg_edit_pages'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueues styles for the Hostinger admin pages.
|
||||
*/
|
||||
public function admin_styles(): void {
|
||||
if ( $this->utils->isThisPage( 'wp-admin/admin.php?page=hostinger-get-onboarding' ) || $this->utils->isThisPage( 'wp-admin/admin.php?page=' . Menus::MENU_SLUG ) ) {
|
||||
wp_enqueue_style( 'hostinger_easy_onboarding_main_styles', HOSTINGER_EASY_ONBOARDING_ASSETS_URL . '/css/main.min.css', array(), HOSTINGER_EASY_ONBOARDING_VERSION );
|
||||
|
||||
$hide_notices = '.notice { display: none !important; }';
|
||||
wp_add_inline_style('hostinger_easy_onboarding_main_styles', $hide_notices);
|
||||
}
|
||||
|
||||
wp_enqueue_style( 'hostinger_easy_onboarding_global_styles', HOSTINGER_EASY_ONBOARDING_ASSETS_URL . '/css/global.min.css', array(), HOSTINGER_EASY_ONBOARDING_VERSION );
|
||||
|
||||
if ( $this->helper->is_preview_domain() && is_user_logged_in() ) {
|
||||
wp_enqueue_style( 'hostinger_easy_onboarding_preview_styles', HOSTINGER_EASY_ONBOARDING_ASSETS_URL . '/css/hts-preview.min.css', array(), HOSTINGER_EASY_ONBOARDING_VERSION );
|
||||
}
|
||||
|
||||
if( is_plugin_active( 'wpforms/wpforms.php' ) ) {
|
||||
$hide_wp_forms_counter = '.wp-admin #wpadminbar .wpforms-menu-notification-counter { display: none !important; }';
|
||||
wp_add_inline_style( 'hostinger_easy_onboarding_global_styles', $hide_wp_forms_counter );
|
||||
}
|
||||
if( is_plugin_active( 'googleanalytics/googleanalytics.php' ) ) {
|
||||
$hide_wp_forms_notification = '.wp-admin .monsterinsights-menu-notification-indicator { display: none !important; }';
|
||||
wp_add_inline_style( 'hostinger_easy_onboarding_global_styles', $hide_wp_forms_notification );
|
||||
}
|
||||
|
||||
if( is_plugin_active( 'woocommerce/woocommerce.php' ) && !is_plugin_active( 'woocommerce-payments/woocommerce-payments.php' ) ) {
|
||||
$hide_woo_payments_menu = '.wp-admin #toplevel_page_wc-admin-path--payments-connect, .wp-admin #toplevel_page_wc-admin-path--wc-pay-welcome-page { display: none !important; }';
|
||||
wp_add_inline_style( 'hostinger_easy_onboarding_global_styles', $hide_woo_payments_menu );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueues scripts for the Hostinger admin pages.
|
||||
*/
|
||||
public function admin_scripts(): void {
|
||||
if ( $this->utils->isThisPage( 'wp-admin/admin.php?page=hostinger-get-onboarding' ) || $this->utils->isThisPage( 'wp-admin/admin.php?page=' . Menus::MENU_SLUG ) ) {
|
||||
wp_enqueue_script(
|
||||
'hostinger_easy_onboarding_main_scripts',
|
||||
HOSTINGER_EASY_ONBOARDING_ASSETS_URL . '/js/main.min.js',
|
||||
array(
|
||||
'jquery',
|
||||
'wp-i18n',
|
||||
),
|
||||
HOSTINGER_EASY_ONBOARDING_VERSION,
|
||||
false
|
||||
);
|
||||
|
||||
$all_plugins = get_plugins();
|
||||
|
||||
$edit_site_url = admin_url( 'edit.php?post_type=page' );
|
||||
|
||||
$front_page_id = get_option('page_on_front');
|
||||
|
||||
if ( wp_is_block_theme() ) {
|
||||
|
||||
$edit_site_url = admin_url( 'site-editor.php' );
|
||||
|
||||
} else {
|
||||
|
||||
if ( ! empty($front_page_id)) {
|
||||
$query_args = [
|
||||
'post' => $front_page_id,
|
||||
'action' => 'edit',
|
||||
];
|
||||
|
||||
$edit_site_url = add_query_arg($query_args, admin_url('post.php'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$localize_data = array(
|
||||
'promotional_link' => $this->helper->get_promotional_link_url( get_locale() ),
|
||||
'completed_steps' => get_option( 'hostinger_onboarding_steps', array() ),
|
||||
'list_visibility' => get_option( StepRoutes::LIST_VISIBILITY_OPTION, 1 ),
|
||||
'site_url' => get_site_url(),
|
||||
'edit_site_url' => $edit_site_url,
|
||||
'plugin_url' => HOSTINGER_EASY_ONBOARDING_PLUGIN_URL,
|
||||
'admin_url' => admin_url('admin-ajax.php'),
|
||||
'user_locale' => get_user_locale(),
|
||||
'plugin_assets_url' => HOSTINGER_EASY_ONBOARDING_ASSETS_URL,
|
||||
'plugin_url' => $this->helper->getHostingerPluginUrl(),
|
||||
'translations' => array(
|
||||
'hostinger_easy_onboarding_black_friday_not_interested' => __( 'Not interested', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_black_friday_get_deal' => __( 'Get deal', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_black_friday_you_will_love_these_deals' => __( 'You’ll love these great deals that were handpicked just for you.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_biggest_cyber_monday_sale' => __( 'The biggest ever <span style="color: #8C85FF">Cyber Monday</span> sale!', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_biggest_black_friday_sale' => __( 'The biggest ever <span style="color: #8C85FF">Black Friday</span> sale!', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_the_biggest_every_white_friday_sale' => __( 'The biggest ever <span style="color: #8C85FF">White Friday</span> sale!', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_the_biggest_ever_amazing_friday_sale' => __( 'The biggest ever <span style="color: #8C85FF">Amazing Friday</span> sale!', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_the_biggest_ever_blessed_friday_sale' => __( 'The biggest ever <span style="color: #8C85FF">Blessed Friday</span> sale!', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_the_biggest_ever_end_of_the_year_sale' => __( 'The biggest ever <span style="color: #8C85FF">End of the year</span> sale!', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_online_store_setup' => __( 'Online store setup', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_preview_website' => __( 'Preview website', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_continue' => __( 'Continue', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_market_your_business' => __( 'Market your business', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_manage_shipping' => __( 'Manage shipping', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_run_email_marketing_campaigns' => __( 'Run email marketing campaigns', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_run_email_marketing_campaigns_description' => __( 'Expand your audience with the help of Omnisend. Create email campaigns that drive sales.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_ship_products_with_ease' => __( 'Ship products with ease', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_shipping_methods' => __( 'Shipping methods', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_try_omnisend' => __( 'Try Omnisend', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_your_store_name' => __( 'Your store name', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_your_business_email' => __( 'Your business email', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_where_is_your_store' => __( 'Where is your store located?', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_what_products_what_do_you_sell' => __( 'What type of products or services will you sell?', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_ship_products_with_ease_description' => __( 'Choose the ways you\'d like to ship orders to customers. You can always add others later.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_getting_features_ready' => __( 'Getting your features ready', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_your_progress' => __( 'Your progress', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_store_info' => __( 'Setup my online store', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_set_up_a_payment_method' => __( 'Set up a payment method', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_set_up_payment_method' => __( 'Set up payment method', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_set_up_a_payment_method_description' => __( 'Get ready to accept customer payments. Let them pay for your products and services with ease.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_add_first_product' => __( 'Add your first product', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_add_first_product_or_service' => __( 'Add your first product or service', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_add_first_product_or_service_description' => __( 'Sell products, services, and digital downloads. Set up and customize each item to fit your business needs.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_setup_google_site_kit' => __( 'Setup Google Site Kit', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_setup_google_site_kit_description' => __( 'Increase your sites visibility by enabling its discoverability in the Google search engine.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_start_earning' => __( 'Start earning', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_connect_your_domain_to_hostinger' => __( 'Connect your domain to Hostinger', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_wait_for_domain_propagation' => __( 'Wait for domain propagation', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_nameserver' => __( 'Nameserver', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_connect_your_domain_to_hostinger' => __( 'Connect your domain to Hostinger', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_connect_your_domain_description_step_one' => __( 'You can connect a domain to Hostinger by changing the nameservers. Different domain providers are have unique procedures for changing nameservers. Here are Hostinger\'s nameservers:', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_connect_your_domain_description_step_two' => __( ' Learn how to connect your domain to Hostinger by watching this tutorial on YouTube for a step-by-step guide:', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_how_to_point_domain_nameservers' => __( 'How to Point Domain Name to Web Hosting', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_play_on_youtube' => __( 'Play on YouTube', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_share_your_referral_link' => __( 'Share your referral link with friends and family and <strong>receive 20% commission</strong> for every successful referral.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_invite_friend' => __( 'Invite a Friend, Earn Up to $100', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_website_setup' => __( 'Website setup', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_create_a_logo_description' => __( 'Adding a logo is a great way to personalize a website or add branding information. You can use your existing logo or create a new one using the <a href="https://logo.hostinger.com/?ref=wordpress-onboarding" style="text-decoration:none; font-weight:bold; color:#673de6">AI Logo Maker.</a>', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_upload_your_logo' => __( 'Upload your logo', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_welcome_to_wordpress_title' => __( '👋 Welcome to WordPress', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_website_url' => __( 'Website URL', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_get_domain_description_step_one' => __( 'Your website is already published and can be accessed using Hostinger free temporary subdomain right now. Here is the current URL of your website:', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_get_domain_description_step_two' => __( 'You need to purchase a domain for your website before the preview domain becomes inaccessible. Find a desired website name using a <a style="text-decoration:none; font-weight:bold; color:#673de6" target="_blank" href="https://hpanel.hostinger.com/domains/domain-checker" >domain name searcher.</a >', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_go_to_customize_page_description' => __( 'In the left sidebar, click Appearance to expand the menu. In the Appearance section, click Customize. The Customize page will open.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_edit_post_description' => __( 'Edit post description', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_upload_an_image' => __( 'Upload an image', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_edit_site_title' => __( 'Edit site title', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_cancel' => __( 'Cancel', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_add_a_new_page' => __( 'Add a new page', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_connect_your_domain' => __( 'Connect your domain', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_create_a_logo_title' => __( 'Create a logo', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_go_to_customize_page_title' => __( 'Go to the Customize page', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_upload_your_logo_title' => __( 'Upload your logo', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_upload_your_logo_description' => __( 'In the left sidebar, click Site Identity, then click on the Select Site Icon button. Here, you can upload your brand logo.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_take_me_there' => __( 'Take me there', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_get_started' => __( 'Get started!', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_skip' => __( 'Skip', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_setup_my_online_store' => __( 'Setup my online store', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_setup_my_online_store_description' => __( 'Enter your store details so we can help you set up your online store faster.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_your progress' => __( 'Your progress', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_complete' => __( 'Complete', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_website_setup' => __( 'Website setup', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_congrats_all_completed' => __( 'Congrats, you’re ready to show off your site!', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_customize_your_sites' => __( 'Customize the way your site looks and start welcoming visitors.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_setup_website' => __( 'Setup website', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_online_store_almost_there' => __( '<strong>Almost there!</strong> Just a few more steps to get your site ready for online success.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_completed_steps' => __( 'Completed steps', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_onboarding' => __( 'Onboarding', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_show_list' => __( 'Show list', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_tutorials' => __( 'Tutorials', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_knowledge_base' => __( 'Knowledge Base', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_hide_list' => __( 'Hide list', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_edit_site' => __( 'Edit site', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_dismiss' => __( 'Dismiss', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_finish_setting_up_plugins' => __( 'Now <strong>finish setting up</strong> the plugins you’ve installed.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_view_plugins' => __( 'View plugins', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_done_setting_up_online_store' => __( 'You’re done setting up your online store!', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_view_completed' => __( 'View completed', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_hide_completed' => __( 'Hide completed', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_connect_domain_now' => __( 'Connect domain now', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_got_it' => __( 'Got it!', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_go_to_posts_title' => __( 'Go to Posts', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_go_to_posts_description' => __( 'In the left sidebar, find the Posts button. Click on the All Posts button and find the post for which you want to change the description.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_edit_post_title' => __( 'Edit post', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_edit_post_description' => __( 'Hover over the chosen post to see the options menu. Click on the Edit button to open the post editor.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_edit_description_title' => __( 'Edit description', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_edit_description_description' => __( 'You can see the whole post in the editor. Find the description part and change it to your preferences.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_find_the_media_page_title' => __( 'Find the Media page', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_find_the_media_page_description' => __( 'In the left sidebar, find the Media button. Click on the Library button to see all the images you have uploaded to your website.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_upload_an_image_title' => __( 'Upload an image', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_upload_an_image_description' => __( 'To upload a new image, click on Add New button on the Media Library page and select files.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_edit_an_image_title' => __( 'Edit an image', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_edit_an_image_description' => __( 'If you wish to edit the image, click on the chosen image and click the Edit Image button. You can now crop, rotate, flip or scale the selected image.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_go_to_the_customize_page_title' => __( 'Go to the Customize page', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_go_to_the_customize_page_description' => __( 'In the left sidebar, click Appearance to expand the menu. In the Appearance section, click Customize. The Customize page will open.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_access_site_identity_and_edit_title_title' => __( 'Access site identity and edit title', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_access_site_identity_and_edit_title_description' => __( 'In the left sidebar, click Site Identity and edit your site title.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_add_a_new_page_title' => __( 'Add a new page', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_add_plugin' => __( 'Add plugin', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_plugin_added' => __( 'Added', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_plugin_configure' => __( 'Configure', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_connect' => __( 'Connect', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_dismiss' => __( 'Dismiss', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_generate_content' => __( 'Generate content', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_plugin_installed' => __( 'Installed', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_generate_content_with_ai' => __( 'Generate content with AI', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_generate_content_with_ai_description' => __( 'Get images, text, and SEO keywords created for you instantly – try <strong>AI Content Creator</strong>.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_run_amazon_affiliate_site' => __( 'Run an Amazon Affiliate site', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_run_amazon_affiliate_site_description' => __( 'Connect your <strong>Amazon Associate</strong> account to fetch API details.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_plugin_activate' => __( 'Activate', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_add_a_new_page_description' => __( 'In the left sidebar, find the Pages menu and click on Add New button. You will see the WordPress page editor. Each paragraph, image, or video in the WordPress editor is presented as a “block” of content.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_add_title_title' => __( 'Add a title', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_back' => __( 'Back', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboaring_payment_plugins' => __( 'Payment plugins', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboaring_shipping_plugins' => __( 'Shipping plugins', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_payment_settings' => __( 'Payment settings', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_set_up_payments' => __( 'Set up payments', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_recommended_for_you' => __( 'Recommended for you', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_other' => __( 'Other', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_shipping_settings' => __( 'Shipping settings', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_add_shipping_method' => __( 'Add shipping method', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_add_shipping_without_additional_plugins' => __( 'You can also set up a shipping method without installing additional plugins.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_or_use_payment_plugins' => __( 'Or use payment plugins', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_or_use_shipping_plugins' => __( 'Or use shipping plugins', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_use_built_in_shipping_methods' => __( '<strong>Use built-in shipping methods</strong> - no extra plugins needed.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_use_built_in_payment_methods' => __( '<strong>Use built-in payment methods</strong> - no extra plugins needed.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_add_title_description' => __( 'Add the title of the page, for example, About. Click the Add Title text to open the text box where you will add your title. The title of your page should be descriptive of the information the page will have.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_add_content_title' => __( 'Add content', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_add_content_description' => __( 'Content can be anything you wish, for example, text, images, videos, tables, and lots more. Click on a plus sign and choose any block you want to add to the page.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_publish_the_page_title' => __( 'Publish the page', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_set_up_site_kit' => __( 'Set up Site Kit', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_set_up_shipping' => __( 'Set up shipping', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_continue_setup' => __( 'Continue setup', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_yes_skip_step' => __( 'Yes, skip step', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_google_site_kit_not_needed' => __( 'Google Site Kit is an essential plugin that makes sure that potential visitors can find your site on Google.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_are_you_sure' => __( 'Are you sure?', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_connect_domain_first' => __( 'Connect your domain first', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_publish_the_page_description' => __( 'Before publishing, you can preview your created page by clicking on the Preview button. If you are happy with the result, click the Publish button.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_get_a_domain_title' => __( 'Get a domain', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_how_to_build_effective_landing_page' => __( 'How to Build an EFFECTIVE Landing Page with WordPress (2024)', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_connect_your_domain_to_hostinger_title' => __( 'Connect your domain to Hostinger', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_how_to_make_website' => __( 'How to Make a Website (2024): Simple, Quick, & Easy Tutorial', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_wait_for_domain_propagation_description' => __( 'Domain propagation can take up to 24 hours. Your domain will propagate automatically, and you don\'t need to take any action during this time.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_how_to_create_wordpress_contact_us_page' => __( 'How to Create a WordPress Contact Us Page', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_i_bought_domain_now_what' => __( 'I Bought a Domain, Now What?', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_how_to_create_coming_soon_page' => __( 'How to Create Your Coming Soon Page in WordPress (2024)', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_how_to_get_maximum_wordpress_optimization' => __( 'LiteSpeed Cache: How to Get 100% WordPress Optimization', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_how_to_backup_wordpress_site' => __( 'How to Back Up a WordPress Site', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_how_to_import_images_to_wordpress_website' => __( 'How to Import Images Into WordPress Website', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_how_to_setup_wordpress_smtp' => __( 'How to Set Up WordPress SMTP', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_knowledge_base' => __( 'Knowledge Base', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_find_answers_in_knowledge_base' => __( 'Find the answers you need in our Knowledge Base', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_help_center' => __( 'Help Center', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_wordpress_tutorials' => __( 'WordPress tutorials', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_learn_wordpress' => __( 'Learn WordPress', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_hostinger_academy' => __( 'Hostinger Academy', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_setup_page_confirmation_text' => __( 'Opt-in to receive tips, discounts, and recommendations from the WooCommerce team directly in your inbox.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_tell_us_about_your_business' => __( 'Tell us a bit about your business', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_tell_us_about_your_business_description' => __( 'We\'ll use this information to help you set up your store faster.', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_get_in_touch_with_live_specialists' => __( 'Get in touch with our live specialists', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_welcome_to_wordpress' => __( 'Welcome to WordPress!', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_follow_steps_complete_setup' => __( 'Follow these steps to complete your setup', 'hostinger-easy-onboarding' ),
|
||||
'hostinger_easy_onboarding_this_field_is_required' => __( 'This field is required', 'hostinger-easy-onboarding' ),
|
||||
|
||||
),
|
||||
'rest_base_url' => esc_url_raw( rest_url() ),
|
||||
'nonce' => wp_create_nonce( 'wp_rest' ),
|
||||
'ajax_nonce' => wp_create_nonce( 'updates' ),
|
||||
'google_site_kit_state' => array(
|
||||
'is_installed' => array_key_exists( 'google-site-kit/google-site-kit.php', $all_plugins),
|
||||
'is_active' => is_plugin_active( 'google-site-kit/google-site-kit.php' ),
|
||||
),
|
||||
);
|
||||
|
||||
if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
|
||||
|
||||
$localize_data['woo'] = array(
|
||||
'store_email' => get_bloginfo( 'admin_email' ),
|
||||
'type_of_products' => array(
|
||||
array(
|
||||
'name' => 'clothing_and_accessories',
|
||||
'label' => __('Clothing and accessories', 'woocommerce')
|
||||
),
|
||||
array(
|
||||
'name' => 'health_and_beauty',
|
||||
'label' => __('Health and beauty', 'woocommerce')
|
||||
),
|
||||
array(
|
||||
'name' => 'food_and_drink',
|
||||
'label' => __('Food and drink', 'woocommerce')
|
||||
),
|
||||
array(
|
||||
'name' => 'home_furniture_and_garden',
|
||||
'label' => __('Home, furniture and garden', 'woocommerce')
|
||||
),
|
||||
array(
|
||||
'name' => 'education_and_learning',
|
||||
'label' => __('Education and learning', 'woocommerce')
|
||||
),
|
||||
array(
|
||||
'name' => 'electronics_and_computers',
|
||||
'label' => __('Electronics and computers', 'woocommerce')
|
||||
),
|
||||
array(
|
||||
'name' => 'other',
|
||||
'label' => __('Other', 'woocommerce')
|
||||
),
|
||||
),
|
||||
'store_countries' => $this->get_countries_and_states()
|
||||
);
|
||||
}
|
||||
|
||||
wp_localize_script(
|
||||
'hostinger_easy_onboarding_main_scripts',
|
||||
'hostinger_easy_onboarding',
|
||||
$localize_data
|
||||
);
|
||||
}
|
||||
|
||||
wp_enqueue_script(
|
||||
'hostinger_easy_onboarding_global_scripts',
|
||||
HOSTINGER_EASY_ONBOARDING_ASSETS_URL . '/js/global-scripts.min.js',
|
||||
array(
|
||||
'jquery',
|
||||
'wp-i18n',
|
||||
),
|
||||
HOSTINGER_EASY_ONBOARDING_VERSION,
|
||||
false
|
||||
);
|
||||
|
||||
$global_data = array(
|
||||
'rest_base_url' => esc_url_raw( rest_url() ),
|
||||
'nonce' => wp_create_nonce( 'wp_rest' ),
|
||||
'hostinger_nonce' => wp_create_nonce( 'hts-ajax-nonce' ),
|
||||
'is_onboarding_completed' => $this->helper->is_website_onboarding_completed() ? 'true' : 'false',
|
||||
'onboarding_page_url' => admin_url( 'admin.php?page=hostinger-get-onboarding' )
|
||||
);
|
||||
|
||||
if ( is_plugin_active( 'hostinger-ai-assistant/hostinger-ai-assistant.php' ) ) {
|
||||
$global_data['ai_block_inject'] = [
|
||||
'user_id' => get_current_user_id()
|
||||
];
|
||||
}
|
||||
|
||||
wp_localize_script(
|
||||
'hostinger_easy_onboarding_global_scripts',
|
||||
'hostinger_easy_onboarding_global',
|
||||
$global_data
|
||||
);
|
||||
}
|
||||
|
||||
public function gutenberg_edit_pages(): void
|
||||
{
|
||||
// Automatically load imported dependencies and assets version.
|
||||
$asset_file = include HOSTINGER_EASY_ONBOARDING_ABSPATH . 'gutenberg/edit-pages-panel/build/index.asset.php';
|
||||
|
||||
// Enqueue CSS dependencies.
|
||||
foreach ($asset_file['dependencies'] as $style) {
|
||||
wp_enqueue_style($style);
|
||||
}
|
||||
|
||||
wp_enqueue_script(
|
||||
'gutenberg_edit_pages_panel',
|
||||
HOSTINGER_EASY_ONBOARDING_GUTENBERG_URL . '/edit-pages-panel/build/index.js',
|
||||
$asset_file['dependencies'],
|
||||
$asset_file['version'],
|
||||
false
|
||||
);
|
||||
|
||||
wp_enqueue_style(
|
||||
'gutenberg_edit_pages_panel',
|
||||
HOSTINGER_EASY_ONBOARDING_GUTENBERG_URL . '/edit-pages-panel/build/style-index.css',
|
||||
array(),
|
||||
$asset_file['version']
|
||||
);
|
||||
}
|
||||
|
||||
private function get_countries_and_states()
|
||||
{
|
||||
$countries = WC()->countries->get_countries();
|
||||
if ( ! $countries ) {
|
||||
return array();
|
||||
}
|
||||
$output = array();
|
||||
foreach ( $countries as $key => $value ) {
|
||||
$states = WC()->countries->get_states( $key );
|
||||
|
||||
if ( $states ) {
|
||||
foreach ( $states as $state_key => $state_value ) {
|
||||
$output[ $key . ':' . $state_key ] = $value . ' - ' . $state_value;
|
||||
}
|
||||
} else {
|
||||
$output[ $key ] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,681 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\EasyOnboarding\Admin;
|
||||
|
||||
use Hostinger\EasyOnboarding\Admin\Actions as Admin_Actions;
|
||||
use Hostinger\EasyOnboarding\Admin\Onboarding\Onboarding;
|
||||
use Hostinger\EasyOnboarding\AmplitudeEvents\Actions as AmplitudeActions;
|
||||
use Hostinger\EasyOnboarding\AmplitudeEvents\Amplitude;
|
||||
use Hostinger\EasyOnboarding\Helper;
|
||||
use Hostinger\EasyOnboarding\WooCommerce\GatewayManager;
|
||||
use Hostinger\EasyOnboarding\WooCommerce\Options as WooCommerceOptions;
|
||||
use Hostinger\WpHelper\Utils;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
|
||||
class Hooks
|
||||
{
|
||||
public const WOOCOMMERCE_PAGES = [
|
||||
'admin.php?page=wc-admin',
|
||||
'edit.php?post_type=shop_order',
|
||||
'admin.php?page=wc-admin&path=/customers',
|
||||
'edit.php?post_type=shop_coupon&legacy_coupon_menu=1',
|
||||
'admin.php?page=wc-admin&path=/marketing',
|
||||
'admin.php?page=wc-reports',
|
||||
'admin.php?page=wc-settings',
|
||||
'admin.php?page=wc-status',
|
||||
'admin.php?page=wc-admin&path=/extensions',
|
||||
'edit.php?post_type=product',
|
||||
'post-new.php?post_type=product',
|
||||
'edit.php?post_type=product&page=product-reviews',
|
||||
'edit.php?post_type=product&page=product_attributes',
|
||||
'edit-tags.php?taxonomy=product_cat&post_type=product',
|
||||
'edit-tags.php?taxonomy=product_tag&post_type=product',
|
||||
'admin.php?page=wc-admin&path=/analytics/overview',
|
||||
'admin.php?page=wc-admin',
|
||||
'admin.php?page=wc-orders',
|
||||
];
|
||||
|
||||
public const COMPLETED_REMINDER_VISIBLE_PAGES = [
|
||||
'admin.php?page=googlesitekit-splash',
|
||||
'admin.php?page=googlesitekit-dashboard'
|
||||
];
|
||||
|
||||
public const COMPLETED_REMINDER_OPTION_NAME = 'hostinger_setup_completed';
|
||||
|
||||
public const WOOPAYMENTS_REMINDER_OPTION_NAME = 'hostinger_woopayments_completed';
|
||||
|
||||
public const WOO_ONBOARDING_NOTICE_TRANS = 'hostinger_return_to_onboarding';
|
||||
/**
|
||||
* @var Onboarding
|
||||
*/
|
||||
private Onboarding $onboarding;
|
||||
|
||||
private Helper $helper;
|
||||
|
||||
public const DAY_IN_SECONDS = 86400;
|
||||
|
||||
public function __construct() {
|
||||
$this->helper = new Helper();
|
||||
$this->onboarding = new Onboarding();
|
||||
|
||||
add_action( 'admin_init', array( $this, 'init_onboarding' ), 0 );
|
||||
|
||||
// Admin footer actions
|
||||
add_action( 'admin_footer', array( $this, 'rate_plugin' ) );
|
||||
|
||||
// Admin init actions
|
||||
add_action( 'admin_init', array( $this, 'admin_init_actions' ) );
|
||||
add_action( 'admin_init', array( $this, 'set_woocommerce_options' ), 0 );
|
||||
|
||||
// Admin notices
|
||||
add_action( 'admin_notices', array( $this, 'omnisend_discount_notice' ) );
|
||||
|
||||
// Return back to onboarding.
|
||||
add_action( 'admin_footer', array( $this, 'back_to_onboarding_notice' ) );
|
||||
add_filter( 'admin_body_class', array( $this, 'add_onboarding_notice_class' ) );
|
||||
|
||||
// Admin Styles
|
||||
add_action( 'admin_head', array( $this, 'hide_notices' ) );
|
||||
|
||||
// WooCommerce filters
|
||||
add_filter( 'woocommerce_prevent_automatic_wizard_redirect', function () {
|
||||
return true;
|
||||
}, 999 );
|
||||
add_filter( 'woocommerce_enable_setup_wizard', function () {
|
||||
return false;
|
||||
}, 999 );
|
||||
|
||||
// Spectra
|
||||
add_filter( 'uagb_enable_redirect_activation', function () {
|
||||
return false;
|
||||
}, 999 );
|
||||
|
||||
// Hooking up one action before and removing astra redirect to onboarding
|
||||
if ( function_exists( 'astra_sites_redirect_to_onboarding' ) ) {
|
||||
add_action('admin_menu', function () {
|
||||
remove_action('admin_init', 'astra_sites_redirect_to_onboarding');
|
||||
});
|
||||
}
|
||||
|
||||
add_filter('get_edit_post_link', [$this, 'change_shop_page_edit_url'], 99, 3);
|
||||
|
||||
add_action( 'admin_menu', array( $this, 'disable_beaver_builder_redirect' ) );
|
||||
|
||||
add_action( 'admin_menu', array( $this, 'disable_monsterinsights_redirect' ) );
|
||||
|
||||
if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
|
||||
add_action('updated_option', [$this, 'check_if_payment_gateway_enabled'], 20, 3);
|
||||
}
|
||||
}
|
||||
|
||||
public function init_onboarding() {
|
||||
$this->onboarding->init();
|
||||
}
|
||||
|
||||
public function hide_notices() {
|
||||
$helper = new Helper();
|
||||
?>
|
||||
<style>
|
||||
|
||||
<?php
|
||||
|
||||
if ( is_plugin_active( 'ultimate-addons-for-gutenberg/ultimate-addons-for-gutenberg.php' ) || is_plugin_active( 'astra-sites/astra-sites.php' ) ) {
|
||||
?>
|
||||
.interface-interface-skeleton .editor-header__settings button[aria-controls="zip-ai-page-level-settings:zip-ai-page-settings-panel"] {
|
||||
display: none !important;
|
||||
}
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
<?php if ( ! $helper->is_woocommerce_onboarding_completed() ) : ?>
|
||||
.post-php.post-type-product #wpadminbar .wpforms-menu-notification-counter,
|
||||
.post-php.post-type-product #wpadminbar .aioseo-menu-notification-counter,
|
||||
.post-php.post-type-product .woocommerce-layout__header-tasks-reminder-bar,
|
||||
.post-php.post-type-product .litespeed_icon.notice.is-dismissible,
|
||||
.post-php.post-type-product .monsterinsights-menu-notification-indicator,
|
||||
.post-php.post-type-product .aioseo-review-plugin-cta,
|
||||
.post-php.post-type-product .omnisend-connection-notice-hidden,
|
||||
.post-php.post-type-product #astra-upgrade-pro-wc {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.notice.hts-notice {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $this->is_woocommerce_admin_page() && ! $helper->is_woocommerce_onboarding_completed() ) : ?>
|
||||
#wpadminbar .wpforms-menu-notification-counter,
|
||||
#wpadminbar .aioseo-menu-notification-counter,
|
||||
.woocommerce-layout__header-tasks-reminder-bar,
|
||||
.litespeed_icon.notice.is-dismissible,
|
||||
.monsterinsights-menu-notification-indicator,
|
||||
.aioseo-review-plugin-cta,
|
||||
.omnisend-connection-notice-hidden,
|
||||
#astra-upgrade-pro-wc,
|
||||
.notice {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.notice.hts-notice {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
<?php endif; ?>
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
|
||||
public function admin_init_actions(): void {
|
||||
$this->hide_astra_builder_selection_screen();
|
||||
$this->hide_metaboxes();
|
||||
$this->hide_monsterinsight_notice();
|
||||
$this->check_plugins_and_remove_duplicates();
|
||||
}
|
||||
public function check_plugins_and_remove_duplicates() {
|
||||
// Check if the script has already run
|
||||
if (get_option('hostinger_woocommerce_pages_cleanup_done')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if Astra Sites and WooCommerce are activated
|
||||
if (is_plugin_active('astra-sites/astra-sites.php') && is_plugin_active('woocommerce/woocommerce.php')) {
|
||||
// List of pages to check
|
||||
$page_slugs = array("shop", "cart", "checkout", "my-account");
|
||||
$astra_page_slugs = array("shop-2", "cart-2", "checkout-2", "my-account-2");
|
||||
$pages_to_remove = array();
|
||||
$pages_to_rename = array();
|
||||
|
||||
$query = new \WP_Query(array(
|
||||
'post_type' => 'page',
|
||||
'post_status' => 'publish',
|
||||
'post_name__in' => array_merge($page_slugs, $astra_page_slugs),
|
||||
'posts_per_page' => -1
|
||||
));
|
||||
|
||||
if ($query->have_posts()) {
|
||||
$pages = $query->posts;
|
||||
$page_ids = array();
|
||||
|
||||
foreach ($pages as $page) {
|
||||
$page_ids[$page->post_name] = $page->ID;
|
||||
}
|
||||
|
||||
foreach ($page_slugs as $index => $slug) {
|
||||
$astra_slug = $astra_page_slugs[$index];
|
||||
if (isset($page_ids[$slug]) && isset($page_ids[$astra_slug])) {
|
||||
$pages_to_remove[] = $page_ids[$slug];
|
||||
$pages_to_rename[$astra_slug] = $page_ids[$astra_slug];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Reset post data after query
|
||||
wp_reset_postdata();
|
||||
|
||||
// Assign the 'shop-2', 'cart-2', 'checkout-2' pages as WooCommerce pages
|
||||
foreach ($pages_to_rename as $astra_slug => $page_id) {
|
||||
switch ($astra_slug) {
|
||||
case 'shop-2':
|
||||
update_option('woocommerce_shop_page_id', $page_id);
|
||||
break;
|
||||
case 'cart-2':
|
||||
update_option('woocommerce_cart_page_id', $page_id);
|
||||
break;
|
||||
case 'checkout-2':
|
||||
update_option('woocommerce_checkout_page_id', $page_id);
|
||||
break;
|
||||
case 'my-account-2':
|
||||
update_option('woocommerce_my_account_page_id', $page_id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove the original 'shop', 'cart', 'checkout' pages
|
||||
foreach ($pages_to_remove as $page_id) {
|
||||
wp_delete_post($page_id, true);
|
||||
}
|
||||
|
||||
// Rename 'shop-2', 'cart-2', 'checkout-2' to 'shop', 'cart', 'checkout'
|
||||
foreach ($pages_to_rename as $astra_slug => $page_id) {
|
||||
$new_slug = str_replace('-2', '', $astra_slug);
|
||||
$new_title = $new_slug == 'my-account' ? 'My Account' : ucfirst($new_slug);
|
||||
wp_update_post(array(
|
||||
'ID' => $page_id,
|
||||
'post_name' => $new_slug,
|
||||
'post_title' => $new_title
|
||||
));
|
||||
}
|
||||
|
||||
// Set the option to indicate the script has run
|
||||
update_option('hostinger_woocommerce_pages_cleanup_done', 1);
|
||||
}
|
||||
}
|
||||
|
||||
public function hide_metaboxes(): void {
|
||||
$this->hide_plugin_metabox( 'google-analytics-for-wordpress/googleanalytics.php', 'monsterinsights-metabox', 'metaboxhidden_product' );
|
||||
$this->hide_plugin_metabox( 'all-in-one-seo-pack/all_in_one_seo_pack.php', 'aioseo-settings', 'aioseo-settings' );
|
||||
$this->hide_plugin_metabox( 'litespeed-cache/litespeed-cache.php', 'litespeed_meta_boxes', 'litespeed_meta_boxes' );
|
||||
$this->hide_astra_theme_metabox();
|
||||
$this->hide_custom_fields_metabox();
|
||||
|
||||
// Hide panels in Gutenberg editor
|
||||
$this->hide_plugin_panel('all-in-one-seo-pack/all_in_one_seo_pack.php', 'meta-box-aioseo-settings');
|
||||
}
|
||||
|
||||
public function hide_astra_theme_metabox(): void {
|
||||
if ( ! $this->is_astra_theme_active() ) {
|
||||
return;
|
||||
}
|
||||
$this->hide_metabox( 'astra_settings_meta_box', 'astra_metabox' );
|
||||
}
|
||||
|
||||
public function hide_custom_fields_metabox(): void {
|
||||
$this->hide_metabox( 'postcustom', 'custom_fields_metabox' );
|
||||
}
|
||||
|
||||
public function hide_metabox( string $metabox_id, string $transient_suffix ): void {
|
||||
$helper = new Utils();
|
||||
$user_id = get_current_user_id();
|
||||
$transient_key = $transient_suffix . '_' . $user_id;
|
||||
$hide_metabox = get_transient( $transient_key );
|
||||
|
||||
if ( $hide_metabox ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$hide_metabox = get_user_meta( $user_id, 'metaboxhidden_product', true );
|
||||
|
||||
if ( ! is_array( $hide_metabox ) ) {
|
||||
$hide_metabox = array();
|
||||
}
|
||||
|
||||
if ( $helper->isThisPage( 'post-new.php?post_type=product' ) ) {
|
||||
if ( ! in_array( $metabox_id, $hide_metabox ) ) {
|
||||
array_push( $hide_metabox, $metabox_id );
|
||||
}
|
||||
|
||||
update_user_meta( $user_id, 'metaboxhidden_product', $hide_metabox );
|
||||
set_transient( $transient_key, 'hidden', self::DAY_IN_SECONDS );
|
||||
}
|
||||
}
|
||||
|
||||
public function is_astra_theme_active(): bool {
|
||||
$theme = wp_get_theme();
|
||||
|
||||
return $theme->get( 'Name' ) === 'Astra';
|
||||
}
|
||||
|
||||
public function hide_monsterinsight_notice(): void {
|
||||
if ( is_plugin_active( 'google-analytics-for-wordpress/googleanalytics.php' ) ) {
|
||||
define( 'MONSTERINSIGHTS_DISABLE_TRACKING', true );
|
||||
}
|
||||
}
|
||||
|
||||
public function rate_plugin(): void {
|
||||
$promotional_banner_hidden = get_transient( 'hts_hide_promotional_banner_transient' );
|
||||
$two_hours_in_seconds = 7200;
|
||||
|
||||
if ( $promotional_banner_hidden && time() > $promotional_banner_hidden + $two_hours_in_seconds ) {
|
||||
require_once HOSTINGER_EASY_ONBOARDING_ABSPATH . 'includes/Admin/Views/Partials/RateUs.php';
|
||||
}
|
||||
}
|
||||
|
||||
public function omnisend_discount_notice(): void {
|
||||
$omnisend_notice_hidden = get_transient( 'hts_omnisend_notice_hidden' );
|
||||
|
||||
if ( $omnisend_notice_hidden === false && $this->helper->is_this_page( '/wp-admin/admin.php?page=omnisend' ) && ( Helper::is_plugin_active( 'class-omnisend-core-bootstrap' ) || Helper::is_plugin_active( 'omnisend-woocommerce' ) ) ) : ?>
|
||||
<div class="notice notice-info hts-admin-notice hts-omnisend">
|
||||
<p><?php echo wp_kses( __( 'Use the special discount code <b>ONLYHOSTINGER30</b> to get 30% off on Omnisend for 6 months when you upgrade.', 'hostinger-easy-onboarding' ), array( 'b' => array() ) ); ?></p>
|
||||
<div>
|
||||
<a class="button button-primary"
|
||||
href="https://your.omnisend.com/LXqyZ0"
|
||||
target="_blank"><?= esc_html__( 'Get Discount', 'hostinger-easy-onboarding' ); ?></a>
|
||||
<button type="button" class="notice-dismiss"></button>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;
|
||||
wp_nonce_field( 'hts_close_omnisend', 'hts_close_omnisend_nonce', true );
|
||||
}
|
||||
|
||||
public function hide_astra_builder_selection_screen(): void {
|
||||
add_filter( 'st_enable_block_page_builder', '__return_true' );
|
||||
}
|
||||
|
||||
public function hide_plugin_metabox( string $plugin_slug, string $metabox_id, string $transient_suffix ): void {
|
||||
$helper = new Utils();
|
||||
$user_id = get_current_user_id();
|
||||
$transient_key = $transient_suffix . '_' . $user_id;
|
||||
$hide_metabox = get_transient( $transient_key );
|
||||
|
||||
if ( $hide_metabox ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$hide_metabox = get_user_meta( $user_id, 'metaboxhidden_product', true );
|
||||
|
||||
if ( ! is_plugin_active( $plugin_slug ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! is_array( $hide_metabox ) ) {
|
||||
$hide_metabox = array();
|
||||
}
|
||||
|
||||
if ( $helper->isThisPage( 'post-new.php?post_type=product' ) ) {
|
||||
if ( ! in_array( $metabox_id, $hide_metabox ) ) {
|
||||
array_push( $hide_metabox, $metabox_id );
|
||||
}
|
||||
|
||||
update_user_meta( $user_id, 'metaboxhidden_product', $hide_metabox );
|
||||
set_transient( $transient_key, 'hidden', self::DAY_IN_SECONDS );
|
||||
}
|
||||
}
|
||||
|
||||
public function hide_plugin_panel( string $plugin_slug, $panel_id ) {
|
||||
if ( ! is_plugin_active( $plugin_slug ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$user_id = get_current_user_id();
|
||||
$flag_name = 'hostinger_' . $panel_id . '_changed';
|
||||
|
||||
$hidden_once = get_user_meta( $user_id, $flag_name, true );
|
||||
|
||||
if( $hidden_once ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$persisted_preferences = get_user_meta( $user_id, 'wp_persisted_preferences', true );
|
||||
|
||||
if ( empty( $persisted_preferences ) ) {
|
||||
$persisted_preferences = array(
|
||||
'core/edit-post' => array(
|
||||
'welcomeGuide' => '',
|
||||
'isComplementaryAreaVisible' => 1,
|
||||
'inactivePanels' => array(
|
||||
$panel_id
|
||||
)
|
||||
),
|
||||
'core/edit-site' => array(
|
||||
'welcomeGuide' => '',
|
||||
'isComplementaryAreaVisible' => 1
|
||||
),
|
||||
'_modified' => wp_date( 'c' ),
|
||||
);
|
||||
} else {
|
||||
if( !empty( $persisted_preferences['core/edit-post']['inactivePanels'] ) && !in_array( $panel_id, $persisted_preferences['core/edit-post']['inactivePanels'] ) ) {
|
||||
$persisted_preferences['core/edit-post']['inactivePanels'][] = $panel_id;
|
||||
}
|
||||
}
|
||||
|
||||
update_user_meta( $user_id, 'wp_persisted_preferences', $persisted_preferences );
|
||||
update_user_meta( $user_id, $flag_name, 1 );
|
||||
}
|
||||
|
||||
private function is_completed_reminder_page(): bool
|
||||
{
|
||||
if ( ! isset($_SERVER['REQUEST_URI'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$current_uri = sanitize_text_field($_SERVER['REQUEST_URI']);
|
||||
|
||||
if (defined('DOING_AJAX') && \DOING_AJAX) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($current_uri) && strpos($current_uri, '/wp-json/') !== false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (self::COMPLETED_REMINDER_VISIBLE_PAGES as $page) {
|
||||
if (strpos($current_uri, $page) !== false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function is_woocommerce_admin_page(): bool
|
||||
{
|
||||
// Product edit etc.
|
||||
if (get_post_type() === 'product') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( ! isset($_SERVER['REQUEST_URI'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$current_uri = sanitize_text_field($_SERVER['REQUEST_URI']);
|
||||
|
||||
if (defined('DOING_AJAX') && \DOING_AJAX) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($current_uri) && strpos($current_uri, '/wp-json/') !== false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($current_uri) && (strpos($current_uri, 'paymentsonboarding') !== false || strpos($current_uri, '/payments/onboarding') !== false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (self::WOOCOMMERCE_PAGES as $page) {
|
||||
if (strpos($current_uri, $page) !== false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function back_to_onboarding_notice(): void
|
||||
{
|
||||
$text = __('Just a few more steps to launch your online store', 'hostinger-easy-onboarding');
|
||||
$button_url = admin_url('admin.php?page=hostinger-get-onboarding&subPage=woo-commerce-online-store-setup');
|
||||
$button_class = '';
|
||||
$button_text = __('Continue setup', 'hostinger-easy-onboarding');
|
||||
|
||||
if ( $this->is_onboarding_complete_reminder_visible() ) {
|
||||
$text = __('Congrats, you’re ready to show off your site!', 'hostinger-easy-onboarding');
|
||||
$button_url = admin_url('admin.php?page=hostinger-get-onboarding');
|
||||
$button_class = '';
|
||||
$button_text = __('View checklist', 'hostinger-easy-onboarding');
|
||||
}
|
||||
|
||||
if( $this->is_woopayments_reminder_visible() ) {
|
||||
$text = __('Congrats, you have connected WooPayments!', 'hostinger-easy-onboarding');
|
||||
$button_url = admin_url('admin.php?page=hostinger-get-onboarding&subPage=woo-commerce-online-store-setup');
|
||||
$button_class = '';
|
||||
$button_text = __('Continue setup', 'hostinger-easy-onboarding');
|
||||
}
|
||||
|
||||
if ( $this->is_onboarding_reminder_visible() || $this->is_onboarding_complete_reminder_visible() || $this->is_woopayments_reminder_visible() ) {
|
||||
?>
|
||||
<div class="hostinger-onboarding-reminder">
|
||||
<div class="hostinger-onboarding-reminder__wrap">
|
||||
<div class="hostinger-onboarding-reminder__logo">
|
||||
<svg width="93" height="108" viewBox="0 0 93 108" fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M66.5145 0V32.2221L92.8421 47.4468V13.2693L66.5145 0ZM0.000915527 0.00183105V50.5657H85.6265L59.5744 36.4074L25.6372 36.3911V13.6097L0.000915527 0.00183105ZM66.5145 94.0237V71.4387L32.3155 71.4152C32.3474 71.5655 5.83099 57.0306 5.83099 57.0306L92.8421 57.4371V108L66.5145 94.0237ZM0.000912095 60.9814L0 94.0237L25.6372 107.292V75.8458L0.000912095 60.9814Z"
|
||||
fill="#673DE6"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="hostinger-onboarding-reminder__text">
|
||||
<?php echo $text; ?>
|
||||
</div>
|
||||
<div class="hostinger-onboarding-reminder__cta <?php echo $button_class; ?>">
|
||||
<a href="<?php
|
||||
echo $button_url; ?>">
|
||||
<?php
|
||||
echo $button_text; ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ( $this->is_onboarding_complete_reminder_visible() ) {
|
||||
update_option( self::COMPLETED_REMINDER_OPTION_NAME, 1 );
|
||||
}
|
||||
|
||||
if ( $this->is_woopayments_reminder_visible() ) {
|
||||
update_option( self::WOOPAYMENTS_REMINDER_OPTION_NAME, 1 );
|
||||
}
|
||||
}
|
||||
|
||||
public function add_onboarding_notice_class($classes)
|
||||
{
|
||||
if ($this->is_onboarding_reminder_visible() || $this->is_onboarding_complete_reminder_visible()) {
|
||||
$classes .= ' hostinger-onboarding-reminder-visible';
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
private function is_onboarding_complete_reminder_visible()
|
||||
{
|
||||
$setup_completed = get_option( self::COMPLETED_REMINDER_OPTION_NAME, false );
|
||||
|
||||
$onboarding_completed = $this->helper->is_website_onboarding_completed();
|
||||
|
||||
if ( is_plugin_active('woocommerce/woocommerce.php') ) {
|
||||
$onboarding_completed = $this->helper->is_woocommerce_onboarding_completed() && $this->helper->is_website_onboarding_completed();
|
||||
}
|
||||
|
||||
return $onboarding_completed
|
||||
&& empty( $setup_completed )
|
||||
&& $this->is_completed_reminder_page();
|
||||
}
|
||||
|
||||
private function is_woopayments_reminder_visible()
|
||||
{
|
||||
$woopayments_completed = get_option( self::WOOPAYMENTS_REMINDER_OPTION_NAME, false );
|
||||
|
||||
return is_plugin_active('woocommerce/woocommerce.php')
|
||||
&& is_plugin_active('woocommerce-payments/woocommerce-payments.php')
|
||||
&& $this->helper->is_woocommerce_payments_ready()
|
||||
&& empty( $woopayments_completed )
|
||||
&& $this->helper->is_this_page( 'paymentsoverview' );
|
||||
}
|
||||
|
||||
private function is_onboarding_reminder_visible()
|
||||
{
|
||||
return is_plugin_active('woocommerce/woocommerce.php')
|
||||
&& ! $this->helper->is_woocommerce_onboarding_completed()
|
||||
&& $this->is_woocommerce_admin_page();
|
||||
}
|
||||
|
||||
public function change_shop_page_edit_url($link, $post_id, $context): string
|
||||
{
|
||||
if ( ! is_plugin_active('woocommerce/woocommerce.php')) {
|
||||
return $link;
|
||||
}
|
||||
|
||||
$shop_page_id = wc_get_page_id( 'shop' );
|
||||
|
||||
if( $shop_page_id != $post_id ) {
|
||||
return $link;
|
||||
}
|
||||
|
||||
if( current_theme_supports( 'block-templates' ) ) {
|
||||
return admin_url( 'site-editor.php?postType=wp_template&postId=woocommerce/woocommerce//archive-product' );
|
||||
}
|
||||
|
||||
return admin_url( 'customize.php?autofocus[section]=woocommerce_product_catalog' );
|
||||
}
|
||||
|
||||
public function disable_beaver_builder_redirect() {
|
||||
if ( !is_plugin_active( 'ultimate-addons-for-beaver-builder-lite/bb-ultimate-addon.php' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$redirect = get_option( 'uabb_lite_redirect', false );
|
||||
|
||||
if ( empty( $redirect ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
update_option( 'uabb_lite_redirect', false );
|
||||
|
||||
$this->flush_object_cache();
|
||||
}
|
||||
|
||||
public function disable_monsterinsights_redirect() {
|
||||
if ( !is_plugin_active( 'google-analytics-for-wordpress/googleanalytics.php' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! get_transient( '_monsterinsights_activation_redirect' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Delete the redirect transient.
|
||||
delete_transient( '_monsterinsights_activation_redirect' );
|
||||
|
||||
$this->flush_object_cache();
|
||||
}
|
||||
|
||||
private function flush_object_cache(): void {
|
||||
if ( has_action( 'litespeed_purge_all_object' ) ) {
|
||||
do_action('litespeed_purge_all_object');
|
||||
}
|
||||
}
|
||||
|
||||
public function check_if_payment_gateway_enabled( $option, $old_value, $value ) {
|
||||
if ( ! str_contains( $option, 'woocommerce' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $this->onboarding->is_completed( Onboarding::HOSTINGER_EASY_ONBOARDING_STORE_STEP_CATEGORY_ID, Admin_Actions::ADD_PAYMENT ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$payment_gateway_manager = new GatewayManager( \WC_Payment_Gateways::instance() );
|
||||
|
||||
if( $payment_gateway_manager->isAnyGatewayActive() ) {
|
||||
$this->onboarding->complete_step( Onboarding::HOSTINGER_EASY_ONBOARDING_STORE_STEP_CATEGORY_ID, Admin_Actions::ADD_PAYMENT );
|
||||
|
||||
$amplitude = new Amplitude();
|
||||
|
||||
$params = array(
|
||||
'action' => AmplitudeActions::WOO_ITEM_COMPLETED,
|
||||
'step_type' => Admin_Actions::ADD_PAYMENT,
|
||||
);
|
||||
|
||||
$amplitude->send_event( $params );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function set_woocommerce_options(): void {
|
||||
if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$woocommerce_options_set = get_option( 'hostinger_onboarding_woo_options_set', null );
|
||||
$onboarding_choice_done = get_option( 'hostinger_onboarding_choice_done', null );
|
||||
|
||||
if ( $onboarding_choice_done === null && $woocommerce_options_set === null ) {
|
||||
$woocommerceOptions = new WooCommerceOptions();
|
||||
|
||||
$woocommerceOptions->hideSetupTaskList();
|
||||
$woocommerceOptions->disableWooCommerceShipingZoneCreation();
|
||||
$woocommerceOptions->skipOnboarding();
|
||||
|
||||
update_option( 'hostinger_onboarding_woo_options_set', true );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\EasyOnboarding\Admin;
|
||||
|
||||
use Hostinger\WpHelper\Utils;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
class Menu {
|
||||
public const WEBSITE_LIST_URL = 'https://hpanel.hostinger.com/websites';
|
||||
public const HPANEL_HOME = 'https://hpanel.hostinger.com';
|
||||
public const WEBSITE_BILLINGS_URL = 'https://hpanel.hostinger.com/billing/subscriptions';
|
||||
|
||||
public function __construct() {
|
||||
add_filter( 'hostinger_menu_subpages', array( $this, 'add_menu_sub_pages' ) );
|
||||
add_filter( 'hostinger_admin_menu_bar_items', array( $this, 'add_admin_bar_items' ) );
|
||||
add_filter( 'hostinger_admin_menu_bar_items', array( $this, 'add_hpanel_bar_items' ), 999 );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $menu_items
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function add_admin_bar_items(array $menu_items): array {
|
||||
$menu_items[] = array(
|
||||
'id' => 'hostinger-easy-onboarding-admin-bar-onboarding',
|
||||
'title' => esc_html__( 'Onboarding', 'hostinger-easy-onboarding' ),
|
||||
'href' => admin_url( 'admin.php?page=hostinger-get-onboarding' )
|
||||
);
|
||||
|
||||
$menu_items[] = array(
|
||||
'id' => 'hostinger-easy-onboarding-admin-bar-learn',
|
||||
'title' => esc_html__( 'Learn', 'hostinger-easy-onboarding' ),
|
||||
'href' => admin_url( 'admin.php?page=hostinger-get-learn' )
|
||||
);
|
||||
|
||||
return $menu_items;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $menu_items
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function add_hpanel_bar_items(array $menu_items): array {
|
||||
if (empty(Utils::getApiToken())) {
|
||||
return $menu_items;
|
||||
}
|
||||
|
||||
$external_icon = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M5 21C4.45 21 3.97917 20.8042 3.5875 20.4125C3.19583 20.0208 3 19.55 3 19V5C3 4.45 3.19583 3.97917 3.5875 3.5875C3.97917 3.19583 4.45 3 5 3H11C11.2833 3 11.5208 3.09583 11.7125 3.2875C11.9042 3.47917 12 3.71667 12 4C12 4.28333 11.9042 4.52083 11.7125 4.7125C11.5208 4.90417 11.2833 5 11 5H5V19H19V13C19 12.7167 19.0958 12.4792 19.2875 12.2875C19.4792 12.0958 19.7167 12 20 12C20.2833 12 20.5208 12.0958 20.7125 12.2875C20.9042 12.4792 21 12.7167 21 13V19C21 19.55 20.8042 20.0208 20.4125 20.4125C20.0208 20.8042 19.55 21 19 21H5ZM19 6.4L10.4 15C10.2167 15.1833 9.98333 15.275 9.7 15.275C9.41667 15.275 9.18333 15.1833 9 15C8.81667 14.8167 8.725 14.5833 8.725 14.3C8.725 14.0167 8.81667 13.7833 9 13.6L17.6 5H15C14.7167 5 14.4792 4.90417 14.2875 4.7125C14.0958 4.52083 14 4.28333 14 4C14 3.71667 14.0958 3.47917 14.2875 3.2875C14.4792 3.09583 14.7167 3 15 3H21V9C21 9.28333 20.9042 9.52083 20.7125 9.7125C20.5208 9.90417 20.2833 10 20 10C19.7167 10 19.4792 9.90417 19.2875 9.7125C19.0958 9.52083 19 9.28333 19 9V6.4Z" fill=""/>
|
||||
</svg>';
|
||||
|
||||
$menu_items[] = array(
|
||||
'id' => 'hostinger_hpanel_home_admin_bar',
|
||||
'title' => esc_html__( 'hPanel - Home', 'hostinger-easy-onboarding' ) . $external_icon,
|
||||
'href' => self::HPANEL_HOME,
|
||||
'meta' => array(
|
||||
'target' => '_blank',
|
||||
)
|
||||
);
|
||||
|
||||
$menu_items[] = array(
|
||||
'id' => 'hostinger_website_list_admin_bar',
|
||||
'title' => esc_html__( 'hPanel - Websites', 'hostinger-easy-onboarding' ) . $external_icon,
|
||||
'href' => self::WEBSITE_LIST_URL,
|
||||
'meta' => array(
|
||||
'target' => '_blank',
|
||||
)
|
||||
);
|
||||
|
||||
$menu_items[] = array(
|
||||
'id' => 'hostinger_billings_admin_bar',
|
||||
'title' => esc_html__( 'hPanel - Billing', 'hostinger-easy-onboarding' ) . $external_icon,
|
||||
'href' => self::WEBSITE_BILLINGS_URL,
|
||||
'meta' => array(
|
||||
'target' => '_blank',
|
||||
)
|
||||
);
|
||||
|
||||
return $menu_items;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $submenus
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function add_menu_sub_pages( array $submenus ): array {
|
||||
$submenus[] = array(
|
||||
'page_title' => __( 'Onboarding', 'hostinger-easy-onboarding' ),
|
||||
'menu_title' => __( 'Onboarding', 'hostinger-easy-onboarding' ),
|
||||
'capability' => 'manage_options',
|
||||
'menu_slug' => 'hostinger-get-onboarding',
|
||||
'callback' => array( $this, 'renderOnboarding' ),
|
||||
'menu_identifier' => 'home',
|
||||
'menu_order' => 10
|
||||
);
|
||||
|
||||
return $submenus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function renderOnboarding(): void {
|
||||
include_once __DIR__ . '/Views/Onboarding.php';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,289 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\EasyOnboarding\Admin\Onboarding;
|
||||
|
||||
use Hostinger\EasyOnboarding\AmplitudeEvents\Amplitude;
|
||||
use Hostinger\EasyOnboarding\AmplitudeEvents\Actions as AmplitudeActions;
|
||||
use Hostinger\EasyOnboarding\Helper;
|
||||
use Hostinger\EasyOnboarding\Admin\Actions as Admin_Actions;
|
||||
use WP_Post;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
class AutocompleteSteps {
|
||||
/**
|
||||
* @var Helper
|
||||
*/
|
||||
private Helper $helper;
|
||||
|
||||
/**
|
||||
* @var Onboarding
|
||||
*/
|
||||
private Onboarding $onboarding;
|
||||
|
||||
/**
|
||||
* @var Amplitude
|
||||
*/
|
||||
private Amplitude $amplitude;
|
||||
|
||||
public function __construct() {
|
||||
$this->onboarding = new Onboarding();
|
||||
$this->helper = new Helper();
|
||||
$this->amplitude = new Amplitude();
|
||||
|
||||
add_action( 'admin_init', array( $this, 'init_onboarding' ), 0 );
|
||||
|
||||
add_action( 'save_post_product', array( $this, 'new_product_creation' ), 10, 3 );
|
||||
add_action( 'woocommerce_shipping_zone_method_added', array( $this, 'shipping_zone_added'), 10, 3 );
|
||||
add_action( 'googlesitekit_authorize_user', array( $this, 'googlesite_connected' ) );
|
||||
|
||||
add_action( 'admin_init', array( $this, 'woocommerce_steps_completed' ) );
|
||||
|
||||
if ( is_plugin_active( 'hostinger-affiliate-plugin/hostinger-affiliate-plugin.php' ) ) {
|
||||
add_action( 'admin_init', array( $this, 'affiliate_plugin_connected' ) );
|
||||
}
|
||||
|
||||
if ( $this->helper->is_hostinger_admin_page() ) {
|
||||
add_action( 'admin_init', array( $this, 'domain_is_connected' ) );
|
||||
}
|
||||
|
||||
if ( $this->helper->isStoreSetupCompleted() ) {
|
||||
add_action( 'admin_init', array( $this, 'website_setup_completed' ) );
|
||||
}
|
||||
}
|
||||
|
||||
public function init_onboarding() {
|
||||
$this->onboarding->init();
|
||||
}
|
||||
|
||||
public function affiliate_plugin_connected(): void {
|
||||
if( ! class_exists( '\Hostinger\AffiliatePlugin\Admin\PluginSettings' )) {
|
||||
return;
|
||||
}
|
||||
|
||||
$action = Admin_Actions::AMAZON_AFFILIATE;
|
||||
|
||||
$category_id = $this->find_category_from_actions($action);
|
||||
|
||||
if(empty($category_id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $this->onboarding->is_completed( $category_id, $action ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$settings = new \Hostinger\AffiliatePlugin\Admin\PluginSettings();
|
||||
|
||||
$plugin_settings = $settings->get_plugin_settings()->to_array();
|
||||
|
||||
if ( ! empty( $plugin_settings['connection_status'] ) && $plugin_settings['connection_status'] === \Hostinger\AffiliatePlugin\Admin\Options\PluginOptions::STATUS_CONNECTED ) {
|
||||
$this->onboarding->complete_step( $category_id, $action );
|
||||
|
||||
$params = array(
|
||||
'action' => AmplitudeActions::ONBOARDING_ITEM_COMPLETED,
|
||||
'step_type' => $action,
|
||||
);
|
||||
|
||||
$this->amplitude->send_event($params);
|
||||
}
|
||||
}
|
||||
|
||||
public function woocommerce_steps_completed(): void {
|
||||
if ( ! is_plugin_active('woocommerce/woocommerce.php')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !$this->helper->is_woocommerce_onboarding_completed() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$action = Admin_Actions::STORE_TASKS;
|
||||
|
||||
$category_id = $this->find_category_from_actions($action);
|
||||
|
||||
if( empty( $category_id ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $this->onboarding->is_completed( $category_id, $action ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->onboarding->complete_step( $category_id, $action );
|
||||
|
||||
$params = array(
|
||||
'action' => AmplitudeActions::ONBOARDING_ITEM_COMPLETED,
|
||||
'step_type' => Admin_Actions::STORE_TASKS,
|
||||
);
|
||||
|
||||
$this->amplitude->send_event($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function domain_is_connected(): void {
|
||||
$action = Admin_Actions::DOMAIN_IS_CONNECTED;
|
||||
|
||||
$category_id = $this->find_category_from_actions($action);
|
||||
|
||||
if(empty($category_id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $this->onboarding->is_completed( $category_id, $action ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! $this->helper->is_free_subdomain() && ! $this->helper->is_preview_domain() ) {
|
||||
if ( ! did_action( 'hostinger_domain_connected' ) ) {
|
||||
$this->onboarding->complete_step( $category_id, $action );
|
||||
|
||||
$params = array(
|
||||
'action' => AmplitudeActions::ONBOARDING_ITEM_COMPLETED,
|
||||
'step_type' => Admin_Actions::DOMAIN_IS_CONNECTED,
|
||||
);
|
||||
|
||||
$this->amplitude->send_event($params);
|
||||
|
||||
do_action( 'hostinger_domain_connected' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function website_setup_completed(): void {
|
||||
$action = Admin_Actions::SETUP_STORE;
|
||||
$category_id = $this->find_category_from_actions( $action );
|
||||
|
||||
if(empty($category_id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $this->onboarding->is_completed( $category_id, $action ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->onboarding->complete_step( $category_id, $action );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $post_id
|
||||
* @param bool $update
|
||||
* @param string $action
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function new_post_item_creation( int $post_id, bool $update, string $action ): void {
|
||||
$cookie_value = isset( $_COOKIE[ $action ] ) ? sanitize_text_field( wp_unslash( $_COOKIE[ $action ] ) ) : '';
|
||||
|
||||
$category_id = $this->find_category_from_actions($action);
|
||||
|
||||
if(empty($category_id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $this->onboarding->is_completed( $category_id, $action ) || wp_is_post_revision( $post_id ) || wp_is_post_autosave( $post_id ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $update && $cookie_value === $action ) {
|
||||
$this->onboarding->complete_step( $category_id, $action );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $post_id
|
||||
* @param WP_Post $post
|
||||
* @param bool $update
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function new_product_creation( int $post_id, WP_Post $post, bool $update ): void {
|
||||
if ( wp_is_post_revision( $post_id ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if( $post->post_status != 'publish' ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if( empty( $post->post_author ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $this->onboarding->is_completed( Onboarding::HOSTINGER_EASY_ONBOARDING_STORE_STEP_CATEGORY_ID, Admin_Actions::ADD_PRODUCT ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->onboarding->complete_step( Onboarding::HOSTINGER_EASY_ONBOARDING_STORE_STEP_CATEGORY_ID, Admin_Actions::ADD_PRODUCT );
|
||||
|
||||
$add_product_event_sent = get_option( 'hostinger_add_product_event_sent', false );
|
||||
|
||||
if ( !empty( $add_product_event_sent ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$params = array(
|
||||
'action' => AmplitudeActions::WOO_ITEM_COMPLETED,
|
||||
'step_type' => Admin_Actions::ADD_PRODUCT,
|
||||
);
|
||||
|
||||
$this->amplitude->send_event($params);
|
||||
|
||||
update_option( 'hostinger_add_product_event_sent', true );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $instance_id
|
||||
* @param $type
|
||||
* @param $zone_id
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function shipping_zone_added($instance_id, $type, $zone_id) {
|
||||
if ( $this->onboarding->is_completed( Onboarding::HOSTINGER_EASY_ONBOARDING_STORE_STEP_CATEGORY_ID, Admin_Actions::ADD_SHIPPING ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->onboarding->complete_step( Onboarding::HOSTINGER_EASY_ONBOARDING_STORE_STEP_CATEGORY_ID, Admin_Actions::ADD_SHIPPING );
|
||||
|
||||
$params = array(
|
||||
'action' => AmplitudeActions::WOO_ITEM_COMPLETED,
|
||||
'step_type' => Admin_Actions::ADD_SHIPPING,
|
||||
);
|
||||
|
||||
$this->amplitude->send_event($params);
|
||||
}
|
||||
|
||||
public function googlesite_connected() {
|
||||
$category = Onboarding::HOSTINGER_EASY_ONBOARDING_WEBSITE_STEP_CATEGORY_ID;
|
||||
|
||||
if ( $this->onboarding->is_completed( $category, Admin_Actions::GOOGLE_KIT ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->onboarding->complete_step( $category, Admin_Actions::GOOGLE_KIT );
|
||||
|
||||
$params = array(
|
||||
'action' => AmplitudeActions::ONBOARDING_ITEM_COMPLETED,
|
||||
'step_type' => Admin_Actions::GOOGLE_KIT,
|
||||
);
|
||||
|
||||
$this->amplitude->send_event($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $action
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function find_category_from_actions($action): string {
|
||||
foreach (Admin_Actions::get_category_action_lists() as $category => $actions) {
|
||||
if (in_array($action, $actions)) {
|
||||
return $category;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,541 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\EasyOnboarding\Admin\Onboarding;
|
||||
|
||||
use Hostinger\EasyOnboarding\Admin\Actions;
|
||||
use Hostinger\EasyOnboarding\Admin\Actions as Admin_Actions;
|
||||
use Hostinger\EasyOnboarding\Admin\Onboarding\Steps\Button;
|
||||
use Hostinger\EasyOnboarding\Admin\Onboarding\Steps\Step;
|
||||
use Hostinger\EasyOnboarding\Admin\Onboarding\Steps\StepCategory;
|
||||
use Hostinger\EasyOnboarding\AmplitudeEvents\Actions as AmplitudeActions;
|
||||
use Hostinger\EasyOnboarding\AmplitudeEvents\Amplitude;
|
||||
use Hostinger\EasyOnboarding\Helper;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
class Onboarding {
|
||||
private const HOSTINGER_ADD_DOMAIN_URL = 'https://hpanel.hostinger.com/add-domain/';
|
||||
private const HOSTINGER_WEBSITES_URL = 'https://hpanel.hostinger.com/websites';
|
||||
public const HOSTINGER_EASY_ONBOARDING_STEPS_OPTION_NAME = 'hostinger_easy_onboarding_steps';
|
||||
public const HOSTINGER_EASY_ONBOARDING_WEBSITE_STEP_CATEGORY_ID = 'website_setup';
|
||||
public const HOSTINGER_EASY_ONBOARDING_STORE_STEP_CATEGORY_ID = 'online_store_setup';
|
||||
/**
|
||||
* @var Helper
|
||||
*/
|
||||
private Helper $helper;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private array $step_categories = array();
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function init(): void {
|
||||
$this->helper = new Helper();
|
||||
|
||||
$this->load_step_categories();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function load_step_categories(): void {
|
||||
include_once ABSPATH . 'wp-admin/includes/plugin.php';
|
||||
|
||||
$website_step_category = new StepCategory(
|
||||
self::HOSTINGER_EASY_ONBOARDING_WEBSITE_STEP_CATEGORY_ID,
|
||||
__( 'Website setup', 'hostinger-easy-onboarding' )
|
||||
);
|
||||
|
||||
$first_step_data = self::get_first_step_data();
|
||||
|
||||
if ( ! empty( $first_step_data ) ) {
|
||||
$first_step = new Step( Actions::AI_STEP );
|
||||
|
||||
$first_step->set_image_url( HOSTINGER_EASY_ONBOARDING_ASSETS_URL . '/images/steps/ai_step.svg' );
|
||||
|
||||
$first_step->set_title_completed( __( 'Started creating your site', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
if ( ! empty( $first_step_data['title'] ) ) {
|
||||
$first_step->set_title( $first_step_data['title'] );
|
||||
}
|
||||
|
||||
if ( ! empty( $first_step_data['description'] ) ) {
|
||||
$first_step->set_description( $first_step_data['description'] );
|
||||
}
|
||||
|
||||
if ( ! empty( $first_step_data['primary_button_title'] ) ) {
|
||||
$button = new Button( $first_step_data['primary_button_title'] );
|
||||
|
||||
if ( ! empty( $first_step_data['primary_button_url'] ) ) {
|
||||
$button->set_url( $first_step_data['primary_button_url'] );
|
||||
}
|
||||
|
||||
$first_step->set_primary_button( $button );
|
||||
}
|
||||
|
||||
if ( ! empty( $first_step_data['secondary_button_title'] ) ) {
|
||||
$button = new Button( $first_step_data['secondary_button_title'] );
|
||||
|
||||
if ( ! empty( $first_step_data['secondary_button_url'] ) ) {
|
||||
$button->set_url( $first_step_data['secondary_button_url'] );
|
||||
} else {
|
||||
$button->set_is_skippable( true );
|
||||
}
|
||||
|
||||
$first_step->set_secondary_button( $button );
|
||||
}
|
||||
|
||||
$website_step_category->add_step( $first_step );
|
||||
}
|
||||
|
||||
if ( is_plugin_active( 'hostinger-affiliate-plugin/hostinger-affiliate-plugin.php' ) ) {
|
||||
$website_step_category->add_step( $this->get_amazon_affiliate_step() );
|
||||
}
|
||||
|
||||
if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
|
||||
$website_step_category->add_step( $this->get_started_with_store() );
|
||||
}
|
||||
|
||||
// Connect domain.
|
||||
$website_step_category->add_step( $this->get_add_domain_step() );
|
||||
|
||||
$website_step_category->add_step( $this->get_google_kit_step() );
|
||||
|
||||
// Add category.
|
||||
$this->step_categories[] = $website_step_category;
|
||||
|
||||
if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
|
||||
$store_step_category = new StepCategory(
|
||||
self::HOSTINGER_EASY_ONBOARDING_STORE_STEP_CATEGORY_ID,
|
||||
__('Online store setup', 'hostinger-easy-onboarding')
|
||||
);
|
||||
|
||||
// Setup online store.
|
||||
$store_step_category->add_step( $this->get_setup_online_store() );
|
||||
|
||||
// Add product.
|
||||
$store_step_category->add_step( $this->get_add_product_step() );
|
||||
|
||||
// Add payment method.
|
||||
$store_step_category->add_step( $this->get_payment_method_step() );
|
||||
|
||||
// Add shipping method.
|
||||
$store_step_category->add_step( $this->get_shipping_method_step() );
|
||||
|
||||
$this->step_categories[] = $store_step_category;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function get_step_categories(): array {
|
||||
return array_map(
|
||||
function ( $item ) {
|
||||
return $item->to_array();
|
||||
},
|
||||
$this->step_categories
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $step_category_id
|
||||
* @param string $step_id
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function complete_step( string $step_category_id, string $step_id ): bool {
|
||||
if ( !$this->validate_step( $step_category_id, $step_id ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$onboarding_steps = $this->get_saved_steps();
|
||||
|
||||
if(empty($onboarding_steps[$step_category_id])) {
|
||||
$onboarding_steps[$step_category_id] = array();
|
||||
}
|
||||
|
||||
$onboarding_steps[$step_category_id][$step_id] = true;
|
||||
|
||||
$this->maybe_send_store_events( $onboarding_steps );
|
||||
|
||||
return update_option( self::HOSTINGER_EASY_ONBOARDING_STEPS_OPTION_NAME, $onboarding_steps, false );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $step_category_id
|
||||
* @param string $step_id
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function validate_step( string $step_category_id, string $step_id ): bool {
|
||||
$step_categories = $this->get_step_categories();
|
||||
|
||||
if(empty($step_categories)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Try to match step category id.
|
||||
$found = false;
|
||||
foreach($step_categories as $step_category) {
|
||||
if($step_category['id'] == $step_category_id) {
|
||||
if(!empty($step_category['steps'])) {
|
||||
foreach($step_category['steps'] as $step) {
|
||||
if($step['id'] == $step_id) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(empty($found)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $step_category_id
|
||||
* @param string $step_id
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_completed( string $step_category_id, string $step_id ) : bool {
|
||||
$onboarding_steps = $this->get_saved_steps();
|
||||
|
||||
if(empty($onboarding_steps[$step_category_id][$step_id])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (bool)$onboarding_steps[$step_category_id][$step_id];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
private function get_saved_steps(): array {
|
||||
return get_option( self::HOSTINGER_EASY_ONBOARDING_STEPS_OPTION_NAME, array() );
|
||||
}
|
||||
|
||||
private function get_add_domain_step(): Step
|
||||
{
|
||||
$step = new Step( Actions::DOMAIN_IS_CONNECTED );
|
||||
|
||||
$step->set_image_url( HOSTINGER_EASY_ONBOARDING_ASSETS_URL . '/images/steps/connect_domain.svg' );
|
||||
|
||||
$step->set_title( __( 'Connect a domain', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$button = new Button( __( 'Connect domain', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
if ( $this->helper->is_free_subdomain() || $this->helper->is_preview_domain() ) {
|
||||
$step->set_title_completed(__('Connect on hPanel', 'hostinger-easy-onboarding'));
|
||||
|
||||
$step->set_description(
|
||||
__(
|
||||
'Visit hPanel and connect a real domain. If you already did this, please wait up to 24h until the domain fully connects',
|
||||
'hostinger-easy-onboarding'
|
||||
)
|
||||
);
|
||||
|
||||
$site_url = preg_replace( '#^https?://#', '', get_site_url() );
|
||||
$hpanel_url = self::HOSTINGER_WEBSITES_URL . '/' . $site_url;
|
||||
|
||||
$button->set_title( __( 'Connect on hPanel', 'hostinger-easy-onboarding' ) );
|
||||
$button->set_url( $hpanel_url );
|
||||
|
||||
} else {
|
||||
$step->set_title_completed(__('Connected a domain', 'hostinger-easy-onboarding'));
|
||||
|
||||
$step->set_description(
|
||||
__(
|
||||
'Every website needs a domain that makes it easy to access and remember. Get yours in just a few clicks.',
|
||||
'hostinger-easy-onboarding'
|
||||
)
|
||||
);
|
||||
|
||||
$site_url = preg_replace( '#^https?://#', '', get_site_url() );
|
||||
$hpanel_url = self::HOSTINGER_ADD_DOMAIN_URL . $site_url . '/select';
|
||||
|
||||
$query_parameters = array(
|
||||
'websiteType' => 'wordpress',
|
||||
'redirectUrl' => self::HOSTINGER_WEBSITES_URL,
|
||||
);
|
||||
|
||||
$button->set_url( $hpanel_url . '?' . http_build_query( $query_parameters ) );
|
||||
}
|
||||
|
||||
$step->set_primary_button( $button );
|
||||
|
||||
return $step;
|
||||
}
|
||||
|
||||
private function get_amazon_affiliate_step(): Step
|
||||
{
|
||||
$step = new Step(Actions::AMAZON_AFFILIATE);
|
||||
|
||||
$step->set_image_url( HOSTINGER_EASY_ONBOARDING_ASSETS_URL . '/images/steps/amazon_affiliate.svg' );
|
||||
|
||||
$step->set_title( __( 'Connect your Amazon account to the site', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$step->set_title_completed( __( 'Connected your Amazon account', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$step->set_description( __( 'Join the Amazon Affiliate Program to start earning commissions. Link your Amazon affiliate account to your website, start promoting products and earn rewards.', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$button = new Button( __( 'Connect Amazon to site', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$button->set_url( admin_url( 'admin.php?page=hostinger-amazon-affiliate' ) );
|
||||
|
||||
$step->set_primary_button( $button );
|
||||
|
||||
return $step;
|
||||
}
|
||||
|
||||
private function get_started_with_store(): Step
|
||||
{
|
||||
$step = new Step( Actions::STORE_TASKS );
|
||||
|
||||
$step->set_image_url( HOSTINGER_EASY_ONBOARDING_ASSETS_URL . '/images/steps/store_tasks.svg' );
|
||||
|
||||
$step->set_title( __( 'Set up your online store', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$step->set_description( __( 'Get ready to sell online. Add your first product, then set up shipping and payments.', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$primary_button = new Button( __( 'Get started', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$primary_button->set_url( admin_url( 'admin.php?page=hostinger-get-onboarding&subPage=woo-commerce-online-store-setup' ) );
|
||||
|
||||
$primary_button->set_title_completed( __( 'View list', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$step->set_primary_button( $primary_button );
|
||||
|
||||
return $step;
|
||||
}
|
||||
|
||||
private function get_setup_online_store(): Step
|
||||
{
|
||||
$step = new Step( Actions::SETUP_STORE );
|
||||
|
||||
$step->set_image_url( HOSTINGER_EASY_ONBOARDING_ASSETS_URL . '/images/steps/store_tasks.svg' );
|
||||
|
||||
$step->set_title( __( 'Store info', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$step->set_description( __( 'We\'ll use this information to help you set up your store faster.', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$primary_button = new Button( __( 'View Details', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$primary_button->set_url( admin_url( 'admin.php?page=wc-settings' ) );
|
||||
|
||||
$step->set_primary_button( $primary_button );
|
||||
|
||||
return $step;
|
||||
}
|
||||
|
||||
private function get_add_product_step(): Step
|
||||
{
|
||||
$step = new Step( Actions::ADD_PRODUCT );
|
||||
|
||||
$step->set_image_url( HOSTINGER_EASY_ONBOARDING_ASSETS_URL . '/images/steps/add_product.svg' );
|
||||
|
||||
$step->set_title( __( 'Add your first product or service', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$step->set_description( __( 'Sell products, services and digital downloads. Set up and customize each item to fit your business needs.', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$primary_button = new Button( __( 'Add product', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$primary_button->set_url( admin_url( 'post-new.php?post_type=product' ) );
|
||||
|
||||
$step->set_primary_button( $primary_button );
|
||||
|
||||
$secondary_button = new Button( __( 'Not interested', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$secondary_button->set_is_skippable( true );
|
||||
|
||||
$step->set_secondary_button( $secondary_button );
|
||||
|
||||
return $step;
|
||||
}
|
||||
|
||||
private function get_payment_method_step(): Step
|
||||
{
|
||||
$step = new Step( Actions::ADD_PAYMENT );
|
||||
|
||||
$step->set_image_url( HOSTINGER_EASY_ONBOARDING_ASSETS_URL . '/images/steps/add_payment_method.svg' );
|
||||
|
||||
$step->set_title( __( 'Set up a payment method', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$step->set_description( __( 'Get ready to accept customer payments. Let them pay for your products and services with ease.', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$primary_button = new Button( __( 'Set up payment method', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$primary_button->set_url( admin_url( 'admin.php?page=hostinger-get-onboarding&subPage=hostinger-store-add-payment-method' ) );
|
||||
|
||||
$step->set_primary_button( $primary_button );
|
||||
|
||||
return $step;
|
||||
}
|
||||
|
||||
private function get_shipping_method_step(): Step
|
||||
{
|
||||
$step = new Step( Actions::ADD_SHIPPING );
|
||||
|
||||
$step->set_image_url( HOSTINGER_EASY_ONBOARDING_ASSETS_URL . '/images/steps/add_shipping_method.svg' );
|
||||
|
||||
$step->set_title( __( 'Manage shipping', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$step->set_description( __( 'Choose the ways you\'d like to ship orders to customers. You can always add others later.', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$primary_button = new Button( __( 'Shipping methods', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$primary_button->set_url( admin_url( 'admin.php?page=hostinger-get-onboarding&subPage=hostinger-store-add-shipping-method' ) );
|
||||
|
||||
$step->set_primary_button( $primary_button );
|
||||
|
||||
$secondary_button = new Button( __( 'Not needed', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$secondary_button->set_is_skippable( true );
|
||||
|
||||
$step->set_secondary_button( $secondary_button );
|
||||
|
||||
return $step;
|
||||
}
|
||||
|
||||
private function get_google_kit_step(): Step
|
||||
{
|
||||
$step = new Step( Admin_Actions::GOOGLE_KIT );
|
||||
|
||||
$step->set_image_url( HOSTINGER_EASY_ONBOARDING_ASSETS_URL . '/images/steps/google_kit.svg' );
|
||||
|
||||
$step->set_title( __( 'Get found on Google', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$step->set_description( __( 'Make sure that your website shows up when visitors are looking for your business on Google.', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$primary_button = new Button( __( 'Set up Google Site Kit', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$primary_button->set_url( admin_url( 'admin.php?page=googlesitekit-splash' ) );
|
||||
|
||||
$primary_button->set_title_completed( __( 'Manage', 'hostinger-easy-onboarding' ));
|
||||
|
||||
$step->set_primary_button( $primary_button );
|
||||
|
||||
$secondary_button = new Button( __( 'Not needed', 'hostinger-easy-onboarding' ) );
|
||||
|
||||
$secondary_button->set_is_skippable( true );
|
||||
|
||||
$step->set_secondary_button( $secondary_button );
|
||||
|
||||
return $step;
|
||||
}
|
||||
|
||||
public function maybe_send_store_events( array $steps ) : void {
|
||||
if ( $this->is_store_ready( $steps ) ) {
|
||||
$this->send_event( AmplitudeActions::WOO_READY_TO_SELL, true );
|
||||
}
|
||||
|
||||
if ( $this->is_store_completed( $steps ) ) {
|
||||
$this->send_event( AmplitudeActions::WOO_SETUP_COMPLETED, true );
|
||||
}
|
||||
}
|
||||
|
||||
private function is_store_ready( array $steps ): bool {
|
||||
$store_steps = $steps[Onboarding::HOSTINGER_EASY_ONBOARDING_STORE_STEP_CATEGORY_ID] ?? array();
|
||||
return !empty( $store_steps[Admin_Actions::ADD_PAYMENT] ) && !empty( $store_steps[Admin_Actions::ADD_PRODUCT] );
|
||||
}
|
||||
|
||||
private function is_store_completed( $steps ): bool {
|
||||
$all_woo_steps = Admin_Actions::get_category_action_lists()[ Onboarding::HOSTINGER_EASY_ONBOARDING_STORE_STEP_CATEGORY_ID ];
|
||||
$completed_woo_steps = !empty($steps[Onboarding::HOSTINGER_EASY_ONBOARDING_STORE_STEP_CATEGORY_ID]) ? $steps[Onboarding::HOSTINGER_EASY_ONBOARDING_STORE_STEP_CATEGORY_ID] : array();
|
||||
|
||||
foreach ( $all_woo_steps as $step_key ) {
|
||||
if ( empty( $completed_woo_steps[ $step_key ] ) ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private function send_event( string $action, bool $once = false ): bool {
|
||||
if ( $once ) {
|
||||
$option_name = 'hostinger_amplitude_' . $action;
|
||||
|
||||
$event_sent = get_option( $option_name, false );
|
||||
|
||||
if ( $event_sent ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$amplitude = new Amplitude();
|
||||
|
||||
$params = array( 'action' => $action );
|
||||
|
||||
$event = $amplitude->send_event( $params );
|
||||
|
||||
if( $once ) {
|
||||
update_option( $option_name, true );
|
||||
}
|
||||
|
||||
return !empty( $event );
|
||||
}
|
||||
|
||||
public static function get_first_step_data(): array
|
||||
{
|
||||
include_once ABSPATH . 'wp-admin/includes/plugin.php';
|
||||
|
||||
$result = array();
|
||||
|
||||
if ( \is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
if ( get_option( 'template' ) == 'hostinger-ai-theme' ) {
|
||||
$hostinger_ai_version = get_option( 'hostinger_ai_version', false );
|
||||
|
||||
if ( empty( $hostinger_ai_version ) ) {
|
||||
$result['title'] = __( 'Create a site with AI', 'hostinger-easy-onboarding' );
|
||||
$result['description'] = __( 'Build a professional, custom-designed site in moments. Just a few clicks and AI handles the rest.', 'hostinger-easy-onboarding' );
|
||||
$result['primary_button_title'] = __( 'Create site with AI', 'hostinger-easy-onboarding' );
|
||||
$result['primary_button_url'] = admin_url( 'admin.php?page=hostinger-ai-website-creation&redirect=hostinger-easy-onboarding' );
|
||||
$result['secondary_button_title'] = __( 'Not now', 'hostinger-easy-onboarding' );
|
||||
} else {
|
||||
$result['title'] = __( 'Want to create a new AI site?', 'hostinger-easy-onboarding' );
|
||||
$result['description'] = __( 'Your new site will replace the current one. Use the same description or change it.', 'hostinger-easy-onboarding' );
|
||||
$result['primary_button_title'] = __( 'Keep current site', 'hostinger-easy-onboarding' );
|
||||
$result['secondary_button_title'] = __( 'Create new site', 'hostinger-easy-onboarding' );
|
||||
$result['secondary_button_url'] = admin_url( 'admin.php?page=hostinger-ai-website-creation&redirect=hostinger-easy-onboarding' );
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
$whitelist_plans = array(
|
||||
'business_economy',
|
||||
'business_enterprise',
|
||||
'business_professional',
|
||||
'cloud_economy',
|
||||
'cloud_enterprise',
|
||||
'cloud_professional',
|
||||
'gcp_business_8',
|
||||
'hostinger_business',
|
||||
);
|
||||
|
||||
$hosting_plan = get_option( 'hostinger_hosting_plan', false );
|
||||
|
||||
if ( \is_plugin_active( 'hostinger-ai-assistant/hostinger-ai-assistant.php' ) && !empty( $hosting_plan ) && in_array( $hosting_plan, $whitelist_plans ) ) {
|
||||
$result['title'] = __( 'Create content with AI', 'hostinger-easy-onboarding' );
|
||||
$result['description'] = __( 'Build a professional, custom-designed site in moments. Just a few clicks and AI handles the rest.', 'hostinger-easy-onboarding' );
|
||||
$result['primary_button_title'] = __( 'Generate post', 'hostinger-easy-onboarding' );
|
||||
$result['primary_button_url'] = admin_url( 'admin.php?page=hostinger-ai-assistant' );
|
||||
$result['secondary_button_title'] = __( 'Not now', 'hostinger-easy-onboarding' );
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,301 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\EasyOnboarding\Admin\Onboarding;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
class Plugin {
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private string $icon_url = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private string $name = '';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private string $slug = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private string $description = '';
|
||||
|
||||
/**
|
||||
* @var array|mixed
|
||||
*/
|
||||
private array $locale_supported = array();
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private bool $global = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private string $type = '';
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private bool $is_active = false;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private bool $is_recommended = false;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private bool $is_installed = false;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private bool $is_config_url = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private string $config_url = '';
|
||||
|
||||
/**
|
||||
* @param $icon_url
|
||||
* @param $name
|
||||
* @param $slug
|
||||
* @param $description
|
||||
* @param $type
|
||||
* @param $locale_supported
|
||||
* @param $global
|
||||
* @param bool $is_config_url
|
||||
* @param string $config_url
|
||||
*/
|
||||
public function __construct($icon_url, $name, $slug, $description, $type, $locale_supported, $global, $is_config_url = false, $config_url = '') {
|
||||
$this->icon_url = $icon_url;
|
||||
$this->name = $name;
|
||||
$this->slug = $slug;
|
||||
$this->description = $description;
|
||||
$this->type = $type;
|
||||
$this->locale_supported = $locale_supported;
|
||||
$this->global = $global;
|
||||
$this->is_config_url = $is_config_url;
|
||||
$this->config_url = $config_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function get_icon_url(): string
|
||||
{
|
||||
return $this->icon_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $icon_url
|
||||
*/
|
||||
public function set_icon_url(string $icon_url): void
|
||||
{
|
||||
$this->icon_url = $icon_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function get_name(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*/
|
||||
public function set_name(string $name): void
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function get_slug(): string
|
||||
{
|
||||
return $this->slug;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $slug
|
||||
*/
|
||||
public function set_slug(string $slug): void
|
||||
{
|
||||
$this->slug = $slug;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function get_description(): string
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $description
|
||||
*/
|
||||
public function set_description(string $description): void
|
||||
{
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function get_locale_supported(): array
|
||||
{
|
||||
return $this->locale_supported;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $locale_supported
|
||||
*/
|
||||
public function set_locale_supported(array $locale_supported): void
|
||||
{
|
||||
$this->locale_supported = $locale_supported;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function get_global(): bool
|
||||
{
|
||||
return $this->global;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $global
|
||||
*/
|
||||
public function set_global(bool $global): void
|
||||
{
|
||||
$this->global = $global;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function get_type(): string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $type
|
||||
*/
|
||||
public function set_type(string $type): void
|
||||
{
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function get_is_active(): bool
|
||||
{
|
||||
return $this->is_active;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $is_active
|
||||
*/
|
||||
public function set_is_active(bool $is_active): void
|
||||
{
|
||||
$this->is_active = $is_active;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function get_is_recommended(): bool
|
||||
{
|
||||
return $this->is_recommended;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $is_recommended
|
||||
*/
|
||||
public function set_is_recommended(bool $is_recommended): void
|
||||
{
|
||||
$this->is_recommended = $is_recommended;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function get_is_installed(): bool
|
||||
{
|
||||
return $this->is_installed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $is_installed
|
||||
*/
|
||||
public function set_is_installed(bool $is_installed): void
|
||||
{
|
||||
$this->is_installed = $is_installed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function get_is_config_url(): bool
|
||||
{
|
||||
return $this->is_config_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $is_config_url
|
||||
*/
|
||||
public function set_is_config_url(bool $is_config_url): void
|
||||
{
|
||||
$this->is_config_url = $is_config_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function get_config_url(): string
|
||||
{
|
||||
return $this->config_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $config_url
|
||||
*/
|
||||
public function set_config_url(string $config_url): void
|
||||
{
|
||||
$this->config_url = $config_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function to_array(): array {
|
||||
return array(
|
||||
'icon_url' => $this->get_icon_url(),
|
||||
'name' => $this->get_name(),
|
||||
'slug' => $this->get_slug(),
|
||||
'description' => $this->get_description(),
|
||||
'locale_supported' => $this->get_locale_supported(),
|
||||
'global' => $this->get_global(),
|
||||
'type' => $this->get_type(),
|
||||
'is_recommended' => $this->get_is_recommended(),
|
||||
'is_active' => $this->get_is_active(),
|
||||
'is_installed' => $this->get_is_installed(),
|
||||
'is_config_url' => $this->get_is_config_url(),
|
||||
'config_url' => $this->get_config_url()
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\EasyOnboarding\Admin\Onboarding;
|
||||
|
||||
use Hostinger\EasyOnboarding\Admin\Onboarding\Plugin;
|
||||
use Hostinger\WpHelper\Utils;
|
||||
use Hostinger\EasyOnboarding\Helper;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
class PluginManager {
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private array $plugins;
|
||||
|
||||
public function __construct() {
|
||||
$this->load_plugins();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function load_plugins(): void {
|
||||
$locales = array( 'US', 'UK', 'ES', 'FR', 'MX', 'CO', 'DE', 'IT', 'NL' );
|
||||
$this->plugins[] = new Plugin( 'https://ps.w.org/woocommerce-gateway-stripe/assets/icon-128x128.png', 'WooCommerce Stripe Gateway', 'woocommerce-gateway-stripe', __( 'Take credit card payments on your store using Stripe.', 'hostinger-easy-onboarding' ), 'payment', $locales, true, true, admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=stripe' ) );
|
||||
|
||||
$locales = array( 'US', 'UK', 'IN', 'BR', 'ES', 'FR', 'MX', 'CO', 'DE', 'IT', 'NL' );
|
||||
$this->plugins[] = new Plugin( 'https://ps.w.org/woocommerce-paypal-payments/assets/icon-128x128.png', 'WooCommerce PayPal Payments', 'woocommerce-paypal-payments', __( 'PayPal\'s latest complete payments processing solution. Accept PayPal, Pay Later, credit/debit cards, alternative digital wallets local payment types and bank accounts.', 'hostinger-easy-onboarding' ), 'payment', $locales, true, true, admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=ppcp-gateway&ppcp-tab=ppcp-connection' ) );
|
||||
|
||||
$locales = array( 'US', 'BR', 'ES', 'FR', 'DE', 'IT', 'NL' );
|
||||
$this->plugins[] = new Plugin( 'https://ps.w.org/woocommerce-payments/assets/icon-128x128.png','WooPayments','woocommerce-payments', __( 'Accept payments via credit card. Manage transactions within WordPress.', 'hostinger-easy-onboarding' ), 'payment', $locales, true, true, admin_url( 'admin.php?page=wc-admin&path=%2Fpayments%2Fconnect' ) );
|
||||
|
||||
$locales = array( 'BR', 'MX', 'CO' );
|
||||
$this->plugins[] = new Plugin( 'https://ps.w.org/woocommerce-mercadopago/assets/icon-128x128.png', 'Mercado Pago', 'woocommerce-mercadopago', __( 'Configure the payment options and accept payments with cards, ticket and money of Mercado Pago account.', 'hostinger-easy-onboarding' ), 'payment', $locales, false, true, admin_url( 'admin.php?page=mercadopago-settings' ) );
|
||||
|
||||
$locales = array( 'US', 'UK', 'ES', 'FR' );
|
||||
$this->plugins[] = new Plugin( 'https://ps.w.org/woocommerce-square/assets/icon-128x128.png', 'WooCommerce Square', 'woocommerce-square', __( 'Securely accept payments, synchronize sales, and seamlessly manage inventory and product data between WooCommerce and Square POS.', 'hostinger-easy-onboarding' ), 'payment', $locales, false, true, admin_url( 'admin.php?page=woocommerce-square-onboarding' ) );
|
||||
|
||||
$locales = array( 'US', 'UK', 'IN', 'ES', 'FR', 'DE', 'IT', 'NL' );
|
||||
$this->plugins[] = new Plugin( 'https://ps.w.org/woocommerce-gateway-amazon-payments-advanced/assets/icon-128x128.png', 'WooCommerce Amazon Pay', 'woocommerce-gateway-amazon-payments-advanced', __( 'Amazon Pay is embedded directly into your existing web site, and all the buyer interactions with Amazon Pay and Login with Amazon take place in embedded widgets so that the buyer never leaves your site. ', 'hostinger-easy-onboarding' ),'payment', $locales, true, true, admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=amazon_payments_advanced' ) );
|
||||
|
||||
$locales = array( 'IN' );
|
||||
$this->plugins[] = new Plugin( 'https://ps.w.org/upi-qr-code-payment-for-woocommerce/assets/icon-128x128.png', 'UPI QR Code Payment Gateway', 'upi-qr-code-payment-for-woocommerce', __( 'It enables a WooCommerce site to accept payments through UPI apps like BHIM, Google Pay, Paytm, PhonePe or any Banking UPI app. Avoid payment gateway charges.', 'hostinger-easy-onboarding' ), 'payment', $locales, false, true, admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=wc-upi' ) );
|
||||
|
||||
$locales = array( 'ES' );
|
||||
$this->plugins[] = new Plugin( 'https://ps.w.org/woo-redsys-gateway-light/assets/icon-128x128.png', 'WooCommerce Redsys Gateway Light', 'woo-redsys-gateway-light', __( 'Extends WooCommerce with a RedSys gateway.', 'hostinger-easy-onboarding' ), 'payment', $locales, false, true, admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=redsys' ) );
|
||||
|
||||
$locales = array( 'BR' );
|
||||
$this->plugins[] = new Plugin( 'https://ps.w.org/woo-pagseguro-rm/assets/icon.svg', 'Módulo PagSeguro', 'woo-pagseguro-rm', __( 'Adiciona PagSeguro como meio de pagamento (com desconto nas taxas oficiais).', 'hostinger-easy-onboarding' ), 'payment', $locales, false, true, admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=pagseguro' ) );
|
||||
|
||||
// Shipping.
|
||||
$locales = array( 'US' );
|
||||
$this->plugins[] = new Plugin( 'https://ps.w.org/woocommerce-services/assets/icon-128x128.png', 'WooCommerce Shipping & Tax', 'woocommerce-services', __( 'Hosted services for WooCommerce: automated tax calculation, shipping label printing, and smoother payment setup.', 'hostinger-easy-onboarding' ), 'shipping', $locales, false );
|
||||
|
||||
$locales = array( );
|
||||
$this->plugins[] = new Plugin( 'https://ps.w.org/flexible-shipping/assets/icon.svg', 'Flexible Shipping', 'flexible-shipping', __( 'Create additional shipment methods in WooCommerce and enable pricing based on cart weight or total.', 'hostinger-easy-onboarding' ), 'shipping', $locales, true, true, admin_url( 'admin.php?page=wc-settings&tab=shipping§ion=flexible_shipping_info' ) );
|
||||
|
||||
$locales = array( 'BR' );
|
||||
$this->plugins[] = new Plugin( 'https://ps.w.org/woocommerce-correios/assets/icon-128x128.png', 'Correios for WooCommerce', 'woocommerce-correios', __( 'Adds Correios shipping methods to your WooCommerce store.', 'hostinger-easy-onboarding' ), 'shipping', $locales, false, true, admin_url( 'admin.php?page=wc-settings&tab=integration§ion=correios-integration' ) );
|
||||
|
||||
$locales = array( 'FR' );
|
||||
$this->plugins[] = new Plugin( 'https://ps.w.org/colissimo-shipping-methods-for-woocommerce/assets/icon.svg', 'Colissimo shipping methods', 'colissimo-shipping-methods-for-woocommerce', __( 'This extension gives you the possibility to use the Colissimo shipping methods in WooCommerce', 'hostinger-easy-onboarding' ), 'shipping', $locales, false, true, admin_url( 'admin.php?page=wc-settings&tab=lpc' ) );
|
||||
|
||||
$locales = array( 'US' );
|
||||
$this->plugins[] = new Plugin( 'https://ps.w.org/woo-usps-simple-shipping/assets/icon-128x128.png', 'USPS Simple Shipping', 'woo-usps-simple-shipping', __( 'The USPS Simple plugin calculates rates for domestic shipping dynamically using USPS API during checkout.', 'hostinger-easy-onboarding' ), 'shipping', $locales, false, true, admin_url( 'admin.php?page=wc-settings&tab=shipping§ion=usps_simple' ) );
|
||||
|
||||
$locales = array( 'FR' );
|
||||
$this->plugins[] = new Plugin( 'https://ps.w.org/wc-multishipping/assets/icon-128x128.png', 'Chronopost & Mondial relay', 'wc-multishipping', __( 'Create Chronopost & Mondial relay shipping labels and send them easily.', 'hostinger-easy-onboarding' ), 'shipping', $locales, false, true, admin_url( 'admin.php?page=wc-settings&tab=mondial_relay' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Hostinger\EasyOnboarding\Admin\Onboarding\Plugin $plugin
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function check_recommended( Plugin $plugin ): bool {
|
||||
$locale = get_option('woocommerce_default_country', '');
|
||||
|
||||
if(empty($locale)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if( in_array($locale, $plugin->get_locale_supported())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get plugins by type and/or locale.
|
||||
*
|
||||
* @param string|null $type
|
||||
* @param string|null $locale
|
||||
* @return array
|
||||
*/
|
||||
|
||||
public function get_plugins_by_criteria( string $type = null, string $locale = null ): array {
|
||||
// Get by type first.
|
||||
$filtered_by_type = array_filter( $this->plugins, function ( $plugin ) use ( $type ) {
|
||||
return $plugin->get_type() === $type;
|
||||
} );
|
||||
|
||||
$all_plugins = get_plugins();
|
||||
|
||||
// Filter by supported locale or global available
|
||||
$filter_by_locale = array_filter( $filtered_by_type, function ( Plugin $plugin ) use ( $locale, $all_plugins ) {
|
||||
// Set if plugin is active and/or recommended
|
||||
$plugin_slug = $plugin->get_slug();
|
||||
$helper = new Helper();
|
||||
$plugin_path = $helper->get_plugin_main_file( $plugin_slug );
|
||||
|
||||
if ( ! is_wp_error( $plugin_path ) ) {
|
||||
$plugin->set_is_active( is_plugin_active( $plugin_path ) );
|
||||
$plugin->set_is_installed( array_key_exists( $plugin_path, $all_plugins ) );
|
||||
} else {
|
||||
$plugin->set_is_active( false );
|
||||
$plugin->set_is_installed( false );
|
||||
}
|
||||
|
||||
$plugin->set_is_recommended( $this->check_recommended( $plugin ) );
|
||||
|
||||
return in_array( $locale, $plugin->get_locale_supported() ) || $plugin->get_global();
|
||||
} );
|
||||
|
||||
return array_map(
|
||||
function ( $item ) {
|
||||
return $item->to_array();
|
||||
},
|
||||
$filter_by_locale
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\EasyOnboarding\Admin\Onboarding;
|
||||
|
||||
use Hostinger\EasyOnboarding\Admin\Actions as Admin_Actions;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
class Settings {
|
||||
public static function all_steps_completed(): bool {
|
||||
$actions = Admin_Actions::ACTIONS_LIST;
|
||||
$completed_steps = get_option( 'hostinger_onboarding_steps', array() );
|
||||
$completed_step_actions = array_column( $completed_steps, 'action' );
|
||||
$completed_steps_count = count( array_intersect( $completed_step_actions, $actions ) );
|
||||
|
||||
return $completed_steps_count === count( $actions );
|
||||
}
|
||||
}
|
||||
|
||||
new Settings();
|
||||
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\EasyOnboarding\Admin\Onboarding\Steps;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
class Button {
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private string $title;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private string $title_completed;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private bool $is_skippable;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private string $url = '';
|
||||
|
||||
/**
|
||||
* @param string $title
|
||||
* @param string $title_completed
|
||||
* @param bool $is_skippable
|
||||
* @param string $url
|
||||
*/
|
||||
public function __construct( string $title, string $title_completed = '', bool $is_skippable = false, string $url = '' ) {
|
||||
$this->title = $title;
|
||||
$this->title_completed = $title_completed;
|
||||
$this->is_skippable = $is_skippable;
|
||||
$this->url = $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function get_title(): string
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $title
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set_title( string $title ): void
|
||||
{
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function get_title_completed(): string
|
||||
{
|
||||
return $this->title_completed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $title_completed
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set_title_completed( string $title_completed ): void
|
||||
{
|
||||
$this->title_completed = $title_completed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function get_is_skippable(): bool
|
||||
{
|
||||
return $this->is_skippable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $is_skippable
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set_is_skippable( bool $is_skippable ): void
|
||||
{
|
||||
$this->is_skippable = $is_skippable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function get_url(): string
|
||||
{
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set_url(string $url): void
|
||||
{
|
||||
$this->url = $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function to_array(): array
|
||||
{
|
||||
return array(
|
||||
'title' => $this->get_title(),
|
||||
'title_completed' => $this->get_title_completed(),
|
||||
'is_skippable' => $this->get_is_skippable(),
|
||||
'url' => $this->get_url()
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,226 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\EasyOnboarding\Admin\Onboarding\Steps;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
class Step {
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private string $id = '';
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private bool $is_completed = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private string $title = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private string $title_completed = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private string $description = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private string $image_url = '';
|
||||
|
||||
/**
|
||||
* @var Button
|
||||
*/
|
||||
private Button $primary_button;
|
||||
|
||||
/**
|
||||
* @var Button
|
||||
*/
|
||||
private Button $secondary_button;
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
* @param string $title
|
||||
* @param string $description
|
||||
* @param string $image_url
|
||||
*/
|
||||
public function __construct(string $id, string $title = '', string $description = '', string $image_url = '') {
|
||||
$this->id = $id;
|
||||
$this->title = $title;
|
||||
$this->description = $description;
|
||||
$this->image_url = $image_url;
|
||||
$this->primary_button = new Button( '' );
|
||||
$this->secondary_button = new Button( '' );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function get_id(): string
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set_id(string $id): void
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function get_is_completed(): bool
|
||||
{
|
||||
return $this->is_completed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $is_completed
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set_is_completed(bool $is_completed): void
|
||||
{
|
||||
$this->is_completed = $is_completed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function get_title(): string
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $title
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set_title(string $title): void
|
||||
{
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function get_description(): string
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $description
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set_description(string $description): void
|
||||
{
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function get_image_url(): string
|
||||
{
|
||||
return $this->image_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $image_url
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set_image_url(string $image_url): void
|
||||
{
|
||||
$this->image_url = $image_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Button
|
||||
*/
|
||||
public function get_primary_button(): Button
|
||||
{
|
||||
return $this->primary_button;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Button $primary_button
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set_primary_button(Button $primary_button): void
|
||||
{
|
||||
$this->primary_button = $primary_button;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Button
|
||||
*/
|
||||
public function get_secondary_button(): Button
|
||||
{
|
||||
return $this->secondary_button;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Button $secondary_button
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set_secondary_button(Button $secondary_button): void
|
||||
{
|
||||
$this->secondary_button = $secondary_button;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function get_title_completed(): string
|
||||
{
|
||||
return $this->title_completed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $title_completed
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set_title_completed(string $title_completed): void
|
||||
{
|
||||
$this->title_completed = $title_completed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function to_array(): array
|
||||
{
|
||||
$primary_button = !empty($this->get_primary_button()) ? $this->get_primary_button()->to_array() : [];
|
||||
$secondary_button = !empty($this->get_secondary_button()) ? $this->get_secondary_button()->to_array() : [];
|
||||
|
||||
return array(
|
||||
'id' => $this->get_id(),
|
||||
'is_completed' => $this->get_is_completed(),
|
||||
'title' => $this->get_title(),
|
||||
'title_completed' => $this->get_title_completed(),
|
||||
'description' => $this->get_description(),
|
||||
'image_url' => $this->get_image_url(),
|
||||
'primary_button' => $primary_button,
|
||||
'secondary_button' => $secondary_button
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\EasyOnboarding\Admin\Onboarding\Steps;
|
||||
|
||||
use Hostinger\EasyOnboarding\Admin\Onboarding\Onboarding;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
class StepCategory {
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private string $title = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private string $id = '';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private array $steps = array();
|
||||
|
||||
public function __construct(string $id, string $title = '', array $steps = array()) {
|
||||
$this->title = $title;
|
||||
$this->id = $id;
|
||||
$this->steps = $steps;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function get_title(): string
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $title
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set_title(string $title): void
|
||||
{
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function get_id(): string
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set_id(string $id): void
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function get_steps(): array
|
||||
{
|
||||
return $this->steps;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $steps
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set_steps(array $steps): void
|
||||
{
|
||||
$this->steps = $steps;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Step $step
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function add_step(Step $step): void
|
||||
{
|
||||
$step = $this->update_step_status( $step );
|
||||
|
||||
$this->steps[] = $step;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function to_array(): array
|
||||
{
|
||||
return array(
|
||||
'title' => $this->get_title(),
|
||||
'id' => $this->get_id(),
|
||||
'steps' => array_map(
|
||||
function ( $item ) {
|
||||
return $item->to_array();
|
||||
},
|
||||
$this->get_steps()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Step $step
|
||||
*
|
||||
* @return Step
|
||||
*/
|
||||
public function update_step_status(Step $step): Step {
|
||||
$onboarding_steps = get_option( Onboarding::HOSTINGER_EASY_ONBOARDING_STEPS_OPTION_NAME, array() );
|
||||
|
||||
if(empty($onboarding_steps[$this->get_id()][$step->get_id()])) {
|
||||
return $step;
|
||||
}
|
||||
|
||||
$step->set_is_completed( (bool)$onboarding_steps[$this->get_id()][$step->get_id()] );
|
||||
|
||||
return $step;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\EasyOnboarding\Admin\Onboarding;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
class WelcomeCards {
|
||||
public function get_welcome_cards(): array {
|
||||
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
||||
|
||||
$welcome_cards = array();
|
||||
|
||||
if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
|
||||
$welcome_cards[] = array(
|
||||
'id' => 'woocommerce',
|
||||
'image' => 'setup-online-store.png',
|
||||
'title' => __( 'Set up an online store', 'hostinger-easy-onboarding' ),
|
||||
'link' => 'admin.php?page=hostinger-get-onboarding&subPage=hostinger-store-setup-information',
|
||||
'description' => wp_kses( __( 'Setup <strong>WooCommerce</strong>, add products or services, and start selling today.', 'hostinger-easy-onboarding' ), array( 'strong' => array() ) ),
|
||||
);
|
||||
}
|
||||
|
||||
if ( is_plugin_active( 'hostinger-affiliate-plugin/hostinger-affiliate-plugin.php' ) ) {
|
||||
$welcome_cards[] = array(
|
||||
'id' => 'affiliate',
|
||||
'image' => 'run-amazon-affiliate-site.png',
|
||||
'title' => __( 'Run an Amazon Affiliate site', 'hostinger-easy-onboarding' ),
|
||||
'link' => admin_url( 'admin.php?page=hostinger-amazon-affiliate' ),
|
||||
'description' => wp_kses( __( 'Connect your <strong>Amazon Associate</strong> account to fetch API details.', 'hostinger-easy-onboarding' ), array( 'strong' => array() ) ),
|
||||
);
|
||||
}
|
||||
|
||||
if ( is_plugin_active( 'hostinger-ai-assistant/hostinger-ai-assistant.php' ) ) {
|
||||
$welcome_cards[] = array(
|
||||
'id' => 'ai',
|
||||
'image' => 'generate-content-with-ai.png',
|
||||
'title' => __( 'Generate content with AI', 'hostinger-easy-onboarding' ),
|
||||
'link' => admin_url( 'admin.php?page=hostinger-ai-assistant' ),
|
||||
'description' => wp_kses( __( 'Get images, text, and SEO keywords created for you instantly.', 'hostinger-easy-onboarding' ), array( 'strong' => array() ) ),
|
||||
);
|
||||
}
|
||||
|
||||
return $welcome_cards;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
namespace Hostinger\EasyOnboarding\Admin;
|
||||
class Partnership {
|
||||
const MONSTERINSIGHTS_PARTNER_ID = '3107422';
|
||||
const ASTRA_PARTNER_ID = '12425';
|
||||
const WPFORMS_PARTNER_LINK = 'https://shareasale.com/r.cfm?b=834775&u=3107422&m=64312&urllink=';
|
||||
const AIOSEO_PARTNER_LINK = 'https://shareasale.com/r.cfm?b=1491200&u=3107422&m=94778&urllink=';
|
||||
const HESTIA_AND_NEVE_PARTNER_LINK = 'https://www.shareasale.com/r.cfm?b=642802&u=3107422&m=55096';
|
||||
|
||||
public function __construct() {
|
||||
if ( is_admin() ) {
|
||||
$this->define_admin_hooks();
|
||||
}
|
||||
|
||||
add_action( 'init', array( $this, 'schedule_weekly_cron_job' ) );
|
||||
}
|
||||
|
||||
public function partner_astra() {
|
||||
add_option( 'astra_partner_url_param', self::ASTRA_PARTNER_ID, '', 'no' );
|
||||
}
|
||||
|
||||
public function partner_monsterinsights( $id ) {
|
||||
return self::MONSTERINSIGHTS_PARTNER_ID;
|
||||
}
|
||||
|
||||
public function wpforms_upgrade_link( $link ) {
|
||||
return self::WPFORMS_PARTNER_LINK . rawurlencode( $link );
|
||||
}
|
||||
|
||||
public function aioseo_upgrade_link( $link ) {
|
||||
return self::AIOSEO_PARTNER_LINK . rawurlencode( $link );
|
||||
}
|
||||
|
||||
public function neve_or_hestia_upgrade_link( $utmify_url, $url ) {
|
||||
if ( strpos( $url, 'themes/neve/upgrade' ) !== false || strpos( $url, 'themes/hestia-pro/upgrade' ) !== false ) {
|
||||
return self::HESTIA_AND_NEVE_PARTNER_LINK;
|
||||
}
|
||||
|
||||
return $utmify_url;
|
||||
}
|
||||
|
||||
private function define_admin_hooks() {
|
||||
add_filter( 'optinmonster_sas_id', array( $this, 'partner_monsterinsights' ) );
|
||||
add_filter( 'monsterinsights_shareasale_id', array( $this, 'partner_monsterinsights' ) );
|
||||
add_filter( 'wpforms_upgrade_link', array( $this, 'wpforms_upgrade_link' ) );
|
||||
add_filter( 'aioseo_upgrade_link', array( $this, 'aioseo_upgrade_link' ) );
|
||||
add_filter( 'tsdk_utmify_url_neve', array( $this, 'neve_or_hestia_upgrade_link' ), 11, 2 );
|
||||
add_filter( 'tsdk_utmify_url_hestia-pro', array( $this, 'neve_or_hestia_upgrade_link' ), 11, 2 );
|
||||
}
|
||||
|
||||
public function schedule_weekly_cron_job() {
|
||||
if ( ! wp_next_scheduled( 'run_weekly_partner_astra' ) ) {
|
||||
wp_schedule_event( time(), 'weekly', 'run_weekly_partner_astra' );
|
||||
}
|
||||
add_action( 'run_weekly_partner_astra', array( $this, 'run_weekly_partner_astra' ) );
|
||||
}
|
||||
|
||||
public function run_weekly_partner_astra() {
|
||||
if ( ! get_option( 'astra_partner_url_param' ) ) {
|
||||
$this->partner_astra();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\EasyOnboarding\Admin;
|
||||
|
||||
use Hostinger\EasyOnboarding\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
class Redirects
|
||||
{
|
||||
private string $platform;
|
||||
public const PLATFORM_HPANEL = 'hpanel';
|
||||
public const BUILDER_TYPE = 'prebuilt';
|
||||
public const HOMEPAGE_DISPLAY = 'page';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
if ( ! Settings::get_setting('first_login_at')) {
|
||||
Settings::update_setting('first_login_at', gmdate('Y-m-d H:i:s'));
|
||||
}
|
||||
|
||||
if (isset($_GET['platform'])) {
|
||||
$this->platform = sanitize_text_field($_GET['platform']);
|
||||
|
||||
if ($this->platform === self::PLATFORM_HPANEL) {
|
||||
$this->loginRedirect();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function loginRedirect(): void
|
||||
{
|
||||
$isPrebuildWebsite = get_option('hostinger_builder_type', '') === self::BUILDER_TYPE;
|
||||
$isWoocommercePage = in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')));
|
||||
$homepageId = get_option('show_on_front') === self::HOMEPAGE_DISPLAY ? get_option('page_on_front') : null;
|
||||
$isGutenbergPage = $homepageId ? has_blocks(get_post($homepageId)->post_content) : false;
|
||||
|
||||
add_action('init', function () use ($isPrebuildWebsite, $isWoocommercePage, $homepageId, $isGutenbergPage) {
|
||||
if ($isPrebuildWebsite && ! $isWoocommercePage && $homepageId && $isGutenbergPage) {
|
||||
// Redirect to the Gutenberg editor for the homepage
|
||||
$redirectUrl = get_edit_post_link($homepageId, '');
|
||||
} else {
|
||||
$redirectUrl = admin_url('admin.php?page=hostinger');
|
||||
}
|
||||
|
||||
wp_safe_redirect($redirectUrl);
|
||||
exit;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\EasyOnboarding\Admin;
|
||||
|
||||
use Hostinger\Surveys\SurveyManager;
|
||||
use Hostinger\WpHelper\Utils as Helper;
|
||||
|
||||
class Surveys {
|
||||
public const TIME_15_MINUTES = 900;
|
||||
public const DAY_IN_SECONDS = 86400;
|
||||
public const WOO_SURVEY_ID = 'woo_survey';
|
||||
public const PREBUILD_WEBSITE_SURVEY_ID = 'prebuild_website';
|
||||
public const AI_ONBOARDING_SURVEY_ID = 'ai_onboarding';
|
||||
public const PREBUILD_WEBSITE_SURVEY_LOCATION = 'wordpress_prebuild_website';
|
||||
public const WOO_SURVEY_LOCATION = 'wordpress_woocommerce_onboarding';
|
||||
public const AI_ONBOARDING_SURVEY_LOCATION = 'wordpress_ai_onboarding';
|
||||
public const WOO_SURVEY_PRIORITY = 100;
|
||||
public const PREBUILD_WEBSITE_SURVEY_PRIORITY = 90;
|
||||
public const AI_ONBOARDING_SURVEY_PRIORITY = 80;
|
||||
public const SUBMITTED_SURVEY_TRANSIENT = 'submitted_survey_transient';
|
||||
private SurveyManager $surveyManager;
|
||||
|
||||
public function __construct( SurveyManager $surveyManager ) {
|
||||
$this->surveyManager = $surveyManager;
|
||||
}
|
||||
|
||||
public function init() {
|
||||
add_filter( 'hostinger_add_surveys', [ $this, 'createSurveys' ] );
|
||||
}
|
||||
|
||||
public function createSurveys( $surveys ) {
|
||||
if ( $this->isWoocommerceSurveyEnabled() ) {
|
||||
$scoreQuestion = esc_html__( 'How would you rate your experience setting up a WooCommerce site on our hosting?', 'hostinger-easy-onboarding' );
|
||||
$commentQuestion = esc_html__( 'Do you have any comments/suggestions to improve our WooCommerce onboarding?', 'hostinger-easy-onboarding' );
|
||||
$wooSurvey = SurveyManager::addSurvey( self::WOO_SURVEY_ID, $scoreQuestion, $commentQuestion, self::WOO_SURVEY_LOCATION, self::WOO_SURVEY_PRIORITY );
|
||||
$surveys[] = $wooSurvey;
|
||||
}
|
||||
|
||||
if ( $this->isPrebuildWebsiteSurveyEnabled() ) {
|
||||
$scoreQuestion = esc_html__( 'How would you rate your experience building a website based on a pre-built template? (Score 1-10)', 'hostinger-easy-onboarding' );
|
||||
$commentQuestion = esc_html__( 'How could we make it easier to create a new WordPress website?', 'hostinger-easy-onboarding' );
|
||||
$prebuildWebsiteSurvey = SurveyManager::addSurvey( self::PREBUILD_WEBSITE_SURVEY_ID, $scoreQuestion, $commentQuestion, self::PREBUILD_WEBSITE_SURVEY_LOCATION, self::PREBUILD_WEBSITE_SURVEY_PRIORITY );
|
||||
$surveys[] = $prebuildWebsiteSurvey;
|
||||
}
|
||||
|
||||
if ( $this->isAiOnboardingSurveyEnabled() ) {
|
||||
$scoreQuestion = esc_html__( 'How would you rate your experience using our AI content generation tools in onboarding? (Scale 1-10)', 'hostinger-easy-onboarding' );
|
||||
$commentQuestion = esc_html__( 'Do you have any comments/suggestions to improve our AI tools?', 'hostinger-easy-onboarding' );
|
||||
$prebuildWebsiteSurvey = SurveyManager::addSurvey( self::AI_ONBOARDING_SURVEY_ID, $scoreQuestion, $commentQuestion, self::AI_ONBOARDING_SURVEY_LOCATION, self::AI_ONBOARDING_SURVEY_PRIORITY );
|
||||
$surveys[] = $prebuildWebsiteSurvey;
|
||||
}
|
||||
|
||||
return $surveys;
|
||||
}
|
||||
|
||||
public function isWoocommerceSurveyEnabled(): bool {
|
||||
|
||||
if ( defined( 'DOING_AJAX' ) && \DOING_AJAX ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$notSubmitted = ! get_transient( self::SUBMITTED_SURVEY_TRANSIENT );
|
||||
$notCompleted = $this->surveyManager->isSurveyNotCompleted( self::WOO_SURVEY_ID );
|
||||
$isWoocommercePage = $this->surveyManager->isWoocommerceAdminPage();
|
||||
$defaultWoocommerceCompleted = $this->surveyManager->defaultWoocommerceSurveyCompleted();
|
||||
$oldestProductDate = $this->surveyManager->getOldestProductDate();
|
||||
$sevenDaysAgo = strtotime( '-7 days' );
|
||||
$isClientEligible = $this->surveyManager->isClientEligible();
|
||||
|
||||
if ( $oldestProductDate < $sevenDaysAgo || ! $this->isWithinCreationDateLimit() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $notSubmitted && $notCompleted && $isWoocommercePage && $defaultWoocommerceCompleted && $isClientEligible;
|
||||
}
|
||||
|
||||
public function isPrebuildWebsiteSurveyEnabled(): bool {
|
||||
|
||||
if ( defined( 'DOING_AJAX' ) && \DOING_AJAX ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$helper = new Helper();
|
||||
$notSubmitted = ! get_transient( self::SUBMITTED_SURVEY_TRANSIENT );
|
||||
$notCompleted = $this->surveyManager->isSurveyNotCompleted( self::PREBUILD_WEBSITE_SURVEY_ID );
|
||||
$isHostingerAdminPage = $helper->isThisPage( 'hostinger-get-onboarding' );
|
||||
$isClientEligible = $this->surveyManager->isClientEligible();
|
||||
$astra_templates_active = $helper->isPluginActive( 'astra-sites' );
|
||||
|
||||
if ( ! $isHostingerAdminPage || ! $this->isWithinCreationDateLimit() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $notSubmitted && $notCompleted && $isClientEligible && $astra_templates_active;
|
||||
}
|
||||
|
||||
public function isAiOnboardingSurveyEnabled(): bool {
|
||||
if ( defined( 'DOING_AJAX' ) && \DOING_AJAX ) {
|
||||
return false;
|
||||
}
|
||||
$helper = new Helper();
|
||||
$firstLoginAt = strtotime( get_option( 'hostinger_first_login_at', time() ) );
|
||||
$notSubmitted = ! get_transient( self::SUBMITTED_SURVEY_TRANSIENT );
|
||||
$notCompleted = $this->surveyManager->isSurveyNotCompleted( self::AI_ONBOARDING_SURVEY_ID );
|
||||
$isClientEligible = $this->surveyManager->isClientEligible();
|
||||
$isAiOnboardingPassed = get_option( 'hostinger_ai_onboarding', '' );
|
||||
$isHostingerAdminPage = $helper->isThisPage( 'hostinger-get-onboarding' );
|
||||
|
||||
if ( ! $isAiOnboardingPassed || ! $this->isWithinCreationDateLimit() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( isset( $_SERVER['H_STAGING'] ) && $_SERVER['H_STAGING'] ) {
|
||||
return $notSubmitted && $notCompleted && $isClientEligible && $isHostingerAdminPage;
|
||||
}
|
||||
|
||||
if ($firstLoginAt && !$this->isTimeElapsed($firstLoginAt, self::TIME_15_MINUTES)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $notSubmitted && $notCompleted && $isClientEligible && $isHostingerAdminPage;
|
||||
}
|
||||
|
||||
|
||||
public function isTimeElapsed( string $firstLoginAt, int $timeInSeconds ): bool {
|
||||
$currentTime = time();
|
||||
$timeElapsed = $currentTime - $timeInSeconds;
|
||||
|
||||
return $timeElapsed >= $firstLoginAt;
|
||||
}
|
||||
|
||||
private function isWithinCreationDateLimit() : bool {
|
||||
$oldestUser = get_users( array(
|
||||
'number' => 1,
|
||||
'orderby' => 'registered',
|
||||
'order' => 'ASC',
|
||||
'fields' => array( 'user_registered' ),
|
||||
) );
|
||||
|
||||
$oldestUserDate = isset( $oldestUser[0]->user_registered ) ? strtotime( $oldestUser[0]->user_registered ): false;
|
||||
|
||||
return $oldestUserDate && ( time() - $oldestUserDate ) <= ( 7 * self::DAY_IN_SECONDS );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Hostinger\WpMenuManager\Menus;
|
||||
|
||||
echo Menus::renderMenuNavigation();
|
||||
?>
|
||||
<div id="hostinger-easy-onboarding-vue-app"/>
|
||||
<?php
|
||||
@@ -0,0 +1,39 @@
|
||||
<div class="hostinger hsr-banner-container">
|
||||
<div class="hsr-promotional-banner">
|
||||
<div class="hsr-promotional-banner-content">
|
||||
<div>
|
||||
<div class="hsr-onboarding__title"><?php echo esc_html__( 'Invite a Friend, Earn Up to $100', 'hostinger-easy-onboarding' ); ?></div>
|
||||
<p class="hsr-promotional-banner-description">
|
||||
<?php
|
||||
echo wp_kses(
|
||||
__(
|
||||
'Share your referral link with friends and family and <b>receive 20% commission</b> for every successful referral.',
|
||||
'hostinger-easy-onboarding'
|
||||
),
|
||||
array(
|
||||
'b' => array(), // Allowing only <b> tags
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="hsr-buttons">
|
||||
<a class="hsr-btn hsr-purple-btn"
|
||||
href="<?php echo esc_url( $helper->get_promotional_link_url( get_locale() ) ); ?>"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"><?php echo esc_html__( 'Start earning', 'hostinger-easy-onboarding' ); ?></a>
|
||||
<svg class="close-btn"
|
||||
width="25"
|
||||
height="24"
|
||||
viewBox="0 0 25 24"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
d="M19.5 6.41L18.09 5L12.5 10.59L6.91 5L5.5 6.41L11.09 12L5.5 17.59L6.91 19L12.5 13.41L18.09 19L19.5 17.59L13.91 12L19.5 6.41Z"
|
||||
fill="#2F1C6A"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,52 @@
|
||||
<div class="hostinger hsr-plugin-rating">
|
||||
<p><?php echo esc_html__( 'Rate this plugin', 'hostinger-easy-onboarding' ); ?></p>
|
||||
<div class="hsr-rate-stars">
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
d="M12 17.27L18.18 21L16.54 13.97L22 9.24L14.81 8.63L12 2L9.19 8.63L2 9.24L7.46 13.97L5.82 21L12 17.27Z"
|
||||
fill="#673DE6"/>
|
||||
</svg>
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
d="M12 17.27L18.18 21L16.54 13.97L22 9.24L14.81 8.63L12 2L9.19 8.63L2 9.24L7.46 13.97L5.82 21L12 17.27Z"
|
||||
fill="#673DE6"/>
|
||||
</svg>
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
d="M12 17.27L18.18 21L16.54 13.97L22 9.24L14.81 8.63L12 2L9.19 8.63L2 9.24L7.46 13.97L5.82 21L12 17.27Z"
|
||||
fill="#673DE6"/>
|
||||
</svg>
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
d="M12 17.27L18.18 21L16.54 13.97L22 9.24L14.81 8.63L12 2L9.19 8.63L2 9.24L7.46 13.97L5.82 21L12 17.27Z"
|
||||
fill="#673DE6"/>
|
||||
</svg>
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
d="M12 17.27L18.18 21L16.54 13.97L22 9.24L14.81 8.63L12 2L9.19 8.63L2 9.24L7.46 13.97L5.82 21L12 17.27Z"
|
||||
fill="#673DE6"/>
|
||||
</svg>
|
||||
</div>
|
||||
<p class="hsr-promotional-banner-description">
|
||||
<?php
|
||||
echo wp_kses(
|
||||
__(
|
||||
'on <a href="https://wordpress.org/support/plugin/hostinger/reviews/#new-post" target="_blank" rel="noopener noreferrer">WordPress.org</a>',
|
||||
'hostinger-easy-onboarding'
|
||||
),
|
||||
array(
|
||||
'a' => array(
|
||||
'href' => array(),
|
||||
'target' => array(),
|
||||
'rel' => array(),
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\EasyOnboarding\AmplitudeEvents;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
class Actions {
|
||||
public const ONBOARDING_ITEM_COMPLETED = 'wordpress.easy_onboarding.item_completed';
|
||||
|
||||
public const WOO_ITEM_COMPLETED = 'wordpress.woocommerce.item_completed';
|
||||
|
||||
public const WOO_READY_TO_SELL = 'wordpress.woocommerce.store.ready_to_sell';
|
||||
|
||||
public const WOO_SETUP_COMPLETED = 'wordpress.woocommerce.store_setup.completed';
|
||||
public const WP_EDIT = 'wordpress.edit_saved';
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\EasyOnboarding\AmplitudeEvents;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
use Hostinger\Amplitude\AmplitudeManager;
|
||||
use Hostinger\EasyOnboarding\AmplitudeEvents\Actions as AmplitudeActions;
|
||||
use Hostinger\WpHelper\Utils as Helper;
|
||||
use Hostinger\WpHelper\Requests\Client;
|
||||
use Hostinger\WpHelper\Config;
|
||||
use Hostinger\WpHelper\Constants;
|
||||
|
||||
class Amplitude
|
||||
{
|
||||
public const WEBSITE_BUILDER_TYPE = 'ai';
|
||||
/**
|
||||
* @var Helper
|
||||
*/
|
||||
private Helper $helper;
|
||||
|
||||
/**
|
||||
* @var Client
|
||||
*/
|
||||
private Client $client;
|
||||
|
||||
/**
|
||||
* @var Config
|
||||
*/
|
||||
private Config $configHandler;
|
||||
|
||||
private array $options = [];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->helper = new Helper();
|
||||
$this->configHandler = new Config();
|
||||
$this->client = new Client(
|
||||
$this->configHandler->getConfigValue('base_rest_uri', Constants::HOSTINGER_REST_URI), [
|
||||
Config::TOKEN_HEADER => Helper::getApiToken(),
|
||||
Config::DOMAIN_HEADER => $this->helper->getHostInfo(),
|
||||
]
|
||||
);
|
||||
$this->options['builder_type'] = get_option('hostinger_builder_type', '');
|
||||
$this->options['website_id'] = get_option('hostinger_website_id', '');
|
||||
$this->options['subscription_id'] = get_option('hostinger_subscription_id', '');
|
||||
$this->options['event_data'] = get_option('hostinger_amplitude_event_data', []);
|
||||
$this->options['edit_count'] = get_option('hostinger_amplitude_edit_count', 0);
|
||||
$this->options['ai_version'] = get_option('hostinger_ai_version', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $params
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function send_event(array $params): array
|
||||
{
|
||||
$amplitudeManager = new AmplitudeManager($this->helper, $this->configHandler, $this->client);
|
||||
|
||||
return $amplitudeManager->sendRequest($amplitudeManager::AMPLITUDE_ENDPOINT, $params);
|
||||
}
|
||||
|
||||
public function sendEditAmplitudeEvent(): void
|
||||
{
|
||||
$edit_count = $this->incrementAmplitudeEditEventCount();
|
||||
|
||||
$params = [
|
||||
'action' => AmplitudeActions::WP_EDIT,
|
||||
'wp_builder_type' => $this->options['builder_type'],
|
||||
'website_id' => $this->options['website_id'],
|
||||
'subscription_id' => $this->options['subscription_id'],
|
||||
'edit_count' => $edit_count,
|
||||
];
|
||||
|
||||
$this->send_event($params);
|
||||
}
|
||||
|
||||
public function canSendEditAmplitudeEvent(): bool
|
||||
{
|
||||
$today = date('Y-m-d');
|
||||
$event_data = $this->options['event_data'];
|
||||
$isAiWebsiteNotGenerated = !$this->options['ai_version'];
|
||||
|
||||
if (!$this->options['builder_type'] || !$this->options['website_id'] || !$this->options['subscription_id']) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->options['builder_type'] == self::WEBSITE_BUILDER_TYPE && $isAiWebsiteNotGenerated) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!is_array($event_data)) {
|
||||
$event_data = [];
|
||||
}
|
||||
|
||||
// Check if we already have data for today
|
||||
$today_event = $event_data[$today] ?? ['count' => 0, 'last_reset' => 0];
|
||||
|
||||
// Only update if the event count is less than 3
|
||||
if ($today_event['count'] < 3) {
|
||||
$today_event['count'] += 1;
|
||||
$event_data[$today] = $today_event;
|
||||
|
||||
update_option('hostinger_amplitude_event_data', $event_data);
|
||||
wp_cache_delete('hostinger_amplitude_event_data', 'options');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function incrementAmplitudeEditEventCount(): int
|
||||
{
|
||||
$edit_count = (int) $this->options['edit_count'] + 1;
|
||||
|
||||
update_option('hostinger_amplitude_edit_count', $edit_count);
|
||||
wp_cache_delete('hostinger_amplitude_event_data', 'options');
|
||||
|
||||
return $edit_count;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\EasyOnboarding;
|
||||
|
||||
use Hostinger\EasyOnboarding\Admin\Surveys;
|
||||
use Hostinger\EasyOnboarding\Rest\Routes;
|
||||
use Hostinger\EasyOnboarding\Rest\StepRoutes;
|
||||
use Hostinger\EasyOnboarding\Rest\TutorialRoutes;
|
||||
use Hostinger\EasyOnboarding\Rest\WelcomeRoutes;
|
||||
use Hostinger\EasyOnboarding\Rest\WooRoutes;
|
||||
use Hostinger\EasyOnboarding\Admin\Assets as AdminAssets;
|
||||
use Hostinger\EasyOnboarding\Admin\Hooks as AdminHooks;
|
||||
use Hostinger\EasyOnboarding\Admin\Menu as AdminMenu;
|
||||
use Hostinger\EasyOnboarding\Admin\Ajax as AdminAjax;
|
||||
use Hostinger\EasyOnboarding\Admin\Partnership;
|
||||
use Hostinger\EasyOnboarding\Admin\Redirects as AdminRedirects;
|
||||
use Hostinger\EasyOnboarding\Preview\Assets as PreviewAssets;
|
||||
use Hostinger\EasyOnboarding\Admin\Onboarding\AutocompleteSteps;
|
||||
use Hostinger\Surveys\SurveyManager;
|
||||
use Hostinger\Surveys\Rest as SurveysRest;
|
||||
use Hostinger\WpHelper\Config;
|
||||
use Hostinger\WpHelper\Constants;
|
||||
use Hostinger\WpHelper\Utils as Helper;
|
||||
use Hostinger\WpHelper\Requests\Client;
|
||||
use Hostinger\EasyOnboarding\Cli;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
class Bootstrap {
|
||||
protected Loader $loader;
|
||||
|
||||
public function __construct() {
|
||||
$this->loader = new Loader();
|
||||
}
|
||||
|
||||
public function run(): void {
|
||||
$this->load_dependencies();
|
||||
$this->set_locale();
|
||||
$this->loader->run();
|
||||
}
|
||||
|
||||
private function load_dependencies(): void {
|
||||
$this->load_onboarding_dependencies();
|
||||
$this->load_public_dependencies();
|
||||
|
||||
|
||||
if ( is_admin() ) {
|
||||
$this->load_admin_dependencies();
|
||||
}
|
||||
|
||||
if ( defined( 'WP_CLI' ) && WP_CLI ) {
|
||||
new Cli();
|
||||
}
|
||||
}
|
||||
|
||||
private function set_locale() {
|
||||
$plugin_i18n = new I18n();
|
||||
$this->loader->add_action( 'init', $plugin_i18n, 'load_plugin_textdomain' );
|
||||
}
|
||||
|
||||
private function surveys(): void
|
||||
{
|
||||
$helper = new Helper();
|
||||
$config = new Config();
|
||||
$client = new Client(
|
||||
$config->getConfigValue( 'base_rest_uri', Constants::HOSTINGER_REST_URI ),
|
||||
[
|
||||
Config::TOKEN_HEADER => $helper->getApiToken(),
|
||||
Config::DOMAIN_HEADER => $helper->getHostInfo(),
|
||||
]
|
||||
);
|
||||
|
||||
if ( class_exists( SurveyManager::class ) ) {
|
||||
$surveysRest = new SurveysRest( $client );
|
||||
$surveyManager = new SurveyManager( $helper, $config, $surveysRest );
|
||||
$surveys = new Surveys( $surveyManager );
|
||||
$surveys->init();
|
||||
}
|
||||
}
|
||||
|
||||
private function load_admin_dependencies(): void
|
||||
{
|
||||
$this->surveys();
|
||||
new AdminAssets();
|
||||
new AdminHooks();
|
||||
new AdminMenu();
|
||||
new AdminRedirects();
|
||||
new AdminAjax();
|
||||
new Partnership();
|
||||
}
|
||||
|
||||
private function load_public_dependencies(): void {
|
||||
new PreviewAssets();
|
||||
new Hooks();
|
||||
new Updates();
|
||||
|
||||
$welcome_routes = new WelcomeRoutes();
|
||||
$step_routes = new StepRoutes();
|
||||
$woo_routes = new WooRoutes();
|
||||
$tutorial_routes = new TutorialRoutes();
|
||||
|
||||
$routes = new Routes( $welcome_routes, $step_routes, $woo_routes, $tutorial_routes );
|
||||
$routes->init();
|
||||
}
|
||||
|
||||
private function load_onboarding_dependencies(): void {
|
||||
new AutocompleteSteps();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\EasyOnboarding;
|
||||
|
||||
use WP_CLI;
|
||||
use Hostinger\EasyOnboarding\Cli\Commands\OnboardingStatus;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
class Cli {
|
||||
/**
|
||||
* Load required files and hooks to make the CLI work.
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->hooks();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up and hooks WP CLI to our CLI code.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function hooks(): void {
|
||||
if ( class_exists( '\WP_CLI' ) && class_exists( OnboardingStatus::class ) ) {
|
||||
WP_CLI::add_hook( 'after_wp_load', array(
|
||||
OnboardingStatus::class,
|
||||
'define_command'
|
||||
) );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Hostinger\EasyOnboarding\Cli\Commands;
|
||||
|
||||
/**
|
||||
* Interface OnboardingStatusInterface
|
||||
*
|
||||
* This interface defines the methods for checking the status of Hostinger Easy Onboarding.
|
||||
*/
|
||||
interface CLICommand {
|
||||
/**
|
||||
* Defines the WP-CLI command for Hostinger onboarding status.
|
||||
*
|
||||
* Adds the 'hostinger onboarding' command to WP-CLI with a short and long description.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function define_command(): void;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php /** @noinspection PhpIllegalPsrClassPathInspection */
|
||||
|
||||
namespace Hostinger\EasyOnboarding\Cli\Commands;
|
||||
|
||||
use Hostinger\EasyOnboarding\Helper;
|
||||
use WP_CLI;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Class OnboardingStatus
|
||||
*
|
||||
* This class defines the WP-CLI command for checking the status of Hostinger Easy Onboarding.
|
||||
*/
|
||||
class OnboardingStatus implements CLICommand {
|
||||
/**
|
||||
* Defines the WP-CLI command for Hostinger onboarding status.
|
||||
*
|
||||
* Adds the 'hostinger onboarding' command to WP-CLI with a short and long description.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function define_command(): void {
|
||||
if ( class_exists( '\WP_CLI' ) ) {
|
||||
WP_CLI::add_command(
|
||||
'hostinger onboarding',
|
||||
self::class,
|
||||
[
|
||||
'shortdesc' => 'Check the status of Hostinger Easy Onboarding',
|
||||
'longdesc' => 'This command allows you to check the status of Hostinger Easy Onboarding Progress for the WooCommerce store.' . "\n\n" .
|
||||
'## EXAMPLES' . "\n\n" .
|
||||
' wp hostinger onboarding woocommerce_status' . "\n" .
|
||||
' Returns whether Hostinger Easy Onboarding for WooCommerce Store setup is completed or is ready to sell in JSON.',
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function woocommerce_status(): void
|
||||
{
|
||||
$helper = new Helper();
|
||||
|
||||
$onboarding = [
|
||||
'woocommerce_onboarding_ready_to_sell' => $helper->is_woocommerce_store_ready(),
|
||||
'woocommerce_onboarding_status' => $helper->is_woocommerce_onboarding_completed(),
|
||||
];
|
||||
|
||||
WP_CLI::line(wp_json_encode($onboarding));
|
||||
}
|
||||
}
|
||||