78% socialauth-wp

Code Review | Socialauth-WordPress

WordPress plugin Socialauth-WordPress scored 78% from 54 tests.

About plugin

  • Plugin page: socialauth-wp
  • Plugin version: 3.11.13
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-3.4.2
  • WordPress version: 5.8.1
  • First release: May 24, 2012
  • Latest release: May 28, 2013
  • Number of updates: 82
  • Update frequency: every 16.4 days
  • Top authors: tsg@brickred.com (73.17%)3pillarlabs (28.05%)

Code review

54 tests

User reviews

10 reviews

Install metrics

20+ active / 7,186 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▲121.43ms] Passed 4 tests

Server-side resources used by Socialauth-WordPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.0125.10 ▲0.16
Dashboard /wp-admin3.08 ▲0.02384.11 ▲346.44
Posts /wp-admin/edit.php3.13 ▲0.02380.70 ▲348.98
Add New Post /wp-admin/post-new.php5.44 ▲0.00459.65 ▼209.86
Media Library /wp-admin/upload.php3.03 ▲0.03394.57 ▲371.98
SocialAuth-WordPress /wp-admin/options-general.php?page=socialauth-wp-settings3.01358.19

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 88 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Socialauth-WordPress: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,803 ▲17715.85 ▼0.188.62 ▲2.5977.20 ▼2.25
Dashboard /wp-admin2,953 ▲586.06 ▼0.05122.32 ▼14.10203.54 ▲26.59
Posts /wp-admin/edit.php2,769 ▲293.14 ▼0.1066.08 ▼14.44143.33 ▼2.22
Add New Post /wp-admin/post-new.php3,726 ▼19118.06 ▼0.79445.10 ▲13.26179.21 ▲21.14
Media Library /wp-admin/upload.php1,778 ▲265.54 ▼0.02125.45 ▼19.34207.51 ▲20.75
SocialAuth-WordPress /wp-admin/options-general.php?page=socialauth-wp-settings2,3223.1979.59155.06

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 50% 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 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
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/socialauth-wp/connect.php
    • > /wp-content/plugins/socialauth-wp/hybridauth/install.php
    • > /wp-content/plugins/socialauth-wp/hybridauth/index.php
    • > /wp-content/plugins/socialauth-wp/verifyEmail.php
  • 23× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: provider in wp-content/plugins/socialauth-wp/connect.php on line 221
    • > PHP Fatal error
      Uncaught Error: Class 'Hybrid_Provider_Model_OAuth1' not found in wp-content/plugins/socialauth-wp/hybridauth/Hybrid/Providers/MySpace.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Hybrid_Provider_Model_OAuth2' not found in wp-content/plugins/socialauth-wp/hybridauth/Hybrid/Providers/Google.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Hybrid_Provider_Model' not found in wp-content/plugins/socialauth-wp/hybridauth/Hybrid/Provider_Model_OAuth2.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Hybrid_Provider_Model_OAuth1' not found in wp-content/plugins/socialauth-wp/hybridauth/Hybrid/Providers/Twitter.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/socialauth-wp/ui.php:45
    • > PHP Fatal error
      Uncaught Error: Class 'Hybrid_Provider_Model' not found in wp-content/plugins/socialauth-wp/hybridauth/Hybrid/Provider_Model_OAuth1.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/socialauth-wp/feature-friends.php:156
    • > PHP Fatal error
      Uncaught Error: Class 'Hybrid_Provider_Model_OpenID' not found in wp-content/plugins/socialauth-wp/hybridauth/Hybrid/Providers/AOL.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/socialauth-wp/common.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #1 (Login screen with enabled providers), #2 (Twitter authentication screen), #3 (Twitter redirecting back to your application), #4 (Profile of the authenticated user showing user data from Twitter)
You can take inspiration from this readme.txt

socialauth-wp/social-auth-wp.php 85% from 13 tests

The main file in "Socialauth-WordPress" v. 3.11.13 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 569 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("socialauth-wp.php" instead of "social-auth-wp.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Please make sure to remedy the following
  • Do not include executable or dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/socialauth-wp/hybridauth/Hybrid/thirdparty/Facebook/fb_ca_chain_bundle.crt
6,592 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
PHP451,5873,8206,444
JavaScript35075
CSS25033
HTML32328
XML10012

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.42
Average class complexity23.02
▷ Minimum class complexity1.00
▷ Maximum class complexity162.00
Average method complexity3.66
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes44
▷ Abstract classes49.09%
▷ Concrete classes4090.91%
▷ Final classes00.00%
Methods375
▷ Static methods4612.27%
▷ Public methods30280.53%
▷ Protected methods6016.00%
▷ Private methods133.47%
Functions23
▷ Named functions23100.00%
▷ Anonymous functions00.00%
Constants28
▷ Global constants27.14%
▷ Class constants2692.86%
▷ Public constants26100.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
28 PNG files occupy 0.13MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/twitter_32.png1.06KB0.93KB▼ 12.76%
screenshot-2.png50.37KB19.06KB▼ 62.16%
assets/images/windows_32.png1.63KB1.48KB▼ 8.87%
assets/images/facebook_small.png0.63KB0.58KB▼ 7.76%
assets/images/wordpress_16.png0.76KB0.59KB▼ 23.24%