88% add-to-cart-button-custom-text-and-color

Code Review | Add to Cart Button Custom Text and Color

WordPress plugin Add to Cart Button Custom Text and Color scored 88% from 54 tests.

About plugin

  • Plugin page: add-to-cart-butto...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5-4.5.2
  • WordPress version: 5.9.2
  • First release: Jun 17, 2016
  • Latest release: Jun 20, 2016
  • Number of updates: 3
  • Update frequency: every 1.0 days
  • Top authors: Chahat Sharma (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active / 4,868 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

Server-side resources used by Add to Cart Button Custom Text and Color
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▼0.0252.67 ▲1.19
Dashboard /wp-admin3.45 ▲0.0435.40 ▲2.20
Posts /wp-admin/edit.php3.67 ▲0.0337.56 ▲0.15
Add New Post /wp-admin/post-new.php6.92 ▼0.0595.84 ▼1,178.54
Media Library /wp-admin/upload.php3.33 ▲0.0323.64 ▼0.45
WooCommerce Buttons /wp-admin/admin.php?page=woocommerce_buttons3.2723.01

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Add to Cart Button Custom Text and Color: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,793 ▲5116.59 ▲0.906.63 ▲0.162.10 ▲0.03
Dashboard /wp-admin2,922 ▲616.74 ▲0.62121.66 ▼17.86281.11 ▲119.35
Posts /wp-admin/edit.php2,718 ▲243.29 ▲0.0572.09 ▲7.92138.17 ▼0.74
Add New Post /wp-admin/post-new.php1,635 ▼11719.79 ▼1.93396.21 ▼64.64170.04 ▲14.85
Media Library /wp-admin/upload.php1,725 ▲305.85 ▲0.33127.25 ▼17.22183.72 ▼1.24
WooCommerce Buttons /wp-admin/admin.php?page=woocommerce_buttons1,6113.4983.78141.49

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woocommerce_buttons
    • > Notice in wp-content/plugins/add-to-cart-button-custom-text-and-color/add-to-cart-button-custom-text-and-color.php+141
    Trying to access array offset on value of type bool

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
Please fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/add-to-cart-button-custom-text-and-color/add-to-cart-button-custom-text-and-color.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/add-to-cart-button-custom-text-and-color/settings.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Screenshot #1 (The Admin screen for the plugin. screenshot-1.png) image not found
The official readme.txt is a good inspiration

add-to-cart-button-custom-text-and-color/add-to-cart-button-custom-text-and-color.php 92% from 13 tests

"Add to Cart Button Custom Text and Color" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 194 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected200 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP24129187
CSS11113

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.18
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 functions8100.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
No PNG files were detected