Optimize Database after Deleting Revisions - Version 5.0.6

Version Description

[07/23/2021] = * BUG FIX: Scheduler fixed

Download this release

Release Info

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

Code changes from version 5.0.5 to 5.0.6

Files changed (2) hide show
  1. readme.txt +5 -2
  2. rvg-optimize-database.php +47 -44
readme.txt CHANGED
@@ -10,8 +10,8 @@ Contributors: cageehv
10
  Requires at least: 2.8
11
  Requires PHP: 5.0
12
  Tested up to: 5.8
13
- Stable tag: 5.0.5
14
- Version: 5.0.5
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.5 [07/20/2021] =
115
  * BUG FIX: Some performance inprovements
116
 
10
  Requires at least: 2.8
11
  Requires PHP: 5.0
12
  Tested up to: 5.8
13
+ Stable tag: 5.0.6
14
+ Version: 5.0.6
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.6 [07/23/2021] =
115
+ * BUG FIX: Scheduler fixed
116
+
117
  = 5.0.5 [07/20/2021] =
118
  * BUG FIX: Some performance inprovements
119
 
rvg-optimize-database.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package Optimize Database after Deleting Revisions
4
- * @version 5.0.5
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.5
14
  */
15
 
16
  /********************************************************************************************
@@ -28,8 +28,8 @@ $odb_class = new OptimizeDatabase();
28
 
29
  class OptimizeDatabase {
30
  // VERSION
31
- var $odb_version = '5.0.5';
32
- var $odb_release_date = '07/20/2021';
33
 
34
  // PLUGIN OPTIONS
35
  var $odb_rvg_options = array();
@@ -66,6 +66,8 @@ class OptimizeDatabase {
66
  // v4.6
67
  var $odb_logtable_name;
68
 
 
 
69
  // OBJECTS
70
  var $odb_cleaner_obj;
71
  var $odb_displayer_obj;
@@ -100,51 +102,51 @@ class OptimizeDatabase {
100
  // URLS AND DIRECTORIES
101
  $this->odb_urls_dirs();
102
 
 
 
103
  $this_page = '';
104
  if(isset($_GET['page'])) $this_page = $_GET['page'];
 
 
105
 
106
  if ($this_page == 'rvg-optimize-database') {
107
- // PLUGIN RUNNING (v5.0.5)
108
- $this->odb_tables = $this->odb_utilities_obj->odb_get_tables();
109
-
110
- // CREATE LOG TABLE (IF NOT EXISTS) - v4.6
111
- $this->odb_logtable_name = $wpdb->base_prefix . 'odb_logs';
112
-
113
- $found = false;
114
- for($i = 0; $i < count($this->odb_tables); $i++) {
115
- if ($this->odb_tables[$i][0] == $this->odb_logtable_name) {
116
- $found = true;
117
- }
118
- } // for($i = 0; $i < count($this->odb_tables); $i++)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
 
120
- // v5.0.3
121
- if (!$found) {
122
- $sql = '
123
- CREATE TABLE IF NOT EXISTS `' . $this->odb_logtable_name . '` (
124
- `odb_id` int(11) NOT NULL AUTO_INCREMENT,
125
- `odb_timestamp` varchar(20) NOT NULL,
126
- `odb_revisions` int(11) NOT NULL,
127
- `odb_trash` int(11) NOT NULL,
128
- `odb_spam` int(11) NOT NULL,
129
- `odb_tags` int(11) NOT NULL,
130
- `odb_transients` int(11) NOT NULL,
131
- `odb_pingbacks` int(11) NOT NULL,
132
- `odb_oembeds` int(11) NOT NULL,
133
- `odb_orphans` int(11) NOT NULL,
134
- `odb_tables` int(11) NOT NULL,
135
- `odb_before` varchar(20) NOT NULL,
136
- `odb_after` varchar(20) NOT NULL,
137
- `odb_savings` varchar(20) NOT NULL,
138
- PRIMARY KEY (`odb_id`)
139
- ) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
140
- ';
141
-
142
- // CREATE TABLE
143
- $wpdb->get_results($sql);
144
- }
145
  }
146
-
147
-
148
 
149
  // GET (MULTI-SITE) NETWORK INFORMATION
150
  $this->odb_multisite_obj->odb_ms_network_info();
@@ -646,7 +648,8 @@ class OptimizeDatabase {
646
  *
647
  *******************************************************************************/
