Fatal error: IP address must be of type string
-
Hi,
I tried to show country-dependent free shipping information on a banner using the following short code:[CBC show=y country="ch"]Free shipping from 50 CHF[/CBC][CBC show=y country="at,be,bg,hr,cy,cz,dk,ee,fi,fr,de,gr,hu,ie,it,lv,lt,lu,mt,nl,pl,pt,ro,sk,si,es,se"]Free shipping from 40 EUR[/CBC]
It works fine for me in Switzerland (first case above), but a friend in France gets a fatal error.
When I tried using geotargetly.com with France as a country, it seems to work OK.
I also tried using show=”y” (with quotes) and show=y (without) having read about it in some post.
Anything obvious in the trace below?
Thanks in advance for your help!–Pete
Fatal error: Uncaught TypeError: MaxMind\Db\Reader::get(): Argument #1 ($ipAddress) must be of type string, null given, called in /home/clients/b41c0f6ff95ac05cc8c2af0787b9ce1f/sites/homnes.co/wp-content/plugins/custom-content-by-country/vendor/geoip2/geoip2/src/Database/Reader.php on line 242 and defined in /home/clients/b41c0f6ff95ac05cc8c2af0787b9ce1f/sites/homnes.co/wp-content/plugins/woocommerce/vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php:122 Stack trace: #0 /home/clients/b41c0f6ff95ac05cc8c2af0787b9ce1f/sites/homnes.co/wp-content/plugins/custom-content-by-country/vendor/geoip2/geoip2/src/Database/Reader.php(242): MaxMind\Db\Reader->get(NULL) #1 /home/clients/b41c0f6ff95ac05cc8c2af0787b9ce1f/sites/homnes.co/wp-content/plugins/custom-content-by-country/vendor/geoip2/geoip2/src/Database/Reader.php(215): GeoIp2\Database\Reader->getRecord('Country', 'Country', NULL) #2 /home/clients/b41c0f6ff95ac05cc8c2af0787b9ce1f/sites/homnes.co/wp-content/plugins/custom-content-by-country/vendor/geoip2/geoip2/src/Database/Reader.php(88): GeoIp2\Database\Reader->modelFor('Country', 'Country', NULL) #3 /home/clients/b41c0f6ff95ac05cc8c2af0787b9ce1f/sites/homnes.co/wp-content/plugins/custom-content-by-country/src/GeoIP/RetrieveCountryForVisitor.php(16): GeoIp2\Database\Reader->country(NULL) #4 /home/clients/b41c0f6ff95ac05cc8c2af0787b9ce1f/sites/homnes.co/wp-content/plugins/custom-content-by-country/src/icwp-ccbc-processor.php(351): FernleafSystems\Wordpress\Plugin\CCBC\GeoIP\RetrieveCountryForVisitor->lookupIP(NULL) #5 /home/clients/b41c0f6ff95ac05cc8c2af0787b9ce1f/sites/homnes.co/wp-content/plugins/custom-content-by-country/src/icwp-ccbc-processor.php(284): ICWP_CCBC_Processor_GeoLocation->getMMCountry() #6 /home/clients/b41c0f6ff95ac05cc8c2af0787b9ce1f/sites/homnes.co/wp-content/plugins/custom-content-by-country/src/icwp-ccbc-processor.php(171): ICWP_CCBC_Processor_GeoLocation->getVisitorCountryCode() #7 /home/clients/b41c0f6ff95ac05cc8c2af0787b9ce1f/sites/homnes.co/wp-includes/shortcodes.php(356): ICWP_CCBC_Processor_GeoLocation->sc_printContentByCountry(Array, 'Livraison gratu...', 'CBC') #8 [internal function]: do_shortcode_tag(Array) #9 /home/clients/b41c0f6ff95ac05cc8c2af0787b9ce1f/sites/homnes.co/wp-includes/shortcodes.php(228): preg_replace_callback('/\\[(\\[?)(CBC)(?...', 'do_shortcode_ta...', '\n<p>[CBC show=y...') #10 /home/clients/b41c0f6ff95ac05cc8c2af0787b9ce1f/sites/homnes.co/wp-includes/class-wp-hook.php(309): do_shortcode('\n<p>[CBC show=y...') #11 /home/clients/b41c0f6ff95ac05cc8c2af0787b9ce1f/sites/homnes.co/wp-includes/plugin.php(191): WP_Hook->apply_filters('\n<p>[CBC show=y...', Array) #12 /home/clients/b41c0f6ff95ac05cc8c2af0787b9ce1f/sites/homnes.co/wp-includes/widgets/class-wp-widget-block.php(81): apply_filters('widget_block_co...', '<!-- wp:paragra...', Array, Object(WP_Widget_Block)) #13 /home/clients/b41c0f6ff95ac05cc8c2af0787b9ce1f/sites/homnes.co/wp-includes/class-wp-widget.php(393): WP_Widget_Block->widget(Array, Array) #14 /home/clients/b41c0f6ff95ac05cc8c2af0787b9ce1f/sites/homnes.co/wp-includes/widgets.php(835): WP_Widget->display_callback(Array, Array) #15 /home/clients/b41c0f6ff95ac05cc8c2af0787b9ce1f/sites/homnes.co/wp-content/themes/astra/inc/markup-extras.php(1278): dynamic_sidebar('header-widget-2') #16 /home/clients/b41c0f6ff95ac05cc8c2af0787b9ce1f/sites/homnes.co/wp-content/themes/astra/template-parts/header/builder/components.php(183): astra_get_sidebar('header-widget-2') #17 /home/clients/b41c0f6ff95ac05cc8c2af0787b9ce1f/sites/homnes.co/wp-includes/template.php(772): require('/home/clients/b...') #18 /home/clients/b41c0f6ff95ac05cc8c2af0787b9ce1f/sites/homnes.co/wp-includes/template.php(716): load_template('/home/clients/b...', false, Array) #19 /home/clients/b41c0f6ff95ac05cc8c2af0787b9ce1f/sites/homnes.co/wp-includes/general-template.php(204): locate_template(Array, true, false, Array) #20 /home/clients/b41c0f6ff95ac05cc8c2af0787b9ce1f/sites/homnes.co/wp-content/themes/astra/inc/core/builder/class-astra-builder-helper.php(903): get_template_part('template-parts/...', '', Array) #21 /home/clients/b41c0f6ff95ac05cc8c2af0787b9ce1f/sites/homnes.co/wp-content/themes/astra/inc/builder/marku
- The topic ‘Fatal error: IP address must be of type string’ is closed to new replies.