84% danp-bitly-urls

Code Review | DanP Bitly URLs

WordPress plugin DanP Bitly URLs scored 84% from 54 tests.

About plugin

  • Plugin page: danp-bitly-urls
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 6.3.1
  • First release: Jan 11, 2022
  • Latest release: Jan 12, 2022
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: danpoulton (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 264 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.69ms] 75% from 4 tests

Analyzing server-side resources used by DanP Bitly URLs
Please take the time to fix the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 1,277.27ms on /wp-admin/index.php?page=danp-shorturls-update-all)
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0138.03 ▼7.67
Dashboard /wp-admin3.32 ▲0.0146.74 ▼11.34
Posts /wp-admin/edit.php3.37 ▲0.0149.17 ▲4.01
Add New Post /wp-admin/post-new.php5.90 ▲0.0197.18 ▲0.88
Media Library /wp-admin/upload.php3.24 ▲0.0134.76 ▼0.64
Update All URLs /wp-admin/index.php?page=danp-shorturls-update-all3.241,277.27

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
danpurls-bitly-url-last-run
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for DanP Bitly URLs
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.18 ▼1.201.82 ▼0.0342.05 ▼4.89
Dashboard /wp-admin2,203 ▲125.88 ▲0.97109.95 ▲0.2441.02 ▼6.93
Posts /wp-admin/edit.php2,092 ▲32.06 ▲0.0339.50 ▼0.5636.22 ▲0.87
Add New Post /wp-admin/post-new.php1,530 ▼418.33 ▼4.71592.99 ▼56.1259.86 ▲0.55
Media Library /wp-admin/upload.php1,388 ▲34.26 ▲0.0795.30 ▼10.6741.30 ▼3.29
Update All URLs /wp-admin/index.php?page=danp-shorturls-update-all7482.1924.4721.76

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • danpurls-bitly-url-last-run
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% 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)
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
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to a member function register_token_setting() on null in wp-content/plugins/danp-bitly-urls/danp-shorturls-admin.php:4
    • > PHP Notice
      Undefined variable: danp_dot_net_dpbu_shorturls_class in wp-content/plugins/danp-bitly-urls/danp-shorturls-admin.php on line 4

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
3 plugin tags: bitly, short links, short urls

danp-bitly-urls/danp-shorturls.php 92% from 13 tests

The primary PHP file in "DanP Bitly URLs" version 1.1.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("danp-bitly-urls.php" instead of "danp-shorturls.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected206 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP31999206

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity19.00
▷ Minimum class complexity19.00
▷ Maximum class complexity19.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
Constants3
▷ Global constants3100.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
No PNG files were detected