93% wp-url-shorten

Code Review | WP URLs Shortener + Social icons [Official]

WordPress plugin WP URLs Shortener + Social icons [Official] scored 93% from 54 tests.

About plugin

  • Plugin page: wp-url-shorten
  • Plugin version: 8.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.8
  • WordPress version: 5.8.1
  • First release: Jul 22, 2013
  • Latest release: Jul 31, 2021
  • Number of updates: 99
  • Update frequency: every 29.6 days
  • Top authors: zinger252 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active / 11,564 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼141.22ms] Passed 4 tests

Server-side resources used by WP URLs Shortener + Social icons [Official]
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.78 ▲0.062,628.21 ▲2,606.36
Dashboard /wp-admin3.12 ▲0.0650.86 ▲6.93
Posts /wp-admin/edit.php3.17 ▲0.0645.61 ▼3.79
Add New Post /wp-admin/post-new.php5.48 ▲0.04102.12 ▼570.37
Media Library /wp-admin/upload.php3.06 ▲0.0639.54 ▲2.34
Settings /wp-admin/admin.php?page=eebme_short_link_settings_page23.0433.56
WP URL SHORTEN /wp-admin/admin.php?page=eebme_short_link_settings_page3.0436.69

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 26 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

WP URLs Shortener + Social icons [Official]: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,745 ▲14916.04 ▲0.5111.20 ▲2.0051.00 ▼4.86
Dashboard /wp-admin3,003 ▲726.74 ▲0.87132.61 ▼30.63155.41 ▲39.66
Posts /wp-admin/edit.php2,777 ▲382.76 ▲0.0970.32 ▲7.66106.88 ▲11.46
Add New Post /wp-admin/post-new.php1,559 ▼12418.79 ▲0.23391.46 ▼0.59134.24 ▲21.91
Media Library /wp-admin/upload.php1,792 ▼185.49 ▲0.51143.18 ▼37.11166.04 ▲36.70
Settings /wp-admin/admin.php?page=eebme_short_link_settings_page21,6172.5859.13100.55
WP URL SHORTEN /wp-admin/admin.php?page=eebme_short_link_settings_page1,2152.8970.8386.39

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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 take a closer look at the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_permalink() in wp-content/plugins/wp-url-shorten/template/public.tpl.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-url-shorten/template/settings.tpl.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 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: You are using too many tags: 14 tag instead of maximum 10
The official readme.txt might help

wp-url-shorten/eebme_shorturl.php 85% from 13 tests

The main PHP script in "WP URLs Shortener + Social icons [Official]" version 8.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-url-shorten.php" instead of "eebme_shorturl.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected554 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP415649383
JavaScript1311170
CSS1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity25.00
▷ Minimum class complexity25.00
▷ Maximum class complexity25.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
18 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
icons/digg-32.png0.75KB0.74KB0.26%
icons/evernote-32.png0.87KB0.87KB▼ 0.56%
(invalid) icon.png1.12KB0.00KB▼ 100.00%
icons/twitter_letter-32.png0.70KB0.70KB0.00%
icons/blogger-32.png0.79KB0.79KB0.25%