84% frontend-analytics

Code Review | Frontend Analytics

WordPress plugin Frontend Analytics scored84%from 54 tests.

About plugin

  • Plugin page: frontend-analytics
  • Plugin version: 2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2
  • WordPress version: 6.3.1
  • First release: Sep 13, 2019
  • Latest release: Mar 16, 2023
  • Number of updates: 13
  • Update frequency: every 99.9 days
  • Top authors: stiofansisland (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

100+ active /3,344 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.75MB] [CPU: ▼1.76ms] Passed 4 tests

Analyzing server-side resources used by Frontend Analytics
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.58 ▲1.1149.58 ▲8.37
Dashboard /wp-admin3.96 ▲0.6551.91 ▼1.36
Posts /wp-admin/edit.php4.01 ▲0.6556.25 ▲2.04
Add New Post /wp-admin/post-new.php7.15 ▲1.2695.14 ▼8.96
Media Library /wp-admin/upload.php3.82 ▲0.5942.60 ▲1.23
Frontend Analytics /wp-admin/options-general.php?page=frontend-analytics4.3640.48

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 288 new files
Database: no new tables, 8 new options
New WordPress options
widget_frontend_analytics
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
frontend_analytics_redirected
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Frontend Analytics
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.27 ▼0.291.67 ▼0.1452.41 ▲14.13
Dashboard /wp-admin2,193 ▲195.58 ▼0.0287.55 ▲1.3738.79 ▼0.11
Posts /wp-admin/edit.php2,104 ▲42.02 ▲0.0535.01 ▼0.1433.31 ▼6.11
Add New Post /wp-admin/post-new.php6,204 ▲4,67821.29 ▼1.68871.64 ▲200.8366.91 ▲5.85
Media Library /wp-admin/upload.php1,404 ▲44.21 ▼0.06101.48 ▼6.2145.71 ▲1.28
Frontend Analytics /wp-admin/options-general.php?page=frontend-analytics8801.9922.0727.32

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-posts
    • widget_frontend_analytics
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • frontend_analytics_redirected
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
The following issues need your attention
  • 185× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/frontend-analytics/vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/frontend-analytics/includes/libraries/google-api-php-client/src/Google/Service/Translate.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/frontend-analytics/vendor/composer/installers/src/Composer/Installers/AglInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/frontend-analytics/vendor/composer/installers/src/Composer/Installers/CraftInstaller.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/frontend-analytics/vendor/composer/installers/src/Composer/Installers/YawikInstaller.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/frontend-analytics/vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/frontend-analytics/vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/frontend-analytics/vendor/composer/installers/src/Composer/Installers/UserFrostingInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/frontend-analytics/includes/libraries/google-api-php-client/src/Google/Service/Freebase.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/frontend-analytics/includes/libraries/google-api-php-client/src/Google/Service/Coordinate.php:31

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Screenshots: Please add an image for screenshot #4 (Top Countries.)
You can take inspiration from this readme.txt

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

"Frontend Analytics" version 2.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
48 characters long description:
Displays Google Analytics stats on the frontend.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected182,133 lines of code in 269 files:
LanguageFilesBlank linesComment linesLines of code
PHP26012,53534,677176,269
SVG30124,842
PO File1319430678
JSON100202
Markdown2320139
JavaScript10112
YAML1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.04
Average class complexity1.46
▷ Minimum class complexity1.00
▷ Maximum class complexity512.00
Average method complexity1.06
▷ Minimum method complexity1.00
▷ Maximum method complexity89.00
Code structure
Namespaces3
Interfaces1
Traits0
Classes3,131
▷ Abstract classes70.22%
▷ Concrete classes3,12499.78%
▷ Final classes00.00%
Methods23,927
▷ Static methods550.23%
▷ Public methods23,80999.51%
▷ Protected methods640.27%
▷ Private methods540.23%
Functions81
▷ Named functions7288.89%
▷ Anonymous functions911.11%
Constants284
▷ Global constants155.28%
▷ Class constants26994.72%
▷ Public constants269100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.03MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
vendor/ayecode/wp-super-duper/icons/placeholder.png29.55KB29.15KB▼ 1.33%