84% bonanza-woocommerce-free-gifts-lite

Code Review | Bonanza - WooCommerce Free Gifts Lite

WordPress plugin Bonanza - WooCommerce Free Gifts Lite scored84%from 54 tests.

About plugin

  • Plugin page: bonanza-woocommer...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.1-5.2.2
  • WordPress version: 6.3.1
  • First release: Aug 13, 2019
  • Latest release: Aug 13, 2019
  • Number of updates: 2
  • Update frequency: every 190.0 days
  • Top authors: amans2k (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /1,291 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.43ms] Passed 4 tests

This is a short check of server-side resources used by Bonanza - WooCommerce Free Gifts Lite
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0539.41 ▼8.00
Dashboard /wp-admin3.35 ▲0.0554.25 ▲3.38
Posts /wp-admin/edit.php3.46 ▲0.1150.58 ▼4.80
Add New Post /wp-admin/post-new.php5.93 ▲0.0592.29 ▼3.89
Media Library /wp-admin/upload.php3.27 ▲0.0537.79 ▼1.04

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 210 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Bonanza - WooCommerce Free Gifts Lite
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲6313.32 ▼0.884.92 ▲2.7342.30 ▼1.72
Dashboard /wp-admin2,221 ▲155.81 ▼0.08100.86 ▼4.1939.05 ▲0.42
Posts /wp-admin/edit.php2,110 ▲102.06 ▲0.0437.08 ▲1.9535.33 ▲2.59
Add New Post /wp-admin/post-new.php1,545 ▲1022.88 ▼0.28600.60 ▼33.3367.77 ▼1.74
Media Library /wp-admin/upload.php1,412 ▲124.26 ▲0.04103.15 ▼14.0548.18 ▲0.92

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 38× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/bonanza-woocommerce-free-gifts-lite/admin/includes/cmb2/includes/types/CMB2_Type_Text_Datetime_Timestamp.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/bonanza-woocommerce-free-gifts-lite/admin/includes/cmb2/includes/CMB2_hookup.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/bonanza-woocommerce-free-gifts-lite/admin/includes/cmb2/includes/types/CMB2_Type_File_List.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/bonanza-woocommerce-free-gifts-lite/admin/includes/cmb2/includes/CMB2_Field.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller' not found in wp-content/plugins/bonanza-woocommerce-free-gifts-lite/admin/includes/cmb2/includes/rest-api/CMB2_REST_Controller_Boxes.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/bonanza-woocommerce-free-gifts-lite/admin/includes/cmb2/includes/types/CMB2_Type_Taxonomy_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/bonanza-woocommerce-free-gifts-lite/admin/includes/cmb2/includes/types/CMB2_Type_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'XLWCFG_Rule_Base' not found in wp-content/plugins/bonanza-woocommerce-free-gifts-lite/rules/rules/day.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Radio' not found in wp-content/plugins/bonanza-woocommerce-free-gifts-lite/admin/includes/cmb2/includes/types/CMB2_Type_Multicheck.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Multicheck' not found in wp-content/plugins/bonanza-woocommerce-free-gifts-lite/admin/includes/cmb2/includes/types/CMB2_Type_Taxonomy_Multicheck_Hierarchical.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 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
7 plugin tags: woocommerce bulk gifts, woocommerce bogo plugin, woocommerce free gifts, woocommerce bogo deals, xlplugins...

bonanza-woocommerce-free-gifts-lite/bonanza-woocommerce-free-gifts-lite.php Passed 13 tests

The main PHP script in "Bonanza - WooCommerce Free Gifts Lite" version 1.0.0 is automatically included on every request by WordPress
62 characters long description:
WooCommerce Free Gifts plugin allows you to add gifts on cart.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin21,726 lines of code in 149 files:
LanguageFilesBlank linesComment linesLines of code
PHP1143,7547,64513,964
CSS191,2431,1935,432
JavaScript155365162,319
SVG10011

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity19.52
▷ Minimum class complexity1.00
▷ Maximum class complexity181.00
Average method complexity3.26
▷ Minimum method complexity1.00
▷ Maximum method complexity53.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes112
▷ Abstract classes87.14%
▷ Concrete classes10492.86%
▷ Final classes00.00%
Methods920
▷ Static methods21823.70%
▷ Public methods82189.24%
▷ Protected methods9410.22%
▷ Private methods50.54%
Functions31
▷ Named functions2993.55%
▷ Anonymous functions26.45%
Constants25
▷ Global constants1664.00%
▷ Class constants936.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
20 PNG files occupy 0.05MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/includes/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
admin/assets/img/nextmove.png5.32KB2.53KB▼ 52.45%
admin/includes/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
admin/includes/cmb2/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
admin/includes/cmb2/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%