78% jetpack-videopress

Code Review | Jetpack VideoPress

WordPress plugin Jetpack VideoPress scored78%from 54 tests.

About plugin

  • Plugin page: jetpack-videopress
  • Plugin version: 1.7
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.3-6.4
  • WordPress version: 6.3.1
  • First release: Oct 25, 2022
  • Latest release: Nov 21, 2023
  • Number of updates: 58
  • Update frequency: every 7.1 days
  • Top authors: jetpackisbestpack (58.62%)nunyvega (27.59%)sdixon194 (13.79%)oskosk (5.17%)

Code review

54 tests

User reviews

6 reviews

Install metrics

4,000+ active /32,668 total downloads

Benchmarks

Plugin footprint 82% 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: ▲3.23MB] [CPU: ▲18.37ms] 75% from 4 tests

Analyzing server-side resources used by Jetpack VideoPress
The following require your attention
  • CPU: You should keep total CPU usage under 500.00ms (currently 1,227.16ms on /wp-admin/admin.php?page=jetpack-videopress)
PageMemory (MB)CPU Time (ms)
Home /7.84 ▲4.3749.59 ▲6.33
Dashboard /wp-admin6.41 ▲3.1071.54 ▲24.29
Posts /wp-admin/edit.php6.46 ▲3.1070.83 ▲19.31
Add New Post /wp-admin/post-new.php9.51 ▲3.62110.84 ▲25.22
Media Library /wp-admin/upload.php6.33 ▲3.0959.48 ▲23.56
My Jetpack /wp-admin/admin.php?page=my-jetpack7.221,043.31
VideoPress /wp-admin/admin.php?page=jetpack-videopress8.771,227.16

Server storage [IO: ▲5.42MB] [DB: ▲0.09MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 400 new files
Database: no new tables, 11 new options
New WordPress options
jetpack_sync_settings_disable
widget_recent-comments
db_upgraded
jetpack_options
theysaidso_admin_options
widget_recent-posts
jetpack_connection_active_plugins
jetpack_sync_https_history_home_url
widget_theysaidso_widget
can_compress_scripts
...

Browser metrics Passed 4 tests

An overview of browser requirements for Jetpack VideoPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,866 ▲10414.30 ▼0.042.93 ▲0.9937.35 ▼6.12
Dashboard /wp-admin2,249 ▲695.77 ▲0.14100.93 ▲4.0442.58 ▼6.02
Posts /wp-admin/edit.php2,159 ▲562.34 ▲0.4042.55 ▼1.3534.97 ▼5.74
Add New Post /wp-admin/post-new.php1,724 ▲19825.15 ▲2.07732.43 ▲90.6341.37 ▼7.15
Media Library /wp-admin/upload.php1,464 ▲614.34 ▲0.15103.03 ▲8.3842.42 ▲0.77
My Jetpack /wp-admin/admin.php?page=my-jetpack1,47410.82330.4946.37
VideoPress /wp-admin/admin.php?page=jetpack-videopress1,2529.27149.4740.92

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The uninstall procedure has failed, leaving 11 options in the database
    • can_compress_scripts
    • db_upgraded
    • jetpack_sync_https_history_site_url
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • jetpack_sync_settings_disable
    • jetpack_sync_https_history_home_url
    • widget_recent-comments
    • jetpack_options
    • jetpack_connection_active_plugins
    • ...

Smoke tests 50% 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)
Everything seems fine, however 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
  • 60× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\My_Jetpack\\Module_Product' not found in wp-content/plugins/jetpack-videopress/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-security.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\Sync\\Modules\\Module' not found in wp-content/plugins/jetpack-videopress/jetpack_vendor/automattic/jetpack-sync/src/modules/class-import.php:15
    • > PHP Warning
      Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in wp-content/plugins/jetpack-videopress/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-client.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum' not found in wp-content/plugins/jetpack-videopress/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-users.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\My_Jetpack\\Module_Product' not found in wp-content/plugins/jetpack-videopress/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-scan.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/jetpack-videopress/jetpack_vendor/automattic/jetpack-videopress/src/class-wpcom-rest-api-v2-endpoint-videopress.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\Sync\\JSON_Deflate_Array_Codec' not found in wp-content/plugins/jetpack-videopress/jetpack_vendor/automattic/jetpack-sync/src/class-simple-codec.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\Sync\\Modules\\Module' not found in wp-content/plugins/jetpack-videopress/jetpack_vendor/automattic/jetpack-sync/src/modules/class-users.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\My_Jetpack\\Product' not found in wp-content/plugins/jetpack-videopress/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-jetpack-ai.php:16
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-upgrader.php' (include_path='.:/usr/share/php') in wp-content/plugins/jetpack-videopress/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-automatic-install-skin.php on line 15

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=my-jetpack
    • > Network (severe)
    index.php/wp-json/my-jetpack/v1/site/product-data?_locale=user - Failed to load resource: the server responded with a status of 400 (Bad Request)
    • > GET request to /wp-admin/admin.php?page=my-jetpack
    • > Network (severe)
    index.php/wp-json/my-jetpack/v1/site/purchases?_locale=user - Failed to load resource: the server responded with a status of 400 (Bad Request)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
9 plugin tags: video-hosting, youtube, video-player, video, mobile-video...

jetpack-videopress/jetpack-videopress.php Passed 13 tests

This is the main PHP file of "Jetpack VideoPress" version 1.7, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
28 characters long description:
High quality, ad-free video.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin45,688 lines of code in 335 files:
LanguageFilesBlank linesComment linesLines of code
PHP2417,74725,37934,816
Markdown252,17507,511
JSON25002,638
Sass38216442
JavaScript16941128
SVG61376
JSX17350
CSS160016
TypeScript20111

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity21.62
▷ Minimum class complexity1.00
▷ Maximum class complexity294.00
Average method complexity2.91
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces22
Interfaces3
Traits0
Classes210
▷ Abstract classes62.86%
▷ Concrete classes20497.14%
▷ Final classes00.00%
Methods2,321
▷ Static methods89838.69%
▷ Public methods2,05488.50%
▷ Protected methods1124.83%
▷ Private methods1556.68%
Functions92
▷ Named functions2830.43%
▷ Anonymous functions6469.57%
Constants188
▷ Global constants115.85%
▷ Class constants17794.15%
▷ Public constants177100.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
12 compressed PNG files occupy 1.19MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-license-activation-with-lock-7b01c1a4cf56de799cd7.png140.94KB52.80KB▼ 62.54%
jetpack_vendor/automattic/jetpack-my-jetpack/build/images/crm-7e7684ae2c40327d8fed.png116.58KB130.94KB0.00%
jetpack_vendor/automattic/jetpack-my-jetpack/build/images/search-f9756bd9c926d905fe70.png92.66KB101.40KB0.00%
jetpack_vendor/automattic/jetpack-jitm/src/images/background.png23.54KB25.93KB0.00%
jetpack_vendor/automattic/jetpack-my-jetpack/build/images/boost-a54137485af36fdffe9c.png144.84KB159.13KB0.00%