83% jw-player-7-for-wp

Code Review | JW Player for WordPress

WordPress plugin JW Player for WordPress scored83%from 54 tests.

About plugin

  • Plugin page: jw-player-7-for-wp
  • Plugin version: 2.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Sep 19, 2015
  • Latest release: May 19, 2023
  • Number of updates: 84
  • Update frequency: every 33.3 days
  • Top authors: ghera74 (100%)

Code review

54 tests

User reviews

28 reviews

Install metrics

3,000+ active /166,157 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.43MB] [CPU: ▲5.43ms] Passed 4 tests

Analyzing server-side resources used by JW Player for WordPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.90 ▲0.4346.34 ▲5.36
Dashboard /wp-admin3.72 ▲0.4250.12 ▲4.52
Posts /wp-admin/edit.php3.84 ▲0.4850.98 ▲5.85
Add New Post /wp-admin/post-new.php6.32 ▲0.44110.57 ▲21.43
Media Library /wp-admin/upload.php3.64 ▲0.4141.47 ▲5.98

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 60 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

JW Player for WordPress: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,930 ▲18413.86 ▼0.526.97 ▲4.9337.66 ▼1.19
Dashboard /wp-admin2,253 ▲655.12 ▼0.75110.54 ▼1.4739.57 ▲0.78
Posts /wp-admin/edit.php2,124 ▲322.43 ▲0.3734.07 ▼3.1031.75 ▼3.97
Add New Post /wp-admin/post-new.php1,561 ▲2823.36 ▲0.19666.97 ▼0.0437.41 ▼13.30
Media Library /wp-admin/upload.php1,429 ▲384.45 ▲0.25100.60 ▼6.0642.74 ▼2.06

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

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 | 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
Almost there! Just fix the following items
  • 20× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/jw-player-7-for-wp/admin/jwppp-admin-security.php:28
    • > PHP Warning
      require(JWPPP_ADMINskin/jwppp-admin-skin-7-options.php): failed to open stream: No such file or directory in wp-content/plugins/jw-player-7-for-wp/admin/skin/jwppp-admin-skin-7.php on line 14
    • > PHP Warning
      Use of undefined constant JWPPP_ADMIN - assumed 'JWPPP_ADMIN' (this will throw an Error in a future version of PHP) in wp-content/plugins/jw-player-7-for-wp/admin/skin/jwppp-admin-skin-7.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/jw-player-7-for-wp/admin/jwppp-admin-subtitles.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/jw-player-7-for-wp/admin/jwppp-admin-playlist-carousel.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/jw-player-7-for-wp/admin/jwppp-admin-ads.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/jw-player-7-for-wp/includes/jwppp-save-single-video-data.php:148
    • > PHP Fatal error
      require(): Failed opening required 'JWPPP_INCLUDESjwppp-ajax-add-video-callback.php' (include_path='.:/usr/share/php') in wp-content/plugins/jw-player-7-for-wp/includes/jwppp-functions.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/jw-player-7-for-wp/jw-widget/jwppp-carousel-config.php:45
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_dashboard_player() in wp-content/plugins/jw-player-7-for-wp/includes/jwppp-second-video-box.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
  • Screenshots: A description for screenshot #14 is required in jw-player-7-for-wp/assets to your readme.txt
The official readme.txt might help

jw-player-7-for-wp/jw-player-7-for-wp.php 92% from 13 tests

The main PHP file in "JW Player for WordPress" ver. 2.3.2 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected4,429 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
PHP227856092,644
JavaScript123271551,064
CSS41216661
SVG10027
HTML10018
JSON10015

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity3.11
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions47
▷ Named functions4697.87%
▷ Anonymous functions12.13%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
16 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/add-tag.png0.49KB0.25KB▼ 49.40%
js/tzCheckbox/jquery.tzCheckbox/background.png4.96KB2.59KB▼ 47.82%
js/tzCheckbox/img/tzine.png1.23KB0.82KB▼ 33.25%
images/add-video.png0.37KB0.48KB0.00%
js/tzCheckbox/img/line_bg.png0.26KB0.23KB▼ 9.16%