Optimize Database after Deleting Revisions - Version 2.8.3

Version Description

[09/10/2014] = * CHANGE: using the WP jQuery libs now (not from googleapis anymore) * BUG FIX: check_admin_referer() fixed (gave a debug warning)

Download this release

Release Info

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

Code changes from version 2.8.2 to 2.8.3

Files changed (2) hide show
  1. readme.txt +7 -3
  2. rvg-optimize-db.php +14 -19
readme.txt CHANGED
@@ -7,9 +7,9 @@ Tags: database, delete, revisions, optimize, post, posts, page, pages, clean, cl
7
  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.9.1
11
- Stable tag: 2.8.2
12
- Version: 2.8.2
13
  License: GPLv2 or later
14
 
15
  == Description ==
@@ -61,6 +61,10 @@ http://wordpress.org/plugins/order-your-posts-manually/
61
 
62
  == Changelog ==
63
 
 
 
 
 
64
  = 2.8.2 [08/01/2014] =
65
  * BUG FIX: all problems with getting the table names should be fixed now!
66
 
7
  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: 4.0
11
+ Stable tag: 2.8.3
12
+ Version: 2.8.3
13
  License: GPLv2 or later
14
 
15
  == Description ==
61
 
62
  == Changelog ==
63
 
64
+ = 2.8.3 [09/10/2014] =
65
+ * CHANGE: using the WP jQuery libs now (not from googleapis anymore)
66
+ * BUG FIX: check_admin_referer() fixed (gave a debug warning)
67
+
68
  = 2.8.2 [08/01/2014] =
69
  * BUG FIX: all problems with getting the table names should be fixed now!
70
 
rvg-optimize-db.php CHANGED
@@ -1,16 +1,16 @@
1
  <?php
2
- $odb_version = '2.8.2';
3
- $odb_release_date = '07/31/2014';
4
  /**
5
  * @package Optimize Database after Deleting Revisions
6
- * @version 2.8.2
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.8.2
14
  Author URI: http://cagewebdev.com
15
  */
16
 
@@ -111,22 +111,14 @@ function rvg_odb_options_page()
111
  $current_date = substr($current_datetime, 0, 8);
112
  $current_hour = substr($current_datetime, 8, 2);
113
 
114
- # jQuery FRAMEWORK
115
- if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
116
- echo '<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>';
117
- }
118
- else
119
- { # 2.7.9
120
- echo '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>';
121
- }
122
-
123
  if(isset($_REQUEST['delete_log']))
124
  if($_REQUEST['delete_log'] == "Y") @unlink(dirname(__FILE__).'/rvg-optimize-db-log.html');
125
 
126
  // SAVE THE OPTIONS
127
  if (isset($_POST['info_update']))
