93% 51blocks-json-schema

Code Review | 51Blocks JSON Schema Generator

WordPress plugin 51Blocks JSON Schema Generator scored 93% from 54 tests.

About plugin

  • Plugin page: 51blocks-json-schema
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 5.8.1
  • First release: Jun 28, 2015
  • Latest release: Jun 28, 2015
  • Number of updates: 2
  • Update frequency: every 1.5 days
  • Top authors: mborgelt (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

500+ active / 5,183 total downloads

Benchmarks

Plugin footprint Passed 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.13MB] [CPU: ▼137.14ms] Passed 4 tests

A check of server-side resources used by 51Blocks JSON Schema Generator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.97 ▲0.2543.57 ▲19.80
Dashboard /wp-admin3.20 ▲0.1444.52 ▼4.57
Posts /wp-admin/edit.php3.25 ▲0.1447.62 ▲10.98
Add New Post /wp-admin/post-new.php5.55 ▲0.1188.89 ▼563.31
Media Library /wp-admin/upload.php3.14 ▲0.1443.45 ▲8.35
Add New /wp-admin/post-new.php?post_type=json_schema3.1846.24
All Schemas /wp-admin/edit.php?post_type=json_schema3.1838.84

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for 51Blocks JSON Schema Generator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,757 ▲16115.94 ▲0.4110.64 ▲1.0149.68 ▼3.55
Dashboard /wp-admin3,014 ▲835.98 ▼0.21138.23 ▼8.37117.62 ▲3.00
Posts /wp-admin/edit.php2,780 ▲412.72 ▲0.0374.30 ▲2.32102.68 ▲13.30
Add New Post /wp-admin/post-new.php1,709 ▲3718.43 ▼0.49380.62 ▼11.85108.68 ▼6.73
Media Library /wp-admin/upload.php1,851 ▲415.07 ▲0.05155.86 ▲6.76128.43 ▼5.40
Add New /wp-admin/post-new.php?post_type=json_schema3,3744.08132.94103.59
All Schemas /wp-admin/edit.php?post_type=json_schema1,4442.6366.0074.95

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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 take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/51blocks-json-schema/includes/custom-post-type.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from), #2 (This is the second screen shot)
  • Plugin Name: You should set the name of your plugin on the first line ( === 51blocks-json-schema === )
You can take inspiration from this readme.txt

51blocks-json-schema/json-schema-generator.php 85% from 13 tests

The principal PHP file in "51Blocks JSON Schema Generator" v. 1.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("51blocks-json-schema.php" instead of "json-schema-generator.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin574 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP215953484
JavaScript135589
CSS1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.59
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%
Functions7
▷ Named functions7100.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 files were detected