10% bonus-for-woo

Code Review | Bonus for Woo

WordPress plugin Bonus for Woo scored10%from 54 tests.

About plugin

  • Plugin page: bonus-for-woo
  • Plugin version: 5.8.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 17, 2020
  • Latest release: Oct 22, 2023
  • Number of updates: 1
  • Update frequency: every 365.0 days

Code review

54 tests

User reviews

16 reviews

Install metrics

200+ active /10,225 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Error in wp-content/plugins/bonus-for-woo/index.php+664
    Uncaught Error: Call to a member function add_cap() on null in wp-content/plugins/bonus-for-woo/index.php:664
    Stack trace:
    #0 wp-admin/includes/plugin.php(2318): include_once()
    #1 wp-admin/includes/plugin.php(663): plugin_sandbox_scrape()

Server metrics [RAM: ▼0.01MB] [CPU: ▼7.30ms] Passed 4 tests

Server-side resources used by Bonus for Woo
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.82 ▼3.09
Dashboard /wp-admin3.31 ▼0.0447.12 ▼18.65
Posts /wp-admin/edit.php3.36 ▲0.0047.45 ▲2.40
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.61 ▼7.41
Media Library /wp-admin/upload.php3.23 ▲0.0033.01 ▼0.06

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 114 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Bonus for Woo
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.43 ▲0.071.76 ▼0.0342.98 ▼0.37
Dashboard /wp-admin2,198 ▲215.55 ▼0.1391.95 ▼8.5142.44 ▼1.66
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0833.51 ▼4.1436.52 ▲4.29
Add New Post /wp-admin/post-new.php1,526 ▼523.16 ▲0.19672.53 ▲12.3757.86 ▼7.66
Media Library /wp-admin/upload.php1,400 ▼04.16 ▼0.0393.70 ▼3.5843.42 ▼1.76

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/bonus-for-woo/classes/teamplates/footer.php
    • > /wp-content/plugins/bonus-for-woo/classes/teamplates/header.php
  • 15× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/bonus-for-woo/index/generator.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/bonus-for-woo/index/shortcodes.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function determine_locale() in wp-content/plugins/bonus-for-woo/index/datatable.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/bonus-for-woo/index/cashback_in_cart.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/bonus-for-woo/index/review.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bonus-for-woo/index/cron.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bonus-for-woo/index/functions.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function determine_locale() in wp-content/plugins/bonus-for-woo/index/coupons.php:61
    • > PHP Fatal error
      Uncaught Error: Call to undefined function determine_locale() in wp-content/plugins/bonus-for-woo/index/datatable.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/bonus-for-woo/index/statistic.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: bonus, points, cashback, referral system, referral...

bonus-for-woo/index.php 77% from 13 tests

This is the main PHP file of "Bonus for Woo" version 5.8.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("bonus-for-woo.php" instead of "index.php")
  • Requires at least: The required version number must match the one declared in readme.txt ("4.9" instead of "5.0")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 237 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected20,853 lines of code in 103 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript322,4088,13110,909
PHP281,4441,0055,442
CSS2283852,779
PO File27318691,490
SVG1911233

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity32.62
▷ Minimum class complexity4.00
▷ Maximum class complexity152.00
Average method complexity2.79
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods141
▷ Static methods13998.58%
▷ Public methods141100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions67
▷ Named functions6597.01%
▷ Anonymous functions22.99%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 compressed PNG files occupy 0.00MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
_inc/datatables/DataTables-1.10.21/images/sort_asc.png0.16KB0.25KB0.00%
_inc/datatables/DataTables-1.10.21/images/sort_asc_disabled.png0.14KB0.25KB0.00%
_inc/datatables/DataTables-1.10.21/images/sort_desc.png0.15KB0.25KB0.00%
_inc/datatables/DataTables-1.10.21/images/sort_desc_disabled.png0.14KB0.25KB0.00%
_inc/datatables/DataTables-1.10.21/images/sort_both.png0.20KB0.29KB0.00%