10% captcha-in-thai-2nd

Code Review | CAPTCHA in Thai 2nd

WordPress plugin CAPTCHA in Thai 2nd scored10%from 54 tests.

About plugin

  • Plugin page: captcha-in-thai-2nd
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.8.1
  • WordPress version: 6.3.1
  • First release: Feb 26, 2014
  • Latest release: Mar 19, 2014
  • Number of updates: 16
  • Update frequency: every 1.4 days
  • Top authors: captcha-in-thai (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,845 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
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/captcha-in-thai-2nd/math.php+2
    session_start(): A session had already been started - ignoring

Server metrics [RAM: ▼1.67MB] [CPU: ▼51.63ms] Passed 4 tests

A check of server-side resources used by CAPTCHA in Thai 2nd
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.32 ▼1.146.99 ▼29.89
Dashboard /wp-admin2.34 ▼1.007.72 ▼49.96
Posts /wp-admin/edit.php2.34 ▼1.018.37 ▼38.04
Add New Post /wp-admin/post-new.php2.34 ▼3.548.64 ▼88.63
Media Library /wp-admin/upload.php2.34 ▼0.896.74 ▼26.52

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 57 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
capth_options
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for CAPTCHA in Thai 2nd
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6914.74 ▲0.541.75 ▼0.1344.07 ▲6.12
Dashboard /wp-admin2,221 ▲325.83 ▼0.07106.35 ▲0.0078.32 ▲33.89
Posts /wp-admin/edit.php2,107 ▲182.00 ▲0.0039.23 ▲3.7635.16 ▲1.06
Add New Post /wp-admin/post-new.php1,526 ▲723.56 ▲0.63659.01 ▼2.1657.06 ▼3.48
Media Library /wp-admin/upload.php1,406 ▲244.15 ▼0.06103.92 ▲1.9773.59 ▲28.16

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/captcha-in-thai-2nd/math.php+2
    session_start(): A session had already been started - ignoring
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • capth_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Please fix the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/captcha-in-thai-2nd/images/plugin.php
    • > /wp-content/plugins/captcha-in-thai-2nd/show_in_settings.php
  • 9× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Undefined index: line in wp-content/plugins/captcha-in-thai-2nd/show_in_settings.php on line 143
    • > PHP Notice
      Undefined index: font_name in wp-content/plugins/captcha-in-thai-2nd/show_in_settings.php on line 5
    • > PHP Notice
      session_start(): A session had already been started - ignoring in wp-content/plugins/captcha-in-thai-2nd/math.php on line 2
    • > PHP Notice
      Undefined index: font_color in wp-content/plugins/captcha-in-thai-2nd/show_in_settings.php on line 94
    • > PHP Notice
      Undefined index: font_size in wp-content/plugins/captcha-in-thai-2nd/show_in_settings.php on line 7
    • > PHP Notice
      Undefined index: bg_color in wp-content/plugins/captcha-in-thai-2nd/show_in_settings.php on line 95
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/captcha-in-thai-2nd/captcha-in-thai.php:46
    • > PHP Notice
      Undefined index: line in wp-content/plugins/captcha-in-thai-2nd/show_in_settings.php on line 123
    • > PHP Notice
      Undefined index: line in wp-content/plugins/captcha-in-thai-2nd/show_in_settings.php on line 133

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (หน้าการตั้งค่าปลั๊กอิน : screenshot-1.png : http://www.captcha.in.th/documents/screenshot-1.png), #2 (ตัวอย่าง captcha in Thai ในหน้าเข้าสู่ระบบ : screenshot-2.png : http://www.captcha.in.th/documents/screenshot-2.png), #3 (ตัวอย่าง captcha in Thai ในหน้าลืมพาสเวิด : screenshot-3.png : http://www.captcha.in.th/documents/screenshot-3.png), #4 (ตัวอย่าง captcha in Thai ในหน้าสมัครสมาชิก : screenshot-4.png : http://www.captcha.in.th/documents/screenshot-4.png)
You can take inspiration from this readme.txt

captcha-in-thai-2nd/captcha-in-thai.php 92% from 13 tests

Analyzing the main PHP file in "CAPTCHA in Thai 2nd" version 1.1
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("captcha-in-thai-2nd.php" instead of "captcha-in-thai.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
Success! There were no dangerous files found in this plugin2,482 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP9180961,695
JavaScript113837778
HTML1309

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
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%
Functions37
▷ Named functions37100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
16 PNG files occupy 0.27MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/capt.png8.46KB3.23KB▼ 61.86%
jscolor/hv.png2.80KB7.32KB0.00%
images/br4.png3.50KB0.39KB▼ 88.88%
images/engr2.png30.06KB12.74KB▼ 57.60%
images/logo_eng.png8.08KB2.65KB▼ 67.24%