Optimize Database after Deleting Revisions - Version 5.0.2

Version Description

[11/06/2020] = * BUG FIX: Deletion of orphaned term relationships deactivated

Download this release

Release Info

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

Code changes from version 5.0.1 to 5.0.2

classes/odb-cleaner.php CHANGED
@@ -1836,26 +1836,6 @@ function odb_confirm_delete() {
1836
  for ($j = 0; $j < count($results); $j++) {
1837
  array_push($res_arr, $results[$j]);
1838
  } // for ($j = 0; $j < count($results); $j++)
1839
-
1840
- // FIND TERM RELATIONSHIP ORPHANS
1841
- $sql = sprintf ("
1842
- SELECT '%s' AS site,
1843
- `object_id` AS ID,
1844
- 'term relationship' AS type,
1845
- `name` AS post_title,
1846
- '' AS post_modified,
1847
- r.term_taxonomy_id AS term_taxonomy_id,
1848
- '' AS meta_key,
1849
- '' AS meta_value
1850
- FROM %sterm_relationships r,
1851
- %sterm_taxonomy x,
1852
- %sterms t
1853
- WHERE r.term_taxonomy_id = x.term_taxonomy_id
1854
- AND x.term_id = t.term_id
1855
- AND `object_id` NOT IN (SELECT ID FROM %sposts)
1856
- ORDER BY `object_id`
1857
- ", $prefix, $prefix, $prefix, $prefix, $prefix);
1858
- // echo $sql . '<br>';
1859
 
1860
  $results = $wpdb->get_results($sql, ARRAY_A);
1861
  for ($j = 0; $j < count($results); $j++) {
@@ -1908,14 +1888,7 @@ function odb_confirm_delete() {
1908
  DELETE FROM %sposts
1909
  WHERE `ID` = %d
1910
  ", $results[$j]['site'], $results[$j]['ID']);
1911
- } else if ($results[$j]['type'] == 'term relationship') {
1912
- //print_r($results[$j]);
1913
- $sql = sprintf ("
1914
- DELETE FROM %sterm_relationships
1915
- WHERE `object_id` = %d
1916
- AND `term_taxonomy_id` = %d
1917
- ", $results[$j]['site'], $results[$j]['ID'], $results[$j]['term_taxonomy_id']);
1918
- } // if ($results[$j]['type'] == 'meta')
1919
  $wpdb->get_results($sql);
1920
  } // for($j = 0; $j < count($results); $j++)
1921
  } // if ($action == 'run_summary' || $action == 'run_detail')
1836
  for ($j = 0; $j < count($results); $j++) {
1837
  array_push($res_arr, $results[$j]);
1838
  } // for ($j = 0; $j < count($results); $j++)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1839
 
1840
  $results = $wpdb->get_results($sql, ARRAY_A);
1841
  for ($j = 0; $j < count($results); $j++) {
1888
  DELETE FROM %sposts
1889
  WHERE `ID` = %d
1890
  ", $results[$j]['site'], $results[$j]['ID']);
1891
+ } // for($j = 0; $j < count($results); $j++)
 
 
 
 
 
 
 
1892
  $wpdb->get_results($sql);
1893
  } // for($j = 0; $j < count($results); $j++)
1894
  } // if ($action == 'run_summary' || $action == 'run_detail')
readme.txt CHANGED
@@ -9,9 +9,9 @@ Author: CAGE Web Design | Rolf van Gelder, Eindhoven, The Netherlands
9
  Contributors: cageehv
10
  Requires at least: 2.8
11
  Requires PHP: 5.0
12
- Tested up to: 5.5.2
13
- Stable tag: 5.0.1
14
- Version: 5.0.1
15
  License: GPLv2 or later
16
 
17
  == Description ==
@@ -111,6 +111,9 @@ http://cagewebdev.com/category/news-tech-art/wordpress/
111
  * If you run the plugin from any of the sites, it will cleanup ALL the sites in the network!
112
 
113
  == Changelog ==
 
 
 
114
  = 5.0.1 [09/10/2020] =
115
  * BUG FIX: Deletion of Duplicated Postmeta entries deactivated
116
 
9
  Contributors: cageehv
10
  Requires at least: 2.8
11
  Requires PHP: 5.0
12
+ Tested up to: 5.5.4
13
+ Stable tag: 5.0.2
14
+ Version: 5.0.2
15
  License: GPLv2 or later
16
 
17
  == Description ==
111
  * If you run the plugin from any of the sites, it will cleanup ALL the sites in the network!
112
 
113
  == Changelog ==
114
+ = 5.0.2 [11/06/2020] =
115
+ * BUG FIX: Deletion of orphaned term relationships deactivated
116
+
117
  = 5.0.1 [09/10/2020] =
118
  * BUG FIX: Deletion of Duplicated Postmeta entries deactivated
119
 
rvg-optimize-database.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package Optimize Database after Deleting Revisions
4
- * @version 5.0.1
5
  */
6
  /*
7
  Plugin Name: Optimize Database after Deleting Revisions
@@ -10,7 +10,7 @@ Description: Optimizes the Wordpress Database after Cleaning it out
10
  Author: CAGE Web Design | Rolf van Gelder, Eindhoven, The Netherlands
11
  Author URI: http://cagewebdev.com
12
  Network: True
13
- Version: 5.0.1
14
  */
15
 
16
  /********************************************************************************************
@@ -28,8 +28,8 @@ $odb_class = new OptimizeDatabase();
28
 
29
  class OptimizeDatabase {
30
  // VERSION
31
- var $odb_version = '5.0.1';
32
- var $odb_release_date = '09/10/2020';
33
 
34
  // PLUGIN OPTIONS
35
  var $odb_rvg_options = array();
1
  <?php
2
  /**
3
  * @package Optimize Database after Deleting Revisions
4
+ * @version 5.0.2
5
  */
6
  /*
7
  Plugin Name: Optimize Database after Deleting Revisions
10
  Author: CAGE Web Design | Rolf van Gelder, Eindhoven, The Netherlands
11
  Author URI: http://cagewebdev.com
12
  Network: True
13
+ Version: 5.0.2
14
  */
15
 
16
  /********************************************************************************************
28
 
29
  class OptimizeDatabase {
30
  // VERSION
31
+ var $odb_version = '5.0.2';
32
+ var $odb_release_date = '11/06/2020';
33
 
34
  // PLUGIN OPTIONS
35
  var $odb_rvg_options = array();