77% updraftplus

Code Review | UpdraftPlus: WordPress Backup & Migration Plugin

WordPress plugin UpdraftPlus: WordPress Backup & Migration Plugin scored77%from 54 tests.

About plugin

  • Plugin page: updraftplus
  • Plugin version: 1.23.13
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-6.4
  • WordPress version: 6.3.1
  • First release: May 22, 2012
  • Latest release: Nov 23, 2023
  • Number of updates: 1,777
  • Update frequency: every 2.4 days
  • Top authors: DavidAnderson (100%)

Code review

54 tests

User reviews

7292 reviews

Install metrics

3,000,000+ active /110,368,374 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲3.70MB] [CPU: ▲21.17ms] Passed 4 tests

This is a short check of server-side resources used by UpdraftPlus: WordPress Backup & Migration Plugin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /5.70 ▲2.2458.98 ▲19.48
Dashboard /wp-admin7.79 ▲4.4881.34 ▲33.30
Posts /wp-admin/edit.php7.79 ▲4.4365.87 ▲19.70
Add New Post /wp-admin/post-new.php9.53 ▲3.65105.23 ▲12.21
Media Library /wp-admin/upload.php7.79 ▲4.5669.07 ▲37.92
UpdraftPlus Backups /wp-admin/options-general.php?page=updraftplus9.87157.68

Server storage [IO: ▲24.38MB] [DB: ▲0.11MB] 67% from 3 tests

Filesystem and database footprint
Please try to fix the following items
  • There were 3 files (0.24KB) illegally modified outside of "wp-content/plugins/updraftplus/" and "wp-content/uploads/"
    • (new file) wp-content/updraft/web.config
    • (new file) wp-content/updraft/index.html
    • (new file) wp-content/updraft/.htaccess
Filesystem: 1,215 new files
Database: no new tables, 24 new options
New WordPress options
updraft_s3generic
updraft_openstack
widget_theysaidso_widget
updraft_ftp
updraft_sftp
widget_recent-posts
theysaidso_admin_options
updraft_googlecloud
updraft_updraftvault
updraft_dropbox
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for UpdraftPlus: WordPress Backup & Migration Plugin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,875 ▲11314.68 ▲0.401.74 ▼0.0742.11 ▼4.10
Dashboard /wp-admin2,277 ▲1005.57 ▲0.0395.87 ▼3.9942.70 ▼1.70
Posts /wp-admin/edit.php2,136 ▲362.00 ▼0.0337.94 ▼2.3632.27 ▼5.28
Add New Post /wp-admin/post-new.php1,555 ▲2023.23 ▲4.91682.68 ▲70.2571.09 ▲2.58
Media Library /wp-admin/upload.php1,436 ▲394.23 ▲0.05105.26 ▲2.8646.38 ▲1.68
UpdraftPlus Backups /wp-admin/options-general.php?page=updraftplus6,4216.53281.1799.67

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 24 options in the database
    • updraft_dropbox
    • updraft_openstack
    • updraft_s3
    • updraft_pcloud
    • updraft_azure
    • db_upgraded
    • updraft_webdav
    • updraft_s3generic
    • updraft_onedrive
    • widget_recent-posts
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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 take a closer look at the following
  • 130× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/updraftplus/templates/wp-admin/advanced/db-size.php
    • > /wp-content/plugins/updraftplus/templates/wp-admin/settings/upload-backups-modal.php
    • > /wp-content/plugins/updraftplus/includes/class-manipulation-functions.php
    • > /wp-content/plugins/updraftplus/templates/wp-admin/settings/temporary-clone.php
    • > /wp-content/plugins/updraftplus/methods/dropbox.php
    • > /wp-content/plugins/updraftplus/includes/class-updraft-dashboard-news.php
    • > /wp-content/plugins/updraftplus/methods/template.php
    • > /wp-content/plugins/updraftplus/class-updraftplus.php
    • > /wp-content/plugins/updraftplus/methods/ftp.php
    • > /wp-content/plugins/updraftplus/central/modules/core.php
  • 315× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Guzzle\\Common\\Exception\\GuzzleException' not found in wp-content/plugins/updraftplus/vendor/guzzle/guzzle/src/Guzzle/Batch/Exception/BatchTransferException.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Guzzle\\Parser\\Message\\MessageParserInterface' not found in wp-content/plugins/updraftplus/vendor/guzzle/guzzle/src/Guzzle/Parser/Message/AbstractMessageParser.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Eher\\OAuth\\SignatureMethod\\SignatureMethod' not found in wp-content/plugins/updraftplus/vendor/eher/oauth/src/Eher/OAuth/RsaSha1.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Guzzle\\Http\\QueryAggregator\\QueryAggregatorInterface' not found in wp-content/plugins/updraftplus/vendor/guzzle/guzzle/src/Guzzle/Http/QueryAggregator/CommaAggregator.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Guzzle\\Service\\Command\\LocationVisitor\\Request\\AbstractRequestVisitor' not found in wp-content/plugins/updraftplus/vendor/guzzle/guzzle/src/Guzzle/Service/Command/LocationVisitor/Request/JsonVisitor.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\Base' not found in wp-content/plugins/updraftplus/vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php:64
    • > PHP Fatal error
      Uncaught Error: Interface 'Guzzle\\Batch\\BatchInterface' not found in wp-content/plugins/updraftplus/vendor/guzzle/guzzle/src/Guzzle/Batch/AbstractBatchDecorator.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/updraftplus/vendor/guzzlehttp/psr7/src/DroppingStream.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/updraftplus/vendor/psr/http-message/src/RequestInterface.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Guzzle\\Log\\AbstractLogAdapter' not found in wp-content/plugins/updraftplus/vendor/guzzle/guzzle/src/Guzzle/Log/MonologLogAdapter.php:11

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #5 (Restoration shows as successful), #6 (To migrate, first click 'Database', 'Plugins' etc. to download these backups to your local machine.), #7 (On the destination site, 'upload backup files' from the source site to restore and migrate to the new destination.)
Please take inspiration from this readme.txt

