I am trying to modify one of my WordPress plugins but I would like to keep the changes even if I update the plugin. The changes are very minor.
I tried copying the plugin file to my wp-themes/child-theme/plugin/plugin_name/file.php and made changes to it but it does not reflect to the frontend.
Related
My website islamabad.ginyaki.com.
The issue I am facing is that I have customized plugins Foodonlineforwoocomerce, Advanced custom fields. I have disabled plugin and WordPress updates Manually, in functions.php and in wp-config.php but the customized code gets reversed after a few days and starts working as the old or original plugin, I need to know why that's happening and how can i achieve the solution to this problem.
I have developed many scripts and have put inside the theme folder of wordpress. Today somehow the theme got updated automatically. Now all the scripts gone. Nothing was there. Whether wordpress will backup the old theme somewhere before it updating the theme automatically?
PS: I haven't installed any plugin to backup automatically!
Thanks for your replies
Wordpress will update and overwrite all the default (included) themes when it upgrades, so your changes will be overwritten.
To prevent this in future you should use a child theme, or manually upgrade by downloading the zip file from wordpress.org, unzipping it, and deleting the files that you don't want to be overwritten, then copying that across your existing installation. Creating a backup before you do this is also a good idea.
To prevent this I strongly recommend that next time you work around with a child theme instead of editing your main theme files. This will prevent your edited files to be overwritten when the theme updates itself. Also start using a plugin that backups your files.
Wordpress itself doesn't backup any files prior to updating Wordpress, themes or plugins. What got overwritten is now overwritten. You can contact your host support and ask them if they made any backups on your site (some hosts do that on a weekly basis so they can revert changes in case of an error - but this is on a host by host basis and not all do this).
Hope this will be a good lesson for you to think about this things beforehand and I hope you retrieve all your lost files.
I am working on a new project on WordPress.
I am developing a new website for a client based on their actual site (developed by an other team).
So, I decided to create a new WordPress theme and to use the existing content (client's request).
However, this supposes to reuse the custom plugins, in order to not re upload the pictures and the articles by hand.
I would like to include the custom plugins into the new theme. However, the plugins folder is outside the theme folder. So I was wondering if you have an idea on how I could transfer the code of a custom plugin into the new theme.
Thank you in advance.
What custom plugins are being used to handle pictures and articles? Uploaded files should go to /wp-content/uploads and all data is stored in the database. Removing the plugins might make the data inaccessible, but it shouldn't disappear.
Why are you moving functions from plugins to a theme? Or are these plugins inside of the /wp-content/themes/ folder? The way you handle the two cases is very different.
If you need to copy certain functions into a theme, you can move them into a functions.php file (or a functions.php file that calls to other files in that directory) in a child theme. The WordPress Codex has much better documentation on child themes than I could ever outline here. Placing the functions into your main theme is a permanent change and is not recommended when you're dealing with functions that are better-suited to plugins.
If you're copying plugins from one theme into another, you might want to look at plugin dependencies using TGM Plugin Activation.
I have buddypress 2.2.4 installed with wordpress 4.4.
Now issue I am facing is, I did some modification to buddypress plugin in plugin files it self. And its reverting back. Its changing my modified files to its original versions. even I try this in my local and same result.
I ask server guy but he told its buddypress issue.
When you modify a BP file, do you see changes in the browser? Or do the files revert to the original state instantly after closing them in a code editor? What are the file permission settings for the BP plugin files?
What files do you modify and with what changes?
Are you hitting update for the plugin? Plugin updates always overwrite local changes as new files are written over the old ones (unless you juggle with write-permissions for the files).
It is not a BuddyPress issue by itself (tried it myself and I could hack the plugin files just fine). It could be the server giving you the illusion of write-allowed files whilst keeping the files unchanged ("reverting"). Or then the plugins are updated constantly, undoing your changes.
The proper way to make modifications is to either use hooks in a plugin or a theme, or copy over the BuddyPress templates to your theme and make modifications there.
I didnt find any solution to that. but I keep my changes by adding a override files to child theme. because I tried everything and its not stopping reset plugin.
So finally making override of plugin in child theme solve this issue.
I didn't know about the best practice of not skinning/modifying/working off of the core wordpress theme (twenty-ten, twenty-eleven, twenty-twelve, twenty-thirteen), and a bunch of my clients sites are running right now on the core themes with a custom/modified skin.
I've heard stories of wordpress getting hacked and sites being compromised because wordpress is out of date. The wordpress team also pretty much states that security issues are being fixed with each update. I need to update the core wordpress files on these sites to prevent this, but now I'm scared that if I update wordpress, the theme will be overwritten.
In fact, I had a client click the update button once in the wordpress admin (not really knowing what they were doing) and overwrite the theme (that was pretty disasterous). I even use a plugin now to disable that message so my other clients don't do that.
What steps should I take now to fix this? Copy the theme, rename the folder/theme name in style.css, and change the theme in admin settings? Would I be OK to update wordpress after I do this? Or are there more steps that I need to take?
You have the right idea. Copy the theme folder and rename the new copy to something else like customtheme. Then edit customtheme's theme info in the comments at the top of style.css and switch to it in the admin panel. After that you are safe to update.
Do keep in mind that it's possible WP updates will break things anyway, depending on how you implement custom functionality and what plugins you are using.
Agree with the above. Don't go anywher near the WP core or the default themes. Either create child themes or better off, build your own.
Copying and renaming and existing theme will cause you all sorts of problems as each theme uses named functions. If you just rename the stylesheet there will be more conflicts than you can fix in a week of debugging.
If you are blocking the update messages you are putting your clients at risk.