Notifications
Clear all

[Closed] PHP Error on line 346 in classes/Cache.php

16 Posts
5 Users
3 Reactions
548 Views
Posts: 21
Topic starter
(@clbtiengducvietduc)
Eminent Member
Joined: 3 years ago

Posted by: @robert

Hi @chingiz,

Please ignore that report. It is related to 2.2.3 version. The issue has been fixed in 2.2.4 version please make sure you've updated your forum.

Ver 2.2.4 returns error when users login.Β 

Line 346 in /wpforo/classes/Cache.phpΒ 

Β 

15 Replies
2 Replies
Robert
Admin
(@robert)
Joined: 9 years ago

Support Team
Posts: 10591

@clbtiengducvietduc,

Please provide the entire error message.

(@clbtiengducvietduc)
Joined: 3 years ago

Eminent Member
Posts: 21

Posted by: @robert

@clbtiengducvietduc,

Please provide the entire error message.

Here you are

Β 

ThΓ΄ng tin lα»—i

================

CΓ³ lα»—i E_ERROR tαΊ‘i dΓ²ng 346 trong file: /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-content/plugins/wpforo/classes/Cache.php. ThΓ΄ng bΓ‘o lα»—i: Uncaught Error: Typed property wpforo\classes\Cache::$dir must not be accessed before initialization in /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-content/plugins/wpforo/classes/Cache.php:346

Stack trace:

#0 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-content/plugins/wpforo/includes/functions.php(2374): wpforo\classes\Cache->clean()

#1 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-content/plugins/wpforo/classes/Members.php(1817): wpforo_clean_cache()

#2 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-content/plugins/wpforo/classes/Members.php(109): wpforo\classes\Members->reset()

#3 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-includes/class-wp-hook.php(326): wpforo\classes\Members->wpforo\classes\{closure}()

#4 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()

#5 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-includes/plugin.php(517): WP_Hook->do_action()

#6 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-includes/user.php(1921): do_action()

#7 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-includes/user.php(2590): clean_user_cache()

#8 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-content/plugins/code-snippets/php/snippet-ops.php(582) : eval()'d code(38): wp_update_user()

#9 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-includes/class-wp-hook.php(324): check_for_role_change()

#10 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-includes/plugin.php(205): WP_Hook->apply_filters()

#11 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-content/plugins/mycred/includes/mycred-functions.php(1537): apply_filters()

#12 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-content/plugins/mycred/includes/hooks/mycred-hook-logins.php(110): myCRED_Settings->add_creds()

#13 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-includes/class-wp-hook.php(324): myCRED_Hook_Logging_In->logging_in()

#14 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()

#15 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-includes/plugin.php(517): WP_Hook->do_action()

#16 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-includes/user.php(121): do_action()

#17 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-login.php(1309): wp_signon()

#18 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-content/plugins/wps-hide-login/classes/plugin.php(603): require_once('/home/cuxc4x76e...')

#19 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-includes/class-wp-hook.php(324): WPS\WPS_Hide_Login\Plugin->wp_loaded()

#20 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()

#21 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-includes/plugin.php(517): WP_Hook->do_action()

#22 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-settings.php(665): do_action()

#23 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-config.php(96): require_once('/home/cuxc4x76e...')

#24 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-load.php(50): require_once('/home/cuxc4x76e...')

#25 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-blog-header.php(13): require_once('/home/cuxc4x76e...')

#26 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/index.php(17): require('/home/cuxc4x76e...')

#27 {main}

Β  thrown

Β 

Β 

Posts: 21
Topic starter
(@clbtiengducvietduc)
Eminent Member
Joined: 3 years ago

Dear @Robert,

May I have the previous version 2.2.3 while waiting for the version 2.2.5?

7 Replies
RealAct
(@realact)
Joined: 7 years ago

Reputable Member
Posts: 238
(@clbtiengducvietduc)
Joined: 3 years ago

Eminent Member
Posts: 21

Posted by: @realact

@clbtiengducvietduc Here

I meant version 2.2.3. Because current version causes some errors.Β 

Β 

RealAct
(@realact)
Joined: 7 years ago

Reputable Member
Posts: 238

@clbtiengducvietduc you can get any previous version from the link I sent you.

Robert
Admin
(@robert)
Joined: 9 years ago

Support Team
Posts: 10591

@clbtiengducvietduc,

We cannot reproduce this error, I think this is a conflict with some plugin. Could you please send admin login details to support[at]gvectors.com to check your issue?

Β 

(@clbtiengducvietduc)
Joined: 3 years ago

Eminent Member
Posts: 21

Posted by: @robert

@clbtiengducvietduc,

We cannot reproduce this error, I think this is a conflict with some plugin. Could you please send admin login details to support[at]gvectors.com to check your issue?

Β 

Yes. But first of all may I have version 2.2.3?

