68% pretty-link

Code Review | Pretty Links - Affiliate Links, Link Branding, Link Tracking & Marketing Plugin

WordPress plugin Pretty Links - Affiliate Links, Link Branding, Link Tracking & Marketing Plugin scored68%from 54 tests.

About plugin

  • Plugin page: pretty-link
  • Plugin version: 3.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.4
  • WordPress version: 6.3.1
  • First release: Mar 29, 2009
  • Latest release: Nov 13, 2023
  • Number of updates: 528
  • Update frequency: every 10.1 days
  • Top authors: supercleanse (86.36%)cartpauj (13.64%)

Code review

54 tests

User reviews

1177 reviews

Install metrics

300,000+ active /6,856,010 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
Install script ran successfully

Server metrics [RAM: ▲0.37MB] [CPU: ▲7.93ms] 75% from 4 tests

Server-side resources used by Pretty Links - Affiliate Links, Link Branding, Link Tracking & Marketing Plugin
Please take the time to fix the following items
  • CPU: Total CPU usage must kept under 500.00ms (currently 650.34ms on /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-clicks)
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.3441.76 ▲6.07
Dashboard /wp-admin3.68 ▲0.3752.03 ▲4.17
Posts /wp-admin/edit.php3.79 ▲0.4359.74 ▲13.32
Add New Post /wp-admin/post-new.php6.28 ▲0.39104.03 ▲15.57
Media Library /wp-admin/upload.php3.59 ▲0.3644.52 ▲8.14
Import / Export /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-upgrade-import-export3.6141.13
Add-ons /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-addons3.6039.61
Tags /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-upgrade-tags3.6240.85
Clicks /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-clicks3.80650.34
PrettyPay™ LinksNEW /wp-admin/edit.php?post_type=pretty-link&page=prettypay-links3.6542.49
/wp-admin/options.php?page=pretty-link-onboarding3.6444.00
Tools /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-tools3.6441.19
Categories /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-upgrade-categories3.6236.17
Pretty Links /wp-admin/edit.php?post_type=pretty-link3.6545.78
Add New /wp-admin/post-new.php?post_type=pretty-link3.8263.68

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 290 new files
Database: 3 new tables, 10 new options
New tables
wp_prli_links
wp_prli_link_metas
wp_prli_clicks
New WordPress options
can_compress_scripts
prli_db_version
db_upgraded
widget_recent-comments
prli_onboarded
prli_options
theysaidso_admin_options
widget_theysaidso_widget
prli_notifications
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Pretty Links - Affiliate Links, Link Branding, Link Tracking & Marketing Plugin
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,088 ▲32614.32 ▼0.391.72 ▼0.2028.13 ▼13.51
Dashboard /wp-admin2,475 ▲2955.63 ▲0.0195.01 ▲3.1688.60 ▲46.64
Posts /wp-admin/edit.php2,233 ▲1302.16 ▲0.1442.35 ▲5.5445.35 ▲5.67
Add New Post /wp-admin/post-new.php6,338 ▲4,81226.21 ▲2.99913.47 ▲292.0956.64 ▲6.12
Media Library /wp-admin/upload.php1,529 ▲1354.26 ▼0.00101.58 ▲1.4949.51 ▲8.90
Import / Export /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-upgrade-import-export1,4252.2245.1368.67
Add-ons /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-addons1,3662.2044.2248.87
Tags /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-upgrade-tags1,6752.1831.8740.78
Clicks /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-clicks1,4845.1656.2878.08
PrettyPay™ LinksNEW /wp-admin/edit.php?post_type=pretty-link&page=prettypay-links2,0002.4639.7373.48
/wp-admin/options.php?page=pretty-link-onboarding1,8262.1530.57169.28
Tools /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-tools1,4152.1933.1539.09
Categories /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-upgrade-categories1,6892.1731.5236.44
Pretty Links /wp-admin/edit.php?post_type=pretty-link1,6372.4542.7973.27
Add New /wp-admin/post-new.php?post_type=pretty-link3,1456.72133.25106.84

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 3 tables in the database
    • wp_prli_link_metas
    • wp_prli_links
    • wp_prli_clicks
  • The uninstall procedure has failed, leaving 10 options in the database
    • prli_options
    • db_upgraded
    • prli_notifications
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • prli_onboarded
    • theysaidso_admin_options
    • prli_db_version

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% 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
  • 118× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/pretty-link/pretty-link.php
    • > /wp-content/plugins/pretty-link/vendor/lib/index.php
    • > /wp-content/plugins/pretty-link/app/models/PrliLink.php
    • > /wp-content/plugins/pretty-link/app/views/admin/onboarding/features.php
    • > /wp-content/plugins/pretty-link/app/views/links/index.php
    • > /wp-content/plugins/pretty-link/app/views/admin/upgrade/categories.php
    • > /wp-content/plugins/pretty-link/app/views/admin/onboarding/category.php
    • > /wp-content/plugins/pretty-link/app/views/shared/errors.php
    • > /wp-content/plugins/pretty-link/app/controllers/PrliReportsController.php
    • > /wp-content/plugins/pretty-link/app/views/shared/public_link.php
  • 15× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Use of undefined constant PRLI_VIEWS_PATH - assumed 'PRLI_VIEWS_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/pretty-link/app/views/admin/upgrade/categories.php on line 280
    • > PHP Warning
      include_once(PRLI_VIEWS_PATH/admin/upgrade/dialog.php): failed to open stream: No such file or directory in wp-content/plugins/pretty-link/app/views/admin/upgrade/tags.php on line 280
    • > PHP Warning
      Use of undefined constant PRLI_VIEWS_PATH - assumed 'PRLI_VIEWS_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/pretty-link/app/views/admin/upgrade/import-export.php on line 46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/pretty-link/app/views/admin/upgrade/reports.php:8
    • > PHP Warning
      include_once(): Failed opening 'PRLI_VIEWS_PATH/admin/upgrade/dialog.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/pretty-link/app/views/admin/upgrade/tags.php on line 280
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/pretty-link/app/views/admin/upgrade/groups.php:8
    • > PHP Warning
      include_once(PRLI_VIEWS_PATH/admin/upgrade/dialog.php): failed to open stream: No such file or directory in wp-content/plugins/pretty-link/app/views/admin/upgrade/import-export.php on line 46
    • > PHP Notice
      Undefined variable: upgrade_link in wp-content/plugins/pretty-link/app/views/admin/upgrade/dialog.php on line 26
    • > PHP Warning
      include_once(): Failed opening 'PRLI_VIEWS_PATH/admin/upgrade/dialog.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/pretty-link/app/views/admin/upgrade/categories.php on line 280
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/pretty-link/app/views/shared/tinymce_form_popup.php:4

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 40 tag instead of maximum 10
Please take inspiration from this readme.txt

