74% mts-url-shortener

Code Review | URL Shortener by MyThemeShop

WordPress plugin URL Shortener by MyThemeShop scored74%from 54 tests.

About plugin

  • Plugin page: mts-url-shortener
  • Plugin version: 1.0.17
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 9, 2016
  • Latest release: Feb 11, 2023
  • Number of updates: 40
  • Update frequency: every 56.4 days
  • Top authors: MyThemeShop (92.5%)roymahfooz (10%)

Code review

54 tests

User reviews

14 reviews

Install metrics

10,000+ active /120,269 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.61MB] [CPU: ▲1.49ms] Passed 4 tests

Analyzing server-side resources used by URL Shortener by MyThemeShop
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.06 ▲0.5949.09 ▲10.49
Dashboard /wp-admin3.93 ▲0.6353.34 ▲8.20
Posts /wp-admin/edit.php3.99 ▲0.6256.38 ▲9.03
Add New Post /wp-admin/post-new.php6.47 ▲0.5885.67 ▼15.10
Media Library /wp-admin/upload.php3.85 ▲0.6239.71 ▲3.84
Edit Link /wp-admin/admin.php?page=url_shortener_edit3.8539.36
Add Link /wp-admin/admin.php?page=url_shortener_add3.8537.59
Short Links /wp-admin/admin.php?page=url_shortener_links3.8837.77
Categories /wp-admin/edit-tags.php?taxonomy=short_link_category3.8539.82
Settings /wp-admin/admin.php?page=url_shortener_settings3.8540.24

Server storage [IO: ▲0.25MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 29 new files
Database: 3 new tables, 9 new options
New tables
wp_short_link_replacements
wp_short_links
wp_short_link_clicks
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
urlshortener_defaults
widget_theysaidso_widget
url_shortener_activated
url_shortener_views
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for URL Shortener by MyThemeShop
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,850 ▲7914.45 ▲0.081.73 ▼0.0142.63 ▲0.69
Dashboard /wp-admin2,253 ▲655.80 ▼0.0598.61 ▲0.3539.66 ▼4.03
Posts /wp-admin/edit.php2,138 ▲492.00 ▼0.0541.52 ▼0.4137.26 ▲1.83
Add New Post /wp-admin/post-new.php1,572 ▲4923.35 ▲0.20594.34 ▼51.6249.11 ▼6.53
Media Library /wp-admin/upload.php1,434 ▲464.20 ▼0.0297.32 ▼3.4342.43 ▼2.20
Edit Link /wp-admin/admin.php?page=url_shortener_edit1,3692.4653.6741.73
Add Link /wp-admin/admin.php?page=url_shortener_add1,3722.5260.5937.47
Short Links /wp-admin/admin.php?page=url_shortener_links1,1642.0028.0826.65
Categories /wp-admin/edit-tags.php?taxonomy=short_link_category1,2792.1326.8829.88
Settings /wp-admin/admin.php?page=url_shortener_settings1,1673.4846.5628.49

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The plugin did not uninstall successfully, leaving 3 tables in the database
    • wp_short_link_replacements
    • wp_short_links
    • wp_short_link_clicks
  • Zombie WordPress options were found after uninstall: 9 options
    • can_compress_scripts
    • url_shortener_activated
    • urlshortener_defaults
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • url_shortener_views

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_admin_page_title() in wp-content/plugins/mts-url-shortener/admin/views/url-shortener-settings.php:14
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/mts-url-shortener/admin/views/url-shortener-edit.php on line 14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/mts-url-shortener/admin/class-url-shortener-list-table.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_admin_page_title() in wp-content/plugins/mts-url-shortener/admin/views/url-shortener-stats.php:15
    • > PHP Fatal error
      Uncaught Error: Call to a member function prepare_items() on null in wp-content/plugins/mts-url-shortener/admin/views/url-shortener-links.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_admin_page_title() in wp-content/plugins/mts-url-shortener/admin/views/url-shortener-add.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/mts-url-shortener/admin/views/url-shortener-edit.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: Too many tags (29 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

mts-url-shortener/mts-url-shortener.php Passed 13 tests

"URL Shortener by MyThemeShop" version 1.0.17's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
111 characters long description:
A simple-yet-powerful tool for creating short links. hiding affiliate links, Ideal for social sharing and more.

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
Everything looks great! No dangerous files found in this plugin4,488 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP187251,2594,185
CSS124195
JavaScript31213108

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity91.50
▷ Minimum class complexity1.00
▷ Maximum class complexity442.00
Average method complexity6.17
▷ Minimum method complexity1.00
▷ Maximum method complexity73.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods175
▷ Static methods137.43%
▷ Public methods17097.14%
▷ Protected methods00.00%
▷ Private methods52.86%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin