62% backup-database

Code Review | Backup Database

WordPress plugin Backup Database scored 62% from 54 tests.

About plugin

  • Plugin page: backup-database
  • Plugin version: 4.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.9
  • WordPress version: 6.3.1
  • First release: May 14, 2016
  • Latest release: Aug 29, 2018
  • Number of updates: 44
  • Update frequency: every 19.1 days
  • Top authors: wpproking (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

500+ active / 33,833 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.55MB] [CPU: ▼48.65ms] Passed 4 tests

This is a short check of server-side resources used by Backup Database
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.44 ▼1.028.72 ▼31.66
Dashboard /wp-admin2.46 ▼0.847.73 ▼38.78
Posts /wp-admin/edit.php2.46 ▼0.897.30 ▼38.61
Add New Post /wp-admin/post-new.php2.46 ▼3.438.73 ▼85.54
Media Library /wp-admin/upload.php2.46 ▼0.778.97 ▼23.71
Email Notification /wp-admin/admin.php?page=backup_database_general2.469.47
Create Backup /wp-admin/admin.php?page=backup_database_overview2.469.59
Pro Features /wp-admin/admin.php?page=backup_database_pro2.467.83
Schedule Options /wp-admin/admin.php?page=backup_database_scheduler2.4610.88
Store Backup /wp-admin/admin.php?page=backup_database_addons2.468.85
Settings /wp-admin/admin.php?page=backup_database_settings2.469.45

Server storage [IO: ▲1.48MB] [DB: ▲0.00MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 48 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
hmbkp_dropbox_settings
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Backup Database: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,842 ▲10713.30 ▼1.271.73 ▲0.0744.82 ▲3.97
Dashboard /wp-admin2,245 ▲545.80 ▲0.9494.99 ▼6.4864.11 ▲21.48
Posts /wp-admin/edit.php2,128 ▲391.98 ▼0.0538.56 ▲1.7738.93 ▲7.21
Add New Post /wp-admin/post-new.php1,557 ▲2418.27 ▼4.75708.41 ▼66.6462.07 ▼4.47
Media Library /wp-admin/upload.php1,424 ▲364.20 ▲0.0298.39 ▲1.7066.33 ▲20.17
Email Notification /wp-admin/admin.php?page=backup_database_general9821.8926.2036.42
Create Backup /wp-admin/admin.php?page=backup_database_overview9931.8025.9838.70
Pro Features /wp-admin/admin.php?page=backup_database_pro1,0391.7623.9136.09
Schedule Options /wp-admin/admin.php?page=backup_database_scheduler9801.7326.0433.38
Store Backup /wp-admin/admin.php?page=backup_database_addons1,0601.9026.8739.73
Settings /wp-admin/admin.php?page=backup_database_settings9511.8127.0836.30

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/backup-database/components/error_handler.php+31
    Trying to access array offset on value of type bool
  • The uninstall procedure has failed, leaving 7 options in the database
    • hmbkp_dropbox_settings
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 29 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=backup_database_settings
    • > Notice in wp-content/plugins/backup-database/pages/settings.php+65
    Trying to access array offset on value of type bool

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/backup-database/lib/Dropbox/tokens/index.php
    • > /wp-content/plugins/backup-database/lib/FTP/index.php
  • 14× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/backup-database/components/backup.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/backup-database/backup-database.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/backup-database/components/cron.php:3
    • > <h2>Send package to FTP site</h2>.
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/backup-database/lib/Dropbox/dropboxform.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/backup-database/lib/backup_database-functions.php:54
    • > PHP Notice
      Undefined variable: pageid in wp-content/plugins/backup-database/lib/FTP/preflight.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/backup-database/components/error_handler.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/backup-database/lib/FTP/preflight.php:16
    • > All good - let's Backup!<br />.

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 17 tag instead of maximum 10
  • Screenshots: Please add an image for screenshot #5 (screenshot-5.png)
You can look at the official readme.txt

backup-database/backup-database.php 85% from 13 tests

"Backup Database" version 4.9's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Description: Keep the plugin description shorter than 140 characters (currently 158 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin6,393 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP251,6792,7725,349
SVG100685
CSS24913245
JavaScript23173114

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity118.00
▷ Minimum class complexity3.00
▷ Maximum class complexity556.00
Average method complexity6.62
▷ Minimum method complexity1.00
▷ Maximum method complexity63.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods125
▷ Static methods10.80%
▷ Public methods10886.40%
▷ Protected methods43.20%
▷ Private methods1310.40%
Functions44
▷ Named functions44100.00%
▷ Anonymous functions00.00%
Constants75
▷ Global constants6992.00%
▷ Class constants68.00%
▷ Public constants6100.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.22MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot_4.png19.74KB8.13KB▼ 58.79%
assets/screenshot_1.png15.44KB5.85KB▼ 62.13%
img/30.png137.44KB78.16KB▼ 43.13%
assets/img/backup.png0.50KB0.62KB0.00%
assets/screenshot_2.png31.68KB12.53KB▼ 60.45%