88% woo-usp

Code Review | Woo USP

WordPress plugin Woo USP scored 88% from 54 tests.

About plugin

  • Plugin page: woo-usp
  • Plugin version: 2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.7
  • WordPress version: 5.8.1
  • First release: Jun 3, 2017
  • Latest release: May 11, 2021
  • Number of updates: 34
  • Update frequency: every 43.0 days
  • Top authors: anna_werner (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

300+ active / 2,512 total downloads

Benchmarks

Plugin footprint Passed 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: ▲0.04MB] [CPU: ▼144.71ms] Passed 4 tests

Analyzing server-side resources used by Woo USP
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.0426.69 ▼7.95
Dashboard /wp-admin3.10 ▲0.0554.70 ▲7.89
Posts /wp-admin/edit.php3.16 ▲0.0544.86 ▼0.56
Add New Post /wp-admin/post-new.php5.46 ▲0.0395.34 ▼570.11
Media Library /wp-admin/upload.php3.05 ▲0.0533.32 ▼0.21
Woo USPs /wp-admin/options-general.php?page=wcusp-options3.0027.95

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 63 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Woo USP
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,730 ▲13416.68 ▲0.6810.70 ▼0.4945.46 ▼7.98
Dashboard /wp-admin3,016 ▲797.13 ▲1.17147.89 ▲3.26108.17 ▲1.11
Posts /wp-admin/edit.php2,785 ▲463.04 ▲0.3271.54 ▼1.9694.41 ▲0.71
Add New Post /wp-admin/post-new.php1,649 ▼3421.76 ▲3.44299.09 ▼73.49116.87 ▲4.86
Media Library /wp-admin/upload.php1,850 ▲405.41 ▲0.40134.78 ▼11.66117.81 ▼2.38
Woo USPs /wp-admin/options-general.php?page=wcusp-options1,5882.5779.3872.00

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wcusp-options
    • > Notice in wp-content/plugins/woo-usp/includes/admin-options.php+108
    Trying to access array offset on value of type bool

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
Almost there! Just fix the following items
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/woo-usp/includes/form-markup.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-usp/assets/scripts.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/woo-usp/woo-usp.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-usp/includes/admin-options.php:134

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

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === woo-usp === )
The official readme.txt is a good inspiration

woo-usp/woo-usp.php 92% from 13 tests

The main PHP script in "Woo USP" version 2.1 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 149 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected20,950 lines of code in 48 files:
LanguageFilesBlank linesComment linesLines of code
JSON1006,518
SVG3003,339
CSS623263,136
HTML217863,117
Sass1434341,768
LESS1434441,758
JavaScript326281,067
PHP54949247

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin