84% wp-rest-api-post-page-custom-fields

Code Review | WP REST API POST/ PAGE CUSTOM FIELDS

WordPress plugin WP REST API POST/ PAGE CUSTOM FIELDS scored84%from 54 tests.

About plugin

  • Plugin page: wp-rest-api-post-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.1-4.9.9
  • WordPress version: 6.3.1
  • First release: Feb 7, 2019
  • Latest release: Feb 7, 2019
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: ahmedimraan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /639 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.21ms] Passed 4 tests

This is a short check of server-side resources used by WP REST API POST/ PAGE CUSTOM FIELDS
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.79 ▼5.96
Dashboard /wp-admin3.32 ▲0.0146.05 ▼7.98
Posts /wp-admin/edit.php3.37 ▲0.0151.58 ▲5.31
Add New Post /wp-admin/post-new.php5.90 ▲0.01121.55 ▲28.38
Media Library /wp-admin/upload.php3.24 ▲0.0136.44 ▼0.19

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for WP REST API POST/ PAGE CUSTOM FIELDS
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.31 ▼0.341.63 ▼0.4545.08 ▲6.12
Dashboard /wp-admin2,198 ▲215.59 ▼0.0193.65 ▲0.0443.82 ▲1.38
Posts /wp-admin/edit.php2,100 ▼01.99 ▼0.0138.27 ▲0.3635.22 ▼1.00
Add New Post /wp-admin/post-new.php1,526 ▼223.09 ▲0.07642.76 ▼31.8651.12 ▼6.55
Media Library /wp-admin/upload.php1,400 ▲34.22 ▲0.0196.19 ▼16.2741.80 ▼9.31

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
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/wp-rest-api-post-page-custom-fields/plugin.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Tags: There are too many tags (13 tag instead of maximum 10)
You can take inspiration from this readme.txt

wp-rest-api-post-page-custom-fields/plugin.php 92% from 13 tests

The main PHP script in "WP REST API POST/ PAGE CUSTOM FIELDS" version 1.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-rest-api-post-page-custom-fields.php" instead of "plugin.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 plugin44 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP18844

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.00
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%
Functions5
▷ Named functions120.00%
▷ Anonymous functions480.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