Plugin Directory

Changeset 1854365


Ignore:
Timestamp:
04/06/2018 09:38:27 PM (8 years ago)
Author:
imthiaz
Message:
  • Fixed bug which clears all setting during update
  • Now it also adds the images which are one folder outside css file
  • Bumped to new version 1.5
Location:
wp-s3/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-s3/trunk/readme.txt

    r1854236 r1854365  
    11=== Wordpress Amazon S3 Plugin ===
    2 Tags: Media, Amazon, S3, CDN, Admin, Uploads, Mirror
     2Tags: Media, Amazon, S3, CDN, Admin, Uploads, Mirror, Bandwidth, Content Delivery Network, Performance
    33Contributors: imthiaz
    44Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FMMYTX4JXJHF8
    55Requires at least: 2.3
    66Tested up to: 4.9.5
    7 Stable tag: 1.4
     7Stable tag: 1.5
     8Requires PHP: 5.6
    89License: LGPL
    910License URI: http://www.gnu.org/licenses/lgpl.html
    10 
    1111
    1212== Description ==
     
    1515== Installation ==
    16161. Copy plugin files to Wordpress wp-content/plugins folder
    17 2. Make sure you create a folder named 's3temp' in your media upload folder and make it writable. 
     172. Make sure you create a folder named 's3temp' in your media upload folder and make it writable.
    18183. Activate the plugin
    19194. Go to Amazon s3 page under plugins and set up your Amazon S3 credentials
     
    7474== Changelog ==
    7575
     76= Version: 1.5 Dated: 2018-04-06 =
     77* Fixed bug which clears all setting during update
     78* Now it also adds the images which are one folder outside css file
     79
    7680= Version: 1.4 Dated: 2018-04-06 =
    7781* Changed the S3 library to Amazon SDK
  • wp-s3/trunk/s3.php

    r1854236 r1854365  
    55Description: WP-S3 copies media files used in your blog post to Amazon S3 cloud. Uses only filters to replace the media urls in the post if media is available in the S3 cloud. Wordpress cron functionality is used for batching media upload to  S3. This plugin is very safe and will not modify anything in your database.
    66Author: Imthiaz Rafiq
    7 Version: 1.4
     7Version: 1.5
    88Author URI: https://www.imthi.com/
    99 */
     10
     11//function dump($var)
     12//{
     13//    print '<pre>';
     14//    print_r($var);
     15//    print '</pre>';
     16//}
    1017
    1118class S3Plugin
     
    211218    function deactivatePlugin()
    212219    {
    213         $query = "DROP TABLE IF EXISTS `{$this->tableImageQueue}`;";
    214         $this->db->query($query);
    215 
    216         $this->recursive_remove_directory($this->s3CacheFolder, true);
    217 
    218 
    219         delete_option('s3plugin_amazon_key_id');
    220         delete_option('s3plugin_amazon_secret_key');
    221         delete_option('s3plugin_amazon_bucket_name');
    222         delete_option('s3plugin_compress_files');
    223         delete_option('s3plugin_dir_prefix');
    224         delete_option('s3plugin_use_cloudfrontURL');
    225         delete_option('s3plugin_cloudfrontURL');
    226         delete_option('s3plugin_cron_interval');
    227         delete_option('s3plugin_cron_limit');
     220        /*
     221            $query = "DROP TABLE IF EXISTS `{$this->tableImageQueue}`;";
     222            $this->db->query($query);
     223
     224            $this->recursive_remove_directory($this->s3CacheFolder, true);
     225
     226            delete_option('s3plugin_amazon_key_id');
     227            delete_option('s3plugin_amazon_secret_key');
     228            delete_option('s3plugin_amazon_bucket_name');
     229            delete_option('s3plugin_compress_files');
     230            delete_option('s3plugin_dir_prefix');
     231            delete_option('s3plugin_use_cloudfrontURL');
     232            delete_option('s3plugin_cloudfrontURL');
     233            delete_option('s3plugin_cron_interval');
     234            delete_option('s3plugin_cron_limit');
     235        */
    228236    }
    229237
     
    430438                $cssFolder = dirname($realPath);
    431439                $cssRelatedFiles = $this->scanDirectoryRecursively($cssFolder);
     440
     441                $cssSearchImageFolder = realpath($cssFolder . DIRECTORY_SEPARATOR . '../images');
     442                if (is_dir($cssSearchImageFolder)) {
     443                    $newFiles = $this->scanDirectoryRecursively($cssSearchImageFolder);
     444                    if (!empty($newFiles)) {
     445                        $cssRelatedFiles = $cssRelatedFiles + $newFiles;
     446                    }
     447                }
    432448                if (!empty($cssRelatedFiles)) {
    433449                    foreach ($cssRelatedFiles as $relatedFile) {
     
    446462            $directory = substr($directory, 0, -1);
    447463        }
     464
    448465
    449466        $extensionToInclude = array('css', 'png', 'gif', 'jpg', 'jpeg', 'svg', 'eot', 'ttf', 'woff', 'woff2', 'js', 'otf');
Note: See TracChangeset for help on using the changeset viewer.