78% recaptcha-protected-downloads

Code Review | reCaptcha Protected Downloads

WordPress plugin reCaptcha Protected Downloads scored78%from 54 tests.

About plugin

  • Plugin page: recaptcha-protect...
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.2-4.7.2
  • WordPress version: 6.3.1
  • First release: Feb 15, 2017
  • Latest release: Feb 15, 2017
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: elhardoum (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,159 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼10.76ms] Passed 4 tests

This is a short check of server-side resources used by reCaptcha Protected Downloads
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0035.79 ▼6.67
Dashboard /wp-admin3.31 ▼0.0349.91 ▼14.55
Posts /wp-admin/edit.php3.36 ▲0.0144.91 ▲6.28
Add New Post /wp-admin/post-new.php5.90 ▲0.0183.03 ▼22.38
Media Library /wp-admin/upload.php3.24 ▲0.0132.80 ▲0.57
reCaptcha Downloads /wp-admin/options-general.php?page=rcpdl3.2029.73

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 30 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for reCaptcha Protected Downloads
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.39 ▲0.221.97 ▲0.1839.11 ▼3.05
Dashboard /wp-admin2,202 ▲275.65 ▲0.0082.25 ▼19.2338.74 ▼4.73
Posts /wp-admin/edit.php2,104 ▲11.94 ▼0.0334.35 ▼5.5331.07 ▼2.43
Add New Post /wp-admin/post-new.php1,539 ▲1018.21 ▼4.99625.17 ▲28.9977.36 ▲23.98
Media Library /wp-admin/upload.php1,404 ▲44.34 ▲0.14101.55 ▲4.5242.55 ▼1.31
reCaptcha Downloads /wp-admin/options-general.php?page=rcpdl1,1872.0023.1927.32

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Please fix the following items
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/recaptcha-protected-downloads/recaptcha-protected-downloads.php
    • > /wp-content/plugins/recaptcha-protected-downloads/uninstall.php
    • > /wp-content/plugins/recaptcha-protected-downloads/Inc/Admin/Admin.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Interface 'ReCaptcha\\RequestMethod' not found in wp-content/plugins/recaptcha-protected-downloads/Inc/Lib/recaptcha/src/ReCaptcha/RequestMethod/Post.php:35
    • > PHP Fatal error
      Uncaught Error: Interface 'ReCaptcha\\RequestMethod' not found in wp-content/plugins/recaptcha-protected-downloads/Inc/Lib/recaptcha/src/ReCaptcha/RequestMethod/SocketPost.php:37
    • > PHP Fatal error
      Uncaught Error: Interface 'ReCaptcha\\RequestMethod' not found in wp-content/plugins/recaptcha-protected-downloads/Inc/Lib/recaptcha/src/ReCaptcha/RequestMethod/CurlPost.php:37

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, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Tags: There are too many tags (11 tag instead of maximum 10)
Please take inspiration from this readme.txt

recaptcha-protected-downloads/recaptcha-protected-downloads.php 92% from 13 tests

The main file in "reCaptcha Protected Downloads" v. 0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin1,031 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP13190502744
JavaScript1371161
Markdown2420108
YAML14014
CSS1004

PHP code Passed 2 tests

A brief analysis 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.33
Average class complexity7.45
▷ Minimum class complexity1.00
▷ Maximum class complexity34.00
Average method complexity2.73
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces2
Interfaces1
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods42
▷ Static methods1842.86%
▷ Public methods42100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants8
▷ Global constants112.50%
▷ Class constants787.50%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin