78% baw-autoshortener

Code Review | BAW AutoShortener

WordPress plugin BAW AutoShortener scored 78% from 54 tests.

About plugin

  • Plugin page: baw-autoshortener
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.2
  • WordPress version: 5.8.1
  • First release: Jun 1, 2011
  • Latest release: Jun 1, 2011
  • Number of updates: 12
  • Update frequency: every 17.0 days
  • Top authors: juliobox (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,690 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.79MB] [CPU: ▼177.29ms] Passed 4 tests

An overview of server-side resources used by BAW AutoShortener
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.81 ▼0.0217.76 ▼14.86
Dashboard /wp-admin2.86 ▼0.1918.98 ▼28.55
Posts /wp-admin/edit.php2.86 ▼0.2519.44 ▼21.69
Add New Post /wp-admin/post-new.php2.86 ▼2.5719.23 ▼640.44
Media Library /wp-admin/upload.php2.86 ▼0.1414.21 ▼18.48
Auto Shortener /wp-admin/admin.php?page=baw_as_config2.8617.95
BoiteAWeb /wp-admin/admin.php?page=baw_menu2.8617.79

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 54 new files
Database: no new tables, 21 new options
New WordPress options
baw-as_autokeyword
baw-as_uselast
baw-as_fordibben_keywords
baw-as_sortby
baw-as_whichtab
baw-as_usehelp
baw-as_generated_name
baw-as_keepqueryvars
baw-as_replacepermalink
baw-as_reflevel
...

Browser metrics Passed 4 tests

BAW AutoShortener: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,018 ▲42216.24 ▲0.6712.10 ▲1.7943.62 ▼6.21
Dashboard /wp-admin3,301 ▲3706.34 ▲0.09147.94 ▲6.00163.48 ▲48.14
Posts /wp-admin/edit.php2,837 ▲982.41 ▼0.3073.14 ▼15.4988.14 ▲0.53
Add New Post /wp-admin/post-new.php1,774 ▲27621.55 ▲2.65353.92 ▼42.78119.37 ▲10.42
Media Library /wp-admin/upload.php1,809 ▲25.11 ▲0.10138.53 ▼4.53141.52 ▲23.36
Auto Shortener /wp-admin/admin.php?page=baw_as_config3,1752.6065.16106.40
BoiteAWeb /wp-admin/admin.php?page=baw_menu1,5292.4162.86129.55

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/baw-autoshortener/functions.inc.php+321
    Undefined index: query

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=baw_menu
    • > Notice in wp-content/plugins/baw-autoshortener/functions.inc.php+322
    Undefined index: fragment
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=baw_menu
    • > Notice in wp-content/plugins/baw-autoshortener/baw_auto_shortener.php+278
    Undefined offset: 0
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=baw_menu
    • > Notice in wp-content/plugins/baw-autoshortener/baw_auto_shortener.php+278
    Trying to get property 'ID' of non-object

SRP 50% 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 fix the following items
  • 10× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/baw-autoshortener/includes/general-settings.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/baw-autoshortener/defines.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/baw-autoshortener/functions.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/baw-autoshortener/includes/advanced-settings.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/baw-autoshortener/includes/help.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/baw-autoshortener/about.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/baw-autoshortener/includes/tools.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/baw-autoshortener/infos.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/baw-autoshortener/defines.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/baw-autoshortener/includes/special-redirections.inc.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
Please take inspiration from this readme.txt

baw-autoshortener/baw_auto_shortener.php 92% from 13 tests

This is the main PHP file of "BAW AutoShortener" version 1.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("baw-autoshortener.php" instead of "baw_auto_shortener.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
There were no executable files found in this plugin2,762 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP1177271,528
PO File1231357441
CSS5780435
JavaScript4220358

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions50
▷ Named functions50100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
26 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/notvalid.png0.87KB1.00KB0.00%
images/help.png1.67KB1.39KB▼ 16.74%
images/schain.png1.21KB0.35KB▼ 70.79%
images/edit.png0.73KB0.75KB0.00%
images/minidel.png0.20KB0.13KB▼ 32.18%