WP Clean Up - Version 1.2.3

Version Description

  • mysql_query is deprecated
Download this release

Release Info

Developer acalbert
Plugin Icon wp plugin WP Clean Up
Version 1.2.3
Comparing to
See all releases

Code changes from version 1.2.1 to 1.2.3

img/alipay_donate.png DELETED
Binary file
img/alipay_donate_email.jpg ADDED
Binary file
img/btn_donateCC_LG.gif DELETED
Binary file
img/paypal_donate_email.jpg ADDED
Binary file
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
  === WP Clean Up ===
2
  Contributors: boliquan
3
- Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=SKA6TPPWSATKG&item_name=BoLiQuan&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=CA&bn=PP%2dDonationsBF&charset=UTF%2d8
4
  Tags: wp clean up,wp cleanup,clean,cleaner,cleanup,database,mysql,comments,posts,post revisions,delete revision,wp cleaner,optimize,optimize database,revision,draft,auto draft,moderated,spam,trash,postmeta,commentmeta,relationships,transient feed,phpMyAdmin,orphan
5
  License: GPLv2
6
  Requires at least: 2.7
7
- Tested up to: 3.5
8
- Stable tag: 1.2.1
9
 
10
  WP Clean Up can help us to clean up the wordpress database by removing "revision" "draft" "auto draft" and so on.
11
 
@@ -27,12 +27,12 @@ It is a effective tool to keep your database clean and surely save a lot of spac
27
 
28
  Related Links:
29
 
30
- * <a href="http://boliquan.com/wp-clean-up/">WP Clean Up (FAQ)</a> | <a href="http://wordpress.org/extend/plugins/wp-clean-up/">Download</a>
31
- * <a href="http://boliquan.com/wp-smtp/">WP SMTP</a> | <a href="http://wordpress.org/extend/plugins/wp-smtp/">Download</a>
32
- * <a href="http://boliquan.com/wp-anti-spam/">WP Anti Spam</a> | <a href="http://wordpress.org/extend/plugins/wp-anti-spam/">Download</a>
33
- * <a href="http://boliquan.com/wp-code-highlight/">WP Code Highlight</a> | <a href="http://wordpress.org/extend/plugins/wp-code-highlight/">Download</a>
34
- * <a href="http://boliquan.com/wp-slug-translate/">WP Slug Translate</a> | <a href="http://wordpress.org/extend/plugins/wp-slug-translate/">Download</a>
35
- * <a href="http://boliquan.com/yg-share/">YG Share</a> | <a href="http://wordpress.org/extend/plugins/yg-share/">Download</a>
36
  * <a href="http://boliquan.com/">BoLiQuan</a>
37
  * <a href="http://boliquan.com/">玻璃泉</a>
38
  * <a href="http://boliquan.com/">夜光</a>
@@ -49,6 +49,10 @@ Related Links:
49
 
50
  == Changelog ==
51
 
 
 
 
 
52
  = 1.2.1 =
53
 
54
  * It allows you to remove "revision" "draft" "auto draft" "moderated comments" "spam comments" "trash comments" "orphan postmeta" "orphan commentmeta" "orphan relationships" "dashboard transient feed"
1
  === WP Clean Up ===
2
  Contributors: boliquan
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SCWY6NPFRR8EY
4
  Tags: wp clean up,wp cleanup,clean,cleaner,cleanup,database,mysql,comments,posts,post revisions,delete revision,wp cleaner,optimize,optimize database,revision,draft,auto draft,moderated,spam,trash,postmeta,commentmeta,relationships,transient feed,phpMyAdmin,orphan
5
  License: GPLv2
6
  Requires at least: 2.7
7
+ Tested up to: 3.9.1
8
+ Stable tag: 1.2.3
9
 
10
  WP Clean Up can help us to clean up the wordpress database by removing "revision" "draft" "auto draft" and so on.
11
 
27
 
28
  Related Links:
29
 
30
+ * <a href="http://boliquan.com/wp-clean-up/">WP Clean Up (FAQ)</a> | <a href="http://wordpress.org/plugins/wp-clean-up/">Download</a>
31
+ * <a href="http://boliquan.com/wp-smtp/">WP SMTP</a> | <a href="http://wordpress.org/plugins/wp-smtp/">Download</a>
32
+ * <a href="http://boliquan.com/wp-anti-spam/">WP Anti Spam</a> | <a href="http://wordpress.org/plugins/wp-anti-spam/">Download</a>
33
+ * <a href="http://boliquan.com/wp-code-highlight/">WP Code Highlight</a> | <a href="http://wordpress.org/plugins/wp-code-highlight/">Download</a>
34
+ * <a href="http://boliquan.com/wp-slug-translate/">WP Slug Translate</a> | <a href="http://wordpress.org/plugins/wp-slug-translate/">Download</a>
35
+ * <a href="http://boliquan.com/yg-share/">YG Share</a> | <a href="http://wordpress.org/plugins/yg-share/">Download</a>
36
  * <a href="http://boliquan.com/">BoLiQuan</a>
37
  * <a href="http://boliquan.com/">玻璃泉</a>
38
  * <a href="http://boliquan.com/">夜光</a>
