79% random

Code Review | Random

WordPress plugin Random scored79%from 54 tests.

About plugin

  • Plugin page: random
  • Plugin version: 1.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Mar 10, 2021
  • Latest release: Oct 18, 2023
  • Number of updates: 15
  • Update frequency: every 63.5 days
  • Top authors: scribit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

700+ active /4,072 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼7.41ms] Passed 4 tests

Analyzing server-side resources used by Random
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0837.29 ▲0.66
Dashboard /wp-admin3.43 ▲0.0949.28 ▼20.51
Posts /wp-admin/edit.php3.55 ▲0.1948.50 ▲2.07
Add New Post /wp-admin/post-new.php6.02 ▲0.1385.65 ▼11.62
Media Library /wp-admin/upload.php3.36 ▲0.1337.78 ▲1.84
Random /wp-admin/tools.php?page=random3.3332.33

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 30 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Random
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲5114.38 ▲0.021.83 ▲0.0941.63 ▲1.43
Dashboard /wp-admin2,196 ▲165.63 ▲0.0686.49 ▼5.7333.37 ▼5.77
Posts /wp-admin/edit.php2,095 ▼51.95 ▼0.0734.08 ▼0.3228.82 ▼7.84
Add New Post /wp-admin/post-new.php1,523 ▼1323.77 ▲0.83612.38 ▼37.0052.07 ▼1.60
Media Library /wp-admin/upload.php1,401 ▲44.19 ▼0.0497.96 ▼1.7839.32 ▼5.24
Random /wp-admin/tools.php?page=random1,0001.6626.5837.99

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/random/public/partials/random-public-display.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/random/admin/partials/random-admin-display.php:13

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)
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
8 plugin tags: casual, random, random post, shortcode, custom types...

random/random.php Passed 13 tests

The main PHP script in "Random" version 1.2 is automatically included on every request by WordPress
113 characters long description:
Random, a plugin designed to insert random contents, coming from pages, posts and other types, into your website.

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
Good job! No executable or dangerous file extensions detected1,089 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP14153552671
CSS23717238
PO File14754132
JavaScript2123048

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity4.14
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity1.54
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods29
▷ Static methods26.90%
▷ Public methods2379.31%
▷ Protected methods00.00%
▷ Private methods620.69%
Functions18
▷ Named functions1055.56%
▷ Anonymous functions844.44%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/shortcodes-finder.png1.63KB1.46KB▼ 10.93%
admin/images/logo_scribit.png1.98KB1.98KB0.34%
admin/images/logo.png18.87KB7.26KB▼ 61.51%
admin/images/proofreading.png2.73KB2.03KB▼ 25.63%