84% wp-bitly

Code Review | Bitly's Wordpress Plugin

WordPress plugin Bitly's Wordpress Plugin scored84%from 54 tests.

About plugin

  • Plugin page: wp-bitly
  • Plugin version: 2.7.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0.1
  • WordPress version: 6.3.1
  • First release: Apr 2, 2010
  • Latest release: Aug 8, 2022
  • Number of updates: 98
  • Update frequency: every 46.0 days
  • Top authors: delayedinsanity (72.45%)temeritystudios (9.18%)clint.s (9.18%)chipbennett (9.18%)watermelons (4.08%)

Code review

54 tests

User reviews

23 reviews

Install metrics

5,000+ active /126,118 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼1.40ms] Passed 4 tests

An overview of server-side resources used by Bitly's Wordpress Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0547.73 ▲2.49
Dashboard /wp-admin3.36 ▲0.0651.72 ▲0.17
Posts /wp-admin/edit.php3.41 ▲0.0648.74 ▼2.46
Add New Post /wp-admin/post-new.php5.96 ▲0.0894.19 ▼4.92
Media Library /wp-admin/upload.php3.28 ▲0.0635.77 ▲1.60

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 39 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Bitly's Wordpress Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.35 ▲0.071.99 ▲0.1643.74 ▼4.20
Dashboard /wp-admin2,198 ▲215.65 ▼0.0292.57 ▼4.3440.64 ▲1.14
Posts /wp-admin/edit.php2,106 ▲62.07 ▲0.0536.76 ▼3.3634.87 ▼4.56
Add New Post /wp-admin/post-new.php6,227 ▲4,70125.90 ▲2.50904.06 ▲266.8954.60 ▲0.83
Media Library /wp-admin/upload.php1,403 ▲34.24 ▲0.0699.07 ▼9.3547.70 ▲1.58

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_query_arg() in wp-content/plugins/wp-bitly/admin/partials/wp-bitly-admin-metabox-regenerate.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_query_arg() in wp-content/plugins/wp-bitly/admin/partials/wp-bitly-admin-metabox.php:22
    • > PHP Notice
      Undefined variable: shortlink in wp-content/plugins/wp-bitly/admin/partials/wp-bitly-admin-metabox-regenerate.php on line 17

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3 in wp-bitly/assets to your readme.txt
The official readme.txt is a good inspiration

wp-bitly/wp-bitly.php Passed 13 tests

This is the main PHP file of "Bitly's Wordpress Plugin" version 2.7.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
139 characters long description:
WP Bitly can be used to generate shortlinks for your website posts, pages, and custom post types. Extremely lightweight and easy to set up!

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 plugin4,573 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript44861,6512,540
PHP18436845976
CSS61072837
Sass1170195
Markdown14025

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity8.92
▷ Minimum class complexity1.00
▷ Maximum class complexity35.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods65
▷ Static methods23.08%
▷ Public methods6092.31%
▷ Protected methods00.00%
▷ Private methods57.69%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/b_logo.png2.84KB2.39KB▼ 15.84%
dist/images/b_logo.png2.84KB2.39KB▼ 15.84%