updraftplus/updraftplus.php 92% from 13 tests

"UpdraftPlus: WordPress Backup & Migration Plugin" version 1.23.13's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 147 characters long)

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin324,874 lines of code in 1,026 files:
LanguageFilesBlank linesComment linesLines of code
PO File3267,80883,520136,691
PHP82823,73955,343133,391
JavaScript357,1197,81535,109
CSS341,68619710,719
Markdown341,62305,246
JSON496703,284
Sass1280167
XML71612142
HTML116041
Ant110134
YAML12025
Dockerfile18010
Perl1418
SVG1007

PHP code 0% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
It is recommended to fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 1,523)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 286)
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity21.82
▷ Minimum class complexity1.00
▷ Maximum class complexity1,523.00
Average method complexity3.94
▷ Minimum method complexity1.00
▷ Maximum method complexity286.00
Code structure
Namespaces96
Interfaces74
Traits4
Classes896
▷ Abstract classes495.47%
▷ Concrete classes84794.53%
▷ Final classes293.42%
Methods7,239
▷ Static methods5157.11%
▷ Public methods6,39688.35%
▷ Protected methods3104.28%
▷ Private methods5337.36%
Functions263
▷ Named functions13651.71%
▷ Anonymous functions12748.29%
Constants737
▷ Global constants15721.30%
▷ Class constants58078.70%
▷ Public constants580100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
106 compressed PNG files occupy 0.55MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/notices/locksettings.png1.25KB1.37KB0.00%
includes/images/ui-icons_222222_256x240.png4.33KB4.17KB▼ 3.52%
images/addons-images/azure.png5.54KB5.77KB0.00%
images/icons/googledrive.png1.88KB1.42KB▼ 24.22%
images/other-plugins/updraft-central.png5.02KB3.32KB▼ 33.86%