74% pretty-shorturls

Code Review | Pretty ShortURLs

WordPress plugin Pretty ShortURLs scored74%from 54 tests.

About plugin

  • Plugin page: pretty-shorturls
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-3.8
  • WordPress version: 6.3.1
  • First release: Jan 10, 2014
  • Latest release: Jan 14, 2014
  • Number of updates: 7
  • Update frequency: every 0.6 days
  • Top authors: kanedo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,009 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼1.24MB] [CPU: ▼47.24ms] Passed 4 tests

Server-side resources used by Pretty ShortURLs
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.73 ▼0.7311.01 ▼30.61
Dashboard /wp-admin2.77 ▼0.5315.37 ▼35.41
Posts /wp-admin/edit.php2.77 ▼0.5817.83 ▼32.45
Add New Post /wp-admin/post-new.php2.77 ▼3.1113.38 ▼90.48
Media Library /wp-admin/upload.php2.77 ▼0.4613.74 ▼25.48

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Pretty ShortURLs: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲5613.19 ▼1.201.69 ▼0.1341.26 ▲1.75
Dashboard /wp-admin2,206 ▲155.88 ▲0.99114.07 ▲9.4245.91 ▼1.43
Posts /wp-admin/edit.php1,993 ▼932.00 ▲0.0137.53 ▼1.2728.75 ▼5.85
Add New Post /wp-admin/post-new.php1,535 ▲222.45 ▼0.66674.79 ▲13.6955.62 ▼5.41
Media Library /wp-admin/upload.php1,385 ▼34.25 ▼0.02106.05 ▲1.4346.86 ▲3.83

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • Uninstall procedure had uncaught errors
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'kanedo_do_shorturl_redirect' not found or invalid function name
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please 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_action() in wp-content/plugins/pretty-shorturls/shorturl.php:53

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

pretty-shorturls/shorturl.php 92% from 13 tests

The main PHP file in "Pretty ShortURLs" ver. 1.1.1 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("pretty-shorturls.php" instead of "shorturl.php")

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 detected39 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP110939

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.53
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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
PNG images were not found in this plugin