58% demon-image-annotation

Code Review | demon image annotation

WordPress plugin demon image annotation scored58%from 54 tests.

About plugin

  • Plugin page: demon-image-annot...
  • Plugin version: 5.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5-6.3
  • WordPress version: 6.3.1
  • First release: Jul 30, 2010
  • Latest release: Aug 16, 2023
  • Number of updates: 146
  • Update frequency: every 32.6 days
  • Top authors: demonisblack (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /13,630 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼0.75MB] [CPU: ▼28.76ms] Passed 4 tests

Analyzing server-side resources used by demon image annotation
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2244.46 ▲2.53
Dashboard /wp-admin3.20 ▼0.1124.48 ▼21.42
Posts /wp-admin/edit.php3.20 ▼0.1625.79 ▼22.52
Add New Post /wp-admin/post-new.php3.20 ▼2.6930.39 ▼62.64
Media Library /wp-admin/upload.php3.20 ▼0.0325.01 ▼8.45
Image Notes /wp-admin/admin.php?page=dia_image_notes3.2024.25
Usage /wp-admin/admin.php?page=dia_usage3.2023.36
Settings /wp-admin/admin.php?page=dia_settings3.2027.73

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 24 new files
Database: 1 new table, 6 new options
New tables
wp_demon_imagenote
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for demon image annotation
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,013 ▲27813.81 ▼0.5710.32 ▲8.1942.68 ▼3.74
Dashboard /wp-admin2,288 ▲1005.86 ▲0.96103.87 ▼2.1551.66 ▲10.23
Posts /wp-admin/edit.php2,173 ▲842.02 ▼0.0138.06 ▼1.2141.60 ▲5.65
Add New Post /wp-admin/post-new.php1,431 ▼9016.05 ▼6.87542.85 ▼103.50184.62 ▲126.61
Media Library /wp-admin/upload.php1,467 ▲824.36 ▲0.17108.55 ▲4.6447.02 ▲1.85
Image Notes /wp-admin/admin.php?page=dia_image_notes1,1212.3228.4142.02
Usage /wp-admin/admin.php?page=dia_usage1,1362.2126.2832.71
Settings /wp-admin/admin.php?page=dia_settings1,4031.8526.8955.56

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • Zombie tables were found after uninstall: 1 table
    • wp_demon_imagenote
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dia_settings
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.

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 take a closer look at the following
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/demon-image-annotation/includes/run-config.php on line 5
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/demon-image-annotation/includes/run-config.php on line 4
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/demon-image-annotation/includes/run-config.php on line 5
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/demon-image-annotation/includes/run-config.php on line 4

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
You can look at the official readme.txt

demon-image-annotation/demon-image-annotation.php 92% from 13 tests

The main file in "demon image annotation" v. 5.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 171 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected2,710 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP112112931,781
JavaScript311179631
CSS23014298

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity90.00
▷ Minimum class complexity90.00
▷ Maximum class complexity90.00
Average method complexity7.36
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions26
▷ Named functions26100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.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.15MB with 0.15MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/black.png49.57KB0.09KB▼ 99.81%
icon.png50.73KB0.83KB▼ 98.35%
images/asterisk_yellow.png56.43KB0.67KB▼ 98.81%