64% play-pause-button-for-video

Code Review | Play Pause Button for Video

WordPress plugin Play Pause Button for Video scored 64% from 54 tests.

About plugin

  • Plugin page: play-pause-button...
  • Plugin version: 2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.9.4
  • WordPress version: 6.3.1
  • First release: Apr 11, 2017
  • Latest release: Mar 7, 2018
  • Number of updates: 12
  • Update frequency: every 27.6 days
  • Top authors: sehgal.sunny (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,264 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.94MB] [CPU: ▼31.14ms] Passed 4 tests

An overview of server-side resources used by Play Pause Button for Video
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.87 ▼1.64
Dashboard /wp-admin3.00 ▼0.3125.33 ▼21.00
Posts /wp-admin/edit.php3.00 ▼0.3624.69 ▼23.10
Add New Post /wp-admin/post-new.php3.00 ▼2.8923.96 ▼71.80
Media Library /wp-admin/upload.php3.00 ▼0.2323.64 ▼8.66

Server storage [IO: ▲0.03MB] [DB: ▲0.08MB] Passed 3 tests

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 7 new files
Database: 1 new table, 6 new options
New tables
wp_Play_pause_video
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Play Pause Button for Video
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,938 ▲20313.95 ▼0.805.56 ▲3.8353.25 ▲7.26
Dashboard /wp-admin2,228 ▲405.83 ▲0.96106.79 ▼0.9546.40 ▲6.46
Posts /wp-admin/edit.php2,123 ▲312.05 ▲0.0438.80 ▲3.3838.68 ▲10.04
Add New Post /wp-admin/post-new.php1,390 ▼12420.69 ▲3.16564.33 ▼118.82183.00 ▲132.71
Media Library /wp-admin/upload.php1,413 ▲224.23 ▼0.01100.69 ▲1.5843.96 ▲1.15

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/play-pause-button-for-video/play-pause-settings.php+20
    count(): Parameter must be an array or an object that implements Countable
  • Zombie tables detected upon uninstall: 1 table
    • wp_Play_pause_video
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • 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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/play-pause-button-for-video/play-pause-settings.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/play-pause-button-for-video/play-pause.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
9 plugin tags: pause, iframe, play, video, sticky video...

play-pause-button-for-video/play-pause.php 92% from 13 tests

The main PHP script in "Play Pause Button for Video" version 2.1 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("play-pause-button-for-video.php" instead of "play-pause.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected283 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP34446283

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity4.00
▷ Minimum method complexity4.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods1
▷ Static methods00.00%
▷ Public methods1100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.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
3 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/icon.png0.39KB0.28KB▼ 28.21%
img/img02.png5.70KB2.48KB▼ 56.58%
img/img01.png6.20KB2.62KB▼ 57.71%