File tree Expand file tree Collapse file tree 3 files changed +42
-2
lines changed Expand file tree Collapse file tree 3 files changed +42
-2
lines changed Original file line number Diff line number Diff line change @@ -5236,7 +5236,14 @@ private function parse_settings( &$plugin_info ) {
52365236 $this->_anonymous_mode = false;
52375237 } else {
52385238 $this->_enable_anonymous = $this->get_bool_option( $plugin_info, 'enable_anonymous', true );
5239- $this->_anonymous_mode = $this->get_bool_option( $plugin_info, 'anonymous_mode', false );
5239+ $this->_anonymous_mode = (
5240+ $this->get_bool_option( $plugin_info, 'anonymous_mode', false ) ||
5241+ (
5242+ $this->apply_filters( 'playground_anonymous_mode', true ) &&
5243+ ! empty( $_SERVER['HTTP_HOST'] ) &&
5244+ FS_Site::is_playground_wp_environment_by_host( $_SERVER['HTTP_HOST'] )
5245+ )
5246+ );
52405247 }
52415248 $this->_permissions = $this->get_option( $plugin_info, 'permissions', array() );
52425249 $this->_is_bundle_license_auto_activation_enabled = $this->get_option( $plugin_info, 'bundle_license_auto_activation', false );
Original file line number Diff line number Diff line change @@ -208,6 +208,39 @@ static function is_localhost_by_address( $url ) {
208208 );
209209 }
210210
211+ /**
212+ * @author Leo Fajardo (@leorw)
213+ * @since 2.9.1
214+ *
215+ * @param string $host
216+ *
217+ * @return bool
218+ */
219+ static function is_playground_wp_environment_by_host ( $ host ) {
220+ // Services aimed at providing a WordPress sandbox environment.
221+ $ sandbox_wp_environment_domains = array (
222+ // InstaWP
223+ 'instawp.xyz ' ,
224+
225+ // TasteWP
226+ 'tastewp.com ' ,
227+
228+ // WordPress Playground
229+ 'playground.wordpress.net ' ,
230+ );
231+
232+ foreach ( $ sandbox_wp_environment_domains as $ domain ) {
233+ if (
234+ fs_ends_with ( $ host , '. ' . $ domain ) ||
235+ fs_ends_with ( $ host , '- ' . $ domain )
236+ ) {
237+ return true ;
238+ }
239+ }
240+
241+ return false ;
242+ }
243+
211244 function is_localhost () {
212245 return ( WP_FS__IS_LOCALHOST_FOR_SERVER || self ::is_localhost_by_address ( $ this ->url ) );
213246 }
Original file line number Diff line number Diff line change 1515 *
1616 * @var string
1717 */
18- $ this_sdk_version = '2.9.0.1 ' ;
18+ $ this_sdk_version = '2.9.0.2 ' ;
1919
2020 #region SDK Selection Logic --------------------------------------------------------------------
2121
You can’t perform that action at this time.
0 commit comments