10% random-post-loader

Code Review | Random Post Loader

WordPress plugin Random Post Loader scored10%from 54 tests.

About plugin

  • Plugin page: random-post-loader
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.0
  • WordPress version: 6.3.1
  • First release: Sep 10, 2014
  • Latest release: Sep 10, 2014
  • Number of updates: 10
  • Update frequency: N/A
  • Top authors: farsad (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,306 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/random-post-loader/random.php+9
    Methods with the same name as their class will not be constructors in a future version of PHP; crand has a deprecated constructor

Server metrics [RAM: ▼1.91MB] [CPU: ▼53.11ms] Passed 4 tests

Server-side resources used by Random Post Loader
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.394.85 ▼38.48
Dashboard /wp-admin2.09 ▼1.215.38 ▼44.96
Posts /wp-admin/edit.php2.09 ▼1.266.44 ▼40.20
Add New Post /wp-admin/post-new.php2.09 ▼3.795.85 ▼88.79
Media Library /wp-admin/upload.php2.09 ▼1.146.96 ▼26.72

Server storage [IO: ▲0.00MB] [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, 7 new options
New WordPress options
widget_recent-posts
widget_crand
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Random Post Loader: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.29 ▼1.061.68 ▼0.3637.88 ▼9.06
Dashboard /wp-admin2,203 ▲155.80 ▲0.9199.29 ▼17.4537.44 ▼5.12
Posts /wp-admin/edit.php2,092 ▲32.00 ▼0.1336.99 ▲0.5934.36 ▼1.88
Add New Post /wp-admin/post-new.php1,536 ▲2223.09 ▲5.40665.52 ▼15.1154.85 ▼4.36
Media Library /wp-admin/upload.php1,388 ▼04.14 ▼0.11112.00 ▲0.8347.39 ▼1.91

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/random-post-loader/random.php+9
    Methods with the same name as their class will not be constructors in a future version of PHP; crand has a deprecated constructor
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_crand

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
Please fix 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/random-post-loader/random.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (`/assets/screenshot-1.png` - Admin panel), #2 (`/assets/screenshot-2.png` - Front-End Image)
  • Plugin Name: You should set the name of your plugin on the first line ( === random-post-loader === )
You can look at the official readme.txt

random-post-loader/random.php 92% from 13 tests

Analyzing the main PHP file in "Random Post Loader" version 1.1
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("random-post-loader.php" instead of "random.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
No dangerous file extensions were detected107 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP107107

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity4.25
▷ Minimum method complexity1.00
▷ Maximum method complexity6.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%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin