84% youtube-play-icon

Code Review | YouTube Play Icon

WordPress plugin YouTube Play Icon scored84%from 54 tests.

About plugin

  • Plugin page: youtube-play-icon
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.0-3.8
  • WordPress version: 6.3.1
  • First release: Oct 23, 2013
  • Latest release: Mar 24, 2018
  • Number of updates: 12
  • Update frequency: every 134.5 days
  • Top authors: kellenmace (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,886 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼5.25ms] Passed 4 tests

Server-side resources used by YouTube Play Icon
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.54 ▼2.95
Dashboard /wp-admin3.34 ▲0.0454.29 ▲0.19
Posts /wp-admin/edit.php3.40 ▲0.0451.41 ▼2.05
Add New Post /wp-admin/post-new.php5.92 ▲0.0490.64 ▼15.21
Media Library /wp-admin/upload.php3.27 ▲0.0438.61 ▼0.80
YouTube Play Icon /wp-admin/options-general.php?page=ypi_options3.2330.15

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

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

Browser metrics Passed 4 tests

Checking browser requirements for YouTube Play Icon
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.74 ▲0.392.02 ▲0.4143.75 ▼3.24
Dashboard /wp-admin2,199 ▲255.64 ▼0.0390.24 ▼6.4443.50 ▼0.55
Posts /wp-admin/edit.php2,104 ▲42.00 ▲0.0138.63 ▲0.6235.88 ▼0.10
Add New Post /wp-admin/post-new.php1,529 ▲322.41 ▼1.30679.24 ▲15.7158.63 ▲5.40
Media Library /wp-admin/upload.php1,404 ▲44.17 ▼0.1597.95 ▼6.0942.95 ▼1.31
YouTube Play Icon /wp-admin/options-general.php?page=ypi_options8372.0323.2930.86

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 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/youtube-play-icon/youtube-play-icon.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Donate link: Invalid URI ("n/a")
Please take inspiration from this readme.txt

youtube-play-icon/youtube-play-icon.php Passed 13 tests

The main file in "YouTube Play Icon" v. 1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
86 characters long description:
Displays a play icon in the browser tab/title bar when playing embedded YouTube videos

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
Good job! No executable or dangerous file extensions detected258 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP33238188
JavaScript1192070

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions13100.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
No PNG images were found in this plugin