Plugin could not be activated because it triggered a fatal error.
-
Summary: The PHP Fatal error occurs within the ‘academy-certificates’ plugin during the activation process. The error specifically points to a
TypeError
within the ‘example-certificate.php’ file on line 39, where theunlink()
function expects a string argument representing a filename but instead receives an object of typeWP_Error
.Steps to Reproduce:
- Install the ‘academy-certificates’ plugin.
- Activate the ‘academy-certificates’ plugin.
Expected Behavior: The ‘academy-certificates’ plugin activates successfully without encountering any fatal errors or exceptions.
Actual Behavior: Upon activation, a PHP Fatal error occurs, leading to the failure of the activation process. The error originates in the ‘example-certificate.php’ file at line 39, triggered by a
TypeError
in theunlink()
function due to an incompatible argument type (WP_Error
instead of a string).Error Message:
[26-Dec-2023 06:05:07 UTC] PHP Fatal error: Uncaught TypeError: unlink(): Argument #1 ($filename) must be of type string, WP_Error given in C:\laragon\www\eventin\wp-content\plugins\academy-certificates\includes\admin\example-certificate.php:39
- The topic ‘Plugin could not be activated because it triggered a fatal error.’ is closed to new replies.