90% wc-coupons-by-country

Code Review | WC Coupons by Country

WordPress plugin WC Coupons by Country scored90%from 54 tests.

About plugin

  • Plugin page: wc-coupons-by-cou...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4
  • WordPress version: 6.3.1
  • First release: Jan 12, 2016
  • Latest release: Jan 12, 2016
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: axisthemes (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /2,273 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

This is a short check of server-side resources used by WC Coupons by Country
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.41 ▼4.73
Dashboard /wp-admin3.32 ▼0.0343.32 ▼12.72
Posts /wp-admin/edit.php3.37 ▲0.0144.18 ▼8.78
Add New Post /wp-admin/post-new.php5.90 ▲0.0181.06 ▼10.24
Media Library /wp-admin/upload.php3.24 ▲0.0134.08 ▲1.25

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WC Coupons by Country
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6913.53 ▼0.851.53 ▼0.5340.74 ▼0.37
Dashboard /wp-admin2,221 ▲304.83 ▼1.05104.21 ▼0.8240.55 ▼4.69
Posts /wp-admin/edit.php2,103 ▲142.03 ▲0.0435.71 ▼5.0937.46 ▼3.66
Add New Post /wp-admin/post-new.php1,524 ▼417.61 ▼0.75628.39 ▲24.1056.87 ▲4.33
Media Library /wp-admin/upload.php1,403 ▲124.19 ▼0.2097.77 ▲0.4147.12 ▲5.04

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed: The official readme.txt is a good inspiration

wc-coupons-by-country/wc-coupons-by-country.php Passed 13 tests

Analyzing the main PHP file in "WC Coupons by Country" version 1.0.0
77 characters long description:
WooCommerce Coupons by Country restricts coupons usage to specific countries.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected143 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP343128143

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity7.67
▷ Minimum class complexity4.00
▷ Maximum class complexity14.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods15
▷ Static methods1173.33%
▷ Public methods1386.67%
▷ Protected methods00.00%
▷ Private methods213.33%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin