Optimize Database after Deleting Revisions - Version 2.2.2

Version Description

[01/20/2013] = * Bug fix: deleting of postmeta orphans didn't work correctly

Download this release

Release Info

Developer cageehv
Plugin Icon 128x128 Optimize Database after Deleting Revisions
Version 2.2.2
Comparing to
See all releases

Code changes from version 2.2.1 to 2.2.2

Files changed (2) hide show
  1. readme.txt +6 -3
  2. rvg-optimize-db.php +9 -8
readme.txt CHANGED
@@ -6,10 +6,10 @@ Plugin URI: http://cagewebdev.com/index.php/optimize-database-after-deleting-rev
6
  Tags: database, delete, revisions, optimize, post, posts, page, pages, clean, clean up, trash, spam, trashed, spammed, database size
7
  Author URI: http://cagewebdev.com
8
  Author: CAGE Web Design | Rolf van Gelder, Eindhoven, The Netherlands
9
- Requires at least: 2.2.1
10
  Tested up to: 3.5
11
- Stable tag: 2.2.1
12
- Version: 2.2.1
13
 
14
  == Description ==
15
 
@@ -48,6 +48,9 @@ http://wordpress.org/extend/plugins/rvg-optimize-database/
48
 
49
  == Changelog ==
50
 
 
 
 
51
  = 2.2.1 [01/17/2013] =
52
  * Bug fix: fixed some debug warnings
53
 
6
  Tags: database, delete, revisions, optimize, post, posts, page, pages, clean, clean up, trash, spam, trashed, spammed, database size
7
  Author URI: http://cagewebdev.com
8
  Author: CAGE Web Design | Rolf van Gelder, Eindhoven, The Netherlands
9
+ Requires at least: 2.2.2
10
  Tested up to: 3.5
11
+ Stable tag: 2.2.2
12
+ Version: 2.2.2
13
 
14
  == Description ==
15
 
48
 
49
  == Changelog ==
50
 
51
+ = 2.2.2 [01/20/2013] =
52
+ * Bug fix: deleting of postmeta orphans didn't work correctly
53
+
54
  = 2.2.1 [01/17/2013] =
55
  * Bug fix: fixed some debug warnings
56
 
rvg-optimize-db.php CHANGED
@@ -1,16 +1,16 @@
1
  <?php
2
- $odb_version = '2.2.1';
3
- $odb_release_date = '01/17/2013';
4
  /**
5
  * @package Optimize Database after Deleting Revisions
6
- * @version 2.2.1
7
  */
8
  /*
9
  Plugin Name: Optimize Database after Deleting Revisions
10
  Plugin URI: http://cagewebdev.com/index.php/optimize-database-after-deleting-revisions-wordpress-plugin/
11
  Description: Optimizes the Wordpress Database after Cleaning it out - <a href="options-general.php?page=rvg_odb_admin"><strong>plug in options</strong></a>
12
  Author: Rolf van Gelder, Eindhoven, The Netherlands
13
- Version: 2.2.1
14
  Author URI: http://cagewebdev.com
15
  */
16
  ?>
@@ -953,17 +953,18 @@ function rvg_delete_orphans($display)
953
 
954
  $sql_delete = "
955
  SELECT COUNT(*) cnt
956
- FROM $wpdb->postmeta pm
957
- WHERE pm.post_id NOT IN (SELECT ID FROM $wpdb->posts)
958
  ";
 
959
  $results = $wpdb -> get_results($sql_delete);
960
 
961
  $total_deleted = $results[0] -> cnt;
962
 
963
  if($total_deleted > 0)
964
  { $sql_delete = "
965
- DELETE FROM $wpdb->postmeta pm
966
- WHERE pm.post_id NOT IN (SELECT ID FROM $wpdb->posts)
967
  ";
968
  $wpdb -> get_results($sql_delete);
969
  }
1
  <?php
2
+ $odb_version = '2.2.2';
3
+ $odb_release_date = '01/20/2013';
4
  /**
5
  * @package Optimize Database after Deleting Revisions
6
+ * @version 2.2.2
7
  */
8
  /*
9
  Plugin Name: Optimize Database after Deleting Revisions
10
  Plugin URI: http://cagewebdev.com/index.php/optimize-database-after-deleting-revisions-wordpress-plugin/
11
  Description: Optimizes the Wordpress Database after Cleaning it out - <a href="options-general.php?page=rvg_odb_admin"><strong>plug in options</strong></a>
12
  Author: Rolf van Gelder, Eindhoven, The Netherlands
13
+ Version: 2.2.2
14
  Author URI: http://cagewebdev.com
15
  */
16
  ?>
953
 
954
  $sql_delete = "
955
  SELECT COUNT(*) cnt
956
+ FROM $wpdb->postmeta
957
+ WHERE post_id NOT IN (SELECT ID FROM $wpdb->posts)
958
  ";
959
+
960
  $results = $wpdb -> get_results($sql_delete);
961
 
962
  $total_deleted = $results[0] -> cnt;
963
 
964
  if($total_deleted > 0)
965
  { $sql_delete = "
966
+ DELETE FROM $wpdb->postmeta
967
+ WHERE post_id NOT IN (SELECT ID FROM $wpdb->posts)
968
  ";
969
  $wpdb -> get_results($sql_delete);
970
  }