72% zsquared-connector-for-zoho-inventory

Code Review | ZSquared Connector for Zoho Inventory

WordPress plugin ZSquared Connector for Zoho Inventory scored 72% from 54 tests.

About plugin

  • Plugin page: zsquared-connecto...
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.6
  • WordPress version: 6.3.1
  • First release: May 11, 2020
  • Latest release: May 7, 2021
  • Number of updates: 17
  • Update frequency: every 21.4 days
  • Top authors: pcis (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 663 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.21MB] [CPU: ▲1.16ms] Passed 4 tests

Analyzing server-side resources used by ZSquared Connector for Zoho Inventory
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2246.26 ▲2.61
Dashboard /wp-admin3.50 ▲0.2050.16 ▼1.39
Posts /wp-admin/edit.php3.62 ▲0.2651.38 ▲2.45
Add New Post /wp-admin/post-new.php6.08 ▲0.2092.48 ▲0.96
Media Library /wp-admin/upload.php3.43 ▲0.2038.86 ▲5.14

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

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

Browser metrics Passed 4 tests

A check of browser resources used by ZSquared Connector for Zoho Inventory
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲8613.67 ▼1.082.48 ▲0.4754.33 ▲3.02
Dashboard /wp-admin2,224 ▲395.80 ▲0.9096.80 ▼43.5141.39 ▼15.57
Posts /wp-admin/edit.php2,109 ▲232.05 ▼0.0033.34 ▼2.9536.49 ▲3.72
Add New Post /wp-admin/post-new.php1,534 ▲1517.65 ▼5.53686.69 ▲12.5456.21 ▼17.20
Media Library /wp-admin/upload.php1,406 ▲244.17 ▼0.0199.44 ▼2.2042.63 ▼5.78
ZSquared Connector to Zoho Inventory /wp-admin/zsq_inv.php260.440.0914.89

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_recent-comments
    • widget_recent-posts
    • zsq_inv_daily_sync_price
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • zsq_inv_daily_sync_qty
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
The following issues need your attention
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/zsquared-connector-for-zoho-inventory/templates/activation_notice.php
    • > /wp-content/plugins/zsquared-connector-for-zoho-inventory/templates/missing_api_key.php
    • > /wp-content/plugins/zsquared-connector-for-zoho-inventory/templates/scripts.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant ZSQ_INV_APP_HOME - assumed 'ZSQ_INV_APP_HOME' (this will throw an Error in a future version of PHP) in wp-content/plugins/zsquared-connector-for-zoho-inventory/templates/missing_api_key.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/zsquared-connector-for-zoho-inventory/templates/options.php:35
    • > PHP Warning
      Use of undefined constant ZSQ_INV_PLUGIN_ASSETS - assumed 'ZSQ_INV_PLUGIN_ASSETS' (this will throw an Error in a future version of PHP) in wp-content/plugins/zsquared-connector-for-zoho-inventory/templates/options.php on line 8

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/zsq_inv.php
    • > Network (severe)
    wp-admin/zsq_inv.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: inventory, ecommerce, woocommerce, zoho

zsquared-connector-for-zoho-inventory/zsq-connector-inventory.php 92% from 13 tests

The main file in "ZSquared Connector for Zoho Inventory" v. 1.0.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
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 ("zsquared-connector-for-zoho-inventory.php" instead of "zsq-connector-inventory.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected1,278 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP1086231,058
CSS14316220

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity35.25
▷ Minimum class complexity11.00
▷ Maximum class complexity72.00
Average method complexity4.91
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods35
▷ Static methods38.57%
▷ Public methods2262.86%
▷ Protected methods00.00%
▷ Private methods1337.14%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/z-squared-logo.png11.21KB5.53KB▼ 50.68%