I’ve encountered an issue with the MapPress Maps plugin that I wanted to share with you, along with a potential fix. The goal was to create a dynamic map using MapPress, with Points of Interest (POIs) specified dynamically through our PHP code,
When utilizing the plugin, PHP Notices are being generated regarding attempts to access properties on a non-object within the mappress_poi.php file:
PHP Notice: Trying to get property ‘lat’ of non-object in /path_to_file/mappress_poi.php on line [line_number]
PHP Notice: Trying to get property ‘lng’ of non-object in /path_to_file/mappress_poi.php on line [line_number]
Upon investigating the code, it seems like the issue is occurring in the to_html() method where $this->point is being accessed as if it’s an object:
Could you please consider validating and possibly incorporating this adjustment in a future plugin update to prevent the aforementioned PHP Notices from occurring? The modification aligns with the current variable type declaration and seems to be coherent with the intended use of $point.