84% shortener-url-redirect

Code Review | Shortener URL Redirect

WordPress plugin Shortener URL Redirect scored84%from 54 tests.

About plugin

  • Plugin page: shortener-url-red...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Dec 29, 2020
  • Latest release: Dec 29, 2020
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: florianluce (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /497 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.11MB] [CPU: ▼10.05ms] Passed 4 tests

Analyzing server-side resources used by Shortener URL Redirect
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0638.47 ▼3.59
Dashboard /wp-admin3.36 ▲0.0649.08 ▼4.84
Posts /wp-admin/edit.php3.47 ▲0.1252.48 ▲1.46
Add New Post /wp-admin/post-new.php5.25 ▼0.6368.91 ▼33.21
Media Library /wp-admin/upload.php3.28 ▲0.0637.92 ▲3.78

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Shortener URL Redirect
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.27 ▼0.111.69 ▼0.3542.21 ▼2.25
Dashboard /wp-admin2,198 ▲215.58 ▼0.0889.14 ▲0.3642.14 ▲5.22
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0539.70 ▲4.1836.28 ▲2.24
Add New Post /wp-admin/post-new.php1,526 ▼022.96 ▼0.16647.42 ▲23.8865.56 ▲15.65
Media Library /wp-admin/upload.php1,400 ▼04.20 ▲0.0299.24 ▼10.9943.34 ▼2.45

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/shortener-url-redirect/view/metabox.php:54
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/shortener-url-redirect/view/metabox.php:54

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Requires at least: Version not formatted correctly
You can look at the official readme.txt

shortener-url-redirect/simple-url-shortener.php 92% from 13 tests

The entry point to "Shortener URL Redirect" version 1.0.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("shortener-url-redirect.php" instead of "simple-url-shortener.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected333 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP692280295
Markdown111038

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity5.60
▷ Minimum class complexity2.00
▷ Maximum class complexity10.00
Average method complexity1.61
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes120.00%
▷ Concrete classes480.00%
▷ Final classes00.00%
Methods38
▷ Static methods00.00%
▷ Public methods2257.89%
▷ Protected methods1642.11%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants00.00%
▷ Class constants8100.00%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin