78% simplemap

Code Review | SimpleMap Store Locator

WordPress plugin SimpleMap Store Locator scored78%from 54 tests.

About plugin

  • Plugin page: simplemap
  • Plugin version: 2.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.3.2
  • WordPress version: 6.3.1
  • First release: Aug 10, 2009
  • Latest release: Feb 12, 2020
  • Number of updates: 106
  • Update frequency: every 36.2 days
  • Top authors: aliso (47.17%)blepoxp (25.47%)hallsofmontezuma (20.75%)pbaylies (4.72%)benjaminprojas (3.77%)

Code review

54 tests

User reviews

25 reviews

Install metrics

1,000+ active /91,645 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.86MB] [CPU: ▲1.10ms] 75% from 4 tests

Analyzing server-side resources used by SimpleMap Store Locator
It is recommended to improve the following
  • CPU: Try to keep total CPU usage under 500.00ms (currently 521.04ms on /wp-admin/edit.php?post_type=sm-location&page=simplemap-import-export)
PageMemory (MB)CPU Time (ms)
Home /4.25 ▲0.7845.94 ▲6.82
Dashboard /wp-admin4.24 ▲0.8956.18 ▼5.20
Posts /wp-admin/edit.php4.29 ▲0.9358.29 ▲12.64
Add New Post /wp-admin/post-new.php6.78 ▲0.8996.28 ▼3.96
Media Library /wp-admin/upload.php4.10 ▲0.8744.84 ▲6.75
Premium Support /wp-admin/edit.php?post_type=sm-location&page=simplemap-help4.15391.94
Add New /wp-admin/post-new.php?post_type=sm-location4.30318.62
Import / Export CSV /wp-admin/edit.php?post_type=sm-location&page=simplemap-import-export4.15521.04
General Options /wp-admin/edit.php?post_type=sm-location&page=simplemap4.17310.91
Location Categories /wp-admin/edit-tags.php?taxonomy=sm-category&post_type=sm-location4.0944.81
Location Tags /wp-admin/edit-tags.php?taxonomy=sm-tag&post_type=sm-location4.0935.64
Locations /wp-admin/edit.php?post_type=sm-location4.2144.53

Server storage [IO: ▲0.44MB] [DB: ▲0.00MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 40 new files
Database: no new tables, 8 new options
New WordPress options
SimpleMap_options
can_compress_scripts
db_upgraded
widget_sm_search_widget
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for SimpleMap Store Locator
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,966 ▲19515.19 ▲0.6228.29 ▲26.2341.07 ▲2.56
Dashboard /wp-admin2,250 ▲765.71 ▲0.18107.41 ▲9.0642.46 ▲0.47
Posts /wp-admin/edit.php2,163 ▲632.57 ▲0.6245.98 ▲6.0437.99 ▼0.06
Add New Post /wp-admin/post-new.php1,578 ▲5224.16 ▲1.31699.39 ▲56.0157.57 ▼13.01
Media Library /wp-admin/upload.php1,465 ▲655.23 ▲1.03105.61 ▼4.4742.73 ▼8.36
Premium Support /wp-admin/edit.php?post_type=sm-location&page=simplemap-help1,1622.4232.6043.99
Add New /wp-admin/post-new.php?post_type=sm-location4,0629.27288.87207.01
Import / Export CSV /wp-admin/edit.php?post_type=sm-location&page=simplemap-import-export9902.6734.3634.29
General Options /wp-admin/edit.php?post_type=sm-location&page=simplemap3,6722.2932.8963.25
Location Categories /wp-admin/edit-tags.php?taxonomy=sm-category&post_type=sm-location1,3362.9235.0135.78
Location Tags /wp-admin/edit-tags.php?taxonomy=sm-tag&post_type=sm-location1,3052.7535.1026.62
Locations /wp-admin/edit.php?post_type=sm-location1,1382.6737.4329.77

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • SimpleMap_options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_sm_search_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/simplemap/simplemap.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simplemap/classes/widgets.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/simplemap/simplemap.php:28

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=sm-location
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?v=3&key&language=en&region=US&ver=6.3.1 276:267 "Google Maps JavaScript API has been loaded directly without a callback. This is not supported and can lead to race conditions and suboptimal performance. For supported loading patterns please see https://goo.gle/js-api-loading"
    • > GET request to /wp-admin/post-new.php?post_type=sm-location
    • > Console-api (severe) in unknown
    https://maps.googleapis.com/maps/api/js?v=3&key&language=en&region=US&ver=6.3.1 159:426 "You are using this API without a key. See https://developers.google.com/maps/documentation/javascript/error-messages?utm_source=maps_js&utm_medium=degraded&utm_campaign=billing#api-key-and-billing-errors"

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
9 plugin tags: maps, google maps, locator, map, locations...

simplemap/simplemap.php Passed 13 tests

"SimpleMap Store Locator" version 2.6.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
127 characters long description:
An easy-to-use international store locator plugin that uses Google Maps to display information directly on your WordPress site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected6,995 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP141,4091,6886,164
CSS314626820
XML10011

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity56.19
▷ Minimum class complexity2.00
▷ Maximum class complexity195.00
Average method complexity7.49
▷ Minimum method complexity1.00
▷ Maximum method complexity68.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods136
▷ Static methods00.00%
▷ Public methods12793.38%
▷ Protected methods85.88%
▷ Private methods10.74%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
13 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/images/black-dot.png0.39KB0.71KB0.00%
inc/images/teal-dot.png0.90KB1.02KB0.00%
inc/images/button-red-grad.png0.13KB0.24KB0.00%
inc/images/red-dot.png0.86KB1.01KB0.00%
inc/images/star.png0.59KB0.72KB0.00%