10% wp-coupon-system

Code Review | WP Coupon System

WordPress plugin WP Coupon System scored10%from 54 tests.

About plugin

  • Plugin page: wp-coupon-system
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.1
  • WordPress version: 6.3.1
  • First release: Dec 11, 2014
  • Latest release: Dec 12, 2014
  • Number of updates: 6
  • Update frequency: every 0.3 days
  • Top authors: noor-e-alam (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /2,759 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/wp-coupon-system/framework/includes/wpalchemy/MetaBox.php+61
    Methods with the same name as their class will not be constructors in a future version of PHP; WPAlchemy_MetaBox has a deprecated constructor

Server metrics [RAM: ▼1.51MB] [CPU: ▼47.84ms] Passed 4 tests

An overview of server-side resources used by WP Coupon System
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.75 ▼0.9810.79 ▼30.45
Dashboard /wp-admin2.77 ▼0.7911.90 ▼43.03
Posts /wp-admin/edit.php2.77 ▼0.9111.13 ▼37.15
Add New Post /wp-admin/post-new.php2.77 ▼3.3810.40 ▼80.57
Media Library /wp-admin/upload.php2.77 ▼0.7211.12 ▼30.59
Coupon Category /wp-admin/edit-tags.php?taxonomy=coupon_cat&post_type=coupon2.779.52
Add New /wp-admin/post-new.php?post_type=coupon2.7712.93
Coupons /wp-admin/edit.php?post_type=coupon2.7813.64

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 200 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

WP Coupon System: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲6814.38 ▲0.012.00 ▲0.2342.53 ▼3.37
Dashboard /wp-admin2,228 ▲575.66 ▲0.0299.54 ▲10.2242.68 ▼3.25
Posts /wp-admin/edit.php2,133 ▲332.01 ▼0.0040.02 ▲2.3038.76 ▲5.35
Add New Post /wp-admin/post-new.php9,277 ▲7,73224.45 ▲1.27708.86 ▲39.7163.81 ▼1.81
Media Library /wp-admin/upload.php1,433 ▲394.22 ▼0.0398.04 ▼4.0342.29 ▼6.15
Coupon Category /wp-admin/edit-tags.php?taxonomy=coupon_cat&post_type=coupon1,3042.1426.7828.56
Add New /wp-admin/post-new.php?post_type=coupon2,2194.0072.75101.51
Coupons /wp-admin/edit.php?post_type=coupon1,1111.9330.4530.29

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/wp-coupon-system/framework/includes/wpalchemy/MetaBox.php+61
    Methods with the same name as their class will not be constructors in a future version of PHP; WPAlchemy_MetaBox has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=coupon
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/wp-coupon-system/framework/includes/wpalchemy/MetaBox.php+61
    Methods with the same name as their class will not be constructors in a future version of PHP; WPAlchemy_MetaBox has a deprecated constructor
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=coupon
    • > Notice in wp-content/plugins/wp-coupon-system/framework/classes/metabox.php+474
    Undefined index: repeating
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=coupon
    • > Warning in wp-content/plugins/wp-coupon-system/framework/includes/wpalchemy/MetaBox.php+2657
    count(): Parameter must be an array or an object that implements Countable

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 118× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: is_compact in wp-content/plugins/wp-coupon-system/framework/views/control/sorter.php on line 1
    • > PHP Warning
      Use of undefined constant VP_PUBLIC_URL - assumed 'VP_PUBLIC_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-coupon-system/framework/config/dependencies.php on line 184
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-coupon-system/admin/shortcodes.php:116
    • > PHP Fatal error
      Uncaught Error: Class 'VP_Control_FieldMulti' not found in wp-content/plugins/wp-coupon-system/framework/classes/control/field/checkbox.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'VP_Control_FieldMulti' not found in wp-content/plugins/wp-coupon-system/framework/classes/control/field/fontawesome.php:3
    • > PHP Warning
      Use of undefined constant VP_PUBLIC_URL - assumed 'VP_PUBLIC_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-coupon-system/framework/config/dependencies.php on line 67
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-coupon-system/admin/icon.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'VP_View' not found in wp-content/plugins/wp-coupon-system/framework/views/control/toggle.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'VP_View' not found in wp-content/plugins/wp-coupon-system/framework/views/control/checkbox.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'VP_Control_Field' not found in wp-content/plugins/wp-coupon-system/framework/classes/control/field/codeeditor.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/post-new.php?post_type=coupon
    • > Javascript (severe) in unknown
    /wp-content/plugins/wp-coupon-system/framework/public/js/vendor/jquery.tipsy.js?ver=1.0.0a 179:24 Uncaught TypeError: this[binder] is not a function
    • > GET request to /wp-admin/post-new.php?post_type=coupon
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: vp.init_ace_editor is not a function" "TypeError: vp.init_ace_editor is not a function\n at vp.init_controls (/wp-content/plugins/wp-coupon-system/framework/public/js/shared.min.js?ver=1.1:1:18433)\n at HTMLDivElement.\u003Canonymous> (/wp-content/plugins/wp-coupon-system/framework/public/js/metabox.min.js?ver=6.3.1:1:975)\n at Function.each (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:3129)\n at e.\u003Ccomputed>.each (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:1594)\n at e (/wp-content/plugins/wp-coupon-system/framework/public/js/metabox.min.js?ver=6.3.1:1:915)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/wp-coupon-system/framework/public/js/metabox.min.js?ver=6.3.1:1:2532)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/post-new.php?post_type=coupon
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: vp.init_ace_editor is not a function

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: wp coupon system, wordpress coupon plugin, wp free coupon plugin, wp coupon, wp coupon management...

wp-coupon-system/wp-coupon-system.php Passed 13 tests

The main PHP script in "WP Coupon System" version 1.0 is automatically included on every request by WordPress
43 characters long description:
Super modern wordpress coupon system plugin

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin16,279 lines of code in 159 files:
LanguageFilesBlank linesComment linesLines of code
PHP932,1232,3188,984
CSS151671893,832
JavaScript474472982,959
SVG100414
Markdown231089
JSON1001

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
It is recommended to fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 102)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity21.38
▷ Minimum class complexity1.00
▷ Maximum class complexity271.00
Average method complexity3.36
▷ Minimum method complexity1.00
▷ Maximum method complexity102.00
Code structure
Namespaces0
Interfaces2
Traits0
Classes56
▷ Abstract classes47.14%
▷ Concrete classes5292.86%
▷ Final classes00.00%
Methods505
▷ Static methods8917.62%
▷ Public methods47293.47%
▷ Protected methods193.76%
▷ Private methods142.77%
Functions31
▷ Named functions31100.00%
▷ Anonymous functions00.00%
Constants40
▷ Global constants3792.50%
▷ Class constants37.50%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
23 compressed PNG files occupy 0.06MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
framework/public/css/vendor/jqueryui/themes/smoothness/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
framework/public/css/vendor/jqueryui/themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
framework/public/css/vendor/jqueryui/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
framework/public/css/vendor/jqueryui/themes/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
framework/public/css/vendor/jqueryui/themes/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%