79% device-wrapper

Code Review | Device Wrapper

WordPress plugin Device Wrapper scored79%from 54 tests.

About plugin

  • Plugin page: device-wrapper
  • Plugin version: 1.1.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.2
  • WordPress version: 6.3.1
  • First release: Apr 25, 2023
  • Latest release: Jul 24, 2023
  • Number of updates: 6
  • Update frequency: every 15.5 days
  • Top authors: barb0ss (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /386 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲4.99MB] [CPU: ▲23.80ms] 75% from 4 tests

This is a short check of server-side resources used by Device Wrapper
The following require your attention
  • CPU: Total CPU usage must kept under 500.00ms (currently 2,068.24ms on /wp-admin/options-general.php?page=device-wrapper)
PageMemory (MB)CPU Time (ms)
Home /8.88 ▲5.4262.77 ▲21.84
Dashboard /wp-admin8.90 ▲5.6079.07 ▲28.21
Posts /wp-admin/edit.php8.90 ▲5.5478.64 ▲27.49
Add New Post /wp-admin/post-new.php9.31 ▲3.42116.20 ▲17.65
Media Library /wp-admin/upload.php8.90 ▲5.6771.88 ▲35.05
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.9058.13
Device Wrapper /wp-admin/options-general.php?page=device-wrapper8.902,068.24

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 249 new files
Database: no new tables, 9 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
fs_active_plugins
fs_accounts
db_upgraded
widget_recent-posts
widget_recent-comments
fs_debug_mode
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Device Wrapper
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,917 ▲15613.59 ▼0.768.45 ▲6.5728.21 ▼15.64
Dashboard /wp-admin2,215 ▲415.54 ▼0.1388.07 ▼8.2840.84 ▼2.47
Posts /wp-admin/edit.php2,127 ▲272.12 ▲0.0938.54 ▲3.4736.94 ▼3.23
Add New Post /wp-admin/post-new.php6,200 ▲4,67220.66 ▼2.51863.35 ▲146.4572.90 ▲19.68
Media Library /wp-admin/upload.php1,488 ▲884.22 ▲0.0597.58 ▼2.3145.52 ▲1.34
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0781.7023.9229.96
Device Wrapper /wp-admin/options-general.php?page=device-wrapper9891.6628.0257.82

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/device-wrapper/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 9 options
    • fs_active_plugins
    • widget_recent-posts
    • fs_accounts
    • widget_theysaidso_widget
    • fs_debug_mode
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
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, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: gadget, wrapper, device, wrap

device-wrapper/device-wrapper.php Passed 13 tests

The main PHP file in "Device Wrapper" ver. 1.1.2 adds more information about the plugin and also serves as the entry point for this plugin
81 characters long description:
This plugin enables users to wrap an image, video or iframe into a device mockup.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin40,903 lines of code in 190 files:
LanguageFilesBlank linesComment linesLines of code
PHP1198,00517,31033,442
SVG3764124,532
CSS162841938
JavaScript11112366922
Sass36912458
JSON300442
PO File167125169

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
These items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity93.06
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.59
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes48
▷ Abstract classes24.17%
▷ Concrete classes4695.83%
▷ Final classes00.00%
Methods1,259
▷ Static methods19715.65%
▷ Public methods87069.10%
▷ Protected methods171.35%
▷ Private methods37229.55%
Functions108
▷ Named functions108100.00%
▷ Anonymous functions00.00%
Constants149
▷ Global constants10268.46%
▷ Class constants4731.54%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
14 PNG files occupy 0.05MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/images/icons/pixel.png0.52KB0.39KB▼ 24.86%
src/images/icons/ipad_pro.png0.46KB0.35KB▼ 23.34%
src/images/icons/galaxy.png0.49KB0.42KB▼ 14.83%
src/images/icons/iwatch.png2.17KB1.34KB▼ 38.34%
src/images/icons/ipad.png0.40KB0.33KB▼ 16.91%