Title: plugin_sandbox_scrape
Published: April 25, 2014
Last modified: February 24, 2026

---

# plugin_sandbox_scrape( string $plugin )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/plugin_sandbox_scrape/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/functions/plugin_sandbox_scrape/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/plugin_sandbox_scrape/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/plugin_sandbox_scrape/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/plugin_sandbox_scrape/?output_format=md#wp--skip-link--target)

Loads a given plugin attempt to generate errors.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/plugin_sandbox_scrape/?output_format=md#parameters)󠁿

 `$plugin`stringrequired

Path to the plugin file relative to the plugins directory.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/plugin_sandbox_scrape/?output_format=md#source)󠁿

    ```php
    function plugin_sandbox_scrape( $plugin ) {
    	if ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) {
    		define( 'WP_SANDBOX_SCRAPING', true );
    	}

    	wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin );
    	include_once WP_PLUGIN_DIR . '/' . $plugin;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/plugin.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-admin/includes/plugin.php#L2394)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/plugin.php#L2394-L2401)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/plugin_sandbox_scrape/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_register_plugin_realpath()](https://developer.wordpress.org/reference/functions/wp_register_plugin_realpath/)`wp-includes/plugin.php` |

Register a plugin’s real path.

  |

| Used by | Description | 
| [resume_plugin()](https://developer.wordpress.org/reference/functions/resume_plugin/)`wp-admin/includes/plugin.php` |

Tries to resume a single plugin.

  | 
| [activate_plugin()](https://developer.wordpress.org/reference/functions/activate_plugin/)`wp-admin/includes/plugin.php` |

Attempts activation of plugin in a “sandbox” and redirects on success.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/plugin_sandbox_scrape/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.4.0](https://developer.wordpress.org/reference/since/4.4.0/) | Function was moved into the `wp-admin/includes/plugin.php` file. | 
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fplugin_sandbox_scrape%2F)
before being able to contribute a note or feedback.