49
 
50
  == Changelog ==
51
 
52
+ = 1.2.3 =
53
+
54
+ * mysql_query is deprecated
55
+
56
  = 1.2.1 =
57
 
58
  * It allows you to remove "revision" "draft" "auto draft" "moderated comments" "spam comments" "trash comments" "orphan postmeta" "orphan commentmeta" "orphan relationships" "dashboard transient feed"
wp-clean-up.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Clean Up
4
  Plugin URI: http://boliquan.com/wp-clean-up/
5
  Description: WP Clean Up can help us to clean up the wordpress database by removing "revision" "draft" "auto draft" "moderated comments" "spam comments" "trash comments" "orphan postmeta" "orphan commentmeta" "orphan relationships" "dashboard transient feed". It allows you to optimize your WordPress database without phpMyAdmin.
6
- Version: 1.2.1
7
  Author: BoLiQuan
8
  Author URI: http://boliquan.com/
9
  Text Domain: WP-Clean-Up
3
  Plugin Name: WP Clean Up
4
  Plugin URI: http://boliquan.com/wp-clean-up/
5
  Description: WP Clean Up can help us to clean up the wordpress database by removing "revision" "draft" "auto draft" "moderated comments" "spam comments" "trash comments" "orphan postmeta" "orphan commentmeta" "orphan relationships" "dashboard transient feed". It allows you to optimize your WordPress database without phpMyAdmin.
6
+ Version: 1.2.3
7
  Author: BoLiQuan
8
  Author URI: http://boliquan.com/
9
  Text Domain: WP-Clean-Up
wp_clean_up_admin.php CHANGED
@@ -106,11 +106,12 @@ function wp_clean_up_count($type){
106
  }
107
 
108
  function wp_clean_up_optimize(){
 
109
  $wcu_sql = 'SHOW TABLE STATUS FROM `'.DB_NAME.'`';
110
- $result = mysql_query($wcu_sql);
111
- while($row = mysql_fetch_assoc($result)){
112
- $wcu_sql = 'OPTIMIZE TABLE '.$row['Name'];
113
- mysql_query($wcu_sql);
114
  }
115
  }
116
 
