84% sb-tab-widget

Code Review | SB Tab Widget

WordPress plugin SB Tab Widget scored84%from 54 tests.

About plugin

  • Plugin page: sb-tab-widget
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.1.1
  • WordPress version: 6.3.1
  • First release: Oct 13, 2014
  • Latest release: Apr 9, 2015
  • Number of updates: 10
  • Update frequency: every 17.8 days
  • Top authors: skylarkcob (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,002 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.41ms] Passed 4 tests

Analyzing server-side resources used by SB Tab Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.17 ▼4.87
Dashboard /wp-admin3.32 ▲0.0149.54 ▲0.26
Posts /wp-admin/edit.php3.37 ▲0.0148.97 ▼2.65
Add New Post /wp-admin/post-new.php5.90 ▲0.0186.55 ▼14.94
Media Library /wp-admin/upload.php3.24 ▲0.0136.81 ▼3.17

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by SB Tab Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.48 ▲0.241.64 ▼0.6044.02 ▼1.75
Dashboard /wp-admin2,209 ▲185.84 ▼0.0499.28 ▼16.2139.48 ▼2.49
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0534.52 ▼14.1932.10 ▼4.53
Add New Post /wp-admin/post-new.php1,538 ▲2423.16 ▲5.64664.30 ▼16.6250.94 ▼13.49
Media Library /wp-admin/upload.php1,391 ▲34.23 ▲0.0396.51 ▼2.2544.83 ▲0.74

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

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 no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sb-tab-widget/inc/class-sb-tab-widget.php:2
    • > PHP Fatal error
      require(): Failed opening required 'SB_TAB_WIDGET_INC_PATH/sb-plugin-install.php' (include_path='.:/usr/share/php') in wp-content/plugins/sb-tab-widget/inc/sb-plugin-load.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sb-tab-widget/inc/sb-plugin-hook.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sb-tab-widget/inc/sb-plugin-admin.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/sb-tab-widget/sb-tab-widget.php:21
    • > PHP Warning
      require(SB_TAB_WIDGET_INC_PATH/sb-plugin-install.php): failed to open stream: No such file or directory in wp-content/plugins/sb-tab-widget/inc/sb-plugin-load.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/sb-tab-widget/inc/sb-plugin-install.php:14
    • > PHP Warning
      Use of undefined constant SB_TAB_WIDGET_INC_PATH - assumed 'SB_TAB_WIDGET_INC_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/sb-tab-widget/inc/sb-plugin-load.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% 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:
  • Screenshots: These screenshots do not have images: #1 (SB Tab widget on widget area.), #2 (SB Tab widget displays on website.), #3 (The option page to manage sidebar.)
The official readme.txt might help

sb-tab-widget/sb-tab-widget.php Passed 13 tests

The entry point to "SB Tab Widget" version 1.0.6 is a PHP file that has certain tags in its header comment area
66 characters long description:
SB Tab Widget is a plugin that allows to display widget on tabber.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin397 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP83212249
CSS417092
JavaScript44256

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png16.84KB8.51KB▼ 49.45%
screenshot-2.png3.47KB2.15KB▼ 38.15%
screenshot-3.png21.74KB10.60KB▼ 51.24%