83% wp-custom-rest-api-generator

Code Review | WP Custom REST API Generator

WordPress plugin WP Custom REST API Generator scored83%from 54 tests.

About plugin

  • Plugin page: wp-custom-rest-ap...
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9.2
  • WordPress version: 6.3.1
  • First release: Dec 19, 2018
  • Latest release: Mar 21, 2022
  • Number of updates: 11
  • Update frequency: every 108.0 days
  • Top authors: centangle (63.64%)shaampk1 (45.45%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /3,738 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
This plugin's installer ran successfully

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

Analyzing server-side resources used by WP Custom REST API Generator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.82 ▲0.36
Dashboard /wp-admin3.31 ▼0.0345.05 ▼16.26
Posts /wp-admin/edit.php3.37 ▲0.0143.89 ▼3.03
Add New Post /wp-admin/post-new.php5.93 ▲0.0484.21 ▼14.07
Media Library /wp-admin/upload.php3.24 ▲0.0133.13 ▼2.78
WP Custom REST API Generator /wp-admin/options-general.php?page=wpcrag3.2434.93

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 33 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

WP Custom REST API Generator: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲1314.35 ▼0.011.73 ▼0.0144.80 ▲4.86
Dashboard /wp-admin2,208 ▲315.56 ▼0.0283.69 ▼7.2237.66 ▼2.06
Posts /wp-admin/edit.php2,110 ▲102.01 ▲0.0436.21 ▲0.0533.24 ▼3.89
Add New Post /wp-admin/post-new.php1,535 ▲723.39 ▲0.19607.91 ▼68.0748.25 ▼5.45
Media Library /wp-admin/upload.php1,413 ▲134.20 ▲0.0395.23 ▼6.5239.49 ▼5.10
WP Custom REST API Generator /wp-admin/options-general.php?page=wpcrag8802.1826.7035.03

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-custom-rest-api-generator/admin/wpcrag_settings_api_function.php:49
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-custom-rest-api-generator/includes/wpcrag_fn_query.php:43

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 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
8 plugin tags: custom fields, admin, taxonomy, json, rest api...

wp-custom-rest-api-generator/wp_custom_rest_api_generator.php 77% from 13 tests

The main file in "WP Custom REST API Generator" v. 1.0.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-custom-rest-api-generator.php" instead of "wp_custom_rest_api_generator.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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 plugin10,558 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
CSS32,750185,720
SVG30124,479
PHP937074331
JavaScript116428

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions1392.86%
▷ Anonymous functions17.14%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin