72% query-generator

Code Review | WP Query Generator

WordPress plugin WP Query Generator scored 72% from 54 tests.

About plugin

  • Plugin page: query-generator
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.3
  • WordPress version: 5.8.1
  • First release: Dec 14, 2015
  • Latest release: Dec 14, 2015
  • Number of updates: 8
  • Update frequency: N/A
  • Top authors: anjan011 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 832 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼136.14ms] Passed 4 tests

An overview of server-side resources used by WP Query Generator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.0133.81 ▲4.95
Dashboard /wp-admin3.08 ▲0.0244.37 ▲10.20
Posts /wp-admin/edit.php3.13 ▲0.0241.91 ▼3.65
Add New Post /wp-admin/post-new.php5.44 ▲0.0191.95 ▼546.42
Media Library /wp-admin/upload.php3.02 ▲0.0232.31 ▲0.58
WP_Query Generator /wp-admin/tools.php?page=wp-query-generator3.1655.76

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 67 new files
Database: no new tables, 1 new option
New WordPress options
category_children

Browser metrics Passed 4 tests

A check of browser resources used by WP Query Generator
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,684 ▲8815.90 ▲0.247.14 ▼1.5846.99 ▼2.65
Dashboard /wp-admin2,975 ▲415.89 ▼0.05124.22 ▼17.78105.99 ▼12.05
Posts /wp-admin/edit.php2,744 ▲52.69 ▼0.0164.75 ▼7.7596.16 ▲14.97
Add New Post /wp-admin/post-new.php1,501 ▼17118.92 ▼0.26373.26 ▲1.51106.26 ▼4.56
Media Library /wp-admin/upload.php1,812 ▲25.02 ▲0.01150.62 ▼11.58116.69 ▼7.17
WP_Query Generator /wp-admin/tools.php?page=wp-query-generator4,1383.47136.6697.79

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 1 option in the database
    • category_children

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/tools.php?page=wp-query-generator
    • > Warning in wp-content/plugins/query-generator/includes/templates/form-parts/meta-query.php+47
    array_values() expects parameter 1 to be array, null given

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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/query-generator/includes/templates/preview/posts-list.php
  • 18× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'meAnjanWqg_Posts' not found in wp-content/plugins/query-generator/includes/templates/form-parts/sorting.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'meAnjanWqg_Utils' not found in wp-content/plugins/query-generator/includes/templates/form-parts/date.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'meAnjanWqg_Posts' not found in wp-content/plugins/query-generator/includes/templates/form-parts/meta.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'meAnjanWqg_Main' not found in wp-content/plugins/query-generator/includes/templates/form-parts/index.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function getGeneratedArgs() on null in wp-content/plugins/query-generator/includes/templates/preview/index.php:17
    • > PHP Notice
      Undefined variable: gen in wp-content/plugins/query-generator/includes/templates/preview/index.php on line 17
    • > PHP Fatal error
      Uncaught Error: Class 'meAnjanWqg_Categories' not found in wp-content/plugins/query-generator/includes/templates/form-parts/category.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'meAnjanWqg_Utils' not found in wp-content/plugins/query-generator/includes/templates/form-parts/meta-query.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'meAnjanWqg_Utils' not found in wp-content/plugins/query-generator/includes/templates/form-parts/pagination.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'meAnjanWqg_Utils' not found in wp-content/plugins/query-generator/includes/templates/form-parts/taxonomy.php:18

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

readme.txt Passed 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
2 plugin tags: code, generator

query-generator/index.php 92% from 13 tests

The principal PHP file in "WP Query Generator" v. 1.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("query-generator.php" instead of "index.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
No dangerous file extensions were detected7,673 lines of code in 58 files:
LanguageFilesBlank linesComment linesLines of code
CSS19262743,487
PHP301,6006652,880
JavaScript6533274766
Sass11450424
JSON200116

PHP code Passed 2 tests

This is a very shot 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.40
Average class complexity31.90
▷ Minimum class complexity1.00
▷ Maximum class complexity187.00
Average method complexity5.83
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods64
▷ Static methods3250.00%
▷ Public methods6296.88%
▷ Protected methods00.00%
▷ Private methods23.12%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants15
▷ Global constants640.00%
▷ Class constants960.00%
▷ Public constants9100.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
5 PNG files occupy 0.19MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-3.png43.31KB17.79KB▼ 58.92%
assets/js/lib/chosen/chosen-sprite@2x.png0.72KB0.83KB0.00%
assets/js/lib/chosen/chosen-sprite.png0.53KB0.88KB0.00%
assets/screenshot-2.png74.93KB29.94KB▼ 60.05%
assets/screenshot-1.png75.60KB31.58KB▼ 58.22%