94% random-images

Code Review | Random Images

WordPress plugin Random Images scored 94% from 54 tests.

About plugin

  • Plugin page: random-images
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-5.0
  • WordPress version: 5.8.1
  • First release: Jul 10, 2013
  • Latest release: Dec 2, 2018
  • Number of updates: 14
  • Update frequency: every 140.8 days
  • Top authors: designsimply (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

80+ active / 3,664 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼146.81ms] Passed 4 tests

A check of server-side resources used by Random Images
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1228.64 ▲2.04
Dashboard /wp-admin3.07 ▲0.0148.35 ▼8.28
Posts /wp-admin/edit.php3.12 ▲0.0147.47 ▼0.34
Add New Post /wp-admin/post-new.php5.43 ▼0.0191.66 ▼574.60
Media Library /wp-admin/upload.php3.01 ▲0.0131.91 ▼4.03

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Random Images
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8315.78 ▲0.308.81 ▼3.8651.38 ▼2.30
Dashboard /wp-admin2,970 ▲395.97 ▲0.01145.34 ▲3.65112.51 ▼2.41
Posts /wp-admin/edit.php2,739 ▼02.69 ▼0.0170.24 ▲4.7392.21 ▼5.38
Add New Post /wp-admin/post-new.php1,683 ▼018.85 ▲0.11401.80 ▲9.08118.75 ▲8.11
Media Library /wp-admin/upload.php1,733 ▼745.01 ▼0.02156.29 ▲6.38123.74 ▼1.79

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

Smoke tests 75% 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 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 items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/random-images/random-images.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: random images, images, shortcode

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

The entry point to "Random Images" version 1.0 is a PHP file that has certain tags in its header comment area
75 characters long description:
Display a set of random attached images with the [random_images] shortcode.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected47 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP181146
CSS1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods2100.00%
▷ Public methods2100.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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin