78% dfoxc-comments

Code Review | DFOXC-Comments 富文本评论框插件

WordPress plugin DFOXC-Comments 富文本评论框插件 scored78%from 54 tests.

About plugin

  • Plugin page: dfoxc-comments
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.7.6
  • WordPress version: 6.3.1
  • First release: Mar 24, 2017
  • Latest release: Jun 27, 2021
  • Number of updates: 9
  • Update frequency: every 172.8 days
  • Top authors: hoythan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /979 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▲0.06ms] Passed 4 tests

Analyzing server-side resources used by DFOXC-Comments 富文本评论框插件
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1347.03 ▲1.94
Dashboard /wp-admin3.42 ▲0.1156.99 ▲2.11
Posts /wp-admin/edit.php3.53 ▲0.1754.38 ▲2.02
Add New Post /wp-admin/post-new.php6.00 ▲0.1195.36 ▼5.83
Media Library /wp-admin/upload.php3.34 ▲0.1142.89 ▲5.50
DFOXWP 设置 /wp-admin/admin.php?page=dfox_wp_admin3.3639.59
↳ 评论框设置 /wp-admin/admin.php?page=comments3.2838.23

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for DFOXC-Comments 富文本评论框插件
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲7614.24 ▼0.112.06 ▲0.0242.83 ▼2.87
Dashboard /wp-admin2,221 ▲415.60 ▼0.0193.10 ▲3.6950.27 ▲5.50
Posts /wp-admin/edit.php2,123 ▲202.04 ▼0.0335.78 ▼0.9343.27 ▲8.26
Add New Post /wp-admin/post-new.php1,545 ▲1923.35 ▼0.36691.16 ▲23.0254.38 ▼6.52
Media Library /wp-admin/upload.php1,426 ▲264.18 ▼0.05100.01 ▼6.0352.54 ▲11.12
DFOXWP 设置 /wp-admin/admin.php?page=dfox_wp_admin1,1061.7025.20169.39
↳ 评论框设置 /wp-admin/admin.php?page=comments1,7592.4327.9188.46

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_cache_get() in wp-content/plugins/dfoxc-comments/form/load.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'Emojione\\ClientInterface' not found in wp-content/plugins/dfoxc-comments/form/themes/pure/lib/Client.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_style() in wp-content/plugins/dfoxc-comments/dfox_wp/dfoxwpsuite.class.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/dfoxc-comments/dfox_wp/load.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/dfoxc-comments/form/public.func.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/dfoxc-comments/dfoxc_comments.php:27
    • > PHP Fatal error
      Uncaught Error: Interface 'Emojione\\RulesetInterface' not found in wp-content/plugins/dfoxc-comments/form/themes/pure/lib/Ruleset.php:10

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=dfox_wp_admin
    • > Javascript (severe) in unknown
    /wp-content/plugins/dfoxc-comments/dfox_wp/dfoxwp.min.js?ver=6.3.1 0:114 Uncaught TypeError: Cannot read properties of undefined (reading 'split')

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: comments, emoji, nnnn, dfoxc, dfox...

dfoxc-comments/dfoxc_comments.php 92% from 13 tests

The principal PHP file in "DFOXC-Comments 富文本评论框插件" v. 1.0.2 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("dfoxc-comments.php" instead of "dfoxc_comments.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected7,075 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP211662,9084,442
JavaScript499311,397
Sass31441,158
SVG10076
CSS2002

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity20.89
▷ Minimum class complexity1.00
▷ Maximum class complexity76.00
Average method complexity3.75
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces2
Interfaces2
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods76
▷ Static methods56.58%
▷ Public methods6484.21%
▷ Protected methods56.58%
▷ Private methods79.21%
Functions26
▷ Named functions26100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin