74% shortlink-domain

Code Review | Custom Shortlink Domain

WordPress plugin Custom Shortlink Domain scored74%from 54 tests.

About plugin

  • Plugin page: shortlink-domain
  • Plugin version: 0.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.1-3.3.1
  • WordPress version: 6.3.1
  • First release: Apr 7, 2012
  • Latest release: Apr 28, 2012
  • Number of updates: 10
  • Update frequency: every 3.3 days
  • Top authors: stvwhtly (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,914 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
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.75ms] Passed 4 tests

Server-side resources used by Custom Shortlink Domain
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0137.60 ▼4.46
Dashboard /wp-admin3.32 ▲0.0246.00 ▼6.38
Posts /wp-admin/edit.php3.37 ▲0.0250.59 ▼3.78
Add New Post /wp-admin/post-new.php5.90 ▲0.0284.87 ▼8.39
Media Library /wp-admin/upload.php3.24 ▲0.0236.09 ▲2.05

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Custom Shortlink Domain: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.27 ▼0.131.64 ▼0.1837.11 ▼5.78
Dashboard /wp-admin2,192 ▲215.62 ▲0.01100.95 ▼1.9742.57 ▼0.16
Posts /wp-admin/edit.php2,097 ▼31.99 ▲0.0339.18 ▲2.0335.26 ▼4.31
Add New Post /wp-admin/post-new.php1,526 ▼522.66 ▼0.60596.62 ▼100.2352.33 ▼1.51
Media Library /wp-admin/upload.php1,400 ▲34.16 ▼0.0795.17 ▼15.1144.88 ▼2.42

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
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/shortlink-domain/index.php+132
    Use of undefined constant WP_UNINSTALL_PLUGIN - assumed 'WP_UNINSTALL_PLUGIN' (this will throw an Error in a future version of PHP)
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/shortlink-domain/index.php:39

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
7 plugin tags: modify, shortlink, link, domain, custom...

shortlink-domain/index.php 92% from 13 tests

The main PHP file in "Custom Shortlink Domain" ver. 0.1.3 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("shortlink-domain.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin71 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1116071

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods116.67%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin