• When using the following php code in the, “Code Snippets Plugin” it would not resolve to the proper path.

    php

    require_once(plugin_dir_path(FILE) . ‘../jwt-authentication-for-wp-rest-api/includes/vendor/autoload.php’);

    The Code Snippets Plugin would provide the following from the debug_log. [26-Jul-2024 09:43:21 UTC] PHP Fatal error: require_once(): Failed opening required ‘/home/alexan55/public_html/wp-content/plugins/code-snippets/php/../jwt-authentication-for-wp-rest-api/includes/vendor/autoload.php’ (include_path=’.:/opt/alt/php74/usr/share/pear’) in /home/alexan55/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(582) : eval()’d code on line 4

    The path rendered from the “Code Snippet Plugin is not the relative path specified by the php code.

    Tested extensively and could not find a way to specify code to create a path to the proper file.

Viewing 1 replies (of 1 total)
  • Plugin Author ImageShea Bunge

    (@bungeshea)

    Hi @ronald-e-preston,
    Can I ask why you are attempting to load this file with a relative path? Where is this jwt-authentication-for-wp-rest-api folder stored on your site?

    In this situation, I’d recommend using an absolute path like:

    require_once WP_CONTENT_DIR . '/jwt-authentication-for-wp-rest-api/includes/vendor/autoload.php';
Viewing 1 replies (of 1 total)

The topic ‘Code Snippet plugin fails to render proper path…’ is closed to new replies.