78% settings-for-youtube-block

Code Review | Settings for YouTube block

WordPress plugin Settings for YouTube block scored78%from 54 tests.

About plugin

  • Plugin page: settings-for-yout...
  • Plugin version: 1.05
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0.1
  • WordPress version: 6.3.1
  • First release: Apr 3, 2021
  • Latest release: Aug 26, 2022
  • Number of updates: 18
  • Update frequency: every 28.4 days
  • Top authors: jonkastonka (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /696 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼5.39ms] Passed 4 tests

A check of server-side resources used by Settings for YouTube block
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.84 ▼10.43
Dashboard /wp-admin3.35 ▲0.0450.18 ▼1.83
Posts /wp-admin/edit.php3.40 ▲0.0451.70 ▼1.77
Add New Post /wp-admin/post-new.php5.93 ▲0.0494.67 ▼5.76
Media Library /wp-admin/upload.php3.27 ▲0.0438.49 ▼3.52
Settings for YouTube block /wp-admin/options-general.php?page=settings_for_youtube_block_settings3.2535.06

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Settings for YouTube block
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.72 ▼0.581.96 ▲0.2143.55 ▼0.42
Dashboard /wp-admin2,210 ▲195.85 ▲0.95106.84 ▼4.2139.05 ▼2.63
Posts /wp-admin/edit.php2,096 ▲41.98 ▼0.0240.70 ▲2.5836.14 ▲2.24
Add New Post /wp-admin/post-new.php1,517 ▼1117.48 ▼5.30667.72 ▼16.8463.57 ▲3.27
Media Library /wp-admin/upload.php1,392 ▲44.25 ▲0.0297.49 ▼24.8543.00 ▼7.48
Settings for YouTube block /wp-admin/options-general.php?page=settings_for_youtube_block_settings9391.6924.5129.64

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/settings-for-youtube-block/inc/settings-settings-for-youtube-block-update-options.php
    • > /wp-content/plugins/settings-for-youtube-block/settings-for-youtube-block.php
    • > /wp-content/plugins/settings-for-youtube-block/inc/settings-settings-for-youtube-block.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=settings_for_youtube_block_settings
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).wpColorPicker is not a function" "TypeError: jQuery(...).wpColorPicker is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/options-general.php?page=settings_for_youtube_block_settings:232:51)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=settings_for_youtube_block_settings
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).wpColorPicker is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
7 plugin tags: rel, youtube, related, block, block editor...

settings-for-youtube-block/settings-for-youtube-block.php 85% from 13 tests

The entry point to "Settings for YouTube block" version 1.05 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Description: Please don't use more than 140 characters for the plugin description (currently 232 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin394 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP42515312
PO File1272982

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
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%
Functions6
▷ Named functions6100.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
No PNG images were found in this plugin