67% ithoughts-advanced-code-editor

Code Review | iThoughts Advanced Code Editor

WordPress plugin iThoughts Advanced Code Editor scored67%from 54 tests.

About plugin

  • Plugin page: ithoughts-advance...
  • Plugin version: 1.2.10
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.5
  • WordPress version: 6.3.1
  • First release: Feb 16, 2016
  • Latest release: Aug 15, 2016
  • Number of updates: 26
  • Update frequency: every 7.0 days
  • Top authors: Gerkin (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

70+ active /3,858 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.21MB] [CPU: ▼0.10ms] Passed 4 tests

Analyzing server-side resources used by iThoughts Advanced Code Editor
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1243.38 ▼0.00
Dashboard /wp-admin3.53 ▲0.2348.13 ▼0.69
Posts /wp-admin/edit.php3.65 ▲0.2946.27 ▲0.04
Add New Post /wp-admin/post-new.php6.13 ▲0.2595.60 ▲11.74
Media Library /wp-admin/upload.php3.46 ▲0.2338.50 ▲0.27
Report false positive/negative /wp-admin/admin.php?page=ithoughts_ace_report3.4933.77
Advanced Code Editor /wp-admin/options-general.php?page=ithoughts_ace3.4328.42

Server storage [IO: ▲37.53MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Please try to fix the following items
  • Filesystem usage must be lower than 25MB (currently using 37.53MB)
Filesystem: 1,559 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

iThoughts Advanced Code Editor: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲9114.38 ▲0.081.75 ▼0.1844.25 ▼1.66
Dashboard /wp-admin2,231 ▲596.16 ▲1.18113.62 ▼11.5637.70 ▼5.30
Posts /wp-admin/edit.php2,129 ▲403.00 ▲0.9539.90 ▲5.4034.42 ▼1.24
Add New Post /wp-admin/post-new.php1,703 ▲16023.82 ▲0.91612.74 ▼58.5426.80 ▼29.44
Media Library /wp-admin/upload.php1,428 ▲405.43 ▲1.28102.58 ▲0.7843.49 ▲0.32
Report false positive/negative /wp-admin/admin.php?page=ithoughts_ace_report1,0623.0251.3977.79
Advanced Code Editor /wp-admin/options-general.php?page=ithoughts_ace1,5775.30109.0763.41

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

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)
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/ithoughts-advanced-code-editor/templates/mail_report.php
    • > /wp-content/plugins/ithoughts-advanced-code-editor/submodules/ace-builds/demo/kitchen-sink/docs/php.php
  • 15× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: response in wp-content/plugins/ithoughts-advanced-code-editor/templates/mail_report.php on line 748
    • > PHP Warning
      fgets() expects parameter 1 to be resource, string given in wp-content/plugins/ithoughts-advanced-code-editor/submodules/ace-builds/demo/kitchen-sink/docs/php.php on line 13
    • > PHP Notice
      Undefined variable: included in wp-content/plugins/ithoughts-advanced-code-editor/templates/mail_report.php on line 803
    • > PHP Notice
      Undefined variable: code in wp-content/plugins/ithoughts-advanced-code-editor/templates/mail_report.php on line 693
    • > PHP Notice
      Undefined variable: name in wp-content/plugins/ithoughts-advanced-code-editor/templates/mail_report.php on line 606
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/ithoughts-advanced-code-editor/templates/mail_report.php on line 557
    • > PHP Notice
      Undefined variable: siteurl in wp-content/plugins/ithoughts-advanced-code-editor/templates/mail_report.php on line 869
    • > PHP Notice
      Undefined variable: email in wp-content/plugins/ithoughts-advanced-code-editor/templates/mail_report.php on line 610
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/ithoughts-advanced-code-editor/templates/options.php:19
    • > PHP Warning
      Use of undefined constant STDIN - assumed 'STDIN' (this will throw an Error in a future version of PHP) in wp-content/plugins/ithoughts-advanced-code-editor/submodules/ace-builds/demo/kitchen-sink/docs/php.php on line 13

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)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 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
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Option page of iThoughts Advanced Code Editor with a test ACE editor), #2 (Edition of a plugin file), #3 (Information tooltip and completion suggestions in a theme CSS file)
The official readme.txt might help

ithoughts-advanced-code-editor/ithoughts_advanced_code_editor.php 92% from 13 tests

