84% tracking-customers-and-product-recommendations

Code Review | Tracking customers and product recommendations

WordPress plugin Tracking customers and product recommendations scored84%from 54 tests.

About plugin

  • Plugin page: tracking-customer...
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.7
  • WordPress version: 6.3.1
  • First release: Apr 13, 2021
  • Latest release: Apr 13, 2021
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: banam8910 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /298 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: ▼3.01ms] Passed 4 tests

Analyzing server-side resources used by Tracking customers and product recommendations
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0038.53 ▲2.64
Dashboard /wp-admin3.31 ▲0.0143.73 ▼3.41
Posts /wp-admin/edit.php3.36 ▲0.0047.51 ▼5.55
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.23 ▼4.28
Media Library /wp-admin/upload.php3.24 ▲0.0032.65 ▲1.21

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Tracking customers and product recommendations
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.36 ▼1.011.91 ▲0.2141.05 ▲0.78
Dashboard /wp-admin2,209 ▲204.91 ▲0.01100.33 ▼22.4236.32 ▼9.42
Posts /wp-admin/edit.php2,089 ▼02.04 ▼0.0138.99 ▼2.2634.65 ▼1.40
Add New Post /wp-admin/post-new.php1,533 ▲1423.15 ▲0.16643.58 ▲3.3258.26 ▲1.53
Media Library /wp-admin/upload.php1,385 ▼64.30 ▲0.1297.14 ▼2.4443.15 ▲0.82

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tracking-customers-and-product-recommendations/functions.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/tracking-customers-and-product-recommendations/includes/shortcodes/shortcode-product-recommendations.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tracking-customers-and-product-recommendations/includes/core/nl2a.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/tracking-customers-and-product-recommendations/admin/settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/tracking-customers-and-product-recommendations/index.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/tracking-customers-and-product-recommendations/includes/widgets/widget-products-viewed.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/tracking-customers-and-product-recommendations/includes/widgets/widget-product-recommendations.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/tracking-customers-and-product-recommendations/admin/tables.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/tracking-customers-and-product-recommendations/includes/shortcodes/shortcode-products-viewed.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: recommendations, product recommendations, tracking customers, tracking customer

tracking-customers-and-product-recommendations/index.php 92% from 13 tests

"Tracking customers and product recommendations" version 1.0'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:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("tracking-customers-and-product-recommendations.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin14,142 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript82,72576211,945
PHP9111101,476
CSS4560459
PO File2106114262

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity26.67
▷ Minimum class complexity7.00
▷ Maximum class complexity63.00
Average method complexity5.97
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods31
▷ Static methods1032.26%
▷ Public methods31100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
6 PNG files occupy 0.43MB with 0.26MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-6.png244.18KB84.08KB▼ 65.57%
assets/screenshot-4.png12.17KB5.25KB▼ 56.85%
assets/screenshot-5.png16.09KB6.42KB▼ 60.12%
assets/screenshot-1.png51.47KB19.68KB▼ 61.76%
assets/screenshot-2.png19.75KB7.52KB▼ 61.93%