78% wp-dealer-map

Code Review | Wp Dealer Map

WordPress plugin Wp Dealer Map scored78%from 54 tests.

About plugin

  • Plugin page: wp-dealer-map
  • Plugin version: 2.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.6.1
  • WordPress version: 6.3.1
  • First release: Mar 25, 2020
  • Latest release: Feb 11, 2021
  • Number of updates: 12
  • Update frequency: every 27.0 days
  • Top authors: assist4web (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /652 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▲23.07ms] Passed 4 tests

This is a short check of server-side resources used by Wp Dealer Map
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2070.09 ▲27.17
Dashboard /wp-admin3.38 ▲0.0380.03 ▲12.38
Posts /wp-admin/edit.php3.49 ▲0.1483.63 ▲31.90
Add New Post /wp-admin/post-new.php5.96 ▲0.07120.06 ▲20.84
Media Library /wp-admin/upload.php3.30 ▲0.0769.79 ▲33.06
Add new /wp-admin/admin.php?page=dealer_map/locations_form3.3868.05
Dealer Locations /wp-admin/admin.php?page=dealer_map/dealer_map_locations3.3070.20
Dealer Stores /wp-admin/admin.php?page=wp-dealer-map/admin/class-admin.php3.5563.02

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 46 new files
Database: 1 new table, 10 new options
New tables
wp_dealer_map_stores
New WordPress options
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts
dealer_db_version
widget_theysaidso_widget
widget_recent-comments
dealer_map_version
dealer_map_keep_table
dealer_map_remove_all

Browser metrics Passed 4 tests

An overview of browser requirements for Wp Dealer Map
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲8013.21 ▼1.371.83 ▲0.0740.69 ▼4.08
Dashboard /wp-admin2,244 ▲416.00 ▲0.13102.81 ▼4.9191.38 ▲45.66
Posts /wp-admin/edit.php2,126 ▲232.03 ▼0.0139.75 ▼5.4038.90 ▲0.38
Add New Post /wp-admin/post-new.php1,556 ▲2421.84 ▼1.40749.92 ▲80.5344.27 ▼19.39
Media Library /wp-admin/upload.php1,423 ▲264.22 ▼0.05116.25 ▲0.1373.00 ▲23.91
Add new /wp-admin/admin.php?page=dealer_map/locations_form1,3933.3652.0473.97
Dealer Locations /wp-admin/admin.php?page=dealer_map/dealer_map_locations1,5433.3750.0392.80
Dealer Stores /wp-admin/admin.php?page=wp-dealer-map/admin/class-admin.php3,0613.5162.1282.11

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • dealer_map_version
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
  • 328 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-dealer-map/admin/class-admin.php
    • > Notice in wp-content/plugins/wp-dealer-map/admin/class-settings.php+575
    Trying to access array offset on value of type bool

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
Almost there! Just fix the following items
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/wp-dealer-map/front/dealer-data.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/wp-dealer-map/front/map-html.php:54
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wp-dealer-map/admin/locations/locations-settings.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-dealer-map/admin/locations/locations-settings.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/wp-dealer-map/wp-dealer-map.php:58
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/wp-dealer-map/uninstall.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3, #4, #5, #6 in wp-dealer-map/assets to your readme.txt
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

wp-dealer-map/wp-dealer-map.php Passed 13 tests

"Wp Dealer Map" version 2.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
129 characters long description:
WP plugin for showing nearby dealer stores around typed zip, city or full address. It can be showed on maps within chosen radius.

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
No dangerous file extensions were detected6,382 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP1606892,486
CSS40572,219
PO File105171,064
JavaScript5038613

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity29.50
▷ Minimum class complexity8.00
▷ Maximum class complexity54.00
Average method complexity3.85
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods60
▷ Static methods00.00%
▷ Public methods5490.00%
▷ Protected methods00.00%
▷ Private methods610.00%
Functions23
▷ Named functions2295.65%
▷ Anonymous functions14.35%
Constants4
▷ Global constants4100.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
16 PNG files occupy 0.33MB with 0.24MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
front/markers/shad.png27.62KB0.91KB▼ 96.71%
front/markers/pin-black.png47.72KB0.89KB▼ 98.14%
admin/img/map-pini.png1.95KB1.12KB▼ 42.83%
front/markers/pin-lightblue.png50.12KB1.10KB▼ 97.81%