10% wp-smart-security

Code Review | WP Smart Security

WordPress plugin WP Smart Security scored10%from 54 tests.

About plugin

  • Plugin page: wp-smart-security
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.4.2
  • WordPress version: 6.3.1
  • First release: Mar 17, 2016
  • Latest release: Mar 18, 2016
  • Number of updates: 4
  • Update frequency: every 1.8 days
  • Top authors: bulktheme (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /5,248 total downloads

Benchmarks

Plugin footprint 57% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/wp-smart-security/admin/wpcontent.php+11
    Undefined index: ssl_frontend

Server metrics [RAM: ▲1.49MB] [CPU: ▼0.48ms] Passed 4 tests

This is a short check of server-side resources used by WP Smart Security
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.31 ▲0.8546.54 ▲2.76
Dashboard /wp-admin5.01 ▲1.6661.51 ▼6.72
Posts /wp-admin/edit.php5.14 ▲1.7862.09 ▲8.87
Add New Post /wp-admin/post-new.php7.61 ▲1.7298.44 ▼6.84
Media Library /wp-admin/upload.php4.95 ▲1.7250.77 ▲12.49
System & Server /wp-admin/admin.php?page=wp-smart-security-systemserver4.9348.33
Captcha & Anti Spam /wp-admin/admin.php?page=wp-smart-security-captcha4.9347.94
WP Smart Security /wp-admin/admin.php?page=wp-smart-security4.9346.55

Server storage [IO: ▲2.31MB] [DB: ▲0.01MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Please fix the following
  • The plugin illegally modified 2 files (4.29KB) outside of "wp-content/plugins/wp-smart-security/" and "wp-content/uploads/"
    • (modified) wp-config.php
    • (modified) .htaccess
Filesystem: 93 new files
Database: 2 new tables, 8 new options
New tables
wp_wpspro_log
wp_wpspro_lockouts
New WordPress options
db_upgraded
theysaidso_admin_options
bitset_wpspro_data
bitset_wpspro
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by WP Smart Security
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,173 ▲40213.23 ▼1.061.84 ▼0.1543.45 ▼2.19
Dashboard /wp-admin2,555 ▲3675.85 ▼0.03109.86 ▼8.5386.74 ▲43.23
Posts /wp-admin/edit.php2,121 ▲352.01 ▼0.0335.12 ▼1.4333.28 ▼1.95
Add New Post /wp-admin/post-new.php1,536 ▲1717.65 ▼5.35700.40 ▲41.0363.10 ▲12.31
Media Library /wp-admin/upload.php1,408 ▲204.25 ▲0.1399.50 ▼16.5974.17 ▲25.40
System & Server /wp-admin/admin.php?page=wp-smart-security-systemserver9624.6144.9473.20
Captcha & Anti Spam /wp-admin/admin.php?page=wp-smart-security-captcha1,1014.7247.4072.52
WP Smart Security /wp-admin/admin.php?page=wp-smart-security9594.6344.4160.13

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 6× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-smart-security/captcha/securimage_show.php
    • > /wp-content/plugins/wp-smart-security/inc/index.php
    • > /wp-content/plugins/wp-smart-security/images/index.php
    • > /wp-content/plugins/wp-smart-security/backups/index.php
    • > /wp-content/plugins/wp-smart-security/lib/index.php
    • > /wp-content/plugins/wp-smart-security/admin/index.php
  • 17× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'wpspro_admin_common' not found in wp-content/plugins/wp-smart-security/admin/wpcontent.php:5
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/wp-smart-security/admin/tables.php on line 5
    • > PHP Fatal error
      require_once(): Failed opening required 'WPSPRO_PPadmin/common.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-smart-security/admin/construct.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'bitset_wpspro' not found in wp-content/plugins/wp-smart-security/inc/secure.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-smart-security/captcha.php:1028
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-smart-security/admin/tables.php on line 5
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-smart-security/admin/tables.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'bitset_wpspro' not found in wp-content/plugins/wp-smart-security/inc/filecheck.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-smart-security/inc/setup.php:3
    • > PHP Warning
      require_once(WPSPRO_PPadmin/common.php): failed to open stream: No such file or directory in wp-content/plugins/wp-smart-security/admin/construct.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 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
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
  • Screenshots: Please add images for these screenshots: #1 (WP Smart Security Dashboard), #2 (WordPress Database Backup Settings), #3 (Captcha and Anti Spam Setting), #4 (Limit Login Attempts Settings), #5 (Admin Username and User ID Settings), #6 (Frontend and Backend Maintenance Mode Settings), #7 (Log In page with Captcha), #8 (Maintenance Mode Frontend View)
You can take inspiration from this readme.txt

wp-smart-security/wp-smart-security.php 85% from 13 tests

"WP Smart Security" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Description: Please keep the plugin description shorter than 140 characters (currently 300 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin8,700 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP213,0922,0678,440
CSS2480244
JavaScript11016

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 112)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity74.00
▷ Minimum class complexity3.00
▷ Maximum class complexity293.00
Average method complexity6.45
▷ Minimum method complexity1.00
▷ Maximum method complexity112.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes21
▷ Abstract classes14.76%
▷ Concrete classes2095.24%
▷ Final classes00.00%
Methods281
▷ Static methods31.07%
▷ Public methods281100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
17 PNG files occupy 1.18MB with 0.59MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/shield-large.png2.59KB2.40KB▼ 7.61%
screenshot-1.png241.15KB86.23KB▼ 64.24%
captcha/backgrounds/fb.png11.51KB5.64KB▼ 51.01%
screenshot-6.png239.72KB88.46KB▼ 63.10%
screenshot-4.png178.77KB64.94KB▼ 63.68%