77% focus-on-reviews-for-woocommerce

Code Review | Focus on Reviews for WooCommerce

WordPress plugin Focus on Reviews for WooCommerce scored 77% from 54 tests.

About plugin

  • Plugin page: focus-on-reviews-...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2.1
  • WordPress version: 5.9.2
  • First release: Jun 12, 2019
  • Latest release: Jun 12, 2019
  • Number of updates: 8
  • Update frequency: N/A
  • Top authors: johnc1979 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 319 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲4.30MB] [CPU: ▼890.61ms] 75% from 4 tests

A check of server-side resources used by Focus on Reviews for WooCommerce
Please take the time to fix the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 2,680.12ms on /wp-admin/admin.php?page=focus-on-reviews-for-woocommerce)
PageMemory (MB)CPU Time (ms)
Home /8.15 ▲4.6471.29 ▲14.34
Dashboard /wp-admin8.17 ▲4.7655.39 ▲22.70
Posts /wp-admin/edit.php8.17 ▲4.5362.72 ▲27.33
Add New Post /wp-admin/post-new.php10.23 ▲3.27117.23 ▼3,609.40
Media Library /wp-admin/upload.php8.17 ▲4.8739.86 ▲9.94
Freemius Debug [v.2.3.0] /wp-admin/admin.php?page=freemius8.1739.80
Focus On Reviews for WooCommerce /wp-admin/admin.php?page=focus-on-reviews-for-woocommerce8.172,680.12

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 195 new files
Database: no new tables, 8 new options
New WordPress options
forfwc_settings_text20
fs_api_cache
fs_active_plugins
forfwc_settings_checkbox0
fs_accounts
forfwc_settings_text10
fs_gdpr
fs_debug_mode

Browser metrics Passed 4 tests

An overview of browser requirements for Focus on Reviews for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,917 ▲16316.28 ▲1.088.81 ▲2.042.20 ▼0.53
Dashboard /wp-admin2,927 ▲666.14 ▼0.03117.38 ▼11.39173.02 ▲15.70
Posts /wp-admin/edit.php2,723 ▲323.23 ▼0.0167.67 ▲2.78155.88 ▲10.93
Add New Post /wp-admin/post-new.php1,708 ▲1821.66 ▲0.39436.00 ▼28.71166.17 ▲6.24
Media Library /wp-admin/upload.php1,731 ▲365.62 ▲0.08145.02 ▲6.70200.53 ▲5.78
Freemius Debug [v.2.3.0] /wp-admin/admin.php?page=freemius1,4472.5052.90124.85
Focus On Reviews for WooCommerce /wp-admin/admin.php?page=focus-on-reviews-for-woocommerce1,2182.6554.59159.18

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
  • Zombie WordPress options were found after uninstall: 8 options
    • fs_debug_mode
    • forfwc_settings_text10
    • fs_api_cache
    • forfwc_settings_text20
    • forfwc_settings_checkbox0
    • fs_active_plugins
    • fs_gdpr
    • fs_accounts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means 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
Almost there! Just fix the following items
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/focus-on-reviews-for-woocommerce/public/partials/forfwc-public-display.php
    • > /wp-content/plugins/focus-on-reviews-for-woocommerce/admin/partials/forfwc-admin-display.php
    • > /wp-content/plugins/focus-on-reviews-for-woocommerce/freemius/templates/ajax-loader.php
  • 9× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/focus-on-reviews-for-woocommerce/freemius/templates/account/partials/addon.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/focus-on-reviews-for-woocommerce/freemius/templates/partials/network-activation.php:6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/focus-on-reviews-for-woocommerce/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/focus-on-reviews-for-woocommerce/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/focus-on-reviews-for-woocommerce/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/focus-on-reviews-for-woocommerce/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/focus-on-reviews-for-woocommerce/freemius/templates/account/partials/addon.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function forfwc_fs() in wp-content/plugins/focus-on-reviews-for-woocommerce/public/class-forfwc-public.php:109
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/focus-on-reviews-for-woocommerce/freemius/templates/account/partials/addon.php:9

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 86% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Donate link: Invalid url: ""
Please take inspiration from this readme.txt

focus-on-reviews-for-woocommerce/forfwc.php 77% from 13 tests

"Focus on Reviews for WooCommerce" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("focus-on-reviews-for-woocommerce.php" instead of "forfwc.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: Please keep the plugin description shorter than 140 characters (currently 173 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin41,400 lines of code in 147 files:
LanguageFilesBlank linesComment linesLines of code
PHP1156,76815,80728,217
PO File105,7106,91312,558
CSS144722291
JavaScript646113203
HTML160117
SVG10014

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please tend to the following items
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 2,609)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity71.96
▷ Minimum class complexity1.00
▷ Maximum class complexity2,609.00
Average method complexity4.44
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes52
▷ Abstract classes23.85%
▷ Concrete classes5096.15%
▷ Final classes00.00%
Methods1,103
▷ Static methods17215.59%
▷ Public methods76769.54%
▷ Protected methods151.36%
▷ Private methods32129.10%
Functions99
▷ Named functions99100.00%
▷ Anonymous functions00.00%
Constants120
▷ Global constants9780.83%
▷ Class constants2319.17%
▷ Public constants23100.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
3 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/focus-on-reviews-for-woocommerce.png62.76KB16.64KB▼ 73.48%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%