Is it safe to use admin-ajax.php in the frontend?

See documentation here but don’t miss the note 2 and the following points : AJAX on the front-end is more complicated, ajaxurl is not defined so you have to call it with wp_localize_script(). you have to use wp_ajax_nopriv_{action} for non logged in users there could be security issue !!! About the third point : Be … Read more

Allow only Admin role to access plugin settings/options page

The 3rd argument of add_options_page is the capability required for this page to be displayed to the user. Then to allow only admin to use this page, you have to set a capability which is only owned by admin, like activate_plugins. So change read to activate_plugins like this: add_options_page( ‘MyPlugin Options’, ‘MyPlugin Options’, ‘activate_plugins’, ‘myplugin-options’, … Read more

WordPress reliability

The things you describe are certainly signs of a site build that isn’t too healthy. What can happen in it? Anything. Who knows. What are practical steps to get it under control? There are roughly three components to WP site build: code, generated files (typically uploads), database state (config and content). You take control of … Read more

Child Themes and Updating Parent Theme

They are referring to the source PHP, JavaScript, and CSS and really any other files contained within the parent theme’s directory. If you have not modified the files within the parent theme, you shouldn’t have much to worry about. Your posts, pages, and other content should not be deleted from updating a theme. It is … Read more