84% advanced-custom-fields-recaptcha-field

Code Review | Advanced Custom Fields: reCAPTCHA Field

WordPress plugin Advanced Custom Fields: reCAPTCHA Field scored84%from 54 tests.

About plugin

  • Plugin page: advanced-custom-f...
  • Plugin version: 1.3.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.1
  • WordPress version: 6.3.1
  • First release: Jul 9, 2015
  • Latest release: Jan 12, 2019
  • Number of updates: 53
  • Update frequency: every 24.2 days
  • Top authors: irvinlim (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

1,000+ active /15,300 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼11.18ms] Passed 4 tests

A check of server-side resources used by Advanced Custom Fields: reCAPTCHA Field
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0040.36 ▼1.12
Dashboard /wp-admin3.31 ▼0.0450.67 ▼12.78
Posts /wp-admin/edit.php3.36 ▲0.0049.81 ▼3.60
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.59 ▼23.49
Media Library /wp-admin/upload.php3.23 ▲0.0034.81 ▼4.85

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Advanced Custom Fields: reCAPTCHA Field
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.23 ▼0.121.99 ▲0.2843.52 ▼0.05
Dashboard /wp-admin2,198 ▲215.63 ▲0.0390.87 ▼2.8842.27 ▼2.16
Posts /wp-admin/edit.php2,100 ▼02.02 ▼0.0034.75 ▼4.7334.93 ▼2.04
Add New Post /wp-admin/post-new.php1,538 ▲1223.05 ▲0.04686.20 ▼3.3466.61 ▲5.35
Media Library /wp-admin/upload.php1,400 ▼04.23 ▲0.0994.26 ▼11.3547.23 ▲0.19

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 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
Almost there! Just fix the following items
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Interface 'ReCaptcha\\RequestMethod' not found in wp-content/plugins/advanced-custom-fields-recaptcha-field/lib/ReCaptcha/RequestMethod/Curl.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-custom-fields-recaptcha-field/includes/settings-page.php:29
    • > PHP Fatal error
      Uncaught Error: Interface 'ReCaptcha\\RequestMethod' not found in wp-content/plugins/advanced-custom-fields-recaptcha-field/includes/classes/WPRemoteRequestMethod.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/advanced-custom-fields-recaptcha-field/acf-recaptcha-v5.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/advanced-custom-fields-recaptcha-field/acf-recaptcha.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'ReCaptcha\\RequestMethod' not found in wp-content/plugins/advanced-custom-fields-recaptcha-field/lib/ReCaptcha/RequestMethod/Post.php:35
    • > PHP Fatal error
      Uncaught Error: Interface 'ReCaptcha\\RequestMethod' not found in wp-content/plugins/advanced-custom-fields-recaptcha-field/lib/ReCaptcha/RequestMethod/SocketPost.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/advanced-custom-fields-recaptcha-field/includes/script-loader.php:39

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: field, form, recaptcha, captcha, acf...

advanced-custom-fields-recaptcha-field/acf-recaptcha.php 85% from 13 tests

The primary PHP file in "Advanced Custom Fields: reCAPTCHA Field" version 1.3.3 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 152 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("advanced-custom-fields-recaptcha-field.php" instead of "acf-recaptcha.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
There were no executable files found in this plugin826 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP16224686686
CSS313074
JavaScript2215753
JSON10013

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity6.70
▷ Minimum class complexity1.00
▷ Maximum class complexity36.00
Average method complexity2.84
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces2
Interfaces1
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods32
▷ Static methods13.12%
▷ Public methods32100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions1593.75%
▷ Anonymous functions16.25%
Constants9
▷ Global constants111.11%
▷ Class constants888.89%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin