73% fin-accounting-for-woocommerce

Code Review | Finpose - Accounting for WooCommerce

WordPress plugin Finpose - Accounting for WooCommerce scored73%from 54 tests.

About plugin

  • Plugin page: fin-accounting-fo...
  • Plugin version: 4.5.2
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-5.8
  • WordPress version: 6.3.1
  • First release: Jul 21, 2021
  • Latest release: Jun 9, 2022
  • Number of updates: 30
  • Update frequency: every 10.8 days
  • Top authors: blueorange589 (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

400+ active /3,284 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲4.95MB] [CPU: ▲18.16ms] Passed 4 tests

This is a short check of server-side resources used by Finpose - Accounting for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /8.78 ▲5.3260.40 ▲17.07
Dashboard /wp-admin8.80 ▲5.4966.88 ▲19.61
Posts /wp-admin/edit.php8.80 ▲5.4472.51 ▲8.97
Add New Post /wp-admin/post-new.php9.43 ▲3.54120.78 ▲28.62
Media Library /wp-admin/upload.php8.80 ▲5.5760.36 ▲26.98
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius8.8061.23

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 352 new files
Database: no new tables, 10 new options
New WordPress options
fs_gdpr
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
fs_debug_mode
widget_recent-posts
fs_accounts
can_compress_scripts
fs_active_plugins
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Finpose - Accounting for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲10613.18 ▼1.171.72 ▲0.1028.72 ▼10.98
Dashboard /wp-admin2,250 ▲624.88 ▲0.00109.51 ▲1.9743.69 ▲3.92
Posts /wp-admin/edit.php2,133 ▲412.01 ▼0.0442.15 ▲6.1939.95 ▲8.95
Add New Post /wp-admin/post-new.php1,540 ▲2022.95 ▼0.16649.93 ▼40.9758.67 ▲6.18
Media Library /wp-admin/upload.php1,426 ▲384.22 ▲0.0297.33 ▼13.6546.16 ▲4.42
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,0851.8424.0227.10

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/fin-accounting-for-woocommerce/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 10 options in the database
    • fs_gdpr
    • fs_debug_mode
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • fs_accounts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • fs_active_plugins

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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 items
  • 26× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/fin-accounting-for-woocommerce/admin/views/dashboard.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/fin-accounting-for-woocommerce/admin/views/settings.php:8
    • > PHP Warning
      Use of undefined constant FINPOSE_WPADMIN_URL - assumed 'FINPOSE_WPADMIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/fin-accounting-for-woocommerce/admin/views/vendors.php on line 6
    • > PHP Warning
      Use of undefined constant FINPOSE_WPADMIN_URL - assumed 'FINPOSE_WPADMIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/fin-accounting-for-woocommerce/admin/views/accounts.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/fin-accounting-for-woocommerce/admin/views/accounts.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'fin_app' not found in wp-content/plugins/fin-accounting-for-woocommerce/classes/taxes.class.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/fin-accounting-for-woocommerce/admin/views/spendings.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'fin_app' not found in wp-content/plugins/fin-accounting-for-woocommerce/classes/vendors.class.php:12
    • > PHP Warning
      Use of undefined constant FINPOSE_WPADMIN_URL - assumed 'FINPOSE_WPADMIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/fin-accounting-for-woocommerce/admin/views/inventory.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/fin-accounting-for-woocommerce/admin/views/vendors.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
9 plugin tags: cogs, accounting, profit, cost, report...

fin-accounting-for-woocommerce/finpose.php 77% from 13 tests

The main PHP script in "Finpose - Accounting for WooCommerce" version 4.5.2 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("fin-accounting-for-woocommerce.php" instead of "finpose.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0" instead of "4.0.0")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis 97% from 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 plugin72,054 lines of code in 241 files:
LanguageFilesBlank linesComment linesLines of code
PHP1367,90616,79037,879
PO File439,29911,56719,876
JavaScript221,3241,68211,539
SVG220161,314
CSS15213271,167
Markdown2790252
JSON10027

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
These items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity72.95
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity4.65
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes63
▷ Abstract classes23.17%
▷ Concrete classes6196.83%
▷ Final classes00.00%
Methods1,272
▷ Static methods18114.23%
▷ Public methods89770.52%
▷ Protected methods151.18%
▷ Private methods36028.30%
Functions105
▷ Named functions10499.05%
▷ Anonymous functions10.95%
Constants131
▷ Global constants10680.92%
▷ Class constants2519.08%
▷ Public constants25100.00%

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
4 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/lib/jqueryui/images/ui-icons_555555_256x240.png3.68KB4.18KB0.00%
assets/lib/jqueryui/images/ui-icons_444444_256x240.png3.68KB4.18KB0.00%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%