I am developing my own plugin.
Under my plugin's directory I have a file called migrate.php. I would like to be able to navigate to this page, without having it be in the left menu.
When I go to
admin.php?page=myplugin/migrate.php
// ERROR: You do not have sufficient permissions to access this page.
How can I grant permission to the administrator to view this page ?
My guess is that the page view is failing because the slug you are using isn't defined as a slug (ie by being added as a menu or submenu).
You could work around this by calling the PHP file directly, but then you'd need to include the WordPress loader to load the WordPress environment.
Hope this gets you a little closer ...
Related
I tried to install reCAPTCHA v3 on my wordpress website, now I’m unable to login to the Wordpress editor to edit the site. Every time I try to log in, it displays an error: Invalid site key.
I tried to remove the domain and the site and secret keys from the reCAPTCHA admin page but the login problem is still there.
I believe I put some code in wordpress... but not sure what and where, maybe it was [recaptcha] in the Contact Form 7 5.1 but I'm not sure (I'm not a developer).
Log into your Cpanel or FTP.
Look for the directory /public_html/wp-content/plugins and rename the reCAPTCHA plugin folder.
For example rename "uber-norecaptcha" to "uber-norecaptcha123". Refresh your WP-admin url. Now you can log in. Don't forget to rename the reCaptcha to it original, then you can deactivate it when you're logged in.
You could try to disable the plugin that added the reCAPTCHA (in this case, Contact Form 7), so you can login again. Then, you can re-enable it and set your site and secret keys properly.
Since you are unable to login, you can't disable the plugin from the WordPress dashboard. Instead you can temporarily move the plugin folder to another location. Navigate to the folder of your WordPress installation → wp-content → plugins and move the contact-form-7 folder.
Just experienced a similar problem, and it persisted for 3 months.
But, finally, I found the solution and resolved it.
In my case, I went to public_html/wp-content/plugins/wpforo/wpforo.php (I don't know exactly if you have forum installed or not, but forum was causing my login page to inherit login recaptcha without any valid keys).
public function init_hook(){
//reCAPTCHA on wp-login.php page
//$this->api->init_wp_recaptcha();
}
This function was calling a recaptcha with invalid keys. All I did was comment out:
$this->api->init_wp_recaptcha()
Another solution to the problem is :
Visit your login page, right click and enter the Inspect section. Search for anything that uses wp-login.php in "script" tags. You'll find the plugin that is causing the problem. Search for multiple results and deduce a conclusion. That's what I did.
I'm using drupal commerce and I added a new product (and product display).
I can see it in the listing, but when a user click on the product page, it's saying : permission denied.
All the other products works fine, it's only the last one which doesn't.
I tried to rebuild the permissions but that doesn't changed anything. How can I check what is "denying" the page ?
The Access denied backtrace module should help you
I found that for drupal 7, the devel module as a submodule called developper node access which shows exactly what I want. For this you need first to enable it and the active the access by user block. This block shows for every users if the current node is accessible and if not why (i.e. which module is denying it).
If your using Apache you might as well look at your .htaccess configurations. I faced a similar issue in the past and by using appropriate permission in the .htaccess file everything fell in place.
Refer http://www.digitalocean.com/community/tutorials/how-to-use-the-htaccess-file to learn more about configuring .htaccess file
Sorry if this question is too basic (It would be great if someone could recommend me on a good resource/tutorial for starting up with wordpress development)
I am new to wordpress development. And I work on a Mac.
I downloaded MAMP, installed wordpress, and installed a custom theme which I bought online.
So far, I've been using the wordpress wp-admin interface to customize the theme.
I created a new Page called "myPage". I'm interested in making some design changes to myPage but the wp-admin tool is limited and I realized I have to start looking/modifying the code.
I'm using Netbeans, and created a new project of my local wordpress folder which contains the wp-admin, wp-content, wp-include folders.
However, I am not sure where in the code to find the page I created "myPage", in order to modify it.
I ran a search on all the code but I don't find any mention of it.
I guess my custom page is saved elsewhere? in the database?
Thanks!
Drill down through wp-content > themes > to your theme's folder. Inside there you will find a file called page.php. That is your default page template. To double check this is the page being used, in your wordpress backend, edit the page and on the right hand side in the 'page attributes' panel, you will see a dropdown under 'Template'. You're purchased theme may have many templates, so that is how you can tell which one is being used.
Note: Creating a page inside of the wordpress backend does not actually create a new page file for that page.
Hope this helps.
Yea, you can find your page in DB, check out link for more info.
To access your database, you need to go to url http://localhost/phpMyAdmin/ if everything is set right; or your local IP/phpMyAdmin/ if host alias is not set.
EDITED
If you are looking for file, you should look in wpfolder/wp-content/themes/some-theme/ and now ether page.php or content-page.php I am not sure.
I have a Drupal site and the Drupal site's admin is not able to access the edit views page.
Lately, the site has also had the problem of Content Access permissions which required me to rebuild the permissions.However, the warning that 'Content Access Permissions need to be rebuilt' continues to persist.
Whenever I goto admin>build>views page, it redirects me back to admin>build page.
Could it be a problem of content access permissions? Should I rebuild it? Would it solve the problem.Its a cumbersome process and many a times, the permissions are not built properly so I was hoping to avoid it. Is there another way of doing it than through the admin console.
When you get redirected back to the build, it's because the path doesn't exist.
In Drupal when you go to admin/build/views, it try
admin/build/views
admin/build
admin
The problem is that views isn't installed, or that you need to clear the menu cache, which can be done at admin/settings/performance. If you needed permission, you would get an access denied page instead.
This happened to me, because somehow my views UI got disabled. I enabled it again on the module page and problem solved.
I made some pages in Wordpress and displayed a navigation so the user can click to go to those pages.
When you click on any of the links, other than the Home link, it will go to a 404 Page not Found Page and display a message as the one below:
The requested URL /new_mtt/about-us-2
was not found on this server.
I realized I don't have a page.php file. Do I need that in order to view pages other than the index?
Why are my pages not working correctly?
There has to be a .htaccess-file in your Wordpress-directory. In there should be the rules for url rewriting.
The problem could be: that file is missing, the file is corrupt or mod_rewrite is not allowed.
You most likely need to regenerate your permalinks -- that solves the problem around 90% of the time. Click on Settings, Permalink; then pick any option that's not selected, hit Save, pick the option you originally wanted again (likely a custom structure with %postname%), hit save again, and verify that it saved.
If it can't save, as with the previous answer, make sure you check that your .htaccess file has global write access.