68% jaspreetchahals-coupons-lite

Code Review | JC Coupon

WordPress plugin JC Coupon scored 68% from 54 tests.

About plugin

  • Plugin page: jaspreetchahals-c...
  • Plugin version: 3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.0-4.4.2
  • WordPress version: 6.3.1
  • First release: May 21, 2012
  • Latest release: Feb 22, 2016
  • Number of updates: 28
  • Update frequency: every 49.0 days
  • Top authors: jaschahal (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

60+ active / 20,713 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.66ms] Passed 4 tests

This is a short check of server-side resources used by JC Coupon
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.20 ▼4.82
Dashboard /wp-admin3.34 ▲0.0448.47 ▲3.75
Posts /wp-admin/edit.php3.39 ▲0.0444.53 ▼0.49
Add New Post /wp-admin/post-new.php5.92 ▲0.0381.95 ▼17.09
Media Library /wp-admin/upload.php3.26 ▲0.0339.64 ▲6.57
Manage Coupons /wp-admin/admin.php?page=jaspreetchahals-coupons-lite/jaspreetchahals-coupons-lite.php_manage3.2332.71
Add Coupon /wp-admin/admin.php?page=jaspreetchahals-coupons-lite/jaspreetchahals-coupons-lite.php_add3.2128.47
Import Coupons /wp-admin/admin.php?page=jaspreetchahals-coupons-lite/jaspreetchahals-coupons-lite.php_import3.2330.66
Manage Categories /wp-admin/admin.php?page=jaspreetchahals-coupons-lite/jaspreetchahals-coupons-lite.php_categories_settings3.2331.97
JC WP-Coupons Lite /wp-admin/admin.php?page=jaspreetchahals-coupons-lite/jaspreetchahals-coupons-lite.php3.2325.33

Server storage [IO: ▲1.26MB] [DB: ▲0.08MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 90 new files
Database: 2 new tables, 16 new options
New tables
wp_jcorgcr_categories
wp_jcorgcr_coupons
New WordPress options
widget_recent-comments
jcorgcr_db_version
can_compress_scripts
db_upgraded
jcorgcr_obfuscate
jcorgcr_default_notification_email
jcorgcr_default_failure_limit
jcorgcr_default_height
widget_recent-posts
jcorgcr_default_theme_color
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for JC Coupon
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,937 ▲20213.92 ▼0.455.68 ▲3.8941.50 ▼0.13
Dashboard /wp-admin2,243 ▲545.38 ▲0.49111.34 ▲6.1182.71 ▲43.18
Posts /wp-admin/edit.php2,157 ▲682.32 ▲0.2839.28 ▼0.4333.54 ▲1.63
Add New Post /wp-admin/post-new.php1,718 ▲18522.73 ▼0.36644.39 ▼51.2831.56 ▼17.15
Media Library /wp-admin/upload.php1,457 ▲694.62 ▲0.4591.17 ▼13.8268.61 ▲24.85
Manage Coupons /wp-admin/admin.php?page=jaspreetchahals-coupons-lite/jaspreetchahals-coupons-lite.php_manage1,0152.4535.7635.25
Add Coupon /wp-admin/admin.php?page=jaspreetchahals-coupons-lite/jaspreetchahals-coupons-lite.php_add1,4242.5552.7787.74
Import Coupons /wp-admin/admin.php?page=jaspreetchahals-coupons-lite/jaspreetchahals-coupons-lite.php_import9402.2830.5736.03
Manage Categories /wp-admin/admin.php?page=jaspreetchahals-coupons-lite/jaspreetchahals-coupons-lite.php_categories_settings8912.2927.8631.23
JC WP-Coupons Lite /wp-admin/admin.php?page=jaspreetchahals-coupons-lite/jaspreetchahals-coupons-lite.php1,0802.2928.2930.11

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_jcorgcr_coupons
    • wp_jcorgcr_categories
  • Zombie WordPress options were found after uninstall: 16 options
    • theysaidso_admin_options
    • jcorgcr_obfuscate
    • jcorgcr_default_notification_email
    • jcorgcr_default_width
    • jcorgcr_db_version
    • widget_recent-comments
    • jcorgcr_default_coupon_category
    • disply_jcorgcr_url
    • jcorgcr_default_failure_limit
    • db_upgraded
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=jaspreetchahals-coupons-lite/jaspreetchahals-coupons-lite.php_manage
    • > POST request to /wp-content/plugins/jaspreetchahals-coupons-lite/jcorgcrjax.php?req_type=mcp&s=0&srt=id&_wpnonce=2426c65e68
    • > Notice in wp-content/plugins/jaspreetchahals-coupons-lite/jcorgcrjax.php+71
    Undefined index: category_id
  • 31 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=jaspreetchahals-coupons-lite/jaspreetchahals-coupons-lite.php_add
    • > Notice in wp-content/plugins/jaspreetchahals-coupons-lite/jaspreetchahals-coupons-lite.php+559
    Undefined variable: coupon

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/jaspreetchahals-coupons-lite/jaspreetchahals-coupons-lite.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (Manage Coupons - screenshot-1.png), #2 (Add Coupons - screenshot-2.png), #3 (Coupon Usage - screenshot-3.png)
You can take inspiration from this readme.txt

jaspreetchahals-coupons-lite/jaspreetchahals-coupons-lite.php 92% from 13 tests

Analyzing the main PHP file in "JC Coupon" version 3.2
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 196 characters long)

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 detected2,555 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
CSS51003451,149
PHP392481,054
JavaScript59971352

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity4.00
▷ Minimum method complexity2.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods2100.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
73 PNG files occupy 1.00MB with 0.40MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/scissors_blue.png1.54KB0.54KB▼ 64.98%
screenshots/jcouponadd.PNG114.22KB38.07KB▼ 66.67%
css/ui-darkness/images/ui-bg_inset-soft_30_f58400_1x100.png0.11KB0.18KB0.00%
images/star_grey.png0.74KB0.67KB▼ 9.80%
images/scisors.png4.70KB1.99KB▼ 57.62%