• Resolved John

    (@thesun2012)


    Hello,

    The plugin isn’t compatible with php8 and it occurs the following error while transfering points

    PHP Fatal error: Uncaught TypeError: sha1(): Argument #1 ($string) must be of type string, array given in /home/john/www/wordpress/wp-content/plugins/mycred/addons/transfer/includes/mycred-transfer-object.php:1317

    I have a look into the code and see that the plugin calls sha1 with an empty array $mycred_transfer_salt , can you fix this issue?

    $mycred_transfer_salt = mycred_get_option( 'mycred_transfer_salt' );
    
    $key = sha1($mycred_transfer_salt);
Viewing 13 replies - 1 through 13 (of 13 total)
  • Hey @thesun2012 ,

    Thanks for contacting us. Hope you are doing well.

    Please let us know the exact version of PHP 8 you are using. We will then replicate this scenario on our environment and provide you proper guidance.

    Hope to hear from you soon.

    Thanks & Regards,
    WP Experts Support Team.

    Thread Starter John

    (@thesun2012)

    Hi,

    My version is 8.0.30 and I also tried with 8.1, I guess the issue is the plugin calls sha1 with an empty array param while the function only accepts a string.

    Hello @thesun2012 ,

    We are unable to replicate this issue on our environment. It’s working fine on our environment.

    To escalate your case, please create a ticket on our official website. So that we can connect you directly with our Technical team.

    Looking forward to getting your issue resolved.

    Thanks a lot for taking your time and identifying the issue.

    Thread Starter John

    (@thesun2012)

    Thanks for your reply, I have resolved it, maybe it was my mistake.

    Is there a way to display logs for all point types using the myCRED_Query_Log class? Currently, it only retrieves logs for a single specific point type based on the ctype parameter. It would be beneficial if the ‘ctype’ parameter could accept an array of point types instead of just a single type.

    Thanks.

    Hey @thesun2012 ,

    Glad to hear that.

    Currently, this functionality is not available in our plugin.
    Please explain more what you want to achieve by accepting an array of point types in myCRED_Query_Log. We need to see the possibilities to do some custom coding.

    Thanks

    Thread Starter John

    (@thesun2012)

    I’ve integrated the plugin into my premium theme, complete with a custom user dashboard. The context is that my customers are interested in creating additional point types beyond the default. We have a table displaying all available logs. However, as you’re already aware, the class doesn’t currently support retrieving logs for all point types simultaneously, this is not good, for instance https://nimb.ws/EszA2u

    Currently, we’ve implemented a selection field that enables users to query logs using the ‘ctype’ parameter. However, it might be a better approach to avoid assigning a default type for the ‘ctype’ parameter within the ‘parse_args’ function of the myCRED_Query_Log class or to allow accepting an array with multiple types. This would enhance the class’s flexibility.

    I hope you understand what I mean.

    • This reply was modified 1 year, 7 months ago by John.

    Hey @thesun2012 ,

    You can use global variable $mycred_types in myCRED_Query_Log

    global $mycred_types;

    $args = array(
    ‘number’ => 10,
    ‘ctype’ => $mycred_types
    );

    $log = new myCRED_Query_Log( $args );

    You will get all point types with $log->args[‘ctype’] in array format

    With this code you will get all point types. Then, you can use these values and make it work as per your requirement. This is just an example.

    Let me know if you have any questions.

    Thanks

    Thread Starter John

    (@thesun2012)

    Thank you for sharing the information. I have attempted it, but no luck.

    Warning: Undefined array key "ids" in /home/john/www/wordpress/wp-content/plugins/mycred/includes/classes/class.query-log.php on line 329

    Warning: Undefined array key "my_point" in /home/john/www/wordpress/wp-content/plugins/mycred/includes/classes/class.query-log.php on line 1787

    <strong>Fatal error</strong>: Uncaught Error: Call to a member function format_creds() on null in /home/john/www/wordpress/wp-content/plugins/mycred/includes/classes/class.query-log.php:1787 Stack trace: #0 /home/john/www/wordpress/wp-content/plugins/mycred/includes/classes/class.query-log.php(1645): myCRED_Query_Log->get_the_entry() #1 /home/john/www/wordpress/wp-content/plugins/mycred/includes/classes/class.query-log.php(1524): myCRED_Query_Log->get_display()

    I am aware that the $mycred_types variable returns an array of all available point types. However, the ctype parameter only accepts a string for a specific type. This implies that we cannot display logs for all point types simultaneously. I’m uncertain if my explanation is clear. For instance, I have two types: default_type and custom_type. At this moment, my goal is to retrieve all logs associated with these types without depending on the selection field via the GET method.

    Thank you.

    • This reply was modified 1 year, 7 months ago by John.

    Hello @thesun2012 ,

    Hope you are doing well.

    In our documentation, we have mentioned that ctype value can be an array or string with examples. Please check our documentation below

    Documentation

    Example 1: Get entries of all point types (Multiple checks)

    ctype=mycred_default,custom_point_type

    ‘ctype’ => array(
    ‘ids’ => array( ‘mycred_default’, ‘custom_point_type’ )
    ‘compare’ => ‘IN’)

    Example 2: Get entries of all point types

    $log = new myCRED_Query_Log( array( ‘ctype’ => ” ) );

    Let me know if you have any questions.

    Thanks

    Thread Starter John

    (@thesun2012)

    It works perfectly, I didn’t see that, thanks for your time.

    Glad to hear this.

    I really appreciate a kind and honest review on this profile regarding plugin and my support towards you.

    Thanks alot.

    Thread Starter John

    (@thesun2012)

    Done, thank you.

    Thanks alot.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘PHP8: PHP Fatal error: Uncaught TypeError: sha1()’ is closed to new replies.