78% randomize

Code Review | Randomize

WordPress plugin Randomize scored78%from 54 tests.

About plugin

  • Plugin page: randomize
  • Plugin version: 1.4.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.7
  • WordPress version: 6.3.1
  • First release: Jun 2, 2014
  • Latest release: Mar 18, 2021
  • Number of updates: 44
  • Update frequency: every 56.4 days
  • Top authors: se-schwarz (97.73%)sirjavik (4.55%)

Code review

54 tests

User reviews

8 reviews

Install metrics

7,000+ active /26,538 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
Install script ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼3.41ms] Passed 4 tests

Server-side resources used by Randomize
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0444.76 ▲4.98
Dashboard /wp-admin3.39 ▲0.0947.28 ▼7.88
Posts /wp-admin/edit.php3.51 ▲0.1546.11 ▼2.52
Add New Post /wp-admin/post-new.php5.98 ▲0.0995.68 ▼1.08
Media Library /wp-admin/upload.php3.32 ▲0.0937.57 ▼2.15
Randomize /wp-admin/options-general.php?page=randomize3.2633.84

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 5 new files
Database: 1 new table, 7 new options
New tables
wp_randomize
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_randomize

Browser metrics Passed 4 tests

A check of browser resources used by Randomize
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.35 ▼0.171.75 ▲0.0143.33 ▼2.05
Dashboard /wp-admin2,199 ▲225.67 ▲0.1089.43 ▼3.3939.52 ▼0.31
Posts /wp-admin/edit.php2,104 ▲42.03 ▼0.0035.89 ▼3.8734.69 ▼3.95
Add New Post /wp-admin/post-new.php1,540 ▲1218.50 ▼4.90640.84 ▼43.6268.76 ▲16.51
Media Library /wp-admin/upload.php1,404 ▲44.18 ▼0.0198.19 ▼11.5544.36 ▼4.23
Randomize /wp-admin/options-general.php?page=randomize8872.0326.0425.45

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
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_randomize
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=randomize
    • > Notice in wp-content/plugins/randomize/randomize.php+155
    Undefined variable: result

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/randomize/randomize.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/randomize/randomize_admin.php:3

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 on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
Please take inspiration from this readme.txt

randomize/randomize.php Passed 13 tests

The main PHP script in "Randomize" version 1.4.3 is automatically included on every request by WordPress
104 characters long description:
Display randomized text in a widget or on posts/pages by shortcode. Originally scripted by Greg Jackson.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin380 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP37537380

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.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
There are no PNG files in this plugin