67% puredevs-customer-history-for-woocommerce

Code Review | PureDevs Customer History for WooCommerce

WordPress plugin PureDevs Customer History for WooCommerce scored67%from 54 tests.

About plugin

  • Plugin page: puredevs-customer...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Jan 23, 2021
  • Latest release: Aug 29, 2023
  • Number of updates: 8
  • Update frequency: every 118.6 days
  • Top authors: puredevs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /876 total downloads

Benchmarks

Plugin footprint 65% 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.48MB] [CPU: ▼6.77ms] Passed 4 tests

A check of server-side resources used by PureDevs Customer History for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.96 ▲0.5035.58 ▼4.23
Dashboard /wp-admin3.80 ▲0.5050.90 ▼0.71
Posts /wp-admin/edit.php3.85 ▲0.5047.30 ▼2.23
Add New Post /wp-admin/post-new.php6.32 ▲0.4385.70 ▼16.60
Media Library /wp-admin/upload.php3.72 ▲0.4937.09 ▼4.00
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius3.9134.69

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 197 new files
Database: no new tables, 12 new options
New WordPress options
widget_theysaidso_widget
fs_active_plugins
can_compress_scripts
db_upgraded
fs_debug_mode
pd-woo-results_per_page
widget_recent-comments
theysaidso_admin_options
pd-woo-hide_users_with_no_orders
widget_recent-posts
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for PureDevs Customer History for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲4614.24 ▼0.131.65 ▼0.3627.49 ▼16.98
Dashboard /wp-admin2,238 ▲615.53 ▼0.1398.38 ▲8.6346.55 ▲3.21
Posts /wp-admin/edit.php2,144 ▲442.12 ▲0.0936.92 ▲0.9432.96 ▼6.91
Add New Post /wp-admin/post-new.php1,553 ▲1023.20 ▲0.02660.66 ▼2.6057.50 ▼0.03
Media Library /wp-admin/upload.php1,443 ▲404.12 ▲0.0398.72 ▼7.1543.86 ▼4.98
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,0861.6929.2331.61

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/puredevs-customer-history-for-woocommerce/includes/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • fs_accounts
    • widget_theysaidso_widget
    • can_compress_scripts
    • fs_gdpr
    • db_upgraded
    • fs_active_plugins
    • widget_recent-posts
    • fs_debug_mode

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/puredevs-customer-history-for-woocommerce/public/partials/pd-customer-history-public-display.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/puredevs-customer-history-for-woocommerce/admin/partials/templates/dashboard/last-orders.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/puredevs-customer-history-for-woocommerce/admin/partials/templates/dashboard/top-customers.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • License uri: Invalid URI found ("http: //www.gnu.org/licenses/gpl-2.0.html")
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
You can take inspiration from this readme.txt

puredevs-customer-history-for-woocommerce/puredevs-customer-history-for-woocommerce.php 85% from 13 tests

"PureDevs Customer History for WooCommerce" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 191 characters long)
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
There were no executable files found in this plugin33,106 lines of code in 152 files:
LanguageFilesBlank linesComment linesLines of code
PHP1267,38316,66831,859
CSS1315113830
JavaScript859102324
XML50093

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 2,911)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity76.43
▷ Minimum class complexity1.00
▷ Maximum class complexity2,911.00
Average method complexity4.55
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes54
▷ Abstract classes23.70%
▷ Concrete classes5296.30%
▷ Final classes00.00%
Methods1,180
▷ Static methods18015.25%
▷ Public methods83370.59%
▷ Protected methods151.27%
▷ Private methods33228.14%
Functions100
▷ Named functions100100.00%
▷ Anonymous functions00.00%
Constants127
▷ Global constants10280.31%
▷ Class constants2519.69%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in 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
includes/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
includes/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
includes/freemius/assets/img/puredevs-customer-history-for-woocommerce.png7.86KB3.61KB▼ 54.04%
includes/freemius/assets/img/puredevs-woo-customer-history.png2.20KB1.02KB▼ 53.77%