84% viewport-exchanger

Code Review | Viewport Exchanger

WordPress plugin Viewport Exchanger scored84%from 54 tests.

About plugin

  • Plugin page: viewport-exchanger
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.1-4.0.0
  • WordPress version: 6.3.1
  • First release: Jun 24, 2014
  • Latest release: Sep 26, 2014
  • Number of updates: 11
  • Update frequency: every 8.7 days
  • Top authors: hideokamoto (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /2,040 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.83ms] Passed 4 tests

An overview of server-side resources used by Viewport Exchanger
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0036.76 ▼6.42
Dashboard /wp-admin3.31 ▲0.0151.95 ▲1.21
Posts /wp-admin/edit.php3.36 ▲0.0046.90 ▼3.06
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.11 ▼11.05
Media Library /wp-admin/upload.php3.23 ▲0.0037.06 ▲1.61

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Viewport Exchanger
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.22 ▼0.141.66 ▼0.0239.15 ▼5.33
Dashboard /wp-admin2,192 ▲125.62 ▼0.0393.72 ▲3.1341.35 ▲0.16
Posts /wp-admin/edit.php2,103 ▲32.00 ▲0.0339.39 ▲0.1835.37 ▼0.13
Add New Post /wp-admin/post-new.php1,526 ▼123.17 ▼0.33637.18 ▼46.4753.44 ▼15.23
Media Library /wp-admin/upload.php1,397 ▼34.17 ▼0.0199.06 ▼12.2443.58 ▼5.31

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 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 50% from 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
Please fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_is_mobile() in wp-content/plugins/viewport-exchanger/mobilepcviewer.php:26

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 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
1 plugin tags: viewport

viewport-exchanger/mobilepcviewer.php 92% from 13 tests

The principal PHP file in "Viewport Exchanger" v. 1.2 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("viewport-exchanger.php" instead of "mobilepcviewer.php")

Code Analysis Passed 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 plugin147 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript22524104
CSS10033
PHP142010

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.20
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin