53% swipe

Code Review | Swipe

WordPress plugin Swipe scored53%from 54 tests.

About plugin

  • Plugin page: swipe
  • Plugin version: 1.4
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2.3
  • WordPress version: 6.3.1
  • First release: Oct 27, 2018
  • Latest release: Sep 25, 2019
  • Number of updates: 10
  • Update frequency: every 34.4 days
  • Top authors: swipepro (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

10+ active /1,356 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.82MB] [CPU: ▼37.94ms] Passed 4 tests

Server-side resources used by Swipe
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1534.39 ▼8.70
Dashboard /wp-admin3.14 ▼0.2124.88 ▼39.57
Posts /wp-admin/edit.php3.14 ▼0.2223.62 ▼25.63
Add New Post /wp-admin/post-new.php3.14 ▼2.7525.64 ▼76.00
Media Library /wp-admin/upload.php3.14 ▼0.0929.85 ▼10.55
Documentation /wp-admin/admin.php?page=swipe_documentation3.1427.62
Settings /wp-admin/admin.php?page=swipe_settings3.1426.07
Generate QR /wp-admin/admin.php?page=swipe_generate3.1426.54
Swipe Users /wp-admin/admin.php?page=swipe_qr_users3.1423.70

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 32 new files
Database: 3 new tables, 6 new options
New tables
wp_swipe
wp_swipe_app_logs
wp_swipe_app_users
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Swipe: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,911 ▲15014.49 ▲0.141.63 ▼0.0028.30 ▼15.25
Dashboard /wp-admin2,221 ▲445.59 ▼0.0886.69 ▼17.3872.04 ▲26.05
Posts /wp-admin/edit.php2,141 ▲441.97 ▼0.0242.19 ▲7.1740.60 ▲2.30
Add New Post /wp-admin/post-new.php1,712 ▲18422.39 ▼0.80670.55 ▼11.4049.29 ▼3.16
Media Library /wp-admin/upload.php1,438 ▲384.23 ▲0.04102.09 ▼7.9078.54 ▲30.98
Documentation /wp-admin/admin.php?page=swipe_documentation9661.8529.22235.37
Settings /wp-admin/admin.php?page=swipe_settings1,1141.7824.9740.45
Generate QR /wp-admin/admin.php?page=swipe_generate9082.0624.2035.62
Swipe Users /wp-admin/admin.php?page=swipe_qr_users9521.7024.8232.19

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • Zombie tables were found after uninstall: 3 tables
    • wp_swipe_app_users
    • wp_swipe
    • wp_swipe_app_logs
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=swipe_qr_users
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=swipe_qr_users
    • > Notice in wp-content/plugins/swipe/controller.php+278
    Undefined index: HTTP_CLIENT_IP
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=swipe_qr_users
    • > Notice in wp-content/plugins/swipe/controller.php+279
    Undefined index: HTTP_X_FORWARDED_FOR

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/swipe/templates/login.php
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Trying to get property 'display_name' of non-object in wp-content/plugins/swipe/templates/email.php on line 33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/swipe/controller.php:7
    • > PHP Notice
      Undefined variable: attachment in wp-content/plugins/swipe/templates/email.php on line 46
    • > PHP Notice
      Undefined variable: blog_name in wp-content/plugins/swipe/templates/email.php on line 27
    • > PHP Notice
      Undefined variable: user in wp-content/plugins/swipe/templates/email.php on line 33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/swipe/templates/email.php:61

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
9 plugin tags: 2fa, two factor, two factor auth, security, password...

swipe/swipe.php Passed 13 tests

The primary PHP file in "Swipe" version 1.4 is used by WordPress to initiate all plugin functionality
30 characters long description:
Wordpress login with swipe app

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin4,721 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript51,0012912,512
PHP81041101,283
CSS24013926

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity82.00
▷ Minimum class complexity82.00
▷ Maximum class complexity82.00
Average method complexity3.53
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods32
▷ Static methods00.00%
▷ Public methods32100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
13 PNG files occupy 0.14MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/add-website.png63.37KB28.53KB▼ 54.98%
images/wp-icon-24.png1.55KB1.04KB▼ 32.64%
images/doc.png1.41KB0.68KB▼ 51.69%
images/install.png1.20KB0.31KB▼ 74.18%
images/google.png5.84KB2.66KB▼ 54.51%