=== File Scan Code Search ===
Contributors: madebysaad
Tags: security, scanner, code search, malware scan
Requires at least: 5.2
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Scan server files from the admin area and search for suspicious patterns. Read-only by design.

== Description ==
File Scan Code Search adds an admin-only tool (Tools → File Scan) that searches code across common WordPress directories and (optionally) additional server paths.
It is designed for debugging and incident response workflows: it reads files and reports matches, without modifying anything.

Developer: Mohamed Saad - https://madebysaad.com/

Documentation: https://madebysaad.com/file-scan-code-search/

= Key Features =
* Preset locations (auto-detected): WordPress core, wp-content, plugins, themes, uploads, and more.
* Custom path scanning with safe validation.
* Optional advanced scanning outside WordPress (requires explicit wp-config.php opt-in).
* Regex and case-sensitive search options.
* Performance safeguards (limits to prevent accidental heavy scans).

== Installation ==
1. Upload the plugin folder to /wp-content/plugins/
2. Activate the plugin through the Plugins menu
3. Go to Tools → File Scan

== Frequently Asked Questions ==
= Does this plugin modify files? =
No. It only reads files and reports results.

= How can I scan outside WordPress? =
You must explicitly enable advanced mode via wp-config.php (see the Advanced tab inside the plugin screen).

== Screenshots ==
1. Search tab (locations and options)
2. Advanced tab (opt-in configuration)
3. Help tab (how-to and safety notes)

== Changelog ==
= 1.0.5 =
* Max depth now works: 0 searches every subfolder, and a number from 1 to 100 searches the chosen folder and that many levels of subfolders below it (1 = the folder and its direct subfolders). Until now the number was ignored and every search included all subfolders. The box accepts 0 to 100, and the help text under it now says what the number means.
* A folder PHP cannot read no longer ends the search with "AJAX error". Subfolders PHP cannot open, broken symbolic links and other entries PHP cannot read are skipped, and the rest of the folder is searched. If the chosen folder itself cannot be read, the search stops with a message saying so.
* Fixed PHP warnings: "Undefined variable $max_depth" on every search; "Undefined variable $tab" on the Advanced and Help tabs (an unused copy of the Advanced tab was removed, the screen is unchanged); one warning per file and folder when File Extensions contains "/" (such a list also matched no file at all; the other extensions in it now work); and, on servers that set open_basedir, an "open_basedir restriction in effect" warning for each (advanced) folder outside it, every time the screen loaded or a search ran.

= 1.0.4 =
* Plugins screen: added a Settings link that opens Tools → File Scan, and a Documentation link that appears only when WordPress does not already link to the plugin page.
* Help tab: the plugin link now points to https://madebysaad.com/file-scan-code-search/.
* The FSC_VERSION constant now matches the plugin version (it said 1.0.2), which also updates the version on the admin CSS and JS URLs.
* Readme: Contributors is now madebysaad, and the description names the developer and the documentation page.
* Plugin header: Author URI now ends with a slash.

= 1.0.3 =
Depth selector and improved root scan limits. (The depth selector, Max depth, had no effect on searches until 1.0.5.)

= 1.0.0 =
Initial release.
