58% cw-step-two-verification

Code Review | CW Step 2 Verification

WordPress plugin CW Step 2 Verification scored58%from 54 tests.

About plugin

  • Plugin page: cw-step-two-verif...
  • Plugin version: 0.0.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.0.2
  • WordPress version: 6.3.1
  • First release: Oct 10, 2022
  • Latest release: Oct 18, 2022
  • Number of updates: 4
  • Update frequency: every 2.5 days
  • Top authors: anujtiwary69 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /166 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.62MB] [CPU: ▼43.83ms] Passed 4 tests

A check of server-side resources used by CW Step 2 Verification
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.35 ▼0.1116.66 ▼25.30
Dashboard /wp-admin3.39 ▲0.0918.72 ▼35.75
Posts /wp-admin/edit.php3.39 ▲0.0320.28 ▼29.75
Add New Post /wp-admin/post-new.php3.39 ▼2.5019.78 ▼84.51
Media Library /wp-admin/upload.php3.39 ▲0.1622.65 ▼13.95

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 972 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by CW Step 2 Verification
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.62 ▼0.962.07 ▲0.1544.66 ▼2.63
Dashboard /wp-admin2,206 ▲156.05 ▲0.18100.57 ▼5.5341.06 ▼1.42
Posts /wp-admin/edit.php2,089 ▼32.04 ▲0.0334.59 ▼1.2935.02 ▲3.90
Add New Post /wp-admin/post-new.php1,513 ▼2517.41 ▼5.70623.84 ▼69.8351.31 ▼5.43
Media Library /wp-admin/upload.php1,391 ▲64.15 ▼0.02104.29 ▼3.2244.06 ▼0.07

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method CWBaseFunction::get_providers() should not be called statically
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/cw-step-two-verification/vendors/phpqrcode/index.php
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'CW_STV_URLvendors/phpqrcode/qrlib.php' (include_path='.:/usr/share/php') in wp-content/plugins/cw-step-two-verification/includes/class_base_function.php on line 2
    • > PHP Fatal error
      Uncaught Error: Interface 'Dolondro\\GoogleAuthenticator\\QrImageGenerator\\QrImageGeneratorInterface' not found in wp-content/plugins/cw-step-two-verification/vendors/google_authenticator/QrImageGenerator/EndroidQrImageGenerator.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cw-step-two-verification/cw_step_two_verification.php:21
    • > PHP Warning
      Use of undefined constant CW_STV_URL - assumed 'CW_STV_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/cw-step-two-verification/includes/class_base_function.php on line 2
    • > PHP Warning
      require_once(CW_STV_URLvendors/phpqrcode/qrlib.php): failed to open stream: No such file or directory in wp-content/plugins/cw-step-two-verification/includes/class_base_function.php on line 2
    • > PHP Fatal error
      Uncaught Error: Interface 'Dolondro\\GoogleAuthenticator\\QrImageGenerator\\QrImageGeneratorInterface' not found in wp-content/plugins/cw-step-two-verification/vendors/google_authenticator/QrImageGenerator/GoogleQrImageGenerator.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: extra layer security, two factor, step 2 verification

cw-step-two-verification/cw_step_two_verification.php 77% from 13 tests

The main PHP file in "CW Step 2 Verification" ver. 0.0.2 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Requires PHP: Required version must be the same as the one declared in readme.txt ("7.0" instead of "7.2")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.4" instead of "5.2")
  • Main file name: The principal plugin file should be the same as the plugin slug ("cw-step-two-verification.php" instead of "cw_step_two_verification.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
These items require your attention
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/cw-step-two-verification/vendors/phpqrcode/tools/merge.bat
6,647 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP271,6602,2326,643
Bourne Shell1002
DOS Batch1002

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity28.40
▷ Minimum class complexity1.00
▷ Maximum class complexity292.00
Average method complexity3.71
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces1
Interfaces1
Traits0
Classes39
▷ Abstract classes00.00%
▷ Concrete classes39100.00%
▷ Final classes00.00%
Methods406
▷ Static methods13232.51%
▷ Public methods30474.88%
▷ Protected methods9824.14%
▷ Private methods40.99%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants100
▷ Global constants9898.00%
▷ Class constants22.00%
▷ Public constants2100.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
578 compressed PNG files occupy 0.88MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/qrcode/qrcode_name_2022-30-09-04-10-33.png0.51KB0.49KB▼ 3.81%
assets/qrcode/qrcode_name_2022-28-09-05-01-52.png0.51KB0.49KB▼ 3.83%
assets/qrcode/qrcode_name_2022-22-09-03-13-20.png0.52KB0.49KB▼ 4.17%
assets/qrcode/qrcode_name_2022-30-09-04-26-12.png0.51KB0.49KB▼ 4.17%
assets/qrcode/qrcode_name_2022-30-09-04-37-41.png0.51KB0.49KB▼ 4.36%