Commit realizado el 12:13:52 08-04-2024
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/**
|
||||
* Auto Updater view in Version Control Tab.
|
||||
*
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Version_Control
|
||||
*/
|
||||
|
||||
use RankMath\Helper;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
?>
|
||||
<form id="cmb2-metabox-rank-math-auto-update" class="rank-math-auto-update-form cmb2-form rank-math-box" action="" method="post">
|
||||
|
||||
<header>
|
||||
<h3><?php esc_html_e( 'Auto Update', 'rank-math' ); ?></h3>
|
||||
</header>
|
||||
|
||||
<?php if ( Helper::is_plugin_update_disabled() ) : ?>
|
||||
<p><?php esc_html_e( 'You cannot turn on auto-updates to automatically update to stable versions of Rank Math as soon as they are released, because site wide plugins auto-update option is disabled on your site.', 'rank-math' ); ?></p>
|
||||
|
||||
<hr/>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! Helper::is_plugin_update_disabled() ) : ?>
|
||||
<p><?php esc_html_e( 'Turn on auto-updates to automatically update to stable versions of Rank Math as soon as they are released. The beta versions will never install automatically.', 'rank-math' ); ?></p>
|
||||
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr class="cmb-row cmb-type-switch">
|
||||
<th scope="row"><label><?php esc_html_e( 'Auto Update Plugin', 'rank-math' ); ?></label></th>
|
||||
<td>
|
||||
<label class="cmb2-toggle">
|
||||
<input type="hidden" name="enable_auto_update" id="enable_auto_update_hidden" value="off">
|
||||
<input type="checkbox" class="regular-text" name="enable_auto_update" id="enable_auto_update" value="on" <?php checked( $auto_update ); ?>>
|
||||
<span class="cmb2-slider">
|
||||
<svg width="3" height="8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 6" class="toggle_on" role="img" aria-hidden="true" focusable="false"><path d="M0 0h2v6H0z"></path></svg>
|
||||
<svg width="8" height="8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 6" class="toggle_off" role="img" aria-hidden="true" focusable="false"><path d="M3 1.5c.8 0 1.5.7 1.5 1.5S3.8 4.5 3 4.5 1.5 3.8 1.5 3 2.2 1.5 3 1.5M3 0C1.3 0 0 1.3 0 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z"></path></svg>
|
||||
</span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
|
||||
<div id="control_update_notification_email">
|
||||
<p><?php esc_html_e( 'When auto-updates are turned off, you can enable update notifications, to send an email to the site administrator when an update is available for Rank Math.', 'rank-math' ); ?></p>
|
||||
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr class="cmb-row cmb-type-switch">
|
||||
<th scope="row"><label><?php esc_html_e( 'Update Notification Email', 'rank-math' ); ?></label></th>
|
||||
<td>
|
||||
<label class="cmb2-toggle">
|
||||
<input type="hidden" name="enable_update_notification_email" id="enable_update_notification_email_hidden" value="off">
|
||||
<input type="checkbox" class="regular-text" name="enable_update_notification_email" id="enable_update_notification_email" value="on" <?php checked( $update_notification ); ?>>
|
||||
<span class="cmb2-slider">
|
||||
<svg width="3" height="8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 6" class="toggle_on" role="img" aria-hidden="true" focusable="false"><path d="M0 0h2v6H0z"></path></svg>
|
||||
<svg width="8" height="8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 6" class="toggle_off" role="img" aria-hidden="true" focusable="false"><path d="M3 1.5c.8 0 1.5.7 1.5 1.5S3.8 4.5 3 4.5 1.5 3.8 1.5 3 2.2 1.5 3 1.5M3 0C1.3 0 0 1.3 0 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z"></path></svg>
|
||||
</span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<?php if ( ! Helper::is_plugin_update_disabled() ) : ?>
|
||||
<?php if ( get_option( 'rank_math_rollback_version', false ) ) { ?>
|
||||
<div class="notice notice-alt notice-warning info inline" style="border: none;">
|
||||
<p>
|
||||
<?php esc_html_e( 'Rank Math will not auto-update because you have rolled back to a previous version. Update to the latest version manually to make this option work again.', 'rank-math' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<footer>
|
||||
<?php wp_nonce_field( 'rank-math-auto-update' ); ?>
|
||||
<button type="submit" class="button button-primary button-xlarge"><?php esc_html_e( 'Save Changes', 'rank-math' ); ?></button>
|
||||
</footer>
|
||||
|
||||
</form>
|
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* Beta Opt-in view in Version Control Tab.
|
||||
*
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Version_Control
|
||||
*/
|
||||
|
||||
use RankMath\Helper;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
?>
|
||||
|
||||
<form id="cmb2-metabox-rank-math-beta-optin" class="rank-math-beta-optin-form cmb2-form rank-math-box" action="" method="post">
|
||||
|
||||
<header>
|
||||
<h3><?php esc_html_e( 'Beta Opt-in', 'rank-math' ); ?></h3>
|
||||
</header>
|
||||
|
||||
<?php if ( Helper::is_plugin_update_disabled() ) : ?>
|
||||
<p><?php esc_html_e( 'You cannot turn on the Beta Tester feature because site wide plugins auto-update option is disabled on your site.', 'rank-math' ); ?></p>
|
||||
|
||||
</form>
|
||||
<?php return; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<p><?php esc_html_e( 'You can take part in shaping Rank Math by test-driving the newest features and letting us know what you think. Turn on the Beta Tester feature to get notified about new beta releases. The beta version will not install automatically and you always have the option to ignore it.', 'rank-math' ); ?></p>
|
||||
<?php // translators: Warning. ?>
|
||||
<p class="description warning"><strong><?php printf( esc_html__( '%s It is not recommended to use the beta version on live production sites.', 'rank-math' ), '<span class="warning">' . esc_html__( 'Warning: ', 'rank-math' ) . '</span>' ); ?></strong></p>
|
||||
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr class="cmb-row cmb-type-switch">
|
||||
<th scope="row"><label><?php esc_html_e( 'Beta Tester', 'rank-math' ); ?></label></th>
|
||||
<td>
|
||||
<label class="cmb2-toggle">
|
||||
<input type="hidden" name="beta_optin" id="beta_optin_hidden" value="off">
|
||||
<input type="checkbox" class="regular-text" name="beta_optin" id="beta_optin" value="on" <?php checked( $beta_optin ); ?>>
|
||||
<span class="cmb2-slider">
|
||||
<svg width="3" height="8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 6" class="toggle_on" role="img" aria-hidden="true" focusable="false"><path d="M0 0h2v6H0z"></path></svg>
|
||||
<svg width="8" height="8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 6" class="toggle_off" role="img" aria-hidden="true" focusable="false"><path d="M3 1.5c.8 0 1.5.7 1.5 1.5S3.8 4.5 3 4.5 1.5 3.8 1.5 3 2.2 1.5 3 1.5M3 0C1.3 0 0 1.3 0 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z"></path></svg>
|
||||
</span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<footer>
|
||||
<?php wp_nonce_field( 'rank-math-beta-optin' ); ?>
|
||||
<button type="submit" class="button button-primary button-xlarge"><?php esc_html_e( 'Save Changes', 'rank-math' ); ?></button>
|
||||
</footer>
|
||||
|
||||
</form>
|
@@ -0,0 +1 @@
|
||||
<?php // Silence is golden.
|
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* The Version Control View.
|
||||
*
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Version_Control
|
||||
*/
|
||||
|
||||
namespace RankMath;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
?>
|
||||
<form class="rank-math-rollback-form cmb2-form rank-math-box" action="" method="post">
|
||||
|
||||
<header>
|
||||
<h3><?php esc_html_e( 'Rollback to Previous Version', 'rank-math' ); ?></h3>
|
||||
</header>
|
||||
|
||||
<p><?php esc_html_e( 'If you are facing issues after an update, you can reinstall a previous version with this tool.', 'rank-math' ); ?></p>
|
||||
<?php // translators: placeholder is the word "warning". ?>
|
||||
<p class="description warning"><strong><?php printf( esc_html__( '%s Previous versions may not be secure or stable. Proceed with caution and always create a backup.', 'rank-math' ), '<span class="warning">' . esc_html__( 'Warning: ', 'rank-math' ) . '</span>' ); ?></strong></p>
|
||||
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row"><label><?php esc_html_e( 'Your Version', 'rank-math' ); ?></label></th>
|
||||
<td>
|
||||
<strong>
|
||||
<?php echo esc_html( $current_version ); ?>
|
||||
</strong>
|
||||
<?php if ( Rollback_Version::is_rollback_version() ) { ?>
|
||||
<?php // Translators: placeholder is "Rolled Back Version:". ?>
|
||||
<br><?php printf( esc_html__( '%s Auto updates will not work, please update the plugin manually.', 'rank-math' ), '<span class="rollback-version-label">' . esc_html__( 'Rolled Back Version: ', 'rank-math' ) . '</span>' ); ?>
|
||||
<?php } ?>
|
||||
<?php if ( $current_version === $latest_version ) { ?>
|
||||
<p class="description"><?php esc_html_e( 'You are using the latest version of the plugin.', 'rank-math' ); ?></p>
|
||||
<?php } else { ?>
|
||||
<p class="description"><?php esc_html_e( 'This is the version you are using on this site.', 'rank-math' ); ?></p>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if ( $current_version !== $latest_version ) { ?>
|
||||
<tr>
|
||||
<th scope="row"><label><?php esc_html_e( 'Latest Stable Version', 'rank-math' ); ?></label></th>
|
||||
<td>
|
||||
<strong><?php echo esc_html( $latest_version ); ?></strong>
|
||||
<?php if ( ! Helper::is_plugin_update_disabled() && version_compare( $current_version, $latest_version, '<' ) ) { ?>
|
||||
<a href="<?php echo esc_url( self_admin_url( 'update-core.php' ) ); ?>" class="update-link"><?php esc_html_e( 'Update Now', 'rank-math' ); ?></a>
|
||||
<?php } ?>
|
||||
<p class="description"><?php esc_html_e( 'This is the latest version of the plugin.', 'rank-math' ); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<th scope="row"><label><?php esc_html_e( 'Rollback Version', 'rank-math' ); ?></label></th>
|
||||
<td>
|
||||
<select class="cmb2_select" name="rm_rollback_version" id="rm_rollback_version">
|
||||
<?php foreach ( $versions as $version ) { ?>
|
||||
<option value="<?php echo esc_attr( $version ); ?>" <?php disabled( ( $version === $current_version ) ); ?>>
|
||||
<?php echo esc_html( $version ); ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<p class="description"><?php esc_html_e( 'Roll back to this version.', 'rank-math' ); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<footer>
|
||||
<?php wp_nonce_field( 'rank-math-rollback' ); ?>
|
||||
<?php // translators: Version number. ?>
|
||||
<button type="submit" class="button button-primary button-xlarge" id="rm-rollback-button" data-buttonlabel="<?php esc_attr_e( 'Install Version %s', 'rank-math' ); ?>"><?php esc_html_e( 'Install Selected Version', 'rank-math' ); ?></button>
|
||||
<div class="alignright hidden rollback-loading-indicator">
|
||||
<span class="loading-indicator-text"><?php esc_html_e( 'Reinstalling, please wait...', 'rank-math' ); ?></span>
|
||||
<span class="spinner is-active"></span>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</form>
|
Reference in New Issue
Block a user