wp-sweep
Last commit date
js
9 years ago
admin.php
9 years ago
class-command.php
9 years ago
composer.json
10 years ago
index.php
9 years ago
readme.txt
9 years ago
uninstall.php
9 years ago
wp-sweep.php
9 years ago
admin.php
570 lines
| 1 | <?php |
| 2 | |
| 3 | // Exit if accessed directly |
| 4 | if ( ! defined( 'ABSPATH' ) ) { |
| 5 | exit; |
| 6 | } |
| 7 | |
| 8 | // Variables |
| 9 | $current_page = admin_url( 'tools.php?page=' . plugin_basename( 'wp-sweep/admin.php' ) ); |
| 10 | $message = ''; |
| 11 | |
| 12 | // Sweeping |
| 13 | if ( ! empty( $_GET['sweep'] ) ) { |
| 14 | if ( check_admin_referer( 'wp_sweep_' . $_GET['sweep'] ) ) { |
| 15 | $message = WPSweep::get_instance()->sweep( $_GET['sweep'] ); |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | // Database Table Status |
| 20 | $total_posts = WPSweep::get_instance()->total_count( 'posts' ); |
| 21 | $total_postmeta = WPSweep::get_instance()->total_count( 'postmeta' ); |
| 22 | $total_comments = WPSweep::get_instance()->total_count( 'comments' ); |
| 23 | $total_commentmeta = WPSweep::get_instance()->total_count( 'commentmeta' ); |
| 24 | $total_users = WPSweep::get_instance()->total_count( 'users' ); |
| 25 | $total_usermeta = WPSweep::get_instance()->total_count( 'usermeta' ); |
| 26 | $total_term_relationships = WPSweep::get_instance()->total_count( 'term_relationships' ); |
| 27 | $total_term_taxonomy = WPSweep::get_instance()->total_count( 'term_taxonomy' ); |
| 28 | $total_terms = WPSweep::get_instance()->total_count( 'terms' ); |
| 29 | $total_termmeta = WPSweep::get_instance()->total_count( 'termmeta' ); |
| 30 | $total_options = WPSweep::get_instance()->total_count( 'options' ); |
| 31 | $total_tables = WPSweep::get_instance()->total_count( 'tables' ); |
| 32 | |
| 33 | // Count |
| 34 | $revisions = WPSweep::get_instance()->count( 'revisions' ); |
| 35 | $auto_drafts = WPSweep::get_instance()->count( 'auto_drafts' ); |
| 36 | $deleted_posts = WPSweep::get_instance()->count( 'deleted_posts' ); |
| 37 | $orphan_postmeta = WPSweep::get_instance()->count( 'orphan_postmeta' ); |
| 38 | $duplicated_postmeta = WPSweep::get_instance()->count( 'duplicated_postmeta' ); |
| 39 | $oembed_postmeta = WPSweep::get_instance()->count( 'oembed_postmeta' ); |
| 40 | |
| 41 | $unapproved_comments = WPSweep::get_instance()->count( 'unapproved_comments' ); |
| 42 | $spam_comments = WPSweep::get_instance()->count( 'spam_comments' ); |
| 43 | $deleted_comments = WPSweep::get_instance()->count( 'deleted_comments' ); |
| 44 | $orphan_commentmeta = WPSweep::get_instance()->count( 'orphan_commentmeta' ); |
| 45 | $duplicated_commentmeta = WPSweep::get_instance()->count( 'duplicated_commentmeta' ); |
| 46 | |
| 47 | $orphan_usermeta = WPSweep::get_instance()->count( 'orphan_usermeta' ); |
| 48 | $duplicated_usermeta = WPSweep::get_instance()->count( 'duplicated_usermeta' ); |
| 49 | |
| 50 | $orphan_term_relationships = WPSweep::get_instance()->count( 'orphan_term_relationships' ); |
| 51 | $unused_terms = WPSweep::get_instance()->count( 'unused_terms' ); |
| 52 | $orphan_termmeta = WPSweep::get_instance()->count( 'orphan_termmeta' ); |
| 53 | $duplicated_termmeta = WPSweep::get_instance()->count( 'duplicated_termmeta' ); |
| 54 | |
| 55 | $transient_options = WPSweep::get_instance()->count( 'transient_options' ); |
| 56 | |
| 57 | ?> |
| 58 | <style type="text/css"> |
| 59 | .table-sweep thead th { |
| 60 | width: 12%; |
| 61 | } |
| 62 | .table-sweep thead th.col-sweep-details { |
| 63 | width: 56%; |
| 64 | } |
| 65 | .table-sweep thead th.col-sweep-action { |
| 66 | width: 20%; |
| 67 | } |
| 68 | </style> |
| 69 | <div class="wrap"> |
| 70 | <h2><?php _e( 'WP-Sweep', 'wp-sweep' ); ?></h2> |
| 71 | <div class="notice notice-warning"> |
| 72 | <p> |
| 73 | <?php printf( __( 'Before you do any sweep, please <a href="%1$s" target="%2$s">backup your database</a> first because any sweep done is irreversible.', 'wp-sweep' ), 'https://wordpress.org/plugins/wp-dbmanager/', '_blank' ); ?> |
| 74 | </p> |
| 75 | </div> |
| 76 | <p> |
| 77 | <?php printf( __( 'For performance reasons, only %s items will be shown if you click Details', 'wp-sweep' ), number_format_i18n( WPSweep::get_instance()->limit_details ) ); ?> |
| 78 | </p> |
| 79 | <h3><?php _e( 'Post Sweep', 'wp-sweep' ); ?></h3> |
| 80 | <p><?php printf( __( 'There are a total of <strong class="attention"><span class="sweep-count-type-posts">%1$s</span> Posts</strong> and <strong class="attention"><span class="sweep-count-type-postmeta">%2$s</span> Post Meta</strong>.', 'wp-sweep' ), number_format_i18n( $total_posts ), number_format_i18n( $total_postmeta ) ); ?></p> |
| 81 | <div class="sweep-message"></div> |
| 82 | <table class="widefat table-sweep"> |
| 83 | <thead> |
| 84 | <tr> |
| 85 | <th class="col-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></th> |
| 86 | <th class="col-sweep-count"><?php _e( 'Count', 'wp-sweep' ); ?></th> |
| 87 | <th class="col-sweep-percent"><?php _e( '% Of', 'wp-sweep' ); ?></th> |
| 88 | <th class="col-sweep-action"><?php _e( 'Action', 'wp-sweep' ); ?></th> |
| 89 | </tr> |
| 90 | </thead> |
| 91 | <tbody> |
| 92 | <tr> |
| 93 | <td> |
| 94 | <strong><?php _e( 'Revisions', 'wp-sweep' ); ?></strong> |
| 95 | <p class="sweep-details" style="display: none;"></p> |
| 96 | </td> |
| 97 | <td> |
| 98 | <span class="sweep-count"><?php echo number_format_i18n( $revisions ); ?></span> |
| 99 | </td> |
| 100 | <td> |
| 101 | <span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $revisions, $total_posts ); ?></span> |
| 102 | </td> |
| 103 | <td> |
| 104 | <?php if ( ! empty( $revisions ) ) : ?> |
| 105 | <button data-action="sweep" data-sweep_name="revisions" data-sweep_type="posts" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_revisions' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button> |
| 106 | <button data-action="sweep_details" data-sweep_name="revisions" data-sweep_type="posts" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_revisions' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button> |
| 107 | <?php else : ?> |
| 108 | <?php _e( 'N/A', 'wp-sweep' ); ?> |
| 109 | <?php endif; ?> |
| 110 | </td> |
| 111 | </tr> |
| 112 | <tr class="alternate"> |
| 113 | <td> |
| 114 | <strong><?php _e( 'Auto Drafts', 'wp-sweep' ); ?></strong> |
| 115 | <p class="sweep-details" style="display: none;"></p> |
| 116 | </td> |
| 117 | <td> |
| 118 | <span class="sweep-count"><?php echo number_format_i18n( $auto_drafts ); ?></span> |
| 119 | </td> |
| 120 | <td> |
| 121 | <span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $auto_drafts, $total_posts ); ?></span> |
| 122 | </td> |
| 123 | <td> |
| 124 | <?php if ( ! empty( $auto_drafts ) ) : ?> |
| 125 | <button data-action="sweep" data-sweep_name="auto_drafts" data-sweep_type="posts" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_auto_drafts' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button> |
| 126 | <button data-action="sweep_details" data-sweep_name="auto_drafts" data-sweep_type="posts" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_auto_drafts' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button> |
| 127 | <?php else : ?> |
| 128 | <?php _e( 'N/A', 'wp-sweep' ); ?> |
| 129 | <?php endif; ?> |
| 130 | </td> |
| 131 | </tr> |
| 132 | <tr> |
| 133 | <td> |
| 134 | <strong><?php _e( 'Deleted Posts', 'wp-sweep' ); ?></strong> |
| 135 | <p class="sweep-details" style="display: none;"></p> |
| 136 | </td> |
| 137 | <td> |
| 138 | <span class="sweep-count"><?php echo number_format_i18n( $deleted_posts ); ?></span> |
| 139 | </td> |
| 140 | <td> |
| 141 | <span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $deleted_posts, $total_posts ); ?></span> |
| 142 | </td> |
| 143 | <td> |
| 144 | <?php if ( ! empty( $deleted_posts ) ) : ?> |
| 145 | <button data-action="sweep" data-sweep_name="deleted_posts" data-sweep_type="posts" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_deleted_posts' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button> |
| 146 | <button data-action="sweep_details" data-sweep_name="deleted_posts" data-sweep_type="posts" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_deleted_posts' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button> |
| 147 | <?php else : ?> |
| 148 | <?php _e( 'N/A', 'wp-sweep' ); ?> |
| 149 | <?php endif; ?> |
| 150 | </td> |
| 151 | </tr> |
| 152 | <tr class="alternate"> |
| 153 | <td> |
| 154 | <strong><?php _e( 'Orphaned Post Meta', 'wp-sweep' ); ?></strong> |
| 155 | <p class="sweep-details" style="display: none;"></p> |
| 156 | </td> |
| 157 | <td> |
| 158 | <span class="sweep-count"><?php echo number_format_i18n( $orphan_postmeta ); ?></span> |
| 159 | </td> |
| 160 | <td> |
| 161 | <span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $orphan_postmeta, $total_postmeta ); ?></span> |
| 162 | </td> |
| 163 | <td> |
| 164 | <?php if ( ! empty( $orphan_postmeta ) ) : ?> |
| 165 | <button data-action="sweep" data-sweep_name="orphan_postmeta" data-sweep_type="postmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_orphan_postmeta' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button> |
| 166 | <button data-action="sweep_details" data-sweep_name="orphan_postmeta" data-sweep_type="postmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_orphan_postmeta' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button> |
| 167 | <?php else : ?> |
| 168 | <?php _e( 'N/A', 'wp-sweep' ); ?> |
| 169 | <?php endif; ?> |
| 170 | </td> |
| 171 | </tr> |
| 172 | <tr> |
| 173 | <td> |
| 174 | <strong><?php _e( 'Duplicated Post Meta', 'wp-sweep' ); ?></strong> |
| 175 | <p class="sweep-details" style="display: none;"></p> |
| 176 | </td> |
| 177 | <td> |
| 178 | <span class="sweep-count"><?php echo number_format_i18n( $duplicated_postmeta ); ?></span> |
| 179 | </td> |
| 180 | <td> |
| 181 | <span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $duplicated_postmeta, $total_postmeta ); ?></span> |
| 182 | </td> |
| 183 | <td> |
| 184 | <?php if ( ! empty( $duplicated_postmeta ) ) : ?> |
| 185 | <button data-action="sweep" data-sweep_name="duplicated_postmeta" data-sweep_type="postmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_duplicated_postmeta' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button> |
| 186 | <button data-action="sweep_details" data-sweep_name="duplicated_postmeta" data-sweep_type="postmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_duplicated_postmeta' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button> |
| 187 | <?php else : ?> |
| 188 | <?php _e( 'N/A', 'wp-sweep' ); ?> |
| 189 | <?php endif; ?> |
| 190 | </td> |
| 191 | </tr> |
| 192 | <tr class="alternate"> |
| 193 | <td> |
| 194 | <strong><?php _e( 'oEmbed Caches In Post Meta', 'wp-sweep' ); ?></strong> |
| 195 | <p class="sweep-details" style="display: none;"></p> |
| 196 | </td> |
| 197 | <td> |
| 198 | <span class="sweep-count"><?php echo number_format_i18n( $oembed_postmeta ); ?></span> |
| 199 | </td> |
| 200 | <td> |
| 201 | <span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $oembed_postmeta, $total_postmeta ); ?></span> |
| 202 | </td> |
| 203 | <td> |
| 204 | <?php if ( ! empty( $oembed_postmeta ) ) : ?> |
| 205 | <button data-action="sweep" data-sweep_name="oembed_postmeta" data-sweep_type="postmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_oembed_postmeta' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button> |
| 206 | <button data-action="sweep_details" data-sweep_name="oembed_postmeta" data-sweep_type="postmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_oembed_postmeta' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button> |
| 207 | <?php else : ?> |
| 208 | <?php _e( 'N/A', 'wp-sweep' ); ?> |
| 209 | <?php endif; ?> |
| 210 | </td> |
| 211 | </tr> |
| 212 | </tbody> |
| 213 | </table> |
| 214 | <?php do_action( 'wp_sweep_admin_post_sweep' ); ?> |
| 215 | <p> </p> |
| 216 | <h3><?php _e( 'Comment Sweep', 'wp-sweep' ); ?></h3> |
| 217 | <p><?php printf( __( 'There are a total of <strong class="attention"><span class="sweep-count-type-comments">%1$s</span> Comments</strong> and <strong class="attention"><span class="sweep-count-type-commentmeta">%2$s</span> Comment Meta</strong>.', 'wp-sweep' ), number_format_i18n( $total_comments ), number_format_i18n( $total_commentmeta ) ); ?></p> |
| 218 | <div class="sweep-message"></div> |
| 219 | <table class="widefat table-sweep"> |
| 220 | <thead> |
| 221 | <tr> |
| 222 | <th class="col-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></th> |
| 223 | <th class="col-sweep-count"><?php _e( 'Count', 'wp-sweep' ); ?></th> |
| 224 | <th class="col-sweep-percent"><?php _e( '% Of', 'wp-sweep' ); ?></th> |
| 225 | <th class="col-sweep-action"><?php _e( 'Action', 'wp-sweep' ); ?></th> |
| 226 | </tr> |
| 227 | </thead> |
| 228 | <tbody> |
| 229 | <tr> |
| 230 | <td> |
| 231 | <strong><?php _e( 'Unapproved Comments', 'wp-sweep' ); ?></strong> |
| 232 | <p class="sweep-details" style="display: none;"></p> |
| 233 | </td> |
| 234 | <td> |
| 235 | <span class="sweep-count"><?php echo number_format_i18n( $unapproved_comments ); ?></span> |
| 236 | </td> |
| 237 | <td> |
| 238 | <span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $unapproved_comments, $total_comments ); ?></span> |
| 239 | </td> |
| 240 | <td> |
| 241 | <?php if ( ! empty( $unapproved_comments ) ) : ?> |
| 242 | <button data-action="sweep" data-sweep_name="unapproved_comments" data-sweep_type="comments" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_unapproved_comments' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button> |
| 243 | <button data-action="sweep_details" data-sweep_name="unapproved_comments" data-sweep_type="comments" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_unapproved_comments' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button> |
| 244 | <?php else : ?> |
| 245 | <?php _e( 'N/A', 'wp-sweep' ); ?> |
| 246 | <?php endif; ?> |
| 247 | </td> |
| 248 | </tr> |
| 249 | <tr class="alternate"> |
| 250 | <td> |
| 251 | <strong><?php _e( 'Spammed Comments', 'wp-sweep' ); ?></strong> |
| 252 | <p class="sweep-details" style="display: none;"></p> |
| 253 | </td> |
| 254 | <td> |
| 255 | <span class="sweep-count"><?php echo number_format_i18n( $spam_comments ); ?></span> |
| 256 | </td> |
| 257 | <td> |
| 258 | <span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $spam_comments, $total_comments ); ?></span> |
| 259 | </td> |
| 260 | <td> |
| 261 | <?php if ( ! empty( $spam_comments ) ) : ?> |
| 262 | <button data-action="sweep" data-sweep_name="spam_comments" data-sweep_type="comments" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_spam_comments' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button> |
| 263 | <button data-action="sweep_details" data-sweep_name="spam_comments" data-sweep_type="comments" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_spam_comments' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button> |
| 264 | <?php else : ?> |
| 265 | <?php _e( 'N/A', 'wp-sweep' ); ?> |
| 266 | <?php endif; ?> |
| 267 | </td> |
| 268 | </tr> |
| 269 | <tr> |
| 270 | <td> |
| 271 | <strong><?php _e( 'Deleted Comments', 'wp-sweep' ); ?></strong> |
| 272 | <p class="sweep-details" style="display: none;"></p> |
| 273 | </td> |
| 274 | <td> |
| 275 | <span class="sweep-count"><?php echo number_format_i18n( $deleted_comments ); ?></span> |
| 276 | </td> |
| 277 | <td> |
| 278 | <span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $deleted_comments, $total_comments ); ?></span> |
| 279 | </td> |
| 280 | <td> |
| 281 | <?php if ( ! empty( $deleted_comments ) ) : ?> |
| 282 | <button data-action="sweep" data-sweep_name="deleted_comments" data-sweep_type="comments" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_deleted_comments' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button> |
| 283 | <button data-action="sweep_details" data-sweep_name="deleted_comments" data-sweep_type="comments" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_deleted_comments' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button> |
| 284 | <?php else : ?> |
| 285 | <?php _e( 'N/A', 'wp-sweep' ); ?> |
| 286 | <?php endif; ?> |
| 287 | </td> |
| 288 | </tr> |
| 289 | <tr class="alternate"> |
| 290 | <td> |
| 291 | <strong><?php _e( 'Orphaned Comment Meta', 'wp-sweep' ); ?></strong> |
| 292 | <p class="sweep-details" style="display: none;"></p> |
| 293 | </td> |
| 294 | <td> |
| 295 | <span class="sweep-count"><?php echo number_format_i18n( $orphan_commentmeta ); ?></span> |
| 296 | </td> |
| 297 | <td> |
| 298 | <span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $orphan_commentmeta, $total_commentmeta ); ?></span> |
| 299 | </td> |
| 300 | <td> |
| 301 | <?php if ( ! empty( $orphan_commentmeta ) ) : ?> |
| 302 | <button data-action="sweep" data-sweep_name="orphan_commentmeta" data-sweep_type="commentmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_orphan_commentmeta' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button> |
| 303 | <button data-action="sweep_details" data-sweep_name="orphan_commentmeta" data-sweep_type="commentmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_orphan_commentmeta' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button> |
| 304 | <?php else : ?> |
| 305 | <?php _e( 'N/A', 'wp-sweep' ); ?> |
| 306 | <?php endif; ?> |
| 307 | </td> |
| 308 | </tr> |
| 309 | <tr> |
| 310 | <td> |
| 311 | <strong><?php _e( 'Duplicated Comment Meta', 'wp-sweep' ); ?></strong> |
| 312 | <p class="sweep-details" style="display: none;"></p> |
| 313 | </td> |
| 314 | <td> |
| 315 | <span class="sweep-count"><?php echo number_format_i18n( $duplicated_commentmeta ); ?></span> |
| 316 | </td> |
| 317 | <td> |
| 318 | <span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $duplicated_commentmeta, $total_commentmeta ); ?></span> |
| 319 | </td> |
| 320 | <td> |
| 321 | <?php if ( ! empty( $duplicated_commentmeta ) ) : ?> |
| 322 | <button data-action="sweep" data-sweep_name="duplicated_commentmeta" data-sweep_type="commentmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_duplicated_commentmeta' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button> |
| 323 | <button data-action="sweep_details" data-sweep_name="duplicated_commentmeta" data-sweep_type="commentmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_duplicated_commentmeta' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button> |
| 324 | <?php else : ?> |
| 325 | <?php _e( 'N/A', 'wp-sweep' ); ?> |
| 326 | <?php endif; ?> |
| 327 | </td> |
| 328 | </tr> |
| 329 | </tbody> |
| 330 | </table> |
| 331 | <?php do_action( 'wp_sweep_admin_comment_sweep' ); ?> |
| 332 | <p> </p> |
| 333 | <h3><?php _e( 'User Sweep', 'wp-sweep' ); ?></h3> |
| 334 | <p><?php printf( __( 'There are a total of <strong class="attention"><span class="sweep-count-type-users">%1$s</span> Users</strong> and <strong class="attention"><span class="sweep-count-type-usermeta">%2$s</span> User Meta</strong>.', 'wp-sweep' ), number_format_i18n( $total_users ), number_format_i18n( $total_usermeta ) ); ?></p> |
| 335 | <div class="sweep-message"></div> |
| 336 | <table class="widefat table-sweep"> |
| 337 | <thead> |
| 338 | <tr> |
| 339 | <th class="col-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></th> |
| 340 | <th class="col-sweep-count"><?php _e( 'Count', 'wp-sweep' ); ?></th> |
| 341 | <th class="col-sweep-percent"><?php _e( '% Of', 'wp-sweep' ); ?></th> |
| 342 | <th class="col-sweep-action"><?php _e( 'Action', 'wp-sweep' ); ?></th> |
| 343 | </tr> |
| 344 | </thead> |
| 345 | <tbody> |
| 346 | <tr> |
| 347 | <td> |
| 348 | <strong><?php _e( 'Orphaned User Meta', 'wp-sweep' ); ?></strong> |
| 349 | <p class="sweep-details" style="display: none;"></p> |
| 350 | </td> |
| 351 | <td> |
| 352 | <span class="sweep-count"><?php echo number_format_i18n( $orphan_usermeta ); ?></span> |
| 353 | </td> |
| 354 | <td> |
| 355 | <span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $orphan_usermeta, $total_usermeta ); ?></span> |
| 356 | </td> |
| 357 | <td> |
| 358 | <?php if ( ! empty( $orphan_usermeta ) ) : ?> |
| 359 | <button data-action="sweep" data-sweep_name="orphan_usermeta" data-sweep_type="usermeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_orphan_usermeta' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button> |
| 360 | <button data-action="sweep_details" data-sweep_name="orphan_usermeta" data-sweep_type="usermeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_orphan_usermeta' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button> |
| 361 | <?php else : ?> |
| 362 | <?php _e( 'N/A', 'wp-sweep' ); ?> |
| 363 | <?php endif; ?> |
| 364 | </td> |
| 365 | </tr> |
| 366 | <tr class="alternate"> |
| 367 | <td> |
| 368 | <strong><?php _e( 'Duplicated User Meta', 'wp-sweep' ); ?></strong> |
| 369 | <p class="sweep-details" style="display: none;"></p> |
| 370 | </td> |
| 371 | <td> |
| 372 | <span class="sweep-count"><?php echo number_format_i18n( $duplicated_usermeta ); ?></span> |
| 373 | </td> |
| 374 | <td> |
| 375 | <span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $duplicated_usermeta, $total_usermeta ); ?></span> |
| 376 | </td> |
| 377 | <td> |
| 378 | <?php if ( ! empty( $duplicated_usermeta ) ) : ?> |
| 379 | <button data-action="sweep" data-sweep_name="duplicated_usermeta" data-sweep_type="usermeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_duplicated_usermeta' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button> |
| 380 | <button data-action="sweep_details" data-sweep_name="duplicated_usermeta" data-sweep_type="usermeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_duplicated_usermeta' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button> |
| 381 | <?php else : ?> |
| 382 | <?php _e( 'N/A', 'wp-sweep' ); ?> |
| 383 | <?php endif; ?> |
| 384 | </td> |
| 385 | </tr> |
| 386 | </tbody> |
| 387 | </table> |
| 388 | <?php do_action( 'wp_sweep_admin_user_sweep' ); ?> |
| 389 | <p> </p> |
| 390 | <h3><?php _e( 'Term Sweep', 'wp-sweep' ); ?></h3> |
| 391 | <p><?php printf( __( 'There are a total of <strong class="attention "><span class="sweep-count-type-terms">%1$s</span> Terms</strong>, <strong class="attention "><span class="sweep-count-type-termmeta">%2$s</span> Term Meta</strong>, <strong class="attention"><span class="sweep-count-type-term_taxonomy">%3$s</span> Term Taxonomy</strong> and <strong class="attention"><span class="sweep-count-type-term_relationships">%4$s</span> Term Relationships</strong>.', 'wp-sweep' ), number_format_i18n( $total_terms ), number_format_i18n( $total_termmeta ), number_format_i18n( $total_term_taxonomy ), number_format_i18n( $total_term_relationships ) ); ?></p> |
| 392 | <div class="sweep-message"></div> |
| 393 | <table class="widefat table-sweep"> |
| 394 | <thead> |
| 395 | <tr> |
| 396 | <th class="col-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></th> |
| 397 | <th class="col-sweep-count"><?php _e( 'Count', 'wp-sweep' ); ?></th> |
| 398 | <th class="col-sweep-percent"><?php _e( '% Of', 'wp-sweep' ); ?></th> |
| 399 | <th class="col-sweep-action"><?php _e( 'Action', 'wp-sweep' ); ?></th> |
| 400 | </tr> |
| 401 | </thead> |
| 402 | <tbody> |
| 403 | <tr> |
| 404 | <td> |
| 405 | <strong><?php _e( 'Orphaned Term Meta', 'wp-sweep' ); ?></strong> |
| 406 | <p class="sweep-details" style="display: none;"></p> |
| 407 | </td> |
| 408 | <td> |
| 409 | <span class="sweep-count"><?php echo number_format_i18n( $orphan_termmeta ); ?></span> |
| 410 | </td> |
| 411 | <td> |
| 412 | <span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $orphan_termmeta, $total_termmeta ); ?></span> |
| 413 | </td> |
| 414 | <td> |
| 415 | <?php if ( ! empty( $orphan_termmeta ) ) : ?> |
| 416 | <button data-action="sweep" data-sweep_name="orphan_termmeta" data-sweep_type="termmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_orphan_termmeta' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button> |
| 417 | <button data-action="sweep_details" data-sweep_name="orphan_termmeta" data-sweep_type="termmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_orphan_termmeta' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button> |
| 418 | <?php else : ?> |
| 419 | <?php _e( 'N/A', 'wp-sweep' ); ?> |
| 420 | <?php endif; ?> |
| 421 | </td> |
| 422 | </tr> |
| 423 | <tr class="alternate"> |
| 424 | <td> |
| 425 | <strong><?php _e( 'Duplicated Term Meta', 'wp-sweep' ); ?></strong> |
| 426 | <p class="sweep-details" style="display: none;"></p> |
| 427 | </td> |
| 428 | <td> |
| 429 | <span class="sweep-count"><?php echo number_format_i18n( $duplicated_termmeta ); ?></span> |
| 430 | </td> |
| 431 | <td> |
| 432 | <span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $duplicated_termmeta, $total_termmeta ); ?></span> |
| 433 | </td> |
| 434 | <td> |
| 435 | <?php if ( ! empty( $duplicated_termmeta ) ) : ?> |
| 436 | <button data-action="sweep" data-sweep_name="duplicated_termmeta" data-sweep_type="termmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_duplicated_termmeta' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button> |
| 437 | <button data-action="sweep_details" data-sweep_name="duplicated_termmeta" data-sweep_type="termmeta" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_duplicated_termmeta' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button> |
| 438 | <?php else : ?> |
| 439 | <?php _e( 'N/A', 'wp-sweep' ); ?> |
| 440 | <?php endif; ?> |
| 441 | </td> |
| 442 | </tr> |
| 443 | <tr> |
| 444 | <td> |
| 445 | <strong><?php _e( 'Orphaned Term Relationship', 'wp-sweep' ); ?></strong> |
| 446 | <p class="sweep-details" style="display: none;"></p> |
| 447 | </td> |
| 448 | <td> |
| 449 | <span class="sweep-count"><?php echo number_format_i18n( $orphan_term_relationships ); ?></span> |
| 450 | </td> |
| 451 | <td> |
| 452 | <span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $orphan_term_relationships, $total_term_relationships ); ?></span> |
| 453 | </td> |
| 454 | <td> |
| 455 | <?php if ( ! empty( $orphan_term_relationships ) ) : ?> |
| 456 | <button data-action="sweep" data-sweep_name="orphan_term_relationships" data-sweep_type="term_relationships" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_orphan_term_relationships' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button> |
| 457 | <button data-action="sweep_details" data-sweep_name="orphan_term_relationships" data-sweep_type="term_relationships" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_orphan_term_relationships' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button> |
| 458 | <?php else : ?> |
| 459 | <?php _e( 'N/A', 'wp-sweep' ); ?> |
| 460 | <?php endif; ?> |
| 461 | </td> |
| 462 | </tr> |
| 463 | <tr class="alternate"> |
| 464 | <td> |
| 465 | <strong><?php _e( 'Unused Terms', 'wp-sweep' ); ?></strong> |
| 466 | <p><?php _e( 'Note that some unused terms might belong to draft posts that have not been published yet. Only sweep this when you do not have any draft posts.', 'wp-sweep' ); ?></p> |
| 467 | <p class="sweep-details" style="display: none;"></p> |
| 468 | </td> |
| 469 | <td> |
| 470 | <span class="sweep-count"><?php echo number_format_i18n( $unused_terms ); ?></span> |
| 471 | </td> |
| 472 | <td> |
| 473 | <span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $unused_terms, $total_terms ); ?></span> |
| 474 | </td> |
| 475 | <td> |
| 476 | <?php if ( ! empty( $unused_terms ) ) : ?> |
| 477 | <button data-action="sweep" data-sweep_name="unused_terms" data-sweep_type="terms" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_unused_terms' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button> |
| 478 | <button data-action="sweep_details" data-sweep_name="unused_terms" data-sweep_type="terms" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_unused_terms' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button> |
| 479 | <?php else : ?> |
| 480 | <?php _e( 'N/A', 'wp-sweep' ); ?> |
| 481 | <?php endif; ?> |
| 482 | </td> |
| 483 | </tr> |
| 484 | </tbody> |
| 485 | </table> |
| 486 | <?php do_action( 'wp_sweep_admin_term_sweep' ); ?> |
| 487 | <p> </p> |
| 488 | <h3><?php _e( 'Option Sweep', 'wp-sweep' ); ?></h3> |
| 489 | <p><?php printf( __( 'There are a total of <strong class="attention"><span class="sweep-count-type-options">%s</span> Options</strong>.', 'wp-sweep' ), number_format_i18n( $total_options ) ); ?></p> |
| 490 | <div class="sweep-message"></div> |
| 491 | <table class="widefat table-sweep"> |
| 492 | <thead> |
| 493 | <tr> |
| 494 | <th class="col-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></th> |
| 495 | <th class="col-sweep-count"><?php _e( 'Count', 'wp-sweep' ); ?></th> |
| 496 | <th class="col-sweep-percent"><?php _e( '% Of', 'wp-sweep' ); ?></th> |
| 497 | <th class="col-sweep-action"><?php _e( 'Action', 'wp-sweep' ); ?></th> |
| 498 | </tr> |
| 499 | </thead> |
| 500 | <tbody> |
| 501 | <tr> |
| 502 | <td> |
| 503 | <strong><?php _e( 'Transient Options', 'wp-sweep' ); ?></strong> |
| 504 | <p class="sweep-details" style="display: none;"></p> |
| 505 | </td> |
| 506 | <td> |
| 507 | <span class="sweep-count"><?php echo number_format_i18n( $transient_options ); ?></span> |
| 508 | </td> |
| 509 | <td> |
| 510 | <span class="sweep-percentage"><?php echo WPSweep::get_instance()->format_percentage( $transient_options, $total_options ); ?></span> |
| 511 | </td> |
| 512 | <td> |
| 513 | <?php if ( ! empty( $transient_options ) ) : ?> |
| 514 | <button data-action="sweep" data-sweep_name="transient_options" data-sweep_type="options" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_transient_options' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button> |
| 515 | <button data-action="sweep_details" data-sweep_name="transient_options" data-sweep_type="options" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_transient_options' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button> |
| 516 | <?php else : ?> |
| 517 | <?php _e( 'N/A', 'wp-sweep' ); ?> |
| 518 | <?php endif; ?> |
| 519 | </td> |
| 520 | </tr> |
| 521 | </tbody> |
| 522 | </table> |
| 523 | <?php do_action( 'wp_sweep_admin_option_sweep' ); ?> |
| 524 | <p> </p> |
| 525 | <h3><?php _e( 'Database Sweep', 'wp-sweep' ); ?></h3> |
| 526 | <p><?php printf( __( 'There are a total of <strong class="attention"><span class="sweep-count-type-tables">%s</span> Tables</strong>.', 'wp-sweep' ), number_format_i18n( $total_tables ) ); ?></p> |
| 527 | <div class="sweep-message"></div> |
| 528 | <table class="widefat table-sweep"> |
| 529 | <thead> |
| 530 | <tr> |
| 531 | <th class="col-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></th> |
| 532 | <th class="col-sweep-count"><?php _e( 'Count', 'wp-sweep' ); ?></th> |
| 533 | <th class="col-sweep-percent"><?php _e( '% Of', 'wp-sweep' ); ?></th> |
| 534 | <th class="col-sweep-action"><?php _e( 'Action', 'wp-sweep' ); ?></th> |
| 535 | </tr> |
| 536 | </thead> |
| 537 | <tbody> |
| 538 | <tr> |
| 539 | <td> |
| 540 | <strong><?php _e( 'Optimize Tables', 'wp-sweep' ); ?></strong> |
| 541 | <p class="sweep-details" style="display: none;"></p> |
| 542 | </td> |
| 543 | <td> |
| 544 | <span class="sweep-count"><?php echo number_format_i18n( $total_tables ); ?></span> |
| 545 | </td> |
| 546 | <td> |
| 547 | <?php _e( 'N/A', 'wp-sweep' ); ?> |
| 548 | </td> |
| 549 | <td> |
| 550 | <?php if ( ! empty( $total_tables ) ) : ?> |
| 551 | <button data-action="sweep" data-sweep_name="optimize_database" data-sweep_type="tables" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_optimize_database' ); ?>" class="button button-primary btn-sweep"><?php _e( 'Sweep', 'wp-sweep' ); ?></button> |
| 552 | <button data-action="sweep_details" data-sweep_name="optimize_database" data-sweep_type="tables" data-nonce="<?php echo wp_create_nonce( 'wp_sweep_details_optimize_database' ); ?>" class="button btn-sweep-details"><?php _e( 'Details', 'wp-sweep' ); ?></button> |
| 553 | <?php else : ?> |
| 554 | <?php _e( 'N/A', 'wp-sweep' ); ?> |
| 555 | <?php endif; ?> |
| 556 | </td> |
| 557 | </tr> |
| 558 | </tbody> |
| 559 | </table> |
| 560 | <?php do_action( 'wp_sweep_admin_database_sweep' ); ?> |
| 561 | <p> </p> |
| 562 | <h3><?php _e( 'Sweep All', 'wp-sweep' ); ?></h3> |
| 563 | <p><?php _e( 'Note that some unused terms might belong to draft posts that have not been published yet. Only sweep all when you do not have any draft posts.', 'wp-sweep' ); ?></p> |
| 564 | <div class="sweep-all"> |
| 565 | <p style="text-align: center;"> |
| 566 | <button class="button button-primary btn-sweep-all"><?php _e( 'Sweep All', 'wp-sweep' ); ?></button> |
| 567 | </p> |
| 568 | </div> |
| 569 | </div> |
| 570 |