Changeset 3229710
- Timestamp:
- 01/27/2025 03:25:46 PM (14 months ago)
- Location:
- revision-buster
- Files:
-
- 2 added
- 3 edited
-
assets/banner-772×250.jpg (added)
-
assets/icon-256×256.jpg (added)
-
trunk/Readme.md (modified) (10 diffs)
-
trunk/helpers/custom-functions.php (modified) (1 diff)
-
trunk/includes/class-revision-buster.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
revision-buster/trunk/Readme.md
r3217227 r3229710 1 1 # Revision Buster 2 2 3 - Contributors: hilayt24,sabbir19914 - Requires at least: 4.75 - Tested up to: 6.76 - Stable tag: 1.0.07 - Requires PHP: 7.0 or higher8 - License: GPLv2 or later9 - License URI: https://www.gnu.org/licenses/gpl-2.0.html3 - **Contributors**: hilayt24, sabbir1991 4 - **Requires at least**: 4.7 5 - **Tested up to**: 6.9 6 - **Stable tag**: 1.0.0 7 - **Requires PHP**: 7.4 8 - **License**: GPLv2 or later 9 - **License URI**: https://www.gnu.org/licenses/gpl-2.0.html 10 10 11 ### Short Description 12 13 Boost your WordPress performance with Revision Buster—the ultimate plugin for managing and cleaning up post and page revisions. Optimize your database, improve site speed, and schedule automated cleanups effortlessly. 14 15 --- 11 16 12 17 ### Description 13 18 14 Revision Buster is a WordPress plugin designed to optimize your database by managing and cleaning up post and page revisions efficiently. By limiting unnecessary revisions, it helps improve site performance and maintain a lean database. 19 Revision Buster is a powerful WordPress plugin designed to enhance website performance by efficiently managing and cleaning up post and page revisions. By removing unnecessary revisions and offering customizable retention settings, it ensures your database remains optimized, reducing bloat and improving load times. 20 21 With Revision Buster, you can easily schedule automated cleanups, perform selective or global revision deletions, and configure retention rules tailored to your site’s needs. Built with scalability in mind, the plugin seamlessly handles large databases and is perfect for sites of any size. 15 22 16 23 --- … … 18 25 ## Features 19 26 20 - **Selective Revision Cleanup**: Choose specific posts or pages to delete revisions for. 21 - **Global Cleanup**: Remove revisions for all posts and pages in one click. 22 - **Revisions Retention**: Configure the number of revisions to retain for each post or page. 23 - **Scheduled Cleanup**: Set automated cleanup intervals (hourly, daily, weekly, monthly, or yearly). 24 - **Cache Management**: Efficiently caches posts and pages to optimize performance. 25 - **Custom Cron Intervals**: Supports monthly and yearly cron schedules. 27 - **Selective Revision Cleanup**: Delete revisions for specific posts or pages as needed. 28 - **Global Cleanup**: Clean up revisions for all posts and pages with a single click. 29 - **Revisions Retention**: Customize how many revisions to retain per post or page. 30 - **Scheduled Cleanup**: Automate cleanup tasks at intervals (hourly, daily, weekly, monthly, or yearly). 31 - **Cache Management**: Uses transients for efficient caching of posts and pages. 32 - **Custom Cron Intervals**: Adds monthly and yearly cleanup schedules. 33 - **Custom Post Type Support**: Handles revisions for all registered post types (future roadmap). 26 34 27 35 --- … … 30 38 31 39 1. Download the plugin and upload the folder to the `/wp-content/plugins/` directory. 32 2. Activate the plugin through the "Plugins"menu in WordPress.33 3. Navigate to the "Revision Cleanup" pagein the WordPress admin menu.40 2. Activate the plugin via the **Plugins** menu in WordPress. 41 3. Navigate to **Tools > Revision Buster** in the WordPress admin menu. 34 42 35 43 --- … … 37 45 ## Usage 38 46 39 ### Admin Page 40 - **Revision Cleanup Settings**: Manage the number of revisions to retain and schedule automated cleanups. 41 - **Single Post/Page Cleanup**: Select a specific post or page and delete its revisions. 42 - **Global Cleanup**: Delete revisions for all posts and pages. 47 ### Admin Settings 48 49 - **Revision Cleanup Settings**: Manage revision retention rules and schedule automated cleanups. 50 - **Single Post/Page Cleanup**: Select individual posts or pages and delete their revisions. 51 - **Global Cleanup**: Remove revisions for all posts and pages to free up database space. 43 52 44 53 ### Automated Cleanup 45 - Schedule cleanup tasks at intervals (hourly, daily, weekly, monthly, or yearly) to ensure your database remains optimized. 54 55 - Configure intervals for automated cleanup tasks (hourly, daily, weekly, monthly, yearly). 56 - Ensure your database stays optimized without manual intervention. 46 57 47 58 --- … … 50 61 51 62 ### Actions 52 - `revision_buster_run_revision_cleanup_cron`: Executes the revision cleanup process. 53 - `save_post` & `delete_post`: Invalidates cached posts when a post or page is updated or deleted. 63 64 - `revision_buster_run_revision_cleanup_cron`: Executes the scheduled revision cleanup. 65 - `save_post` & `delete_post`: Automatically invalidates cached posts when updates or deletions occur. 54 66 55 67 ### Filters 56 - `cron_schedules`: Adds custom intervals (monthly, yearly) to the WordPress cron schedules. 68 69 - `cron_schedules`: Adds custom intervals (monthly, yearly) to WordPress cron schedules. 57 70 58 71 --- … … 61 74 62 75 ### Cache Management 63 The plugin uses WordPress transients to cache all posts and pages, improving performance when processing large numbers of posts. 76 77 - Implements WordPress transients to improve performance when processing large datasets. 78 - Efficiently manages cached data to minimize load times during cleanup tasks. 64 79 65 80 ### Cleanup Logic 66 - Deletes all revisions for a post while retaining the specified number of recent revisions. 67 - Supports batch processing for scalability. 81 82 - Deletes older revisions while retaining the configured number of most recent revisions. 83 - Utilizes batch processing for scalability on larger databases. 68 84 69 85 --- … … 79 95 80 96 - Add support for custom post types. 81 - Enhanced UI for managing cleanup settings. 82 - Integration with third-party backup plugins. 97 - Enhanced UI with analytics and visual cleanup reports. 98 - Third-party plugin integration for backup compatibility. 99 - Multisite support for network-wide revision cleanup. 83 100 84 101 --- … … 86 103 ## Contribution 87 104 88 Feel free to submit issues or pull requests onthe [GitHub repository](https://github.com/HILAYTRIVEDI/revision-buster).105 We welcome your contributions! Feel free to submit issues or pull requests via the [GitHub repository](https://github.com/HILAYTRIVEDI/revision-buster). 89 106 90 107 --- … … 92 109 ## License 93 110 94 This plugin is open-source and licensed under the MIT License.111 This plugin is open-source and licensed under the GPLv2 or later. Learn more at [GPL License](https://www.gnu.org/licenses/gpl-2.0.html). 95 112 96 113 --- … … 99 116 100 117 Developed by [Hilay Trivedi](https://github.com/HILAYTRIVEDI). 118 119 Special thanks to the WordPress community for their continuous support and feedback. -
revision-buster/trunk/helpers/custom-functions.php
r3217227 r3229710 13 13 function revision_buster_filter_input( $type, $variable_name, $filter = FILTER_DEFAULT, $options = 0 ) { 14 14 switch ( $filter ) { 15 case R B_FILTER_SANITIZE_STRING:15 case REVISION_BUSTER__FILTER_SANITIZE_STRING: 16 16 $sanitized_variable = sanitize_text_field( filter_input( $type, $variable_name, FILTER_UNSAFE_RAW, $options ) ); 17 17 break; -
revision-buster/trunk/includes/class-revision-buster.php
r3217227 r3229710 152 152 $revision_buster_cleanup_interval = get_option( 'revision_cleanup_interval', 'monthly' ); 153 153 154 $revision_buster_revision_cleanup_submit = revision_buster_filter_input( INPUT_POST, 'revision_cleanup_submit', R B_FILTER_SANITIZE_STRING );155 $revision_buster_delete_all_revisions = revision_buster_filter_input( INPUT_POST, 'delete_all_revisions', R B_FILTER_SANITIZE_STRING );156 $revision_buster_delete_single_revision = revision_buster_filter_input( INPUT_POST, 'delete_single_revision', R B_FILTER_SANITIZE_STRING );154 $revision_buster_revision_cleanup_submit = revision_buster_filter_input( INPUT_POST, 'revision_cleanup_submit', REVISION_BUSTER__FILTER_SANITIZE_STRING ); 155 $revision_buster_delete_all_revisions = revision_buster_filter_input( INPUT_POST, 'delete_all_revisions', REVISION_BUSTER__FILTER_SANITIZE_STRING ); 156 $revision_buster_delete_single_revision = revision_buster_filter_input( INPUT_POST, 'delete_single_revision', REVISION_BUSTER__FILTER_SANITIZE_STRING ); 157 157 158 158 // Handle form submission. … … 161 161 $revision_buster_selected_pages = revision_buster_filter_input( INPUT_POST, 'selected_pages', FILTER_SANITIZE_NUMBER_INT, FILTER_REQUIRE_ARRAY ) ?: []; 162 162 $revision_buster_revisions_to_keep = revision_buster_filter_input( INPUT_POST, 'revisions_to_keep', FILTER_VALIDATE_INT ); 163 $revision_buster_cleanup_interval = revision_buster_filter_input( INPUT_POST, 'cleanup_interval', R B_FILTER_SANITIZE_STRING );163 $revision_buster_cleanup_interval = revision_buster_filter_input( INPUT_POST, 'cleanup_interval', REVISION_BUSTER__FILTER_SANITIZE_STRING ); 164 164 165 165 update_option( 'revision_cleanup_pages', $revision_buster_selected_pages );
Note: See TracChangeset
for help on using the changeset viewer.