Fatal error in class-wc-shipping-legacy-free-shipping.php
-
Uncaught Error: Call to a member function get_shipping_countries() on null in /home/mywebsite/public_html/wp-content/plugins/woocommerce/includes/shipping/legacy-free-shipping/class-wc-shipping-legacy-free-shipping.php:127
-
Hi @kenrichman .
Thanks for reaching out!
I understand you are experiencing an error related to the legacy free shipping method in your WooCommerce installation. Specifically,
get_shipping_countries()
is called on an object that is either non-existent or isn’t configured properly.Please clarify where and when exactly this error shows up and how exactly it affects your shipping at this time.
To better assist, could you please tell me a bit more about your specific shipping configuration? Also, a screenshot of WooCommerce →?Settings →
Shipping
→?Shipping zones may be helpful.Snipboard.io?can be used for easily sharing screenshots – please follow the instructions on that page, then paste the URL in this thread.
Finally, please also include your status report found under WooCommerce?→?Status. Select?
Get system report
?and then?Copy for support
.Cheers!
This error caused the site to crash when logging in to the admin dashboard. In order to login as admin I had to rename the WooCommerce plugin from the server. Then in order to access the shipping zone settings I had to hack the WooCommerce files that were causing the crash because re-activating WooCommerce caused the site to crash again.
There are no shipping zones configured – only free shipping (legacy) and international shipping (legacy).
WordPress Environment WordPress address (URL): https://thewatchsalon.com
Site address (URL): https://thewatchsalon.com
WC Version: 7.5.1
REST API Version: ? 7.5.1
WC Blocks Version: ? 9.6.6
Action Scheduler Version: ? 3.5.4
Log Directory Writable: ?
WP Version: 6.2
WP Multisite: –
WP Memory Limit: 256 MB
WP Debug Mode: ?
WP Cron: ?
Language: en_GB
External object cache: – Server Environment Server Info: LiteSpeed
PHP Version: 7.4.33
PHP Post Max Size: 512 MB
PHP Time Limit: 120
PHP Max Input Vars: 8000
cURL Version: 7.84.0
OpenSSL/1.1.1p SUHOSIN Installed: –
MySQL Version: 10.3.38-MariaDB-log-cll-lve
Max Upload Size: 512 MB
Default Timezone is UTC: ?
fsockopen/cURL: ?
SoapClient: ? Your server does not have the SoapClient class enabled - some gateway plugins which use SOAP may not work as expected.
DOMDocument: ?
GZip: ?
Multibyte String: ?
Remote Post: ?
Remote Get: ? Database WC Database Version: 7.5.1
WC Database Prefix: wpmb_
Total Database Size: 45.19MB
Database Data Size: 37.94MB
Database Index Size: 7.25MB
wpmb_woocommerce_sessions: Data: 1.02MB + Index: 0.02MB + Engine InnoDB
wpmb_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wpmb_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wpmb_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_woocommerce_order_itemmeta: Data: 0.08MB + Index: 0.09MB + Engine InnoDB
wpmb_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wpmb_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wpmb_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wpmb_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wpmb_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wpmb_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wpmb_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_actionscheduler_actions: Data: 0.09MB + Index: 0.13MB + Engine InnoDB
wpmb_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_actionscheduler_logs: Data: 0.06MB + Index: 0.03MB + Engine InnoDB
wpmb_chat_lines: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_chat_logs: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_chat_online: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wpmb_chat_visitors: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wpmb_comments: Data: 0.06MB + Index: 0.09MB + Engine InnoDB
wpmb_fusion_forms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wpmb_fusion_form_entries: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_fusion_form_fields: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_fusion_form_submissions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_options: Data: 8.41MB + Index: 0.14MB + Engine InnoDB
wpmb_postmeta: Data: 3.52MB + Index: 0.77MB + Engine InnoDB
wpmb_posts: Data: 1.52MB + Index: 0.28MB + Engine InnoDB
wpmb_revslider_css: Data: 0.05MB + Index: 0.00MB + Engine InnoDB
wpmb_revslider_css_bkp: Data: 0.05MB + Index: 0.02MB + Engine InnoDB
wpmb_revslider_layer_animations: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wpmb_revslider_layer_animations_bkp: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_revslider_navigations: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wpmb_revslider_navigations_bkp: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wpmb_revslider_sliders: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wpmb_revslider_sliders_bkp: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_revslider_slides: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wpmb_revslider_slides_bkp: Data: 0.08MB + Index: 0.02MB + Engine InnoDB
wpmb_revslider_static_slides: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wpmb_revslider_static_slides_bkp: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_taxonomymeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wpmb_termmeta: Data: 0.05MB + Index: 0.03MB + Engine InnoDB
wpmb_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wpmb_term_relationships: Data: 0.05MB + Index: 0.02MB + Engine InnoDB
wpmb_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wpmb_usermeta: Data: 2.52MB + Index: 2.95MB + Engine InnoDB
wpmb_users: Data: 0.22MB + Index: 0.23MB + Engine InnoDB
wpmb_wc_admin_notes: Data: 0.06MB + Index: 0.00MB + Engine InnoDB
wpmb_wc_admin_note_actions: Data: 0.05MB + Index: 0.02MB + Engine InnoDB
wpmb_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wpmb_wc_customer_lookup: Data: 0.20MB + Index: 0.22MB + Engine InnoDB
wpmb_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wpmb_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wpmb_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wpmb_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wpmb_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wpmb_wc_product_attributes_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
wpmb_wc_product_download_directories: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
wpmb_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
wpmb_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wpmb_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_wfblockediplog: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wpmb_wfblocks7: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wpmb_wfconfig: Data: 1.30MB + Index: 0.00MB + Engine InnoDB
wpmb_wfcrawlers: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wpmb_wffilechanges: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wpmb_wffilemods: Data: 10.52MB + Index: 0.00MB + Engine InnoDB
wpmb_wfhits: Data: 0.36MB + Index: 0.09MB + Engine InnoDB
wpmb_wfhoover: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_wfissues: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wpmb_wfknownfilelist: Data: 5.52MB + Index: 0.00MB + Engine InnoDB
wpmb_wflivetraffichuman: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_wflocs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wpmb_wflogins: Data: 0.42MB + Index: 0.16MB + Engine InnoDB
wpmb_wfls_2fa_secrets: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_wfls_role_counts: Data: 0.00MB + Index: 0.00MB + Engine MEMORY
wpmb_wfls_settings: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wpmb_wfnotifications: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wpmb_wfpendingissues: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wpmb_wfreversecache: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wpmb_wfsnipcache: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wpmb_wfstatus: Data: 0.17MB + Index: 0.13MB + Engine InnoDB
wpmb_wftrafficrates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wpmb_wpforms_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wpmb_wpmailsmtp_debug_events: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wpmb_wpmailsmtp_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wpmb_yith_wcwl: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_yith_wcwl_lists: Data: 0.02MB + Index: 0.13MB + Engine InnoDB
wpmb_yoast_indexable: Data: 0.08MB + Index: 0.09MB + Engine InnoDB
wpmb_yoast_indexable_hierarchy: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wpmb_yoast_migrations: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wpmb_yoast_primary_term: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wpmb_yoast_seo_links: Data: 0.06MB + Index: 0.03MB + Engine InnoDB
wpmb_yoast_seo_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB Post Type Counts attachment: 655
avada_faq: 12
custom_css: 1
fusion_form: 1
nav_menu_item: 76
option-tree: 1
page: 22
post: 1
product: 64
revision: 182
shop_order: 61
shop_order_refund: 4
slide: 3
staticblocks: 3 Security Secure connection (HTTPS): ?
Hide errors from visitors: ?Error messages should not be shown to visitors. Active Plugins (14) Redux Framework: by Team Redux – 4.4.0
CookieYes | GDPR Cookie Consent: by CookieYes – 3.0.8
Disable Comments: by WPDeveloper – 2.4.3
Avada Builder: by ThemeFusion – 3.10.0
Avada Core: by ThemeFusion – 5.10.0
Limit Login Attempts: by Johan Eenfeldt – 1.7.1
Really Simple SSL: by Really Simple Plugins – 6.2.3
UpdraftPlus - Backup/Restore: by UpdraftPlus.Com
DavidAnderson – 1.23.3 WooCommerce: by Automattic – 7.5.1
Wordfence Security: by Wordfence – 7.9.2
Yoast SEO: by Team Yoast – 20.4
WP Mail SMTP: by WPForms – 3.7.0
WP Super Cache: by Automattic – 1.9.4
WPForms Lite: by WPForms – 1.8.1.1 Inactive Plugins (5) CMB2: by CMB2 team – 2.10.1
Google Analytics for WordPress by MonsterInsights: by MonsterInsights – 8.14.0
Slider Revolution: by ThemePunch – 6.2.23
WordPress Font Uploader: by Pippin Williamson – 2.2
YITH WooCommerce Wishlist: by YITH – 3.19.0 Dropin Plugins (1) advanced-cache.php: advanced-cache.php Settings API Enabled: ?
Force SSL: –
Currency: GBP (£)
Currency Position: left
Thousand Separator: ,
Decimal Separator: .
Number of Decimals: 2
Taxonomies: Product Types: external (external)
grouped (grouped)
simple (simple)
variable (variable) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
exclude-from-search (exclude-from-search)
featured (featured)
outofstock (outofstock)
rated-1 (rated-1)
rated-2 (rated-2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-5 (rated-5) Connected to WooCommerce.com: –
Enforce Approved Product Download Directories: –
Order datastore: WC_Order_Data_Store_CPT WC Pages Shop base: #5 - /shop/
Basket: #6 - /cart/
Checkout: #7 - /checkout/
My account: #8 - /my-account/
Terms and conditions: #240 - /terms-conditions/ Theme Name: Avada
Version: 7.10.0
Author URL: https://themeforest.net/user/ThemeFusion
Child Theme: ? – If you are modifying WooCommerce on a parent theme that you did not build
personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: ? Templates Overrides: Avada/woocommerce/cart/cart.php
Avada/woocommerce/checkout/form-pay.php
Avada/woocommerce/checkout/review-order.php
Avada/woocommerce/checkout/thankyou.php
Avada/woocommerce/loop/loop-start.php
Avada/woocommerce/single-product/add-to-cart/variable.php
Avada/woocommerce/single-product/short-description.php
Avada/woocommerce/single-product/tabs/additional-information.php
Avada/woocommerce/single-product/tabs/description.php Admin Enabled Features: activity-panels
analytics
coupons
customer-effort-score-tracks
import-products-task
experimental-fashion-sample-products
shipping-smart-defaults
shipping-setting-tour
homescreen
marketing
multichannel-marketing
mobile-app-banner
navigation
onboarding
onboarding-tasks
remote-inbox-notifications
remote-free-extensions
payment-gateway-suggestions
shipping-label-banner
subscriptions
store-alerts
transient-notices
woo-mobile-welcome
wc-pay-promotion
wc-pay-welcome-page Disabled Features: minified-js
new-product-management-experience
product-variation-management
settings Daily Cron: ? Next scheduled: 2023-04-04 00:07:14 +01:00
Options: ?
Notes: 116
Onboarding: completed Action Scheduler Complete: 145
Oldest: 2023-03-31 16:10:20 +0100
Newest: 2023-04-03 10:17:11 +0100 Pending: 7
Oldest: 2023-04-03 10:17:27 +0100
Newest: 2023-04-08 19:13:43 +0100 Status report information Generated at: 2023-04-03 10:17:33 +01:00
`Hello @kenrichman,
Checking the error logs, it seems like this public function is not called properly.
Also, the mentioned file is for backward compatibility for a feature deprecated since 2016.
I wasn’t able to reproduce the issue since my version of WooCommerce doesn’t have this legacy method but I assume this will be fixed by simply creating shipping zones and or removing any plugin that still uses that deprecated feature.
I suggest you try reinstalling WooCommerce to restore any corrupted files as well as creating new shipping zones.But before you proceed with any of the steps mentioned above, please make sure to create a backup in case things go wrong.
If you still get the error after doing the above please let us know!Hi,
We haven’t heard back from you in a while, so I’m going to mark this as resolved – we’ll be here if and/or when you are ready to continue.
Kind regards.
- The topic ‘Fatal error in class-wc-shipping-legacy-free-shipping.php’ is closed to new replies.