78% briqpay-fortnox-product-sync

Code Review | Briqpay Fortnox Product Sync

WordPress plugin Briqpay Fortnox Product Sync scored 78% from 54 tests.

About plugin

  • Plugin page: briqpay-fortnox-p...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.8
  • WordPress version: 6.3.1
  • First release: Aug 13, 2021
  • Latest release: Aug 13, 2021
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: briqpaymattias (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,775 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.09MB] [CPU: ▼2.22ms] Passed 4 tests

An overview of server-side resources used by Briqpay Fortnox Product Sync
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0947.41 ▲2.82
Dashboard /wp-admin3.39 ▲0.0854.11 ▼3.58
Posts /wp-admin/edit.php3.51 ▲0.1552.72 ▼2.04
Add New Post /wp-admin/post-new.php5.99 ▲0.1091.09 ▼6.07
Media Library /wp-admin/upload.php3.32 ▲0.0839.31 ▲5.71
Briqpay Fortnox Product Sync /wp-admin/tools.php?page=briqpay_fortnox_sync3.2733.50

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 22 new files
Database: no new tables, 7 new options
New WordPress options
recovery_mode_email_last_sent
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Briqpay Fortnox Product Sync
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,891 ▲10213.95 ▲0.795.46 ▲3.6042.16 ▼3.45
Dashboard /wp-admin2,214 ▲54.82 ▼1.06111.74 ▲10.5040.92 ▼5.57
Posts /wp-admin/edit.php2,097 ▲52.01 ▼0.0339.59 ▲3.2835.47 ▲4.22
Add New Post /wp-admin/post-new.php1,524 ▲1017.66 ▲0.20654.79 ▲53.9253.79 ▲8.67
Media Library /wp-admin/upload.php1,390 ▼14.21 ▲0.0294.94 ▼8.1641.20 ▼1.17
Briqpay Fortnox Product Sync /wp-admin/tools.php?page=briqpay_fortnox_sync6831.536.8317.18

Uninstaller [IO: ✅] [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
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/tools.php?page=briqpay_fortnox_sync
    • > Error in wp-content/plugins/briqpay-fortnox-product-sync/admin/class-briqpay_fortnox_product_sync-admin.php+262
    Uncaught Error: Class 'WC_Product_Query' not found in wp-content/plugins/briqpay-fortnox-product-sync/admin/class-briqpay_fortnox_product_sync-admin.php:262
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): Briqpay_fortnox_product_sync_Admin->render_fortnox_sync_page()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 wp-admin/tools.php(40): require_once('/var/www/wordpr...')
    #5 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/briqpay-fortnox-product-sync/public/partials/briqpay_fortnox_product_sync-public-display.php
    • > /wp-content/plugins/briqpay-fortnox-product-sync/admin/partials/briqpay_fortnox_product_sync-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
8 plugin tags: fortnox, b2b, producs, business2business, briqpay...

briqpay-fortnox-product-sync/briqpay_fortnox_product_sync.php 85% from 13 tests

The entry point to "Briqpay Fortnox Product Sync" version 1.0.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Main file name: Name the main plugin file the same as the plugin slug ("briqpay-fortnox-product-sync.php" instead of "briqpay_fortnox_product_sync.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
Good job! No executable or dangerous file extensions detected448 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12136537442
JavaScript24546
CSS2080

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity5.86
▷ Minimum class complexity1.00
▷ Maximum class complexity32.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods33
▷ Static methods26.06%
▷ Public methods2884.85%
▷ Protected methods00.00%
▷ Private methods515.15%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin