Title: PHP8: PHP Fatal error: Uncaught TypeError: sha1()
Last modified: August 22, 2023

---

# PHP8: PHP Fatal error: Uncaught TypeError: sha1()

 *  Resolved [John](https://wordpress.org/support/users/thesun2012/)
 * (@thesun2012)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/php8-php-fatal-error-uncaught-typeerror-sha1/)
 * 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?
 *     ```wp-block-code
       $mycred_transfer_salt = mycred_get_option( 'mycred_transfer_salt' );
   
       $key = sha1($mycred_transfer_salt);
       ```
   

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

 *  [Daniyal Raza](https://wordpress.org/support/users/daniyalraza01/)
 * (@daniyalraza01)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/php8-php-fatal-error-uncaught-typeerror-sha1/#post-16992061)
 * Hey [@thesun2012](https://wordpress.org/support/users/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](https://wordpress.org/support/users/thesun2012/)
 * (@thesun2012)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/php8-php-fatal-error-uncaught-typeerror-sha1/#post-16992124)
 * 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.
 *  [Daniyal Raza](https://wordpress.org/support/users/daniyalraza01/)
 * (@daniyalraza01)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/php8-php-fatal-error-uncaught-typeerror-sha1/#post-16992346)
 * Hello [@thesun2012](https://wordpress.org/support/users/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](https://wordpress.org/support/users/thesun2012/)
 * (@thesun2012)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/php8-php-fatal-error-uncaught-typeerror-sha1/#post-16997158)
 * 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.
 *  [Daniyal Raza](https://wordpress.org/support/users/daniyalraza01/)
 * (@daniyalraza01)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/php8-php-fatal-error-uncaught-typeerror-sha1/#post-16997324)
 * Hey [@thesun2012](https://wordpress.org/support/users/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](https://wordpress.org/support/users/thesun2012/)
 * (@thesun2012)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/php8-php-fatal-error-uncaught-typeerror-sha1/#post-16997439)
 * 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](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 2 years, 9 months ago by [John](https://wordpress.org/support/users/thesun2012/).
 *  [Daniyal Raza](https://wordpress.org/support/users/daniyalraza01/)
 * (@daniyalraza01)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/php8-php-fatal-error-uncaught-typeerror-sha1/#post-16998092)
 * Hey [@thesun2012](https://wordpress.org/support/users/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](https://wordpress.org/support/users/thesun2012/)
 * (@thesun2012)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/php8-php-fatal-error-uncaught-typeerror-sha1/#post-16998192)
 * 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 2 years, 9 months ago by [John](https://wordpress.org/support/users/thesun2012/).
 *  [Daniyal Raza](https://wordpress.org/support/users/daniyalraza01/)
 * (@daniyalraza01)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/php8-php-fatal-error-uncaught-typeerror-sha1/#post-17000509)
 * Hello [@thesun2012](https://wordpress.org/support/users/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
 * [Do](https://codex.mycred.me/classes/mycred_query_log/)[cumentation](https://codex.mycred.me/classes/mycred_query_log/)
 * 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](https://wordpress.org/support/users/thesun2012/)
 * (@thesun2012)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/php8-php-fatal-error-uncaught-typeerror-sha1/#post-17001203)
 * It works perfectly, I didn’t see that, thanks for your time.
 *  [Daniyal Raza](https://wordpress.org/support/users/daniyalraza01/)
 * (@daniyalraza01)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/php8-php-fatal-error-uncaught-typeerror-sha1/#post-17001228)
 * 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](https://wordpress.org/support/users/thesun2012/)
 * (@thesun2012)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/php8-php-fatal-error-uncaught-typeerror-sha1/#post-17001342)
 * Done, thank you.
 *  [Daniyal Raza](https://wordpress.org/support/users/daniyalraza01/)
 * (@daniyalraza01)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/php8-php-fatal-error-uncaught-typeerror-sha1/#post-17005316)
 * 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.

 * ![](https://ps.w.org/mycred/assets/icon-128x128.gif?rev=3512531)
 * [Points Management System For Gamification, Ranks, Badges, and Loyalty Rewards Program - myCred](https://wordpress.org/plugins/mycred/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mycred/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mycred/)
 * [Active Topics](https://wordpress.org/support/plugin/mycred/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mycred/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mycred/reviews/)

 * 13 replies
 * 2 participants
 * Last reply from: [Daniyal Raza](https://wordpress.org/support/users/daniyalraza01/)
 * Last activity: [2 years, 9 months ago](https://wordpress.org/support/topic/php8-php-fatal-error-uncaught-typeerror-sha1/#post-17005316)
 * Status: resolved