84% scgeshi

Code Review | scGeSHi

WordPress plugin scGeSHi scored 84% from 54 tests.

About plugin

  • Plugin page: scgeshi
  • Plugin version: 0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-3.6
  • WordPress version: 6.3.1
  • First release: May 27, 2010
  • Latest release: Jan 16, 2013
  • Number of updates: 21
  • Update frequency: every 46.0 days
  • Top authors: realloc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,874 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.61ms] Passed 4 tests

An overview of server-side resources used by scGeSHi
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.57 ▼6.92
Dashboard /wp-admin3.33 ▲0.0244.01 ▼2.57
Posts /wp-admin/edit.php3.38 ▲0.0245.27 ▼6.15
Add New Post /wp-admin/post-new.php5.91 ▲0.0287.23 ▼10.81
Media Library /wp-admin/upload.php3.25 ▲0.0238.60 ▲5.36

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 206 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for scGeSHi
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲5613.71 ▼0.591.69 ▼0.1543.70 ▲6.40
Dashboard /wp-admin2,206 ▲184.90 ▲0.04105.98 ▼8.6740.43 ▼5.90
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0236.75 ▼4.8235.58 ▼1.63
Add New Post /wp-admin/post-new.php1,522 ▼1223.26 ▲0.21668.33 ▲52.1257.16 ▼7.91
Media Library /wp-admin/upload.php1,388 ▼34.20 ▲0.0195.54 ▼4.4042.62 ▼0.37

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1556× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > 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/scgeshi/geshi/oz.php on line 120
    • > PHP Warning
      Use of undefined constant GESHI_REPLACE - assumed 'GESHI_REPLACE' (this will throw an Error in a future version of PHP) in wp-content/plugins/scgeshi/geshi/gdb.php on line 128
    • > 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/scgeshi/geshi/pascal.php on line 157
    • > PHP Warning
      Use of undefined constant GESHI_NUMBER_BIN_PREFIX_0B - assumed 'GESHI_NUMBER_BIN_PREFIX_0B' (this will throw an Error in a future version of PHP) in wp-content/plugins/scgeshi/geshi/c_mac.php on line 186
    • > 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/scgeshi/geshi/llvm.php on line 367
    • > 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/scgeshi/geshi/logtalk.php on line 73
    • > PHP Warning
      Use of undefined constant GESHI_NUMBER_FLT_SCI_SHORT - assumed 'GESHI_NUMBER_FLT_SCI_SHORT' (this will throw an Error in a future version of PHP) in wp-content/plugins/scgeshi/geshi/cpp.php on line 79
    • > 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/scgeshi/geshi/gdb.php on line 143
    • > PHP Warning
      Use of undefined constant GESHI_REPLACE - assumed 'GESHI_REPLACE' (this will throw an Error in a future version of PHP) in wp-content/plugins/scgeshi/geshi/sas.php on line 277
    • > 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/scgeshi/geshi/email.php on line 135

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 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
7 plugin tags: syntax highlighting, scgeshi, syntax highlight, geshi, highlight...

scgeshi/scGeSHi.php 92% from 13 tests

The main PHP file in "scGeSHi" ver. 0.5 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("scgeshi.php" instead of "scGeSHi.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin45,223 lines of code in 205 files:
LanguageFilesBlank linesComment linesLines of code
PHP2031,41511,73645,200
CSS10013
Markdown15010

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 199)
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity320.00
▷ Minimum class complexity3.00
▷ Maximum class complexity637.00
Average method complexity7.72
▷ Minimum method complexity1.00
▷ Maximum method complexity199.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods95
▷ Static methods11.05%
▷ Public methods95100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants58
▷ Global constants58100.00%
▷ Class constants00.00%
▷ Public constants00.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
No PNG files were detected