=== Jeet Sanwal File Manager ===
Contributors: jeetsanwal
Tags: file manager, administrator, file editor, upload, developer
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A small, clean file manager inside your WordPress dashboard.

Created by Jeet Sanwal — https://jeetsanwal.in/

== Description ==

Jeet Sanwal File Manager gives administrators direct access to the files inside the WordPress installation directory. Open the Jeet Sanwal File Manager menu after activation; there is no configuration screen and no external account required.

Features:
* Folder navigation with breadcrumbs, an editable address bar, back/forward history and quick-access shortcuts.
* List and grid layouts, image thumbnails, multi-selection using checkboxes, Ctrl/Cmd-click, Shift-click or Select all.
* Bulk copy, move, delete and ZIP download; a browsable destination picker keeps folder transfers simple.
* Search/filter the current folder, sortable columns and a hidden-files toggle.
* View and edit text/code files with the WordPress code editor, line numbers and syntax highlighting when enabled in your profile.
* Fullscreen editor, text search, word wrap and Ctrl+S / Cmd+S to save; prompts before discarding unsaved edits.
* Go to line moves the cursor to an exact line in both code and plain-text editors, including read-only files. It does not change file contents.
* Find treats search text literally and preserves correct selection offsets after Unicode characters such as dotted capital I and emoji.
* A previous-version restore point is stored privately in the database before each successful edit.
* Conflict detection prevents silently overwriting a file changed since you opened it.
* PHP syntax is checked before an editor save to catch parsing errors before changing the file.
* Multiple uploads and drag-and-drop upload, with visible progress.
* Prominent New file button with TXT, PHP, JS, CSS, HTML, JSON, Markdown, XML and custom extension choices.
* New folders, rename, recursive folder copy, file/folder move and confirmed recursive folder deletion.
* ZIP creation and extraction, including complete folders and multiple selected items.
* Private, authenticated previews for images, PDF, audio and video; file/folder properties include size and permissions.
* Right-click context menu, internal copy/cut/paste clipboard and standard keyboard shortcuts.
* Responsive interface, keyboard-accessible dialogs, error messages and a read-only mode.

Access requires both manage_options and the primitive edit_files capability, checked through the named jeet_fm_access capability. This keeps settings-only custom roles out while retaining read-only access for administrators when file changes are disabled. On WordPress Multisite, users must also be super administrators. Every request checks permissions and a session nonce. No public upload or download endpoint is registered. Symlinks and paths outside the configured root are blocked. Hosts may revoke jeet_fm_access through WordPress capability filters.

The plugin uses PHP filesystem access with the permissions of your web server. It cannot bypass hosting permissions or provide FTP/SFTP access. The browser never directly executes or previews a selected PHP/HTML file; downloads are attachments.

== Installation ==

1. In WordPress, go to Plugins > Add New Plugin > Upload Plugin.
2. Select jeet-file-manager.zip and choose Install Now.
3. Activate Jeet Sanwal File Manager.
4. Open Jeet Sanwal File Manager in the dashboard sidebar.

You may also upload the jeet-file-manager folder to wp-content/plugins and activate it.

To update an existing installation, upload the new ZIP and choose Replace current with uploaded. Keep the same plugin folder; uninstalling is not necessary and would remove saved editor restore points.

If switching from a differently named file manager, deactivate the previous plugin and then install/activate Jeet Sanwal File Manager. This ZIP installs in its own jeet-file-manager folder. Previously saved restore points remain with the previous plugin. Reapply any custom root restriction using JEET_FM_ROOT.

== Frequently Asked Questions ==

= Which files can I access? =

By default, files under ABSPATH, the WordPress installation directory. A wp-config.php stored above that directory is outside the root. Symlinks are listed but cannot be opened or changed. Files must be readable by PHP; changes also require writable files/directories.

= Why are changes disabled? =

The plugin respects DISALLOW_FILE_MODS, DISALLOW_FILE_EDIT and wp_is_file_mod_allowed( 'jeet_file_manager' ), including the file_mod_allowed filter. When changes are denied, uploads and all other writes are disabled; authorized administrators retain browsing, text viewing and downloads. The plugin also protects its own files from modification while active, and blocks destructive changes to essential WordPress paths.

= How are updates delivered? =

This edition is distributed independently from https://jeetsanwal.in/. Download a new release ZIP from the website, then use Plugins > Add New Plugin > Upload Plugin and Replace current with uploaded. No automatic updater or external update service is included. The Update URI header prevents a similarly named WordPress.org plugin from replacing this edition.

= How do restore points work? =

Before saving a text file, the previous content is stored in a non-autoloaded WordPress database option. Restore swaps the current file with its most recent restore point. There are at most 20 file restore points, each limited to 2 MiB. They are not downloadable web files. Restore points are not full-site backups and do not cover upload, deletion, rename, move or copy operations. Deactivation retains restore points; uninstall removes them.

= What are the limits? =

The text editor supports UTF-8 text files up to 2 MiB, including custom text extensions and extensionless files. Known binary formats must be previewed or downloaded. Uploads allow up to 64 MiB per file, or the hosting/WordPress limit if smaller. Individual copied files must be 64 MiB or smaller. Folder operations and ZIPs support up to 5,000 entries, 128 MiB of content and 30 folder levels. Bulk selections support 100 top-level items. Existing files are never overwritten by create, upload, copy, rename, move or extraction. Extraction creates a new destination folder and validates paths, entry types, expansion size and integrity before writing. Encrypted, damaged and oversized ZIPs are rejected. Permission bits are displayed as information; changing server permissions is not included.

