84% wp-site-monitor

Code Review | WP Site Monitor

WordPress plugin WP Site Monitor scored84%from 54 tests.

About plugin

  • Plugin page: wp-site-monitor
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.9
  • WordPress version: 6.3.1
  • First release: Jan 30, 2018
  • Latest release: Feb 4, 2018
  • Number of updates: 7
  • Update frequency: every 1.0 days
  • Top authors: bwibrew (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /732 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼4.23ms] Passed 4 tests

This is a short check of server-side resources used by WP Site Monitor
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0737.73 ▼0.18
Dashboard /wp-admin3.41 ▲0.1151.40 ▲2.88
Posts /wp-admin/edit.php3.53 ▲0.1743.47 ▼3.14
Add New Post /wp-admin/post-new.php6.00 ▲0.1180.71 ▼13.65
Media Library /wp-admin/upload.php3.33 ▲0.1035.63 ▲0.04
WP Site Monitor /wp-admin/options-general.php?page=wp_site_monitor3.3035.20

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by WP Site Monitor
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.72 ▲0.431.62 ▲0.0141.96 ▼0.02
Dashboard /wp-admin2,199 ▲225.65 ▲0.1196.98 ▲8.8041.64 ▲5.19
Posts /wp-admin/edit.php2,104 ▲41.99 ▼0.0334.23 ▼2.6433.84 ▼0.52
Add New Post /wp-admin/post-new.php1,531 ▲523.32 ▼0.32627.42 ▼56.4757.74 ▲3.86
Media Library /wp-admin/upload.php1,401 ▲14.19 ▼0.0392.60 ▼18.4640.08 ▼6.96
WP Site Monitor /wp-admin/options-general.php?page=wp_site_monitor8411.9925.1428.83

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Please fix the following
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wp-site-monitor/templates/settings-page.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-site-monitor/templates/setting-input-wp-version.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-site-monitor/templates/setting-section-endpoints.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-site-monitor/templates/setting-input-enable.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-site-monitor/templates/setting-section-enable.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/wp-site-monitor/src/class-api.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-site-monitor/templates/setting-input-plugins.php:15

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 Passed 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: remote administration, admin, rest, rest-api, api

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

The main PHP file in "WP Site Monitor" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
67 characters long description:
Provides extra WP REST API endpoints to help manage sites remotely.

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
No dangerous file extensions were detected641 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP19146455584
Markdown110056
JSON1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity9.00
▷ Minimum class complexity1.00
▷ Maximum class complexity40.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods43
▷ Static methods511.63%
▷ Public methods4195.35%
▷ Protected methods00.00%
▷ Private methods24.65%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants5
▷ Global constants360.00%
▷ Class constants240.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin