78% papaya-youtube-widget

Code Review | Papaya YouTube Widget

WordPress plugin Papaya YouTube Widget scored78%from 54 tests.

About plugin

  • Plugin page: papaya-youtube-wi...
  • Plugin version: 2.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.1.1
  • WordPress version: 6.3.1
  • First release: Apr 21, 2020
  • Latest release: Jan 29, 2023
  • Number of updates: 30
  • Update frequency: every 33.8 days
  • Top authors: sagargurnani (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /951 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.07MB] [CPU: ▼10.62ms] Passed 4 tests

This is a short check of server-side resources used by Papaya YouTube Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0743.25 ▲1.07
Dashboard /wp-admin3.36 ▲0.0650.41 ▼2.13
Posts /wp-admin/edit.php3.48 ▲0.1245.23 ▼12.16
Add New Post /wp-admin/post-new.php5.96 ▲0.0889.09 ▼22.81
Media Library /wp-admin/upload.php3.29 ▲0.0639.91 ▼5.37
YouTube Widget /wp-admin/options-general.php?page=papaya-youtube-widget-settings3.2833.39

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 22 new files
Database: 2 new tables, 7 new options
New tables
wp_pyw_video_data
wp_pyw_channels
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_papayayoutubewidget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Papaya YouTube Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,992 ▲24614.32 ▼0.127.18 ▲5.2539.68 ▼4.67
Dashboard /wp-admin2,209 ▲245.87 ▼0.01101.30 ▼9.1739.04 ▼7.12
Posts /wp-admin/edit.php2,101 ▲122.03 ▲0.0337.91 ▼3.8134.52 ▼4.06
Add New Post /wp-admin/post-new.php1,536 ▲323.10 ▼0.02681.63 ▲22.7953.07 ▼0.69
Media Library /wp-admin/upload.php1,394 ▲64.21 ▼0.0497.37 ▼9.8945.35 ▼2.83
YouTube Widget /wp-admin/options-general.php?page=papaya-youtube-widget-settings1,2682.1924.7538.19

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_papayayoutubewidget
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% 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 0% 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
The following issues need your attention
  • 11× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/papaya-youtube-widget/template_parts/accordion-templates/howto_use_widget.php
    • > /wp-content/plugins/papaya-youtube-widget/template_parts/accordion-templates/howto_hire_developer.php
    • > /wp-content/plugins/papaya-youtube-widget/template_parts/accordion-templates/howto_google_apikey.php
    • > /wp-content/plugins/papaya-youtube-widget/template_parts/show_video_modal.php
    • > /wp-content/plugins/papaya-youtube-widget/template_parts/accordion-templates/howto_youtube_channelid.php
    • > /wp-content/plugins/papaya-youtube-widget/template_parts/accordion-templates/howto_hire_papaya.php
    • > /wp-content/plugins/papaya-youtube-widget/template_parts/accordion-templates/why_do_my_videos_stop_showing.php
    • > /wp-content/plugins/papaya-youtube-widget/template_parts/accordion-templates/it_does_not_work_why.php
    • > /wp-content/plugins/papaya-youtube-widget/template_parts/accordion-templates/howto_use_shortcode.php
    • > /wp-content/plugins/papaya-youtube-widget/template_parts/accordion-templates/howto_change_layout.php
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/papaya-youtube-widget/template_parts/show_video_grid.php on line 17
    • > PHP Fatal error
      Uncaught Error: Class 'PapayaYoutubePlugin' not found in wp-content/plugins/papaya-youtube-widget/inc/class-papaya-youtube-plugin-settings.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/papaya-youtube-widget/template_parts/accordion-templates/refresh_videos.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/papaya-youtube-widget/template_parts/accordion-templates/http_referer_error.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/papaya-youtube-widget/inc/class-papaya-youtube-widget.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: youtube, widget, channel

papaya-youtube-widget/papaya-youtube-widget.php 92% from 13 tests

This is the main PHP file of "Papaya YouTube Widget" version 2.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 202 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin986 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP18205447842
CSS1161374
JavaScript2202770

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity27.00
▷ Minimum class complexity12.00
▷ Maximum class complexity44.00
Average method complexity2.70
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods46
▷ Static methods00.00%
▷ Public methods46100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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
PNG images were not found in this plugin