71% jetpack

Code Review | Jetpack - WP Security, Backup, Speed, & Growth

WordPress plugin Jetpack - WP Security, Backup, Speed, & Growth scored71%from 54 tests.

About plugin

  • Plugin page: jetpack
  • Plugin version: 12.8.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.4
  • WordPress version: 6.3.1
  • First release: Jan 20, 2011
  • Latest release: Nov 13, 2023
  • Number of updates: 2,500
  • Update frequency: every 1.5 days
  • Top authors: jeherve (23.32%)georgestephanis (14.32%)zinigor (7.4%)samiff (7.12%)samhotchkiss (6.64%)

Code review

54 tests

User reviews

1932 reviews

Install metrics

5,000,000+ active /367,499,578 total downloads

Benchmarks

Plugin footprint 81% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲9.41MB] [CPU: ▲68.29ms] 25% from 4 tests

Server-side resources used by Jetpack - WP Security, Backup, Speed, & Growth
Please take the time to fix the following items
  • RAM: Try to keep total memory usage under 10MB (currently 14.68MB on /wp-admin/admin.php?page=jetpack)
  • CPU: You should keep total CPU usage under 500.00ms (currently 576.94ms on /wp-admin/admin.php?page=my-jetpack)
  • Extra RAM: Extra memory usage should kept under 5MB (currently 9.41MB on /wp-admin/admin.php?page=jetpack)
PageMemory (MB)CPU Time (ms)
Home /13.96 ▲10.49105.28 ▲65.21
Dashboard /wp-admin12.47 ▲9.17123.47 ▲77.00
Posts /wp-admin/edit.php12.48 ▲9.12118.54 ▲71.30
Add New Post /wp-admin/post-new.php16.16 ▲10.28181.46 ▲93.27
Media Library /wp-admin/upload.php12.29 ▲9.0697.32 ▲59.63
/wp-admin/admin.php?page=jetpack-debugger12.37739.99
Search /wp-admin/admin.php?page=jetpack-search12.4496.71
My Jetpack /wp-admin/admin.php?page=my-jetpack13.09576.94
Jetpack /wp-admin/admin.php?page=jetpack14.68164.68

Server storage [IO: ▲48.20MB] [DB: ▲0.07MB] 67% from 3 tests

Filesystem and database footprint
Please try to fix the following items
  • Filesystem usage must be lower than 25MB (currently using 48.20MB)
Filesystem: 2,832 new files
Database: no new tables, 17 new options
New WordPress options
jetpack_sync_https_history_site_url
do_activate
db_upgraded
jetpack_sync_settings_disable
jetpack_options
jetpack_activation_source
can_compress_scripts
jetpack_sync_https_history_home_url
jetpack_connection_active_plugins
jetpack_activated
...

Browser metrics Passed 4 tests

Jetpack - WP Security, Backup, Speed, & Growth: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,066 ▲30418.86 ▲4.533.25 ▲1.3924.60 ▼19.56
Dashboard /wp-admin2,344 ▲1645.89 ▲0.24102.26 ▲2.3899.24 ▲56.56
Posts /wp-admin/edit.php2,156 ▲562.18 ▲0.1742.12 ▲5.0432.30 ▼2.18
Add New Post /wp-admin/post-new.php1,546 ▲2020.93 ▼2.28717.83 ▲2.4058.91 ▲0.68
Media Library /wp-admin/upload.php1,483 ▲894.38 ▲0.24102.52 ▲2.4546.61 ▲1.64
/wp-admin/admin.php?page=jetpack-debugger1,1282.4129.0739.22
Search /wp-admin/admin.php?page=jetpack-search1,2968.15114.7435.97
My Jetpack /wp-admin/admin.php?page=my-jetpack1,2939.31244.6846.16
Jetpack /wp-admin/admin.php?page=jetpack1,30015.97302.0744.78

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 8 options
    • theysaidso_admin_options
    • do_activate
    • widget_theysaidso_widget
    • jetpack_connection_active_plugins
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 25% 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 0% 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 fix the following items
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/jetpack/vendor/wikimedia/aho-corasick/bench/bench.php
    • > /wp-content/plugins/jetpack/vendor/wikimedia/aho-corasick/bench/check.php
    • > /wp-content/plugins/jetpack/views/admin/jetpack-plugin-portal-containers.php
    • > /wp-content/plugins/jetpack/extensions/blocks/podcast-player/templates/podcast-header.php
  • 747× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WPCOM_JSON_API_Get_Media_Endpoint' not found in wp-content/plugins/jetpack/json-endpoints/class.wpcom-json-api-get-media-endpoint.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Terms_Controller' not found in wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-import/src/endpoints/class-tag.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/jetpack/modules/tiled-gallery.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\Forms\\ContactForm\\Contact_Form_Shortcode' not found in wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-forms/src/contact-form/class-contact-form-field.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\Assets' not found in wp-content/plugins/jetpack/modules/comment-likes.php:18
    • > PHP Warning
      Use of undefined constant JETPACK__PLUGIN_DIR - assumed 'JETPACK__PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/jetpack/locales.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/jetpack/modules/shortcodes/wordads.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/publicize-connections.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-external-media.php:16
    • > PHP Warning
      Use of undefined constant HOUR_IN_SECONDS - assumed 'HOUR_IN_SECONDS' (this will throw an Error in a future version of PHP) in wp-content/plugins/jetpack/modules/sitemaps/sitemap-constants.php on line 83

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 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: scan, woo, malware, social, spam...

jetpack/jetpack.php 92% from 13 tests

The principal PHP file in "Jetpack - WP Security, Backup, Speed, & Growth" v. 12.8.1 is loaded by WordPress automatically on each request
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 146 characters long)

Code Analysis 97% from 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 plugin282,992 lines of code in 2,311 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,28038,366104,819191,958
CSS3454,1071,48927,604
JavaScript3183,6262,69626,437
Markdown564,439020,003
JSON51006,018
TypeScript646409664,161
SVG1281132,585
Sass344171612,542
JSX24157681,249
HTML61810322
XML592113

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 236)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity28.27
▷ Minimum class complexity1.00
▷ Maximum class complexity612.00
Average method complexity3.77
▷ Minimum method complexity1.00
▷ Maximum method complexity236.00
Code structure
Namespaces119
Interfaces5
Traits4
Classes896
▷ Abstract classes384.24%
▷ Concrete classes85895.76%
▷ Final classes20.23%
Methods8,878
▷ Static methods2,64729.82%
▷ Public methods7,31682.41%
▷ Protected methods91410.30%
▷ Private methods6487.30%
Functions1,221
▷ Named functions99981.82%
▷ Anonymous functions22218.18%
Constants565
▷ Global constants11019.47%
▷ Class constants45580.53%
▷ Public constants455100.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
223 PNG files occupy 13.22MB with 4.23MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/cf-ss.png26.87KB15.76KB▼ 41.36%
modules/sharedaddy/images/smart-twitter.png1.91KB1.64KB▼ 14.19%
modules/sharedaddy/images/designfloat.png0.81KB0.86KB0.00%
images/connect-right-secondary.png60.55KB35.14KB▼ 41.96%
images/recommendations/assistant-complete-welcome-2x.png376.08KB141.19KB▼ 62.46%