57% sovrn-workbench

Code Review | Workbench by Sovrn

WordPress plugin Workbench by Sovrn scored57%from 54 tests.

About plugin

  • Plugin page: sovrn-workbench
  • Plugin version: 1.3.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.7
  • WordPress version: 6.3.1
  • First release: Sep 9, 2016
  • Latest release: May 16, 2017
  • Number of updates: 31
  • Update frequency: every 7.9 days
  • Top authors: sovrn (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,944 total downloads

Benchmarks

Plugin footprint 47% 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: ▲1.25MB] [CPU: ▲3,766.28ms] 75% from 4 tests

A check of server-side resources used by Workbench by Sovrn
Please fix the following
  • Extra CPU: Extra CPU usage should be kept under 200.00ms (currently 3,766.28ms on /wp-admin/upload.php)
PageMemory (MB)CPU Time (ms)
Home /4.64 ▲1.1864.43 ▲26.11
Dashboard /wp-admin4.64 ▲1.345,066.96 ▲5,019.65
Posts /wp-admin/edit.php4.69 ▲1.3420,071.68 ▲20,016.18
Add New Post /wp-admin/post-new.php7.14 ▲1.265,100.51 ▲5,001.72
Media Library /wp-admin/upload.php4.46 ▲1.245,052.42 ▲5,017.63

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 477 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-comments
workbench_last_sent
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded
sovrn_workbench_version
sovrn_workbench_priority
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Workbench by Sovrn
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,185 ▲42415.95 ▲1.6032.11 ▲30.1141.35 ▼1.36
Dashboard /wp-admin2,468 ▲2627.17 ▲2.12135.74 ▲28.1495.72 ▲53.47
Posts /wp-admin/edit.php2,415 ▲3153.97 ▲1.9669.09 ▲27.3279.90 ▲41.74
Add New Post /wp-admin/post-new.php1,660 ▲11521.52 ▼1.90611.17 ▼86.5239.77 ▼25.98
Media Library /wp-admin/upload.php1,581 ▲1784.86 ▲0.6396.23 ▼7.8992.49 ▲47.36

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Compile error in wp-content/plugins/sovrn-workbench/includes/class-sovrn_workbench.php+21
    Cannot declare class Sovrn_Workbench, because the name is already in use
  • Incomplete uninstall procedure, leaving 477 files (9.69MB) in the plugin directory
    • (new file) LICENSE.txt
    • (new file) admin/class-sovrn_workbench-admin.php
    • (new file) admin/css/material-icons.css
    • (new file) admin/css/countrySelect.min.css
    • (new file) admin/css/dialog-polyfill.css
    • (new file) LICENSE
    • (new file) admin/css/countrySelect.css
    • (new file) admin/css/font-awesome.min.css
    • (new file) README.md
    • (new file) README.txt
    • ...
  • Zombie WordPress options detected upon uninstall: 11 options
    • can_compress_scripts
    • sovrn_workbench_priority
    • sovrn_workbench_version
    • recovery_mode_email_last_sent
    • sovrn_workbench-auth_token
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • workbench_last_sent
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, 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
Please fix the following items
  • 7× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/sovrn-workbench/includes/vendor/mixpanel/mixpanel-php/examples/custom_consumer.php
    • > /wp-content/plugins/sovrn-workbench/admin/layouts/layout-workbench-banner.php
    • > /wp-content/plugins/sovrn-workbench/admin/layouts/dialogs/dialog-terms-and-conditions.php
    • > /wp-content/plugins/sovrn-workbench/admin/layouts/layout-api-down.php
    • > /wp-content/plugins/sovrn-workbench/includes/mixpanel/examples/error_handling.php
    • > /wp-content/plugins/sovrn-workbench/includes/mixpanel/examples/custom_consumer.php
    • > /wp-content/plugins/sovrn-workbench/includes/vendor/mixpanel/mixpanel-php/examples/error_handling.php
  • 357× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > [ Base_MixpanelBase - line 194 ]
      Queued message: {"event":"test_event","properties":{"mp_lib":"php","color":"red","token":"MIXPANEL_PROJECT_TOKEN","time":1697205504}}
    • > [ Base_MixpanelBase - line 94 ]
      destruct flush attempt #1
    • > [ Base_MixpanelBase - line 94 ]
      destruct flush attempt #1
    • > [ Base_MixpanelBase - line 133 ]
      Batch of 1 consumed, queue size is now 0
    • > [ Base_MixpanelBase - line 76 ]
      Using token: MIXPANEL_PROJECT_TOKEN
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/sovrn-workbench/includes/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php:7
    • > [ Base_MixpanelBase - line 94 ]
      destruct flush attempt #1
    • > [ Base_MixpanelBase - line 133 ]
      Batch of 2 consumed, queue size is now 0
    • > [ Base_MixpanelBase - line 121 ]
      Batch consumption failed!
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Handler\\CurlFactoryInterface' not found in wp-content/plugins/sovrn-workbench/includes/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:16

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

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
10 plugin tags: twitter, distribute, fbia, share, apple news...

sovrn-workbench/sovrn_workbench.php 77% from 13 tests

The main PHP file in "Workbench by Sovrn" ver. 1.3.3 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Description: Please keep the plugin description shorter than 140 characters (currently 147 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sovrn-workbench.php" instead of "sovrn_workbench.php")

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 detected39,765 lines of code in 354 files:
LanguageFilesBlank linesComment linesLines of code
PHP2507,07311,54925,083
CSS95991743,733
Markdown211,06803,465
YAML29162933,309
JavaScript74215592,417
SVG18010994
JSON1300618
XML560115
make211031

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity11.30
▷ Minimum class complexity1.00
▷ Maximum class complexity197.00
Average method complexity2.28
▷ Minimum method complexity1.00
▷ Maximum method complexity80.00
Code structure
Namespaces25
Interfaces17
Traits2
Classes201
▷ Abstract classes62.99%
▷ Concrete classes19597.01%
▷ Final classes42.05%
Methods1,878
▷ Static methods743.94%
▷ Public methods1,60785.57%
▷ Protected methods824.37%
▷ Private methods18910.06%
Functions375
▷ Named functions6818.13%
▷ Anonymous functions30781.87%
Constants75
▷ Global constants2432.00%
▷ Class constants5168.00%
▷ Public constants51100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
51 PNG files occupy 3.42MB with 1.40MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/close-icon.png2.09KB0.82KB▼ 60.73%
admin/img/google-plus.png3.79KB2.21KB▼ 41.89%
assets/images/placeholder-icon.png0.85KB0.82KB▼ 3.12%
admin/img/twitter@2x.png6.74KB3.16KB▼ 53.04%
admin/img/google-a-m-p-logo.png4.15KB2.27KB▼ 45.19%