89% awocoupon

Code Review | AwoCoupon

WordPress plugin AwoCoupon scored89%from 54 tests.

About plugin

  • Plugin page: awocoupon
  • Plugin version: 3.1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.4
  • WordPress version: 6.3.1
  • First release: Aug 21, 2017
  • Latest release: Dec 2, 2023
  • Number of updates: 35
  • Update frequency: every 65.6 days
  • Top authors: awodev (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /2,827 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
Installer ran successfully

Server metrics [RAM: ▲0.99MB] [CPU: ▲5.51ms] Passed 4 tests

An overview of server-side resources used by AwoCoupon
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.45 ▲0.9944.74 ▲1.56
Dashboard /wp-admin4.30 ▲1.0052.50 ▲2.18
Posts /wp-admin/edit.php4.35 ▲0.9958.26 ▲12.65
Add New Post /wp-admin/post-new.php6.88 ▲0.9997.53 ▲6.50
Media Library /wp-admin/upload.php4.22 ▲0.9942.18 ▲11.78

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 164 new files
Database: 8 new tables, 8 new options
New tables
wp_awocoupon_tag
wp_awocoupon
wp_awocoupon_cron
wp_awocoupon_lang_text
wp_awocoupon_config
wp_awocoupon_auto
wp_awocoupon_asset
wp_awocoupon_history
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
awocoupon_version
widget_recent-comments
widget_recent-posts
awocoupon_db_version

Browser metrics Passed 4 tests

An overview of browser requirements for AwoCoupon
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.21 ▼0.011.64 ▼0.0237.75 ▼6.11
Dashboard /wp-admin2,195 ▲145.58 ▼0.0692.61 ▼27.0338.73 ▼5.42
Posts /wp-admin/edit.php2,097 ▼32.00 ▲0.0439.67 ▲1.8935.50 ▼0.11
Add New Post /wp-admin/post-new.php1,526 ▼923.31 ▼1.92653.33 ▲8.9750.04 ▼17.42
Media Library /wp-admin/upload.php1,400 ▼04.15 ▲0.02106.82 ▲10.8645.76 ▲3.29

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

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 no errors were found, this is by no means an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% 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
These attributes need your attention:
  • Screenshots: No descriptions were found for these screenshots #1, #2 in awocoupon/assets to your readme.txt
Please take inspiration from this readme.txt

awocoupon/awocoupon.php Passed 13 tests

This is the main PHP file of "AwoCoupon" version 3.1.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
16 characters long description:
Coupons enhanced

Code Analysis 97% from 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
No dangerous file extensions were detected13,274 lines of code in 82 files:
LanguageFilesBlank linesComment linesLines of code
PHP571,8471,60310,246
CSS10201591,622
JavaScript131741041,303
SQL22514103

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 103)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity52.77
▷ Minimum class complexity1.00
▷ Maximum class complexity590.00
Average method complexity5.68
▷ Minimum method complexity1.00
▷ Maximum method complexity103.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes35
▷ Abstract classes00.00%
▷ Concrete classes35100.00%
▷ Final classes12.86%
Methods381
▷ Static methods184.72%
▷ Public methods28775.33%
▷ Protected methods5815.22%
▷ Private methods369.45%
Functions32
▷ Named functions515.62%
▷ Anonymous functions2784.38%
Constants9
▷ Global constants9100.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
66 compressed PNG files occupy 0.16MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
media/assets/images/awocoupon-small.png1.16KB1.06KB▼ 8.42%
media/assets/images/c_table3.png1.38KB0.87KB▼ 36.58%
media/assets/images/icon-16-home.png0.99KB0.84KB▼ 14.97%
media/assets/images/sort_desc.png0.15KB0.25KB0.00%
media/assets/images/template.png1.07KB0.93KB▼ 13.13%