89% json-rest-api-shortcode

Code Review | SJF WP API Shortcode

WordPress plugin SJF WP API Shortcode scored89%from 54 tests.

About plugin

  • Plugin page: json-rest-api-sho...
  • Plugin version: 2.0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.2-4.4
  • WordPress version: 6.3.1
  • First release: Sep 13, 2014
  • Latest release: Dec 24, 2015
  • Number of updates: 26
  • Update frequency: every 18.0 days
  • Top authors: scofennell@gmail.com (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,169 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼1.83ms] Passed 4 tests

An overview of server-side resources used by SJF WP API Shortcode
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.12 ▼4.57
Dashboard /wp-admin3.34 ▲0.0448.50 ▼5.05
Posts /wp-admin/edit.php3.39 ▲0.0449.64 ▲2.85
Add New Post /wp-admin/post-new.php5.92 ▲0.0492.87 ▲3.19
Media Library /wp-admin/upload.php3.26 ▲0.0437.62 ▼0.55

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

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

Browser metrics Passed 4 tests

SJF WP API Shortcode: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.74 ▲0.101.74 ▲0.0240.62 ▼5.50
Dashboard /wp-admin2,206 ▲184.87 ▼0.03109.61 ▼8.4241.98 ▼3.13
Posts /wp-admin/edit.php2,092 ▲32.05 ▲0.0540.94 ▲4.6236.48 ▲2.02
Add New Post /wp-admin/post-new.php1,533 ▼923.12 ▲4.92684.84 ▲9.1958.28 ▲4.35
Media Library /wp-admin/upload.php1,391 ▼04.17 ▲0.0097.14 ▼7.3641.42 ▼5.46

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

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

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
2 plugin tags: wp api, json rest api shortcode

json-rest-api-shortcode/sjf-wp-api-shortcode.php 85% from 13 tests

This is the main PHP file of "SJF WP API Shortcode" version 2.0.9, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 146 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("json-rest-api-shortcode.php" instead of "sjf-wp-api-shortcode.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin356 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP1101195140
JavaScript174102129
CSS1151178
Markdown1409

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity1.60
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods550.00%
▷ Protected methods00.00%
▷ Private methods550.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected