84% carthook-for-woocommerce

Code Review | CartHook for WooCommerce

WordPress plugin CartHook for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: carthook-for-wooc...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.0-4.1.0
  • WordPress version: 6.3.1
  • First release: Nov 20, 2014
  • Latest release: Apr 28, 2016
  • Number of updates: 16
  • Update frequency: every 32.9 days
  • Top authors: CartHook (68.75%)stephen.zuniga001 (37.5%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,564 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
The plugin installed gracefully, with no errors

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

A check of server-side resources used by CartHook for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.28 ▼8.98
Dashboard /wp-admin3.34 ▲0.0344.12 ▼3.83
Posts /wp-admin/edit.php3.39 ▲0.0348.87 ▲6.03
Add New Post /wp-admin/post-new.php5.92 ▲0.0390.65 ▼31.39
Media Library /wp-admin/upload.php3.26 ▲0.0339.40 ▲4.88

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by CartHook for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲6313.20 ▼1.191.62 ▼0.1139.20 ▼4.75
Dashboard /wp-admin2,215 ▲274.86 ▼1.00107.62 ▼11.1543.47 ▼1.03
Posts /wp-admin/edit.php2,097 ▲82.00 ▼0.0440.08 ▲4.4036.76 ▲2.83
Add New Post /wp-admin/post-new.php1,523 ▲417.68 ▼5.40676.46 ▲38.9657.49 ▲3.82
Media Library /wp-admin/upload.php1,397 ▲154.25 ▲0.1294.97 ▼12.3142.05 ▲0.77

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 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
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/carthook-for-woocommerce/carthook-wc.php:310

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
9 plugin tags: cart, ecommerce, carthook, payment gateway, commerce...

carthook-for-woocommerce/carthook-wc.php 92% from 13 tests

The principal PHP file in "CartHook for WooCommerce" v. 1.0.3 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("carthook-for-woocommerce.php" instead of "carthook-wc.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin154 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP154102154

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/carthook.png3.47KB1.09KB▼ 68.48%