88% query-shortcode

Code Review | Query Shortcode

WordPress plugin Query Shortcode scored 88% from 54 tests.

About plugin

  • Plugin page: query-shortcode
  • Plugin version: 0.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.6
  • WordPress version: 5.8.1
  • First release: Jan 15, 2013
  • Latest release: Apr 27, 2013
  • Number of updates: 18
  • Update frequency: every 6.2 days
  • Top authors: shazdeh (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

60+ active / 2,075 total downloads

Benchmarks

Plugin footprint Passed 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.02MB] [CPU: ▼148.29ms] Passed 4 tests

This is a short check of server-side resources used by Query Shortcode
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.0330.17 ▼10.17
Dashboard /wp-admin3.08 ▲0.0345.38 ▼5.95
Posts /wp-admin/edit.php3.13 ▲0.0344.51 ▼6.27
Add New Post /wp-admin/post-new.php5.44 ▲0.0085.28 ▼570.78
Media Library /wp-admin/upload.php3.02 ▲0.0236.14 ▼3.27

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Query Shortcode: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,681 ▲8515.92 ▲0.448.49 ▼0.3950.99 ▲0.87
Dashboard /wp-admin2,973 ▲406.04 ▼0.09138.82 ▼28.56121.01 ▲1.72
Posts /wp-admin/edit.php2,739 ▼02.68 ▼0.0170.05 ▲3.6789.01 ▼13.33
Add New Post /wp-admin/post-new.php1,683 ▲7918.81 ▼0.03385.84 ▼8.43122.21 ▲6.14
Media Library /wp-admin/upload.php1,810 ▼05.03 ▲0.03162.28 ▼8.89128.36 ▲9.40

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however 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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/query-shortcode/init.php
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/query-shortcode/lenses/accordion.php:11
    • > PHP Notice
      Undefined variable: posts in wp-content/plugins/query-shortcode/lenses/carousel.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/query-shortcode/lenses/tabs.php:10
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/query-shortcode/lenses/carousel.php:11
    • > PHP Notice
      Undefined variable: posts in wp-content/plugins/query-shortcode/lenses/tabs.php on line 10
    • > PHP Notice
      Undefined variable: posts in wp-content/plugins/query-shortcode/lenses/accordion.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: post, shortcode, query

query-shortcode/init.php 92% from 13 tests

Analyzing the main PHP file in "Query Shortcode" version 0.2.1
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("query-shortcode.php" instead of "init.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
Everything looks great! No dangerous files found in this plugin115 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP43066113
CSS2002

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity22.00
▷ Minimum class complexity22.00
▷ Maximum class complexity22.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

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