{
  "id": "global",
  "status": "always-active",
  "load": "early",
  "title": "Global Settings",
  "description": "Configure basic settings that control how Solid Security functions.",
  "help": "Changes made here are applied globally throughout Solid Security’s settings. For example, the lockout settings and messages are used by all of Solid Security’s lockout features.",
  "type": "recommended",
  "tools": {
    "identify-server-ips": {
      "title": "Identify Server IPs",
      "description": "Determines the list of IP addresses your server uses when making HTTP requests.",
      "help": "The correct list of server IPs is important to prevent erroneous lockouts and trusted device errors.",
      "schedule": "identify-server-ips"
    }
  },
  "scheduling": {
    "identify-server-ips": {
      "type": "recurring",
      "schedule": "daily"
    }
  },
  "user-groups": {
    "manage_group": {
      "type": "multiple",
      "title": "Manage Solid Security",
      "description": "Allow users to manage Solid Security."
    }
  },
  "settings": {
    "type": "object",
    "properties": {
      "write_files": {
        "type": "boolean",
        "default": true,
        "title": "Write to Files",
        "description": "Allow Solid Security to write to wp-config.php and .htaccess automatically. If this box is not checked, you will need to edit those files manually."
      },
      "nginx_file": {
        "type": "string",
        "format": "file-path",
        "title": "NGINX Conf File",
        "description": "This path must be writable by WordPress. For security reasons, we recommend you do not include it in your website’s root folder.",
        "default": ""
      },
      "lockout_period": {
        "type": "integer",
        "minimum": 0,
        "default": 15,
        "title": "Minutes to Lockout",
        "description": "The length of time an IP address or user will be locked out from this site after hitting the limit for failed logins. The default setting of 15 minutes is recommended. Increasing it could prevent attackers from being banned."
      },
      "blacklist_period": {
        "type": "integer",
        "minimum": 0,
        "default": 7,
        "title": "Days to Remember Lockouts",
        "description": "How many days should Solid Security remember a lockout? This does not affect the logs generated when creating a lockout."
      },
      "blacklist": {
        "type": "boolean",
        "default": true,
        "title": "Ban Repeat Offender",
        "description": "Permanently add a locked-out IP address to the “Ban Users” list after reaching the configured “Ban Threshold.”"
      },
      "blacklist_count": {
        "type": "integer",
        "minimum": 0,
        "default": 3,
        "title": "Ban Threshold",
        "description": "The number of lockouts Solid Security must remember before permanently banning the attacker."
      },
      "lockout_message": {
        "type": "string",
        "format": "html",
        "default": "error",
        "title": "IP Lockout Message",
        "description": "Display this message when an IP address has been locked out."
      },
      "user_lockout_message": {
        "type": "string",
        "format": "html",
        "default": "You have been locked out for too many invalid login attempts.",
        "title": "User Lockout Message",
        "description": "The message to display to a user when they have been locked out."
      },
      "community_lockout_message": {
        "type": "string",
        "format": "html",
        "default": "Your IP address has been flagged as a threat by the Solid Security network.",
        "title": "Community Lockout Message",
        "description": "The message to display to a user when their IP has been flagged as suspicious by the SolidWP network."
      },
      "automatic_temp_auth": {
        "type": "boolean",
        "default": true,
        "title": "Automatically Temporarily Authorize IPs",
        "description": "Whenever an administrator user accesses the website, Solid Security will prevent their last used IP from being locked out for 24 hours."
      },
      "lockout_white_list": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "default": [],
        "title": "Authorized IPs",
        "description": "Enter a list of IP addresses that should not be locked out by Solid Security.",
        "keywords": [
          "whitelist"
        ]
      },
      "log_type": {
        "type": "string",
        "enum": [
          "database",
          "file",
          "both"
        ],
        "enumNames": [
          "Database Only",
          "File Only",
          "Both"
        ],
        "default": "database",
        "title": "How should event logs be kept",
        "description": "Solid Security can log events in two different ways. Each has advantages and disadvantages. Database Only logs puts all events in the database with your posts and other WordPress data. This makes it easy to retrieve and process that information, but it can slow down your site if the log table gets very large. File Only logging is very fast, but the plugin does not process the logs itself. That would take far more server resources. For most users or smaller sites, Database Only logging should be fine. If you have a very large site or log processing software, then File Only might be a better option."
      },
      "log_rotation": {
        "type": "integer",
        "minimum": 0,
        "default": 60,
        "title": "Days to Keep Database Logs",
        "description": "The number of days database logs should be kept."
      },
      "file_log_rotation": {
        "type": "integer",
        "minimum": 0,
        "default": 180,
        "title": "Days to Keep File Logs",
        "description": "The number of days file logs should be kept. File logs will be rotated once the file hits 10MB. Set to 0 to only use log rotation."
      },
      "log_location": {
        "type": "string",
        "format": "directory",
        "default": "",
        "title": "Path to Log Files",
        "description": "This folder must be writable. For security reasons, we recommend you do not save logs in your website's root folder."
      },
      "proxy": {
        "type": "string",
        "default": "automatic",
        "title": "Proxy Detection",
        "description": "Configure the method Solid Security uses to identify the IP address of your site’s visitors and users. Choose “Security Check Scan” to allow Solid Security to automatically configure the correct method. When this setting is configured incorrectly, key firewall features will not work properly.<br>[Read more about IP Detection](https://go.solidwp.com/about-ip-detection)."
      },
      "proxy_header": {
        "type": "string",
        "default": "HTTP_X_FORWARDED_FOR",
        "title": "Proxy Header",
        "description": "Select the HTTP header record used by your proxy server or load balancer to forward the IP address of each site visitor. Contact your hosting provider or proxy service provider (Cloudflare, etc.) to determine the correct setting. When configured correctly, the “Detected IP” shown above should match your current IP address."
      },
      "hide_admin_bar": {
        "type": "boolean",
        "default": false,
        "title": "Hide Security Menu in Admin Bar",
        "description": "Remove the Security Messages Menu from the Admin Bar. Notifications will only appear on the Solid Security dashboard and settings pages."
      },
      "allow_tracking": {
        "type": "boolean",
        "default": false,
        "title": "Allow Data Sharing",
        "description": "If you opt-in, some data about your usage of this plugin and future StellarWP Products will be shared with our teams (so they can work their butts off to improve). We will also share some helpful info on WordPress, and our products from time to time. If you don't opt in, that's okay! Our products still work just fine.<br>[Read more about usage sharing](https://go.solidwp.com/opt-in-usage-sharing)."
      },
      "show_error_codes": {
        "type": "boolean",
        "default": false,
        "title": "Show Error Codes",
        "description": "Each error message in Solid Security has an associated error code that can help diagnose an issue. Changing this setting to “Yes” causes these codes to be displayed. This setting should be left set to “No” unless Solid Security's customer success team requests that you change it.",
        "readonly": true
      },
      "build": {
        "type": "integer",
        "minimum": 0,
        "default": 0,
        "readonly": true
      },
      "initial_build": {
        "type": "integer",
        "minimum": 0,
        "default": 0,
        "readonly": true
      },
      "activation_timestamp": {
        "type": "integer",
        "minimum": 0,
        "default": 0,
        "readonly": true
      },
      "cron_status": {
        "type": "integer",
        "enum": [
          -1,
          0,
          1
        ],
        "default": -1,
        "readonly": true
      },
      "use_cron": {
        "type": "boolean",
        "default": true,
        "readonly": true
      },
      "cron_test_time": {
        "type": "integer",
        "minimum": 0,
        "default": 0,
        "readonly": true
      },
      "server_ips": {
        "type": "array",
        "items": {
          "type": "string",
          "format": "ip"
        },
        "default": [],
        "readonly": true
      },
      "licensed_hostname_prompt": {
        "type": "boolean",
        "default": false,
        "readonly": true
      },
      "onboard_complete": {
        "type": "boolean",
        "default": false,
        "readonly": true
      },
      "enabled_tools": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "default": [],
        "uniqueItems": true,
        "readonly": true
      },
      "enable_remote_help": {
        "type": "boolean",
        "default": false,
        "readonly": true
      },
      "feature_flags": {
        "type": "object",
        "patternProperties": {
          "^\\w+$": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "time": {
                "type": "integer",
                "minimum": 0
              },
              "rate": {
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false,
        "default": {},
        "readonly": true
      },
      "log_info": {
        "type": "string",
        "default": "",
        "readonly": true
      }
    },
    "uiSchema": {
      "nginx_file": {
        "ui:resettable": true
      },
      "lockout_white_list": {
        "ui:field": "TextareaListField",
        "ui:rows": 10
      },
      "log_location": {
        "ui:resettable": true
      },
      "ui:sections": [
        {
          "title": "Lockouts",
          "fields": [
            "lockout_period",
            "blacklist_period",
            "blacklist",
            "blacklist_count"
          ]
        },
        {
          "title": "Lockout Messages",
          "fields": [
            "lockout_message",
            "user_lockout_message",
            "community_lockout_message"
          ]
        },
        {
          "title": "Authorized IPs",
          "fields": [
            "automatic_temp_auth",
            "lockout_white_list"
          ]
        },
        {
          "title": "Logging",
          "fields": [
            "log_type",
            "log_rotation",
            "log_file_rotation",
            "log_location"
          ]
        },
        {
          "title": "IP Detection",
          "fields": [
            "proxy",
            "proxy_header"
          ]
        },
        {
          "title": "Other",
          "fields": [
            "hide_admin_bar",
            "show_error_codes",
            "allow_tracking"
          ]
        }
      ]
    }
  },
  "conditional-settings": {
    "blacklist_count": {
      "settings": {
        "type": "object",
        "properties": {
          "blacklist": {
            "type": "boolean",
            "enum": [
              true
            ]
          }
        }
      }
    },
    "log_rotation": {
      "settings": {
        "type": "object",
        "properties": {
          "log_type": {
            "type": "string",
            "enum": [
              "database",
              "both"
            ]
          }
        }
      }
    },
    "log_location": {
      "settings": {
        "type": "object",
        "properties": {
          "log_type": {
            "type": "string",
            "enum": [
              "file",
              "both"
            ]
          }
        }
      }
    },
    "file_log_rotation": {
      "settings": {
        "type": "object",
        "properties": {
          "log_type": {
            "type": "string",
            "enum": [
              "file",
              "both"
            ]
          }
        }
      }
    },
    "proxy_header": {
      "settings": {
        "type": "object",
        "properties": {
          "proxy": {
            "type": "string",
            "enum": [
              "manual"
            ]
          }
        }
      }
    },
    "nginx_file": {
      "server-type": [
        "nginx"
      ]
    }
  },
  "removed-settings": [
    "did_upgrade",
    "show_security_check",
    "digest_email",
    "email_notifications",
    "notification_email",
    "backup_email",
    "proxy_override",
    "lock_file",
    "digest_last_sent",
    "digest_messages",
    "show_new_dashboard_notice",
    "infinitewp_compatibility",
    "enable_grade_report"
  ],
  "onboard-settings": [
    "lockout_white_list",
    "proxy",
    "proxy_header"
  ],
  "import-export": {
    "import-settings": [
      "proxy",
      "proxy_header",
      "log_location",
      "nginx_file"
    ],
    "exclude-settings": [
      "server_ips",
      "use_cron",
      "cron_test_time"
    ]
  },
  "telemetry-settings": {
    "write_files": true,
    "lockout_period": true,
    "blacklist_period": true,
    "blacklist": true,
    "blacklist_count": true,
    "automatic_temp_auth": true,
    "lockout_white_list": "count",
    "log_type": true,
    "proxy": true,
    "proxy_header": true,
    "hide_admin_bar": true
  }
}
