84% json-api-for-buddypress

Code Review | JSON-API-for-BuddyPress

WordPress plugin JSON-API-for-BuddyPress scored84%from 54 tests.

About plugin

  • Plugin page: json-api-for-budd...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.8
  • WordPress version: 6.3.1
  • First release: Nov 22, 2012
  • Latest release: Feb 4, 2014
  • Number of updates: 14
  • Update frequency: every 31.4 days
  • Top authors: tweichart (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /2,970 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

This is a short check of server-side resources used by JSON-API-for-BuddyPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.56 ▲0.03
Dashboard /wp-admin3.31 ▲0.0148.56 ▼2.72
Posts /wp-admin/edit.php3.36 ▲0.0151.12 ▼2.05
Add New Post /wp-admin/post-new.php5.89 ▲0.0184.41 ▼14.76
Media Library /wp-admin/upload.php3.24 ▲0.0139.14 ▲2.24

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for JSON-API-for-BuddyPress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲1414.23 ▼0.491.89 ▼0.0644.95 ▲5.29
Dashboard /wp-admin2,206 ▲295.64 ▼0.0692.34 ▲1.8143.05 ▲0.01
Posts /wp-admin/edit.php2,114 ▲112.13 ▲0.1040.38 ▲2.6535.97 ▲1.55
Add New Post /wp-admin/post-new.php1,539 ▲1323.20 ▲0.17652.16 ▼83.9447.67 ▼12.08
Media Library /wp-admin/upload.php1,411 ▲114.15 ▼0.06109.99 ▼18.8846.80 ▼4.18

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

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
Even though no errors were found, this is by no means an exhaustive test

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
The following issues need your attention
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant JSON_API_FOR_BUDDYPRESS_HOME - assumed 'JSON_API_FOR_BUDDYPRESS_HOME' (this will throw an Error in a future version of PHP) in wp-content/plugins/json-api-for-buddypress/controllers/BuddypressRead.php on line 8
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/json-api-for-buddypress/json-api-for-buddypress.php on line 13
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/json-api-for-buddypress/json-api-for-buddypress.php on line 13
    • > PHP Fatal error
      Uncaught Error: Class 'JSON_API_BuddypressRead_Controller' not found in wp-content/plugins/json-api-for-buddypress/library/functions.class.php:3
    • > PHP Warning
      require_once(JSON_API_FOR_BUDDYPRESS_HOME/library/functions.class.php): failed to open stream: No such file or directory in wp-content/plugins/json-api-for-buddypress/controllers/BuddypressRead.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/json-api-for-buddypress/json-api-for-buddypress.php:19
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/json-api-for-buddypress/json-api-for-buddypress.php on line 13
    • > PHP Fatal error
      require_once(): Failed opening required 'JSON_API_FOR_BUDDYPRESS_HOME/library/functions.class.php' (include_path='.:/usr/share/php') in wp-content/plugins/json-api-for-buddypress/controllers/BuddypressRead.php on line 8

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: json, buddypress, api

json-api-for-buddypress/json-api-for-buddypress.php Passed 13 tests

The main file in "JSON-API-for-BuddyPress" v. 1.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
47 characters long description:
Extends the JSON API to be used with Buddypress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin1,155 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP4163181995
PO File24850160

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity105.00
▷ Minimum class complexity78.00
▷ Maximum class complexity132.00
Average method complexity7.12
▷ Minimum method complexity2.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods34
▷ Static methods926.47%
▷ Public methods2470.59%
▷ Protected methods720.59%
▷ Private methods38.82%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
PNG images were not found in this plugin