84% persoo-for-woocommerce

Code Review | Persoo for WooCommerce

WordPress plugin Persoo for WooCommerce scored 84% from 54 tests.

About plugin

  • Plugin page: persoo-for-woocom...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.8
  • WordPress version: 5.8.1
  • First release: Jul 11, 2017
  • Latest release: Jul 25, 2017
  • Number of updates: 6
  • Update frequency: every 3.5 days
  • Top authors: vyskoczilova (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 559 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.00MB] [CPU: ▼139.98ms] Passed 4 tests

A check of server-side resources used by Persoo for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0029.18 ▲7.28
Dashboard /wp-admin3.06 ▼0.0031.74 ▼4.87
Posts /wp-admin/edit.php3.11 ▲0.0033.46 ▲2.55
Add New Post /wp-admin/post-new.php5.42 ▼0.0268.90 ▼558.05
Media Library /wp-admin/upload.php3.00 ▲0.0022.87 ▲0.46

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 16 new files
Database: no new tables, 1 new option
New WordPress options
wc_persoo_settings_security_token

Browser metrics Passed 4 tests

A check of browser resources used by Persoo for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,666 ▲6515.67 ▲0.365.16 ▼1.0975.01 ▼1.87
Dashboard /wp-admin2,930 ▲346.05 ▼0.14119.04 ▼9.10166.84 ▼6.72
Posts /wp-admin/edit.php2,740 ▼03.23 ▼0.0165.10 ▲1.03142.00 ▲1.08
Add New Post /wp-admin/post-new.php3,815 ▲119.31 ▲0.10462.06 ▼26.06156.24 ▼17.09
Media Library /wp-admin/upload.php1,752 ▼05.50 ▼0.02158.61 ▲19.46190.64 ▲7.36

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • wc_persoo_settings_security_token

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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: xmlWriter in wp-content/plugins/persoo-for-woocommerce/includes/feed/product_simple.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to a member function id() on null in wp-content/plugins/persoo-for-woocommerce/includes/feed/master_id.php:3
    • > PHP Notice
      Undefined variable: woo in wp-content/plugins/persoo-for-woocommerce/includes/feed/master_id.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to a member function startElement() on null in wp-content/plugins/persoo-for-woocommerce/includes/feed/product_simple.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_get_product() in wp-content/plugins/persoo-for-woocommerce/includes/feed/product_id.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function id_variation() on null in wp-content/plugins/persoo-for-woocommerce/includes/feed/product_variation.php:3
    • > PHP Notice
      Undefined variable: woo in wp-content/plugins/persoo-for-woocommerce/includes/feed/product_variation.php on line 3
    • > PHP Notice
      Undefined variable: xmlWriter in wp-content/plugins/persoo-for-woocommerce/includes/feed/category.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to a member function startElement() on null in wp-content/plugins/persoo-for-woocommerce/includes/feed/category.php:3

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 96% 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
2 plugin tags: woocommerce, persoo

persoo-for-woocommerce/persoo-for-woocommerce.php 92% from 13 tests

The main PHP script in "Persoo for WooCommerce" version 1.0.2 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 174 characters long)

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 plugin1,175 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP122671621,115
JavaScript216260

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.35
Average class complexity13.50
▷ Minimum class complexity2.00
▷ Maximum class complexity35.00
Average method complexity3.03
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods37
▷ Static methods00.00%
▷ Public methods3491.89%
▷ Protected methods00.00%
▷ Private methods38.11%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
No PNG images were found in this plugin