• Resolved kiandept

    (@kiandept)


    Dear Mohamed,

    thanks for the great work. Unfortunately, the plugin cannot be activated at this time. Fatal error. It would be great if the bug could be fixed. Tested with WP Local and a clean installation. I’m looking forward to trying out the plugin.

    Best regards

    • This topic was modified 9 months, 3 weeks ago by kiandept.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Mohamed Endisha

    (@endisha)

    @kiandept

    Unfortunately, I cannot reproduce the issue, it works on my end. I have already tested it on local, shared hosting, VPS, and dedicated servers.

    Could you please provide more details about the error? Check the error_log file on your server for relevant entries.

    Also, please enable WordPress debugging and share the debug output so we can see what happened:
    https://developer.ww.wp.xz.cn/advanced-administration/debug/debug-wordpress/

    Thread Starter kiandept

    (@kiandept)

    Thank you for your prompt response. Oh, you are correct. I apologize; it is functioning on the staging site. Nevertheless, please find the debug log below, in case it is of interest.

    [08-Aug-2025 14:43:20 UTC] PHP Fatal error:  Uncaught Error: Class "Secure_Passkeys\Core\Secure_Passkeys_Application" not found in C:\Users\[]\Local Sites\clean-install\app\public\wp-content\plugins\secure-passkeys\bootstrap.php:9
    Stack trace:
    #0 C:\Users\[]\Local Sites\clean-install\app\public\wp-content\plugins\secure-passkeys\secure-passkeys.php(45): require()
    #1 C:\Users\[]\Local Sites\clean-install\app\public\wp-admin\includes\plugin.php(2387): include_once('C:\\Users\\[]\\...')
    #2 C:\Users\[]\Local Sites\clean-install\app\public\wp-admin\includes\plugin.php(673): plugin_sandbox_scrape('secure-passkeys...')
    #3 C:\Users\[]\Local Sites\clean-install\app\public\wp-admin\plugins.php(60): activate_plugin('secure-passkeys...', 'http://clean-in...', false)
    #4 {main}
    thrown in C:\Users\[]\Local Sites\clean-install\app\public\wp-content\plugins\secure-passkeys\bootstrap.php on line 9
    Plugin Author Mohamed Endisha

    (@endisha)

    @kiandept Thank you for sharing the debug info. this issue is likely caused by something specific in environment.

    Could you please check the following:

    • File permissions: Ensure all plugin files and folders have proper read permissions for the web server (usually 644 for files and 755 for folders).
    • Clear PHP caches: If your server uses OPCache or any PHP cache, please clear it or restart your PHP process.
    • PHP version: Confirm your PHP version is supported (7.4+ or 8.x).

    Also, if possible, please help us gather more detailed debugging info by doing the following:

    1. Open the file: /secure-passkeys/src/core/secure-passkeys-autoloader.php

    2. Find

    private function get_class_file(string $class): string
    {
    $class_file = strtolower(str_replace('_', '-', $class));
    $class_file = str_replace('\\', DIRECTORY_SEPARATOR, $class_file);
    $class_file = str_replace(SECURE_PASSKEYS_PLUGIN_BASENAME . '/', '', $class_file);

    return SECURE_PASSKEYS_PLUGIN_DIR . '/src/' . $class_file . '.php';
    }

    3. Replace it with:

       private function get_class_file(string $class): string
    {
    $logs = [];
    $logs[] = SECURE_PASSKEYS_PLUGIN_FILE;
    $logs[] = SECURE_PASSKEYS_PLUGIN_DIR;
    $logs[] = DIRECTORY_SEPARATOR;
    $logs[] = $class;

    $class_file = strtolower(str_replace('_', '-', $class));
    $class_file = str_replace('\\', DIRECTORY_SEPARATOR, $class_file);
    $class_file = str_replace(SECURE_PASSKEYS_PLUGIN_BASENAME . '/', '', $class_file);

    $logs[] = $class_file;
    $logs[] = SECURE_PASSKEYS_PLUGIN_DIR . '/src/' . $class_file . '.php';
    $logs[] = file_exists(SECURE_PASSKEYS_PLUGIN_DIR . '/src/' . $class_file . '.php');


    if(strpos(strtolower($class),'application') !== false){
    error_log(print_r($logs,true),3,__DIR__.'/logs.log');
    }

    return SECURE_PASSKEYS_PLUGIN_DIR . '/src/' . $class_file . '.php';
    }

    4. Then refresh the site once to generate the log file.

    This will create a logs.log file inside /secure-passkeys/src/core/. Please share the contents of that log file with me — it will help identify exactly how your environment is resolving paths and separators.

    After that, you can remove this debug code to keep things clean and I hope this will give me full clarification of your issue.

    Thread Starter kiandept

    (@kiandept)

    Oh, how cool. I’d be happy to do that.
    Just so there are no misunderstandings, the error occurs locally when using https://localwp.com/. File permissions should therefore exist across the board. The plugin works perfectly on the staging server.

    Environment:

    • web server: nginx
    • PHP 8.2.27
    • WordPress: 6.8.2
    • all caches cleared

    Attached is the content of the log file. I am available for any questions.

    Array
    (
    [0] => C:\Users\[...]\Local Sites\clean-install\app\public\wp-content\plugins\secure-passkeys\secure-passkeys.php
    [1] => C:\Users\[...]\Local Sites\clean-install\app\public\wp-content\plugins\secure-passkeys
    [2] => \
    [3] => Secure_Passkeys\Core\Secure_Passkeys_Application
    [4] => secure-passkeys\core\secure-passkeys-application
    [5] => C:\Users\[...]\Local Sites\clean-install\app\public\wp-content\plugins\secure-passkeys/src/secure-passkeys\core\secure-passkeys-application.php
    [6] =>
    )
    Plugin Author Mohamed Endisha

    (@endisha)

    @kiandept Yes, I’m aware it’s running locally on Windows, which is why I asked you to log the autoloader to help me identify the issue.
    Open: /secure-passkeys/src/core/secure-passkeys-autoloader.php

    Replace

    private function get_class_file(string $class): string
    {
    $class_file = strtolower(str_replace('_', '-', $class));
    $class_file = str_replace('\\', DIRECTORY_SEPARATOR, $class_file);
    $class_file = str_replace(SECURE_PASSKEYS_PLUGIN_BASENAME . '/', '', $class_file);

    return SECURE_PASSKEYS_PLUGIN_DIR . '/src/' . $class_file . '.php';
    }

    With:

    private function get_class_file(string $class): string
    {
    $class_file = strtolower(str_replace('_', '-', $class));
    $class_file = str_replace('\\', '/', $class_file);
    $basename = strtolower(str_replace('\\', '/', SECURE_PASSKEYS_PLUGIN_BASENAME . '/'));

    if (strpos($class_file, $basename) === 0) {
    $class_file = substr($class_file, strlen($basename));
    }

    $class_file = str_replace('/', DIRECTORY_SEPARATOR, $class_file);

    return SECURE_PASSKEYS_PLUGIN_DIR . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . $class_file . '.php';
    }

    Finally, please try this one, it should resolve the issue, if it does, please confirm.

    Thread Starter kiandept

    (@kiandept)

    Yeah, works great. Thanks. Have a nice weekend.

    Plugin Author Mohamed Endisha

    (@endisha)

    @kiandept

    Great, Please stay tuned, the next release is coming soon.

    Plugin Author Mohamed Endisha

    (@endisha)

    @kiandept

    Release 1.2.0 has been published and is now available. This update includes a fix for this issue.

    Thread Starter kiandept

    (@kiandept)

    Fantastic! Thank you!

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Fatal Error’ is closed to new replies.