Skip to content

Commit

Permalink
v7,0-b30: * **Misc** Generated robots.txt file under litespeed folder…
Browse files Browse the repository at this point in the history
… to prevent from search engine indexing of static resource files. (djwilko12)
  • Loading branch information
Hai Zheng committed Jan 9, 2025
1 parent 0becda1 commit a0cd0dc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions litespeed-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: LiteSpeed Cache
* Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
* Description: High-performance page caching and site optimization from LiteSpeed
* Version: 7.0-b29
* Version: 7.0-b30
* Author: LiteSpeed Technologies
* Author URI: https://www.litespeedtech.com
* License: GPLv3
Expand Down Expand Up @@ -34,7 +34,7 @@
return;
}

!defined('LSCWP_V') && define('LSCWP_V', '7.0-b29');
!defined('LSCWP_V') && define('LSCWP_V', '7.0-b30');

!defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR);
!defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro
* **Misc** Check filename is valid or not before saving file to fix the possible Object Cache log issue. (Mahdi Akrami #761)
* **Misc** Fixed PHP 7.2 compatibility in cloud message. (Viktor Szépe #771)
* **Misc** Incompatibility warning banner for third party plugins is now dismissible.
* **Misc** Generated robots.txt file under litespeed folder to prevent from search engine indexing of static resource files. (djwilko12)

= 6.5.4 - Dec 16 2024 =
* **Page Optimize** Fixed Google Fonts broken with the Async option. (HivePress #787)
Expand Down
4 changes: 4 additions & 0 deletions src/file.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ public static function save($filename, $data, $mkdir = false, $append = false, $

try {
mkdir($folder, 0755, true);
// Create robots.txt file to forbid search engine indexes
if (!file_exists(LITESPEED_STATIC_DIR . '/robots.txt')) {
file_put_contents(LITESPEED_STATIC_DIR . '/robots.txt', "User-agent: *\nDisallow: /\n");
}
} catch (\ErrorException $ex) {
return $silence ? false : sprintf(__('Can not create folder: %1$s. Error: %2$s', 'litespeed-cache'), $folder, $ex->getMessage());
}
Expand Down

0 comments on commit a0cd0dc

Please sign in to comment.