Plugin Directory

Changeset 428529


Ignore:
Timestamp:
08/25/2011 09:31:15 AM (15 years ago)
Author:
enseitankado
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-green-cache/trunk/options.php

    r426960 r428529  
    1717*/
    1818
    19 function wpgc_options()
     19
     20
     21function wpsc_options()
    2022{
    2123    if (is_admin())
    2224    {               
    2325        // Print warnings about directory permisions
    24         $wpgc_ok = wpgc_is_cache_writable() && wpgc_is_config_writable() && wpgc_check_configuration();
    25        
    26         if ( $wpgc_ok )
     26        $wpsc_ok = wpsc_is_cache_writable() && wpsc_is_config_writable() && wpsc_check_configuration();
     27       
     28        if ( $wpsc_ok )
    2729        {               
    2830            if (isset($_POST['save']))
    2931            {
    3032                // Clear inbound parameters
    31                 $old_options = wpgc_get_options();
     33                $old_options = wpsc_get_options();
    3234                $options = stripslashes_deep($_POST['options']);
    3335
    3436                // Clean cache switching on compressed/uncompressed modes
    3537                if ( $options['compress'] != $old_options['compress'] )
    36                     wpgc_clean_cache();
     38                    wpsc_clean_cache();
    3739               
    38                 wpgc_update_options($options);             
     40                wpsc_update_options($options);             
    3941               
    4042                // Activate/deactivate cache mechanism of wordpress
    4143                if ( $options['enabled'] != $old_options['enabled'] )
    4244                if ( $options['enabled'] )
    43                     wpgc_activate();           
     45                    wpsc_activate();           
    4446                else
    45                     wpgc_deactivate();             
     47                    wpsc_deactivate();             
    4648            }
    4749           
    4850            if (isset($_POST['clean']))
    49                 wpgc_clean_cache();         
    50            
    51             $options = wpgc_get_options();
     51                wpsc_clean_cache();         
     52           
     53            $options = wpsc_get_options();
    5254        }
    5355        ?>
     
    5658            <tr >
    5759                <td valign='top' height='100'>
    58                     <a href='http://www.tankado.com/wp-green-cache/' target='_blank'>
    59                     <img src="/wp-content/plugins/wp-green-cache/images/WPGC-banner.png">
     60                    <a href='http://www.tankado.com/wp-simple-cache/' target='_blank'>
     61                    <img src="/wp-content/plugins/wp-simple-cache/images/WPSC-banner.png">
    6062                    </a>
    6163                </td>
     
    8284        </script>
    8385       
    84         <?php if( !$wpgc_ok )
     86        <p>
     87        <span style="background-color:red; color:white; font-size:24px; line-height:30px">
     88        <b>Important:</b> Now, WP Simple Cache plugin continious as WP Green Cache. Please <b>uninstall this plugin</b> and <b><a href='http://wordpress.org/extend/plugins/wp-green-cache/'>install</a> WP Green Cache</b>.
     89        </span>
     90        </p>
     91   
     92
     93       
     94        <?php if( !$wpsc_ok )
    8595            echo "<div style='background-color:#d0d0d0;z-index:1000;opacity:0.85'>";
    8696        ?>
     
    90100            <!-- #################################################################################### -->
    91101            <div class="postbox" id="dashboard_right_now">
    92             <div class="handlediv" title="Click to open/close"><br /></div>
    93                 <h3 class='hndle'><?php _e('Cache status', 'wpgc'); ?></h3>
    94                 <div class="inside">
    95                     <table class="form-table">
    96                     <tr valign="top">                       
    97                         <td><?php echo wpgc_get_cache_status(); ?></td>
    98                     </tr>
    99                     <tr valign="top">                       
    100                         <td><?php echo wpgc_get_cache_gains(); ?></td>
    101                     </tr>                   
    102                     </table>
    103                     <p class="submit">
    104                         <input class="button" type="submit" name="clean" value="<?php _e('Clear cache', 'wpgc'); ?>" <?php echo (!$wpgc_ok) ? 'disabled':''; ?>>
    105                     </p>                   
    106                 </div>
     102            <div class="handlediv" title="Click to open/close"><br /></div><h3 class='hndle'><?php _e('Cache status', 'wpsc'); ?></h3>
     103            <div class="inside">
     104
     105                <table class="form-table">
     106                <tr valign="top">
     107                    <th><?php _e('Cached files', 'wpsc'); ?></th>
     108                    <td><?php echo wpsc_get_cache_status(); ?></td>
     109                </tr>
     110                </table>
     111                <p class="submit">
     112                    <input class="button" type="submit" name="clean" value="<?php _e('Clear cache', 'wpsc'); ?>" <?php echo (!$wpsc_ok) ? 'disabled':''; ?>>
     113                </p>
     114               
     115            </div>
    107116            </div>
    108117           
    109118            <!-- #################################################################################### -->
    110119            <div class="postbox" id="dashboard_right_now">
    111             <div class="handlediv" title="Click to open/close"><br /></div>
    112             <h3 class='hndle'><?php _e('Cache settings', 'wpgc'); ?></h3>
     120            <div class="handlediv" title="Click to open/close"><br /></div><h3 class='hndle'><?php _e('Cache settings', 'wpsc'); ?></h3>
    113121            <div class="inside">           
    114122           
    115123            <table class="form-table">
    116124            <tr valign="top">
    117                 <th><?php _e('Enable WP Green Cache', 'wpgc'); ?></th>
     125                <th><?php _e('Enable WP Simple Cache', 'wpsc'); ?></th>
    118126                <td>
    119127                    <input type="hidden" name="options[enabled]" value="0">
     
    122130            </tr>               
    123131            <tr valign="top">
    124                 <th><?php _e('Cached pages timeout', 'wpgc'); ?></th>
    125                 <td>
    126                     <input type="text" size="5" name="options[cache_ttl]" value="<?php echo htmlspecialchars($options['cache_ttl']); ?>"/> (<?php _e('minutes', 'wpgc'); ?>) <br />
    127                     <?php _e('Minutes a cached page is valid and served to users. A zero value means a cached page is valid forever.', 'wpgc'); ?>
    128                     <?php _e('If a cached page is older than specified value (expired) it is no more used and will be regenerated on next request of it.', 'wpgc'); ?>
    129                     <?php _e('720 minutes is half a day, 1440 is a full day and so on.', 'wpgc'); ?>
    130                 </td>
    131             </tr>
    132             <tr valign="top">
    133                 <th><?php _e('Cache autoclean', 'wpgc'); ?></th>
     132                <th><?php _e('Cached pages timeout', 'wpsc'); ?></th>
     133                <td>
     134                    <input type="text" size="5" name="options[cache_ttl]" value="<?php echo htmlspecialchars($options['cache_ttl']); ?>"/> (<?php _e('minutes', 'wpsc'); ?>) <br />
     135                    <?php _e('Minutes a cached page is valid and served to users. A zero value means a cached page is valid forever.', 'wpsc'); ?>
     136                    <?php _e('If a cached page is older than specified value (expired) it is no more used and will be regenerated on next request of it.', 'wpsc'); ?>
     137                    <?php _e('720 minutes is half a day, 1440 is a full day and so on.', 'wpsc'); ?>
     138                </td>
     139            </tr>
     140            <tr valign="top">
     141                <th><?php _e('Cache autoclean', 'wpsc'); ?></th>
    134142                <td>
    135143                    <input type="hidden" name="options[last_cleaning]" value="<?php echo $options['last_cleaning']; ?>">
    136                     <input type="text" size="5" name="options[clean_interval]" value="<?php echo htmlspecialchars($options['clean_interval']); ?>"/> (<?php _e('minutes', 'wpgc'); ?>) <br />
    137                     <?php _e('Frequency of the autoclean process which removes to expired cached pages to free disk space.', 'wpgc'); ?>
    138                     <?php _e('If Cache autoclean is set to zero, autoclean never runs.', 'wpgc'); ?>
    139                 </td>
    140             </tr>
    141             <tr valign="top">
    142                 <th><?php _e('Compression', 'wpgc'); ?></th>
    143                 <td>
    144                 <?php if (!wpgc_check_gz_funcs()) { ?>
    145                 <p><?php _e('<i>Your hosting server has not the gzcompress/gzuncompress and gzencode/gzdecode functions, so no compression options are available.</i>', 'wpgc'); ?></p>
     144                    <input type="text" size="5" name="options[clean_interval]" value="<?php echo htmlspecialchars($options['clean_interval']); ?>"/> (<?php _e('minutes', 'wpsc'); ?>) <br />
     145                    <?php _e('Frequency of the autoclean process which removes to expired cached pages to free disk space.', 'wpsc'); ?>
     146                    <?php _e('If Cache autoclean is set to zero, autoclean never runs.', 'wpsc'); ?>
     147                </td>
     148            </tr>
     149            <tr valign="top">
     150                <th><?php _e('Compression', 'wpsc'); ?></th>
     151                <td>
     152                <?php if (!wpsc_check_gz_funcs()) { ?>
     153                <p><?php _e('<i>Your hosting server has not the gzcompress/gzuncompress and gzencode/gzdecode functions, so no compression options are available.</i>', 'wpsc'); ?></p>
    146154                <?php } else { ?>
    147155                    <input type="hidden" name="options[compress]" value="0">
    148                     <input type="checkbox" name="options[compress]" value="<?php echo wpgc_check_gz_funcs(); ?>" <?php echo $options['compress']?'checked':''; ?> /> <br />
    149                     <?php _e('If possible the page will be sent and stored as compressed to save bandwidth and storege quate.', 'wpgc'); ?>
    150                     <?php _e('If you switch this option then the cache will be cleaned.', 'wpgc'); ?>
     156                    <input type="checkbox" name="options[compress]" value="<?php echo wpsc_check_gz_funcs(); ?>" <?php echo $options['compress']?'checked':''; ?> /> <br />
     157                    <?php _e('If possible the page will be sent and stored as compressed to save bandwidth and storege quate.', 'wpsc'); ?>
     158                    <?php _e('If you switch this option then the cache will be cleaned.', 'wpsc'); ?>
    151159                <?php } ?>     
    152160                </td>
    153161            </tr>
    154162            <tr valign="top">
    155                 <th><?php _e('Show performance box', 'wpgc'); ?></th>
     163                <th><?php _e('Show performance box', 'wpsc'); ?></th>
    156164                <td>
    157165                    <input type="hidden" name="options[perf_footer]" value="0">
    158166                    <input type="checkbox" name="options[perf_footer]" value="1" <?php echo $options['perf_footer']?'checked':''; ?>/> <br />
    159                     <?php _e('When activated the performance box it will be attached to top-right of every page.', 'wpgc'); ?>
     167                    <?php _e('When activated the performance box it will be attached to top-right of every page.', 'wpsc'); ?>
    160168                    <?php _e('Performance box views SQL query count and page generation time that you inform about blog performance.', 'hyper-cache'); ?>
    161                     <?php _e('I suggest you to see advantage of wpgc compare the values when wpgc is enabled and disabled.', 'wpgc'); ?>
     169                    <?php _e('I suggest you to see advantage of WPSC compare the values when WPSC is enabled and disabled.', 'wpsc'); ?>
    162170                </td>
    163171            </tr>
     
    165173                <td>
    166174                    <p class="submit">
    167                     <input class="button" type="submit" name="save" value="<?php _e('Update'); ?>" <?php echo (!$wpgc_ok) ? 'disabled':''; ?>>
     175                    <input class="button" type="submit" name="save" value="<?php _e('Update'); ?>" <?php echo (!$wpsc_ok) ? 'disabled':''; ?>>
    168176                    </p>
    169177                </td>
     
    175183            <!-- #################################################################################### -->
    176184            <div class="postbox closed" id="dashboard_right_now">
    177             <div class="handlediv" title="Click to open/close"><br /></div><h3 class='hndle'><?php _e('Extra options', 'wpgc'); ?></h3>
     185            <div class="handlediv" title="Click to open/close"><br /></div><h3 class='hndle'><?php _e('Extra options', 'wpsc'); ?></h3>
    178186            <div class="inside">   
    179187                <table class="form-table">
    180188                <tr valign="top">
    181                     <th><?php _e('Include php', 'wpgc'); ?></th>
     189                    <th><?php _e('Include php', 'wpsc'); ?></th>
    182190                    <td>
    183191                        <input type="text" size="70" name="options[include_php]" value="<?php echo htmlspecialchars($options['include_php']); ?>"/><br>
    184                         <?php _e('When wpgc is active if you run any php script write the path of script starting from server root.', 'wpgc'); ?><br>
    185                         <?php _e('Example: ', 'wpgc'); ?>
     192                        <?php _e('When WPSC is active if you run any php script write the path of script starting from server root.', 'wpsc'); ?><br>
     193                        <?php _e('Example: ', 'wpsc'); ?>
    186194                        <?php echo '<i>'.dirname(__FILE__).'/example.php'.'</i>'; ?>
    187195                    </td>
     
    190198                    <td>
    191199                        <p class="submit">
    192                         <input class="button" type="submit" name="save" value="<?php _e('Update'); ?>" <?php echo (!$wpgc_ok) ? 'disabled':''; ?>>
     200                        <input class="button" type="submit" name="save" value="<?php _e('Update'); ?>" <?php echo (!$wpsc_ok) ? 'disabled':''; ?>>
    193201                        </p>
    194202                    </td>
     
    199207           
    200208        </form>
    201         <?php if (!$wpgc_ok)
     209        <?php if (!$wpsc_ok)
    202210            echo "</div>";
    203211        ?>
Note: See TracChangeset for help on using the changeset viewer.