73% draw-attention

Code Review | Interactive Image Map Plugin - Draw Attention

WordPress plugin Interactive Image Map Plugin - Draw Attention scored73%from 54 tests.

About plugin

  • Plugin page: draw-attention
  • Plugin version: 2.0.17
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-6.4
  • WordPress version: 6.3.1
  • First release: Feb 12, 2015
  • Latest release: Nov 7, 2023
  • Number of updates: 259
  • Update frequency: every 12.3 days
  • Top authors: croixhaug (95.37%)Otto42 (5.02%)

Code review

54 tests

User reviews

100 reviews

Install metrics

20,000+ active /579,792 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
Installer ran successfully

Server metrics [RAM: ▲1.07MB] [CPU: ▼0.39ms] Passed 4 tests

An overview of server-side resources used by Interactive Image Map Plugin - Draw Attention
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.42 ▲0.9547.69 ▲5.10
Dashboard /wp-admin4.47 ▲1.1254.38 ▼12.60
Posts /wp-admin/edit.php4.49 ▲1.1360.20 ▲9.82
Add New Post /wp-admin/post-new.php7.00 ▲1.11103.92 ▼2.20
Media Library /wp-admin/upload.php4.33 ▲1.0942.98 ▲8.14
Import / Export /wp-admin/edit.php?post_type=da_image&page=import_export4.3140.17
Upgrade to Pro /wp-admin/edit.php?post_type=da_image&page=da_upgrade_to_pro4.0730.02
Edit Image /wp-admin/edit.php?post_type=da_image4.1767.14

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 194 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
drag-drop-file-types
theysaidso_admin_options
drag-drop-page-reload
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Interactive Image Map Plugin - Draw Attention: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲8514.26 ▼0.131.92 ▲0.2944.22 ▼2.72
Dashboard /wp-admin2,234 ▲575.55 ▼0.1885.19 ▼15.6640.41 ▼3.69
Posts /wp-admin/edit.php2,139 ▲362.06 ▲0.1041.06 ▲0.6335.31 ▼2.86
Add New Post /wp-admin/post-new.php6,412 ▲4,88627.81 ▲4.79872.60 ▲185.1137.98 ▼28.11
Media Library /wp-admin/upload.php1,439 ▲424.29 ▲0.1397.04 ▼2.7740.55 ▼1.76
Import / Export /wp-admin/edit.php?post_type=da_image&page=import_export8732.4340.3924.82
Upgrade to Pro /wp-admin/edit.php?post_type=da_image&page=da_upgrade_to_pro5,90921.85923.92292.06
Edit Image /wp-admin/edit.php?post_type=da_image3,5278.89218.16128.28

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • drag-drop-file-types
    • drag-drop-page-reload
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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 fix the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/draw-attention/external/actions-scripts/format-changelog.php
    • > /wp-content/plugins/draw-attention/public/views/public.php
  • 60× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_admin_page_title() in wp-content/plugins/draw-attention/public/includes/lib/drag-drop-featured-image/assets/views/options.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/draw-attention/public/includes/lib/CMB2/includes/rest-api/CMB2_REST.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/draw-attention/public/includes/lib/CMB2/includes/helper-functions.php:131
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/draw-attention/public/views/more_info_template.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Radio' not found in wp-content/plugins/draw-attention/public/includes/lib/CMB2/includes/types/CMB2_Type_Taxonomy_Radio_Hierarchical.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/draw-attention/public/includes/lib/CMB2/includes/types/CMB2_Type_Text_Datetime_Timestamp.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cmb2_dir() in wp-content/plugins/draw-attention/public/includes/lib/CMB2/includes/rest-api/CMB2_REST_Controller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/draw-attention/public/includes/lib/CMB2/includes/types/CMB2_Type_Colorpicker.php:13
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/draw-attention/public/views/more_info_template.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/draw-attention/public/includes/lib/CMB2/includes/types/CMB2_Type_File.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/edit.php?post_type=da_image&page=da_upgrade_to_pro
    • > Javascript (severe) in unknown
    https://wpdrawattention.com/?utm_source=plugin&utm_medium=ads&utm_campaign=upgrade-pro&utm_content=admin-menu 1495:0 Uncaught ReferenceError: wp is not defined

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

draw-attention/draw-attention.php Passed 13 tests

"Interactive Image Map Plugin - Draw Attention" version 2.0.17's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
38 characters long description:
Create interactive images in WordPress

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
Everything looks great! No dangerous files found in this plugin23,779 lines of code in 127 files:
LanguageFilesBlank linesComment linesLines of code
PHP792,6787,0449,404
CSS184731,2335,699
JSON2004,264
JavaScript196207143,011
Markdown22190676
PO File5217339562
SVG100156
Ruby1247

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity18.70
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity3.20
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes80
▷ Abstract classes911.25%
▷ Concrete classes7188.75%
▷ Final classes00.00%
Methods639
▷ Static methods10616.59%
▷ Public methods54284.82%
▷ Protected methods8913.93%
▷ Private methods81.25%
Functions37
▷ Named functions3697.30%
▷ Anonymous functions12.70%
Constants16
▷ Global constants637.50%
▷ Class constants1062.50%
▷ Public constants10100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
26 compressed PNG files occupy 0.06MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/includes/lib/CMB2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
public/includes/lib/CMB2/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
public/includes/lib/CMB2/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
public/includes/lib/CMB2/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
admin/assets/css/images/marker-icon-2x.png2.53KB2.52KB0.39%