90% ajax-add-to-cart-on-hover

Code Review | Ajax add to cart on hover Plugin

WordPress plugin Ajax add to cart on hover Plugin scored90%from 54 tests.

About plugin

  • Plugin page: ajax-add-to-cart-...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.3
  • WordPress version: 6.3.1
  • First release: Jan 6, 2020
  • Latest release: Jan 6, 2020
  • Number of updates: 2
  • Update frequency: every 12.5 days
  • Top authors: scrumwheel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /566 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

Server-side resources used by Ajax add to cart on hover Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.23 ▼5.78
Dashboard /wp-admin3.33 ▼0.0544.56 ▼1,525.80
Posts /wp-admin/edit.php3.39 ▲0.0345.80 ▼4.29
Add New Post /wp-admin/post-new.php5.92 ▲0.0382.11 ▼10.85
Media Library /wp-admin/upload.php3.26 ▲0.0336.98 ▲1.92

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Ajax add to cart on hover Plugin
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,874 ▲12813.36 ▼0.997.58 ▲5.9037.43 ▼2.86
Dashboard /wp-admin2,198 ▲365.63 ▼0.0282.50 ▼11.0837.41 ▼2.67
Posts /wp-admin/edit.php2,079 ▼101.97 ▼0.0135.55 ▲0.8430.59 ▼2.87
Add New Post /wp-admin/post-new.php1,526 ▲1023.03 ▼0.03589.85 ▼41.8845.48 ▼23.25
Media Library /wp-admin/upload.php1,391 ▼94.19 ▼0.0599.73 ▼12.0441.84 ▼0.66

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

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 Passed 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: ecommerce, variations, ajax add to cart, variable products, ajax...

ajax-add-to-cart-on-hover/ajax-add-to-cart-on-hover.php Passed 13 tests

The primary PHP file in "Ajax add to cart on hover Plugin" version 1.0.0 is used by WordPress to initiate all plugin functionality
133 characters long description:
Ajax add to cart on hover Plugin is used for adding variable products to cart using overlay on image when hovered over product image.

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
Success! There were no dangerous files found in this plugin438 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
CSS21123181
JavaScript43930123
PHP17933118
SVG10116

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.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%
Functions8
▷ Named functions787.50%
▷ Anonymous functions112.50%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
check-mark.png6.35KB4.30KB▼ 32.29%
cross.png4.09KB2.37KB▼ 42.16%