84% mas-woocommerce-variation-swatches

Code Review | MAS Variation Swatches for WooCommerce

WordPress plugin MAS Variation Swatches for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: mas-woocommerce-v...
  • Plugin version: 1.0.5
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.0
  • WordPress version: 6.3.1
  • First release: Apr 8, 2020
  • Latest release: Jun 10, 2023
  • Number of updates: 17
  • Update frequency: every 68.1 days
  • Top authors: madrasthemes (47.06%)farookibrahim (47.06%)yousufansa (17.65%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /6,878 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.03ms] Passed 4 tests

Server-side resources used by MAS Variation Swatches for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0133.50 ▼8.47
Dashboard /wp-admin3.31 ▲0.0143.78 ▼3.56
Posts /wp-admin/edit.php3.36 ▲0.0047.02 ▼2.07
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.23 ▼2.03
Media Library /wp-admin/upload.php3.24 ▲0.0034.15 ▲0.40

Server storage [IO: ▲0.11MB] [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: 21 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

MAS Variation Swatches for WooCommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.44 ▲0.051.54 ▼0.9040.85 ▼25.82
Dashboard /wp-admin2,209 ▲215.89 ▲1.02103.31 ▼2.0338.86 ▼5.50
Posts /wp-admin/edit.php2,089 ▼02.04 ▼0.1238.32 ▼2.0235.86 ▼3.50
Add New Post /wp-admin/post-new.php1,534 ▲1023.27 ▲0.21684.67 ▲85.1353.35 ▲8.13
Media Library /wp-admin/upload.php1,391 ▲34.28 ▲0.0294.63 ▼4.1444.16 ▼0.07

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mas-woocommerce-variation-swatches/includes/mas-wc-variation-swatches-functions.php:95

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: woocommerce, product color, variation swatches, variable products, product size...

mas-woocommerce-variation-swatches/mas-woocommerce-variation-swatches.php 92% from 13 tests

The principal PHP file in "MAS Variation Swatches for WooCommerce" v. 1.0.5 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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 detected1,724 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP8266355991
CSS4342346
Sass2430236
JavaScript43819151

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity32.67
▷ Minimum class complexity8.00
▷ Maximum class complexity98.00
Average method complexity4.96
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes116.67%
Methods48
▷ Static methods12.08%
▷ Public methods3675.00%
▷ Protected methods816.67%
▷ Private methods48.33%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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