Optimize Database after Deleting Revisions - Version 4.4

Version Description

[08/22/2017] = * NEW: New options to delete revisions of posts, pages and / or specific custom post types

Download this release

Release Info

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

Code changes from version 4.3.2 to 4.4

classes/odb-cleaner.php CHANGED
@@ -502,15 +502,30 @@ class ODB_Cleaner {
502
  global $odb_class, $wpdb;
503
 
504
  $res_arr = array();
505
-
506
- $rev_post_type = $odb_class->odb_rvg_options['rev_post_type'];
507
- $where = "";
508
- if ($rev_post_type) $where = " AND p2.`post_type` = '" . $rev_post_type . "'";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
509
 
510
  $older_than = $odb_class->odb_rvg_options['older_than'];
511
 
512
  $index = 0;
513
 
 
514
  for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
515
 
516
  $sql = sprintf("
@@ -526,6 +541,8 @@ class ODB_Cleaner {
526
  $odb_class->odb_ms_prefixes[$i],
527
  $where,
528
  $older_than);
 
 
529
 
530
  $res = $wpdb->get_results($sql, ARRAY_A);
531
 
@@ -550,14 +567,24 @@ class ODB_Cleaner {
550
  global $odb_class, $wpdb;
551
 
552
  $res_arr = array();
553
-
554
- if (!isset($odb_class->odb_rvg_options['rev_post_type'])) {
555
- $odb_class->odb_rvg_options['rev_post_type'] = '';
556
- }
557
-
558
- $rev_post_type = $odb_class->odb_rvg_options['rev_post_type'];
 
 
 
 
 
559
  $where1 = '';
560
- if ($rev_post_type) $where1 = " AND p2.`post_type` = '" . $rev_post_type . "'";
 
 
 
 
 
561
 
562
  // MAX NUMBER OF REVISIONS TO KEEP
563
  $max_revisions = $odb_class->odb_rvg_options['nr_of_revisions'];
@@ -590,6 +617,8 @@ class ODB_Cleaner {
590
  $where2,
591
  $max_revisions);
592
 
 
 
593
  $res = $wpdb->get_results($sql, ARRAY_A);
594
  for($j=0; $j<count($res); $j++) {
595
  if(isset($res[$j]) && !$this->odb_post_is_excluded($res[$j]['post_parent'])) {
502
  global $odb_class, $wpdb;
503
 
504
  $res_arr = array();
505
+
506
+ // CUSTOM POST TYPES (from v4.4)
507
+ $rel_posttypes = $odb_class->odb_rvg_options['post_types'];
508
+ $in = '';
509
+ foreach ($rel_posttypes as $posttype => $value) {
510
+ if ($value == 'Y') {
511
+ if ($in != '') $in .= ',';
512
+ $in .= "'" . $posttype . "'";
513
+ } // if ($value == 'Y')
514
+ } // foreach($rel_posttypes as $posttypes)
515
+
516
+ $where = '';
517
+ if($in != '') {
518
+ $where = " AND p2.`post_type` IN ($in)";
519
+ } else {
520
+ // NO POST TYPES TO DELETE REVISIONS FOR... SKIP!
521
+ return $res_arr;
522
+ } // if($in != '')
523
 
524
  $older_than = $odb_class->odb_rvg_options['older_than'];
525
 
526
  $index = 0;
527
 
528
+ // LOOP THROUGH THE SITES (IF MULTI SITE)
529
  for($i=0; $i<count($odb_class->odb_ms_prefixes); $i++) {
530
 
531
  $sql = sprintf("
541
  $odb_class->odb_ms_prefixes[$i],
542
  $where,
543
  $older_than);
544
+
545
+ //echo 'OLDER: '.$sql.'<br>';
546
 
547
  $res = $wpdb->get_results($sql, ARRAY_A);
548
 
567
  global $odb_class, $wpdb;
568
 
569
  $res_arr = array();
570
+
571
+ // CUSTOM POST TYPES (from v4.4)
572
+ $rel_posttypes = $odb_class->odb_rvg_options['post_types'];
573
+ $in = '';
574
+ foreach ($rel_posttypes as $posttype => $value) {
575
+ if ($value == 'Y') {
576
+ if ($in != '') $in .= ',';
577
+ $in .= "'" . $posttype . "'";
578
+ } // if ($value == 'Y')
579
+ } // foreach($rel_posttypes as $posttypes)
580
+
581
  $where1 = '';
582
+ if($in != '') {
583
+ $where1 = " AND p2.`post_type` IN ($in)";
584
+ } else {
585
+ // NO POST TYPES TO DELETE REVISIONS FOR... SKIP!
586
+ return $res_arr;
587
+ } // if($in != '')
588
 
589
  // MAX NUMBER OF REVISIONS TO KEEP
590
  $max_revisions = $odb_class->odb_rvg_options['nr_of_revisions'];
617
  $where2,
618
  $max_revisions);
619
 
620
+ //echo 'KEEP: '.$sql.'<br>';
621
+
622
  $res = $wpdb->get_results($sql, ARRAY_A);
623
  for($j=0; $j<count($res); $j++) {
624
  if(isset($res[$j]) && !$this->odb_post_is_excluded($res[$j]['post_parent'])) {
classes/odb-displayer.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /************************************************************************************************
3
  *
4
- * DISPLAYER CLASS: DISPLAY CURRENT SETTINGS, BUTTONS, HEADERS
5
  *
6
  ************************************************************************************************/
7
  ?>
@@ -95,16 +95,18 @@ class ODB_Displayer {
95
  <br><br>
96
  ';
97
 
98
- if (!isset($odb_class->odb_rvg_options['rev_post_type'])) {
99
- $odb_class->odb_rvg_options['rev_post_type'] = '';
100
- }
101
-
102
- if ($odb_class->odb_rvg_options['rev_post_type'] == 'post')
103
- $rpt = __("POSTS only", $odb_class->odb_txt_domain);
104
- else if ($odb_class->odb_rvg_options['rev_post_type'] == 'page')
105
- $rpt = __("PAGES only", $odb_class->odb_txt_domain);
106
- else
107
- $rpt = __("POSTS and PAGES", $odb_class->odb_txt_domain);
 
 
108
  echo '<span class="odb-bold">'.__('Delete revisions of', $odb_class->odb_txt_domain).':</span> <span class="odb-bold odb-blue">'.$rpt.'</span><br />';
109
 
110
  if($odb_class->odb_rvg_options['delete_older'] == 'Y') {
1
  <?php
2
  /************************************************************************************************
3
  *
4
+ * DISPLAYER CLASS: DISPLAY HEADERS, CURRENT SETTINGS, BUTTONS
5
  *
6
  ************************************************************************************************/
7
  ?>
95
  <br><br>
96
  ';
97
 
98
+ // CUSTOM POST TYPES (from v4.4)
99
+ $rel_posttypes = $odb_class->odb_rvg_options['post_types'];
100
+ $rpt = '';
101
+ foreach ($rel_posttypes as $posttype => $value) {
102
+ if ($value == 'Y') {
103
+ if ($rpt != '') $rpt .= ', ';
104
+ $rpt .= strtoupper($posttype);
105
+ } // if ($value == 'Y')
106
+ } // foreach($rel_posttypes as $posttypes)
107
+
108
+ if ($rpt == '') $rpt = '(' . __('NONE', $odb_class->odb_txt_domain) . ')';
109
+
110
  echo '<span class="odb-bold">'.__('Delete revisions of', $odb_class->odb_txt_domain).':</span> <span class="odb-bold odb-blue">'.$rpt.'</span><br />';
111
 
112
  if($odb_class->odb_rvg_options['delete_older'] == 'Y') {
classes/odb-utilities.php CHANGED
@@ -14,6 +14,27 @@ class ODB_Utilities {
14
  } // __construct()
15
 
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  /********************************************************************************************
18
  * FORMAT SIZES FROM BYTES TO KB OR MB
19
  ********************************************************************************************/
14
  } // __construct()
15
 
16
 
17
+ /********************************************************************************************
18
+ * GET THE (FOR REVISIONS) RELEVANT POST TYPES, INCLUDING CUSTOM POST TYPES (from v4.4)
19
+ ********************************************************************************************/
20
+ function odb_get_relevant_post_types() {
21
+ $relevant_pts = array();
22
+ $posttypes = get_post_types();
23
+ foreach ($posttypes as $posttype) {
24
+ // SKIP THE DEFAULT POST TYPES (EXCEPT FOR 'post' AND 'page')
25
+ if ($posttype != 'attachment' &&
26
+ $posttype != 'revision' &&
27
+ $posttype != 'nav_menu_item' &&
28
+ $posttype != 'custom_css' &&
29
+ $posttype != 'customize_changeset') {
30
+ array_push($relevant_pts, $posttype);
31
+ }
32
+ } // foreach ($posttypes as $posttype)
33
+
34
+ return $relevant_pts;
35
+ } // odb_get_relevant_post_types()
36
+
37
+
38
  /********************************************************************************************
39
  * FORMAT SIZES FROM BYTES TO KB OR MB
40
  ********************************************************************************************/
includes/settings-page.php CHANGED
@@ -17,10 +17,19 @@ if (isset($_POST['info_update'])) {
17
  $current_date = substr($current_datetime, 0, 8);
18
  $current_hour = substr($current_datetime, 8, 2);
19
 
20
- // var_dump($_POST);
21
-
22
- if(isset($_POST['rvg_odb_rev_post_type'])) $this->odb_rvg_options['rev_post_type'] = sanitize_text_field($_POST['rvg_odb_rev_post_type']);
23
- else $this->odb_rvg_options['rev_post_type'] = '';
 
 
 
 
 
 
 
 
 
24
 
25
  if(isset($_POST['rvg_odb_delete_older'])) $this->odb_rvg_options['delete_older'] = sanitize_text_field($_POST['rvg_odb_delete_older']);
26
  else $this->odb_rvg_options['delete_older'] = 'N';
@@ -191,7 +200,7 @@ if($this->odb_rvg_options['rvg_revisions'] == "Y") {
191
  $cb_keep_revisions = '';
192
  $this->odb_rvg_options['nr_of_revisions'] = '';
193
  $cb_disabled2 = $d;
194
- }
195
 
196
  $cb_trash = ($this->odb_rvg_options['clear_trash'] == "Y") ? $c : '';
197
  $cb_spam = ($this->odb_rvg_options['clear_spam'] == "Y") ? $c : '';
@@ -218,23 +227,37 @@ echo '
218
  </div>
219
  <table border="0" cellspacing="2" cellpadding="5" class="editform" align="center">
220
  <tr>
221
- <td width="50%" align="right"><span class="odb-bold">'. __('Delete revisions of',$this->odb_txt_domain).'</span></td>
222
- <td width="50%" valign="top"><select name="rvg_odb_rev_post_type" id="rvg_odb_rev_post_type" class="odb-post-type-select">
223
- <option selected="selected" value="">
224
- '.__('POSTS and PAGES',$this->odb_txt_domain).'
225
- </option>
226
- <option value="post">
227
- '.__('POSTS only',$this->odb_txt_domain).'
228
- </option>
229
- <option value="page">
230
- '.__('PAGES only',$this->odb_txt_domain).'
231
- </option>
232
- </select>
233
- <script type="text/javascript">
234
- jQuery("#rvg_odb_rev_post_type").val("'.$this->odb_rvg_options['rev_post_type'].'");
235
- </script>
236
- </td>
237
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  <tr>
239
  <td width="50%" align="right"><span class="odb-bold">'. __('Delete revisions older than',$this->odb_txt_domain).'</span></td>
240
  <td width="50%" valign="top"><table border="0" cellspacing="0" cellpadding="3">
17
  $current_date = substr($current_datetime, 0, 8);
18
  $current_hour = substr($current_datetime, 8, 2);
19
 
20
+ // CUSTOM POST TYPES (from v4.4)
21
+ $updated_pts = array();
22
+ $rel_posttypes = $this->odb_utilities_obj->odb_get_relevant_post_types();
23
+ // LOOP THROUGH THE RELEVANT POST TYPES
24
+ foreach ($rel_posttypes as $posttype) {
25
+ if (isset($_POST['cb_cpt_' . $posttype])) {
26
+ $updated_pts[$posttype] = "Y";
27
+ } else {
28
+ $updated_pts[$posttype] = "N";
29
+ } // if (isset($_POST['cb_cpt_' . $posttype]))
30
+ } // foreach ($rel_posttypes as $posttype)
31
+ // UPDATE OPTIONS
32
+ $this->odb_rvg_options['post_types'] = $updated_pts;
33
 
34
  if(isset($_POST['rvg_odb_delete_older'])) $this->odb_rvg_options['delete_older'] = sanitize_text_field($_POST['rvg_odb_delete_older']);
35
  else $this->odb_rvg_options['delete_older'] = 'N';
200
  $cb_keep_revisions = '';
201
  $this->odb_rvg_options['nr_of_revisions'] = '';
202
  $cb_disabled2 = $d;
203
+ } // if($this->odb_rvg_options['rvg_revisions'] == "Y")
204
 
205
  $cb_trash = ($this->odb_rvg_options['clear_trash'] == "Y") ? $c : '';
206
  $cb_spam = ($this->odb_rvg_options['clear_spam'] == "Y") ? $c : '';
227
  </div>
228
  <table border="0" cellspacing="2" cellpadding="5" class="editform" align="center">
229
  <tr>
230
+
231
+ <td align="center" colspan="2"><span class="odb-bold">'. __('Delete revisions for the following (custom) post type(s):',$this->odb_txt_domain).'</span></td>
232
+ </tr>';
233
+
234
+ // CUSTOM POST TYPES (from v4.4)
235
+ $rel_posttypes = $this->odb_utilities_obj->odb_get_relevant_post_types();
236
+
237
+ // LOOP THROUGH THE RELEVANT POST TYPES
238
+ foreach ($rel_posttypes as $posttype) {
239
+
240
+ $cb_checked = ' checked';
241
+ if (isset($this->odb_rvg_options['post_types'][$posttype]) &&
242
+ $this->odb_rvg_options['post_types'][$posttype] == 'N') {
243
+ $cb_checked = '';
244
+ }
245
+
246
+ echo '
247
+ <tr>
248
+ <td width="50%" align="right"><span class="odb-bold">' . $posttype . '</span></td>
249
+ ';
250
+
251
+ echo '
252
+ <td width="50%" valign="top">
253
+ <span class="odb-bold">
254
+ <input name="cb_cpt_' . $posttype . '" id="cb_cpt_' . $posttype . '" type="checkbox" value="Y" ' . $cb_checked . ' /></span>
255
+ </td>
256
+ </tr>
257
+ ';
258
+ } // foreach ($rel_posttypes as $posttype)
259
+
260
+ echo '
261
  <tr>
262
  <td width="50%" align="right"><span class="odb-bold">'. __('Delete revisions older than',$this->odb_txt_domain).'</span></td>
263
  <td width="50%" valign="top"><table border="0" cellspacing="0" cellpadding="3">
language/rvg-optimize-database-nl_NL.mo CHANGED
Binary file
language/rvg-optimize-database-nl_NL.po CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Optimize Database after Deleting Revisions v4.3\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2017-08-10 16:30+0200\n"
6
- "PO-Revision-Date: 2017-08-10 16:33+0200\n"
7
  "Last-Translator: Rolf van Gelder <info@cagewebdev.com>\n"
8
  "Language-Team: CAGE <info@cagewebdev.com>\n"
9
  "Language: nl_NL\n"
@@ -200,27 +200,27 @@ msgstr "Optimalizatie duurde"
200
  msgid "seconds"
201
  msgstr "seconden"
202
 
203
- #: classes/odb-cleaner.php:487 classes/odb-displayer.php:159
204
  msgid "View Log File"
205
  msgstr "Bekijk Logbestand"
206
 
207
- #: classes/odb-cleaner.php:489 classes/odb-displayer.php:161
208
  msgid "Delete Log File"
209
  msgstr "Verwijder Logbestand"
210
 
211
- #: classes/odb-cleaner.php:687
212
  msgid "of"
213
  msgstr "van"
214
 
215
- #: classes/odb-cleaner.php:1152
216
  msgid "InnoDB table: skipped..."
217
  msgstr "InnoDB tabel overgeslagen..."
218
 
219
- #: classes/odb-cleaner.php:1157 classes/odb-cleaner.php:1159
220
  msgid "<span class=\"odb-optimized\">TABLE OPTIMIZED</span>"
221
  msgstr "<span class=\"odb-optimized\">TABEL GEOPTIMALISEERD</span>"
222
 
223
- #: classes/odb-cleaner.php:1158
224
  msgid "Table is already up to date"
225
  msgstr "Tabel is al optimaal"
226
 
@@ -267,11 +267,11 @@ msgstr "JA"
267
  msgid "NO"
268
  msgstr "NEE"
269
 
270
- #: classes/odb-displayer.php:64 includes/settings-page.php:297
271
  msgid "DELETE EXPIRED TRANSIENTS"
272
  msgstr "AANTAL VERWIJDERDE VERLOPEN TRANSIËNTS"
273
 
274
- #: classes/odb-displayer.php:66 includes/settings-page.php:300
275
  msgid "DELETE ALL TRANSIENTS"
276
  msgstr "VERWIJDER ALLE TRANSIENTS"
277
 
@@ -299,7 +299,7 @@ msgstr "WEKELIJKS"
299
  msgid "ONCE MONTHLY"
300
  msgstr "MAANDELIJKS"
301
 
302
- #: classes/odb-displayer.php:88 includes/settings-page.php:331
303
  msgid "NOT SCHEDULED"
304
  msgstr "NIET GEPLAND"
305
 
@@ -307,99 +307,91 @@ msgstr "NIET GEPLAND"
307
  msgid "Current settings"
308
  msgstr "Huidige instellingen"
309
 
310
- #: classes/odb-displayer.php:99 includes/settings-page.php:227
311
- msgid "POSTS only"
312
- msgstr "BERICHTEN alleen"
313
 
314
- #: classes/odb-displayer.php:101 includes/settings-page.php:230
315
- msgid "PAGES only"
316
- msgstr "PAGINA'S alleen"
317
-
318
- #: classes/odb-displayer.php:103 includes/settings-page.php:224
319
- msgid "POSTS and PAGES"
320
- msgstr "BERICHTEN en PAGINA'S"
321
-
322
- #: classes/odb-displayer.php:104 includes/settings-page.php:221
323
  msgid "Delete revisions of"
324
  msgstr "Verwijder revisies van"
325
 
326
- #: classes/odb-displayer.php:107 includes/settings-page.php:143
327
- #: includes/settings-page.php:239
328
  msgid "Delete revisions older than"
329
  msgstr "Verwijder revisies ouder dan"
330
 
331
- #: classes/odb-displayer.php:107
332
  msgid "days"
333
  msgstr "dagen"
334
 
335
- #: classes/odb-displayer.php:111
336
  msgid "Maximum number of - most recent - revisions to keep per post / page"
337
  msgstr ""
338
  "Maximaal aantal (meest recente) revisies die bewaard worden per bericht / "
339
  "pagina"
340
 
341
- #: classes/odb-displayer.php:115 includes/settings-page.php:272
342
  msgid "Delete trashed items"
343
  msgstr "Verwijder trashed items"
344
 
345
- #: classes/odb-displayer.php:116 includes/settings-page.php:278
346
  msgid "Delete spammed items"
347
  msgstr "Verwijder spammed items"
348
 
349
- #: classes/odb-displayer.php:117 includes/settings-page.php:284
350
  msgid "Delete unused tags"
351
  msgstr "Verwijder ongebruikte tags"
352
 
353
- #: classes/odb-displayer.php:118 includes/settings-page.php:290
354
  msgid "Delete transients"
355
  msgstr "Verwijder transiënts"
356
 
357
- #: classes/odb-displayer.php:119 includes/settings-page.php:309
358
  msgid "Delete pingbacks and trackbacks"
359
  msgstr "Verwijder pingback en trackbacks"
360
 
361
- #: classes/odb-displayer.php:120 includes/settings-page.php:321
362
  msgid "Keep a log"
363
  msgstr "Gebruik een logbestand"
364
 
365
- #: classes/odb-displayer.php:121
366
  msgid "Optimize InnoDB tables"
367
  msgstr "Optimaliseer InnoDB tabellen"
368
 
369
- #: classes/odb-displayer.php:122
370
  msgid "Last run"
371
  msgstr "Laatste uitvoering"
372
 
373
- #: classes/odb-displayer.php:122 classes/odb-displayer.php:131
374
- #: includes/settings-page.php:365
375
  msgid "hrs"
376
  msgstr "uur"
377
 
378
- #: classes/odb-displayer.php:123
379
  msgid "Number of excluded tables"
380
  msgstr "Aantal uitgesloten tabellen"
381
 
382
- #: classes/odb-displayer.php:124 includes/settings-page.php:327
383
  msgid "Scheduler"
384
  msgstr "Planner"
385
 
386
- #: classes/odb-displayer.php:131
387
  msgid "Next scheduled run"
388
  msgstr "Volgende geplande uitvoering"
389
 
390
- #: classes/odb-displayer.php:131
391
  msgid "current server time"
392
  msgstr "huidige systeemtijd"
393
 
394
- #: classes/odb-displayer.php:136
395
  msgid "Total savings since the first run"
396
  msgstr "Totale besparing sinds de eerste uitvoering"
397
 
398
- #: classes/odb-displayer.php:152
399
  msgid "Change Settings"
400
  msgstr "Wijzig instellingen"
401
 
402
- #: classes/odb-displayer.php:168
403
  msgid "Start Optimization"
404
  msgstr "Start Optimalisatie"
405
 
@@ -474,11 +466,11 @@ msgstr "Maandelijks"
474
  msgid "Every Five Minutes"
475
  msgstr "Iedere vijf minuten"
476
 
477
- #: includes/settings-page.php:106
478
  msgid "Optimize Database after Deleting Revisions SETTINGS UPDATED"
479
  msgstr "Optimize Database after Deleting Revisions INSTELLINGEN AANGEPAST"
480
 
481
- #: includes/settings-page.php:108
482
  msgid ""
483
  "Click <a href=\"tools.php?page=rvg-optimize-database\" class=\"odb-bold"
484
  "\">HERE</a> to run the optimization"
@@ -486,92 +478,96 @@ msgstr ""
486
  "Klik <a href=\"tools.php?page=rvg-optimize-database\" class=\"odb-bold"
487
  "\">HIER</a> om de optimalisatie te starten"
488
 
489
- #: includes/settings-page.php:143
490
  msgid "You have to enter: "
491
  msgstr "Je moet invullen:"
492
 
493
- #: includes/settings-page.php:148
494
  msgid "<Delete revisions older than> should be a number"
495
  msgstr "<Verwijder revisites ouder dan> moet een getal zijn"
496
 
497
- #: includes/settings-page.php:156
498
  msgid "You have to enter the <Maximum number of revisions>"
499
  msgstr "Je moet het <Maximaal aantal revisies> invullen"
500
 
501
- #: includes/settings-page.php:161
502
  msgid "<Maximum number of revisions> should be a number"
503
  msgstr "<Maximaal aantal revisies> moet een getal zijn"
504
 
505
- #: includes/settings-page.php:217 rvg-optimize-database.php:389
506
  msgid "Settings"
507
  msgstr "Instellingen"
508
 
509
- #: includes/settings-page.php:244
 
 
 
 
510
  msgid "day(s)"
511
  msgstr "dag(en)"
512
 
513
- #: includes/settings-page.php:256
514
  msgid "Maximum number of - most recent - revisions<br>to keep per post / page"
515
  msgstr ""
516
  "Maximaal aantal - meest recente - revisies<br>om te bewaren per post/pagina"
517
 
518
- #: includes/settings-page.php:262
519
  msgid "('0' means: delete <u>ALL</u> revisions)"
520
  msgstr "('0' betekent: verwijder <u>ALLE</u> revisies)"
521
 
522
- #: includes/settings-page.php:294
523
  msgid "DO NOT DELETE TRANSIENTS"
524
  msgstr "GEEN TRANSIENTS VERWIJDEREN"
525
 
526
- #: includes/settings-page.php:315
527
  msgid "Optimize InnoDB tables too"
528
  msgstr "Optimiliseer ook InnoDB tabellen"
529
 
530
- #: includes/settings-page.php:334
531
  msgid "run optimization HOURLY"
532
  msgstr "voer de optimalisatie ELK UUR uit"
533
 
534
- #: includes/settings-page.php:337
535
  msgid "run optimization TWICE A DAY"
536
  msgstr "voer de optimalisatie TWEE KEER PER DAG uit"
537
 
538
- #: includes/settings-page.php:340
539
  msgid "run optimization DAILY"
540
  msgstr "voer de optimalisatie DAGELIJKS uit"
541
 
542
- #: includes/settings-page.php:343
543
  msgid "run optimization WEEKLY"
544
  msgstr "voer de optimalisatie WEKELIJKS uit"
545
 
546
- #: includes/settings-page.php:346
547
  msgid "run optimization MONTHLY"
548
  msgstr "voer de optimalisatie MAANDELIJKS uit"
549
 
550
- #: includes/settings-page.php:356
551
  msgid "Time"
552
  msgstr "Tijd"
553
 
554
- #: includes/settings-page.php:380
555
  msgid "Show '1-click' link in Admin Bar"
556
  msgstr "Toon de '1-klik' link in de Admin Balk"
557
 
558
- #: includes/settings-page.php:386
559
  msgid "Show an icon in the Admin Menu"
560
  msgstr "Toon een icon in het Admin Menu"
561
 
562
- #: includes/settings-page.php:391
563
  msgid "change will be visible after loading the next page"
564
  msgstr "wijziging wordt pas zichtbaar na het laden van de volgende pagina"
565
 
566
- #: includes/settings-page.php:396 includes/settings-page.php:442
567
  msgid "Save Settings"
568
  msgstr "Bewaar instellingen"
569
 
570
- #: includes/settings-page.php:398 includes/settings-page.php:444
571
  msgid "Go To Optimizer"
572
  msgstr "Ga naar Optimalisatie"
573
 
574
- #: includes/settings-page.php:405
575
  msgid ""
576
  "EXCLUDE DATABASE TABLES FROM OPTIMIZATION:<br><span class=\"odb-underline-red"
577
  "\">CHECKED</span> TABLES <span class=\"odb-underline-red\">WON'T</span> BE "
@@ -581,35 +577,44 @@ msgstr ""
581
  "underline-red\">AANGEVINKTE</span> TABELLEN ZULLEN <span class=\"odb-"
582
  "underline-red\">NIET</span> GEOPTIMALISEERD WORDEN!</span>"
583
 
584
- #: includes/settings-page.php:411
585
  msgid "check all tables"
586
  msgstr "vink alle tabellen aan"
587
 
588
- #: includes/settings-page.php:413
589
  msgid "uncheck all tables"
590
  msgstr "vink alle tabellen uit"
591
 
592
- #: includes/settings-page.php:415
593
  msgid "check all NON-WordPress tables"
594
  msgstr "vink alle NIET-WordPress tabellen aan"
595
 
596
  # @ rvg-optimize-database
597
- #: rvg-optimize-database.php:361 rvg-optimize-database.php:362
598
- #: rvg-optimize-database.php:376 rvg-optimize-database.php:377
599
- #: rvg-optimize-database.php:417 rvg-optimize-database.php:418
600
- #: rvg-optimize-database.php:435 rvg-optimize-database.php:436
601
  msgid "Optimize Database"
602
  msgstr "Optimaliseer Database"
603
 
604
  # @ optimize_db
605
- #: rvg-optimize-database.php:406
606
  msgid "Optimize DB (1 click)"
607
  msgstr "Optimaliseer DB (1 klik)"
608
 
609
- #: rvg-optimize-database.php:533
610
  msgid "Optimize Database after Deleting Revisions LOG FILE HAS BEEN DELETED"
611
  msgstr "Optimize Database after Deleting Revisions LOGBESTAND VERWIJDERD"
612
 
 
 
 
 
 
 
 
 
 
613
  #~ msgid "You have to enter the maximum number of revisions"
614
  #~ msgstr "Je moet een maximaal aantal revisies invullen"
615
 
2
  msgstr ""
3
  "Project-Id-Version: Optimize Database after Deleting Revisions v4.3\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2017-08-22 15:08+0200\n"
6
+ "PO-Revision-Date: 2017-08-22 15:10+0200\n"
7
  "Last-Translator: Rolf van Gelder <info@cagewebdev.com>\n"
8
  "Language-Team: CAGE <info@cagewebdev.com>\n"
9
  "Language: nl_NL\n"
200
  msgid "seconds"
201
  msgstr "seconden"
202
 
203
+ #: classes/odb-cleaner.php:487 classes/odb-displayer.php:165
204
  msgid "View Log File"
205
  msgstr "Bekijk Logbestand"
206
 
207
+ #: classes/odb-cleaner.php:489 classes/odb-displayer.php:167
208
  msgid "Delete Log File"
209
  msgstr "Verwijder Logbestand"
210
 
211
+ #: classes/odb-cleaner.php:720
212
  msgid "of"
213
  msgstr "van"
214
 
215
+ #: classes/odb-cleaner.php:1185
216
  msgid "InnoDB table: skipped..."
217
  msgstr "InnoDB tabel overgeslagen..."
218
 
219
+ #: classes/odb-cleaner.php:1190 classes/odb-cleaner.php:1192
220
  msgid "<span class=\"odb-optimized\">TABLE OPTIMIZED</span>"
221
  msgstr "<span class=\"odb-optimized\">TABEL GEOPTIMALISEERD</span>"
222
 
223
+ #: classes/odb-cleaner.php:1191
224
  msgid "Table is already up to date"
225
  msgstr "Tabel is al optimaal"
226
 
267
  msgid "NO"
268
  msgstr "NEE"
269
 
270
+ #: classes/odb-displayer.php:64 includes/settings-page.php:320
271
  msgid "DELETE EXPIRED TRANSIENTS"
272
  msgstr "AANTAL VERWIJDERDE VERLOPEN TRANSIËNTS"
273
 
274
+ #: classes/odb-displayer.php:66 includes/settings-page.php:323
275
  msgid "DELETE ALL TRANSIENTS"
276
  msgstr "VERWIJDER ALLE TRANSIENTS"
277
 
299
  msgid "ONCE MONTHLY"
300
  msgstr "MAANDELIJKS"
301
 
302
+ #: classes/odb-displayer.php:88 includes/settings-page.php:354
303
  msgid "NOT SCHEDULED"
304
  msgstr "NIET GEPLAND"
305
 
307
  msgid "Current settings"
308
  msgstr "Huidige instellingen"
309
 
310
+ #: classes/odb-displayer.php:108
311
+ msgid "NONE"
312
+ msgstr "GEEN"
313
 
314
+ #: classes/odb-displayer.php:110
 
 
 
 
 
 
 
 
315
  msgid "Delete revisions of"
316
  msgstr "Verwijder revisies van"
317
 
318
+ #: classes/odb-displayer.php:113 includes/settings-page.php:152
319
+ #: includes/settings-page.php:262
320
  msgid "Delete revisions older than"
321
  msgstr "Verwijder revisies ouder dan"
322
 
323
+ #: classes/odb-displayer.php:113
324
  msgid "days"
325
  msgstr "dagen"
326
 
327
+ #: classes/odb-displayer.php:117
328
  msgid "Maximum number of - most recent - revisions to keep per post / page"
329
  msgstr ""
330
  "Maximaal aantal (meest recente) revisies die bewaard worden per bericht / "
331
  "pagina"
332
 
333
+ #: classes/odb-displayer.php:121 includes/settings-page.php:295
334
  msgid "Delete trashed items"
335
  msgstr "Verwijder trashed items"
336
 
337
+ #: classes/odb-displayer.php:122 includes/settings-page.php:301
338
  msgid "Delete spammed items"
339
  msgstr "Verwijder spammed items"
340
 
341
+ #: classes/odb-displayer.php:123 includes/settings-page.php:307
342
  msgid "Delete unused tags"
343
  msgstr "Verwijder ongebruikte tags"
344
 
345
+ #: classes/odb-displayer.php:124 includes/settings-page.php:313
346
  msgid "Delete transients"
347
  msgstr "Verwijder transiënts"
348
 
349
+ #: classes/odb-displayer.php:125 includes/settings-page.php:332
350
  msgid "Delete pingbacks and trackbacks"
351
  msgstr "Verwijder pingback en trackbacks"
352
 
353
+ #: classes/odb-displayer.php:126 includes/settings-page.php:344
354
  msgid "Keep a log"
355
  msgstr "Gebruik een logbestand"
356
 
357
+ #: classes/odb-displayer.php:127
358
  msgid "Optimize InnoDB tables"
359
  msgstr "Optimaliseer InnoDB tabellen"
360
 
361
+ #: classes/odb-displayer.php:128
362
  msgid "Last run"
363
  msgstr "Laatste uitvoering"
364
 
365
+ #: classes/odb-displayer.php:128 classes/odb-displayer.php:137
366
+ #: includes/settings-page.php:388
367
  msgid "hrs"
368
  msgstr "uur"
369
 
370
+ #: classes/odb-displayer.php:129
371
  msgid "Number of excluded tables"
372
  msgstr "Aantal uitgesloten tabellen"
373
 
374
+ #: classes/odb-displayer.php:130 includes/settings-page.php:350
375
  msgid "Scheduler"
376
  msgstr "Planner"
377
 
378
+ #: classes/odb-displayer.php:137
379
  msgid "Next scheduled run"
380
  msgstr "Volgende geplande uitvoering"
381
 
382
+ #: classes/odb-displayer.php:137
383
  msgid "current server time"
384
  msgstr "huidige systeemtijd"
385
 
386
+ #: classes/odb-displayer.php:142
387
  msgid "Total savings since the first run"
388
  msgstr "Totale besparing sinds de eerste uitvoering"
389
 
390
+ #: classes/odb-displayer.php:158
391
  msgid "Change Settings"
392
  msgstr "Wijzig instellingen"
393
 
394
+ #: classes/odb-displayer.php:174
395
  msgid "Start Optimization"
396
  msgstr "Start Optimalisatie"
397
 
466
  msgid "Every Five Minutes"
467
  msgstr "Iedere vijf minuten"
468
 
469
+ #: includes/settings-page.php:115
470
  msgid "Optimize Database after Deleting Revisions SETTINGS UPDATED"
471
  msgstr "Optimize Database after Deleting Revisions INSTELLINGEN AANGEPAST"
472
 
473
+ #: includes/settings-page.php:117
474
  msgid ""
475
  "Click <a href=\"tools.php?page=rvg-optimize-database\" class=\"odb-bold"
476
  "\">HERE</a> to run the optimization"
478
  "Klik <a href=\"tools.php?page=rvg-optimize-database\" class=\"odb-bold"
479
  "\">HIER</a> om de optimalisatie te starten"
480
 
481
+ #: includes/settings-page.php:152
482
  msgid "You have to enter: "
483
  msgstr "Je moet invullen:"
484
 
485
+ #: includes/settings-page.php:157
486
  msgid "<Delete revisions older than> should be a number"
487
  msgstr "<Verwijder revisites ouder dan> moet een getal zijn"
488
 
489
+ #: includes/settings-page.php:165
490
  msgid "You have to enter the <Maximum number of revisions>"
491
  msgstr "Je moet het <Maximaal aantal revisies> invullen"
492
 
493
+ #: includes/settings-page.php:170
494
  msgid "<Maximum number of revisions> should be a number"
495
  msgstr "<Maximaal aantal revisies> moet een getal zijn"
496
 
497
+ #: includes/settings-page.php:226 rvg-optimize-database.php:411
498
  msgid "Settings"
499
  msgstr "Instellingen"
500
 
501
+ #: includes/settings-page.php:231
502
+ msgid "Delete revisions for the following (custom) post type(s):"
503
+ msgstr "Verwijder revisies voor de volgende (custom) post type(s):"
504
+
505
+ #: includes/settings-page.php:267
506
  msgid "day(s)"
507
  msgstr "dag(en)"
508
 
509
+ #: includes/settings-page.php:279
510
  msgid "Maximum number of - most recent - revisions<br>to keep per post / page"
511
  msgstr ""
512
  "Maximaal aantal - meest recente - revisies<br>om te bewaren per post/pagina"
513
 
514
+ #: includes/settings-page.php:285
515
  msgid "('0' means: delete <u>ALL</u> revisions)"
516
  msgstr "('0' betekent: verwijder <u>ALLE</u> revisies)"
517
 
518
+ #: includes/settings-page.php:317
519
  msgid "DO NOT DELETE TRANSIENTS"
520
  msgstr "GEEN TRANSIENTS VERWIJDEREN"
521
 
522
+ #: includes/settings-page.php:338
523
  msgid "Optimize InnoDB tables too"
524
  msgstr "Optimiliseer ook InnoDB tabellen"
525
 
526
+ #: includes/settings-page.php:357
527
  msgid "run optimization HOURLY"
528
  msgstr "voer de optimalisatie ELK UUR uit"
529
 
530
+ #: includes/settings-page.php:360
531
  msgid "run optimization TWICE A DAY"
532
  msgstr "voer de optimalisatie TWEE KEER PER DAG uit"
533
 
534
+ #: includes/settings-page.php:363
535
  msgid "run optimization DAILY"
536
  msgstr "voer de optimalisatie DAGELIJKS uit"
537
 
538
+ #: includes/settings-page.php:366
539
  msgid "run optimization WEEKLY"
540
  msgstr "voer de optimalisatie WEKELIJKS uit"
541
 
542
+ #: includes/settings-page.php:369
543
  msgid "run optimization MONTHLY"
544
  msgstr "voer de optimalisatie MAANDELIJKS uit"
545
 
546
+ #: includes/settings-page.php:379
547
  msgid "Time"
548
  msgstr "Tijd"
549
 
550
+ #: includes/settings-page.php:403
551
  msgid "Show '1-click' link in Admin Bar"
552
  msgstr "Toon de '1-klik' link in de Admin Balk"
553
 
554
+ #: includes/settings-page.php:409
555
  msgid "Show an icon in the Admin Menu"
556
  msgstr "Toon een icon in het Admin Menu"
557
 
558
+ #: includes/settings-page.php:414
559
  msgid "change will be visible after loading the next page"
560
  msgstr "wijziging wordt pas zichtbaar na het laden van de volgende pagina"
561
 
562
+ #: includes/settings-page.php:419 includes/settings-page.php:465
563
  msgid "Save Settings"
564
  msgstr "Bewaar instellingen"
565
 
566
+ #: includes/settings-page.php:421 includes/settings-page.php:467
567
  msgid "Go To Optimizer"
568
  msgstr "Ga naar Optimalisatie"
569
 
570
+ #: includes/settings-page.php:428
571
  msgid ""
572
  "EXCLUDE DATABASE TABLES FROM OPTIMIZATION:<br><span class=\"odb-underline-red"
573
  "\">CHECKED</span> TABLES <span class=\"odb-underline-red\">WON'T</span> BE "
577
  "underline-red\">AANGEVINKTE</span> TABELLEN ZULLEN <span class=\"odb-"
578
  "underline-red\">NIET</span> GEOPTIMALISEERD WORDEN!</span>"
579
 
580
+ #: includes/settings-page.php:434
581
  msgid "check all tables"
582
  msgstr "vink alle tabellen aan"
583
 
584
+ #: includes/settings-page.php:436
585
  msgid "uncheck all tables"
586
  msgstr "vink alle tabellen uit"
587
 
588
+ #: includes/settings-page.php:438
589
  msgid "check all NON-WordPress tables"
590
  msgstr "vink alle NIET-WordPress tabellen aan"
591
 
592
  # @ rvg-optimize-database
593
+ #: rvg-optimize-database.php:383 rvg-optimize-database.php:384
594
+ #: rvg-optimize-database.php:398 rvg-optimize-database.php:399
595
+ #: rvg-optimize-database.php:439 rvg-optimize-database.php:440
596
+ #: rvg-optimize-database.php:457 rvg-optimize-database.php:458
597
  msgid "Optimize Database"
598
  msgstr "Optimaliseer Database"
599
 
600
  # @ optimize_db
601
+ #: rvg-optimize-database.php:428
602
  msgid "Optimize DB (1 click)"
603
  msgstr "Optimaliseer DB (1 klik)"
604
 
605
+ #: rvg-optimize-database.php:555
606
  msgid "Optimize Database after Deleting Revisions LOG FILE HAS BEEN DELETED"
607
  msgstr "Optimize Database after Deleting Revisions LOGBESTAND VERWIJDERD"
608
 
609
+ #~ msgid "POSTS only"
610
+ #~ msgstr "BERICHTEN alleen"
611
+
612
+ #~ msgid "PAGES only"
613
+ #~ msgstr "PAGINA'S alleen"
614
+
615
+ #~ msgid "POSTS and PAGES"
616
+ #~ msgstr "BERICHTEN en PAGINA'S"
617
+
618
  #~ msgid "You have to enter the maximum number of revisions"
619
  #~ msgstr "Je moet een maximaal aantal revisies invullen"
620
 
readme.txt CHANGED
@@ -3,13 +3,13 @@ Contributors: CAGE Web Design | Rolf van Gelder
3
  Donate link: http://cagewebdev.com/donations-odb/
4
  Plugin Name: Optimize Database after Deleting Revisions
5
  Plugin URI: http://cagewebdev.com/optimize-database-after-deleting-revisions-wordpress-plugin
6
- Tags: database, delete, revisions, optimize, post, posts, page, pages, clean, clean up, trash, spam, trashed, spammed, database size, scheduler, transients, unused tags, pingback, trackback, unix cron tab, crontab, multisite
7
  Author URI: http://cagewebdev.com
8
  Author: CAGE Web Design | Rolf van Gelder, Eindhoven, The Netherlands
9
  Requires at least: 2.8
10
  Tested up to: 4.8.1
11
- Stable tag: 4.3.2
12
- Version: 4.3.2
13
  License: GPLv2 or later
14
 
15
  == Description ==
@@ -17,7 +17,7 @@ License: GPLv2 or later
17
  This plugin is a 'One Click' WordPress Database Cleaner / Optimizer.
18
 
19
  = Main Features =
20
- * Deletes redundant revisions of posts and pages (you optionally can keep an 'x'-amount of the most recent revisions)
21
  * Deletes trashed posts, pages and comments (optional)
22
  * Deletes spammed comments (optional)
23
  * Deletes unused tags (optional)
@@ -102,8 +102,11 @@ http://cagewebdev.com/wordpress-plugins/
102
  * If you run the plugin from any of the sites, it will cleanup ALL the sites in the network!
103
 
104
  == Changelog ==
 
 
 
105
  = 4.3.2 [08/12/2017] =
106
- * CHANGE: fixed some (innocent) PHP warnings
107
 
108
  = 4.3.1 [08/10/2017] =
109
  * NEW: New option for deleting ALL transients (not the expired ones only)
@@ -119,7 +122,7 @@ http://cagewebdev.com/wordpress-plugins/
119
  * NEW: Indonesian (id_ID) translation added
120
 
121
  = 4.2.1 [09/23/2016] =
122
- * CHANGE: fixed some (innocent) warnings
123
 
124
  = 4.2.0 [09/16/2016] =
125
  * NEW: Added a 'monthly' schedule to the scheduler
@@ -446,3 +449,9 @@ InnoDB focuses on speed optimization and sometimes it means the database can gro
446
 
447
  = I scheduled the optimization for 8pm but it runs at 6pm (my local time) =
448
  * The scheduler uses the local time of the web server which can differ from your own local time
 
 
 
 
 
 
3
  Donate link: http://cagewebdev.com/donations-odb/
4
  Plugin Name: Optimize Database after Deleting Revisions
5
  Plugin URI: http://cagewebdev.com/optimize-database-after-deleting-revisions-wordpress-plugin
6
+ Tags: database, delete, revisions, optimize, post, posts, page, pages, clean, clean up, trash, spam, trashed, spammed, database size, scheduler, transients, unused tags, pingback, trackback, unix cron tab, crontab, multisite, custom post types
7
  Author URI: http://cagewebdev.com
8
  Author: CAGE Web Design | Rolf van Gelder, Eindhoven, The Netherlands
9
  Requires at least: 2.8
10
  Tested up to: 4.8.1
11
+ Stable tag: 4.4
12
+ Version: 4.4
13
  License: GPLv2 or later
14
 
15
  == Description ==
17
  This plugin is a 'One Click' WordPress Database Cleaner / Optimizer.
18
 
19
  = Main Features =
20
+ * Deletes revisions of posts, pages and / or custom post types (you optionally can keep an 'x'-amount of the most recent revisions and you can choose to delete revisions older than...)
21
  * Deletes trashed posts, pages and comments (optional)
22
  * Deletes spammed comments (optional)
23
  * Deletes unused tags (optional)
102
  * If you run the plugin from any of the sites, it will cleanup ALL the sites in the network!
103
 
104
  == Changelog ==
105
+ = 4.4 [08/22/2017] =
106
+ * NEW: New options to delete revisions of posts, pages and / or specific custom post types
107
+
108
  = 4.3.2 [08/12/2017] =
109
+ * CHANGE: Fixed some (innocent) PHP warnings
110
 
111
  = 4.3.1 [08/10/2017] =
112
  * NEW: New option for deleting ALL transients (not the expired ones only)
122
  * NEW: Indonesian (id_ID) translation added
123
 
124
  = 4.2.1 [09/23/2016] =
125
+ * CHANGE: Fixed some (innocent) warnings
126
 
127
  = 4.2.0 [09/16/2016] =
128
  * NEW: Added a 'monthly' schedule to the scheduler
449
 
450
  = I scheduled the optimization for 8pm but it runs at 6pm (my local time) =
451
  * The scheduler uses the local time of the web server which can differ from your own local time
452
+
453
+ = The plugin is visible in Main Site Tools but not in my subsites =
454
+ * Multisite Support
455
+ – Install the plugin as Network Administrator (Network Admin » Plugins)
456
+ – ‘Network Activate’ the plugin
457
+ – You only can configure and run the plugin on the main network site, but it will optimize ALL the sub-sites too!
rvg-optimize-database.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package Optimize Database after Deleting Revisions
4
- * @version 4.3.2
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: 4.3.2
14
  */
15
 
16
  /********************************************************************************************
@@ -24,8 +24,8 @@ $odb_class = new OptimizeDatabase();
24
 
25
  class OptimizeDatabase {
26
  // VERSION
27
- var $odb_version = '4.3.2';
28
- var $odb_release_date = '08/12/2017';
29
 
30
  // PLUGIN OPTIONS
31
  var $odb_rvg_options = array();
@@ -201,6 +201,28 @@ class OptimizeDatabase {
201
  $this->odb_rvg_options['total_savings'] = (int)0;
202
  if(!isset($this->odb_rvg_options['version']))
203
  $this->odb_rvg_options['version'] = $this->odb_version;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
 
205
  // UPDATE OPTIONS
206
  $this->odb_multisite_obj->odb_ms_update_option('odb_rvg_options', $this->odb_rvg_options);
1
  <?php
2
  /**
3
  * @package Optimize Database after Deleting Revisions
4
+ * @version 4.4
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: 4.4
14
  */
15
 
16
  /********************************************************************************************
24
 
25
  class OptimizeDatabase {
26
  // VERSION
27
+ var $odb_version = '4.4';
28
+ var $odb_release_date = '08/22/2017';
29
 
30
  // PLUGIN OPTIONS
31
  var $odb_rvg_options = array();
201
  $this->odb_rvg_options['total_savings'] = (int)0;
202
  if(!isset($this->odb_rvg_options['version']))
203
  $this->odb_rvg_options['version'] = $this->odb_version;
204
+
205
+ // CUSTOM POST TYPES (from v4.4)
206
+ if(!isset($this->odb_rvg_options['post_types'])) {
207
+ $this->odb_rvg_options['post_types'] = array();
208
+ $relevant_pts = $this->odb_utilities_obj->odb_get_relevant_post_types();
209
+ // (CUSTOM) POST TYPES ARE PER DEFAULT ENABLED
210
+ foreach($relevant_pts as $posttype) {
211
+ $this->odb_rvg_options['post_types'][$posttype] = "Y";
212
+ } // foreach($relevant_pts as $posttype)
213
+
214
+ if (isset($this->odb_rvg_options['rev_post_type'])) {
215
+ // UPGRADE FROM A VERSION < 4.4
216
+ if ($this->odb_rvg_options['rev_post_type'] == 'page') {
217
+ // PAGES ONLY: DISABLE 'post'
218
+ $this->odb_rvg_options['post_types']['post'] = "N";
219
+ } else if ($this->odb_rvg_options['rev_post_type'] == 'post') {
220
+ // POSTS ONLY: DISABLE 'page'
221
+ $this->odb_rvg_options['post_types']['page'] = "N";
222
+ }
223
+ unset($this->odb_rvg_options['rev_post_type']);
224
+ } // if (isset($this->odb_rvg_options['rev_post_type']))
225
+ } // if(!isset($this->odb_rvg_options['post_types']))
226
 
227
  // UPDATE OPTIONS
228
  $this->odb_multisite_obj->odb_ms_update_option('odb_rvg_options', $this->odb_rvg_options);