10% randomtext

Code Review | Random Text

WordPress plugin Random Text scored 10% from 54 tests.

About plugin

  • Plugin page: randomtext
  • Plugin version: 0.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-3.5.1
  • WordPress version: 5.8.1
  • First release: Aug 11, 2009
  • Latest release: Aug 18, 2015
  • Number of updates: 34
  • Update frequency: every 64.6 days
  • Top authors: pantsonhead (100%)

Code review

54 tests

User reviews

19 reviews

Install metrics

4,000+ active / 65,089 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/randomtext/randomtext.php+30
    Methods with the same name as their class will not be constructors in a future version of PHP; randomtext has a deprecated constructor

Server metrics [RAM: ▼1.83MB] [CPU: ▼186.30ms] Passed 4 tests

An overview of server-side resources used by Random Text
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /1.80 ▼1.035.01 ▼31.95
Dashboard /wp-admin1.82 ▼1.244.73 ▼41.82
Posts /wp-admin/edit.php1.82 ▼1.2919.99 ▼21.83
Add New Post /wp-admin/post-new.php1.82 ▼3.616.37 ▼636.46
Media Library /wp-admin/upload.php1.82 ▼1.195.33 ▼34.96
Random Text /wp-admin/options-general.php?page=randomtext1.825.06

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 6 new files
Database: 1 new table, 1 new option
New tables
wp_randomtext
New WordPress options
widget_randomtext

Browser metrics Passed 4 tests

This is an overview of browser requirements for Random Text
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲12615.72 ▲0.138.52 ▼3.0248.33 ▲4.21
Dashboard /wp-admin2,969 ▲355.91 ▼0.15150.94 ▼6.40111.00 ▼5.15
Posts /wp-admin/edit.php2,744 ▲52.72 ▼0.0099.09 ▲34.29100.92 ▲13.43
Add New Post /wp-admin/post-new.php1,686 ▲318.80 ▲0.11425.92 ▼32.13116.17 ▲6.96
Media Library /wp-admin/upload.php1,815 ▲85.02 ▼0.02152.33 ▼1.39111.14 ▼13.28
Random Text /wp-admin/options-general.php?page=randomtext1,1702.0955.8272.53

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 validation failed for this plugin
    • > Deprecated in wp-content/plugins/randomtext/randomtext.php+30
    Methods with the same name as their class will not be constructors in a future version of PHP; randomtext has a deprecated constructor
  • Zombie WordPress options were found after uninstall: 1 option
    • widget_randomtext

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=randomtext
    • > Deprecated in wp-content/plugins/randomtext/randomtext.php+30
    Methods with the same name as their class will not be constructors in a future version of PHP; randomtext has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=randomtext
    • > User deprecated in wp-includes/functions.php+5304
    The called constructor method for WP_Widget in randomtext is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=randomtext
    • > Notice in wp-content/plugins/randomtext/randomtext.php+149
    Undefined variable: result

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/randomtext/randomtext_admin.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/randomtext/randomtext.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Sidebar widget options), #2 (Text management page)
The official readme.txt might help

randomtext/randomtext.php Passed 13 tests

This is the main PHP file of "Random Text" version 0.3.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
48 characters long description:
A widget to display randomized text on your site

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
Good job! No executable or dangerous file extensions detected369 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP37538369

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
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%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.11MB with 0.06MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png19.36KB10.21KB▼ 47.27%
screenshot-2.png96.54KB31.85KB▼ 67.01%