72% simplest-analytics

Code Review | Simplest Analytics

WordPress plugin Simplest Analytics scored72%from 54 tests.

About plugin

  • Plugin page: simplest-analytics
  • Plugin version: 1.3.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Jan 12, 2023
  • Latest release: Oct 22, 2023
  • Number of updates: 12
  • Update frequency: every 23.6 days
  • Top authors: codenlassen (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

80+ active /623 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

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

Server-side resources used by Simplest Analytics
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1135.30 ▼4.89
Dashboard /wp-admin3.41 ▲0.0743.81 ▼17.68
Posts /wp-admin/edit.php3.53 ▲0.1745.70 ▼1.01
Add New Post /wp-admin/post-new.php6.00 ▲0.1181.24 ▼17.07
Media Library /wp-admin/upload.php3.34 ▲0.1136.00 ▲3.94
Settings /wp-admin/admin.php?page=simplest-analytics-settings3.4138.10
Webanalytics /wp-admin/admin.php?page=simplest-analytics3.6433.46

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 29 new files
Database: 1 new table, 7 new options
New tables
wp_simplest_analytics
New WordPress options
widget_recent-posts
simplest_analytics_version
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Simplest Analytics: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲7314.29 ▼0.282.35 ▲0.6544.11 ▲1.36
Dashboard /wp-admin2,225 ▲455.67 ▼0.0082.95 ▼5.0340.66 ▼3.74
Posts /wp-admin/edit.php2,124 ▲241.98 ▼0.0332.78 ▼5.3635.18 ▲0.58
Add New Post /wp-admin/post-new.php1,548 ▲1123.26 ▲5.11665.48 ▲35.2651.26 ▼23.57
Media Library /wp-admin/upload.php1,424 ▲304.22 ▲0.1194.74 ▼7.6043.21 ▲1.08
Settings /wp-admin/admin.php?page=simplest-analytics-settings1,3351.8625.1530.83
Webanalytics /wp-admin/admin.php?page=simplest-analytics1,3455.1042.0057.27

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=simplest-analytics-settings
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/simplest-analytics/admin/structure.php:70
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/simplest-analytics/admin/dashboard.php:11

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=simplest-analytics
    • > Javascript (severe) in unknown
    https://www.gstatic.com/charts/51/js/jsapi_compiled_default_module.js 293:21 Uncaught Error: Row 0 given with size different than 4 (the number of columns in the table).

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
5 plugin tags: analytics, cookieless, statistic, tracking, video tracking

simplest-analytics/simplest-analytics.php 92% from 13 tests

Analyzing the main PHP file in "Simplest Analytics" version 1.3.1
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected2,562 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP125262582,060
PO File192107248
CSS100182
JavaScript12572

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity5.88
▷ Minimum class complexity1.00
▷ Maximum class complexity23.00
Average method complexity2.26
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods31
▷ Static methods39.68%
▷ Public methods2683.87%
▷ Protected methods00.00%
▷ Private methods516.13%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
8 PNG files occupy 0.36MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png44.33KB18.98KB▼ 57.19%
assets/screenshot-5.png53.49KB26.00KB▼ 51.39%
assets/banner-772x250.png59.97KB17.24KB▼ 71.25%
assets/screenshot-4.png40.35KB17.96KB▼ 55.49%
assets/screenshot-6.png62.79KB29.62KB▼ 52.83%