• Stars
    star
    153
  • Rank 243,368 (Top 5 %)
  • Language
    PHP
  • Created almost 10 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

WP-Sweep allows you to clean up unused, orphaned and duplicated data in your WordPress. It also optimizes your database tables.

WP-Sweep

Contributors: GamerZ
Donate link: https://lesterchan.net/site/donation/
Tags: sweep, clean, cleanup, clean up, optimize, orphan, unused, duplicated, posts, post meta, comments, comment meta, users, user meta, terms, term meta, term relationships, revisions, auto drafts, transient, database, tables, oembed Requires at least: 4.6
Tested up to: 6.3
Stable tag: 1.1.8
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

WP-Sweep allows you to clean up unused, orphaned and duplicated data in your WordPress. It also optimizes your database tables.

Description

This plugin cleans up:

  • Revisions
  • Auto drafts
  • Deleted comments
  • Unapproved comments
  • Spammed comments
  • Deleted comments
  • Orphaned post meta
  • Orphaned comment meta
  • Orphaned user meta
  • Orphaned term meta
  • Orphan term relationships
  • Unused terms
  • Duplicated post meta
  • Duplicated comment meta
  • Duplicated user meta
  • Duplicated term meta
  • Transient options
  • Optimizes database tables
  • oEmbed caches in post meta

This plugin uses proper WordPress delete functions as much as possible instead of running direct delete MySQL queries.

Following delete functions are used:

  • wp_delete_post_revision()
  • wp_delete_post()
  • wp_delete_comment()
  • delete_post_meta()
  • delete_comment_meta()
  • delete_user_meta()
  • delete_term_meta()
  • wp_remove_object_terms()
  • wp_delete_term()
  • delete_transient()
  • delete_site_transient()

WP-Sweep WP REST API Endpoints

  • GET /wp-json/sweep/v1/count/<Name>. Get the number of items that we will be sweeping.
  • GET /wp-json/sweep/v1/details/<Name>. Get the details of the items that we will be sweeping.
  • DELETE /wp-json/sweep/v1/sweep/<Name>. Runs sweep for that particular item.

WP-Sweep WP-CLI Commands

  • wp sweep --all. Runs sweep for all items.
  • wp sweep <Name>. Runs sweep for that particular item.
  • wp sweep <Name1> <Name2>. Run sweep for the selected items.

WP-Sweep Available Items:

  • revisions
  • auto_drafts
  • deleted_posts
  • unapproved_comments
  • spam_comments
  • deleted_comments
  • transient_options
  • orphan_postmeta
  • orphan_commentmeta
  • orphan_usermeta
  • orphan_termmeta
  • orphan_term_relationships
  • unused_terms
  • duplicated_postmeta
  • duplicated_commentmeta
  • duplicated_usermeta
  • duplicated_termmeta
  • optimize_database
  • oembed_postmeta

WP-Sweep is not compatible with the following plugins:

Build Status

Code Climate Issue Count

Development

Credits

Donations

I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks, I will really appreciate it. If not feel free to use it without any obligations.

Changelog

1.1.8

  • FIXED: Added current_user_can() Check For AJAX Calls

1.1.7

  • FIXED: Pass in default blank string to fix fatal error

1.1.6

  • NEW: Re-org wp-sweep.php to inc/class-wpsweep.php
  • NEW: Bump to WordPress 6.2

1.1.5

  • NEW: Bump to WordPress 5.8

1.1.4

  • FIXED: Replaced %_transient_% with %\_transient\_%. Escape _ in MySQL if not it is being used as a wildcard character. Props @janrenn.

1.1.3

  • FIXED: Changed permissions check to activate_plugins because update_plugins will return false when DISALLOW_FILE_MODS=true.

1.1.2

  • NEW: Changed permission check to update_plugins for better MultiSite compatibility.
  • NEW: Bump min PHP version to 5.6.

1.1.1

  • NEW: wp_sweep_excluded_termids filter.

1.1.0

  • NEW: Added WP Rest API Endpoint support, sweep/v1/count/<Name>, sweep/v1/details/<Name>, and sweep/v1/sweep/<Name>
  • FIXED: Follow as close as possible to WordPress Coding Standards

1.0.12

  • NEW: Bump to WordPress 4.9
  • NEW: Update README to incompatible plugins

1.0.10

  • FIXED: Invalid plugin head 'This plugin has an invalid header.'

1.0.9

  • NEW: Support for Codeclimate
  • FIXES: Uses get_sites() on WordPress 4.6. This should fix deprecated notices.
  • FIXES: Fixes translation placeholder count. Props @pedro-mendonca.
  • FIXES: Use manage_options capability as it conflicts with Admin Menu Editor on multisite installs. Props @EusebiuOprinoiu.

1.0.8

  • NEW: Added wp_sweep_excluded_taxonomies filter to allow more than just link_category taxonomy
  • NEW: Support for WP-CLI wp sweep

1.0.7

  • FIXES: Use custom query to delete Orphaned Term Relationship if wp_remove_object_terms() fails

1.0.6

  • NEW: Delete 'languages' folder from the plugin
  • NEW: Use translate.wordpress.org to translate the plugin
  • FIXED: Works only with WordPress 4.4 because of new term meta

1.0.5

  • FIXED: apply_filters() wrong arguments

1.0.4

  • NEW: oEmbed caches in post meta Sweep
  • NEW: Add POT file for translators

1.0.3

  • NEW: AJAX Sweep All
  • NEW: AJAX Sweeping
  • NEW: View details of sweep
  • NEW: Optimize DB sweep
  • NEW: User hint and confirmation. Props @SiamKreative
  • FIXED: Division by zero. Pros @barisunver

