88% custom-tinymce-shortcode-button

Code Review | Custom TinyMCE Shortcode Button

WordPress plugin Custom TinyMCE Shortcode Button scored 88% from 54 tests.

About plugin

  • Plugin page: custom-tinymce-sh...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.2-3.7
  • WordPress version: 5.9.2
  • First release: Aug 3, 2011
  • Latest release: Nov 17, 2013
  • Number of updates: 4
  • Update frequency: every 209.3 days
  • Top authors: nrowe (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

300+ active / 7,587 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by Custom TinyMCE Shortcode Button
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0351.10 ▲0.20
Dashboard /wp-admin3.43 ▲0.0232.49 ▲0.44
Posts /wp-admin/edit.php3.66 ▲0.0236.90 ▼1.23
Add New Post /wp-admin/post-new.php6.93 ▼0.0796.86 ▼1,181.07
Media Library /wp-admin/upload.php3.31 ▲0.0222.43 ▼1.28
Shortcode Button /wp-admin/options-general.php?page=stscb-page-elements3.2625.00

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Custom TinyMCE Shortcode Button
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,768 ▲1416.18 ▲0.525.90 ▼0.362.23 ▼0.64
Dashboard /wp-admin2,897 ▲396.00 ▼0.20115.60 ▼18.38157.19 ▼1.61
Posts /wp-admin/edit.php2,715 ▲243.27 ▲0.0463.65 ▼11.36139.82 ▼13.69
Add New Post /wp-admin/post-new.php1,669 ▲916.35 ▲0.40405.57 ▼19.02159.67 ▼3.90
Media Library /wp-admin/upload.php1,716 ▲185.57 ▲0.06136.41 ▼7.23193.39 ▲4.20
Shortcode Button /wp-admin/options-general.php?page=stscb-page-elements1,1012.7558.08124.25

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=stscb-page-elements
    • > Notice in wp-content/plugins/custom-tinymce-shortcode-button/settings.php+11
    Undefined index: sc-name
    • > GET request to /wp-admin/options-general.php?page=stscb-page-elements
    • > Notice in wp-content/plugins/custom-tinymce-shortcode-button/settings.php+12
    Undefined index: sc-img-url
    • > GET request to /wp-admin/options-general.php?page=stscb-page-elements
    • > Notice in wp-content/plugins/custom-tinymce-shortcode-button/settings.php+13
    Undefined index: sc-init

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 2× 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/custom-tinymce-shortcode-button/settings.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-tinymce-shortcode-button/settings.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% 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
These attributes need your attention:
  • Screenshots: Please add an image for screenshot #1 (This screenshot shows a custom button in the TinyMCE editor displaying the defaults button image and shortcode.)
The official readme.txt is a good inspiration

custom-tinymce-shortcode-button/custom-tinymce-shortcode-button.php 92% from 13 tests

The main PHP script in "Custom TinyMCE Shortcode Button" version 1.1 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 196 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 plugin146 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2198116
JavaScript17030

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
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%
Functions7
▷ Named functions7100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
image.png0.30KB0.21KB▼ 32.48%