Plugin Directory

Changeset 434338


Ignore:
Timestamp:
09/06/2011 10:37:12 PM (15 years ago)
Author:
enseitankado
Message:
 
Location:
wp-green-cache/trunk
Files:
4 edited

Legend:

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

    r426960 r434338  
    248248                }
    249249                wpgc_activate();
    250             }           
     250            }
    251251        }
    252252    }   
     
    346346       
    347347        if (!is_writable( ABSPATH . 'wp-config.php' ))
    348             $wpgc_notice .= '<b>Warning:</b> Wordpress config file (wp-config.php) is not writable by server.'
    349                 .'Check its permissions.';
     348            $wpgc_notice .= _('<b>Warning:</b> Wordpress config file (wp-config.php) is not writable by server.'
     349                .'Check its permissions. (Dont forget to restore original value [ex: 640])', 'wpgc');
    350350           
    351351        if (!is_writable( ABSPATH . 'wp-content/' ))
    352             $wpgc_notice .= '<b>Warning:</b> Wordpress content directory (wp-content/) is not writable by server.'
    353             .'Check its permissions.';
     352            $wpgc_notice .= _('<b>Warning:</b> Wordpress content directory (wp-content/) is not writable by server.'
     353            .'Check its permissions. (Dont forget to restore original value.)', 'wpgc');
    354354       
    355355        if (!empty($wpgc_notice))
     
    462462            }
    463463            closedir($handle);
    464             return 'Files count: '.$count . ',  Total size: ' . wpgc_formatBytes($size, 2).'';
    465         }
    466         return 'Couldnt open dir: ' . dirname(__FILE__) . '/cache';
     464            $ret = 'Files count: '.$count . ',  Total size: ' . wpgc_formatBytes($size, 2).'';
     465       
     466        } else
     467        $ret = 'Couldnt open dir: ' . dirname(__FILE__) . '/cache';
     468       
     469        $ret .= " (<a href='".$_SERVER['REQUEST_URI']."&clean_cache=true' title='"._('Delete all cached files', 'wpgc')."'>"._('Clear cache', 'wpgc')."</a>)";
     470       
     471        return $ret;
    467472    }
    468473   
     
    731736        $profited_tree = sprintf("%.3f", $profited_watt * 0.59239163522);
    732737       
    733         $mes .= "Total code run time decreased to <b>%s</b> which was <b>%s</b> before plugin, ";
    734         $mes .= 'so you saved <b>%s</b> (%s) of code run time. ';
     738        $mes .= "Total code run time decreased to %s which was %s before plugin, ";
     739        $mes .= 'so you saved %s (%s) of code run time. ';
    735740        $mes .= "This plugin also enabling the bandwidth compression which ends up with ";
    736         $mes .= "reduced total bandwidth from <b>%s</b> to <b>%s</b>. ";
    737         $mes .= "In this way, according to the current server configuration you ";
    738         $mes .= "saved about <b>%s</b> energy and saved <b>%s</b> ";       
    739         $mes .= "(<i>Your server has %s CPU cores, %s HD, %s network interfaces and %s mainboard devices.</i>)";
    740        
     741        $mes .= "reduced total bandwidth from %s to %s. ";
     742        $mes .= "In this way, according to the current %s ";
     743        $mes .= "saved about %s energy and saved %s ";
     744       
     745        $server_conf = sprintf("(Your server has %s CPU cores, %s HD, %s network interfaces and %s mainboard devices.)",
     746                $hw['cpu_count'],
     747                $hw['hdd_count'],
     748                $hw['eth_count'],
     749                $hw['main_board_devices_count']);
    741750       
    742751        $mes = sprintf($mes,
     
    748757                c($c_sent, 'green'),
    749758                c($profited_watt.' kWh', 'green'),
    750                 c($profited_tree.' trees being shorn, thank you.', 'green'),
    751                 $hw['cpu_count'],
    752                 $hw['hdd_count'],
    753                 $hw['eth_count'],
    754                 $hw['main_board_devices_count']
     759                '<span title="'.$server_conf.'"><u>server configuration you</u></span>',
     760                c($profited_tree.' trees being shorn, thank you.', 'green')
    755761                );
    756762               
    757         $mes = _e($mes, 'wpgc');
     763        $mes = _($mes, 'wpgc');     
    758764        return $mes;
    759765    }   
  • wp-green-cache/trunk/options.php

    r428529 r434338  
    1717*/
    1818
    19 
    20 
    21 function wpsc_options()
     19function wpgc_options()
    2220{
    2321    if (is_admin())
    2422    {               
    2523        // Print warnings about directory permisions
    26         $wpsc_ok = wpsc_is_cache_writable() && wpsc_is_config_writable() && wpsc_check_configuration();
    27        
    28         if ( $wpsc_ok )
     24        $wpgc_ok = wpgc_is_cache_writable() && wpgc_is_config_writable() && wpgc_check_configuration();
     25       
     26        if ( $wpgc_ok )
    2927        {               
    3028            if (isset($_POST['save']))
    3129            {
    3230                // Clear inbound parameters
    33                 $old_options = wpsc_get_options();
     31                $old_options = wpgc_get_options();
    3432                $options = stripslashes_deep($_POST['options']);
    3533
    3634                // Clean cache switching on compressed/uncompressed modes
    3735                if ( $options['compress'] != $old_options['compress'] )
    38                     wpsc_clean_cache();
     36                    wpgc_clean_cache();
    3937               
    40                 wpsc_update_options($options);             
     38                wpgc_update_options($options);             
    4139               
    4240                // Activate/deactivate cache mechanism of wordpress
    4341                if ( $options['enabled'] != $old_options['enabled'] )
    4442                if ( $options['enabled'] )
    45                     wpsc_activate();           
     43                    wpgc_activate();           
    4644                else
    47                     wpsc_deactivate();             
     45                    wpgc_deactivate();             
    4846            }
    4947           
    50             if (isset($_POST['clean']))
    51                 wpsc_clean_cache();         
    52            
    53             $options = wpsc_get_options();
     48            if (isset($_GET['clean_cache']))
     49                wpgc_clean_cache();         
     50           
     51            $options = wpgc_get_options();
    5452        }
    5553        ?>
     
    5856            <tr >
    5957                <td valign='top' height='100'>
    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">
     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">
    6260                    </a>
    6361                </td>
     
    7371        </table>
    7472       
    75 <div class="wrap">
    76 <div id="poststuff" class="metabox-holder">
    77 <div class="meta-box-sortables">
     73        <div class="wrap">
     74        <div id="poststuff" class="metabox-holder">
     75        <div class="meta-box-sortables">
    7876        <script>
    7977            jQuery(document).ready(function($) {
     
    8482        </script>
    8583       
    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 )
     84        <?php if( !$wpgc_ok )
    9585            echo "<div style='background-color:#d0d0d0;z-index:1000;opacity:0.85'>";
    9686        ?>
     
    10090            <!-- #################################################################################### -->
    10191            <div class="postbox" id="dashboard_right_now">
    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>
     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>
     98                            <?php _e('Enable WP Green Cache', 'wpgc'); ?>
     99                            <input type="hidden" name="options[enabled]" value="0">&nbsp;&nbsp;&nbsp;&nbsp;
     100                            <input type="checkbox" name="options[enabled]" value="1" <?php echo $options['enabled']?'checked':''; ?>/> <br />
     101                        </td>
     102                    </tr>
     103                    <tr valign="top">                       
     104                        <td><?php echo wpgc_get_cache_status(); ?></td>
     105                    </tr>
     106                    <tr valign="top">                       
     107                        <td><?php echo wpgc_get_cache_gains(); ?></td>
     108                    </tr>               
     109                    <tr>
     110                        <td>
     111                           
     112                            <input class="button" type="submit" name="save" value="<?php _e('Save'); ?>" <?php echo (!$wpgc_ok) ? 'disabled':''; ?>>
     113                           
     114                        </td>
     115                    </tr>
     116                    </table>
     117                </div>
    116118            </div>
    117119           
    118120            <!-- #################################################################################### -->
    119             <div class="postbox" id="dashboard_right_now">
    120             <div class="handlediv" title="Click to open/close"><br /></div><h3 class='hndle'><?php _e('Cache settings', 'wpsc'); ?></h3>
     121            <div class="postbox closed" id="dashboard_right_now">
     122            <div class="handlediv" title="Click to open/close"><br /></div>
     123            <h3 class='hndle'><?php _e('Cache settings', 'wpgc'); ?></h3>
    121124            <div class="inside">           
    122125           
    123             <table class="form-table">
    124             <tr valign="top">
    125                 <th><?php _e('Enable WP Simple Cache', 'wpsc'); ?></th>
    126                 <td>
    127                     <input type="hidden" name="options[enabled]" value="0">
    128                     <input type="checkbox" name="options[enabled]" value="1" <?php echo $options['enabled']?'checked':''; ?>/> <br />
    129                 </td>
    130             </tr>               
    131             <tr valign="top">
    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>
     126            <table class="form-table">         
     127            <tr valign="top">
     128                <th><?php _e('Cached pages timeout', 'wpgc'); ?></th>
     129                <td>
     130                    <input type="text" size="5" name="options[cache_ttl]" value="<?php echo htmlspecialchars($options['cache_ttl']); ?>"/> (<?php _e('minutes', 'wpgc'); ?>) <br />
     131                    <?php _e('Minutes a cached page is valid and served to users. A zero value means a cached page is valid forever.', 'wpgc'); ?>
     132                    <?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'); ?>
     133                    <?php _e('720 minutes is half a day, 1440 is a full day and so on.', 'wpgc'); ?>
     134                </td>
     135            </tr>
     136            <tr valign="top">
     137                <th><?php _e('Cache autoclean', 'wpgc'); ?></th>
    142138                <td>
    143139                    <input type="hidden" name="options[last_cleaning]" value="<?php echo $options['last_cleaning']; ?>">
    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>
     140                    <input type="text" size="5" name="options[clean_interval]" value="<?php echo htmlspecialchars($options['clean_interval']); ?>"/> (<?php _e('minutes', 'wpgc'); ?>) <br />
     141                    <?php _e('Frequency of the autoclean process which removes to expired cached pages to free disk space.', 'wpgc'); ?>
     142                    <?php _e('If Cache autoclean is set to zero, autoclean never runs.', 'wpgc'); ?>
     143                </td>
     144            </tr>
     145            <tr valign="top">
     146                <th><?php _e('Compression', 'wpgc'); ?></th>
     147                <td>
     148                <?php if (!wpgc_check_gz_funcs()) { ?>
     149                <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>
    154150                <?php } else { ?>
    155151                    <input type="hidden" name="options[compress]" value="0">
    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'); ?>
     152                    <input type="checkbox" name="options[compress]" value="<?php echo wpgc_check_gz_funcs(); ?>" <?php echo $options['compress']?'checked':''; ?> /> <br />
     153                    <?php _e('If possible the page will be sent and stored as compressed to save bandwidth and storege quate.', 'wpgc'); ?>
     154                    <?php _e('If you switch this option then the cache will be cleaned.', 'wpgc'); ?>
    159155                <?php } ?>     
    160156                </td>
    161157            </tr>
    162158            <tr valign="top">
    163                 <th><?php _e('Show performance box', 'wpsc'); ?></th>
     159                <th><?php _e('Show performance box', 'wpgc'); ?></th>
    164160                <td>
    165161                    <input type="hidden" name="options[perf_footer]" value="0">
    166162                    <input type="checkbox" name="options[perf_footer]" value="1" <?php echo $options['perf_footer']?'checked':''; ?>/> <br />
    167                     <?php _e('When activated the performance box it will be attached to top-right of every page.', 'wpsc'); ?>
     163                    <?php _e('When activated the performance box it will be attached to top-right of every page.', 'wpgc'); ?>
    168164                    <?php _e('Performance box views SQL query count and page generation time that you inform about blog performance.', 'hyper-cache'); ?>
    169                     <?php _e('I suggest you to see advantage of WPSC compare the values when WPSC is enabled and disabled.', 'wpsc'); ?>
     165                    <?php _e('I suggest you to see advantage of wpgc compare the values when wpgc is enabled and disabled.', 'wpgc'); ?>
    170166                </td>
    171167            </tr>
     
    173169                <td>
    174170                    <p class="submit">
    175                     <input class="button" type="submit" name="save" value="<?php _e('Update'); ?>" <?php echo (!$wpsc_ok) ? 'disabled':''; ?>>
     171                    <input class="button" type="submit" name="save" value="<?php _e('Update'); ?>" <?php echo (!$wpgc_ok) ? 'disabled':''; ?>>
    176172                    </p>
    177173                </td>
     
    183179            <!-- #################################################################################### -->
    184180            <div class="postbox closed" id="dashboard_right_now">
    185             <div class="handlediv" title="Click to open/close"><br /></div><h3 class='hndle'><?php _e('Extra options', 'wpsc'); ?></h3>
     181            <div class="handlediv" title="Click to open/close"><br /></div><h3 class='hndle'><?php _e('Extra options', 'wpgc'); ?></h3>
    186182            <div class="inside">   
    187183                <table class="form-table">
    188184                <tr valign="top">
    189                     <th><?php _e('Include php', 'wpsc'); ?></th>
     185                    <th><?php _e('Include php', 'wpgc'); ?></th>
    190186                    <td>
    191187                        <input type="text" size="70" name="options[include_php]" value="<?php echo htmlspecialchars($options['include_php']); ?>"/><br>
    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'); ?>
     188                        <?php _e('When wpgc is active if you run any php script write the path of script starting from server root.', 'wpgc'); ?><br>
     189                        <?php _e('Example: ', 'wpgc'); ?>
    194190                        <?php echo '<i>'.dirname(__FILE__).'/example.php'.'</i>'; ?>
    195191                    </td>
     
    198194                    <td>
    199195                        <p class="submit">
    200                         <input class="button" type="submit" name="save" value="<?php _e('Update'); ?>" <?php echo (!$wpsc_ok) ? 'disabled':''; ?>>
     196                        <input class="button" type="submit" name="save" value="<?php _e('Update'); ?>" <?php echo (!$wpgc_ok) ? 'disabled':''; ?>>
    201197                        </p>
    202198                    </td>
     
    207203           
    208204        </form>
    209         <?php if (!$wpsc_ok)
     205        <?php if (!$wpgc_ok)
    210206            echo "</div>";
    211207        ?>
  • wp-green-cache/trunk/plugin.php

    r434175 r434338  
    33 Plugin Name: WP Green Cache
    44 Plugin URI: http://www.tankado.com/wp-green-cache/
    5  Version: 0.1.3
     5 Version: 0.1.4
    66 Description: WP Green Cache plugin is a cache system for WordPress Blogs to improve performance and save the World.
    77 Author: Özgür Koca
  • wp-green-cache/trunk/readme.txt

    r434175 r434338  
    63633. Make "/wp-content/plugins/wp-green-cache/cache/" directory writable (0777)
    64644. Add this line to the wp-config.php file ("/wp-config.php"): define('WP_CACHE', true);
     655. Set file access permision to 640 for wp-config.php (for security)
    65665. Go into the WordPress admin interface and activate the plugin
    66676. Go to the options page and enabled it
     
    110111== Changelog ==
    111112
     113= 0.1.4 =
     114
     115* Fixed bugs
     116
    112117= 0.1.3 =
    113118
Note: See TracChangeset for help on using the changeset viewer.