84% single-post-widget

Code Review | Single Post Widget

WordPress plugin Single Post Widget scored84%from 54 tests.

About plugin

  • Plugin page: single-post-widget
  • Plugin version: 0.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-3.5
  • WordPress version: 6.3.1
  • First release: Oct 5, 2011
  • Latest release: Feb 2, 2013
  • Number of updates: 13
  • Update frequency: every 37.5 days
  • Top authors: miyauchi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /6,648 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.95ms] Passed 4 tests

This is a short check of server-side resources used by Single Post Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.33 ▼1.16
Dashboard /wp-admin3.34 ▼0.0047.97 ▼13.37
Posts /wp-admin/edit.php3.39 ▲0.0447.45 ▼7.23
Add New Post /wp-admin/post-new.php5.92 ▲0.0494.33 ▼2.04
Media Library /wp-admin/upload.php3.27 ▲0.0440.21 ▼0.84

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
widget_singlepostwidget
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Single Post Widget: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲3114.48 ▲0.131.93 ▼0.0947.96 ▲1.86
Dashboard /wp-admin2,215 ▲95.84 ▲0.9699.70 ▼11.3835.08 ▼10.79
Posts /wp-admin/edit.php2,103 ▲31.97 ▼0.0239.96 ▲3.0532.29 ▲0.06
Add New Post /wp-admin/post-new.php1,555 ▲2918.49 ▲0.77628.04 ▼79.6862.01 ▲6.17
Media Library /wp-admin/upload.php1,400 ▼34.24 ▲0.0496.06 ▼15.4641.58 ▼9.98

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

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

Smoke tests 75% 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)
Good news, no errors were detected

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
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/single-post-widget/single-post-widget.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 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
1 plugin tags: widget

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

"Single Post Widget" version 0.4.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
47 characters long description:
Display single post from url on sidebar widget.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected193 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP12312155
PO File161125
CSS23013

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity9.00
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity2.78
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods888.89%
▷ Protected methods00.00%
▷ Private methods111.11%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin