62% ostoolbar

Code Review | OSToolbar

WordPress plugin OSToolbar scored62%from 54 tests.

About plugin

  • Plugin page: ostoolbar
  • Plugin version: 3.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4.1
  • WordPress version: 6.3.1
  • First release: Apr 28, 2012
  • Latest release: Jan 27, 2016
  • Number of updates: 35
  • Update frequency: every 39.2 days
  • Top authors: alledia (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,940 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.84MB] [CPU: ▼30.84ms] Passed 4 tests

An overview of server-side resources used by OSToolbar
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0733.14 ▼13.71
Dashboard /wp-admin3.10 ▼0.2022.67 ▼25.31
Posts /wp-admin/edit.php3.10 ▼0.2629.25 ▼17.17
Add New Post /wp-admin/post-new.php3.10 ▼2.7926.43 ▼67.17
Media Library /wp-admin/upload.php3.10 ▼0.1324.99 ▼8.22
OSToolbar /wp-admin/options-general.php?page=ostoolbar_options3.1024.05

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 40 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by OSToolbar
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,854 ▲8313.61 ▼0.791.78 ▼0.3540.21 ▼1.95
Dashboard /wp-admin2,226 ▲355.25 ▲0.35109.78 ▼7.3742.50 ▼1.00
Posts /wp-admin/edit.php2,121 ▲352.33 ▲0.2946.31 ▲8.5637.62 ▲3.94
Add New Post /wp-admin/post-new.php1,544 ▲2518.51 ▼4.68619.49 ▼67.9652.71 ▼0.28
Media Library /wp-admin/upload.php1,417 ▲324.51 ▲0.3198.75 ▼0.1841.11 ▼3.51
OSToolbar /wp-admin/options-general.php?page=ostoolbar_options9322.1630.4231.35

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5453
    Function add_object_page is deprecated since version 4.5.0! Use add_menu_page() instead.
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=ostoolbar_options
    • > User deprecated in wp-includes/functions.php+5453
    Function add_object_page is deprecated since version 4.5.0! Use add_menu_page() instead.
    • > GET request to /wp-admin/options-general.php?page=ostoolbar_options
    • > Warning in wp-content/plugins/ostoolbar/library/ostoolbar/Configuration.php+160
    count(): Parameter must be an array or an object that implements Countable
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ostoolbar_options
    • > Warning in wp-content/plugins/ostoolbar/library/ostoolbar/Configuration.php+203
    Invalid argument supplied for foreach()

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Ostoolbar\\Model' not found in wp-content/plugins/ostoolbar/library/ostoolbar/Model/Tutorial.php:14

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=ostoolbar_options
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).fire is not a function" "TypeError: $(...).fire is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/ostoolbar/assets/js/configuration.js?ver=6.3.1:34:36)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=ostoolbar_options
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).fire is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% 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
These attributes need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === ostoolbar === )
  • Screenshots: Please add images for these screenshots: #1 (The list of videos in your WordPress admin panel.), #2 (Watching a video.)
You can look at the official readme.txt

ostoolbar/ostoolbar.php Passed 13 tests

The main PHP script in "OSToolbar" version 3.0.3 is automatically included on every request by WordPress
68 characters long description:
This plugin shows training videos inside your WordPress admin panel.

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
Everything looks great! No dangerous files found in this plugin1,903 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP162725211,297
CSS22830571
JavaScript26435

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity12.73
▷ Minimum class complexity1.00
▷ Maximum class complexity69.00
Average method complexity3.12
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes15
▷ Abstract classes213.33%
▷ Concrete classes1386.67%
▷ Final classes00.00%
Methods84
▷ Static methods2023.81%
▷ Public methods6476.19%
▷ Protected methods2023.81%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants12
▷ Global constants541.67%
▷ Class constants758.33%
▷ Public constants7100.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
19 PNG files occupy 0.15MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png0.20KB0.08KB▼ 57.56%
assets/images/ost_icon.png3.01KB2.62KB▼ 13.09%
assets/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png0.32KB0.18KB▼ 42.38%
assets/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png0.26KB0.12KB▼ 53.44%
assets/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png5.68KB1.83KB▼ 67.77%