84% dmg-related-pages-widget

Code Review | DMG Related Pages Widget

WordPress plugin DMG Related Pages Widget scored84%from 54 tests.

About plugin

  • Plugin page: dmg-related-pages...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.6
  • WordPress version: 6.3.1
  • First release: Aug 5, 2016
  • Latest release: Aug 25, 2016
  • Number of updates: 20
  • Update frequency: every 1.0 days
  • Top authors: dancoded (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /4,241 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▼6.15ms] Passed 4 tests

An overview of server-side resources used by DMG Related Pages Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0740.07 ▼3.81
Dashboard /wp-admin3.38 ▲0.0852.31 ▼4.53
Posts /wp-admin/edit.php3.49 ▲0.1452.56 ▼1.22
Add New Post /wp-admin/post-new.php5.96 ▲0.0788.01 ▼15.04
Media Library /wp-admin/upload.php3.30 ▲0.0739.43 ▲1.23

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: 18 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_dmg_related_pages_widget
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for DMG Related Pages Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.72 ▲0.092.43 ▲0.7343.90 ▼1.85
Dashboard /wp-admin2,192 ▲125.56 ▼0.1088.67 ▼3.0739.86 ▼2.41
Posts /wp-admin/edit.php2,100 ▼31.95 ▼0.1736.47 ▼6.1334.01 ▼5.66
Add New Post /wp-admin/post-new.php1,526 ▼223.07 ▼0.16669.97 ▲14.6155.64 ▼3.18
Media Library /wp-admin/upload.php1,403 ▲34.20 ▲0.02112.13 ▲3.3749.60 ▲1.89

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
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_dmg_related_pages_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means 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
Please fix the following items
  • 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-related-pages-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-related-pages-widget/src/WP_Related_Pages_Widget.php:27

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

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: css, list pages, page widget, menu, related pages

dmg-related-pages-widget/dmg-related-pages-widget.php 92% from 13 tests

"DMG Related Pages Widget" version 1.1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 189 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected732 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP10226222637
JSON24053
Markdown215042

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity18.20
▷ Minimum class complexity1.00
▷ Maximum class complexity40.00
Average method complexity3.05
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods43
▷ Static methods36.98%
▷ Public methods4297.67%
▷ Protected methods00.00%
▷ Private methods12.33%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
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
PNG images were not found in this plugin