1.0.2

  • FIXED: Use term_id for wp_remove_object_terms()
  • FIXED: number_format_i18n() issues after sweeping

1.0.1

  • NEW: Moved plugin location to WP-Admin -> Tools -> Sweep
  • NEW: Add Deleted Post Sweep
  • FIXED: Use forced_delete for wp_delete_post() and wp_delete_comment();
  • FIXED: If orphaned meta has an object id of 0, use SQL query to delete

1.0.0

  • Initial release

Installation

  1. Upload wp-sweep folder to the /wp-content/plugins/ directory
  2. Activate the WP-Sweep plugin through the 'Plugins' menu in WordPress
  3. You can access WP-Sweep via WP-Admin -> Tools -> Sweep

Screenshots

  1. WP-Sweep Administrator Page (Before Sweeping)
  2. WP-Sweep Administrator Page (Swept)

Frequently Asked Questions

Coming soon ...

Upgrade Notice

N/A

More Repositories

1

wp-pagenavi

Adds a more advanced paging navigation interface to your WordPress blog.
PHP
133
star
2

wp-postratings

Adds an AJAX rating system for your WordPress blog's post/page.
PHP
123
star
3

telegram-bot

Telegram Bot using AWS API Gateway and AWS Lambda
JavaScript
123
star
4

wp-postviews

Enables you to display how many times a post/page had been viewed.
PHP
114
star
5

wp-polls

Adds an AJAX poll system to your WordPress blog. You can also easily add a poll into your WordPress's blog post/page.
PHP
93
star
6

wp-dbmanager

Allows you to optimize database, repair database, backup database, restore database, delete backup database , drop/empty tables and run selected queries. Supports automatic scheduling of backing up, optimizing and repairing of database.
PHP
71
star
7

slack-bot

Slack Bot using AWS API Gateway and AWS Lambda
JavaScript
56
star
8

wp-useronline

Enable you to display how many users are online on your WordPress blog with detailed statistics.
PHP
36
star
9

linkedin-pdf-resume-parser

Parse LinkedIn PDF Resume and extract out name, email, education and work experiences.
PHP
27
star
10

wp-showhide

Allows you to embed content within your blog post via WordPress ShortCode API and toggling the visibility of the cotent via a link.
PHP
24
star
11

rendeer

Puppeteer x Prerender
JavaScript
24
star
12

gamerz-file-explorer

Enables you to browse and search for folders/files on the web just like Windows Explorer.
PHP
23
star
13

wp-ban

Ban users by IP, IP Range, host name, user agent and referrer url from visiting your WordPress's blog.
PHP
22
star
14

wp-print

Displays a printable version of your WordPress blog's post/page.
PHP
21
star
15

wp-serverinfo

Display your host's PHP, MYSQL & memcached (if installed) information on your WordPress dashboard.
PHP
17
star
16

wp-downloadmanager

Adds a simple download manager to your WordPress blog.
PHP
17
star
17

wp-email

Allows people to recommend/send your WordPress blog's post/page to a friend.
PHP
14
star
18

wp-instantarticles

WP-InstantArticles generates a RSS feed of your WordPress posts as Instant Articles for Facebook to consume.
PHP
10
star
19

wp-draftsforfriends

Now you don't need to add friends as users to the blog in order to let them preview your drafts
PHP
10
star
20

products-stock-checker

Just a personal project to check products price and stock availability on Razer Online Stores and Lazada.
JavaScript
9
star
21

wp-relativedate

Displays relative date alongside with your post/comments actual date. Like 'Today', 'Yesterday', '2 Days Ago', '2 Weeks Ago', '2 'Seconds Ago', '2 Minutes Ago', '2 Hours Ago'.
PHP
6
star
22

wp-stats

Display your WordPress blog statistics. Ranging from general total statistics, some of my plugins statistics and top 10 statistics.
PHP
5
star
23

wp-commentnavi

Adds a more advanced paging navigation for your comments to your WordPress 2.8 and above blog.
PHP
4
star
24

wp-sticky

[DEPRECATED] Adds a sticky post feature to your WordPress's blog.
PHP
3
star
25

wp-pluginsused

Display WordPress plugins that you currently have (both active and inactive) onto a post/page.
PHP
3
star
26

paw-base64urlencode

A Paw Extension that allows you to generate a websafe url from a base64 encoding. Used mainly for GrabPay API.
JavaScript
2
star
27

lesterchan

Lester Chan's GitHub Profile
2
star
28

smartthings

Lester Chan's SmartThings Apps & Custom Device Handlers
Groovy
2
star
29

paw-rsa

A Paw Extension that allows you to encrypt/decrypt using RSA Public/Private Key.
JavaScript
2
star
30

gp-php-sdk-sample

GP PHP SDK Sample
PHP
1
star
31

paw-popsignature

A Paw Extension that allows you to generate a X-GID-AUX-POP HMAC signature. Used mainly for GrabPay API.
JavaScript
1
star
32

wp-wap

[DEPRECATED] Browse your WordPress's blog entries on a WAP enabled mobile phone.
PHP
1
star
33

wp-migme

Share a post to migme's Miniblog whenever you publish a post in WordPress.
PHP
1
star
34

freemyinternet

Automatically places the FreeMyInternet banner from FreeMyInternet.com on your WordPress website. The blogging community will be organising a protest and online black out on Thursday 6th June 2013, 0001 to 6th June 2013, 2359 against the new licensing by the Media Development Authority of Singapore.
PHP
1
star