78% commons-in-a-box

Code Review | Commons In A Box

WordPress plugin Commons In A Box scored78%from 54 tests.

About plugin

  • Plugin page: commons-in-a-box
  • Plugin version: 1.5.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.8-6.3
  • WordPress version: 6.3.1
  • First release: Nov 19, 2012
  • Latest release: Aug 10, 2023
  • Number of updates: 89
  • Update frequency: every 44.3 days
  • Top authors: boonebgorges (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

40+ active /34,163 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼5.24ms] Passed 4 tests

A check of server-side resources used by Commons In A Box
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0636.39 ▼4.00
Dashboard /wp-admin3.35 ▲0.0544.83 ▼9.73
Posts /wp-admin/edit.php3.41 ▲0.0547.57 ▲1.88
Add New Post /wp-admin/post-new.php5.94 ▲0.0584.43 ▼9.10
Media Library /wp-admin/upload.php3.28 ▲0.0537.39 ▲3.41

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 106 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Commons In A Box
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.27 ▼1.104.32 ▲2.5040.72 ▼2.16
Dashboard /wp-admin2,229 ▲445.84 ▼0.02104.05 ▼0.8238.32 ▼5.14
Posts /wp-admin/edit.php2,121 ▲352.00 ▼0.0040.23 ▲3.7039.94 ▲4.62
Add New Post /wp-admin/post-new.php1,563 ▲4423.41 ▲0.27640.46 ▼33.0757.69 ▲7.33
Media Library /wp-admin/upload.php1,414 ▲264.31 ▲0.1496.37 ▼6.5846.37 ▲0.38

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/commons-in-a-box/admin/templates/base/footer.php
  • 44× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/commons-in-a-box/admin/templates/openlab/description.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cbox_get_theme_prop() in wp-content/plugins/commons-in-a-box/admin/templates/base/package-details.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cbox_welcome_panel_classes() in wp-content/plugins/commons-in-a-box/admin/templates/base/welcome.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'CBox_Package' not found in wp-content/plugins/commons-in-a-box/includes/classic/classic.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/commons-in-a-box/includes/openlab/defaults/bbpress.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/commons-in-a-box/admin/templates/classic/package-details-plugins.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cbox_get_package_prop() in wp-content/plugins/commons-in-a-box/admin/templates/base/package-details-intro.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/commons-in-a-box/admin/templates/base/package-details-theme.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/commons-in-a-box/languages/strings/openlab-theme.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/commons-in-a-box/admin/templates/base/package-details-plugins.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: community, buddypress, education, academic, cuny...

commons-in-a-box/loader.php 92% from 13 tests

This is the main PHP file of "Commons In A Box" version 1.5.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("commons-in-a-box.php" instead of "loader.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected7,561 lines of code in 71 files:
LanguageFilesBlank linesComment linesLines of code
PHP642,1003,6717,379
JavaScript110051
CSS16036
Bourne Again Shell1113028
Markdown222027
PO File181225
JSON10015

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity25.44
▷ Minimum class complexity2.00
▷ Maximum class complexity136.00
Average method complexity3.77
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes32
▷ Abstract classes26.25%
▷ Concrete classes3093.75%
▷ Final classes00.00%
Methods225
▷ Static methods7834.67%
▷ Public methods17176.00%
▷ Protected methods3013.33%
▷ Private methods2410.67%
Functions105
▷ Named functions3735.24%
▷ Anonymous functions6864.76%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
13 PNG files occupy 1.00MB with 0.36MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/wp-plugin-dependencies/screenshot-1.png4.97KB2.65KB▼ 46.75%
admin/images/menu-2x.png2.36KB1.77KB▼ 25.19%
admin/images/logo-cbox_icon-2x.png1.69KB1.02KB▼ 39.47%
admin/images/menu.png1.08KB0.92KB▼ 14.07%
lib/wp-plugin-dependencies/screenshot-2.png11.13KB4.75KB▼ 57.27%