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.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.1
  • WordPress version: 6.3.1
  • First release: Feb 11, 2013
  • Latest release: Aug 5, 2023
  • Number of updates: 49
  • Update frequency: every 78.1 days
  • Top authors: satrya (100%)

Code review

54 tests

User reviews

39 reviews

Install metrics

20,000+ active / 201,251 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼0.92ms] Passed 4 tests

This is a short check of server-side resources used by Advanced Random Posts Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1037.30 ▼4.87
Dashboard /wp-admin3.40 ▲0.1045.70 ▼1.73
Posts /wp-admin/edit.php3.52 ▲0.1646.32 ▲1.45
Add New Post /wp-admin/post-new.php6.00 ▲0.1292.63 ▲1.45
Media Library /wp-admin/upload.php3.33 ▲0.1038.11 ▲3.23

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Random Posts Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲6713.68 ▼0.701.63 ▼0.2741.30 ▼6.13
Dashboard /wp-admin2,205 ▲165.83 ▼0.0997.73 ▼12.5542.58 ▼2.21
Posts /wp-admin/edit.php2,094 ▲52.06 ▲0.0639.65 ▼3.3140.42 ▲7.25
Add New Post /wp-admin/post-new.php1,540 ▼218.14 ▼0.05652.16 ▲8.8462.24 ▲12.65
Media Library /wp-admin/upload.php1,390 ▲24.28 ▲0.09100.80 ▲0.7242.40 ▼3.19

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
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_arpw-widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/advanced-random-posts-widget/includes/shortcode.php:23
    • > 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: Class 'WP_Widget' not found in wp-content/plugins/advanced-random-posts-widget/includes/widget.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test


Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
Please take inspiration from this readme.txt

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

The main PHP file in "Advanced Random Posts Widget" ver. 2.2.1 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as 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 check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin789 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
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
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
▷ Static methods15.56%
▷ Public methods1688.89%
▷ Protected methods00.00%
▷ Private methods211.11%
▷ Named functions8100.00%
▷ Anonymous functions00.00%
▷ Global constants4100.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
PNG images were not found in this plugin