73% coupons

Code Review | Coupons

WordPress plugin Coupons scored73%from 54 tests.

About plugin

  • Plugin page: coupons
  • Plugin version: 1.5.0
  • PHP compatiblity: 5.8.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.1.0
  • WordPress version: 6.3.1
  • First release: Apr 8, 2019
  • Latest release: Aug 25, 2022
  • Number of updates: 11
  • Update frequency: every 112.5 days
  • Top authors: intellasoftsolutions (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,146 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲5.11MB] [CPU: ▲22.25ms] 75% from 4 tests

A check of server-side resources used by Coupons
It is recommended to improve the following
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.11MB on /wp-admin/post-new.php?post_type=issc-coupon)
PageMemory (MB)CPU Time (ms)
Home /8.76 ▲5.2972.38 ▲26.49
Dashboard /wp-admin8.78 ▲5.4784.55 ▲32.31
Posts /wp-admin/edit.php8.78 ▲5.4287.30 ▲27.93
Add New Post /wp-admin/post-new.php10.16 ▲4.27114.52 ▲2.27
Media Library /wp-admin/upload.php8.78 ▲5.5575.63 ▲36.46
Freemius Debug [v.2.4.5] /wp-admin/admin.php?page=freemius8.7864.60
IntellaSoft Coupon Creator /wp-admin/admin.php?page=coupons8.7862.71
Coupons /wp-admin/edit.php?post_type=issc-coupon8.7868.34
Add New /wp-admin/post-new.php?post_type=issc-coupon8.7873.35

Server storage [IO: ▲6.25MB] [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: 534 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
fs_gdpr
can_compress_scripts
fs_debug_mode
db_upgraded
theysaidso_admin_options
fs_active_plugins
fs_accounts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Coupons
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,850 ▲8914.29 ▼0.311.98 ▲0.2231.07 ▼17.85
Dashboard /wp-admin2,253 ▲765.65 ▲0.01104.10 ▲0.4048.13 ▲4.77
Posts /wp-admin/edit.php2,162 ▲592.07 ▲0.0944.64 ▲3.2139.80 ▲3.40
Add New Post /wp-admin/post-new.php1,564 ▲3822.26 ▼0.72689.62 ▼25.0458.74 ▲3.95
Media Library /wp-admin/upload.php1,461 ▲644.45 ▲0.25103.97 ▲0.3844.89 ▼2.19
Freemius Debug [v.2.4.5] /wp-admin/admin.php?page=freemius1,0801.7929.9428.76
IntellaSoft Coupon Creator /wp-admin/admin.php?page=coupons1,2501.8233.3451.88
Coupons /wp-admin/edit.php?post_type=issc-coupon1,1202.0138.4630.85
Add New /wp-admin/post-new.php?post_type=issc-coupon2,2043.35103.8139.45

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/coupons/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 10 options
    • widget_theysaidso_widget
    • fs_gdpr
    • fs_debug_mode
    • fs_active_plugins
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • fs_accounts
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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
  • 43× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/coupons/plugins/cmb2/includes/rest-api/CMB2_REST.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/coupons/plugins/cmb2/example-functions.php:105
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/coupons/plugins/cmb2/includes/types/CMB2_Type_Multi_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/coupons/plugins/cmb2/includes/types/CMB2_Type_Text_Date.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/coupons/plugins/cmb2/includes/types/CMB2_Type_File_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/coupons/inc/notices.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/coupons/plugins/cmb2/includes/CMB2_Hookup.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/coupons/plugins/cmb2/includes/types/CMB2_Type_File_List.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/coupons/plugins/cmb2/includes/types/CMB2_Type_File.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Radio' not found in wp-content/plugins/coupons/plugins/cmb2/includes/types/CMB2_Type_Multicheck.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% 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
Attributes that need to be fixed:
  • Screenshots: Add descriptions for screenshots #1, #2 in coupons/assets to your readme.txt
You can take inspiration from this readme.txt

coupons/coupons.php 85% from 13 tests

Analyzing the main PHP file in "Coupons" version 1.5.0
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

Code Analysis 97% from 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
Success! There were no dangerous files found in this plugin85,202 lines of code in 344 files:
LanguageFilesBlank linesComment linesLines of code
PHP1699,46622,52137,905
PO File12014,31518,50232,323
JSON2006,602
CSS232501,1904,568
JavaScript103956421,625
Sass17306291,411
Markdown32490768

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 2,911)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity47.58
▷ Minimum class complexity1.00
▷ Maximum class complexity2,911.00
Average method complexity4.21
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes113
▷ Abstract classes119.73%
▷ Concrete classes10290.27%
▷ Final classes00.00%
Methods1,674
▷ Static methods26415.77%
▷ Public methods1,24274.19%
▷ Protected methods1046.21%
▷ Private methods32819.59%
Functions134
▷ Named functions134100.00%
▷ Anonymous functions00.00%
Constants133
▷ Global constants10276.69%
▷ Class constants3123.31%
▷ Public constants31100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
17 compressed PNG files occupy 0.05MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
plugins/cmb2/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
plugins/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
freemius/assets/img/coupons.png9.16KB5.26KB▼ 42.58%
plugins/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
plugins/cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%