10% cyan-backup

Code Review | CYAN Backup

WordPress plugin CYAN Backup scored10%from 54 tests.

About plugin

  • Plugin page: cyan-backup
  • Plugin version: 2.5.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9-6.4.1
  • WordPress version: 6.3.1
  • First release: Feb 10, 2014
  • Latest release: Dec 3, 2023
  • Number of updates: 179
  • Update frequency: every 20.0 days
  • Top authors: GregRoss (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

600+ active /32,191 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/cyan-backup/cyan-backup.php+85
    array_key_exists() expects parameter 2 to be array, bool given

Server metrics [RAM: ▼1.47MB] [CPU: ▼54.11ms] Passed 4 tests

A check of server-side resources used by CYAN Backup
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.52 ▼0.947.16 ▼37.86
Dashboard /wp-admin2.54 ▼0.7612.92 ▼34.30
Posts /wp-admin/edit.php2.54 ▼0.818.34 ▼42.79
Add New Post /wp-admin/post-new.php2.54 ▼3.347.84 ▼101.50
Media Library /wp-admin/upload.php2.54 ▼0.699.58 ▼24.82
Backups /wp-admin/admin.php?page=cyan-backup2.549.05
About /wp-admin/admin.php?page=cyan-backup-about2.5410.15
Options /wp-admin/admin.php?page=cyan-backup-options2.547.95

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

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

Browser metrics Passed 4 tests

A check of browser resources used by CYAN Backup
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲5814.25 ▼0.091.67 ▼0.1243.49 ▼1.97
Dashboard /wp-admin2,222 ▲425.54 ▼0.1391.27 ▼5.6572.65 ▲32.34
Posts /wp-admin/edit.php2,133 ▲331.99 ▲0.0338.85 ▼0.8534.67 ▼4.89
Add New Post /wp-admin/post-new.php1,568 ▲4223.16 ▼0.12757.27 ▲83.1258.31 ▲2.49
Media Library /wp-admin/upload.php1,433 ▲334.13 ▼0.10103.46 ▲4.8278.19 ▲35.86
Backups /wp-admin/admin.php?page=cyan-backup9071.8333.4329.61
About /wp-admin/admin.php?page=cyan-backup-about9891.7426.5026.69
Options /wp-admin/admin.php?page=cyan-backup-options2,3952.0336.2036.92

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/cyan-backup/cyan-backup.php+85
    array_key_exists() expects parameter 2 to be array, bool given
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% 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)
Smoke test failed, please fix the following
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cyan-backup-options
    • > Warning in wp-content/plugins/cyan-backup/cyan-backup.php+85
    array_key_exists() expects parameter 2 to be array, bool given
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cyan-backup
    • > POST request to /index.php/json/status/
    • > User deprecated in wp-includes/functions.php+5453
    Function get_currentuserinfo is deprecated since version 4.5.0! Use wp_get_current_user() instead.
    • > GET request to /wp-admin/admin.php?page=cyan-backup
    • > Notice in wp-content/plugins/cyan-backup/includes/class-cyan-wp-backuper.php+51
    Undefined index: excluded
    • > GET request to /wp-admin/admin.php?page=cyan-backup
    • > POST request to /index.php/json/status/
    • > Warning in wp-content/plugins/cyan-backup/cyan-backup.php+540
    file_get_contents(/tmpstatus.log): failed to open stream: No such file or directory
    • > GET request to /wp-admin/admin.php?page=cyan-backup-options
    • > Notice in wp-content/plugins/cyan-backup/includes/page-options.php+318
    Undefined index: remote
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cyan-backup-options
    • > Notice in wp-content/plugins/cyan-backup/includes/page-options.php+811
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/admin.php?page=cyan-backup-options
    • > Notice in wp-content/plugins/cyan-backup/includes/page-options.php+505
    Undefined index: schedule
    • > GET request to /wp-admin/admin.php?page=cyan-backup-options
    • > Notice in wp-content/plugins/cyan-backup/includes/page-options.php+654
    Undefined index: sendto
    • > GET request to /wp-admin/admin.php?page=cyan-backup-options
    • > Notice in wp-content/plugins/cyan-backup/includes/page-options.php+726
    Undefined index: schedule_once
    • > GET request to /wp-admin/admin.php?page=cyan-backup-options
    • > Notice in wp-content/plugins/cyan-backup/includes/page-options.php+727
    Undefined index: schedule_before
    • > GET request to /wp-admin/admin.php?page=cyan-backup-options
    • > Notice in wp-content/plugins/cyan-backup/includes/page-options.php+738
    Undefined index: schedule_hours_label
    • > GET request to /wp-admin/admin.php?page=cyan-backup-options
    • > Notice in wp-content/plugins/cyan-backup/includes/page-options.php+738
    Undefined index: schedule_days
    • > GET request to /wp-admin/admin.php?page=cyan-backup-options
    • > Notice in wp-content/plugins/cyan-backup/includes/page-options.php+738
    Undefined index: schedule_weeks
    • > GET request to /wp-admin/admin.php?page=cyan-backup-options
    • > Notice in wp-content/plugins/cyan-backup/includes/page-options.php+738
    Undefined index: schedule_months
    • > GET request to /wp-admin/admin.php?page=cyan-backup-options
    • > Notice in wp-content/plugins/cyan-backup/includes/page-options.php+739
    Undefined index: schedule_on
    • > GET request to /wp-admin/admin.php?page=cyan-backup-options
    • > Notice in wp-content/plugins/cyan-backup/includes/page-options.php+741
    Undefined index: schedule_dow
    • > GET request to /wp-admin/admin.php?page=cyan-backup-options
    • > Notice in wp-content/plugins/cyan-backup/includes/page-options.php+755
    Undefined index: schedule_the
    • > GET request to /wp-admin/admin.php?page=cyan-backup-options
    • > Notice in wp-content/plugins/cyan-backup/includes/page-options.php+757
    Undefined index: schedule_dom
    • > GET request to /wp-admin/admin.php?page=cyan-backup-options
    • > Notice in wp-content/plugins/cyan-backup/includes/page-options.php+770
    Undefined index: schedule_at
    • > GET request to /wp-admin/admin.php?page=cyan-backup-options
    • > Notice in wp-content/plugins/cyan-backup/includes/page-options.php+811
    Undefined index: prune
    • > GET request to /wp-admin/admin.php?page=cyan-backup-options
    • > Notice in wp-content/plugins/cyan-backup/includes/page-options.php+859
    Undefined index: host
    • > GET request to /wp-admin/admin.php?page=cyan-backup-options
    • > Notice in wp-content/plugins/cyan-backup/includes/page-options.php+865
    Undefined index: username
    • > GET request to /wp-admin/admin.php?page=cyan-backup-options
    • > Notice in wp-content/plugins/cyan-backup/includes/page-options.php+878
    Undefined index: path

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 61× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: final_password in wp-content/plugins/cyan-backup/includes/protocol-ftpswrappers.php on line 10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/cyan-backup/includes/protocol-ftpwrappers.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/cyan-backup/includes/page-backups.php:3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/cyan-backup/includes/protocol-ftpwrappers.php on line 22
    • > PHP Notice
      Undefined variable: remote_settings in wp-content/plugins/cyan-backup/includes/protocol-ftpswrappers.php on line 17
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/cyan-backup/includes/protocol-ftpwrappers.php on line 15
    • > PHP Notice
      Undefined offset: 1 in wp-content/plugins/cyan-backup/includes/protocol-ftplibrary.php on line 13
    • > PHP Fatal error
      Uncaught Error: Class 'splitbrain\\PHPArchive\\Archive' not found in wp-content/plugins/cyan-backup/vendor/splitbrain/php-archive/src/Zip.php:16
    • > PHP Notice
      Undefined variable: remote_settings in wp-content/plugins/cyan-backup/includes/protocol-ftpwrappers.php on line 22
    • > PHP Notice
      Undefined offset: 2 in wp-content/plugins/cyan-backup/includes/protocol-ftpwrappers.php on line 13

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: backup, ftp, ftps, sftp, schedule...

cyan-backup/cyan-backup.php Passed 13 tests

The main PHP file in "CYAN Backup" ver. 2.5.1 adds more information about the plugin and also serves as the entry point for this plugin
86 characters long description:
Backup your entire WordPress site and its database into an archive file on a schedule.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected28,756 lines of code in 72 files:
LanguageFilesBlank linesComment linesLines of code
PHP615,66015,83328,195
CSS31725299
JSON350111
Markdown116052
YAML29050
Bourne Shell1132228
XML10021

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 121)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity101.26
▷ Minimum class complexity1.00
▷ Maximum class complexity556.00
Average method complexity5.97
▷ Minimum method complexity1.00
▷ Maximum method complexity121.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes46
▷ Abstract classes12.17%
▷ Concrete classes4597.83%
▷ Final classes00.00%
Methods940
▷ Static methods232.45%
▷ Public methods82988.19%
▷ Protected methods333.51%
▷ Private methods788.30%
Functions11
▷ Named functions981.82%
▷ Anonymous functions218.18%
Constants309
▷ Global constants29595.47%
▷ Class constants144.53%
▷ Public constants14100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/cyan-backup.png9.44KB6.25KB▼ 33.75%
images/backup32.png1.05KB0.94KB▼ 10.83%
images/backup16.png0.36KB0.32KB▼ 9.07%
images/success.png0.76KB0.81KB0.00%
images/failure.png0.57KB0.62KB0.00%