90% default-attributes-for-woocommerce

Code Review | Default Attributes for WooCommerce

WordPress plugin Default Attributes for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: default-attribute...
  • Plugin version: 1.1.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4
  • WordPress version: 6.3.1
  • First release: Sep 4, 2020
  • Latest release: Oct 22, 2023
  • Number of updates: 27
  • Update frequency: every 42.3 days
  • Top authors: condless (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

500+ active /5,310 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.01MB] [CPU: ▼10.65ms] Passed 4 tests

A check of server-side resources used by Default Attributes for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0037.68 ▲1.10
Dashboard /wp-admin3.31 ▼0.0442.84 ▼22.42
Posts /wp-admin/edit.php3.42 ▲0.0746.54 ▼1.53
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.56 ▼17.55
Media Library /wp-admin/upload.php3.23 ▲0.0034.65 ▼1.09

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Default Attributes for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.38 ▲0.031.64 ▲0.1236.91 ▼3.46
Dashboard /wp-admin2,195 ▲175.59 ▼0.1187.11 ▼7.2339.75 ▼1.48
Posts /wp-admin/edit.php2,100 ▲31.97 ▲0.0035.53 ▲0.9932.06 ▼1.40
Add New Post /wp-admin/post-new.php1,526 ▼223.04 ▲0.07690.78 ▲44.3751.09 ▲0.02
Media Library /wp-admin/upload.php1,400 ▼04.15 ▼0.0695.23 ▼1.1943.63 ▼5.71

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed: You can take inspiration from this readme.txt

default-attributes-for-woocommerce/default-attributes-for-woocommerce.php Passed 13 tests

The main PHP file in "Default Attributes for WooCommerce" ver. 1.1.6 adds more information about the plugin and also serves as the entry point for this plugin
112 characters long description:
WooCommerce plugin that sets default attribute for variable products automatically if only 1 option is in-stock.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected309 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP127135262
PO File1111347

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity52.00
▷ Minimum class complexity52.00
▷ Maximum class complexity52.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin