fresh-install.php
5 years ago
migrate-data.php
5 years ago
release-highlight.php
5 years ago
review-conditions.php
5 years ago
migrate-data.php
296 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Dialog for migrating tracking from 3.x to 4.x. |
| 4 | * |
| 5 | * @package Hustle |
| 6 | * @since 4.0.0 |
| 7 | */ |
| 8 | |
| 9 | $slide_one_1x = self::$plugin_url . 'assets/images/onboard-welcome.png'; |
| 10 | $slide_one_2x = self::$plugin_url . 'assets/images/onboard-welcome@2x.png'; |
| 11 | |
| 12 | $slide_two_1x = self::$plugin_url . 'assets/images/onboard-migrate.png'; |
| 13 | $slide_two_2x = self::$plugin_url . 'assets/images/onboard-migrate@2x.png'; |
| 14 | |
| 15 | $slide_three_1x = self::$plugin_url . 'assets/images/onboard-create.png'; |
| 16 | $slide_three_2x = self::$plugin_url . 'assets/images/onboard-create@2x.png'; |
| 17 | |
| 18 | $is_first_time_opening = empty( filter_input( INPUT_GET, 'show-migrate', FILTER_VALIDATE_BOOLEAN ) ); |
| 19 | $support_link = 'https://premium.wpmudev.org/get-support/'; |
| 20 | |
| 21 | if ( Opt_In_Utils::_is_free() ) { |
| 22 | $support_link = 'https://wordpress.org/support/plugin/wordpress-popup/'; |
| 23 | } |
| 24 | |
| 25 | $user = wp_get_current_user(); |
| 26 | $username = ! empty( $user->user_firstname ) ? $user->user_firstname : $user->user_login; |
| 27 | ?> |
| 28 | |
| 29 | <div class="sui-modal sui-modal-md"> |
| 30 | |
| 31 | <div |
| 32 | role="dialog" |
| 33 | id="hustle-dialog--migrate" |
| 34 | class="sui-modal-content" |
| 35 | aria-modal="true" |
| 36 | aria-label="<?php esc_html_e( 'Modal for migrating your existing tracking data to the latest Hustle version.', 'hustle' ); ?>" |
| 37 | aria-live="polite" |
| 38 | data-nonce="<?php echo esc_attr( wp_create_nonce( 'hustle_dismiss_notification' ) ); ?>" |
| 39 | data-is-first="<?php echo $is_first_time_opening ? '1' : '0'; ?>" |
| 40 | > |
| 41 | |
| 42 | <?php // SLIDE 1: Welcome. ?> |
| 43 | <div id="hustle-dialog--migrate-slide-1" class="sui-modal-slide"> |
| 44 | |
| 45 | <div class="sui-box" role="document"> |
| 46 | |
| 47 | <div class="sui-box-header sui-flatten sui-content-center sui-spacing-top--60"> |
| 48 | |
| 49 | <?php if ( ! $this->is_branding_hidden ) : ?> |
| 50 | <figure class="sui-box-banner" role="banner" aria-hidden="true"> |
| 51 | <?php echo $this->render_image_markup( $slide_one_1x, $slide_one_2x, 'sui-image sui-image-center' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 52 | </figure> |
| 53 | <?php endif; ?> |
| 54 | |
| 55 | <h3 class="sui-box-title sui-lg"> |
| 56 | <?php /* translators: username. */ ?> |
| 57 | <?php printf( esc_html__( 'Hey, %s', 'hustle' ), esc_html( $username ) ); ?> |
| 58 | </h3> |
| 59 | |
| 60 | <p class="sui-description"><?php esc_html_e( "Welcome to Hustle, the only plugin you'll ever need to turn your visitors into loyal subscribers, leads and customers.", 'hustle' ); ?></p> |
| 61 | |
| 62 | </div> |
| 63 | |
| 64 | <div class="sui-box-body sui-content-center sui-spacing-bottom--60"> |
| 65 | |
| 66 | <button |
| 67 | id="hustle-migrate-get-started" |
| 68 | class="sui-button sui-button-blue sui-button-icon-right" |
| 69 | data-modal-slide="hustle-dialog--migrate-slide-2" |
| 70 | data-modal-slide-focus="hustle-migrate-start" |
| 71 | data-modal-slide-intro="next" |
| 72 | > |
| 73 | <?php esc_html_e( 'Get Started', 'hustle' ); ?> |
| 74 | <span class="sui-icon-chevron-right" aria-hidden="true"></span> |
| 75 | </button> |
| 76 | |
| 77 | </div> |
| 78 | |
| 79 | </div> |
| 80 | |
| 81 | </div> |
| 82 | |
| 83 | <?php // SLIDE 2: Migrate. ?> |
| 84 | <div id="hustle-dialog--migrate-slide-2" class="sui-modal-slide"> |
| 85 | |
| 86 | <div class="sui-box" role="document"> |
| 87 | |
| 88 | <div class="sui-box-header sui-flatten sui-content-center sui-spacing-top--60"> |
| 89 | |
| 90 | <figure class="sui-box-banner" role="banner" aria-hidden="true"> |
| 91 | <?php echo $this->render_image_markup( $slide_two_1x, $slide_two_2x, 'sui-image sui-image-center' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 92 | </figure> |
| 93 | |
| 94 | <h3 |
| 95 | id="hustle-dialog--migrate-slide-2-title" |
| 96 | class="sui-box-title sui-lg" |
| 97 | data-done-text="<?php esc_html_e( 'Migration complete', 'hustle' ); ?>" |
| 98 | > |
| 99 | <?php esc_html_e( 'Migrate Data', 'hustle' ); ?> |
| 100 | </h3> |
| 101 | |
| 102 | <p |
| 103 | id="hustle-dialog--migrate-slide-2-description" |
| 104 | class="sui-description" |
| 105 | style="margin-bottom: 0;" |
| 106 | data-default-text="<?php esc_html_e( 'Nice work on updating the Hustle! All your modules are already in place. However, you need to migrate the data of your existing modules such as tracking data and email list manually.', 'hustle' ); ?>" |
| 107 | data-migrate-text="<?php esc_html_e( 'Data migration is in progress. It can take anywhere from a few seconds to a couple of hours depending upon the data of your existing modules and traffic on your site.', 'hustle' ); ?>" |
| 108 | data-done-text="<?php esc_html_e( "We've successfully migrated your existing data. You're good to continue using Hustle!", 'hustle' ); ?>" |
| 109 | > |
| 110 | <?php esc_html_e( 'Nice work on updating the Hustle! All your modules are already in place. However, you need to migrate the data of your existing modules such as tracking data and email list manually.', 'hustle' ); ?> |
| 111 | </p> |
| 112 | |
| 113 | </div> |
| 114 | |
| 115 | |
| 116 | <div class="sui-box-body sui-content-center sui-spacing-bottom--60" data-migrate-start> |
| 117 | |
| 118 | <button |
| 119 | id="hustle-migrate-start" |
| 120 | class="sui-button sui-button-icon-right" |
| 121 | data-nonce="<?php echo esc_attr( wp_create_nonce( 'hustle-migrate-tracking-and-subscriptions' ) ); ?>" |
| 122 | > |
| 123 | <span class="sui-loading-text"> |
| 124 | <?php esc_html_e( 'Begin Migration', 'hustle' ); ?> |
| 125 | <span class="sui-icon-chevron-right" aria-hidden="true"></span> |
| 126 | </span> |
| 127 | <span class="sui-icon-loader sui-loading" aria-hidden="true"></span> |
| 128 | </button> |
| 129 | |
| 130 | </div> |
| 131 | |
| 132 | <div class="sui-box-body sui-content-center sui-spacing-bottom--60" style="display:none;" aria-hidden="true" hidden data-migrate-progress> |
| 133 | |
| 134 | <div class="sui-progress-block"> |
| 135 | |
| 136 | <div class="sui-progress"> |
| 137 | |
| 138 | <span class="sui-progress-icon" aria-hidden="true"> |
| 139 | <span class="sui-icon-loader sui-loading" aria-hidden="true"></span> |
| 140 | </span> |
| 141 | |
| 142 | <span class="sui-progress-text"> |
| 143 | <span>0%</span> |
| 144 | </span> |
| 145 | |
| 146 | <div class="sui-progress-bar" aria-hidden="true"> |
| 147 | <span style="width: 0%"></span> |
| 148 | </div> |
| 149 | |
| 150 | </div> |
| 151 | |
| 152 | </div> |
| 153 | |
| 154 | <div class="sui-progress-state"> |
| 155 | <?php /* translators: html tags. */ ?> |
| 156 | <span><?php printf( esc_html__( 'Rows migrated: %1$s%3$s/%2$s%3$s' ), '<span id="hustle-partial-rows" style="display: inline;">', '<span id="hustle-total-rows" style="display: inline;">', '</span>' ); ?></span> |
| 157 | </div> |
| 158 | |
| 159 | </div> |
| 160 | |
| 161 | <div class="sui-box-body sui-content-center" style="display:none;" aria-hidden="true" hidden data-migrate-failed> |
| 162 | |
| 163 | <?php |
| 164 | $notice_options = array( |
| 165 | array( |
| 166 | 'type' => 'inline_notice', |
| 167 | 'id' => 'hustle-dialog--migrate-error-notice', |
| 168 | 'value' => '', |
| 169 | 'attributes' => array( |
| 170 | /* translators: 1. opening 'a' tag to support link, 2. closing 'a' tag */ |
| 171 | 'data-message' => sprintf( esc_html__( 'There was an error while migrating your data. Please retry again or contact our %1$ssupport%2$s team for help.', 'hustle' ), '<a href="' . esc_url( $support_link ) . '" target="_blank">', '</a>' ), |
| 172 | ), |
| 173 | ), |
| 174 | ); |
| 175 | $this->get_html_for_options( $notice_options ); |
| 176 | ?> |
| 177 | |
| 178 | <button |
| 179 | id="hustle-migrate-start" |
| 180 | class="sui-button sui-button-icon-right" |
| 181 | data-nonce="<?php echo esc_attr( wp_create_nonce( 'hustle-migrate-tracking-and-subscriptions' ) ); ?>" |
| 182 | > |
| 183 | <span class="sui-loading-text"> |
| 184 | <?php esc_html_e( 'Retry Migration', 'hustle' ); ?> |
| 185 | </span> |
| 186 | <span class="sui-icon-loader sui-loading" aria-hidden="true"></span> |
| 187 | </button> |
| 188 | |
| 189 | <span class="sui-description" style="margin: 10px 0 0;"><?php esc_html_e( 'The migration will continue from where it failed in the last attempt.', 'hustle' ); ?></span> |
| 190 | |
| 191 | </div> |
| 192 | |
| 193 | <div class="sui-box-body sui-content-center sui-spacing-bottom--60" style="display:none;" aria-hidden="true" hidden data-migrate-done> |
| 194 | |
| 195 | <button |
| 196 | class="sui-button" |
| 197 | data-modal-slide="hustle-dialog--migrate-slide-3" |
| 198 | data-modal-slide-focus="hustle-new-popup" |
| 199 | data-modal-slide-intro="next" |
| 200 | > |
| 201 | <?php esc_html_e( 'Continue', 'hustle' ); ?> |
| 202 | </button> |
| 203 | |
| 204 | </div> |
| 205 | |
| 206 | </div> |
| 207 | |
| 208 | <button class="sui-modal-skip hustle-dialog-migrate-skip" data-modal-close><?php esc_html_e( "Skip this, I'll migrate data later", 'hustle' ); ?></button> |
| 209 | |
| 210 | </div> |
| 211 | |
| 212 | <?php // SLIDE 3: Create. ?> |
| 213 | <div id="hustle-dialog--migrate-slide-3" class="sui-modal-slide"> |
| 214 | |
| 215 | <div class="sui-box" role="document"> |
| 216 | |
| 217 | <div class="sui-box-header sui-flatten sui-content-center sui-spacing-top--60"> |
| 218 | |
| 219 | <button class="sui-button-icon sui-button-float--right" data-modal-close> |
| 220 | <span class="sui-icon-close sui-md" aria-hidden="true"></span> |
| 221 | <span class="sui-screen-reader-text"><?php esc_html_e( 'Close this modal', 'hustle' ); ?></span> |
| 222 | </button> |
| 223 | |
| 224 | <figure class="sui-box-banner" role="banner" aria-hidden="true"> |
| 225 | <?php echo $this->render_image_markup( $slide_three_1x, $slide_three_2x, 'sui-image sui-image-center' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 226 | </figure> |
| 227 | |
| 228 | <h3 class="sui-box-title sui-lg"><?php esc_html_e( 'Create Module', 'hustle' ); ?></h3> |
| 229 | |
| 230 | <span id="dialogDescription" class="sui-description"><?php esc_html_e( 'Choose a module to get started on converting your visitors into subscribers, generate more leads and grow your social following.', 'hustle' ); ?></span> |
| 231 | |
| 232 | </div> |
| 233 | |
| 234 | <div class="sui-box-selectors sui-box-selectors-col-2"> |
| 235 | |
| 236 | <ul> |
| 237 | |
| 238 | <li><label for="hustle-new-popup" class="sui-box-selector"> |
| 239 | <input type="radio" name="hustle-create-new" id="hustle-new-popup" value="<?php echo esc_attr( Hustle_Module_Model::POPUP_MODULE ); ?>" /> |
| 240 | <span> |
| 241 | <span class="sui-icon-popup" aria-hidden="true"></span> |
| 242 | <?php esc_html_e( 'Pop-up', 'hustle' ); ?> |
| 243 | </span> |
| 244 | </label></li> |
| 245 | |
| 246 | <li><label for="hustle-new-slidein" class="sui-box-selector"> |
| 247 | <input type="radio" name="hustle-create-new" id="hustle-new-slidein" value="<?php echo esc_attr( Hustle_Module_Model::SLIDEIN_MODULE ); ?>" /> |
| 248 | <span> |
| 249 | <span class="sui-icon-slide-in" aria-hidden="true"></span> |
| 250 | <?php esc_html_e( 'Slide-in', 'hustle' ); ?> |
| 251 | </span> |
| 252 | </label></li> |
| 253 | |
| 254 | <li><label for="hustle-new-embed" class="sui-box-selector"> |
| 255 | <input type="radio" name="hustle-create-new" id="hustle-new-embed" value="<?php echo esc_attr( Hustle_Module_Model::EMBEDDED_MODULE ); ?>" /> |
| 256 | <span> |
| 257 | <span class="sui-icon-embed" aria-hidden="true"></span> |
| 258 | <?php esc_html_e( 'Embed', 'hustle' ); ?> |
| 259 | </span> |
| 260 | </label></li> |
| 261 | |
| 262 | <li><label for="hustle-new-sshare" class="sui-box-selector"> |
| 263 | <input type="radio" name="hustle-create-new" id="hustle-new-sshare" value="<?php echo esc_attr( Hustle_Module_Model::SOCIAL_SHARING_MODULE ); ?>" /> |
| 264 | <span> |
| 265 | <span class="sui-icon-share" aria-hidden="true"></span> |
| 266 | <?php esc_html_e( 'Social Share', 'hustle' ); ?> |
| 267 | </span> |
| 268 | </label></li> |
| 269 | |
| 270 | </ul> |
| 271 | |
| 272 | </div> |
| 273 | |
| 274 | <div class="sui-box-body sui-content-center sui-spacing-bottom--60 sui-spacing-top--0"> |
| 275 | |
| 276 | <button |
| 277 | id="hustle-create-new-module" |
| 278 | class="sui-button sui-button-blue sui-button-icon-right" |
| 279 | disabled="disabled" |
| 280 | > |
| 281 | <span class="sui-loading-text"><?php esc_html_e( 'Create', 'hustle' ); ?></span> |
| 282 | <span class="sui-icon-loader sui-loading" aria-hidden="true"></span> |
| 283 | </button> |
| 284 | |
| 285 | </div> |
| 286 | |
| 287 | </div> |
| 288 | |
| 289 | <button class="sui-modal-skip" data-modal-close><?php esc_html_e( "Skip this, I'll create a module later", 'hustle' ); ?></button> |
| 290 | |
| 291 | </div> |
| 292 | |
| 293 | </div> |
| 294 | |
| 295 | </div> |
| 296 |