93% wp-rest-jmespath

Code Review | WP REST JMESPath

WordPress plugin WP REST JMESPath scored 93% from 54 tests.

About plugin

  • Plugin page: wp-rest-jmespath
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.6.1
  • WordPress version: 5.8.1
  • First release: Mar 9, 2016
  • Latest release: Mar 10, 2016
  • Number of updates: 8
  • Update frequency: every 33.3 days
  • Top authors: loboyle (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active / 2,285 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

Analyzing server-side resources used by WP REST JMESPath
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1229.06 ▲8.05
Dashboard /wp-admin3.06 ▲0.0140.80 ▼2.34
Posts /wp-admin/edit.php3.11 ▲0.0139.98 ▼5.12
Add New Post /wp-admin/post-new.php5.42 ▼0.0190.86 ▼541.79
Media Library /wp-admin/upload.php3.00 ▼0.0026.22 ▼14.33

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 68 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP REST JMESPath
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10716.27 ▲0.6610.64 ▲1.6246.56 ▼1.24
Dashboard /wp-admin2,970 ▲365.89 ▼0.05145.14 ▲4.26109.71 ▲3.49
Posts /wp-admin/edit.php2,739 ▼02.69 ▼0.0162.32 ▼2.9590.40 ▲4.99
Add New Post /wp-admin/post-new.php1,672 ▼018.80 ▼0.12351.72 ▼17.58101.40 ▼1.99
Media Library /wp-admin/upload.php1,810 ▲35.02 ▲0.01148.82 ▼5.47116.80 ▼6.76

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
Please fix the following
  • 14× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/wp-rest-jmespath/vendor/mtdowling/jmespath.php/bin/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-rest-jmespath/vendor/mtdowling/jmespath.php/bin/jp.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-rest-jmespath/vendor/mtdowling/jmespath.php/tests/SyntaxErrorExceptionTest.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-rest-jmespath/wp_rest_jmespath.php:125
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-rest-jmespath/vendor/mtdowling/jmespath.php/tests/LexerTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-rest-jmespath/vendor/mtdowling/jmespath.php/tests/TreeCompilerTest.php:9
    • > PHP Warning
      require(wp-content/plugins/wp-rest-jmespath/vendor/mtdowling/jmespath.php/bin/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/wp-rest-jmespath/vendor/mtdowling/jmespath.php/bin/perf.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-rest-jmespath/vendor/mtdowling/jmespath.php/tests/ComplianceTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-rest-jmespath/vendor/mtdowling/jmespath.php/tests/FnDispatcherTest.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-rest-jmespath/vendor/mtdowling/jmespath.php/tests/EnvTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-rest-jmespath/vendor/mtdowling/jmespath.php/tests/UtilsTest.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% 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:
  • Donate link: Invalid URI ("")
  • Tags: Please add at least on tag
You can take inspiration from this readme.txt

wp-rest-jmespath/wp_rest_jmespath.php 85% from 13 tests

The main PHP file in "WP REST JMESPath" ver. 0.1 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Version: Plugin version not found
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-rest-jmespath.php" instead of "wp_rest_jmespath.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 detected8,740 lines of code in 61 files:
LanguageFilesBlank linesComment linesLines of code
JSON24805,666
PHP314665862,927
reStructuredText1352959
Markdown222048
XML13014
YAML14013
make16013

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity12.96
▷ Minimum class complexity1.00
▷ Maximum class complexity59.00
Average method complexity2.31
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes26
▷ Abstract classes00.00%
▷ Concrete classes26100.00%
▷ Final classes13.85%
Methods199
▷ Static methods199.55%
▷ Public methods9145.73%
▷ Protected methods00.00%
▷ Private methods10854.27%
Functions32
▷ Named functions928.12%
▷ Anonymous functions2371.88%
Constants40
▷ Global constants00.00%
▷ Class constants40100.00%
▷ Public constants40100.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