84% print-button-shortcode

Code Review | Name: Print Button Shortcode

WordPress plugin Name: Print Button Shortcodescored84%from 54 tests.

About plugin

  • Plugin page: print-button-shor...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9-3.4.2
  • WordPress version: 6.3.1
  • First release: Feb 13, 2012
  • Latest release: Dec 4, 2012
  • Number of updates: 6
  • Update frequency: every 50.3 days
  • Top authors: ChrisHurst (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /8,554 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.90ms] Passed 4 tests

This is a short check of server-side resources used by Name: Print Button Shortcode
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0038.54 ▼2.40
Dashboard /wp-admin3.31 ▲0.0143.91 ▼4.87
Posts /wp-admin/edit.php3.36 ▲0.0044.60 ▼3.89
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.34 ▼12.43
Media Library /wp-admin/upload.php3.23 ▲0.0034.14 ▲1.87

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Name: Print Button Shortcode
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.23 ▼0.171.83 ▲0.1743.26 ▲0.46
Dashboard /wp-admin2,195 ▲185.58 ▼0.0084.95 ▼5.2537.96 ▲0.08
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0435.74 ▼3.5834.91 ▼1.76
Add New Post /wp-admin/post-new.php1,535 ▲918.34 ▼4.46624.91 ▲9.5177.08 ▲2.52
Media Library /wp-admin/upload.php1,403 ▼04.19 ▼0.0397.99 ▲1.1143.21 ▼0.02

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/print-button-shortcode/print-button-shortcode.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Screenshot #1 (Example output of shortcode) image required
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === Name: Print Button Shortcode=== )
Please take inspiration from this readme.txt

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

"Name: Print Button Shortcode" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
69 characters long description:
Shortcode to add a Print Button that prints a specified HTML element.

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 plugin17 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1162417

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.20
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin