=== AppPass Removal ===
Contributors: jodriscoll
Tags: application passwords, security, rest api, xml-rpc, hardening
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 2.0.12
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Turns Application Passwords off site-wide: the profile screen, the REST API, XML-RPC sign-in, and any plugin that tries to turn them back on.

== Description ==

Application Passwords let a person sign in to the REST API and XML-RPC with a separate password. That password stays valid after the account password changes, and it never goes through the normal login screen. AppPass Removal turns the feature off for the whole site.

While removal is on:

* Nobody can create, list, or sign in with an application password.
* The Application Passwords section is hidden on user profiles.
* The REST route `/wp-json/wp/v2/users/<id>/application-passwords` is removed, and a direct request to it is rejected.
* `wp-admin/authorize-application.php` cannot issue a password.
* Another plugin cannot turn the feature back on through the `wp_is_application_passwords_available` filter.

Removal is on as soon as the plugin is activated. Turn it off from **Settings → AppPass Removal** to restore normal WordPress behavior.

The settings screen also has a **Usages** tab. It lists the WordPress screens that use Application Passwords, then scans the active plugins, must-use plugins, and active theme on this site for code that references them. The scan runs only when an administrator opens the screen. Nothing is stored and nothing is sent anywhere.

= What it does not do =

The plugin does not delete application passwords already stored on user accounts. Those passwords cannot be used while removal is on, and they work again if you turn removal off or delete the plugin.

== Installation ==

1. In your WordPress admin, go to **Plugins → Add New Plugin** and search for "AppPass Removal".
2. Click **Install Now**, then **Activate**.
3. Application Passwords are now removed. Open **Settings → AppPass Removal** to check the status or turn removal off.

= Composer =

`composer require wpackagist-plugin/apppass-removal`

= Must-use plugin =

The plugin also works as a must-use plugin, so it cannot be turned off from the Plugins screen. Place the `apppass-removal` folder in `wp-content/mu-plugins/` and load it with a loader file or the Bedrock Autoloader, because WordPress only auto-loads PHP files placed directly in `mu-plugins/`.

== Frequently Asked Questions ==

= Who can open the settings screen? =

Anyone with the `manage_options` capability: Administrators, and super admins on multisite. Anyone else who opens the URL is turned away, and the menu item is hidden from them.

To require a different capability, add a filter:

`add_filter( 'apppass_removal_required_capability', fn() => 'manage_network_options' );`

= Will this break an integration that uses an application password? =

Yes, while removal is on. Turn removal off only when a trusted integration needs an application password.

= Does it delete existing application passwords? =

No. They are kept on the user account but cannot be used while removal is on.

= What happens when I delete the plugin? =

The plugin removes its one setting, `apppass_removal_enabled`, and WordPress behaves normally again.

== Screenshots ==

1. The Removal tab, with the toggle that turns Application Passwords off.
2. The Usages tab, listing WordPress screens and code on this site that reference Application Passwords.

== Changelog ==

= 2.0.12 =
* First release on WordPress.org.

== Upgrade Notice ==

= 2.0.12 =
First release on WordPress.org.
