upgrade_2_1_0.php
151 lines
| 1 | <?php |
| 2 | |
| 3 | // Don't load directly. |
| 4 | if ( ! defined( 'ABSPATH' ) ) { |
| 5 | die( '-1' ); |
| 6 | } |
| 7 | |
| 8 | // phpcs:ignoreFile WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound |
| 9 | |
| 10 | global $wpdb; |
| 11 | ?> |
| 12 | <div class="wrap pods-admin"> |
| 13 | <div id="icon-pods" class="icon32"><br /></div> |
| 14 | |
| 15 | <h2 class="italicized"><?php esc_html_e( 'Upgrade Pods', 'pods' ); ?></h2> |
| 16 | |
| 17 | <img src="<?php echo esc_url( PODS_URL ); ?>ui/images/pods-logo-notext-rgb-transparent.png" class="pods-leaf-watermark-right" /> |
| 18 | |
| 19 | <div id="pods-wizard-box" class="pods-wizard-steps-3" data-action="pods_admin" data-method="upgrade" data-_wpnonce="<?php echo esc_attr( wp_create_nonce( 'pods-upgrade' ) ); ?>" data-version="<?php echo esc_attr( $new_version ); ?>"> |
| 20 | <div id="pods-wizard-heading"> |
| 21 | <ul> |
| 22 | <li class="pods-wizard-menu-current" data-step="1"> |
| 23 | <i></i> <span>1</span> <?php esc_html_e( 'Getting Started', 'pods' ); ?> <em></em> |
| 24 | </li> |
| 25 | <li data-step="2"> |
| 26 | <i></i> <span>2</span> <?php esc_html_e( 'Prepare', 'pods' ); ?> <em></em> |
| 27 | </li> |
| 28 | <li data-step="3"> |
| 29 | <i></i> <span>3</span> <?php esc_html_e( 'Upgrade', 'pods' ); ?> <em></em> |
| 30 | </li> |
| 31 | </ul> |
| 32 | </div> |
| 33 | <div id="pods-wizard-main"> |
| 34 | |
| 35 | <!-- Getting Started Panel --> |
| 36 | <div id="pods-wizard-panel-1" class="pods-wizard-panel"> |
| 37 | <div class="pods-wizard-content pods-wizard-grey"> |
| 38 | <p> |
| 39 | <?php |
| 40 | $intro = __( 'Thanks for upgrading your Pods 2.x site! We sincerely hope you enjoy over two years worth of planning and work, available to you for <em>free</em>.', 'pods' ) . ' ' . __( 'We need to run a few updates to your database to optimize your relationship data.', 'pods' ); |
| 41 | |
| 42 | echo wp_kses_post( $intro ); |
| 43 | ?> |
| 44 | </p> |
| 45 | </div> |
| 46 | |
| 47 | <?php require_once PODS_DIR . 'ui/admin/upgrade/backup.php'; ?> |
| 48 | </div> |
| 49 | <!-- // Getting Started Panel --> |
| 50 | |
| 51 | <!-- Prepare Panel --> |
| 52 | <div id="pods-wizard-panel-2" class="pods-wizard-panel"> |
| 53 | <div class="pods-wizard-content"> |
| 54 | <p><?php esc_html_e( 'We will prepare your relationships for the upgrade. If any issues are found they will be displayed below for your review. Be sure to backup your database before continuing onto the next step for the Upgrade.', 'pods' ); ?></p> |
| 55 | </div> |
| 56 | <table cellpadding="0" cellspacing="0"> |
| 57 | <col style="width: 70px"> |
| 58 | <col style="width: 110px"> |
| 59 | <col style="width: 580px"> |
| 60 | <thead> |
| 61 | <tr> |
| 62 | <th colspan="3"><?php esc_html_e( 'Preparing Your Relationships for Upgrade', 'pods' ); ?>..</th> |
| 63 | </tr> |
| 64 | </thead> |
| 65 | <tbody> |
| 66 | <tr class="pods-wizard-table-pending" data-upgrade="relationships"> |
| 67 | <td class="pods-wizard-right pods-wizard-status"> |
| 68 | <i><img src="<?php echo esc_url( PODS_URL ); ?>ui/images/spinner.gif" alt="Loading..." /></i> |
| 69 | </td> |
| 70 | <td class="pods-wizard-right pods-wizard-count">—</td> |
| 71 | <td class="pods-wizard-name"> |
| 72 | <?php esc_html_e( 'Relationships', 'pods' ); ?> <span class="pods-wizard-info"></span> |
| 73 | </td> |
| 74 | </tr> |
| 75 | </tbody> |
| 76 | </table> |
| 77 | </div> |
| 78 | <!-- // Prepare Panel --> |
| 79 | |
| 80 | <!-- Migrate Panel --> |
| 81 | <div id="pods-wizard-panel-3" class="pods-wizard-panel"> |
| 82 | <div class="pods-wizard-content"> |
| 83 | <p><?php esc_html_e( 'During this process your Relationships will be optimized.', 'pods' ); ?></p> |
| 84 | </div> |
| 85 | <table cellpadding="0" cellspacing="0"> |
| 86 | <col style="width: 70px"> |
| 87 | <col style="width: 110px"> |
| 88 | <col style="width: 580px"> |
| 89 | <thead> |
| 90 | <tr> |
| 91 | <th colspan="3"><?php esc_html_e( 'Optimizing Your Relationships', 'pods' ); ?>..</th> |
| 92 | </tr> |
| 93 | </thead> |
| 94 | <tbody><!-- complete|pending|active <i></i> --> |
| 95 | <tr class="pods-wizard-table-pending" data-upgrade="relationships"> |
| 96 | <td class="pods-wizard-right pods-wizard-status"> |
| 97 | <i><img src="<?php echo esc_url( PODS_URL ); ?>ui/images/spinner.gif" alt="Loading..." /></i> |
| 98 | </td> |
| 99 | <td class="pods-wizard-right pods-wizard-count">—</td> |
| 100 | <td class="pods-wizard-name"> |
| 101 | <?php esc_html_e( 'Relationships', 'pods' ); ?> <span class="pods-wizard-info"></span> |
| 102 | </td> |
| 103 | </tr> |
| 104 | <tr class="pods-wizard-table-pending" data-upgrade="cleanup"> |
| 105 | <td class="pods-wizard-right pods-wizard-status"> |
| 106 | <i><img src="<?php echo esc_url( PODS_URL ); ?>ui/images/spinner.gif" alt="Loading..." /></i> |
| 107 | </td> |
| 108 | <td class="pods-wizard-right pods-wizard-count">—</td> |
| 109 | <td class="pods-wizard-name"> |
| 110 | <?php esc_html_e( 'Cleanup', 'pods' ); ?> <span class="pods-wizard-info"></span> |
| 111 | </td> |
| 112 | </tr> |
| 113 | </tbody> |
| 114 | </table> |
| 115 | </div> |
| 116 | <!-- // Mirate Panel --> |
| 117 | |
| 118 | </div> |
| 119 | <div id="pods-wizard-actions"> |
| 120 | <div id="pods-wizard-toolbar"> |
| 121 | <a href="#start" id="pods-wizard-start" class="button button-secondary"><?php esc_html_e( 'Start Over', 'pods' ); ?></a> |
| 122 | <a href="#next" id="pods-wizard-next" class="button button-primary" data-next="<?php esc_attr_e( 'Next Step', 'pods' ); ?>" data-finished="<?php esc_attr_e( 'Start using Pods', 'pods' ); ?>"><?php esc_html_e( 'Next Step', 'pods' ); ?></a> |
| 123 | </div> |
| 124 | <div id="pods-wizard-finished"> |
| 125 | <?php esc_html_e( 'Upgrade Complete!', 'pods' ); ?> |
| 126 | </div> |
| 127 | </div> |
| 128 | </div> |
| 129 | </div> |
| 130 | |
| 131 | <script> |
| 132 | var pods_admin_wizard_callback = function ( step ) { |
| 133 | jQuery( '#pods-wizard-start, #pods-wizard-next' ).hide(); |
| 134 | |
| 135 | if ( step == 2 ) { |
| 136 | jQuery( '#pods-wizard-box' ).PodsUpgrade( 'prepare' ); |
| 137 | |
| 138 | return false; |
| 139 | } |
| 140 | else { |
| 141 | if ( step == 3 ) { |
| 142 | jQuery( '#pods-wizard-box' ).PodsUpgrade( 'migrate' ); |
| 143 | } |
| 144 | } |
| 145 | }; |
| 146 | |
| 147 | jQuery( function ( $ ) { |
| 148 | $( '#pods-wizard-box' ).Pods( 'wizard' ); |
| 149 | } ); |
| 150 | </script> |
| 151 |