88% posts-in-sidebar

Code Review | Posts in Sidebar

WordPress plugin Posts in Sidebar scored 88% from 54 tests.

About plugin

  • Plugin page: posts-in-sidebar
  • Plugin version: 4.16.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.8
  • WordPress version: 5.9.2
  • First release: Sep 10, 2012
  • Latest release: Oct 31, 2021
  • Number of updates: 203
  • Update frequency: every 16.4 days
  • Top authors: aldolat (100%)

Code review

54 tests

User reviews

92 reviews

Install metrics

10,000+ active / 355,410 total downloads

Benchmarks

Plugin footprint Passed 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: ▲1.10MB] [CPU: ▼288.89ms] Passed 4 tests

An overview of server-side resources used by Posts in Sidebar
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.71 ▲1.1965.06 ▲8.58
Dashboard /wp-admin4.53 ▲1.1239.34 ▲3.11
Posts /wp-admin/edit.php4.77 ▲1.1243.94 ▲2.79
Add New Post /wp-admin/post-new.php8.00 ▲1.0396.80 ▼1,168.65
Media Library /wp-admin/upload.php4.42 ▲1.1232.39 ▲7.20

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 35 new files
Database: no new tables, 1 new option
New WordPress options
widget_pis_posts_in_sidebar

Browser metrics Passed 4 tests

Checking browser requirements for Posts in Sidebar
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,783 ▲6116.21 ▲0.085.88 ▲0.172.00 ▼0.05
Dashboard /wp-admin2,890 ▲296.11 ▼0.09136.91 ▼0.29194.24 ▲23.43
Posts /wp-admin/edit.php2,688 ▼63.24 ▲0.0168.25 ▲5.33134.48 ▼7.28
Add New Post /wp-admin/post-new.php1,717 ▲5621.34 ▲5.32440.03 ▼17.42198.77 ▼4.86
Media Library /wp-admin/upload.php1,694 ▼15.50 ▼0.04154.36 ▲13.89220.38 ▲12.70

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
  • 9× PHP files output text when accessed directly:
    • > /wp-content/plugins/posts-in-sidebar/includes/pis-core.php
    • > /wp-content/plugins/posts-in-sidebar/includes/pis-functions-general.php
    • > /wp-content/plugins/posts-in-sidebar/includes/pis-functions-tools.php
    • > /wp-content/plugins/posts-in-sidebar/includes/pis-functions-display.php
    • > /wp-content/plugins/posts-in-sidebar/includes/pis-functions-queries.php
    • > /wp-content/plugins/posts-in-sidebar/includes/class-pis-posts-in-sidebar.php
    • > /wp-content/plugins/posts-in-sidebar/includes/pis-widget-form-functions.php
    • > /wp-content/plugins/posts-in-sidebar/uninstall.php
    • > /wp-content/plugins/posts-in-sidebar/posts-in-sidebar.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function shortcode_exists() in wp-content/plugins/posts-in-sidebar/includes/pis-shortcode.php:22

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 Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: query, wp_query, post, widget, sidebar

posts-in-sidebar/posts-in-sidebar.php Passed 13 tests

Analyzing the main PHP file in "Posts in Sidebar" version 4.16.3
39 characters long description:
Publish a list of posts in your sidebar

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin10,575 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP131,3062,2277,469
PO File58522,6682,065
Markdown31610752
CSS1712179
JavaScript22237110

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 198)
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity210.00
▷ Minimum class complexity210.00
▷ Maximum class complexity210.00
Average method complexity53.25
▷ Minimum method complexity1.00
▷ Maximum method complexity198.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%
Functions75
▷ Named functions75100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected