10% simple-ajax-auth

Code Review | Simple Ajax Auth

WordPress plugin Simple Ajax Auth scored 10% from 54 tests.

About plugin

  • Plugin page: simple-ajax-auth
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.1.1
  • WordPress version: 5.9.2
  • First release: Mar 21, 2015
  • Latest release: Mar 21, 2015
  • Number of updates: 2
  • Update frequency: every 1.5 days
  • Top authors: jake1981 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active / 2,760 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/simple-ajax-auth/plugin.php+230
    Methods with the same name as their class will not be constructors in a future version of PHP; simple_ajax_auth has a deprecated constructor

Server metrics [RAM: ▼2.24MB] [CPU: ▼358.21ms] Passed 4 tests

Analyzing server-side resources used by Simple Ajax Auth
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.11 ▼1.408.02 ▼41.93
Dashboard /wp-admin2.15 ▼1.267.67 ▼26.42
Posts /wp-admin/edit.php2.15 ▼1.496.91 ▼33.28
Add New Post /wp-admin/post-new.php2.14 ▼4.836.71 ▼1,331.22
Media Library /wp-admin/upload.php2.15 ▼1.156.41 ▼18.86
Simple Ajax Auth /wp-admin/options-general.php?page=options-general.php_simple_ajax_auth2.157.30

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 66 new files
Database: no new tables, 1 new option
New WordPress options
widget_simple_ajax_auth

Browser metrics Passed 4 tests

Checking browser requirements for Simple Ajax Auth
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,800 ▲4616.27 ▲0.596.15 ▲0.262.85 ▲0.24
Dashboard /wp-admin2,897 ▲365.98 ▼0.18115.44 ▼26.56155.51 ▼5.34
Posts /wp-admin/edit.php2,693 ▲23.23 ▲0.0164.50 ▲2.42139.31 ▲0.32
Add New Post /wp-admin/post-new.php1,763 ▲522.59 ▲0.52415.82 ▼8.72160.88 ▲6.38
Media Library /wp-admin/upload.php1,700 ▲55.50 ▲0.00143.39 ▼7.40185.84 ▼6.25
Simple Ajax Auth /wp-admin/options-general.php?page=options-general.php_simple_ajax_auth1,9893.1663.38157.62

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5409
    The called constructor method for WP_Widget in simple_ajax_auth is deprecated since version 4.3.0! Use __construct() instead.
  • Zombie WordPress options were found after uninstall: 1 option
    • widget_simple_ajax_auth

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=options-general.php_simple_ajax_auth
    • > User deprecated in wp-includes/functions.php+5409
    The called constructor method for WP_Widget in simple_ajax_auth is deprecated since version 4.3.0! Use __construct() instead.

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/simple-ajax-auth/plugin.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/simple-ajax-auth/templates/ajax-auth.php:2

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)
No browser issues were found

Optimizations

Plugin configuration 93% 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
Attributes that require attention:
  • Tags: There are too many tags (14 tag instead of maximum 10)
The official readme.txt is a good inspiration

simple-ajax-auth/plugin.php 92% from 13 tests

"Simple Ajax Auth" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("simple-ajax-auth.php" instead of "plugin.php")

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
Good job! No executable or dangerous file extensions detected13,739 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript141,1011,0938,727
PHP44431,3922,302
CSS103232392,051
PO File4276352659

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity194.50
▷ Minimum class complexity9.00
▷ Maximum class complexity380.00
Average method complexity3.95
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods131
▷ Static methods00.00%
▷ Public methods12897.71%
▷ Protected methods00.00%
▷ Private methods32.29%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
25 compressed PNG files occupy 0.16MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin-page-class/css/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
admin-page-class/images/edit.png1.54KB1.38KB▼ 10.34%
admin-page-class/css/images/ui-icons_f6cf3b_256x240.png8.68KB4.11KB▼ 52.68%
admin-page-class/css/images/ui-bg_glass_75_ffffff_1x400.png0.10KB0.10KB▼ 4.67%
admin-page-class/css/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%