84% sb-post-widget

Code Review | SB Post Widget

WordPress plugin SB Post Widget scored84%from 54 tests.

About plugin

  • Plugin page: sb-post-widget
  • Plugin version: 1.0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.1.1
  • WordPress version: 6.3.1
  • First release: Oct 6, 2014
  • Latest release: Apr 9, 2015
  • Number of updates: 16
  • Update frequency: every 11.6 days
  • Top authors: skylarkcob (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,447 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼7.85ms] Passed 4 tests

An overview of server-side resources used by SB Post Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.71 ▼9.94
Dashboard /wp-admin3.32 ▼0.0348.87 ▼12.06
Posts /wp-admin/edit.php3.37 ▲0.0154.42 ▲2.19
Add New Post /wp-admin/post-new.php5.90 ▲0.0191.75 ▼10.45
Media Library /wp-admin/upload.php3.24 ▲0.0137.70 ▲1.06

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

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

Browser metrics Passed 4 tests

A check of browser resources used by SB Post Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.26 ▼0.381.65 ▼0.1641.09 ▼10.59
Dashboard /wp-admin2,195 ▲245.65 ▲0.0692.55 ▼2.4844.67 ▲4.05
Posts /wp-admin/edit.php2,103 ▼01.98 ▼0.0042.49 ▲1.9535.80 ▼1.26
Add New Post /wp-admin/post-new.php1,535 ▼618.32 ▼4.71627.89 ▲43.4970.05 ▲13.47
Media Library /wp-admin/upload.php1,400 ▼04.21 ▲0.0196.95 ▼3.9542.80 ▼0.23

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sb-post-widget/inc/sb-plugin-hook.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/sb-post-widget/sb-post-widget.php:19
    • > PHP Fatal error
      require(): Failed opening required 'SB_POST_WIDGET_INC_PATH/sb-plugin-install.php' (include_path='.:/usr/share/php') in wp-content/plugins/sb-post-widget/inc/sb-plugin-load.php on line 2
    • > PHP Warning
      require(SB_POST_WIDGET_INC_PATH/sb-plugin-install.php): failed to open stream: No such file or directory in wp-content/plugins/sb-post-widget/inc/sb-plugin-load.php on line 2
    • > PHP Warning
      Use of undefined constant SB_POST_WIDGET_INC_PATH - assumed 'SB_POST_WIDGET_INC_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/sb-post-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-post-widget/inc/sb-plugin-install.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sb-post-widget/inc/sb-plugin-admin.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sb-post-widget/inc/class-sb-post-widget.php: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)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (SB Post widget on widget area.), #2 (Widget displays on website.)
Please take inspiration from this readme.txt

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

"SB Post Widget" version 1.0.9's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
70 characters long description:
SB Post Widget is a plugin that allows to show custom post on sidebar.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin1,305 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP92242451,047
PO File15454131
CSS215072
JavaScript24055

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity44.40
▷ Minimum class complexity4.00
▷ Maximum class complexity96.00
Average method complexity9.04
▷ Minimum method complexity1.00
▷ Maximum method complexity91.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods27
▷ Static methods518.52%
▷ Public methods2074.07%
▷ Protected methods27.41%
▷ Private methods518.52%
Functions19
▷ Named functions19100.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
2 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png16.94KB9.04KB▼ 46.63%
screenshot-2.png53.10KB16.66KB▼ 68.62%