83% switch-video-quality

Code Review | Switch Video Quality

WordPress plugin Switch Video Quality scored83%from 54 tests.

About plugin

  • Plugin page: switch-video-quality
  • Plugin version: 1.5.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.5.3
  • WordPress version: 6.3.1
  • First release: Aug 27, 2015
  • Latest release: Nov 13, 2020
  • Number of updates: 51
  • Update frequency: every 37.4 days
  • Top authors: team-ok (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

200+ active /9,864 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

Server-side resources used by Switch Video Quality
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0244.32 ▲0.96
Dashboard /wp-admin3.31 ▲0.0147.67 ▼3.44
Posts /wp-admin/edit.php3.37 ▲0.0148.31 ▼1.88
Add New Post /wp-admin/post-new.php5.92 ▲0.0494.60 ▼23.48
Media Library /wp-admin/upload.php3.24 ▲0.0141.35 ▲6.67

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Switch Video Quality
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.16 ▼0.191.83 ▼0.1246.78 ▲0.60
Dashboard /wp-admin2,195 ▲185.55 ▼0.0385.82 ▼2.4638.93 ▼0.68
Posts /wp-admin/edit.php2,103 ▼02.00 ▲0.0439.80 ▼0.6635.74 ▲1.94
Add New Post /wp-admin/post-new.php6,436 ▲4,91026.26 ▲3.11893.26 ▲257.1464.58 ▲13.46
Media Library /wp-admin/upload.php1,400 ▼04.21 ▲0.01101.65 ▼6.2745.12 ▼0.16

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

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
Even though everything seems fine, this is not an exhaustive test

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 fix the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bloginfo() in wp-content/plugins/switch-video-quality/template/svq_embeds.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/switch-video-quality/switch_video_quality.php:16

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

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Tags: Please delete some tags, you are using 23 tag instead of maximum 10
You can take inspiration from this readme.txt

switch-video-quality/switch_video_quality.php 85% from 13 tests

Analyzing the main PHP file in "Switch Video Quality" version 1.5.7
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 175 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("switch-video-quality.php" instead of "switch_video_quality.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected2,342 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
CSS4722930
JavaScript65274720
PHP25266549
PO File14446125
SVG30118

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.44
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%
Functions12
▷ Named functions12100.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
11 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/svq_playlist_play.png0.96KB1.02KB0.00%
img/svq_control.png0.41KB0.51KB0.00%
img/svq_overlay_icons.png2.42KB0.92KB▼ 61.87%
img/svq_controls.png1.32KB0.35KB▼ 73.59%
img/svq_close.png0.47KB0.47KB0.00%