83% force-sell-for-woocommerce

Code Review | Force Sell for WooCommerce

WordPress plugin Force Sell for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: force-sell-for-wo...
  • Plugin version: 3.5.7.9
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Aug 15, 2016
  • Latest release: Sep 21, 2023
  • Number of updates: 73
  • Update frequency: every 35.6 days
  • Top authors: RazyRx (63.01%)dholovnia (38.36%)

Code review

54 tests

User reviews

14 reviews

Install metrics

900+ active /26,733 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.38MB] [CPU: ▲3.21ms] Passed 4 tests

Analyzing server-side resources used by Force Sell for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.84 ▲1.3848.19 ▲7.62
Dashboard /wp-admin4.74 ▲1.3964.91 ▲6.95
Posts /wp-admin/edit.php4.79 ▲1.4357.49 ▲3.95
Add New Post /wp-admin/post-new.php7.25 ▲1.37105.08 ▼5.70
Media Library /wp-admin/upload.php4.60 ▲1.3753.02 ▲19.53

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 100 new files
Database: no new tables, 8 new options
New WordPress options
br-force_sell-options
widget_theysaidso_widget
can_compress_scripts
berocket_admin_notices_rate_stars
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Force Sell for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,842 ▲9613.32 ▼1.092.03 ▲0.3341.59 ▼3.11
Dashboard /wp-admin2,226 ▲355.83 ▲0.9699.39 ▼4.2780.38 ▲40.28
Posts /wp-admin/edit.php2,116 ▲242.01 ▼0.0452.28 ▲12.2440.22 ▲2.30
Add New Post /wp-admin/post-new.php1,548 ▲3418.17 ▲0.61707.55 ▲100.5868.07 ▲14.92
Media Library /wp-admin/upload.php1,402 ▲144.26 ▲0.07100.54 ▲2.7770.71 ▲28.90

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 8 options
    • theysaidso_admin_options
    • widget_recent-posts
    • berocket_admin_notices_rate_stars
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • berocket_key_activated_plugins
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 29× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/force-sell-for-woocommerce/berocket/libraries/popup.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'BeRocket_plugin_variations' not found in wp-content/plugins/force-sell-for-woocommerce/includes/paid.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/force-sell-for-woocommerce/includes/widget.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'BeRocket_plugin_variations' not found in wp-content/plugins/force-sell-for-woocommerce/includes/tripwire.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'DiviExtension' not found in wp-content/plugins/force-sell-for-woocommerce/divi/includes/ForcesellExtension.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/force-sell-for-woocommerce/includes/deprecated/force_sell_single.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'ET_Builder_Module' not found in wp-content/plugins/force-sell-for-woocommerce/divi/includes/modules/brforcesell/brforcesell.php:3
    • > PHP Notice
      Undefined variable: name in wp-content/plugins/force-sell-for-woocommerce/berocket/templates/conditions.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/force-sell-for-woocommerce/berocket/includes/widget.php:8
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/force-sell-for-woocommerce/berocket/templates/settings_footer.php:3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (General settings), #2 (Option on product page)
  • Tags: There are too many tags (18 tag instead of maximum 10)
The official readme.txt is a good inspiration

force-sell-for-woocommerce/woocommerce-force-sell.php 92% from 13 tests

Analyzing the main PHP file in "Force Sell for WooCommerce" version 3.5.7.9
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("force-sell-for-woocommerce.php" instead of "woocommerce-force-sell.php")

Code Analysis Passed 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
Success! There were no dangerous files found in this plugin21,450 lines of code in 72 files:
LanguageFilesBlank linesComment linesLines of code
PHP434771,2419,816
CSS142,513769,385
JavaScript1047611,699
PO File2194216430
JSX16181
XML20039

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity46.54
▷ Minimum class complexity1.00
▷ Maximum class complexity240.00
Average method complexity4.72
▷ Minimum method complexity1.00
▷ Maximum method complexity98.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes35
▷ Abstract classes00.00%
▷ Concrete classes35100.00%
▷ Final classes00.00%
Methods429
▷ Static methods15435.90%
▷ Public methods429100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions32
▷ Named functions32100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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
8 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
berocket/assets/images/submenu-icon.png0.62KB0.50KB▼ 20.13%
images/ad_white_on_orange.png20.67KB15.57KB▼ 24.67%
berocket/assets/images/submenu-icon-a.png0.54KB0.48KB▼ 10.20%
divi/styles/ico.png1.90KB1.41KB▼ 25.89%
berocket/libraries/addons/default.png3.87KB2.63KB▼ 31.94%