94% simple-random-posts-shortcode

Code Review | Simple Random Posts Shortcode

WordPress plugin Simple Random Posts Shortcode scored 94% from 53 tests.

About plugin

  • Plugin page: simple-random-pos...
  • Plugin version: 0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.1.0
  • WordPress version: 5.8.1
  • First release: Jan 6, 2015
  • Latest release: Jan 6, 2015
  • Number of updates: 8
  • Update frequency: every 20.1 days
  • Top authors: mkerstner (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 736 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼271.06ms] Passed 4 tests

Analyzing server-side resources used by Simple Random Posts Shortcode
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1335.17 ▲13.11
Dashboard /wp-admin3.07 ▲0.0239.23 ▼5.14
Posts /wp-admin/edit.php3.12 ▲0.0242.74 ▼3.61
Add New Post /wp-admin/post-new.php5.43 ▲0.0085.61 ▼1,070.98
Media Library /wp-admin/upload.php3.01 ▲0.0132.34 ▼4.51

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Simple Random Posts Shortcode
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,650 ▲4415.79 ▲0.207.61 ▼2.8349.77 ▲6.17
Dashboard /wp-admin2,931 ▲815.97 ▼0.08133.41 ▼11.74101.25 ▲0.59
Posts /wp-admin/edit.php2,706 ▼02.69 ▲0.0268.16 ▲1.1590.50 ▼0.48
Add New Post /wp-admin/post-new.php1,851 ▲19818.79 ▲0.18385.15 ▲20.91113.65 ▲5.41
Media Library /wp-admin/upload.php1,772 ▼05.01 ▼0.00148.39 ▼11.02107.49 ▼4.52

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled successfully, without leaving any zombie files or tables

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
Everything seems fine, however this is by no means 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
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/simple-random-posts-shortcode/simple-random-posts-shortcode.php

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

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: posts, random, shortcode, simple

simple-random-posts-shortcode/simple-random-posts-shortcode.php Passed 13 tests

The main file in "Simple Random Posts Shortcode" v. 0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
82 characters long description:
A simple plugin for rendering random post previews in a list view using shortcode.

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
Success! There were no dangerous files found in this plugin88 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1173388

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin