10% wp-viewport

Code Review | WP Viewport

WordPress plugin WP Viewport scored10%from 54 tests.

About plugin

  • Plugin page: wp-viewport
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Feb 1, 2013
  • Latest release: Feb 2, 2013
  • Number of updates: 6
  • Update frequency: every 0.5 days
  • Top authors: wgrivera (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,800 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/wp-viewport/wp-viewport.php+27
    Trying to access array offset on value of type bool

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

This is a short check of server-side resources used by WP Viewport
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.20 ▼2.19
Dashboard /wp-admin3.33 ▼0.0143.46 ▼30.72
Posts /wp-admin/edit.php3.38 ▲0.0243.96 ▼2.58
Add New Post /wp-admin/post-new.php5.91 ▲0.0291.11 ▲0.82
Media Library /wp-admin/upload.php3.25 ▲0.0234.40 ▼1.84
WP Viewport /wp-admin/options-general.php?page=wpviewport-settings3.2228.41

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts
wpviewport_options

Browser metrics Passed 4 tests

A check of browser resources used by WP Viewport
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,925 ▲17913.55 ▼0.769.45 ▲7.7343.24 ▼1.29
Dashboard /wp-admin2,210 ▲195.87 ▲0.95106.03 ▼8.6642.10 ▲4.09
Posts /wp-admin/edit.php2,096 ▲42.00 ▼0.0539.34 ▲2.5333.90 ▲0.31
Add New Post /wp-admin/post-new.php1,538 ▲322.98 ▼0.35588.11 ▼93.1853.75 ▼4.32
Media Library /wp-admin/upload.php1,395 ▲74.28 ▲0.0797.29 ▼13.8443.60 ▼3.89
WP Viewport /wp-admin/options-general.php?page=wpviewport-settings8422.0623.6625.46

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • wpviewport_options
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means 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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-viewport/wp-viewport.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
2 plugin tags: responsive, viewport

wp-viewport/wp-viewport.php Passed 13 tests

The principal PHP file in "WP Viewport" v. 1.0 is loaded by WordPress automatically on each request
137 characters long description:
A handy little tool that display the viewport size of any computer or mobile device for testing responsive web designs and media queries.

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 detected140 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP12830102
CSS11023
JavaScript18615

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/resize.png3.28KB0.49KB▼ 85.03%