84% carthook-for-easy-digital-downloads

Code Review | CartHook for Easy Digital Downloads

WordPress plugin CartHook for Easy Digital Downloads scored84%from 54 tests.

About plugin

  • Plugin page: carthook-for-easy...
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.0-4.3.1
  • WordPress version: 6.3.1
  • First release: Dec 29, 2015
  • Latest release: Dec 5, 2017
  • Number of updates: 39
  • Update frequency: every 18.3 days
  • Top authors: CartHook (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,601 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.21ms] Passed 4 tests

An overview of server-side resources used by CartHook for Easy Digital Downloads
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0036.70 ▲1.53
Dashboard /wp-admin3.31 ▲0.0147.72 ▼0.77
Posts /wp-admin/edit.php3.36 ▲0.0043.54 ▼5.34
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.04 ▼8.27
Media Library /wp-admin/upload.php3.23 ▲0.0038.07 ▲3.45

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for CartHook for Easy Digital Downloads
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲6314.75 ▲0.511.83 ▲0.1246.62 ▲6.44
Dashboard /wp-admin2,215 ▲304.83 ▼0.96112.89 ▲11.4243.14 ▼1.27
Posts /wp-admin/edit.php2,097 ▲82.04 ▲0.0436.29 ▲2.0635.06 ▼2.91
Add New Post /wp-admin/post-new.php1,523 ▲917.44 ▼0.12670.05 ▼17.2757.47 ▼5.17
Media Library /wp-admin/upload.php1,397 ▲94.23 ▲0.0696.02 ▼30.6341.02 ▼8.72

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
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/carthook-for-easy-digital-downloads/edd-carthook.php:375

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 on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
9 plugin tags: checkout, ecommerce, e-commerce, cart, commerce...

carthook-for-easy-digital-downloads/edd-carthook.php 92% from 13 tests

The entry point to "CartHook for Easy Digital Downloads" version 1.0.6 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("carthook-for-easy-digital-downloads.php" instead of "edd-carthook.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 plugin179 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP177119179

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity2.07
▷ Minimum method complexity1.00
▷ Maximum method complexity6.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

PNG files should be compressed to save space and minimize bandwidth usage
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%