78% couponfun

Code Review | Coupon Fun (WordPress Coupon Plugin by ThemeXL.com)

WordPress plugin Coupon Fun (WordPress Coupon Plugin by ThemeXL.com) scored78%from 54 tests.

About plugin

  • Plugin page: couponfun
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.9.7
  • WordPress version: 6.3.1
  • First release: May 14, 2018
  • Latest release: Jun 21, 2018
  • Number of updates: 9
  • Update frequency: every 4.3 days
  • Top authors: themexl (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /909 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.42MB] [CPU: ▲3.19ms] Passed 4 tests

This is a short check of server-side resources used by Coupon Fun (WordPress Coupon Plugin by ThemeXL.com)
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.94 ▲0.4842.85 ▲5.92
Dashboard /wp-admin3.75 ▲0.4552.24 ▲6.76
Posts /wp-admin/edit.php3.80 ▲0.4547.86 ▲5.39
Add New Post /wp-admin/post-new.php6.28 ▲0.3986.34 ▼5.30
Media Library /wp-admin/upload.php3.61 ▲0.3840.06 ▲7.62
Add New Coupon /wp-admin/post-new.php?post_type=cf_coupon3.7848.47
Welcome to Meta Box /wp-admin/index.php?page=meta-box-about3.5938.08
Coupons /wp-admin/edit.php?post_type=cf_coupon3.7237.02

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 249 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Coupon Fun (WordPress Coupon Plugin by ThemeXL.com): an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,941 ▲18014.85 ▲0.4914.44 ▲12.4685.26 ▲42.86
Dashboard /wp-admin2,222 ▲445.64 ▼0.0899.03 ▼3.3743.74 ▲0.44
Posts /wp-admin/edit.php2,127 ▲302.00 ▲0.0234.36 ▼1.1933.01 ▲1.73
Add New Post /wp-admin/post-new.php1,549 ▲2323.53 ▼0.04645.12 ▼54.1851.65 ▼11.46
Media Library /wp-admin/upload.php1,424 ▲304.22 ▼0.01112.21 ▲15.8847.52 ▲1.64
Add New Coupon /wp-admin/post-new.php?post_type=cf_coupon1,7933.7063.0933.10
Welcome to Meta Box /wp-admin/index.php?page=meta-box-about8942.1727.1454.30
Coupons /wp-admin/edit.php?post_type=cf_coupon1,1061.9230.6630.14

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 5× PHP files output text when accessed directly:
    • > /wp-content/plugins/couponfun/inc/meta-box-master/inc/templates/audio.php
    • > /wp-content/plugins/couponfun/inc/meta-box-master/inc/templates/image-advanced.php
    • > /wp-content/plugins/couponfun/inc/meta-box-master/inc/templates/video.php
    • > /wp-content/plugins/couponfun/inc/meta-box-master/inc/templates/media.php
    • > /wp-content/plugins/couponfun/inc/meta-box-master/inc/templates/upload.php
  • 65× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Field' not found in wp-content/plugins/couponfun/inc/meta-box-master/inc/fields/multiple-values.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Choice_Field' not found in wp-content/plugins/couponfun/inc/meta-box-master/inc/fields/input-list.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/couponfun/inc/functions.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Walker_Base' not found in wp-content/plugins/couponfun/inc/meta-box-master/inc/walkers/input-list.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Datetime_Field' not found in wp-content/plugins/couponfun/inc/meta-box-master/inc/fields/time.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Text_Field' not found in wp-content/plugins/couponfun/inc/meta-box-master/inc/fields/datetime.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/couponfun/inc/meta-box-master/inc/about/sections/tabs.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Media_Field' not found in wp-content/plugins/couponfun/inc/meta-box-master/inc/fields/file-upload.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Taxonomy_Field' not found in wp-content/plugins/couponfun/inc/meta-box-master/inc/fields/taxonomy-advanced.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Media_Field' not found in wp-content/plugins/couponfun/inc/meta-box-master/inc/fields/video.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
5 plugin tags: coupons, daily deals, promo code, discounts, offers

couponfun/index.php 85% from 13 tests

The main PHP script in "Coupon Fun (WordPress Coupon Plugin by ThemeXL.com)" version 1.0.0 is automatically included on every request by WordPress
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 178 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("couponfun.php" instead of "index.php")

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
Success! There were no dangerous files found in this plugin9,795 lines of code in 217 files:
LanguageFilesBlank linesComment linesLines of code
PHP888863,4764,219
CSS371571112,461
JavaScript813954661,731
PO File115145671,384

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity6.62
▷ Minimum class complexity1.00
▷ Maximum class complexity74.00
Average method complexity2.21
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes71
▷ Abstract classes68.45%
▷ Concrete classes6591.55%
▷ Final classes00.00%
Methods336
▷ Static methods25575.89%
▷ Public methods31593.75%
▷ Protected methods205.95%
▷ Private methods10.30%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
16 compressed PNG files occupy 0.04MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/meta-box-master/img/jqueryui/ui-icons_888888_256x240.png4.27KB4.11KB▼ 3.78%
inc/meta-box-master/img/jqueryui/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
inc/meta-box-master/img/jqueryui/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
inc/meta-box-master/img/jqueryui/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
inc/meta-box-master/img/jqueryui/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%