10% syntaxhighlighter-amplified

Code Review | SyntaxHighlighter Amplified

WordPress plugin SyntaxHighlighter Amplified scored10%from 54 tests.

About plugin

  • Plugin page: syntaxhighlighter...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.2
  • WordPress version: 6.3.1
  • First release: May 3, 2023
  • Latest release: May 3, 2023
  • Number of updates: 4
  • Update frequency: every 1.8 days
  • Top authors: kioub (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /287 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/syntaxhighlighter-amplified/shortcodes.php+23
    array_keys() expects parameter 1 to be array, null given

Server metrics [RAM: ▲0.14MB] [CPU: ▼9.11ms] Passed 4 tests

Server-side resources used by SyntaxHighlighter Amplified
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲0.3244.58 ▲2.92
Dashboard /wp-admin3.63 ▲0.2854.50 ▼7.40
Posts /wp-admin/edit.php3.74 ▲0.3846.59 ▲2.57
Add New Post /wp-admin/post-new.php5.52 ▼0.3762.24 ▼34.28
Media Library /wp-admin/upload.php3.55 ▲0.3235.15 ▲2.66
SyntaxHighlighter Amplified /wp-admin/options-general.php?page=shamp_plugin3.4934.29

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 320 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by SyntaxHighlighter Amplified
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.10 ▼0.261.71 ▲0.0842.27 ▼2.45
Dashboard /wp-admin2,199 ▲255.52 ▼0.0494.00 ▼6.6038.87 ▼6.26
Posts /wp-admin/edit.php2,104 ▲42.02 ▲0.0432.90 ▼1.4035.71 ▼0.01
Add New Post /wp-admin/post-new.php6,370 ▲4,84427.55 ▲4.82883.20 ▲203.3049.51 ▼16.99
Media Library /wp-admin/upload.php1,404 ▲44.13 ▼0.0794.05 ▼5.3542.38 ▼3.15
SyntaxHighlighter Amplified /wp-admin/options-general.php?page=shamp_plugin1,3442.0128.0741.10

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
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 35 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=shamp_plugin
    • > Notice in wp-content/plugins/syntaxhighlighter-amplified/sanitizer.php+167
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=shamp_plugin
    • > Notice in wp-content/plugins/syntaxhighlighter-amplified/sanitizer.php+263
    Undefined index: light
    • > GET request to /wp-admin/options-general.php?page=shamp_plugin
    • > Notice in wp-content/plugins/syntaxhighlighter-amplified/sanitizer.php+173
    Undefined variable: title_attr

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
The following issues need your attention
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SyntaxHighlighterAmplified\\add_filter() in wp-content/plugins/syntaxhighlighter-amplified/shortcodes.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SyntaxHighlighterAmplified\\add_action() in wp-content/plugins/syntaxhighlighter-amplified/settings.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SyntaxHighlighterAmplified\\add_filter() in wp-content/plugins/syntaxhighlighter-amplified/shortcodes.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SyntaxHighlighterAmplified\\get_option() in wp-content/plugins/syntaxhighlighter-amplified/blocks.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PhpCsFixer\\Finder' not found in wp-content/plugins/syntaxhighlighter-amplified/vendor/scrivo/highlight.php/.php-cs-fixer.dist.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Highlight\\Mode' not found in wp-content/plugins/syntaxhighlighter-amplified/vendor/scrivo/highlight.php/Highlight/Language.php:48

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
10 plugin tags: highlighting, syntax, wordpresscom, code, source...

syntaxhighlighter-amplified/syntaxhighlighter-amplified.php 92% from 13 tests

The main PHP script in "SyntaxHighlighter Amplified" version 1.0.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected32,797 lines of code in 312 files:
LanguageFilesBlank linesComment linesLines of code
JSON1870023,378
CSS931,2616985,929
PHP286051,6152,824
JavaScript13235483
Markdown31050183

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity20.07
▷ Minimum class complexity1.00
▷ Maximum class complexity113.00
Average method complexity3.74
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces4
Interfaces0
Traits1
Classes13
▷ Abstract classes323.08%
▷ Concrete classes1076.92%
▷ Final classes220.00%
Methods98
▷ Static methods1212.24%
▷ Public methods6364.29%
▷ Protected methods00.00%
▷ Private methods3535.71%
Functions48
▷ Named functions4695.83%
▷ Anonymous functions24.17%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/scrivo/highlight.php/styles/brown-papersq.png17.77KB9.92KB▼ 44.16%
vendor/scrivo/highlight.php/styles/school-book.png0.47KB0.34KB▼ 27.37%