648
  function odb_start_scheduler() {
649
- $this->odb_start(true);
 
650
  } // odb_start_scheduler()
651
 
652
 
1
  <?php
2
  /**
3
  * @package Optimize Database after Deleting Revisions
4
+ * @version 5.0.6
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.6
14
  */
15
 
16
  /********************************************************************************************
28
 
29
  class OptimizeDatabase {
30
  // VERSION
31
+ var $odb_version = '5.0.6';
32
+ var $odb_release_date = '07/23/2021';
33
 
34
  // PLUGIN OPTIONS
35
  var $odb_rvg_options = array();
66
  // v4.6
67
  var $odb_logtable_name;
68
 
69
+ var $odb_scheduler = false;
70
+
71
  // OBJECTS
72
  var $odb_cleaner_obj;
73
  var $odb_displayer_obj;
102
  // URLS AND DIRECTORIES
103
  $this->odb_urls_dirs();
104
 
105
+ $this->odb_logtable_name = $wpdb->base_prefix . 'odb_logs';
106
+
107
  $this_page = '';
108
  if(isset($_GET['page'])) $this_page = $_GET['page'];
109
+ $this_action = '';
110
+ if(isset($_GET['action'])) $this_action = $_GET['action'];
111
 
112
  if ($this_page == 'rvg-optimize-database') {
113
+ if ($this->odb_scheduler || $this_action == 'run_summary' || $this_action == 'run_detail') {
114
+ $this->odb_tables = $this->odb_utilities_obj->odb_get_tables();
115
+ // CREATE LOG TABLE (IF NOT EXISTS) - v4.6
116
+ $found = false;
117
+ for($i = 0; $i < count($this->odb_tables); $i++) {
118
+ if ($this->odb_tables[$i][0] == $this->odb_logtable_name) {
119
+ $found = true;
120
+ }
121
+ } // for($i = 0; $i < count($this->odb_tables); $i++)
122
+
123
+ // v5.0.3
124
+ if (!$found) {
125
+ $sql = '
126
+ CREATE TABLE IF NOT EXISTS `' . $this->odb_logtable_name . '` (
127
+ `odb_id` int(11) NOT NULL AUTO_INCREMENT,
128
+ `odb_timestamp` varchar(20) NOT NULL,
129
+ `odb_revisions` int(11) NOT NULL,
130
+ `odb_trash` int(11) NOT NULL,
131
+ `odb_spam` int(11) NOT NULL,
132
+ `odb_tags` int(11) NOT NULL,
133
+ `odb_transients` int(11) NOT NULL,
134
+ `odb_pingbacks` int(11) NOT NULL,
135
+ `odb_oembeds` int(11) NOT NULL,
136
+ `odb_orphans` int(11) NOT NULL,
137
+ `odb_tables` int(11) NOT NULL,
138
+ `odb_before` varchar(20) NOT NULL,
139
+ `odb_after` varchar(20) NOT NULL,
140
+ `odb_savings` varchar(20) NOT NULL,
141
+ PRIMARY KEY (`odb_id`)
142
+ ) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
143
+ ';
144
 
145
+ // CREATE TABLE
146
+ $wpdb->get_results($sql);
147
+ } // if (!$found)
148
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  }
 
 
150
 
151
  // GET (MULTI-SITE) NETWORK INFORMATION
152
  $this->odb_multisite_obj->odb_ms_network_info();
648
  *
649
  *******************************************************************************/
650
  function odb_start_scheduler() {
651
+ $this->odb_scheduler = true;
652
+ $this->odb_start($this->odb_scheduler);
653
  } // odb_start_scheduler()
654
 
655