89% random-numbers-generator

Code Review | Random Numbers Generator

WordPress plugin Random Numbers Generatorscored89%from 54 tests.

About plugin

  • Plugin page: random-numbers-ge...
  • Plugin version: 1.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.3.2
  • WordPress version: 6.3.1
  • First release: Jan 8, 2020
  • Latest release: Jan 8, 2020
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: codecide (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /1,642 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼5.99ms] Passed 4 tests

An overview of server-side resources used by Random Numbers Generator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.71 ▼2.14
Dashboard /wp-admin3.31 ▼0.0450.32 ▼17.75
Posts /wp-admin/edit.php3.36 ▲0.0053.72 ▲3.82
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.33 ▼7.09
Media Library /wp-admin/upload.php3.23 ▲0.0038.30 ▲3.04

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Random Numbers Generator
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.28 ▼0.311.71 ▼0.2943.50 ▲0.52
Dashboard /wp-admin2,195 ▲305.67 ▼0.0493.14 ▼7.0037.72 ▼9.64
Posts /wp-admin/edit.php2,100 ▼32.01 ▼0.0438.64 ▲3.2336.39 ▲2.40
Add New Post /wp-admin/post-new.php1,560 ▲2918.25 ▼4.84714.63 ▲104.2773.82 ▲16.30
Media Library /wp-admin/upload.php1,394 ▼64.22 ▲0.0197.42 ▼1.2741.02 ▼4.31

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === Random Numbers Generator=== )
Please take inspiration from this readme.txt

random-numbers-generator/randomnumbers_generator.php 92% from 13 tests

The main PHP file in "Random Numbers Generator" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("random-numbers-generator.php" instead of "randomnumbers_generator.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin152 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP22239152
CSS1010
JavaScript1010

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity21.00
▷ Minimum class complexity21.00
▷ Maximum class complexity21.00
Average method complexity2.11
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods1161.11%
▷ Protected methods633.33%
▷ Private methods15.56%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There were not PNG files found in your plugin