• Hi j_3rk,

    Firstly, fantastic plugin! It’s coming in very useful for our membership site.

    I am, however, having a slight issue.

    My site is using MemberPress and AffiliateWP. I believe there may be a conflict with Inactive Logout and AffiliateWP.

    When a user fills out the affiliate registration form and hits submit, they’re given the following error:

    ————–

    Fatal error: Uncaught Error: Call to undefined function ina_helpers() in …/wp-content/plugins/inactive-logout/src/class-inactive-logout-main.php:266 Stack trace: #0 …/wp-includes/class-wp-hook.php(286): Inactive_Logout_Main->load_scripts(”) #1 …/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #2 …/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #3 …/wp-includes/script-loader.php(1447): do_action(‘wp_enqueue_scri…’) #4 …/wp-includes/class-wp-hook.php(286): wp_enqueue_scripts(”) #5 …/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #6 …/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #7 …/public in …/wp-content/plugins/inactive-logout/src/class-inactive-logout-main.php on line 266

    ————–

    This message only appears when someone tries to register as an affiliate. It does not appear when a user signs up for our main service, which is done via a MemberPress form.

    I did notice that, even though this fatal error message appears, the affiliate registration is actually successful – the affiliate account does get created correctly. If I refresh the page which shows the error, the affiliate dashboard will appear and everything works as normal.

    Any idea what the problem could be?

    I’m running WordPress 4.9.8 and the latest version of Inactive Logout (v1.9.1).

    I look forward to your reply!

    Kind regards,
    tsg29

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Deepen

    (@j_3rk)

    Hi there,

    Will try to replicate the issue and will fix accordingly. Thanks for the explanation as well – would help me alot.

    Thanks

    Hi there, I just noticed the same thing happening on a site that I manage. Users were reporting seeing the WordPress “The site is experiencing technical difficulties” message when loading the site – not even when logging into anything. Refreshing the page made the page load up just fine, but looking in the logs has the same errors as in the post above:

    [18-Aug-2019 13:41:54 UTC] PHP Fatal error: Uncaught Error: Call to undefined function ina_helpers() in /var/www/html/wp-content/plugins/inactive-logout/src/class-inactive-logout-main.php:266
    Stack trace:
    #0 /var/www/html/wp-includes/class-wp-hook.php(286): Inactive_Logout_Main->load_scripts(”)
    #1 /var/www/html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
    #2 /var/www/html/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
    #3 /var/www/html/wp-includes/script-loader.php(2537): do_action(‘wp_enqueue_scri…’)
    #4 /var/www/html/wp-includes/class-wp-hook.php(286): wp_enqueue_scripts(”)
    #5 /var/www/html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
    #6 /var/www/html/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
    #7 /var/www/html/wp-includes/general-template.php(2745): do_action(‘wp_head’)
    #8 /var/www/html/wp-content/themes/x/framework/legacy/cranium/headers/views/global/_header.php(16): wp_head()
    #9 /var/www/html/wp-content/themes/x/framework/functions/frontend/view-routing.php(182): include(‘/ in /var/www/html/wp-content/plugins/inactive-logout/src/class-inactive-logout-main.php on line 266

    We are using the X theme on WordPress 5.2.2 with version 1.9.1 of Inactive Logout.
    We are running PHP version 7.2.21 if that is helpful.

    Please let me know if there’s a fix, thank you for your help!

    yes … I am getting this error too … here is the stack trace;

    <b>Fatal error</b>:  Uncaught Error: Call to undefined function ina_helpers() in \wp-content\plugins\inactive-logout\src\class-inactive-logout-main.php:266
    Stack trace:
    #0 \wp-includes\class-wp-hook.php(286): Inactive_Logout_Main->load_scripts('')
    #1 \wp-includes\class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
    #2 \wp-includes\plugin.php(453): WP_Hook->do_action(Array)
    #3 \wp-includes\script-loader.php(1447): do_action('wp_enqueue_scri...')
    #4 \wp-includes\class-wp-hook.php(286): wp_enqueue_scripts('')
    #5 \wp-includes\class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
    #6 \wp-includes\plugin.php(453): WP_Hook->do_action(Array)
    #7 \wp-includes\general-template.php(2614): do_action('wp_head')
    #8 \wp-content\themes\Theme-child\header.php(26): wp_head()
    #9 \wp-includes\template.php(688): require_once( in <b>\wp-content\plugins\inactive-logout\src\class-inactive-logout-main.php</b> on line <b>266</b>

    not sure what is needed to fix it … but the problems stems from a failure to load the helper class here:

    FILE: /src/class-inactive-logout-main.php
    
    176:	if ( is_user_logged_in() ) {
    177:		$this->ina_load_dependencies();
    178:		$this->ina_define_them_constants();
    179:	}
    

    if you bypass the logged_in check and unconditionally load the dependencies (including the helper class), the Fatal Error doesn’t occur …

    though I have no clue what the collateral effects would be to loading those files without a valid login_in check … the developer would need to trace that.

    -DJ

    • This reply was modified 5 years, 6 months ago by damelco.
    Plugin Author Deepen

    (@j_3rk)

    Please check if this issue is fixed in new version 1.9.2

    well?
    you did do something to affect it!

    Notice: Use of undefined constant INACTIVE_LOGOUT_ASSETS_URL - assumed 'INACTIVE_LOGOUT_ASSETS_URL' in \wp-content\plugins\inactive-logout\src\class-inactive-logout-main.php on line 268
    
    Notice: Use of undefined constant INACTIVE_LOGOUT_ASSETS_URL - assumed 'INACTIVE_LOGOUT_ASSETS_URL' in \wp-content\plugins\inactive-logout\src\class-inactive-logout-main.php on line 277
    
    Notice: Use of undefined constant INACTIVE_LOGOUT_VENDOR_URL - assumed 'INACTIVE_LOGOUT_VENDOR_URL' in \wp-content\plugins\inactive-logout\src\class-inactive-logout-main.php on line 278
    
    Notice: Use of undefined constant INACTIVE_LOGOUT_VENDOR_URL - assumed 'INACTIVE_LOGOUT_VENDOR_URL' in \wp-content\plugins\inactive-logout\src\class-inactive-logout-main.php on line 280
    
    Notice: Use of undefined constant INACTIVE_LOGOUT_ASSETS_URL - assumed 'INACTIVE_LOGOUT_ASSETS_URL' in \wp-content\plugins\inactive-logout\src\class-inactive-logout-main.php on line 286

    it looks like you moved some code from your ‘helper’ file to a ‘pointer’ file … correct? … and that seems to have got the initialization past the ‘load dependencies’
    EDIT: I see you just are not loading the helper class at all during initialization … and that is breaking CONSTANTS definitions calls (see next post)

    		if ( is_user_logged_in() ) {
    			$this->ina_load_dependencies();
    			$this->ina_define_them_constants();
    		}

    … but the constants are also failing to load?
    can you perhaps move them to the ‘pointers file? … perhaps that may fix things?!?!

    peace

    -DJ

    • This reply was modified 5 years, 5 months ago by damelco.

    another thought?

    if that doesn’t work, the other solution might be to hook something a bit later (or differently) to ensure the WordPress user class has initialized before attempting to access it?!

    maybe the is_user_logged_in() is failing due to it being requested too early … or maybe a race condition is occurring for non-standard processing?!

    -DJ

    here’s what I did to test a bit (I figure you are not able to reproduce this at your end?)

    I added a copy of the ina_define() method from the Inactive_Logout_Helpers class to the Inactive_Logout_Main class.

    then I moved;
    $this->ina_define_them_constants();
    outside the is_user_logged_in() check, and altered each the four CONSTANT calls in ina_define_them_constants() method from;
    ina_helpers()->ina_define()
    to
    $this->ina_define()

    this fixed all of the initialization errors … though it DOES BREAK all of the is_user_logged_in() necessities … including the nonce generation for all the ajax!

    but hopefully this helps you identify it solution?

    peace

    -DJ

    okay … here is a cleaner test …

    I edited Inactive_Logout_Main::__construct():line_87

    from
    $this->ina_plugins_loaded();
    to
    add_action('init', array($this, 'ina_plugins_loaded'), 9 );

    and changed Inactive_Logout_Main::ina_plugins_loaded to Public

    this seemed to fixed most of it … however, it seems the nonce generation is still failing.

    -DJ

    • This reply was modified 5 years, 5 months ago by damelco.
    • This reply was modified 5 years, 5 months ago by damelco.
    Plugin Author Deepen

    (@j_3rk)

    @damelco

    Yes i moved helper to core plugin activation file on the root.

    Also, yes i am not being able to reproduce the issues on my end not sure why but yes i also have guessed it before that the loader ina_plugins_loaded is causing the issue.

    I’ll have to test further.

    Appreciate the debug info. Good reference.

    • This reply was modified 5 years, 5 months ago by Deepen.
    • This reply was modified 5 years, 5 months ago by Deepen.
Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Fatal error: Uncaught Error’ is closed to new replies.