WordPress hack code issue, help required

This will try to load PHP code from one of three servers, the three base64-encoded strings, and execute the first one it successfully fetches on your server. Those domains do still exist, so this is potentially an active hack. They don’t return any data to me when tested but I hadn’t set a domain in … Read more

Too few arguments – wp_login action

The custom role needs the read capability to view the backend. Example: $your_role = get_role(‘your_custom_role’); $your_role->add_cap( ‘read’ ); See: https://wordpress.org/documentation/article/roles-and-capabilities/#read Ideally, this should only be done once, e.g. when activating your plugin or theme.

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

audio tags no longer working

You may need to update your shortcode function to generate the audio player using proper HTML markup instead of returning the raw shortcode text. Here’s an example: function myshortcode_shortcode() { $audio_url=”path/file.mp3″; $audio_markup = ‘<audio controls><source src=”‘ . esc_url($audio_url) . ‘” type=”audio/mp3″></audio>’; return $audio_markup; }

Sanitization of register_setting()

You can use sanitize_text_field exactly as you are. From the function’s documentation: Checks for invalid UTF-8, Converts single < characters to entities Strips all tags Removes line breaks, tabs, and extra whitespace Strips percent-encoded characters sanitize_text_field() is already defined as a function in WordPress, so you don’t need to change anything. The sanitize_callback parameter takes … Read more

Issue with WordPress Plugin Activation Hook and Table Creation

Not sure if this helps but try doing this in the main plugin file: require plugin_dir_path(__FILE__).’inc/plugin-setting.php’; require plugin_dir_path(__FILE__).’inc/db.php’; // Register activation hook in the main plugin file register_activation_hook(__FILE__, ‘wp_comment_reactions’); Move your function wp_comment_reactions to the db.php file and call it from the main plugin file.

Is Nonce Verification (CSRF) required for WordPress Custom Bulk User Actions?

In WordPress, nonces (number used once) are security tokens that help protect against CSRF (Cross-Site Request Forgery) attacks. Nonce verification is generally recommended for actions that involve user interactions to ensure that the request is legitimate and not forged by a malicious party. When it comes to custom bulk user actions in WordPress, nonce verification … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)