72% ps-phpcaptcha

Code Review | PS PHPCaptcha WP

WordPress plugin PS PHPCaptcha WP scored72%from 54 tests.

About plugin

  • Plugin page: ps-phpcaptcha
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 23, 2018
  • Latest release: Jul 21, 2023
  • Number of updates: 19
  • Update frequency: every 89.5 days
  • Top authors: pstimpel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /724 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▼5.17ms] Passed 4 tests

This is a short check of server-side resources used by PS PHPCaptcha WP
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0639.49 ▼3.28
Dashboard /wp-admin3.39 ▲0.0952.08 ▼2.46
Posts /wp-admin/edit.php3.50 ▲0.1455.38 ▲8.56
Add New Post /wp-admin/post-new.php5.96 ▲0.0883.27 ▼15.66
Media Library /wp-admin/upload.php3.29 ▲0.0636.82 ▲0.73
PSPHPCaptchaWP /wp-admin/options-general.php?page=psphpcaptchawp3.3838.75

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

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

Browser metrics Passed 4 tests

A check of browser resources used by PS PHPCaptcha WP
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,036 ▲27515.04 ▲0.774.71 ▲2.5940.15 ▼9.51
Dashboard /wp-admin2,362 ▲1986.37 ▲0.79121.05 ▲19.6940.80 ▼1.88
Posts /wp-admin/edit.php2,293 ▲1963.62 ▲1.5459.18 ▲21.6734.29 ▼3.96
Add New Post /wp-admin/post-new.php1,547 ▲1923.28 ▼0.01652.87 ▼32.1738.64 ▼15.22
Media Library /wp-admin/upload.php1,427 ▲274.38 ▲0.2086.14 ▼11.9247.21 ▲1.76
PSPHPCaptchaWP /wp-admin/options-general.php?page=psphpcaptchawp1,5573.6062.7161.25

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 25% 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/ps-phpcaptcha/public/renderimage.php
    • > /wp-content/plugins/ps-phpcaptcha/public/partials/psphpcaptchawp-public-display.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/ps-phpcaptcha/admin/partials/psphpcaptchawp-admin-display.php:17

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=psphpcaptchawp
    • > Network (severe)
    wp-content/plugins/ps-phpcaptcha/admin/wp-color-picker-script.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
4 plugin tags: captcha, spam, recaptcha-replacement, comments

ps-phpcaptcha/psphpcaptchawp.php 85% from 13 tests

The principal PHP file in "PS PHPCaptcha WP" v. 1.2.0 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ps-phpcaptcha.php" instead of "psphpcaptchawp.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
There were no executable files found in this plugin1,123 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP13337639790
PO File3126210322
JavaScript295611
CSS2080
SQL1120

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity9.12
▷ Minimum class complexity1.00
▷ Maximum class complexity29.00
Average method complexity2.44
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods45
▷ Static methods715.56%
▷ Public methods3680.00%
▷ Protected methods00.00%
▷ Private methods920.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
8 PNG files occupy 1.18MB with 0.47MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png96.93KB42.12KB▼ 56.54%
assets/screenshot-1.png0.84KB0.84KB▼ 0.70%
assets/icon-128x128.png31.30KB13.68KB▼ 56.30%
assets/screenshot-3.png2.27KB1.43KB▼ 36.84%
assets/screenshot-4.png49.69KB24.18KB▼ 51.35%