Support » Plugin: LocateAndFilter » All markers not showing on page load. Custom marker positioning is off.

  • Another issue I appear to be having is that I’d like all the available markers to display on page load as in this example – https://broadstone-mcdowell.gtma.dev/neighborhood/

    I have the maps configured the same, but the only marker that displays on page load is the “Navlia” custom marker – https://navalia.gtma.dev/neighborhood/ (uses a different host – https://wordkeeper.com/)

    I’m not sure if there is a discrepancy between the pro version used on Navalia as opposed to the free version on Broadstone McDowell.

    I’m also seeing this error when on the Map admin page:
    Warning: getimagesize(http://navalia.gtma.dev/wp-content/uploads/2022/03/map-icon-navalia.png): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in /home/staging_navalia/www/wp-content/plugins/locateandfilter_pro/public/class-locate-and-filter-public.php on line 1034

    The custom marker also looks as if it’s aligned to the top left of the image, as opposed to the bottom center, hence the marker shifts and moves away from the location when zooming in and out.

    The plugin also appears to cause a 429 error on https://navalia.gtma.dev/neighborhood/. I had to reach out to the host (wordkeeper) to relax the server settings. They said the plugin generates a lot of server requests. Not sure if anything can be helped with that.

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter gtmaandrew

    (@gtmaandrew)

    This is happening in the Pro version, by the way..

    Thread Starter gtmaandrew

    (@gtmaandrew)

    Hoping to have this resolved soon.

    Let me know if you’d like for me to create and admin user for you.

    Additional information:

    Server architecture Linux 5.13.4-x86_64-linode146 x86_64
    Web server nginx/1.21.3
    PHP version 7.4.28 (Supports 64bit values)
    PHP SAPI fpm-fcgi
    PHP max input variables 10000
    PHP time limit 30
    PHP memory limit 512M
    Max input time 60
    Upload max filesize 40M
    PHP post max size 40M
    cURL version 7.29.0 NSS/3.53.1
    Is SUHOSIN installed? No
    Is the Imagick library available? Yes
    Are pretty permalinks supported? Yes

    Extension mysqli
    Server version 10.5.15-MariaDB
    Client version mysqlnd 7.4.28
    Database username staging_navalia
    Database host localhost
    Database name staging_navalia
    Table prefix wp_
    Database charset utf8mb4
    Database collation utf8mb4_unicode_ci
    Max allowed packet size 1073741824
    Max connections number 100

    Plugin Author dgamoni

    (@dgamoni)

    it problem server setup your hosting provider
    all access to files Forbidden if not set ‘user_agent’
    please contact to support your hosting provider to disable this restriction

    Thread Starter gtmaandrew

    (@gtmaandrew)

    Thanks, reaching out to our hosting provider.

    Thread Starter gtmaandrew

    (@gtmaandrew)

    @dgamoni, I brought this up with the host and they recommended that you update your bot to include a user_agent, otherwise, they assume the bot is from a hacker.

    Is this something you are able to update?

    Regards!

    Plugin Author dgamoni

    (@dgamoni)

    Hi Andrew
    1
    I am set user agent on your server for test a month ago
    but did not see any changes
    Sorry I can’t help you more now
    because I don’t know how to solve it
    if you know how it can be fixed, I will add it to the code

    2
    It is worth noting that the paid features are indicated on the site and do not include support for adding new features
    the plugin was approved upon loading and was edited according to all standards

    3
    I am from Ukraine and due to the war, I am forced to migrate and cannot serve the plugin quickly and now
    but I try to solve every question as far as possible

    @dgamoni Please accept my best wishes for you and your family as you’re traveling right now. No one should be in the position that you’ve been put in and I genuinely hope the best for you as you work out how to handle that situation.

    As far as this particular forum topic problem, perhaps I can help some. The underlying problem really just stems from core use of PHP file I/O for URLs that the site actually has direct access to. The user agent issue is really just a symptom of the problem rather than the problem itself. In simple terms, it’s a bit of a logical code problem to fetch an asset (like an image) that the server has direct access to by using the URL to that image instead. By using the URL, the server has to go outside of itself through the internet only to loop right back to itself to get that asset. You could say that it is the long way around like if you needed to get the cup across the room and decided to leave the building, walk around it, and then come back in to get the cup from a different side of the room. It’s just more cumbersome than walking a few feet or meters across the room to the cup.

    The solution is just to fix that. In an effort to try to help Andrew, we took the liberty to try one solution. There are several ways that you could fix this but the one below is working for him.

    The problem is in this file:
    wp-content/plugins/locateandfilter_pro/public/class-locate-and-filter-public.php

    In it, you’ll find the following code to retrieve a custom map marker URL:

    $custom_marker = sanitize_key($customIconURL) ;
    list($width, $height, $type, $attr) = getimagesize($customIconURL);

    The code in this particular branch in your plugin appears to be limited to custom map marker images that are inside of the WordPress media library (not other URLs that aren’t in the media library). So a small modification to this code to the following seems to fix the problem.

    $custom_marker = sanitize_key($customIconURL) ;
    $customIconPath = str_replace(WP_CONTENT_URL, '', $customIconURL);
    list($width, $height, $type, $attr) = getimagesize(WP_CONTENT_DIR . $customIconPath);

    That that code does is just find the file path to the image in the customIconURL variable so that you don’t have to use PHP’s URL functions for I/O at all. Assuming that you wanted to continue using PHP’s native URL-supported functions for things like getimagesize, you could also just set a user agent via:

    ini_set(‘user_agent’, ‘whatever user agent you want to use’);

    Since ini_set is global to all other things in the site too, I don’t really recommend that route as it might have side effects. The code that I provided above is more of a direct approach to solving this problem and since we did test it for Andrew on his server and verified that it’s working for him, it might be a simple copy and paste solution for you to upgrade that part of your plugin to support more secure defaults on security-minded hosts.

    Hopefully that helps. Happy to explain further if that’s of any help to you.

    Plugin Author dgamoni

    (@dgamoni)

    Hi
    This solution fixed a problem
    Thanks a lot for helping @wordkeeper

    Moderator Steve Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Rep

    @dgamoni I’ve deleted your offer to login to your user’s site. I’m am 100% sure you mean well but please never ask for credentials on these forums.

    https://wordpress.org/support/guidelines/#the-bad-stuff

    Now for the why: The internet is a wonderful place full of very nice people and a few very bad ones. I’m sure everyone here is very nice however, by giving some ones keys to your house you are trusting they wont steal anything. Likewise the person who takes the keys is now responsible for the house FOREVER.

    If something was to go wrong, then you the author may well legally become liable for damages, which they would not normally have been as their software is provided without warranty.

    Please be aware that repeatedly asking for credentials will result in us escalating this to the plugins team.

    It’s never necessary to do that. Here’s why.

    There are many ways to get information you need and accessing the user’s site is not one of them. That’s going too far.

    You get the idea.

    Volunteer support is not easy. But these forums need to a safe place for all users, experienced or new. Accessing their system that way is a short cut that will get you into real trouble in these forums.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.