88% dfoxc-comments

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

WordPress plugin DFOXC-Comments 富文本评论框插件 scored 88% 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: 5.9.2
  • 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 / 780 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.09MB] [CPU: ▼292.46ms] Passed 4 tests

This is a short check of server-side resources used by DFOXC-Comments 富文本评论框插件
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.1758.86 ▲5.59
Dashboard /wp-admin3.52 ▲0.1237.43 ▲4.00
Posts /wp-admin/edit.php3.75 ▲0.1143.40 ▲6.86
Add New Post /wp-admin/post-new.php6.99 ▲0.02110.01 ▼1,180.88
Media Library /wp-admin/upload.php3.40 ▲0.1027.81 ▲1.44
↳ 评论框设置 /wp-admin/admin.php?page=comments3.3425.87
DFOXWP 设置 /wp-admin/admin.php?page=dfox_wp_admin3.4327.76

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 37 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by DFOXC-Comments 富文本评论框插件
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,792 ▲3816.01 ▲0.446.31 ▲0.492.42 ▼0.16
Dashboard /wp-admin2,922 ▲686.11 ▼0.15117.84 ▼14.59179.19 ▲21.55
Posts /wp-admin/edit.php2,717 ▲293.24 ▼0.0060.33 ▼5.28150.39 ▲10.26
Add New Post /wp-admin/post-new.php1,680 ▲1916.76 ▲0.62417.89 ▲6.12156.86 ▼0.94
Media Library /wp-admin/upload.php1,727 ▲295.54 ▲0.06142.35 ▼5.82210.62 ▲18.27
↳ 评论框设置 /wp-admin/admin.php?page=comments2,0803.2968.23334.09
DFOXWP 设置 /wp-admin/admin.php?page=dfox_wp_admin1,4202.7754.67267.99

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstall script ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > 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: Interface 'Emojione\\RulesetInterface' not found in wp-content/plugins/dfoxc-comments/form/themes/pure/lib/Ruleset.php:10
    • > 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: Call to undefined function wp_cache_get() in wp-content/plugins/dfoxc-comments/form/load.php:3
    • > 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: 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 add_filter() in wp-content/plugins/dfoxc-comments/form/public.func.php:32

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=5.9.2 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 is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: dfox, doofox, nnnn, emoji, comments...

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

The entry point to "DFOXC-Comments 富文本评论框插件" version 1.0.2 is a PHP file that has certain tags in its header comment area
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 ("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
Everything looks great! No dangerous files found in this plugin7,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

This plugin's cyclomatic complexity and code structure detailed below
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected