84% shortcode-with-preview-block

Code Review | Shortcode Preview Block

WordPress plugin Shortcode Preview Block scored84%from 54 tests.

About plugin

  • Plugin page: shortcode-with-pr...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Jul 24, 2020
  • Latest release: Dec 9, 2022
  • Number of updates: 17
  • Update frequency: every 51.1 days
  • Top authors: ronakganatra (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

300+ active /2,009 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.79ms] Passed 4 tests

Server-side resources used by Shortcode Preview Block
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0240.66 ▼3.38
Dashboard /wp-admin3.31 ▲0.0146.70 ▼5.90
Posts /wp-admin/edit.php3.36 ▲0.0149.57 ▲0.64
Add New Post /wp-admin/post-new.php5.89 ▲0.0187.41 ▼10.53
Media Library /wp-admin/upload.php3.24 ▲0.0132.93 ▼3.35

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Shortcode Preview Block: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.74 ▲0.451.82 ▼0.3145.04 ▼7.16
Dashboard /wp-admin2,209 ▲185.84 ▼0.0598.99 ▼2.9636.89 ▼4.90
Posts /wp-admin/edit.php2,089 ▲32.00 ▲0.0141.56 ▲6.8835.16 ▲1.87
Add New Post /wp-admin/post-new.php6,415 ▲4,89828.53 ▲11.03918.15 ▲203.1155.17 ▼1.92
Media Library /wp-admin/upload.php1,391 ▲64.23 ▲0.0198.06 ▼0.9744.49 ▲2.78

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

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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/shortcode-with-preview-block/shortcode-preview-block.php:10

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)
Everything seems fine, but this is not an exhaustive test

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
5 plugin tags: block, blocks, shortcode, preview, gutenberg

shortcode-with-preview-block/shortcode-preview-block.php 85% from 13 tests

"Shortcode Preview Block" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("shortcode-with-preview-block.php" instead of "shortcode-preview-block.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 185 characters long)

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
Success! There were no dangerous files found in this plugin61 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP171544
JSON10015
CSS1031
JavaScript1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png7.21KB5.39KB▼ 25.23%