83% show-for-device

Code Review | Hide and show for devices

WordPress plugin Hide and show for devices scored83%from 54 tests.

About plugin

  • Plugin page: show-for-device
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8.4-5.3.2
  • WordPress version: 6.3.1
  • First release: Aug 4, 2018
  • Latest release: May 13, 2020
  • Number of updates: 37
  • Update frequency: every 17.6 days
  • Top authors: desparza (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /737 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
Installer ran successfully

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

Server-side resources used by Hide and show for devices
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.17 ▼4.41
Dashboard /wp-admin3.31 ▲0.0156.82 ▲9.48
Posts /wp-admin/edit.php3.36 ▲0.0152.17 ▲3.68
Add New Post /wp-admin/post-new.php5.89 ▲0.0195.32 ▼43.53
Media Library /wp-admin/upload.php3.24 ▲0.0137.20 ▲3.59
Hide and show /wp-admin/admin.php?page=wp-hide-and-shows-settings3.2034.04
Sobre Daniel Esparza /wp-admin/admin.php?page=desparza-menu3.2036.96

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

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

Browser metrics Passed 4 tests

Hide and show for devices: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,850 ▲9314.74 ▲0.331.85 ▼0.4045.76 ▼4.12
Dashboard /wp-admin2,231 ▲424.88 ▲0.01111.64 ▲1.2255.67 ▲13.71
Posts /wp-admin/edit.php2,117 ▲282.03 ▲0.0042.58 ▲7.8843.02 ▲8.83
Add New Post /wp-admin/post-new.php1,551 ▲3123.28 ▼0.14711.48 ▼108.4761.80 ▲4.23
Media Library /wp-admin/upload.php1,416 ▲344.22 ▲0.07109.08 ▼5.0752.52 ▲4.38
Hide and show /wp-admin/admin.php?page=wp-hide-and-shows-settings8272.1825.0033.46
Sobre Daniel Esparza /wp-admin/admin.php?page=desparza-menu8202.1729.5537.14

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

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
Good news, no errors were detected

SRP 50% from 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
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/show-for-device/wp-show-for-device.php

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Requires php: Version not formatted correctly
You can take inspiration from this readme.txt

show-for-device/wp-show-for-device.php 85% from 13 tests

The entry point to "Hide and show for devices" version 2.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 298 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("show-for-device.php" instead of "wp-show-for-device.php")

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
There were no executable files found in this plugin733 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP3178654728
CSS1125

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.90
Average class complexity123.00
▷ Minimum class complexity123.00
▷ Maximum class complexity123.00
Average method complexity4.70
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods33
▷ Static methods927.27%
▷ Public methods3193.94%
▷ Protected methods26.06%
▷ Private methods00.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants110.00%
▷ Class constants990.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin