84% wp-query-generator

Code Review | WP Query Generator

WordPress plugin WP Query Generator scored84%from 54 tests.

About plugin

  • Plugin page: wp-query-generator
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.9.1
  • WordPress version: 6.3.1
  • First release: Jun 29, 2014
  • Latest release: Jun 29, 2014
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: azibaloch (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,385 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

Server-side resources used by WP Query Generator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.45 ▼4.99
Dashboard /wp-admin3.31 ▲0.0144.65 ▼3.47
Posts /wp-admin/edit.php3.36 ▲0.0145.85 ▼0.39
Add New Post /wp-admin/post-new.php5.89 ▲0.0195.42 ▼9.11
Media Library /wp-admin/upload.php3.23 ▲0.0031.25 ▼3.22

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

WP Query Generator: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7014.80 ▲0.061.63 ▼0.1940.63 ▼3.84
Dashboard /wp-admin2,219 ▲344.86 ▼1.03109.04 ▲4.6542.88 ▼6.40
Posts /wp-admin/edit.php2,105 ▲162.04 ▼0.0239.43 ▼2.9335.58 ▲3.43
Add New Post /wp-admin/post-new.php1,546 ▲2423.01 ▼0.48613.79 ▼32.1050.11 ▼6.24
Media Library /wp-admin/upload.php1,404 ▲134.25 ▲0.07101.56 ▲1.8942.18 ▼1.13

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/wp-query-generator/functions.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/wp-query-generator/functions.php:12

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: Screenshot #1 (WP Query Generator) image required
You can look at the official readme.txt

wp-query-generator/query_gen.php 92% from 13 tests

The main PHP script in "WP Query Generator" version 1.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-query-generator.php" instead of "query_gen.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected7,141 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
CSS51,124386,420
PHP223336713
JavaScript31178

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot.png26.74KB16.33KB▼ 38.95%