84% codemirror-for-post-editor

Code Review | CodeMirror for Post Editor

WordPress plugin CodeMirror for Post Editor scored 84% from 54 tests.

About plugin

  • Plugin page: codemirror-for-po...
  • Plugin version: 0.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.9
  • WordPress version: 5.8.1
  • First release: Mar 11, 2013
  • Latest release: Apr 15, 2014
  • Number of updates: 26
  • Update frequency: every 15.5 days
  • Top authors: felipelavinz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 2,467 total downloads

Benchmarks

Plugin footprint Passed 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.03MB] [CPU: ▼143.59ms] Passed 4 tests

Server-side resources used by CodeMirror for Post Editor
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1439.06 ▲14.06
Dashboard /wp-admin3.08 ▲0.0345.20 ▲2.32
Posts /wp-admin/edit.php3.17 ▲0.0648.84 ▼5.01
Add New Post /wp-admin/post-new.php5.45 ▲0.0288.15 ▼568.92
Media Library /wp-admin/upload.php3.03 ▲0.0238.06 ▼2.73

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 358 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

CodeMirror for Post Editor: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲5615.86 ▲0.3911.97 ▲5.0743.78 ▼11.75
Dashboard /wp-admin2,972 ▲385.89 ▼0.10151.45 ▼8.07116.43 ▼12.22
Posts /wp-admin/edit.php2,736 ▼32.70 ▲0.0072.96 ▼2.0192.38 ▲1.57
Add New Post /wp-admin/post-new.php1,622 ▼6118.96 ▲0.21396.38 ▲7.68111.75 ▼9.62
Media Library /wp-admin/upload.php1,807 ▼35.02 ▲0.03159.23 ▲8.39123.12 ▲1.11

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/codemirror-for-post-editor/codemirror-editor.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: writing, html, editor, post, code

codemirror-for-post-editor/codemirror-editor.php 92% from 13 tests

The main PHP file in "CodeMirror for Post Editor" ver. 0.4.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("codemirror-for-post-editor.php" instead of "codemirror-editor.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Please fix the following items
  • For security reasons, never distribute binary or executable files with your plugin
    • .ls - LightWave LScript File in LightWave
      • wp-content/plugins/codemirror-for-post-editor/js/mode/livescript/livescript.ls
55,563 lines of code in 339 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1613,8072,81336,517
HTML1332,7561017,154
CSS412671421,523
SVG222296
PHP111368
Bourne Shell1015

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.40
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods110.00%
▷ Public methods880.00%
▷ Protected methods00.00%
▷ Private methods220.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/img/editor.png0.71KB0.76KB0.00%
js/doc/logo.png11.72KB4.95KB▼ 57.76%
js/doc/baboon.png22.75KB10.31KB▼ 54.68%