90% analytics-buddy

Code Review | Analytics Buddy

WordPress plugin Analytics Buddy scored 90% from 54 tests.

About plugin

  • Plugin page: analytics-buddy
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.5
  • WordPress version: 6.3.1
  • First release: Jun 2, 2018
  • Latest release: Oct 9, 2020
  • Number of updates: 18
  • Update frequency: every 47.8 days
  • Top authors: fpcorso (100%)

Code review

54 tests

User reviews

1 review

Install metrics

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

Server metrics [RAM: ▲0.04MB] [CPU: ▼2.45ms] Passed 4 tests

An overview of server-side resources used by Analytics Buddy
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.88 ▼1.69
Dashboard /wp-admin3.35 ▲0.0574.39 ▲24.15
Posts /wp-admin/edit.php3.46 ▲0.1147.88 ▲0.73
Add New Post /wp-admin/post-new.php5.93 ▲0.0485.11 ▼8.38
Media Library /wp-admin/upload.php3.27 ▲0.0532.15 ▼0.44
Analytics Buddy /wp-admin/options-general.php?page=analytics_buddy3.2428.89

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
anbu_review_message_trigger
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Analytics Buddy
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.12 ▼1.471.62 ▼0.2245.00 ▲0.39
Dashboard /wp-admin2,210 ▲254.85 ▼0.05110.71 ▲6.5143.04 ▲1.96
Posts /wp-admin/edit.php2,093 ▲42.06 ▲0.0641.27 ▲6.4337.22 ▲5.79
Add New Post /wp-admin/post-new.php1,523 ▼1923.24 ▲5.11677.64 ▲80.7956.08 ▼10.70
Media Library /wp-admin/upload.php1,389 ▲14.21 ▲0.0194.51 ▼1.8640.03 ▼1.53
Analytics Buddy /wp-admin/options-general.php?page=analytics_buddy8052.0325.6329.31

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-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

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)
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration Passed 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
4 plugin tags: google, tracking, do not track, analytics

analytics-buddy/analytics-buddy.php Passed 13 tests

Analyzing the main PHP file in "Analytics Buddy" version 1.0.2
52 characters long description:
Quickly and easily add Google Analytics to your site

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
There were no executable files found in this plugin234 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP634164219
Markdown17015

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity4.67
▷ Minimum class complexity1.00
▷ Maximum class complexity10.00
Average method complexity1.61
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods18
▷ Static methods844.44%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png56.58KB19.28KB▼ 65.93%