62% wp-privacy

Code Review | WP Privacy

WordPress plugin WP Privacy scored62%from 54 tests.

About plugin

  • Plugin page: wp-privacy
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9-4.3
  • WordPress version: 6.3.1
  • First release: Nov 13, 2015
  • Latest release: Nov 13, 2015
  • Number of updates: 7
  • Update frequency: N/A
  • Top authors: reqianduan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,685 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.14MB] [CPU: ▼9.37ms] Passed 4 tests

This is a short check of server-side resources used by WP Privacy
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.73 ▼0.7316.02 ▼36.83
Dashboard /wp-admin3.36 ▲0.0645.50 ▼2.49
Posts /wp-admin/edit.php3.42 ▲0.0648.09 ▲0.73
Add New Post /wp-admin/post-new.php5.96 ▲0.0894.17 ▲1.93
Media Library /wp-admin/upload.php3.29 ▲0.0632.96 ▲1.11
密码保护 /wp-admin/options-general.php?page=wp_privacy-setting-admin3.2538.16

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 55 new files
Database: 1 new table, 6 new options
New tables
wp_hidemysiteSecure
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for WP Privacy
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲10013.63 ▼0.931.80 ▼0.5544.07 ▼14.29
Dashboard /wp-admin2,238 ▲535.03 ▼0.85103.20 ▲0.9149.84 ▲4.20
Posts /wp-admin/edit.php2,104 ▲122.33 ▲0.3642.45 ▲7.2045.47 ▲15.36
Add New Post /wp-admin/post-new.php1,552 ▲1823.58 ▲0.44582.91 ▼105.5033.16 ▼19.85
Media Library /wp-admin/upload.php1,426 ▲414.44 ▲0.1697.60 ▼2.8051.40 ▲5.15
密码保护 /wp-admin/options-general.php?page=wp_privacy-setting-admin1,4863.7956.11175.79

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
It is recommended to fix the following
  • Zombie tables detected upon uninstall: 1 table
    • wp_hidemysiteSecure
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=wp_privacy-setting-admin
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=wp_privacy-setting-admin
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp_privacy-setting-admin
    • > Notice in wp-content/plugins/wp-privacy/index.php+893
    Undefined index: class
    • > GET request to /wp-admin/options-general.php?page=wp_privacy-setting-admin
    • > Notice in wp-content/plugins/wp-privacy/index.php+963
    Undefined index: desc

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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-privacy/templates/hmsdiscreet.php
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-privacy/templates/hmsiris.php:11
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-privacy/templates/hmsclassic.php:11
    • > PHP Notice
      Undefined variable: messagehtml in wp-content/plugins/wp-privacy/templates/hmsdefault.php on line 106
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-privacy/index.php:25
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-privacy/templates/hmscobalt.php:10
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-privacy/templates/hmsbinder.php:11
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-privacy/templates/hmsdefault.php:111
    • > PHP Notice
      Undefined variable: messagehtml in wp-content/plugins/wp-privacy/templates/hmsdiscreet.php on line 71
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-privacy/templates/hmsice.php:11
    • > PHP Notice
      Undefined variable: hinthtml in wp-content/plugins/wp-privacy/templates/hmsdiscreet.php on line 75

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 on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: hide-my-site, wp-privacy, privacy, password protection, password

wp-privacy/index.php 85% from 13 tests

This is the main PHP file of "WP Privacy" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 289 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-privacy.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin1,440 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP101481881,414
JavaScript214526

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity45.00
▷ Minimum class complexity13.00
▷ Maximum class complexity77.00
Average method complexity3.32
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods38
▷ Static methods00.00%
▷ Public methods38100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
29 PNG files occupy 0.21MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/bg_dot.png0.12KB0.10KB▼ 16.67%
images/premium_back.png10.54KB8.60KB▼ 18.33%
images/default.png1.38KB1.24KB▼ 9.92%
images/login_button_cobalt.png2.84KB2.00KB▼ 29.46%
images/input_back_lockandkey.png0.76KB0.58KB▼ 24.55%