78% ect-add-to-cart-button

Code Review | ECT Add to Cart Button

WordPress plugin ECT Add to Cart Button scored78%from 54 tests.

About plugin

  • Plugin page: ect-add-to-cart-b...
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Apr 27, 2013
  • Latest release: Dec 7, 2018
  • Number of updates: 29
  • Update frequency: every 70.7 days
  • Top authors: etemplates (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

50+ active /8,836 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
Installer ran successfully

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

This is a short check of server-side resources used by ECT Add to Cart Button
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.92 ▼4.36
Dashboard /wp-admin3.32 ▲0.0152.36 ▲1.92
Posts /wp-admin/edit.php3.37 ▲0.0150.08 ▼2.78
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.86 ▼5.38
Media Library /wp-admin/upload.php3.24 ▲0.0142.10 ▲6.00
Add New /wp-admin/admin.php?page=add_ect3.2134.90
ECT Buy Button /wp-admin/admin.php?page=ec3.2135.42

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: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

ECT Add to Cart Button: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5414.25 ▼0.021.76 ▼0.1541.74 ▲0.14
Dashboard /wp-admin2,224 ▲475.59 ▼0.08123.50 ▲28.8689.52 ▲47.75
Posts /wp-admin/edit.php2,126 ▲262.02 ▲0.0040.72 ▼0.8735.77 ▼3.70
Add New Post /wp-admin/post-new.php1,562 ▲3623.51 ▲0.16700.96 ▼10.58135.60 ▲75.80
Media Library /wp-admin/upload.php1,426 ▲234.10 ▼0.04107.31 ▲5.7674.50 ▲21.26
Add New /wp-admin/admin.php?page=add_ect9091.8924.3336.78
ECT Buy Button /wp-admin/admin.php?page=ec8481.9925.8225.29

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/ect-add-to-cart-button/add_ect_button.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/ect-add-to-cart-button/ect_list.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ect-add-to-cart-button/index.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Requires at least: Invalid plugin version format
You can look at the official readme.txt

ect-add-to-cart-button/index.php 92% from 13 tests

The entry point to "ECT Add to Cart Button" version 1.4 is a PHP file that has certain tags in its header comment area
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 ("ect-add-to-cart-button.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected185 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP329185

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.41
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%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/ect28x28.png0.63KB0.58KB▼ 7.59%
img/delete.png0.32KB0.20KB▼ 36.22%