72% website-analytics

Code Review | Website Analytics

WordPress plugin Website Analytics scored 72% from 54 tests.

About plugin

  • Plugin page: website-analytics
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.3.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.9.2
  • WordPress version: 5.9.2
  • First release: Mar 23, 2020
  • Latest release: Mar 16, 2022
  • Number of updates: 6
  • Update frequency: every 121.0 days
  • Top authors: cyberlord92 (83.33%)twofactorauthentication (33.33%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 419 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼191.66ms] Passed 4 tests

Server-side resources used by Website Analytics
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.27 ▼0.24133.64 ▲83.98
Dashboard /wp-admin3.60 ▲0.19145.19 ▲111.31
Posts /wp-admin/edit.php3.83 ▲0.19168.84 ▲132.42
Add New Post /wp-admin/post-new.php7.14 ▲0.17208.56 ▼1,072.96
Media Library /wp-admin/upload.php3.56 ▲0.25138.31 ▲111.05
Error Report /wp-admin/admin.php?page=mo_error_report3.50156.19
Comments /wp-admin/admin.php?page=mo_cmt_post_report3.50138.25
Page Count /wp-admin/admin.php?page=mo_page_count_report3.51146.15
Settings /wp-admin/admin.php?page=mo_site_analytics_setting3.49139.04
Upgrade /wp-admin/admin.php?page=mo_site_analytics_upgrade3.50135.26
Dashboard /wp-admin/admin.php?page=mo_site_analytics3.51180.66
Guest User Report /wp-admin/admin.php?page=mo_user_login_status3.50132.22
Posts /wp-admin/admin.php?page=mo_post_report3.51168.55
Account /wp-admin/admin.php?page=mo_site_analytics_account3.57190.60
Logged in User Report /wp-admin/admin.php?page=mo_logged_in_report3.52141.05

Server storage [IO: ▲0.84MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 66 new files
Database: 2 new tables, 3 new options
New tables
wp_wpsa_page_details
wp_wpsa_user_activity
New WordPress options
mo_wpns_new_registration
mo_2factor_user_registration_status
mosa_dbversion

Browser metrics Passed 4 tests

A check of browser resources used by Website Analytics
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,836 ▲9215.82 ▲0.196.01 ▼0.092.05 ▼0.08
Dashboard /wp-admin2,966 ▲1056.15 ▼0.01117.83 ▼16.78169.32 ▼2.89
Posts /wp-admin/edit.php2,763 ▲723.12 ▼0.1164.75 ▲0.31143.03 ▲0.75
Add New Post /wp-admin/post-new.php1,664 ▲321.17 ▲4.64406.15 ▲17.90182.46 ▲29.96
Media Library /wp-admin/upload.php1,774 ▲795.52 ▲0.00124.78 ▼16.48210.10 ▲22.07
Error Report /wp-admin/admin.php?page=mo_error_report1,4404.1779.74163.83
Comments /wp-admin/admin.php?page=mo_cmt_post_report1,4234.0383.36159.90
Page Count /wp-admin/admin.php?page=mo_page_count_report1,6404.1074.80175.26
Settings /wp-admin/admin.php?page=mo_site_analytics_setting1,6363.4460.64138.91
Upgrade /wp-admin/admin.php?page=mo_site_analytics_upgrade1,6263.4662.98229.52
Dashboard /wp-admin/admin.php?page=mo_site_analytics1,5014.89112.84182.56
Guest User Report /wp-admin/admin.php?page=mo_user_login_status1,7714.4281.03190.28
Posts /wp-admin/admin.php?page=mo_post_report1,8604.4582.59192.72
Account /wp-admin/admin.php?page=mo_site_analytics_account1,3473.3162.36150.04
Logged in User Report /wp-admin/admin.php?page=mo_logged_in_report2,2564.5481.75187.02

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 2 options in the database
    • mo_2factor_user_registration_status
    • mo_wpns_new_registration

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 11× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/website-analytics/controller/guest_user.php
    • > /wp-content/plugins/website-analytics/controller/post_report_tab.php
    • > /wp-content/plugins/website-analytics/views/dashboard.php
    • > /wp-content/plugins/website-analytics/views/settings.php
    • > /wp-content/plugins/website-analytics/views/upgrade.php
    • > /wp-content/plugins/website-analytics/views/user_login_status_premium.php
    • > /wp-content/plugins/website-analytics/views/post_report_premium.php
    • > /wp-content/plugins/website-analytics/views/cmt_post_report.php
    • > /wp-content/plugins/website-analytics/controller/logged_in_user_report.php
    • > /wp-content/plugins/website-analytics/views/page_report_premium.php
  • 92× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to get property 'base_prefix' of non-object in wp-content/plugins/website-analytics/database/database_function.php on line 7
    • > PHP Warning
      include(): Failed opening 'helper/pluginutility.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/website-analytics/controller/error_report.php on line 4
    • > PHP Warning
      include_once(): Failed opening 'controller/user_login_status_premium.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/website-analytics/controller/guest_user.php on line 28
    • > PHP Warning
      include_once(): Failed opening 'controller/post_report_premium.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/website-analytics/controller/post_report_tab.php on line 28
    • > PHP Fatal error
      Uncaught Error: Class 'MoSite_DB' not found in wp-content/plugins/website-analytics/helper/constants.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/website-analytics/views/page_count.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/website-analytics/views/page_report.php:2
    • > PHP Warning
      include(): Failed opening 'helper/pluginutility.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/website-analytics/controller/user_login_status.php on line 3
    • > PHP Notice
      Undefined variable: browser_chart in wp-content/plugins/website-analytics/views/dashboard.php on line 43
    • > PHP Warning
      include(controller/support.php): failed to open stream: No such file or directory in wp-content/plugins/website-analytics/controller/main_controller.php on line 37

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=mo_site_analytics
    • > Network (severe)
    http://ajax.googleapis.com/ajax/static/modules/gviz/1.0/core/tooltip.css - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: analysis, web monitoring, site analytics, statistics, website analytics...

website-analytics/miniorange-site-activity-setting.php 85% from 13 tests

The main file in "Website Analytics" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("website-analytics.php" instead of "miniorange-site-activity-setting.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 143 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin4,437 lines of code in 53 files:
LanguageFilesBlank linesComment linesLines of code
PHP47411112,644
JavaScript45101,072
CSS2871721

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity10.00
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity2.19
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods68
▷ Static methods34.41%
▷ Public methods6798.53%
▷ Protected methods00.00%
▷ Private methods11.47%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants17
▷ Global constants211.76%
▷ Class constants1588.24%
▷ Public constants15100.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
11 PNG files occupy 0.11MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/angry.png20.40KB9.65KB▼ 52.68%
includes/images/miniOrange2.png3.94KB2.26KB▼ 42.53%
includes/images/miniorange_icon.png0.44KB0.35KB▼ 18.61%
includes/images/normal1.png15.74KB7.91KB▼ 49.78%
includes/images/smile.png17.89KB8.79KB▼ 50.86%