68% image-annotation

Code Review | Image Annotation

WordPress plugin Image Annotation scored 68% from 54 tests.

About plugin

  • Plugin page: image-annotation
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.9
  • WordPress version: 5.9.2
  • First release: Jan 30, 2022
  • Latest release: Mar 6, 2022
  • Number of updates: 7
  • Update frequency: every 6.1 days
  • Top authors: wpmart (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 160 total downloads

Benchmarks

Plugin footprint 65% 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.87MB] [CPU: ▼284.46ms] Passed 4 tests

This is a short check of server-side resources used by Image Annotation
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.47 ▲0.9655.40 ▲8.57
Dashboard /wp-admin4.31 ▲0.9033.28 ▲0.41
Posts /wp-admin/edit.php4.54 ▲0.9036.96 ▼1.32
Add New Post /wp-admin/post-new.php7.77 ▲0.8098.71 ▼1,138.08
Media Library /wp-admin/upload.php4.19 ▲0.8926.70 ▲1.14
WpMart Plugins /wp-admin/admin.php?page=ano-6310-wpmart-plugins4.1824.28
All Image Annotation /wp-admin/admin.php?page=ano-6310-image-annotation4.2029.64
Help /wp-admin/admin.php?page=ano-6310-image-annotation-use4.1827.42
License /wp-admin/admin.php?page=ano-6310-image-annotation-license4.1825.06

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 39 new files
Database: 1 new table, 1 new option
New tables
wp_ano_6310_style
New WordPress options
ano_6310_version_info

Browser metrics Passed 4 tests

Checking browser requirements for Image Annotation
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,802 ▲4816.23 ▲0.635.61 ▼0.182.43 ▼0.59
Dashboard /wp-admin2,932 ▲746.17 ▼0.07115.33 ▼15.30158.30 ▼5.07
Posts /wp-admin/edit.php2,696 ▲23.24 ▲0.0263.92 ▼1.04137.12 ▼5.93
Add New Post /wp-admin/post-new.php1,736 ▲7621.46 ▲4.65438.82 ▲20.00151.40 ▼8.15
Media Library /wp-admin/upload.php1,739 ▲415.49 ▼0.04141.79 ▲1.90186.43 ▼9.78
WpMart Plugins /wp-admin/admin.php?page=ano-6310-wpmart-plugins1,1373.6868.43133.75
All Image Annotation /wp-admin/admin.php?page=ano-6310-image-annotation1,4175.5884.62154.54
Help /wp-admin/admin.php?page=ano-6310-image-annotation-use1,1103.6068.04122.61
License /wp-admin/admin.php?page=ano-6310-image-annotation-license1,1623.6764.99122.83

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie tables were found after uninstall: 1 table
    • wp_ano_6310_style
  • Zombie WordPress options were found after uninstall: 1 option
    • ano_6310_version_info

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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 perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/image-annotation/settings/css/template-css.php
    • > /wp-content/plugins/image-annotation/settings/template-settings.php
    • > /wp-content/plugins/image-annotation/settings/add-point-html.php
    • > /wp-content/plugins/image-annotation/settings/edit-point-html.php
  • 30× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_style() in wp-content/plugins/image-annotation/settings/annotation.php:56
    • > PHP Warning
      Use of undefined constant ano_6310_plugin_dir_url - assumed 'ano_6310_plugin_dir_url' (this will throw an Error in a future version of PHP) in wp-content/plugins/image-annotation/settings/add-point-html.php on line 82
    • > PHP Warning
      include(ano_6310_plugin_urlsettings/form.php): failed to open stream: No such file or directory in wp-content/plugins/image-annotation/settings/annotation.php on line 5
    • > PHP Warning
      Use of undefined constant ano_6310_plugin_url - assumed 'ano_6310_plugin_url' (this will throw an Error in a future version of PHP) in wp-content/plugins/image-annotation/settings/add-point-html.php on line 104
    • > PHP Warning
      Use of undefined constant ano_6310_plugin_dir_url - assumed 'ano_6310_plugin_dir_url' (this will throw an Error in a future version of PHP) in wp-content/plugins/image-annotation/settings/add-point-html.php on line 86
    • > PHP Warning
      include(): Failed opening 'ano_6310_plugin_urlsettings/template-settings.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/image-annotation/settings/edit-point-html.php on line 104
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/image-annotation/settings/form.php:3
    • > PHP Warning
      Use of undefined constant ano_6310_plugin_dir_url - assumed 'ano_6310_plugin_dir_url' (this will throw an Error in a future version of PHP) in wp-content/plugins/image-annotation/settings/edit-point-html.php on line 82
    • > PHP Warning
      include(): Failed opening 'ano_6310_plugin_urlsettings/save.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/image-annotation/settings/annotation.php on line 4
    • > PHP Warning
      Use of undefined constant ano_6310_plugin_dir_url - assumed 'ano_6310_plugin_dir_url' (this will throw an Error in a future version of PHP) in wp-content/plugins/image-annotation/settings/edit-point-html.php on line 74

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 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
5 plugin tags: image annotation, image labeling tool, map annotation for wordpress, draw floor plan, map annotation

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

The main file in "Image Annotation" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("image-annotation.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin7,361 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP18196153,465
JavaScript8170621,985
CSS492221,911

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions31
▷ Named functions31100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
8 PNG files occupy 0.25MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/5.png25.50KB24.07KB▼ 5.59%
assets/css/hover.png1.27KB0.66KB▼ 48.23%
assets/images/3.png36.68KB35.65KB▼ 2.79%
assets/css/jquery.minicolors.png67.02KB34.31KB▼ 48.80%
assets/images/4.png23.22KB21.33KB▼ 8.15%