84% lbyt-lb-youtube

Code Review | LBYT - LB Youtube

WordPress plugin LBYT - LB Youtube scored84%from 54 tests.

About plugin

  • Plugin page: lbyt-lb-youtube
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.3.29+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8.1-5.8.1
  • WordPress version: 6.3.1
  • First release: Nov 13, 2021
  • Latest release: Nov 13, 2021
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: baciotti (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /276 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
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼2.93ms] Passed 4 tests

This is a short check of server-side resources used by LBYT - LB Youtube
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0542.99 ▲4.15
Dashboard /wp-admin3.36 ▲0.0650.40 ▲1.66
Posts /wp-admin/edit.php3.48 ▲0.1243.07 ▼9.35
Add New Post /wp-admin/post-new.php5.94 ▲0.0688.29 ▼8.19
Media Library /wp-admin/upload.php3.29 ▲0.0638.81 ▲4.24

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for LBYT - LB Youtube
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲4414.34 ▼0.021.86 ▲0.2043.97 ▲2.33
Dashboard /wp-admin2,211 ▲405.59 ▲0.0688.53 ▼1.0439.49 ▼3.74
Posts /wp-admin/edit.php2,113 ▲101.97 ▲0.0135.40 ▼6.3232.65 ▼5.52
Add New Post /wp-admin/post-new.php1,539 ▲423.10 ▲5.04664.43 ▲23.3253.10 ▼14.38
Media Library /wp-admin/upload.php1,419 ▲224.18 ▼0.12102.18 ▲0.5744.54 ▲1.66

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'LBYT\\WpSubPage' not found in wp-content/plugins/lbyt-lb-youtube/src/LBYT/SettingsPage.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'LBYT\\Pimple' not found in wp-content/plugins/lbyt-lb-youtube/src/LBYT/Plugin.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lbyt-lb-youtube/lb-youtube.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
3 plugin tags: shortcode, video, youtube

lbyt-lb-youtube/lb-youtube.php 92% from 13 tests

The primary PHP file in "LBYT - LB Youtube" version 1.0.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("lbyt-lb-youtube.php" instead of "lb-youtube.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin362 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP780143362

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity7.00
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity1.88
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes120.00%
▷ Concrete classes480.00%
▷ Final classes00.00%
Methods26
▷ Static methods00.00%
▷ Public methods26100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions240.00%
▷ Anonymous functions360.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin