94% wp-syntax-highlighter

Code Review | wp-syntax-highlighter

WordPress plugin wp-syntax-highlighter scored 94% from 54 tests.

About plugin

  • Plugin page: wp-syntax-highlig...
  • Plugin version: 0.5.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-3.9.2
  • WordPress version: 5.8.1
  • First release: May 7, 2014
  • Latest release: Aug 7, 2014
  • Number of updates: 26
  • Update frequency: every 3.5 days
  • Top authors: dsawardekar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,268 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.20MB] [CPU: ▼146.13ms] Passed 4 tests

This is a short check of server-side resources used by wp-syntax-highlighter
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.06 ▲0.2233.48 ▼0.08
Dashboard /wp-admin3.26 ▲0.2139.46 ▼10.06
Posts /wp-admin/edit.php3.31 ▲0.2147.83 ▲0.22
Add New Post /wp-admin/post-new.php5.61 ▲0.1881.87 ▼574.39
Media Library /wp-admin/upload.php3.21 ▲0.2133.64 ▲0.01
WP Syntax Highlighter /wp-admin/options-general.php?page=wp-syntax-highlighter3.1431.35

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 380 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

wp-syntax-highlighter: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,687 ▲9115.96 ▼0.0710.53 ▼0.5845.35 ▲0.52
Dashboard /wp-admin2,975 ▲415.95 ▲0.03142.35 ▼4.87110.05 ▼3.81
Posts /wp-admin/edit.php2,744 ▲52.71 ▼0.0070.61 ▲2.6892.57 ▲3.16
Add New Post /wp-admin/post-new.php1,501 ▼18218.84 ▲0.36415.60 ▲39.08109.30 ▲2.21
Media Library /wp-admin/upload.php1,812 ▲25.01 ▼0.06151.66 ▼0.68111.34 ▼7.03
WP Syntax Highlighter /wp-admin/options-general.php?page=wp-syntax-highlighter1,3033.9091.4085.11

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 140× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/wp-syntax-highlighter/vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression' not found in wp-content/plugins/wp-syntax-highlighter/vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig_FunctionInterface' not found in wp-content/plugins/wp-syntax-highlighter/vendor/twig/twig/lib/Twig/Function.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Arrow\\Sentry' not found in wp-content/plugins/wp-syntax-highlighter/vendor/dsawardekar/arrow/lib/Arrow/Ajax/Sentry.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Unary' not found in wp-content/plugins/wp-syntax-highlighter/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Extension' not found in wp-content/plugins/wp-syntax-highlighter/vendor/twig/twig/lib/Twig/Extension/Optimizer.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/wp-syntax-highlighter/vendor/twig/twig/lib/Twig/Node/For.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig_NodeVisitorInterface' not found in wp-content/plugins/wp-syntax-highlighter/vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/wp-syntax-highlighter/vendor/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_TokenParser' not found in wp-content/plugins/wp-syntax-highlighter/vendor/twig/twig/lib/Twig/TokenParser/Use.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 97% 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
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (Screenshot 1), #2 (Screenshot 2)
You can look at the official readme.txt

wp-syntax-highlighter/wp-syntax-highlighter.php Passed 13 tests

The principal PHP file in "wp-syntax-highlighter" v. 0.5.1 is loaded by WordPress automatically on each request
47 characters long description:
WordPress Syntax Highlighter using Highlight.js

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin35,767 lines of code in 369 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript923,0558,22319,282
PHP2212,7255,12411,345
CSS546823864,882
JSON100248
HTML11010

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity6.79
▷ Minimum class complexity1.00
▷ Maximum class complexity116.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces9
Interfaces20
Traits0
Classes197
▷ Abstract classes105.08%
▷ Concrete classes18794.92%
▷ Final classes00.00%
Methods1,162
▷ Static methods161.38%
▷ Public methods1,05290.53%
▷ Protected methods1089.29%
▷ Private methods20.17%
Functions52
▷ Named functions5198.08%
▷ Anonymous functions11.92%
Constants38
▷ Global constants12.63%
▷ Class constants3797.37%
▷ Public constants37100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up 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
css/school_book.png0.47KB0.34KB▼ 27.37%
css/brown_papersq.png17.77KB9.92KB▼ 44.16%