| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 13 | public function rollback($version) |
||
| 14 | { |
||
| 15 | global $title, $parent_file; |
||
| 16 | $plugin = plugin_basename(glsr()->file); |
||
| 17 | $parent_file = 'edit.php?post_type='.glsr()->post_type; |
||
| 18 | $title = _x('Rollback Site Reviews', 'admin-text', 'site-reviews'); |
||
| 19 | $nonce = 'upgrade-plugin_'.$plugin; |
||
| 20 | $url = 'update.php?action=upgrade-plugin&plugin='.urlencode($plugin); |
||
| 21 | wp_enqueue_script('updates'); |
||
| 22 | require_once ABSPATH.'wp-admin/admin-header.php'; |
||
| 23 | $upgrader = new PluginUpgrader( |
||
| 24 | new \Plugin_Upgrader_Skin(compact('title', 'nonce', 'url', 'plugin')) |
||
| 25 | ); |
||
| 26 | $upgrader->rollback($version); |
||
| 27 | require_once ABSPATH.'wp-admin/admin-footer.php'; |
||
| 28 | } |
||
| 48 |