pretty-link/pretty-link.php Passed 13 tests

The primary PHP file in "Pretty Links - Affiliate Links, Link Branding, Link Tracking & Marketing Plugin" version 3.6.1 is used by WordPress to initiate all plugin functionality
61 characters long description:
Shrink, track and share any URL using your website and brand!

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 plugin266,962 lines of code in 197 files:
LanguageFilesBlank linesComment linesLines of code
INI171,3062,923238,779
PHP1102,7271,50815,884
CSS325392394,212
JavaScript326391883,561
PO File19201,0792,452
JSON1001,626
SVG19852422
Sass12026

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity52.90
▷ Minimum class complexity1.00
▷ Maximum class complexity286.00
Average method complexity4.72
▷ Minimum method complexity1.00
▷ Maximum method complexity65.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes39
▷ Abstract classes12.56%
▷ Concrete classes3897.44%
▷ Final classes00.00%
Methods543
▷ Static methods17832.78%
▷ Public methods49791.53%
▷ Protected methods71.29%
▷ Private methods397.18%
Functions19
▷ Named functions1473.68%
▷ Anonymous functions526.32%
Constants44
▷ Global constants3784.09%
▷ Class constants715.91%
▷ Public constants7100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
47 PNG files occupy 3.37MB with 1.53MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/welcome-desk.png269.79KB121.83KB▼ 54.84%
images/redirection-link-menu_324_original3.png37.86KB11.82KB▼ 68.76%
images/product-displays-add-on.png141.58KB34.30KB▼ 75.77%
images/arrow_down.png0.17KB0.18KB0.00%
images/welcome-dynamic-redirects.png104.55KB75.87KB▼ 27.44%