84% widgets-device-display-option

Code Review | Widgets Device Display Option

WordPress plugin Widgets Device Display Option scored84%from 54 tests.

About plugin

  • Plugin page: widgets-device-di...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.9.5
  • WordPress version: 6.3.1
  • First release: Apr 27, 2018
  • Latest release: Apr 27, 2018
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: mr_mat (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /522 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by Widgets Device Display Option
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0143.53 ▼3.13
Dashboard /wp-admin3.31 ▲0.0146.57 ▼6.11
Posts /wp-admin/edit.php3.36 ▲0.0151.96 ▲2.45
Add New Post /wp-admin/post-new.php5.89 ▲0.0196.15 ▼5.85
Media Library /wp-admin/upload.php3.23 ▲0.0036.87 ▲1.50

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Widgets Device Display Option
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.37 ▼0.311.68 ▼0.4341.61 ▼1.55
Dashboard /wp-admin2,195 ▲185.58 ▼0.0587.29 ▼1.0240.10 ▼4.74
Posts /wp-admin/edit.php2,103 ▼02.00 ▼0.0142.16 ▲5.7941.19 ▲6.27
Add New Post /wp-admin/post-new.php1,532 ▼1323.25 ▲0.03657.41 ▼42.5054.05 ▼10.40
Media Library /wp-admin/upload.php1,400 ▲34.27 ▼0.06100.49 ▼3.5347.48 ▲2.45

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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 fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/widgets-device-display-option/widgets-device-display-option.php:84

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Plugin Name: Please specify the plugin name on the first line ( === widgets-device-display-option === )
  • Screenshots: Please add an image for screenshot #1 (Widget Settings page)
You can take inspiration from this readme.txt

widgets-device-display-option/widgets-device-display-option.php Passed 13 tests

The primary PHP file in "Widgets Device Display Option" version 1.0 is used by WordPress to initiate all plugin functionality
96 characters long description:
Adds option for widgets to choose on which device they are displayed : mobile, desktop, or both.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected43 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1142943

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.77
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity4.33
▷ Minimum method complexity2.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods3100.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png14.44KB6.84KB▼ 52.63%