83% coupon-zen

Code Review | Coupon Zen

WordPress plugin Coupon Zen scored 83% from 54 tests.

About plugin

  • Plugin page: coupon-zen
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 4, 2021
  • Latest release: Aug 3, 2023
  • Number of updates: 13
  • Update frequency: every 49.1 days
  • Top authors: hasthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 695 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

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

This is a short check of server-side resources used by Coupon Zen
The following require your attention
  • CPU: Try to keep total CPU usage under 500.00ms (currently 1,409.67ms on /wp-admin/edit.php?post_type=couponzen&page=couponzen-recommendations)
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1246.73 ▲7.37
Dashboard /wp-admin3.41 ▲0.1146.33 ▼3.98
Posts /wp-admin/edit.php3.46 ▲0.1146.18 ▲3.52
Add New Post /wp-admin/post-new.php6.00 ▲0.1195.01 ▲1.40
Media Library /wp-admin/upload.php3.33 ▲0.1133.30 ▼2.86
Add Coupon /wp-admin/post-new.php?post_type=couponzen3.4553.42
All Coupons /wp-admin/edit.php?post_type=couponzen3.3835.69
Events /wp-admin/edit-tags.php?taxonomy=couponzen_event&post_type=couponzen3.3333.55
Recommendations /wp-admin/edit.php?post_type=couponzen&page=couponzen-recommendations7.621,409.67
Settings /wp-admin/edit.php?post_type=couponzen&page=couponzen-setting3.3138.94
Categories /wp-admin/edit-tags.php?taxonomy=couponzen_category&post_type=couponzen3.3335.56

Server storage [IO: ▲0.28MB] [DB: ▲0.67MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 42 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded
sticky_post_update_check

Browser metrics Passed 4 tests

An overview of browser requirements for Coupon Zen
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,870 ▲13513.62 ▼0.781.93 ▲0.3144.58 ▲3.01
Dashboard /wp-admin2,248 ▲565.86 ▲0.9094.62 ▼12.5378.61 ▲36.10
Posts /wp-admin/edit.php2,145 ▲562.20 ▲0.1940.18 ▲3.6935.13 ▲3.37
Add New Post /wp-admin/post-new.php1,560 ▲4123.18 ▼0.08718.00 ▲38.8755.72 ▲2.30
Media Library /wp-admin/upload.php1,435 ▲444.10 ▼0.0795.14 ▼1.0375.48 ▲29.73
Add Coupon /wp-admin/post-new.php?post_type=couponzen2,5897.94174.06137.45
All Coupons /wp-admin/edit.php?post_type=couponzen1,1742.3435.1030.67
Events /wp-admin/edit-tags.php?taxonomy=couponzen_event&post_type=couponzen1,3202.1826.6929.82
Recommendations /wp-admin/edit.php?post_type=couponzen&page=couponzen-recommendations2,9532.2034.1378.21
Settings /wp-admin/edit.php?post_type=couponzen&page=couponzen-setting1,6512.6958.3230.61
Categories /wp-admin/edit-tags.php?taxonomy=couponzen_category&post_type=couponzen1,3122.1725.9429.24

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • sticky_post_update_check
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 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
Please take a closer look at the following
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/coupon-zen/admin/classes/class.admin-settings.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/coupon-zen/frontend/templates/couponzen-full-width-page-template.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/coupon-zen/frontend/templates/archive-couponzen.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/coupon-zen/include/shortcodes.php:150
    • > PHP Fatal error
      Uncaught Error: Class 'couponZen\\Admin\\Recommended_Plugins' not found in wp-content/plugins/coupon-zen/admin/classes/class.recommended_plugins_menu_call.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/coupon-zen/admin/classes/class.custom-post-type.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/coupon-zen/admin/include/custom-meta-fields.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: deals, coupon plugin, wp coupons, affiliate, coupon

coupon-zen/coupon-zen.php 92% from 13 tests

"Coupon Zen" version 1.0.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin3,073 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP153561591,853
CSS21087863
JavaScript45545355
SVG2002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity14.25
▷ Minimum class complexity1.00
▷ Maximum class complexity46.00
Average method complexity3.36
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods45
▷ Static methods48.89%
▷ Public methods45100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants685.71%
▷ Class constants114.29%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
17 PNG files occupy 0.11MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) admin/assets/images/extensions/ht-menu.png2.85KB0.00KB▼ 100.00%
(invalid) admin/assets/images/extensions/cf7-extensions-pro.png8.57KB0.00KB▼ 100.00%
admin/assets/images/extensions/just-tables-pro.png1.02KB1.05KB0.00%
admin/assets/icon/ht-cupons.png3.42KB0.99KB▼ 70.90%
admin/assets/images/extensions/hashbar-pro.png3.15KB3.30KB0.00%