84% cmb2-admin-extension

Code Review | CMB2 Admin Extension

WordPress plugin CMB2 Admin Extension scored84%from 54 tests.

About plugin

  • Plugin page: cmb2-admin-extension
  • Plugin version: 0.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.9
  • WordPress version: 6.3.1
  • First release: Jun 14, 2015
  • Latest release: Apr 24, 2018
  • Number of updates: 95
  • Update frequency: every 11.0 days
  • Top authors: twoelevenjay (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

300+ active /6,034 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

Analyzing server-side resources used by CMB2 Admin Extension
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.35 ▲4.44
Dashboard /wp-admin3.33 ▼0.0246.35 ▼12.70
Posts /wp-admin/edit.php3.38 ▲0.0241.54 ▼4.18
Add New Post /wp-admin/post-new.php5.91 ▲0.0279.19 ▼20.09
Media Library /wp-admin/upload.php3.25 ▲0.0233.99 ▼2.07

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

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

Browser metrics Passed 4 tests

Checking browser requirements for CMB2 Admin Extension
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲3714.25 ▼0.011.73 ▲0.1843.58 ▲2.50
Dashboard /wp-admin2,204 ▲275.57 ▼0.1081.45 ▼7.0241.08 ▼1.12
Posts /wp-admin/edit.php2,110 ▲101.98 ▼0.0235.35 ▼0.2837.25 ▲2.30
Add New Post /wp-admin/post-new.php1,535 ▲723.76 ▲0.47682.41 ▲6.0555.30 ▼8.74
Media Library /wp-admin/upload.php1,409 ▲64.16 ▼0.1595.40 ▼5.9943.61 ▼1.82

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

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 | 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
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cmb2-admin-extension/includes/class-meta-box-settings.php:58
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cmb2-admin-extension/includes/class-meta-box-post-type.php:44

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: forms, fields, settings, options, metaboxes

cmb2-admin-extension/cmb2-admin-extension.php Passed 13 tests

The main PHP script in "CMB2 Admin Extension" version 0.2.3 is automatically included on every request by WordPress
104 characters long description:
CMB2 Admin Extension add a user interface for admins to create CMB2 meta boxes from the WordPress admin.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin1,558 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP5193391837
PO File2237260633
JavaScript1147079
CSS1109

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity16.00
▷ Minimum class complexity7.00
▷ Maximum class complexity34.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods37
▷ Static methods38.11%
▷ Public methods3389.19%
▷ Protected methods00.00%
▷ Private methods410.81%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin