83% swoop-password-free-authentication

Code Review | 1-Click Login: Passwordless Authentication

WordPress plugin 1-Click Login: Passwordless Authentication scored83%from 54 tests.

About plugin

  • Plugin page: swoop-password-fr...
  • Plugin version: 1.4.5
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.0
  • WordPress version: 6.3.1
  • First release: May 5, 2020
  • Latest release: Jul 12, 2022
  • Number of updates: 44
  • Update frequency: every 18.1 days
  • Top authors: swoopbrandon (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

40+ active /3,046 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
Installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼1.46ms] Passed 4 tests

An overview of server-side resources used by 1-Click Login: Passwordless Authentication
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0940.98 ▲0.76
Dashboard /wp-admin3.40 ▲0.1051.52 ▼1.66
Posts /wp-admin/edit.php3.52 ▲0.1649.57 ▼0.94
Add New Post /wp-admin/post-new.php5.98 ▲0.1088.55 ▼3.98
Media Library /wp-admin/upload.php3.33 ▲0.1038.52 ▲3.45

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 30 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by 1-Click Login: Passwordless Authentication
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲8613.24 ▼1.121.55 ▼0.2743.50 ▲0.98
Dashboard /wp-admin2,238 ▲505.85 ▼0.2095.15 ▼21.5366.10 ▲14.85
Posts /wp-admin/edit.php2,124 ▲352.15 ▲0.1634.89 ▼3.4931.94 ▼2.46
Add New Post /wp-admin/post-new.php1,541 ▲2723.40 ▲5.94733.10 ▲57.0757.11 ▼5.57
Media Library /wp-admin/upload.php1,420 ▲384.24 ▲0.05112.36 ▲11.2560.85 ▲17.46

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
Please fix the following items
  • 13× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/swoop-password-free-authentication/includes/util/Swoop.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/swoop-password-free-authentication/includes/util/Swoop.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/swoop-password-free-authentication/includes/admin/controllers/WP_Swoop_Admin_Password_Free.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/swoop-password-free-authentication/includes/WP_Swoop_WooCommerceOverrides.php:82
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/swoop-password-free-authentication/includes/views/swoop_wp_login_footer.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_admin_url() in wp-content/plugins/swoop-password-free-authentication/includes/views/swoop_wp_login.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/swoop-password-free-authentication/includes/views/woocommerce_my_account.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/swoop-password-free-authentication/swoop.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/swoop-password-free-authentication/includes/admin/views/password-free.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_user_logged_in() in wp-content/plugins/swoop-password-free-authentication/includes/views/swoop_login.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes: The official readme.txt might help

swoop-password-free-authentication/swoop.php 85% from 13 tests

The primary PHP file in "1-Click Login: Passwordless Authentication" version 1.4.5 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("swoop-password-free-authentication.php" instead of "swoop.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 237 characters long)

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
No dangerous file extensions were detected1,218 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP16136145703
CSS5949467
SVG50048

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity8.83
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity2.08
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods41
▷ Static methods24.88%
▷ Public methods3790.24%
▷ Protected methods00.00%
▷ Private methods49.76%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
Constants28
▷ Global constants28100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/assets/images/swoop-button-with-icon@2x.png5.38KB2.96KB▼ 44.92%
includes/assets/images/swoop-logo-horizontal2x.png6.02KB2.83KB▼ 53.01%
includes/assets/images/1-Click-Login-Swoop.png10.24KB5.56KB▼ 45.73%