= Does ZIP require a server extension? =

ZIP compression, extraction and multiple-item/folder downloads require PHP ZipArchive. The interface explains when it is unavailable. Individual file downloads and the other tools still work without it. Temporary download archives are stored outside the web root, use restricted permissions, and are removed after streaming. Persistent archives cannot include known credential files such as wp-config.php or .env; authenticated temporary downloads can include them.

= How do selection and opening work? =

Click an item to select it; double-click or choose Open / edit to open it. Checkboxes support several selections at once. Ctrl/Cmd-click toggles individual items; Shift-click selects a range. Ctrl/Cmd+A selects visible items. Ctrl/Cmd+C, X and V use the file manager clipboard. F2 renames, Delete opens the deletion confirmation, and F5 refreshes the folder. Filtering or navigating clears the selection.

= Can I restrict the root? =

An administrator can define JEET_FM_ROOT in wp-config.php before WordPress loads, for example:

define( 'JEET_FM_ROOT', __DIR__ . '/wp-content' );

Use an existing local absolute directory. This is an optional server-side setting, not a browser-editable path. Only files inside that directory are accessible.

= Does it need an external service? =

No. Jeet Sanwal File Manager includes its UI assets and uses WordPress's bundled code editor. It does not send files to external services or load fonts/scripts from a CDN.

== Updating an existing installation ==

Download this plugin's individual ZIP from https://jeetsanwal.in/tools/jeet-file-manager . Make a normal site backup and try the update on staging first. In WordPress, use Plugins > Add New > Upload Plugin and choose Replace current with uploaded when WordPress detects the existing installation. Keep the same plugin folder; do not uninstall/delete the plugin as an update step. Confirm the displayed version is 1.2.1, then reopen the plugin's normal screen and check one representative workflow described above. Clear relevant page caches if public output remains stale.

Updates are installed manually; a matching Update URI prevents unrelated directory plugins from replacing this package, but does not provide an update service. If replacement fails, check hosting upload limits and write permissions before retrying. To roll back, replace the plugin files with your saved previous ZIP; file replacement alone does not restore database records or deleted files. Use your site backup when data restoration is needed. Read this plugin's retention notes before deliberately uninstalling it.

Author and support: Jeet Sanwal — https://jeetsanwal.in/contact

== Optional installation reports ==

Installation reports are optional and OFF by default. Installing, activating, or using this product does not submit a report. Administrators can choose consent separately for each product under Settings > Jeet Sanwal Reports. All product features remain available with reporting off.

After explicit consent, the client sends the website URL, a random installation ID, product/WordPress/PHP versions, reported state, and an observed activation timestamp when available to https://jeetsanwal.in/api/v1/plugin-reports. While that product is active and consent remains enabled, a daily WordPress cron check-in can update its last-known status. WP-Cron depends on site traffic and hosting; it is not a continuous monitor.

Pause stops future reports without deleting records already shared. Forget requests deletion of the remote installation entry and history, retrying deletion if delivery fails. Records automatically expire after 90 days without a check-in. The plugin does not send page content, files, database exports, administrator email addresses, or raw IP addresses. Server rate limiting keeps a keyed IP hash for up to 24 hours; ordinary hosting access logs are governed separately by the privacy policy.

Review the fields and consent before enabling reporting. Read https://jeetsanwal.in/privacy for the reporting endpoint, retention, and deletion details. Reporting does not authorize remote control, automatic updates, or access to the website.

== Changelog ==

= 1.2.1 =
* Updated the product display name to Jeet Sanwal File Manager and retained the Jeet Sanwal author website.
* Added voluntary installation/status reports with per-product consent OFF by default, pause/forget controls, and documented fields and retention.
* Preserved existing identifiers, stored data, permissions, and earlier release history.


= 1.2.0 =
* Fixed Find selection offsets after Unicode case expansion and kept search metacharacters literal.
* Added Go to line with bounded whole-number validation, editor focus and support for both the code editor and plain-text fallback.

= 1.1.6 =
* Added a complete US English installation and update guide; kept documented permissions, limits and manual rollback steps.


= 1.1.5 =
* Clarified the manual replacement, verification and rollback workflow, with direct author support details.
* Rechecked package metadata, source/archive consistency and existing isolated regressions.


= 1.1.4 =
* Use atomic, ownership-checked editor backup locks so simultaneous saves cannot replace another save claim.

= 1.1.3 =
* Updated author and download links to the official jeetsanwal.in website.

= 1.1.2 =
* Restricted manager access to users with settings and file authority, preserving administrator read-only access when writes are disabled.
* Added support for the WordPress file_mod_allowed filter across every write operation.
* Kept one locked, identity-checked handle from download/preview validation through streaming, with separate private ZIP cleanup.
* Added independent-distribution update protection and documented manual website updates.

= 1.1.1 =
* Personal branding: Jeet File Manager, by Jeet Sanwal, https://jeetsanwal.in/.
* Updated plugin identity, interface, downloads, code prefixes and documentation.

= 1.1.0 =
* Added full bulk actions, list/grid views, previews, ZIP creation/extraction, folder transfers, properties and clipboard shortcuts.
* Moved New file into the main toolbar and added file format choices.
* Reworked styles with screen-scoped CSS and fixed editor sizing, focus, search and fullscreen behavior.
* Added bounded recursive operations and ZIP integrity/path validation.

= 1.0.0 =
* Initial release of Jeet File Manager.
