79% locations

Code Review | Locations

WordPress plugin Locations scored79%from 54 tests.

About plugin

  • Plugin page: locations
  • Plugin version: 4.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.7.2
  • WordPress version: 6.3.1
  • First release: Feb 19, 2014
  • Latest release: Jul 1, 2021
  • Number of updates: 60
  • Update frequency: every 44.9 days
  • Top authors: richardgabriel (85%)ghuger (16.67%)

Code review

54 tests

User reviews

6 reviews

Install metrics

800+ active /38,487 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.80MB] [CPU: ▲1.92ms] Passed 4 tests

Analyzing server-side resources used by Locations
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.50 ▲1.0455.57 ▲16.38
Dashboard /wp-admin4.34 ▲1.0463.01 ▲6.85
Posts /wp-admin/edit.php4.40 ▲1.0567.35 ▲15.91
Add New Post /wp-admin/post-new.php5.97 ▲0.0867.33 ▼31.47
Media Library /wp-admin/upload.php4.27 ▲1.0459.88 ▲20.37
About Plugin /wp-admin/edit.php?post_type=location&page=gp_locations_aloha4.2551.11
Help & Instructions /wp-admin/edit.php?post_type=location&page=locations-help4.2348.86
Add New Location /wp-admin/post-new.php?post_type=location4.3569.64
Settings /wp-admin/edit.php?post_type=location&page=locations-settings4.2352.00
Upgrade To Pro /wp-admin/edit.php?post_type=location&page=locations-upgrade-to-pro4.2349.04
Locations /wp-admin/edit.php?post_type=location4.3153.07
Location Categories /wp-admin/edit-tags.php?taxonomy=location-categories&post_type=location4.2647.38

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 74 new files
Database: no new tables, 10 new options
New WordPress options
can_compress_scripts
widget_storelocatorwidgetajax
theysaidso_admin_options
widget_locationslistwidget
widget_recent-comments
widget_recent-posts
db_upgraded
widget_singlelocationwidget
widget_theysaidso_widget
widget_storelocatorwidget

Browser metrics Passed 4 tests

Checking browser requirements for Locations
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,034 ▲27314.43 ▼0.2926.03 ▲24.3938.55 ▼3.65
Dashboard /wp-admin2,288 ▲1075.12 ▼0.5997.86 ▼5.0546.39 ▲4.49
Posts /wp-admin/edit.php2,199 ▲992.56 ▲0.5341.01 ▲2.1535.26 ▼4.47
Add New Post /wp-admin/post-new.php1,641 ▲11523.54 ▲0.34667.56 ▼1.5738.67 ▼15.01
Media Library /wp-admin/upload.php1,497 ▲944.65 ▲0.47102.85 ▼3.7649.44 ▲5.67
About Plugin /wp-admin/edit.php?post_type=location&page=gp_locations_aloha1,0672.0225.8442.96
Help & Instructions /wp-admin/edit.php?post_type=location&page=locations-help9302.5037.3534.33
Add New Location /wp-admin/post-new.php?post_type=location2,1774.0569.4138.93
Settings /wp-admin/edit.php?post_type=location&page=locations-settings1,3422.5434.6933.34
Upgrade To Pro /wp-admin/edit.php?post_type=location&page=locations-upgrade-to-pro1,1192.2428.6657.95
Locations /wp-admin/edit.php?post_type=location1,3592.3732.2831.52
Location Categories /wp-admin/edit-tags.php?taxonomy=location-categories&post_type=location1,3642.2928.2928.62

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 10 options
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_locationslistwidget
    • widget_theysaidso_widget
    • widget_storelocatorwidget
    • widget_recent-posts
    • widget_recent-comments
    • widget_singlelocationwidget
    • widget_storelocatorwidgetajax

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
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/locations/templates/google-maps-info-window.php
  • 12× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/locations/widgets/single_location_widget.php:21
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/locations/templates/single-location-content.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/locations/blocks/single-location.php:50
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/locations/widgets/single_location_widget.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/locations/widgets/locations_list_widget.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/locations/blocks/store-locator.php:50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function menu_page_url() in wp-content/plugins/locations/assets/content/welcome.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/locations/widgets/store_locator_widget.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/locations/widgets/store_locator_widget_ajax.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_post_thumbnail() in wp-content/plugins/locations/templates/single-location-content.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: store locator, business address map, business locations, maps, business maps...

locations/locations.php Passed 13 tests

The main PHP script in "Locations" version 4.0 is automatically included on every request by WordPress
109 characters long description:
Easily add a Store Locator to your website. List your business' locations and show a Google map for each one.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected12,222 lines of code in 60 files:
LanguageFilesBlank linesComment linesLines of code
PHP297087124,560
CSS18288914,323
JavaScript113461732,553
SVG100685
HTML100101

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity25.05
▷ Minimum class complexity2.00
▷ Maximum class complexity107.00
Average method complexity3.36
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes00.00%
Methods224
▷ Static methods00.00%
▷ Public methods21796.88%
▷ Protected methods00.00%
▷ Private methods73.12%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
7 PNG files occupy 0.27MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/upgrade/import-export.png38.06KB15.12KB▼ 60.28%
lib/GP_MegaSeptember/assets/img/lock.png1.28KB1.25KB▼ 2.52%
lib/GP_MegaSeptember/assets/img/logo.png1.02KB0.92KB▼ 9.79%
assets/img/upgrade/locations-directory-widget.png191.02KB84.60KB▼ 55.71%
assets/img/lock.png1.28KB1.25KB▼ 2.52%