Can not clear data as admin
-
Hi,
when I want to clear all data from the plugin (to start the statistics fresh) I am told I need administrator right. But I have that role. Any ideas?Thanks
Joerg
-
Hi @jeykeysyn,
I just tested the Clear All Data button on a fresh WordPress install (and on a Multisite one too) and it worked normally for me. Are you sure your user account has the manage_options capability assigned to it?
Hi Hector,
thanks for the quick reply. All I can do is assign the “Administrator” role to my account. I do not know how to edit role capabilities or that that was even necessary for the “administrator”.
If you’re not using a role-customizer-kind-of-plugin but the regular user management screen to manage your user accounts then your admin account should have that capability already.
To rule out that it’s not a problem with your user account, please create a new administrator account (Users > Add New) and give it another try. If you still can’t clear WPP’s data with the new admin account, please share the exact error message you’re seeing so I can have a look.
Also:
- WordPress version?
- Plugin version?
- Active plugins?
Hi Hector,
I already did create a new admin account and it still does not work.
I am using WordPress 5.3.2
Plugin Version Version 5.0.1Other plugins:
Disable Emojis (GDPR friendly)
Version 1.7.2 | Von Ryan HellyerEnvato Market
WordPress Theme & Plugin management for the Envato Market.
Version 2.0.3 | Von EnvatoLets Blog Theme Gallery
Plugin that will create gallery post for Lets Blog theme.
Version 1.5 | Von ThemeGoodsRemove Google Fonts References
Remove Open Sans and other google fonts references from all pages.
Version 2.6 | Von Bruno XuI am using the Button in the Tools section called “Alle Daten löschen” (in English probably “Clear all data”) The error message says:
“Du hast nicht die erforderlichen Rechte um das zu tun. Bitte wende dich an den Administrator für weitere Hilfe.” (in English probably “You do not have the necessary rights to do this. Please contact the administrator for further assistance.”).Thanks for looking into this.
Best,
JoergHow odd. Do you have a staging/dev version of your website by any chance? There are some things I’d like you to try which involve messing around with code (not that it’ll break anything but better safe than sorry.)
sorry, no. I can give you access to an FTP where a db dump and the wp files are if you like. But we need to do that via e-mail. Shall I send it to [email protected] ?
Yeah, about that, moderators can get a bit cranky (for good reasons though) when people request/offer access credentials here in the forums (see Forum Guidelines – The Bad Stuff).
Try this:
- Assuming you haven’t done so already, please enable the debug log.
- Go to Plugins > Plugin Editor, then pick the WordPress Popular Posts plugin using the dropdown to your right to edit it.
- Click on
src/Admin/Admin.phpto open the file. - In the
clear_data()function (around line 1058) add the following right before theifcondition:$debug = array( 'can_manage_options' => current_user_can('manage_options'), 'token' => $token, 'clear' => $clear, 'key' => $key ); error_log(print_r($debug, true));It should look something like this:
$token = $_POST['token']; $clear = isset($_POST['clear']) ? $_POST['clear'] : null; $key = get_option("wpp_rand"); $debug = array( 'can_manage_options' => current_user_can('manage_options'), 'token' => $token, 'clear' => $clear, 'key' => $key ); error_log(print_r($debug, true)); - Click on the Update File button to save changes.
- Go to Settings > WordPress Popular Posts > Tools and click on the Clear All Data button.
- Share the contents of your
/wp-content/debug.logfile (use pastebin.com for this, please).
Alternatively, if you don’t want to deal with code -although this is just a workaround and won’t fix the problem- you could also just log in into phpMyAdmin (or whichever tool your hosting provider offers to manage databases) then empty (truncate) both the _popularpostsdata and _popularpostssummary tables.
Thanks, Hektor. I did the truncate thing.
Thank you for the good and quick support.I wish you a happy new year
Jörg
The topic ‘Can not clear data as admin’ is closed to new replies.