83% rest-api-featured-image

Code Review | REST API Featured Image

WordPress plugin REST API Featured Image scored83%from 54 tests.

About plugin

  • Plugin page: rest-api-featured...
  • Plugin version: 0.7.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-5.7
  • WordPress version: 6.3.1
  • First release: Oct 1, 2020
  • Latest release: Mar 11, 2021
  • Number of updates: 7
  • Update frequency: every 23.0 days
  • Top authors: icelayer (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

600+ active /3,527 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.19MB] [CPU: ▼14.91ms] Passed 4 tests

Server-side resources used by REST API Featured Image
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1343.46 ▲4.61
Dashboard /wp-admin3.53 ▲0.1851.72 ▼1.60
Posts /wp-admin/edit.php3.58 ▲0.1852.84 ▼4.39
Add New Post /wp-admin/post-new.php4.76 ▼1.1745.11 ▼58.24
Media Library /wp-admin/upload.php3.39 ▲0.1240.82 ▲5.24

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 30 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
wpfms_post_types
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by REST API Featured Image
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲4614.72 ▲0.461.82 ▲0.0645.04 ▼1.03
Dashboard /wp-admin2,216 ▲395.61 ▲0.0887.40 ▼2.5339.10 ▼5.33
Posts /wp-admin/edit.php2,118 ▲182.00 ▼0.0339.57 ▲0.1034.86 ▼5.43
Add New Post /wp-admin/post-new.php1,541 ▲423.05 ▲4.72694.44 ▲81.9754.47 ▼9.18
Media Library /wp-admin/upload.php1,412 ▲214.29 ▲0.1298.98 ▼0.2745.04 ▲1.94

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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
Please fix the following items
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/rest-api-featured-image/src/WPAdminPage/pages/footer.admin.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_user_logged_in() in wp-content/plugins/rest-api-featured-image/src/WPAdminPage/pages/header.admin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/rest-api-featured-image/src/Admin/pages/api-featured-media-src/api-featured-media-src.admin.php:38
    • > PHP Fatal error
      Uncaught Error: Class 'SimFeaturedMediaSrc\\WPAdminPage\\AdminPage' not found in wp-content/plugins/rest-api-featured-image/src/Admin/FeaturedMediaSrcAdmin.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: rest-api, api, json, thumbnail, featured image...

rest-api-featured-image/api-featured-image.php 69% from 13 tests

This is the main PHP file of "REST API Featured Image" version 0.7.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Domain Path: The domain path should use only dashes and lowercase characters ("languages")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("rest-api-featured-image.php" instead of "api-featured-image.php")
  • Domain Path: Prefix the domain path with a forward slash character ("/languages")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin1,468 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP16221734985
Markdown2780350
CSS1152129
HTML3003
JSON1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity11.71
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.03
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes7
▷ Abstract classes114.29%
▷ Concrete classes685.71%
▷ Final classes233.33%
Methods74
▷ Static methods912.16%
▷ Public methods6790.54%
▷ Protected methods00.00%
▷ Private methods79.46%
Functions5
▷ Named functions120.00%
▷ Anonymous functions480.00%
Constants5
▷ Global constants360.00%
▷ Class constants240.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin