84% advanced-random-posts-widget

Code Review | Advanced Random Posts Widget

WordPress plugin Advanced Random Posts Widget scored 84% from 54 tests.

About plugin

  • Plugin page: advanced-random-p...
  • Plugin version: 2.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.1
  • WordPress version: 5.9.2
  • First release: Feb 11, 2013
  • Latest release: Mar 7, 2019
  • Number of updates: 45
  • Update frequency: every 49.2 days
  • Top authors: satrya (100%)

Code review

54 tests

User reviews

37 reviews

Install metrics

20,000+ active / 181,275 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼306.16ms] Passed 4 tests

Server-side resources used by Advanced Random Posts Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.1754.41 ▲5.55
Dashboard /wp-admin3.52 ▲0.1137.45 ▼1.71
Posts /wp-admin/edit.php3.74 ▲0.1036.61 ▼6.92
Add New Post /wp-admin/post-new.php6.99 ▲0.0192.88 ▼1,216.91
Media Library /wp-admin/upload.php3.39 ▲0.1026.74 ▲0.91

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 13 new files
Database: no new tables, 1 new option
New WordPress options
widget_arpw-widget

Browser metrics Passed 4 tests

A check of browser resources used by Advanced Random Posts Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,772 ▲1815.97 ▲0.046.95 ▲0.902.13 ▼0.07
Dashboard /wp-admin2,873 ▲126.01 ▼0.16119.47 ▼24.51155.24 ▼121.32
Posts /wp-admin/edit.php2,689 ▼53.25 ▲0.0264.56 ▼0.58141.10 ▼9.11
Add New Post /wp-admin/post-new.php1,754 ▲9320.95 ▲4.89432.69 ▲10.63160.16 ▼0.95
Media Library /wp-admin/upload.php1,700 ▲55.56 ▲0.12145.91 ▲7.75187.55 ▼1.49

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 1 option
    • widget_arpw-widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/advanced-random-posts-widget/includes/widget.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-random-posts-widget/includes/functions.php:92
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/advanced-random-posts-widget/includes/shortcode.php:23

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

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
You can look at the official readme.txt

advanced-random-posts-widget/arpw.php 92% from 13 tests

Analyzing the main PHP file in "Advanced Random Posts Widget" version 2.2.0
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("advanced-random-posts-widget.php" instead of "arpw.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected789 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP7216263628
CSS221090
JavaScript1212271

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity15.33
▷ Minimum class complexity1.00
▷ Maximum class complexity31.00
Average method complexity3.39
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods18
▷ Static methods15.56%
▷ Public methods1688.89%
▷ Protected methods00.00%
▷ Private methods211.11%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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 were not PNG files found in your plugin