diff --git a/Gruntfile.js b/Gruntfile.js index bc0fcf617a006bdf32648830e622c2c201283693..cc1962dd2e63e88278bd5dafd846a7cb555d5901 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 a23cc6e940f9a903cca83293060ee1a45e9f5bf9..567831c081200a2a24191be3bb7d1f6b12665709 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 3f1f58df05cd7a072daf7a94e3b54080d7dfa588..630b03a78226bbec8d062b031567f99b542312ae 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 b9721201a039caae3c685d6746e06a3fb3efcdf5..de43a00b3784356ddbd94e919f366b8913b9e7f8 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 ad770c653e0113d1a628d0c881bed92fab93dd27..e1094b3d8d2782225bbb7f1659f7d85a4da358dc 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 470b25a2fe0ae8d77fcd21a1eb7778770a1be458..750887f86bcbd1f249d6a77742e34f489337e438 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 622c7a178a9c6ef136fa5a8f8ce1d6fcb010eebf..031913982495969c697d1e37f66b2294a7cbf4a8 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 68e74ff5f0abc514438b4c5948d99d57da7382b8..ace7ed61d571fc3b53ca2bf886d5f4101a8184a7 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 b2d3724c6df0cedf84681ebe2c5bc6af35737bc2..3f64cc3e88d5656b857c1a9d6ea972ee388a5c7d 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 c90811ff746d5f35c74167c6571d4c8fe01e42a4..860c4d37f7cbbf73e6a11fdd0ac2d78ce3561701 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 6696683db036d618026bdf6278b97ccec4207df8..85cce1c4969f2f41d78c735d0c091b71e6e5b41b 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 57472658e428a21d8c58cf0079dabbaf0e047823..2b3dc8b9a766dcc27269950f571a5354202485e4 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 dde0131d4f82fcad28438b657a4acec782c8545b..6957993b0453f45c84e5df68294cac423ca84747 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 814ff7bfb0a76a782a230f37a4c60111ad4bc22f..65b9153f7ff77e8620ad96dea4ef4d217dd1e6b8 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 */ /**