69% sites-monitor

Code Review | Sites Monitor

WordPress plugin Sites Monitor scored69%from 54 tests.

About plugin

  • Plugin page: sites-monitor
  • Plugin version: 1.1.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Jun 25, 2023
  • Latest release: Nov 13, 2023
  • Number of updates: 40
  • Update frequency: every 3.9 days
  • Top authors: verdantstudio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /830 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.64MB] [CPU: ▲998.58ms] 50% from 4 tests

Server-side resources used by Sites Monitor
The following require your attention
  • CPU: You should keep total CPU usage under 500.00ms (currently 1,039.87ms on /wp-admin/admin.php?page=freemius)
  • Extra CPU: Extra CPU usage should be kept under 200.00ms (currently 998.58ms on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /4.14 ▲0.681,043.92 ▲1,004.99
Dashboard /wp-admin3.96 ▲0.621,051.30 ▲991.03
Posts /wp-admin/edit.php4.02 ▲0.661,048.70 ▲1,001.32
Add New Post /wp-admin/post-new.php6.49 ▲0.611,092.87 ▲996.99
Media Library /wp-admin/upload.php3.89 ▲0.661,041.23 ▲1,009.82
Sites Monitor /wp-admin/options-general.php?page=wp-sites-monitor4.122,961.72
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius4.211,039.87

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 256 new files
Database: 1 new table, 15 new options
New tables
wp_wpsm_sites
New WordPress options
widget_recent-posts
db_upgraded
wpsm_site_url
widget_recent-comments
can_compress_scripts
wpsm_type_of_website
wpsm_site_interval
wpsm_site_ap
fs_debug_mode
fs_active_plugins
...

Browser metrics Passed 4 tests

Sites Monitor: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,944 ▲18217.55 ▲3.20115.50 ▲113.9233.14 ▼8.13
Dashboard /wp-admin2,216 ▲415.53 ▼0.1274.79 ▼40.3241.19 ▲0.04
Posts /wp-admin/edit.php2,125 ▲221.98 ▼0.0434.36 ▼2.0235.41 ▲0.43
Add New Post /wp-admin/post-new.php1,674 ▲14820.18 ▼2.95599.94 ▼47.4637.72 ▼18.62
Media Library /wp-admin/upload.php1,412 ▲124.08 ▼0.1193.08 ▼11.9443.12 ▲3.40
Sites Monitor /wp-admin/options-general.php?page=wp-sites-monitor1,0002.1229.5860.25
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,0731.6723.3627.73

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/sites-monitor/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_wpsm_sites
  • The uninstall procedure has failed, leaving 15 options in the database
    • fs_accounts
    • wpsm_site_username
    • widget_recent-comments
    • can_compress_scripts
    • wpsm_site_url
    • wpsm_site_interval
    • fs_active_plugins
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • ...

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Screenshots: These screenshots need descriptions #1, #2, #3 in sites-monitor/assets to your readme.txt
The official readme.txt might help

sites-monitor/sites-monitor.php Passed 13 tests

"Sites Monitor" version 1.1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
51 characters long description:
Monitor your websites and be in charge of the data.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected37,549 lines of code in 207 files:
LanguageFilesBlank linesComment linesLines of code
PHP1588,55418,78735,983
CSS175621191,071
PO File194229206
JavaScript73462201
JSON230085
Markdown1103

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity60.20
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.41
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces8
Interfaces1
Traits1
Classes78
▷ Abstract classes22.56%
▷ Concrete classes7697.44%
▷ Final classes11.32%
Methods1,417
▷ Static methods22515.88%
▷ Public methods1,01071.28%
▷ Protected methods181.27%
▷ Private methods38927.45%
Functions110
▷ Named functions10696.36%
▷ Anonymous functions43.64%
Constants150
▷ Global constants10368.67%
▷ Class constants4731.33%
▷ Public constants47100.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
3 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/sites-monitor.png16.98KB8.73KB▼ 48.55%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%