How to make changes are not visible in userside using wordpress - wordpress

I want to edit contents of the existing page in wordpress.It is a live site so user side should not be changed
untill i want to publish that after all changes made to that page.Is there any plugin or what
i have to do for this.
Anyone please help me.

It depends what sort of changes. As noted above if you're channing post contents if will be enough not to publish them, but I guess you already now that.
However if you want to change appearance of the site then caching plugin might help. E.g. with w3 total cache you can do any change to template/css/php and so on and only logged in users will see changes (any non logged in user will get cached version of the page until you clean cache or cache expires).
If you have also users which are logging in into your wordpress, then I'm not aware of already made plugin that have such functionality - you probably would have to create development version of your site and test changes there.

For content - agree with previous answers.
But if you are changing the theme and want some changes to be visible only for you (admin) then you can use is_admin() function to print out different content for admin (new one) and different for other users (old one).
http://codex.wordpress.org/Function_Reference/is_admin

Related

How to Prevent Cart from clearing on registration in Woocommerce?

If a user adds a product to card, then goes to account page and registers a new account, the product(s) in the cart are automatically removed. How to prevent this behavior?
Try following these debugging steps:
https://businessbloomer.com/woocommerce-solving-cart-empty-issue/
Fix 1. Make sure there is no “red alert” under WooCommerce / System Status
Fix 2. Click the following buttons under WooCommerce / System Status / Tools
Fix 3. Check your Theme, WooCommerce & WordPress are using updated, compatible versions
Some premium themes won’t notify you if there is an update available. You have to make sure you’re using the latest, Woo-compatible version. Check with your theme vendor, plugin developers and see if anything has been reported.
For example, you might have updated WooCommerce too soon – sometimes premium plugins/themes require a few days/weeks before they can adapt to the new changes (if major) and become 100% compatible.
Fix 4. Save (flush) your permalinks
Go to WordPress/Settings/Permalinks and click on “save”. This should flush the permalinks and give you a chance to test the cart again.
Fix 5. Check you have no spaces in your checkout end-points
Go to WooCommerce/Settings/Checkout and make sure you have no spaces in your end-points. This happened to a client a while ago and it too me ages to find out (who would think the permalinks had been changed?):
WooCommerce Checkout Endpoints
Fix 6. Properly set up your WordPress cache plugin
Cart and Checkout pages should not be cached – if your WordPress cache plugin is for some reason caching WooCommerce pages, your cart will probably show as empty. Make sure to select a WooCommerce-compatible cache plugin 🙂
Also: ask your hosting to disable or properly set up server cache
Some hosts have their own cache system and this is sometimes applied to your website by default. Create a ticket or give them a quick call to find out if they have anything like that and if they can disable that as soon as possible.
For example: WPEngine uses its own cache. This might affect your WooCommerce Cart. Please contact support so they can create a caching exception list for WooCommerce and/or ajax files
Fix 7. Disable all plugins but WooCommerce
This is a typical troubleshooting operation. Disable all plugins and see if the Cart is back functioning. If YES, reactivate one plugin at a time and test the Cart again. As soon as you find the “guilty” plugin – yay! – time to substitute that plugin or see if there is an update available!
Fix 8. Try switching to a default WordPress Theme (e.g. TwentySixteen)
This is to prove the error is not theme-related. You won’t lose any content if you switch between themes, so don’t worry. If the error goes away, then check with your theme developers and report the bug 🙂

WP toolbar only showing on frontend for some admins

We have several admins who all have the "Show toolbar when viewing site" option checked in their user profile but only some of them are actually able to see the toolbar. Others have the option checked but the toolbar doesn't show up. Additionally, we have a multisite setup and they are able to see the toolbar on one of the sites but not the other site.
After a bit of research, I've checked that is included in our footer.php file and I tried deactivating a plugin called "Members" that wasn't activated on the site where they can see the toolbar, however, nothing seemed to change. While I thought it could be another plugin issue, what doesn't make sense is that it's not an issue for all admins, just a few.
Is there anything else that I should be checking?
Sometimes instead of checking if a user "is_admin()" plugins or functions will check which permissions users have to determine what features they can or cannot see. I might check to see if the users in question have different permissions despite being admins. Perhaps create some new admin users to test if it is an issue with user IDs after a certain number.
Consider turning on debugging to see if any errors prevent the bar from displaying. Also try the query monitor plugin. Check for errors and query issues with and without the suspected conflicting plugin activated.

