84% random-content

Code Review | Random Content

WordPress plugin Random Content scored 84% from 54 tests.

About plugin

  • Plugin page: random-content
  • Plugin version: 1.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-6.2.1
  • WordPress version: 6.3.1
  • First release: Oct 19, 2012
  • Latest release: May 17, 2023
  • Number of updates: 29
  • Update frequency: every 133.2 days
  • Top authors: endocreative (100%)

Code review

54 tests

User reviews

31 reviews

Install metrics

4,000+ active / 41,014 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

Server-side resources used by Random Content
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0937.00 ▼4.41
Dashboard /wp-admin3.39 ▲0.0847.70 ▼0.00
Posts /wp-admin/edit.php3.50 ▲0.1448.79 ▼3.75
Add New Post /wp-admin/post-new.php6.06 ▲0.1789.17 ▼17.36
Media Library /wp-admin/upload.php3.31 ▲0.0834.15 ▼0.75
Groups /wp-admin/edit-tags.php?taxonomy=endo_wrc_group&post_type=endo_wrc_cpt3.3133.85
Add New /wp-admin/post-new.php?post_type=endo_wrc_cpt6.0584.88
Random Content /wp-admin/edit.php?post_type=endo_wrc_cpt3.3536.59

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Random Content
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲9914.74 ▲0.381.68 ▲0.0637.56 ▼12.64
Dashboard /wp-admin2,237 ▲524.85 ▼0.25113.88 ▲1.0841.47 ▼3.57
Posts /wp-admin/edit.php2,123 ▲342.05 ▲0.0136.63 ▼4.5134.83 ▼3.95
Add New Post /wp-admin/post-new.php1,540 ▲417.45 ▼5.93687.94 ▲21.2559.95 ▲1.08
Media Library /wp-admin/upload.php1,422 ▲314.23 ▲0.0396.64 ▼8.8042.23 ▼0.27
Groups /wp-admin/edit-tags.php?taxonomy=endo_wrc_group&post_type=endo_wrc_cpt1,2982.1428.2827.79
Add New /wp-admin/post-new.php?post_type=endo_wrc_cpt6,42722.90848.4128.96
Random Content /wp-admin/edit.php?post_type=endo_wrc_cpt1,0921.9531.3432.64

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_endo_wrc_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

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
Even though no errors were found, this is by no means 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
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/random-content/class-random-content-widget.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
Attributes that require attention: You can take inspiration from this readme.txt

random-content/random-content.php Passed 13 tests

The primary PHP file in "Random Content" version 1.4.1 is used by WordPress to initiate all plugin functionality
50 characters long description:
Randomly display any content anywhere on your site

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected278 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP39193278

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity8.50
▷ Minimum class complexity8.00
▷ Maximum class complexity9.00
Average method complexity2.07
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png12.36KB4.77KB▼ 61.40%