88% wps-backup

Code Review | WPS Backup

WordPress plugin WPS Backup scored 88% from 54 tests.

About plugin

  • Plugin page: wps-backup
  • Plugin version: 0.6.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.0.3
  • WordPress version: 5.8.1
  • First release: Nov 25, 2018
  • Latest release: Jan 15, 2019
  • Number of updates: 14
  • Update frequency: every 3.6 days
  • Top authors: fullmoonfriday (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 455 total downloads

Benchmarks

Plugin footprint Passed 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: ▼0.00MB] [CPU: ▼138.51ms] Passed 4 tests

Server-side resources used by WPS Backup
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1229.46 ▼0.06
Dashboard /wp-admin3.06 ▲0.0057.24 ▲9.56
Posts /wp-admin/edit.php3.11 ▲0.0049.43 ▲8.40
Add New Post /wp-admin/post-new.php5.42 ▼0.0296.65 ▼563.71
Media Library /wp-admin/upload.php3.00 ▲0.0034.01 ▲1.33

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 23 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by WPS Backup
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,718 ▲13615.91 ▲0.429.31 ▼1.5649.20 ▼7.18
Dashboard /wp-admin2,973 ▲425.89 ▼0.08140.08 ▼16.45115.58 ▼0.60
Posts /wp-admin/edit.php2,739 ▼02.68 ▲0.0070.61 ▲4.6797.01 ▲2.40
Add New Post /wp-admin/post-new.php1,683 ▲18318.79 ▼0.08388.61 ▲3.45119.37 ▲8.39
Media Library /wp-admin/upload.php1,807 ▲35.01 ▼0.03159.01 ▲7.26119.53 ▼8.39

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
The following issues need your attention
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wps-backup/includes/data_actions/setup_backup.php
    • > /wp-content/plugins/wps-backup/includes/data_actions/plugins_restore_backup_files_list.php
    • > /wp-content/plugins/wps-backup/includes/data_actions/restore_cloud_plugins_backup.php
    • > /wp-content/plugins/wps-backup/includes/data_actions/plugins_restore_backup_remote.php
  • 15× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: site_url in wp-content/plugins/wps-backup/includes/data_actions/restore_backup_download_remote.php on line 36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wps-backup/includes/data_actions/wpsc_data_management.php:142
    • > PHP Notice
      Undefined index: url in wp-content/plugins/wps-backup/includes/data_actions/restore_backup_download_remote.php on line 34
    • > PHP Notice
      Undefined index: url in wp-content/plugins/wps-backup/includes/data_actions/restore_cloud_db_backup.php on line 30
    • > PHP Notice
      Undefined index: required_backup in wp-content/plugins/wps-backup/includes/data_actions/restore_cloud_db_backup.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_row() on null in wp-content/plugins/wps-backup/includes/data_actions/restore_backup_remote.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/wps-backup/includes/data_actions/restore_backup_files_list.php:17
    • > PHP Notice
      Undefined index: required_backup in wp-content/plugins/wps-backup/includes/data_actions/restore_cloud_db_backup.php on line 31
    • > PHP Notice
      Undefined index: required_backup in wp-content/plugins/wps-backup/includes/data_actions/restore_backup_download_remote.php on line 35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/wps-backup/includes/data_actions/plugins_backup.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: No descriptions were found for these screenshots #2, #3 in wps-backup/assets to your readme.txt
Please take inspiration from this readme.txt

wps-backup/wps_backup.php 92% from 13 tests

"WPS Backup" version 0.6.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wps-backup.php" instead of "wps_backup.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin1,259 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP204734901,257
CSS1012

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity33.50
▷ Minimum class complexity5.00
▷ Maximum class complexity62.00
Average method complexity4.25
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods20
▷ Static methods525.00%
▷ Public methods1995.00%
▷ Protected methods00.00%
▷ Private methods15.00%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin