84% rest-json

Code Review | WP-Restify

WordPress plugin WP-Restify scored 84% from 54 tests.

About plugin

  • Plugin page: rest-json
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Dec 21, 2015
  • Latest release: Dec 21, 2015
  • Number of updates: 2
  • Update frequency: every 20.5 days
  • Top authors: mastersoftwaresolutions (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 532 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
Install script ran successfully

Server metrics [RAM: ▲0.74MB] [CPU: ▼1.19ms] Passed 4 tests

Server-side resources used by WP-Restify
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.34 ▲0.8845.11 ▲5.11
Dashboard /wp-admin4.05 ▲0.7552.37 ▲4.48
Posts /wp-admin/edit.php4.10 ▲0.7447.63 ▼1.62
Add New Post /wp-admin/post-new.php6.63 ▲0.7486.50 ▼12.74
Media Library /wp-admin/upload.php3.97 ▲0.7440.55 ▲5.77

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 29 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
json_api_plugin_version

Browser metrics Passed 4 tests

Checking browser requirements for WP-Restify
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲6714.60 ▲0.221.88 ▼0.0342.81 ▲2.53
Dashboard /wp-admin2,206 ▲214.87 ▼0.17111.80 ▲9.0545.45 ▲4.63
Posts /wp-admin/edit.php2,089 ▲32.05 ▲0.0534.92 ▼1.9033.42 ▲3.03
Add New Post /wp-admin/post-new.php1,519 ▼2323.12 ▼0.20676.72 ▼8.9363.15 ▲8.49
Media Library /wp-admin/upload.php1,388 ▼34.20 ▼0.01100.27 ▼2.1742.53 ▼2.82

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 29× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      include_once(ABSPATHWPINC/class-wp-json-server.php): failed to open stream: No such file or directory in wp-content/plugins/rest-json/include/wp-json.php on line 29
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/rest-json/include/class-wp-json-server.php on line 10
    • > PHP Warning
      include_once(ABSPATHWPINC/class-wp-xmlrpc-server.php): failed to open stream: No such file or directory in wp-content/plugins/rest-json/include/wp-json.php on line 27
    • > PHP Fatal error
      Uncaught Error: Class 'WP_JSON_Posts' not found in wp-content/plugins/rest-json/include/class-wp-json-media.php:3
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/admin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/rest-json/include/wp-json.php on line 26
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/rest-json/include/wp-json.php on line 27
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/rest-json/include/wp-json.php on line 29
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/admin.php' (include_path='.:/usr/share/php') in wp-content/plugins/rest-json/include/class-wp-json-server.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/rest-json/include/wp-json.php:32
    • > PHP Warning
      Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in wp-content/plugins/rest-json/include/wp-json.php on line 28

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
No tags were found

rest-json/plugin.php 92% from 13 tests

The main PHP file in "WP-Restify" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("rest-json.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin3,890 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP191,0252,0133,207
JavaScript1141265581
HTML3350102

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity30.47
▷ Minimum class complexity1.00
▷ Maximum class complexity127.00
Average method complexity4.13
▷ Minimum method complexity1.00
▷ Maximum method complexity52.00
Code structure
Namespaces0
Interfaces3
Traits0
Classes14
▷ Abstract classes214.29%
▷ Concrete classes1285.71%
▷ Final classes00.00%
Methods168
▷ Static methods63.57%
▷ Public methods13077.38%
▷ Protected methods3621.43%
▷ Private methods21.19%
Functions31
▷ Named functions2993.55%
▷ Anonymous functions26.45%
Constants19
▷ Global constants631.58%
▷ Class constants1368.42%
▷ Public constants13100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected