93% plytix-for-woocommerce

Code Review | Plytix Analytics for WooCommerce

WordPress plugin Plytix Analytics for WooCommerce scored 93% from 54 tests.

About plugin

  • Plugin page: plytix-for-woocom...
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1.0-5.2.2
  • WordPress version: 5.8.1
  • First release: Dec 1, 2015
  • Latest release: Aug 26, 2019
  • Number of updates: 99
  • Update frequency: every 13.8 days
  • Top authors: Plytix (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,391 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

This is a short check of server-side resources used by Plytix Analytics for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.83 ▲0.0036.79 ▲0.87
Dashboard /wp-admin3.06 ▲0.0042.02 ▲4.82
Posts /wp-admin/edit.php3.11 ▲0.0049.39 ▲6.52
Add New Post /wp-admin/post-new.php5.42 ▼0.0286.05 ▼553.69
Media Library /wp-admin/upload.php3.00 ▲0.0033.15 ▼6.30

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 35 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Plytix Analytics for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10715.97 ▲0.3810.98 ▲0.3546.83 ▲0.37
Dashboard /wp-admin2,967 ▲366.08 ▲0.09140.53 ▼10.30109.90 ▲4.94
Posts /wp-admin/edit.php2,739 ▼02.71 ▼0.0164.13 ▼6.0689.68 ▲5.73
Add New Post /wp-admin/post-new.php1,683 ▼016.18 ▼2.58404.94 ▼4.97109.28 ▼4.32
Media Library /wp-admin/upload.php1,807 ▲34.99 ▼0.07167.54 ▲12.38105.93 ▼14.11

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

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
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/image.php): failed to open stream: No such file or directory in wp-content/plugins/plytix-for-woocommerce/admin/includes/class-plytix-admin-functions.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/image.php' (include_path='.:/usr/share/php') in wp-content/plugins/plytix-for-woocommerce/admin/includes/class-plytix-admin-functions.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_transient() in wp-content/plugins/plytix-for-woocommerce/admin/partials/plytix-admin-api-settings.php:23
    • > PHP Warning
      Use of undefined constant PLYTIX_PLUGIN_ADMIN - assumed 'PLYTIX_PLUGIN_ADMIN' (this will throw an Error in a future version of PHP) in wp-content/plugins/plytix-for-woocommerce/admin/class-plytix-admin.php on line 2
    • > PHP Warning
      include_once(PLYTIX_PLUGIN_PUBLIC/includes/class-plytix-integration.php): failed to open stream: No such file or directory in wp-content/plugins/plytix-for-woocommerce/public/class-plytix-public.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_transient() in wp-content/plugins/plytix-for-woocommerce/admin/partials/plytix-admin-site-settings.php:19
    • > PHP Warning
      include_once(): Failed opening 'PLYTIX_PLUGIN_PUBLIC/includes/class-plytix-integration.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/plytix-for-woocommerce/public/class-plytix-public.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'PLYTIX_PLUGIN_ADMIN/includes/class-plytix-admin-functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/plytix-for-woocommerce/admin/class-plytix-admin.php on line 2
    • > PHP Warning
      require_once(PLYTIX_PLUGIN_ADMIN/includes/class-plytix-admin-functions.php): failed to open stream: No such file or directory in wp-content/plugins/plytix-for-woocommerce/admin/class-plytix-admin.php on line 2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/plytix-for-woocommerce/admin/includes/class-plytix-admin-functions.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
8 plugin tags: product analytics, analytics, retail, woocommerce, plytix...

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

The primary PHP file in "Plytix Analytics for WooCommerce" version 1.0.2 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("plytix-for-woocommerce.php" instead of "plytix.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected1,152 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP13197569902
CSS24313242
JavaScript24108

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity7.38
▷ Minimum class complexity1.00
▷ Maximum class complexity36.00
Average method complexity2.09
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods47
▷ Static methods24.26%
▷ Public methods4187.23%
▷ Protected methods00.00%
▷ Private methods612.77%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants15
▷ Global constants640.00%
▷ Class constants960.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/plytix_icon.png1.28KB0.55KB▼ 56.75%
admin/images/plytix_logo.png8.06KB4.52KB▼ 43.94%