77% wpshorturl

Code Review | wp Short URL - Best Wordpress URL shortener

WordPress plugin wp Short URL - Best Wordpress URL shortener scored 77% from 54 tests.

About plugin

  • Plugin page: wpshorturl
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.7.2
  • WordPress version: 5.8.1
  • First release: Jul 7, 2021
  • Latest release: Jul 11, 2021
  • Number of updates: 11
  • Update frequency: every 0.4 days
  • Top authors: wpshorturl (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 311 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.16MB] [CPU: ▼144.58ms] Passed 4 tests

An overview of server-side resources used by wp Short URL - Best Wordpress URL shortener
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.98 ▲0.2639.98 ▲14.06
Dashboard /wp-admin3.21 ▲0.1639.77 ▼8.10
Posts /wp-admin/edit.php3.32 ▲0.2147.02 ▼4.15
Add New Post /wp-admin/post-new.php5.57 ▲0.1393.74 ▼565.15
Media Library /wp-admin/upload.php3.15 ▲0.1533.95 ▼0.92
Categories /wp-admin/admin.php?page=wp-short-url-categories3.1344.03
Short URL /wp-admin/admin.php?page=wp-short-url3.1836.12

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 29 new files
Database: 3 new tables, no new options
New tables
wp_wsu_categories
wp_wsu_items_history
wp_wsu_items

Browser metrics Passed 4 tests

This is an overview of browser requirements for wp Short URL - Best Wordpress URL shortener
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,722 ▲15016.63 ▲0.8012.86 ▲3.0851.62 ▼4.09
Dashboard /wp-admin3,001 ▲677.05 ▲1.11150.56 ▼9.56137.87 ▲17.01
Posts /wp-admin/edit.php2,784 ▲453.10 ▲0.4179.72 ▲8.90119.24 ▲30.39
Add New Post /wp-admin/post-new.php1,612 ▼7115.44 ▼2.97415.80 ▲24.86117.06 ▼2.42
Media Library /wp-admin/upload.php1,802 ▼85.73 ▲0.72179.11 ▲31.66164.58 ▲45.31
Categories /wp-admin/admin.php?page=wp-short-url-categories1,1532.9975.3475.58
Short URL /wp-admin/admin.php?page=wp-short-url1,6623.0266.3790.37

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 3 tables in the database
    • wp_wsu_items
    • wp_wsu_items_history
    • wp_wsu_categories

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=wp-short-url-categories
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/wpshorturl/includes/ajax-handler.php+229
    Undefined index: rowid
    • > GET request to /wp-admin/admin.php?page=wp-short-url-categories
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/wpshorturl/includes/ajax-handler.php+230
    Undefined index: type
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-short-url
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/wpshorturl/includes/ajax-handler.php+240
    Trying to get property 'post_id' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-short-url
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/wpshorturl/includes/ajax-handler.php+240
    Trying to get property 'custom_url' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-short-url
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/wpshorturl/includes/ajax-handler.php+242
    Trying to get property 'short_slug' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-short-url
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/wpshorturl/includes/ajax-handler.php+243
    Trying to get property 'title' of non-object
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-short-url
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/wpshorturl/includes/ajax-handler.php+244
    Trying to get property 'ID' of non-object

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
The following issues need your attention
  • 10× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wpshorturl/admin/category-list.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpshorturl/includes/ajax-handler.php:35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wpshorturl/wpShortUrl.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpshorturl/admin/index.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/wpshorturl/includes/db-operations.php:52
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpshorturl/includes/handle-uri-requests.php:36
    • > PHP Fatal error
      require_once(): Failed opening required 'WSURL_PATHincludes/helpers.php' (include_path='.:/usr/share/php') in wp-content/plugins/wpshorturl/includes/index.php on line 3
    • > PHP Warning
      require_once(WSURL_PATHincludes/helpers.php): failed to open stream: No such file or directory in wp-content/plugins/wpshorturl/includes/index.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wsu_get_categories_list() in wp-content/plugins/wpshorturl/admin/admin-list.php:10
    • > PHP Warning
      Use of undefined constant WSURL_PATH - assumed 'WSURL_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wpshorturl/includes/index.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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: Too many tags (18 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: These screenshots require images: #1 (Dashboard), #2 (Create custom url), #3 (Create post/page url), #4 (Manage categories)
You can look at the official readme.txt

wpshorturl/wpShortUrl.php 92% from 13 tests

The main PHP script in "wp Short URL - Best Wordpress URL shortener" version 1.1.1 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wpshorturl.php" instead of "wpShortUrl.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin2,014 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP919275961
CSS1453498
JavaScript36240474
Markdown138081

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.20
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%
Functions35
▷ Named functions35100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 0% from 2 tests

Image compression 0% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
12 PNG files occupy 0.51MB with 0.47MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) assets/Screenshot-2.png98.81KB0.00KB▼ 100.00%
assets/img/admin-menu.png18.41KB0.90KB▼ 95.10%
(invalid) assets/Screenshot-1.png180.40KB0.00KB▼ 100.00%
assets/img/click.png0.80KB0.30KB▼ 63.23%
(invalid) assets/Screenshot-4.png75.88KB0.00KB▼ 100.00%