68% intrackt-companion-products

Code Review | Intrackt Companion Products

WordPress plugin Intrackt Companion Products scored 68% from 54 tests.

About plugin

  • Plugin page: intrackt-companio...
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3.2-5.8
  • WordPress version: 5.8.1
  • First release: Sep 22, 2020
  • Latest release: Jul 14, 2021
  • Number of updates: 6
  • Update frequency: every 49.2 days
  • Top authors: intrackt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 220 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.25MB] [CPU: ▼181.05ms] Passed 4 tests

Analyzing server-side resources used by Intrackt Companion Products
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.97 ▲0.1417.73 ▼4.77
Dashboard /wp-admin3.39 ▲0.3332.52 ▼5.52
Posts /wp-admin/edit.php3.44 ▲0.3331.04 ▼1.81
Add New Post /wp-admin/post-new.php5.69 ▲0.2569.01 ▼712.10
Media Library /wp-admin/upload.php3.27 ▲0.2724.08 ▼0.02
Companion Products /wp-admin/admin.php?page=intracktcompanionproducts-main3.2220.38
Intrackt /wp-admin/admin.php?page=intrackt-common3.2420.37
--Log /wp-admin/admin.php?page=intracktcompanionproducts-log3.2426.25

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 8 new files
Database: 1 new table, 2 new options
New tables
wp_intrackt_log
New WordPress options
intrackt_companionproducts
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

