78% buddypress-captcha

Code Review | BuddyPress Captcha

WordPress plugin BuddyPress Captcha scored78%from 54 tests.

About plugin

  • Plugin page: buddypress-captcha
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: WordPress 2.8, BuddyPress 1.2.9-4.1
  • WordPress version: 6.3.1
  • First release: Jun 10, 2014
  • Latest release: Oct 23, 2015
  • Number of updates: 9
  • Update frequency: every 55.6 days
  • Top authors: hardeepasrani (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

400+ active /17,813 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

This is a short check of server-side resources used by BuddyPress Captcha
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.36 ▲0.64
Dashboard /wp-admin3.34 ▲0.0346.32 ▼2.75
Posts /wp-admin/edit.php3.39 ▲0.0347.35 ▲1.25
Add New Post /wp-admin/post-new.php5.92 ▲0.0381.94 ▼3.68
Media Library /wp-admin/upload.php3.26 ▲0.0335.88 ▲2.45
BuddyPress Captcha /wp-admin/options-general.php?page=bp-captcha3.2129.48

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 18 new files
Database: no new tables, 10 new options
New WordPress options
theysaidso_admin_options
db_upgraded
bpcapt_language
widget_theysaidso_widget
bpcapt_public
widget_recent-comments
can_compress_scripts
bpcapt_theme
bpcapt_private
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for BuddyPress Captcha
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲3714.35 ▼0.271.77 ▲0.1143.43 ▼3.69
Dashboard /wp-admin2,204 ▲245.47 ▼0.2081.37 ▼21.4140.01 ▼2.76
Posts /wp-admin/edit.php2,109 ▲92.02 ▲0.0240.86 ▲5.7138.05 ▲2.32
Add New Post /wp-admin/post-new.php1,534 ▲623.41 ▲0.26680.25 ▼6.3255.49 ▲0.53
Media Library /wp-admin/upload.php1,412 ▲154.25 ▲0.0496.36 ▲0.0644.81 ▼0.13
BuddyPress Captcha /wp-admin/options-general.php?page=bp-captcha9452.1623.5326.95

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 10 options
    • bpcapt_private
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • bpcapt_theme
    • widget_recent-posts
    • widget_theysaidso_widget
    • bpcapt_public
    • bpcapt_language
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=bp-captcha
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=bp-captcha
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/buddypress-captcha/bpcapt-options.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'ReCaptcha\\RequestMethod' not found in wp-content/plugins/buddypress-captcha/recaptcha/ReCaptcha/RequestMethod/CurlPost.php:37
    • > PHP Warning
      require_once(wp-content/plugins/buddypress-captcha/recaptcha/examples/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/buddypress-captcha/recaptcha/examples/example-captcha.php on line 36
    • > PHP Fatal error
      Uncaught Error: Interface 'ReCaptcha\\RequestMethod' not found in wp-content/plugins/buddypress-captcha/recaptcha/ReCaptcha/RequestMethod/Post.php:35
    • > PHP Fatal error
      Uncaught Error: Interface 'ReCaptcha\\RequestMethod' not found in wp-content/plugins/buddypress-captcha/recaptcha/ReCaptcha/RequestMethod/SocketPost.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/buddypress-captcha/bpcapt-options.php:14
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/buddypress-captcha/recaptcha/examples/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/buddypress-captcha/recaptcha/examples/example-captcha.php on line 36

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 on the user side

Optimizations

Plugin configuration 90% 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
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (reCAPTCHA Form On The Front-end), #2 (Plugin Option Panel)
The official readme.txt is a good inspiration

buddypress-captcha/bp-recaptcha.php 85% from 13 tests

This is the main PHP file of "BuddyPress Captcha" version 1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("buddypress-captcha.php" instead of "bp-recaptcha.php")
  • Requires at least: Please use periods and digits for the required version (ex. "7.0" instead of "WordPress 2.8, BuddyPress 1.2.9")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin504 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP13136565504

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity3.44
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.96
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces2
Interfaces1
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods24
▷ Static methods14.17%
▷ Public methods24100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions888.89%
▷ Anonymous functions111.11%
Constants7
▷ Global constants00.00%
▷ Class constants7100.00%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png19.55KB6.65KB▼ 65.97%
screenshot-1.png24.48KB9.64KB▼ 60.61%