84% wp-query-route-to-rest-api

Code Review | WP_Query Route To REST API

WordPress plugin WP_Query Route To REST API scored84%from 54 tests.

About plugin

  • Plugin page: wp-query-route-to...
  • Plugin version: 1.3.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.3-5.9.3
  • WordPress version: 6.3.1
  • First release: Jul 25, 2019
  • Latest release: Apr 12, 2022
  • Number of updates: 7
  • Update frequency: every 181.9 days
  • Top authors: aucor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /1,508 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by WP_Query Route To REST API
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.54 ▼1.34
Dashboard /wp-admin3.31 ▼0.0743.88 ▼30.92
Posts /wp-admin/edit.php3.37 ▲0.0145.77 ▼0.42
Add New Post /wp-admin/post-new.php5.90 ▲0.0288.03 ▼6.42
Media Library /wp-admin/upload.php3.24 ▲0.0133.83 ▼0.12

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by WP_Query Route To REST API
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.74 ▲0.351.66 ▼0.1244.80 ▼4.25
Dashboard /wp-admin2,206 ▲184.87 ▼0.02108.83 ▲6.1938.24 ▼4.52
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0140.06 ▲4.1835.57 ▲0.22
Add New Post /wp-admin/post-new.php1,533 ▲1323.24 ▼0.03664.79 ▼64.1659.92 ▲2.77
Media Library /wp-admin/upload.php1,388 ▼04.16 ▼0.0893.46 ▼8.0341.25 ▼3.10

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-query-route-to-rest-api/wp_query-route-to-rest-api.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 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
3 plugin tags: rest api, wp_query, wordpress

wp-query-route-to-rest-api/wp_query-route-to-rest-api.php 92% from 13 tests

The entry point to "WP_Query Route To REST API" version 1.3.2 is a PHP file that has certain tags in its header comment area
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-route-to-rest-api.php" instead of "wp_query-route-to-rest-api.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin749 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
Markdown11080501
PHP289134235
JSON10013

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity32.00
▷ Minimum class complexity32.00
▷ Maximum class complexity32.00
Average method complexity3.21
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods857.14%
▷ Protected methods642.86%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin