Lost access to wp-admin and some of user meta-data - wordpress

We are running into the same problem for the third time already. Suddenly all the users, including admins, lose their access to wp-admin, plus some custom user fields get erased.
When I look into the database, it looks like user roles are not changed (admin is still admin). So why I can't access the backend is not clear.
Every time we recover from the backup, but it becomes a regular problem.
I can't figure out if it's a WordPress, a plugin, a hosting issue or we get hacked every time it happens. The problem is that the logs on the hosting stopped being recorded on the 4th of October (we'll be changing hosting as it's the second time I see the logs not recorded).
For the guest users the site is working fine.
My question is: where to look for the source of the problem?
Thank you in advance.

Regularly update your wordpress and plugins. I read somewhere wordpress contaminates sites if not updated regularly. So whenever you see an update for a plugin or core files do not forget to hit that.

A friend asked me to help him with a similar problem ... somehow a part of the usermeta table was lost yesterday and today. This is a list of the plugins that he's using ... maybe there's a match somewhere:
Akismet anti-spam
Autoptimize
Cherry Data Importer
Cherry Data Importer
Cherry PopUps
Cherry Search
Cherry Sidebars
Cherry Socialize
Cookie Notice
Duplicate Page
Editor clasic
Contact Form 7
Google Analytics for WordPress by MonsterInsights
Mashshare Share Buttons
Mobile Menu
Post Types Order
Post Views Counter
Q2W3 Post Order
SSL Insecure Content Fixer
WordPress Social Login
Yoast SEO
Thankfully we have a backup and were able to restore the usermeta data, but since it happened twice by now, the problem persists :(
WP and all plugins are updated.

Related

Can't access the Wordpress dashboard when logged in

I migrated the company's website on a new hosting server. Since then, I cannot access my Wordpress dashboard when I'm logged in.
When connected, I see my website and the classic Wordpress top bar. But when I click on the button with the name of my website (usually that sends me to the dashboard) it just sends me back to the home page.
I add that the top bar isn't really like the classic top bar since it doesn't contain any option.
Here's a screenshot.
The top of my website when logged with the top bar of the admin wordpress
Clicking "Bonjour Signature_Beta" doesn't do anything. I can only log out.
Going to the /wp-admin page gives me an error saying "Sorry, you do not have authorization to reach this page". Except, I'm supposed to have authorization since my profile has a wp_content value of a:1:{s:13:"administrator";b:1;} and wp_user_level of 10.
I have tried multiple things I found online that didn't come to fruition sadly :
Renaming plugin's folder (nothing changes except page breaking because they're made with Elementor)
Renaming theme's and child theme's folder (page goes blank, top bar still there though)
Replaced .htaccess file (nothing)
Checking my account didn't lose admin privilege through phpmyadmin (it didn't, it's at level 10 + it has the weird administrator code
Added a new admin account through function.php (can log in with it, still can't access dashboard)
Increased memory limit
Repair database tables
Kind of desperate and frustrated about it.
Thank you in advance for the help :)
Ok with a fresh pair of eyes, I found out what was the problem. Tables prefix! I followed what was described here : After moving Wordpress, login works, but no admin access anymore
For the record, I never found it when googling or searching my answer here before posting. When posting my question I review the post stackoverflow suggested and it wasn't there either. But now it's suggested next to my post, so... great!

Wordpress website stops working for a particular IP after updating a page

Weirdest problem ever. I use wordpress (last version) for my website and I use WP-bakery page builder. It has worked without problems for years. All my plugins are updated to the latest version, except WP bakery page builder because i'm not paying for it.
Today, i decided to update the website, and I go to the contact page of my website and change 1 word in the page and click "update". The website ends up showing a "timeout" and the website stopped working.
"This site can’t be reached. Try:
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_TIMED_OUT"
In opera the error is DNS_PROBE_FINISHED_NXDOMAIN
Then I tried with a VPN and the website works, so I try to update the page again and "timeout" again and the website is down
Then I changed the VPN ip again and my website is working on that new IP. I try to change a blog post, no problem, I add new pages with the testimonial plugin and no problem, then, thinking that everything is ok, i go to the contact page again and i change 1 word and boom... time out and the website is dead for that IP
Now I run out of VPNs to test and I can't access my website anymore, but this problem is very strange.
I tried https://www.isitdownrightnow.com/ and that website says that my site is up, but i can't access it anymore due to this change that produced the same awful result 3 or 4 times.
Who knows about this mysterious issue and a potential solution?
The following is the list of plugins i use:
Akismet
Contact Form 7
Cookie Notice
Google Analytics for WordPress by MonsterInsights:
Hello Dolly
Hide Featured Image:
Jivo Chat
Maintenance and WP Maintenance mode:
PageBuilder by Site Origin and WPBakery page builder:
Read More without refresh and WP Show More:
ShortPixel image optimizer:
Show Hide Author:
Simple Custom CSS:
Slider Revolution:
ThemesFlat by Themesflat.com:
WP Downgrade | Specific core version:
I don't know why it happened, but I discovered that a rule of modsecurity blocked my IP whenever I attempted to update my page... Seems to be a security thing with wordpress to avoid attacks... This shows up in the server log.
To solve it I removed the rule for my website... which may cause some security issues, but who cares about security.
But I don't know where this blocking comes from...

How to link 2 wordpress websites

Is there any way or pluggin to link 2 wordpress websites together which means when i publish a post in the first site, the second one publish the same post automatically.
notice that 2 sites on the same host.
thanks in advance.
I have looked into this few months ago for a project which one of the requirements was to automatically duplicate posts between Wordpress sites, short answer is yes, but out of the box you can't.
Long answer:
Yes, you can have three different scenarios:
You can clone posts manually through different blogs sitting in a multi-site installation using the Multisite Post Duplicator plugin, this however requires you to move both websites within a single installation of wordpress and make them run into multi-site mode. Also, you will need to manually duplicate them.
You can install on the second website a WPAuto plugin (there are few options out there, so I am not going to link every single one) which allows you to import automatically some RSS feeds into your second website. However RSS feeds must be enabled on the first website to make these plugin fetch correctly the content, on top of that the content won't be created instantly but it will be fetched after a certain amount of time, (5/10 mins interval, maybe more, according to the plugin and host settings)
You can develop something custom, you can open up a REST endpoint on the second website and through the Wordpress APIs create programmatically a new post for each request received. On the First website you need to hook your Publish post function to send the data across to the second website to process it. As far as I am aware there are no plugins which does that so you'll have to do something on your own, requires a bit of time and you need to keep in considerations all the security implications in doing that.
Needless to say that I strongly hope you have access to both websites and the content you are trying to clone is yours or you have been authorized to republish it from the original author.

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.

Link phpbb usernames to drupal profiles

I'm using drupal and phpbb with a bridge called phpbbforum. It works quite well, the user information is synched between the drupal and phpbb databases. The forum is embeded in a drupal page, so all variables that come with page.tpl.php should be avaliable.
I want drupal to be the only profile handler, so when someone clicks on a phpbb username, that person get's linked to the drupal profile. In phpbbs template files, the link to the profile is called by function get_username_string. I think the right place to edit it is in the /includes/functions_content.php file on line 1178. Right above that line it says "* Get username details for placing into templates." and there's a section about profile links.
I just can't figure out how to edit it so that the profile links lead to drupal profiles. Can anyone figure this one out?
I managed to achieve this just a few days ago! I must say, it did take a good 30 minutes for me to figure the files that needed to be edited, but after that, it was a breeze!
Basically, you have to edit the phpBB3 PHP Includes files, so that they point to the Drupal user profile, instead of the phpBB one. This can be achieved very easily. Firstly, install the Pathauto Drupal module. Make an auto alias for all user profiles, so that they go to yoursite.com/users/[username]. Then basically, in the phpBB PHP Includes files, make the user profiles direct to: yoursite.com/users/{USERNAME}.
In phpBB, {USERNAME} means the user's username. So when you add yoursite.com/users/{USERNAME}, it will direct to the Drupal profiles that you created with Pathauto. For example, my Drupal profile pages are mysite.com/users/admin, and phpBB will use the {USERNAME} tag to print the user's username. So in phpBB, if you change the profile URLs, they'll go to the same place.
It's pretty easy, but will require a bit of PHP knowledge. Mine is working seamlessly now, and only took about 5 minutes after I'd searched through the phpBB files. What you must remember is - These modifications would be made to phpBB itself, and not Drupal, seeing as you want phpBB profiles to go to Drupal ones. If you need any help, let me know, I'll try to help you out. :)

Resources