83% wp-graphql

Code Review | WPGraphQL

WordPress plugin WPGraphQL scored83%from 54 tests.

About plugin

  • Plugin page: wp-graphql
  • Plugin version: 1.19.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Nov 14, 2020
  • Latest release: Nov 15, 2023
  • Number of updates: 115
  • Update frequency: every 10.7 days
  • Top authors: jasonbahl (100%)

Code review

54 tests

User reviews

47 reviews

Install metrics

30,000+ active /701,272 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
Install script ran successfully

Server metrics [RAM: ▲0.96MB] [CPU: ▼7.64ms] Passed 4 tests

An overview of server-side resources used by WPGraphQL
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.42 ▲0.9644.30 ▲3.43
Dashboard /wp-admin4.28 ▲0.9449.96 ▼43.71
Posts /wp-admin/edit.php4.40 ▲1.0456.82 ▲14.46
Add New Post /wp-admin/post-new.php6.86 ▲0.98105.44 ▲4.44
Media Library /wp-admin/upload.php4.20 ▲0.9740.40 ▲5.29
Settings /wp-admin/admin.php?page=graphql-settings4.2440.96
GraphiQL IDE /wp-admin/admin.php?page=graphiql-ide4.1836.06

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 498 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
wp_graphql_version
db_upgraded
graphql_general_settings
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

WPGraphQL: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,859 ▲11214.35 ▲0.021.71 ▼0.1442.71 ▼1.52
Dashboard /wp-admin2,260 ▲805.63 ▲0.0597.13 ▲4.7639.85 ▼0.63
Posts /wp-admin/edit.php2,162 ▲622.04 ▲0.0941.50 ▲7.2635.72 ▼2.24
Add New Post /wp-admin/post-new.php1,561 ▲3523.27 ▼0.29674.11 ▼21.9855.57 ▲4.20
Media Library /wp-admin/upload.php1,463 ▲604.21 ▼0.09103.82 ▼1.0943.08 ▼1.10
Settings /wp-admin/admin.php?page=graphql-settings1,3243.5850.7032.42
GraphiQL IDE /wp-admin/admin.php?page=graphiql-ide94721.34222.2386.35

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • wp_graphql_version
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • graphql_general_settings
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 177× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'GraphQL\\Language\\AST\ode' not found in wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Language/AST/DirectiveDefinitionNode.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WPGraphQL\\Data\\Connection\\TermObjectConnectionResolver' not found in wp-content/plugins/wp-graphql/src/Data/Connection/MenuConnectionResolver.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'GraphQL\\Validator\\Rules\\QuerySecurityRule' not found in wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Validator/Rules/QueryDepth.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'GraphQL\\Validator\\Rules\\ValidationRule' not found in wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArgumentsOnDirectives.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'GraphQL\\Language\\AST\ode' not found in wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Language/AST/IntValueNode.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'GraphQL\\Language\\AST\ode' not found in wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Language/AST/ObjectFieldNode.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'GraphQL\\Validator\\Rules\\ValidationRule' not found in wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNames.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'WPGraphQL\\Data\\Loader\\AbstractDataLoader' not found in wp-content/plugins/wp-graphql/src/Data/Loader/EnqueuedStylesheetLoader.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WPGraphQL\\Data\\Loader\\AbstractDataLoader' not found in wp-content/plugins/wp-graphql/src/Data/Loader/UserLoader.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'GraphQL\\Validator\\Rules\\ValidationRule' not found in wp-content/plugins/wp-graphql/vendor/webonyx/graphql-php/src/Validator/Rules/PossibleFragmentSpreads.php:21

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 90% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 16 tag instead of maximum 10
  • Screenshots: Please add descriptions for these screenshots #1, #2 in wp-graphql/assets to your readme.txt
You can take inspiration from this readme.txt

wp-graphql/wp-graphql.php 92% from 13 tests

"WPGraphQL" version 1.19.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Domain Path: The domain path is invalid: folder "/languages/" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin53,280 lines of code in 488 files:
LanguageFilesBlank linesComment linesLines of code
PHP4458,94620,62746,296
Markdown2489905,038
CSS4289401,474
JSON200172
XML22547126
JavaScript73096
YAML416178

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity14.28
▷ Minimum class complexity1.00
▷ Maximum class complexity169.00
Average method complexity3.15
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces51
Interfaces25
Traits1
Classes404
▷ Abstract classes112.72%
▷ Concrete classes39397.28%
▷ Final classes41.02%
Methods2,084
▷ Static methods70333.73%
▷ Public methods1,55874.76%
▷ Protected methods21910.51%
▷ Private methods30714.73%
Functions976
▷ Named functions515.23%
▷ Anonymous functions92594.77%
Constants185
▷ Global constants105.41%
▷ Class constants17594.59%
▷ Public constants16091.43%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin