52% import-youtube-videos

Code Review | Import Youtube Videos

WordPress plugin Import Youtube Videos scored 52% from 54 tests.

About plugin

  • Plugin page: import-youtube-vi...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.8
  • WordPress version: 5.9.2
  • First release: Mar 1, 2022
  • Latest release: Mar 2, 2022
  • Number of updates: 9
  • Update frequency: every 0.1 days
  • Top authors: sivahtech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 55 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.47MB] [CPU: ▼347.17ms] Passed 4 tests

Server-side resources used by Import Youtube Videos
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.97 ▼0.5416.43 ▼33.82
Dashboard /wp-admin2.89 ▼0.5113.99 ▼19.12
Posts /wp-admin/edit.php2.90 ▼0.7415.45 ▼22.37
Add New Post /wp-admin/post-new.php2.89 ▼4.0814.08 ▼1,313.37
Media Library /wp-admin/upload.php2.89 ▼0.4013.14 ▼10.35
Add New /wp-admin/post-new.php?post_type=videos2.9014.10
All Video /wp-admin/edit.php?post_type=videos2.9013.67
Import Youtube /wp-admin/tools.php?page=youtube-importer-import_youtube2.9013.77
Categories /wp-admin/edit-tags.php?taxonomy=categories&post_type=videos2.9014.74

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 30 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Import Youtube Videos
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,821 ▲6715.98 ▲0.447.26 ▲1.572.13 ▼0.41
Dashboard /wp-admin2,942 ▲886.20 ▲0.04116.76 ▼11.63155.30 ▼10.83
Posts /wp-admin/edit.php2,747 ▲563.25 ▲0.0162.65 ▲0.04142.71 ▲0.70
Add New Post /wp-admin/post-new.php1,697 ▲3616.26 ▲0.36403.97 ▼6.95154.64 ▼10.47
Media Library /wp-admin/upload.php1,753 ▲555.56 ▲0.09135.82 ▼1.70184.23 ▼0.96
Add New /wp-admin/post-new.php?post_type=videos9,42718.94565.56150.17
All Video /wp-admin/edit.php?post_type=videos1,4743.1858.06108.62
Import Youtube /wp-admin/tools.php?page=youtube-importer-import_youtube1,3504.7670.82128.72
Categories /wp-admin/edit-tags.php?taxonomy=categories&post_type=videos1,6772.8254.39108.57

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5768
    register_post_type was called incorrectly. Post type names must be between 1 and 20 characters in length. Please see Debugging in WordPress for more information. (This message was added in version 4.2.0.)
  • The plugin did not uninstall correctly, leaving 30 files (0.17MB) in the plugin directory
    • (new file) app/Hooks.php
    • (new file) app/Helper/Importer.php
    • (new file) app/PostTypes.php
    • (new file) app/AdminMenu.php
    • (new file) app/AdminAssets.php
    • (new file) app/Helper/FeedForm.php
    • (new file) app/RestAPI.php
    • (new file) app/Helper/Importer/FeedItem.php
    • (new file) app/Helper/Youtube.php
    • (new file) app/Controller.php
    • ...
  • Zombie WordPress options detected upon uninstall: 1 option
    • recovery_mode_email_last_sent

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=categories&post_type=videos
    • > User notice in wp-includes/functions.php+5768
    register_post_type was called incorrectly. Post type names must be between 1 and 20 characters in length. Please see Debugging in WordPress for more information. (This message was added in version 4.2.0.)

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/import-youtube-videos/templates/_form-field.php
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/import-youtube-videos/templates/tools.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'YoutubeImporterImportyoutube\\Settings' not found in wp-content/plugins/import-youtube-videos/templates/settings.php:13
    • > PHP Warning
      Use of undefined constant YOUTUBE_IMPORTER_IMPORTYOUTUBE_BASE_FILE_PATH - assumed 'YOUTUBE_IMPORTER_IMPORTYOUTUBE_BASE_FILE_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/import-youtube-videos/definitions.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'YoutubeImporterImportyoutube\\Helper\\FeedForm' not found in wp-content/plugins/import-youtube-videos/templates/importer-form.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Admin screenshot to show setting option where you can insert your api key.), #3 (Admin screenshot to show list of video that you view after click on preview you can select video that you want to import from here .)
  • Screenshots: Add a description for screenshot #0 in import-youtube-videos/assets to your readme.txt
The official readme.txt might help

import-youtube-videos/import-youtube-videos.php 92% from 13 tests

The principal PHP file in "Import Youtube Videos" v. 1.0.1 is loaded by WordPress automatically on each request
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
Everything looks great! No dangerous files found in this plugin2,064 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP225061021,455
CSS1730400
JavaScript15713209

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity14.29
▷ Minimum class complexity2.00
▷ Maximum class complexity55.00
Average method complexity4.65
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods51
▷ Static methods2854.90%
▷ Public methods4894.12%
▷ Protected methods00.00%
▷ Private methods35.88%
Functions18
▷ Named functions1688.89%
▷ Anonymous functions211.11%
Constants14
▷ Global constants14100.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
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/deleteicon.png2.25KB2.03KB▼ 9.75%
assets/close.png0.86KB0.72KB▼ 16.61%
assets/loader-icon.png3.75KB1.35KB▼ 63.86%