An overview of browser requirements for Intrackt Companion Products
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,253 ▼34815.70 ▼0.380.35 ▼4.7816.09 ▼58.79
Dashboard /wp-admin2,967 ▲746.14 ▼0.01115.94 ▼16.69164.90 ▼8.21
Posts /wp-admin/edit.php2,771 ▲313.25 ▲0.0264.35 ▲1.53138.72 ▲7.97
Add New Post /wp-admin/post-new.php3,829 ▲2218.57 ▲0.14419.99 ▼14.89159.69 ▼0.08
Media Library /wp-admin/upload.php1,784 ▲325.55 ▲0.06143.60 ▼2.92193.71 ▲3.55
Companion Products /wp-admin/admin.php?page=intracktcompanionproducts-main1,0122.1638.12108.60
Intrackt /wp-admin/admin.php?page=intrackt-common1,0382.4154.37100.40
--Log /wp-admin/admin.php?page=intracktcompanionproducts-log1,0582.3352.73107.98

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie tables detected upon uninstall: 1 table
    • wp_intrackt_log
  • Zombie WordPress options detected upon uninstall: 2 options
    • recovery_mode_email_last_sent
    • intrackt_companionproducts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=intracktcompanionproducts-main
    • > Notice in wp-content/plugins/intrackt-companion-products/class.Intrackt-Companion-Products-PageMain.php+145
    Trying to get property 'parent' of non-object
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=intracktcompanionproducts-main
    • > Notice in wp-content/plugins/intrackt-companion-products/class.Intrackt-Companion-Products-PageMain.php+154
    Trying to get property 'name' of non-object
    • > GET request to /wp-admin/admin.php?page=intracktcompanionproducts-main
    • > Notice in wp-content/plugins/intrackt-companion-products/class.Intrackt-Companion-Products-PageMain.php+150
    Trying to get property 'slug' of non-object
    • > GET request to /wp-admin/admin.php?page=intracktcompanionproducts-main
    • > Notice in wp-content/plugins/intrackt-companion-products/class.Intrackt-Companion-Products-PageMain.php+157
    Trying to get property 'term_id' of non-object
    • > GET request to /wp-admin/admin.php?page=intracktcompanionproducts-main
    • > Error in wp-content/plugins/intrackt-companion-products/class.Intrackt-Companion-Products-PageMain.php+160
    Uncaught Error: Cannot use object of type WP_Error as array in wp-content/plugins/intrackt-companion-products/class.Intrackt-Companion-Products-PageMain.php:160
    Stack trace:
    #0 wp-content/plugins/intrackt-companion-products/class.Intrackt-Companion-Products-PageMain.php(192): Intrackt\CompanionProducts\PageMain::buildHierachy()
    #1 wp-admin/includes/template.php(1743): Intrackt\CompanionProducts\PageMain::optionsCompanionCategory()
    #2 wp-admin/includes/template.php(1701): do_settings_fields()
    #3 wp-content/plugins/intrackt-companion-products/class.Intrackt-Companion-Products-PageMain.php(272): do_settings_sections()
    #4 wp-includes/class-wp-hook.php(303): Intrackt\CompanionProducts\PageMain::displayPage()
    #5 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #6 wp-includes/plugin.php(470): WP_Hook->do_action()
    #7 wp-admin/admin.php(2

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 13× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      require_once(INTRACKT_COMPANIONPRODUCTS_PLUGIN_DIRclass.Intrackt-Companion-Products-PageLog.php): failed to open stream: No such file or directory in wp-content/plugins/intrackt-companion-products/class.Intrackt-Companion-Products-Common.php on line 7
    • > PHP Warning
      Use of undefined constant INTRACKT_COMPANIONPRODUCTS_PLUGIN_DIR - assumed 'INTRACKT_COMPANIONPRODUCTS_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/intrackt-companion-products/class.Intrackt-Companion-Products-Manager.php on line 7
    • > PHP Fatal error
      require_once(): Failed opening required 'INTRACKT_COMPANIONPRODUCTS_PLUGIN_DIRclass.Intrackt-Companion-Products-PageLog.php' (include_path='.:/usr/share/php') in wp-content/plugins/intrackt-companion-products/class.Intrackt-Companion-Products-Actions.php on line 7
    • > PHP Warning
      require_once(INTRACKT_COMPANIONPRODUCTS_PLUGIN_DIRclass.Intrackt-Companion-Products-PageLog.php): failed to open stream: No such file or directory in wp-content/plugins/intrackt-companion-products/class.Intrackt-Companion-Products-Actions.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/intrackt-companion-products/Intrackt-Companion-Products.php:28
    • > PHP Fatal error
      require_once(): Failed opening required 'INTRACKT_COMPANIONPRODUCTS_PLUGIN_DIRclass.Intrackt-Companion-Products-PageMain.php' (include_path='.:/usr/share/php') in wp-content/plugins/intrackt-companion-products/class.Intrackt-Companion-Products-Manager.php on line 7
    • > PHP Warning
      Use of undefined constant INTRACKT_COMPANIONPRODUCTS_PLUGIN_DIR - assumed 'INTRACKT_COMPANIONPRODUCTS_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/intrackt-companion-products/class.Intrackt-Companion-Products-Actions.php on line 7
    • > PHP Warning
      require_once(INTRACKT_COMPANIONPRODUCTS_PLUGIN_DIRclass.Intrackt-Companion-Products-PageMain.php): failed to open stream: No such file or directory in wp-content/plugins/intrackt-companion-products/class.Intrackt-Companion-Products-Manager.php on line 7
    • > PHP Fatal error
      require_once(): Failed opening required 'INTRACKT_COMPANIONPRODUCTS_PLUGIN_DIRclass.Intrackt-Companion-Products-PageLog.php' (include_path='.:/usr/share/php') in wp-content/plugins/intrackt-companion-products/class.Intrackt-Companion-Products-PageMain.php on line 7
    • > PHP Warning
      Use of undefined constant INTRACKT_COMPANIONPRODUCTS_PLUGIN_DIR - assumed 'INTRACKT_COMPANIONPRODUCTS_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/intrackt-companion-products/class.Intrackt-Companion-Products-PageMain.php on line 7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 14 tag instead of maximum 10
Please take inspiration from this readme.txt

intrackt-companion-products/Intrackt-Companion-Products.php 85% from 13 tests

The main PHP script in "Intrackt Companion Products" version 1.0.2 is automatically included on every request by 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 ("intrackt-companion-products.php" instead of "Intrackt-Companion-Products.php")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin1,009 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP65041,0691,009

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity27.80
▷ Minimum class complexity5.00
▷ Maximum class complexity91.00
Average method complexity3.23
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods60
▷ Static methods60100.00%
▷ Public methods5388.33%
▷ Protected methods00.00%
▷ Private methods711.67%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
There are no PNG files in this plugin