84% better-rest-api-featured-images

Code Review | Better REST API Featured Images

WordPress plugin Better REST API Featured Images scored 84% from 54 tests.

About plugin

  • Plugin page: better-rest-api-f...
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6
  • WordPress version: 6.3.1
  • First release: Oct 13, 2015
  • Latest release: Jul 30, 2016
  • Number of updates: 10
  • Update frequency: every 29.1 days
  • Top authors: Braad (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

5,000+ active / 50,095 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
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼1.18ms] Passed 4 tests

Server-side resources used by Better REST API Featured Images
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.96 ▲0.91
Dashboard /wp-admin3.33 ▲0.0243.89 ▼11.77
Posts /wp-admin/edit.php3.38 ▲0.0247.78 ▲2.34
Add New Post /wp-admin/post-new.php5.91 ▲0.02115.21 ▲28.35
Media Library /wp-admin/upload.php3.25 ▲0.0238.40 ▲3.82

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Better REST API Featured Images
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.64 ▼0.661.77 ▼0.2140.63 ▼1.36
Dashboard /wp-admin2,206 ▲155.86 ▲0.98109.17 ▲10.0339.22 ▼4.12
Posts /wp-admin/edit.php2,089 ▼02.01 ▲0.0039.68 ▲5.6134.18 ▲0.20
Add New Post /wp-admin/post-new.php1,542 ▲1323.15 ▲4.90656.67 ▲42.3455.47 ▲2.91
Media Library /wp-admin/upload.php1,382 ▼64.24 ▲0.0495.21 ▼3.5043.04 ▼2.81

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/better-rest-api-featured-images/better-rest-api-featured-images.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
7 plugin tags: rest, featured, images, api, better...

better-rest-api-featured-images/better-rest-api-featured-images.php Passed 13 tests

The principal PHP file in "Better REST API Featured Images" v. 1.2.1 is loaded by WordPress automatically on each request
127 characters long description:
Adds a top-level field with featured image data including available sizes and URLs to the post object returned by the REST API.

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
Success! There were no dangerous files found in this plugin268 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
Markdown1530151
PHP1144972
JavaScript14025
JSON10020

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.55
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected