Пример #1
0
 public function can_fix()
 {
     if (GRAV_TESTS::is_editable()) {
         $path = $this->get_wp_config_path();
         if ($path && wp_is_writable($path)) {
             if ($contents = file_get_contents($path)) {
                 $contents = GRAV_TESTS::remove_comments($contents);
                 if (preg_match('/define[^;]*WP_DEBUG.*(true|TRUE)[^;]*/s', $contents, $matches)) {
                     return true;
                 }
             }
         }
     }
     return false;
 }
 public function can_fix()
 {
     if (GRAV_TESTS::is_editable()) {
         $plugin_file = ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
         if (file_exists($plugin_file) && function_exists('activate_plugin')) {
             require_once $plugin_file;
             if (class_exists('Plugin_Upgrader') && method_exists('Plugin_Upgrader', 'upgrade')) {
                 return true;
             }
         }
     }
     return false;
 }