68% query-wrangler

Code Review | Query Wrangler

WordPress plugin Query Wrangler scored68%from 54 tests.

About plugin

  • Plugin page: query-wrangler
  • Plugin version: 1.5.53
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Nov 20, 2011
  • Latest release: May 9, 2023
  • Number of updates: 105
  • Update frequency: every 40.0 days
  • Top authors: daggerhart (100%)

Code review

54 tests

User reviews

37 reviews

Install metrics

1,000+ active /40,758 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▼10.24ms] Passed 4 tests

This is a short check of server-side resources used by Query Wrangler
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0843.16 ▲7.25
Dashboard /wp-admin3.38 ▲0.0449.73 ▼13.49
Posts /wp-admin/edit.php3.50 ▲0.1445.94 ▼6.71
Add New Post /wp-admin/post-new.php5.96 ▲0.0887.22 ▼16.26
Media Library /wp-admin/upload.php3.31 ▲0.0834.65 ▼4.50
Add New /wp-admin/admin.php?page=qw-create3.3136.83
Settings /wp-admin/admin.php?page=qw-settings3.3438.90
Import /wp-admin/admin.php?page=qw-import3.3136.62
Query Wrangler /wp-admin/admin.php?page=query-wrangler3.3635.17

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 101 new files
Database: 2 new tables, 12 new options
New tables
wp_query_wrangler
wp_query_override_terms
New WordPress options
qw_edit_theme
can_compress_scripts
templatewrangler_version
db_upgraded
widget_theysaidso_widget
qw_settings
widget_recent-comments
qw_live_preview
widget_recent-posts
widget_query-wrangler-widget
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Query Wrangler
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲6214.20 ▼0.081.67 ▲0.1243.23 ▼1.82
Dashboard /wp-admin2,226 ▲465.49 ▼0.1588.71 ▼1.5039.15 ▼6.14
Posts /wp-admin/edit.php2,134 ▲311.99 ▼0.0135.22 ▼6.1835.04 ▼2.34
Add New Post /wp-admin/post-new.php1,554 ▲1723.55 ▲5.40682.98 ▲50.2752.82 ▼15.40
Media Library /wp-admin/upload.php1,437 ▲434.22 ▲0.13103.40 ▲2.1046.38 ▼0.04
Add New /wp-admin/admin.php?page=qw-create9231.9927.8444.37
Settings /wp-admin/admin.php?page=qw-settings1,0652.1227.0936.59
Import /wp-admin/admin.php?page=qw-import8471.9625.2732.44
Query Wrangler /wp-admin/admin.php?page=query-wrangler9852.1724.9127.41

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie tables detected upon uninstall: 2 tables
    • wp_query_wrangler
    • wp_query_override_terms
  • The uninstall procedure has failed, leaving 12 options in the database
    • qw_live_preview
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • qw_plugin_version
    • qw_edit_theme
    • qw_settings
    • theysaidso_admin_options
    • templatewrangler_version
    • widget_query-wrangler-widget
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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 fix the following items
  • 12× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/query-wrangler/templates/query-ordered_list.php
    • > /wp-content/plugins/query-wrangler/templates/query-unformatted.php
    • > /wp-content/plugins/query-wrangler/admin/templates/handler-filter.php
    • > /wp-content/plugins/query-wrangler/templates/query-unordered_list.php
    • > /wp-content/plugins/query-wrangler/admin/templates/page-admin-wrapper.php
    • > /wp-content/plugins/query-wrangler/admin/editors/picnic/picnic-editor.php
    • > /wp-content/plugins/query-wrangler/admin/templates/form-import.php
    • > /wp-content/plugins/query-wrangler/templates/query-table.php
    • > /wp-content/plugins/query-wrangler/templates/query-wrapper.php
    • > /wp-content/plugins/query-wrangler/admin/templates/handler-sort.php
  • 256× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: sorts in wp-content/plugins/query-wrangler/admin/editors/views/views-editor.php on line 142
    • > PHP Notice
      Undefined variable: basics in wp-content/plugins/query-wrangler/admin/editors/picnic/picnic-editor.php on line 46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function qw_textarea() in wp-content/plugins/query-wrangler/admin/templates/handler-field.php:178
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/query-wrangler/includes/basics/display_title.php:3
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/query-wrangler/admin/editors/picnic/picnic-editor.php on line 259
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/query-wrangler/admin/templates/handler-filter.php on line 10
    • > PHP Notice
      Undefined variable: filter in wp-content/plugins/query-wrangler/admin/templates/handler-filter.php on line 38
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/query-wrangler/admin/editors/picnic/picnic-editor.php on line 192
    • > PHP Notice
      Undefined variable: basics in wp-content/plugins/query-wrangler/admin/editors/picnic/picnic-editor.php on line 193
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/query-wrangler/includes/overrides/tags.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Requires at least: Invalid version format
You can look at the official readme.txt

query-wrangler/query-wrangler.php Passed 13 tests

The main PHP script in "Query Wrangler" version 1.5.53 is automatically included on every request by WordPress
122 characters long description:
Query Wrangler provides an intuitive interface for creating complex WP queries as pages or widgets. Based on Drupal Views.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin9,041 lines of code in 95 files:
LanguageFilesBlank linesComment linesLines of code
PHP831,3642,3107,624
JavaScript5152259609
CSS3950474
Markdown4700334

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity12.50
▷ Minimum class complexity5.00
▷ Maximum class complexity21.00
Average method complexity2.82
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods38
▷ Static methods37.89%
▷ Public methods3694.74%
▷ Protected methods00.00%
▷ Private methods25.26%
Functions291
▷ Named functions28999.31%
▷ Anonymous functions20.69%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/handle2.png0.56KB0.54KB▼ 3.16%
admin/images/white-grad.png0.21KB0.18KB▼ 12.38%