77% wp-ajax-login-and-register-popup

Code Review | WP AJAX Login and Register Popup

WordPress plugin WP AJAX Login and Register Popup scored77%from 54 tests.

About plugin

  • Plugin page: wp-ajax-login-and...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.7
  • WordPress version: 6.3.1
  • First release: Feb 16, 2019
  • Latest release: Mar 18, 2021
  • Number of updates: 12
  • Update frequency: every 63.5 days
  • Top authors: dhasib (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /4,469 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
Install script ran successfully

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

A check of server-side resources used by WP AJAX Login and Register Popup
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1146.02 ▲0.02
Dashboard /wp-admin3.40 ▲0.1051.10 ▼0.82
Posts /wp-admin/edit.php3.51 ▲0.1649.54 ▼3.84
Add New Post /wp-admin/post-new.php6.00 ▲0.1190.20 ▲0.51
Media Library /wp-admin/upload.php3.32 ▲0.0940.05 ▲4.51
AJAX Login Settings /wp-admin/options-general.php?page=wpalrp-page3.2935.95

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

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

Browser metrics Passed 4 tests

Checking browser requirements for WP AJAX Login and Register Popup
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,027 ▲28114.27 ▼0.107.45 ▲5.3546.30 ▼0.72
Dashboard /wp-admin2,235 ▲475.09 ▼0.73108.06 ▼5.0941.09 ▼2.35
Posts /wp-admin/edit.php2,126 ▲372.36 ▲0.3739.00 ▼2.1333.61 ▼2.22
Add New Post /wp-admin/post-new.php1,540 ▲623.28 ▼0.17638.27 ▼54.9334.38 ▼26.08
Media Library /wp-admin/upload.php1,423 ▲354.55 ▲0.36104.48 ▲7.3345.43 ▼2.12
AJAX Login Settings /wp-admin/options-general.php?page=wpalrp-page1,1392.5154.0931.61

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
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • widget_wpalrb-recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

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)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-ajax-login-and-register-popup/lib/wpalr-widget.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-ajax-login-and-register-popup/lib/functions.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-ajax-login-and-register-popup/lib/wpalr-style.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-ajax-login-and-register-popup/wp-ajax-login-register-popup.php:24

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=wpalrp-page
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/wp-ajax-login-and-register-popup/js/ajax-auth-script.js?ver=6.3.1:3:31)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=wpalrp-page
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Signin Box), #2 (Signup Box), #3 (Login Settings)
You can look at the official readme.txt

wp-ajax-login-and-register-popup/wp-ajax-login-register-popup.php 77% from 13 tests

The main file in "WP AJAX Login and Register Popup" v. 1.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-ajax-login-and-register-popup.php" instead of "wp-ajax-login-register-popup.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 224 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected1,607 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript31541281,111
PHP46060327
CSS2150169

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.14MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png31.67KB18.25KB▼ 42.40%
screenshot-2.png33.08KB18.28KB▼ 44.74%
img/review.png0.64KB0.64KB0.00%
img/cancel.png18.47KB3.64KB▼ 80.29%
screenshot-3.png61.50KB34.94KB▼ 43.19%