@@ -360,23 +361,24 @@ function wp_clean_up_optimize(){
360
  </thead>
361
  <tbody id="the-list">
362
  <?php
 
363
  $total_size = 0;
364
  $alternate = " class='alternate'";
365
  $wcu_sql = 'SHOW TABLE STATUS FROM `'.DB_NAME.'`';
366
- $result = mysql_query($wcu_sql);
367
 
368
- while($row = mysql_fetch_assoc($result)){
369
 
370
- $table_size = $row['Data_length'] + $row['Index_length'];
371
  $table_size = $table_size / 1024;
372
  $table_size = sprintf("%0.3f",$table_size);
373
 
374
- $every_size = $row['Data_length'] + $row['Index_length'];
375
  $every_size = $every_size / 1024;
376
  $total_size += $every_size;
377
 
378
  echo "<tr". $alternate .">
379
- <td class='column-name'>". $row['Name'] ."</td>
380
  <td class='column-name'>". $table_size ." KB"."</td>
381
  </tr>\n";
382
  $alternate = (empty($alternate)) ? " class='alternate'" : "";
@@ -399,30 +401,30 @@ function wp_clean_up_optimize(){
399
  <br />
400
 
401
  <h3>Related Links</h3>
402
- 1. <a href="http://boliquan.com/wp-clean-up/" target="_blank">WP Clean Up (FAQ)</a> | <a href="http://wordpress.org/extend/plugins/wp-clean-up/" target="_blank">Download</a><br />
403
- 2. <a href="http://boliquan.com/wp-smtp/" target="_blank">WP SMTP</a> | <a href="http://wordpress.org/extend/plugins/wp-smtp/" target="_blank">Download</a><br />
404
- 3. <a href="http://boliquan.com/wp-code-highlight/" target="_blank">WP Code Highlight</a> | <a href="http://wordpress.org/extend/plugins/wp-code-highlight/" target="_blank">Download</a><br />
405
- 4. <a href="http://boliquan.com/wp-slug-translate/" target="_blank">WP Slug Translate</a> | <a href="http://wordpress.org/extend/plugins/wp-slug-translate/" target="_blank">Download</a><br />
406
- 5. <a href="http://boliquan.com/wp-anti-spam/" target="_blank">WP Anti Spam</a> | <a href="http://wordpress.org/extend/plugins/wp-anti-spam/" target="_blank">Download</a><br />
407
- 6. <a href="http://boliquan.com/yg-share/" target="_blank">YG Share</a> | <a href="http://wordpress.org/extend/plugins/yg-share/" target="_blank">Download</a>
408
 
409
  <br /><br />
410
  <?php $donate_url = plugins_url('/img/paypal_32_32.jpg', __FILE__);?>
411
- <?php $paypal_donate_url = plugins_url('/img/btn_donateCC_LG.gif', __FILE__);?>
412
- <?php $ali_donate_url = plugins_url('/img/alipay_donate.png', __FILE__);?>
413
  <div class="icon32"><img src="<?php echo $donate_url; ?>" alt="Donate" /></div>
414
  <h2>Donate</h2>
415
  <p>
416
  If you find my work useful and you want to encourage the development of more free resources, you can do it by donating.
417
  </p>
418
  <p>
419
- <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=SKA6TPPWSATKG&item_name=BoLiQuan&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=CA&bn=PP%2dDonationsBF&charset=UTF%2d8" target="_blank"><img src="<?php echo $paypal_donate_url; ?>" alt="Paypal Donate" title="Paypal" /></a>
420
  &nbsp;
421
- <a href="https://me.alipay.com/boliquan" target="_blank"><img src="<?php echo $ali_donate_url; ?>" alt="Alipay Donate" title="Alipay" /></a>
422
  </p>
423
  <br />
424
 
425
- <div style="text-align:center; margin:60px 0 10px 0;">&copy; <?php echo date("Y"); ?> BoLiQuan</div>
426
 
427
  </div>
428
  <?php
106
  }
107
 
108
  function wp_clean_up_optimize(){
109
+ global $wpdb;
110
  $wcu_sql = 'SHOW TABLE STATUS FROM `'.DB_NAME.'`';
111
+ $result = $wpdb->get_results($wcu_sql);
112
+ foreach($result as $row){
113
+ $wcu_sql = 'OPTIMIZE TABLE '.$row->Name;
114
+ $wpdb->query($wcu_sql);
115
  }
116
  }
117
 
361
  </thead>
362
  <tbody id="the-list">
363
  <?php
364
+ global $wpdb;
365
  $total_size = 0;
366
  $alternate = " class='alternate'";
367
  $wcu_sql = 'SHOW TABLE STATUS FROM `'.DB_NAME.'`';
368
+ $result = $wpdb->get_results($wcu_sql);
369
 
370
+ foreach($result as $row){
371
 
372
+ $table_size = $row->Data_length + $row->Index_length;
373
  $table_size = $table_size / 1024;
374
  $table_size = sprintf("%0.3f",$table_size);
375
 
376
+ $every_size = $row->Data_length + $row->Index_length;
377
  $every_size = $every_size / 1024;
378
  $total_size += $every_size;
379
 
380
  echo "<tr". $alternate .">
381
+ <td class='column-name'>". $row->Name ."</td>
382
  <td class='column-name'>". $table_size ." KB"."</td>
383
  </tr>\n";
384
  $alternate = (empty($alternate)) ? " class='alternate'" : "";
401
  <br />
402
 
403
  <h3>Related Links</h3>
404
+ 1. <a href="http://boliquan.com/wp-clean-up/" target="_blank">WP Clean Up (FAQ)</a> | <a href="http://wordpress.org/plugins/wp-clean-up/" target="_blank">Download</a><br />
405
+ 2. <a href="http://boliquan.com/wp-smtp/" target="_blank">WP SMTP</a> | <a href="http://wordpress.org/plugins/wp-smtp/" target="_blank">Download</a><br />
406
+ 3. <a href="http://boliquan.com/wp-code-highlight/" target="_blank">WP Code Highlight</a> | <a href="http://wordpress.org/plugins/wp-code-highlight/" target="_blank">Download</a><br />
407
+ 4. <a href="http://boliquan.com/wp-slug-translate/" target="_blank">WP Slug Translate</a> | <a href="http://wordpress.org/plugins/wp-slug-translate/" target="_blank">Download</a><br />
408
+ 5. <a href="http://boliquan.com/wp-anti-spam/" target="_blank">WP Anti Spam</a> | <a href="http://wordpress.org/plugins/wp-anti-spam/" target="_blank">Download</a><br />
409
+ 6. <a href="http://boliquan.com/yg-share/" target="_blank">YG Share</a> | <a href="http://wordpress.org/plugins/yg-share/" target="_blank">Download</a>
410
 
411
  <br /><br />
412
  <?php $donate_url = plugins_url('/img/paypal_32_32.jpg', __FILE__);?>
413
+ <?php $paypal_donate_url = plugins_url('/img/paypal_donate_email.jpg', __FILE__);?>
414
+ <?php $ali_donate_url = plugins_url('/img/alipay_donate_email.jpg', __FILE__);?>
415
  <div class="icon32"><img src="<?php echo $donate_url; ?>" alt="Donate" /></div>
416
  <h2>Donate</h2>
417
  <p>
418
  If you find my work useful and you want to encourage the development of more free resources, you can do it by donating.
419
  </p>
420
  <p>
421
+ <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SCWY6NPFRR8EY" target="_blank"><img src="<?php echo $paypal_donate_url; ?>" alt="Paypal Donate" title="Paypal" /></a>
422
  &nbsp;
423
+ <a href="https://www.alipay.com/" target="_blank"><img src="<?php echo $ali_donate_url; ?>" alt="Alipay Donate" title="Alipay" /></a>
424
  </p>
425
  <br />
426
 
427
+ <div style="text-align:center; margin:60px 0 10px 0;">&copy; <?php echo date("Y"); ?> BoLiQuan.COM</div>
428
 
429
  </div>
430
  <?php