Dynamic Content not working with WP Super Cache

wonder if someone can help. I am trying to add a cart widget to the header of a woocommerce enabled site. However, when WP Super Cache is enabled, the widget doesn't update when something is added to the cart, understandably.
I am trying to add the following so the widget isn't cached:
<!--dynamic-cached-content-->
<?php echo time(); ?>
<!-- my_dynamic_content(); -->
<!--/dynamic-cached-content-->
I have just displayed the time in this case to see if I can get it working.
I have set the caching to PHP cache, with late init and dynamic caching enabled but the time still doesn't update when I'm logged out of the administrator.
I have trailed through documentation to see if there is another way to get this working but so far I have not found a way.
Can anyone point me in the right direction? Maybe I've got this completely wrong!
I just want one widget to be dynamic in the header.
Thank you in advance.
There are multiple types of cache for web applications, and WordPress has ways to take advantage of all of them.
Plugins like WP Super Cache, W3 Total Cache, and Batcache as well as server components like Varnish and Nginx implement page caching. These tools store a copy of the complete page and use that cached copy every time the same URL is requested. This is the fastest cache available, but the down side is they return the same HTML to everyone.
If you want to use a page cache but still have dynamic elements like your header widget, you'll have to render them in JavaScript.
If you've written your own theme, you can implement fragment caching by storing the rendered HTML of different sections of the page except the part you want to be dynamic. There's no plugin you can download that'll do it for you. You'll need to make your own judgement calls about what needs to be cached and for how long.
Lastly, you can just cache the data used to render pages. Look for information on WordPress persistent object caching or write code to use WordPress's Transients API. A persistent object cache plugin can automatically store the results of WordPress's queries to something like Memcached or Redis if you have that available.

Remove element from Wordpress plugin

I am currently using a social media login plugin for my website that allows users to login via their social media account.
Currently the flow of the plugin works in a way such that after ANY user authenticate themselves through Facebook, they will be brought back to my site with 2 options, link their Facebook account with their site's account, or to register an account.
How can I edit my code such that I am able to remove the "registration account" part without editing the plugin code directly as this might affect future updates of the plugin itself. One way that I know will definitely work is to comment that section away in the plugins itself but I do not wish to touch the plugin code.
After researching, a possible way that I think might work is to apply a filter that removes the element but I am not sure if that is the correct workaround for this situation.
Can anyone shed some light on this matter?
Thank you!
I don't see a way to filter executed php code on your Wordpress website.
I got two ways of dealing with this:
1: Disallow people to register an account on your site. The registration link will probably not be displayed anymore.
2: Or comment out the code within the plugin. Remember where you edited the lines. Whenever the plugin gets an update, comment out those lines again. Or contact the owner of the plugin to issue a feature request.

How to delete all plugin references in database?

How does one completely remove a plugin from WordPress?
I have deleted the plugin via WordPress admin and then reinstalled, problem persists.
I see 8 records in cmsoptions table referencing the offending plugin. Since WP Admin drags to a grinding crawl with the plugin active, and for weeks the plugin was working just fine, I have to conclude that the problem exists due to the plugin references in the DB.
If anyone has the inside word on completely obliterating a plugin from WP, please do share.
The the options API (http://codex.wordpress.org/Options_API) is open to the plugin to store whatever data it wishes (under whatever name it wishes). You'd have to search the plugin code to see what it is storing (and how) in order to get rid of the offending data.
The issue isn't with WordPress, it's with the plugin. WordPress is a framework and can't take responsibility for whatever gets built on top of it (ie plugins). It's like blaming a hammer for a poorly built house.

Resources