Β 

dimalifragis
(@dimalifragis)
Joined: 5 years ago

Famed Member
Posts: 2611

@clbtiengducvietduc At the end of the page using the dropdown, you will get whatever version you need

https://wordpress.org/plugins/wpforo/advanced/

(@clbtiengducvietduc)
Joined: 3 years ago

Eminent Member
Posts: 21

Posted by: @dimalifragis

@clbtiengducvietduc At the end of the page using the dropdown, you will get whatever version you need

https://wordpress.org/plugins/wpforo/advanced/

Thank you so much. πŸ™‚Β 

Β 

Robert
Posts: 10591
Admin
(@robert)
Support Team
Joined: 9 years ago

Posted by: @clbtiengducvietduc

#8 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-content/plugins/code-snippets/php/snippet-ops.php(582) : eval()'d code(38): wp_update_user()

I see you use some code snippet in Code Snippets plugin and the error comes from that snippet. Please copy paste that code here.

3 Replies
(@itsupport)
Joined: 6 years ago

Eminent Member
Posts: 14

@robert tried to reopen my thread but cant πŸ™ my site cached ... after clearing still getting below errors πŸ™ please advise

Β 

Fatal error: Uncaught Error: Typed property wpforo\classes\Cache::$dir must not be accessed before initialization in /home/customer/www/intranet.bobby.org/public_html/wp-content/plugins/wpforo/classes/Cache.php:346 Stack trace: #0 /home/customer/www/intranet.bobby.org/public_html/wp-content/plugins/wpforo/includes/functions.php(2374): wpforo\classes\Cache->clean(2770, 'avatar', Array) #1 /home/customer/www/intranet.bobby.org/public_html/wp-content/plugins/wpforo/classes/Members.php(1817): wpforo_clean_cache('avatar', 2770) #2 /home/customer/www/intranet.bobby.org/public_html/wp-content/plugins/wpforo/classes/Members.php(109): wpforo\classes\Members->reset(2770) #3 /home/customer/www/intranet.bobby.org/public_html/wp-includes/class-wp-hook.php(326): wpforo\classes\Members->wpforo\classes\{closure}(2770) #4 /home/customer/www/intranet.bobby.org/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(2770, Array) #5 /home/customer/www/intranet.bobby.org/public_html/wp- in /home/customer/www/intranet.bobby.org/public_html/wp-content/plugins/wpforo/classes/Cache.php on line 346
dimalifragis
(@dimalifragis)
Joined: 5 years ago

Famed Member
Posts: 2611

@itsupport Open a new topic. Do not hijack an other guy's topic.

(@clbtiengducvietduc)
Joined: 3 years ago

Eminent Member
Posts: 21

Posted by: @robert

Posted by: @clbtiengducvietduc

#8 /home/cuxc4x76ejjy/0toNet.FUN/TrangChinh/DL/wp-content/plugins/code-snippets/php/snippet-ops.php(582) : eval()'d code(38): wp_update_user()

I see you use some code snippet in Code Snippets plugin and the error comes from that snippet. Please copy paste that code here.

Here you are

Β 

/**

Β * Promote and demote Based on myCRED Balance

Β * Changes a users role based on their myCRED balance.

Β * @version 10.7.23

Β */

Β 

add_filter( 'mycred_add_finished', 'check_for_role_change', 99, 3 );

function check_for_role_change( $reply, $request, $mycred ) {

Β // Make sure that if any other filter has declined this we also decline

Β if ( $reply === false ) return $reply;

Β 

Β // Exclude admins and others except normal users and camnoi users

Β if ( user_can( $request['user_id'], 'manage_options' ) || user_can($request['user_id'], 'editor') || user_can($request['user_id'], 'administrator') || user_can($request['user_id'], 'author') ) return $reply;

Β 

Β extract( $request );

Β 

Β // Minimum balance requirement for each role

Β $thresholds = array(

Β  'camnoi' => -999999,

Β  'subscriber' => 0

Β );

Β 

Β  Β  Β // Get users current balance

Β $current_balance = $mycred->get_users_balance( $user_id, 'mycred_default' );

Β //$current_balance = $current_balance + $amount;

Β 

Β // Check if the users current balance awards a new role

Β $new_role = false;

Β foreach ( $thresholds as $role => $min ) {

Β  if ( $current_balance > $min )

Β  Β $new_role = $role;

Β }

Β 

Β // Change users role if we have one

Β if ( $new_role !== false )

Β  wp_update_user( array(

Β  Β 'ID'Β  Β => $user_id,

Β  Β 'role' = > $new_role

Β  ) );

Β 

Β return $reply;

}

Β 

Robert
Posts: 10591
Admin
(@robert)
Support Team
Joined: 9 years ago

Hi @clbtiengducvietduc,

Please update to 2.2.5 version. This issue should be fixed in the new version.