84% wp-automatic-widget

Code Review | wp_automatic_widget

WordPress plugin wp_automatic_widget scored 84% from 54 tests.

About plugin

  • Plugin page: wp-automatic-widget
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.5
  • WordPress version: 5.8.1
  • First release: Aug 21, 2013
  • Latest release: Sep 1, 2013
  • Number of updates: 7
  • Update frequency: every 2.7 days
  • Top authors: Codstack (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 814 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
Install script ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼147.33ms] Passed 4 tests

Server-side resources used by wp_automatic_widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.93 ▲0.2137.74 ▲15.10
Dashboard /wp-admin3.12 ▲0.0639.18 ▼11.44
Posts /wp-admin/edit.php3.20 ▲0.0942.84 ▼5.25
Add New Post /wp-admin/post-new.php5.51 ▲0.0893.32 ▼577.59
Media Library /wp-admin/upload.php3.09 ▲0.0940.77 ▲4.97

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

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

Browser metrics Passed 4 tests

wp_automatic_widget: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,773 ▲17715.92 ▲0.168.75 ▼1.1246.01 ▼5.14
Dashboard /wp-admin3,042 ▲1116.17 ▼0.08145.47 ▼15.46110.86 ▼1.18
Posts /wp-admin/edit.php2,755 ▲162.75 ▲0.0485.12 ▲16.0091.47 ▲3.85
Add New Post /wp-admin/post-new.php1,508 ▼2,19918.38 ▼0.67394.65 ▼92.51106.17 ▼17.66
Media Library /wp-admin/upload.php1,823 ▲165.05 ▼0.04148.81 ▼3.28119.73 ▼5.40

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 1 option
    • widget_wp_automatic_widget_core

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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-automatic-widget/wp_automatic_widget_core.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-automatic-widget/wp_automatic_widget_core.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === wp-automatic-widget === )
You can look at the official readme.txt

wp-automatic-widget/index.php 92% from 13 tests

"wp_automatic_widget" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-automatic-widget.php" instead of "index.php")

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
There were no executable files found in this plugin6,568 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
CSS28662555,795
PHP35567584
JavaScript1431189

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity14.50
▷ Minimum class complexity6.00
▷ Maximum class complexity23.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods16
▷ Static methods1275.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
2 compressed PNG files occupy 0.02MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/glyphicons-halflings.png12.50KB10.35KB▼ 17.19%
img/glyphicons-halflings-white.png8.57KB9.20KB0.00%