10% comments-for-me

Code Review | My Comments

WordPress plugin My Comments scored10%from 54 tests.

About plugin

  • Plugin page: comments-for-me
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.1-2.6.0
  • WordPress version: 6.3.1
  • First release: Jan 29, 2013
  • Latest release: Jan 30, 2013
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: mwayi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /806 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/comments-for-me/configure.php+10
    Only variables should be passed by reference

Server metrics [RAM: ▼1.92MB] [CPU: ▼52.73ms] Passed 4 tests

A check of server-side resources used by My Comments
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.404.53 ▼39.60
Dashboard /wp-admin2.09 ▼1.226.42 ▼41.49
Posts /wp-admin/edit.php2.09 ▼1.275.51 ▼49.06
Add New Post /wp-admin/post-new.php2.09 ▼3.807.40 ▼80.75
Media Library /wp-admin/upload.php2.09 ▼1.155.26 ▼30.60

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

My Comments: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲5114.23 ▲0.121.66 ▼0.2544.36 ▲2.01
Dashboard /wp-admin2,204 ▲335.62 ▼0.0191.97 ▼7.0441.89 ▼8.50
Posts /wp-admin/edit.php2,112 ▲122.03 ▼0.0040.38 ▲3.2737.65 ▲1.29
Add New Post /wp-admin/post-new.php1,536 ▲123.47 ▲5.04691.11 ▲13.3458.02 ▼21.50
Media Library /wp-admin/upload.php1,415 ▲184.24 ▲0.03101.75 ▼3.6448.47 ▲1.93

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/comments-for-me/configure.php+10
    Only variables should be passed by reference
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • 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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 18× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/comments-for-me/_layouts/comments/edit.php:5
    • > PHP Notice
      Only variables should be passed by reference in wp-content/plugins/comments-for-me/configure.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/comments-for-me/_layouts/comments/pending.php:5
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/comments-for-me/_layouts/comments/reply.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/comments-for-me/_layouts/comments/spam.php:5
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/comments-for-me/_inc/libs/smrtr.table.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/comments-for-me/_layouts/comments/approved.php:5
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/comments-for-me/_inc/libs/smrtr.table.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'smtrWp_Table_Core' not found in wp-content/plugins/comments-for-me/_inc/admin-listing-tables.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/comments-for-me/configure.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
1 plugin tags: author comments

comments-for-me/my-comments.php 92% from 13 tests

"My Comments" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("comments-for-me.php" instead of "my-comments.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected4,388 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
CSS2115113,020
PHP22692851,368

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity13.09
▷ Minimum class complexity1.00
▷ Maximum class complexity33.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods98
▷ Static methods2929.59%
▷ Public methods9596.94%
▷ Protected methods00.00%
▷ Private methods33.06%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants18
▷ Global constants18100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 compressed PNG files occupy 0.02MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
_assets/img/glyphicons-halflings-white.png8.57KB9.20KB0.00%
_assets/img/glyphicons-halflings.png13.50KB10.35KB▼ 23.34%