10% website-backup-bot

Code Review | Website Backup Bot

WordPress plugin Website Backup Bot scored10%from 54 tests.

About plugin

  • Plugin page: website-backup-bot
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.9.3
  • WordPress version: 6.3.1
  • First release: May 20, 2022
  • Latest release: Jun 8, 2022
  • Number of updates: 8
  • Update frequency: every 2.8 days
  • Top authors: websitebackupbot (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,458 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/website-backup-bot/plugin.php+339
    count(): Parameter must be an array or an object that implements Countable

Server metrics [RAM: ▼1.00MB] [CPU: ▼47.93ms] Passed 4 tests

Analyzing server-side resources used by Website Backup Bot
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.99 ▼0.4713.39 ▼28.29
Dashboard /wp-admin3.00 ▼0.3015.56 ▼38.29
Posts /wp-admin/edit.php3.00 ▼0.3517.27 ▼36.60
Add New Post /wp-admin/post-new.php3.00 ▼2.8814.57 ▼88.55
Media Library /wp-admin/upload.php3.00 ▼0.2219.62 ▼16.23
Website BackupBot /wp-admin/tools.php?page=wbb_settings3.0021.09

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 681 new files
Database: 2 new tables, 6 new options
New tables
wp_wbb_user
wp_wbb_settings
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Website Backup Bot: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5813.70 ▼0.961.72 ▼0.1144.58 ▼4.01
Dashboard /wp-admin2,228 ▲255.86 ▲0.97102.41 ▼0.7838.65 ▼0.36
Posts /wp-admin/edit.php2,104 ▲42.01 ▼0.1734.93 ▼3.3732.93 ▼4.54
Add New Post /wp-admin/post-new.php1,548 ▼222.92 ▼0.01602.79 ▼57.4458.75 ▲2.52
Media Library /wp-admin/upload.php1,404 ▲74.13 ▼0.11111.75 ▼1.6748.27 ▲0.33
Website BackupBot /wp-admin/tools.php?page=wbb_settings1,2953.0079.97113.51

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function register_rest_route was called incorrectly. REST API routes must be registered on the rest_api_init action. Please see Debugging in WordPress for more information. (This message was added in version 5.1.0.)
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_wbb_user
    • wp_wbb_settings
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=wbb_settings
    • > User notice in wp-includes/functions.php+5905
    Function register_rest_route was called incorrectly. REST API routes must be registered on the rest_api_init action. Please see Debugging in WordPress for more information. (This message was added in version 5.1.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=wbb_settings
    • > User notice in wp-includes/functions.php+5905
    Function register_rest_route was called incorrectly. The REST API route definition for api/v1/request-backup is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback. Please see Debugging in WordPress for more information. (This message was added in version 5.5.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=wbb_settings
    • > User notice in wp-includes/functions.php+5905
    Function register_rest_route was called incorrectly. The REST API route definition for api/v1/check-code is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback. Please see Debugging in WordPress for more information. (This message was added in version 5.5.0.)
    • > GET request to /wp-admin/tools.php?page=wbb_settings
    • > User deprecated in wp-includes/functions.php+5463
    Function is_plugin_page is deprecated since version 3.1.0 with no alternative available.

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 148× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\TokenParser\\AbstractTokenParser' not found in wp-content/plugins/website-backup-bot/vendor/twig/twig/src/TokenParser/IfTokenParser.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\Extension\\AbstractExtension' not found in wp-content/plugins/website-backup-bot/vendor/twig/twig/src/Extension/ProfilerExtension.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\Binary\\AbstractBinary' not found in wp-content/plugins/website-backup-bot/vendor/twig/twig/src/Node/Expression/Binary/FloorDivBinary.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\ode' not found in wp-content/plugins/website-backup-bot/vendor/twig/twig/src/Node/AutoEscapeNode.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\odeVisitor\\AbstractNodeVisitor' not found in wp-content/plugins/website-backup-bot/vendor/twig/twig/src/NodeVisitor/EscaperNodeVisitor.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\ode' not found in wp-content/plugins/website-backup-bot/vendor/twig/twig/src/Node/ForLoopNode.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\Sandbox\\SecurityError' not found in wp-content/plugins/website-backup-bot/vendor/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\ode' not found in wp-content/plugins/website-backup-bot/vendor/twig/twig/src/Node/ImportNode.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\Binary\\AbstractBinary' not found in wp-content/plugins/website-backup-bot/vendor/twig/twig/src/Node/Expression/Binary/LessBinary.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\Extension\\AbstractExtension' not found in wp-content/plugins/website-backup-bot/vendor/twig/twig/src/Extension/StagingExtension.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Contributors: Plugin contributors not specified
The official readme.txt is a good inspiration

website-backup-bot/plugin.php 92% from 13 tests

"Website Backup Bot" version 0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
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 ("website-backup-bot.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected45,638 lines of code in 624 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript995,4842,89821,662
PHP3793,8995,04117,468
reStructuredText1152,6162,5303,005
CSS8731241,934
HTML57830616
JSON500387
YAML3580226
make1245124
XML500123
Bourne Shell16143
Python17316533
Markdown28017

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity5.15
▷ Minimum class complexity1.00
▷ Maximum class complexity162.00
Average method complexity2.70
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces26
Interfaces14
Traits0
Classes350
▷ Abstract classes113.14%
▷ Concrete classes33996.86%
▷ Final classes5115.04%
Methods907
▷ Static methods758.27%
▷ Public methods77385.23%
▷ Protected methods596.50%
▷ Private methods758.27%
Functions162
▷ Named functions14891.36%
▷ Anonymous functions148.64%
Constants55
▷ Global constants610.91%
▷ Class constants4989.09%
▷ Public constants49100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 1.62MB with 0.79MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/wbblogo.png8.30KB4.49KB▼ 45.84%
img/test.png11.38KB3.96KB▼ 65.21%
img/wbbhead.png4.22KB2.34KB▼ 44.54%
img/wbb-logo.png8.30KB4.49KB▼ 45.84%
img/wave.png6.79KB4.02KB▼ 40.78%