84% wp-random-post-inside

Code Review | WP Random Post Inside

WordPress plugin WP Random Post Inside scored84%from 54 tests.

About plugin

  • Plugin page: wp-random-post-in...
  • Plugin version: 1.6.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Jan 5, 2016
  • Latest release: Apr 10, 2023
  • Number of updates: 47
  • Update frequency: every 56.5 days
  • Top authors: a.r.bhuyan (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

500+ active /8,675 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.14MB] [CPU: ▼3.11ms] Passed 4 tests

Analyzing server-side resources used by WP Random Post Inside
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1548.34 ▼1.42
Dashboard /wp-admin3.43 ▲0.1346.66 ▼1.98
Posts /wp-admin/edit.php3.54 ▲0.1949.28 ▲3.13
Add New Post /wp-admin/post-new.php6.03 ▲0.1583.40 ▼11.36
Media Library /wp-admin/upload.php3.35 ▲0.1336.67 ▲2.34
Wp random post inside Settings /wp-admin/options-general.php?page=wprpi-settings3.3235.89

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 21 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
wprpi_notice_dismiss
can_compress_scripts
wprpi_version

Browser metrics Passed 4 tests

A check of browser resources used by WP Random Post Inside
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲10213.91 ▼0.461.51 ▼0.2641.56 ▼2.83
Dashboard /wp-admin2,251 ▲635.25 ▼0.61117.68 ▲17.8443.28 ▼0.41
Posts /wp-admin/edit.php2,121 ▲352.34 ▲0.3237.28 ▼0.6331.53 ▼0.75
Add New Post /wp-admin/post-new.php1,544 ▲1118.42 ▼4.73623.38 ▼126.3133.80 ▼17.35
Media Library /wp-admin/upload.php1,418 ▲304.56 ▲0.37102.69 ▲0.6746.10 ▲1.31
Wp random post inside Settings /wp-admin/options-general.php?page=wprpi-settings1,5352.6955.9634.07

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • wprpi_version
    • widget_recent-comments
    • wprpi_notice_dismiss
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

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 fix the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-random-post-inside/wprpi_functions.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-random-post-inside/wprpi_settings.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: random posts inside, wordpress posts, related posts inside, wordpress random posts, wp related posts...

wp-random-post-inside/index.php 92% from 13 tests

The entry point to "WP Random Post Inside" version 1.6.6 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: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-random-post-inside.php" instead of "index.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
There were no executable files found in this plugin914 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP4128109552
PO File2548169
CSS139146
JavaScript36547

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
4 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png41.90KB22.14KB▼ 47.15%
screenshot.png20.45KB13.67KB▼ 33.13%
images/wprpi_faq.png9.61KB4.27KB▼ 55.61%
images/wprpi_logo.png4.03KB1.62KB▼ 59.84%