84% wp-geshi-highlight

Code Review | WP-GeSHi-Highlight — rock-solid syntax highlighting for 259 languages

WordPress plugin WP-GeSHi-Highlight — rock-solid syntax highlighting for 259 languages scored84%from 54 tests.

About plugin

  • Plugin page: wp-geshi-highlight
  • Plugin version: 1.4.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2
  • WordPress version: 6.3.1
  • First release: Nov 22, 2010
  • Latest release: Apr 30, 2023
  • Number of updates: 129
  • Update frequency: every 35.2 days
  • Top authors: jgehrcke (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

600+ active /30,125 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

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

Analyzing server-side resources used by WP-GeSHi-Highlight — rock-solid syntax highlighting for 259 languages
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.53 ▼3.02
Dashboard /wp-admin3.31 ▲0.0046.59 ▼2.92
Posts /wp-admin/edit.php3.36 ▲0.0052.07 ▼0.52
Add New Post /wp-admin/post-new.php5.89 ▲0.0094.26 ▲0.54
Media Library /wp-admin/upload.php3.23 ▲0.0036.73 ▼1.73

Server storage [IO: ▲3.97MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 261 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for WP-GeSHi-Highlight — rock-solid syntax highlighting for 259 languages
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.38 ▼0.291.62 ▼0.0642.07 ▲0.09
Dashboard /wp-admin2,198 ▲185.64 ▼0.0589.89 ▼2.6440.12 ▲0.16
Posts /wp-admin/edit.php2,100 ▼32.04 ▲0.0438.37 ▼23.6937.24 ▼6.85
Add New Post /wp-admin/post-new.php1,545 ▲1423.20 ▼0.30632.90 ▼56.9051.12 ▼8.65
Media Library /wp-admin/upload.php1,397 ▼04.23 ▼0.01122.85 ▲13.2249.72 ▲3.59

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
  • 2125× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant GESHI_AFTER - assumed 'GESHI_AFTER' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-geshi-highlight/geshi/geshi/dos.php on line 187
    • > PHP Warning
      Use of undefined constant GESHI_NUMBER_FLT_SCI_ZERO - assumed 'GESHI_NUMBER_FLT_SCI_ZERO' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-geshi-highlight/geshi/geshi/asm.php on line 583
    • > PHP Warning
      Use of undefined constant GESHI_NUMBER_BIN_PREFIX_PERCENT - assumed 'GESHI_NUMBER_BIN_PREFIX_PERCENT' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-geshi-highlight/geshi/geshi/68000devpac.php on line 123
    • > PHP Warning
      Use of undefined constant GESHI_NEVER - assumed 'GESHI_NEVER' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-geshi-highlight/geshi/geshi/bf.php on line 96
    • > PHP Warning
      Use of undefined constant GESHI_SEARCH - assumed 'GESHI_SEARCH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-geshi-highlight/geshi/geshi/xojo.php on line 261
    • > PHP Warning
      Use of undefined constant GESHI_BEFORE - assumed 'GESHI_BEFORE' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-geshi-highlight/geshi/geshi/rsplus.php on line 466
    • > PHP Warning
      Use of undefined constant GESHI_MODIFIERS - assumed 'GESHI_MODIFIERS' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-geshi-highlight/geshi/geshi/diff.php on line 136
    • > PHP Warning
      Use of undefined constant GESHI_MODIFIERS - assumed 'GESHI_MODIFIERS' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-geshi-highlight/geshi/geshi/reg.php on line 170
    • > PHP Warning
      Use of undefined constant GESHI_BEFORE - assumed 'GESHI_BEFORE' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-geshi-highlight/geshi/geshi/gdb.php on line 154
    • > PHP Warning
      Use of undefined constant GESHI_NUMBER_INT_BASIC - assumed 'GESHI_NUMBER_INT_BASIC' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-geshi-highlight/geshi/geshi/arm.php on line 3295

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: code, valid, highlight, highlighting, fast...

wp-geshi-highlight/wp-geshi-highlight.php Passed 13 tests

"WP-GeSHi-Highlight — rock-solid syntax highlighting for 259 languages" version 1.4.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
106 characters long description:
Syntax highlighting for 259 languages. Mobile-friendly. Easy-to-use. Based on a rock-solid engine (GeSHi).

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected70,584 lines of code in 260 files:
LanguageFilesBlank linesComment linesLines of code
PHP2581,97114,86270,534
CSS2144550

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 190)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity320.00
▷ Minimum class complexity3.00
▷ Maximum class complexity637.00
Average method complexity7.80
▷ Minimum method complexity1.00
▷ Maximum method complexity190.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods94
▷ Static methods11.06%
▷ Public methods7478.72%
▷ Protected methods2021.28%
▷ Private methods00.00%
Functions14
▷ Named functions1392.86%
▷ Anonymous functions17.14%
Constants54
▷ Global constants54100.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
No PNG files were detected