78% commentpress-core

Code Review | CommentPress Core

WordPress plugin CommentPress Core scored 78% from 54 tests.

About plugin

  • Plugin page: commentpress-core
  • Plugin version: 3.9.15
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.8
  • WordPress version: 5.8.1
  • First release: Nov 13, 2012
  • Latest release: Oct 2, 2021
  • Number of updates: 108
  • Update frequency: every 30.1 days
  • Top authors: commentpress (97.22%)needle (3.7%)

Code review

54 tests

User reviews

9 reviews

Install metrics

100+ active / 21,680 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲1.67MB] [CPU: ▼138.04ms] Passed 4 tests

Analyzing server-side resources used by CommentPress Core
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.75 ▲1.9160.52 ▲37.15
Dashboard /wp-admin4.81 ▲1.7440.49 ▲2.28
Posts /wp-admin/edit.php4.84 ▲1.7338.61 ▲1.51
Add New Post /wp-admin/post-new.php6.91 ▲1.4876.95 ▼562.90
Media Library /wp-admin/upload.php4.74 ▲1.7431.05 ▲6.94
Customize /wp-admin/customize.php7.96105.88
Header /wp-admin/themes.php?page=custom-header4.7632.07
CommentPress Core /wp-admin/options-general.php?page=commentpress_admin4.7028.45

Server storage [IO: ▲4.15MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 337 new files
Database: no new tables, 15 new options
New WordPress options
commentpress_page_comments
widget_commentpress_text
theme_mods_commentpress-modern
commentpress_page_for_posts
theme_switched
commentpress_options
commentpress_show_on_front
commentpress_sidebars_widgets
widget_recent-comments
widget_recent-posts
...

Browser metrics Passed 4 tests

Checking browser requirements for CommentPress Core
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /5,497 ▲1,89621.60 ▲6.04112.33 ▲106.8584.66 ▲2.12
Dashboard /wp-admin2,957 ▲616.02 ▼0.13112.98 ▼29.05163.78 ▼21.75
Posts /wp-admin/edit.php2,707 ▼363.37 ▲0.1460.98 ▼2.34130.42 ▼9.49
Add New Post /wp-admin/post-new.php2,593 ▼1,22224.44 ▲5.58379.08 ▼66.26169.39 ▲4.05
Media Library /wp-admin/upload.php1,782 ▲305.58 ▲0.06117.24 ▼28.99182.24 ▼5.78
Customize /wp-admin/customize.php11,64027.11661.14278.07
Header /wp-admin/themes.php?page=custom-header1,9845.1390.34178.95
CommentPress Core /wp-admin/options-general.php?page=commentpress_admin1,8342.5652.40150.85
Header /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php&autofocus%5Bcontrol%5D=header_image11,64026.85542.34236.00

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 8 options in the database
    • theme_mods_commentpress-modern
    • current_theme
    • template_root
    • widget_recent-posts
    • widget_commentpress_text
    • stylesheet_root
    • widget_recent-comments
    • theme_switched

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 9× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/commentpress-core/themes/commentpress-flat/assets/templates/comment_form.php
    • > /wp-content/plugins/commentpress-core/themes/commentpress-theme/assets/templates/comments_by_para.php
    • > /wp-content/plugins/commentpress-core/themes/commentpress-theme/comments.php
    • > /wp-content/plugins/commentpress-core/themes/commentpress-flat/assets/templates/comments_by_para.php
    • > /wp-content/plugins/commentpress-core/themes/commentpress-flat/comments.php
    • > /wp-content/plugins/commentpress-core/themes/commentpress-modern/comments.php
    • > /wp-content/plugins/commentpress-core/themes/commentpress-modern/assets/templates/comment_form.php
    • > /wp-content/plugins/commentpress-core/themes/commentpress-theme/assets/templates/comment_form.php
    • > /wp-content/plugins/commentpress-core/themes/commentpress-modern/assets/templates/comments_by_para.php
  • 138× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_template() in wp-content/plugins/commentpress-core/themes/commentpress-flat/header-wp-activate.php:1
    • > PHP Notice
      Trying to get property 'nav' of non-object in wp-content/plugins/commentpress-core/themes/commentpress-flat/welcome.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_template() in wp-content/plugins/commentpress-core/themes/commentpress-theme/header-wp-activate.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function commentpress_is_commentable() in wp-content/plugins/commentpress-core/themes/commentpress-modern/assets/templates/activity_sidebar.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/commentpress-core/themes/commentpress-flat/assets/templates/archive_sidebar.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/commentpress-core/themes/commentpress-flat/archive.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_userdata() in wp-content/plugins/commentpress-core/themes/commentpress-theme/author.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/commentpress-core/themes/commentpress-theme/taxonomy-comment_tags.php:17
    • > PHP Notice
      Undefined variable: wp_version in wp-content/plugins/commentpress-core/themes/commentpress-theme/group.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_sidebar() in wp-content/plugins/commentpress-core/themes/commentpress-theme/footer-wp-activate.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

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
9 plugin tags: blogs, groups, commentpress, debate, groupblogs...

commentpress-core/commentpress-core.php Passed 13 tests

The main file in "CommentPress Core" v. 3.9.15 serves as a complement to information provided in readme.txt and as the entry point to the plugin
126 characters long description:
CommentPress allows readers to comment in the margins of a text. You can use it to annotate, gloss, workshop, debate and more!

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin50,329 lines of code in 182 files:
LanguageFilesBlank linesComment linesLines of code
CSS424,8552,83922,716
PHP9813,84313,34715,933
JavaScript385,4356,7857,119
PO File41,8214,7954,561

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity68.75
▷ Minimum class complexity1.00
▷ Maximum class complexity312.00
Average method complexity3.79
▷ Minimum method complexity1.00
▷ Maximum method complexity78.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes00.00%
Methods485
▷ Static methods102.06%
▷ Public methods47497.73%
▷ Protected methods20.41%
▷ Private methods91.86%
Functions164
▷ Named functions164100.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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
25 PNG files occupy 0.61MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
themes/commentpress-theme/assets/images/texthighlighter/highlight-caret.png1.26KB0.18KB▼ 85.71%
themes/commentpress-theme/assets/images/icons/information.png0.76KB0.83KB0.00%
themes/commentpress-theme/assets/images/buddypress/closed.png0.31KB0.21KB▼ 31.11%
themes/commentpress-flat/assets/images/buddypress/feed.png0.67KB0.70KB0.00%
themes/commentpress-theme/assets/images/icons/comment_add.png0.52KB0.38KB▼ 25.66%