{"id":120197,"date":"2020-05-12T09:06:11","date_gmt":"2020-05-12T09:06:11","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/snapshots\/"},"modified":"2024-12-04T09:51:04","modified_gmt":"2024-12-04T09:51:04","slug":"snapshots","status":"publish","type":"plugin","link":"https:\/\/twd.wordpress.org\/plugins\/snapshots\/","author":15233756,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"2.8.2","stable_tag":"2.8.2","tested":"6.7.5","requires":"6.6","requires_php":"7.4","requires_plugins":null,"header_name":"Snapshots","header_author":"EverPress","header_description":"Quickly Create SnapShots of your development sites and restore them with a click.","assets_banners_color":"e3dcd5","last_updated":"2024-12-04 09:51:04","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"https:\/\/xaver.dev","rating":3.7,"author_block_rating":0,"active_installs":20,"downloads":5531,"num_ratings":3,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0":{"tag":"1.0","author":"everpress","date":"2020-08-03 08:55:11"},"2.0":{"tag":"2.0","author":"everpress","date":"2020-08-17 14:07:59"},"2.1":{"tag":"2.1","author":"everpress","date":"2020-12-22 13:22:39"},"2.2":{"tag":"2.2","author":"everpress","date":"2020-12-31 08:47:34"},"2.3":{"tag":"2.3","author":"everpress","date":"2022-01-28 15:45:52"},"2.4":{"tag":"2.4","author":"everpress","date":"2022-07-08 10:47:53"},"2.5.0":{"tag":"2.5.0","author":"everpress","date":"2022-07-11 13:34:25"},"2.6.0":{"tag":"2.6.0","author":"everpress","date":"2023-03-13 18:41:29"},"2.7.0":{"tag":"2.7.0","author":"everpress","date":"2023-03-13 18:42:06"},"2.8.0":{"tag":"2.8.0","author":"everpress","date":"2024-12-03 20:55:21"},"2.8.1":{"tag":"2.8.1","author":"everpress","date":"2024-12-03 21:00:37"},"2.8.2":{"tag":"2.8.2","author":"everpress","date":"2024-12-04 09:51:04"}},"upgrade_notice":[],"ratings":{"1":1,"2":0,"3":0,"4":0,"5":2},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3202237,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3202237,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3202237,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3202237,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","2.0","2.1","2.2","2.3","2.4","2.5.0","2.6.0","2.7.0","2.8.0","2.8.1","2.8.2"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[153,2985,734,22382],"plugin_category":[59],"plugin_contributors":[132235,165179],"plugin_business_model":[],"class_list":["post-120197","plugin","type-plugin","status-publish","hentry","plugin_tags-database","plugin_tags-dev","plugin_tags-development","plugin_tags-snapshots","plugin_category-utilities-and-tools","plugin_contributors-everpress","plugin_contributors-xaverb","plugin_committers-everpress","plugin_committers-xaverb"],"banners":{"banner":"https:\/\/ps.w.org\/snapshots\/assets\/banner-772x250.png?rev=3202237","banner_2x":"https:\/\/ps.w.org\/snapshots\/assets\/banner-1544x500.png?rev=3202237","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/snapshots\/assets\/icon-128x128.png?rev=3202237","icon_2x":"https:\/\/ps.w.org\/snapshots\/assets\/icon-256x256.png?rev=3202237","generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p>You are developing things on a WordPress site and would like to have a <em>snapshot<\/em> of the current state of your site? <strong>SnapShots<\/strong> will help you save states of your WordPress environment.<\/p>\n\n<ul>\n<li>Save snapshots of your site with a simple click.<\/li>\n<li>Name your snapshots for easy distinction.<\/li>\n<li>SnapShots stores current location and redirects after restore.<\/li>\n<li>Stores and restores database tables and files in upload folder.<\/li>\n<li>Automatically logs in current user.<\/li>\n<li>Automatically clears old snapshots with same name.<\/li>\n<li>Small footprint and minimal UI.<\/li>\n<\/ul>\n\n<p>[youtube https:\/\/www.youtube.com\/watch?v=-ybCpL5Ri44]<\/p>\n\n<h3>Options<\/h3>\n\n<p>All options are defined via constants and can get overwritten with a filter. The format of options is<\/p>\n\n<pre><code>SNAPSHOTS_[OPTION_NAME]\n<\/code><\/pre>\n\n<p>Best to define your custom option constants in the <code>wp-config.php<\/code> file.<\/p>\n\n<p>You can use filters options like<\/p>\n\n<pre><code>add_filter( 'snapshots_[option_name]', function( $default_option ){\n return $my_option;\n});\n<\/code><\/pre>\n\n<h4>Default Options<\/h4>\n\n<pre><code>\/\/ Default save location.\nSNAPSHOTS_FOLDER : WP_CONTENT_DIR . '\/.snapshots'\n\n\/\/ add '--allow-root' to each command if you run the commands as root.\nSNAPSHOTS_CLI_ALLOW_ROOT: false\n\n\/\/ define the location of your 'wp' binaries.\nSNAPSHOTS_CLI_PATH: '\/usr\/local\/bin'\n\n\/\/ Number of shots kept with the same name.\nSNAPSHOTS_MAX_SHOTS: 2\n\n\/\/ SnapShot includes files from content folder.\nSNAPSHOTS_SAVE_FILES: true\n\n\/\/ SnapShot includes location (URL) during creation to redirect on restore.\nSNAPSHOTS_SAVE_LOCATION: true\n<\/code><\/pre>\n\n<!--section=installation-->\n<ol>\n<li>Upload <code>snapshosts<\/code> to the <code>\/wp-content\/plugins\/<\/code> directory.<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress.<\/li>\n<li>Click on \"Click here to create your first Snapshot!\" in the admin bar to create your first Snapshot.<\/li>\n<li>Restore the saved snapshot by clicking on the menu entry and confirm.<\/li>\n<li>All tables not used in the current SnapShot with the DB prefix will be removed!<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id='what%20are%20the%20requirements%20for%20snapshots'><h3>What are the requirements for SnapShots<\/h3><\/dt>\n<dd><p>You need <a href=\"https:\/\/wp-cli.org\/\">WP CLI<\/a> installed (at least version 2.2) and PHP must be able to execute external programs with PHPs <a href=\"https:\/\/www.php.net\/manual\/en\/function.exec.php\"><code>exec<\/code><\/a><\/p><\/dd>\n<dt id='does%20it%20work%20without%20wp%20cli%3F'><h3>Does it work without WP CLI?<\/h3><\/dt>\n<dd><p>No, WP CLI is essential here and SnapShots will not work without it. You will not be able to activate the plugin without the addon.<\/p><\/dd>\n<dt id='does%20it%20work%20with%20%22local%22'><h3>Does it work with \"Local\"<\/h3><\/dt>\n<dd><p>Yes, the plugin has been tested with the <a href=\"https:\/\/localwp.com\/\">amazing tool<\/a> from WPEngine and works out of the box.<\/p><\/dd>\n<dt id='snapshots%20requires%20the%20php%20in%20your%20path%20environment'><h3>Snapshots requires the php in your PATH environment<\/h3><\/dt>\n<dd><p>SnapShots tries to find the <code>php<\/code> binary on your system. If it can't find it, you will get this error. You can define the location of your <code>php<\/code> binary by open your terminal and running<\/p>\n\n<pre><code>`\n<\/code><\/pre>\n\n<p>dirname $(which php)\n    `<\/p>\n\n<p>This returns the directory of your php binary. Use this location to define the constant <code>SNAPSHOTS_PHP_PATH<\/code> in your <code>wp-config.php<\/code> file. For example:<\/p>\n\n<pre><code>`\n<\/code><\/pre>\n\n<p>define( 'SNAPSHOTS_PHP_PATH', '\/usr\/local\/bin' );\n    `<\/p>\n\n<p><strong>Don't include the <code>php<\/code> binary in the path!<\/strong><\/p><\/dd>\n<dt id='your%20home%20urls%20do%20not%20match'><h3>Your Home URLs do not match<\/h3><\/dt>\n<dd><p>Snapshots checks if the home URL of your site matches the one from <code>wp option get home<\/code>. If they are not equal it often that the <code>DB_HOST<\/code> variable is not defined correctly. This also happens if you use a socket for your MySql connection (Local WP).<\/p>\n\n<p>Update your DB_HOST variable in your <code>wp-config.php<\/code> file to something like this:<\/p>\n\n<pre><code>`\n<\/code><\/pre>\n\n<p>define( 'DB_HOST', 'localhost:\/tmp\/ysql\/mysqld.sock' );\n    `<\/p>\n\n<p>This should not affect the regular usage of your site. If you encounter any problems, You can wrap the statement like so:<\/p>\n\n<pre><code>`\n<\/code><\/pre>\n\n<p>if ( defined( 'WP_CLI' ) &amp;&amp; WP_CLI ) {\n    define( 'DB_HOST', 'localhost:\/tmp\/ysql\/mysqld.sock' );\n}else{\n    define( 'DB_HOST', 'localhost' );\n}\n    `<\/p><\/dd>\n<dt id='snapshots%20requires%20the%20%22exec%22%20method'><h3>Snapshots requires the \"exec\" method<\/h3><\/dt>\n<dd><p>SnapShots uses the PHP <a href=\"https:\/\/www.php.net\/manual\/en\/function.exec.php\"><code>exec<\/code><\/a> method to execute the WP CLI commands.<\/p>\n\n<pre><code>`\n<\/code><\/pre><\/dd>\n<dt id='snapshots%20requires%20wp-cli%21'><h3>Snapshots requires WP-CLI!<\/h3><\/dt>\n<dd><p>SnapShots requires the <a href=\"https:\/\/wp-cli.org\/\">WP-CLI<\/a> to be installed on your system. Please install it and make sure it is available in your <code>PATH<\/code> environment.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>2.8.2<\/h4>\n\n<ul>\n<li>instructions for namespaces<\/li>\n<li>update github workflow, no actual changes to the plugin<\/li>\n<\/ul>\n\n<h4>2.8.1<\/h4>\n\n<ul>\n<li>updated file strucutre<\/li>\n<\/ul>\n\n<h4>2.8.0<\/h4>\n\n<ul>\n<li>Tested up to PHP 8.3<\/li>\n<li>fixed: redirects now work with fragments in URLs<\/li>\n<li>change: current snapshot names is now stored in the database (not in the localstorage anymore)<\/li>\n<\/ul>\n\n<h4>2.7.0<\/h4>\n\n<ul>\n<li>better error handling<\/li>\n<li>keyboard search<\/li>\n<li>tested up to 6.1<\/li>\n<li>implemented upgrade mechanism for future update routines<\/li>\n<\/ul>\n\n<h4>2.6.0<\/h4>\n\n<ul>\n<li>fixed: Snapshots with numbers are now recognized.<\/li>\n<li>moved to external script and styles<\/li>\n<\/ul>\n\n<h4>2.5.0<\/h4>\n\n<ul>\n<li>store last use snapshots in localstorage<\/li>\n<\/ul>\n\n<h4>2.4<\/h4>\n\n<ul>\n<li>Now requires at least PHP 7.0<\/li>\n<\/ul>\n\n<h4>2.3<\/h4>\n\n<ul>\n<li>updated usage of CLI commands for better support<\/li>\n<\/ul>\n\n<h4>2.2<\/h4>\n\n<ul>\n<li>checks for ZIPAchive and falls back to PCLZIP if not available<\/li>\n<li>automatically checks the <code>home_url<\/code> and do a <code>search-replace<\/code> if necessary<\/li>\n<\/ul>\n\n<h4>2.1<\/h4>\n\n<ul>\n<li>Updated look in the dropdown menu.<\/li>\n<\/ul>\n\n<h4>2.0<\/h4>\n\n<ul>\n<li>Breaking changes: Snapshosts are now stored in a subdirectory.<\/li>\n<li>added option to remove snapshots from the UI<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>Initial release<\/li>\n<\/ul>","raw_excerpt":"Quickly Create SnapShots of your development sites and restore them with a click.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/120197","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=120197"}],"author":[{"embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/everpress"}],"wp:attachment":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=120197"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=120197"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=120197"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=120197"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=120197"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=120197"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}