67% shorten-url

Code Review | Short URL

WordPress plugin Short URL scored67%from 54 tests.

About plugin

  • Plugin page: shorten-url
  • Plugin version: %s by %s', 'SL_frame...
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Jul 9, 2011
  • Latest release: Jul 31, 2023
  • Number of updates: 81
  • Update frequency: every 54.4 days
  • Top authors: sedLex (87.65%)kaizencoders (13.58%)

Code review

54 tests

User reviews

22 reviews

Install metrics

2,000+ active /66,360 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: ▲0.00MB] [CPU: ▼2.88ms] Passed 4 tests

An overview of server-side resources used by Short URL
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.97 ▼4.14
Dashboard /wp-admin3.31 ▲0.0047.71 ▼1.93
Posts /wp-admin/edit.php3.36 ▲0.0047.32 ▲6.37
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.39 ▼5.74
Media Library /wp-admin/upload.php3.23 ▲0.0031.57 ▲0.29

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 182 new files
Database: 1 new table, 6 new options
New tables
wp_pluginSL_shorturl
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Short URL
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.23 ▼0.481.68 ▼0.0744.49 ▲0.99
Dashboard /wp-admin2,198 ▲215.61 ▼0.0496.59 ▼6.3942.16 ▼1.91
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0739.74 ▲3.3836.57 ▲7.29
Add New Post /wp-admin/post-new.php1,540 ▲1418.48 ▼4.95618.80 ▼15.5053.66 ▲2.33
Media Library /wp-admin/upload.php1,397 ▼64.15 ▼0.0194.81 ▼1.3242.25 ▼0.63

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
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method shorturl::uninstall_removedata() should not be called statically
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/shorten-url/core.php
    • > /wp-content/plugins/shorten-url/core.class.php
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      require_once(core.php): failed to open stream: No such file or directory in wp-content/plugins/shorten-url/core/templates/my-plugin.php on line 18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/shorten-url/shorten-url.php:29
    • > PHP Fatal error
      require_once(): Failed opening required 'core.php' (include_path='.:/usr/share/php') in wp-content/plugins/shorten-url/core/templates/my-plugin.php on line 18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (The synthesis of the short link generated for your post and page), #2 (The configuration page of the plugin)
You can take inspiration from this readme.txt

shorten-url/core.class.php 85% from 13 tests

The primary PHP file in "Short URL" version %s by %s', 'SL_frame... is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("shorten-url.php" instead of "core.class.php")
  • Version: Plugin version number should only contain digits separated by dots (ex. "1.0.3" instead of "%s by %s', 'SL_frame...")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin18,992 lines of code in 84 files:
LanguageFilesBlank linesComment linesLines of code
PO File444,608010,155
PHP191,0521,8707,361
JavaScript6248282891
CSS118813470
Markdown120084
JSON10029
INI2002

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 119)
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity55.58
▷ Minimum class complexity1.00
▷ Maximum class complexity211.00
Average method complexity7.32
▷ Minimum method complexity1.00
▷ Maximum method complexity119.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes15.26%
▷ Concrete classes1894.74%
▷ Final classes00.00%
Methods164
▷ Static methods3521.34%
▷ Public methods16198.17%
▷ Protected methods31.83%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
35 PNG files occupy 0.44MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
core/img/tree_node_minus.png0.14KB0.12KB▼ 15.17%
core/img/arrow_up.png0.24KB0.27KB0.00%
core/img/tab_mail.png0.66KB0.62KB▼ 6.63%
screenshot-1.png49.23KB17.87KB▼ 63.71%
core/img/progressbar.png1.43KB1.25KB▼ 12.96%