84% custom-text-on-add-to-cart-button-for-woocommerce

Code Review | Custom WooCommerce Add to Cart

WordPress plugin Custom WooCommerce Add to Cart scored84%from 54 tests.

About plugin

  • Plugin page: custom-text-on-ad...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4
  • WordPress version: 6.3.1
  • First release: Nov 12, 2015
  • Latest release: Dec 2, 2015
  • Number of updates: 4
  • Update frequency: every 5.8 days
  • Top authors: BurlesonBrad (75%)iCaleb (50%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /6,446 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
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Custom WooCommerce Add to Cart
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.16 ▼5.93
Dashboard /wp-admin3.31 ▲0.0143.20 ▼6.32
Posts /wp-admin/edit.php3.36 ▲0.0146.22 ▲1.22
Add New Post /wp-admin/post-new.php5.89 ▲0.0190.45 ▼13.09
Media Library /wp-admin/upload.php3.23 ▲0.0131.62 ▼3.20

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Custom WooCommerce Add to Cart: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.48 ▼0.061.77 ▲0.0440.69 ▼4.31
Dashboard /wp-admin2,206 ▲184.87 ▼0.98109.99 ▲3.4141.80 ▼0.80
Posts /wp-admin/edit.php2,089 ▼32.01 ▲0.0139.96 ▼1.4437.31 ▲2.84
Add New Post /wp-admin/post-new.php1,542 ▼018.24 ▲0.08595.80 ▼53.8255.16 ▼7.76
Media Library /wp-admin/upload.php1,391 ▲64.15 ▼0.0797.32 ▼6.7442.25 ▲0.82

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-text-on-add-to-cart-button-for-woocommerce/custom-woocommerce-add-to-cart.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
4 plugin tags: custom add to cart button, add to cart, woothemes, woocommerce

custom-text-on-add-to-cart-button-for-woocommerce/custom-woocommerce-add-to-cart.php 92% from 13 tests

Analyzing the main PHP file in "Custom WooCommerce Add to Cart" version 1.0
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("custom-text-on-add-to-cart-button-for-woocommerce.php" instead of "custom-woocommerce-add-to-cart.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin34 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1172129
Markdown1505

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.09
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin