84% persoo-for-woocommerce

Code Review | Persoo for WooCommerce

WordPress plugin Persoo for WooCommerce scored84%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: 6.3.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 /713 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼10.85ms] Passed 4 tests

An overview of server-side resources used by Persoo for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.56 ▼7.77
Dashboard /wp-admin3.31 ▲0.0047.28 ▼5.56
Posts /wp-admin/edit.php3.36 ▲0.0049.57 ▲1.33
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.92 ▼31.38
Media Library /wp-admin/upload.php3.23 ▲0.0037.53 ▲1.31

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts
wc_persoo_settings_security_token
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Persoo for WooCommerce: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.23 ▼0.141.77 ▼0.0944.56 ▲5.49
Dashboard /wp-admin2,195 ▲185.62 ▼0.0389.32 ▲0.2840.10 ▼3.62
Posts /wp-admin/edit.php2,103 ▲62.03 ▲0.0336.31 ▲1.4236.08 ▲1.40
Add New Post /wp-admin/post-new.php1,528 ▲223.29 ▼0.39652.71 ▲31.8960.96 ▲14.30
Media Library /wp-admin/upload.php1,400 ▲34.20 ▼0.10102.12 ▼3.8246.87 ▲2.08

Uninstaller [IO: ▲0.00MB] [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
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • wc_persoo_settings_security_token
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

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
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 9× PHP files trigger server errors when accessed directly:
    • > 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/category.php:3
    • > PHP Notice
      Undefined variable: xmlWriter in wp-content/plugins/persoo-for-woocommerce/includes/feed/product_simple.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 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 startElement() on null in wp-content/plugins/persoo-for-woocommerce/includes/feed/product_simple.php:3
    • > PHP Notice
      Undefined variable: woo in wp-content/plugins/persoo-for-woocommerce/includes/feed/product_variation.php on line 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

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
2 plugin tags: persoo, woocommerce

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

The main file in "Persoo for WooCommerce" v. 1.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 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
No dangerous file extensions were detected1,175 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP122671621,115
JavaScript216260

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
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
PNG images were not found in this plugin