84% cafe-api

Code Review | CAFEHAUS API

WordPress plugin CAFEHAUS API scored84%from 54 tests.

About plugin

  • Plugin page: cafe-api
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Nov 16, 2022
  • Latest release: Nov 16, 2022
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: cafehaus (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /165 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.66MB] [CPU: ▼27.82ms] Passed 4 tests

An overview of server-side resources used by CAFEHAUS API
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.84 ▼7.19
Dashboard /wp-admin3.32 ▲0.0244.24 ▼5.79
Posts /wp-admin/edit.php3.43 ▲0.0845.09 ▼5.79
Add New Post /wp-admin/post-new.php3.20 ▼2.6935.60 ▼92.52
Media Library /wp-admin/upload.php3.24 ▲0.0235.87 ▲1.61

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

CAFEHAUS API: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.51 ▼0.871.57 ▼0.1844.04 ▼0.95
Dashboard /wp-admin2,203 ▲184.86 ▼0.03100.18 ▼8.6041.53 ▼8.92
Posts /wp-admin/edit.php2,089 ▼32.03 ▲0.0339.77 ▼0.3636.20 ▼0.18
Add New Post /wp-admin/post-new.php1,537 ▲423.42 ▲0.13614.11 ▼45.2764.93 ▲9.78
Media Library /wp-admin/upload.php1,388 ▼34.21 ▼0.1798.96 ▼0.1241.00 ▼2.94

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 did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

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
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
The following issues need your attention
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/cafe-api/includes/api/class_cafehaus_post.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/cafe-api/includes/api/class_cafehaus_comment.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/cafe-api/includes/api/class_cafehaus_category.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/cafe-api/includes/api/class_cafehaus_tag.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/cafe-api/includes/api/class_cafehaus_user.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/cafe-api/includes/api/class_cafehaus_post.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cafe-api/cafehaus-api.php:11

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

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
4 plugin tags: app, restful, json, api

cafe-api/cafehaus-api.php 85% from 13 tests

This is the main PHP file of "CAFEHAUS API" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("cafe-api.php" instead of "cafehaus-api.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 154 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected1,107 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP7117152712
Markdown1480395

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity13.57
▷ Minimum class complexity1.00
▷ Maximum class complexity38.00
Average method complexity3.59
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods34
▷ Static methods00.00%
▷ Public methods2779.41%
▷ Protected methods00.00%
▷ Private methods720.59%
Functions0
▷ Named functions00.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
There are no PNG files in this plugin