90% apoyl-captcha

Code Review | [凹凸曼]中文验证码

WordPress plugin [凹凸曼]中文验证码 scored90%from 54 tests.

About plugin

  • Plugin page: apoyl-captcha
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.1-6.4
  • WordPress version: 6.3.1
  • First release: Jun 2, 2023
  • Latest release: Nov 23, 2023
  • Number of updates: 5
  • Update frequency: every 34.8 days
  • Top authors: apoyl (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /232 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.04MB] [CPU: ▼6.81ms] Passed 4 tests

A check of server-side resources used by [凹凸曼]中文验证码
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0542.94 ▲1.47
Dashboard /wp-admin3.36 ▲0.0146.36 ▼18.33
Posts /wp-admin/edit.php3.47 ▲0.1148.36 ▼1.27
Add New Post /wp-admin/post-new.php5.94 ▲0.0595.53 ▼5.05
Media Library /wp-admin/upload.php3.28 ▲0.0535.30 ▼2.60
settings /wp-admin/options-general.php?page=apoyl-captcha-settings3.2632.65

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 31 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
apoyl-captcha-settings
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for [凹凸曼]中文验证码
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲6614.20 ▼0.081.98 ▲0.2645.78 ▲3.05
Dashboard /wp-admin2,199 ▲225.63 ▲0.0290.69 ▲2.8039.14 ▼3.44
Posts /wp-admin/edit.php2,104 ▲42.00 ▼0.0139.79 ▼2.0335.36 ▼0.01
Add New Post /wp-admin/post-new.php1,529 ▲323.01 ▼0.12668.07 ▲50.2667.73 ▲11.53
Media Library /wp-admin/upload.php1,404 ▲44.26 ▲0.0395.12 ▼0.0943.21 ▼1.81
settings /wp-admin/options-general.php?page=apoyl-captcha-settings8412.0026.3926.76

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests Passed 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 Passed 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
The SRP test was a success

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 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
1 plugin tags: captcha

apoyl-captcha/apoyl-captcha.php Passed 13 tests

The main PHP script in "[凹凸曼]中文验证码" version 1.2.0 is automatically included on every request by WordPress
127 characters long description:
实现网站注册用户的时候,显示弹层中文点击验证码,防止恶意注册,恶意信息发表,恶意评论.

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
There were no executable files found in this plugin716 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP15115176524
JavaScript33198
CSS10094

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity6.78
▷ Minimum class complexity1.00
▷ Maximum class complexity37.00
Average method complexity2.44
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods37
▷ Static methods410.81%
▷ Public methods2875.68%
▷ Protected methods00.00%
▷ Private methods924.32%
Functions4
▷ Named functions4100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
api/clicaptcha/image/refresh.png1.48KB0.45KB▼ 69.83%