89% wp-rest-api-options

Code Review | WP API Options

WordPress plugin WP API Options scored89%from 54 tests.

About plugin

  • Plugin page: wp-rest-api-options
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.0-4.5
  • WordPress version: 6.3.1
  • First release: Apr 10, 2016
  • Latest release: May 9, 2016
  • Number of updates: 3
  • Update frequency: every 10.7 days
  • Top authors: oleg2tor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,000 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.00MB] [CPU: ▼4.23ms] Passed 4 tests

A check of server-side resources used by WP API Options
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.78 ▼2.69
Dashboard /wp-admin3.31 ▲0.0043.96 ▼6.70
Posts /wp-admin/edit.php3.36 ▲0.0045.75 ▼1.17
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.93 ▼6.37
Media Library /wp-admin/upload.php3.23 ▲0.0035.57 ▲1.40

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for WP API Options
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.25 ▼1.131.55 ▼0.2837.90 ▼10.40
Dashboard /wp-admin2,206 ▲185.83 ▲0.8297.33 ▼16.0638.87 ▼9.99
Posts /wp-admin/edit.php2,089 ▼02.02 ▲0.0040.43 ▲4.5935.92 ▲3.23
Add New Post /wp-admin/post-new.php1,514 ▼817.57 ▼5.68623.33 ▼39.1650.08 ▼1.36
Media Library /wp-admin/upload.php1,388 ▼04.21 ▼0.0092.99 ▼1.9141.03 ▼0.59

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

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

Smoke tests Passed 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)
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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 SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
You can take inspiration from this readme.txt

wp-rest-api-options/wp-api-options.php 92% from 13 tests

The entry point to "WP API Options" version 1.0.1 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-rest-api-options.php" instead of "wp-api-options.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected229 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP493133229

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity3.44
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods9
▷ Static methods777.78%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.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