77% wp-wpcat-json-rest

Code Review | wp_wpcat_json_rest

WordPress plugin wp_wpcat_json_rest scored77%from 54 tests.

About plugin

  • Plugin page: wp-wpcat-json-rest
  • Plugin version: 0.1.5
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.4
  • WordPress version: 6.3.1
  • First release: Dec 19, 2020
  • Latest release: Oct 27, 2023
  • Number of updates: 51
  • Update frequency: every 20.5 days
  • Top authors: martinvonberg (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,417 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.30MB] [CPU: ▲0.66ms] Passed 4 tests

Server-side resources used by wp_wpcat_json_rest
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.3039.40 ▲0.83
Dashboard /wp-admin3.60 ▲0.2945.61 ▲0.83
Posts /wp-admin/edit.php3.71 ▲0.3549.68 ▲0.72
Add New Post /wp-admin/post-new.php6.20 ▲0.3185.24 ▲0.61
Media Library /wp-admin/upload.php3.52 ▲0.2937.20 ▲0.48

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for wp_wpcat_json_rest
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.28 ▼0.071.73 ▲0.1237.89 ▼0.88
Dashboard /wp-admin2,186 ▲85.53 ▼0.1783.00 ▼27.1941.27 ▲1.65
Posts /wp-admin/edit.php2,097 ▼61.95 ▼0.0739.38 ▼2.3035.77 ▼0.37
Add New Post /wp-admin/post-new.php1,526 ▼223.14 ▼0.19669.94 ▼36.2972.21 ▲16.79
Media Library /wp-admin/upload.php1,400 ▲34.25 ▲0.0596.27 ▲1.3944.16 ▼2.49

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 7× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-wpcat-json-rest/includes/rest_register_functions.php
    • > /wp-content/plugins/wp-wpcat-json-rest/includes/meta_update_callback.php
    • > /wp-content/plugins/wp-wpcat-json-rest/wp_wpcat_json_rest.php
    • > /wp-content/plugins/wp-wpcat-json-rest/includes/add_image_from_folder_callback.php
    • > /wp-content/plugins/wp-wpcat-json-rest/includes/rest_api_field_functions.php
    • > /wp-content/plugins/wp-wpcat-json-rest/includes/add_image_to_folder_callback.php
    • > /wp-content/plugins/wp-wpcat-json-rest/includes/image_update_callback.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-wpcat-json-rest/includes/require_rest_auth.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mvbplugins\\extmedialib\\add_filter() in wp-content/plugins/wp-wpcat-json-rest/includes/trigger_after_rest.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 86% 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
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
You can look at the official readme.txt

wp-wpcat-json-rest/wp_wpcat_json_rest.php 77% from 13 tests

The primary PHP file in "wp_wpcat_json_rest" version 0.1.5 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-wpcat-json-rest.php" instead of "wp_wpcat_json_rest.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("5.3" instead of "5.9")
  • Description: Please don't use more than 140 characters for the plugin description (currently 186 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected1,373 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP123556201,373

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity61.00
▷ Minimum class complexity12.00
▷ Maximum class complexity110.00
Average method complexity5.00
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods30
▷ Static methods00.00%
▷ Public methods1756.67%
▷ Protected methods26.67%
▷ Private methods1136.67%
Functions36
▷ Named functions2158.33%
▷ Anonymous functions1541.67%
Constants11
▷ Global constants00.00%
▷ Class constants11100.00%
▷ Public constants11100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin