89% allergens-for-woocommerce

Code Review | Allergens System for Woocommerce

WordPress plugin Allergens System for Woocommerce scored89%from 54 tests.

About plugin

  • Plugin page: allergens-for-woo...
  • Plugin version: 1.3.4
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.3
  • WordPress version: 6.3.1
  • First release: Mar 15, 2022
  • Latest release: Oct 20, 2023
  • Number of updates: 19
  • Update frequency: every 30.7 days
  • Top authors: Ulloa (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /554 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼2.96ms] Passed 4 tests

Server-side resources used by Allergens System for Woocommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0538.65 ▲2.43
Dashboard /wp-admin3.35 ▲0.0445.90 ▼0.50
Posts /wp-admin/edit.php3.40 ▲0.0446.12 ▲1.42
Add New Post /wp-admin/post-new.php5.93 ▲0.0483.04 ▼15.19
Media Library /wp-admin/upload.php3.27 ▲0.0436.71 ▲3.56

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Allergens System for Woocommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.28 ▼0.441.66 ▲0.0143.33 ▼2.79
Dashboard /wp-admin2,197 ▲195.64 ▼0.2691.14 ▼18.7339.46 ▼9.78
Posts /wp-admin/edit.php2,102 ▲21.99 ▼0.0339.65 ▲4.3337.19 ▲0.92
Add New Post /wp-admin/post-new.php1,539 ▲1318.48 ▼5.18605.91 ▼86.0193.64 ▲33.69
Media Library /wp-admin/upload.php1,405 ▲54.24 ▲0.0196.67 ▼8.2943.15 ▼0.08

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests Passed 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 Passed 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
Congratulations! This plugin passed the SRP test

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 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention: You can take inspiration from this readme.txt

allergens-for-woocommerce/allergens-woocommerce.php 92% from 13 tests

"Allergens System for Woocommerce" version 1.3.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("allergens-for-woocommerce.php" instead of "allergens-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin456 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
CSS26716262
PHP23032194

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
15 PNG files occupy 0.49MB with 0.31MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/crustacean.png39.35KB13.39KB▼ 65.98%
images/soy.png45.39KB13.65KB▼ 69.94%
images/lupins.png33.13KB11.82KB▼ 64.33%
images/pistachio.png4.25KB2.23KB▼ 47.55%
images/fish.png35.25KB12.17KB▼ 65.49%