74% locatoraid

Code Review | Locatoraid Store Locator

WordPress plugin Locatoraid Store Locator scored74%from 54 tests.

About plugin

  • Plugin page: locatoraid
  • Plugin version: 3.9.27
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-6.3
  • WordPress version: 6.3.1
  • First release: Jan 20, 2014
  • Latest release: Oct 28, 2023
  • Number of updates: 236
  • Update frequency: every 15.1 days
  • Top authors: hitcode (77.54%)plainware (22.88%)

Code review

54 tests

User reviews

17 reviews

Install metrics

2,000+ active /125,594 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲1.60MB] [CPU: ▲17.46ms] Passed 4 tests

A check of server-side resources used by Locatoraid Store Locator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.86 ▲1.4060.30 ▲25.23
Dashboard /wp-admin5.02 ▲1.7172.78 ▲29.11
Posts /wp-admin/edit.php5.06 ▲1.7165.14 ▲20.35
Add New Post /wp-admin/post-new.php7.55 ▲1.67100.68 ▼4.84
Media Library /wp-admin/upload.php4.86 ▲1.6363.88 ▲33.29
Search Log /wp-admin/admin.php?page=locatoraid&hca=searchlog4.3236.00
Locations /wp-admin/admin.php?page=locatoraid&hca=locations4.3240.70
Publish /wp-admin/admin.php?page=locatoraid&hca=publish.wordpress4.3233.87
Add-Ons /wp-admin/admin.php?page=locatoraid&hca=promo4.3234.21
Configuration /wp-admin/admin.php?page=locatoraid&hca=conf4.3234.03
REST API /wp-admin/admin.php?page=locatoraid&hca=rest4.3233.65

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 340 new files
Database: 5 new tables, 8 new options
New tables
wp_lctr2_conf
wp_lctr2_locations
wp_lctr2_relations
wp_lctr2_migrations
wp_lctr2_searchlog
New WordPress options
widget_locatoraid_widget
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
locatoraid-rest_auth_code
widget_recent-posts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Locatoraid Store Locator
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲7214.28 ▼0.451.79 ▲0.0641.52 ▲2.99
Dashboard /wp-admin2,239 ▲595.57 ▼0.0481.71 ▼4.5240.17 ▼0.20
Posts /wp-admin/edit.php2,141 ▲411.96 ▼0.0835.28 ▲1.7436.90 ▲0.79
Add New Post /wp-admin/post-new.php6,232 ▲4,70619.05 ▼4.20893.96 ▲216.7156.09 ▼25.18
Media Library /wp-admin/upload.php1,447 ▲504.28 ▲0.1093.64 ▼1.6143.14 ▲0.65
Search Log /wp-admin/admin.php?page=locatoraid&hca=searchlog1,7656.73137.19131.15
Locations /wp-admin/admin.php?page=locatoraid&hca=locations1,7656.80145.2469.62
Publish /wp-admin/admin.php?page=locatoraid&hca=publish.wordpress1,7656.67132.4170.56
Add-Ons /wp-admin/admin.php?page=locatoraid&hca=promo1,7656.63121.8667.82
Configuration /wp-admin/admin.php?page=locatoraid&hca=conf1,7626.64118.4466.67
REST API /wp-admin/admin.php?page=locatoraid&hca=rest1,7656.61121.6565.69

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie tables detected upon uninstall: 5 tables
    • wp_lctr2_locations
    • wp_lctr2_relations
    • wp_lctr2_conf
    • wp_lctr2_searchlog
    • wp_lctr2_migrations
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_locatoraid_widget
    • locatoraid-rest_auth_code
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=locatoraid&hca=searchlog
    • > Console-api (warning) in unknown
    http://maps.googleapis.com/maps/api/js?_=1698555644326 210:51 "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/admin.php?page=locatoraid&hca=locations
    • > Console-api (warning) in unknown
    http://maps.googleapis.com/maps/api/js?_=1698555646224 210:51 "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/admin.php?page=locatoraid&hca=publish.wordpress
    • > Console-api (warning) in unknown
    http://maps.googleapis.com/maps/api/js?_=1698555648090 210:51 "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/admin.php?page=locatoraid&hca=promo
    • > Console-api (warning) in unknown
    http://maps.googleapis.com/maps/api/js?_=1698555649957 210:51 "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/admin.php?page=locatoraid&hca=conf
    • > Console-api (warning) in unknown
    http://maps.googleapis.com/maps/api/js?_=1698555651808 210:51 "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/admin.php?page=locatoraid&hca=rest
    • > Console-api (warning) in unknown
    http://maps.googleapis.com/maps/api/js?_=1698555653664 210:51 "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"

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 45 tag instead of maximum 10
You can take inspiration from this readme.txt

locatoraid/locatoraid.php Passed 13 tests

The main PHP script in "Locatoraid Store Locator" version 3.9.27 is automatically included on every request by WordPress
20 characters long description:
Store locator plugin

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin27,121 lines of code in 332 files:
LanguageFilesBlank linesComment linesLines of code
PHP3164,4663,95823,225
JavaScript126636932,910
CSS311049965
Markdown15021

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity12.52
▷ Minimum class complexity1.00
▷ Maximum class complexity298.00
Average method complexity3.73
▷ Minimum method complexity1.00
▷ Maximum method complexity56.00
Code structure
Namespaces0
Interfaces3
Traits0
Classes235
▷ Abstract classes20.85%
▷ Concrete classes23399.15%
▷ Final classes00.00%
Methods920
▷ Static methods374.02%
▷ Public methods81188.15%
▷ Protected methods9710.54%
▷ Private methods121.30%
Functions106
▷ Named functions2422.64%
▷ Anonymous functions8277.36%
Constants7
▷ Global constants457.14%
▷ Class constants342.86%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
happ2/modules/maps_google/assets/js/images/m2.png3.18KB2.36KB▼ 25.77%
happ2/modules/maps_google/assets/js/images/m3.png3.86KB3.06KB▼ 20.80%
happ2/modules/maps_google/assets/js/images/m1.png2.93KB2.20KB▼ 25.07%
happ2/modules/maps_google/assets/js/images/m4.png5.57KB4.23KB▼ 24.08%
happ2/modules/maps_google/assets/js/images/m5.png6.68KB5.10KB▼ 23.66%