84% bitly-url-generator

Code Review | Bitly URL Generator

WordPress plugin Bitly URL Generator scored84%from 54 tests.

About plugin

  • Plugin page: bitly-url-generator
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.5
  • WordPress version: 6.3.1
  • First release: Dec 15, 2012
  • Latest release: Dec 19, 2012
  • Number of updates: 5
  • Update frequency: every 1.0 days
  • Top authors: micahwave (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,743 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼5.40ms] Passed 4 tests

Server-side resources used by Bitly URL Generator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.23 ▼6.20
Dashboard /wp-admin3.35 ▲0.0448.56 ▼4.24
Posts /wp-admin/edit.php3.40 ▲0.0445.95 ▼1.76
Add New Post /wp-admin/post-new.php5.93 ▲0.0491.17 ▼9.41
Media Library /wp-admin/upload.php3.27 ▲0.0441.37 ▲6.97
Bitly /wp-admin/options-general.php?page=bitly-settings3.2328.27

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Bitly URL Generator: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.28 ▼0.071.57 ▼0.5139.23 ▼5.01
Dashboard /wp-admin2,196 ▲195.62 ▼0.0094.37 ▼3.6842.87 ▼1.05
Posts /wp-admin/edit.php2,104 ▲11.99 ▲0.0537.81 ▼4.1733.13 ▼1.35
Add New Post /wp-admin/post-new.php1,529 ▼623.16 ▲4.99673.10 ▼7.3857.97 ▼20.35
Media Library /wp-admin/upload.php1,398 ▲14.20 ▲0.06103.73 ▼4.6743.47 ▲1.97
Bitly /wp-admin/options-general.php?page=bitly-settings8062.0327.1328.76

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

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
Even though everything seems fine, this is not 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
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_parse_args() in wp-content/plugins/bitly-url-generator/bitly-url-generator.php:110

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
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:
  • Donate link: Invalid URI found ("")
The official readme.txt might help

bitly-url-generator/bitly-url-generator.php Passed 13 tests

The primary PHP file in "Bitly URL Generator" version 1.0 is used by WordPress to initiate all plugin functionality
85 characters long description:
Uses bitly API to get shortened url for a post on publish and saves url as meta data.

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
No dangerous file extensions were detected155 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP15568148
Markdown1207

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin