How to remove Database Table in WordPress via Function file?

Add this to functions.php function delete_wpbr_rank_math_sc_analytics() { if ( ! isset( $_GET[‘delete_wpbr_rank_math_sc_analytics’] ) ) { return; } global $wpdb; $wpdb->query( “DROP TABLE IF EXISTS wpbr_rank_math_sc_analytics” ); } add_action( ‘admin_init’, ‘delete_wpbr_rank_math_sc_analytics’ ); Visit this URL: https://yoursite.com/wp-admin/?delete_wpbr_rank_math_sc_analytics Obviously change “yoursite.com” to your actual domain. I made it so you have to visit a specific URL so it … Read more

Im unable to login to my wordpress

It looks like your site has tried to update from 5.4 to 5.5 but failed, and you’re left with a mix of the two versions that doesn’t work. in 5.4, wp-settings line 70 called wp_unregister_GLOBALS() which was defined in wp-includes/load.php, loaded from wp-settings line 34 in 5.5, wp_unregister_GLOBALS has been deprecated and a placeholder is … Read more

What is an arbitrary URL?

Arbitrary by definition is: Based on random choice or personal whim, rather than any reason or system. WordPress sometimes generates URLs automatically and systemically. For example, whenever you create a new WordPress page it will, by default simply generate a URL based on the slug of the page title. example.com/my-page-title/ We can change this but … Read more

Cache WP remote_get HTTP Response using Transients

function display_api_response() { $body = get_transient( ‘my_remote_response_value’ ); if ( false === $body ) { $api_url = “https://randletter2020.herokuapp.com”; $response = wp_remote_get($api_url); if (200 !== wp_remote_retrieve_response_code($response)) { return; } $body = wp_remote_retrieve_body($response); set_transient( ‘my_remote_response_value’, $body, 5*MINUTE_IN_SECONDS ); } if (‘a’ === $body) { echo ‘A wins’; } else { // Do something else. } } add_action(‘init’, … Read more

MITM risk of not sanitizing?

This is the official answer from the WordPress Plugin Review Team: PHP runs processes one at a time. If step 1 is “Validate” and step 2 is save, then between step 1 and 2 is where a MITM happens. Now. You may be thinking “But come on, nothing could possibly happen there! That’s too fast!” … Read more

add mediaelement.js plugins into WordPress video player control bar

You can alter the mediaelement.js feature-set using the mejs_settings hook. Settings Overview Defaults are: playpause, current, progress, duration, tracks, volume, fullscreen. Add the plugin to the array as needed to extend the features. add_filter(‘mejs_settings’, function ($settings) { $settings[‘features’] = array(…,’jumpforward’); return $settings; }); Make sure to enqueue the plugin itself: wp_enqueue_script( ‘mejs-plugin-name’, ‘path_to_plugin_file’, array(‘wp-mediaelement’), null, … Read more