lesterchan / wp-sweep

WP-Sweep allows you to clean up unused, orphaned and duplicated data in your WordPress. It also optimizes your database tables.
https://wordpress.org/plugins/wp-sweep/
153 stars 22 forks source link

Polylang #40

Closed szepeviktor closed 6 years ago

szepeviktor commented 8 years ago

I think language and post_translations are swept out in "Orphaned Term Relationship" while belonging to Polylang.

Maybe Polylang should hook wp_sweep_excluded_taxonomies?

lesterchan commented 8 years ago

Sorry, I don't really get what you mean by this?

szepeviktor commented 8 years ago

When searching for Orphaned Term Relationship language and post_translations are found to be orphans although Polylang plugin uses them.

lesterchan commented 8 years ago

Ah I see, Polylang https://wordpress.org/plugins/polylang/ ?

I think better for plugins to hook on it. Unless WP defaults includes it

szepeviktor commented 6 years ago

@lesterchan Is this MU plugin OK?

<?php
/**
 * Plugin Name: Polylang's excluded taxonomies for WP-Sweep
 */

add_filter( 'wp_sweep_excluded_taxonomies', function( $excluded_taxonomies ) {
    $excluded_taxonomies[] = 'language';
    $excluded_taxonomies[] = 'post_translations';
    return $excluded_taxonomies;
} );
lesterchan commented 6 years ago

Yea looks ok