| @@ -5,56 +5,83 @@ | ||
| 5 | 5 | * |
| 6 | 6 | ********************************************************************************************/ |
| 7 | 7 | ?> |
| 8 | 8 | <?php |
| 9 | -if(isset($_REQUEST['delete_log'])) | |
| 10 | - if($_REQUEST['delete_log'] == "Y") @unlink(dirname(__FILE__).'/rvg-optimize-db-log.html'); | |
| 9 | +if (isset($_POST['info_update'])) { | |
| 10 | + // SAVE SETTINGS | |
| 11 | + check_admin_referer('odb_action', 'odb_nonce'); | |
| 11 | 12 | |
| 12 | -if (isset($_POST['info_update'])) | |
| 13 | -{ // SAVE SETTINGS | |
| 14 | - check_admin_referer('odb_action', 'odb_nonce'); | |
| 15 | - | |
| 16 | 13 | $current_datetime = Date('YmdHis'); |
| 17 | 14 | $current_date = substr($current_datetime, 0, 8); |
| 18 | 15 | $current_hour = substr($current_datetime, 8, 2); |
| 19 | 16 | |
| 20 | - if(isset($_POST['rvg_odb_number'])) | |
| 21 | - { if(!$_POST['rvg_odb_number']) $this->odb_rvg_options['nr_of_revisions'] = '0'; | |
| 22 | - else $this->odb_rvg_options['nr_of_revisions'] = trim($_POST['rvg_odb_number']); | |
| 23 | - } | |
| 17 | + // CUSTOM POST TYPES (from v4.4) | |
| 18 | + $updated_pts = array(); | |
| 19 | + $rel_posttypes = $this->odb_utilities_obj->odb_get_relevant_post_types(); | |
| 20 | + // LOOP THROUGH THE RELEVANT POST TYPES | |
| 21 | + foreach ($rel_posttypes as $posttype) { | |
| 22 | + if (isset($_POST['rvg_cb_cpt_' . $posttype])) { | |
| 23 | + $updated_pts[$posttype] = "Y"; | |
| 24 | + } else { | |
| 25 | + $updated_pts[$posttype] = "N"; | |
| 26 | + } // if (isset($_POST['rvg_cb_cpt_' . $posttype])) | |
| 27 | + } // foreach ($rel_posttypes as $posttype) | |
| 28 | + // UPDATE OPTIONS | |
| 29 | + $this->odb_rvg_options['post_types'] = $updated_pts; | |
| 24 | 30 | |
| 25 | - if(isset($_POST['rvg_clear_trash'])) $this->odb_rvg_options['clear_trash'] = $_POST['rvg_clear_trash']; | |
| 31 | + if(isset($_POST['rvg_odb_delete_older'])) $this->odb_rvg_options['delete_older'] = sanitize_text_field($_POST['rvg_odb_delete_older']); | |
| 32 | + else $this->odb_rvg_options['delete_older'] = 'N'; | |
| 33 | + | |
| 34 | + if(isset($_POST['rvg_odb_older_than'])) $this->odb_rvg_options['older_than'] = sanitize_text_field($_POST['rvg_odb_older_than']); | |
| 35 | + else $this->odb_rvg_options['older_than'] = ''; | |
| 36 | + | |
| 37 | + if(isset($_POST['rvg_odb_keep_revisions'])) | |
| 38 | + $this->odb_rvg_options['rvg_revisions'] = sanitize_text_field($_POST['rvg_odb_keep_revisions']); | |
| 39 | + else | |
| 40 | + $this->odb_rvg_options['rvg_revisions'] = 'N'; | |
| 41 | + | |
| 42 | + if(isset($_POST['rvg_odb_number'])) $this->odb_rvg_options['nr_of_revisions'] = sanitize_text_field($_POST['rvg_odb_number']); | |
| 43 | + else $this->odb_rvg_options['nr_of_revisions'] = ''; | |
| 44 | + | |
| 45 | + if(isset($_POST['rvg_clear_trash'])) $this->odb_rvg_options['clear_trash'] = sanitize_text_field($_POST['rvg_clear_trash']); | |
| 26 | 46 | else $this->odb_rvg_options['clear_trash'] = 'N'; |
| 27 | 47 | |
| 28 | - if(isset($_POST['rvg_clear_spam'])) $this->odb_rvg_options['clear_spam'] = $_POST['rvg_clear_spam']; | |
| 48 | + if(isset($_POST['rvg_clear_spam'])) $this->odb_rvg_options['clear_spam'] = sanitize_text_field($_POST['rvg_clear_spam']); | |
| 29 | 49 | else $this->odb_rvg_options['clear_spam'] = 'N'; |
| 30 | 50 | |
| 31 | - if(isset($_POST['rvg_clear_tags'])) $this->odb_rvg_options['clear_tags'] = $_POST['rvg_clear_tags']; | |
| 51 | + if(isset($_POST['rvg_clear_tags'])) $this->odb_rvg_options['clear_tags'] = sanitize_text_field($_POST['rvg_clear_tags']); | |
| 32 | 52 | else $this->odb_rvg_options['clear_tags'] = 'N'; |
| 33 | 53 | |
| 34 | - if(isset($_POST['rvg_clear_transients'])) $this->odb_rvg_options['clear_transients'] = $_POST['rvg_clear_transients']; | |
| 54 | + if(isset($_POST['rvg_clear_transients'])) $this->odb_rvg_options['clear_transients'] = sanitize_text_field($_POST['rvg_clear_transients']); | |
| 35 | 55 | else $this->odb_rvg_options['clear_transients'] = 'N'; |
| 36 | 56 | |
| 37 | - if(isset($_POST['rvg_clear_pingbacks'])) $this->odb_rvg_options['clear_pingbacks'] = $_POST['rvg_clear_pingbacks']; | |
| 57 | + if(isset($_POST['rvg_clear_pingbacks'])) $this->odb_rvg_options['clear_pingbacks'] = sanitize_text_field($_POST['rvg_clear_pingbacks']); | |
| 38 | 58 | else $this->odb_rvg_options['clear_pingbacks'] = 'N'; |
| 39 | 59 | |
| 40 | - if(isset($_POST['rvg_odb_logging_on'])) $this->odb_rvg_options['logging_on'] = $_POST['rvg_odb_logging_on']; | |
| 60 | + if(isset($_POST['rvg_clear_oembed'])) $this->odb_rvg_options['clear_oembed'] = sanitize_text_field($_POST['rvg_clear_oembed']); | |
| 61 | + else $this->odb_rvg_options['clear_oembed'] = 'N'; | |
| 62 | + | |
| 63 | + if(isset($_POST['rvg_clear_orphans'])) $this->odb_rvg_options['clear_orphans'] = sanitize_text_field($_POST['rvg_clear_orphans']); | |
| 64 | + else $this->odb_rvg_options['clear_orphans'] = 'N'; | |
| 65 | + | |
| 66 | + if(isset($_POST['rvg_odb_logging_on'])) $this->odb_rvg_options['logging_on'] = sanitize_text_field($_POST['rvg_odb_logging_on']); | |
| 41 | 67 | else $this->odb_rvg_options['logging_on'] = 'N'; |
| 42 | 68 | |
| 43 | - if(isset($_POST['rvg_odb_schedule'])) | |
| 44 | - { | |
| 69 | + if(isset($_POST['rvg_odb_schedule'])) { | |
| 45 | 70 | $type_old = $this->odb_rvg_options['schedule_type']; |
| 46 | 71 | $hour_old = $this->odb_rvg_options['schedule_hour']; |
| 47 | 72 | |
| 48 | - if($_POST['rvg_odb_schedule'] == '' || ($_POST['rvg_odb_schedule'] != 'daily' && $_POST['rvg_odb_schedule'] != 'weekly' )) | |
| 73 | + if(sanitize_text_field($_POST['rvg_odb_schedule'] == '') | |
| 74 | + || (sanitize_text_field($_POST['rvg_odb_schedule']) != 'daily' | |
| 75 | + && sanitize_text_field($_POST['rvg_odb_schedule']) != 'weekly' && sanitize_text_field($_POST['rvg_odb_schedule']) != 'monthly' )) | |
| 49 | 76 | $_POST['rvg_odb_schedulehour'] = ''; |
| 50 | 77 | |
| 51 | 78 | $hour = ''; |
| 52 | - if(isset($_POST['rvg_odb_schedulehour'])) $hour = $_POST['rvg_odb_schedulehour']; | |
| 79 | + if(isset($_POST['rvg_odb_schedulehour'])) $hour = sanitize_text_field($_POST['rvg_odb_schedulehour']); | |
| 53 | 80 | |
| 54 | - if($type_old != $_POST['rvg_odb_schedule'] || $hour_old != $hour) | |
| 55 | - { // SCHEDULE CHANGED | |
| 56 | - $this->odb_rvg_options['schedule_type'] = $_POST['rvg_odb_schedule']; | |
| 81 | + if($type_old != sanitize_text_field($_POST['rvg_odb_schedule']) || $hour_old != $hour) { | |
| 82 | + // SCHEDULE CHANGED | |
| 83 | + $this->odb_rvg_options['schedule_type'] = sanitize_text_field($_POST['rvg_odb_schedule']); | |
| 57 | 84 | $this->odb_rvg_options['schedule_hour'] = $hour; |
| 58 | 85 | if($this->odb_rvg_options['schedule_type'] == '') |
| 59 | 86 | // UN-SCHEDULED |
| 60 | 87 | wp_clear_scheduled_hook('odb_scheduler'); |
| @@ -60,18 +87,18 @@ | ||
| 60 | 87 | wp_clear_scheduled_hook('odb_scheduler'); |
| 61 | 88 | else |
| 62 | 89 | // RE-SCHEDULE |
| 63 | 90 | $this->odb_scheduler_obj->odb_reschedule(); |
| 64 | - } | |
| 91 | + } // if($type_old != sanitize_text_field($_POST['rvg_odb_schedule']) || $hour_old != $hour) | |
| 65 | 92 | } // if(isset($_POST['rvg_odb_schedule'])) |
| 66 | 93 | |
| 67 | - if(isset($_POST['rvg_odb_adminbar'])) $this->odb_rvg_options['adminbar'] = $_POST['rvg_odb_adminbar']; | |
| 94 | + if(isset($_POST['rvg_odb_adminbar'])) $this->odb_rvg_options['adminbar'] = sanitize_text_field($_POST['rvg_odb_adminbar']); | |
| 68 | 95 | else $this->odb_rvg_options['adminbar'] = 'N'; |
| 69 | 96 | |
| 70 | - if(isset($_POST['rvg_odb_adminmenu'])) $this->odb_rvg_options['adminmenu'] = $_POST['rvg_odb_adminmenu']; | |
| 97 | + if(isset($_POST['rvg_odb_adminmenu'])) $this->odb_rvg_options['adminmenu'] = sanitize_text_field($_POST['rvg_odb_adminmenu']); | |
| 71 | 98 | else $this->odb_rvg_options['adminmenu'] = 'N'; |
| 72 | 99 | |
| 73 | - if(isset($_POST['rvg_odb_optimize_innodb'])) $this->odb_rvg_options['optimize_innodb'] = $_POST['rvg_odb_optimize_innodb']; | |
| 100 | + if(isset($_POST['rvg_odb_optimize_innodb'])) $this->odb_rvg_options['optimize_innodb'] = sanitize_text_field($_POST['rvg_odb_optimize_innodb']); | |
| 74 | 101 | else $this->odb_rvg_options['optimize_innodb'] = 'N'; |
| 75 | 102 | |
| 76 | 103 | $this->odb_multisite_obj->odb_ms_update_option('odb_rvg_options', $this->odb_rvg_options); |
| 77 | 104 | |
| @@ -94,23 +121,97 @@ | ||
| 94 | 121 | echo "</p></div>"; |
| 95 | 122 | } // if (isset($_POST['info_update'])) |
| 96 | 123 | ?> |
| 97 | 124 | <script type="text/javascript"> |
| 98 | -function schedule_changed() | |
| 99 | -{ if(jQuery("#rvg_odb_schedule").val() == "daily" || jQuery("#rvg_odb_schedule").val() == "weekly") | |
| 125 | +function rvg_odb_delete_older_changed() { | |
| 126 | + if(!jQuery('input[name=rvg_odb_delete_older]:checked').val()) { | |
| 127 | + jQuery("#rvg_odb_older_than").prop('disabled', true); | |
| 128 | + jQuery("#rvg_odb_older_than").val(""); | |
| 129 | + } else { | |
| 130 | + jQuery("#rvg_odb_older_than").prop('disabled', false); | |
| 131 | + } | |
| 132 | +} // rvg_odb_delete_older_changed() | |
| 133 | + | |
| 134 | +function rvg_odb_keep_revisions_changed() { | |
| 135 | + if(!jQuery('input[name=rvg_odb_keep_revisions]:checked').val()) { | |
| 136 | + jQuery("#rvg_odb_number").prop('disabled', true); | |
| 137 | + jQuery("#rvg_odb_number").val(""); | |
| 138 | + } else { | |
| 139 | + jQuery("#rvg_odb_number").prop('disabled', false); | |
| 140 | + } | |
| 141 | +} // rvg_odb_keep_revisions_changed() | |
| 142 | + | |
| 143 | +function schedule_changed() { | |
| 144 | + if(jQuery("#rvg_odb_schedule").val() == "daily" || jQuery("#rvg_odb_schedule").val() == "weekly" || jQuery("#rvg_odb_schedule").val() == "monthly") | |
| 100 | 145 | jQuery("#schedulehour").show(); |
| 101 | 146 | else |
| 102 | 147 | jQuery("#schedulehour").hide(); |
| 103 | -} | |
| 148 | +} // schedule_changed() | |
| 149 | + | |
| 150 | +function rvg_odb_check_form() | |
| 151 | +{ | |
| 152 | + if(jQuery('input[name=rvg_odb_delete_older]:checked').val()) { | |
| 153 | + if(jQuery("#rvg_odb_older_than").val() == '') { | |
| 154 | + jQuery("#rvg_odb_older_than").focus(); | |
| 155 | + alert('<?php _e("You have to enter: ",$this->odb_txt_domain)?> <'+'<?php _e("Delete revisions older than",$this->odb_txt_domain)?>'+'>'); | |
| 156 | + return false; | |
| 157 | + } | |
| 158 | + if(!jQuery.isNumeric(jQuery("#rvg_odb_older_than").val())) { | |
| 159 | + jQuery("#rvg_odb_older_than").focus(); | |
| 160 | + alert('<?php _e("<Delete revisions older than> should be a number", $this->odb_txt_domain)?>'); | |
| 161 | + return false; | |
| 162 | + } | |
| 163 | + } // if(jQuery('input[name=rvg_odb_delete_older]:checked').val()) | |
| 164 | + | |
| 165 | + if(jQuery('input[name=rvg_odb_keep_revisions]:checked').val()) { | |
| 166 | + if(jQuery("#rvg_odb_number").val() == '') { | |
| 167 | + jQuery("#rvg_odb_number").focus(); | |
| 168 | + alert('<?php _e("You have to enter the <Maximum number of revisions>", $this->odb_txt_domain)?>'); | |
| 169 | + return false; | |
| 170 | + } | |
| 171 | + if(!jQuery.isNumeric(jQuery("#rvg_odb_number").val())) { | |
| 172 | + jQuery("#rvg_odb_number").focus(); | |
| 173 | + alert('<?php _e("<Maximum number of revisions> should be a number", $this->odb_txt_domain)?>'); | |
| 174 | + return false; | |
| 175 | + } | |
| 176 | + } // if(jQuery('input[name=rvg_odb_keep_revisions]:checked').val()) | |
| 177 | + | |
| 178 | + return true; | |
| 179 | +} // function rvg_odb_check_form() | |
| 104 | 180 | </script> |
| 105 | 181 | <?php |
| 106 | 182 | // CHECKBOXES |
| 107 | 183 | $c = ' checked'; |
| 184 | +$d = ' disabled'; | |
| 185 | + | |
| 186 | +if($this->odb_rvg_options['delete_older'] == "Y") { | |
| 187 | + // CHECKED | |
| 188 | + $cb_delete_older = $c; | |
| 189 | + $cb_disabled1 = ''; | |
| 190 | +} else { | |
| 191 | + // UNCHECKED | |
| 192 | + $cb_delete_older = ''; | |
| 193 | + $this->odb_rvg_options['older_than'] = ''; | |
| 194 | + $cb_disabled1 = $d; | |
| 195 | +} | |
| 196 | + | |
| 197 | +if($this->odb_rvg_options['rvg_revisions'] == "Y") { | |
| 198 | + // CHECKED | |
| 199 | + $cb_keep_revisions = $c; | |
| 200 | + $cb_disabled2 = ''; | |
| 201 | +} else { | |
| 202 | + // UNCHECED | |
| 203 | + $cb_keep_revisions = ''; | |
| 204 | + $this->odb_rvg_options['nr_of_revisions'] = ''; | |
| 205 | + $cb_disabled2 = $d; | |
| 206 | +} // if($this->odb_rvg_options['rvg_revisions'] == "Y") | |
| 207 | + | |
| 108 | 208 | $cb_trash = ($this->odb_rvg_options['clear_trash'] == "Y") ? $c : ''; |
| 109 | 209 | $cb_spam = ($this->odb_rvg_options['clear_spam'] == "Y") ? $c : ''; |
| 110 | 210 | $cb_tags = ($this->odb_rvg_options['clear_tags'] == "Y") ? $c : ''; |
| 111 | -$cb_trans = ($this->odb_rvg_options['clear_transients'] == "Y") ? $c : ''; | |
| 112 | 211 | $cb_ping = ($this->odb_rvg_options['clear_pingbacks'] == "Y") ? $c : ''; |
| 212 | +$cb_oembed = ($this->odb_rvg_options['clear_oembed'] == "Y") ? $c : ''; | |
| 213 | +$cb_orphans = ($this->odb_rvg_options['clear_orphans'] == "Y") ? $c : ''; | |
| 113 | 214 | $cb_logging = ($this->odb_rvg_options['logging_on'] == "Y") ? $c : ''; |
| 114 | 215 | $cb_adminbar = ($this->odb_rvg_options['adminbar'] == "Y") ? $c : ''; |
| 115 | 216 | $cb_adminmenu = ($this->odb_rvg_options['adminmenu'] == "Y") ? $c : ''; |
| 116 | 217 | $cb_optimize_innodb = ($this->odb_rvg_options['optimize_innodb'] == "Y") ? $c : ''; |
| @@ -117,28 +218,87 @@ | ||
| 117 | 218 | |
| 118 | 219 | // DISPLAY HEADER |
| 119 | 220 | $this->odb_displayer_obj->display_header(); |
| 120 | 221 | |
| 222 | +// GET THE DATABASE TABLES | |
| 223 | +$odb_tables = $this->odb_utilities_obj->odb_get_tables(); | |
| 224 | + | |
| 121 | 225 | // DISPLAY FORM |
| 122 | 226 | echo ' |
| 123 | 227 | <div class="odb-padding-left"> |
| 124 | 228 | <div id="odb-options-form"> |
| 125 | - <form name="options" method="post" action=""> | |
| 229 | + <form name="options" method="post" action="" onsubmit="return rvg_odb_check_form();"> | |
| 126 | 230 | '.wp_nonce_field('odb_action','odb_nonce').' |
| 127 | 231 | <div id="odb-options-wrap"> |
| 128 | 232 | <div id="odb-options-settings"> |
| 129 | 233 | <div class="odb-title-bar"> |
| 130 | - <h2>'.__('Settings',$this->odb_txt_domain).'</h2> | |
| 234 | + <h2>'.__('Settings',$this->odb_txt_domain) . ' <a href="http://cagewebdev.com/optimize-database-after-deleting-revisions-wordpress-plugin/" target="_blank" title="Help"><img src="' . $this->odb_plugin_url.'images/question.png" align="absmiddle"></a>' . '</h2> | |
| 131 | 235 | </div> |
| 132 | 236 | <table border="0" cellspacing="2" cellpadding="5" class="editform" align="center"> |
| 237 | + <tr> | |
| 238 | + | |
| 239 | + <td align="center" colspan="2"><span class="odb-bold">'. __('Delete revisions for the following (custom) post type(s):',$this->odb_txt_domain).'</span></td> | |
| 240 | + </tr>'; | |
| 241 | + | |
| 242 | +// CUSTOM POST TYPES (from v4.4) | |
| 243 | +$rel_posttypes = $this->odb_utilities_obj->odb_get_relevant_post_types(); | |
| 244 | + | |
| 245 | +// LOOP THROUGH THE RELEVANT POST TYPES | |
| 246 | +foreach ($rel_posttypes as $posttype) { | |
| 247 | + | |
| 248 | + $cb_checked = ' checked'; | |
| 249 | + if (isset($this->odb_rvg_options['post_types'][$posttype]) && | |
| 250 | + $this->odb_rvg_options['post_types'][$posttype] == 'N') { | |
| 251 | + $cb_checked = ''; | |
| 252 | + } | |
| 253 | + | |
| 254 | + echo ' | |
| 255 | + <tr> | |
| 256 | + <td width="50%" align="right"><span class="odb-bold">' . $posttype . '</span></td> | |
| 257 | + '; | |
| 258 | + | |
| 259 | + echo ' | |
| 260 | + <td width="50%" valign="top"> | |
| 261 | + <span class="odb-bold"> | |
| 262 | + <input name="rvg_cb_cpt_' . $posttype . '" id="rvg_cb_cpt_' . $posttype . '" type="checkbox" value="Y" ' . $cb_checked . ' /></span> | |
| 263 | + </td> | |
| 264 | + </tr> | |
| 265 | + '; | |
| 266 | +} // foreach ($rel_posttypes as $posttype) | |
| 267 | + | |
| 268 | +echo ' | |
| 269 | + <tr> | |
| 270 | + <td width="50%" align="right"><span class="odb-bold">'. __('Delete revisions older than',$this->odb_txt_domain).'</span></td> | |
| 271 | + <td width="50%" valign="top"><table border="0" cellspacing="0" cellpadding="3"> | |
| 272 | + <tr> | |
| 273 | + <td><span class="odb-bold"> | |
| 274 | + <input name="rvg_odb_delete_older" id="rvg_odb_delete_older" type="checkbox" value="Y" '.$cb_delete_older.' onchange="rvg_odb_delete_older_changed();" /></span></td> | |
| 275 | + <td><input type="text" size="2" name="rvg_odb_older_than" id="rvg_odb_older_than" value="'.$this->odb_rvg_options['older_than'].'" class="odb-bold odb-blue"'.$cb_disabled1.'> '.__("day(s)", $this->odb_txt_domain).' | |
| 276 | + <script type="text/javascript"> | |
| 277 | +'; | |
| 278 | +if($this->odb_rvg_options['delete_older'] == 'Y') echo 'jQuery("#rvg_odb_older").prop("checked", true)'; | |
| 279 | +echo ' | |
| 280 | + jQuery("#rvg_odb_older_than").val("'.$this->odb_rvg_options['older_than'].'"); | |
| 281 | + </script> | |
| 282 | + </td> | |
| 283 | + </tr> | |
| 284 | + </table></td> | |
| 285 | + </tr> | |
| 286 | + <tr> | |
| 287 | + <td width="50%" align="right" valign="top"><span class="odb-bold">'.__('Maximum number of - most recent - revisions<br>to keep per post / page',$this->odb_txt_domain).'</span></td> | |
| 288 | + <td width="50%" valign="top"><table border="0" cellspacing="0" cellpadding="3"> | |
| 289 | + <tr> | |
| 290 | + <td><span class="odb-bold"> | |
| 291 | + <input name="rvg_odb_keep_revisions" id="rvg_odb_keep_revisions" type="checkbox" value="Y" '.$cb_keep_revisions.' onchange="rvg_odb_keep_revisions_changed();" /></span></td> | |
| 292 | + <td><input type="text" size="2" name="rvg_odb_number" id="rvg_odb_number" value="'.$this->odb_rvg_options['nr_of_revisions'].'" class="odb-bold odb-blue"'.$cb_disabled2.'> | |
| 293 | + <em>'.__('(\'0\' means: delete <u>ALL</u> revisions)',$this->odb_txt_domain).'</em></td> | |
| 294 | + </tr> | |
| 295 | + </table></td> | |
| 296 | + </tr> | |
| 133 | 297 | <tr> |
| 134 | - <td width="50%" align="right" valign="top"><span class="odb-bold"> | |
| 135 | - '.__('Maximum number of - most recent - revisions<br>to keep per post / page',$this->odb_txt_domain).' | |
| 136 | - </span></td> | |
| 137 | - <td width="50%" valign="top"><input type="text" size="2" name="rvg_odb_number" id="rvg_odb_number" value="'.$this->odb_rvg_options['nr_of_revisions'] .'" class="odb-bold odb-blue"> | |
| 138 | - | |
| 139 | - '.__('(\'0\' means: delete <u>ALL</u> revisions)',$this->odb_txt_domain).' | |
| 140 | - </tr> | |
| 298 | + <td width="50%" align="right" valign="top" class="odb-bold"> </td> | |
| 299 | + <td width="50%" valign="top"> </td> | |
| 300 | + </tr> | |
| 141 | 301 | <tr> |
| 142 | 302 | <td width="50%" align="right" valign="top"><span class="odb-bold"> |
| 143 | 303 | '. __('Delete trashed items',$this->odb_txt_domain).' |
| 144 | 304 | </span></td> |
| @@ -156,12 +316,25 @@ | ||
| 156 | 316 | </span></td> |
| 157 | 317 | <td width="50%" valign="top"><input name="rvg_clear_tags" type="checkbox" value="Y" '.$cb_tags.'></td> |
| 158 | 318 | </tr> |
| 159 | 319 | <tr> |
| 160 | - <td width="50%" align="right" valign="top"><span class="odb-bold"> | |
| 161 | - '.__('Delete expired transients',$this->odb_txt_domain).' | |
| 320 | + <td width="50%" align="right"><span class="odb-bold"> | |
| 321 | + '.__('Delete transients',$this->odb_txt_domain).' | |
| 162 | 322 | </span></td> |
| 163 | - <td width="50%" valign="top"><input name="rvg_clear_transients" type="checkbox" value="Y" '.$cb_trans.'></td> | |
| 323 | + <td width="50%" valign="top"><select name="rvg_clear_transients" id="rvg_clear_transients" class="odb-post-type-select"> | |
| 324 | + <option selected="selected" value="N"> | |
| 325 | + '.__('DO NOT DELETE TRANSIENTS',$this->odb_txt_domain).' | |
| 326 | + </option> | |
| 327 | + <option value="Y"> | |
| 328 | + '.__('DELETE EXPIRED TRANSIENTS',$this->odb_txt_domain).' | |
| 329 | + </option> | |
| 330 | + <option value="A"> | |
| 331 | + '.__('DELETE ALL TRANSIENTS',$this->odb_txt_domain).' | |
| 332 | + </option> | |
| 333 | + </select> | |
| 334 | + <script type="text/javascript"> | |
| 335 | + jQuery("#rvg_clear_transients").val("'.$this->odb_rvg_options['clear_transients'].'"); | |
| 336 | + </script></td> | |
| 164 | 337 | </tr> |
| 165 | 338 | <tr> |
| 166 | 339 | <td width="50%" align="right" valign="top"><span class="odb-bold"> |
| 167 | 340 | '.__('Delete pingbacks and trackbacks',$this->odb_txt_domain).' |
| @@ -169,13 +342,19 @@ | ||
| 169 | 342 | <td width="50%" valign="top"><input name="rvg_clear_pingbacks" type="checkbox" value="Y" '.$cb_ping.'></td> |
| 170 | 343 | </tr> |
| 171 | 344 | <tr> |
| 172 | 345 | <td width="50%" align="right" valign="top"><span class="odb-bold"> |
| 173 | - '.__('Keep a log',$this->odb_txt_domain).' | |
| 346 | + '.__('Clear oEmbed cache',$this->odb_txt_domain).' | |
| 174 | 347 | </span></td> |
| 175 | - <td width="50%" valign="top"><input name="rvg_odb_logging_on" type="checkbox" value="Y" '.$cb_logging.'></td> | |
| 348 | + <td width="50%" valign="top"><input name="rvg_clear_oembed" type="checkbox" value="Y" '.$cb_oembed.'></td> | |
| 176 | 349 | </tr> |
| 177 | 350 | <tr> |
| 351 | + <td width="50%" align="right" valign="top"><span class="odb-bold"> | |
| 352 | + '.__('Clear orphans',$this->odb_txt_domain).' | |
| 353 | + </span></td> | |
| 354 | + <td width="50%" valign="top"><input name="rvg_clear_orphans" type="checkbox" value="Y" '.$cb_orphans.'></td> | |
| 355 | + </tr> | |
| 356 | + <tr> | |
| 178 | 357 | <td align="right" valign="top"><span class="odb-bold"> |
| 179 | 358 | '. __('Optimize InnoDB tables too',$this->odb_txt_domain).' |
| 180 | 359 | </span></td> |
| 181 | 360 | <td valign="top"><input name="rvg_odb_optimize_innodb" type="checkbox" value="Y" '.$cb_optimize_innodb.'></td> |
| @@ -180,8 +359,14 @@ | ||
| 180 | 359 | </span></td> |
| 181 | 360 | <td valign="top"><input name="rvg_odb_optimize_innodb" type="checkbox" value="Y" '.$cb_optimize_innodb.'></td> |
| 182 | 361 | </tr> |
| 183 | 362 | <tr> |
| 363 | + <td width="50%" align="right" valign="top"><span class="odb-bold"> | |
| 364 | + '.__('Keep a log',$this->odb_txt_domain).' | |
| 365 | + </span></td> | |
| 366 | + <td width="50%" valign="top"><input name="rvg_odb_logging_on" type="checkbox" value="Y" '.$cb_logging.'></td> | |
| 367 | + </tr> | |
| 368 | + <tr> | |
| 184 | 369 | <td width="50%" align="right"><span class="odb-bold"> |
| 185 | 370 | '.__('Scheduler',$this->odb_txt_domain).' |
| 186 | 371 | </span></td> |
| 187 | 372 | <td width="50%"><select name="rvg_odb_schedule" id="rvg_odb_schedule" class="odb-schedule-select" onchange="schedule_changed();"> |
| @@ -198,13 +383,20 @@ | ||
| 198 | 383 | '.__('run optimization DAILY',$this->odb_txt_domain).' |
| 199 | 384 | </option> |
| 200 | 385 | <option value="weekly"> |
| 201 | 386 | '.__('run optimization WEEKLY',$this->odb_txt_domain).' |
| 202 | - </option> | |
| 387 | + </option> | |
| 388 | + <option value="monthly"> | |
| 389 | + '.__('run optimization MONTHLY',$this->odb_txt_domain).' | |
| 390 | + </option> | |
| 391 | +<!-- <option value="fiveminutes"> | |
| 392 | + '.__('run optimization EVERY FIVE MINUTES',$this->odb_txt_domain).' | |
| 393 | + </option>--> | |
| 203 | 394 | </select> |
| 204 | 395 | <script type="text/javascript"> |
| 205 | 396 | jQuery("#rvg_odb_schedule").val("'.$this->odb_rvg_options['schedule_type'].'"); |
| 206 | - </script> | |
| 397 | + </script> | |
| 398 | + </td> | |
| 207 | 399 | </tr> |
| 208 | 400 | <tr id="schedulehour"> |
| 209 | 401 | <td width="50%" align="right"><span class="odb-bold"> |
| 210 | 402 | '.__('Time',$this->odb_txt_domain).' |
| @@ -212,10 +404,10 @@ | ||
| 212 | 404 | <td> |
| 213 | 405 | <select name="rvg_odb_schedulehour" id="rvg_odb_schedulehour" class="odb-schedulehour-select"> |
| 214 | 406 | '; |
| 215 | 407 | |
| 216 | -for($i=0; $i<=23; $i++) | |
| 217 | -{ if($i<10) $i = '0'.$i; | |
| 408 | +for($i=0; $i<=23; $i++) { | |
| 409 | + if($i < 10) $i = '0'.$i; | |
| 218 | 410 | ?> |
| 219 | 411 | <option value="<?php echo $i?>"><?php echo $i.':00 '.__('hrs',$this->odb_txt_domain)?></option> |
| 220 | 412 | <?php |
| 221 | 413 | } // for($i=0; $i<=23; $i++) |
| @@ -225,9 +417,8 @@ | ||
| 225 | 417 | <script type="text/javascript"> |
| 226 | 418 | jQuery("#rvg_odb_schedulehour").val("'.$this->odb_rvg_options['schedule_hour'].'"); |
| 227 | 419 | </script> |
| 228 | 420 | </span> |
| 229 | - </div> | |
| 230 | 421 | </td> |
| 231 | 422 | </tr> |
| 232 | 423 | <script type="text/javascript">schedule_changed();</script> |
| 233 | 424 | <tr> |
| @@ -244,8 +435,18 @@ | ||
| 244 | 435 | </tr> |
| 245 | 436 | </table> |
| 246 | 437 | <div align="center"><em>* '.__('change will be visible after loading the next page', $this->odb_txt_domain).'</em></div> |
| 247 | 438 | <br> |
| 439 | + | |
| 440 | + <div id="odb-options-buttons" align="center"> | |
| 441 | + <p> | |
| 442 | + <input class="button-primary button-large odb-bold" type="submit" name="info_update" value="'.__('Save Settings',$this->odb_txt_domain).'"> | |
| 443 | + | |
| 444 | + <input class="button odb-normal" type="button" name="optimizer" value="'.__('Go To Optimizer',$this->odb_txt_domain).'" onclick="self.location=\'tools.php?page=rvg-optimize-database\'"> | |
| 445 | + </p> | |
| 446 | + </div> | |
| 447 | + <!-- odb-options-buttons --> | |
| 448 | + <br> | |
| 248 | 449 | <div align="center"> |
| 249 | 450 | <span class="odb-bold"> |
| 250 | 451 | '.__('EXCLUDE DATABASE TABLES FROM OPTIMIZATION:<br><span class="odb-underline-red">CHECKED</span> TABLES <span class="odb-underline-red">WON\'T</span> BE OPTIMIZED!</span>',$this->odb_txt_domain).' |
| 251 | 452 | <br><br> |
| @@ -266,18 +467,18 @@ | ||
| 266 | 467 | <div id="odb-options-tables-container"> |
| 267 | 468 | <div id="odb-options-tables-wrapper"> |
| 268 | 469 | '; |
| 269 | 470 | |
| 270 | -for ($i=0; $i<count($this->odb_tables); $i++) | |
| 271 | -{ $class = ''; | |
| 471 | +for ($i=0; $i<count($odb_tables); $i++) { | |
| 472 | + $class = ''; | |
| 272 | 473 | for($j=0; $j<count($this->odb_ms_prefixes); $j++) |
| 273 | - if(substr($this->odb_tables[$i][0], 0, strlen($this->odb_ms_prefixes[$j])) == $this->odb_ms_prefixes[$j]) $class = ' odb-wp-table'; | |
| 474 | + if(substr($odb_tables[$i][0], 0, strlen($this->odb_ms_prefixes[$j])) == $this->odb_ms_prefixes[$j]) $class = ' odb-wp-table'; | |
| 274 | 475 | $cb_checked = ''; |
| 275 | - if(isset($this->odb_rvg_excluded_tabs[$this->odb_tables[$i][0]])) $cb_checked = ' checked'; | |
| 476 | + if(isset($this->odb_rvg_excluded_tabs[$odb_tables[$i][0]])) $cb_checked = ' checked'; | |
| 276 | 477 | ?> |
| 277 | - <div class="odb-options-table<?php echo $class;?>" title="<?php echo $this->odb_tables[$i][0];?>"> | |
| 278 | - <input id="cb_<?php echo $this->odb_tables[$i][0];?>" name="cb_<?php echo $this->odb_tables[$i][0];?>" type="checkbox" value="1"<?php echo $cb_checked; ?>> | |
| 279 | - <?php echo $this->odb_tables[$i][0];?></div> | |
| 478 | + <div class="odb-options-table<?php echo $class;?>" title="<?php echo $odb_tables[$i][0];?>"> | |
| 479 | + <input id="cb_<?php echo $odb_tables[$i][0];?>" name="cb_<?php echo $odb_tables[$i][0];?>" type="checkbox" value="1"<?php echo $cb_checked; ?>> | |
| 480 | + <?php echo $odb_tables[$i][0];?></div> | |
| 280 | 481 | <?php |
| 281 | 482 | } |
| 282 | 483 | |
| 283 | 484 | echo ' |
| @@ -283,9 +484,9 @@ | ||
| 283 | 484 | echo ' |
| 284 | 485 | </div><!-- /odb-options-tables-wrapper --> |
| 285 | 486 | <div id="odb-options-buttons" align="center"> |
| 286 | 487 | <p> |
| 287 | - <input class="button-primary button-large" type="submit" name="info_update" value="'.__('Save Settings',$this->odb_txt_domain).'" class="odb-bold"> | |
| 488 | + <input class="button-primary button-large odb-bold" type="submit" name="info_update" value="'.__('Save Settings',$this->odb_txt_domain).'"> | |
| 288 | 489 | |
| 289 | 490 | <input class="button odb-normal" type="button" name="optimizer" value="'.__('Go To Optimizer',$this->odb_txt_domain).'" onclick="self.location=\'tools.php?page=rvg-optimize-database\'"> |
| 290 | 491 | </p> |
| 291 | 492 | </div> |