Uncaught Error: Call to a member function get_name() on bool
-
Hi,
We are importing orders from the 3rd party, and when we add orders on the website at that time we are facing the below fatal error. Could you let us know why it is happening and how to fix this?
PHP Fatal error: Uncaught Error: Call to a member function get_name() on bool in wp-content/plugins/wp-security-audit-log/classes/WPSensors/class-woocommerce-sensor.php
Let us know if you have any concerns.
Thanks,
-
Hello John!
I am sorry to hear about this experience with our plugin!
Since this is the first time seeing this one, I would have a few more questions for you, just to build some context:
1. Can you share with us the rest of the error details (if there are any?). At first glance, it seems like the error code is incomplete, so just double-checking.
2. Can you tell me a few details regarding the context in which this happens:
a) WordPress version of your site
b) PHP version of the site
c) Woocommerce version currently installed
d) What plugin handles the import of orders? If it’s a Free plugin, can you share it’s URL with us so we can check?
3. Can you elaborate a bit on the actual process of order import? Is there anything in particular we should know about regarding this import process? When does the error actually get triggered? Is it a one-time error, or can it be reproduced at any time following certain steps that you can describe?
A screen recording or some screenshots describing this process, and how to trigger the error, can help a lot! If you can share such details with us, please use test data for the orders and make sure no sensitive information is shared here on the forums.
Looking forward to hearing back from you on this.A small addition @vsourztesting on my previous message question list #2 :
e) Can you confirm that you are using the latest plugin version when this occurs, 5.1.0? If that’s not the case, please make sure you update the plugin to its latest version first and try to reproduce the problem again.
Does the same thing occur this time? Can you share the (full) error code generated this time with us? (if that’s the case)Hi Lucian,
Please fine below our comments with your comments.
Can you share with us the rest of the error details (if there are any?). At first glance, it seems like the error code is incomplete, so just double-checking.
=> We are getting only the above error within the debug log file.- Can you tell me a few details regarding the context in which this happens:
a) WordPress version of your site
=> WordPress version : 6.6.1
b) PHP version of the site
=> PHP version : 8.2c) Woocommerce version currently installed
=> Woocommerce version : 9.1.4d) What plugin handles the import of orders? If it’s a Free plugin, can you share it’s URL with us so we can check?
=> We are not using any 3rd party plugin for import orders on the website; we have created a custom PHP script for import orders, and without activating this plugin, it is working properly.- Can you elaborate a bit on the actual process of order import? Is there anything in particular we should know about regarding this import process? When does the error actually get triggered? Is it a one-time error, or can it be reproduced at any time following certain steps that you can describe?
=> We are importing orders through the cron process so we cannot generate errors from our end, and it is generating randomly.
As per error details, we are assuming this error generates when we are adding a product with an order, but that product does not exist on the website, and this plugin tries to get those product details from the website, but the product does not exist, so the plugin generates a fatal error.Please assume the above case with a fatal error and analyse your plugin code accordingly.
Let us know if you have any concerns.
Thanks
Hello again John!
Thank you for your answers. Allow me to offer some clarifications for each, and a few other questions.
1. Can you remind me if you are using the latest plugin version 5.1.0 ? If not, does this still happen after migrating the plugin to this latest version?
2. In regards to the incomplete error code:
PHP Fatal error: Uncaught Error: Call to a member function get_name() on bool in wp-content/plugins/wp-security-audit-log/classes/WPSensors/class-woocommerce-sensor.php
Usually the error generated in debug.log shows more lines of code, and also references on which particular line the error is generated. For example, in the above error code we have “945” at the very end referencing the line of code in that file where the error was triggered:[04-Sep-2024 07:24:09 UTC] PHP Fatal error: Uncaught TypeError: explode(): Argument #2 ($string) must be of type string, array given in /home/paxamilohe6556/web/public_html/wp-content/plugins/wp-security-audit-log/classes/Helpers/class-settings-helper.php:945
Can you please check again and try to generate the error once again with debug mode enabled and share it’s contents with us afterwards?
3. Since you mentioned “we have created a custom PHP script for import orders, and without activating this plugin, it is working properly.”
Since we are unfamiliar with this custom code, I will require a few more details from your end, and to be able to offer you some relevant support I would require a few more details from you:
A) Would it be possible to share a staging site with us via email on [email protected] while referencing this support ticket, so we can further investigate this? Make sure you do not share any sensitive information here on the forums.
You can use this website to encapsulate site details before sending for more privacy/securityB) Along with the above – Can you please also send us via email [email protected] , the system information file? This file includes information about your website and our plugin’s setup so we can better understand how it is configured. You can get the system information file from the?System Info?tab in the?Help & Contact Us?section in the plugin.
C) Can you also send us some precise step-by-step actions that we can take while on the site in order to generate the error? Without consistently being able to reproduce it, it will be very hard to tell what’s going on, so looking forward to this information from you as well.
Once again, please make sure you send everything requested on #3 via email [email protected] , as this is sensitive information that should not be disclosed here on the forums.
Many thanks! - Can you tell me a few details regarding the context in which this happens:
- You must be logged in to reply to this topic.