Пример #1
0
 /**
  * @covers FrmDb::uninstall
  */
 public function test_uninstall()
 {
     $this->set_as_user_role('administrator');
     $frmdb = new FrmDb();
     $uninstalled = $frmdb->uninstall();
     $this->assertTrue($uninstalled);
     $this->markTestIncomplete('Make sure uninstall is complete');
     $this->do_tables_exist(false);
     $this->assertEmpty(get_option('frm_db_version', true));
     $this->assertEmpty(get_option('frm_options', true));
     // TODO: Check if roles exist FrmAppHelper::frm_capabilities()
     // TODO: Check if any posts exist for extra types
     // TODO: Check if transients exist: frmpro_css, frm_options, frmpro_options, %frm_form_fields%
 }
 public static function uninstall()
 {
     check_ajax_referer('frm_ajax', 'nonce');
     if (current_user_can('administrator')) {
         $frmdb = new FrmDb();
         $frmdb->uninstall();
         //disable the plugin and redirect after uninstall so the tables don't get added right back
         deactivate_plugins(FrmAppHelper::plugin_folder() . '/formidable.php', false, false);
         echo esc_url_raw(admin_url('plugins.php?deactivate=true'));
     } else {
         $frm_settings = FrmAppHelper::get_settings();
         wp_die($frm_settings->admin_permission);
     }
     wp_die();
 }
 public static function uninstall()
 {
     FrmAppHelper::permission_check('administrator');
     check_ajax_referer('frm_ajax', 'nonce');
     $frmdb = new FrmDb();
     $frmdb->uninstall();
     //disable the plugin and redirect after uninstall so the tables don't get added right back
     deactivate_plugins(FrmAppHelper::plugin_folder() . '/formidable.php', false, false);
     echo esc_url_raw(admin_url('plugins.php?deactivate=true'));
     wp_die();
 }