Created
          April 23, 2014 01:40 
        
      - 
      
- 
        Save lordspace/11200213 to your computer and use it in GitHub Desktop. 
    Log plugin activation errors.
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| // install it in mu-plugins | |
| add_action('activated_plugin', 'dbg_log_error', 0, 2); | |
| function dbg_log_error($plugin, $network_wide) { | |
| if (ob_get_length() == 0) { | |
| return ; | |
| } | |
| $buff = ''; | |
| $buff .= "Plugin: $plugin\n"; | |
| $buff .= sprintf("Network Wide: %s\n", $network_wide ? 'No' : 'Yes'); | |
| $buff .= "Output:\n"; | |
| $buff .= ob_get_contents() . "\n\n"; | |
| file_put_contents(WP_CONTENT_DIR. '/plugin_activation_error.log', $buff, FILE_APPEND); | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment