84% rest-api-multiple-post-types

Code Review | REST API Multiple Post Types

WordPress plugin REST API Multiple Post Types scored84%from 54 tests.

About plugin

  • Plugin page: rest-api-multiple...
  • Plugin version: 0.1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 22, 2017
  • Latest release: Aug 22, 2017
  • Number of updates: 3
  • Update frequency: every 8.0 days
  • Top authors: Shelob9 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /2,996 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.47ms] Passed 4 tests

This is a short check of server-side resources used by REST API Multiple Post Types
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.46 ▲3.43
Dashboard /wp-admin3.31 ▲0.0150.77 ▼6.58
Posts /wp-admin/edit.php3.36 ▲0.0147.68 ▼5.08
Add New Post /wp-admin/post-new.php5.90 ▲0.0183.35 ▼3.64
Media Library /wp-admin/upload.php3.24 ▲0.0136.95 ▲1.43

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

REST API Multiple Post Types: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.54 ▲0.171.69 ▼0.0143.37 ▼2.32
Dashboard /wp-admin2,189 ▲95.50 ▼0.0885.85 ▼8.5738.11 ▼5.50
Posts /wp-admin/edit.php2,103 ▲32.16 ▲0.1740.14 ▼0.6837.40 ▼3.13
Add New Post /wp-admin/post-new.php1,531 ▲522.96 ▼0.08653.17 ▲60.0755.89 ▲4.81
Media Library /wp-admin/upload.php1,400 ▼34.18 ▼0.0294.92 ▼7.5139.98 ▼2.41

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/rest-api-multiple-post-types/rest-multiple-post-types.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: Please add an image for screenshot #1 (A cool screenshot of some fancy JSONs.)
The official readme.txt might help

rest-api-multiple-post-types/rest-multiple-post-types.php 92% from 13 tests

"REST API Multiple Post Types" version 0.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("rest-api-multiple-post-types.php" instead of "rest-multiple-post-types.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected35 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1133135

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.73
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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin