10% captchelfie-captcha-by-selfie

Code Review | Captchelfie - Captcha by Selfie

WordPress plugin Captchelfie - Captcha by Selfie scored10%from 54 tests.

About plugin

  • Plugin page: captchelfie-captc...
  • Plugin version: 1.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0-4.5.2
  • WordPress version: 6.3.1
  • First release: Jun 3, 2016
  • Latest release: Aug 1, 2016
  • Number of updates: 25
  • Update frequency: every 2.4 days
  • Top authors: trof (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active /1,784 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/captchelfie-captcha-by-selfie/captchelfie.php+63
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.73MB] [CPU: ▼59.68ms] Passed 4 tests

An overview of server-side resources used by Captchelfie - Captcha by Selfie
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.30 ▼1.205.41 ▼40.24
Dashboard /wp-admin2.32 ▼1.029.12 ▼44.84
Posts /wp-admin/edit.php2.32 ▼1.087.36 ▼52.64
Add New Post /wp-admin/post-new.php2.32 ▼3.617.17 ▼101.00
Media Library /wp-admin/upload.php2.32 ▼0.957.09 ▼34.25
API.BIO Captchelfie /wp-admin/options-general.php?page=captchelfie2.328.90

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Captchelfie - Captcha by Selfie
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲7214.34 ▼0.001.93 ▲0.0643.53 ▲1.85
Dashboard /wp-admin2,196 ▲195.55 ▼0.1083.37 ▼6.5637.89 ▼10.56
Posts /wp-admin/edit.php2,101 ▲41.94 ▼0.0436.14 ▼0.9632.88 ▼5.11
Add New Post /wp-admin/post-new.php1,540 ▲1418.29 ▼4.80641.12 ▼53.6765.78 ▲13.99
Media Library /wp-admin/upload.php1,404 ▲104.19 ▲0.0196.25 ▼10.9943.30 ▼5.28
API.BIO Captchelfie /wp-admin/options-general.php?page=captchelfie1,1012.2263.6144.31

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/captchelfie-captcha-by-selfie/captchelfie.php+63
    Trying to access array offset on value of type bool
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 24 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=captchelfie
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/captchelfie-captcha-by-selfie/captchelfie.php+89
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=captchelfie
    • > Notice in wp-content/plugins/captchelfie-captcha-by-selfie/captchelfie.php+194
    Undefined variable: content

SRP 50% 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
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/captchelfie-captcha-by-selfie/captchelfie.php:42

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Tags: There are too many tags (27 tag instead of maximum 10)
  • Screenshots: These screenshots require images: #1 (**Captchelfie is ready** - User is about take Captchelfie), #2 (**Captchelfie in progress** - Camera operates), #3 (**Captchelfie passed** - User may proceed), #4 (**Face features** - just for fun), #5 (**Social Share** - User may share the selfie and promote your website)
You can take inspiration from this readme.txt

captchelfie-captcha-by-selfie/captchelfie.php 85% from 13 tests

Analyzing the main PHP file in "Captchelfie - Captcha by Selfie" version 1.0.7
You should first fix the following items:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("captchelfie-captcha-by-selfie.php" instead of "captchelfie.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected2,477 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript52361721,438
PHP312491798
PO File16766184
CSS22157

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity51.00
▷ Minimum class complexity51.00
▷ Maximum class complexity51.00
Average method complexity2.47
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods34
▷ Static methods00.00%
▷ Public methods34100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
11 PNG files occupy 0.70MB with 0.34MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png178.31KB42.24KB▼ 76.31%
screenshot-1.png18.58KB8.76KB▼ 52.84%
img/standard_captcha.png27.45KB11.95KB▼ 56.45%
img/shape.png8.08KB5.63KB▼ 30.31%
img/share.png2.69KB1.94KB▼ 28.09%