89% widget-display-conditions

Code Review | Widget Display Conditions

WordPress plugin Widget Display Conditions scored89%from 54 tests.

About plugin

  • Plugin page: widget-display-co...
  • Plugin version: 0.2.8
  • PHP compatiblity: 5.6.27+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-5.7.1
  • WordPress version: 6.3.1
  • First release: Nov 25, 2017
  • Latest release: Apr 22, 2021
  • Number of updates: 60
  • Update frequency: every 20.8 days
  • Top authors: MaartenM (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

600+ active /7,834 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.37MB] [CPU: ▼4.25ms] Passed 4 tests

Server-side resources used by Widget Display Conditions
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3248.61 ▲7.95
Dashboard /wp-admin3.70 ▲0.3951.16 ▼3.24
Posts /wp-admin/edit.php3.75 ▲0.3955.25 ▲6.88
Add New Post /wp-admin/post-new.php6.28 ▲0.39109.89 ▼19.71
Media Library /wp-admin/upload.php3.62 ▲0.3938.32 ▼0.93
Updater /wp-admin/admin.php?page=wdc-updater3.5334.68

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 47 new files
Database: no new tables, 7 new options
New WordPress options
wdc_version
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Widget Display Conditions
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.46 ▲0.172.15 ▲0.4641.75 ▲0.44
Dashboard /wp-admin2,206 ▲175.91 ▲0.99109.28 ▼25.6338.36 ▼10.49
Posts /wp-admin/edit.php2,092 ▲31.99 ▼0.0342.10 ▲7.5135.86 ▲3.44
Add New Post /wp-admin/post-new.php1,514 ▼2217.91 ▼5.41641.88 ▼2.7250.87 ▼0.19
Media Library /wp-admin/upload.php1,391 ▲34.20 ▲0.01102.38 ▼12.5142.66 ▼0.88
Updater /wp-admin/admin.php?page=wdc-updater7502.0524.1722.82

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests Passed 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 Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Widget form), #2 (Widget Settings with available options)
Please take inspiration from this readme.txt

widget-display-conditions/widget-display-conditions.php 92% from 13 tests

The primary PHP file in "Widget Display Conditions" version 0.2.8 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected2,665 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
PHP345148971,629
JavaScript4176132801
CSS2114235

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity3.79
▷ Minimum class complexity1.00
▷ Maximum class complexity18.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes28
▷ Abstract classes00.00%
▷ Concrete classes28100.00%
▷ Final classes414.29%
Methods110
▷ Static methods1614.55%
▷ Public methods10797.27%
▷ Protected methods00.00%
▷ Private methods32.73%
Functions41
▷ Named functions41100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
3 PNG files occupy 0.37MB with 0.26MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png52.44KB15.17KB▼ 71.06%
screenshot-2.png100.09KB29.05KB▼ 70.97%
screenshot-3.png222.06KB63.13KB▼ 71.57%