83% keep-backup-daily

Code Review | Keep Backup Daily

WordPress plugin Keep Backup Daily scored83%from 54 tests.

About plugin

  • Plugin page: keep-backup-daily
  • Plugin version: 2.0.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2
  • WordPress version: 6.3.1
  • First release: Mar 9, 2013
  • Latest release: May 24, 2023
  • Number of updates: 145
  • Update frequency: every 25.7 days
  • Top authors: fahadmahmood (100%)

Code review

54 tests

User reviews

45 reviews

Install metrics

600+ active /47,985 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲1.60MB] [CPU: ▼1.20ms] Passed 4 tests

An overview of server-side resources used by Keep Backup Daily
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.34 ▼4.10
Dashboard /wp-admin5.46 ▲2.1559.30 ▲2.21
Posts /wp-admin/edit.php5.49 ▲2.1455.38 ▲5.43
Add New Post /wp-admin/post-new.php8.07 ▲2.1886.40 ▼8.34
Media Library /wp-admin/upload.php5.33 ▲2.1047.72 ▲12.51
Backup Now /wp-admin/admin.php?page=kbd_download5.2645.24
Export /wp-admin/upload.php?page=kbd-export-media5.2341.46
Keep Backup Daily /wp-admin/options-general.php?page=kbd_settings5.3351.46

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 71 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Keep Backup Daily
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3614.24 ▼0.131.59 ▼0.0437.92 ▼4.59
Dashboard /wp-admin2,203 ▲265.59 ▼0.0686.44 ▼11.4036.85 ▼6.44
Posts /wp-admin/edit.php2,108 ▲81.97 ▼0.0137.24 ▼1.0735.79 ▲0.77
Add New Post /wp-admin/post-new.php1,541 ▲618.44 ▼0.04619.25 ▼33.7463.74 ▼8.59
Media Library /wp-admin/upload.php1,416 ▲194.26 ▲0.0297.36 ▲2.4142.72 ▼2.17
Backup Now /wp-admin/admin.php?page=kbd_download8661.8628.9228.09
Export /wp-admin/upload.php?page=kbd-export-media1,3442.4045.8729.93
Keep Backup Daily /wp-admin/options-general.php?page=kbd_settings1,3402.3536.5926.66

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 15× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WPDB' not found in wp-content/plugins/keep-backup-daily/inc/find_replace/class/Common/Db/MDBWPDB.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/keep-backup-daily/inc/find_replace/setup-mdb.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/keep-backup-daily/inc/kbd_find_replace.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WPMechanic\\KBFNR\\Common\\Plugin\\PluginManagerBase' not found in wp-content/plugins/keep-backup-daily/inc/find_replace/class/Free/Plugin/PluginManager.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WPMechanic\\KBFNR\\Common\\UI\\TemplateBase' not found in wp-content/plugins/keep-backup-daily/inc/find_replace/class/Free/UI/Template.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/keep-backup-daily/inc/kbd_export_media.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/keep-backup-daily/inc/kbd_settings.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WPMechanic\\KBFNR\\ServiceProviderAbstract' not found in wp-content/plugins/keep-backup-daily/inc/find_replace/class/ServiceProvider.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'WPMechanic\\KBFNR\\ServiceProvider' not found in wp-content/plugins/keep-backup-daily/inc/find_replace/class/Free/ServiceProvider.php:8
    • > PHP Fatal error
      Trait 'WPMechanic\\KBFNR\\Common\\Util\\Singleton' not found in wp-content/plugins/keep-backup-daily/inc/find_replace/class/Common/MigrationState/StateDataContainer.php on line 18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

keep-backup-daily/index.php 85% from 13 tests

"Keep Backup Daily" version 2.0.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("keep-backup-daily.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin11,733 lines of code in 60 files:
LanguageFilesBlank linesComment linesLines of code
PHP522,5972,8808,993
PO File38359212,033
JavaScript320418364
CSS27311343

PHP code Passed 2 tests

Analyzing 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.41
Average class complexity24.89
▷ Minimum class complexity1.00
▷ Maximum class complexity284.00
Average method complexity3.89
▷ Minimum method complexity1.00
▷ Maximum method complexity66.00
Code structure
Namespaces23
Interfaces0
Traits1
Classes54
▷ Abstract classes59.26%
▷ Concrete classes4990.74%
▷ Final classes00.00%
Methods455
▷ Static methods357.69%
▷ Public methods42292.75%
▷ Protected methods40.88%
▷ Private methods296.37%
Functions43
▷ Named functions4093.02%
▷ Anonymous functions36.98%
Constants10
▷ Global constants110.00%
▷ Class constants990.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/database_email.png0.82KB0.80KB▼ 3.44%
images/flower.png13.18KB4.85KB▼ 63.22%
images/tick_cross.png3.99KB1.23KB▼ 69.17%
images/folder.png0.72KB0.50KB▼ 30.86%