Plugin Directory

Changeset 3064592


Ignore:
Timestamp:
04/04/2024 11:04:52 AM (2 years ago)
Author:
cyberorange
Message:

Prevent files and folder access release v2.5.4

Location:
prevent-file-access
Files:
59 added
3 edited

Legend:

Unmodified
Added
Removed
  • prevent-file-access/trunk/README.txt

    r2977025 r3064592  
    44Tags: protect uploads, secure-files, content-restriction, protect-folders, media restriction, media management, download logs
    55Requires at least: 3.0.1
    6 Tested up to: 6.3
     6Tested up to: 6.5
    77Requires PHP: 5.6
    8 Stable tag: 2.5.3
     8Stable tag: 2.5.4
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    143143
    144144== Changelog ==
     145= 2.5.4 =
     146* Added Compatibility with WordPress 6.5
     147* Handled server rules removal on plugin deactivation.
     148
    145149= 2.5.3 =
    146150* Added an advertisement for the All Inclusive Plan.
     
    218222
    219223== Upgrade Notice ==
     224= 2.5.4 =
     225* Added Compatibility with WordPress 6.5
     226* Handled server rules removal on plugin deactivation.
     227
    220228= 2.5.3 =
    221229* Added an advertisement for the All Inclusive Plan.
  • prevent-file-access/trunk/includes/class-media-restriction-deactivator.php

    r2896658 r3064592  
    3333        delete_option( 'mo_media_restriction_admin_customer_key' );
    3434        delete_option( 'mo_media_restriction_new_user' );
     35
     36        $home_path     = get_home_path();
     37        $htaccess_file = $home_path . '.htaccess'; // Specify the path to your .htaccess file.
     38
     39        // Read the existing .htaccess file content.
     40        $existing_content = file_get_contents( $htaccess_file );
     41
     42        // Remove the content between BEGIN and END MINIORANGE MEDIA RESTRICTION.
     43        $updated_content = preg_replace( '/# BEGIN MINIORANGE MEDIA RESTRICTION(.*?)# END MINIORANGE MEDIA RESTRICTION/ms', '', $existing_content );
     44        // Write the updated content back to the .htaccess file.
     45        file_put_contents( $htaccess_file, $updated_content );
    3546    }
    3647
  • prevent-file-access/trunk/media-restriction.php

    r2977025 r3064592  
    44 * Plugin URI: http://miniorange.com
    55 * Description: Allows to protect your files and folders (wp-content, uploads, images, pdf, documents) from public access, Role base folder access, User base folder access, giving access to only logged in users.
    6  * Version: 2.5.3
     6 * Version: 2.5.4
    77 * Author: miniOrange
    88 * Author URI: http://miniorange.com
     
    2222 * Rename this for your plugin and update it as you release new versions.
    2323 */
    24 define( 'MO_MEDIA_RESTRICTION_PLUGIN_NAME_VERSION', '2.5.3' );
     24define( 'MO_MEDIA_RESTRICTION_PLUGIN_NAME_VERSION', '2.5.4' );
    2525/**
    2626 * The code that runs during plugin activation.
Note: See TracChangeset for help on using the changeset viewer.