84% rest-api-meta-endpoints

Code Review | WP REST API Meta Endpoints

WordPress plugin WP REST API Meta Endpoints scored84%from 54 tests.

About plugin

  • Plugin page: rest-api-meta-end...
  • Plugin version: 0.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4+
  • WordPress version: 6.3.1
  • First release: Feb 9, 2016
  • Latest release: Feb 9, 2016
  • Number of updates: 4
  • Update frequency: every 1.0 days
  • Top authors: danielbachhuber (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /7,136 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.01MB] [CPU: ▼11.46ms] Passed 4 tests

Analyzing server-side resources used by WP REST API Meta Endpoints
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0139.75 ▼10.10
Dashboard /wp-admin3.36 ▲0.0147.33 ▼5.81
Posts /wp-admin/edit.php3.41 ▲0.0151.67 ▼4.22
Add New Post /wp-admin/post-new.php6.06 ▲0.1391.43 ▼25.71
Media Library /wp-admin/upload.php3.28 ▲0.0140.15 ▲1.62

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for WP REST API Meta Endpoints
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.18 ▼0.041.54 ▼0.3244.21 ▲0.82
Dashboard /wp-admin2,195 ▲255.64 ▲0.0083.86 ▼15.1641.44 ▼0.42
Posts /wp-admin/edit.php2,082 ▼181.98 ▲0.0334.55 ▼0.7335.26 ▼1.94
Add New Post /wp-admin/post-new.php1,526 ▼023.40 ▲0.28691.70 ▲38.6558.72 ▲3.05
Media Library /wp-admin/upload.php1,394 ▼64.13 ▼0.0998.05 ▼8.1643.04 ▼1.65

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% 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
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Meta_Controller' not found in wp-content/plugins/rest-api-meta-endpoints/lib/class-wp-rest-meta-posts-controller.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/rest-api-meta-endpoints/plugin.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/rest-api-meta-endpoints/lib/class-wp-rest-meta-controller.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% 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
Please fix the following attributes:
  • Tested up to: The plugin version is formatted incorrectly
Please take inspiration from this readme.txt

rest-api-meta-endpoints/plugin.php 92% from 13 tests

The entry point to "WP REST API Meta Endpoints" version 0.1.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("rest-api-meta-endpoints.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin349 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP389180349

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity28.00
▷ Minimum class complexity10.00
▷ Maximum class complexity46.00
Average method complexity3.84
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes150.00%
▷ Concrete classes150.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods1684.21%
▷ Protected methods315.79%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin