10% syntaxhighlighter-tinymce-button

Code Review | SyntaxHighlighter TinyMCE Button

WordPress plugin SyntaxHighlighter TinyMCE Button scored 10% from 54 tests.

About plugin

  • Plugin page: syntaxhighlighter...
  • Plugin version: 0.7.8.4
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-3.3
  • WordPress version: 6.3.1
  • First release: Apr 30, 2011
  • Latest release: Dec 24, 2011
  • Number of updates: 151
  • Update frequency: every 1.6 days
  • Top authors: redcocker (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active / 20,543 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/syntaxhighlighter-tinymce-button/sh-tinymce-button.php+171
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.12MB] [CPU: ▲0.09ms] Passed 4 tests

Analyzing server-side resources used by SyntaxHighlighter TinyMCE Button
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1240.28 ▲0.35
Dashboard /wp-admin3.42 ▲0.1247.23 ▼0.35
Posts /wp-admin/edit.php3.53 ▲0.1849.71 ▲1.98
Add New Post /wp-admin/post-new.php6.00 ▲0.1293.73 ▼1.62
Media Library /wp-admin/upload.php3.34 ▲0.1137.71 ▲2.52
SH TinyMCE Button /wp-admin/options-general.php?page=syntaxhighlighter-tinymce-button-options3.2930.66

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 32 new files
Database: no new tables, 11 new options
New WordPress options
widget_theysaidso_widget
shtb_adv_updated
can_compress_scripts
widget_recent-comments
shtb_adv_languages
shtb_adv_checkver_stamp
shtb_adv_setting_opt
theysaidso_admin_options
db_upgraded
recovery_mode_email_last_sent
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for SyntaxHighlighter TinyMCE Button
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲8013.63 ▼0.731.74 ▼0.2240.51 ▼8.70
Dashboard /wp-admin2,218 ▲305.83 ▲0.9997.38 ▼14.9440.66 ▼1.71
Posts /wp-admin/edit.php2,106 ▲172.12 ▲0.0838.90 ▲1.3838.25 ▲6.16
Add New Post /wp-admin/post-new.php1,545 ▲323.50 ▲5.31646.98 ▼8.8550.06 ▼1.15
Media Library /wp-admin/upload.php1,406 ▲244.25 ▲0.0696.59 ▼2.5144.54 ▲0.50
SH TinyMCE Button /wp-admin/options-general.php?page=syntaxhighlighter-tinymce-button-options1,6361.536.3027.51

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • recovery_mode_email_last_sent

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=syntaxhighlighter-tinymce-button-options
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=syntaxhighlighter-tinymce-button-options
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 70 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=syntaxhighlighter-tinymce-button-options
    • > Notice in wp-content/plugins/syntaxhighlighter-tinymce-button/sh-tinymce-button.php+356
    Undefined variable: lang
    • > GET request to /wp-admin/options-general.php?page=syntaxhighlighter-tinymce-button-options
    • > Error in wp-content/plugins/syntaxhighlighter-tinymce-button/sh-tinymce-button.php+380
    Uncaught Error: Call to undefined function mysql_get_server_info() in wp-content/plugins/syntaxhighlighter-tinymce-button/sh-tinymce-button.php:380
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): shtb_adv_options_panel()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #5 {main}
    thrown

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
Please fix the following items
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function delete_option() in wp-content/plugins/syntaxhighlighter-tinymce-button/del-old-options.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/syntaxhighlighter-tinymce-button/sh-tinymce-button.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/syntaxhighlighter-tinymce-button/sh-tinymce-button-ins/sh-tinymce-button-ins.php:66
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/syntaxhighlighter-tinymce-button/data-migration.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/syntaxhighlighter-tinymce-button/sh-tinymce-button-box/sh-tinymce-button-box.php:65

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (This is added buttons on TinyMCE.), #2 (This is pop up window at the click of "pre" button.), #3 (This is pop up window at the click of "CODE" button.), #4 (This is setting panel.)
The official readme.txt is a good inspiration

syntaxhighlighter-tinymce-button/sh-tinymce-button.php 77% from 13 tests

Analyzing the main PHP file in "SyntaxHighlighter TinyMCE Button" version 0.7.8.4
Please make the necessary changes and fix the following:
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Description: Please don't use more than 140 characters for the plugin description (currently 385 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("syntaxhighlighter-tinymce-button.php" instead of "sh-tinymce-button.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected1,373 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP95591826
JavaScript107837390
PO File16779149
CSS1108

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.53
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%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
sh-tinymce-button-ins/shtb_img.png2.92KB0.22KB▼ 92.40%
sh-tinymce-button-box/shtb_img.png2.88KB0.19KB▼ 93.50%