"iThoughts Advanced Code Editor" version 1.2.10's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("ithoughts-advanced-code-editor.php" instead of "ithoughts_advanced_code_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
These items require your attention
  • Do not include executable or dangerous files in your plugin
    • .as - Adobe Flash ActionScript File in Adobe Flash
      • wp-content/plugins/ithoughts-advanced-code-editor/submodules/ace-builds/demo/kitchen-sink/docs/actionscript.as
    • .ahk - AutoHotkey Script in AutoHotkey
      • wp-content/plugins/ithoughts-advanced-code-editor/submodules/ace-builds/demo/kitchen-sink/docs/autohotkey.ahk
    • .bat - Batch File in Windows
      • wp-content/plugins/ithoughts-advanced-code-editor/submodules/ace-builds/demo/kitchen-sink/docs/batchfile.bat
    • .ls - LightWave LScript File in LightWave
      • wp-content/plugins/ithoughts-advanced-code-editor/submodules/ace-builds/demo/kitchen-sink/docs/live_script.ls
      • wp-content/plugins/ithoughts-advanced-code-editor/submodules/ace-builds/demo/kitchen-sink/docs/livescript.ls
    • .mel - Maya Embedded Language File in Maya 2013
      • wp-content/plugins/ithoughts-advanced-code-editor/submodules/ace-builds/demo/kitchen-sink/docs/mel.mel
    • .ps1 - Windows PowerShell Cmdlet in Windows
      • wp-content/plugins/ithoughts-advanced-code-editor/submodules/ace-builds/demo/kitchen-sink/docs/powershell.ps1
    • .vbs - VBScript File in Windows
      • wp-content/plugins/ithoughts-advanced-code-editor/submodules/ace-builds/demo/kitchen-sink/docs/vbscript.vbs
502,794 lines of code in 1,496 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1,36052,02131,819491,395
AsciiDoc11,192164,832
PHP142316801,823
HTML17117241,060
JSON600564
CSS54835401
reStructuredText113321259
Markdown41060223
LESS23520176
XML323134
PO File14343133
SVG29085
make1261185
Objective C127473
TypeScript18064
Scala17161
liquid118058
Sass212146
JSP15140
Velocity Template Language15237
Forth15036
Stylus111836
TeX23336
diff152935
C++19433
Nix142132
Freemarker Template111431
Tcl/Tk15530
Bourne Shell16529
EJS12029
Groovy111129
Haml15229
Pascal171229
ActionScript1121128
Perl16328
Ruby16128
YAML15228
AutoHotkey16326
Slim15026
VHDL19025
Twig15124
Pug115723
Cucumber15122
Go14822
EEx14121
ERB14121
Elixir171421
Lisp11120
Lua181020
Specman e18220
TOML17220
Scheme11119
ABAP19918
PowerShell15118
Rust12018
Visual Basic11517
CoffeeScript13316
Dockerfile1132416
R14016
Vala15016
Assembly25015
Haxe11115
Clojure11414
Erlang13314
Protocol Buffers12014
GLSL14313
Julia12013
Python13313
Swift13013
Verilog-SystemVerilog11011
DOS Batch14110
Dart14510
Elm12010
Haskell14610
OCaml13510
Lean1108
Windows Message File1008
SQL2007
Smarty1007
Handlebars1116
Java1276
Ada1005
JSX1045
XQuery1105
INI1004
C#1013
Razor1003
ColdFusion1212

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity23.57
▷ Minimum class complexity1.00
▷ Maximum class complexity90.00
Average method complexity4.59
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces4
Interfaces1
Traits0
Classes6
▷ Abstract classes466.67%
▷ Concrete classes233.33%
▷ Final classes00.00%
Methods46
▷ Static methods1430.43%
▷ Public methods4189.13%
▷ Protected methods24.35%
▷ Private methods36.52%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
12 PNG files occupy 0.63MB with 0.43MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
submodules/ace-builds/demo/bookmarklet/images/logo.png51.31KB17.19KB▼ 66.50%
submodules/ace-builds/demo/bookmarklet/images/logo_half.png19.52KB6.47KB▼ 66.84%
screenshot-2.png171.71KB54.39KB▼ 68.33%
submodules/ace-builds/demo/kitchen-sink/logo.png48.11KB20.51KB▼ 57.36%
submodules/ace-builds/demo/bookmarklet/images/background.png3.36KB0.55KB▼ 83.66%