68% b2-sync

Code Review | b2-sync

WordPress plugin b2-sync scored68%from 54 tests.

About plugin

  • Plugin page: b2-sync
  • Plugin version: 1.2.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7.0-5.8.2
  • WordPress version: 6.3.1
  • First release: Nov 28, 2021
  • Latest release: Dec 5, 2021
  • Number of updates: 18
  • Update frequency: every 0.7 days
  • Top authors: wkhayrattee (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /508 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.47ms] Passed 4 tests

Server-side resources used by b2-sync
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.38 ▲1.01
Dashboard /wp-admin3.33 ▲0.0345.22 ▼4.46
Posts /wp-admin/edit.php3.38 ▲0.0345.39 ▼2.46
Add New Post /wp-admin/post-new.php5.92 ▲0.0397.94 ▼2.24
Media Library /wp-admin/upload.php3.25 ▲0.0334.15 ▼0.72
B2-Sync /wp-admin/admin.php?page=b2-sync-settings-page4.4375.17
B2-Sync LOG /wp-admin/admin.php?page=b2-sync-log-page3.6431.02

Server storage [IO: ▲5.95MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 1,001 new files
Database: no new tables, 7 new options
New WordPress options
b2_sync_plugin_option_name
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by b2-sync
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲7714.60 ▲0.231.82 ▲0.0343.28 ▼0.02
Dashboard /wp-admin2,229 ▲375.85 ▲0.9296.98 ▼9.9640.77 ▼2.31
Posts /wp-admin/edit.php2,112 ▲232.05 ▲0.0541.35 ▲7.5333.55 ▲1.21
Add New Post /wp-admin/post-new.php1,561 ▲2818.68 ▼4.42608.44 ▼43.1754.13 ▼8.35
Media Library /wp-admin/upload.php1,405 ▲144.20 ▼0.0195.30 ▲0.1543.60 ▲0.24
B2-Sync /wp-admin/admin.php?page=b2-sync-settings-page9241.7228.1127.83
B2-Sync LOG /wp-admin/admin.php?page=b2-sync-log-page8452.0222.2430.36

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/b2-sync/uninstall.php+32
    Constant B2Sync_DS already defined
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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 take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/b2-sync/includes/vendor/timber/timber/tests/bootstrap.php
    • > /wp-content/plugins/b2-sync/includes/vendor/timber/timber/tests/assets/my-sidebar.php
  • 480× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\GroupHandler' not found in wp-content/plugins/b2-sync/includes/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/b2-sync/includes/vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Timber_UnitTestCase' not found in wp-content/plugins/b2-sync/includes/vendor/timber/timber/tests/test-timber-router.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig\\Cache\\CacheInterface' not found in wp-content/plugins/b2-sync/includes/vendor/twig/twig/src/Cache/FilesystemCache.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/b2-sync/includes/vendor/composer/installers/src/Composer/Installers/WinterInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\Unary\\AbstractUnary' not found in wp-content/plugins/b2-sync/includes/vendor/twig/twig/src/Node/Expression/Unary/NegUnary.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Monolog\\Processor\\ProcessorInterface' not found in wp-content/plugins/b2-sync/includes/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\TokenParser\\AbstractTokenParser' not found in wp-content/plugins/b2-sync/includes/vendor/twig/twig/src/TokenParser/DeprecatedTokenParser.php:27
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerInterface' not found in wp-content/plugins/b2-sync/includes/vendor/psr/log/Psr/Log/AbstractLogger.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Timber\\Core' not found in wp-content/plugins/b2-sync/includes/vendor/timber/timber/lib/Request.php:12

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

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: backup, backblaze b2, backblaze, sync

b2-sync/b2-sync.php 85% from 13 tests

"b2-sync" version 1.2.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("4.7" instead of "5.7.0")
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin53,436 lines of code in 946 files:
LanguageFilesBlank linesComment linesLines of code
PHP8029,84818,08946,351
Markdown541,56103,970
JSON14001,651
YAML121226552
Bourne Shell35219287
Twig47130229
XML91952191
PO File16886180
SVG20015
reStructuredText18510
CSS11130

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity6.33
▷ Minimum class complexity1.00
▷ Maximum class complexity178.00
Average method complexity2.26
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces57
Interfaces31
Traits5
Classes753
▷ Abstract classes233.05%
▷ Concrete classes73096.95%
▷ Final classes567.67%
Methods3,410
▷ Static methods37210.91%
▷ Public methods2,89284.81%
▷ Protected methods35210.32%
▷ Private methods1664.87%
Functions284
▷ Named functions12945.42%
▷ Anonymous functions15554.58%
Constants190
▷ Global constants1910.00%
▷ Class constants17190.00%
▷ Public constants14886.55%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/vendor/timber/timber/tests/assets/eastern-trans.png12.34KB7.39KB▼ 40.11%
includes/vendor/timber/timber/tests/assets/cropper.png15.74KB0.31KB▼ 98.01%
includes/vendor/timber/timber/tests/assets/flag.png10.33KB4.00KB▼ 61.24%