How to know what plugins were installed in WordPress - wordpress

I am working in a WordPress project that for some reason the plugins disappeared, the data still exits but neither the project owner or me know what plugins were installed. For example I knew contact form 7 was installed because it showed me [contact-form-7 id="424"] in the page, I installed it and I can see the plugin now
there are other plugins for user authentication, permissions, etc. But how could I know which were installed?
there are no plugins in the plugins page so I need to check in the db or anywhere else.

First of all, I would try and determine why all the plugins aren't showing up (perhaps the /wp-content/plugins/ folder got renamed? It's a common way to quickly disable all plugins for diagnostics)
Beyond that, if you go to your wp_options table, there is a an option called active_plugins that contains a serialized array of the active plugin files that looks like:
a:13:{i:0;s:29:"gravityforms/gravityforms.php";i:1;s:19:"akismet/akismet.php"; … }
It sounds like your database is fine, consider page content is unaffected, so this should suffice in getting you a list of active plugins, provided they haven't been registered as inactive due to the plugin files not being found - if so you'll probably want to dig through a database backup from when it was working (and if you have a "Full Backup" you may even be able to restore the plugin files from there)
Note: Serialized arrays can be a pain to read, you can either dump the unserialized value in your own script, or use an online tool like this or this to get a more readable format.

Related

WordPress will not delete plugins or install any new themes or plugins

I have installed WordPress and the Admin console is working. However any plugin I try to delete will stay no matter what as well as the themes. Any time I try to install a theme I get "Update Failed". If I delete the plugins from within my File Manager in cPanel, my plugins still remain in the admin console of WordPress. My permissions are set to 7-5-5 in general for WordPress. I have tried installing WordPress in a different directory and that does not work as well. I am installing this with Softaculous located in my cPanel.
Sounds like you might have some serious server-side/database related issues going on. Generally speaking, if you are in cPanel, or have FTP access you can go ahead and delete the plugins you want to from the /wp-content/plugins folder. Upon doing so this will 100% remove all the dependencies from the respective plugin(s) you're looking to remove.
If you go back into the WP plugin dashboard a fatal error will be thrown by those plugins since they no longer have the core files needed to run, and will automatically de-activate.
Another thing you can do is look inside the database, a simple SQL query will pull up your current active plugins, which you can then manipulate and remove from the database with another SQL query, or by using PHPMYADMIN or whatever other database management utility to have w/ your cPanel dashboard.
Example of the query:
SELECT * FROM wp_options WHERE option_name = 'active_plugins'
There's numerous resources out there which will help you 'hack' your way into the database and extract/remove the information you no longer need for your WP environment. Here's an example of one that does so via SQL queries:
https://perishablepress.com/activate-wordpress-plugin-database/

My wordpress site is brocken. dont know what todo. Tried safe mode plugin but nothing happen

My wordpress site was working fine , but wordpress update it to V 5.4 and after that my website is not working , not even i can access my admin dashboard.
I tried all these step to solve this
MANUAL INSTLLATION (RECOMMENDED)
Download the WP Safe Mode plugin and unzip it, you’ll now have a
wp-safe-mode folder.
Connect to your server (for example via FTP) and go to your website
folder.
Add this line to your wp-config.php file:
if( !defined('WPMU_PLUGIN_DIR') ) define( 'WPMU_PLUGIN_DIR',
dirname(__FILE__).'/wp-content/wp-safe-mode' ); //WP Safe Mode
Create the folder named wp-safe-mode inside your wp-contents folder.
Uploade the file wp-safe-mode/bootstrap/wp-safe-mode-loader.php into
the newly created wp-safe-mode folder.
Upload the entire wp-safe-mode folder to your plugins folder in
wp-content/plugins.
If your site is broken and you cannot install plugins or access the dashboard, you can modify the loader file temporarily to gain access by following these additional steps:
Open the plugin file wp-safe-mode-loader.php and change this line:
public $safe_mode_on = false;
to
public $safe_mode_on = true;
Upload the modified wp-safe-mode-loader.php file to the
wp-contents/plugins/wp-safe-mode folder.
Visit your site, deactivate plugins etc.
Undo the changes you just made to wp-safe-mode-loader.php when you
want to disable safe mode.
But nothing works for me. Can you please suggest something so i can fix my problem
Theme Conflict Troubleshoot:
To perform this, you just activate a default theme, like Twenty Nineteen. Unfortunately, because your site is showing an error, you will need to perform the troubleshoot with either your web host’s file manager (like cPanel’s Filemanager), or use FTP or sFTP (it’s like secure version of FTP.) It’s important to note that in switching themes, you won’t lose your chosen theme’s settings. To do this, you rename your active theme’s folder by adding DISABLE or OFF to the end of the folder’s name. For example, if you’re using Twenty Eighteen and the folder is ‘twentyeighteen’, you would name it ‘twentyeighteenDISABLE’ or ‘twentyeighteenOLD’ . Go back to the front of your site and refresh.
The objective is to check whether the mistake leaves. In the event that it doesn’t, it is anything but a subject issue. Try to rename the organizer back to its unique name when you’re finished investigating.
Plugin Conflict Troubleshoot
If it’s not the theme, it might be a plugin issue. In a way, troubleshooting is similar. However, it’s much easier to rename the plugin folder to ‘pluginsOFF’. Visit the site, and log-in. This will turn off all of the plugins. Please note that it won’t remove the original settings of those plugins, as they will be there when you reactivate them later on.
Once the plugins are off, go back and rename the folder back to ‘plugins’. Go to your WordPress admin area and reactivate each, one-by-one, until you get the screen that says “There has been a critical error on your website”. The plugin that you just reactivated, is the problem.
You can either disable the plugin that caused the problem or remove it or roll it back to the previous version using the rollback plugin and wait until the developer releases a new version of the plugin.

Migrating client wp site for local development

I've been asked to help out with a former colleague of mine's Wordpress Site. Nothing crazy, just change the format of a page, and add some kind of form on another page. I'm not so concerned with these changes I need to make, but am more concerned with setting up an identical site locally so that I can exercise these changes, do whatever I need to do, then simply upload my changes.
Quick background of myself; web developer of about 5 years with strengths in the Javascript frameworks and Node sphere. I know what Wordpress is and can navigate through the project with relative ease. Where I fall short is uncertainty in the project set up side of things.
So I have both the project itself and an export of my clients database, and configuration is updated accordingly. When I attempt to run the site I'm constantly prompted with errors, most of which have me take a look at the code and see what exactly the problem is. At this point I've made quite a few adjustments to the site to try and make it work that I feel continuing development won't get me anywhere.
Is duplicating an existing site to a local env usually this difficult? Could bad implementation of the initial site by the previous developer be a reason why I'm now struggling? Am I missing a step?
Duplicating a WordPress website is not that difficult. If you have the wp admin login of your website then you can simply use duplicator or akeeba backup plugin, but no worries, if you do not have the wp login access and just have the wp files & db then try this: create a new db from phpmyadmin, place your files in wp theme directory, install your new wp by using your new db file created, after that import your db file and do the following changes in your wp config file found in your root directory.
You will need to type in the new database information: database name, database user, and the password.
Once you have updated those, click Save Changes
Fixing your Permalinks
Log into your WordPress Dashboard, using the username and password from the copy of WordPress you brought over
Under Settings, click Permalinks
You don't have to make any actual changes, just click the Save Changes button.
Doing this will update all the page and post URLs. If you have custom themes or plugins/widgets with old URLs, you will have to update those manually since there are not any plugins that are able to modify those as well.
For ref:
https://my.bluehost.com/cgi/help/2361
https://www.tipsandtricks-hq.com/how-to-easily-import-or-export-any-of-your-wordpress-database-content-using-phpmyadmin-3415

Adding plugins that required database changes to version control on Wordpress

I'd like to add a installation of a Wordpress site to version control. After researching a little bit, I found some files/folders that should be ignore, like sitemap.xml and cache folders.
Every single one of them say I shouldn't ignore wp-content/plugins/, which is a reasonable advice at first. The question is: How should I deal with plugins that alter the database?
I can see two scenarios:
If the plugin has to add some tables on installation, this trigger would be lost since it would already be "installed" after uploading the files to the server.
If I must access the installation screen on production, then there's no reason to version control these files.
I would suggest to take a look at this great presentation. It's the most complete I saw yet.
http://stevegrunwell.github.io/wordpress-git
You should have your plugins directory in there too since you do want to track plugin files. As for the database, that's another subject completely. Take a look at the development of VersionPress, it should be out at the end of the year.

Meta Description Shows Spam

I have website (thebyandby.com) that got hacked several weeks ago. The problem is, the description on Google is showing a spam description for viagra and one the most popular posts (when linked to from Google) goes to a spam website.
The site is a WordPress website so I reinstalled the theme and made sure everything was updated. There are only two plugins installed, Akismet and Google Analytics. I don't think the plugins could be effected but I am not sure. The problem was still there so I checked when Google last indexed my site and it was after I had reinstalled my theme. I checked for malware from Google Webmaster and it said it didn't find any malware. I ran grep -r "viagra" on my entire web directory and nothing was found. I really don't know what else to do. Could this be a database problem?
Yes, it could well be that you have content in the database which is compromised. After all, that's where all the pages and posts are stored. Does your hosting company provide a tool like phpMyAdmin for browsing and editing the database?
But equally, if you have only reinstalled the theme then there are a lot more core WordPress files that could have been compromised by the hacker. Given that you are having problems, it would be well worth doing a complete reinstall of the WordPress files. Just make sure you keep a copy of your wp-config file, as you will need to copy that back. Also make sure you reinstall the same version of WordPress that you currently have.
But you know what: It may save you time in the long-run to just export all your posts and pages from within WordPress and then wipe the hacked site completely and install the whole thing from scratch. You can open the export file in any decent editor and once you've got your head around the XML structure, you can delete any rubbish that the hacker put there. I guess this option depends on how much content you had already put up on the site and how readily you could reconfigure the new site to match the old one.
Of-course if you have a full files and database backup from before the hacker got there, then you have an easy option that avoids all this grief ;-)

Resources