78% enhanced-text-widget

Code Review | Enhanced Text Widget

WordPress plugin Enhanced Text Widget scored78%from 54 tests.

About plugin

  • Plugin page: enhanced-text-widget
  • Plugin version: 1.6.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-6.4.1
  • WordPress version: 6.3.1
  • First release: May 26, 2011
  • Latest release: Nov 14, 2023
  • Number of updates: 96
  • Update frequency: every 47.5 days
  • Top authors: bostondv (71.88%)iclyde (15.63%)upwsupport (8.33%)cl272 (7.29%)

Code review

54 tests

User reviews

49 reviews

Install metrics

50,000+ active /695,830 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

Analyzing server-side resources used by Enhanced Text Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.91 ▲0.4543.58 ▲1.31
Dashboard /wp-admin3.78 ▲0.4851.15 ▲2.38
Posts /wp-admin/edit.php3.89 ▲0.5355.46 ▲9.62
Add New Post /wp-admin/post-new.php6.38 ▲0.4992.77 ▲7.15
Media Library /wp-admin/upload.php3.71 ▲0.4740.98 ▲7.80

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 127 new files
Database: no new tables, 9 new options
New WordPress options
_tifm_force_disable_feature_update
widget_enhancedtextwidget
theysaidso_admin_options
analyst_cache
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Enhanced Text Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,084 ▲32214.17 ▼0.081.68 ▼0.1937.83 ▼4.99
Dashboard /wp-admin2,486 ▲3065.64 ▲0.04101.03 ▼0.8183.31 ▲40.58
Posts /wp-admin/edit.php2,413 ▲3132.16 ▲0.1543.03 ▲3.7745.74 ▲11.28
Add New Post /wp-admin/post-new.php1,886 ▲36023.01 ▲0.12681.89 ▲66.2363.45 ▲12.08
Media Library /wp-admin/upload.php1,697 ▲3004.25 ▲0.01102.69 ▲0.0577.31 ▲32.84

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • _tifm_force_disable_feature_update
    • widget_recent-comments
    • analyst_accounts_data
    • db_upgraded
    • analyst_cache
    • widget_recent-posts
    • widget_enhancedtextwidget
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Please fix the following
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/enhanced-text-widget/analyst/templates/optin.php
    • > /wp-content/plugins/enhanced-text-widget/analyst/templates/forms/install.php
    • > /wp-content/plugins/enhanced-text-widget/analyst/templates/optout.php
    • > /wp-content/plugins/enhanced-text-widget/analyst/templates/forms/deactivate.php
  • 23× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Analyst\\Http\\Requests\\AbstractLoggerRequest' not found in wp-content/plugins/enhanced-text-widget/analyst/src/Http/Requests/OptOutRequest.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Analyst\\Contracts\\HttpClientContract' not found in wp-content/plugins/enhanced-text-widget/analyst/src/Http/DummyHttpClient.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Analyst\\Core\\AbstractFactory' not found in wp-content/plugins/enhanced-text-widget/analyst/src/Notices/NoticeFactory.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Analyst\\Contracts\\RequestContract' not found in wp-content/plugins/enhanced-text-widget/analyst/src/Http/Requests/AbstractLoggerRequest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Analyst\\Http\\Requests\\AbstractLoggerRequest' not found in wp-content/plugins/enhanced-text-widget/analyst/src/Http/Requests/UninstallRequest.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Analyst\\Contracts\\HttpClientContract' not found in wp-content/plugins/enhanced-text-widget/analyst/src/Http/WordPressHttpClient.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Analyst\\Contracts\\HttpClientContract' not found in wp-content/plugins/enhanced-text-widget/analyst/src/Http/CurlHttpClient.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Analyst\\Contracts\\CacheContract' not found in wp-content/plugins/enhanced-text-widget/analyst/src/Cache/DatabaseCache.php:12
    • > PHP Notice
      Undefined variable: pencilImage in wp-content/plugins/enhanced-text-widget/analyst/templates/forms/deactivate.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'Analyst\\Core\\AbstractFactory' not found in wp-content/plugins/enhanced-text-widget/analyst/src/Account/AccountDataFactory.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (20 tag instead of maximum 10)
Please take inspiration from this readme.txt

enhanced-text-widget/enhanced-text-widget.php 92% from 13 tests

Analyzing the main PHP file in "Enhanced Text Widget" version 1.6.2
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 163 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected3,907 lines of code in 95 files:
LanguageFilesBlank linesComment linesLines of code
PHP629531,4513,092
CSS2484368
JavaScript2245230
SVG2802177
PO File1121140

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity35.00
Average method complexity1.72
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces9
Interfaces6
Traits0
Classes25
▷ Abstract classes28.00%
▷ Concrete classes2392.00%
▷ Final classes00.00%
Methods201
▷ Static methods2311.44%
▷ Public methods17386.07%
▷ Protected methods104.98%
▷ Private methods188.96%
Functions29
▷ Named functions1034.48%
▷ Anonymous functions1965.52%
Constants5
▷ Global constants240.00%
▷ Class constants360.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
30 PNG files occupy 0.41MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
banner/views/projects/cdp/imgs/main-background-image.png14.24KB14.12KB▼ 0.85%
assets/screenshot-1.png52.49KB14.24KB▼ 72.87%
banner/views/projects/bmi/imgs/big-colored-logo.png0.85KB0.83KB▼ 2.18%
banner/views/projects/usm/imgs/play-icon.png0.62KB0.60KB▼ 3.17%
analyst/assets/img/shield_question.png22.05KB11.19KB▼ 49.26%