From 9db2eaaa59509793a06855ecd045a40b4e674cc1 Mon Sep 17 00:00:00 2001 From: Erick Hitter <git-contrib@ethitter.com> Date: Thu, 14 Sep 2017 11:57:25 -0700 Subject: [PATCH] Fix plugin name, since it isn't just editing --- Gruntfile.js | 6 ++--- README.md | 10 +++---- ...fload.php => bulk-actions-cron-offload.php | 10 +++---- includes/class-delete-all.php | 16 ++++++------ includes/class-delete-permanently.php | 16 ++++++------ includes/class-main.php | 14 +++++----- includes/class-move-to-trash.php | 16 ++++++------ includes/class-restore-from-trash.php | 16 ++++++------ includes/utils.php | 4 +-- ...load.pot => bulk-actions-cron-offload.pot} | 26 ++++++++++++++----- package.json | 2 +- readme.txt | 10 +++---- tests/bootstrap.php | 4 +-- tests/tests/class-sampletest.php | 2 +- 14 files changed, 83 insertions(+), 69 deletions(-) rename bulk-edit-cron-offload.php => bulk-actions-cron-offload.php (69%) rename languages/{bulk-edit-cron-offload.pot => bulk-actions-cron-offload.pot} (75%) diff --git a/Gruntfile.js b/Gruntfile.js index bc0fcf6..cc1962d 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -9,7 +9,7 @@ module.exports = function( grunt ) { addtextdomain: { options: { - textdomain: 'bulk-edit-cron-offload', + textdomain: 'bulk-actions-cron-offload', }, update_all_domains: { options: { @@ -31,8 +31,8 @@ module.exports = function( grunt ) { target: { options: { domainPath: '/languages', - mainFile: 'bulk-edit-cron-offload.php', - potFilename: 'bulk-edit-cron-offload.pot', + mainFile: 'bulk-actions-cron-offload.php', + potFilename: 'bulk-actions-cron-offload.pot', potHeaders: { poedit: true, 'x-poedit-keywordslist': true diff --git a/README.md b/README.md index a23cc6e..567831c 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,21 @@ -# Bulk Edit Cron Offload # +# Bulk Actions Cron Offload # **Contributors:** ethitter, automattic -**Tags:** cron, bulk edit +**Tags:** cron, bulk edit, bulk actions **Requires at least:** 4.8.1 **Tested up to:** 4.9 **Stable tag:** 1.0 **License:** GPLv2 or later **License URI:** http://www.gnu.org/licenses/gpl-2.0.html -Process Core's Bulk Edit requests using Cron +Process Core's Bulk Actions using Cron ## Description ## -Process Core's Bulk Edit requests using Cron, rather than via a `$_GET` request. +Process Core's Bulk Actions using Cron, rather than via a `$_GET` request. ## Installation ## -1. Upload the `bulk-edit-cron-offload` directory to the `/wp-content/plugins/` directory +1. Upload the `bulk-actions-cron-offload` directory to the `/wp-content/plugins/` directory 1. Activate the plugin through the 'Plugins' menu in WordPress ## Frequently Asked Questions ## diff --git a/bulk-edit-cron-offload.php b/bulk-actions-cron-offload.php similarity index 69% rename from bulk-edit-cron-offload.php rename to bulk-actions-cron-offload.php index 3f1f58d..630b03a 100644 --- a/bulk-edit-cron-offload.php +++ b/bulk-actions-cron-offload.php @@ -1,18 +1,18 @@ <?php /** - * Plugin Name: Bulk Edit Cron Offload + * Plugin Name: Bulk Actions Cron Offload * Plugin URI: https://vip.wordpress.com/ - * Description: Process Bulk Edit requests using Cron + * Description: Process Bulk Action requests using Cron * Author: Erick Hitter, Automattic * Author URI: https://automattic.com/ - * Text Domain: bulk-edit-cron-offload + * Text Domain: bulk-actions-cron-offload * Domain Path: /languages * Version: 1.0 * - * @package Bulk_Edit_Cron_Offload + * @package Bulk_Actions_Cron_Offload */ -namespace Automattic\WP\Bulk_Edit_Cron_Offload; +namespace Automattic\WP\Bulk_Actions_Cron_Offload; // Plugin dependencies. require __DIR__ . '/includes/utils.php'; diff --git a/includes/class-delete-all.php b/includes/class-delete-all.php index b972120..de43a00 100644 --- a/includes/class-delete-all.php +++ b/includes/class-delete-all.php @@ -2,10 +2,10 @@ /** * Offload "Empty Trash" * - * @package Bulk_Edit_Cron_Offload + * @package Bulk_Actions_Cron_Offload */ -namespace Automattic\WP\Bulk_Edit_Cron_Offload; +namespace Automattic\WP\Bulk_Actions_Cron_Offload; /** * Class Delete_All @@ -16,7 +16,7 @@ class Delete_All { */ const ACTION = 'delete_all'; - const ADMIN_NOTICE_KEY = 'bulk_edit_cron_offload_deleted_all'; + const ADMIN_NOTICE_KEY = 'bulk_actions_cron_offload_deleted_all'; /** * Register this bulk process' hooks @@ -102,9 +102,9 @@ class Delete_All { } $results = compact( 'deleted', 'locked', 'auth_error', 'error' ); - do_action( 'bulk_edit_cron_offload_delete_all_request_completed', $results, $vars ); + do_action( 'bulk_actions_cron_offload_delete_all_request_completed', $results, $vars ); } else { - do_action( 'bulk_edit_cron_offload_delete_all_request_no_posts', $post_ids, $vars ); + do_action( 'bulk_actions_cron_offload_delete_all_request_no_posts', $post_ids, $vars ); } } @@ -120,15 +120,15 @@ class Delete_All { if ( isset( $_REQUEST[ self::ADMIN_NOTICE_KEY ] ) ) { if ( 1 === (int) $_REQUEST[ self::ADMIN_NOTICE_KEY ] ) { $type = 'success'; - $message = __( 'Success! The trash will be emptied shortly.', 'bulk-edit-cron-offload' ); + $message = __( 'Success! The trash will be emptied shortly.', 'bulk-actions-cron-offload' ); } else { $type = 'error'; - $message = __( 'A request to empty the trash is already pending for this post type.', 'bulk-edit-cron-offload' ); + $message = __( 'A request to empty the trash is already pending for this post type.', 'bulk-actions-cron-offload' ); } } elseif ( 'edit' === $screen->base && isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status'] ) { if ( Main::get_action_next_scheduled( self::ACTION, $screen->post_type ) ) { $type = 'warning'; - $message = __( 'A pending request to empty the trash will be processed soon.', 'bulk-edit-cron-offload' ); + $message = __( 'A pending request to empty the trash will be processed soon.', 'bulk-actions-cron-offload' ); } } diff --git a/includes/class-delete-permanently.php b/includes/class-delete-permanently.php index ad770c6..e1094b3 100644 --- a/includes/class-delete-permanently.php +++ b/includes/class-delete-permanently.php @@ -2,10 +2,10 @@ /** * Offload "Delete Permanently" * - * @package Bulk_Edit_Cron_Offload + * @package Bulk_Actions_Cron_Offload */ -namespace Automattic\WP\Bulk_Edit_Cron_Offload; +namespace Automattic\WP\Bulk_Actions_Cron_Offload; /** * Class Delete_Permanently @@ -16,7 +16,7 @@ class Delete_Permanently { */ const ACTION = 'delete'; - const ADMIN_NOTICE_KEY = 'bulk_edit_cron_offload_delete_permanently'; + const ADMIN_NOTICE_KEY = 'bulk_actions_cron_offload_delete_permanently'; /** * Register this bulk process' hooks @@ -90,9 +90,9 @@ class Delete_Permanently { } $results = compact( 'deleted', 'locked', 'auth_error', 'error' ); - do_action( 'bulk_edit_cron_offload_move_to_trash_request_completed', $results, $vars ); + do_action( 'bulk_actions_cron_offload_move_to_trash_request_completed', $results, $vars ); } else { - do_action( 'bulk_edit_cron_offload_move_to_trash_request_no_posts', $vars->posts, $vars ); + do_action( 'bulk_actions_cron_offload_move_to_trash_request_no_posts', $vars->posts, $vars ); } } @@ -108,15 +108,15 @@ class Delete_Permanently { if ( isset( $_REQUEST[ self::ADMIN_NOTICE_KEY ] ) ) { if ( 1 === (int) $_REQUEST[ self::ADMIN_NOTICE_KEY ] ) { $type = 'success'; - $message = __( 'Success! The selected posts will be deleted shortly.', 'bulk-edit-cron-offload' ); + $message = __( 'Success! The selected posts will be deleted shortly.', 'bulk-actions-cron-offload' ); } else { $type = 'error'; - $message = __( 'The selected posts are already scheduled to be deleted.', 'bulk-edit-cron-offload' ); + $message = __( 'The selected posts are already scheduled to be deleted.', 'bulk-actions-cron-offload' ); } } elseif ( 'edit' === $screen->base && isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status'] ) { if ( Main::get_post_ids_for_pending_events( self::ACTION, $screen->post_type, 'trash' ) ) { $type = 'warning'; - $message = __( 'Some items that would normally be shown here are waiting to be deleted permanently. These items are hidden until then.', 'bulk-edit-cron-offload' ); + $message = __( 'Some items that would normally be shown here are waiting to be deleted permanently. These items are hidden until then.', 'bulk-actions-cron-offload' ); } } diff --git a/includes/class-main.php b/includes/class-main.php index 470b25a..750887f 100644 --- a/includes/class-main.php +++ b/includes/class-main.php @@ -1,11 +1,11 @@ <?php /** - * Plugin's main class, dispatcher for specific bulk-edit requests + * Plugin's main class, dispatcher for specific bulk-action requests * - * @package Bulk_Edit_Cron_Offload + * @package Bulk_Actions_Cron_Offload */ -namespace Automattic\WP\Bulk_Edit_Cron_Offload; +namespace Automattic\WP\Bulk_Actions_Cron_Offload; /** * Class Main @@ -14,12 +14,12 @@ class Main { /** * Prefix for bulk-process hook invoked by request-specific classes */ - const ACTION = 'a8c_bulk_edit_cron_'; + const ACTION = 'bulk_actions_cron_offload_'; /** * Common cron action */ - const CRON_EVENT = 'bulk_edit_cron_offload'; + const CRON_EVENT = 'bulk_actions_cron_offload'; /** * Register actions @@ -69,7 +69,7 @@ class Main { } /** - * Determine if current request is a bulk edit + * Determine if current request is a bulk action */ private static function should_intercept_request() { if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) ) { @@ -221,7 +221,7 @@ class Main { public static function do_admin_redirect( $return_key, $succeeded = false, $extra_keys = array() ) { $redirect = wp_unslash( $_SERVER['REQUEST_URI'] ); - // Remove arguments that could re-trigger this bulk-edit. + // Remove arguments that could re-trigger this bulk action. $action_keys = array( '_wp_http_referer', '_wpnonce', 'action', 'action2' ); $action_keys = array_merge( $action_keys, $extra_keys ); $redirect = remove_query_arg( $action_keys, $redirect ); diff --git a/includes/class-move-to-trash.php b/includes/class-move-to-trash.php index 622c7a1..0319139 100644 --- a/includes/class-move-to-trash.php +++ b/includes/class-move-to-trash.php @@ -2,10 +2,10 @@ /** * Offload "Move to Trash" * - * @package Bulk_Edit_Cron_Offload + * @package Bulk_Actions_Cron_Offload */ -namespace Automattic\WP\Bulk_Edit_Cron_Offload; +namespace Automattic\WP\Bulk_Actions_Cron_Offload; /** * Class Move_To_Trash @@ -16,7 +16,7 @@ class Move_To_Trash { */ const ACTION = 'trash'; - const ADMIN_NOTICE_KEY = 'bulk_edit_cron_offload_move_to_trash'; + const ADMIN_NOTICE_KEY = 'bulk_actions_cron_offload_move_to_trash'; /** * Register this bulk process' hooks @@ -90,9 +90,9 @@ class Move_To_Trash { } $results = compact( 'trashed', 'locked', 'auth_error', 'error' ); - do_action( 'bulk_edit_cron_offload_move_to_trash_request_completed', $results, $vars ); + do_action( 'bulk_actions_cron_offload_move_to_trash_request_completed', $results, $vars ); } else { - do_action( 'bulk_edit_cron_offload_move_to_trash_request_no_posts', $vars->posts, $vars ); + do_action( 'bulk_actions_cron_offload_move_to_trash_request_no_posts', $vars->posts, $vars ); } } @@ -108,10 +108,10 @@ class Move_To_Trash { if ( isset( $_REQUEST[ self::ADMIN_NOTICE_KEY ] ) ) { if ( 1 === (int) $_REQUEST[ self::ADMIN_NOTICE_KEY ] ) { $type = 'success'; - $message = __( 'Success! The selected posts will be moved to the trash shortly.', 'bulk-edit-cron-offload' ); + $message = __( 'Success! The selected posts will be moved to the trash shortly.', 'bulk-actions-cron-offload' ); } else { $type = 'error'; - $message = __( 'The selected posts are already scheduled to be moved to the trash.', 'bulk-edit-cron-offload' ); + $message = __( 'The selected posts are already scheduled to be moved to the trash.', 'bulk-actions-cron-offload' ); } } elseif ( 'edit' === $screen->base ) { if ( isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status'] ) { @@ -123,7 +123,7 @@ class Move_To_Trash { if ( ! empty( $pending ) ) { $type = 'warning'; - $message = __( 'Some items that would normally be shown here are waiting to be moved to the trash. These items are hidden until they are moved.', 'bulk-edit-cron-offload' ); + $message = __( 'Some items that would normally be shown here are waiting to be moved to the trash. These items are hidden until they are moved.', 'bulk-actions-cron-offload' ); } } diff --git a/includes/class-restore-from-trash.php b/includes/class-restore-from-trash.php index 68e74ff..ace7ed6 100644 --- a/includes/class-restore-from-trash.php +++ b/includes/class-restore-from-trash.php @@ -2,10 +2,10 @@ /** * Offload "Restore from Trash" * - * @package Bulk_Edit_Cron_Offload + * @package Bulk_Actions_Cron_Offload */ -namespace Automattic\WP\Bulk_Edit_Cron_Offload; +namespace Automattic\WP\Bulk_Actions_Cron_Offload; /** * Class Restore_From_Trash @@ -16,7 +16,7 @@ class Restore_From_Trash { */ const ACTION = 'untrash'; - const ADMIN_NOTICE_KEY = 'bulk_edit_cron_offload_restore_from_trash'; + const ADMIN_NOTICE_KEY = 'bulk_actions_cron_offload_restore_from_trash'; /** * Register this bulk process' hooks @@ -90,9 +90,9 @@ class Restore_From_Trash { } $results = compact( 'restored', 'locked', 'auth_error', 'error' ); - do_action( 'bulk_edit_cron_offload_restore_from_trash_request_completed', $results, $vars ); + do_action( 'bulk_actions_cron_offload_restore_from_trash_request_completed', $results, $vars ); } else { - do_action( 'bulk_edit_cron_offload_restore_from_trash_request_no_posts', $vars->posts, $vars ); + do_action( 'bulk_actions_cron_offload_restore_from_trash_request_no_posts', $vars->posts, $vars ); } } @@ -108,15 +108,15 @@ class Restore_From_Trash { if ( isset( $_REQUEST[ self::ADMIN_NOTICE_KEY ] ) ) { if ( 1 === (int) $_REQUEST[ self::ADMIN_NOTICE_KEY ] ) { $type = 'success'; - $message = __( 'Success! The selected posts will be restored shortly.', 'bulk-edit-cron-offload' ); + $message = __( 'Success! The selected posts will be restored shortly.', 'bulk-actions-cron-offload' ); } else { $type = 'error'; - $message = __( 'The selected posts are already scheduled to be restored.', 'bulk-edit-cron-offload' ); + $message = __( 'The selected posts are already scheduled to be restored.', 'bulk-actions-cron-offload' ); } } elseif ( 'edit' === $screen->base && isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status'] ) { if ( Main::get_post_ids_for_pending_events( self::ACTION, $screen->post_type, 'trash' ) ) { $type = 'warning'; - $message = __( 'Some items that would normally be shown here are waiting to be restored from the trash. These items are hidden until they are restored.', 'bulk-edit-cron-offload' ); + $message = __( 'Some items that would normally be shown here are waiting to be restored from the trash. These items are hidden until they are restored.', 'bulk-actions-cron-offload' ); } } diff --git a/includes/utils.php b/includes/utils.php index b2d3724..3f64cc3 100644 --- a/includes/utils.php +++ b/includes/utils.php @@ -2,10 +2,10 @@ /** * Plugin utilities * - * @package Bulk_Edit_Cron_Offload + * @package Bulk_Actions_Cron_Offload */ -namespace Automattic\WP\Bulk_Edit_Cron_Offload; +namespace Automattic\WP\Bulk_Actions_Cron_Offload; /** * Free memory diff --git a/languages/bulk-edit-cron-offload.pot b/languages/bulk-actions-cron-offload.pot similarity index 75% rename from languages/bulk-edit-cron-offload.pot rename to languages/bulk-actions-cron-offload.pot index c90811f..860c4d3 100644 --- a/languages/bulk-edit-cron-offload.pot +++ b/languages/bulk-actions-cron-offload.pot @@ -1,11 +1,11 @@ # Copyright (C) 2017 Erick Hitter, Automattic -# This file is distributed under the same license as the Bulk Edit Cron Offload package. +# This file is distributed under the same license as the Bulk Actions Cron Offload package. msgid "" msgstr "" -"Project-Id-Version: Bulk Edit Cron Offload 1.0\n" +"Project-Id-Version: Bulk Actions Cron Offload 1.0\n" "Report-Msgid-Bugs-To: " -"https://wordpress.org/support/plugin/bulk-edit-cron-offload\n" -"POT-Creation-Date: 2017-09-14 05:06:18+00:00\n" +"https://wordpress.org/support/plugin/bulk-actions-cron-offload\n" +"POT-Creation-Date: 2017-09-14 18:55:07+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -37,6 +37,20 @@ msgstr "" msgid "A pending request to empty the trash will be processed soon." msgstr "" +#: includes/class-delete-permanently.php:111 +msgid "Success! The selected posts will be deleted shortly." +msgstr "" + +#: includes/class-delete-permanently.php:114 +msgid "The selected posts are already scheduled to be deleted." +msgstr "" + +#: includes/class-delete-permanently.php:119 +msgid "" +"Some items that would normally be shown here are waiting to be deleted " +"permanently. These items are hidden until then." +msgstr "" + #: includes/class-move-to-trash.php:111 msgid "Success! The selected posts will be moved to the trash shortly." msgstr "" @@ -66,7 +80,7 @@ msgid "" msgstr "" #. Plugin Name of the plugin/theme -msgid "Bulk Edit Cron Offload" +msgid "Bulk Actions Cron Offload" msgstr "" #. Plugin URI of the plugin/theme @@ -74,7 +88,7 @@ msgid "https://vip.wordpress.com/" msgstr "" #. Description of the plugin/theme -msgid "Process Bulk Edit requests using Cron" +msgid "Process Bulk Action requests using Cron" msgstr "" #. Author of the plugin/theme diff --git a/package.json b/package.json index 6696683..85cce1c 100755 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "bulk-edit-cron-offload", + "name": "bulk-actions-cron-offload", "version": "0.1.0", "main": "Gruntfile.js", "author": "YOUR NAME HERE", diff --git a/readme.txt b/readme.txt index 5747265..2b3dc8b 100755 --- a/readme.txt +++ b/readme.txt @@ -1,21 +1,21 @@ -=== Bulk Edit Cron Offload === +=== Bulk Actions Cron Offload === Contributors: ethitter, automattic -Tags: cron, bulk edit +Tags: cron, bulk edit, bulk actions Requires at least: 4.8.1 Tested up to: 4.9 Stable tag: 1.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html -Process Core's Bulk Edit requests using Cron +Process Core's Bulk Actions using Cron == Description == -Process Core's Bulk Edit requests using Cron, rather than via a `$_GET` request. +Process Core's Bulk Actions using Cron, rather than via a `$_GET` request. == Installation == -1. Upload the `bulk-edit-cron-offload` directory to the `/wp-content/plugins/` directory +1. Upload the `bulk-actions-cron-offload` directory to the `/wp-content/plugins/` directory 1. Activate the plugin through the 'Plugins' menu in WordPress == Frequently Asked Questions == diff --git a/tests/bootstrap.php b/tests/bootstrap.php index dde0131..6957993 100755 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -2,7 +2,7 @@ /** * PHPUnit bootstrap file * - * @package Bulk_Edit_Cron_Offload + * @package Bulk_Actions_Cron_Offload */ $_tests_dir = getenv( 'WP_TESTS_DIR' ); @@ -17,7 +17,7 @@ require_once $_tests_dir . '/includes/functions.php'; * Manually load the plugin being tested. */ function _manually_load_plugin() { - require dirname( dirname( __FILE__ ) ) . '/bulk-edit-cron-offload.php'; + require dirname( dirname( __FILE__ ) ) . '/bulk-actions-cron-offload.php'; } tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' ); diff --git a/tests/tests/class-sampletest.php b/tests/tests/class-sampletest.php index 814ff7b..65b9153 100755 --- a/tests/tests/class-sampletest.php +++ b/tests/tests/class-sampletest.php @@ -2,7 +2,7 @@ /** * Class SampleTest * - * @package Bulk_Edit_Cron_Offload + * @package Bulk_Actions_Cron_Offload */ /** -- GitLab