=== Jeet 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.1.2
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.com/

== Description ==

Jeet File Manager gives administrators direct access to the files inside the WordPress installation directory. Open the Jeet 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.
* 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 File Manager.
4. Open Jeet 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 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.com/. 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 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.

== Changelog ==

= 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.com/.
* 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.
