P_Error */ public function process() { return $this->prevent_file_editor(); } /** * This is for un-do stuff that has be done in @process. * * @return bool|WP_Error */ public function revert() { return $this->allow_file_editor(); } /** * Define the DISALLOW_FILE_EDIT constant, so we can hide the editor page. * * @return bool Always returns true. */ public function shield_up() { return true; } /** * Retrieve the tweak's label. * * @return string */ public function get_label(): string { return esc_html__( 'Disable the file editor', 'wpdef' ); } /** * Get the error reason. * * @return string */ public function get_error_reason(): string { return esc_html__( 'The file editor is currently enabled.', 'wpdef' ); } /** * Return a summary data of this tweak. * * @return array */ public function to_array(): array { return array( 'slug' => $this->slug, 'title' => $this->get_label(), 'errorReason' => $this->get_error_reason(), 'successReason' => esc_html__( 'You\'ve disabled the file editor, winning.', 'wpdef' ), 'misc' => array(), 'bulk_description' => esc_html__( 'The file editor is currently active, this means anyone with access to your login information can further edit your plugin and theme files and inject malicious code. We will disable file editor for you.', 'wpdef' ), 'bulk_title' => esc_html__( 'File Editor', 'wpdef' ), ); } }