- NewspaperHow to use the Flex Blocks cache option
- NewspaperCache plugin – install and configure
- NewspaperWP Rocket and Newspaper Theme: Optimization Guide
- NewspaperFlex Block Settings Guide
- NewspaperGeneral Options that May Interfere with the Newspaper Theme
- NewspaperThe Newspaper Mobile Theme: Introduction
- NewspaperAutoptimize Plugin – install and configuration
- NewspaperHow to update a plugin
- NewspaperCloudflare (CDN)
- NewspaperFacebook Share
- NewsmagRequirements for Newsmag
- NewsmagHow to update the theme
- NewsmagtagDiv Social Counter tutorial
- NewsmagTop bar templates
- NewsmagAjax view count
- TutorialsWhat is Ajax preloading?
- NewspaperVideo Playlist
- Newspaper7 Days Post Sorting
- NewspaperAjax View Count
- NewspaperTop bar templates
hi,
in the next update we gonna release a new modify version of the 7 day count.
until then please try disabling your cache.
Thanks for you message.
Radu A.
Already fixed.
It has nothing to do with the theme.
Thank you.
Hi.
I’m trying to follow the HostGator suggestions to use the WP Super Cache plugin but every time I try to use it, with mod-rewrite enabled, I get a 403 error.
It has anything to do with the theme ?
Can you help me, please ?
Regards
Wow. 7 seconds is a lifetime ! It might be due to running a proxy? A lot of folks running nginx (we’re running Apache, and then nginx for SOME things not all) seem to run through a proxy, and that might cause the issue. Perhaps check amount of memory allocated to PHP ? I think mine is set to 512MB, with 256M being typically the best lower limit for WP these days. I think you already checked that.
If you can see a noticeable slowdown running that just from the server, two things you might try is a traceroute between the API IP and your DNS, and/or check with your hosting provider to explain the issue. It might be something they have run across before.
Or it could be some weirdo voodoo thing like why my stupid Font Awesome 4 CSS don’t load consistently off Amazon’s CDN, or from the free CDN that also hosts bootstrap. Gave up on that one 🙂
Hey Christopher! When I run the script (with api key) locall with wamp server, the response time is almost zero. When executing the code on my server (by putting a clean php code in the root and execute it by requesting the file), there’s a delay. Almost 7 seconds delay. Now, i know you are also running a plesk server, do you know if it could have to do something with my server settings? I already tested it by processing PHP by Apache instead of nginx but that doesn’t make a difference. I’m on PHP version 5.4.23, but maybe i’m missing some php extensions?
-
This reply was modified 12 years by
r1kay.
Well i’ve tested a clean php code (without image) that they provide for php in a single script with and without api key and it returns the correct count immediately. Then i’ve tested that clean code within functions.php (and added the created shortcode in the post template) and it delays. Then i’ve tested the clean php code by adding it directly to loop-single.php (without shortcode) and it also delays. So i think it doesnt have anything to do with the sharedcount api or response time, but with the page rendering. For example, category pages that dont contain this code are loaded instantly. Somehow the post pages rendering slows down.
All tests were done without caching to measure respone time.
My personal thinking is that if sharedcount is going out and grabbing the data for you, and then you’re grabbing data from them, it seems to be an obvious slowdown.
Since you’re using the (apparently) ‘free/unauthenticated API’ you not only have to contend with the 10,000 queries limit, but are also in the pool with all other free users, and obviously this is a slowdown someplace, perhaps it’s fetching the graphic before service code which would introduce delay for it to fetch that and serve back to you; dunno.
You might pay for one month trial on their upgraded “PLUS” plan to get the better connection?
I’d likely do a split test among services
1) theme built-in features
2) what you’re using now
3) AddThis Sharing (or ShareThis if you prefer)
Run speed tests with GTMetrix or something and measure the speed FROM THAT API compared to speed of other methods, and go with what is faster.
Marius/Radu may have better answer. 🙂
-
This reply was modified 12 years by
simchris.
Well i use the sharedcount api to count the total shares for me. It´s considered one of the fastest api to do this. Maybe i have configured the function wrong, i´ve tested it without caching and this peace of code make the website render at least 3 seconds later. Maybe you can have a look:
function getTotalShares($atts) {
extract(shortcode_atts(array(
'cache' => '600',
'url' => 0,
'f' => 0,
'bgcolor' => '#7bc6f1',
'bordercolor' => '#000',
'borderwidth' => '0',
'bordertype' => 'solid',
'fontcolor' => '#fff',
'fontsize' => '18',
'fontweight' => 'normal',
'padding' => '1',
'fontfamily' => 'Oswald'
), $atts));
$shareHash = "$cache.$url.$f.$bgcolor.$bordercolor.$borderwidth.$bordertype.$fontcolor.$fontsize.$fontweight.$padding.$fontfamily";
$totalShareRecord = 'totalshares_' . $shareHash;
$cachedposts = get_transient($totalShareRecord);
if ($cachedposts !== false) {
return $cachedposts;
} else {
if (!$url) $url = get_permalink($post->ID);
$json = wp_remote_retrieve_body( wp_remote_get("http://api.sharedcount.com/?url=" . rawurlencode($url) . "&apikey=0928d3131a18a15945e4c74fa1a68cef3c6f2ad8"));
$counts = json_decode($json, true);
$return = $counts['Twitter'] + $counts['Facebook']['total_count'] + $counts['GooglePlusOne'];
if ($f) $return = '<div id="totalshares"><img src="http://mhmag.nl/content/uploads/2014/04/viral-icon-retina-42-x-42.png" width="21" height="21" /><div id="sharecounter">' . $return . '</div><div id="gedeeld">x gedeeld</div></div>';
set_transient($totalShareRecord, $return, $cache);
return $return;
}
}
add_shortcode('totalshares','getTotalShares');
Also, the total share counts are shown right below the post title, so maybe that prevents the page from rendering? I’ve added the shortcode in loop-sigle.php right below the page title and above the category and date meta.
Without this function the website will load very quickley, even without cache, due to the nginx set up.
-
This reply was modified 12 years by
r1kay.
Anything that connects to multiple external systems and has to get a response will slow down the site; everything like recaptcha, jetpack, adsense, social plugins which “go out an get data and then bring it back to cache” and similar — all slow things down since it’s not happening “locally.” (As I’m sure you already know.) You would likely disable the theme’s function to “count” reads/shares from other sites, and try using something like AddThis which can also do this for you. Ironically, the reason the calls to the APIs in the functions.php is done to avoid having to use external plugins and for most of us makes site run faster than using external plugs. But every site is different, and part of the development process is picking/choosing how to add/adjust things on page for best user experience and performance.
Note also that WP-Postview was updated this week to address issues folks were having with Ajax and Cache, so might be worth revisiting that setup with new version.
Not sure if that helped at all, but my two cents.
Disabling all plugins isn’t an option. I need most of them to make my website work. I was just wondering if it is something theme related or wordpress related. Maybe the theme is set up to load all external js before rendering the page? And if not, how can i make the page render before those scripts are loaded? Also, the wp-postview and ajax vies count plugins slow down the rendering of the page! Are you guys planning on integrating these ajax views counters in the next update? I would be nice to so the theme functions working flawlessly with caching plugins. I mean, that is what you guys advertise with: the theme’s speed and functionality 🙂
Love to hear some opions from other people and would like to know if somebody else is experiencing the same problem with plugins or functions that make js calls to social media api! I can’t be the only one who uses plugins that show how many times a post is shared on social media.
hi,
docs about ajax_the_view : https://forum.tagdiv.com/wp-postviews-post-view-counter-alternative-for-w3-total-cache/
Thanks for you message.
Radu A.
hi,
we created wp-booster plugin to have a bigger google pagespeed result, what it duos, is moving the css and javascript files in the footer of the page.
the bad news about wp-booster plugin is that is known to make the theme not function properly, an issue we are still investigate. also is compatible with only a couple of plugins (wp supper cache, Seo by Yost, tagDiv social counter).
my advise is to disable all the plugins but WP Super Cache, tagDiv social counter, contact 7. it should work.
Thanks for you message.
Radu A.
Hi,
Since a couple of days in noticed that my website is very slow when not serving cached pages of when caching is disabled. I’ve narrowed the problem down to a plugin and a custom function in functions.php that make (js) calls to social media api’s to count the amount of social media shares for each post on the website. These two “plugins” result in a very slow website and a slow cached page generation. I’m running on a VPS (with enough resources, it’s little overpowered) with Plesk 11 which uses Nginx as a reverse proxy. Nginx handles all PHP, static files and is configured to work with WP Super Cache to serve compressed cached pages.
The problem I encounter with these two “plugins” is that the generation of dynamic cached pages take more than 20 seconds in some cases, which normally only took less than a second, a couple of seconds at worst. Also, the time to first byte can take up to 6 seconds, instead of the less than 1 second which is normal.
Without caching is disabled, the page will still load very slowly, as if the rendering only starts when those javascripts are handled. I know this isn’t exactly theme related, but i’ve read somewhere in another post that it’s possible to move the plugins javascripts and css to the footer by using the wp-booster plugin.
I now know what causes the problem, but i don’t exactly how. I’m desperate for a solution and hope someone can help me!
I’ve installed the ajax_the_view and wp-postviews plugins and it show the views on the post pages, but it doesn’t show the views on the homepage and category pages. I use block 2 and 3 on the homepage and module 6 and 7 on the category pages. Also, the views wont show on post pages on mobile.
Also, those plugins slowed down my website. Most visitors won’t noticed because of the cached pages created by WP Super Cache.
NOTE:
update to WP-Postview for those using with cache:
Version 1.67
•NEW: Allow user to not use AJAX to update the views even though WP_CACHE is true
Hello,
I’m using the plugin ‘AJAX Hits Counter + Popular Posts Widget’ to display one popular post on my homepage sidebar, as i’m using a cache plugin as well.
How can i apply the same styles to this code:
<span class="popularsidepost">
<a href="{permalink}" title="{post_title}">{thumbnail-320x240}{post_title}</a>
</span>
So it looks the same as the other posts (output) on the homepage?
Clear things up: I want the same font and size for the post title, rounded image for the widget also positioning of the text and image (so it doesn’t look any different for any other content on the homepage).
For the rounded image, i’m using the custom CSS (in the theme options):
.wpb_row.row-fluid div.thumb-wrap a img {
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
-o-border-radius: 10px;
border-radius: 10px;
}
Thanks 🙂
I’m using a host that has their own cache and CDN so I have no cache plugin installed and I’m getting 95/100 perf grade! Can’t complain. I’m sure there’s more I can do as the load time is around 3 seconds but for now I’m happy. I’d like to see this forum have a topic for members sites!
Hi Radu
I am using Pressable (Zippykid) who doesn’t allow us to use our own cache! They have their own set up. I will contact them about this though! I see you recommend Total Cache so would you think it may be more suitable to change hosts as I also use LightningBase? Thanks for your support by the way.
hi,
you (for your site) or your host has a cache plugin enabled : <h3>Memcached:</h3><h4> commands</h4>
find the plugin and disabled or remove it.
this is definitely not coming from the theme.
Thanks for you message.
Radu A.
HI, Marius
not huge issue as I can fix with CSS.
Just odd.
Note I’m not running any minify stuff, just tagDiv speed booster, along with mod_pagespeed to remove white spaces and remove comments – and cache small images. It’s not doing anything else.
I am using the social media icons top right, and NOT using the login function, which is different from your example, and have the responsive AdSense ads running.
I will upgrade to the latest WP this week and then revisit. 🙂
Usually I am *not* the person with the one in a million gremlin, but this one is mine.
Have a great day!
Can you please tell me where this is coming from and how to remove it. http://www.funeventsasia.com/build-a-bike/ There are almost 2000 lines of exactly the same lines of code as below:
<h3>Memcached:</h3><h4> commands</h4>
Array
(
[0] => <span style='color:green'>get</span> is_blog_installed
[1] => <span style='color:green'>get</span> is_blog_installed
[2] => <span style='color:green'>get</span> _mab_settings
[3] => <span style='color:green'>get</span> _mab_settings
[4] => <span style='color:green'>get</span> _mab_settings
[5] => <span style='color:green'>get</span> _mab_html_unique_id489
[6] => <span style='color:green'>get</span> _mab_settings
)
<big>Too many to show! Show them anyway.</big>
<h4>options commands</h4>
Array
(
[0] => <span style='color:green'>get</span> notoptions
[1] => <span style='color:green'>get</span> alloptions
[2] => <span style='color:green'>get</span> notoptions
[3] => <span style='color:green'>get</span> alloptions
[4] => <span style='color:green'>get</span> notoptions
[5] => <span style='color:green'>get</span> alloptions
[6] => <span style='color:green'>get</span> notoptions
[7] => <span style='color:green'>get</span> alloptions
[8] => <span style='color:green'>get</span> notoptions
[9] => <span style='color:green'>get</span> alloptions
[10] => <span style='color:green'>get</span> notoptions
[11] => <span style='color:green'>get</span> alloptions
[12] => <span style='color:green'>get</span> notoptions
[13] => <span style='color:green'>get</span> notoptions
[14] => <span style='color:green'>get</span> alloptions
[15] => <span style='color:green'>get</span> notoptions
[16] => <span style='color:green'>get</span> alloptions
[17] => <span style='color:green'>get</span> wp-optimize-enable-admin-menu
[18] => <span style='color:green'>get</span> notoptions
[19] => <span style='color:green'>get</span> alloptions
[20] => <span style='color:green'>get</span> notoptions
[21] => <span style='color:green'>get</span> notoptions
[22] => <span style='color:green'>get</span> alloptions
[23] => <span style='color:green'>get</span> notoptions
[24] => <span style='color:green'>get</span> alloptions
[25] => <span style='color:green'>get</span> notoptions
[26] => <span style='color:green'>get</span> alloptions
[27] => <span style='color:green'>get</span> notoptions
[28] => <span style='color:green'>get</span> alloptions
And it goes on and on!
Hi,
I just figured out what was causing the problem and thought to post an update here to let others know in case they may have the same problems.
I have W3 Total Cache plugin installed, it is best to use the default Minify settings otherwise they will interfere with the HTML which is not good 🙂
But I am still having issues with #6: The color of the date and the comment options are too light to read, need to make them darker?
thank you very much for your answer, I just enabled “Page Cache” and the truth is that I have good results results.
GTmetrix: http://prntscr.com/39fk62
Pingdom: http://prntscr.com/39flf9
PageSpeed Insights: http://prntscr.com/39flqp
What do you think?
I would stick with ONLY enabling Page Cache.
And now … my morning soapbox: brought to you by clean living and cute kittens ….
Remember that if you’re using the TagDiv Speed Booster plugin, it is MOVING things around on the page for better performance when the page is loaded. You do not want the dynamic stuff cached or it won’t show updates to things on pages. Your home page would not show new items, categories wouldn’t show new items, sidebars wouldn’t show new, recent, related, etc.
So, you only want to enable the page cache which will basically serve up a snapshot of the page and not the dynamic stuff which is still called via php.
Newspaper type sites are way more complex than say, a blog about raising rabbits on a farm, or a bicycling blog updated once a month. If you have content updated daily, or even hourly, caching can help with speed and limit load on server, but it can be TRICKY to optimize for YOUR particular website, due to how elements are loaded on pages, where they are, what other optimizations are running, etc.
There truly is no “one click” caching option for any busy, complex website. Blogs sure. Complex websites need to be tweaked for advanced tools like caching, just like all the other tweaks not built-in to WordPress, or the theme.
So, for most advanced users, there is trial and error – nothing to do with the theme, and not covered by support team for your particular use.
The theme devs have “recommended” you only use Page Cache, as that is how they achieve their own high speed rating/score.
So, you may wish to
1) fully optimize your site, outside of caching!
2) enable tagdiv speed booster and make sure nothing breaks if you’re using some kind of external plugin which might conflict with the optimizations (on our site the < > arrows disappear in 3.6, with WP 3.8.1; with 3.5 the slide out “you might like” broke) — you have to decide if this is a benefit for you or not; YOU need to test, decide, then either use or not for YOUR particular solution
3) make trusted backups of your site before doing any caching!!
4) enable W3C and use page cache only; test your site — either determine if it works for you or not, and some trade offs, and if there are workarounds for some things like page counters, random or recent dynamic elements, etc. — and there are forum posts on issues other have faced with using specific plugins, or with certain features in use (e.g., JetPack, forms, membership, bbpress, etc.)
5) adjust, test, adjust, test.
If you have no idea how to do any of that you likely would need to hire a developer at an hourly rate. Or, do what most of us do which is trial, error, forums, Google search, test, retest, learn, fail, learn.
The reason there is no simple “how to” for caching, is that there are a hundred things which might be impacted by that if you turn on every option in the theme and load up a dozen external plugins.
In a perfect world, for caching, the average joe might try this:
1) setup the theme with only the basic functions; no special menu, no JetPack, no “counters” for social media reads, one ad management system or AdSense.
2) enable tagDiv Speed Booster BETA plugin to optimize the placement of the CSS, JS components, Google fonts, et al.
3) put in the basic optimizations: a) gzip/deflate at server level, b) htaccess, c) image optimization tweaks (plugin, and/or functions.php mod from my speed posts)
4) W3C or other caching with minimal page caching settings.
5) test site.
6) turn on the “fun” features like megamenu, jetpack, forms, social reads/likes; choose what works; what doesn’t — either find workaround or don’t use.
There is ALWAYS a tradeoff between speed and features. You can’t have 100 add-ons and have the speed of a site with 15 add-ons. So, YOU need to decide if speed vs features matters, or other way around.
Hope that helps somebody!
Copr. © 2014 Christopher Simmons.
-
This reply was modified 12 years by
simchris.
Is there any updates about when this feature is coming? As i’d really like my popular widget to work with cache.
Thanks 🙂