10% woo-image-product-annotator

Code Review | WooCommerce Image Annotator

WordPress plugin WooCommerce Image Annotator scored10%from 54 tests.

About plugin

  • Plugin page: woo-image-product...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.7.3
  • WordPress version: 6.3.1
  • First release: Apr 9, 2017
  • Latest release: Apr 9, 2017
  • Number of updates: 6
  • Update frequency: N/A
  • Top authors: tolotrasam (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /662 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • The plugin cannot be installed
    • > User deprecated in wp-includes/functions.php+5453
    Function get_page_by_title is deprecated since version 6.2.0! Use WP_Query instead.

Server metrics [RAM: ▲0.17MB] [CPU: ▼8.32ms] Passed 4 tests

An overview of server-side resources used by WooCommerce Image Annotator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1934.62 ▼1.83
Dashboard /wp-admin3.48 ▲0.1444.40 ▼12.00
Posts /wp-admin/edit.php3.60 ▲0.2446.48 ▼3.32
Add New Post /wp-admin/post-new.php6.07 ▲0.1881.65 ▼16.13
Media Library /wp-admin/upload.php3.41 ▲0.1836.51 ▲3.07
Add New /wp-admin/post-new.php?post_type=annotation3.4242.20
All Annotations /wp-admin/edit.php?post_type=annotation3.4537.95

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 53 new files
Database: no new tables, 9 new options
New WordPress options
wcia_options
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
wcia_view_install_date
wcia_style
widget_recent-comments

Browser metrics Passed 4 tests

WooCommerce Image Annotator: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,850 ▲10414.28 ▼0.071.87 ▲0.1136.71 ▼5.07
Dashboard /wp-admin2,218 ▲445.49 ▼0.1788.39 ▼6.8638.38 ▼6.54
Posts /wp-admin/edit.php2,129 ▲292.03 ▲0.0134.92 ▼11.7632.98 ▼10.75
Add New Post /wp-admin/post-new.php1,561 ▲2822.92 ▼0.03658.94 ▲13.9351.38 ▼10.45
Media Library /wp-admin/upload.php1,432 ▲354.29 ▲0.1196.24 ▼0.9542.15 ▼0.52
Add New /wp-admin/post-new.php?post_type=annotation1,6923.2874.6677.71
All Annotations /wp-admin/edit.php?post_type=annotation1,1061.9732.2728.20

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=annotation
    • > Notice in wp-content/plugins/woo-image-product-annotator/classes/class-wcia_admin_metaboxes.php+377
    Undefined variable: field

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/woo-image-product-annotator/templates/gallery-annotation.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-image-product-annotator/classes/class-wcia_admin_metaboxes.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-image-product-annotator/classes/class-wcia_admin.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/woo-image-product-annotator/templates/archive-annotation.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/woo-image-product-annotator/classes/class-wcia_front_image.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/woo-image-product-annotator/woocommerce-image-annotator.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/woo-image-product-annotator/templates/single-annotation.php:3

User-side errors Passed 1 test

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

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
4 plugin tags: popup, annotation, woocommerce, gallery

woo-image-product-annotator/woocommerce-image-annotator.php 92% from 13 tests

The entry point to "WooCommerce Image Annotator" version 1.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woo-image-product-annotator.php" instead of "woocommerce-image-annotator.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected30,737 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
SVG13022,643
JavaScript91,9051,3632,941
CSS75722342,717
PHP94371211,250
XML3001,186

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity23.40
▷ Minimum class complexity13.00
▷ Maximum class complexity33.00
Average method complexity3.67
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods42
▷ Static methods00.00%
▷ Public methods4197.62%
▷ Protected methods12.38%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
14 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/admin/images/sprite.png5.94KB2.82KB▼ 52.51%
img/admin/images/arrows.png0.24KB0.24KB0.00%
css/admin/css/images/ui-icons_cc0000_256x240.png4.44KB4.17KB▼ 6.02%
css/admin/css/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
img/left_arr.png0.74KB0.42KB▼ 43.61%