10% commentarysandbox

Code Review | CommentarySandbox

WordPress plugin CommentarySandbox scored10%from 54 tests.

About plugin

  • Plugin page: commentarysandbox
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-5.2
  • WordPress version: 6.3.1
  • First release: May 25, 2017
  • Latest release: May 25, 2019
  • Number of updates: 7
  • Update frequency: every 104.4 days
  • Top authors: bmulligan3 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,039 total downloads

Benchmarks

Plugin footprint 22% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/commentarysandbox/commentpress-core/class_commentpress.php+4927
    Use of undefined constant _FILE_ - assumed '_FILE_' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼0.81MB] [CPU: ▼52.20ms] Passed 4 tests

An overview of server-side resources used by CommentarySandbox
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.18 ▼0.2812.30 ▼28.03
Dashboard /wp-admin3.21 ▼0.1313.98 ▼52.52
Posts /wp-admin/edit.php3.21 ▼0.1415.44 ▼42.11
Add New Post /wp-admin/post-new.php3.21 ▼2.6814.23 ▼86.13
Media Library /wp-admin/upload.php3.21 ▼0.0213.62 ▼22.25
Customize /wp-admin/customize.php3.2416.00
CommentarySandbox /wp-admin/options-general.php?page=commentpress_admin3.2115.94
Header /wp-admin/themes.php?page=custom-header3.2215.10

Server storage [IO: ▲4.71MB] [DB: ▲0.01MB] 67% from 3 tests

Input-output and database impact of this plugin
Just a few items left to fix
  • Illegal file modification found: 1 file (4.00KB) outside of "wp-content/plugins/commentarysandbox/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 342 new files
Database: 1 new table, 19 new options
New tables
wp_commentpress_new_field
New WordPress options
template_root
commentpress_options
commentpress_page_for_posts
widget_theysaidso_widget
widget_recent-comments
commentpress_page_comments
current_theme
commentpress_sidebars_widgets
can_compress_scripts
theme_switched
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for CommentarySandbox
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,462 ▲71615.03 ▲0.6534.77 ▲32.9548.21 ▲7.36
Dashboard /wp-admin2,245 ▲845.84 ▲0.2495.26 ▼3.8539.60 ▲0.57
Posts /wp-admin/edit.php2,064 ▼332.05 ▼0.0740.28 ▲0.6335.54 ▲1.38
Add New Post /wp-admin/post-new.php5,144 ▲3,61322.86 ▼0.46897.63 ▲208.26123.40 ▲58.48
Media Library /wp-admin/upload.php1,423 ▲294.25 ▲0.01100.14 ▼32.0844.73 ▼11.12
Customize /wp-admin/customize.php7,32621.70632.26137.23
CommentarySandbox /wp-admin/options-general.php?page=commentpress_admin1,4112.0724.7140.44
Header /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php&autofocus%5Bcontrol%5D=header_image8,44323.81454.3075.88
Header /wp-admin/themes.php?page=custom-header1,3873.9564.5189.38

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/commentarysandbox/commentpress-core/class_commentpress.php+4927
    Use of undefined constant _FILE_ - assumed '_FILE_' (this will throw an Error in a future version of PHP)
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_commentpress_new_field
  • This plugin does not fully uninstall, leaving 13 options in the database
    • template_root
    • db_upgraded
    • can_compress_scripts
    • theme_mods_twentytwentythree
    • widget_commentpress_text
    • widget_theysaidso_widget
    • widget_recent-comments
    • theme_mods_commentpress-modern
    • current_theme
    • stylesheet_root
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=custom-header
    • > Warning in wp-content/plugins/commentarysandbox/commentpress-core/class_commentpress.php+4927
    Use of undefined constant _FILE_ - assumed '_FILE_' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/customize.php
    • > Notice in wp-content/plugins/commentarysandbox/commentpress-core/class_commentpress_display.php+625
    Undefined variable: popover_textblock
    • > GET request to /wp-admin/customize.php
    • > Notice in wp-content/plugins/commentarysandbox/commentpress-core/class_commentpress_display.php+627
    Undefined variable: popover_comment

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 items
  • 9× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/commentarysandbox/themes/commentpress-flat/assets/templates/comments_by_para.php
    • > /wp-content/plugins/commentarysandbox/themes/commentpress-theme/assets/templates/comments_by_para.php
    • > /wp-content/plugins/commentarysandbox/themes/commentpress-theme/comments.php
    • > /wp-content/plugins/commentarysandbox/themes/commentpress-modern/comments.php
    • > /wp-content/plugins/commentarysandbox/themes/commentpress-flat/comments.php
    • > /wp-content/plugins/commentarysandbox/themes/commentpress-theme/assets/templates/comment_form.php
    • > /wp-content/plugins/commentarysandbox/themes/commentpress-modern/assets/templates/comments_by_para.php
    • > /wp-content/plugins/commentarysandbox/themes/commentpress-modern/assets/templates/comment_form.php
    • > /wp-content/plugins/commentarysandbox/themes/commentpress-flat/assets/templates/comment_form.php
  • 138× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant COMMENTPRESS_PLUGIN_PATH - assumed 'COMMENTPRESS_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/commentarysandbox/themes/commentpress-modern/functions.php on line 29
    • > PHP Notice
      Undefined variable: wp_version in wp-content/plugins/commentarysandbox/themes/commentpress-theme/group.php on line 31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/commentarysandbox/themes/commentpress-flat/assets/templates/toc_dropdown.php:41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function commentpress_get_all_comments_page_content() in wp-content/plugins/commentarysandbox/themes/commentpress-modern/comments-all.php:46
    • > PHP Notice
      Trying to get property 'comment_status' of non-object in wp-content/plugins/commentarysandbox/themes/commentpress-theme/assets/templates/comments_in_page.php on line 126
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_multisite() in wp-content/plugins/commentarysandbox/themes/commentpress-modern/assets/templates/navigation.php:551
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/commentarysandbox/themes/commentpress-theme/search.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/commentarysandbox/themes/commentpress-theme/404.php:1
    • > PHP Fatal error
      require_once(): Failed opening required 'COMMENTPRESS_PLUGIN_PATHcommentpress-core/assets/includes/theme/theme-functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/commentarysandbox/themes/commentpress-flat/functions.php on line 29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/commentarysandbox/themes/commentpress-flat/404.php:1

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
    • > GET request to /wp-admin/customize.php
    • > Security (warning) in unknown
    /?customize_changeset_uuid=a8e7464e-5e78-47c8-8a50-31bf7f084e68&customize_theme=commentpress-modern&customize_messenger_channel=preview-0 - An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php&autofocus%5Bcontrol%5D=header_image
    • > Network (severe)
    wp-content/plugins/commentarysandbox/themes/commentpress-modern/assets/css/style.css?ver=1.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php&autofocus%5Bcontrol%5D=header_image
    • > Network (severe)
    wp-content/plugins/commentarysandbox/themes/commentpress-modern/assets/css/responsive.css?ver=1.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/customize.php
    • > Javascript (severe) in unknown
    /?customize_changeset_uuid=a8e7464e-5e78-47c8-8a50-31bf7f084e68&customize_theme=commentpress-modern&customize_messenger_channel=preview-0 657:38 Uncaught TypeError: Cannot read properties of null (reading 'click')
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php&autofocus%5Bcontrol%5D=header_image
    • > Console-api (warning) in unknown
    /wp-includes/js/jquery/jquery.min.js?ver=3.7.0 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'handler')" "TypeError: Cannot read properties of undefined (reading 'handler')\n at HTMLParagraphElement.setup (/wp-content/plugins/commentarysandbox/commentpress-core/assets/js/jquery.highlighter.min.js?ver=3.9:1:288)\n at Object.add (/wp-includes/js/jquery/jquery.min.js?ver=3.7.0:2:38402)\n at Object.\u003Canonymous> (/wp-includes/js/jquery/jquery-migrate.min.js?ver=3.4.1:2:9827)\n at e.\u003Ccomputed> [as add] (/wp-includes/js/jquery/jquery-migrate.min.js?ver=3.4.1:2:1582)\n at HTMLParagraphElement.\u003Canonymous> (/wp-includes/js/jquery/jquery.min.js?ver=3.7.0:2:37080)\n at Function.each (/wp-includes/js/jquery/jquery.min.js?ver=3.7.0:2:3129)\n at e.\u003Ccomputed>.each (/wp-includes/js/jquery/jquery.min.js?ver=3.7.0:2:1594)\n at Le (/wp-includes/js/jquery/jquery.min.js?ver=3.7.0:2:37055)\n at e.\u003Ccomputed>.on (/wp-includes/js/jquery/jquery.min.js?ver=3.7.0:2:44440)\n at e.\u003Ccomputed>.\u003Canonymous> (/wp-includes/js/jquery/jquery-migrate.min.js?ver=3.4.1:2:10808)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php&autofocus%5Bcontrol%5D=header_image
    • > Javascript (severe) in unknown
    /wp-includes/js/jquery/jquery.min.js?ver=3.7.0 1:28721 Uncaught TypeError: Cannot read properties of undefined (reading 'handler')
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php&autofocus%5Bcontrol%5D=header_image
    • > Security (warning) in unknown
    /?customize_changeset_uuid=bbc4da20-a6d2-40e5-9c6f-befa2736e251&customize_theme=commentpress-modern&customize_messenger_channel=preview-0 - An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php&autofocus%5Bcontrol%5D=header_image
    • > Javascript (severe) in unknown
    /?customize_changeset_uuid=bbc4da20-a6d2-40e5-9c6f-befa2736e251&customize_theme=commentpress-modern&customize_messenger_channel=preview-0 657:38 Uncaught TypeError: Cannot read properties of null (reading 'click')

