78% ekmap-store-locator

Code Review | eKMap Store Locator

WordPress plugin eKMap Store Locator scored78%from 54 tests.

About plugin

  • Plugin page: ekmap-store-locator
  • Plugin version: 1.0
  • PHP compatiblity: 5.7+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.0
  • WordPress version: 6.3.1
  • First release: Aug 27, 2022
  • Latest release: Nov 18, 2022
  • Number of updates: 10
  • Update frequency: every 8.4 days
  • Top authors: hubworksvn (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /243 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.02MB] [CPU: ▼7.17ms] Passed 4 tests

An overview of server-side resources used by eKMap Store Locator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0535.90 ▼1.35
Dashboard /wp-admin3.33 ▼0.0148.16 ▼8.50
Posts /wp-admin/edit.php3.39 ▲0.0344.80 ▲0.61
Add New Post /wp-admin/post-new.php5.94 ▲0.0585.46 ▼18.36
Media Library /wp-admin/upload.php3.26 ▲0.0333.98 ▼0.46
Danh sách bản đồ /wp-admin/admin.php?page=ekmap-storelocator3.2935.90
Sửa /wp-admin/admin.php?page=edit-ekmap-storelocator3.5129.57
Thêm /wp-admin/admin.php?page=add-ekmap-storelocator3.3533.15
Api Key /wp-admin/admin.php?page=ekmap-storelocator-api-key3.2632.13

Server storage [IO: ▲1.57MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for eKMap Store Locator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,965 ▲21917.14 ▲2.7912.50 ▲10.7535.79 ▼4.88
Dashboard /wp-admin2,231 ▲506.63 ▲0.9199.92 ▼2.6473.18 ▲35.07
Posts /wp-admin/edit.php2,155 ▲554.42 ▲2.4147.50 ▲10.4235.91 ▲2.20
Add New Post /wp-admin/post-new.php1,724 ▲18725.16 ▲6.79597.37 ▼54.7727.60 ▼59.54
Media Library /wp-admin/upload.php1,449 ▲496.09 ▲1.86104.29 ▲4.4884.30 ▲40.05
Danh sách bản đồ /wp-admin/admin.php?page=ekmap-storelocator1,0614.4550.4982.92
Sửa /wp-admin/admin.php?page=edit-ekmap-storelocator1,7346.0861.03101.55
Thêm /wp-admin/admin.php?page=add-ekmap-storelocator2,5107.41166.9658.04
Api Key /wp-admin/admin.php?page=ekmap-storelocator-api-key8683.3039.2028.41

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not 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
  • 12× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ekmap-store-locator/inc/metabox/metabox-ekmap.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ekmap-store-locator/inc/ajax/ajax.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ekmap-store-locator/ekmap-storelocator.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ekmap-store-locator/inc/posttype/ekmap-posttype.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ekmap-store-locator/inc/admin/menu.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ekmap-store-locator/inc/posttype/marker-posttype.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/ekmap-store-locator/inc/admin/menu_api_key_ekmap.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/ekmap-store-locator/inc/admin/menu_edit_ekmap.php:453
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/ekmap-store-locator/inc/admin/menu_add_ekmap.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ekmap-store-locator/inc/metabox/metabox-marker.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=add-ekmap-storelocator
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'model')" "TypeError: Cannot read properties of undefined (reading 'model')\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=add-ekmap-storelocator:448:45)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ekmap-storelocator-api-key
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: Cannot read properties of undefined (reading 'model')
    • > GET request to /wp-admin/admin.php?page=add-ekmap-storelocator
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=add-ekmap-storelocator - [.WebGL-0x17bc00f4d500]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels
    • > GET request to /wp-admin/admin.php?page=add-ekmap-storelocator
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught Error: Parameter apiKey not valid
    • > GET request to /wp-admin/admin.php?page=ekmap-storelocator-api-key
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'model')" "TypeError: Cannot read properties of undefined (reading 'model')\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=ekmap-storelocator-api-key:185:45)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined

Optimizations

Plugin configuration 90% 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 need to be fixed: The official readme.txt might help

ekmap-store-locator/ekmap-storelocator.php 85% from 13 tests

"eKMap Store Locator" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("ekmap-store-locator.php" instead of "ekmap-storelocator.php")

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
No dangerous file extensions were detected9,405 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript284643,231
SVG1002,671
PHP121196522,411
CSS218631,092

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.33
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods111.11%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions23
▷ Named functions1982.61%
▷ Anonymous functions417.39%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon.png1.60KB1.54KB▼ 3.71%