88% easily-generate-rest-api-url

Code Review | Easily Generate Rest API Url

WordPress plugin Easily Generate Rest API Url scored 88% from 54 tests.

About plugin

  • Plugin page: easily-generate-r...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.8.1
  • WordPress version: 5.8.1
  • First release: Dec 24, 2017
  • Latest release: Sep 13, 2021
  • Number of updates: 43
  • Update frequency: every 31.7 days
  • Top authors: kinjaldalwadi (83.72%)kinjaldalwadivc (11.63%)viitorcloudvc (9.3%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active / 4,217 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.10MB] [CPU: ▼160.97ms] Passed 4 tests

A check of server-side resources used by Easily Generate Rest API Url
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.95 ▲0.1124.17 ▼4.05
Dashboard /wp-admin3.17 ▲0.1034.50 ▼9.53
Posts /wp-admin/edit.php3.28 ▲0.1734.16 ▲0.16
Add New Post /wp-admin/post-new.php5.53 ▲0.0977.08 ▼630.44
Media Library /wp-admin/upload.php3.11 ▲0.1127.15 ▲0.68
Generate Rest API URL /wp-admin/options-general.php?page=generate_cuatom_restapi_url3.0930.98

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 23 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Easily Generate Rest API Url
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,784 ▲18316.39 ▲0.778.50 ▲3.4872.01 ▼5.18
Dashboard /wp-admin2,939 ▲436.11 ▼0.03115.28 ▼15.33166.83 ▼11.24
Posts /wp-admin/edit.php2,752 ▲123.22 ▼0.0163.18 ▼3.84136.72 ▼9.53
Add New Post /wp-admin/post-new.php3,748 ▼6518.56 ▼0.67417.13 ▼34.11159.52 ▼4.84
Media Library /wp-admin/upload.php1,761 ▲95.52 ▼0.01144.56 ▲2.41189.52 ▼1.35
Generate Rest API URL /wp-admin/options-general.php?page=generate_cuatom_restapi_url1,4402.5453.33137.16

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=generate_cuatom_restapi_url
    • > Notice in wp-content/plugins/easily-generate-rest-api-url/admin/class-generate-rest-api-url-admin.php+383
    Undefined variable: result_per_page
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=generate_cuatom_restapi_url
    • > Notice in wp-content/plugins/easily-generate-rest-api-url/admin/class-generate-rest-api-url-admin.php+383
    Undefined variable: result_category_list_api
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=generate_cuatom_restapi_url
    • > Notice in wp-content/plugins/easily-generate-rest-api-url/admin/class-generate-rest-api-url-admin.php+383
    Undefined variable: result_tags_list_api
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=generate_cuatom_restapi_url
    • > Notice in wp-content/plugins/easily-generate-rest-api-url/admin/class-generate-rest-api-url-admin.php+383
    Undefined variable: result_order_list_api
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=generate_cuatom_restapi_url
    • > Notice in wp-content/plugins/easily-generate-rest-api-url/admin/class-generate-rest-api-url-admin.php+383
    Undefined variable: result_orderby_list_api
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=generate_cuatom_restapi_url
    • > Notice in wp-content/plugins/easily-generate-rest-api-url/admin/class-generate-rest-api-url-admin.php+383
    Undefined variable: result_exclude_post_list_api
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=generate_cuatom_restapi_url
    • > Notice in wp-content/plugins/easily-generate-rest-api-url/admin/class-generate-rest-api-url-admin.php+383
    Undefined variable: result_include_post_list_api
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=generate_cuatom_restapi_url
    • > Notice in wp-content/plugins/easily-generate-rest-api-url/admin/class-generate-rest-api-url-admin.php+383
    Undefined variable: result_author_list_api
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=generate_cuatom_restapi_url
    • > Notice in wp-content/plugins/easily-generate-rest-api-url/admin/class-generate-rest-api-url-admin.php+383
    Undefined variable: result_status_list_api
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=generate_cuatom_restapi_url
    • > Notice in wp-content/plugins/easily-generate-rest-api-url/admin/class-generate-rest-api-url-admin.php+383
    Undefined variable: result_search_list_api

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 items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/easily-generate-rest-api-url/public/partials/generate-rest-api-url-public-display.php
    • > /wp-content/plugins/easily-generate-rest-api-url/admin/partials/generate-rest-api-url-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: rest api, rest api in wordpress, api, generate rest api url

easily-generate-rest-api-url/generate-rest-api-url.php 92% from 13 tests

"Easily Generate Rest API Url" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("easily-generate-rest-api-url.php" instead of "generate-rest-api-url.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin493 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP13178573487
JavaScript24546
CSS2080

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity13.29
▷ Minimum class complexity1.00
▷ Maximum class complexity84.00
Average method complexity4.44
▷ Minimum method complexity1.00
▷ Maximum method complexity47.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods26
▷ Static methods27.69%
▷ Public methods2180.77%
▷ Protected methods00.00%
▷ Private methods519.23%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants19
▷ Global constants19100.00%
▷ Class constants00.00%
▷ Public constants00.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