78% store-locator-for-wp

Code Review | Store Locator for WP

WordPress plugin Store Locator for WP scored 78% from 54 tests.

About plugin

  • Plugin page: store-locator-for-wp
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.2-5.8.2
  • WordPress version: 5.9.2
  • First release: Dec 10, 2021
  • Latest release: Feb 24, 2022
  • Number of updates: 3
  • Update frequency: every 27.3 days
  • Top authors: wpevince (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 99 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.55MB] [CPU: ▼298.56ms] Passed 4 tests

A check of server-side resources used by Store Locator for WP
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.07 ▲0.5557.38 ▲7.03
Dashboard /wp-admin3.96 ▲0.5636.12 ▲3.91
Posts /wp-admin/edit.php4.19 ▲0.5538.76 ▲2.55
Add New Post /wp-admin/post-new.php7.52 ▲0.5292.88 ▼1,205.48
Media Library /wp-admin/upload.php3.91 ▲0.6230.17 ▲4.80
Edit Store /wp-admin/admin.php?page=edit-evdpl-store4.0131.46
Dashboard /wp-admin/admin.php?page=store-locator-dashboard3.8428.13
Manage Categories /wp-admin/admin.php?page=manage-esl-categories3.8664.77
Store Locator Settings /wp-admin/admin.php?page=store-locator-settings4.0929.69
Add New Store /wp-admin/admin.php?page=create-evdpl-store4.1829.32
Manage Stores /wp-admin/admin.php?page=manage-evdpl-store3.8623.33

Server storage [IO: ▲6.12MB] [DB: ▲0.04MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 191 new files
Database: 10 new tables, no new options
New tables
wp_evdpl_configs
wp_evdpl_stores_view
wp_evdpl_markers
wp_evdpl_countries
wp_evdpl_stores
wp_evdpl_stores_categories
wp_evdpl_categories
wp_evdpl_brands
wp_evdpl_settings
wp_evdpl_storelogos

Browser metrics Passed 4 tests

This is an overview of browser requirements for Store Locator for WP
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,974 ▲22017.62 ▲1.5528.34 ▲22.212.60 ▼0.40
Dashboard /wp-admin2,952 ▲916.15 ▼0.10118.25 ▼15.39154.58 ▼2.60
Posts /wp-admin/edit.php2,751 ▲573.24 ▲0.0066.74 ▲5.32139.68 ▼5.08
Add New Post /wp-admin/post-new.php1,793 ▲14221.03 ▲1.80462.65 ▲50.50156.16 ▼5.54
Media Library /wp-admin/upload.php1,759 ▲615.55 ▲0.04145.02 ▲0.98182.74 ▼13.52
Edit Store /wp-admin/admin.php?page=edit-evdpl-store8581.9736.2953.46
Dashboard /wp-admin/admin.php?page=store-locator-dashboard1,5383.2164.54153.60
Manage Categories /wp-admin/admin.php?page=manage-esl-categories3,0634.01100.78206.89
Store Locator Settings /wp-admin/admin.php?page=store-locator-settings3,7333.1273.91187.40
Add New Store /wp-admin/admin.php?page=create-evdpl-store5,6737.31152.10333.52
Manage Stores /wp-admin/admin.php?page=manage-evdpl-store3,4064.01100.57221.44

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie tables detected upon uninstall: 10 tables
    • wp_evdpl_categories
    • wp_evdpl_configs
    • wp_evdpl_stores_view
    • wp_evdpl_brands
    • wp_evdpl_countries
    • wp_evdpl_stores_categories
    • wp_evdpl_settings
    • wp_evdpl_markers
    • wp_evdpl_storelogos
    • wp_evdpl_stores

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 18× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/store-locator-for-wp/admin/partials/user_setting.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/store-locator-for-wp/public/partials/template-frontend.php:19
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/store-locator-for-wp/public/partials/template-frontend.php on line 8
    • > PHP Notice
      Undefined variable: all_configs in wp-content/plugins/store-locator-for-wp/public/partials/template-frontend.php on line 12
    • > PHP Notice
      Undefined variable: all_configs in wp-content/plugins/store-locator-for-wp/public/partials/template-frontend.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/store-locator-for-wp/admin/partials/add_store.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_editor() in wp-content/plugins/store-locator-for-wp/admin/partials/info_box.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/store-locator-for-wp/admin/partials/manage_store.php:27
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/store-locator-for-wp/public/partials/template-frontend.php on line 4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/store-locator-for-wp/public/partials/template-frontend.php on line 14

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=manage-esl-categories
    • > Network (severe)
    wp-content/plugins/store-locator-for-wp/public/svg/electronics-store.svg - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=create-evdpl-store
    • > Network (severe)
    http://maps.googleapis.com/maps/api/mapsjs/gen_204?csp_test=true - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Tags: You are using too many tags: 16 tag instead of maximum 10
Please take inspiration from this readme.txt

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

"Store Locator for WP" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 267 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected27,454 lines of code in 74 files:
LanguageFilesBlank linesComment linesLines of code
CSS1253425218,211
PHP198199374,263
JavaScript115792842,361
PO File109391,1942,193
SVG22780426

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity41.11
▷ Minimum class complexity1.00
▷ Maximum class complexity293.00
Average method complexity5.10
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods89
▷ Static methods66.74%
▷ Public methods8191.01%
▷ Protected methods00.00%
▷ Private methods88.99%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
86 PNG files occupy 3.36MB with 1.68MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/chosen-sprite@2x.png0.72KB0.83KB0.00%
admin/images/custom-map.png213.36KB95.29KB▼ 55.34%
admin/images/asl-tmpl-2-1.png101.45KB36.82KB▼ 63.71%
admin/images/pro/pro-5.png29.43KB10.69KB▼ 63.67%
public/icon/arts_entertainment.png3.83KB1.22KB▼ 68.24%