83% single-post-sidebar-widget

Code Review | Single Post Widget

WordPress plugin Single Post Widget scored83%from 54 tests.

About plugin

  • Plugin page: single-post-sideb...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-4.9.4
  • WordPress version: 6.3.1
  • First release: Feb 16, 2015
  • Latest release: Feb 28, 2018
  • Number of updates: 21
  • Update frequency: every 53.0 days
  • Top authors: LibraFire (100%)

Code review

54 tests

User reviews

1 review

Install metrics

500+ active /6,003 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.01MB] [CPU: ▼7.33ms] Passed 4 tests

Server-side resources used by Single Post Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0144.40 ▼2.79
Dashboard /wp-admin3.31 ▲0.0151.39 ▼3.50
Posts /wp-admin/edit.php3.37 ▲0.0152.24 ▼5.95
Add New Post /wp-admin/post-new.php5.90 ▲0.0192.54 ▼17.06
Media Library /wp-admin/upload.php3.24 ▲0.0139.13 ▲0.15

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_single_post_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Single Post Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲2814.15 ▼0.141.91 ▲0.0642.58 ▲4.44
Dashboard /wp-admin2,198 ▲185.65 ▼0.0182.16 ▼2.2941.00 ▼4.22
Posts /wp-admin/edit.php2,103 ▲31.98 ▼0.0042.25 ▲5.0242.12 ▲6.46
Add New Post /wp-admin/post-new.php1,526 ▼023.13 ▼0.03682.11 ▼10.6453.06 ▲3.85
Media Library /wp-admin/upload.php1,397 ▼34.23 ▲0.1097.28 ▼14.7042.93 ▼3.21

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_single_post_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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
Please fix the following items
  • 1× 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/single-post-sidebar-widget/single-post-widget.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
2 plugin tags: single post, widget

single-post-sidebar-widget/single-post-widget.php 77% from 13 tests

The principal PHP file in "Single Post Widget" v. 1.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("single-post-sidebar-widget.php" instead of "single-post-widget.php")
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("Optional. Plugin's relative directory path to .mo files. Example: /locale/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected117 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP13726117

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity19.00
▷ Minimum class complexity19.00
▷ Maximum class complexity19.00
Average method complexity5.50
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot.png10.98KB6.09KB▼ 44.49%