84% dmg-text-widget

Code Review | DMG Text Widget

WordPress plugin DMG Text Widget scored84%from 54 tests.

About plugin

  • Plugin page: dmg-text-widget
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.6
  • WordPress version: 6.3.1
  • First release: Jul 29, 2016
  • Latest release: Aug 23, 2016
  • Number of updates: 11
  • Update frequency: every 2.3 days
  • Top authors: dancoded (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /992 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: ▼3.29MB] [CPU: ▼661,465.10ms] Passed 4 tests

Server-side resources used by DMG Text Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▼13.3341.96 ▼2,645,842.09
Dashboard /wp-admin3.41 ▲0.0652.32 ▼0.53
Posts /wp-admin/edit.php3.52 ▲0.1249.14 ▼2.66
Add New Post /wp-admin/post-new.php5.99 ▲0.0693.02 ▼15.10
Media Library /wp-admin/upload.php3.33 ▲0.0642.46 ▲3.93

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_dmg_text_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

DMG Text Widget: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.26 ▲0.111.69 ▼0.2143.21 ▼0.95
Dashboard /wp-admin2,189 ▲145.54 ▼0.1486.20 ▼13.6941.64 ▼1.75
Posts /wp-admin/edit.php2,097 ▼32.00 ▲0.0237.60 ▼4.5036.43 ▲2.03
Add New Post /wp-admin/post-new.php1,531 ▲12723.29 ▲5.31674.25 ▲63.0250.12 ▲2.72
Media Library /wp-admin/upload.php1,403 ▲34.16 ▲0.0098.65 ▼6.8044.71 ▼0.87

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_dmg_text_widget
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/dmg-text-widget/vendor/DMG/WP_Widget_Base/src/WP_Widget_Base.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'DMG\\WP_Widget_Base\\WP_Widget_Base' not found in wp-content/plugins/dmg-text-widget/src/WP_Text_Widget.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: shortcodes, widget, css, text widget

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

"DMG Text Widget" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 167 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin398 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP316782325
Markdown220055
JSON14018

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.34
Average class complexity20.50
▷ Minimum class complexity5.00
▷ Maximum class complexity36.00
Average method complexity2.70
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods23
▷ Static methods00.00%
▷ Public methods23100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected