<?php
/**
 * Name: Disable Application Passwords
 * Description: Disable WordPress application passwords feature to prevent third-party apps from authenticating and reduce potential security attack vectors for site protection
 * Category: Security
 * Icon: -
 * UseCases: [
 *   {
 *     "title": "Close Security Loophole",
 *     "description": "Disable WordPress application passwords feature if you do not need it, reducing potential attack vectors."
 *   },
 *   {
 *     "title": "Enforce Standard Authentication",
 *     "description": "Ensure all users authenticate through your standard login system with your security policies applied."
 *   }
 * ]
 * Added: 2025-06-12
 * Tags: application-passwords, security, disable, authentication
 * WhereToFind: {
 *   "location": "Works automatically",
 *   "url": "",
 *   "instructions": "Application Passwords feature disabled for all users",
 *   "newTab": false
 * }
 */

// Prevent direct access
if (!defined('ABSPATH')) exit;

class SwitchboardDisableApplicationPasswords {

    public function __construct() {
        add_filter('wp_is_application_passwords_available', '__return_false');
    }

    /**
     * Register data locations for cleanup system
     *
     * @return array Data storage locations
     */
    public function register_data_locations() {
        return [
            'options' => [],
            'option_patterns' => [],
            'tables' => [],
            'post_meta' => [],
            'user_meta' => [],
        ];
    }
}

// Initialize and register with data system
$switchboard_instance = new SwitchboardDisableApplicationPasswords();
Switchboard_Data_Registry::get_instance()->auto_register($switchboard_instance, __FILE__);
