10% custom-wp-rest-api

Code Review | Ultimate Endpoints With Rest Api

WordPress plugin Ultimate Endpoints With Rest Api scored10%from 54 tests.

About plugin

  • Plugin page: custom-wp-rest-api
  • Plugin version: 2.2.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Nov 16, 2018
  • Latest release: Dec 30, 2022
  • Number of updates: 65
  • Update frequency: every 23.2 days
  • Top authors: dipankarpal212 (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

400+ active /8,380 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/custom-wp-rest-api/admin/settings.php+131
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.18MB] [CPU: ▼4.93ms] Passed 4 tests

An overview of server-side resources used by Ultimate Endpoints With Rest Api
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1642.26 ▼1.77
Dashboard /wp-admin3.53 ▲0.2348.15 ▼2.90
Posts /wp-admin/edit.php3.58 ▲0.2351.47 ▲1.86
Add New Post /wp-admin/post-new.php6.08 ▲0.1984.67 ▼16.91
Media Library /wp-admin/upload.php3.39 ▲0.1645.63 ▲9.27
Walk Through /wp-admin/admin.php?page=wcra_api_walk_help3.3633.73
Secret List /wp-admin/admin.php?page=wcra_api_list3.3747.62
New Api Secret /wp-admin/admin.php?page=wcra_new_api3.3634.17
Endpoints /wp-admin/admin.php?page=wcra_api_endpoints3.4034.88
Recent Activity /wp-admin/admin.php?page=wcra_api_recent_activity3.3633.49
Log /wp-admin/admin.php?page=wcra_api_log3.4231.41
Settings /wp-admin/admin.php?page=wcra_api_settings3.3932.83

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 78 new files
Database: 4 new tables, 7 new options
New tables
wp_wcra_notification_log
wp_wcra_api_endpoints
wp_wcra_api_base
wp_wcra_api_log
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts
wcra_settings_meta

Browser metrics Passed 4 tests

An overview of browser requirements for Ultimate Endpoints With Rest Api
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,923 ▲16213.40 ▼0.787.60 ▲5.7140.50 ▼1.91
Dashboard /wp-admin2,234 ▲545.70 ▲0.0392.94 ▲2.5974.53 ▲32.20
Posts /wp-admin/edit.php2,154 ▲542.04 ▲0.0234.87 ▼4.3833.69 ▼2.50
Add New Post /wp-admin/post-new.php1,723 ▲19722.35 ▼0.79695.32 ▼37.1566.73 ▼1.61
Media Library /wp-admin/upload.php1,454 ▲544.29 ▲0.09102.41 ▼1.6373.78 ▲28.76
Walk Through /wp-admin/admin.php?page=wcra_api_walk_help1,4299.13319.4193.59
Secret List /wp-admin/admin.php?page=wcra_api_list9222.0530.7739.04
New Api Secret /wp-admin/admin.php?page=wcra_new_api9112.0526.0237.30
Endpoints /wp-admin/admin.php?page=wcra_api_endpoints1,0221.6626.5357.69
Recent Activity /wp-admin/admin.php?page=wcra_api_recent_activity9212.1726.2633.07
Log /wp-admin/admin.php?page=wcra_api_log1,0161.6926.0128.90
Settings /wp-admin/admin.php?page=wcra_api_settings1,0301.7824.8435.21

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_wcra_notification_log
  • Zombie WordPress options detected upon uninstall: 7 options
    • wcra_settings_meta
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=wcra_api_settings
    • > Notice in wp-content/plugins/custom-wp-rest-api/admin/wpr_api_settings.php+71
    Undefined index: wpr_set_auth_check_by_admin

SRP 0% 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
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/custom-wp-rest-api/public/partials/customwprest-public-display.php
    • > /wp-content/plugins/custom-wp-rest-api/admin/partials/customwprest-admin-display.php
    • > /wp-content/plugins/custom-wp-rest-api/includes/demo.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wcra_admin_page_tabs() in wp-content/plugins/custom-wp-rest-api/admin/header.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wcra_admin_page_tabs() in wp-content/plugins/custom-wp-rest-api/admin/header.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wcra_api_settings
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).tooltip is not a function" "TypeError: $(...).tooltip is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/custom-wp-rest-api/admin/js/customwprest-admin.js?ver=6.3.1:52:32)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wcra_api_settings
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).tooltip is not a function

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === custom-wp-rest-api === )
You can take inspiration from this readme.txt

custom-wp-rest-api/wp-custom-rest-api.php 85% from 13 tests

The main PHP file in "Ultimate Endpoints With Rest Api" ver. 2.2.2 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("custom-wp-rest-api.php" instead of "wp-custom-rest-api.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin10,478 lines of code in 66 files:
LanguageFilesBlank linesComment linesLines of code
SVG1002,671
CSS430222,528
Sass1434341,768
LESS1434441,758
PHP314336541,710
JavaScript2205543

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity4.60
▷ Minimum class complexity1.00
▷ Maximum class complexity20.00
Average method complexity1.74
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods40
▷ Static methods25.00%
▷ Public methods3587.50%
▷ Protected methods00.00%
▷ Private methods512.50%
Functions57
▷ Named functions5596.49%
▷ Anonymous functions23.51%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/geometry2.png2.09KB2.44KB0.00%
admin/img/menu_icon.png1.71KB0.80KB▼ 53.17%