84% shrtfly-url-shortener

Code Review | ShrtFly - URL Shortener

WordPress plugin ShrtFly - URL Shortener scored 84% from 54 tests.

About plugin

  • Plugin page: shrtfly-url-short...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.3.2
  • WordPress version: 6.3.1
  • First release: Mar 31, 2020
  • Latest release: Mar 31, 2020
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: shrtfly (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,113 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▲0.42ms] Passed 4 tests

Server-side resources used by ShrtFly - URL Shortener
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.87 ▼0.98
Dashboard /wp-admin3.31 ▲0.0144.50 ▼0.20
Posts /wp-admin/edit.php3.36 ▲0.0148.36 ▲2.79
Add New Post /wp-admin/post-new.php5.89 ▲0.0191.64 ▲10.14
Media Library /wp-admin/upload.php3.23 ▲0.0038.09 ▲0.07
ShrtFly Settings /wp-admin/options-general.php?page=ShrtFly3.2432.44

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for ShrtFly - URL Shortener
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲4313.16 ▼0.011.98 ▲0.3339.84 ▲1.74
Dashboard /wp-admin2,210 ▲45.83 ▼0.0598.52 ▼0.6637.67 ▼0.92
Posts /wp-admin/edit.php2,093 ▲72.05 ▼0.0240.96 ▲5.6637.32 ▲3.77
Add New Post /wp-admin/post-new.php1,536 ▼623.32 ▲4.80648.73 ▲16.6960.06 ▲10.05
Media Library /wp-admin/upload.php1,389 ▲14.17 ▼0.0793.65 ▼25.6543.57 ▼4.35
ShrtFly Settings /wp-admin/options-general.php?page=ShrtFly9482.0423.1866.28

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/shrtfly-url-shortener/template.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: shorten url, url shortener, link shortener, shortener, shrtfly

shrtfly-url-shortener/shrtfly.php 92% from 13 tests

"ShrtFly - URL Shortener" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("shrtfly-url-shortener.php" instead of "shrtfly.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 detected204 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP33024204

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods8
▷ Static methods225.00%
▷ Public methods562.50%
▷ Protected methods112.50%
▷ Private methods225.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected