| @@ -1,11 +1,13 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Upgrade Screen | |
| 3 | + * Upgrade/Updates Screen | |
| 4 | 4 | * |
| 5 | + * Displays both add-on updates for files and database upgrades | |
| 6 | + * | |
| 5 | 7 | * @package Give |
| 6 | 8 | * @subpackage Admin/Upgrades |
| 7 | - * @copyright Copyright (c) 2017, WordImpress | |
| 9 | + * @copyright Copyright (c) 2017, GiveWP | |
| 8 | 10 | * @license https://opensource.org/licenses/gpl-license GNU Public License |
| 9 | 11 | * @since 1.8.12 |
| 10 | 12 | */ |
| 11 | 13 | |
| @@ -15,23 +17,35 @@ | ||
| 15 | 17 | } |
| 16 | 18 | |
| 17 | 19 | $give_updates = Give_Updates::get_instance(); |
| 18 | 20 | ?> |
| 19 | -<div class="wrap" id="poststuff"> | |
| 20 | - <div id="give-updates"> | |
| 21 | - <h1 id="give-updates-h1"><?php esc_html_e( 'Give - Updates', 'give' ); ?></h1> | |
| 22 | - <hr class="wp-header-end"> | |
| 21 | +<div id="give-updates" class="wrap give-settings-page"> | |
| 23 | 22 | |
| 24 | - <?php $db_updates = $give_updates->get_pending_db_update_count(); ?> | |
| 25 | - <?php if ( ! empty( $db_updates ) ) : ?> | |
| 23 | + <div class="give-settings-header"> | |
| 24 | + <h1 id="give-updates-h1" | |
| 25 | + class="wp-heading-inline"><?php echo sprintf( __( 'GiveWP %s Updates', 'give' ), '<span class="give-settings-heading-sep dashicons dashicons-arrow-right-alt2"></span>' ); ?></h1> | |
| 26 | + </div> | |
| 27 | + | |
| 28 | + <?php $db_updates = $give_updates->get_pending_db_update_count(); ?> | |
| 29 | + | |
| 30 | + <div id="give-updates-content"> | |
| 31 | + | |
| 32 | + <div id="poststuff" class="give-clearfix"> | |
| 33 | + | |
| 34 | + <?php | |
| 35 | + /** | |
| 36 | + * Database Upgrades | |
| 37 | + */ | |
| 38 | + if ( ! empty( $db_updates ) ) : | |
| 39 | + ?> | |
| 26 | 40 | <?php |
| 27 | 41 | $is_doing_updates = $give_updates->is_doing_updates(); |
| 28 | - $db_update_url = add_query_arg( array( 'type' => 'database', ) ); | |
| 42 | + $db_update_url = add_query_arg( [ 'type' => 'database' ] ); | |
| 29 | 43 | $resume_updates = get_option( 'give_doing_upgrade' ); |
| 30 | 44 | $width = ! empty( $resume_updates ) ? $resume_updates['percentage'] : 0; |
| 31 | 45 | ?> |
| 32 | 46 | <div class="give-update-panel-content"> |
| 33 | - <p><?php printf( __( 'Give regularly receives new features, bug fixes, and enhancements. It is important to always stay up-to-date with latest version of Give core and its add-ons. Please create a backup of your site before updating. To update add-ons be sure your <a href="%1$s">license keys</a> are activated.', 'give' ), 'https://givewp.com/my-account/' ); ?></p> | |
| 47 | + <p><?php printf( __( 'GiveWP regularly receives new features, bug fixes, and enhancements. It is important to always stay up-to-date with latest version of GiveWP core and its add-ons. <strong>If you do not have a backup already, please create a full backup before updating.</strong> To update add-ons be sure your <a href="%1$s">license keys</a> are activated.', 'give' ), admin_url( '' ) ); ?></p> | |
| 34 | 48 | </div> |
| 35 | 49 | |
| 36 | 50 | <div id="give-db-updates" data-resume-update="<?php echo absint( $give_updates->is_doing_updates() ); ?>"> |
| 37 | 51 | <div class="postbox-container"> |
| @@ -40,16 +54,17 @@ | ||
| 40 | 54 | <div class="inside"> |
| 41 | 55 | <div class="panel-content"> |
| 42 | 56 | <p class="give-update-button"> |
| 43 | 57 | <?php |
| 44 | - if( ! give_test_ajax_works() ) { | |
| 58 | + if ( ! give_test_ajax_works() ) { | |
| 45 | 59 | echo sprintf( |
| 46 | 60 | '<div class="notice notice-warning inline"><p>%s</p></div>', |
| 47 | - __( 'Give is currently updating the database. Please do not refresh or leave this page while the update is in progress.', 'give' ) | |
| 61 | + __( 'GiveWP is currently updating the database. Please do not refresh or leave this page while the update is in progress.', 'give' ) | |
| 48 | 62 | ); |
| 49 | 63 | } |
| 50 | 64 | ?> |
| 51 | - <span class="give-doing-update-text-p" <?php echo Give_Updates::$background_updater->is_paused_process() ? 'style="display:none;"' : ''; ?>> | |
| 65 | + <span | |
| 66 | + class="give-doing-update-text-p" <?php echo Give_Updates::$background_updater->is_paused_process() ? 'style="display:none;"' : ''; ?>> | |
| 52 | 67 | <?php |
| 53 | 68 | echo sprintf( |
| 54 | 69 | __( '%1$s <a href="%2$s" class="give-update-now %3$s">%4$s</a>', 'give' ), |
| 55 | 70 | $is_doing_updates |
| @@ -54,21 +69,30 @@ | ||
| 54 | 69 | __( '%1$s <a href="%2$s" class="give-update-now %3$s">%4$s</a>', 'give' ), |
| 55 | 70 | $is_doing_updates |
| 56 | 71 | ? sprintf( |
| 57 | 72 | '%s%s', |
| 58 | - __( 'Give is currently updating the database', 'give' ), | |
| 59 | - give_test_ajax_works() ? ' ' . __( 'in the background.', 'give' ) : '.' | |
| 73 | + __( 'GiveWP is currently updating the database', 'give' ), | |
| 74 | + give_test_ajax_works() ? ' ' . __( 'in the background.', 'give' ) : '.' | |
| 60 | 75 | ) |
| 61 | - : __( 'Give needs to update the database.', 'give' ), | |
| 62 | - $db_update_url, | |
| 76 | + : __( 'GiveWP needs to update the database.', 'give' ), | |
| 77 | + esc_url( $db_update_url ), | |
| 63 | 78 | ( $is_doing_updates ? 'give-hidden' : '' ), |
| 64 | 79 | __( 'Update now', 'give' ) |
| 65 | 80 | ); |
| 66 | 81 | ?> |
| 67 | 82 | </span> |
| 68 | - <span class="give-update-paused-text-p" <?php echo ! Give_Updates::$background_updater->is_paused_process() ? 'style="display:none;"' : ''; ?>> | |
| 83 | + <span | |
| 84 | + class="give-update-paused-text-p" <?php echo ! Give_Updates::$background_updater->is_paused_process() ? 'style="display:none;"' : ''; ?>> | |
| 69 | 85 | <?php if ( get_option( 'give_upgrade_error' ) ) : ?> |
| 70 | -  <?php _e( 'An unexpected issue occurred during the database update which caused it to stop automatically. Please contact support for assistance.', 'give' ); ?> | |
| 86 | +   | |
| 87 | + <?php | |
| 88 | + printf( | |
| 89 | + '%1$s <br> %2$s <a href="http://docs.givewp.com/troubleshooting-db-updates" target="_blank">%3$s »</a>', | |
| 90 | + esc_html__( 'An unexpected issue occurred during the database update which caused it to stop automatically.', 'give' ), | |
| 91 | + esc_html__( 'Please contact support for assistance.', 'give' ), | |
| 92 | + esc_html__( 'Read More', 'give' ) | |
| 93 | + ); | |
| 94 | + ?> | |
| 71 | 95 | <?php else : ?> |
| 72 | 96 | <?php _e( 'The updates have been paused.', 'give' ); ?> |
| 73 | 97 | <?php endif; ?> |
| 74 | 98 | </span> |
| @@ -75,13 +99,13 @@ | ||
| 75 | 99 | |
| 76 | 100 | <?php if ( Give_Updates::$background_updater->is_paused_process() ) : ?> |
| 77 | 101 | <?php $is_disabled = isset( $_GET['give-restart-db-upgrades'] ) ? ' disabled' : ''; ?> |
| 78 | 102 | <button id="give-restart-upgrades" class="button button-primary alignright" |
| 79 | - data-redirect-url="<?php echo esc_url( admin_url( '/edit.php?post_type=give_forms&page=give-updates&give-restart-db-upgrades=1' ) ); ?>"<?php echo $is_disabled; ?>><?php _e( 'Restart Upgrades', 'give' ); ?></button> | |
| 80 | - <?php elseif ( $give_updates->is_doing_updates() ): ?> | |
| 103 | + data-redirect-url="<?php echo esc_url( admin_url( '/edit.php?post_type=give_forms&page=give-updates&give-restart-db-upgrades=1' ) ); ?>"<?php echo $is_disabled; ?>><?php _e( 'Restart Upgrades', 'give' ); ?></button> | |
| 104 | + <?php elseif ( $give_updates->is_doing_updates() ) : ?> | |
| 81 | 105 | <?php $is_disabled = isset( $_GET['give-pause-db-upgrades'] ) ? ' disabled' : ''; ?> |
| 82 | 106 | <button id="give-pause-upgrades" class="button button-primary alignright" |
| 83 | - data-redirect-url="<?php echo esc_url( admin_url( '/edit.php?post_type=give_forms&page=give-updates&give-pause-db-upgrades=1' ) ); ?>"<?php echo $is_disabled; ?>> | |
| 107 | + data-redirect-url="<?php echo esc_url( admin_url( '/edit.php?post_type=give_forms&page=give-updates&give-pause-db-upgrades=1' ) ); ?>"<?php echo $is_disabled; ?>> | |
| 84 | 108 | <?php _e( 'Pause Upgrades', 'give' ); ?> |
| 85 | 109 | </button> |
| 86 | 110 | <?php endif; ?> |
| 87 | 111 | </p> |
| @@ -90,9 +114,9 @@ | ||
| 90 | 114 | <p class="update-message"> |
| 91 | 115 | <strong> |
| 92 | 116 | <?php |
| 93 | 117 | echo sprintf( |
| 94 | - __( 'Update %s of %s', 'give' ), | |
| 118 | + __( 'Update %1$s of %2$s', 'give' ), | |
| 95 | 119 | $give_updates->get_running_db_update(), |
| 96 | 120 | $give_updates->get_total_new_db_update_count() |
| 97 | 121 | ); |
| 98 | 122 | ?> |
| @@ -106,9 +130,9 @@ | ||
| 106 | 130 | <span class="spinner is-active"></span> |
| 107 | 131 | <?php endif; ?> |
| 108 | 132 | |
| 109 | 133 | <div class="give-progress"> |
| 110 | - <div style="width: <?php echo $width ?>%;"></div> | |
| 134 | + <div style="width: <?php echo $width; ?>%;"></div> | |
| 111 | 135 | </div> |
| 112 | 136 | </div> |
| 113 | 137 | <?php endif; ?> |
| 114 | 138 | </div> |
| @@ -120,16 +144,20 @@ | ||
| 120 | 144 | <!-- .inside --> |
| 121 | 145 | </div><!-- .postbox --> |
| 122 | 146 | </div> <!-- .post-container --> |
| 123 | 147 | </div> |
| 124 | - <?php else: include GIVE_PLUGIN_DIR . 'includes/admin/upgrades/views/db-upgrades-complete-metabox.php'; ?> | |
| 125 | 148 | <?php endif; ?> |
| 126 | 149 | |
| 127 | - <?php $plugin_updates = $give_updates->get_total_plugin_update_count(); ?> | |
| 128 | - <?php if ( ! empty( $plugin_updates ) ) : ?> | |
| 129 | - <?php $plugin_update_url = add_query_arg( array( | |
| 130 | - 'plugin_status' => 'give', | |
| 131 | - ), admin_url( '/plugins.php' ) ); ?> | |
| 150 | + <?php | |
| 151 | + /** | |
| 152 | + * Add-on Updates | |
| 153 | + */ | |
| 154 | + $plugin_updates = $give_updates->get_total_plugin_update_count(); | |
| 155 | + if ( ! empty( $plugin_updates ) ) : | |
| 156 | + ?> | |
| 157 | + <?php | |
| 158 | + $plugin_update_url = add_query_arg( [ 'plugin_status' => 'give' ], admin_url( '/plugins.php' ) ); | |
| 159 | + ?> | |
| 132 | 160 | <div id="give-plugin-updates"> |
| 133 | 161 | <div class="postbox-container"> |
| 134 | 162 | <div class="postbox"> |
| 135 | 163 | <h2 class="hndle"><?php _e( 'Add-on Updates', 'give' ); ?></h2> |
| @@ -138,15 +166,15 @@ | ||
| 138 | 166 | <p> |
| 139 | 167 | <?php |
| 140 | 168 | printf( |
| 141 | 169 | _n( |
| 142 | - 'There is %1$d Give addon that needs to be updated. <a href="%2$s">Update now</a>', | |
| 143 | - 'There are %1$d Give addons that need to be updated. <a href="%2$s">Update now</a>', | |
| 170 | + 'There is %1$d GiveWP addon that needs to be updated. <a href="%2$s">Update now</a>', | |
| 171 | + 'There are %1$d GiveWP addons that need to be updated. <a href="%2$s">Update now</a>', | |
| 144 | 172 | $plugin_updates, |
| 145 | 173 | 'give' |
| 146 | 174 | ), |
| 147 | 175 | $plugin_updates, |
| 148 | - $plugin_update_url | |
| 176 | + esc_url( $plugin_update_url ) | |
| 149 | 177 | ); |
| 150 | 178 | ?> |
| 151 | 179 | </p> |
| 152 | 180 | <?php include_once 'plugins-update-section.php'; ?> |
| @@ -157,6 +185,9 @@ | ||
| 157 | 185 | </div> |
| 158 | 186 | </div> |
| 159 | 187 | <?php endif; ?> |
| 160 | 188 | |
| 161 | - </div> | |
| 162 | -</div> | |
| 189 | + </div><!-- /#poststuff --> | |
| 190 | + | |
| 191 | + </div><!-- /#give-updates-content --> | |
| 192 | + | |
| 193 | +</div><!-- /#give-updates --> | |