79% inject-query-posts

Code Review | Inject Query Posts

WordPress plugin Inject Query Posts scored79%from 54 tests.

About plugin

  • Plugin page: inject-query-posts
  • Plugin version: 3.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-6.3
  • WordPress version: 6.3.1
  • First release: Sep 27, 2010
  • Latest release: Aug 21, 2023
  • Number of updates: 23
  • Update frequency: every 226.0 days
  • Top authors: coffee2code (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,587 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.97ms] Passed 4 tests

This is a short check of server-side resources used by Inject Query Posts
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0248.07 ▲9.33
Dashboard /wp-admin3.32 ▲0.0249.64 ▼1.94
Posts /wp-admin/edit.php3.37 ▲0.0251.03 ▲2.06
Add New Post /wp-admin/post-new.php5.90 ▲0.0286.17 ▼13.50
Media Library /wp-admin/upload.php3.24 ▲0.0139.88 ▲1.51

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Inject Query Posts
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.63 ▲0.282.01 ▲0.2048.59 ▲7.69
Dashboard /wp-admin2,195 ▲155.61 ▼0.0585.80 ▼7.0339.61 ▼7.64
Posts /wp-admin/edit.php2,100 ▼32.04 ▲0.0538.64 ▼1.0434.94 ▼2.22
Add New Post /wp-admin/post-new.php1,528 ▼023.13 ▲0.04627.72 ▼33.7448.87 ▼5.47
Media Library /wp-admin/upload.php1,394 ▼94.18 ▼0.0699.99 ▼4.1846.05 ▲2.03

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 did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

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
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/inject-query-posts/tests/phpunit/bootstrap.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/tests/phpunit/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/inject-query-posts/tests/phpunit/bootstrap.php on line 29
    • > PHP Warning
      require_once(/tmp/wordpress-tests-lib/tests/phpunit/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/inject-query-posts/tests/phpunit/bootstrap.php on line 29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
6 plugin tags: coffee2code, template tags, posts, query, wp_query...

inject-query-posts/inject-query-posts.php Passed 13 tests

"Inject Query Posts" version 3.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
137 characters long description:
Facilitates injecting an array of posts into a WP query object as if queried. Particularly useful to allow use of standard template tags.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin538 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP486144256
Markdown4770247
Bourne Shell16221
XML10014

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods1593.75%
▷ Protected methods16.25%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected