83% f13-youtube-shortcode

Code Review | F13 Youtube Shortcode

WordPress plugin F13 Youtube Shortcode scored83%from 54 tests.

About plugin

  • Plugin page: f13-youtube-short...
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.8.1
  • WordPress version: 6.3.1
  • First release: Jul 20, 2016
  • Latest release: Oct 21, 2021
  • Number of updates: 6
  • Update frequency: every 321.0 days
  • Top authors: f13dev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,459 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼15.98ms] Passed 4 tests

An overview of server-side resources used by F13 Youtube Shortcode
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.46 ▼3.46
Dashboard /wp-admin3.32 ▲0.0249.09 ▲0.22
Posts /wp-admin/edit.php3.37 ▲0.0249.08 ▼8.74
Add New Post /wp-admin/post-new.php5.90 ▲0.0285.54 ▼47.80
Media Library /wp-admin/upload.php3.24 ▲0.0234.44 ▼3.91

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for F13 Youtube Shortcode
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲3014.38 ▼0.211.94 ▼0.1046.13 ▲1.76
Dashboard /wp-admin2,195 ▲185.64 ▼0.0591.80 ▼5.5242.56 ▲2.01
Posts /wp-admin/edit.php2,100 ▼32.00 ▼0.0536.53 ▲0.2334.03 ▼1.39
Add New Post /wp-admin/post-new.php1,554 ▼018.47 ▲0.33631.98 ▲7.0150.70 ▼8.50
Media Library /wp-admin/upload.php1,397 ▼04.20 ▼0.0399.44 ▼4.7341.41 ▼8.01

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • 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
Good news, no errors were detected

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 fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/f13-youtube-shortcode/youtube-shortcode.php on line 15
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/f13-youtube-shortcode/youtube-shortcode.php on line 15
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/f13-youtube-shortcode/youtube-shortcode.php on line 15

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 87% 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
These attributes need to be fixed:
  • Screenshots: Add an image for screenshot #1 (The results of adding [youtube video="FXFMQ_qyZEQ" autoplay="true"] to a blog post.)
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === f13-youtube-shortcode === )
You can take inspiration from this readme.txt

f13-youtube-shortcode/youtube-shortcode.php 85% from 13 tests

The entry point to "F13 Youtube Shortcode" version 2.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • 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
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("f13-youtube-shortcode.php" instead of "youtube-shortcode.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin126 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP3161076
Markdown115035
CSS11015

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity3.00
▷ Minimum class complexity2.00
▷ Maximum class complexity4.00
Average method complexity1.86
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods7
▷ Static methods114.29%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.88MB with 0.56MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png899.03KB326.33KB▼ 63.70%