| 1 |
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?> |
| 2 |
|
| 3 |
<h3><?php _e('Scheduled clean-up settings', 'wp-optimize'); ?></h3> |
| 4 |
|
| 5 |
<p> |
| 6 |
<a href="<?php echo WP_Optimize()->premium_version_link; ?>" target="_blank"><?php _e('Take control of clean-ups: Upgrade to Premium for a more powerful and flexible scheduler', 'wp-optimize'); ?></a> |
| 7 |
</p> |
| 8 |
|
| 9 |
<div class="wpo-fieldgroup"> |
| 10 |
|
| 11 |
<p> |
| 12 |
|
| 13 |
<input name="enable-schedule" id="enable-schedule" type="checkbox" value ="true" <?php checked($options->get_option('schedule'), 'true'); ?>> |
| 14 |
<label for="enable-schedule"><?php _e('Enable scheduled clean-up and optimization', 'wp-optimize'); ?></label> |
| 15 |
|
| 16 |
</p> |
| 17 |
|
| 18 |
<div id="wp-optimize-auto-options"> |
| 19 |
|
| 20 |
<p> |
| 21 |
|
| 22 |
<?php _e('Select schedule type (default is Weekly)', 'wp-optimize'); ?><br> |
| 23 |
<select id="schedule_type" name="schedule_type"> |
| 24 |
|
| 25 |
<?php |
| 26 |
$schedule_options = array( |
| 27 |
'wpo_daily' => __('Daily', 'wp-optimize'), |
| 28 |
'wpo_weekly' => __('Weekly', 'wp-optimize'), |
| 29 |
'wpo_fortnightly' => __('Fortnightly', 'wp-optimize'), |
| 30 |
'wpo_monthly' => __('Monthly (approx. - every 30 days)', 'wp-optimize'), |
| 31 |
); |
| 32 |
|
| 33 |
$schedule_type_saved_id = $options->get_option('schedule-type', 'wpo_weekly'); |
| 34 |
|
| 35 |
// Backwards compatibility: |
| 36 |
if ('wpo_otherweekly' == $schedule_type_saved_id) $schedule_type_saved_id = 'wpo_fortnightly'; |
| 37 |
|
| 38 |
foreach ($schedule_options as $opt_id => $opt_description) { |
| 39 |
?> |
| 40 |
<option value="<?php echo esc_attr($opt_id); ?>" <?php if ($opt_id == $schedule_type_saved_id) echo 'selected="selected"'; ?>><?php echo htmlspecialchars($opt_description); ?></option> |
| 41 |
<?php |
| 42 |
} |
| 43 |
|
| 44 |
?> |
| 45 |
|
| 46 |
</select> |
| 47 |
|
| 48 |
</p> |
| 49 |
|
| 50 |
<?php |
| 51 |
$wpo_auto_options = $options->get_option('auto'); |
| 52 |
|
| 53 |
$optimizations = $optimizer->sort_optimizations($optimizer->get_optimizations()); |
| 54 |
|
| 55 |
foreach ($optimizations as $id => $optimization) { |
| 56 |
if (empty($optimization->available_for_auto)) continue; |
| 57 |
|
| 58 |
$auto_id = $optimization->get_auto_id(); |
| 59 |
|
| 60 |
$auto_dom_id = 'wp-optimize-auto-'.$auto_id; |
| 61 |
|
| 62 |
$setting_activated = (empty($wpo_auto_options[$auto_id]) || 'false' == $wpo_auto_options[$auto_id]) ? false : true; |
| 63 |
?> |
| 64 |
<p> |
| 65 |
<input name="wp-optimize-auto[<?php echo $auto_id; ?>]" id="<?php echo esc_attr($auto_dom_id); ?>" type="checkbox" value="true" <?php if ($setting_activated) echo 'checked="checked"'; ?>> <label for="<?php echo esc_attr($auto_dom_id); ?>"><?php echo $optimization->get_auto_option_description(); ?></label> |
| 66 |
</p> |
| 67 |
<?php |
| 68 |
} |
| 69 |
?> |
| 70 |
|
| 71 |
<!-- disabled email notification |
| 72 |
<p> |
| 73 |
<label> |
| 74 |
<input name="enable-email" id="enable-email" type="checkbox" value ="true" /> |
| 75 |
</label> |
| 76 |
</p> |
| 77 |
<p> |
| 78 |
<label for="enable-email-address"> |
| 79 |
<input name="enable-email-address" id="enable-email-address" type="text" value ="" /> |
| 80 |
</label> |
| 81 |
</p> --> |
| 82 |
|
| 83 |
</div><!-- END #wp-optimize-auto-options --> |
| 84 |
</div><!-- END .wpo-fieldgroup --> |