94% a-random-number

Code Review | A Random Number

WordPress plugin A Random Number scored 94% from 54 tests.

About plugin

  • Plugin page: a-random-number
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2
  • WordPress version: 5.9.2
  • First release: Jan 12, 2016
  • Latest release: May 22, 2019
  • Number of updates: 7
  • Update frequency: every 175.6 days
  • Top authors: macardam (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active / 6,823 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼0.02MB] [CPU: ▼292.56ms] Passed 4 tests

A check of server-side resources used by A Random Number
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0151.12 ▼0.50
Dashboard /wp-admin3.41 ▲0.0033.33 ▲0.05
Posts /wp-admin/edit.php3.65 ▲0.0135.58 ▼1.79
Add New Post /wp-admin/post-new.php6.88 ▼0.0992.76 ▼1,167.98
Media Library /wp-admin/upload.php3.29 ▲0.0026.48 ▲0.44

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 3 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by A Random Number
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,802 ▲4815.85 ▼0.096.26 ▼0.552.83 ▼0.06
Dashboard /wp-admin2,895 ▲346.13 ▼0.03119.25 ▼18.46160.59 ▼1.39
Posts /wp-admin/edit.php2,691 ▼33.24 ▲0.0063.53 ▲0.67136.48 ▼8.85
Add New Post /wp-admin/post-new.php1,720 ▼5321.69 ▼0.44439.43 ▼9.71154.21 ▼3.69
Media Library /wp-admin/upload.php1,698 ▼05.46 ▼0.04139.20 ▼10.85189.94 ▲2.31

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
This plugin's uninstaller ran successfully

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
Good news, no errors were detected

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 items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/a-random-number/a-random-number.php:31

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

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === a-random-number === )
The official readme.txt is a good inspiration

a-random-number/a-random-number.php Passed 13 tests

"A Random Number" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
51 characters long description:
Outputs a random number via shortcode. It's magic.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin84 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1111649
JavaScript10035

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
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%
Functions5
▷ Named functions5100.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