Plugin Directory

Changeset 2066393


Ignore:
Timestamp:
04/10/2019 08:38:44 AM (7 years ago)
Author:
esselinknu
Message:

2.53

  • Added weekly Cache cleanup cronjob
Location:
esselinknu-settings/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • esselinknu-settings/trunk/esselink-nu-settings.php

    r2005596 r2066393  
    44 * Plugin URI: http://www.esselink.nu
    55 * Description: Settings plugin for customs configuration of Esselink.nu WP websites
    6  * Version: 2.52
     6 * Version: 2.53
    77 * Author: Esselink.nu
    88 * Author URI: http://www.esselink.nu
    99**/
    10 $esselink_nu_settings_verson = 2.52;
     10$esselink_nu_settings_verson = 2.53;
    1111
    1212// Block  access to this file
  • esselinknu-settings/trunk/includes/admin-settings.php

    r1998936 r2066393  
    102102                                       
    103103                    update_option( 'esselink_nu_settings_minify_html', checkBoolean($_POST['esselink_nu_settings_minify_html']), 'true' );     
    104                     update_option( 'esselink_nu_settings_remove_recaptcha', checkBoolean($_POST['esselink_nu_settings_remove_recaptcha']), 'true' );       
     104                    update_option( 'esselink_nu_settings_remove_recaptcha', checkBoolean($_POST['esselink_nu_settings_remove_recaptcha']), 'true' );   
     105                    update_option( 'esselink_nu_settings_remove_cache', checkBoolean($_POST['esselink_nu_settings_remove_cache']), 'true' );       
    105106                           
    106107                    update_option( 'esselink_nu_settings_hsts_header', checkBoolean($_POST['esselink_nu_settings_hsts_header']), 'true' ); 
     
    327328                                            </fieldset>
    328329                                        </td>
     330                                    </tr>       
     331                                    <tr valign="top">
     332                                        <th scope="row">
     333                                            <label for="esselink_nu_settings_remove_cache">Auto clear cache folder weekly</label>
     334                                        </th>
     335                                        <td>
     336                                            <fieldset>
     337                                                <legend class="screen-reader-text">
     338                                                    <span>Auto clear cache folder weekly</span>
     339                                                </legend>
     340                                                <label for="esselink_nu_settings_remove_cache">
     341                                                    <input name="esselink_nu_settings_remove_cache" type="checkbox" <?= (get_option('esselink_nu_settings_remove_cache')=='true') ? "checked" : "" ?> id="esselink_nu_settings_remove_cache" value="true">Yes
     342                                                </label>
     343                                            </fieldset>
     344                                        </td>
    329345                                    </tr>                               
    330346                                </tbody>
  • esselinknu-settings/trunk/includes/basic-settings.php

    r1998936 r2066393  
    3535    echo PHP_EOL . "<style>.grecaptcha-badge { display: none !important; }</style>" . PHP_EOL;
    3636}
    37    
    38 
     37
     38// Auto remove cache weekly
     39if(get_option('esselink_nu_settings_remove_cache') == false)
     40    add_option( 'esselink_nu_settings_remove_cache', 'true', '', 'yes' );
     41if(get_option('esselink_nu_settings_remove_cache') != false && get_option('esselink_nu_settings_remove_cache') == "true")
     42{
     43    if (! wp_next_scheduled ( 'esselink_nu_settings_remove_cache_cronjob_event' )) {
     44        wp_schedule_event(time(), 'weekly', 'esselink_nu_settings_remove_cache_cronjob_event');
     45    }
     46   
     47    add_action('esselink_nu_settings_remove_cache_cronjob_event', 'esselink_nu_settings_optimze_cronjob_action');
     48   
     49
     50} else {
     51    wp_clear_scheduled_hook('esselink_nu_settings_remove_cache_cronjob_event');
     52}
     53
     54function esselink_nu_settings_remove_cache_cronjob_action()
     55{
     56    if (function_exists('w3tc_dbcache_flush')) {
     57        w3tc_dbcache_flush();
     58    }
     59   
     60    if (function_exists('w3tc_objectcache_flush')) {
     61        w3tc_objectcache_flush();
     62    }
     63   
     64    if (function_exists('w3tc_pgcache_flush')) {
     65        w3tc_pgcache_flush();
     66    }
     67}
    3968
    4069// Send email on update
  • esselinknu-settings/trunk/readme.txt

    r2005596 r2066393  
    33Tags: esselink.nu,esselink
    44Requires at least: 4.0
    5 Tested up to: 5.0
     5Tested up to: 5.1
    66Stable tag: trunk
    77License: GPLv2 or later
     
    124124= 2.52 =
    125125* Active plug-in check fix
     126= 2.53 =
     127* Added weekly Cache cleanup cronjob
    126128
    127129== Upgrade Notice ==
Note: See TracChangeset for help on using the changeset viewer.