84% shortcode-button

Code Review | Shortcode Button

WordPress plugin Shortcode Button scored84%from 54 tests.

About plugin

  • Plugin page: shortcode-button
  • Plugin version: 1.1.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.8
  • WordPress version: 6.3.1
  • First release: Mar 2, 2014
  • Latest release: Jun 13, 2014
  • Number of updates: 40
  • Update frequency: every 2.6 days
  • Top authors: eflyjason (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active /2,813 total downloads

Benchmarks

Plugin footprint 83% from 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.02MB] [CPU: ▼11.41ms] Passed 4 tests

Server-side resources used by Shortcode Button
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.39 ▼1.40
Dashboard /wp-admin3.33 ▼0.0149.54 ▼15.94
Posts /wp-admin/edit.php3.38 ▲0.0345.77 ▼9.36
Add New Post /wp-admin/post-new.php5.91 ▲0.0387.90 ▼18.92
Media Library /wp-admin/upload.php3.26 ▲0.0339.00 ▲1.20
Shortcode Button /wp-admin/tools.php?page=shortcode-button-help3.2232.04

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Shortcode Button
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲6214.74 ▲0.351.90 ▲0.0148.32 ▲1.05
Dashboard /wp-admin2,227 ▲215.83 ▼0.05118.63 ▲13.1543.89 ▲0.74
Posts /wp-admin/edit.php2,106 ▲62.05 ▲0.0334.40 ▼5.8333.13 ▼5.51
Add New Post /wp-admin/post-new.php1,531 ▼023.22 ▲0.05610.13 ▼64.3977.91 ▲10.26
Media Library /wp-admin/upload.php1,406 ▲64.19 ▼0.06112.44 ▼0.5454.99 ▲6.29
Shortcode Button /wp-admin/tools.php?page=shortcode-button-help8312.0225.7231.14

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/shortcode-button/help.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/shortcode-button/shortcode-button.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: button, shortcode

shortcode-button/shortcode-button.php Passed 13 tests

The primary PHP file in "Shortcode Button" version 1.1.9 is used by WordPress to initiate all plugin functionality
113 characters long description:
Add Useful Buttons to your blog simply by shortcode. 在你的部落格中使用短代碼來加入實用的按鈕

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected299 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
CSS2310144
PHP2192581
PO File2202274

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.11
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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.03MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/but-link.png4.95KB1.75KB▼ 64.71%
img/but-down.png7.08KB2.04KB▼ 71.20%
img/but-document.png7.26KB2.09KB▼ 71.26%
img/but-heart.png6.70KB1.81KB▼ 72.96%