84% better-yourls

Code Review | Better YOURLS

WordPress plugin Better YOURLS scored84%from 54 tests.

About plugin

  • Plugin page: better-yourls
  • Plugin version: 2.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-5.1
  • WordPress version: 6.3.1
  • First release: Apr 20, 2014
  • Latest release: Feb 20, 2019
  • Number of updates: 49
  • Update frequency: every 36.9 days
  • Top authors: ChrisWiegman (93.88%)channeleaton (8.16%)

Code review

54 tests

User reviews

11 reviews

Install metrics

400+ active /12,785 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼7.71ms] Passed 4 tests

Analyzing server-side resources used by Better YOURLS
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0538.47 ▼4.22
Dashboard /wp-admin3.45 ▲0.1444.82 ▼4.56
Posts /wp-admin/edit.php3.56 ▲0.2049.27 ▲0.29
Add New Post /wp-admin/post-new.php6.03 ▲0.1480.16 ▼19.72
Media Library /wp-admin/upload.php3.37 ▲0.1434.34 ▼2.33
Better YOURLS /wp-admin/options-general.php?page=better_yourls3.3433.33

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 18 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Better YOURLS
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.16 ▼1.251.71 ▼0.1242.89 ▲0.14
Dashboard /wp-admin2,210 ▲225.83 ▼0.0597.19 ▼16.8936.12 ▼7.13
Posts /wp-admin/edit.php2,096 ▲72.02 ▼0.0138.45 ▲3.8535.80 ▲1.84
Add New Post /wp-admin/post-new.php1,536 ▲1623.10 ▼0.08653.62 ▼22.7659.72 ▲10.52
Media Library /wp-admin/upload.php1,386 ▼54.33 ▲0.1896.69 ▲0.6742.98 ▲1.67
Better YOURLS /wp-admin/options-general.php?page=better_yourls1,3312.8454.8370.29

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means 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
Please fix the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function status_header() in wp-content/plugins/better-yourls/uninstall.php:79
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/better-yourls/better-yourls.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: shortlink, yourls, custom shortlink

better-yourls/better-yourls.php Passed 13 tests

"Better YOURLS" version 2.3.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
55 characters long description:
Replace WordPress shortlinks with custom YOURLS domain.

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
Good job! No executable or dangerous file extensions detected722 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP4286456647
Sass116035
CSS23224
JavaScript64216

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity42.67
▷ Minimum class complexity5.00
▷ Maximum class complexity79.00
Average method complexity4.47
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods36
▷ Static methods12.78%
▷ Public methods3186.11%
▷ Protected methods411.11%
▷ Private methods12.78%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
No PNG files were detected