62% betterlinks

Code Review | BetterLinks - Shorten, Track and Manage any URL

WordPress plugin BetterLinks - Shorten, Track and Manage any URL scored62%from 54 tests.

About plugin

  • Plugin page: betterlinks
  • Plugin version: 1.6.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Jan 14, 2021
  • Latest release: Nov 20, 2023
  • Number of updates: 73
  • Update frequency: every 14.3 days
  • Top authors: wpdevteam (53.42%)re_enter_rupok (41.1%)priyomukul (8.22%)

Code review

54 tests

User reviews

46 reviews

Install metrics

10,000+ active /262,367 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
Install script ran successfully

Server metrics [RAM: ▲1.62MB] [CPU: ▲10.52ms] Passed 4 tests

Server-side resources used by BetterLinks - Shorten, Track and Manage any URL
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.50 ▲1.0342.47 ▲1.56
Dashboard /wp-admin5.15 ▲1.8459.74 ▲10.76
Posts /wp-admin/edit.php5.20 ▲1.8465.97 ▲18.77
Add New Post /wp-admin/post-new.php7.71 ▲1.81103.13 ▲10.99
Media Library /wp-admin/upload.php5.01 ▲1.7851.96 ▲18.89
Analytics /wp-admin/admin.php?page=betterlinks-analytics4.9942.74
Manage Links /wp-admin/admin.php?page=betterlinks4.9944.75
Settings /wp-admin/admin.php?page=betterlinks-settings4.9944.32

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 138 new files
Database: 6 new tables, 6 new options
New tables
wp_betterlinks_clicks
wp_betterlinks_terms
wp_betterlinks_terms_relationships
wp_betterlinkmeta
wp_betterlinks_password
wp_betterlinks
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for BetterLinks - Shorten, Track and Manage any URL
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲6514.13 ▼0.631.75 ▼0.1937.32 ▼7.09
Dashboard /wp-admin2,306 ▲1325.71 ▲0.0792.31 ▼5.8082.92 ▲40.27
Posts /wp-admin/edit.php2,211 ▲1082.13 ▲0.1241.28 ▲6.7241.92 ▲1.09
Add New Post /wp-admin/post-new.php1,788 ▲26225.09 ▲2.03720.29 ▲85.70190.98 ▲141.36
Media Library /wp-admin/upload.php1,505 ▲1024.14 ▲0.0098.92 ▼0.3587.99 ▲44.64
Analytics /wp-admin/admin.php?page=betterlinks-analytics1,1277.36141.7637.80
Manage Links /wp-admin/admin.php?page=betterlinks1,2766.47136.4142.36
Settings /wp-admin/admin.php?page=betterlinks-settings1,3856.1299.2948.65

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie tables detected upon uninstall: 6 tables
    • wp_betterlinks_password
    • wp_betterlinks_terms_relationships
    • wp_betterlinks
    • wp_betterlinkmeta
    • wp_betterlinks_terms
    • wp_betterlinks_clicks
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/betterlinks/vendor/a5hleyrich/wp-background-processing/tests/bootstrap.php
  • 30× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'BetterLinks\\API\\Controller' not found in wp-content/plugins/betterlinks/includes/API/Terms.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'BetterLinks\\API\\Controller' not found in wp-content/plugins/betterlinks/includes/API/Settings.php:7
    • > PHP Fatal error
      Trait 'BetterLinks\\Traits\\Query' not found in wp-content/plugins/betterlinks/includes/Helper.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'PriyoMukul\\WPNotice\\Utils\\Base' not found in wp-content/plugins/betterlinks/vendor/priyomukul/wp-notice/src/Utils/Storage.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'BetterLinks\\Tools\\Migration\\S30RBase' not found in wp-content/plugins/betterlinks/includes/Tools/Migration/S301ROneClick.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/betterlinks/vendor/a5hleyrich/wp-background-processing/tests/Test_Setup.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Jaybizzle\\CrawlerDetect\\Fixtures\\AbstractProvider' not found in wp-content/plugins/betterlinks/vendor/jaybizzle/crawler-detect/src/Fixtures/Headers.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'BetterLinks\\Tools\\Migration\\BaseCSV' not found in wp-content/plugins/betterlinks/includes/Tools/Migration/PTLOneClick.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'PriyoMukul\\WPNotice\\Utils\\Base' not found in wp-content/plugins/betterlinks/vendor/priyomukul/wp-notice/src/Notice.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Async_Request' not found in wp-content/plugins/betterlinks/vendor/a5hleyrich/wp-background-processing/classes/wp-background-process.php:14

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=betterlinks-analytics
    • > Console-api (severe) in wp-content/plugins/betterlinks/assets/js/betterlinks.core.min.js?ver=9e93c62bac0e168d2aaf+0:1031804
    Invalid scale configuration for scale: yAxes

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Tags: You are using too many tags: 33 tag instead of maximum 10
  • Screenshots: These screenshots lack descriptions #1, #2, #3, #4, #5, #6 in betterlinks/assets to your readme.txt
The official readme.txt might help

betterlinks/betterlinks.php Passed 13 tests

The principal PHP file in "BetterLinks - Shorten, Track and Manage any URL" v. 1.6.3 is loaded by WordPress automatically on each request
135 characters long description:
Ultimate plugin to create, shorten, track and manage any URL. Gather analytics reports and run successfully marketing campaigns easily.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin12,219 lines of code in 126 files:
LanguageFilesBlank linesComment linesLines of code
PHP791,1362,43710,976
SVG3104334
CSS65718312
Markdown11240252
JSON400152
Bourne Shell12311147
JavaScript34532
make14014

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity21.51
▷ Minimum class complexity1.00
▷ Maximum class complexity139.00
Average method complexity3.56
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces17
Interfaces2
Traits8
Classes58
▷ Abstract classes610.34%
▷ Concrete classes5289.66%
▷ Final classes23.85%
Methods556
▷ Static methods9517.09%
▷ Public methods48887.77%
▷ Protected methods447.91%
▷ Private methods244.32%
Functions29
▷ Named functions413.79%
▷ Anonymous functions2586.21%
Constants25
▷ Global constants1872.00%
▷ Class constants728.00%
▷ Public constants7100.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