84% four-nodes-random-post

Code Review | FourNodes Random Post

WordPress plugin FourNodes Random Post scored84%from 54 tests.

About plugin

  • Plugin page: four-nodes-random...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Apr 13, 2018
  • Latest release: Apr 14, 2018
  • Number of updates: 3
  • Update frequency: every 1.3 days
  • Top authors: fournodes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /563 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼8.29ms] Passed 4 tests

An overview of server-side resources used by FourNodes Random Post
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.92 ▲0.83
Dashboard /wp-admin3.33 ▼0.0145.60 ▼18.02
Posts /wp-admin/edit.php3.39 ▲0.0342.61 ▼2.60
Add New Post /wp-admin/post-new.php5.92 ▲0.0390.48 ▼9.67
Media Library /wp-admin/upload.php3.26 ▲0.0334.93 ▼2.87

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

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

Browser metrics Passed 4 tests

Checking browser requirements for FourNodes Random Post
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.74 ▲0.441.89 ▼0.0344.18 ▲0.54
Dashboard /wp-admin2,209 ▲214.84 ▼1.07105.97 ▲0.7841.82 ▼4.52
Posts /wp-admin/edit.php2,089 ▼02.13 ▲0.1334.01 ▼1.7433.80 ▼1.51
Add New Post /wp-admin/post-new.php1,542 ▲918.31 ▼4.91613.17 ▲16.5856.45 ▲2.67
Media Library /wp-admin/upload.php1,388 ▲34.23 ▲0.0399.01 ▼3.4745.08 ▲3.29

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_randompostplugin_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/four-nodes-random-post/index.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Requires at least: Invalid plugin version format
Please take inspiration from this readme.txt

four-nodes-random-post/index.php 92% from 13 tests

The principal PHP file in "FourNodes Random Post" v. 1.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("four-nodes-random-post.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin121 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP15515121

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity4.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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin