77% wp-staging

Code Review | WP STAGING WordPress Backup Plugin - Migration Backup Restore

WordPress plugin WP STAGING WordPress Backup Plugin - Migration Backup Restore scored77%from 54 tests.

About plugin

  • Plugin page: wp-staging
  • Plugin version: 3.1.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6+-6.4
  • WordPress version: 6.3.1
  • First release: Aug 5, 2015
  • Latest release: Nov 17, 2023
  • Number of updates: 322
  • Update frequency: every 9.4 days
  • Top authors: ReneHermi (100%)

Code review

54 tests

User reviews

2186 reviews

Install metrics

70,000+ active /2,764,002 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲4.61MB] [CPU: ▲24.46ms] 75% from 4 tests

This is a short check of server-side resources used by WP STAGING WordPress Backup Plugin - Migration Backup Restore
Please take the time to fix the following items
  • CPU: Total CPU usage must kept under 500.00ms (currently 534.54ms on /wp-admin/admin.php?page=wpstg-tools)
PageMemory (MB)CPU Time (ms)
Home /7.37 ▲3.9163.53 ▲25.59
Dashboard /wp-admin8.15 ▲4.8181.27 ▲20.95
Posts /wp-admin/edit.php8.20 ▲4.8586.71 ▲41.23
Add New Post /wp-admin/post-new.php10.76 ▲4.87109.75 ▲15.53
Media Library /wp-admin/upload.php8.09 ▲4.8671.12 ▲35.76
Backup & Migration /wp-admin/admin.php?page=wpstg_backup8.2171.18
System Info /wp-admin/admin.php?page=wpstg-tools8.76534.54
Staging Sites /wp-admin/admin.php?page=wpstg_clone8.2164.23
Get WP Staging Pro /wp-admin/admin.php?page=wpstg-welcome8.1659.68
Settings /wp-admin/admin.php?page=wpstg-settings8.3666.03

