78% tailored-shortcodes

Code Review | Tailored Shortcodes

WordPress plugin Tailored Shortcodes scored78%from 54 tests.

About plugin

  • Plugin page: tailored-shortcodes
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-4.9.6
  • WordPress version: 6.3.1
  • First release: May 28, 2018
  • Latest release: May 28, 2018
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: ajferg (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /569 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.68MB] [CPU: ▼16.96ms] Passed 4 tests

Server-side resources used by Tailored Shortcodes
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0332.22 ▼10.32
Dashboard /wp-admin3.33 ▲0.0245.91 ▼0.27
Posts /wp-admin/edit.php3.38 ▲0.0248.19 ▲1.46
Add New Post /wp-admin/post-new.php3.11 ▼2.7735.37 ▼58.33
Media Library /wp-admin/upload.php3.25 ▲0.0236.15 ▲1.07
Tailored Shortcodes /wp-admin/edit.php?post_type=tailored_shortcode3.2933.14
Add Shortcode /wp-admin/post-new.php?post_type=tailored_shortcode3.1129.92

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Tailored Shortcodes
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲9513.18 ▼1.551.81 ▼0.2039.87 ▼9.21
Dashboard /wp-admin2,233 ▲544.86 ▼0.95110.59 ▲10.4842.79 ▼3.73
Posts /wp-admin/edit.php2,116 ▲242.05 ▼0.1340.42 ▲0.3934.67 ▼0.71
Add New Post /wp-admin/post-new.php1,571 ▲2818.31 ▼0.04608.76 ▼3.7564.26 ▲11.55
Media Library /wp-admin/upload.php1,418 ▲334.19 ▼0.0095.79 ▼1.4441.24 ▼1.13
Tailored Shortcodes /wp-admin/edit.php?post_type=tailored_shortcode1,0801.9831.6628.11
Add Shortcode /wp-admin/post-new.php?post_type=tailored_shortcode1,7335.2493.9843.16

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/post-new.php?post_type=tailored_shortcode
    • > Notice in wp-content/plugins/tailored-shortcodes/plugin.php+89
    Undefined index: save_shortcode

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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tailored-shortcodes/plugin.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Tags: No tags were detected
The official readme.txt is a good inspiration

tailored-shortcodes/plugin.php 85% from 13 tests

The principal PHP file in "Tailored Shortcodes" v. 1.0.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("tailored-shortcodes.php" instead of "plugin.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 141 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin122 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP13132122

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity15.00
▷ Minimum class complexity15.00
▷ Maximum class complexity15.00
Average method complexity2.56
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin