78% wp-url-shortener

Code Review | WP URL Shortener

WordPress plugin WP URL Shortener scored78%from 54 tests.

About plugin

  • Plugin page: wp-url-shortener
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.0-3.9.0
  • WordPress version: 6.3.1
  • First release: Jun 11, 2012
  • Latest release: Feb 13, 2016
  • Number of updates: 13
  • Update frequency: every 103.2 days
  • Top authors: djerba (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,441 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.01MB] [CPU: ▼7.25ms] Passed 4 tests

Server-side resources used by WP URL Shortener
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0236.24 ▼1.46
Dashboard /wp-admin3.33 ▼0.0248.08 ▼12.29
Posts /wp-admin/edit.php3.30 ▼0.0647.17 ▼2.98
Add New Post /wp-admin/post-new.php5.91 ▲0.0294.47 ▼12.06
Media Library /wp-admin/upload.php3.25 ▲0.0234.84 ▼1.65
Url Shortener /wp-admin/options-general.php?page=url_shortener_settings3.2032.57

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by WP URL Shortener
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3313.18 ▼1.191.73 ▼0.0442.74 ▲3.54
Dashboard /wp-admin2,207 ▲155.83 ▼0.0795.53 ▼20.7140.01 ▼4.88
Posts /wp-admin/edit.php2,106 ▲172.02 ▲0.0141.00 ▲4.6637.23 ▲3.85
Add New Post /wp-admin/post-new.php1,536 ▲822.83 ▲4.81614.32 ▲11.0850.74 ▲2.25
Media Library /wp-admin/upload.php1,389 ▼24.25 ▲0.0391.91 ▼10.4243.16 ▼2.26
Url Shortener /wp-admin/options-general.php?page=url_shortener_settings8982.1426.0922.80

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=url_shortener_settings
    • > Notice in wp-content/plugins/wp-url-shortener/index.php+75
    Undefined variable: siteurl
    • > GET request to /wp-admin/options-general.php?page=url_shortener_settings
    • > Notice in wp-content/plugins/wp-url-shortener/index.php+80
    Undefined variable: plugin_name
    • > GET request to /wp-admin/options-general.php?page=url_shortener_settings
    • > Notice in wp-content/plugins/wp-url-shortener/index.php+80
    Undefined variable: plugin_version
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=url_shortener_settings
    • > Notice in wp-content/plugins/wp-url-shortener/index.php+117
    Trying to access array offset on value of type bool

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
Almost there! Just fix the following items
  • 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/wp-url-shortener/index.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (WP URL Shortener), #2 (WP URL Shortener)
The official readme.txt might help

wp-url-shortener/index.php 92% from 13 tests

This is the main PHP file of "WP URL Shortener" version 1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-url-shortener.php" instead of "index.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
No dangerous file extensions were detected187 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1613125
PO File1274440
CSS10022

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.14
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%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.12MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/plug-and-play.png4.91KB1.75KB▼ 64.38%
screenshot-1.png32.95KB14.50KB▼ 55.99%
images/wp-live-support.png5.81KB2.25KB▼ 61.30%
screenshot-2.png71.29KB34.19KB▼ 52.04%
images/facebook-ogg-meta-tags.png5.17KB1.93KB▼ 62.60%