Optimize Database after Deleting Revisions - Version 5.0.5

Version Description

[07/20/2021] = * BUG FIX: Some performance inprovements

Download this release

Release Info

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

Code changes from version 5.0.4 to 5.0.5

Files changed (2) hide show
  1. readme.txt +5 -2
  2. rvg-optimize-database.php +47 -41
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.4
14
- Version: 5.0.4
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.4 [02/26/2021] =
115
  * BUG FIX: Field names INFORMATION_SCHEMA corrected
116
 
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
  * 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
+
117
  = 5.0.4 [02/26/2021] =
118
  * BUG FIX: Field names INFORMATION_SCHEMA corrected
119
 
rvg-optimize-database.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package Optimize Database after Deleting Revisions
4
- * @version 5.0.4
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.4
14
  */
15
 
16
  /********************************************************************************************
@@ -28,8 +28,8 @@ $odb_class = new OptimizeDatabase();
28
 
29
  class OptimizeDatabase {
30
  // VERSION
31
- var $odb_version = '5.0.4';
32
- var $odb_release_date = '02/26/2021';
33
 
34
  // PLUGIN OPTIONS
35
  var $odb_rvg_options = array();
@@ -99,44 +99,52 @@ class OptimizeDatabase {
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
142
  $this->odb_multisite_obj->odb_ms_network_info();
@@ -154,8 +162,6 @@ class OptimizeDatabase {
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__));
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
  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
 
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();
99
 
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();
162
  $this->odb_minify = (defined('WP_DEBUG') && WP_DEBUG) ? '' : '.min';
163
 
164
  // LOAD STYLE SHEET (ONLY ON RELEVANT PAGES)
 
 
165
  // v4.0.3
166
  if($this->odb_is_relevant_page()) {
167
  wp_register_style('odb-style'.$this->odb_version, plugins_url('css/style'.$this->odb_minify.'.css', __FILE__));