From d8e37186d5aa518fb9cf1c04a315f9127dc7041f Mon Sep 17 00:00:00 2001 From: Ryan Fredlund Date: Sun, 8 Mar 2020 20:40:36 +0100 Subject: [PATCH 1/3] Remove update time text after manual update --- wp-autoupdates.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/wp-autoupdates.php b/wp-autoupdates.php index f3cd0bc..6bcb832 100755 --- a/wp-autoupdates.php +++ b/wp-autoupdates.php @@ -9,7 +9,7 @@ Tested up to: 5.4 Author: The WordPress Team Author URI: https://wordpress.org -Contributors: wordpressdotorg, audrasjb, whodunitagency, pbiron, xkon, karmatosed, mapk +Contributors: wordpressdotorg, audrasjb, whodunitagency, pbiron, xkon, karmatosed, mapk, bookdude13 License: GPLv2 License URI: http://www.gnu.org/licenses/gpl-2.0.html Text Domain: wp-autoupdates @@ -50,6 +50,20 @@ function wp_autoupdates_enqueues( $hook ) { $script .= '});'; wp_add_inline_script( 'jquery', $script ); } + + // When manually updating a plugin the 'time until next update' text needs to be hidden. + // Doesn't need to be done on the update-core.php page since that page refreshes after an update. + if ( 'plugins.php' === $hook ) { + $script = 'jQuery( document ).ready(function() { + jQuery( ".update-link" ).click( function() { + var plugin = jQuery( this ).closest("tr").data("plugin"); + var plugin_row = jQuery( "tr.update[data-plugin=\'" + plugin + "\']" ); + var plugin_auto_update_time_text = plugin_row.find("span.plugin-autoupdate-time"); + plugin_auto_update_time_text.text(""); + }); + });'; + wp_add_inline_script( 'jquery', $script ); + } } add_action( 'admin_enqueue_scripts', 'wp_autoupdates_enqueues' ); @@ -126,12 +140,14 @@ function wp_autoupdates_add_plugins_autoupdates_column_content( $column_name, $p $next_update_time = wp_next_scheduled( 'wp_version_check' ); $time_to_next_update = human_time_diff( intval( $next_update_time ) ); if ( isset( $plugins_updates->response[$plugin_file] ) ) { + echo ''; echo sprintf( /* translators: Time until the next update. */ __( 'Update scheduled in %s', 'wp-autoupdates' ), $time_to_next_update ); echo '
'; + echo '
'; } if ( current_user_can( 'update_plugins', $plugin_file ) ) { echo sprintf( From 702b69d5720550c2cf75dbf405a8a617011bb3e9 Mon Sep 17 00:00:00 2001 From: Ryan Fredlund Date: Tue, 10 Mar 2020 23:03:42 +0100 Subject: [PATCH 2/3] Removing name from contributors list --- wp-autoupdates.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-autoupdates.php b/wp-autoupdates.php index 6bcb832..6ee2380 100755 --- a/wp-autoupdates.php +++ b/wp-autoupdates.php @@ -9,7 +9,7 @@ Tested up to: 5.4 Author: The WordPress Team Author URI: https://wordpress.org -Contributors: wordpressdotorg, audrasjb, whodunitagency, pbiron, xkon, karmatosed, mapk, bookdude13 +Contributors: wordpressdotorg, audrasjb, whodunitagency, pbiron, xkon, karmatosed, mapk License: GPLv2 License URI: http://www.gnu.org/licenses/gpl-2.0.html Text Domain: wp-autoupdates From c630af0c8e1a10b455592e9d473c92914c846ecc Mon Sep 17 00:00:00 2001 From: Ryan Fredlund Date: Sat, 14 Mar 2020 07:53:24 +0100 Subject: [PATCH 3/3] Using remove() instead of setting text to empty string --- wp-autoupdates.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-autoupdates.php b/wp-autoupdates.php index 7c2d2fb..67e2bb0 100755 --- a/wp-autoupdates.php +++ b/wp-autoupdates.php @@ -59,7 +59,7 @@ function wp_autoupdates_enqueues( $hook ) { var plugin = jQuery( this ).closest("tr").data("plugin"); var plugin_row = jQuery( "tr.update[data-plugin=\'" + plugin + "\']" ); var plugin_auto_update_time_text = plugin_row.find("span.plugin-autoupdate-time"); - plugin_auto_update_time_text.text(""); + plugin_auto_update_time_text.remove(); }); });'; wp_add_inline_script( 'jquery', $script );