Server storage [IO: ▲7.08MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
It is recommended to fix the following issues
  • Illegal file modification detected: 1 file (10.82KB) outside of "wp-content/plugins/wp-staging/" and "wp-content/uploads/"
    • (new file) wp-content/mu-plugins/wp-staging-optimizer.php
Filesystem: 901 new files
Database: no new tables, 14 new options
New WordPress options
wpstg_installDate
can_compress_scripts
wpstg_free_upgrade_date
db_upgraded
widget_recent-posts
wpstg_settings
theysaidso_admin_options
wpstg_free_install_date
wpstg_missing_cloneName_routine_executed
wpstg_access_token
...

Browser metrics Passed 4 tests

WP STAGING WordPress Backup Plugin - Migration Backup Restore: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,915 ▲15314.33 ▲0.081.91 ▲0.1638.41 ▼6.12
Dashboard /wp-admin2,287 ▲1095.51 ▼0.2194.40 ▼15.0439.40 ▼0.15
Posts /wp-admin/edit.php2,199 ▲992.03 ▲0.0141.97 ▲3.0936.01 ▼0.11
Add New Post /wp-admin/post-new.php1,558 ▲3223.24 ▼0.28671.55 ▲71.5956.84 ▲9.25
Media Library /wp-admin/upload.php1,496 ▲994.16 ▼0.0199.58 ▲6.0240.58 ▼1.01
Backup & Migration /wp-admin/admin.php?page=wpstg_backup2,8782.1746.44101.38
System Info /wp-admin/admin.php?page=wpstg-tools1,3312.0936.9460.46
Staging Sites /wp-admin/admin.php?page=wpstg_clone1,5812.0832.0646.57
Get WP Staging Pro /wp-admin/admin.php?page=wpstg-welcome9692.0733.1141.22
Settings /wp-admin/admin.php?page=wpstg-settings1,6752.0730.1140.09

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 14 options in the database
    • db_upgraded
    • wpstg_version
    • wpstg_access_token
    • wpstg_free_install_date
    • wpstg_version_upgraded_from
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • wpstg_free_upgrade_date
    • widget_recent-comments
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
  • 5× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-staging/vendor_wpstg/lucatume/di52/test-constructor.php
    • > /wp-content/plugins/wp-staging/Backend/views/backup/modal/download.php
    • > /wp-content/plugins/wp-staging/Frontend/views/header.php
    • > /wp-content/plugins/wp-staging/Frontend/views/footer.php
    • > /wp-content/plugins/wp-staging/Backend/views/clone/single-site/index.php
  • 499× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WPStaging\\Vendor\\Monolog\\Handler\\AbstractHandler' not found in wp-content/plugins/wp-staging/vendor_wpstg/monolog/monolog/src/Monolog/Handler/BufferHandler.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/wp-staging/Backend/views/_main/contact-us-pro.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WPStaging\\Backup\\Task\\RestoreFileHandlers\\RestoreFileHandler' not found in wp-content/plugins/wp-staging/Backup/Task/RestoreFileHandlers/MoveHandler.php:5
    • > PHP Fatal error
      Trait 'WPStaging\\Framework\\Traits\\ResourceTrait' not found in wp-content/plugins/wp-staging/Framework/Assets/Assets.php on line 15
    • > PHP Warning
      require_once(WPSTG_PLUGIN_DIRBackend/views/backup/modal/progress.php): failed to open stream: No such file or directory in wp-content/plugins/wp-staging/Backend/views/clone/ajax/delete-confirmation.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'WPStaging\\Framework\\Component\\AbstractTemplateComponent' not found in wp-content/plugins/wp-staging/Backup/Ajax/Parts.php:15
    • > PHP Warning
      Use of undefined constant WPSTG_PLUGIN_DIR - assumed 'WPSTG_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-staging/Backend/views/clone/ajax/update.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-staging/Backend/views/notices/table-tmp-prefix-conflict-notice.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'WPStaging\\Vendor\\lucatume\\DI52\\Builders\\BuilderInterface' not found in wp-content/plugins/wp-staging/vendor_wpstg/lucatume/di52/src/Builders/ClosureBuilder.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WPStaging\\Framework\\DependencyResolver\\Exceptions\\ResolveException' not found in wp-content/plugins/wp-staging/Framework/DependencyResolver/Exceptions/CircularReferenceException.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Requires at least: Version format is invalid
  • Screenshots: Please a description for screenshot #8 in wp-staging/assets to your readme.txt
You can look at the official readme.txt

wp-staging/wp-staging.php 92% from 13 tests

"WP STAGING WordPress Backup Plugin - Migration Backup Restore" version 3.1.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Requires at least: Please use periods and digits for the required version (ex. "7.0" instead of "3.6+")

Code Analysis 97% from 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
Everything looks great! No dangerous files found in this plugin76,985 lines of code in 849 files:
LanguageFilesBlank linesComment linesLines of code
PHP78111,21029,15259,619
JavaScript245461,42710,771
CSS11831684,727
PO File44414721,137
SVG2301426
make12410232
XML22136
Markdown111018
Dockerfile18010
HTML1109

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity12.45
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces127
Interfaces53
Traits28
Classes555
▷ Abstract classes407.21%
▷ Concrete classes51592.79%
▷ Final classes265.05%
Methods4,411
▷ Static methods3668.30%
▷ Public methods3,26474.00%
▷ Protected methods61413.92%
▷ Private methods53312.08%
Functions332
▷ Named functions15346.08%
▷ Anonymous functions17953.92%
Constants439
▷ Global constants8519.36%
▷ Class constants35480.64%
▷ Public constants354100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.10MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/admin_dashboard.png6.43KB4.11KB▼ 36.10%
assets/img/wp-staging-logo-256x256.png11.12KB5.79KB▼ 47.91%
assets/img/logo-white-transparent.png8.27KB5.88KB▼ 28.87%
assets/img/wp-staging274x463-1.png68.68KB29.92KB▼ 56.44%
assets/img/wpstaging-icon.png2.41KB1.13KB▼ 53.04%