66% code-syntax-highlighter

Code Review | Code Syntax Highlighter

WordPress plugin Code Syntax Highlighter scored66%from 54 tests.

About plugin

  • Plugin page: code-syntax-highl...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.9
  • WordPress version: 6.3.1
  • First release: Aug 30, 2018
  • Latest release: Aug 30, 2018
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: kartikaykanojia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /892 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.31MB] [CPU: ▼30.71ms] Passed 4 tests

A check of server-side resources used by Code Syntax Highlighter
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0731.70 ▼21.17
Dashboard /wp-admin3.27 ▼0.0841.67 ▼23.62
Posts /wp-admin/edit.php3.34 ▼0.0240.04 ▼18.33
Add New Post /wp-admin/post-new.php4.69 ▼1.2046.15 ▼59.72
Media Library /wp-admin/upload.php3.27 ▲0.0433.37 ▼3.40
Code Syntax Highlighter /wp-admin/options-general.php?page=code-syntax-highlighter3.2431.21

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 456 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Code Syntax Highlighter
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲3514.25 ▼0.032.05 ▼0.0341.99 ▼8.03
Dashboard /wp-admin2,212 ▲385.65 ▲0.0890.99 ▼11.3942.47 ▼1.30
Posts /wp-admin/edit.php2,117 ▲142.02 ▲0.0447.31 ▲8.8639.36 ▲5.02
Add New Post /wp-admin/post-new.php1,542 ▲1622.99 ▼0.16679.00 ▲77.0758.28 ▲9.42
Media Library /wp-admin/upload.php1,420 ▲234.16 ▼0.04109.57 ▲5.7346.38 ▲1.32
Code Syntax Highlighter /wp-admin/options-general.php?page=code-syntax-highlighter2,4761.6827.4059.84

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=code-syntax-highlighter
    • > Notice in wp-content/plugins/code-syntax-highlighter/inc/src/acp-page.php+140
    Trying to access array offset on value of type bool

SRP 0% 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
The following issues need your attention
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/code-syntax-highlighter/briskjab-syntax-highlighter.php
    • > /wp-content/plugins/code-syntax-highlighter/inc/src/rendrer.php
    • > /wp-content/plugins/code-syntax-highlighter/inc/src/landing.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/code-syntax-highlighter/inc/src/acp-page.php:20

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=code-syntax-highlighter
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).tabs is not a function" "TypeError: $(...).tabs is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/options-general.php?page=code-syntax-highlighter:348:34)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=code-syntax-highlighter
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).tabs is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
8 plugin tags: code theme, advance code viewer, multiple code highlighter, codemirror, snippet...

code-syntax-highlighter/briskjab-syntax-highlighter.php 85% from 13 tests

"Code Syntax Highlighter" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("code-syntax-highlighter.php" instead of "briskjab-syntax-highlighter.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin70,493 lines of code in 440 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2236,2204,61650,516
HTML1282,527813,488
CSS784753392,732
JSON3101,972
Markdown357101,006
PHP476193766
SVG11013

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
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%
Functions34
▷ Named functions3294.12%
▷ Anonymous functions25.88%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected