89% wp-lean-analytics

Code Review | WP Lean Analytics

WordPress plugin WP Lean Analytics scored89%from 54 tests.

About plugin

  • Plugin page: wp-lean-analytics
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.0-5.4.0
  • WordPress version: 6.3.1
  • First release: Nov 8, 2019
  • Latest release: Apr 17, 2020
  • Number of updates: 5
  • Update frequency: every 228.0 days
  • Top authors: wpserviceagents (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /548 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.16MB] [CPU: ▼5.72ms] Passed 4 tests

Server-side resources used by WP Lean Analytics
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1736.75 ▼3.35
Dashboard /wp-admin3.47 ▲0.1746.72 ▼0.01
Posts /wp-admin/edit.php3.58 ▲0.2343.97 ▼1.84
Add New Post /wp-admin/post-new.php6.05 ▲0.1682.36 ▼17.69
Media Library /wp-admin/upload.php3.39 ▲0.1638.53 ▲3.96
Configuration /wp-admin/admin.php?page=wp_lean_analytics_free_menuPageConfiguration3.4832.60
Facebook Pixel Wizard /wp-admin/admin.php?page=wp_lean_analytics_free_menuPageFacebookPixelWizard3.4230.54
WP Lean Analytics /wp-admin/admin.php?page=wp_lean_analytics_free_menuPages3.4032.89
Smartlook recording Wizard /wp-admin/admin.php?page=wp_lean_analytics_free_menuPageSmartlookWizard3.4231.34
Google Analytics Wizard /wp-admin/admin.php?page=wp_lean_analytics_free_menuPageGoogleAnalyticsWizard3.4630.87

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 20 new files
Database: no new tables, 27 new options
New WordPress options
wp_lean_analytics_free_smartlook_analytics_key
wp_lean_analytics_free_google_analytics_respect_wp_consent_manager_pro_settings
wp_lean_analytics_free_google_analytics_anonymize_ip
db_upgraded
wp_lean_analytics_free_facebook_analytics_respect_wp_consent_manager_pro_settings
wp_lean_analytics_free_google_analytics_key
wp_lean_analytics_free_facebook_analytics_track_loggedin
widget_theysaidso_widget
theysaidso_admin_options
wp_lean_analytics_free_facebook_analytics_track_login_registration
...

Browser metrics Passed 4 tests

WP Lean Analytics: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲8614.34 ▼0.011.89 ▲0.2444.66 ▲1.95
Dashboard /wp-admin2,231 ▲545.66 ▲0.0488.27 ▼3.1238.70 ▼1.38
Posts /wp-admin/edit.php2,135 ▲321.98 ▼0.0535.01 ▼2.7331.26 ▼5.58
Add New Post /wp-admin/post-new.php1,560 ▲3422.93 ▼0.19601.63 ▼5.6095.89 ▲31.42
Media Library /wp-admin/upload.php1,432 ▲324.23 ▼0.04100.26 ▼3.9645.50 ▲1.56
Configuration /wp-admin/admin.php?page=wp_lean_analytics_free_menuPageConfiguration1,4172.0025.9931.92
Facebook Pixel Wizard /wp-admin/admin.php?page=wp_lean_analytics_free_menuPageFacebookPixelWizard8832.0026.0426.59
WP Lean Analytics /wp-admin/admin.php?page=wp_lean_analytics_free_menuPages1,0241.9927.2137.75
Smartlook recording Wizard /wp-admin/admin.php?page=wp_lean_analytics_free_menuPageSmartlookWizard8852.0026.5425.08
Google Analytics Wizard /wp-admin/admin.php?page=wp_lean_analytics_free_menuPageGoogleAnalyticsWizard8832.0023.8125.74

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests Passed 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)
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: Add images for these screenshots: #1 (Here you can configure your tracking codes and all the other options), #2 (With the built in wizard, you are setup in minutes)
  • Tags: You are using too many tags: 13 tag instead of maximum 10
Please take inspiration from this readme.txt

wp-lean-analytics/wp-lean-analytics.php 85% from 13 tests

The main file in "WP Lean Analytics" v. 1.1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Domain Path: The domain path points to a folder that does not exist ("/plugin/languages")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

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
No dangerous file extensions were detected1,650 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP132171431,531
CSS1160119

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity97.00
▷ Minimum class complexity97.00
▷ Maximum class complexity97.00
Average method complexity5.17
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods23
▷ Static methods14.35%
▷ Public methods23100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.61MB with 0.45MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
plugin/img/wp_lean_analytics-wizard_google_analytics.png174.45KB52.72KB▼ 69.78%
plugin/img/wp_lean_analytics-wizard_smartlook.png209.73KB55.88KB▼ 73.36%
plugin/img/wp_lean_analytics-wizard_facebook_pixel.png243.11KB55.99KB▼ 76.97%