78% woo-graphql-api

Code Review | Shopz GraphQL API for WooCommerce

WordPress plugin Shopz GraphQL API for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: woo-graphql-api
  • Plugin version: 2.1.5
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.0-5.6
  • WordPress version: 6.3.1
  • First release: Jul 3, 2018
  • Latest release: May 17, 2021
  • Number of updates: 133
  • Update frequency: every 7.9 days
  • Top authors: yasiend (74.44%)shopzio (26.32%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /10,611 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by Shopz GraphQL API for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0045.09 ▲1.33
Dashboard /wp-admin3.31 ▲0.0045.68 ▼4.14
Posts /wp-admin/edit.php3.36 ▲0.0049.79 ▼3.26
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.87 ▼21.94
Media Library /wp-admin/upload.php3.23 ▲0.0035.42 ▼0.81

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 2,470 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Shopz GraphQL API for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.20 ▼1.072.23 ▲0.4143.54 ▼2.10
Dashboard /wp-admin2,203 ▲185.80 ▼0.0994.52 ▼8.0338.53 ▼0.88
Posts /wp-admin/edit.php2,089 ▼32.04 ▲0.0439.86 ▼3.5936.76 ▼1.14
Add New Post /wp-admin/post-new.php1,535 ▼922.98 ▲4.78631.94 ▼7.3179.44 ▲28.79
Media Library /wp-admin/upload.php1,388 ▲94.25 ▲0.0095.03 ▼5.3642.85 ▼0.61

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

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
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/woo-graphql-api/wc-graphql.php
    • > /wp-content/plugins/woo-graphql-api/vendor/automattic/woocommerce/tests/bootstrap.php
  • 2195× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'GraphQL\\Executor\\Promise\\PromiseAdapter' not found in wp-content/plugins/woo-graphql-api/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromiseAdapter.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'WCGQL\\Mobile\\Providers\\MobileDriver' not found in wp-content/plugins/woo-graphql-api/includes/Mobile/Providers/Mobily.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Exceptions\\TwilioException' not found in wp-content/plugins/woo-graphql-api/vendor/twilio/sdk/src/Twilio/Exceptions/ConfigurationException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\InstanceResource' not found in wp-content/plugins/woo-graphql-api/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthInstance.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Options' not found in wp-content/plugins/woo-graphql-api/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationOptions.php:85
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Options' not found in wp-content/plugins/woo-graphql-api/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressOptions.php:59
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\ListResource' not found in wp-content/plugins/woo-graphql-api/vendor/twilio/sdk/src/Twilio/Rest/Chat/V1/Service/UserList.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'GraphQL\\Type\\Definition\\ScalarType' not found in wp-content/plugins/woo-graphql-api/vendor/webonyx/graphql-php/tests/Executor/TestClasses.php:46
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\ListResource' not found in wp-content/plugins/woo-graphql-api/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/UsageList.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\InstanceResource' not found in wp-content/plugins/woo-graphql-api/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionInstance.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% 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
9 plugin tags: ios, build, shopz, wordpress, graphql...

woo-graphql-api/wc-graphql.php 85% from 13 tests

The main file in "Shopz GraphQL API for WooCommerce" v. 2.1.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.6" instead of "3.6.0")
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-graphql-api.php" instead of "wc-graphql.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin160,365 lines of code in 2,449 files:
LanguageFilesBlank linesComment linesLines of code
PHP2,38136,271122,045153,467
Markdown371,08905,751
JSON910563
YAML8474210
XML5155181
GraphQL32812113
JavaScript361769
Dockerfile1308
SQL1002
CSS1061

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity3.48
▷ Minimum class complexity1.00
▷ Maximum class complexity169.00
Average method complexity1.39
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces244
Interfaces30
Traits15
Classes2,810
▷ Abstract classes28810.25%
▷ Concrete classes2,52289.75%
▷ Final classes40.16%
Methods16,195
▷ Static methods1,0646.57%
▷ Public methods14,31188.37%
▷ Protected methods1,4368.87%
▷ Private methods4482.77%
Functions1,363
▷ Named functions362.64%
▷ Anonymous functions1,32797.36%
Constants272
▷ Global constants114.04%
▷ Class constants26195.96%
▷ Public constants24493.49%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin