Describe the bug
Note : I have used my S3 credentials.
When user enter secret access key and click on Save button, then it produces a Fatal error, and the site stops working.
This creates permanent error in the DB on the website and after that user cannot activate secure-media plugin. Deleting and installing new plugin also not works.
Note : This issue also exist on WP 5.8
Steps to Reproduce
- Go to Settings > media.
- Enter As Access key.
- Click on Save settings.
- Details will get save successfully.
- Now enter secret access key.
- Notice Fatal error.
Screenshots, screen recording, code snippet

Environment information
OS - Windows 11
Browser - Chrome - Version 98.0.4758.102 (Official Build) (64-bit)
PHP version -7.4
WP version 5.8 and 5.9
Secure mediaPlugin version - 1.0.5
WordPress information
No response
Code of Conduct