89% zwk-add-to-cart-button-label

Code Review | Cart Label

WordPress plugin Cart Label scored89%from 54 tests.

About plugin

  • Plugin page: zwk-add-to-cart-b...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.8
  • WordPress version: 6.3.1
  • First release: Jan 28, 2021
  • Latest release: Aug 4, 2021
  • Number of updates: 3
  • Update frequency: every 63.0 days
  • Top authors: zworthkey (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /463 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

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

A check of server-side resources used by Cart Label
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.34 ▼5.70
Dashboard /wp-admin3.31 ▲0.0148.06 ▲0.82
Posts /wp-admin/edit.php3.36 ▲0.0141.41 ▼11.22
Add New Post /wp-admin/post-new.php5.89 ▲0.0182.08 ▼12.63
Media Library /wp-admin/upload.php3.23 ▲0.0137.70 ▲3.05

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

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

Browser metrics Passed 4 tests

Cart Label: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲8513.30 ▼1.311.97 ▲0.1038.62 ▼4.43
Dashboard /wp-admin2,215 ▲274.86 ▼0.06103.49 ▼5.4641.25 ▼1.57
Posts /wp-admin/edit.php2,094 ▲52.00 ▲0.0235.89 ▼4.8632.16 ▼2.85
Add New Post /wp-admin/post-new.php1,539 ▲2523.42 ▲5.90676.88 ▼9.0555.91 ▼11.22
Media Library /wp-admin/upload.php1,397 ▲94.21 ▲0.02105.31 ▲6.2148.14 ▲4.12

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === zwk-add-to-cart-button-label === )
  • Donate link: Please fix this invalid URI: "zworthkey.com"
Please take inspiration from this readme.txt

zwk-add-to-cart-button-label/wc-cart-label.php 85% from 13 tests

The primary PHP file in "Cart Label" version 1.0.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: The principal plugin file should be the same as the plugin slug ("zwk-add-to-cart-button-label.php" instead of "wc-cart-label.php")

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
Good job! No executable or dangerous file extensions detected239 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP10125455239

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity2.57
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity1.41
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods27
▷ Static methods27.41%
▷ Public methods2281.48%
▷ Protected methods00.00%
▷ Private methods518.52%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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