83% china-video-block

Code Review | China Video Block

WordPress plugin China Video Block scored83%from 54 tests.

About plugin

  • Plugin page: china-video-block
  • Plugin version: 0.2.5
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8.0
  • WordPress version: 6.3.1
  • First release: May 9, 2019
  • Latest release: Jul 29, 2021
  • Number of updates: 22
  • Update frequency: every 37.0 days
  • Top authors: cjyabraham (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /11,371 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼1.66ms] Passed 4 tests

This is a short check of server-side resources used by China Video Block
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0348.54 ▲5.76
Dashboard /wp-admin3.34 ▲0.0349.59 ▼5.27
Posts /wp-admin/edit.php3.39 ▲0.0349.05 ▼3.94
Add New Post /wp-admin/post-new.php5.92 ▲0.0398.70 ▲3.99
Media Library /wp-admin/upload.php3.26 ▲0.0337.99 ▼1.41
China Video Block /wp-admin/options-general.php?page=cvb3.2333.98

Server storage [IO: ▲0.70MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Just a few items left to fix
  • There were 1 file (4.00KB) illegally modified outside of "wp-content/plugins/china-video-block/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by China Video Block
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲3313.26 ▼1.301.99 ▼0.1242.73 ▲1.35
Dashboard /wp-admin2,225 ▲225.85 ▼0.06106.94 ▲2.3342.07 ▲1.11
Posts /wp-admin/edit.php2,104 ▲72.04 ▲0.0138.64 ▲0.4937.75 ▲0.15
Add New Post /wp-admin/post-new.php6,198 ▲4,67218.92 ▼4.54877.56 ▲207.4352.37 ▲0.36
Media Library /wp-admin/upload.php1,404 ▲44.23 ▲0.0698.92 ▼10.2242.63 ▼7.34
China Video Block /wp-admin/options-general.php?page=cvb7962.0523.6231.84

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

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
The smoke test was a success, however most plugin functionality was not tested

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 trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/china-video-block/src/settings.php:35

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Screenshots: Screenshot #1 (China Video block inserted into a post.) image not found
You can take inspiration from this readme.txt

china-video-block/plugin.php 85% from 13 tests

Analyzing the main PHP file in "China Video Block" version 0.2.5
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 145 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("china-video-block.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected16,886 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
JSON30016,609
PHP32293127
JavaScript483993
Sass33138
Markdown16017
CSS2002

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.16
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%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
1 PNG file occupies 0.07MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png75.48KB20.38KB▼ 73.00%