84% watchman-site7

Code Review | WatchMan-Site7

WordPress plugin WatchMan-Site7 scored84%from 54 tests.

About plugin

  • Plugin page: watchman-site7
  • Plugin version: 4.2.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.3
  • WordPress version: 6.3.1
  • First release: Oct 26, 2017
  • Latest release: Oct 3, 2023
  • Number of updates: 449
  • Update frequency: every 4.8 days
  • Top authors: adminkov (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /3,494 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲1.11MB] [CPU: ▼0.85ms] Passed 4 tests

A check of server-side resources used by WatchMan-Site7
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.73 ▲1.2662.02 ▲19.96
Dashboard /wp-admin4.42 ▲1.0763.74 ▼2.34
Posts /wp-admin/edit.php4.47 ▲1.1151.92 ▼2.57
Add New Post /wp-admin/post-new.php7.02 ▲1.1391.20 ▼7.06
Media Library /wp-admin/upload.php4.34 ▲1.1148.25 ▲8.55
Visitors /wp-admin/admin.php?page=wms7_visitors4.3656.89
Black list /wp-admin/admin.php?page=wms7_black_list4.2339.16
Settings /wp-admin/admin.php?page=wms7_settings4.2539.85

Server storage [IO: ▲0.77MB] [DB: ▲0.02MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 303 new files
Database: 2 new tables, 11 new options
New tables
wp_wms7_visitors
wp_wms7_countries
New WordPress options
can_compress_scripts
wms7_current_url
wms7_frontend
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
wms7_screen_settings
widget_theysaidso_widget
widget_wms7_widget
...

Browser metrics Passed 4 tests

An overview of browser requirements for WatchMan-Site7
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲7514.73 ▲0.792.24 ▲0.3448.75 ▲5.08
Dashboard /wp-admin2,220 ▲465.63 ▲0.0082.63 ▼16.5142.05 ▼4.03
Posts /wp-admin/edit.php2,125 ▲252.00 ▼0.0437.45 ▲0.2735.34 ▲1.42
Add New Post /wp-admin/post-new.php1,547 ▲2123.48 ▲0.49683.03 ▼14.7569.00 ▲11.76
Media Library /wp-admin/upload.php1,428 ▲284.17 ▼0.0099.83 ▼8.5844.58 ▼2.11
Visitors /wp-admin/admin.php?page=wms7_visitors2,0891.8129.1155.61
Black list /wp-admin/admin.php?page=wms7_black_list1,2182.0025.1126.63
Settings /wp-admin/admin.php?page=wms7_settings1,3751.6824.9131.22

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_wms7_widget
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wms7_black_list
    • > Warning in wp-content/plugins/watchman-site7/class-wms7-core.php+2017
    array_shift() expects parameter 1 to be array, null given
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wms7_black_list
    • > Notice in wp-content/plugins/watchman-site7/class-wms7-core.php+2121
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/admin.php?page=wms7_black_list
    • > Notice in wp-content/plugins/watchman-site7/class-wms7-core.php+2131
    Undefined offset: 0
    • > GET request to /wp-admin/admin.php?page=wms7_black_list
    • > Notice in wp-content/plugins/watchman-site7/class-wms7-core.php+2132
    Undefined offset: 1

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: login, blacklist, security, cron, statistic

watchman-site7/watchman-site7.php 92% from 13 tests

The main file in "WatchMan-Site7" v. 4.2.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 278 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin7,411 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP215621,4825,972
JavaScript488213750
CSS12426509
PO File17381180

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity123.20
▷ Minimum class complexity15.00
▷ Maximum class complexity265.00
Average method complexity5.49
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods136
▷ Static methods32.21%
▷ Public methods7353.68%
▷ Protected methods4432.35%
▷ Private methods1913.97%
Functions55
▷ Named functions55100.00%
▷ Anonymous functions00.00%
Constants76
▷ Global constants45.26%
▷ Class constants7294.74%
▷ Public constants72100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
19 PNG files occupy 0.16MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/ban_start_date.png8.26KB3.61KB▼ 56.32%
images/screen_options.png19.21KB8.97KB▼ 53.31%
images/robots.png5.50KB3.07KB▼ 44.12%
images/black_list.png4.20KB2.69KB▼ 36.11%
images/other_functions.png2.79KB1.35KB▼ 51.64%