84% tomparis-youtube-widget

Code Review | TomParisDE YouTube Widget

WordPress plugin TomParisDE YouTube Widget scored 84% from 54 tests.

About plugin

  • Plugin page: tomparis-youtube-...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-5.2.1
  • WordPress version: 6.3.1
  • First release: May 14, 2017
  • Latest release: Jun 8, 2019
  • Number of updates: 10
  • Update frequency: every 75.7 days
  • Top authors: TomParisDE (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 824 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.08MB] [CPU: ▼1.43ms] Passed 4 tests

A check of server-side resources used by TomParisDE YouTube Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0841.19 ▲2.93
Dashboard /wp-admin3.38 ▲0.0849.72 ▲1.53
Posts /wp-admin/edit.php3.50 ▲0.1446.11 ▼5.41
Add New Post /wp-admin/post-new.php5.97 ▲0.0894.79 ▼4.77
Media Library /wp-admin/upload.php3.31 ▲0.0836.98 ▲2.98

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded
widget_tp_ytw_widget
widget_theysaidso_widget

Browser metrics Passed 4 tests

TomParisDE YouTube Widget: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲6714.68 ▲0.331.79 ▼0.1644.68 ▲4.57
Dashboard /wp-admin2,200 ▲125.81 ▲0.90102.64 ▲1.8042.88 ▲3.21
Posts /wp-admin/edit.php2,089 ▲211.97 ▼0.0635.76 ▲1.6834.45 ▲1.95
Add New Post /wp-admin/post-new.php1,533 ▼023.62 ▲0.77654.78 ▲32.4349.51 ▼4.27
Media Library /wp-admin/upload.php1,388 ▼34.30 ▲0.0996.89 ▼4.9041.79 ▼3.17

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_tp_ytw_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means 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
Please fix the following
  • 12× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: youtube_channel_id in wp-content/plugins/tomparis-youtube-widget/views/youtube.php on line 25
    • > PHP Notice
      Undefined variable: youtube_channel_id in wp-content/plugins/tomparis-youtube-widget/views/youtube.php on line 22
    • > PHP Notice
      Undefined variable: youtube_channel_name in wp-content/plugins/tomparis-youtube-widget/views/youtube.php on line 22
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/tomparis-youtube-widget/includes/widget.php:6
    • > PHP Notice
      Undefined variable: youtube_channel_name in wp-content/plugins/tomparis-youtube-widget/views/youtube.php on line 18
    • > PHP Notice
      Undefined variable: youtube_channel_name in wp-content/plugins/tomparis-youtube-widget/views/youtube.php on line 22
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/tomparis-youtube-widget/views/youtube.php on line 19
    • > PHP Notice
      Undefined variable: banner_postion in wp-content/plugins/tomparis-youtube-widget/views/youtube.php on line 33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/tomparis-youtube-widget/views/youtube.php:42
    • > PHP Notice
      Undefined variable: youtube_snippet in wp-content/plugins/tomparis-youtube-widget/views/youtube.php on line 19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% 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
6 plugin tags: api, youtube, youtube widget, tomparis, tomparisde...

tomparis-youtube-widget/tp-youtube-widget.php 85% from 13 tests

The principal PHP file in "TomParisDE YouTube Widget" v. 1.0.2 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("tomparis-youtube-widget.php" instead of "tp-youtube-widget.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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 plugin451 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP5110127320
CSS1270131

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity15.50
▷ Minimum class complexity2.00
▷ Maximum class complexity29.00
Average method complexity3.90
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods330.00%
▷ Public methods880.00%
▷ Protected methods00.00%
▷ Private methods220.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/youtube-logo-light.png10.10KB3.31KB▼ 67.27%
public/img/youtube-logo-light-original.png6.92KB3.76KB▼ 45.63%