10% fv-code-highlighter

Code Review | FV Code Highlighter

WordPress plugin FV Code Highlighter scored10%from 54 tests.

About plugin

  • Plugin page: fv-code-highlighter
  • Plugin version: 2.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2
  • WordPress version: 6.3.1
  • First release: Sep 16, 2008
  • Latest release: Aug 14, 2019
  • Number of updates: 52
  • Update frequency: every 76.6 days
  • Top authors: frankverhoeven (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /22,316 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Error in wp-content/plugins/fv-code-highlighter/src/Diagnostics/Api/Request.php+37
    Uncaught Error: Wrong parameters for RuntimeException([string $message [, long $code [, Throwable $previous = NULL]]]) in wp-content/plugins/fv-code-highlighter/src/Diagnostics/Api/Request.php:37
    Stack trace:
    #0 wp-content/plugins/fv-code-highlighter/src/Diagnostics/Api/Request.php(37): Exception->__construct()
    #1 wp-content/plugins/fv-code-highlighter/src/Version.php(43): FvCodeHighlighter\Diagnostics\Api\Request->sendRequest()
    #2 wp-content/plugins/fv-code-highlighter/src/Installer.php(57): FvCodeHighlighter\Version::getLatestVersion()
    #3 wp-content/plugins/fv-code-highlighter/src/Bootstrap.php(59): FvCodeHighlighter\Installer->hasUpdate()
    #4 wp-content/plugins/fv-code-highlighter/src/Bootstrap.php(52): FvCodeHighlighter\Bootstrap->initInstaller()
    #5 wp-content/plugins/fv-code-highlighter/fv-code-highlighter.php(52): FvCodeHighlighter\Bootstrap->bootstrap()
    #6 /var/www/wordpre

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

An overview of server-side resources used by FV Code Highlighter
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.40 ▲3.22
Dashboard /wp-admin3.30 ▲0.0046.82 ▼1.44
Posts /wp-admin/edit.php3.36 ▲0.0045.96 ▼4.52
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.70 ▼4.35
Media Library /wp-admin/upload.php3.23 ▲0.0034.39 ▼1.61

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

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

Browser metrics Passed 4 tests

FV Code Highlighter: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.25 ▼1.131.89 ▼0.0843.80 ▲2.95
Dashboard /wp-admin2,203 ▲125.84 ▲0.9596.68 ▼5.5136.55 ▼7.69
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0534.02 ▼8.7336.41 ▲2.13
Add New Post /wp-admin/post-new.php1,514 ▼2017.65 ▼5.52599.43 ▼120.4349.71 ▼11.63
Media Library /wp-admin/upload.php1,388 ▼04.21 ▼0.0194.61 ▼12.5840.83 ▼3.52

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

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
Even though everything seems fine, this is not 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
  • 50× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'FvCodeHighlighter\\Cache\\Cache' not found in wp-content/plugins/fv-code-highlighter/src/Cache/Filesystem.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'FvCodeHighlighter\\Container\\Factory' not found in wp-content/plugins/fv-code-highlighter/src/Container/AliasedFactory.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'FvCodeHighlighter\\Highlighter\\AbstractHighlighter' not found in wp-content/plugins/fv-code-highlighter/src/Highlighter/General/General.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'FvCodeHighlighter\\Container\\Factory' not found in wp-content/plugins/fv-code-highlighter/src/Highlighter/Bash/Factory.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'FvCodeHighlighter\\Output\\Formatter\\Formatter' not found in wp-content/plugins/fv-code-highlighter/src/Output/Formatter/LineNumbers.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'FvCodeHighlighter\\Output\\Formatter\\Formatter' not found in wp-content/plugins/fv-code-highlighter/src/Output/Formatter/Filtered.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'FvCodeHighlighter\\Container\\Factory' not found in wp-content/plugins/fv-code-highlighter/src/Container/Factory/InstallerFactory.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'FvCodeHighlighter\\Container\\Factory' not found in wp-content/plugins/fv-code-highlighter/src/Highlighter/Html/Factory.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'FvCodeHighlighter\\Container\\Factory' not found in wp-content/plugins/fv-code-highlighter/src/Container/Factory/Admin/AdminFactory.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/fv-code-highlighter/test/Diagnostics/Api/DataTest.php:10

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (PHP Code with dark mode enabled), #2 (The configuration page.), #3 (PHP Code with notepaper background and toolbox), #4 (General Code), #5 (CSS Code), #6 (HTML Code with embedded CSS and Javascript), #7 (JavaScript Code), #8 (PHP Code)
You can take inspiration from this readme.txt

fv-code-highlighter/fv-code-highlighter.php Passed 13 tests

The main PHP file in "FV Code Highlighter" ver. 2.2.1 adds more information about the plugin and also serves as the entry point for this plugin
40 characters long description:
Highlighter your code to look beautiful.

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
No dangerous file extensions were detected16,901 lines of code in 103 files:
LanguageFilesBlank linesComment linesLines of code
JSON30011,341
PHP837755194,352
Sass2470635
XML26132369
JavaScript72013138
CSS48547
YAML15017
Markdown1202

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity2.71
▷ Minimum class complexity1.00
▷ Maximum class complexity41.00
Average method complexity1.60
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces27
Interfaces6
Traits0
Classes77
▷ Abstract classes22.60%
▷ Concrete classes7597.40%
▷ Final classes75100.00%
Methods251
▷ Static methods176.77%
▷ Public methods23593.63%
▷ Protected methods20.80%
▷ Private methods145.58%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
9 PNG files occupy 0.93MB with 0.40MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/notepaper.png0.12KB0.12KB▼ 3.15%
screenshot-4.png20.64KB20.65KB0.00%
screenshot-8.png153.09KB43.48KB▼ 71.60%
screenshot-1.png142.76KB40.95KB▼ 71.31%
screenshot-3.png166.56KB49.59KB▼ 70.23%