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