90% wpc-ajax-add-to-cart

Code Review | WPC AJAX Add to Cart for WooCommerce

WordPress plugin WPC AJAX Add to Cart for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: wpc-ajax-add-to-cart
  • Plugin version: 1.6.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: May 19, 2020
  • Latest release: Nov 7, 2023
  • Number of updates: 44
  • Update frequency: every 28.8 days
  • Top authors: wpclever (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

8,000+ active /94,895 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▲1.08ms] Passed 4 tests

Analyzing server-side resources used by WPC AJAX Add to Cart for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1242.11 ▲0.23
Dashboard /wp-admin3.43 ▲0.1246.85 ▲1.19
Posts /wp-admin/edit.php3.54 ▲0.1849.14 ▲1.52
Add New Post /wp-admin/post-new.php6.03 ▲0.1491.85 ▲4.61
Media Library /wp-admin/upload.php3.35 ▲0.1236.71 ▲1.37
About /wp-admin/admin.php?page=wpclever3.3233.88
Essential Kit /wp-admin/admin.php?page=wpclever-kit3.3232.89

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

WPC AJAX Add to Cart for WooCommerce: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,859 ▲9714.35 ▲0.031.59 ▼0.0844.16 ▼2.28
Dashboard /wp-admin2,255 ▲755.54 ▼0.1292.55 ▼0.9765.53 ▲24.71
Posts /wp-admin/edit.php2,172 ▲722.00 ▲0.0337.61 ▲0.1734.23 ▼0.13
Add New Post /wp-admin/post-new.php1,601 ▲7524.80 ▲1.55711.71 ▲117.3160.83 ▲14.05
Media Library /wp-admin/upload.php1,469 ▲724.15 ▼0.03100.13 ▼0.2669.55 ▲24.03
About /wp-admin/admin.php?page=wpclever1,4002.1036.9934.71
Essential Kit /wp-admin/admin.php?page=wpclever-kit5,5101.1934.9361.47

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

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)
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Looking good! No server-side errors or output on direct access of PHP files

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)
No browser errors were detected

Optimizations

Plugin configuration Passed 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
6 plugin tags: add-to-cart, ajax, wpc, woocommerce, add to cart...

wpc-ajax-add-to-cart/wpc-ajax-add-to-cart.php Passed 13 tests

The entry point to "WPC AJAX Add to Cart for WooCommerce" version 1.6.5 is a PHP file that has certain tags in its header comment area
42 characters long description:
AJAX add to cart for WooCommerce products.

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
There were no executable files found in this plugin1,275 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP59022629
CSS3756406
JavaScript4358211
SVG10029

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.45
Average class complexity18.50
▷ Minimum class complexity1.00
▷ Maximum class complexity33.00
Average method complexity3.41
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods29
▷ Static methods310.34%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants8
▷ Global constants8100.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
No PNG files were detected