84% randpost-random-post-widget

Code Review | RandPost widget

WordPress plugin RandPost widget scored84%from 54 tests.

About plugin

  • Plugin page: randpost-random-p...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.7.1
  • WordPress version: 6.3.1
  • First release: Nov 26, 2013
  • Latest release: Nov 28, 2013
  • Number of updates: 4
  • Update frequency: every 0.8 days
  • Top authors: dev.Fishy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /701 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

This is a short check of server-side resources used by RandPost widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0035.79 ▼7.96
Dashboard /wp-admin3.31 ▲0.0044.29 ▼3.34
Posts /wp-admin/edit.php3.36 ▲0.0045.28 ▼0.72
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.25 ▼13.63
Media Library /wp-admin/upload.php3.23 ▲0.0033.58 ▼0.52

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for RandPost widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,915 ▲16913.25 ▼1.191.73 ▼0.1143.18 ▼3.96
Dashboard /wp-admin2,236 ▲485.80 ▼0.01109.98 ▼6.5643.38 ▲1.08
Posts /wp-admin/edit.php2,129 ▲432.00 ▼0.0040.40 ▲3.3138.29 ▲2.33
Add New Post /wp-admin/post-new.php1,545 ▲224.72 ▲6.20503.62 ▼131.4634.71 ▼18.54
Media Library /wp-admin/upload.php1,418 ▲304.20 ▲0.0399.09 ▼8.5340.95 ▼3.44

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/randpost-random-post-widget/rand-post-widget.class.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (2.), #3 ()
Please take inspiration from this readme.txt

randpost-random-post-widget/rand-post-widget.class.php 92% from 13 tests

The entry point to "RandPost widget" version 1.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("randpost-random-post-widget.php" instead of "rand-post-widget.class.php")

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

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.00
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png3.78KB1.87KB▼ 50.68%
screenshot-3.png3.24KB1.61KB▼ 50.27%
screenshot-1.png6.28KB4.09KB▼ 34.84%