Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter keplermanu

    (@keplermanu)

    I managed to fix it. I’ll post the solution here for anyone else having this problem.
    The problem I was encountering was this error in my error log

    PHP Fatal error: Uncaught Error: Call to undefined function wp_get_current_user() in …/wp-includes/capabilities.php:693

    I think pretty much all the function in the weight training plugin were getting called too early in the stack, which led to errors.

    I fixed this by changing the contents of …/weight-loss-tracker/export/inc.php
    from

    <?php
    
    defined('ABSPATH') or die('Jog on.');
    
    require_once( 'functions.php' );
    require_once( 'db.php' );
    require_once( 'hooks.php' );
    require_once( 'admin.page.php' );
    require_once( 'activate.php' );
    

    to

    <?php
    
    defined('ABSPATH') or die('Jog on.');
    
    add_action( 'wp_loaded', 'load_plugins' );
    
    function load_plugins(){
        require_once( 'functions.php' );
        require_once( 'db.php' );
        require_once( 'hooks.php' );
        require_once( 'admin.page.php' );
        require_once( 'activate.php' );
    };

    so all necessary code gets called after my other php files are called and not beforehand.
    With this change everything seems to work ok for now and my css has returned back to normal.

    Thread Starter keplermanu

    (@keplermanu)

    Thanks for the swift reply Al,

    The above account’s just a throwaway test account with basic permissions but I changed the password just in case, thanks for the heads up.

    My host is running php 7.4 and I do have access to my PHP error logs.

    Should I send these to you via email?

    Kind Regards,
    Kepler Manu

    Thread Starter keplermanu

    (@keplermanu)

    If I rollback the plugin back to ver 7.6.4 I can use it without having troubles accessing my css files.

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