94% rest-api-post-embeds

Code Review | REST API Post Embeds

WordPress plugin REST API Post Embeds scored 94% from 53 tests.

About plugin

  • Plugin page: rest-api-post-embeds
  • Plugin version: 1.5.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.7
  • WordPress version: 5.8.1
  • First release: Aug 14, 2015
  • Latest release: Mar 15, 2021
  • Number of updates: 42
  • Update frequency: every 48.6 days
  • Top authors: jeherve (100%)

Code review

53 tests

User reviews

1 review

Install metrics

700+ active / 8,509 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by REST API Post Embeds
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.94 ▲0.2233.46 ▲12.29
Dashboard /wp-admin3.16 ▲0.1144.77 ▲1.90
Posts /wp-admin/edit.php3.21 ▲0.1146.30 ▲11.51
Add New Post /wp-admin/post-new.php5.52 ▲0.0992.46 ▼1,290.03
Media Library /wp-admin/upload.php3.10 ▲0.1031.65 ▼5.94

Server storage [IO: ▲0.04MB] [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: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

REST API Post Embeds: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,652 ▲7016.17 ▲0.478.66 ▲0.1449.50 ▲4.49
Dashboard /wp-admin2,928 ▲755.93 ▲0.04158.71 ▲6.7695.16 ▼10.87
Posts /wp-admin/edit.php2,703 ▼32.69 ▲0.0065.06 ▲0.2189.49 ▼3.21
Add New Post /wp-admin/post-new.php1,853 ▲20018.76 ▼0.09354.10 ▼12.65110.34 ▲4.49
Media Library /wp-admin/upload.php1,778 ▲35.01 ▲0.02149.35 ▲1.96112.50 ▼0.16

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled completely, with no zombie files or tables

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function status_header() in wp-content/plugins/rest-api-post-embeds/uninstall.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/rest-api-post-embeds/rest-api-post-embeds.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: wp api, embed, shortcode, posts, jetpack...

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

The main PHP script in "REST API Post Embeds" version 1.5.0 is automatically included on every request by WordPress
The following require your attention:
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin600 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2157414564
CSS191036

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.59
Average class complexity126.00
▷ Minimum class complexity126.00
▷ Maximum class complexity126.00
Average method complexity6.95
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods21
▷ Static methods419.05%
▷ Public methods2095.24%
▷ Protected methods00.00%
▷ Private methods14.76%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin