83% wp-store-locator

Code Review | WP Store Locator

WordPress plugin WP Store Locator scored83%from 54 tests.

About plugin

  • Plugin page: wp-store-locator
  • Plugin version: 2.2.241
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-6.3.1
  • WordPress version: 6.3.1
  • First release: Dec 31, 2013
  • Latest release: Oct 9, 2023
  • Number of updates: 178
  • Update frequency: every 20.1 days
  • Top authors: tijmensmit (100%)

Code review

54 tests

User reviews

288 reviews

Install metrics

60,000+ active /1,184,230 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.02MB] [CPU: ▲0.33ms] 75% from 4 tests

Server-side resources used by WP Store Locator
The following require your attention
  • CPU: You should keep total CPU usage under 500.00ms (currently 608.76ms on /wp-admin/edit.php?post_type=wpsl_stores&page=wpsl_add_ons)
PageMemory (MB)CPU Time (ms)
Home /4.02 ▲0.5544.71 ▲6.11
Dashboard /wp-admin4.48 ▲1.1852.12 ▲0.52
Posts /wp-admin/edit.php4.53 ▲1.1857.56 ▲0.88
Add New Post /wp-admin/post-new.php7.21 ▲1.32101.56 ▼6.17
Media Library /wp-admin/upload.php4.40 ▲1.1747.27 ▲8.79
All Stores /wp-admin/edit.php?post_type=wpsl_stores4.4847.50
New Store /wp-admin/post-new.php?post_type=wpsl_stores7.2192.50
Store Categories /wp-admin/edit-tags.php?taxonomy=wpsl_store_category&post_type=wpsl_stores4.4045.88
Settings /wp-admin/edit.php?post_type=wpsl_stores&page=wpsl_settings4.8053.26
Add-Ons /wp-admin/edit.php?post_type=wpsl_stores&page=wpsl_add_ons4.41608.76

Server storage [IO: ▲1.29MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 93 new files
Database: no new tables, 8 new options
New WordPress options
wpsl_version
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
wpsl_settings
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for WP Store Locator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,909 ▲14814.37 ▼0.261.78 ▼0.0744.83 ▲0.82
Dashboard /wp-admin2,307 ▲1275.71 ▼0.0096.95 ▲8.7345.98 ▲5.83
Posts /wp-admin/edit.php2,215 ▲1152.38 ▲0.3649.96 ▲10.6237.46 ▼6.98
Add New Post /wp-admin/post-new.php1,587 ▲6123.28 ▲0.16636.21 ▼40.1749.16 ▼3.04
Media Library /wp-admin/upload.php1,512 ▲1184.40 ▲0.10107.82 ▲10.6847.91 ▼1.60
All Stores /wp-admin/edit.php?post_type=wpsl_stores1,5054.6478.4934.04
New Store /wp-admin/post-new.php?post_type=wpsl_stores11,32727.60965.05153.59
Store Categories /wp-admin/edit-tags.php?taxonomy=wpsl_store_category&post_type=wpsl_stores1,3952.0041.1536.55
Settings /wp-admin/edit.php?post_type=wpsl_stores&page=wpsl_settings8,8747.53142.11149.46
Add-Ons /wp-admin/edit.php?post_type=wpsl_stores&page=wpsl_add_ons1,1804.3353.4799.52

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-store-locator/frontend/templates/store-listings-below.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-store-locator/admin/data-export.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/wp-store-locator/wp-store-locator.php:99
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-store-locator/frontend/templates/default.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-store-locator/admin/upgrade.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Screenshots: A description for screenshot #5 is required in wp-store-locator/assets to your readme.txt
  • Tags: You are using too many tags: 16 tag instead of maximum 10
You can look at the official readme.txt

wp-store-locator/wp-store-locator.php 92% from 13 tests

This is the main PHP file of "WP Store Locator" version 2.2.241, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin16,451 lines of code in 61 files:
LanguageFilesBlank linesComment linesLines of code
PHP281,7052,4576,508
PO File31,9392,3634,721
JavaScript181,0832,0973,530
CSS9327461,635
XML10029
SVG20028

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity51.53
▷ Minimum class complexity8.00
▷ Maximum class complexity255.00
Average method complexity4.91
▷ Minimum method complexity1.00
▷ Maximum method complexity56.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods194
▷ Static methods00.00%
▷ Public methods18394.33%
▷ Protected methods00.00%
▷ Private methods115.67%
Functions51
▷ Named functions51100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.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
19 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/markers/blue@2x.png1.83KB1.38KB▼ 25.01%
img/markers/pink@2x.png2.08KB1.50KB▼ 28.00%
img/markers/pink.png1.13KB0.94KB▼ 16.96%
img/markers/dark-blue.png1.04KB0.86KB▼ 17.15%
img/markers/dark-orange.png1.10KB0.94KB▼ 14.46%