63% random-numbers-builder

Code Review | Random numbers - WordPress Random numbers builder plugin

WordPress plugin Random numbers - WordPress Random numbers builder plugin scored63%from 54 tests.

About plugin

  • Plugin page: random-numbers-bu...
  • Plugin version: 1.1.6
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.6
  • WordPress version: 6.3.1
  • First release: Mar 5, 2020
  • Latest release: Jan 1, 2021
  • Number of updates: 41
  • Update frequency: every 7.4 days
  • Top authors: adamskaat (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /4,436 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.19MB] [CPU: ▼43.02ms] Passed 4 tests

Analyzing server-side resources used by Random numbers - WordPress Random numbers builder plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.78 ▼0.6815.35 ▼29.86
Dashboard /wp-admin2.83 ▼0.4817.50 ▼38.12
Posts /wp-admin/edit.php2.83 ▼0.5319.11 ▼28.88
Add New Post /wp-admin/post-new.php2.83 ▼3.0620.81 ▼75.23
Media Library /wp-admin/upload.php2.83 ▼0.4014.13 ▼23.16
Support /wp-admin/edit.php?post_type=yrnnumbers&page=yrn-support-page3.1029.84
More Ideas? /wp-admin/edit.php?post_type=yrnnumbers&page=yrn-ideas-page3.1029.75
All Items /wp-admin/edit.php?post_type=yrnnumbers3.2326.49
Add New /wp-admin/post-new.php?post_type=yrnnumbers3.2736.60

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 65 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
yrn_redirect
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Random numbers - WordPress Random numbers builder plugin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,851 ▲9014.27 ▲0.041.79 ▼0.3350.51 ▲3.36
Dashboard /wp-admin2,266 ▲865.65 ▼0.0292.01 ▲1.0760.54 ▲17.85
Posts /wp-admin/edit.php2,179 ▲792.04 ▲0.0941.06 ▲1.9050.32 ▲16.28
Add New Post /wp-admin/post-new.php6,226 ▲4,70019.37 ▼4.38874.39 ▲164.3158.99 ▲8.38
Media Library /wp-admin/upload.php1,465 ▲654.26 ▲0.08105.29 ▲0.8657.08 ▲6.47
Support /wp-admin/edit.php?post_type=yrnnumbers&page=yrn-support-page8271.7125.7723.90
More Ideas? /wp-admin/edit.php?post_type=yrnnumbers&page=yrn-ideas-page8271.7425.3326.74
All Items /wp-admin/edit.php?post_type=yrnnumbers1,1292.0137.4132.32
Add New /wp-admin/post-new.php?post_type=yrnnumbers2,9483.2469.4248.84

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/random-numbers-builder/classes/RegisterPostType.php+48
    Undefined index: post_type
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=yrnnumbers
    • > Notice in wp-content/plugins/random-numbers-builder/assets/views/metaboxes/shortcode.php+2
    Undefined index: post
    • > GET request to /wp-admin/edit.php?post_type=yrnnumbers
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/random-numbers-builder/classes/RegisterPostType.php+48
    Undefined index: post_type
    • > GET request to /wp-admin/post-new.php?post_type=yrnnumbers
    • > Notice in wp-content/plugins/random-numbers-builder/assets/views/hiddenOptions.php+4
    Undefined index: yrn-type

SRP 0% 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 take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/random-numbers-builder/assets/views/metaboxes/support.php
  • 25× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/random-numbers-builder/config/config.php:12
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/random-numbers-builder/config/config-platinum.php:2
    • > PHP Warning
      Use of undefined constant YRN_FILE_NAME - assumed 'YRN_FILE_NAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/random-numbers-builder/config/config.php on line 11
    • > PHP Warning
      Use of undefined constant YRN_FILE_NAME - assumed 'YRN_FILE_NAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/random-numbers-builder/config/config.php on line 11
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/random-numbers-builder/config/config-gold.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'yrn\umbers' not found in wp-content/plugins/random-numbers-builder/classes/types/TextNumbers.php:4
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/random-numbers-builder/config/config-free.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function yrn\\register_activation_hook() in wp-content/plugins/random-numbers-builder/RandomNumbersInit.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'yrn\\AdminHelper' not found in wp-content/plugins/random-numbers-builder/assets/views/options.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/random-numbers-builder/assets/views/metaboxes/shortcode.php:5

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

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
3 plugin tags: random, numbers, random numbers

random-numbers-builder/random-numbers-builder.php Passed 13 tests

This is the main PHP file of "Random numbers - WordPress Random numbers builder plugin" version 1.1.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
35 characters long description:
Random numbers customizable plugin.

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
There were no executable files found in this plugin13,934 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
CSS528166,983
JavaScript71,2073144,969
PHP404601991,982

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity8.96
▷ Minimum class complexity1.00
▷ Maximum class complexity61.00
Average method complexity2.04
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes24
▷ Abstract classes28.33%
▷ Concrete classes2291.67%
▷ Final classes00.00%
Methods186
▷ Static methods4323.12%
▷ Public methods16588.71%
▷ Protected methods10.54%
▷ Private methods2010.75%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants5
▷ Global constants5100.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 are no PNG files in this plugin