Compare user meta values before update them

So you need to check if the values for a single user meta field are different or the same as the new values? If so, you don’t need to check the current values. Simply update the meta field regardless. It will be slower to check the current values and there is no benefit to doing … Read more

Help with AJAX request

The code you provided is on the right track, but it’s possible that the issue you’re facing is related to WordPress’s admin-ajax.php handling. Here’s how you can modify your code to make sure you stay on the same page after submitting the form: Change the form action to the current page instead of admin-ajax.php. Form: … Read more

Create custom dashboard for plugin

The first parameter to wp_enqueue_script()—in this case, dashboard—is the handle of the script. The handle can be pre-registered using wp_register_script(), and that’s where the script’s path will be set. dashboard isn’t one of the default scripts that WordPress registers, but it’s entirely possible some other entity has registered it. Looking at the example code that … Read more

List Hidden Plugins

The potentially nefarious plugin might filter itself out of the plugins list table by attaching a filter callback to all_plugins hook, which is used in WP_Plugins_List_Table->prepare_items(). One option could be that you inspect the global $wp_filter variable and see, if there are any suspicious (but what counts as suspicious?) callbacks attached to the above hook. … Read more

Add/remove tools from tinymce

Try this and adjust the tools as you wish: $settings = array( ‘text_area_name’=> ‘the_data’, ‘textarea_rows’ => 27, ‘teeny’ => false, ‘media_buttons’ => true, ‘quicktags’ => true, ‘tinymce’ => array ( ‘paste_as_text’ => true, ‘toolbar1’ => ‘formatselect, bold, italic, underline, bullist, numlist, blockquote, alignleft, aligncenter, alignright’, ‘toolbar2’ => ‘strikethrough, forecolor, pastetext, removeformat, charmap, link, unlink, redo, … Read more

Error 403 on wp-admin – Redirection to upgrade.php

The Error 403 with a redirection to upgrade.php in a WordPress site’s admin area can be a bit tricky to diagnose and resolve, as it can stem from various issues, including file permissions, server configuration, database problems, or corrupted files. Let’s go through some steps to troubleshoot and potentially resolve this issue: File Permissions: Incorrect … Read more