84% wp-rest-api-media-ids

Code Review | WP-REST-API Media IDs

WordPress plugin WP-REST-API Media IDs scored84%from 54 tests.

About plugin

  • Plugin page: wp-rest-api-media...
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.0
  • WordPress version: 6.3.1
  • First release: Jan 30, 2018
  • Latest release: Dec 30, 2018
  • Number of updates: 4
  • Update frequency: every 84.3 days
  • Top authors: mapk (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,032 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.69MB] [CPU: ▼16.21ms] Passed 4 tests

This is a short check of server-side resources used by WP-REST-API Media IDs
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0034.68 ▼5.28
Dashboard /wp-admin3.31 ▲0.0145.03 ▼1.95
Posts /wp-admin/edit.php3.36 ▲0.0044.66 ▼1.42
Add New Post /wp-admin/post-new.php3.12 ▼2.7631.97 ▼56.19
Media Library /wp-admin/upload.php3.23 ▲0.0032.94 ▼1.23

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for WP-REST-API Media IDs
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.17 ▼1.191.69 ▼0.3437.49 ▼11.18
Dashboard /wp-admin2,206 ▲144.85 ▼0.10110.98 ▼28.3842.75 ▼16.88
Posts /wp-admin/edit.php2,089 ▲32.02 ▼0.0439.27 ▲5.0336.05 ▲1.20
Add New Post /wp-admin/post-new.php1,542 ▲2318.28 ▼4.75610.64 ▼73.6450.16 ▼13.02
Media Library /wp-admin/upload.php1,382 ▼64.21 ▼0.0298.83 ▼5.5443.76 ▼0.93

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
The following issues need your attention
  • 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/wp-rest-api-media-ids/wp-rest-api-media-ids.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === wp-rest-api-media-ids === )
You can look at the official readme.txt

wp-rest-api-media-ids/wp-rest-api-media-ids.php Passed 13 tests

The principal PHP file in "WP-REST-API Media IDs" v. 0.2 is loaded by WordPress automatically on each request
55 characters long description:
Adding an endpoint to show all media IDs on WP REST API

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin20 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP141320

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.20
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 functions150.00%
▷ Anonymous functions150.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin