Optimize Database after Deleting Revisions - Version 5.0.7

Version Description

[07/24/2021] = * BUG FIX: Changed back to v5.0.4

Download this release

Release Info

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

Code changes from version 5.0.6 to 5.0.7

includes/settings-page.php CHANGED
@@ -387,7 +387,12 @@ echo '
387
  </option>
388
  <option value="monthly">
389
  '.__('run optimization MONTHLY',$this->odb_txt_domain).'
390
- </option>
 
 
 
 
 
391
  </select>
392
  <script type="text/javascript">
393
  jQuery("#rvg_odb_schedule").val("'.$this->odb_rvg_options['schedule_type'].'");
387
  </option>
388
  <option value="monthly">
389
  '.__('run optimization MONTHLY',$this->odb_txt_domain).'
390
+ </option>
391
+ <!--
392
+ <option value="fiveminutes">
393
+ '.__('run optimization EVERY FIVE MINUTES',$this->odb_txt_domain).'
394
+ </option>
395
+ -->
396
  </select>
397
  <script type="text/javascript">
398
  jQuery("#rvg_odb_schedule").val("'.$this->odb_rvg_options['schedule_type'].'");
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.6
14
- Version: 5.0.6
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.6 [07/23/2021] =
115
  * BUG FIX: Scheduler fixed
116
 
10
  Requires at least: 2.8
11
  Requires PHP: 5.0
12
  Tested up to: 5.8
13
+ Stable tag: 5.0.7
14
+ Version: 5.0.7
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.7 [07/24/2021] =
115
+ * BUG FIX: Changed back to v5.0.4
116
+
117
  = 5.0.6 [07/23/2021] =
118
  * BUG FIX: Scheduler fixed
119
 
rvg-optimize-database.php CHANGED
@@ -1,7 +1,7 @@
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,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.6
14
  */
15
 
16
  /********************************************************************************************
@@ -28,8 +28,8 @@ $odb_class = new OptimizeDatabase();
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,8 +66,6 @@ class OptimizeDatabase {
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;
@@ -101,51 +99,43 @@ class OptimizeDatabase {
101
 
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
@@ -164,6 +154,8 @@ class OptimizeDatabase {
164
  $this->odb_minify = (defined('WP_DEBUG') && WP_DEBUG) ? '' : '.min';
165
 
166
  // LOAD STYLE SHEET (ONLY ON RELEVANT PAGES)
 
 
167
  // v4.0.3
168
  if($this->odb_is_relevant_page()) {
169
  wp_register_style('odb-style'.$this->odb_version, plugins_url('css/style'.$this->odb_minify.'.css', __FILE__));
@@ -648,8 +640,7 @@ class OptimizeDatabase {
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
 
1
  <?php
2
  /**
3
  * @package Optimize Database after Deleting Revisions
4
+ * @version 5.0.7
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.7
14
  */
15
 
16
  /********************************************************************************************
28
 
29
  class OptimizeDatabase {
30
  // VERSION
31
+ var $odb_version = '5.0.7';
32
+ var $odb_release_date = '07/24/2021';
33
 
34
  // PLUGIN OPTIONS
35
  var $odb_rvg_options = array();
66
  // v4.6
67
  var $odb_logtable_name;
68
 
 
 
69
  // OBJECTS
70
  var $odb_cleaner_obj;
71
  var $odb_displayer_obj;
99
 
100
  // URLS AND DIRECTORIES
101
  $this->odb_urls_dirs();
102
+
103
+ $this->odb_tables = $this->odb_utilities_obj->odb_get_tables();
104
+
105
+ // CREATE LOG TABLE (IF NOT EXISTS) - v4.6
106
  $this->odb_logtable_name = $wpdb->base_prefix . 'odb_logs';
107
 
108
+ $found = false;
109
+ for($i = 0; $i < count($this->odb_tables); $i++) {
110
+ if ($this->odb_tables[$i][0] == $this->odb_logtable_name) {
111
+ $found = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  }
113
+ } // for($i = 0; $i < count($this->odb_tables); $i++)
114
+
115
+ // v5.0.3
116
+ if (!$found) {
117
+ $sql = '
118
+ CREATE TABLE IF NOT EXISTS `' . $this->odb_logtable_name . '` (
119
+ `odb_id` int(11) NOT NULL AUTO_INCREMENT,
120
+ `odb_timestamp` varchar(20) NOT NULL,
121
+ `odb_revisions` int(11) NOT NULL,
122
+ `odb_trash` int(11) NOT NULL,
123
+ `odb_spam` int(11) NOT NULL,
124
+ `odb_tags` int(11) NOT NULL,
125
+ `odb_transients` int(11) NOT NULL,
126
+ `odb_pingbacks` int(11) NOT NULL,
127
+ `odb_oembeds` int(11) NOT NULL,
128
+ `odb_orphans` int(11) NOT NULL,
129
+ `odb_tables` int(11) NOT NULL,
130
+ `odb_before` varchar(20) NOT NULL,
131
+ `odb_after` varchar(20) NOT NULL,
132
+ `odb_savings` varchar(20) NOT NULL,
133
+ PRIMARY KEY (`odb_id`)
134
+ ) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
135
+ ';
136
+
137
+ // CREATE TABLE
138
+ $wpdb->get_results($sql);
139
  }
140
 
141
  // GET (MULTI-SITE) NETWORK INFORMATION
154
  $this->odb_minify = (defined('WP_DEBUG') && WP_DEBUG) ? '' : '.min';
155
 
156
  // LOAD STYLE SHEET (ONLY ON RELEVANT PAGES)
157
+ $this_page = '';
158
+ if(isset($_GET['page'])) $this_page = $_GET['page'];
159
  // v4.0.3
160
  if($this->odb_is_relevant_page()) {
161
  wp_register_style('odb-style'.$this->odb_version, plugins_url('css/style'.$this->odb_minify.'.css', __FILE__));
640
  *
641
  *******************************************************************************/
642
  function odb_start_scheduler() {
643
+ $this->odb_start(true);
 
644
  } // odb_start_scheduler()
645
 
646