10% mytube

Code Review | MyTube PlayList

WordPress plugin MyTube PlayList scored10%from 54 tests.

About plugin

  • Plugin page: mytube
  • Plugin version: 2.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.2.4
  • WordPress version: 6.3.1
  • First release: Jun 5, 2015
  • Latest release: Aug 7, 2015
  • Number of updates: 203
  • Update frequency: every 0.3 days
  • Top authors: tes-india (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /4,056 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/mytube/mytube_list.php+52
    Undefined variable: hook

Server metrics [RAM: ▼1.90MB] [CPU: ▼58.38ms] Passed 4 tests

An overview of server-side resources used by MyTube PlayList
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.10 ▼1.364.77 ▼38.39
Dashboard /wp-admin2.12 ▼1.236.82 ▼61.62
Posts /wp-admin/edit.php2.12 ▼1.246.08 ▼45.58
Add New Post /wp-admin/post-new.php2.12 ▼3.778.42 ▼87.91
Media Library /wp-admin/upload.php2.12 ▼1.115.63 ▼32.54
Create PlayList /wp-admin/admin.php?page=mytube_select_videos2.126.26
Global Settings /wp-admin/admin.php?page=mytube_settings2.126.25
My PlayList /wp-admin/admin.php?page=mytube_change_videos2.125.30
Edit PlayList /wp-admin/admin.php?page=mytube_edit_videos2.126.10
Save Category /wp-admin/admin.php?page=mytube_savedata2.125.52

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 52 new files
Database: 2 new tables, 31 new options
New tables
wp_mytube_videos
wp_mytube_playlist
New WordPress options
mytube_pagination_type
mytube_vimeo_channel_id
mytube_open_type
mytube_text_size
mytube_column
mytube_pg_bg_color
db_upgraded
mytube_text_color
mytube_pg_act_bg_color
theysaidso_admin_options
...

Browser metrics Passed 4 tests

Checking browser requirements for MyTube PlayList
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,951 ▲19013.57 ▼0.7011.68 ▲9.9442.05 ▼2.68
Dashboard /wp-admin2,218 ▲445.52 ▼0.0689.67 ▼2.2769.97 ▲32.95
Posts /wp-admin/edit.php2,126 ▲261.99 ▲0.0340.43 ▲1.1932.48 ▼3.79
Add New Post /wp-admin/post-new.php1,563 ▲3721.89 ▼1.37656.93 ▼22.49182.76 ▲124.41
Media Library /wp-admin/upload.php1,423 ▲234.15 ▼0.0396.11 ▼14.3188.96 ▲41.68
Create PlayList /wp-admin/admin.php?page=mytube_select_videos8692.0127.5428.40
Global Settings /wp-admin/admin.php?page=mytube_settings2,9163.0089.4839.61
My PlayList /wp-admin/admin.php?page=mytube_change_videos8402.1424.4326.32
Edit PlayList /wp-admin/admin.php?page=mytube_edit_videos8982.0429.6129.60
Save Category /wp-admin/admin.php?page=mytube_savedata3,5713.35108.5731.59

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/mytube/mytube_list.php+52
    Undefined variable: hook
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_mytube_videos
    • wp_mytube_playlist
  • The uninstall procedure has failed, leaving 31 options in the database
    • mytube_text_size
    • mytube_text_color
    • mytube_pg_text_color
    • db_upgraded
    • widget_recent-posts
    • mytube_apikey
    • theysaidso_admin_options
    • mytube_pagination_type
    • mytube_pg_border_color
    • mytube_pg_hover_bg_color
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mytube_savedata
    • > Notice in wp-content/plugins/mytube/mytube_list.php+52
    Undefined variable: hook
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mytube_savedata
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)
    • > GET request to /wp-admin/admin.php?page=mytube_select_videos
    • > Deprecated in wp-content/plugins/mytube/mytube_list.php+107
    Non-static method Mytube_Admin_Data::MyTube_create_playlist_by_channel_id() should not be called statically
    • > GET request to /wp-admin/admin.php?page=mytube_select_videos
    • > Notice in wp-content/plugins/mytube/admin/include/create_playlist_by_channel_id.php+20
    Undefined index: channelId
    • > GET request to /wp-admin/admin.php?page=mytube_select_videos
    • > Warning in wp-content/plugins/mytube/admin/include/create_playlist_by_channel_id.php+22
    file_get_contents(https://www.googleapis.com/youtube/v3/playlists?part=snippet,contentDetails&maxResults=5&channelId=&key=): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden

    • > GET request to /wp-admin/admin.php?page=mytube_select_videos
    • > Notice in wp-content/plugins/mytube/admin/include/create_playlist_by_channel_id.php+24
    Trying to get property 'items' of non-object
    • > GET request to /wp-admin/admin.php?page=mytube_select_videos
    • > Notice in wp-content/plugins/mytube/admin/include/create_playlist_by_channel_id.php+25
    Undefined index: videoPlayList
    • > GET request to /wp-admin/admin.php?page=mytube_select_videos
    • > Notice in wp-content/plugins/mytube/admin/include/create_playlist_by_channel_id.php+86
    Undefined index: addVideoPlayList
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mytube_change_videos
    • > Notice in wp-content/plugins/mytube/admin/include/change_playlist_by_id.php+22
    Undefined index: success-create
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mytube_select_videos
    • > Notice in wp-content/plugins/mytube/admin/include/create_playlist_by_channel_id.php+167
    Undefined variable: videoid
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mytube_savedata
    • > Deprecated in wp-content/plugins/mytube/mytube_list.php+97
    Non-static method Mytube_Admin_Data::MyTube_management_settings() should not be called statically
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mytube_savedata
    • > Notice in wp-content/plugins/mytube/admin/include/page-settings.php+23
    Undefined index: settings-updated
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mytube_savedata
    • > Notice in wp-content/plugins/mytube/admin/include/page-settings.php+28
    Undefined index: settings-restore
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mytube_savedata
    • > Notice in wp-content/plugins/mytube/admin/include/page-settings.php+33
    Undefined index: settings-create
    • > GET request to /wp-admin/admin.php?page=mytube_change_videos
    • > Deprecated in wp-content/plugins/mytube/mytube_list.php+112
    Non-static method Mytube_Admin_Data::MyTube_change_playlist_by_id() should not be called statically
    • > GET request to /wp-admin/admin.php?page=mytube_change_videos
    • > Notice in wp-content/plugins/mytube/admin/include/change_playlist_by_id.php+32
    Undefined index: playlist-deleted
    • > GET request to /wp-admin/admin.php?page=mytube_edit_videos
    • > Deprecated in wp-content/plugins/mytube/mytube_list.php+117
    Non-static method Mytube_Admin_Data::MyTube_edit_playlist_by_id() should not be called statically
    • > GET request to /wp-admin/admin.php?page=mytube_edit_videos
    • > Notice in wp-content/plugins/mytube/admin/include/edit_playlist.php+9
    Undefined index: playlistid
    • > GET request to /wp-admin/admin.php?page=mytube_edit_videos
    • > Notice in wp-content/plugins/mytube/admin/include/edit_playlist.php+14
    Undefined index: playlist-updated
    • > GET request to /wp-admin/admin.php?page=mytube_edit_videos
    • > Notice in wp-content/plugins/mytube/admin/include/edit_playlist.php+20
    Undefined index: video-already
    • > GET request to /wp-admin/admin.php?page=mytube_edit_videos
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
    • > GET request to /wp-admin/admin.php?page=mytube_edit_videos
    • > Notice in wp-content/plugins/mytube/admin/include/edit_playlist.php+33
    Trying to get property 'id' of non-object
    • > GET request to /wp-admin/admin.php?page=mytube_edit_videos
    • > Notice in wp-content/plugins/mytube/admin/include/edit_playlist.php+34
    Trying to get property 'name' of non-object
    • > GET request to /wp-admin/admin.php?page=mytube_savedata
    • > Deprecated in wp-content/plugins/mytube/mytube_list.php+102
    Non-static method Mytube_Admin_Data::MyTube_save_data() should not be called statically

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
Please fix the following
  • 8× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/mytube/mytube_override/wrapper-end.php
    • > /wp-content/plugins/mytube/mytube_override/list_youtube_data.php
    • > /wp-content/plugins/mytube/mytube_override/vimeo/vimeo_list.php
    • > /wp-content/plugins/mytube/mytube_override/vimeo/wrapper-start.php
    • > /wp-content/plugins/mytube/admin/include/savedata.php
    • > /wp-content/plugins/mytube/mytube_override/list_youtube_channel.php
    • > /wp-content/plugins/mytube/mytube_override/wrapper-start.php
    • > /wp-content/plugins/mytube/mytube_override/list_mylist_data.php
  • 74× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to get property 'thumbnails' of non-object in wp-content/plugins/mytube/mytube_override/list_youtube_channel.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mytube/hookfunction.php:2
    • > PHP Notice
      Undefined variable: playlistid in wp-content/plugins/mytube/template/include/youtube_playlist_wise.php on line 7
    • > PHP Notice
      Undefined index: success-create in wp-content/plugins/mytube/admin/include/change_playlist_by_id.php on line 22
    • > PHP Notice
      Undefined variable: latestvideos in wp-content/plugins/mytube/template/include/youtube_playlist_wise.php on line 13
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/mytube/mytube_override/list_mylist_data.php on line 4
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/mytube/admin/include/create_playlist_by_channel_id.php on line 7
    • > PHP Notice
      Trying to get property 'title' of non-object in wp-content/plugins/mytube/mytube_override/list_youtube_channel.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function shortcode_atts() in wp-content/plugins/mytube/template/include/vimeodata.php:5
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/mytube/admin/include/page-settings.php on line 8

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mytube_savedata
    • > Network (severe)
    wp-content/plugins/mytube/admin/my-script.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: youtube, videolist, wordpress youtube plugin, playlist, mytube

mytube/mytube_list.php 85% from 13 tests

"MyTube PlayList" version 2.0.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("mytube.php" instead of "mytube_list.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 274 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected3,270 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP25342832,175
JavaScript119778830
CSS3927265

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity11.25
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity2.24
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods33
▷ Static methods00.00%
▷ Public methods33100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
15 PNG files occupy 1.08MB with 0.48MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png561.50KB150.18KB▼ 73.25%
assets/images/vimeo_icon.png1.04KB1.13KB0.00%
screenshot-1.png91.73KB45.95KB▼ 49.91%
screenshot-4.png111.78KB50.46KB▼ 54.86%
screenshot-3.png30.34KB17.35KB▼ 42.81%