83% coupon-lite

Code Review | Coupon Plugin

WordPress plugin Coupon Plugin scored 83% from 54 tests.

About plugin

  • Plugin page: coupon-lite
  • Plugin version: 1.1.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.4.1
  • WordPress version: 6.3.1
  • First release: Oct 11, 2017
  • Latest release: May 17, 2020
  • Number of updates: 35
  • Update frequency: every 27.1 days
  • Top authors: vickydalmia (100%)Otto42 (5.71%)

Code review

54 tests

User reviews

4 reviews

Install metrics

300+ active / 7,885 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
Install script ran successfully

Server metrics [RAM: ▲0.27MB] [CPU: ▼2.54ms] Passed 4 tests

This is a short check of server-side resources used by Coupon Plugin
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2740.66 ▼6.42
Dashboard /wp-admin3.58 ▲0.2748.68 ▼0.11
Posts /wp-admin/edit.php3.69 ▲0.3348.92 ▲0.70
Add New Post /wp-admin/post-new.php6.17 ▲0.2989.87 ▼4.32
Media Library /wp-admin/upload.php3.50 ▲0.2737.68 ▲0.91
Category /wp-admin/edit-tags.php?taxonomy=coupon-category&post_type=coupon3.4939.17
Go Pro ➤ /wp-admin/edit.php?post_type=coupon&page=coupon-plugin-setting&tab=pro_settings3.5033.59
Add New /wp-admin/post-new.php?post_type=coupon3.5649.71
All Coupons /wp-admin/edit.php?post_type=coupon3.5440.57
Settings /wp-admin/edit.php?post_type=coupon&page=coupon-plugin-setting3.4933.52
Store /wp-admin/edit-tags.php?taxonomy=coupon-store&post_type=coupon3.4936.40

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 47 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
coupon_plugin_settings
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Coupon Plugin
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,885 ▲13913.19 ▼0.801.61 ▼0.1840.64 ▼7.84
Dashboard /wp-admin2,267 ▲795.90 ▲0.79100.26 ▼12.8541.13 ▼0.55
Posts /wp-admin/edit.php2,147 ▲582.02 ▲0.0336.45 ▼6.4534.92 ▲2.16
Add New Post /wp-admin/post-new.php1,562 ▲2023.19 ▲4.70612.64 ▲0.9465.02 ▲14.40
Media Library /wp-admin/upload.php1,443 ▲554.25 ▲0.0798.06 ▼14.1350.11 ▼2.90
Category /wp-admin/edit-tags.php?taxonomy=coupon-category&post_type=coupon1,3192.1827.0629.03
Go Pro ➤ /wp-admin/edit.php?post_type=coupon&page=coupon-plugin-setting&tab=pro_settings1,0731.9229.8160.23
Add New /wp-admin/post-new.php?post_type=coupon1,7742.8856.1861.71
All Coupons /wp-admin/edit.php?post_type=coupon1,1681.9335.3337.34
Settings /wp-admin/edit.php?post_type=coupon&page=coupon-plugin-setting1,5282.8566.0633.92
Store /wp-admin/edit-tags.php?taxonomy=coupon-store&post_type=coupon1,3192.1528.1829.73

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • coupon_plugin_settings
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, 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 fix the following
  • 50× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function CouponPlugin\\Custom\\PostType\\add_action() in wp-content/plugins/coupon-lite/src/custom/post-type/coupon.php:14
    • > PHP Warning
      Use of undefined constant COUPON_PLUGIN_PATH - assumed 'COUPON_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/coupon-lite/src/custom/custom.php on line 29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/coupon-lite/src/custom/shortcode/views/coupon.php:24
    • > PHP Warning
      include(COUPON_PLUGIN_PATHsrc/custom/admin/admin.php): failed to open stream: No such file or directory in wp-content/plugins/coupon-lite/src/custom/custom.php on line 29
    • > PHP Warning
      include(COUPON_PLUGIN_PATHsrc/custom/helpers/functions.php): failed to open stream: No such file or directory in wp-content/plugins/coupon-lite/src/custom/custom.php on line 29
    • > PHP Warning
      include(): Failed opening 'COUPON_PLUGIN_PATHsrc/custom/meta/term-meta.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/coupon-lite/src/custom/custom.php on line 29
    • > PHP Warning
      include(COUPON_PLUGIN_PATHsrc/custom/meta/term-meta.php): failed to open stream: No such file or directory in wp-content/plugins/coupon-lite/src/custom/custom.php on line 29
    • > PHP Warning
      Use of undefined constant COUPON_PLUGIN_PATH - assumed 'COUPON_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/coupon-lite/src/custom/custom.php on line 29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/coupon-lite/src/custom/meta/views/term-uploader.php:4
    • > PHP Notice
      Undefined variable: popular_coupon in wp-content/plugins/coupon-lite/src/custom/shortcode/views/coupon.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% 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
These attributes need to be fixed:
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3, #4, #5, #6, #7, #8 in coupon-lite/assets to your readme.txt
Please take inspiration from this readme.txt

coupon-lite/coupon-plugin-lite.php 77% from 13 tests

This is the main PHP file of "Coupon Plugin" version 1.1.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Requires PHP: Required version does not match the one declared in readme.txt ("5.4" instead of "5.6")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("coupon-lite.php" instead of "coupon-plugin-lite.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin1,410 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP181255081,019
PO File2126140306
JavaScript30043
SVG10138
CSS4154

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces8
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions44
▷ Named functions44100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/coupon-plugin-guarantee.png19.38KB10.19KB▼ 47.41%
assets/images/cg-icon.png1.16KB0.77KB▼ 33.19%