84% hjyl-comment-spam

Code Review | Hjyl Comment Spam

WordPress plugin Hjyl Comment Spam scored84%from 54 tests.

About plugin

  • Plugin page: hjyl-comment-spam
  • Plugin version: 1.3
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.2.4
  • WordPress version: 6.3.1
  • First release: May 14, 2015
  • Latest release: Oct 22, 2019
  • Number of updates: 7
  • Update frequency: every 231.7 days
  • Top authors: hjyl (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /833 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
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.38ms] Passed 4 tests

An overview of server-side resources used by Hjyl Comment Spam
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0343.55 ▲0.71
Dashboard /wp-admin3.33 ▲0.0348.75 ▲0.57
Posts /wp-admin/edit.php3.38 ▲0.0344.28 ▼7.97
Add New Post /wp-admin/post-new.php5.91 ▲0.0385.40 ▼10.83
Media Library /wp-admin/upload.php3.25 ▲0.0337.97 ▲3.85
HJYL COMMENT SPAM /wp-admin/options-general.php?page=hjyl-comment-spam3.2231.31

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Hjyl Comment Spam
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4913.66 ▼0.721.92 ▼0.4144.47 ▼3.39
Dashboard /wp-admin2,213 ▲285.83 ▼0.08105.21 ▼2.6636.44 ▼3.09
Posts /wp-admin/edit.php2,093 ▲12.01 ▼0.0034.96 ▼6.4636.81 ▼3.38
Add New Post /wp-admin/post-new.php1,537 ▲2323.09 ▲5.46692.86 ▲70.1555.03 ▲4.28
Media Library /wp-admin/upload.php1,395 ▲104.24 ▲0.0897.91 ▼5.0241.55 ▼2.34
HJYL COMMENT SPAM /wp-admin/options-general.php?page=hjyl-comment-spam8462.0430.5829.96

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% 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 everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/hjyl-comment-spam/hjyl-comment-spam.php:12

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, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: You should set the name of your plugin on the first line ( === hjyl-comment-spam === )
You can look at the official readme.txt

hjyl-comment-spam/hjyl-comment-spam.php Passed 13 tests

The entry point to "Hjyl Comment Spam" version 1.3 is a PHP file that has certain tags in its header comment area
100 characters long description:
A simple Anti Spam for Comment by number or english.非常简单的数字或字母评论验证码。

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected194 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP11217102
PO File118636951
CSS11041

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There were not PNG files found in your plugin