78% codecolorer

Code Review | CodeColorer

WordPress plugin CodeColorer scored78%from 54 tests.

About plugin

  • Plugin page: codecolorer
  • Plugin version: 0.10.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Apr 9, 2007
  • Latest release: May 29, 2023
  • Number of updates: 285
  • Update frequency: every 20.7 days
  • Top authors: kpumuk (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

2,000+ active /120,068 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼7.57ms] Passed 4 tests

A check of server-side resources used by CodeColorer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0740.09 ▲0.40
Dashboard /wp-admin3.42 ▲0.1244.69 ▼3.84
Posts /wp-admin/edit.php3.47 ▲0.1145.36 ▲2.06
Add New Post /wp-admin/post-new.php5.94 ▲0.0583.99 ▼14.07
Media Library /wp-admin/upload.php3.28 ▲0.0536.90 ▼12.75

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 276 new files
Database: no new tables, 19 new options
New WordPress options
codecolorer_height
codecolorer_css_class
db_upgraded
codecolorer_tab_size
codecolorer_language_notification
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
codecolorer_line_numbers
codecolorer_width
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for CodeColorer
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7013.38 ▼0.671.65 ▼0.1140.41 ▼4.53
Dashboard /wp-admin2,220 ▲295.88 ▼0.03108.78 ▲7.6039.00 ▼1.10
Posts /wp-admin/edit.php2,095 ▲62.05 ▲0.0234.81 ▼2.5435.05 ▲0.11
Add New Post /wp-admin/post-new.php1,521 ▼023.06 ▼0.12699.49 ▲14.0457.84 ▲5.75
Media Library /wp-admin/upload.php1,391 ▲94.17 ▼0.0494.85 ▼7.6041.83 ▼1.68
CodeColorer /wp-admin/codecolorer.php260.440.0813.61

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 19 options in the database
    • db_upgraded
    • widget_recent-posts
    • codecolorer_css_class
    • codecolorer_concurrent_notification
    • codecolorer_height
    • codecolorer_tab_size
    • widget_theysaidso_widget
    • codecolorer_width
    • codecolorer_lines_to_scroll
    • codecolorer_theme
    • ...

Smoke tests 50% 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 2127× PHP files trigger errors when accessed directly with GET requests (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/codecolorer/lib/geshi/typoscript.php on line 254
    • > 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/codecolorer/lib/geshi/gdb.php on line 152
    • > 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/codecolorer/lib/geshi/mk-61.php on line 93
    • > PHP Warning
      Use of undefined constant GESHI_COMMENTS - assumed 'GESHI_COMMENTS' (this will throw an Error in a future version of PHP) in wp-content/plugins/codecolorer/lib/geshi/c_winapi.php on line 790
    • > 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/codecolorer/lib/geshi/reg.php on line 217
    • > 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/codecolorer/lib/geshi/apt_sources.php on line 141
    • > PHP Warning
      Use of undefined constant GESHI_NUMBER_HEX_PREFIX - assumed 'GESHI_NUMBER_HEX_PREFIX' (this will throw an Error in a future version of PHP) in wp-content/plugins/codecolorer/lib/geshi/upc.php on line 68
    • > 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/codecolorer/lib/geshi/python.php on line 55
    • > 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/codecolorer/lib/geshi/biblatex.php on line 155
    • > PHP Warning
      Use of undefined constant GESHI_NUMBER_FLT_NONSCI_F - assumed 'GESHI_NUMBER_FLT_NONSCI_F' (this will throw an Error in a future version of PHP) in wp-content/plugins/codecolorer/lib/geshi/autoconf.php on line 468

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/codecolorer.php
    • > Network (severe)
    wp-admin/codecolorer.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
7 plugin tags: color, snippet, highlighting, geshi, syntax...

codecolorer/codecolorer.php 92% from 13 tests

The main PHP file in "CodeColorer" ver. 0.10.1 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 289 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin71,860 lines of code in 270 files:
LanguageFilesBlank linesComment linesLines of code
PHP2622,06614,81871,300
CSS21626258
JavaScript53822199
HTML190103

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
The following items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 189)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity125.83
▷ Minimum class complexity3.00
▷ Maximum class complexity635.00
Average method complexity6.26
▷ Minimum method complexity1.00
▷ Maximum method complexity189.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods144
▷ Static methods3121.53%
▷ Public methods10875.00%
▷ Protected methods2618.06%
▷ Private methods106.94%
Functions10
▷ Named functions330.00%
▷ Anonymous functions770.00%
Constants55
▷ Global constants55100.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