67% wp-site-protect

Code Review | WP Site Protect

WordPress plugin WP Site Protect scored 67% from 54 tests.

About plugin

  • Plugin page: wp-site-protect
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6
  • WordPress version: 5.9.2
  • First release: Jul 11, 2016
  • Latest release: Jul 11, 2016
  • Number of updates: 6
  • Update frequency: every 0.3 days
  • Top authors: vaurdan (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active / 2,985 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.08MB] [CPU: ▼318.95ms] Passed 4 tests

This is a short check of server-side resources used by WP Site Protect
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2353.19 ▲1.93
Dashboard /wp-admin3.25 ▼0.1619.21 ▼13.62
Posts /wp-admin/edit.php3.25 ▼0.3920.82 ▼17.18
Add New Post /wp-admin/post-new.php3.25 ▼3.7219.11 ▼1,242.99
Media Library /wp-admin/upload.php3.25 ▼0.0421.39 ▼1.99
Add New /wp-admin/post-new.php?post_type=password3.2521.02
All Passwords /wp-admin/edit.php?post_type=password3.2519.26

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 138 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by WP Site Protect
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,380 ▲63623.29 ▲7.326.84 ▲1.032.19 ▼0.00
Dashboard /wp-admin3,521 ▲66012.41 ▲6.32205.57 ▲77.50160.95 ▲7.29
Posts /wp-admin/edit.php3,568 ▲8749.41 ▲6.18153.10 ▲89.88136.90 ▼4.64
Add New Post /wp-admin/post-new.php2,444 ▲78320.23 ▲4.24500.35 ▲89.34160.26 ▲3.67
Media Library /wp-admin/upload.php2,345 ▲6479.85 ▲4.32176.91 ▲43.56185.95 ▼0.84
Add New /wp-admin/post-new.php?post_type=password2,80410.11183.16161.25
Settings /wp-admin/crbn-settings.php260.940.0320.02
All Passwords /wp-admin/edit.php?post_type=password2,2649.29159.48126.19

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5768
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=password
    • > User notice in wp-includes/functions.php+5768
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

SRP 0% 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
Please fix the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-site-protect/vendor/htmlburger/carbon-fields/tests/bootstrap.php
    • > /wp-content/plugins/wp-site-protect/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php
  • 74× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Container' not found in wp-content/plugins/wp-site-protect/vendor/htmlburger/carbon-fields/core/Container/Theme_Options_Container.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/wp-site-protect/vendor/htmlburger/carbon-fields/tests/unit-tests/Container/ContainerInitializationTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/wp-site-protect/vendor/htmlburger/carbon-fields/tests/unit-tests/Field/FieldGetSetId.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/wp-site-protect/vendor/htmlburger/carbon-fields/tests/unit-tests/Field/FieldInitializationTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Datastore\\Datastore' not found in wp-content/plugins/wp-site-protect/vendor/htmlburger/carbon-fields/core/Datastore/Theme_Options_Datastore.php:10
    • > PHP Notice
      Undefined variable: hideErrorsCookieName in wp-content/plugins/wp-site-protect/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php on line 21
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Datastore\\Meta_Datastore' not found in wp-content/plugins/wp-site-protect/vendor/htmlburger/carbon-fields/core/Datastore/Term_Meta_Datastore.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Datastore\\Meta_Datastore' not found in wp-content/plugins/wp-site-protect/vendor/htmlburger/carbon-fields/core/Datastore/User_Meta_Datastore.php:10
    • > PHP Notice
      Undefined variable: plural in wp-content/plugins/wp-site-protect/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php on line 40
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Field' not found in wp-content/plugins/wp-site-protect/vendor/htmlburger/carbon-fields/core/Field/Map_Field.php:10

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 user-side errors
    • > GET request to /wp-admin/crbn-settings.php
    • > Network (severe)
    wp-admin/crbn-settings.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: protection, password, multiple, protect, site

wp-site-protect/wp-site-protect.php Passed 13 tests

The main PHP file in "WP Site Protect" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
50 characters long description:
Protects your WordPress site with unique passwords

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin12,229 lines of code in 122 files:
LanguageFilesBlank linesComment linesLines of code
PHP951,7873,6255,986
JavaScript91,0818174,303
Markdown31400580
PO File3207217538
CSS410670473
JSON310210
Bourne Shell1202064
YAML210050
XML23225

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity9.59
▷ Minimum class complexity1.00
▷ Maximum class complexity78.00
Average method complexity2.06
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces15
Interfaces1
Traits0
Classes73
▷ Abstract classes79.59%
▷ Concrete classes6690.41%
▷ Final classes00.00%
Methods618
▷ Static methods6310.19%
▷ Public methods60297.41%
▷ Protected methods50.81%
▷ Private methods111.78%
Functions15
▷ Named functions1173.33%
▷ Anonymous functions426.67%
Constants7
▷ Global constants342.86%
▷ Class constants457.14%
▷ Public constants4100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 1.48MB with 1.05MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png403.88KB116.38KB▼ 71.18%
screenshot-3.png215.37KB60.11KB▼ 72.09%
screenshot-2.png448.54KB130.73KB▼ 70.85%
screenshot-4.png448.69KB133.37KB▼ 70.28%