83% wpgraphql-smart-cache

Code Review | WPGraphQL Smart Cache

WordPress plugin WPGraphQL Smart Cache scored83%from 54 tests.

About plugin

  • Plugin page: wpgraphql-smart-c...
  • Plugin version: 1.2.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.1
  • WordPress version: 6.3.1
  • First release: Dec 2, 2022
  • Latest release: Sep 1, 2023
  • Number of updates: 16
  • Update frequency: every 17.1 days
  • Top authors: jasonbahl (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active /10,597 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.28MB] [CPU: ▲0.77ms] Passed 4 tests

Analyzing server-side resources used by WPGraphQL Smart Cache
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.3046.14 ▲1.93
Dashboard /wp-admin3.62 ▲0.3256.10 ▲4.70
Posts /wp-admin/edit.php3.67 ▲0.3252.86 ▲2.52
Add New Post /wp-admin/post-new.php6.14 ▲0.2592.72 ▼6.06
Media Library /wp-admin/upload.php3.48 ▲0.2542.79 ▲8.89

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 38 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for WPGraphQL Smart Cache
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,846 ▲8513.18 ▼1.385.48 ▲3.5643.94 ▼0.99
Dashboard /wp-admin2,224 ▲305.82 ▲0.01101.91 ▼2.4338.62 ▼6.06
Posts /wp-admin/edit.php2,107 ▲72.04 ▲0.0538.77 ▼3.4534.41 ▼6.07
Add New Post /wp-admin/post-new.php1,553 ▲423.34 ▲0.17672.71 ▲10.9754.16 ▲0.07
Media Library /wp-admin/upload.php1,409 ▲94.23 ▲0.00108.03 ▲4.5948.95 ▲4.61

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'GraphQL\\Validator\\Rules\\ValidationRule' not found in wp-content/plugins/wpgraphql-smart-cache/src/ValidationRules/AllowDenyQueryDocument.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'WPGraphQL\\SmartCache\\Cache\\Query' not found in wp-content/plugins/wpgraphql-smart-cache/src/Cache/Collection.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WPGraphQL\\SmartCache\\Cache\\Query' not found in wp-content/plugins/wpgraphql-smart-cache/src/Cache/Results.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
8 plugin tags: cache, wpgraphql, performance, speed, graphql...

wpgraphql-smart-cache/wp-graphql-smart-cache.php 77% from 13 tests

This is the main PHP file of "WPGraphQL Smart Cache" version 1.2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wpgraphql-smart-cache.php" instead of "wp-graphql-smart-cache.php")
  • 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 folder does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin4,608 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP341,1242,4444,357
Markdown1700196
JSON10055

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity22.85
▷ Minimum class complexity1.00
▷ Maximum class complexity105.00
Average method complexity3.12
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces9
Interfaces0
Traits0
Classes27
▷ Abstract classes00.00%
▷ Concrete classes27100.00%
▷ Final classes00.00%
Methods264
▷ Static methods3914.77%
▷ Public methods22585.23%
▷ Protected methods72.65%
▷ Private methods3212.12%
Functions32
▷ Named functions39.38%
▷ Anonymous functions2990.62%
Constants22
▷ Global constants313.64%
▷ Class constants1986.36%
▷ Public constants19100.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
No PNG images were found in this plugin