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