83% image-hotspots-by-widgetic

Code Review | Image Hotspots

WordPress plugin Image Hotspots scored83%from 54 tests.

About plugin

  • Plugin page: image-hotspots-by...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.0
  • WordPress version: 6.3.1
  • First release: Jul 11, 2022
  • Latest release: Jul 11, 2022
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: widgetic (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /254 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.16MB] [CPU: ▲378.50ms] 75% from 4 tests

An overview of server-side resources used by Image Hotspots
The following require your attention
  • Extra CPU: Extra CPU usage should be kept under 200.00ms (currently 378.50ms on /wp-admin/upload.php)
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.16349.48 ▲309.70
Dashboard /wp-admin3.46 ▲0.16428.60 ▲381.43
Posts /wp-admin/edit.php3.51 ▲0.15361.41 ▲318.57
Add New Post /wp-admin/post-new.php6.05 ▲0.16596.43 ▲504.31
Media Library /wp-admin/upload.php3.38 ▲0.15886.86 ▲852.81

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 31 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widgetic/secret
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Image Hotspots
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /5,012 ▲2,26630.89 ▲16.28114.63 ▲112.9032.42 ▼7.17
Dashboard /wp-admin3,576 ▲1,39514.56 ▲8.84254.16 ▲153.15108.90 ▲69.44
Posts /wp-admin/edit.php3,406 ▲1,30313.32 ▲11.33183.67 ▲146.2641.68 ▲10.26
Add New Post /wp-admin/post-new.php2,544 ▲1,01029.67 ▲11.62790.17 ▲171.8265.28 ▼17.17
Media Library /wp-admin/upload.php1,798 ▲40411.78 ▲7.56246.71 ▲143.7843.88 ▲1.23

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widgetic/secret
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Undefined variable: blockWidgetId in wp-content/plugins/image-hotspots-by-widgetic/block.php on line 29
    • > PHP Notice
      Undefined variable: blockPath in wp-content/plugins/image-hotspots-by-widgetic/block.php on line 29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/image-hotspots-by-widgetic/dashboard.php:4
    • > PHP Notice
      Undefined variable: widgetMeta in wp-content/plugins/image-hotspots-by-widgetic/block.php on line 29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/image-hotspots-by-widgetic/block.php:110

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Tags: You are using too many tags: 16 tag instead of maximum 10
Please take inspiration from this readme.txt

image-hotspots-by-widgetic/index.php 92% from 13 tests

Analyzing the main PHP file in "Image Hotspots" version 1.0.0
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("image-hotspots-by-widgetic.php" instead of "index.php")

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 detected1,522 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
JSON500909
CSS37458432
PHP43055170
SVG1009
JavaScript2012

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.13
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%
Functions11
▷ Named functions00.00%
▷ Anonymous functions11100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
10 PNG files occupy 7.29MB with 3.83MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png4.54KB1.41KB▼ 68.89%
assets/banner-772x250.png11.77KB4.67KB▼ 60.33%
assets/icon.png1.30KB0.50KB▼ 61.44%
assets/banner-1544x500.png29.22KB8.07KB▼ 72.37%
assets/screenshot-2.png232.32KB250.73KB0.00%