84% woo-fortnox-hub

Code Review | WooCommerce Fortnox Hub

WordPress plugin WooCommerce Fortnox Hub scored84%from 54 tests.

About plugin

  • Plugin page: woo-fortnox-hub
  • Plugin version: 5.6.5
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Jun 16, 2019
  • Latest release: Oct 31, 2023
  • Number of updates: 129
  • Update frequency: every 13.5 days
  • Top authors: bjorntech (82.17%)carlericsson (18.6%)

Code review

54 tests

User reviews

5 reviews

Install metrics

200+ active /12,933 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.58MB] [CPU: ▼1.91ms] Passed 4 tests

This is a short check of server-side resources used by WooCommerce Fortnox Hub
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.06 ▲0.5944.80 ▼5.36
Dashboard /wp-admin3.89 ▲0.5853.14 ▲3.22
Posts /wp-admin/edit.php3.94 ▲0.5851.62 ▲6.37
Add New Post /wp-admin/post-new.php6.47 ▲0.5884.77 ▼8.38
Media Library /wp-admin/upload.php3.82 ▲0.5839.16 ▲2.89

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 154 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Fortnox Hub
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲1014.27 ▼0.271.71 ▼0.4142.97 ▼1.13
Dashboard /wp-admin2,196 ▲195.57 ▼0.0785.18 ▼8.9337.22 ▼0.44
Posts /wp-admin/edit.php2,104 ▲42.01 ▲0.0234.83 ▼1.7833.72 ▼1.32
Add New Post /wp-admin/post-new.php1,542 ▲1618.58 ▼4.61650.52 ▼46.6069.94 ▲14.59
Media Library /wp-admin/upload.php1,401 ▼24.19 ▼0.01100.09 ▲2.5340.49 ▲0.22

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Automattic\\Jetpack\\Autoloader\\jp58711d225348eae0a9e8573b7a3a8c8f\\al2_12_0\\wp_normalize_path() in wp-content/plugins/woo-fortnox-hub/vendor/jetpack-autoloader/class-path-processor.php:73
    • > PHP Fatal error
      Uncaught Error: Interface 'Firebase\\JWT\\JWTExceptionWithPayloadInterface' not found in wp-content/plugins/woo-fortnox-hub/vendor/firebase/php-jwt/src/BeforeValidException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Firebase\\JWT\\JWTExceptionWithPayloadInterface' not found in wp-content/plugins/woo-fortnox-hub/vendor/firebase/php-jwt/src/ExpiredException.php:5
    • > PHP Warning
      require_once(wp-content/plugins/woo-fortnox-hub/vendor/automattic/jetpack-autoloader/src/jetpack-autoloader/class-autoloader.php): failed to open stream: No such file or directory in wp-content/plugins/woo-fortnox-hub/vendor/automattic/jetpack-autoloader/src/autoload.php on line 4
    • > PHP Fatal error
      Uncaught Error: Interface 'Composer\\Plugin\\PluginInterface' not found in wp-content/plugins/woo-fortnox-hub/vendor/automattic/jetpack-autoloader/src/CustomAutoloaderPlugin.php:22
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/woo-fortnox-hub/vendor/automattic/jetpack-autoloader/src/jetpack-autoloader/class-autoloader.php' (include_path='.:/usr/share/php') in wp-content/plugins/woo-fortnox-hub/vendor/automattic/jetpack-autoloader/src/autoload.php on line 4

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
10 plugin tags: integration, hub, accounting, paypal, zettle...

woo-fortnox-hub/woo-fortnox-hub.php 85% from 13 tests

Analyzing the main PHP file in "WooCommerce Fortnox Hub" version 5.6.5
Please take the time to fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("4.9" instead of "4.0")
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

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
Success! There were no dangerous files found in this plugin19,426 lines of code in 147 files:
LanguageFilesBlank linesComment linesLines of code
PHP1334,6694,55817,825
Markdown52910813
JavaScript2579409
JSON410258
CSS1203113
XML2008

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity21.45
▷ Minimum class complexity1.00
▷ Maximum class complexity170.00
Average method complexity3.80
▷ Minimum method complexity1.00
▷ Maximum method complexity68.00
Code structure
Namespaces6
Interfaces1
Traits0
Classes122
▷ Abstract classes00.00%
▷ Concrete classes122100.00%
▷ Final classes1713.93%
Methods902
▷ Static methods15617.29%
▷ Public methods80389.02%
▷ Protected methods171.88%
▷ Private methods829.09%
Functions16
▷ Named functions850.00%
▷ Anonymous functions850.00%
Constants35
▷ Global constants1337.14%
▷ Class constants2262.86%
▷ Public constants1359.09%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/BjornTech_logo_small.png84.40KB39.40KB▼ 53.32%