84% json-rest-api-subscriptions

Code Review | JSON REST API Subscriptions

WordPress plugin JSON REST API Subscriptions scored 84% from 54 tests.

About plugin

  • Plugin page: json-rest-api-sub...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.8
  • WordPress version: 5.8.1
  • First release: Feb 16, 2016
  • Latest release: Feb 16, 2016
  • Number of updates: 6
  • Update frequency: every 50.3 days
  • Top authors: tlovett1 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,314 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼0.25MB] [CPU: ▼151.33ms] Passed 4 tests

An overview of server-side resources used by JSON REST API Subscriptions
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.91 ▲0.1933.03 ▲10.36
Dashboard /wp-admin3.13 ▲0.0842.20 ▲4.61
Posts /wp-admin/edit.php3.18 ▲0.0845.56 ▼0.91
Add New Post /wp-admin/post-new.php4.21 ▼1.2341.44 ▼609.22
Media Library /wp-admin/upload.php3.07 ▲0.0732.31 ▲0.22

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 1 new option
New WordPress options
jras_deleted_posts

Browser metrics Passed 4 tests

An overview of browser requirements for JSON REST API Subscriptions
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10715.85 ▲0.248.76 ▼0.4649.44 ▼3.32
Dashboard /wp-admin2,973 ▲425.90 ▼0.02133.71 ▼17.87107.17 ▼7.23
Posts /wp-admin/edit.php2,739 ▲32.84 ▲0.0064.50 ▼0.8490.67 ▲2.10
Add New Post /wp-admin/post-new.php1,676 ▲418.81 ▼0.22365.65 ▼33.59105.24 ▼7.33
Media Library /wp-admin/upload.php1,810 ▼05.04 ▲0.03149.36 ▲6.34119.06 ▼7.71

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 did not uninstall successfully, leaving 1 option in the database
    • jras_deleted_posts

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
Please fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/json-rest-api-subscriptions/lib/endpoints/class-jras-subscriptions-controller.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/json-rest-api-subscriptions/plugin.php:33

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
9 plugin tags: api webhooks, rest api, json rest api, rest, webhooks...

json-rest-api-subscriptions/plugin.php 92% from 13 tests

The entry point to "JSON REST API Subscriptions" version 1.0 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 ("json-rest-api-subscriptions.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected784 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP5210278671
Markdown1400113

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity24.50
▷ Minimum class complexity2.00
▷ Maximum class complexity56.00
Average method complexity4.36
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods28
▷ Static methods310.71%
▷ Public methods2692.86%
▷ Protected methods00.00%
▷ Private methods27.14%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

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