Title: PHP Error in frontend API
Last modified: January 15, 2022

---

# PHP Error in frontend API

 *  Resolved [djbill](https://wordpress.org/support/users/djbill/)
 * (@djbill)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/php-error-in-frontend-api/)
 * Hi,
 * Thank you for your work and your plugin. It is very well done on the backend 
   side and it is easy to use. But I’ve got some issues when I try to use inside
   the pages.
 * `2022/01/15 02:16:23 [error] 23719#23719: *632703 FastCGI sent in stderr: "PHP
   message: PHP Warning: foreach() argument must be of type array|object, bool given
   in /path/to/wordpress/wp-content/plugins/mapster-wp-maps/admin/api/class-mapster-
   wordpress-maps-api.php on line 529PHP message: PHP Warning: foreach() argument
   must be of type array|object, bool given in /path/to/wordpress/wp-content/plugins/
   mapster-wp-maps/admin/api/class-mapster-wordpress-maps-api.php on line 529PHP
   message: PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must
   be of type Countable|array, bool given in /path/to/wordpress/wp-content/plugins/
   mapster-wp-maps/admin/api/class-mapster-wordpress-maps-api.php:395`
 * How can I fix this error?
 * Thanks in advance
 * Francesco
    -  This topic was modified 4 years, 4 months ago by [djbill](https://wordpress.org/support/users/djbill/).
    -  This topic was modified 4 years, 4 months ago by [Yui](https://wordpress.org/support/users/fierevere/).

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Plugin Author [mapster](https://wordpress.org/support/users/mapster/)
 * (@mapster)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/php-error-in-frontend-api/#post-15256397)
 * Hey there! Thanks for the clear bug report. Try out the latest version (0.5.10)
   and let me know if that sorts things out.
 *  Thread Starter [djbill](https://wordpress.org/support/users/djbill/)
 * (@djbill)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/php-error-in-frontend-api/#post-15256434)
 * Hi,
 * thank you for your reply. I have only one error now but the map isn’t loading.
 * Here you can find the error report from nginx:
 *     ```
       2022/01/16 00:58:53 [error] 23719#23719: *758977 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /path/to/wordpress/wp-content/plugins/mapster-wp-maps/admin/api/class-mapster-wordpress-maps-api.php:405
       Stack trace:
       #0 /path/to/wordpress/wp-includes/rest-api/class-wp-rest-server.php(1140): mapster_wp_maps_get_single_map()
       #1 /path/to/wordpress/wp-includes/rest-api/class-wp-rest-server.php(987): WP_REST_Server->respond_to_request()
       #2 /path/to/wordpress/wp-includes/rest-api/class-wp-rest-server.php(414): WP_REST_Server->dispatch()
       #3 /path/to/wordpress/wp-includes/rest-api.php(370): WP_REST_Server->serve_request()
       #4 /path/to/wordpress/wp-includes/class-wp-hook.php(303): rest_api_loaded()
       #5 /path/to/wordpress/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
       #6 /path/to/wordpress/wp-includes/plugin.php(518): WP_Hook->do_action()
       #7 /path/to/wordpress/wp-includes/class-wp.php(388): do_action_ref_array()
       #8 /path/t" while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: address.to, request: "GET /wordpress/wp-json/mapster-wp-maps/map?id=35081 HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.0-fpm.sock:", host: "address.to"
       ```
   
 * Thanks for your good work!
 * Francesco
    -  This reply was modified 4 years, 4 months ago by [djbill](https://wordpress.org/support/users/djbill/).
 *  Plugin Author [mapster](https://wordpress.org/support/users/mapster/)
 * (@mapster)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/php-error-in-frontend-api/#post-15256441)
 * Hi, if you don’t mind, try re-downloading 0.5.10 (I made a small additional change),
   and hopefully that’s all for your errors. Let me know if more pop up though.
 *  Thread Starter [djbill](https://wordpress.org/support/users/djbill/)
 * (@djbill)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/php-error-in-frontend-api/#post-15256452)
 * Hi, everything seems fine now!
 * Tomorrow I will test it with a more complex map and I let you know if everything
   works well.
 * Thank you for the support
 * Francesco
 *  Thread Starter [djbill](https://wordpress.org/support/users/djbill/)
 * (@djbill)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/php-error-in-frontend-api/#post-15272073)
 * Hi,
 * I had to reinstall version 0.5.10 because of this error in the frontend with 
   the 0.5.11 when I try to show a popup.
 * > [View post on imgur.com](https://imgur.com/GGhpWro)
 * Thanks in advance
 * Francesco
 *  Plugin Author [mapster](https://wordpress.org/support/users/mapster/)
 * (@mapster)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/php-error-in-frontend-api/#post-15273698)
 * Yep, you caught us! We made a major improvement to front end loading and became
   aware of this error yesterday, and we are just preparing a push to fix it. It’ll
   be fixed later today in 0.5.12.
 *  Thread Starter [djbill](https://wordpress.org/support/users/djbill/)
 * (@djbill)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/php-error-in-frontend-api/#post-15290265)
 * Hi,
 * I think there is an error in 0.5.13 with the Custom Filter Search:
 * > [View post on imgur.com](https://imgur.com/9Wynbdp)
 * Thanks in advance
 * Francesco
 *  Plugin Author [mapster](https://wordpress.org/support/users/mapster/)
 * (@mapster)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/php-error-in-frontend-api/#post-15290297)
 * Hi Francesco, is this happening locally or is there a site I can visit? I believe
   I’ve fixed this in 0.5.13 but perhaps I was mistaken, it would be good to check
   the bug in action.
 *  Thread Starter [djbill](https://wordpress.org/support/users/djbill/)
 * (@djbill)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/php-error-in-frontend-api/#post-15290307)
 * I’ve the same problem with the 0.5.14
 * > [View post on imgur.com](https://imgur.com/fmGRU3y)
 * Can I can send you a link via private message or email?
 * Thanks!
 * Francesco
    -  This reply was modified 4 years, 3 months ago by [djbill](https://wordpress.org/support/users/djbill/).
 *  Plugin Author [mapster](https://wordpress.org/support/users/mapster/)
 * (@mapster)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/php-error-in-frontend-api/#post-15290312)
 * Yes. [victor@mapster.me](https://wordpress.org/support/topic/php-error-in-frontend-api/victor@mapster.me?output_format=md)
 *  Thread Starter [djbill](https://wordpress.org/support/users/djbill/)
 * (@djbill)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/php-error-in-frontend-api/#post-15290354)
 * Ok, mail sent.
 * Let me know if you need any other information.
 * Thanks
 * Francesco

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘PHP Error in frontend API’ is closed to new replies.

 * ![](https://ps.w.org/mapster-wp-maps/assets/icon-256x256.png?rev=3132969)
 * [Mapster WP Maps](https://wordpress.org/plugins/mapster-wp-maps/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mapster-wp-maps/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mapster-wp-maps/)
 * [Active Topics](https://wordpress.org/support/plugin/mapster-wp-maps/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mapster-wp-maps/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mapster-wp-maps/reviews/)

 * 11 replies
 * 2 participants
 * Last reply from: [djbill](https://wordpress.org/support/users/djbill/)
 * Last activity: [4 years, 3 months ago](https://wordpress.org/support/topic/php-error-in-frontend-api/#post-15290354)
 * Status: resolved