Giter Site home page Giter Site logo

nystudio107 / craft-webperf Goto Github PK

View Code? Open in Web Editor NEW
25.0 4.0 2.0 39.79 MB

Webperf helps you build & maintain high quality websites through Real User Measurement of your website's performance

Home Page: https://nystudio107.com/plugins/webperf

License: Other

JavaScript 0.42% Shell 0.04% PHP 93.46% CSS 0.31% Vue 2.37% Twig 3.29% Dockerfile 0.01% Makefile 0.04% TypeScript 0.06%
craftcms craft-plugin web performance error tracking real user measurement rum

craft-webperf's Introduction

Scrutinizer Code Quality Code Coverage Build Status Code Intelligence Status

Webperf plugin for Craft CMS 5.x

Webperf helps you build & maintain high quality websites through Real User Measurement of your website's performance

Screenshot

Note: The license fee for this plugin is $59.00 via the Craft Plugin Store.

Requirements

This plugin requires Craft CMS 5.0.0 or later.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
    
  2. Then tell Composer to load the plugin:

     composer require nystudio107/craft-webperf
    
  3. Install the plugin via ./craft install/plugin webperf via the CLI, or in the Control Panel, go to Settings → Plugins and click the “Install” button for Webperf.

You can also install Webperf via the Plugin Store in the Craft Control Panel.

Documentation

Click here -> Webperf Documentation

Webperf Roadmap

Some things to do, and ideas for potential features:

  • User definable "Alerts" that can be consumed by the Webhooks plugin
  • Have the Recommendations be a type of "Alert"
  • Comparison of multiple periods side by side to show comparative performance

Brought to you by nystudio107

craft-webperf's People

Contributors

khalwat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

craft-webperf's Issues

Boomerang error on frontend

Getting a strange craft error:

Screenshot 2019-06-24 11 30 15

It's odd b/c it's picking up some text from h1 tag in the site ['Powering Brand']. This H1 tag is a bit different in that I have applied some js fittext that applies some styling to font size. But oddly it's not erroring on every page that I apply that the fittext call.

Server Performance not collecting samples

Hi Andrew,

Any reason you can think of as to why the Server Performance section wouldn't be collecting samples? I've got over 40k in both Browser and Craft performance, but nada under Server Performance:

Screen Shot 2019-04-23 at 10 40 55

I'm running:

  • Craft 3.1.23
  • Webperf 1.0.7
  • PHP 7.2.17
  • MySQL 5.7.25 (running on its own remote server)
  • Also included a WebPageTest API key

Ideas? Maybe a server config thing I need to turn on/adjust?

TypeError in Craft 3.7.2

Describe the bug

The bug shows when I open up a category entry

To reproduce

Steps to reproduce the behaviour:

  1. Go to "CP main left menu"
  2. Click on "Categories and double click a category"
  3. See error message "Argument 1 passed to nystudio107\webperf\Webperf::renderSidebar() must be an instance of craft\base\Element, null given, called in /var/www/project/cms/vendor/nystudio107/craft-webperf/src/Webperf.php on line 586"

Screenshots

See this link

Versions

  • Plugin version: 1.0.24
  • Craft version: 3.7.2

Webperf blocking logout on front end?

I was really surprised at this, but since I built and launched store.gcx.com, I've had 2 weird issues:

  1. Logging into the Control Panel takes 2 clicks of the submit button
  2. Front end logout link not working

These are both reported and dealt with everyday by both me and my client. I've had them on my list to fix.

I sat down today to figure out which plugin (likely) was causing these issues. Because I am weird, I tend to do things from the bottom up. I started by disabling Webperf. Lo and behold #2 is now fixed. I logged in and out on the front end a bunch of times. Reactivated Webperf, and the logout stopped working. Disabled again, and logout worked. I pushed my project config changes to production, disabling Webperf there, and logout is working.

WebPerf Plugin slowed site

Sorry for the vague bug report... I'll try to give you the most information I can...

We added WebPerf to a site and about a day after installing and enabling the plugin, the site got reeeeeally slow. The homepage was taking a good 10seconds to load - and that's not one of our possibly problematic pages that we brought WebPerf in to diagnose. Once I disabled WebPerf, the site snapped back to its normal speeds. The admin panel stayed fast even when the front-end of the site was slow.

Settings I had enabled:

  • Include Browser Beacon: On
  • Include Craft Beacon: On
  • Static Cached Site: On (We're using Incapsula)
  • WebPageTest.org API Key: Empty
  • Webperf Data Samples to Store: bumped that down a tad to 10,000
  • All other settings default

Other Plugins Installed:

  • Asset Rev
  • Cache Flag
  • Rackspace Cloud Files (moving them to AWS soon)
  • Redactor
  • Reroute
  • SuperTable
  • Tags
  • Video Embed
  • Recaptcha
  • a couple more home-coded plugins for this site to integrate with some 3rd-party services. One does do a fairly heavy query for related content, but even pages that don't use that plugin were very slow

Is there anything obvious that I set up incorrectly? Or any log files I should be looking at?

Craft version: 3.0.26.1 (This is further behind than I thought! Scheduling an upgrade night with them now)
plugin version: 1.0.7

Sidebar not rendering

Describe the bug

On all elements - the Sidebar is not rendering and is throwing an error.

Error rendering `_sidebars/webperf-sidebar.twig` -> An exception has been thrown during the rendering of a template ("The file or directory to be published does not exist: /home/eauk/www.eauk.org/vendor/nystudio107/craft-webperf/src/assetbundles/webperf/dist").

To reproduce

Steps to reproduce the behaviour:

  1. Go to any entry
  2. See error message

Expected behaviour

See WebPerf sidebar

Screenshots

CleanShot 2022-02-10 at 12 14 19@2x

Versions

  • Plugin version: 1.0.26
  • Craft version: 3.7.28

Couple of questions

Watched your youtube livestream preview, super excited about this plugin!

Couple of non-live questions:

  1. Have you considered using a median value instead of mean with 10x outlier filter? Perhaps even a quartile type bar chart for aggregate data, would be interesting. Averages can be a bit misleading depending on who you ask.

  2. Would there be anyway to filter by traffic source. Example being a glicd or utm parameter. I've noticed on many of the sites I work on that have heavy paid media [gclid] traffic, performance and errors are pretty wild almost all outliers of typical user. So it would be nice to compare traffic of organic users vs paid media.

  3. In addition to browser & os, is there potential to capture internet connection through https://developer.mozilla.org/en-US/docs/Web/API/Network_Information_API – although seems pretty limited browser support.

  4. A super nice to have, would there be a way to send the session data recorded to webhook or javascript source such as GA event, Segment or Matamo? I say that just out of experience, that most of the reporting/monitoring happens outside of craft so rolling it up into an common dashboard would be helpful - although I think the dashboards you've created already top most of the monitoring tools I've used.

Great work.

Causing internal server error in admin?

Hi,

I installed the trial of webperf. It worked fine at first but suddenly I got locked out of the admin panel with an internal server error. The log file printed below error messsage which lets me assume it has something to do with the plugin. If yes, how can I fix this?

Edit: The frontend loads fine, by the way.

2019-02-25 10:45:27 [-][1][94317439431c01a6555872869f106ec1][error][yii\base\ErrorException:2] yii\base\ErrorException: Division by zero in /home/**/**/vendor/nystudio107/craft-webperf/src/recommendations/MemoryLimit.php:40 Stack trace: #0 /home/**/**/vendor/craftcms/cms/src/web/ErrorHandler.php(76): yii\base\ErrorHandler->handleError(2, 'Division by zer...', '/home/**/...', 40) #1 /home/**/**/vendor/nystudio107/craft-webperf/src/recommendations/MemoryLimit.php(40): craft\web\ErrorHandler->handleError(2, 'Division by zer...', '/home/**/...', 40, Array) #2 /home/**/**/vendor/nystudio107/craft-webperf/src/base/Recommendation.php(35): nystudio107\webperf\recommendations\MemoryLimit->evaluate() #3 /home/**/**/vendor/yiisoft/yii2/base/BaseObject.php(109): nystudio107\webperf\base\Recommendation->init() #4 /home/**/**/vendor/nystudio107/craft-webperf/src/base/CleanModel.php(50): yii\base\BaseObject->__construct(Array) #5 /home/**/**/vendor/nystudio107/craft-webperf/src/services/Recommendations.php(66): nystudio107\webperf\base\CleanModel->__construct(Array) #6 /home/**/**/vendor/nystudio107/craft-webperf/src/Webperf.php(766): nystudio107\webperf\services\Recommendations->list(Object(nystudio107\webperf\models\RecommendationDataSample)) #7 [internal function]: nystudio107\webperf\Webperf->nystudio107\webperf\{closure}(Object(yii\caching\FileCache)) #8 /home/**/**/vendor/yiisoft/yii2/caching/Cache.php(595): call_user_func(Object(Closure), Object(yii\caching\FileCache)) #9 /home/**/**/vendor/nystudio107/craft-webperf/src/Webperf.php(770): yii\caching\Cache->getOrSet('webperf-recomme...', Object(Closure), 60) #10 /home/**/**/vendor/nystudio107/craft-webperf/src/Webperf.php(169): nystudio107\webperf\Webperf->getRecommendationsCount() #11 /home/**/**/vendor/craftcms/cms/src/web/twig/variables/Cp.php(133): nystudio107\webperf\Webperf->getCpNavItem() #12 /home/**/**/vendor/twig/twig/lib/Twig/Extension/Core.php(1626): craft\web\twig\variables\Cp->nav() #13 /home/**/**/vendor/craftcms/cms/src/helpers/Template.php(73): twig_get_attribute(Object(craft\web\twig\Environment), Object(Twig_Source), Object(craft\web\twig\variables\Cp), 'nav', Array, 'method', false, false) #14 /home/**/**/storage/runtime/compiled_templates/ef/ef66fbea8732fe2418c7ebc40f7b49d2fca4568f4f28e0cc6d9f30afe396805f.php(195): craft\helpers\Template::attribute(Object(craft\web\twig\Environment), Object(Twig_Source), Object(craft\web\twig\variables\Cp), 'nav', Array, 'method') #15 /home/**/**/vendor/twig/twig/lib/Twig/Template.php(189): __TwigTemplate_7e89eaa15bd1c373873f900b73defa023cb12b48e008619a6e4d29c91f829467->block_body(Array, Array) #16 /home/**/**/storage/runtime/compiled_templates/db/dbdc8cb81e5773efd5de27bd3da2ab4a672814446bdd58173800b5869c01ade5.php(60): Twig_Template->displayBlock('body', Array, Array) #17 /home/**/**/vendor/twig/twig/lib/Twig/Template.php(386): __TwigTemplate_448399f8e06cec2a6aa98f702d938b0edd5bb82b0f1c3b95cea3104a5f4ce2b9->doDisplay(Array, Array) #18 /home/**/**/vendor/craftcms/cms/src/web/twig/Template.php(49): Twig_Template->displayWithErrorHandling(Array, Array) #19 /home/**/**/vendor/twig/twig/lib/Twig/Template.php(363): craft\web\twig\Template->displayWithErrorHandling(Array, Array) #20 /home/**/**/vendor/craftcms/cms/src/web/twig/Template.php(31): Twig_Template->display(Array, Array) #21 /home/**/**/storage/runtime/compiled_templates/a1/a1fc86af3eb0323b3b1663f2f1deeef83b4c010d22a3f704754790838185954b.php(40): craft\web\twig\Template->display(Array, Array) #22 /home/**/**/vendor/twig/twig/lib/Twig/Template.php(386): __TwigTemplate_10dda3cac79e544fbb2065355947b20cf14061918a405c062b3182d37b143e42->doDisplay(Array, Array) #23 /home/**/**/vendor/craftcms/cms/src/web/twig/Template.php(49): Twig_Template->displayWithErrorHandling(Array, Array) #24 /home/**/**/vendor/twig/twig/lib/Twig/Template.php(363): craft\web\twig\Template->displayWithErrorHandling(Array, Array) #25 /home/**/**/vendor/craftcms/cms/src/web/twig/Template.php(31): Twig_Template->display(Array, Array) #26 /home/**/**/storage/runtime/compiled_templates/ef/ef66fbea8732fe2418c7ebc40f7b49d2fca4568f4f28e0cc6d9f30afe396805f.php(95): craft\web\twig\Template->display(Array, Array) #27 /home/**/**/vendor/twig/twig/lib/Twig/Template.php(386): __TwigTemplate_7e89eaa15bd1c373873f900b73defa023cb12b48e008619a6e4d29c91f829467->doDisplay(Array, Array) #28 /home/**/**/vendor/craftcms/cms/src/web/twig/Template.php(49): Twig_Template->displayWithErrorHandling(Array, Array) #29 /home/**/**/vendor/twig/twig/lib/Twig/Template.php(363): craft\web\twig\Template->displayWithErrorHandling(Array, Array) #30 /home/**/**/vendor/craftcms/cms/src/web/twig/Template.php(31): Twig_Template->display(Array, Array) #31 /home/**/**/storage/runtime/compiled_templates/55/55bd1c30f77b4e9259eccffd1f0bde10f6763b944d3b2a83f913bf159a14a268.php(32): craft\web\twig\Template->display(Array, Array) #32 /home/**/**/vendor/twig/twig/lib/Twig/Template.php(386): __TwigTemplate_50b86bde48fc2e178d7f518c2826e24a73643eede9d8d41baf8135423f322c9d->doDisplay(Array, Array) #33 /home/**/**/vendor/craftcms/cms/src/web/twig/Template.php(49): Twig_Template->displayWithErrorHandling(Array, Array) #34 /home/**/**/vendor/twig/twig/lib/Twig/Template.php(363): craft\web\twig\Template->displayWithErrorHandling(Array, Array) #35 /home/**/**/vendor/craftcms/cms/src/web/twig/Template.php(31): Twig_Template->display(Array, Array) #36 /home/**/**/vendor/twig/twig/lib/Twig/Template.php(371): craft\web\twig\Template->display(Array) #37 /home/**/**/vendor/twig/twig/lib/Twig/Environment.php(289): Twig_Template->render(Array) #38 /home/**/**/vendor/craftcms/cms/src/web/View.php(337): Twig_Environment->render('dashboard/_inde...', Array) #39 /home/**/**/vendor/craftcms/cms/src/web/View.php(384): craft\web\View->renderTemplate('dashboard/_inde...', Array) #40 /home/**/**/vendor/craftcms/cms/src/web/Controller.php(161): craft\web\View->renderPageTemplate('dashboard/_inde...', Array) #41 /home/**/**/vendor/craftcms/cms/src/controllers/DashboardController.php(136): craft\web\Controller->renderTemplate('dashboard/_inde...', Array) #42 [internal function]: craft\controllers\DashboardController->actionIndex() #43 /home/**/**/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array) #44 /home/**/**/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array) #45 /home/**/**/vendor/craftcms/cms/src/web/Controller.php(109): yii\base\Controller->runAction('index', Array) #46 /home/**/**/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('index', Array) #47 /home/**/**/vendor/craftcms/cms/src/web/Application.php(297): yii\base\Module->runAction('dashboard/index', Array) #48 /home/**/**/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction('dashboard/index', Array) #49 /home/**/**/vendor/craftcms/cms/src/web/Application.php(286): yii\web\Application->handleRequest(Object(craft\web\Request)) #50 /home/**/**/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request)) #51 /home/**/**/web/index.php(21): yii\base\Application->run() #52 {main}

Consider adding DB index

I noticed this query on a larger dataset (300K rows):

SELECT *
FROM `webperf_data_samples`
WHERE `requestId`=99999999999999
LIMIT 1

An index on webperf_data_samples.requestId might be useful :-)

Setting to disable Samples from Live Preview?

I recently added this to a site with some performance issues and my client noticed that if you are using Live Preview, it's recording a new sample every time it refreshes live preview which potentially results in a lot of samples and could perhaps end up skewing the data.

I just wonder if it would make sense to have a config option to turn off recording data in Live Preview.

Crash in CP + errors in logs

Hey there Andrew,

Seeing the same few errors often in the logs after trying to access the WebPerf dashboard in Craft. Dashboard crashes after attempting to load for several minutes. Memory limit is 512M on the server droplet.

Errors are as follows...

2020-05-07 16:03:35 [-][-][-][error][nystudio107\webperf\services\DataSamples::addDataSample] SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction

2020-05-05 17:58:23 [-][-][-][error][nystudio107\webperf\services\DataSamples::addDataSample] SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction

Craft CMS 3.4.7.1
Webperf 1.0.17

Thanks!

Unknown parseEnv function on Page Performance Details

I have a site still on 3.0.39 and when I'm on an entry and click "Page Performance Details" I get a twig error:

Twig Syntax Error – Twig_Error_Syntax
Unknown "parseEnv" function.
 in /chroot/home/domain/vendor/nystudio107/craft-webperf/src/templates/performance/_includes/backend.twig at line 120

{% set webpageTestApiKey = parseEnv(webpageTestApiKey) %}

I remember seeing parseEnv in recent craft release notes and it looks like maybe it was added in 3.1. I was able to check on our staging server which has 3.1 on it and it worked fine. So maybe required version needs bumped up or something.

[FR] Set an interval on database trimming

Allow a configurable setting (defaulting to perhaps once every 24 hours) that database trimming should be performed.

This is to prevent it from trimming the database on every request if Automatically Trim Data Samples is on.

Removing redundant title tags

Question

We are using SEOMatic and are having issues with it replicating title title tags on pages. How do we turn off the SEOMatic Title tag insert?

Additional context

Add any other context or screenshots about the support request here.

Webperf is displaying 0 samples

Webperf displays that there are 0 data samples because the average of the number of samples for all of the pages is < 1

Probably it should round up or display something more useful

unknown

Metrics Widget

It looks like the metrics widget might not be quite finished ?

image

Sidebar UI has been a bit of a mess for a while

Describe the bug

Screenshot 2024-01-30 at 4 10 03 PM

I'm assuming I don't need to breakdown how to reproduce and what is expected.

Versions

  • Plugin version: 4.0.0
  • Craft version: Craft Pro 4.5.10

Also is the same for Chrome, Firefox, and Safari.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.