10% do-you-know-widget

Code Review | Do You Know Widget

WordPress plugin Do You Know Widget scored10%from 54 tests.

About plugin

  • Plugin page: do-you-know-widget
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jun 6, 2016
  • Latest release: Sep 22, 2016
  • Number of updates: 5
  • Update frequency: every 22.0 days
  • Top authors: konnektiv (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,015 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/do-you-know-widget/do-you-know.php+105
    Function create_function() is deprecated

Server metrics [RAM: ▼1.93MB] [CPU: ▼57.26ms] Passed 4 tests

Analyzing server-side resources used by Do You Know Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.396.68 ▼41.59
Dashboard /wp-admin2.10 ▼1.259.25 ▼55.23
Posts /wp-admin/edit.php2.10 ▼1.267.41 ▼37.68
Add New Post /wp-admin/post-new.php2.10 ▼3.796.52 ▼94.55
Media Library /wp-admin/upload.php2.10 ▼1.146.46 ▼26.34

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 8 new files
Database: no new tables, 7 new options
New WordPress options
widget_doyouknow_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Do You Know Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.26 ▼1.114.74 ▲2.2239.50 ▼1.64
Dashboard /wp-admin2,206 ▲155.87 ▲0.99100.90 ▼5.6240.02 ▼5.18
Posts /wp-admin/edit.php2,089 ▼02.01 ▲0.0140.00 ▲2.4134.40 ▲1.97
Add New Post /wp-admin/post-new.php1,533 ▲1923.29 ▲5.74689.91 ▲88.6952.25 ▲0.39
Media Library /wp-admin/upload.php1,388 ▼04.27 ▲0.0898.67 ▼4.9042.17 ▼5.46

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/do-you-know-widget/do-you-know.php+105
    Function create_function() is deprecated
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_doyouknow_widget
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

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)
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/do-you-know-widget/do-you-know-widget-class.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Requires at least: Version not formatted correctly
  • Tags: There are too many tags (12 tag instead of maximum 10)
The official readme.txt might help

do-you-know-widget/do-you-know.php 92% from 13 tests

"Do You Know Widget" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("do-you-know-widget.php" instead of "do-you-know.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin630 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP38995354
JavaScript2115266
JSON10010

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity14.67
▷ Minimum class complexity2.00
▷ Maximum class complexity25.00
Average method complexity2.95
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods21
▷ Static methods29.52%
▷ Public methods1466.67%
▷ Protected methods00.00%
▷ Private methods733.33%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin