10% shorturl-to-random-url

Code Review | Shorturl to random url

WordPress plugin Shorturl to random url scored 10% from 54 tests.

About plugin

  • Plugin page: shorturl-to-rando...
  • Plugin version: 1.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Jun 4, 2020
  • Latest release: Jun 4, 2020
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: sakawsar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 168 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/shorturl-to-random-url/index.php+27
    Undefined variable: charset_collate

Server metrics [RAM: ▼1.03MB] [CPU: ▼176.89ms] Passed 4 tests

An overview of server-side resources used by Shorturl to random url
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.58 ▼0.1415.60 ▼7.26
Dashboard /wp-admin2.62 ▼0.4316.27 ▼16.71
Posts /wp-admin/edit.php2.63 ▼0.4816.83 ▼24.08
Add New Post /wp-admin/post-new.php2.62 ▼2.8117.07 ▼643.59
Media Library /wp-admin/upload.php2.63 ▼0.3817.11 ▼23.19
URL shorter /wp-admin/edit.php?post_type=url_shorter2.6316.45
Add New /wp-admin/post-new.php?post_type=url_shorter2.6316.64

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 5 new files
Database: 1 new table, no new options
New tables
wp_url_shorter

Browser metrics Passed 4 tests

Checking browser requirements for Shorturl to random url
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,766 ▲17116.20 ▲0.728.19 ▲1.4654.61 ▲10.46
Dashboard /wp-admin3,032 ▲985.91 ▼0.04141.01 ▲0.5289.60 ▼16.57
Posts /wp-admin/edit.php2,798 ▲592.71 ▲0.0165.62 ▲0.2173.47 ▼18.16
Add New Post /wp-admin/post-new.php1,712 ▲21218.90 ▲0.31354.08 ▼11.73116.61 ▲5.15
Media Library /wp-admin/upload.php1,866 ▲565.05 ▲0.07154.65 ▲9.50123.53 ▲5.90
URL shorter /wp-admin/edit.php?post_type=url_shorter1,4552.6365.2170.62
Add New /wp-admin/post-new.php?post_type=url_shorter1,9493.15102.7770.40

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/shorturl-to-random-url/index.php+192
    Undefined index: REDIRECT_URL
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_url_shorter

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=url_shorter
    • > Notice in wp-content/plugins/shorturl-to-random-url/index.php+192
    Undefined index: REDIRECT_URL
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=url_shorter
    • > Notice in wp-content/plugins/shorturl-to-random-url/index.php+192
    Only variables should be passed by reference

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/shorturl-to-random-url/index.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% 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
These attributes need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === shorturl-to-random-url === )
The official readme.txt is a good inspiration

shorturl-to-random-url/index.php 92% from 13 tests

"Shorturl to random url" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("shorturl-to-random-url.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected209 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP11315208
CSS1051

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
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%
Functions6
▷ Named functions6100.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
PNG images were not found in this plugin