84% dmg-archives-widget

Code Review | DMG Post Archives Widget

WordPress plugin DMG Post Archives Widget scored 84% from 53 tests.

About plugin

  • Plugin page: dmg-archives-widget
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.6
  • WordPress version: 5.8.1
  • First release: Aug 28, 2016
  • Latest release: Aug 28, 2016
  • Number of updates: 3
  • Update frequency: every 1.3 days
  • Top authors: dancoded (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 464 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼301.55ms] Passed 4 tests

This is a short check of server-side resources used by DMG Post Archives Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1229.02 ▲6.84
Dashboard /wp-admin3.07 ▲0.0142.17 ▲0.99
Posts /wp-admin/edit.php3.15 ▲0.0441.78 ▼0.50
Add New Post /wp-admin/post-new.php5.43 ▼0.0090.70 ▼1,204.33
Media Library /wp-admin/upload.php3.01 ▲0.0031.91 ▼2.36

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 1 new option
New WordPress options
widget_dmg_archives_widget

Browser metrics Passed 4 tests

DMG Post Archives Widget: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,678 ▲7215.89 ▲0.417.55 ▼1.5048.43 ▲4.58
Dashboard /wp-admin2,959 ▲1066.08 ▲0.18131.02 ▲1.11111.67 ▲9.51
Posts /wp-admin/edit.php2,703 ▼32.69 ▲0.0168.15 ▲1.8892.37 ▲9.66
Add New Post /wp-admin/post-new.php1,653 ▼20018.62 ▼0.55362.05 ▼1.80109.04 ▲2.06
Media Library /wp-admin/upload.php1,778 ▲95.02 ▲0.03145.74 ▼1.68109.95 ▼4.85

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_dmg_archives_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
The smoke test was a success, however most plugin functionality was not tested

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

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: menu, css, archives widget, list archives, monthly

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

The principal PHP file in "DMG Post Archives Widget" v. 1.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 166 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
No dangerous file extensions were detected359 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP315888330
JSON14018
Markdown24011

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity22.50
▷ Minimum class complexity9.00
▷ Maximum class complexity36.00
Average method complexity2.87
▷ 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 1 test

Image compression Passed 1 test

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin