84% woocomerce-favicon-cart-badge

Code Review | Woocommerce favicon cart badge

WordPress plugin Woocommerce favicon cart badge scored84%from 54 tests.

About plugin

  • Plugin page: woocomerce-favico...
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.8.1
  • WordPress version: 6.3.1
  • First release: Dec 22, 2013
  • Latest release: Mar 17, 2014
  • Number of updates: 6
  • Update frequency: every 14.3 days
  • Top authors: Sweet Homes (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /3,118 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼10.76ms] Passed 4 tests

Server-side resources used by Woocommerce favicon cart badge
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0436.38 ▼2.21
Dashboard /wp-admin3.35 ▲0.0046.47 ▼14.87
Posts /wp-admin/edit.php3.40 ▲0.0448.00 ▼2.68
Add New Post /wp-admin/post-new.php5.93 ▲0.0485.18 ▼23.26
Media Library /wp-admin/upload.php3.27 ▲0.0436.18 ▲4.25

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Woocommerce favicon cart badge
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲3614.48 ▲0.101.69 ▼0.0839.59 ▼5.03
Dashboard /wp-admin2,210 ▲225.81 ▲0.89106.31 ▲2.4640.53 ▼4.09
Posts /wp-admin/edit.php2,093 ▲12.14 ▲0.1439.42 ▼1.1334.30 ▼1.83
Add New Post /wp-admin/post-new.php1,540 ▲1223.08 ▼0.33664.14 ▲68.4068.00 ▲21.52
Media Library /wp-admin/upload.php1,392 ▲14.26 ▲0.0599.87 ▼5.8045.04 ▲0.20

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 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
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/woocomerce-favicon-cart-badge/woocommerce-cart-badge.php:39

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: woocommerce, cart, favicon, badge

woocomerce-favicon-cart-badge/woocommerce-cart-badge.php 92% from 13 tests

The main PHP file in "Woocommerce favicon cart badge" ver. 0.1 adds more information about the plugin and also serves as the entry point for this plugin
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 ("woocomerce-favicon-cart-badge.php" instead of "woocommerce-cart-badge.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected269 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP17432268
JavaScript1061

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.20
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%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/favicon.png1.67KB0.63KB▼ 62.27%
assets/img/sweethomes.png1.16KB0.33KB▼ 71.85%