83% pureclarity-for-woocommerce

Code Review | PureClarity - award-winning ecommerce personalisation for WooCommerce

WordPress plugin PureClarity - award-winning ecommerce personalisation for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: pureclarity-for-w...
  • Plugin version: 3.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.7.1
  • WordPress version: 6.3.1
  • First release: Jan 22, 2019
  • Latest release: Jul 29, 2021
  • Number of updates: 59
  • Update frequency: every 15.6 days
  • Top authors: pureclaritytechnologies (100%)

Code review

54 tests

User reviews

1 review

Install metrics

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

Server metrics [RAM: ▼0.01MB] [CPU: ▼4.66ms] Passed 4 tests

This is a short check of server-side resources used by PureClarity - award-winning ecommerce personalisation for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.52 ▼6.92
Dashboard /wp-admin3.31 ▼0.0352.43 ▼14.33
Posts /wp-admin/edit.php3.36 ▲0.0049.81 ▲1.15
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.42 ▲1.45
Media Library /wp-admin/upload.php3.23 ▲0.0041.82 ▲6.62

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 142 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by PureClarity - award-winning ecommerce personalisation for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲8313.29 ▼1.291.74 ▼0.1443.91 ▼4.71
Dashboard /wp-admin2,224 ▲215.03 ▲0.10113.58 ▲1.2343.12 ▲0.42
Posts /wp-admin/edit.php2,106 ▲32.04 ▲0.0338.94 ▲0.1934.81 ▼1.72
Add New Post /wp-admin/post-new.php1,599 ▲5422.47 ▼0.86673.86 ▲39.5049.08 ▼3.08
Media Library /wp-admin/upload.php1,400 ▼04.18 ▼0.12103.36 ▼2.9944.07 ▼1.16

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
Please fix the following items
  • 47× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Mockery\\Adapter\\Phpunit\\MockeryTestCase' not found in wp-content/plugins/pureclarity-for-woocommerce/includes/php-sdk/tests/unit/PureClarity/Api/Signup/StatusTest.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/pureclarity-for-woocommerce/includes/admin/views/settings-page.php:14
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/pureclarity-for-woocommerce/includes/admin/views/dashboard-page.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Mockery\\Adapter\\Phpunit\\MockeryTestCase' not found in wp-content/plugins/pureclarity-for-woocommerce/includes/php-sdk/tests/unit/PureClarity/Api/Feed/TransferTest.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/pureclarity-for-woocommerce/includes/admin/views/dashboard/feeds.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Mockery\\Adapter\\Phpunit\\MockeryTestCase' not found in wp-content/plugins/pureclarity-for-woocommerce/includes/php-sdk/tests/unit/PureClarity/Api/Feed/Type/UserTest.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/pureclarity-for-woocommerce/includes/admin/views/dashboard/stats.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Mockery\\Adapter\\Phpunit\\MockeryTestCase' not found in wp-content/plugins/pureclarity-for-woocommerce/includes/php-sdk/tests/unit/PureClarity/Api/Signup/Status/ProcessorTest.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Mockery\\Adapter\\Phpunit\\MockeryTestCase' not found in wp-content/plugins/pureclarity-for-woocommerce/includes/php-sdk/tests/unit/PureClarity/Api/Signup/SubmitTest.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'PureClarity\\Api\\Feed\\Feed' not found in wp-content/plugins/pureclarity-for-woocommerce/includes/php-sdk/src/PureClarity/Api/Feed/Type/Order.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
The official readme.txt is a good inspiration

pureclarity-for-woocommerce/pureclarity.php 77% from 13 tests

The main PHP script in "PureClarity - award-winning ecommerce personalisation for WooCommerce" version 3.3.1 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 207 characters long)
  • 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
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("pureclarity-for-woocommerce.php" instead of "pureclarity.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected13,015 lines of code in 119 files:
LanguageFilesBlank linesComment linesLines of code
PHP1052,3375,29711,243
CSS6223321,177
JavaScript56325528
JSON10030
XML15024
SVG11013

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity8.56
▷ Minimum class complexity1.00
▷ Maximum class complexity93.00
Average method complexity1.98
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces32
Interfaces0
Traits0
Classes91
▷ Abstract classes22.20%
▷ Concrete classes8997.80%
▷ Final classes00.00%
Methods705
▷ Static methods20.28%
▷ Public methods50371.35%
▷ Protected methods456.38%
▷ Private methods15722.27%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.00%
Constants120
▷ Global constants75.83%
▷ Class constants11394.17%
▷ Public constants113100.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
4 compressed PNG files occupy 0.01MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/images/support.png1.64KB1.54KB▼ 5.97%
admin/css/images/settings.png1.10KB0.93KB▼ 15.49%
admin/images/logo.png5.47KB5.46KB0.25%
admin/css/images/documentation.png0.56KB0.51KB▼ 9.25%