Changeset 428529
- Timestamp:
- 08/25/2011 09:31:15 AM (15 years ago)
- File:
-
- 1 edited
-
wp-green-cache/trunk/options.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-green-cache/trunk/options.php
r426960 r428529 17 17 */ 18 18 19 function wpgc_options() 19 20 21 function wpsc_options() 20 22 { 21 23 if (is_admin()) 22 24 { 23 25 // Print warnings about directory permisions 24 $wp gc_ok = wpgc_is_cache_writable() && wpgc_is_config_writable() && wpgc_check_configuration();25 26 if ( $wp gc_ok )26 $wpsc_ok = wpsc_is_cache_writable() && wpsc_is_config_writable() && wpsc_check_configuration(); 27 28 if ( $wpsc_ok ) 27 29 { 28 30 if (isset($_POST['save'])) 29 31 { 30 32 // Clear inbound parameters 31 $old_options = wp gc_get_options();33 $old_options = wpsc_get_options(); 32 34 $options = stripslashes_deep($_POST['options']); 33 35 34 36 // Clean cache switching on compressed/uncompressed modes 35 37 if ( $options['compress'] != $old_options['compress'] ) 36 wp gc_clean_cache();38 wpsc_clean_cache(); 37 39 38 wp gc_update_options($options);40 wpsc_update_options($options); 39 41 40 42 // Activate/deactivate cache mechanism of wordpress 41 43 if ( $options['enabled'] != $old_options['enabled'] ) 42 44 if ( $options['enabled'] ) 43 wp gc_activate();45 wpsc_activate(); 44 46 else 45 wp gc_deactivate();47 wpsc_deactivate(); 46 48 } 47 49 48 50 if (isset($_POST['clean'])) 49 wp gc_clean_cache();50 51 $options = wp gc_get_options();51 wpsc_clean_cache(); 52 53 $options = wpsc_get_options(); 52 54 } 53 55 ?> … … 56 58 <tr > 57 59 <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"> 60 62 </a> 61 63 </td> … … 82 84 </script> 83 85 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 ) 85 95 echo "<div style='background-color:#d0d0d0;z-index:1000;opacity:0.85'>"; 86 96 ?> … … 90 100 <!-- #################################################################################### --> 91 101 <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> 107 116 </div> 108 117 109 118 <!-- #################################################################################### --> 110 119 <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> 113 121 <div class="inside"> 114 122 115 123 <table class="form-table"> 116 124 <tr valign="top"> 117 <th><?php _e('Enable WP Green Cache', 'wpgc'); ?></th>125 <th><?php _e('Enable WP Simple Cache', 'wpsc'); ?></th> 118 126 <td> 119 127 <input type="hidden" name="options[enabled]" value="0"> … … 122 130 </tr> 123 131 <tr valign="top"> 124 <th><?php _e('Cached pages timeout', 'wp gc'); ?></th>125 <td> 126 <input type="text" size="5" name="options[cache_ttl]" value="<?php echo htmlspecialchars($options['cache_ttl']); ?>"/> (<?php _e('minutes', 'wp gc'); ?>) <br />127 <?php _e('Minutes a cached page is valid and served to users. A zero value means a cached page is valid forever.', 'wp gc'); ?>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.', 'wp gc'); ?>129 <?php _e('720 minutes is half a day, 1440 is a full day and so on.', 'wp gc'); ?>130 </td> 131 </tr> 132 <tr valign="top"> 133 <th><?php _e('Cache autoclean', 'wp gc'); ?></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> 134 142 <td> 135 143 <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', 'wp gc'); ?>) <br />137 <?php _e('Frequency of the autoclean process which removes to expired cached pages to free disk space.', 'wp gc'); ?>138 <?php _e('If Cache autoclean is set to zero, autoclean never runs.', 'wp gc'); ?>139 </td> 140 </tr> 141 <tr valign="top"> 142 <th><?php _e('Compression', 'wp gc'); ?></th>143 <td> 144 <?php if (!wp gc_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>', 'wp gc'); ?></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> 146 154 <?php } else { ?> 147 155 <input type="hidden" name="options[compress]" value="0"> 148 <input type="checkbox" name="options[compress]" value="<?php echo wp gc_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.', 'wp gc'); ?>150 <?php _e('If you switch this option then the cache will be cleaned.', 'wp gc'); ?>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'); ?> 151 159 <?php } ?> 152 160 </td> 153 161 </tr> 154 162 <tr valign="top"> 155 <th><?php _e('Show performance box', 'wp gc'); ?></th>163 <th><?php _e('Show performance box', 'wpsc'); ?></th> 156 164 <td> 157 165 <input type="hidden" name="options[perf_footer]" value="0"> 158 166 <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.', 'wp gc'); ?>167 <?php _e('When activated the performance box it will be attached to top-right of every page.', 'wpsc'); ?> 160 168 <?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'); ?> 162 170 </td> 163 171 </tr> … … 165 173 <td> 166 174 <p class="submit"> 167 <input class="button" type="submit" name="save" value="<?php _e('Update'); ?>" <?php echo (!$wp gc_ok) ? 'disabled':''; ?>>175 <input class="button" type="submit" name="save" value="<?php _e('Update'); ?>" <?php echo (!$wpsc_ok) ? 'disabled':''; ?>> 168 176 </p> 169 177 </td> … … 175 183 <!-- #################################################################################### --> 176 184 <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', 'wp gc'); ?></h3>185 <div class="handlediv" title="Click to open/close"><br /></div><h3 class='hndle'><?php _e('Extra options', 'wpsc'); ?></h3> 178 186 <div class="inside"> 179 187 <table class="form-table"> 180 188 <tr valign="top"> 181 <th><?php _e('Include php', 'wp gc'); ?></th>189 <th><?php _e('Include php', 'wpsc'); ?></th> 182 190 <td> 183 191 <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: ', 'wp gc'); ?>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'); ?> 186 194 <?php echo '<i>'.dirname(__FILE__).'/example.php'.'</i>'; ?> 187 195 </td> … … 190 198 <td> 191 199 <p class="submit"> 192 <input class="button" type="submit" name="save" value="<?php _e('Update'); ?>" <?php echo (!$wp gc_ok) ? 'disabled':''; ?>>200 <input class="button" type="submit" name="save" value="<?php _e('Update'); ?>" <?php echo (!$wpsc_ok) ? 'disabled':''; ?>> 193 201 </p> 194 202 </td> … … 199 207 200 208 </form> 201 <?php if (!$wp gc_ok)209 <?php if (!$wpsc_ok) 202 210 echo "</div>"; 203 211 ?>
Note: See TracChangeset
for help on using the changeset viewer.