• Resolved tajenli

    (@tajenli)


    We have been using WP Store Locator for a few years and it works great!

    Recently we got a strange error that the locations loading taking forever to load. So I check the server error logs and found this:

    I think the error is opening hour related. Do we need to purchase the 6 months of support so you can help us? Thank you!

    PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /nas/content/live/tjcorgdev/wp-content/plugins/wp-store-locator/frontend/class-frontend.php:560\\nStack trace:\\n#0 /…/wp-content/plugins/wp-store-locator/frontend/class-frontend.php(533): WPSL_Frontend->create_opening_hours_tabel(Array, true)\\n#1 /…/wp-content/plugins/wp-store-locator/frontend/class-frontend.php(360): WPSL_Frontend->get_opening_hours(Array, true)\\n#2 /…/wp-content/plugins/wp-store-locator/frontend/class-frontend.php(296): WPSL_Frontend->get_store_meta_data(Array)\\n#3 /…/wp-content/plugins/wp-store-locator/frontend/class-frontend.php(116): WPSL_Frontend->find_nearby_locations()\\n#4 /…/wp-includes/class-wp-hook.php(308): WPSL_Frontend->store_search(”)\\n#5 /…/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(”, Array)\\n#6 /…/wp-includes/plugin.php(517): WP_Hook->do_action(Array)\\n#7 /…/wp-admin/admin-ajax.php(188): do_action(‘wp_ajax_store_s…’)\\n#8 {main}\\n thrown in /…/wp-content/plugins/wp-store-locator/frontend/class-frontend.php on line 560″,

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there!

    We are aware of a small bug that produces the results you mention under some circumstances, and we will fix it in the next release.

    In the meantime, you can fix it by changing the contents of line 560 in the frontend/class-frontend.php file from:

    $hour_count = count( $hours[$index] );

    to

    $hour_count = ( is_array( $hours ) && array_key_exists( $index, $hours ) ) ? count( $hours[$index] ) : 0;

    We apologize for the inconvenience, you should get going for the time being with that quick and dirty fix.

    Regards,

    Thread Starter tajenli

    (@tajenli)

    Hi Farroyo,
    Thank you so much for the solution. I updated the codes and it works great now!

    That is great to know.

    Apologies for the issue!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WP Store Locator Error’ is closed to new replies.