EE4/5 compatibility updates:

  • Publisher is EE4 and EE5 compatible, but it does not currently support the Fluid field (it's in the works).

Ticket: Reading Time Pro - Feedback & Issues

Status Open
Add-on / Version Bloqs 0.1.0
Severity
EE Version 5.2.1

Sarah Friedlander

Apr 09, 2019

Hey Brian,

We installed the beta for Reading Time Pro today. Is looking good but I have some questions & feedback.
Please check out this video: https://share.vidyard.com/watch/HrsbAprHbYUZ8nNuFRiQHw?
Here are the steps:

1. After installing the addon I browsed the listing page. It seems it evaluates whatever’s inside the exp:channel:entries tag. Because the listing page has so little content, it saved a few seconds of reading time on each entry.

2. To reset that I have to re-save an entry, and then visit the detail page with the full text before I visit the listing page. This is ok for new entries (I haven’t tried, but I would assume using the preview could be enough to save the right content on entry save), but we have another +1000 blog articles that would need re-saving. Is there a way we can work around this? Or could we ask the plugin to save the reading time of a specific content field, even if it’s not parsed on that listing exp:channel:entries loop?

3. The {finished_reading_time:relative} tag outputs “in xxx minutes” or “less than a minute”. On the first case, can we remove the word “in”? I tried to have more control with {reading_time format="%i"} but it seems PHP always outputs the leading zero on the minutes format, and looks odd.

That’s my feedback so far. Other than that it performs fast and works nicely.
Please keep me in copy as well as Sarah. Once we get your responses we’ll be able to close and publish into production.
Thank you for your work!

Best regards,
Santiago.-

 

#1

BoldMinded (Brian)

Apr 09, 2019

Hi, Santiago!

1) Did you add the reading_time_field=”” parameter to your listing entry page? If so that would explain why it captured such a small reading time. You shouldn’t have to add it to the listing page, only the entries tag that contains the full content, but in the listing page just add the {finished_reading_time:relative} to display the output.

2) Thanks for mentioning the reset stuff, maybe I can add a CP page or something to perform a global reset of reading times so you don’t have to re-save each entry separately. For now you may need to just run an DB query to delete the value in that field. If this isn’t something you’re comfortable with I can help with that, but I would need to know what the field_id is of the custom field.

3) The :relative modifier is an EE thing, not something I wrote. You might be able to add your own language file to override what EE is trying to do. I think this is the value it uses for the text: https://github.com/ExpressionEngine/ExpressionEngine/blob/stability/system/ee/legacy/language/english/core_lang.php#L209

#2

BoldMinded (Brian)

Apr 09, 2019

Comment has been marked private.

#3

BoldMinded (Brian)

Apr 10, 2019
#4

Sarah Friedlander

Apr 10, 2019

Brian,

I was testing this. When going into the backend options, to see the list or click the reset, I get this:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 36864 bytes) in /var/www/staging/html/w-admin/ee/EllisLab/ExpressionEngine/Service/Model/Model.php on line 724

If I refresh the page I get to see the list, but I can’t reset it.
Can you have a look?

#5

Sarah Friedlander

Apr 10, 2019

FYI also from my tests, the entry preview parses the plugin just fine, but doesn’t save the info on the db. Not sure if that’s by design. Thanks!

Santiago.-

#6

BoldMinded (Brian)

Apr 10, 2019

I was worried about that the performance of the deletion. I asked EllisLab in the forum the best way to batch clear a single field across a ton of entries, so waiting on feedback from them on that.

#7

BoldMinded (Brian)

Apr 10, 2019

“but doesn’t save the info on the db. Not sure if that’s by design.” - it should definitely be saving the value to the DB. Are you able to take a quick video of this so I can see what you are seeing (including the DB)?

#8

BoldMinded (Brian)

Apr 10, 2019

“but doesn’t save the info on the db. Not sure if that’s by design.” - it should definitely be saving the value to the DB. Are you able to take a quick video of this so I can see what you are seeing (including the DB)?

#9

Sarah Friedlander

Apr 11, 2019

HI Brian,

I will let Santiago respond about the db issue.  He will send you a video for that.  I do have a question about the word “in”.  I know you showed us where it was, but Santiago was having a hard time finding it.  I’m wondering if you would be able to fix that for us, so that we don’t have to override EE files override files every time we upgrade.

Let me know.  Thanks!

- Sarah

#10

BoldMinded (Brian)

Apr 11, 2019

I think you can do user based language overrides. In system/user/language/make an english folder, and a core_lang.php file with the following contents:

<?php  if ( !defined('BASEPATH')) exit('No direct script access allowed');

$lang [
    
'future' => 'whatever you want %s.',
]

If that does not work, you may have to copy the entire language/english folder from EE’s core to your user folder and make the change there. It depends on how EE loads and merges those arrays.

#11

Sarah Friedlander

6 days ago

Thanks Brian, the language bit did the work nicely.

I installed your addon on production and got tons of errors:
https://drive.google.com/file/d/15xH-a8HDJQXPHp3HkkklunIDeJEhEIBg/view?usp=sharing
What do you think?

Regarding the “not saving in the db” bit, let’s see if I can explain myself better.
Check out this video:
https://share.vidyard.com/watch/y6HMqopJGRmQ5Cb48BA3cJ?

1. I opened with saved reading time data. I saved the entry and the data was reset.
2. After saving I opened the preview. On the live preview the tag parses nicely and shows the right result. I save the entry again.
3. Though the tag parsed correctly, after saving and refreshing I still get the “Reading time has not been calculated.”

I would assume that after step #2, since the tag parsed the content on the live preview, that action would save the reading time.
Makes sense?

Looking forward to your feedback.
Santiago.-

#12

BoldMinded (Brian)

6 days ago

Did you get that query error in any local or dev environments first? What exactly are you doing when you get that error? Just loading the settings page? How many channels do you have the reading time field assigned to? Did you create 1 reading time field and assign it to multiple channels, or multiple reading time fields and assign each one to a specific channel? The specific you can get about your usage of this (channel and field names used, maybe even field_ids) the more it helps me understand what might be happening. Can you update the ticket again with CP login so I can take a peak at the environment?

Thanks for the video. It probably does save the reading time to the DB when loading the live preview, but since the publish page is still open, it isn’t live updating to fetch the newly saved value, so it might be saving a blank value back to the database immediately when you click the save button. I’ll take a further look into this scenario.

#13

BoldMinded (Brian)

6 days ago

Also, I might have to update the settings page to add checkboxes to select which entries you want to reset the reading times for to create a batch query. Trying to update 100s or 1000s of entries at once will likely cause problems (and might be the error you posted the screenshot of). Which means you’d be able to reset just 20 entries at a time.

#14

BoldMinded (Brian)

6 days ago

Comment has been marked private.

#15

BoldMinded (Brian)

6 days ago

Do you have a URL to your staging site that I can take a look at that is using RTP? Also, do you mind if I take a screenshot of the front-end entry displaying the calculated reading time and use the screenshot in when promoting the item and in the docs? My local environment is bare bones and doesn’t really have a design to provide context. smile

#16

BoldMinded (Brian)

3 days ago

Comment has been marked private.

#17

Sarah Friedlander

3 days ago

Comment has been marked private.

#18

BoldMinded (Brian)

3 days ago

The user/pass in the ticket is not working.

#19

Sarah Friedlander

3 days ago

Can you try again?

#20

BoldMinded (Brian)

3 days ago

Login works now, thanks.

#21

BoldMinded (Brian)

3 days ago

You didn’t have the parameter on the entries tag:

{exp:channel:entries channel="news_articles" dynamic="no" limit="100" reading_time_field="reading_time"
#22

Sarah Friedlander

3 days ago

OK I added that. It’s parsing the content of the listing, like I reported earlier on the thread.
Have a look: https://www.w-systems.com/blog

My code:
{exp:channel:entries
      channel=“news_articles”
      paginate=“bottom”
      dynamic=“no”
      limit=“12”
      reading_time_field=“reading_time”
  }

Let me know. I installed 0.4 already btw.
Santiago.-

#23

BoldMinded (Brian)

3 days ago

Comment has been marked private.

#24

Sarah Friedlander

3 days ago

OK. Any ideas about the listing?

#25

BoldMinded (Brian)

3 days ago

I refreshed the reading times on some of the more recent entries and it seems to have calculated it right. Remember, don’t put the reading_time_field=“reading_time” parameter on your blog list page, just the page that is displaying the full blog content. The list page won’t display a reading time until the full page has been loaded at least once.

#26

Sarah Friedlander

3 days ago

Hi Brian,

So to confirm - in order to calculate correctly we would have to go in and resave all blog article entries?

- S

#27

Sarah Friedlander

3 days ago

Hi Brian,

I tried resaving a few entries and it keeps defaulting back to seconds.

#28

Sarah Friedlander

3 days ago

Brian,

If I don’t add the reading_time_field=“reading_time” to the listing, the {finished_reading_time:relative} tag won’t parse.
What do you suggest to fix that? I thought you were answering this on https://boldminded.com/support/ticket/1955#comment21, sorry for the confusion.

We’re also worried that whenever we make any changes and save the entry, we’ll have to go to the entry again on the frontend. We can do that for a first round, but on daily basis with +1000 articles that will be a nightmare. Is there any way it could calculate and save on the backend, w/o having to go through the actual entry on the website?

Thanks,
Santiago.

#29

BoldMinded (Brian)

3 days ago

Comment has been marked private.

#30

BoldMinded (Brian)

3 days ago

“If I don’t add the reading_time_field=“reading_time” to the listing, the {finished_reading_time:relative} tag won’t parse.” - I’m looking into this.

#31

BoldMinded (Brian)

3 days ago

Yeah, I see the issue now. I’ll send a new build soonish.

#32

BoldMinded (Brian)

3 days ago

Comment has been marked private.

#33

BoldMinded (Brian)

3 days ago

Comment has been marked private.

#34

Sarah Friedlander

3 days ago

Fantastic. Works like a charm.

Regarding this bit:
You don’t have to save them to re-calculate, that is why I made the module page so you can select entries and reset the values. To re-calculate you have to load one fo the full detail pages, e.g. https://www.w-systems.com/blog/building-a-prospect-list

The module works just fine too, and it’s useful when we want to reset on purpose. But if I save an entry, it does reset/empty the existing value. So if I, let’s say, only fix a typo, I still have to go into the full detail page on the frontend to have the correct value re-saved into the database. This doesn’t affect the detail page, because whenever I load it it’s going to update the value, but it does affect the values on the listing page.

Here’s another quick video, in case it’s useful:
https://share.vidyard.com/watch/2Boaf4ggt8TiuFxgFZ54BE?

Thanks for the fast responses!
Santiago

#35

BoldMinded (Brian)

3 days ago

I watched the video and tried to replicate it locally but wasn’t able to. That appeared to have reset the field value for all entries, does that describe what you are seeing?

#36

Sarah Friedlander

3 days ago

Not quite. It only resets the field value of the entry you’re saving. I just gave you an example where I only had one entry with reading time value.
So, current behaviour:
1. Entry “A” has a reading time of 6 minutes.
2. I edit entry “A”, and save.
3. As soon as I save, the entry’s reading time is set to empty.
4. I must go into the detail url again, so it re-saves the reading time.

Expected behaviour:
1. Entry “A” has a reading time of 6 minutes.
2. I edit entry “A”, and save. It doesn’t erase or override the reading time. This means it still shows up perfectly on listings.
4. If I want to, I can go into the detail url, and it will refresh/update the reading time.

Hope that makes more sense.
S-

#37

BoldMinded (Brian)

2 days ago

It only resets the field value of the entry you’re saving…
1. Entry “A” has a reading time of 6 minutes.
2. I edit entry “A”, and save.
3. As soon as I save, the entry’s reading time is set to empty.
4. I must go into the detail url again, so it re-saves the reading time.

Which is the correct behavior, sounds like that is working correctly to me.

I edit entry “A”, and save. It doesn’t erase or override the reading time. This means it still shows up perfectly on listings.

If someone edits an entry, it could be changing the amount of words, thus the reading time would need to be re-calculated.

If I want to, I can go into the detail url, and it will refresh/update the reading time

That would require some sort of trigger, such as a query string parameter to tell it to refresh the reading time, otherwise it would refresh it every page load, which defeats the purpose of caching it (and defeats the purpose of this add-on).

Yes, when you edit an entry it will wipe out the reading time value. The first time someone loads the detail page it will re-calculate and immediately show the reading time to the user. Until that is done, the listing page won’t have a reading time, so maybe a conditional on the listing page would be appropriate to not show anything until the detail page has been loaded at least once. Maybe you can instruct content editors to to visit the page after they make any updates. This is a bit of a chicken and egg scenario, yes, but either scenario requires some manual intervention to load the detail page and force the calculation to happen. The only automated way around this is to get much more complex with the add-on and have it load the page in the background after saving with a cURL request similar to how CE Cache re-warms the page, but that wasn’t in scope.

#38

BoldMinded (Brian)

2 days ago

I could add an option to the fieldtype that is a checkbox that when checked won’t reset the reading time when saving an entry. It would be checked by default though.

#39

Sarah Friedlander

2 days ago

You had also mentioned this: The only automated way around this is to get much more complex with the add-on and have it load the page in the background after saving with a cURL request similar to how CE Cache re-warms the page, but that wasn’t in scope.

I know this was not in scope, but I am wondering what an estimate would be to have this feature built out?

(This is Sarah responding again, Santiago is out on vacation this week for the Easter holidays).

#40

BoldMinded (Brian)

2 days ago

I’d have to think about that one for a bit. I’ll get back to you tomorrow. The problem is, unless you’re using Structure it is difficult to know what the URL is to any entry due to how un-restricting EE’s templates are.

#41

BoldMinded (Brian)

2 days ago

I might be able to use the Preview URL used in the Live Preview feature. Still, will need to think about it.

#42

Sarah Friedlander

2 days ago

No problem - give it some thought.

We have a pretty large marketing team, so relying on each content writer, marketing manager an associate marketing manager to load the live page is a hard task.  My hope was that on save we would be able to calculate the reading time (the backend to EE) instead of it loading only when you go to the live page on the frontend. 

Think about it - I don’t want to make this more difficult than it needs to be.

#43

BoldMinded (Brian)

1 day ago

I think I can make this work as long as the Structure URL or Live Preview URL are defined, which it sounds like you’re using the LP, so that is good. This one is a bit of a nebulous feature, so I’m estimating 2-8 hours of work. Again I’ll have a better idea of how long it’ll take after I spend 1-2 hours working on it. I’ll make it so if neither the Structure URL or Live Preview URL are available, it just won’t attempt to load the page, b/c then it gets super complex.

#44

BoldMinded (Brian)

1 day ago

Comment has been marked private.

#45

BoldMinded (Brian)

1 day ago

The build in the previous message will attempt to refresh the reading time of the actual detail page so long as it has one of the following:

• A Structure URL
• A Pages URL
• A Live Preview URL is defined in the channel’s settings

If it still doesn’t work, check the developer log. The server needs to be able to make requests to itself. Locally I had to an entry to my hosts file, e.g.

127.0.0.1    local.dev 
#46

Sarah Friedlander

1 day ago

Hi Brian,

Sorry for the silence - I’m swamped with some other items at work today.  I can review the comments either later tonight or tomorrow.  We do not use Structure URL for the blog now, and we don’t always generate a live preview before saving.

What does the new build accomplish?  I’m happy to agree upon the hours of work, but I want to make sure that we both agree with the scope and desired result before proceeding.

Thank you!

-S

#47

Sarah Friedlander

18 hours ago

Hi Brian,

I tested out this build on our staging site - when I go into the backend of an entry and save instead of it calculating the time it changes the time read to the word “read”.  Here’s a video showing this: https://www.screencast.com/t/9xwdnWsvq2HU

Thanks,
Sarah

#48

BoldMinded (Brian)

11 hours ago

Comment has been marked private.

#49

Sarah Friedlander

7 hours ago

Here you go - Easier as a txt file, the image was quite large.

#50

BoldMinded (Brian)

6 hours ago

So it is clearly able to make a request to that page, which should have set the reading time correctly.

I’ll double check locally but this has worked for me in all instances.

#51

Sarah Friedlander

3 hours ago

OK, thanks.  If you want access to our staging environment to test, let me know.

- Sarah

#52

BoldMinded (Brian)

3 hours ago

Staging access might help, yes. Are you able to provide FTP? If so make sure the login works before you send it (seems half the time I get sent FTP info it doesn’t work the first time I try it b/c the user doesn’t have write permissions or something).

#53

BoldMinded (Brian)

3 hours ago

Edit the ticket and add the FTP info in the provided fields. When the ticket is closed the info is removed from my DB, it’s the most secure way to share it.

#54

Sarah Friedlander

3 hours ago

Will do.  I just added a task for my DevOps team to give you FTP access.  I’ll test it before I send it to you. 

#55

BoldMinded (Brian)

51 minutes ago

Comment has been marked private.

#56

Sarah Friedlander

33 minutes ago

No change - still turning everything to “read”.  I’m working on getting you FTP access along with login to staging

#57

BoldMinded (Brian)

25 minutes ago

“read” is just the text from the language file, it means there is no reading time value being saved to the db.

#58

Sarah Friedlander

12 minutes ago

I added login via FTP as well as EE CP to the ticket.  I tested both.  For FTP these are the settings you’ll need:

Please note that since this is staging the website is in offline mode.  If you need to do testing to see logs, you can temporarily activate and turn it to online mode.

- Sarah

Login to reply

Contact

For add-on support, please use the Support section. General inquries and pre-sale questions can be sent to support@boldminded.com.