84% wphobby-woocommerce-mini-cart

Code Review | WPHobby WooCommerce Mini Cart

WordPress plugin WPHobby WooCommerce Mini Cart scored84%from 54 tests.

About plugin

  • Plugin page: wphobby-woocommer...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2
  • WordPress version: 6.3.1
  • First release: Jul 25, 2019
  • Latest release: Dec 13, 2019
  • Number of updates: 9
  • Update frequency: every 57.3 days
  • Top authors: darell (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /990 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.02ms] Passed 4 tests

A check of server-side resources used by WPHobby WooCommerce Mini Cart
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0143.45 ▼3.17
Dashboard /wp-admin67.32 ▲0.0113,237,159.04 ▲8,952.79
Posts /wp-admin/edit.php3.41 ▲0.0151.73 ▼2.17
Add New Post /wp-admin/post-new.php5.94 ▲0.0190.31 ▼17.30
Media Library /wp-admin/upload.php3.28 ▲0.0143.88 ▲6.55

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for WPHobby WooCommerce Mini Cart
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.41 ▼0.261.95 ▲0.1042.41 ▲0.03
Dashboard /wp-admin2,204 ▲245.61 ▼0.0591.29 ▲3.5943.47 ▲3.55
Posts /wp-admin/edit.php2,107 ▲71.94 ▼0.0435.85 ▼3.5235.64 ▼1.02
Add New Post /wp-admin/post-new.php1,537 ▲1122.91 ▼0.06682.84 ▲13.7755.78 ▲0.63
Media Library /wp-admin/upload.php1,403 ▲34.22 ▲0.02114.97 ▲10.7947.73 ▲5.68

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 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)
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
The following issues need your attention
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/wphobby-woocommerce-mini-cart/includes/admin/sections/general/tab-general.php:12
    • > PHP Warning
      require(WHMC_DIRchanges.txt): failed to open stream: No such file or directory in wp-content/plugins/wphobby-woocommerce-mini-cart/includes/admin/sections/help/tab-change-log.php on line 12
    • > PHP Warning
      Use of undefined constant WHMC_DIR - assumed 'WHMC_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wphobby-woocommerce-mini-cart/includes/admin/sections/help/tab-change-log.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wphobby-woocommerce-mini-cart/includes/whmc_admin.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/wphobby-woocommerce-mini-cart/includes/admin/sections/help/top.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wphobby-woocommerce-mini-cart/includes/admin/sections/help/tab-help.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/wphobby-woocommerce-mini-cart/includes/admin/sections/general/top.php:8
    • > PHP Fatal error
      require(): Failed opening required 'WHMC_DIRchanges.txt' (include_path='.:/usr/share/php') in wp-content/plugins/wphobby-woocommerce-mini-cart/includes/admin/sections/help/tab-change-log.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wphobby-woocommerce-mini-cart/includes/whmc_tools.php:6

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: ecommerce shop cart, mini cart, woocommerce mini cart, woocommerce shop cart, cart...

wphobby-woocommerce-mini-cart/wphobby-woo-mini-cart.php 92% from 13 tests

The principal PHP file in "WPHobby WooCommerce Mini Cart" v. 1.0.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wphobby-woocommerce-mini-cart.php" instead of "wphobby-woo-mini-cart.php")

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
Success! There were no dangerous files found in this plugin5,194 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
CSS81,920544,525
PHP1065132390
SVG214252
JavaScript213127

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity7.50
▷ Minimum class complexity4.00
▷ Maximum class complexity11.00
Average method complexity1.76
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
4 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/admin/images/icon.png19.99KB0.88KB▼ 95.61%
assets/images/mail.png16.25KB13.04KB▼ 19.74%
assets/images/play-button.png13.39KB10.70KB▼ 20.12%
assets/images/file.png5.09KB3.92KB▼ 22.99%