Support » Plugin: WP Date and Time Shortcode » PHP Fatal error

  • Resolved plastiquefruit

    (@plastiquefruit)


    I’m getting a strange error:

    PHP Fatal error: require_once(): Failed opening required ‘denra-plugins/classes/Basic.php’ (include_path=’.:/usr/share/php’) in /nas/content/live/manflowyoga/wp-content/plugins/wp-date-and-time-shortcode/denra-plugins/classes/FrameworkLoader.php on line 54

    Fatal error: require_once(): Failed opening required ‘denra-plugins/classes/Basic.php’ (include_path=’.:/usr/share/php’) in /nas/content/live/manflowyoga/wp-content/plugins/wp-date-and-time-shortcode/denra-plugins/classes/FrameworkLoader.php on line 54

    It appears that the plugin requires the “Basic.php” file which is present however the file itself according to the error message failed to open. Do you have any ckue as to why this might happen?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Denra.com

    (@denra)

    Hello @plastiquefruit,

    The plugin is in the installation zip file but it might have been damaged or missing from the plugin folder due to some reason.

    Please deactivate and delete the plug-in and then reinstall it again so you may recover the lost/damaged file.

    Please let us know if that worked to resolve your issue.

    Plugin Author Denra.com

    (@denra)

    PS: Please also check if the permissions of the file are 644.

    Plugin Author Denra.com

    (@denra)

    Hello @plastiquefruit,

    Did you succeed to solve your issue with the Basic.php class file?

    Plugin Author Denra.com

    (@denra)

    Hi @plastiquefruit,

    We hope everything is fine with the plugin installation now since you are not replying our messages. That is why we are closing this thread.

    Thank you for using our plugin.

    Had to uninstall this as well, same issue. Cron events wouldn’t run:

    web02-nj-ln:~/files$ /usr/local/bin/wp cron event run --due-now
    PHP Warning:  Invalid argument supplied for foreach() in /sites/[site].org/files/wp-content/plugins/wp-date-and-time-shortcode/denra-plugins/classes/FrameworkLoader.php on line 45
    Warning: Invalid argument supplied for foreach() in /sites/[site].org/files/wp-content/plugins/wp-date-and-time-shortcode/denra-plugins/classes/FrameworkLoader.php on line 45
    PHP Warning:  require_once(denra-plugins/classes/Basic.php): failed to open stream: No such file or directory in /sites/[site].org/files/wp-content/plugins/wp-date-and-time-shortcode/denra-plugins/classes/FrameworkLoader.php on line 54
    Warning: require_once(denra-plugins/classes/Basic.php): failed to open stream: No such file or directory in /sites/[site].org/files/wp-content/plugins/wp-date-and-time-shortcode/denra-plugins/classes/FrameworkLoader.php on line 54
    PHP Fatal error:  require_once(): Failed opening required 'denra-plugins/classes/Basic.php' (include_path='.:/usr/share/php') in /sites/[site].org/files/wp-content/plugins/wp-date-and-time-shortcode/denra-plugins/classes/FrameworkLoader.php on line 54
    Fatal error: require_once(): Failed opening required 'denra-plugins/classes/Basic.php' (include_path='.:/usr/share/php') in /sites/[site].org/files/wp-content/plugins/wp-date-and-time-shortcode/denra-plugins/classes/FrameworkLoader.php on line 54
    Error: There has been a critical error on your website.Learn more about debugging in WordPress. There has been a critical error on your website.
    

    To fix – you need to add global $denra_plugins to wp-date-and-time-shortcode.php – see here:

    https://gist.github.com/rob/2e9258d6f8cd0a0bedcd8f0ea3b9bf9c

    (Line #39.)

    Plugin Author Denra.com

    (@denra)

    Hello @rawb,

    Thanks for your initiative and the solution.

    Can you please let us know in what environment and in what cases you get the error messages when the variable is not defined as a global since we have received only the complaint above for this error until now (and yours, of course).

    Thank you in advance!

    @denra

    It only happens when I’m trying to run a command via wp-cli (e.g., /usr/local/bin/wp cron event run --due-now) – this plugin will throw a Fatal Error because $denra_plugins is empty. It works fine otherwise.

    Researching, it looks like this is because wp-cli commands are loaded through a function and you need to be explicit in your global definitions. See here:

    https://github.com/wp-cli/wp-cli/issues/2200

    WP-CLI now loads WordPress inside of a function: #2089

    Global variables need to be explicitly globalized in order to function as expected in WP-CLI.

    So yeah, just adding the global $denra_plugins like in my Gist above should solve the wp-cli issue. I was trying to figure out why my cron jobs weren’t running!

    Plugin Author Denra.com

    (@denra)

    Thanks for your feedback and additional details, @rawb. We will consider it when releasing the 3.0 version which is in development and testing. Cheers.

    Good morning,

    I had the same issue here and fix proposed by @rawb is working fine. Thank you and hope the 3.0 version will be released very soon. Cheers.

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.