Plugin Directory

Changeset 3431708


Ignore:
Timestamp:
01/03/2026 03:19:46 PM (7 weeks ago)
Author:
ultradevs
Message:

Update to version 1.12.6 from GitHub

Location:
easy-dropbox-integration
Files:
2 added
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • easy-dropbox-integration/tags/1.12.6/app/Thumbnail.php

    r3424111 r3431708  
    8787        $this->thumbnails_location_url = EDBI_CACHE_DIR_URL . 'thumbnails/' . $account_id . '/';
    8888
     89        // Secure thumbnail location if no security.
     90        Helper::secure_directory_with_index( $this->thumbnails_location );
     91
     92        // Add .htaccess protection to the thumbnail directory.
     93        Helper::secure_cache_directory( $this->thumbnails_location );
     94
    8995        $this->size = $size;
    9096
     
    141147            $thumbnail = $thumbnail->getContents();
    142148
    143             if ( ! file_exists( $this->thumbnails_location ) ) {
    144                 wp_mkdir_p( $this->thumbnails_location );
    145             }
     149            // Secure the account-specific thumbnail directory with index.php.
     150            Helper::secure_directory_with_index( $this->thumbnails_location );
    146151
    147             // put a index.php inside location if not exists.
    148             if ( ! file_exists( $this->thumbnails_location . 'index.php' ) ) {
    149                 $wp_filesystem->put_contents( $this->thumbnails_location . 'index.php', '<?php exit; ?>', FS_CHMOD_FILE );
    150             }
    151 
    152             // file_put_contents( $file, $thumbnail );
     152            // Save the thumbnail file.
    153153            if ( ! $wp_filesystem->put_contents( $file, $thumbnail, FS_CHMOD_FILE ) ) {
    154154                return false;
  • easy-dropbox-integration/tags/1.12.6/easy-dropbox-integration.php

    r3431689 r3431708  
    2323 * Plugin URI:        https://ultradevs.com/easy-dropbox-integration/
    2424 * Description:       Easy DropBox Integration - Browse, Upload, Manage Your Dropbox Files from Your Website Easily.
    25  * Version: 1.12.5
     25 * Version: 1.12.6
    2626 * Author:            ultraDevs
    2727 * Author URI:        https://ultradevs.com
     
    3535
    3636// Constant.
    37 define( 'EDBI_VERSION', '1.12.5' );
     37define( 'EDBI_VERSION', '1.12.6' );
    3838define( 'EDBI_NAME', 'Easy Dropbox Integration' );
    3939define( 'EDBI_DIR_PATH', plugin_dir_path( __FILE__ ) );
  • easy-dropbox-integration/tags/1.12.6/includes/Activate.php

    r3431687 r3431708  
    9595
    9696        foreach ( $directories as $directory ) {
    97             if ( ! file_exists( $directory ) ) {
    98                 wp_mkdir_p( $directory );
    99             }
     97            // Secure directory with index.php file.
     98            Helper::secure_directory_with_index( $directory );
     99        }
    100100
    101             // Create an index.php file in the directory using WP_Filesystem.
    102             global $wp_filesystem;
    103 
    104             if ( empty( $wp_filesystem ) ) {
    105                 require_once ABSPATH . '/wp-admin/includes/file.php';
    106                 WP_Filesystem();
    107             }
    108 
    109             $index_content = "<?php\n// Silence is golden\n";
    110             $wp_filesystem->put_contents(
    111                 $directory . 'index.php',
    112                 $index_content,
    113                 FS_CHMOD_FILE
    114             );
    115         }
     101        // Add .htaccess protection to the main cache directory.
     102        Helper::secure_cache_directory( EDBI_CACHE_DIR );
    116103    }
    117104
  • easy-dropbox-integration/tags/1.12.6/includes/Helper.php

    r3424111 r3431708  
    15571557
    15581558    /**
     1559     * Secure Directory with Index File
     1560     *
     1561     * Creates an index.php file in a directory to prevent directory browsing.
     1562     *
     1563     * @param string $directory The directory path to secure.
     1564     * @return bool True if successful, false otherwise.
     1565     */
     1566    public static function secure_directory_with_index( $directory ) {
     1567        // Initialize WP_Filesystem if not already initialized.
     1568        global $wp_filesystem;
     1569
     1570        if ( empty( $wp_filesystem ) ) {
     1571            require_once ABSPATH . '/wp-admin/includes/file.php';
     1572            WP_Filesystem();
     1573        }
     1574
     1575        // Ensure directory exists.
     1576        if ( ! wp_mkdir_p( $directory ) ) {
     1577            return false;
     1578        }
     1579
     1580        $index_file = trailingslashit( $directory ) . 'index.php';
     1581
     1582        // Only create if it doesn't exist.
     1583        if ( ! $wp_filesystem->exists( $index_file ) ) {
     1584            $index_content = "<?php\n// Silence is golden.\n";
     1585            return $wp_filesystem->put_contents( $index_file, $index_content, FS_CHMOD_FILE );
     1586        }
     1587
     1588        return true;
     1589    }
     1590
     1591    /**
     1592     * Secure Cache Directory with .htaccess
     1593     *
     1594     * Creates a .htaccess file in the cache directory to deny direct access.
     1595     *
     1596     * @param string $cache_dir The cache directory path.
     1597     * @return bool True if successful, false otherwise.
     1598     */
     1599    public static function secure_cache_directory( $cache_dir ) {
     1600        // Initialize WP_Filesystem if not already initialized.
     1601        global $wp_filesystem;
     1602
     1603        if ( empty( $wp_filesystem ) ) {
     1604            require_once ABSPATH . '/wp-admin/includes/file.php';
     1605            WP_Filesystem();
     1606        }
     1607
     1608        // Ensure directory exists.
     1609        if ( ! wp_mkdir_p( $cache_dir ) ) {
     1610            return false;
     1611        }
     1612
     1613        $htaccess_file = trailingslashit( $cache_dir ) . '.htaccess';
     1614
     1615        // Only create if it doesn't exist.
     1616        if ( ! $wp_filesystem->exists( $htaccess_file ) ) {
     1617            $htaccess_content = "Deny from all\n";
     1618            return $wp_filesystem->put_contents( $htaccess_file, $htaccess_content, FS_CHMOD_FILE );
     1619        }
     1620
     1621        return true;
     1622    }
     1623
     1624    /**
    15591625     * Check Users Role
    15601626     *
  • easy-dropbox-integration/tags/1.12.6/includes/Updates.php

    r3424111 r3431708  
    3434        '1.7.0',
    3535        '1.12.0',
     36        '1.12.6',
    3637    ];
    3738
  • easy-dropbox-integration/tags/1.12.6/readme.txt

    r3431689 r3431708  
    55Requires at least: 5.3.2
    66Tested up to:      6.9
    7 Stable tag:       1.12.5
     7Stable tag:       1.12.6
    88Requires PHP:      7.4.0
    99License: GPLv2 or later
     
    147147
    148148== Changelog ==
     149
     150= 1.12.6 - 3 January, 2026 =
     151- **Improvement:** Thumbnail folder security.
    149152
    150153= 1.12.5 - 3 January, 2026 =
  • easy-dropbox-integration/trunk/app/Thumbnail.php

    r3424111 r3431708  
    8787        $this->thumbnails_location_url = EDBI_CACHE_DIR_URL . 'thumbnails/' . $account_id . '/';
    8888
     89        // Secure thumbnail location if no security.
     90        Helper::secure_directory_with_index( $this->thumbnails_location );
     91
     92        // Add .htaccess protection to the thumbnail directory.
     93        Helper::secure_cache_directory( $this->thumbnails_location );
     94
    8995        $this->size = $size;
    9096
     
    141147            $thumbnail = $thumbnail->getContents();
    142148
    143             if ( ! file_exists( $this->thumbnails_location ) ) {
    144                 wp_mkdir_p( $this->thumbnails_location );
    145             }
     149            // Secure the account-specific thumbnail directory with index.php.
     150            Helper::secure_directory_with_index( $this->thumbnails_location );
    146151
    147             // put a index.php inside location if not exists.
    148             if ( ! file_exists( $this->thumbnails_location . 'index.php' ) ) {
    149                 $wp_filesystem->put_contents( $this->thumbnails_location . 'index.php', '<?php exit; ?>', FS_CHMOD_FILE );
    150             }
    151 
    152             // file_put_contents( $file, $thumbnail );
     152            // Save the thumbnail file.
    153153            if ( ! $wp_filesystem->put_contents( $file, $thumbnail, FS_CHMOD_FILE ) ) {
    154154                return false;
  • easy-dropbox-integration/trunk/easy-dropbox-integration.php

    r3431689 r3431708  
    2323 * Plugin URI:        https://ultradevs.com/easy-dropbox-integration/
    2424 * Description:       Easy DropBox Integration - Browse, Upload, Manage Your Dropbox Files from Your Website Easily.
    25  * Version: 1.12.5
     25 * Version: 1.12.6
    2626 * Author:            ultraDevs
    2727 * Author URI:        https://ultradevs.com
     
    3535
    3636// Constant.
    37 define( 'EDBI_VERSION', '1.12.5' );
     37define( 'EDBI_VERSION', '1.12.6' );
    3838define( 'EDBI_NAME', 'Easy Dropbox Integration' );
    3939define( 'EDBI_DIR_PATH', plugin_dir_path( __FILE__ ) );
  • easy-dropbox-integration/trunk/includes/Activate.php

    r3431687 r3431708  
    9595
    9696        foreach ( $directories as $directory ) {
    97             if ( ! file_exists( $directory ) ) {
    98                 wp_mkdir_p( $directory );
    99             }
     97            // Secure directory with index.php file.
     98            Helper::secure_directory_with_index( $directory );
     99        }
    100100
    101             // Create an index.php file in the directory using WP_Filesystem.
    102             global $wp_filesystem;
    103 
    104             if ( empty( $wp_filesystem ) ) {
    105                 require_once ABSPATH . '/wp-admin/includes/file.php';
    106                 WP_Filesystem();
    107             }
    108 
    109             $index_content = "<?php\n// Silence is golden\n";
    110             $wp_filesystem->put_contents(
    111                 $directory . 'index.php',
    112                 $index_content,
    113                 FS_CHMOD_FILE
    114             );
    115         }
     101        // Add .htaccess protection to the main cache directory.
     102        Helper::secure_cache_directory( EDBI_CACHE_DIR );
    116103    }
    117104
  • easy-dropbox-integration/trunk/includes/Helper.php

    r3424111 r3431708  
    15571557
    15581558    /**
     1559     * Secure Directory with Index File
     1560     *
     1561     * Creates an index.php file in a directory to prevent directory browsing.
     1562     *
     1563     * @param string $directory The directory path to secure.
     1564     * @return bool True if successful, false otherwise.
     1565     */
     1566    public static function secure_directory_with_index( $directory ) {
     1567        // Initialize WP_Filesystem if not already initialized.
     1568        global $wp_filesystem;
     1569
     1570        if ( empty( $wp_filesystem ) ) {
     1571            require_once ABSPATH . '/wp-admin/includes/file.php';
     1572            WP_Filesystem();
     1573        }
     1574
     1575        // Ensure directory exists.
     1576        if ( ! wp_mkdir_p( $directory ) ) {
     1577            return false;
     1578        }
     1579
     1580        $index_file = trailingslashit( $directory ) . 'index.php';
     1581
     1582        // Only create if it doesn't exist.
     1583        if ( ! $wp_filesystem->exists( $index_file ) ) {
     1584            $index_content = "<?php\n// Silence is golden.\n";
     1585            return $wp_filesystem->put_contents( $index_file, $index_content, FS_CHMOD_FILE );
     1586        }
     1587
     1588        return true;
     1589    }
     1590
     1591    /**
     1592     * Secure Cache Directory with .htaccess
     1593     *
     1594     * Creates a .htaccess file in the cache directory to deny direct access.
     1595     *
     1596     * @param string $cache_dir The cache directory path.
     1597     * @return bool True if successful, false otherwise.
     1598     */
     1599    public static function secure_cache_directory( $cache_dir ) {
     1600        // Initialize WP_Filesystem if not already initialized.
     1601        global $wp_filesystem;
     1602
     1603        if ( empty( $wp_filesystem ) ) {
     1604            require_once ABSPATH . '/wp-admin/includes/file.php';
     1605            WP_Filesystem();
     1606        }
     1607
     1608        // Ensure directory exists.
     1609        if ( ! wp_mkdir_p( $cache_dir ) ) {
     1610            return false;
     1611        }
     1612
     1613        $htaccess_file = trailingslashit( $cache_dir ) . '.htaccess';
     1614
     1615        // Only create if it doesn't exist.
     1616        if ( ! $wp_filesystem->exists( $htaccess_file ) ) {
     1617            $htaccess_content = "Deny from all\n";
     1618            return $wp_filesystem->put_contents( $htaccess_file, $htaccess_content, FS_CHMOD_FILE );
     1619        }
     1620
     1621        return true;
     1622    }
     1623
     1624    /**
    15591625     * Check Users Role
    15601626     *
  • easy-dropbox-integration/trunk/includes/Updates.php

    r3424111 r3431708  
    3434        '1.7.0',
    3535        '1.12.0',
     36        '1.12.6',
    3637    ];
    3738
  • easy-dropbox-integration/trunk/readme.txt

    r3431689 r3431708  
    55Requires at least: 5.3.2
    66Tested up to:      6.9
    7 Stable tag:       1.12.5
     7Stable tag:       1.12.6
    88Requires PHP:      7.4.0
    99License: GPLv2 or later
     
    147147
    148148== Changelog ==
     149
     150= 1.12.6 - 3 January, 2026 =
     151- **Improvement:** Thumbnail folder security.
    149152
    150153= 1.12.5 - 3 January, 2026 =
Note: See TracChangeset for help on using the changeset viewer.