Skip to content

Commit

Permalink
Merge pull request #736 from udx/latest
Browse files Browse the repository at this point in the history
Latest
  • Loading branch information
balexey88 committed Apr 4, 2024
2 parents 7137bf8 + 94e08c1 commit 12bf46b
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 31 deletions.
1 change: 1 addition & 0 deletions l10n.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,6 @@

'confirm' => __('Confirm', ud_get_stateless_media()->domain ),
'cancel' => __('Cancel', ud_get_stateless_media()->domain ),
'start_optimization' => __('Start Data Optimization', ud_get_stateless_media()->domain ),
);

5 changes: 2 additions & 3 deletions lib/classes/batch/class-batch-task-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,9 @@ protected function complete() {
do_action('wp_stateless_batch_task_finished', $class);

$site = site_url();
$subject = sprintf( __('Stateless %s complete successfully', ud_get_stateless_media()->domain), $description );
$subject = sprintf( __('WP-Stateless: Data Optimization Complete', ud_get_stateless_media()->domain) );
$message = sprintf(
__("This is a simple notification to inform you that the WP-Stateless plugin has finished a %s process for %s.\n\nIf you have WP_DEBUG_LOG enabled, check those logs to review any errors that may have occurred during the process.", ud_get_stateless_media()->domain),
$description,
__("WP-Stateless data has been optimized for %s.\n\nIf you have WP_STATELESS_SYNC_LOG or WP_DEBUG_LOG enabled, review those logs now to review any errors that may have occurred during the synchronization process.", ud_get_stateless_media()->domain),
$site
);

Expand Down
2 changes: 1 addition & 1 deletion lib/classes/status/class-info.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected function __construct() {
}

private function _init_hooks() {
add_action('wp_stateless_status_tab_content', [$this, 'tab_content'], 10);
// add_action('wp_stateless_status_tab_content', [$this, 'tab_content'], 10);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/classes/sync/class-background-sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ protected function complete() {
$sync_name = strip_tags($this->get_name());
$site = site_url();

$subject = sprintf(__('Stateless Sync for %s is Complete', ud_get_stateless_media()->domain), $sync_name);
$message = sprintf(__("This is a simple notification to inform you that the WP-Stateless plugin has finished a %s synchronization process for %s.\n\nIf you have WP_STATELESS_SYNC_LOG or WP_DEBUG_LOG enabled, check those logs to review any errors that may have occurred during the synchronization process.", ud_get_stateless_media()->domain), $sync_name, $site);
$subject = sprintf(__('WP-Stateless: %s Synchronization Complete', ud_get_stateless_media()->domain), $sync_name);
$message = sprintf(__("WP-Stateless has finished synchronizing %s for %s.\n\nIf you have WP_STATELESS_SYNC_LOG or WP_DEBUG_LOG enabled, review those logs now to review any errors that may have occurred during the synchronization process.", ud_get_stateless_media()->domain), $sync_name, $site);

do_action('wp_stateless_send_admin_email', $subject, $message);
}
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ License: GPLv2 or later
Requires PHP: 8.0
Requires at least: 5.0
Tested up to: 6.5.0
Stable tag: 4.0.0-RC.2
Stable tag: 4.0.0

Upload and serve your WordPress media files from Google Cloud Storage.

Expand Down
12 changes: 7 additions & 5 deletions static/scripts/wp-stateless-batch.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ function wpMigrations($) {
autoOpen: false,
position: { my: "center", at: "center", of: window },
open: function(event, ui) {
$(this).closest('.ui-dialog').find('.ui-button').addClass('button')
$(this).closest('.ui-dialog').find('.ui-button').last().addClass('button-primary')
$('body').css('overflow', 'hidden')
},
Expand All @@ -215,7 +216,7 @@ function wpMigrations($) {
},
buttons: [
{
text: stateless_l10n.confirm,
text: stateless_l10n.start_optimization,
click: function() {},
},
{
Expand Down Expand Up @@ -245,11 +246,12 @@ function wpMigrations($) {
}

if ( action === 'start' ) {
var migrationElement = $('#stless_status_tab .migration[data-id="' + id + '"]')
var title = migrationElement.find('.title strong').text()
// Title
// var migrationElement = $('#stless_status_tab .migration[data-id="' + id + '"]')
// var title = migrationElement.find('.title strong').text()

$( '#stateless-migration-confirm' ).dialog('option', 'title', title)
$( '#stateless-migration-confirm' ).find('strong').text(title)
// $( '#stateless-migration-confirm' ).dialog('option', 'title', title)
// $( '#stateless-migration-confirm' ).find('strong').text(title)

$('#stateless-migration-confirm').closest('.ui-dialog').find('.ui-dialog-buttonset .ui-button').first().click(function(e) {
e.preventDefault()
Expand Down
5 changes: 0 additions & 5 deletions static/styles/wp-stateless-status.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@
justify-content: space-between;
}

#stless_status_tab .title span {
font-style: italic;
color: #646970;
}

#stless_status_tab .actions .button {
display: none;
}
Expand Down
28 changes: 15 additions & 13 deletions static/views/status-sections/migrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
<div class="postbox">
<h2 class="hndle"><?php _e('Data Optimization', ud_get_stateless_media()->domain); ?></h2>
<div class="hndle-notice">
<p><?php _e('Please consider the following:', ud_get_stateless_media()->domain); ?></p>
<p><?php _e('Beginning with WP-Stateless 4.0, the method used to store and access plugin data has improved significantly. We\'ve detected that your data still needs to be updated using this new method.', ud_get_stateless_media()->domain); ?></p>
<p><?php _e('Start your data optimization process below to experience a faster and more performant WP-Stateless. Before you begin, please consider the following:', ud_get_stateless_media()->domain); ?></p>
<ul>
<li><?php _e('Before running any optimizations please make a backup copy of your database', ud_get_stateless_media()->domain); ?></li>
<li><?php _e('Please try not to add/update/delete any media while optimization is in progress', ud_get_stateless_media()->domain); ?></li>
<li><?php _e('Create a backup copy of your WordPress database.', ud_get_stateless_media()->domain); ?></li>
<li><?php _e('Do not upload, edit, or delete media or files while the optimization process is underway.', ud_get_stateless_media()->domain); ?></li>
<li><?php _e('Perform this update during a low period in your website traffic.', ud_get_stateless_media()->domain); ?></li>
</ul>
</div>

Expand All @@ -15,11 +17,11 @@
<?php foreach ($migrations as $id => $migration ) : ?>
<div class="migration <?php echo $migration->classes; ?>" data-id="<?php echo $id; ?>">
<p class="title">
<strong><?php echo $migration->description; ?></strong>
<!-- <strong><?php echo $migration->description; ?></strong> -->
<span class="actions">
<a href="#" class="button button-small button-primary start" data-action="start"><?php _e('Optimize', ud_get_stateless_media()->domain); ?></a>
<a href="#" class="button button-small button-secondary pause" data-action="pause"><?php _e('Pause', ud_get_stateless_media()->domain); ?></a>
<a href="#" class="button button-small button-primary resume" data-action="resume"><?php _e('Resume', ud_get_stateless_media()->domain); ?></a>
<a href="#" class="button button-primary start" data-action="start"><?php _e('Start Data Optimization', ud_get_stateless_media()->domain); ?></a>
<a href="#" class="button button-secondary pause" data-action="pause"><?php _e('Pause Data Optimization', ud_get_stateless_media()->domain); ?></a>
<a href="#" class="button button-primary resume" data-action="resume"><?php _e('Resume Data Optimization', ud_get_stateless_media()->domain); ?></a>
</span>
</p>

Expand All @@ -46,21 +48,21 @@
$current_email = $current_user->user_email ?? '';
?>

<div id="stateless-migration-confirm" title="Migration">
<p><?php _e('You are about to start the <strong>Migration</strong>.', ud_get_stateless_media()->domain); ?></p>
<p><?php _e('Please make a backup copy of your database and try not to upload, change or delete your media while the process continues.', ud_get_stateless_media()->domain); ?></p>
<div id="stateless-migration-confirm" title="<?php _e('Optimize WP-Stateless Data', ud_get_stateless_media()->domain); ?>">
<p><?php _e('You are about to optimize your WP-Stateless data. This process makes changes to your WordPress database.', ud_get_stateless_media()->domain); ?></p>
<p><?php _e('Create a backup copy of your database, and do not upload, edit, or delete media or files during the optimization process.', ud_get_stateless_media()->domain); ?></p>
<p>
<?php _e('Notify when process finishes:', ud_get_stateless_media()->domain); ?>
<?php _e('WP-Stateless will send an email notification when the process is complete. Who would you like to receive this notification?', ud_get_stateless_media()->domain); ?>

<label for="stateless-migration-email-default">
<input type="radio" name="email-notification" id="stateless-migration-email-default" value="<?php echo $default_email;?>" checked="checked" />
<?php echo $default_email; ?>
<?php printf( __('Administration Email Address (%s)', ud_get_stateless_media()->domain), $default_email ); ?>
</label>

<label for="stateless-migration-email-user">
<input type="radio" name="email-notification" id="stateless-migration-email-user" value="<?php echo $current_email?>" />
<?php printf( __('Current User (%s)', ud_get_stateless_media()->domain), $current_email ); ?>
</label>
</p>
<p><?php _e('Are you sure you want to continue?', ud_get_stateless_media()->domain); ?></p>
<p><?php _e('Are you ready to continue?', ud_get_stateless_media()->domain); ?></p>
</div>
2 changes: 1 addition & 1 deletion wp-stateless-media.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin URI: https://stateless.udx.io/
* Description: Upload and serve your WordPress media files from Google Cloud Storage.
* Author: UDX
* Version: 4.0.0-RC.2
* Version: 4.0.0
* Text Domain: stateless-media
* Author URI: https://udx.io
* License: GPLv2 or later
Expand Down

0 comments on commit 12bf46b

Please sign in to comment.