Optimizations

Plugin configuration 90% 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: commentpress, blogs, commentarysandbox, collaboration, dcc...

commentarysandbox/commentpress-core.php 77% from 13 tests

The main PHP script in "CommentarySandbox" version 2.2 is automatically included on every request by WordPress
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 ("commentarysandbox.php" instead of "commentpress-core.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Description: The description should be shorter than 140 characters (currently 320 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected52,485 lines of code in 194 files:
LanguageFilesBlank linesComment linesLines of code
CSS425,2292,80625,148
PHP10817,81512,16716,701
JavaScript3728,4885,2365,894
PO File41,9265,1964,529
Markdown1940154
Bourne Shell121958
SVG1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity72.47
▷ Minimum class complexity1.00
▷ Maximum class complexity326.00
Average method complexity3.79
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes00.00%
Methods487
▷ Static methods91.85%
▷ Public methods47797.95%
▷ Protected methods20.41%
▷ Private methods81.64%
Functions148
▷ Named functions148100.00%
▷ Anonymous functions00.00%
Constants26
▷ Global constants1765.38%
▷ Class constants934.62%
▷ Public constants9100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
23 PNG files occupy 0.61MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
themes/commentpress-theme/assets/images/icons/page.png0.62KB0.92KB0.00%
themes/commentpress-modern/screenshot.png353.04KB120.52KB▼ 65.86%
themes/commentpress-flat/assets/images/buddypress/closed.png0.31KB0.21KB▼ 31.11%
themes/commentpress-theme/assets/images/icons/information.png0.76KB0.83KB0.00%
themes/commentpress-flat/assets/images/icons/comment_add.png0.52KB0.38KB▼ 25.66%