Optimize Database after Deleting Revisions - Version 2.7.1

Version Description

[12/09/2013] = * BUG FIX: query and depreciated item (mysql_list_tables) fixed

Download this release

Release Info

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

Code changes from version 2.7 to 2.7.1

Files changed (2) hide show
  1. readme.txt +5 -2
  2. rvg-optimize-db.php +20 -15
readme.txt CHANGED
@@ -8,8 +8,8 @@ Author URI: http://cagewebdev.com
8
  Author: CAGE Web Design | Rolf van Gelder, Eindhoven, The Netherlands
9
  Requires at least: 2.0
10
  Tested up to: 3.7.1
11
- Stable tag: 2.7
12
- Version: 2.7
13
 
14
  == Description ==
15
 
@@ -54,6 +54,9 @@ No warranty, use at own risk!
54
 
55
  == Changelog ==
56
 
 
 
 
57
  = 2.7 [12/06/2013] =
58
  * NEW: deletion of expired transients (optional)
59
 
8
  Author: CAGE Web Design | Rolf van Gelder, Eindhoven, The Netherlands
9
  Requires at least: 2.0
10
  Tested up to: 3.7.1
11
+ Stable tag: 2.7.1
12
+ Version: 2.7.1
13
 
14
  == Description ==
15
 
54
 
55
  == Changelog ==
56
 
57
+ = 2.7.1 [12/09/2013] =
58
+ * BUG FIX: query and depreciated item (mysql_list_tables) fixed
59
+
60
  = 2.7 [12/06/2013] =
61
  * NEW: deletion of expired transients (optional)
62
 
rvg-optimize-db.php CHANGED
@@ -1,16 +1,16 @@
1
  <?php
2
- $odb_version = '2.7';
3
- $odb_release_date = '12/06/2013';
4
  /**
5
  * @package Optimize Database after Deleting Revisions
6
- * @version 2.7
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: CAGE Web Design | Rolf van Gelder, Eindhoven, The Netherlands
13
- Version: 2.7
14
  Author URI: http://cagewebdev.com
15
  */
16
  ?>
@@ -347,7 +347,7 @@ if($rvg_odb_logging_on == 'Y') $rvg_odb_logging_on_checked = ' checked="checke
347
  </table></td>
348
  </tr>
349
  <?php
350
- $names = mysql_list_tables(DB_NAME);
351
  ?>
352
  <tr>
353
  <td colspan="4" valign="top"><table id="table_list" width="100%" border="0" cellspacing="0" cellpadding="4" style="display:block;">
@@ -1267,20 +1267,24 @@ function rvg_delete_transients()
1267
 
1268
  $sql = "
1269
  SELECT *
1270
- FROM $wpdb->options a, $wpdb->options b
1271
- WHERE b.option_name = replace(a.option_name,'_timeout', '')
1272
- AND (a.option_name like '_transient_timeout_%' or a.option_name like '_site_transient_timeout_%')
1273
- AND a.option_value < '$delay'
 
 
1274
  ";
1275
 
1276
  $results = $wpdb -> get_results($sql);
1277
  $total_deleted += count($results);
1278
 
1279
  $sql = "
1280
- DELETE FROM $wpdb->options a, $wpdb->options b
1281
- WHERE b.option_name = replace(a.option_name,'_timeout', '')
1282
- AND (a.option_name like '_transient_timeout_%' or a.option_name like '_site_transient_timeout_%')
1283
- AND a.option_value < '$delay'
 
 
1284
  ";
1285
 
1286
  $wpdb -> get_results($sql);
@@ -1359,7 +1363,7 @@ function rvg_optimize_tables($display)
1359
  # WP_ONLY IS DEPRECIATED FROM v2.2
1360
  rvg_fix_wp_only();
1361
 
1362
- $names = mysql_list_tables(DB_NAME);
1363
  $cnt = 0;
1364
  while($row = mysql_fetch_row($names))
1365
  {
@@ -1412,7 +1416,7 @@ function rvg_fix_wp_only()
1412
  $wp_only = get_option('rvg_wp_only');
1413
  if($wp_only == 'Y')
1414
  {
1415
- $names = mysql_list_tables(DB_NAME);
1416
  while($row = mysql_fetch_row($names))
1417
  { if(substr($row[0],0,strlen($table_prefix)) != $table_prefix)
1418
  { // NOT A WORDPRESS TABLE: EXLUDE IT
@@ -1646,3 +1650,4 @@ function rvg_format_size($size, $precision=1)
1646
  return $table_size;
1647
  } // rvg_format_size
1648
  ?>
 
1
  <?php
2
+ $odb_version = '2.7.1';
3
+ $odb_release_date = '12/09/2013';
4
  /**
5
  * @package Optimize Database after Deleting Revisions
6
+ * @version 2.7.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: CAGE Web Design | Rolf van Gelder, Eindhoven, The Netherlands
13
+ Version: 2.7.1
14
  Author URI: http://cagewebdev.com
15
  */
16
  ?>
347
  </table></td>
348
  </tr>
349
  <?php
350
+ $names = mysql_query("SHOW TABLES FROM ".DB_NAME);
351
  ?>
352
  <tr>
353
  <td colspan="4" valign="top"><table id="table_list" width="100%" border="0" cellspacing="0" cellpadding="4" style="display:block;">
1267
 
1268
  $sql = "
1269
  SELECT *
1270
+ FROM cwwp_options
1271
+ WHERE (
1272
+ option_name LIKE '_transient_timeout_%'
1273
+ OR option_name LIKE '_site_transient_timeout_%'
1274
+ )
1275
+ AND option_value < '$delay'
1276
  ";
1277
 
1278
  $results = $wpdb -> get_results($sql);
1279
  $total_deleted += count($results);
1280
 
1281
  $sql = "
1282
+ DELETE FROM cwwp_options
1283
+ WHERE (
1284
+ option_name LIKE '_transient_timeout_%'
1285
+ OR option_name LIKE '_site_transient_timeout_%'
1286
+ )
1287
+ AND option_value < '$delay'
1288
  ";
1289
 
1290
  $wpdb -> get_results($sql);
1363
  # WP_ONLY IS DEPRECIATED FROM v2.2
1364
  rvg_fix_wp_only();
1365
 
1366
+ $names = mysql_query("SHOW TABLES FROM ".DB_NAME);
1367
  $cnt = 0;
1368
  while($row = mysql_fetch_row($names))
1369
  {
1416
  $wp_only = get_option('rvg_wp_only');
1417
  if($wp_only == 'Y')
1418
  {
1419
+ $names = mysql_query("SHOW TABLES FROM ".DB_NAME);
1420
  while($row = mysql_fetch_row($names))
1421
  { if(substr($row[0],0,strlen($table_prefix)) != $table_prefix)
1422
  { // NOT A WORDPRESS TABLE: EXLUDE IT
1650
  return $table_size;
1651
  } // rvg_format_size
1652
  ?>
1653
+