77% widget-detector-elementor

Code Review | Widget Detector for Elementor

WordPress plugin Widget Detector for Elementor scored77%from 54 tests.

About plugin

  • Plugin page: widget-detector-e...
  • Plugin version: 1.2.7
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.3
  • WordPress version: 6.3.1
  • First release: May 21, 2021
  • Latest release: Jul 31, 2023
  • Number of updates: 27
  • Update frequency: every 29.7 days
  • Top authors: elementinvader (100%)

Code review

54 tests

User reviews

22 reviews

Install metrics

1,000+ active /13,781 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.66MB] [CPU: ▲3.09ms] 75% from 4 tests

Server-side resources used by Widget Detector for Elementor
Please fix the following
  • CPU: Total CPU usage should be kept under 500.00ms (currently 1,907.41ms on /wp-admin/admin.php?page=wde-addons)
PageMemory (MB)CPU Time (ms)
Home /4.09 ▲0.6344.78 ▲4.72
Dashboard /wp-admin3.99 ▲0.6951.94 ▲2.44
Posts /wp-admin/edit.php4.04 ▲0.6952.71 ▲5.17
Add New Post /wp-admin/post-new.php6.53 ▲0.6488.14 ▲0.02
Media Library /wp-admin/upload.php3.92 ▲0.6942.34 ▲7.37
Install Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins4.1141.62
Add-Ons /wp-admin/admin.php?page=wde-addons4.071,907.41
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius4.2737.77
Support Forum /wp-admin/admin.php?page=wde-wp-support-forum3.8133.89
Upgrade  ➤ /wp-admin/admin.php?page=wde-pricing3.9838.15
Contact Us /wp-admin/admin.php?page=wde-contact3.9635.58

Server storage [IO: ▲5.72MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 295 new files
Database: no new tables, 12 new options
New WordPress options
wde_editor_hover
fs_debug_mode
fs_active_plugins
fs_accounts
db_upgraded
winter_mvc_active_plugins
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
...

Browser metrics Passed 4 tests

A check of browser resources used by Widget Detector for Elementor
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,846 ▲11113.26 ▼1.114.38 ▲2.4341.29 ▼3.80
Dashboard /wp-admin2,247 ▲595.88 ▲0.0299.30 ▼15.1243.80 ▲1.93
Posts /wp-admin/edit.php2,144 ▲552.10 ▲0.0742.34 ▲3.6738.91 ▲3.66
Add New Post /wp-admin/post-new.php1,554 ▲4023.30 ▲5.81658.86 ▼41.6552.52 ▼6.88
Media Library /wp-admin/upload.php1,443 ▲554.22 ▼0.0497.05 ▼6.8544.89 ▼2.20
Install Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins1,4451.8228.2837.15
Add-Ons /wp-admin/admin.php?page=wde-addons1,1052.6767.5838.97
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1401.8525.2428.03
Support Forum /wp-admin/admin.php?page=wde-wp-support-forum1,7743.7881.6193.24
Upgrade  ➤ /wp-admin/admin.php?page=wde-pricing1,6403.4669.3263.12
Contact Us /wp-admin/admin.php?page=wde-contact1,5593.4475.0328.17

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 12 options
    • fs_accounts
    • widget_recent-posts
    • winter_mvc_active_plugins
    • theysaidso_admin_options
    • fs_debug_mode
    • widget_theysaidso_widget
    • widget_detector_elementor_reviews_installed_on
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • ...

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
Almost there! Just fix the following items
  • 11× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/widget-detector-elementor/application/controllers/Wde_used_images.php
    • > /wp-content/plugins/widget-detector-elementor/application/controllers/Wde_used_missing.php
    • > /wp-content/plugins/widget-detector-elementor/application/controllers/Wde_settings.php
    • > /wp-content/plugins/widget-detector-elementor/application/controllers/Wde_used_templates.php
    • > /wp-content/plugins/widget-detector-elementor/public/partials/widget-detector-elementor-public-display.php
    • > /wp-content/plugins/widget-detector-elementor/application/controllers/Wde_used_widgets.php
    • > /wp-content/plugins/widget-detector-elementor/application/controllers/Wde.php
    • > /wp-content/plugins/widget-detector-elementor/application/controllers/Wde_ajax.php
    • > /wp-content/plugins/widget-detector-elementor/admin/partials/widget-detector-elementor-admin-display.php
    • > /wp-content/plugins/widget-detector-elementor/application/controllers/Wde_plugins_not_in_use.php
  • 38× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/widget-detector-elementor/application/views/fields_edit/DROPDOWN.php on line 11
    • > PHP Warning
      Creating default object from empty value in wp-content/plugins/widget-detector-elementor/application/views/fields_edit/INPUTBOX.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/widget-detector-elementor/application/views/fields_edit/NUMBER.php:26
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/widget-detector-elementor/application/views/fields_edit/NUMBER.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/widget-detector-elementor/application/views/fields_edit/INPUTBOX.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/widget-detector-elementor/application/views/wde_plugins_not_in_use/index.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/widget-detector-elementor/application/views/fields_edit/CHECKBOX.php:24
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/widget-detector-elementor/application/views/fields_edit/INPUTBOX.php on line 11
    • > PHP Warning
      Creating default object from empty value in wp-content/plugins/widget-detector-elementor/application/views/fields_edit/CHECKBOX.php on line 14
    • > PHP Notice
      Trying to get property 'idfield' of non-object in wp-content/plugins/widget-detector-elementor/application/views/fields_edit/DROPDOWN.php on line 11

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 86% from 29 tests

readme.txt 81% from 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
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Elementor Widgets Used Per Page), #2 (Elementor Widgets Positions on Page), #3 (Elementor Widgets Name Inside Editor on Hover), #4 (Detect Images Used in Elementor Structure Per Page)
  • Donate link: Invalid URI ("elementinvader.com")
  • Plugin Name: Please specify the plugin name on the first line ( === widget-detector-elementor === )
The official readme.txt might help

widget-detector-elementor/widget-detector-elementor.php 92% from 13 tests

This is the main PHP file of "Widget Detector for Elementor" version 1.2.7, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected47,345 lines of code in 220 files:
LanguageFilesBlank linesComment linesLines of code
PHP16810,30420,51240,020
PO File191,5202,1195,041
Markdown52530992
JavaScript9196187678
CSS175621442
Sass1300163
HTML1209

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
The following items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity67.20
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.56
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes79
▷ Abstract classes22.53%
▷ Concrete classes7797.47%
▷ Final classes00.00%
Methods1,497
▷ Static methods22014.70%
▷ Public methods1,07571.81%
▷ Protected methods412.74%
▷ Private methods38125.45%
Functions197
▷ Named functions19498.48%
▷ Anonymous functions31.52%
Constants157
▷ Global constants10768.15%
▷ Class constants5031.85%
▷ Public constants50100.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
3 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/icon-256x256.png14.66KB6.37KB▼ 56.53%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%