10% tiny-url

Code Review | Tiny URL

WordPress plugin Tiny URL scored 10% from 54 tests.

About plugin

  • Plugin page: tiny-url
  • Plugin version: 1.3.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.5.1
  • WordPress version: 6.3.1
  • First release: Sep 3, 2012
  • Latest release: Mar 18, 2013
  • Number of updates: 12
  • Update frequency: every 16.4 days
  • Top authors: prasannasp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 5,774 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/tiny-url/tiny-url.php+121
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼0.32MB] [CPU: ▼16.41ms] Passed 4 tests

Analyzing server-side resources used by Tiny URL
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.44 ▼0.0229.32 ▼13.21
Dashboard /wp-admin3.32 ▲0.0146.29 ▼1.26
Posts /wp-admin/edit.php3.37 ▲0.0148.51 ▼2.15
Add New Post /wp-admin/post-new.php4.61 ▼1.2842.75 ▼49.03
Media Library /wp-admin/upload.php3.24 ▲0.0136.75 ▲4.01
Tiny URL /wp-admin/options-general.php?page=tiny-url/tiny-url.php3.1829.03

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
tinyurl_options
widget_recent-posts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Tiny URL: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲5913.31 ▼1.051.72 ▼0.2136.99 ▼10.84
Dashboard /wp-admin2,210 ▲194.87 ▼0.01106.84 ▼4.2840.44 ▼1.92
Posts /wp-admin/edit.php2,096 ▲101.98 ▼0.0841.26 ▲1.1034.09 ▼3.75
Add New Post /wp-admin/post-new.php1,539 ▼223.08 ▼0.10640.20 ▲45.1958.68 ▲6.52
Media Library /wp-admin/upload.php1,386 ▲14.32 ▲0.0699.29 ▼0.1840.95 ▼2.34
Tiny URL /wp-admin/options-general.php?page=tiny-url/tiny-url.php9582.0322.3133.24

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=tiny-url/tiny-url.php
    • > Notice in wp-content/plugins/tiny-url/tiny-url.php+42
    Undefined variable: post
    • > GET request to /wp-admin/options-general.php?page=tiny-url/tiny-url.php
    • > Notice in wp-content/plugins/tiny-url/tiny-url.php+42
    Trying to get property 'ID' of non-object
    • > GET request to /wp-admin/options-general.php?page=tiny-url/tiny-url.php
    • > Warning in wp-content/plugins/tiny-url/tiny-url.php+35
    file_get_contents(http://tinyurl.com/api-create.php?url=): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request

SRP 50% 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 trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/tiny-url/tiny-url.php:66

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, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
7 plugin tags: shorturl, shortlink, short url, post, tinyurl...

tiny-url/tiny-url.php Passed 13 tests

The primary PHP file in "Tiny URL" version 1.3.4 is used by WordPress to initiate all plugin functionality
131 characters long description:
This plugin automatically adds a tiny URL for all blog posts after post content. Uses http://tinyurl.com/ service to get Tiny URLs.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected215 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP14133199
JavaScript221316

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.38
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%
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

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.13MB with 0.08MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png8.83KB3.34KB▼ 62.15%
screenshot-1.png63.95KB21.02KB▼ 67.13%
screenshot-3.png62.33KB22.68KB▼ 63.62%