78% sales-map-for-woocommerce

Code Review | Sales Map for Woocommerce

WordPress plugin Sales Map for Woocommerce scored78%from 54 tests.

About plugin

  • Plugin page: sales-map-for-woo...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-5.7
  • WordPress version: 6.3.1
  • First release: May 28, 2021
  • Latest release: May 28, 2021
  • Number of updates: 5
  • Update frequency: every 0.8 days
  • Top authors: sarankumar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /410 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

An overview of server-side resources used by Sales Map for Woocommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0939.40 ▼1.03
Dashboard /wp-admin3.38 ▲0.0846.13 ▼3.27
Posts /wp-admin/edit.php3.49 ▲0.1449.45 ▼2.38
Add New Post /wp-admin/post-new.php5.98 ▲0.1092.02 ▼10.42
Media Library /wp-admin/upload.php3.30 ▲0.0835.22 ▲1.59

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Sales Map for Woocommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲7413.57 ▼0.792.07 ▲0.0044.60 ▲0.06
Dashboard /wp-admin2,210 ▲224.86 ▼1.03110.10 ▲8.6839.83 ▼4.68
Posts /wp-admin/edit.php2,093 ▲42.06 ▲0.0540.06 ▼0.2234.99 ▼1.77
Add New Post /wp-admin/post-new.php1,518 ▼1623.11 ▼0.09605.80 ▼6.9155.71 ▼2.36
Media Library /wp-admin/upload.php1,386 ▼24.18 ▼0.0595.89 ▲1.8341.62 ▼3.45

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 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
Please take a closer look at the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/sales-map-for-woocommerce/admin/partials/sales-map-woo-admin-display.php
    • > /wp-content/plugins/sales-map-for-woocommerce/public/partials/sales-map-woo-public-display.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/sales-map-for-woocommerce/admin/partials/sales-map-woo-admin-settings.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: order, sales, map

sales-map-for-woocommerce/sales-map-for-woocommerce.php 92% from 13 tests

The primary PHP file in "Sales Map for Woocommerce" version 1.0.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.0.1" instead of "3.7")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin404 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP14138573369
JavaScript286031
CSS2184

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity2.57
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.37
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods30
▷ Static methods26.67%
▷ Public methods2583.33%
▷ Protected methods00.00%
▷ Private methods516.67%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected