10% random-posts-widget-configurable

Code Review | Random Posts Widget Configurable

WordPress plugin Random Posts Widget Configurable scored10%from 54 tests.

About plugin

  • Plugin page: random-posts-widg...
  • Plugin version: 1.19
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.5.1
  • WordPress version: 6.3.1
  • First release: Nov 20, 2012
  • Latest release: May 17, 2013
  • Number of updates: 32
  • Update frequency: every 5.6 days
  • Top authors: tlorders (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

20+ active /5,483 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/random-posts-widget-configurable/random-posts-widget-configurable.php+14
    Methods with the same name as their class will not be constructors in a future version of PHP; RandomPostsWidgetConfigurable has a deprecated constructor

Server metrics [RAM: ▼1.94MB] [CPU: ▼56.50ms] Passed 4 tests

A check of server-side resources used by Random Posts Widget Configurable
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.404.52 ▼31.91
Dashboard /wp-admin2.08 ▼1.265.66 ▼53.37
Posts /wp-admin/edit.php2.08 ▼1.276.43 ▼42.49
Add New Post /wp-admin/post-new.php2.08 ▼3.815.16 ▼98.24
Media Library /wp-admin/upload.php2.08 ▼1.155.38 ▼26.74

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 7 new options
New WordPress options
widget_randompostswidgetconfigurable
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Random Posts Widget Configurable
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.29 ▼0.101.73 ▲0.0943.84 ▲2.57
Dashboard /wp-admin2,195 ▲155.57 ▼0.0887.79 ▲0.2641.67 ▼1.96
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0233.56 ▼3.4340.01 ▲3.78
Add New Post /wp-admin/post-new.php1,526 ▼223.66 ▲0.42577.13 ▼109.5252.83 ▲1.01
Media Library /wp-admin/upload.php1,400 ▼34.27 ▲0.05106.46 ▲6.6544.55 ▼0.62

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/random-posts-widget-configurable/random-posts-widget-configurable.php+14
    Methods with the same name as their class will not be constructors in a future version of PHP; RandomPostsWidgetConfigurable has a deprecated constructor
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_randompostswidgetconfigurable
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • 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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just 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/random-posts-widget-configurable/random-posts-widget-configurable.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: Screenshot #1 (2.) image required
  • Donate link: Please fix this invalid url: ""
You can take inspiration from this readme.txt

random-posts-widget-configurable/random-posts-widget-configurable.php Passed 13 tests

The main PHP script in "Random Posts Widget Configurable" version 1.19 is automatically included on every request by WordPress
34 characters long description:
Widget which displays random posts

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 detected57 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP123857

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity3.50
▷ Minimum class complexity3.00
▷ Maximum class complexity4.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected