84% image-annotator

Code Review | Image Annotator

WordPress plugin Image Annotator scored84%from 54 tests.

About plugin

  • Plugin page: image-annotator
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.6
  • WordPress version: 6.3.1
  • First release: Aug 24, 2016
  • Latest release: Aug 25, 2016
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: moeloubani1 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,576 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼4.66ms] Passed 4 tests

Server-side resources used by Image Annotator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0939.09 ▼6.60
Dashboard /wp-admin3.39 ▲0.0950.68 ▼3.69
Posts /wp-admin/edit.php3.50 ▲0.1557.88 ▲7.48
Add New Post /wp-admin/post-new.php5.98 ▲0.0992.10 ▼4.95
Media Library /wp-admin/upload.php3.31 ▲0.0938.52 ▼3.38
All Annotations /wp-admin/edit.php?post_type=annotation3.3639.86
Add New /wp-admin/post-new.php?post_type=annotation3.3544.80

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Image Annotator
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,850 ▲8913.20 ▼1.384.27 ▲2.3342.84 ▼0.37
Dashboard /wp-admin2,224 ▲505.62 ▲0.0487.42 ▼11.5839.68 ▼4.68
Posts /wp-admin/edit.php2,132 ▲321.97 ▼0.0339.07 ▲3.1133.78 ▼3.64
Add New Post /wp-admin/post-new.php1,563 ▲3518.41 ▼4.70604.78 ▼98.0676.80 ▲24.18
Media Library /wp-admin/upload.php1,432 ▲324.18 ▲0.0094.52 ▼4.1446.76 ▲0.23
All Annotations /wp-admin/edit.php?post_type=annotation1,1041.9731.7532.15
Add New /wp-admin/post-new.php?post_type=annotation1,5684.2686.5967.51

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means 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
The following issues need your attention
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/image-annotator/inc/class-wpia_admin.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/image-annotator/inc/class-wpia_front.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/image-annotator/inc/class-wpia_metaboxes.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/image-annotator/inc/class-wpia_admin.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: annotation, canvas, html5

image-annotator/image-annotator.php Passed 13 tests

The principal PHP file in "Image Annotator" v. 1.0 is loaded by WordPress automatically on each request
80 characters long description:
Adds the ability to create annotated images and then edit the annotations later.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected38,169 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
SVG13022,643
JavaScript63,5248,25515,133
PHP48839299
CSS222994

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity12.33
▷ Minimum class complexity7.00
▷ Maximum class complexity23.00
Average method complexity2.89
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods1794.44%
▷ Protected methods15.56%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
front/js/images/pencil.png0.54KB0.42KB▼ 21.56%