128
  {
129
- check_admin_referer();
 
130
 
131
  # DELETE ALL EXCLUDED TABLES
132
  $sql = "
@@ -249,14 +241,17 @@ function rvg_odb_options_page()
249
  ?>
250
  <script type="text/javascript">
251
  function schedule_changed()
252
- { if(document.options.rvg_odb_schedule.value == 'daily' || document.options.rvg_odb_schedule.value == 'weekly')
253
- $("#schedulehour").show();
 
254
  else
255
- $("#schedulehour").hide();
256
  }
257
  </script>
258
 
259
  <form name="options" method="post" action="">
 
 
260
  <div class="wrap">
261
  <h2>Using Optimize Database after Deleting Revisions</h2>
262
  <blockquote>
@@ -353,13 +348,13 @@ if($rvg_odb_logging_on == 'Y') $rvg_odb_logging_on_checked = ' checked="checke
353
  <?php
354
  # v2.8.2
355
  $tables = $wpdb->get_results("SHOW TABLES FROM `".DB_NAME."`",ARRAY_N);
356
- // print_r($tables);
357
  ?>
358
  <tr>
359
  <td colspan="4" valign="top"><table id="table_list" width="100%" border="0" cellspacing="0" cellpadding="4" style="display:block;">
360
  <tr>
361
  <td colspan="4" align="center"><span style="font-weight:bold;">EXCLUDE DATABASE TABLES FROM OPTIMIZATION: <span style="text-decoration:underline;color:#F00;">CHECKED</span> TABLES <span style="text-decoration:underline;color:#F00;">WON'T</span> BE OPTIMIZED!</span><br />
362
- <a href="javascript:;" onclick="$('[id^=cb_]').attr('checked',true);">check all tables</a> | <a href="javascript:;" onclick="$('[id^=cb_]').attr('checked',false);">uncheck all tables</a> | <a href="javascript:;" onclick="$(':not([id^=cb_<?php echo $table_prefix; ?>])').filter('[id^=cb_]').attr('checked',true);">check all NON-WordPress tables</a></td>
363
  </tr>
364
  <tr>
365
  <?php
1
  <?php
2
+ $odb_version = '2.8.3';
3
+ $odb_release_date = '09/10/2014';
4
  /**
5
  * @package Optimize Database after Deleting Revisions
6
+ * @version 2.8.3
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.8.3
14
  Author URI: http://cagewebdev.com
15
  */
16
 
111
  $current_date = substr($current_datetime, 0, 8);
112
  $current_hour = substr($current_datetime, 8, 2);
113
 
 
 
 
 
 
 
 
 
 
114
  if(isset($_REQUEST['delete_log']))
115
  if($_REQUEST['delete_log'] == "Y") @unlink(dirname(__FILE__).'/rvg-optimize-db-log.html');
116
 
117
  // SAVE THE OPTIONS
118
  if (isset($_POST['info_update']))
119
  {
120
+ // v2.8.3
121
+ check_admin_referer('odb_action', 'odb_nonce');
122
 
123
  # DELETE ALL EXCLUDED TABLES
124
  $sql = "
241
  ?>
242
  <script type="text/javascript">
243
  function schedule_changed()
244
+ { // v2.8.3
245
+ if(document.options.rvg_odb_schedule.value == 'daily' || document.options.rvg_odb_schedule.value == 'weekly')
246
+ jQuery("#schedulehour").show();
247
  else
248
+ jQuery("#schedulehour").hide();
249
  }
250
  </script>
251
 
252
  <form name="options" method="post" action="">
253
+ <?php // v2.8.3 ?>
254
+ <?php wp_nonce_field( 'odb_action','odb_nonce' ); ?>
255
  <div class="wrap">
256
  <h2>Using Optimize Database after Deleting Revisions</h2>
257
  <blockquote>
348
  <?php
349
  # v2.8.2
350
  $tables = $wpdb->get_results("SHOW TABLES FROM `".DB_NAME."`",ARRAY_N);
351
+ # v2.8.3 $ replaced by jQuery
352
  ?>
353
  <tr>
354
  <td colspan="4" valign="top"><table id="table_list" width="100%" border="0" cellspacing="0" cellpadding="4" style="display:block;">
355
  <tr>
356
  <td colspan="4" align="center"><span style="font-weight:bold;">EXCLUDE DATABASE TABLES FROM OPTIMIZATION: <span style="text-decoration:underline;color:#F00;">CHECKED</span> TABLES <span style="text-decoration:underline;color:#F00;">WON'T</span> BE OPTIMIZED!</span><br />
357
+ <a href="javascript:;" onclick="jQuery('[id^=cb_]').attr('checked',true);">check all tables</a> | <a href="javascript:;" onclick="jQuery('[id^=cb_]').attr('checked',false);">uncheck all tables</a> | <a href="javascript:;" onclick="jQuery(':not([id^=cb_<?php echo $table_prefix; ?>])').filter('[id^=cb_]').attr('checked',true);">check all NON-WordPress tables</a></td>
358
  </tr>
359
  <tr>
360
  <?php