84% drawit

Code Review | DrawIt (draw.io)

WordPress plugin DrawIt (draw.io) scored84%from 54 tests.

About plugin

  • Plugin page: drawit
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8
  • WordPress version: 6.3.1
  • First release: Jul 8, 2015
  • Latest release: May 16, 2017
  • Number of updates: 65
  • Update frequency: every 11.5 days
  • Top authors: assortedchips (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

3,000+ active /35,066 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.66ms] Passed 4 tests

A check of server-side resources used by DrawIt (draw.io)
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.13 ▼2.15
Dashboard /wp-admin3.34 ▲0.0344.37 ▼6.39
Posts /wp-admin/edit.php3.39 ▲0.0346.87 ▼1.42
Add New Post /wp-admin/post-new.php5.94 ▲0.0694.40 ▼0.68
Media Library /wp-admin/upload.php3.26 ▲0.0336.26 ▲0.90
DrawIt (draw.io) /wp-admin/options-general.php?page=drawit3.2329.75

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for DrawIt (draw.io)
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,856 ▲11013.19 ▼1.195.05 ▲3.2941.95 ▼1.66
Dashboard /wp-admin2,213 ▲224.88 ▼1.02107.92 ▲7.0641.53 ▼2.93
Posts /wp-admin/edit.php2,101 ▲122.02 ▲0.0039.20 ▲2.8834.61 ▲2.46
Add New Post /wp-admin/post-new.php1,518 ▼117.41 ▼5.85612.32 ▼63.0660.39 ▲5.74
Media Library /wp-admin/upload.php1,391 ▼04.25 ▼0.0696.59 ▼6.2941.50 ▼3.77
DrawIt (draw.io) /wp-admin/options-general.php?page=drawit9711.8823.7430.46

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/drawit/drawit.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 23 tag instead of maximum 10
  • Screenshots: Please add descriptions for these screenshots #2, #3, #4 in drawit/assets to your readme.txt
You can look at the official readme.txt

drawit/drawit.php Passed 13 tests

The primary PHP file in "DrawIt (draw.io)" version 1.1.3 is used by WordPress to initiate all plugin functionality
74 characters long description:
Draw and edit flow charts, diagrams, images and more while editing a post.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected869 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP2112132561
JavaScript44242227
CSS310081

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity96.00
▷ Minimum class complexity96.00
▷ Maximum class complexity96.00
Average method complexity4.80
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods25100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/drawit-logo.png2.39KB2.07KB▼ 13.46%
img/drawit.png0.60KB0.54KB▼ 10.53%