Fatal error…class-wc-geolocation.php on line 105
-
Hello!
I have a serious problem on my site. Every time I try to access the site, the following message appears:
Fatal error: Call to undefined function wc_clean () in /home/shopm342/public_html/wp-content/plugins/woocommerce/includes/class-wc-geolocation.php on line 105.
How can I solve this problem?
-
Hello
This is a ghost error and I’ve heard about it but can not catch it on my sideWrite me PM please here: http://codecanyon.net/item/woocommerce-currency-switcher/8085217/support with link to this forum and wp-admin access
Hello
I found receipt
find code block beginning from if ($this->storage->get_val(‘woocs_first_unique_visit’) == 0) and replace it to next code: (all blocke)
//WELCOME USER CURRENCY ACTIVATION if ($this->storage->get_val('woocs_first_unique_visit') == 0) { //$this->storage->set_val('woocs_first_unique_visit', 0); $this->is_first_unique_visit = true; $this->storage->set_val('woocs_current_currency', $this->get_welcome_currency()); $file_path = ABSPATH . 'wp-content/plugins/woocommerce/includes/class-wc-geolocation.php'; if (file_exists($file_path)) { if (!function_exists('wc_clean')) { function wc_clean($var) { return sanitize_text_field($var); } } include_once($file_path); $this->init_geo_currency(); runkit_function_remove('wc_clean'); } }We’re having this same issue.
This seems like this might fix it, but shouldn’t runkit_function_remove() only be used if the function doesn’t exist? Right now it’s always used, so it will remove the function that already pre-existed.
@kwojniak
You are right, so I added flag $wc_clean_is_defined to avoid it. Use next code please:if ($this->storage->get_val('woocs_first_unique_visit') == 0) { //$this->storage->set_val('woocs_first_unique_visit', 0); $this->is_first_unique_visit = true; $this->storage->set_val('woocs_current_currency', $this->get_welcome_currency()); $file_path = WP_PLUGIN_DIR . '/woocommerce/includes/class-wc-geolocation.php'; if (file_exists($file_path)) { $wc_clean_is_defined = true; if (function_exists('runkit_function_remove')) { if (!function_exists('wc_clean')) { $wc_clean_is_defined = false; function wc_clean($var) { return sanitize_text_field($var); } } } //*** include_once($file_path); $this->init_geo_currency(); //*** if (function_exists('runkit_function_remove') AND ! $wc_clean_is_defined) { runkit_function_remove('wc_clean'); } } }Looks good. Thanks!
Great! Welcome …
Hello!
I get this error after update to WC 2.4.9.
But ONLY on my iPad and mobile phone. The computer works normally.Since I have no idea what to do, even after reading the solution at the top, I’ve deactivated the plugin and are awaiting a fixed version.
Thanks a lot for fixing this soon! π
/Uffe
This is the exact error I get on mobile devices:
Fatal error: Class ‘WC_Logger’ not found in /home/uffe/data/www/uffesgjutformar.se/wp-content/plugins/woocommerce/includes/class-wc-geo-ip.php on line 1117
Thanks again.
Never mind. After new update to WC 2.4.10 it works. Was a bug in WC. π
@uffesgjutformar
Hello. Hehe, and such things happens too πI tried with free currency switcher plugin on my site. While I was using, there was no problem on my site. but Whenver I use the plugin, after a few hours, I could not access to my website. and displaying fatal eroor(….). I am sure this plugin caused the trouble, but I make sure this plugins need to be checked before I buy the plugin. please let me know that ASAP
@skaye234
Update to the latest woocommerce version, woo 2.4.3.9 had a bugHi guys.
Please, I have the same problem in localhost.
Where do i put this code? What file?
The topic ‘Fatal error…class-wc-geolocation.php on line 105’ is closed to new replies.