74% shortcode-variables

Code Review | Snippet Shortcodes

WordPress plugin Snippet Shortcodes scored74%from 54 tests.

About plugin

  • Plugin page: shortcode-variables
  • Plugin version: 4.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.4.1
  • WordPress version: 6.3.1
  • First release: Jul 21, 2015
  • Latest release: Nov 23, 2023
  • Number of updates: 61
  • Update frequency: every 50.0 days
  • Top authors: aliakro (100%)

Code review

54 tests

User reviews

23 reviews

Install metrics

5,000+ active /58,343 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by Snippet Shortcodes
It is recommended to improve the following
  • CPU: Try to keep total CPU usage under 500.00ms (currently 2,433.42ms on /wp-admin/admin.php?page=sh-cd-shortcode-variables-license)
PageMemory (MB)CPU Time (ms)
Home /3.91 ▲0.4438.01 ▼5.52
Dashboard /wp-admin3.76 ▲0.4151.68 ▼15.37
Posts /wp-admin/edit.php3.82 ▲0.4550.71 ▲0.60
Add New Post /wp-admin/post-new.php6.30 ▲0.4191.82 ▼10.69
Media Library /wp-admin/upload.php3.63 ▲0.3940.96 ▲7.77
Upgrade to Premium /wp-admin/admin.php?page=sh-cd-shortcode-variables-license3.672,433.42
Your shortcodes /wp-admin/admin.php?page=sh-cd-shortcode-variables-your-shortcodes3.5938.35
Premade shortcodes /wp-admin/admin.php?page=sh-cd-shortcode-variables-sub-premade3.6034.30
/wp-admin/admin.php?page=sh-cd-shortcode-variables-main-menu3.5934.48
Help /wp-admin/admin.php?page=sh-cd-help3.5932.66
Settings /wp-admin/admin.php?page=sh-cd-settings3.5932.28
Import shortcodes /wp-admin/admin.php?page=sh-cd-import3.6137.20

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 50 new files
Database: 2 new tables, 8 new options
New tables
wp_SH_CD_SHORTCODES
wp_SH_CD_SHORTCODES_MULTISITE
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
sh-cd-hash
sh-cd-version-number-2021
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Snippet Shortcodes: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,849 ▲8714.72 ▲0.371.52 ▼0.2738.04 ▼8.28
Dashboard /wp-admin2,254 ▲735.61 ▼0.1196.88 ▼8.5243.35 ▲4.47
Posts /wp-admin/edit.php2,159 ▲592.00 ▲0.0540.13 ▼5.1537.53 ▼0.28
Add New Post /wp-admin/post-new.php1,575 ▲4923.45 ▲0.52691.91 ▲106.1962.05 ▲5.24
Media Library /wp-admin/upload.php1,459 ▲654.27 ▲0.0197.72 ▼5.9540.92 ▼2.53
Upgrade to Premium /wp-admin/admin.php?page=sh-cd-shortcode-variables-license1,1642.0625.8544.06
Your shortcodes /wp-admin/admin.php?page=sh-cd-shortcode-variables-your-shortcodes9562.0426.6225.13
Premade shortcodes /wp-admin/admin.php?page=sh-cd-shortcode-variables-sub-premade1,3482.0526.2446.94
/wp-admin/admin.php?page=sh-cd-shortcode-variables-main-menu9562.0725.9925.43
Help /wp-admin/admin.php?page=sh-cd-help9452.1426.7324.95
Settings /wp-admin/admin.php?page=sh-cd-settings9232.0326.9029.31
Import shortcodes /wp-admin/admin.php?page=sh-cd-import1,1043.0247.4225.02

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_SH_CD_SHORTCODES_MULTISITE
    • wp_SH_CD_SHORTCODES
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_recent-comments
    • sh-cd-hash
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • sh-cd-version-number-2021
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 19× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/shortcode-variables/includes/pages/page.edit.php
    • > /wp-content/plugins/shortcode-variables/includes/hooks.php
    • > /wp-content/plugins/shortcode-variables/includes/pages/page.settings.php
    • > /wp-content/plugins/shortcode-variables/includes/pages/page.help.php
    • > /wp-content/plugins/shortcode-variables/includes/pages/page.premade.php
    • > /wp-content/plugins/shortcode-variables/includes/shortcode.presets.premium.php
    • > /wp-content/plugins/shortcode-variables/includes/shortcode.user.php
    • > /wp-content/plugins/shortcode-variables/includes/db.php
    • > /wp-content/plugins/shortcode-variables/includes/shortcode.presets.core.php
    • > /wp-content/plugins/shortcode-variables/includes/shortcode.presets.free.php

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

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
9 plugin tags: html, reuse, shortcode, embed, text...

shortcode-variables/shortcode-variables.php 92% from 13 tests

The principal PHP file in "Snippet Shortcodes" v. 4.1 is loaded by WordPress automatically on each request
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 197 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected3,202 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
PHP198717102,075
XML400502
Markdown11970221
JavaScript28075200
HTML1203138
CSS10057
YAML2009

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity3.69
▷ Minimum class complexity1.00
▷ Maximum class complexity19.00
Average method complexity3.06
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes26
▷ Abstract classes13.85%
▷ Concrete classes2596.15%
▷ Final classes00.00%
Methods35
▷ Static methods00.00%
▷ Public methods720.00%
▷ Protected methods2777.14%
▷ Private methods12.86%
Functions100
▷ Named functions9999.00%
▷ Anonymous functions11.00%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.24MB with 0.15MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/pages/assets/images/yeken-logo.png8.83KB4.42KB▼ 49.97%
docs/assets/images/product-logo.png13.30KB5.15KB▼ 61.28%
docs/assets/images/add-edit.png117.83KB34.28KB▼ 70.90%
docs/assets/images/list.png107.38KB33.33KB▼ 68.96%