78% wp-oauth

Code Review | WP-OAuth

WordPress plugin WP-OAuth scored78%from 54 tests.

About plugin

  • Plugin page: wp-oauth
  • Plugin version: 0.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.1
  • WordPress version: 6.3.1
  • First release: Oct 10, 2014
  • Latest release: Mar 6, 2016
  • Number of updates: 81
  • Update frequency: every 6.3 days
  • Top authors: hectavex (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

300+ active /21,144 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼4.15ms] Passed 4 tests

Analyzing server-side resources used by WP-OAuth
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0741.69 ▲7.01
Dashboard /wp-admin3.39 ▲0.0546.57 ▼10.39
Posts /wp-admin/edit.php3.51 ▲0.1553.48 ▲6.73
Add New Post /wp-admin/post-new.php5.97 ▲0.0977.71 ▼11.61
Media Library /wp-admin/upload.php3.29 ▲0.0735.48 ▼1.32
WP-OAuth /wp-admin/options-general.php?page=WP-OAuth3.71360.27

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 28 new files
Database: no new tables, 57 new options
New WordPress options
wpoa_logout_redirect_url
wpoa_paypal_api_enabled
wpoa_windowslive_api_id
wpoa_login_form_show_comments_section
wpoa_restore_default_settings
wpoa_paypal_api_id
wpoa_linkedin_api_id
wpoa_new_user_role
wpoa_google_api_secret
wpoa_facebook_api_id
...

Browser metrics Passed 4 tests

An overview of browser requirements for WP-OAuth
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,046 ▲30014.92 ▲0.645.85 ▲4.2939.77 ▼0.59
Dashboard /wp-admin2,344 ▲1676.17 ▲0.43104.76 ▲16.9236.87 ▼5.21
Posts /wp-admin/edit.php2,275 ▲1753.32 ▲1.3351.71 ▲9.7132.45 ▼5.21
Add New Post /wp-admin/post-new.php1,539 ▲1321.84 ▼1.31630.35 ▼43.1337.71 ▼16.97
Media Library /wp-admin/upload.php1,409 ▲94.08 ▼0.0788.84 ▼23.4345.11 ▼0.97
WP-OAuth /wp-admin/options-general.php?page=WP-OAuth3,3043.4543.03101.19

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 57 options
    • wpoa_logo_links_to_site
    • wpoa_logout_inactive_users
    • wpoa_facebook_api_id
    • wpoa_linkedin_api_secret
    • wpoa_paypal_api_sandbox_mode
    • wpoa_facebook_api_secret
    • widget_recent-posts
    • wpoa_instagram_api_id
    • wpoa_battlenet_api_secret
    • wpoa_battlenet_api_enabled
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=WP-OAuth
    • > Notice in wp-content/plugins/wp-oauth/wp-oauth-settings.php+85
    Undefined variable: maxitems

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
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/wp-oauth/wp-oauth.php:119
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-oauth/login-github.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-oauth/login-paypal.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-oauth/login-linkedin.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-oauth/login-reddit.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-oauth/login-instagram.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-oauth/register.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/wp-oauth/wp-oauth-settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-oauth/login-battlenet.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-oauth/login-facebook.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (The Settings page is where you'll configure the plugin.), #2 (The Your Profile page is where users will manage their linked accounts.), #3 (The Login page can easily be customized.)
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

wp-oauth/wp-oauth.php 92% from 13 tests

This is the main PHP file of "WP-OAuth" version 0.4.1, 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:
  • Description: The description should be shorter than 140 characters (currently 247 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin3,338 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP131914912,870
JavaScript148139315
CSS12014153

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity69.00
▷ Minimum class complexity69.00
▷ Maximum class complexity69.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods42
▷ Static methods12.38%
▷ Public methods42100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions30
▷ Named functions30100.00%
▷ Anonymous functions00.00%
Constants82
▷ Global constants8198.78%
▷ Class constants11.22%
▷ Public constants1100.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
11 PNG files occupy 0.35MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
icons/hex/linkedin.png1.14KB0.73KB▼ 35.84%
screenshot-1.png315.02KB103.12KB▼ 67.27%
screenshot-2.png19.07KB18.14KB▼ 4.88%
icons/hex/google.png1.93KB1.13KB▼ 41.27%
icons/hex/reddit.png2.48KB1.30KB▼ 47.44%