68% pretty-link

Code Review | Pretty Links - Link Management, Branding, Tracking & Sharing Plugin

WordPress plugin Pretty Links - Link Management, Branding, Tracking & Sharing Plugin scored 68% from 54 tests.

About plugin

  • Plugin page: pretty-link
  • Plugin version: 3.2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.8
  • WordPress version: 5.9.2
  • First release: Mar 29, 2009
  • Latest release: Oct 28, 2021
  • Number of updates: 505
  • Update frequency: every 9.1 days
  • Top authors: supercleanse (90.1%)cartpauj (9.9%)

Code review

54 tests

User reviews

1003 reviews

Install metrics

300,000+ active / 4,775,214 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
Installer ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼290.22ms] Passed 4 tests

This is a short check of server-side resources used by Pretty Links - Link Management, Branding, Tracking & Sharing Plugin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2156.39 ▲10.26
Dashboard /wp-admin3.59 ▲0.1839.86 ▲6.75
Posts /wp-admin/edit.php3.87 ▲0.2343.70 ▲8.34
Add New Post /wp-admin/post-new.php7.12 ▲0.15100.54 ▼1,173.85
Media Library /wp-admin/upload.php3.53 ▲0.2328.87 ▼2.13
Tags /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-upgrade-tags3.5630.78
Options /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-options3.8730.91
Add New /wp-admin/post-new.php?post_type=pretty-link3.8145.53
/wp-admin/options.php?page=pretty-link-welcome3.5827.92
Reports /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-upgrade-reports3.5428.52
Import / Export /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-upgrade-import-export3.5427.09
Clicks /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-clicks3.7230.77
Pretty Links /wp-admin/edit.php?post_type=pretty-link3.6032.74
Tools /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-tools3.5826.97
Upgrade /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-updates3.5835.02

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 196 new files
Database: 3 new tables, 3 new options
New tables
wp_prli_clicks
wp_prli_link_metas
wp_prli_links
New WordPress options
prli_options
prli_db_version
prli_version

Browser metrics Passed 4 tests

Checking browser requirements for Pretty Links - Link Management, Branding, Tracking & Sharing Plugin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,087 ▲33315.90 ▼0.105.81 ▲0.132.62 ▼0.10
Dashboard /wp-admin3,182 ▲3216.23 ▲0.04113.85 ▼22.31184.50 ▲18.18
Posts /wp-admin/edit.php2,778 ▲873.24 ▲0.0168.49 ▲5.20164.67 ▲17.10
Add New Post /wp-admin/post-new.php1,780 ▲2821.82 ▲0.96436.37 ▲4.21158.58 ▼0.99
Media Library /wp-admin/upload.php1,782 ▲845.56 ▲0.06132.86 ▼11.98199.17 ▲11.46
Tags /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-upgrade-tags1,9503.4477.08179.62
Options /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-options4,8594.0490.55228.38
Add New /wp-admin/post-new.php?post_type=pretty-link3,1984.8785.40228.52
/wp-admin/options.php?page=pretty-link-welcome1,6873.1958.21240.33
Reports /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-upgrade-reports1,5593.3860.35160.51
Import / Export /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-upgrade-import-export1,5843.3964.48194.76
Clicks /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-clicks1,6596.4686.36177.75
Pretty Links /wp-admin/edit.php?post_type=pretty-link1,8233.6370.64150.59
Tools /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-tools1,5753.4161.37175.91
Upgrade /wp-admin/edit.php?post_type=pretty-link&page=pretty-link-updates1,5303.4666.14154.27

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 3 tables in the database
    • wp_prli_clicks
    • wp_prli_link_metas
    • wp_prli_links
  • This plugin did not uninstall successfully, leaving 3 options in the database
    • prli_version
    • prli_db_version
    • prli_options

Smoke tests 50% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 items
  • 78× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/pretty-link/app/views/admin/upgrade/import-export.php
    • > /wp-content/plugins/pretty-link/app/views/admin/upgrade/dialog.php
    • > /wp-content/plugins/pretty-link/app/views/links/index.php
    • > /wp-content/plugins/pretty-link/app/controllers/PrliAppController.php
    • > /wp-content/plugins/pretty-link/app/views/options/index.php
    • > /wp-content/plugins/pretty-link/app/views/admin/popups/rating.php
    • > /wp-content/plugins/pretty-link/app/views/widgets/widget.php
    • > /wp-content/plugins/pretty-link/app/views/shared/index.php
    • > /wp-content/plugins/pretty-link/app/controllers/PrliPopupController.php
    • > /wp-content/plugins/pretty-link/css/index.php
  • 13× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > 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
    • > 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 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
      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 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 Notice
      Undefined variable: upgrade_link in wp-content/plugins/pretty-link/app/views/admin/upgrade/dialog.php on line 24
    • > 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 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 Warning
      Use of undefined constant PRLI_IMAGES_URL - assumed 'PRLI_IMAGES_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/pretty-link/app/views/admin/upgrade/dialog.php on line 5
    • > 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/categories.php on line 280

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 97% 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
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 58 tag instead of maximum 10
Please take inspiration from this readme.txt

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

The principal PHP file in "Pretty Links - Link Management, Branding, Tracking & Sharing Plugin" v. 3.2.4 is loaded by WordPress automatically on each request
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 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin267,470 lines of code in 125 files:
LanguageFilesBlank linesComment linesLines of code
INI171,3062,923238,779
JSON20012,768
PHP631,5656729,375
PO File19201,0792,452
CSS263742462,049
JavaScript242951831,703
SVG7802336
Sass1008

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity47.52
▷ Minimum class complexity1.00
▷ Maximum class complexity235.00
Average method complexity4.40
▷ Minimum method complexity1.00
▷ Maximum method complexity62.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes25
▷ Abstract classes14.00%
▷ Concrete classes2496.00%
▷ Final classes00.00%
Methods341
▷ Static methods7421.70%
▷ Public methods31792.96%
▷ Protected methods00.00%
▷ Private methods247.04%
Functions16
▷ Named functions1275.00%
▷ Anonymous functions425.00%
Constants32
▷ Global constants32100.00%
▷ Class constants00.00%
▷ Public constants00.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
37 PNG files occupy 1.36MB with 0.65MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/welcome-click-update.png8.37KB3.91KB▼ 53.28%
vendor/lib/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.31KB0.18KB▼ 42.95%
images/bar_map.png13.07KB5.32KB▼ 59.27%
vendor/lib/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png0.36KB0.15KB▼ 59.57%
images/settings_table/arrow_sprite.png0.67KB0.52KB▼ 23.04%