82% backup-restore-manager

Code Review | Backup & Restore Manager

WordPress plugin Backup & Restore Manager scored 82% from 54 tests.

About plugin

  • Plugin page: backup-restore-ma...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-5.7
  • WordPress version: 5.9.2
  • First release: Apr 28, 2020
  • Latest release: Mar 5, 2021
  • Number of updates: 6
  • Update frequency: every 51.7 days
  • Top authors: onionbazaar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 1,384 total downloads

Benchmarks

Plugin footprint 99% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲1.33MB] [CPU: ▼280.06ms] 75% from 4 tests

An overview of server-side resources used by Backup & Restore Manager
Please take the time to fix the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 15,112.42ms on /wp-admin/admin.php?page=backup-restore-manager_extensions)
PageMemory (MB)CPU Time (ms)
Home /4.68 ▲1.1761.91 ▲12.30
Dashboard /wp-admin4.79 ▲1.3849.87 ▲14.41
Posts /wp-admin/edit.php5.08 ▲1.4453.60 ▲17.07
Add New Post /wp-admin/post-new.php8.31 ▲1.34109.42 ▼1,164.03
Media Library /wp-admin/upload.php4.74 ▲1.4444.53 ▲19.74
Extensions /wp-admin/admin.php?page=backup-restore-manager_extensions4.7615,112.42
Backups /wp-admin/tools.php?page=backup-restore-manager5.01144.86

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

Input-output and database impact of this plugin
It is recommended to fix the following issues
  • You have illegally modified 4 files (30.93KB) outside of "wp-content/plugins/backup-restore-manager/" and "wp-content/uploads/"
    • (new file) wp-content/backupwordpress-4d84ca6083-backups/index.html
    • (new file) wp-content/backupwordpress-4d84ca6083-backups/.htaccess
    • (new file) wp-content/backupwordpress-4d84ca6083-backups/backup-restore-manager-cron
    • (new file) wp-content/backupwordpress-4d84ca6083-backups/.files
Filesystem: 193 new files
Database: no new tables, 3 new options
New WordPress options
obzbrm_plugin_version
hmbkp_schedule_1647681718
hmbkp_schedule_1647681717

Browser metrics Passed 4 tests

A check of browser resources used by Backup & Restore Manager
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,768 ▲4615.80 ▲0.095.99 ▲0.112.30 ▼0.11
Dashboard /wp-admin2,897 ▲366.17 ▼0.01114.54 ▼17.90156.22 ▼5.80
Posts /wp-admin/edit.php2,696 ▲23.23 ▼0.0061.23 ▼1.81143.17 ▼3.60
Add New Post /wp-admin/post-new.php1,776 ▲11522.08 ▲6.23480.16 ▲34.00162.80 ▲14.62
Media Library /wp-admin/upload.php1,703 ▲55.51 ▼0.02151.86 ▲9.37187.22 ▲0.40
Extensions /wp-admin/admin.php?page=backup-restore-manager_extensions1,0412.3757.41130.85
Backups /wp-admin/tools.php?page=backup-restore-manager2,3692.7870.53135.08

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=backup-restore-manager_extensions
    • > Warning in wp-content/plugins/backup-restore-manager/admin/extensions.php+50
    Invalid argument supplied for foreach()

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/backup-restore-manager/sar/srdb.cli.php
  • 98× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/backup-restore-manager/vendor/symfony/process/Tests/PhpExecutableFinderTest.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/backup-restore-manager/vendor/symfony/process/Tests/ProcessFailedExceptionTest.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function HM\\BackUpWordPress\\add_action() in wp-content/plugins/backup-restore-manager/admin/actions.php:25
    • > PHP Warning
      stream_select(): supplied argument is not a valid stream resource in wp-content/plugins/backup-restore-manager/vendor/symfony/process/Tests/PipeStdinInStdoutStdErrStreamSelect.php on line 29
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Process\\Exception\\RuntimeException' not found in wp-content/plugins/backup-restore-manager/vendor/symfony/process/Exception/ProcessTimedOutException.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Finder\\Expression\\ValueInterface' not found in wp-content/plugins/backup-restore-manager/vendor/symfony/finder/Expression/Glob.php:21
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_excludes() on null in wp-content/plugins/backup-restore-manager/admin/schedule-form-excludes.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/backup-restore-manager/vendor/symfony/process/Tests/ProcessBuilderTest.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/backup-restore-manager/admin/faq.php:2
    • > PHP Warning
      Use of undefined constant STDERR - assumed 'STDERR' (this will throw an Error in a future version of PHP) in wp-content/plugins/backup-restore-manager/sar/srdb.cli.php on line 180

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
The official readme.txt might help

backup-restore-manager/backup-restore-manager.php Passed 13 tests

This is the main PHP file of "Backup & Restore Manager" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
62 characters long description:
Simple automated Backup and Restore of your WordPress Website.

Code Analysis Passed 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
Good job! No executable or dangerous file extensions detected22,458 lines of code in 161 files:
LanguageFilesBlank linesComment linesLines of code
PHP1264,4596,86412,405
PO File224,1474,6189,216
Bourne Shell13727269
JSON400250
JavaScript25311138
CSS220266
Markdown219060
XML26054

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity10.32
▷ Minimum class complexity1.00
▷ Maximum class complexity136.00
Average method complexity2.47
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces15
Interfaces5
Traits0
Classes144
▷ Abstract classes1611.11%
▷ Concrete classes12888.89%
▷ Final classes21.56%
Methods960
▷ Static methods10611.04%
▷ Public methods84487.92%
▷ Protected methods464.79%
▷ Private methods707.29%
Functions97
▷ Named functions6567.01%
▷ Anonymous functions3232.99%
Constants54
▷ Global constants1222.22%
▷ Class constants4277.78%
▷ Public constants42100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin