83% qnap-nas-backup

Code Review | QNAP NAS Backup

WordPress plugin QNAP NAS Backup scored83%from 54 tests.

About plugin

  • Plugin page: qnap-nas-backup
  • Plugin version: 1.0.5
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-6.4
  • WordPress version: 6.3.1
  • First release: Sep 7, 2021
  • Latest release: Oct 26, 2023
  • Number of updates: 23
  • Update frequency: every 33.9 days
  • Top authors: qnapplugin (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

2,000+ active /6,991 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.94MB] [CPU: ▲4.60ms] Passed 4 tests

A check of server-side resources used by QNAP NAS Backup
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /5.43 ▲1.9744.87 ▲7.25
Dashboard /wp-admin5.28 ▲1.9752.94 ▼2.32
Posts /wp-admin/edit.php5.33 ▲1.9753.84 ▲7.90
Add New Post /wp-admin/post-new.php7.82 ▲1.9388.41 ▲5.58
Media Library /wp-admin/upload.php5.14 ▲1.9149.93 ▲16.12

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

Filesystem and database footprint
Please fix the following
  • Illegal file modification detected: 4 files (0.48KB) outside of "wp-content/plugins/qnap-nas-backup/" and "wp-content/uploads/"
    • (new file) wp-content/qnap-backups/web.config
    • (new file) wp-content/qnap-backups/index.html
    • (new file) wp-content/qnap-backups/.htaccess
    • (new file) wp-content/qnap-backups/index.php
Filesystem: 117 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
qnap_secret_key
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for QNAP NAS Backup
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4314.17 ▼0.111.63 ▲0.0337.11 ▼4.61
Dashboard /wp-admin2,213 ▲335.64 ▲0.0283.77 ▼0.4838.86 ▼5.57
Posts /wp-admin/edit.php2,115 ▲152.00 ▲0.0134.89 ▼2.5832.92 ▼3.60
Add New Post /wp-admin/post-new.php1,541 ▲1023.09 ▼0.15685.06 ▲83.3163.56 ▲17.42
Media Library /wp-admin/upload.php1,412 ▲94.17 ▲0.0093.35 ▼7.8240.69 ▼4.71

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 items
  • 86× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/qnap-nas-backup/lib/view/main/backups-htaccess-notice.php
    • > /wp-content/plugins/qnap-nas-backup/lib/controller/class-qnap-backups-controller.php
    • > /wp-content/plugins/qnap-nas-backup/lib/view/main/storage-index-html-notice.php
    • > /wp-content/plugins/qnap-nas-backup/lib/model/import/class-qnap-import-compatibility.php
    • > /wp-content/plugins/qnap-nas-backup/lib/model/class-qnap-notification.php
    • > /wp-content/plugins/qnap-nas-backup/lib/model/class-qnap-message.php
    • > /wp-content/plugins/qnap-nas-backup/lib/view/main/admin-head.php
    • > /wp-content/plugins/qnap-nas-backup/lib/model/class-qnap-compatibility.php
    • > /wp-content/plugins/qnap-nas-backup/lib/model/import/class-qnap-import-blogs.php
    • > /wp-content/plugins/qnap-nas-backup/lib/model/export/class-qnap-export-database-file.php

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: migrate, restore, nas, backup, qnap

qnap-nas-backup/qnap.php 77% from 13 tests

The principal PHP file in "QNAP NAS Backup" v. 1.0.5 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("qnap-nas-backup.php" instead of "qnap.php")
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected10,544 lines of code in 105 files:
LanguageFilesBlank linesComment linesLines of code
PHP862,1773,5757,307
JavaScript79051473,157
SVG20070
CSS100010

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
The following items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 150)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity10.76
▷ Minimum class complexity1.00
▷ Maximum class complexity150.00
Average method complexity3.90
▷ Minimum method complexity1.00
▷ Maximum method complexity150.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes87
▷ Abstract classes22.30%
▷ Concrete classes8597.70%
▷ Final classes00.00%
Methods302
▷ Static methods10434.44%
▷ Public methods24882.12%
▷ Protected methods4615.23%
▷ Private methods82.65%
Functions80
▷ Named functions7998.75%
▷ Anonymous functions11.25%
Constants76
▷ Global constants76100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/view/assets/img/logo-32x32.png1.39KB1.25KB▼ 10.05%
lib/view/assets/img/logo-20x20.png0.86KB0.81KB▼ 5.59%
lib/view/assets/img/logo-128x128.png5.28KB2.94KB▼ 44.21%