99% widget-shortcode

Code Review | Widget Shortcode

WordPress plugin Widget Shortcode scored 99% from 54 tests.

About plugin

  • Plugin page: widget-shortcode
  • Plugin version: 0.3.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.4.1
  • WordPress version: 5.8.1
  • First release: Dec 23, 2011
  • Latest release: May 4, 2020
  • Number of updates: 81
  • Update frequency: every 37.7 days
  • Top authors: shazdeh (100%)

Code review

54 tests

User reviews

66 reviews

Install metrics

90,000+ active / 615,317 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼152.35ms] Passed 4 tests

An overview of server-side resources used by Widget Shortcode
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.0629.35 ▲2.19
Dashboard /wp-admin3.12 ▲0.0537.42 ▼5.33
Posts /wp-admin/edit.php3.20 ▲0.0933.97 ▼2.22
Add New Post /wp-admin/post-new.php5.48 ▲0.0477.27 ▼604.05
Media Library /wp-admin/upload.php3.06 ▲0.0630.73 ▲7.18

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Widget Shortcode
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,666 ▲6515.73 ▼0.167.81 ▲2.9576.91 ▼0.44
Dashboard /wp-admin2,930 ▲386.01 ▼0.15114.79 ▼15.39161.10 ▼18.47
Posts /wp-admin/edit.php2,740 ▲33.10 ▼0.1462.94 ▼2.16132.47 ▼7.24
Add New Post /wp-admin/post-new.php3,823 ▲8819.42 ▲0.77436.98 ▼18.12157.37 ▼10.00
Media Library /wp-admin/upload.php1,752 ▼05.47 ▼0.04132.90 ▼22.65179.93 ▼5.88

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: widget, shortcode, theme, admin

widget-shortcode/init.php 85% from 13 tests

The principal PHP file in "Widget Shortcode" v. 0.3.5 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("widget-shortcode.php" instead of "init.php")
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin313 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP455124246
JavaScript24267

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity13.67
▷ Minimum class complexity2.00
▷ Maximum class complexity34.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods19
▷ Static methods315.79%
▷ Public methods1684.21%
▷ Protected methods00.00%
▷ Private methods315.79%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/widget-icon.png0.77KB0.79KB0.00%