How to block plugin activations with no known user or coming from unknown IP address range?
How to block plugin activations with no known user or coming from unknown IP address range?
How to block plugin activations with no known user or coming from unknown IP address range?
How to check if tables in WordPress still exists after activations
In a WPMU setup the account information is sent to the wp_signup table before being passed to the wp_users table. an easy fix for this is: function your_disable_activation( $user, $user_email, $key, $meta=”” ) { // Activate the user $user_id = wpmu_activate_signup( $key ); wp_set_auth_cookie( $user_id, true, is_ssl() ); wp_redirect( /*redirect to */ site_url() ); exit; … Read more
You should first make sure that you don’t get any JavaScript errors. Plugin activations and edit buttons are using JavaScript and if your code has issues, it might break some portions of the website. Use Chrome Inspect to check it for JS errors.
You should just not add code outside of actions (callbacks attached to hooks and filters). Else your variables might conflict with global variables. The default/first action for a plugin bootstrap would be (depending on the type of plugin): plugins_loaded or muplugins_loaded. Attach hooks from there on to wp_loaded if you want stuff to run on … Read more
50 is relatively not much, and you should create them on the plugin activation hook. For more then 100 (just pulled the number out of my ass 😉 do your own testing on some slow shared hosting) I would create a settings page and initialize the DB from there. The reason is that users do … Read more
Unless you had something installed to track it, then no, that information is lost. WP does not track that information out of the box. Post revisions are the closest thing you will find to an audit log, and those only track changes to posts. You have 2 options to retrieve it: Try to remember which … Read more
You might want to add your own plugin to deactivate their plugin (silently). First open their main plugin file and see where the plugin hooks (or filters) in. Then unhook their plugin … and your’s as well. <?php /** Plugin Name: Deactivate other plugin */ add_action( ‘the_same_hook’, ‘removeOtherPlugin’, PHP_INT_MAX -1 ); function removeOtherPlugin() { remove_filter( current_filter(), … Read more
Themes don’t currently have activation/deactivation/installation/uninstallation hooks. Your best bet is to “fake” it somehow, perhaps with a function that only executes one time, based on a switch that gets toggled when the function executes. e.g.: <?php function wpse45817_theme_activation() { // globalize our switch global $wpse45817_theme_activation_switch; // Check to see if the switch is set if … Read more
You have two options either define you register methods as static and then you can avoid instantiating your classes or even calling the MyActivation function ex: File1.php: Class File1 { static function file1_register() { //register some short codes; } static function file1_unregister() { //unregister previous short codes; } } File2.php: Class File2 { static function … Read more