74% ng-wp-endpoints

Code Review | ng-wp-rest

WordPress plugin ng-wp-rest scored74%from 54 tests.

About plugin

  • Plugin page: ng-wp-endpoints
  • Plugin version: 1.5.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.4
  • WordPress version: 6.3.1
  • First release: Feb 21, 2018
  • Latest release: Mar 26, 2018
  • Number of updates: 20
  • Update frequency: every 1.7 days
  • Top authors: uiarch (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /616 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼1.23MB] [CPU: ▼47.30ms] Passed 4 tests

An overview of server-side resources used by ng-wp-rest
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.74 ▼0.7214.90 ▼26.85
Dashboard /wp-admin2.78 ▼0.5216.92 ▼35.77
Posts /wp-admin/edit.php2.78 ▼0.5716.52 ▼36.34
Add New Post /wp-admin/post-new.php2.78 ▼3.1016.77 ▼90.22
Media Library /wp-admin/upload.php2.78 ▼0.4516.13 ▼20.36

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for ng-wp-rest
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.28 ▼0.081.72 ▼0.0643.65 ▼6.90
Dashboard /wp-admin2,195 ▲215.58 ▲0.0691.85 ▼6.7340.71 ▼8.05
Posts /wp-admin/edit.php2,097 ▼32.02 ▲0.0438.92 ▲2.1134.45 ▼5.71
Add New Post /wp-admin/post-new.php6,230 ▲4,69518.98 ▲0.73919.64 ▲302.1756.21 ▼5.38
Media Library /wp-admin/upload.php1,400 ▼04.20 ▼0.0397.87 ▼9.6446.20 ▲2.84

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function register_rest_route was called incorrectly. REST API routes must be registered on the rest_api_init action. Please see Debugging in WordPress for more information. (This message was added in version 5.1.0.)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 8× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/ng-wp-endpoints/includes/ng-wp-abstract.php
    • > /wp-content/plugins/ng-wp-endpoints/includes/ng-wp-interface.php
    • > /wp-content/plugins/ng-wp-endpoints/includes/ng-wp-endpoints-add-fields.php
    • > /wp-content/plugins/ng-wp-endpoints/includes/ng-wp-rest-menus-controller.php
    • > /wp-content/plugins/ng-wp-endpoints/ng-wp-rest-controller.php
    • > /wp-content/plugins/ng-wp-endpoints/includes/ng-wp-rest-widgets-controller.php
    • > /wp-content/plugins/ng-wp-endpoints/includes/ng-wp-rest-custom-post-types-controller.php
    • > /wp-content/plugins/ng-wp-endpoints/includes/ng-wp-rest-sidebars-controller.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
1 plugin tags: rest api headless cms

ng-wp-endpoints/ng-wp-rest-controller.php 92% from 13 tests

"ng-wp-rest" version 1.5.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ng-wp-endpoints.php" instead of "ng-wp-rest-controller.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 plugin765 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP9147443707
Markdown128058

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity9.00
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes7
▷ Abstract classes114.29%
▷ Concrete classes685.71%
▷ Final classes00.00%
Methods49
▷ Static methods24.08%
▷ Public methods4183.67%
▷ Protected methods00.00%
▷ Private methods816.33%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants6
▷ Global constants00.00%
▷ Class constants6100.00%
▷ Public constants6100.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 images were found in this plugin