10% cua-backuprestore

Code Review | cua-backup-restore

WordPress plugin cua-backup-restore scored10%from 54 tests.

About plugin

  • Plugin page: cua-backuprestore
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.4
  • WordPress version: 6.3.1
  • First release: Dec 16, 2015
  • Latest release: Dec 17, 2015
  • Number of updates: 7
  • Update frequency: every 0.4 days
  • Top authors: cayfer (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /888 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • The plugin cannot be installed
    • > Error in wp-content/plugins/cua-backuprestore/cua-backup-restore.php+67
    Uncaught Error: Call to undefined function switch_to_blog() in wp-content/plugins/cua-backuprestore/cua-backup-restore.php:67
    Stack trace:
    #0 wp-admin/includes/plugin.php(2318): include_once()
    #1 wp-admin/includes/plugin.php(663): plugin_sandbox_scrape()

Server metrics [RAM: ▼0.01MB] [CPU: ▼6.76ms] Passed 4 tests

Analyzing server-side resources used by cua-backup-restore
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.62 ▼2.39
Dashboard /wp-admin3.31 ▼0.0445.87 ▼13.17
Posts /wp-admin/edit.php3.36 ▲0.0045.62 ▼3.29
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.65 ▼8.18
Media Library /wp-admin/upload.php3.23 ▲0.0031.59 ▼1.90

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 83 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

cua-backup-restore: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.14 ▼1.301.71 ▲0.0944.40 ▲5.37
Dashboard /wp-admin2,200 ▲125.83 ▲0.9397.42 ▼10.2137.43 ▼8.08
Posts /wp-admin/edit.php2,089 ▼02.00 ▲0.0138.87 ▼1.7434.45 ▼2.30
Add New Post /wp-admin/post-new.php1,544 ▲718.29 ▲0.05642.39 ▼2.5372.73 ▲11.82
Media Library /wp-admin/upload.php1,388 ▼04.12 ▼0.0692.74 ▼4.6642.16 ▼3.96

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/cua-backuprestore/cua-backup-restore.php
    • > /wp-content/plugins/cua-backuprestore/lib/cuabr-init.php
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      include(CUABR_PLUGIN_PATHlib/get_upload_limits.php): failed to open stream: No such file or directory in wp-content/plugins/cua-backuprestore/lib/cuabr-main-page.php on line 7
    • > PHP Warning
      Use of undefined constant CUABR_PLUGIN_PATH - assumed 'CUABR_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/cua-backuprestore/lib/build_recents_table.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_multisite() in wp-content/plugins/cua-backuprestore/lib/cuabr-main-page.php:12
    • > PHP Warning
      Use of undefined constant CUABR_PLUGIN_PATH - assumed 'CUABR_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/cua-backuprestore/lib/cuabr-main-page.php on line 7
    • > PHP Warning
      include(CUABR_PLUGIN_PATHlib/get_upload_limits.php): failed to open stream: No such file or directory in wp-content/plugins/cua-backuprestore/lib/build_recents_table.php on line 2
    • > PHP Warning
      include(): Failed opening 'CUABR_PLUGIN_PATHlib/get_upload_limits.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/cua-backuprestore/lib/build_recents_table.php on line 2
    • > PHP Warning
      include(): Failed opening 'CUABR_PLUGIN_PATHlib/get_upload_limits.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/cua-backuprestore/lib/cuabr-main-page.php on line 7

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
3 plugin tags: restore, backup, multisite

cua-backuprestore/cua-backup-restore.php 92% from 13 tests

The main PHP file in "cua-backup-restore" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cua-backuprestore.php" instead of "cua-backup-restore.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
No dangerous file extensions were detected8,819 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
CSS9173602,702
JavaScript165795162,177
PHP144474961,541
Sass5181211,497
HTML2839517
SVG313193
Markdown1450112
JSON20070
YAML1008
Bourne Shell1002

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions32
▷ Named functions32100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
12 PNG files occupy 0.10MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/yellow.png0.47KB0.44KB▼ 6.86%
js/sweetalert-master/example/images/logo_big.png16.76KB5.65KB▼ 66.32%
js/sweetalert-master/example/images/vs_icon@2x.png8.06KB3.51KB▼ 56.40%
img/red.png0.63KB0.58KB▼ 8.15%
img/help.png0.79KB0.72KB▼ 8.81%