68% shortener-simple

Code Review | Shortener Simple

WordPress plugin Shortener Simple scored68%from 54 tests.

About plugin

  • Plugin page: shortener-simple
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.6
  • WordPress version: 6.3.1
  • First release: Jul 17, 2018
  • Latest release: Jul 19, 2018
  • Number of updates: 5
  • Update frequency: every 0.6 days
  • Top authors: cuxaro (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /629 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.10MB] [CPU: ▲2.85ms] Passed 4 tests

This is a short check of server-side resources used by Shortener Simple
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1042.97 ▲1.04
Dashboard /wp-admin3.40 ▲0.1055.09 ▲8.42
Posts /wp-admin/edit.php3.50 ▲0.1456.87 ▲11.21
Add New Post /wp-admin/post-new.php5.99 ▲0.1092.91 ▼1.51
Media Library /wp-admin/upload.php3.32 ▲0.1040.27 ▲3.46
Añadir enlace /wp-admin/post-new.php?post_type=buzz_shortener3.3549.11
Todos los enlaces /wp-admin/edit.php?post_type=buzz_shortener3.3542.63

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 429 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Shortener Simple
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲9513.53 ▼0.861.68 ▲0.0540.36 ▼4.34
Dashboard /wp-admin2,236 ▲455.85 ▲0.95100.14 ▼7.0139.42 ▼7.58
Posts /wp-admin/edit.php2,119 ▲302.00 ▼0.0635.64 ▼1.7733.31 ▲1.06
Add New Post /wp-admin/post-new.php1,542 ▲2823.31 ▲5.50644.27 ▼6.9856.09 ▲5.90
Media Library /wp-admin/upload.php1,415 ▲274.17 ▼0.0396.65 ▼2.2743.36 ▼1.63
Añadir enlace /wp-admin/post-new.php?post_type=buzz_shortener1,6803.6761.4031.01
Todos los enlaces /wp-admin/edit.php?post_type=buzz_shortener1,0891.9931.0829.51

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

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

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=buzz_shortener
    • > Notice in wp-content/plugins/shortener-simple/shortener-simple.php+147
    Undefined index: default
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=buzz_shortener
    • > Notice in wp-content/plugins/shortener-simple/shortener-simple.php+157
    Undefined index: disable

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
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/shortener-simple/lib/phpqrcode/index.php

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 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
4 plugin tags: redirect, shortener, social media, url

shortener-simple/shortener-simple.php 85% from 13 tests

The primary PHP file in "Shortener Simple" version 1.0.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis 5% from 3 tests

File types 0% from 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
Almost there! Just fix the following issues
  • Do not include executable or dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/shortener-simple/lib/phpqrcode/tools/merge.bat
6,316 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP191,5542,0636,312
Bourne Shell1002
DOS Batch1002

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity31.79
▷ Minimum class complexity1.00
▷ Maximum class complexity292.00
Average method complexity3.81
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes34
▷ Abstract classes00.00%
▷ Concrete classes34100.00%
▷ Final classes00.00%
Methods373
▷ Static methods12232.71%
▷ Public methods27373.19%
▷ Protected methods9625.74%
▷ Private methods41.07%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants99
▷ Global constants99100.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
40 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/phpqrcode/cache/frame_30.png0.25KB0.24KB▼ 4.71%
lib/phpqrcode/cache/frame_6.png0.15KB0.14KB▼ 1.99%
lib/phpqrcode/cache/frame_20.png0.22KB0.20KB▼ 8.00%
lib/phpqrcode/cache/frame_29.png0.23KB0.21KB▼ 7.76%
lib/phpqrcode/cache/frame_37.png0.27KB0.25KB▼ 7.89%