84% mb-rest-api

Code Review | MB Rest API

WordPress plugin MB Rest API scored84%from 54 tests.

About plugin

  • Plugin page: mb-rest-api
  • Plugin version: 2.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-6.3.2
  • WordPress version: 6.3.1
  • First release: Jun 9, 2016
  • Latest release: Oct 14, 2023
  • Number of updates: 34
  • Update frequency: every 78.9 days
  • Top authors: rilwis (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /25,627 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼0.30MB] [CPU: ▼16.13ms] Passed 4 tests

A check of server-side resources used by MB Rest API
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0240.71 ▼3.60
Dashboard /wp-admin3.32 ▲0.0249.32 ▼1.84
Posts /wp-admin/edit.php3.43 ▲0.0850.36 ▲0.80
Add New Post /wp-admin/post-new.php4.63 ▼1.2645.87 ▼59.89
Media Library /wp-admin/upload.php3.24 ▲0.0132.80 ▲2.98

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 19 new files
Database: no new tables, 7 new options
New WordPress options
recovery_mode_email_last_sent
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for MB Rest API
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.27 ▼0.031.64 ▼0.3542.90 ▼1.40
Dashboard /wp-admin2,189 ▲125.52 ▼0.1489.80 ▲5.1443.64 ▲1.01
Posts /wp-admin/edit.php2,100 ▼31.97 ▼0.0637.12 ▲3.3234.84 ▲0.21
Add New Post /wp-admin/post-new.php45 ▼1,4810.42 ▼22.650.07 ▼649.938.71 ▼51.05
Media Library /wp-admin/upload.php1,397 ▼34.18 ▼0.04105.27 ▼3.5968.58 ▲23.21

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'MetaBox\\RestApi\\Base' not found in wp-content/plugins/mb-rest-api/src/Term.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'MetaBox\\RestApi\\Base' not found in wp-content/plugins/mb-rest-api/src/Comment.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'MetaBox\\RestApi\\Base' not found in wp-content/plugins/mb-rest-api/src/Post.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'MetaBox\\RestApi\\Base' not found in wp-content/plugins/mb-rest-api/src/User.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'MetaBox\\RestApi\\Base' not found in wp-content/plugins/mb-rest-api/src/Setting.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
Please take inspiration from this readme.txt

mb-rest-api/mb-rest-api.php 92% from 13 tests

This is the main PHP file of "MB Rest API" version 2.0.1, 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:
  • Domain Path: The domain path folder does not exist ("/languages/")

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
Success! There were no dangerous files found in this plugin817 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP16196402812
JSON1005

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity12.30
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity2.77
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes10
▷ Abstract classes110.00%
▷ Concrete classes990.00%
▷ Final classes00.00%
Methods65
▷ Static methods1929.23%
▷ Public methods4975.38%
▷ Protected methods812.31%
▷ Private methods812.31%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.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
There are no PNG files in this plugin