78% jetpack-backup

Code Review | Jetpack VaultPress Backup

WordPress plugin Jetpack VaultPress Backup scored78%from 54 tests.

About plugin

  • Plugin page: jetpack-backup
  • Plugin version: 2.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.3
  • WordPress version: 6.3.1
  • First release: Aug 12, 2021
  • Latest release: Sep 20, 2023
  • Number of updates: 129
  • Update frequency: every 6.2 days
  • Top authors: jetpackisbestpack (42.64%)jwebbdev (12.4%)williamvianas (10.85%)sdixon194 (8.53%)kraftbj (8.53%)

Code review

54 tests

User reviews

21 reviews

Install metrics

4,000+ active /89,343 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲2.56MB] [CPU: ▲10.96ms] 75% from 4 tests

A check of server-side resources used by Jetpack VaultPress Backup
Please have a look at the following items
  • CPU: The total CPU usage must kept under 500.00ms (currently 1,117.35ms on /wp-admin/admin.php?page=my-jetpack)
PageMemory (MB)CPU Time (ms)
Home /7.31 ▲3.8447.37 ▲8.59
Dashboard /wp-admin5.72 ▲2.4158.48 ▲11.90
Posts /wp-admin/edit.php5.83 ▲2.4756.98 ▲13.47
Add New Post /wp-admin/post-new.php8.83 ▲2.94111.44 ▲9.87
Media Library /wp-admin/upload.php5.64 ▲2.4151.97 ▲20.60
VaultPress Backup /wp-admin/admin.php?page=jetpack-backup5.8251.09
My Jetpack /wp-admin/admin.php?page=my-jetpack6.381,117.35

Server storage [IO: ▲5.34MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

An overview of browser requirements for Jetpack VaultPress Backup
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲7414.42 ▼0.223.01 ▲1.4138.38 ▼0.91
Dashboard /wp-admin2,238 ▲575.74 ▲0.0789.82 ▼11.0339.51 ▼7.08
Posts /wp-admin/edit.php2,151 ▲512.24 ▲0.2342.42 ▲8.2034.21 ▲2.90
Add New Post /wp-admin/post-new.php1,556 ▲3018.00 ▼5.05630.16 ▼19.9066.74 ▲9.63
Media Library /wp-admin/upload.php1,450 ▲504.25 ▲0.0499.82 ▼4.6743.83 ▼2.28
VaultPress Backup /wp-admin/admin.php?page=jetpack-backup2,1437.52202.3162.85
My Jetpack /wp-admin/admin.php?page=my-jetpack1,2449.93161.7339.20

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 13 options in the database
    • widget_recent-comments
    • db_upgraded
    • _upgrade_clear_disabled_plugin
    • can_compress_scripts
    • theysaidso_admin_options
    • jetpack_connection_active_plugins
    • jetpack_sync_https_history_home_url
    • widget_theysaidso_widget
    • jetpack_backup_db_version
    • widget_recent-posts
    • ...

Smoke tests 50% 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 60× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\Sync\\Modules\\Module' not found in wp-content/plugins/jetpack-backup/jetpack_vendor/automattic/jetpack-sync/src/modules/class-network-options.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Automattic\\Jetpack\\Sync\\Replicastore_Interface' not found in wp-content/plugins/jetpack-backup/jetpack_vendor/automattic/jetpack-sync/src/class-replicastore.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\My_Jetpack\\Product' not found in wp-content/plugins/jetpack-backup/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-hybrid-product.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\My_Jetpack\\Product' not found in wp-content/plugins/jetpack-backup/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-jetpack-ai.php:16
    • > 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-backup/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-client.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\Sync\\Modules\\Module' not found in wp-content/plugins/jetpack-backup/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\My_Jetpack\\Product' not found in wp-content/plugins/jetpack-backup/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-crm.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Automattic\\Jetpack\\Autoloader\\jp9559eef123208b7d1b9c15b978567267_backup\xe2\x93\xa52_2\\wp_normalize_path() in wp-content/plugins/jetpack-backup/vendor/jetpack-autoloader/class-path-processor.php:73
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\Sync\\Modules\\Module' not found in wp-content/plugins/jetpack-backup/jetpack_vendor/automattic/jetpack-sync/src/modules/class-comments.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\My_Jetpack\\Product' not found in wp-content/plugins/jetpack-backup/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-extras.php:16

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > 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 is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: restore, backup, jetpack

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

This is the main PHP file of "Jetpack VaultPress Backup" version 2.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
80 characters long description:
Easily restore or download a backup of your site from a specific moment in time.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin45,062 lines of code in 373 files:
LanguageFilesBlank linesComment linesLines of code
PHP2076,67622,62930,630
Markdown242,03206,599
JavaScript59258902,821
JSON23002,440
Sass16292601,575
JSX85416527
TypeScript73810234
SVG2113228
CSS8008

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity23.55
▷ Minimum class complexity1.00
▷ Maximum class complexity294.00
Average method complexity2.94
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces21
Interfaces3
Traits0
Classes172
▷ Abstract classes42.33%
▷ Concrete classes16897.67%
▷ Final classes00.00%
Methods2,053
▷ Static methods80239.06%
▷ Public methods1,82088.65%
▷ Protected methods934.53%
▷ Private methods1406.82%
Functions55
▷ Named functions35.45%
▷ Anonymous functions5294.55%
Constants162
▷ Global constants63.70%
▷ Class constants15696.30%
▷ Public constants156100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
20 PNG files occupy 1.80MB with 0.40MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
jetpack_vendor/automattic/jetpack-my-jetpack/build/images/extras-26daf36507504c96d066.png25.35KB28.14KB0.00%
jetpack_vendor/automattic/jetpack-backup/src/js/hooks/assets/connect-right.png60.55KB35.14KB▼ 41.96%
jetpack_vendor/automattic/jetpack-backup/src/js/hooks/assets/tim-ferriss-testimonial.png72.75KB61.68KB▼ 15.21%
jetpack_vendor/automattic/jetpack-backup/build/images/connect-backup-a39e4064c9a6c6df2030.png79.56KB37.75KB▼ 52.55%
jetpack_vendor/automattic/jetpack-backup/src/js/hooks/assets/ben-giordano-testimonial.png126.46KB133.65KB0.00%