73% bp-rest-endpoints

Code Review | BP-Rest-Endpoints

WordPress plugin BP-Rest-Endpoints scored73%from 54 tests.

About plugin

  • Plugin page: bp-rest-endpoints
  • Plugin version: 0.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5-4.5
  • WordPress version: 6.3.1
  • First release: Aug 29, 2016
  • Latest release: Aug 26, 2016
  • Number of updates: 2
  • Update frequency: every 1.5 days
  • Top authors: Julian_Kingman (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /861 total downloads

Benchmarks

Plugin footprint 65% 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.22MB] [CPU: ▼50.04ms] Passed 4 tests

Analyzing server-side resources used by BP-Rest-Endpoints
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.76 ▼0.7014.55 ▼32.80
Dashboard /wp-admin2.80 ▼0.5516.93 ▼48.61
Posts /wp-admin/edit.php2.80 ▼0.5616.70 ▼31.32
Add New Post /wp-admin/post-new.php2.80 ▼3.0915.46 ▼87.43
Media Library /wp-admin/upload.php2.80 ▼0.4316.25 ▼20.13

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by BP-Rest-Endpoints
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲1814.27 ▼0.111.78 ▼0.3445.87 ▲3.50
Dashboard /wp-admin2,198 ▲215.64 ▲0.0897.25 ▲2.8546.99 ▲7.41
Posts /wp-admin/edit.php2,097 ▼31.97 ▼0.0334.53 ▼2.0632.52 ▼1.80
Add New Post /wp-admin/post-new.php45 ▼1,4810.42 ▼22.750.07 ▼674.1910.91 ▼59.65
Media Library /wp-admin/upload.php1,400 ▼04.12 ▼0.07101.10 ▼15.7567.77 ▲18.76

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/bp-rest-endpoints/bp-rest-endpoints.php+65
    Creating default object from empty value
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

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
Everything seems fine, however this is by no means an exhaustive test

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 fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bp-rest-endpoints/bp-rest-endpoints.php:49

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Tags: No valid plugin tags found
  • Donate link: Invalid URI ("")
Please take inspiration from this readme.txt

bp-rest-endpoints/bp-rest-endpoints.php 85% from 13 tests

This is the main PHP file of "BP-Rest-Endpoints" version 0.0.1, 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:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin216 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11940216

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.14
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%
Functions17
▷ Named functions1482.35%
▷ Anonymous functions317.65%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin