84% tcp-clean-coupons

Code Review | Clean Coupons for Woocommerce by TheCartPress

WordPress plugin Clean Coupons for Woocommerce by TheCartPress scored84%from 54 tests.

About plugin

  • Plugin page: tcp-clean-coupons
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.8.4
  • WordPress version: 6.3.1
  • First release: Oct 14, 2020
  • Latest release: Mar 30, 2022
  • Number of updates: 5
  • Update frequency: every 106.6 days
  • Top authors: tcpteam (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /706 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.10MB] [CPU: ▼1.47ms] 75% from 4 tests

An overview of server-side resources used by Clean Coupons for Woocommerce by TheCartPress
Please have a look at the following items
  • CPU: Total CPU usage must kept under 500.00ms (currently 1,412.08ms on /wp-admin/admin.php?page=thecartpress)
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1040.18 ▲1.38
Dashboard /wp-admin3.41 ▲0.1044.32 ▼2.94
Posts /wp-admin/edit.php3.53 ▲0.1743.21 ▼3.97
Add New Post /wp-admin/post-new.php5.99 ▲0.1088.21 ▲4.17
Media Library /wp-admin/upload.php3.34 ▲0.1033.70 ▼0.33
TCP Plugins /wp-admin/admin.php?page=thecartpress3.411,412.08
Coupon Cleanup /wp-admin/admin.php?page=tcp-clean-coupons3.3029.44

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Clean Coupons for Woocommerce by TheCartPress: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲5714.19 ▼0.341.99 ▲0.1844.24 ▲1.28
Dashboard /wp-admin2,224 ▲475.68 ▲0.0982.42 ▼5.5181.27 ▲40.49
Posts /wp-admin/edit.php2,129 ▲292.02 ▲0.0236.45 ▼0.2434.70 ▼1.42
Add New Post /wp-admin/post-new.php1,552 ▲2622.99 ▲0.06686.04 ▲89.8553.58 ▼2.02
Media Library /wp-admin/upload.php1,429 ▲354.23 ▼0.0195.32 ▼0.8071.30 ▲28.46
TCP Plugins /wp-admin/admin.php?page=thecartpress9452.0523.0837.17
Coupon Cleanup /wp-admin/admin.php?page=tcp-clean-coupons8672.0523.4625.24

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tcp-clean-coupons
    • > Network (severe)
    wp-content/plugins/tcp-clean-coupons/assets/images/tcp-icon.svg - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tcp-clean-coupons
    • > Network (severe)
    wp-content/plugins/tcp-clean-coupons/assets/css/menu.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: tcp, woocommerce, coupon, thecartpress

tcp-clean-coupons/tcp-clean-coupons.php Passed 13 tests

"Clean Coupons for Woocommerce by TheCartPress" version 1.1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
17 characters long description:
TCP Clean Coupons

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected522 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP371142522

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity11.60
▷ Minimum class complexity2.00
▷ Maximum class complexity20.00
Average method complexity3.08
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods25
▷ Static methods14.00%
▷ Public methods25100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions1173.33%
▷ Anonymous functions426.67%
Constants5
▷ Global constants00.00%
▷ Class constants5100.00%
▷ Public constants5100.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