67% updraftcentral

Code Review | UpdraftCentral Dashboard

WordPress plugin UpdraftCentral Dashboard scored67%from 54 tests.

About plugin

  • Plugin page: updraftcentral
  • Plugin version: 0.8.29
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Mar 31, 2016
  • Latest release: Jul 19, 2023
  • Number of updates: 88
  • Update frequency: every 30.4 days
  • Top authors: DavidAnderson (100%)

Code review

54 tests

User reviews

22 reviews

Install metrics

6,000+ active /216,428 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.48MB] [CPU: ▲3.29ms] Passed 4 tests

An overview of server-side resources used by UpdraftCentral Dashboard
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.99 ▲0.5243.49 ▲2.21
Dashboard /wp-admin3.82 ▲0.5154.54 ▲4.86
Posts /wp-admin/edit.php3.87 ▲0.5152.30 ▲2.38
Add New Post /wp-admin/post-new.php6.34 ▲0.45100.01 ▲11.10
Media Library /wp-admin/upload.php3.68 ▲0.4536.69 ▲3.71

Server storage [IO: ▲17.24MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 595 new files
Database: 5 new tables, 7 new options
New tables
wp_updraftcentral_events
wp_updraftcentral_sitemeta
wp_updraftcentral_sites
wp_updraftcentral_site_temporary_keys
wp_updraftcentral_user_cron
New WordPress options
widget_recent-posts
updraftcentral_dbversion
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

UpdraftCentral Dashboard: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲7613.21 ▼1.481.78 ▼0.0043.90 ▼3.51
Dashboard /wp-admin2,217 ▲265.84 ▲0.99101.25 ▼8.9671.92 ▲29.01
Posts /wp-admin/edit.php2,097 ▲82.00 ▲0.0238.34 ▼2.0536.73 ▲1.41
Add New Post /wp-admin/post-new.php1,534 ▼823.27 ▲4.86715.63 ▲89.3851.73 ▼6.27
Media Library /wp-admin/upload.php1,393 ▲84.21 ▲0.0298.81 ▼2.5568.71 ▲24.40

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie tables were found after uninstall: 5 tables
    • wp_updraftcentral_user_cron
    • wp_updraftcentral_sites
    • wp_updraftcentral_events
    • wp_updraftcentral_sitemeta
    • wp_updraftcentral_site_temporary_keys
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • updraftcentral_dbversion
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

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
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 62× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/updraftcentral/classes/class-updraftcentral-logger-interface.php
    • > /wp-content/plugins/updraftcentral/classes/class-uploader.php
    • > /wp-content/plugins/updraftcentral/templates/dashboard/sidebar-navigation.php
    • > /wp-content/plugins/updraftcentral/classes/class-rest-users-controller.php
    • > /wp-content/plugins/updraftcentral/classes/class-updraftcentral-abstract-logger.php
    • > /wp-content/plugins/updraftcentral/templates/handlebars-compiler.php
    • > /wp-content/plugins/updraftcentral/modules/site_search/translations-dashboard.php
    • > /wp-content/plugins/updraftcentral/modules/events/templates/management-actions.php
    • > /wp-content/plugins/updraftcentral/classes/licence-manager.php
    • > /wp-content/plugins/updraftcentral/modules/events/loader.php
  • 64× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/updraftcentral/vendor/guzzlehttp/promises/src/FulfilledPromise.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/updraftcentral/vendor/guzzlehttp/psr7/src/LimitStream.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\ResponseInterface' not found in wp-content/plugins/updraftcentral/vendor/guzzlehttp/psr7/src/Response.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/updraftcentral/vendor/guzzlehttp/psr7/src/NoSeekStream.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/updraftcentral/modules/updraftplus/templates/management-actions.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/updraftcentral/vendor/psr/http-message/src/ServerRequestInterface.php:45
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Psr7\\Request' not found in wp-content/plugins/updraftcentral/vendor/guzzlehttp/psr7/src/ServerRequest.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/updraftcentral/vendor/guzzlehttp/psr7/src/Stream.php:12
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/updraftcentral/templates/dashboard/notices.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\BadResponseException' not found in wp-content/plugins/updraftcentral/vendor/guzzlehttp/guzzle/src/Exception/ClientException.php:7

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)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #14 (Manage plugins on a controlled site (premium only)), #15 (Manage themes on a controlled site (premium only))
You can look at the official readme.txt

updraftcentral/site-management.php 85% from 13 tests

Analyzing the main PHP file in "UpdraftCentral Dashboard" version 0.8.29
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("updraftcentral.php" instead of "site-management.php")
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.4" instead of "4.6")

Code Analysis 97% from 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
No dangerous file extensions were detected178,951 lines of code in 507 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript7716,45119,76270,811
PHP2368,32123,22757,493
CSS513,52346643,307
Markdown191,27103,775
JSON11001,387
HTML518241,213
SVG591458923
YAML12025
XML201217

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity43.52
▷ Minimum class complexity1.00
▷ Maximum class complexity657.00
Average method complexity5.00
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces13
Interfaces16
Traits2
Classes148
▷ Abstract classes53.38%
▷ Concrete classes14396.62%
▷ Final classes2416.78%
Methods1,869
▷ Static methods20510.97%
▷ Public methods1,65988.76%
▷ Protected methods211.12%
▷ Private methods18910.11%
Functions170
▷ Named functions7644.71%
▷ Anonymous functions9455.29%
Constants420
▷ Global constants28166.90%
▷ Class constants13933.10%
▷ Public constants139100.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
35 PNG files occupy 0.06MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
modules/updraftplus/icons/onedrive.png1.07KB0.90KB▼ 15.36%
modules/updraftplus/icons/webdav.png2.24KB1.48KB▼ 34.03%
images/updraft_central_premium_logo.png2.09KB2.19KB0.00%
images/updraftcentral-logo-icon.png3.29KB1.82KB▼ 44.75%
modules/updraftplus/icons/s3.png1.05KB1.12KB0.00%