awesomemotive / simplemap

SimpleMap is an easy-to-use international store locator plugin that uses Google Maps to display information directly on your WordPress site.
https://simplemap-plugin.com/
GNU General Public License v3.0
63 stars 33 forks source link

Condense/Optimize Widget Class #223

Open EkoJR opened 7 years ago

EkoJR commented 7 years ago

Currently, within the widget.php file, there's a couple methods with variables unmodified and simply just multiple copies of separate parts of the instance array. For example...

$show_address   = $instance['show_address'];
$show_city      = $instance['show_city'];
$show_state     = $instance['show_state'];
$show_zip       = $instance['show_zip'];
$show_distance  = $instance['show_distance'];
$default_lat    = $instance['default_lat'];
$default_lng    = $instance['default_lng'];
$simplemap_page = $instance['simplemap_page'];

Since #151 resulted in a better method to handling the instance array. Many of these separate variables usage can be changed to the instance array. Cleaning it up would make it less confusing, save on memory, and allow better looping.

wpsmort commented 7 years ago

This is tested and is good. Needs a code review.