old htaccess multi-site problem with guten editor

This website is from way back when wordpress multisite was actually wordpressmu – and way back then we had to do tricky things with htaccess to tell wp where to put non-admin user files and such.

Since then it’s been updated many times –

we had a problem some time ago where iphone / ios devices can not watch mp4 videos with the site, but if we disable htaccess they can.

Anyway… today I found the gutendumb editor can not saved or publish. (shows the publish error)

after disabled all security plugins, and contacting host – they find that removing the htaccess file and replacing it with a default wp htaccess file – fixing the posts won’t save / publish thing.

Problem now… all the old pictures and other files are 404 / missing. I’m not even sure if users can upload pics and stuff without the old htaccess being active.

Ideas for this dillemma?

Here is old htaccess:

text/x-generic .htaccess-bak03Aug ( Non-ISO extended-ASCII English text )

#Header set Accept-Ranges bytes

order allow,deny
deny from 79.35.
deny from 95.250.
deny from 91.101.
deny from 72.168.0.
allow from all

<IfModule mod_expires.c>

# Enable expirations
ExpiresActive On

# passwqord login
# ErrorDocument 401 "Unauthorized Access - new extra security - two step login - If you are human - username is: yes. If you agree to our terms of service - the password is: yes."
# ErrorDocument 403 "Forbidden"
# <FilesMatch "wp-login.php">
# AuthName "Authorized Only - If you are human - username is: yes. If you agree to our terms of service - the password is: yes."
# AuthType Basic
# AuthUserFile /home/flasgcom/.wpaoslogin
# require valid-user
# </FilesMatch>

# Default directive

# My favicon
ExpiresByType image/x-icon "access plus 1 month?

# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"

# CSS
ExpiresByType text/css "access 1 week?

# Javascript
ExpiresByType application/javascript "access plus 1 week"

</IfModule>

# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

RewriteEngine On
RewriteBase /

#uploaded files
RewriteRule ^(.*/)?files/$ index.php [L]
RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteCond %{REQUEST_URI} ^.*/wp-admin$
RewriteRule ^(.+)$ $1/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]
RewriteRule . index.php [L]

<IfModule mod_security.c>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>

#AddType video/mp4 .mp4 .m4v
#AddType video/ogg .ogv
#AddType video/webm .webm

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php73” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php73 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

Here is new htacess:

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

What do you all think I should do?

Steve

  • Dimitris
    • Support Star

    Hello there Steve

    I can see that the initial file is using

    RewriteEngine On
    RewriteBase /

    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]

    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ $1/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]
    RewriteRule . index.php [L]

    which seems like a modified version for a subfolder multisite originally installed from v.3.0 to v.3.4.2. : https://wordpress.org/support/article/htaccess/#wordpress-3-4-and-below

    The replacement you added though, it’s for single sites. Even if you use the proper rules though for subfolder multisite (https://wordpress.org/support/article/htaccess/#wordpress-3-5-and-up) then images won’t be available as they are stored in different paths in server.

    Unless you can’t re-upload all images and set them again in posts, pages, theme options etc, then keeping the old structure it’d be wiser.

    Can you try to remove all rules and only keep the original WP part that I posted above, just to be sure that there aren’t any other rules causing this?

    Anyway… today I found the gutendumb editor can not saved or publish. (shows the publish error)

    Can you also please share the exact error you’re seeing?

    Warm regards,

    Dimitris

  • djsteve
    • Site Builder, Child of Zeus

    thanks for helping with this.

    I changed the htaccess to:

    RewriteEngine On
    RewriteBase /

    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]

    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ $1/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]
    RewriteRule . index.php [L]

    then tried new post logged in as admin.. after adding title and line of text, went to upload picture – after slected from ,local files, I get this error (in pink bg in editor)

    The response is not a valid JSON response.

    also noticed near top of page, getting "updating failed" (in pink bg)

    click publish – get 'publishing failed'

    under site health, I am seeing the 500 error for rest api again as well:

    The REST API is one way WordPress, and other applications, communicate with the server. One example is the block editor screen, which relies on this to display, and save, your posts and pages.

    The REST API call gave the following unexpected result: (500)


    thoughts?

  • Nastia
    • Support Rock Star

    Hello djsteve

    Hope you’re doing well!

    The 500 error is a PHP error, please enable debug mode to get more details about it. Add the following lines in the wp-config.php file:

    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );

    Please make sure that you insert these lines above /* That’s all, stop editing! Happy blogging. */ in the wp-config.php file.

    Please replicate the 500 error. This way all errors will be saved in the debug.log file inside the /wp-content/ directory. Let us know what errors will be shown in the debug.log file.

    In the current .htaccess file, please replace this line:

    RewriteRule . index.php [L]

    With this line

    RewriteRule . /index.php [L]

    And if the issue still persists, please try removing these lines and see if it will fix the issue:

    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]

    I would suggest keeping a copy of the old .htaccess file and removing one line after line from thee, every time testing if the site will work again. So this way you will find which line is causing 500 error, and which line when removed causing 404 for images.

    Let us know how it went!

    Kind regards,

    Nastia

  • djsteve
    • Site Builder, Child of Zeus

    okay – several things did..

    changed the htacess as suggested – adding the slash..

    then tried post – it failed.

    dug into debug – removed an onld spamshielf mu-plugin thing, deactivated all-in-one-seo, removed the other two lines suggested above from htaccess.

    also removed some other unused plugins.

    then a post published, and image was able to upload.

    then re-added these two lines to htaccess:

    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]

    and then I get the ‘The response is not a valid JSON response.’ when trying to add another image to a post – and at top I get ‘Updating failed’ – so it seems those two lines are some issue maybe.

    I did do a quick debug, had a lot of stuff pop, so I removed a bunch of duplicate things and I THINK these are the things from it:

    [04-Aug-2019 19:29:01 UTC] PHP Deprecated:  Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 19:29:01 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39

    [04-Aug-2019 19:29:05 UTC] PHP Notice: Undefined index: aiosp_cpostactive in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/all-in-one-seo-pack/aioseop_class.php on line 3870

    [04-Aug-2019 19:29:05 UTC] PHP Warning: array_key_exists() expects parameter 2 to be array, bool given in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/all-in-one-seo-pack/aioseop_class.php on line 4735

    [04-Aug-2019 19:29:08 UTC] PHP Notice: register_sidebar was called <strong>incorrectly</strong>. No 'id' was set in the arguments array for the "Sidebar 1" sidebar. Defaulting to "sidebar-1". Manually set the 'i' to "sidebar-1" to silence this notice and keep existing sidebar content. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 4.2.0.) in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/functions.php on line 4773
    [04-Aug-2019 19:29:08 UTC] PHP Notice: Trying to get property 'post_status' of non-object in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/link-template.php on line 371
    [04-Aug-2019 19:29:08 UTC] PHP Notice: Trying to get property 'ID' of non-object in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/link-template.php on line 383
    [04-Aug-2019 19:29:08 UTC] PHP Notice: Trying to get property 'ID' of non-object in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/link-template.php on line 394
    [04-Aug-2019 19:29:08 UTC] PHP Notice: Trying to get property 'ID' of non-object in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/link-template.php on line 347

    [04-Aug-2019 19:29:09 UTC] PHP Notice: Only variables should be assigned by reference in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/themes/chaoticsoul/functions.php on line 390
    [04-Aug-2019 19:29:09 UTC] PHP Notice: get_current_site_name is <strong>deprecated</strong> since version 3.9.0! Use get_current_site() instead. in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/functions.php on line 4435

    I run again with all-in-one-seo deactivated.. tried to edit post, add another picture and publish (which failed) – and see this in debug log:

    text/x-log debug.log ( ASCII English text, with very long lines )

    [04-Aug-2019 21:41:51 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:41:51 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:41:51 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:41:51 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:41:54 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:41:54 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:41:54 UTC] PHP Notice: register_sidebar was called <strong>incorrectly</strong>. No <code>id</code> was set in the arguments array for the "Sidebar 1" sidebar. Defaulting to "sidebar-1". Manually set the <code>id</code> to "sidebar-1" to silence this notice and keep existing sidebar content. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 4.2.0.) in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/functions.php on line 4773
    [04-Aug-2019 21:41:54 UTC] PHP Notice: Trying to get property 'post_status' of non-object in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/link-template.php on line 371
    [04-Aug-2019 21:41:54 UTC] PHP Notice: Trying to get property 'ID' of non-object in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/link-template.php on line 383
    [04-Aug-2019 21:41:54 UTC] PHP Notice: Trying to get property 'ID' of non-object in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/link-template.php on line 394
    [04-Aug-2019 21:41:54 UTC] PHP Notice: Trying to get property 'ID' of non-object in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/link-template.php on line 347
    [04-Aug-2019 21:41:55 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:41:55 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:41:55 UTC] PHP Notice: Only variables should be assigned by reference in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/themes/chaoticsoul/functions.php on line 390
    [04-Aug-2019 21:41:55 UTC] PHP Notice: get_current_site_name is <strong>deprecated</strong> since version 3.9.0! Use get_current_site() instead. in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/functions.php on line 4435
    [04-Aug-2019 21:41:55 UTC] PHP Notice: register_sidebar was called <strong>incorrectly</strong>. No <code>id</code> was set in the arguments array for the "Sidebar 1" sidebar. Defaulting to "sidebar-1". Manually set the <code>id</code> to "sidebar-1" to silence this notice and keep existing sidebar content. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 4.2.0.) in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/functions.php on line 4773
    [04-Aug-2019 21:41:55 UTC] PHP Notice: Only variables should be assigned by reference in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/themes/anarchy/functions.php on line 387
    [04-Aug-2019 21:41:55 UTC] PHP Notice: Only variables should be assigned by reference in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/themes/anarchy/functions.php on line 387
    [04-Aug-2019 21:41:55 UTC] PHP Notice: Only variables should be assigned by reference in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/themes/anarchy/functions.php on line 387
    [04-Aug-2019 21:41:55 UTC] PHP Notice: Only variables should be assigned by reference in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/themes/anarchy/functions.php on line 387
    [04-Aug-2019 21:41:55 UTC] PHP Notice: get_current_site_name is <strong>deprecated</strong> since version 3.9.0! Use get_current_site() instead. in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/functions.php on line 4435
    [04-Aug-2019 21:41:55 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:41:55 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:41:56 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:41:56 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:41:56 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:41:56 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:41:56 UTC] PHP Notice: register_sidebar was called <strong>incorrectly</strong>. No <code>id</code> was set in the arguments array for the "Sidebar 1" sidebar. Defaulting to "sidebar-1". Manually set the <code>id</code> to "sidebar-1" to silence this notice and keep existing sidebar content. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 4.2.0.) in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/functions.php on line 4773
    [04-Aug-2019 21:41:56 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:41:56 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:41:57 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:41:57 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:41:57 UTC] PHP Notice: register_sidebar was called <strong>incorrectly</strong>. No <code>id</code> was set in the arguments array for the "Sidebar 1" sidebar. Defaulting to "sidebar-1". Manually set the <code>id</code> to "sidebar-1" to silence this notice and keep existing sidebar content. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 4.2.0.) in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/functions.php on line 4773
    [04-Aug-2019 21:41:57 UTC] PHP Notice: Trying to get property 'post_status' of non-object in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/link-template.php on line 371
    [04-Aug-2019 21:41:57 UTC] PHP Notice: Trying to get property 'ID' of non-object in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/link-template.php on line 383
    [04-Aug-2019 21:41:57 UTC] PHP Notice: Trying to get property 'ID' of non-object in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/link-template.php on line 394
    [04-Aug-2019 21:41:57 UTC] PHP Notice: Trying to get property 'ID' of non-object in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/link-template.php on line 347
    [04-Aug-2019 21:41:58 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:41:58 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:41:58 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:41:58 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:41:58 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:41:58 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:03 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:03 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:03 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:03 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:04 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:04 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:05 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:05 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:05 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:05 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:05 UTC] PHP Notice: register_sidebar was called <strong>incorrectly</strong>. No <code>id</code> was set in the arguments array for the "Sidebar 1" sidebar. Defaulting to "sidebar-1". Manually set the <code>id</code> to "sidebar-1" to silence this notice and keep existing sidebar content. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 4.2.0.) in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/functions.php on line 4773
    [04-Aug-2019 21:42:05 UTC] PHP Notice: Trying to get property 'post_status' of non-object in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/link-template.php on line 371
    [04-Aug-2019 21:42:05 UTC] PHP Notice: Trying to get property 'ID' of non-object in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/link-template.php on line 383
    [04-Aug-2019 21:42:05 UTC] PHP Notice: Trying to get property 'ID' of non-object in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/link-template.php on line 394
    [04-Aug-2019 21:42:05 UTC] PHP Notice: Trying to get property 'ID' of non-object in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/link-template.php on line 347
    [04-Aug-2019 21:42:06 UTC] PHP Notice: Only variables should be assigned by reference in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/themes/chaoticsoul/functions.php on line 390
    [04-Aug-2019 21:42:06 UTC] PHP Notice: get_current_site_name is <strong>deprecated</strong> since version 3.9.0! Use get_current_site() instead. in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/functions.php on line 4435
    [04-Aug-2019 21:42:07 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:07 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:07 UTC] PHP Notice: register_sidebar was called <strong>incorrectly</strong>. No <code>id</code> was set in the arguments array for the "Sidebar 1" sidebar. Defaulting to "sidebar-1". Manually set the <code>id</code> to "sidebar-1" to silence this notice and keep existing sidebar content. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 4.2.0.) in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/functions.php on line 4773
    [04-Aug-2019 21:42:07 UTC] PHP Notice: get_bloginfo was called with an argument that is <strong>deprecated</strong> since version 2.2.0! The <code>text_direction</code> option is deprecated for the family of <code>bloginfo()</code> functions. Use the <code>is_rtl()</code> function instead. in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/functions.php on line 4652
    [04-Aug-2019 21:42:07 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:07 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:08 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:08 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:08 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:08 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:09 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:09 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:10 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:10 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:10 UTC] PHP Notice: register_sidebar was called <strong>incorrectly</strong>. No <code>id</code> was set in the arguments array for the "Sidebar 1" sidebar. Defaulting to "sidebar-1". Manually set the <code>id</code> to "sidebar-1" to silence this notice and keep existing sidebar content. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 4.2.0.) in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/functions.php on line 4773
    [04-Aug-2019 21:42:10 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:10 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:11 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:11 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:11 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:11 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:11 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:11 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:11 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:11 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:13 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:13 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:13 UTC] PHP Notice: register_sidebar was called <strong>incorrectly</strong>. No <code>id</code> was set in the arguments array for the "Sidebar 1" sidebar. Defaulting to "sidebar-1". Manually set the <code>id</code> to "sidebar-1" to silence this notice and keep existing sidebar content. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 4.2.0.) in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/functions.php on line 4773
    [04-Aug-2019 21:42:13 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:13 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:16 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:16 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:20 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:20 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:20 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:20 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:22 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:22 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:22 UTC] PHP Notice: register_sidebar was called <strong>incorrectly</strong>. No <code>id</code> was set in the arguments array for the "Sidebar 1" sidebar. Defaulting to "sidebar-1". Manually set the <code>id</code> to "sidebar-1" to silence this notice and keep existing sidebar content. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 4.2.0.) in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/functions.php on line 4773
    [04-Aug-2019 21:42:22 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:22 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:23 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:23 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39
    [04-Aug-2019 21:42:23 UTC] PHP Notice: register_sidebar was called <strong>incorrectly</strong>. No <code>id</code> was set in the arguments array for the "Sidebar 1" sidebar. Defaulting to "sidebar-1". Manually set the <code>id</code> to "sidebar-1" to silence this notice and keep existing sidebar content. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 4.2.0.) in /home/flasgcom/public_html/adultsonlyspace.com/wp-includes/functions.php on line 4773
    [04-Aug-2019 21:42:25 UTC] PHP Deprecated: Function create_function() is deprecated in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/blogtemplates/blogtemplatesfiles/blog_templates.php on line 37
    [04-Aug-2019 21:42:25 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ds_network_discussion_settings has a deprecated constructor in /home/flasgcom/public_html/adultsonlyspace.com/wp-content/plugins/ds_network_discussion_settings.php on line 39

    not sure it’s really an issue, but here is code in the “ds_network_discussion_settings.php” – which is in plugins folder..

    application/x-httpd-php ds_network_discussion_settings.php ( PHP script text )

    <?php
    /*
    Plugin Name: Network Discussion Settings
    Plugin URI: http://dsader.snowotherway.org
    Description: WP multisite Networka SuperAdmins can prevent sub-site users from seeing contact email and ip addys. Only users who are registered and logged in can submit comments as well.
    Author: D Sader
    Version: 0.3
    Author URI: http://dsader.snowotherway.org
    Network: true

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    Pluginspiration:
    Steve wanted a plugin to enable a network setting: 'Users must be registered and logged in to comment' -so I added it and a couple more
    http://wordpress.org/support/topic/problem-hiding-ipemail-from-users-in-multisite

    This plugin could serve as a template for creating other Network Settings pages.

    Wordpress functions
    pre_option_ ...
    __return_true()
    __return_false()
    __return_zero()
    __return_empty_array()
    __return_null()
    __return_empty_string()

    */

    class ds_network_discussion_settings {

    function ds_network_discussion_settings() {
    add_filter( 'plugins_loaded', array(&$this, 'network_discussion') );
    add_action( 'wpmu_options', array(&$this, 'options_page') );
    add_action( 'update_wpmu_options', array(&$this, 'update') );
    add_filter( 'get_comment_author_IP', array(&$this,'filter_ip') );
    add_filter( 'comment_email', array(&$this,'filter_ip') );
    add_action( 'manage_users_columns', array(&$this,'remove_user_column') );
    }

    function remove_user_column($column_headers) {
    if (!is_super_admin())
    unset($column_headers['email']);
    return $column_headers;
    }

    function filter_ip($ip) {
    if (is_super_admin()) {
    return $ip;
    } else {
    return;
    }
    }

    function return_value() {
    $ds_network_discussion_items = get_site_option( 'ds_network_discussion_settings' );
    return $ds_network_discussion_items['close_comments_days_old'];
    }

    function network_discussion() {
    $ds_network_discussion_items = get_site_option( 'ds_network_discussion_settings' );
    if( is_array( $ds_network_discussion_items ) == false )
    $ds_network_discussion_items = array();
    if( '0' == $ds_network_discussion_items[ 'ds_network_discussion_settings' ] )
    return;
    add_filter( 'pre_option_close_comments_days_old', array(&$this,'return_value') );

    //unset($ds_network_discussion_items['close_comments_days_old']);
    //$ds_network_discussion_items = array_values($ds_network_discussion_items);

    foreach ( (array) $ds_network_discussion_items as $key => $val ) {
    if ( '1' == $val )
    add_filter( 'pre_option_'.$key, '__return_true' );

    if ( '0' == $val )
    add_filter( 'pre_option_'.$key, '__return_zero');
    }
    }

    function options_page() {
    $ds_network_discussion_items = get_site_option( 'ds_network_discussion_settings' );
    if( is_array( $ds_network_discussion_items ) == false )
    $ds_network_discussion_items = array();

    //add more options to override here from options-discussion.php
    //attemtp to override only those settings with a single checkbox '1' or none setting
    //I only wanted to add one site_option sto wanted all discussion options under one setting, but it got too complicated if trying to save more than just the checkbox type options.

    $ds_network_discussion_settings = array(
    'ds_network_discussion_settings' => __('Override the following individual site discussion settings - check any/all of the following'),
    //Default article settings
    'default_pingback_flag' => __('Attempt to notify any blogs linked to from the article'),
    //Other comment settings
    'require_name_email' => __('Comment author must fill out name and e-mail'),
    'comment_registration' => __('Users must be registered and logged in to comment'),
    //E-mail me whenever
    'comments_notify' => __('E-mail site admin whenever: ').__('Anyone posts a comment'),
    'moderation_notify' => __('E-mail site admin whenever: ').__('A comment is held for moderation'),
    //Before a comment appears
    'comment_moderation' => __('Before a comment appears: ').__('Comment must be manually approved'),
    'comment_whitelist' => __('Before a comment appears: ').__('Comment author must have a previously approved comment'),
    //Avatar Display
    // 'show_avatars' => __('Show Avatars'),
    //Other Writing settings settings
    'use_smilies' => __('Convert emoticons like <code>:-)</code> and <code>:-P</code> to graphics on display'),
    'use_balanceTags' => __('WordPress should correct invalidly nested XHTML automatically'),

    );

    echo '<h3>' . __('Network Discussion Settings') . '</h3>';
    echo '
    <table class="form-table">
    <tr valign="top">
    <th scope="row">' . __('Enable Settings Override') . '<br /><small>' . __('These settings use "pre_options" and take effect on every site immediatley. The first box must be checked for any others to have effect.') . '</small></th>
    <td>
    ';

    foreach ( (array) $ds_network_discussion_settings as $key => $val ) {
    echo '<label>
    <input type="hidden" name="ds_network_discussion_settings[' . $key . ']" value="0" />
    <input type="checkbox" name="ds_network_discussion_settings[' . $key . ']" value="1"' . ( isset( $ds_network_discussion_items[$key] ) ? checked( $ds_network_discussion_items[$key], "1", false ) : 0 ) . ' /> ' . esc_html( $val ) . '
    </label><br />';
    }

    echo '<label>
    <input type="hidden" name="ds_network_discussion_settings[close_comments_for_old_posts]" value="0" />
    <input type="checkbox" name="ds_network_discussion_settings[close_comments_for_old_posts]" value="1"' . ( isset( $ds_network_discussion_items['close_comments_for_old_posts'] ) ? checked( $ds_network_discussion_items['close_comments_for_old_posts'], "1", false ) : 0 ) . ' />'. sprintf( __('Automatically close comments on articles older than %s days'), '</label><label for="ds_network_discussion_settings[close_comments_days_old]"><input name="ds_network_discussion_settings[close_comments_days_old]" type="number" min="0" step="1" id="ds_network_discussion_settings[close_comments_days_old]" value="' . esc_attr($ds_network_discussion_items['close_comments_days_old']) . '" class="small-text" />') . '
    </label><br />';

    echo '
    </td>
    </tr>
    </table>
    ';
    }

    function update() {
    update_site_option('ds_network_discussion_settings', $_POST['ds_network_discussion_settings']);
    }
    }

    if (class_exists("ds_network_discussion_settings")) {
    $ds_network_discussion_settings = new ds_network_discussion_settings();
    }

    if ( ! function_exists('wp_notify_postauthor') ) :
    /**
    * Notify an author (and/or others) of a comment/trackback/pingback on a post.
    */
    function wp_notify_postauthor( $comment_id, $deprecated = null ) {
    if ( null !== $deprecated ) {
    _deprecated_argument( __FUNCTION__, '3.8' );
    }

    $comment = get_comment( $comment_id );
    if ( empty( $comment ) )
    return false;

    $post = get_post( $comment->comment_post_ID );
    $author = get_userdata( $post->post_author );

    // Who to notify? By default, just the post author, but others can be added.
    $emails = array();
    if ( $author ) {
    $emails[] = $author->user_email;
    }

    /**
    * Filter the list of email addresses to receive a comment notification.
    *
    * By default, only post authors are notified of comments. This filter allows
    * others to be added.
    *
    * @since 3.7.0
    *
    * @param array $emails An array of email addresses to receive a comment notification.
    * @param int $comment_id The comment ID.
    */
    $emails = apply_filters( 'comment_notification_recipients', $emails, $comment_id );
    $emails = array_filter( $emails );

    // If there are no addresses to send the comment to, bail.
    if ( ! count( $emails ) ) {
    return false;
    }

    // Facilitate unsetting below without knowing the keys.
    $emails = array_flip( $emails );

    /**
    * Filter whether to notify comment authors of their comments on their own posts.
    *
    * By default, comment authors aren't notified of their comments on their own
    * posts. This filter allows you to override that.
    *
    * @since 3.8.0
    *
    * @param bool $notify Whether to notify the post author of their own comment.
    * Default false.
    * @param int $comment_id The comment ID.
    */
    $notify_author = apply_filters( 'comment_notification_notify_author', false, $comment_id );

    // The comment was left by the author
    if ( $author && ! $notify_author && $comment->user_id == $post->post_author ) {
    unset( $emails[ $author->user_email ] );
    }

    // The author moderated a comment on their own post
    if ( $author && ! $notify_author && $post->post_author == get_current_user_id() ) {
    unset( $emails[ $author->user_email ] );
    }

    // The post author is no longer a member of the blog
    if ( $author && ! $notify_author && ! user_can( $post->post_author, 'read_post', $post->ID ) ) {
    unset( $emails[ $author->user_email ] );
    }

    // If there's no email to send the comment to, bail, otherwise flip array back around for use below
    if ( ! count( $emails ) ) {
    return false;
    } else {
    $emails = array_flip( $emails );
    }

    $comment_author_domain = @gethostbyaddr($comment->comment_author_IP);

    // The blogname option is escaped with esc_html on the way into the database in sanitize_option
    // we want to reverse this for the plain text arena of emails.
    $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);

    switch ( $comment->comment_type ) {
    case 'trackback':
    $notify_message = sprintf( __( 'New trackback on your post "%s"' ), $post->post_title ) . "rn";
    /* translators: 1: website name, 2: author IP, 3: author domain */
    // $notify_message .= sprintf( __('Website: %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "rn";
    // $notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "rn";
    $notify_message .= __('Excerpt: ') . "rn" . $comment->comment_content . "rnrn";
    $notify_message .= __('You can see all trackbacks on this post here: ') . "rn";
    /* translators: 1: blog name, 2: post title */
    $subject = sprintf( __('[%1$s] Trackback: "%2$s"'), $blogname, $post->post_title );
    break;
    case 'pingback':
    $notify_message = sprintf( __( 'New pingback on your post "%s"' ), $post->post_title ) . "rn";
    /* translators: 1: comment author, 2: author IP, 3: author domain */
    // $notify_message .= sprintf( __('Website: %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "rn";
    // $notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "rn";
    $notify_message .= __('Excerpt: ') . "rn" . sprintf('[...] %s [...]', $comment->comment_content ) . "rnrn";
    $notify_message .= __('You can see all pingbacks on this post here: ') . "rn";
    /* translators: 1: blog name, 2: post title */
    $subject = sprintf( __('[%1$s] Pingback: "%2$s"'), $blogname, $post->post_title );
    break;
    default: // Comments
    $notify_message = sprintf( __( 'New comment on your post "%s"' ), $post->post_title ) . "rn";
    /* translators: 1: comment author, 2: author IP, 3: author domain */
    // $notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "rn";
    // $notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "rn";
    // $notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "rn";
    // $notify_message .= sprintf( __('Whois : http://whois.arin.net/rest/ip/%s'), $comment->comment_author_IP ) . "rn";
    $notify_message .= __('Comment: ') . "rn" . $comment->comment_content . "rnrn";
    $notify_message .= __('You can see all comments on this post here: ') . "rn";
    /* translators: 1: blog name, 2: post title */
    $subject = sprintf( __('[%1$s] Comment: "%2$s"'), $blogname, $post->post_title );
    break;
    }
    $notify_message .= get_permalink($comment->comment_post_ID) . "#commentsrnrn";
    $notify_message .= sprintf( __('Permalink: %s'), get_comment_link( $comment_id ) ) . "rn";

    if ( user_can( $post->post_author, 'edit_comment', $comment_id ) ) {
    if ( EMPTY_TRASH_DAYS )
    $notify_message .= sprintf( __('Trash it: %s'), admin_url("comment.php?action=trash&c=$comment_id") ) . "rn";
    else
    $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=delete&c=$comment_id") ) . "rn";
    $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=spam&c=$comment_id") ) . "rn";
    }

    $wp_email = 'wordpress@' . preg_replace('#^www.#', '', strtolower($_SERVER['SERVER_NAME']));

    if ( '' == $comment->comment_author ) {
    $from = "From: "$blogname" <$wp_email>";
    if ( '' != $comment->comment_author_email )
    $reply_to = "Reply-To: $comment->comment_author_email";
    } else {
    $from = "From: "$comment->comment_author" <$wp_email>";
    if ( '' != $comment->comment_author_email )
    $reply_to = "Reply-To: "$comment->comment_author_email" <$comment->comment_author_email>";
    }

    $message_headers = "$fromn"
    . "Content-Type: text/plain; charset="" . get_option('blog_charset') . ""n";

    if ( isset($reply_to) )
    $message_headers .= $reply_to . "n";

    /**
    * Filter the comment notification email text.
    *
    * @since 1.5.2
    *
    * @param string $notify_message The comment notification email text.
    * @param int $comment_id Comment ID.
    */
    $notify_message = apply_filters( 'comment_notification_text', $notify_message, $comment_id );

    /**
    * Filter the comment notification email subject.
    *
    * @since 1.5.2
    *
    * @param string $subject The comment notification email subject.
    * @param int $comment_id Comment ID.
    */
    $subject = apply_filters( 'comment_notification_subject', $subject, $comment_id );

    /**
    * Filter the comment notification email headers.
    *
    * @since 1.5.2
    *
    * @param string $message_headers Headers for the comment notification email.
    * @param int $comment_id Comment ID.
    */
    $message_headers = apply_filters( 'comment_notification_headers', $message_headers, $comment_id );

    foreach ( $emails as $email ) {
    @wp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers );
    }

    return true;
    }
    endif;

    if ( !function_exists('wp_notify_moderator') ) :
    /**
    * Notifies the moderator of the blog about a new comment that is awaiting approval.
    */
    function wp_notify_moderator($comment_id) {
    global $wpdb;

    if ( 0 == get_option( 'moderation_notify' ) )
    return true;

    $comment = get_comment($comment_id);
    $post = get_post($comment->comment_post_ID);
    $user = get_userdata( $post->post_author );
    // Send to the administration and to the post author if the author can modify the comment.
    $emails = array( get_option( 'admin_email' ) );
    if ( user_can( $user->ID, 'edit_comment', $comment_id ) && ! empty( $user->user_email ) ) {
    if ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) )
    $emails[] = $user->user_email;
    }

    $comment_author_domain = @gethostbyaddr($comment->comment_author_IP);
    $comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'");

    // The blogname option is escaped with esc_html on the way into the database in sanitize_option
    // we want to reverse this for the plain text arena of emails.
    $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);

    switch ( $comment->comment_type ) {
    case 'trackback':
    $notify_message = sprintf( __('A new trackback on the post "%s" is waiting for your approval'), $post->post_title ) . "rn";
    $notify_message .= get_permalink($comment->comment_post_ID) . "rnrn";
    // $notify_message .= sprintf( __('Website : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "rn";
    // $notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "rn";
    $notify_message .= __('Trackback excerpt: ') . "rn" . $comment->comment_content . "rnrn";
    break;
    case 'pingback':
    $notify_message = sprintf( __('A new pingback on the post "%s" is waiting for your approval'), $post->post_title ) . "rn";
    $notify_message .= get_permalink($comment->comment_post_ID) . "rnrn";
    // $notify_message .= sprintf( __('Website : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "rn";
    // $notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "rn";
    $notify_message .= __('Pingback excerpt: ') . "rn" . $comment->comment_content . "rnrn";
    break;
    default: // Comments
    $notify_message = sprintf( __('A new comment on the post "%s" is waiting for your approval'), $post->post_title ) . "rn";
    $notify_message .= get_permalink($comment->comment_post_ID) . "rnrn";
    // $notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "rn";
    // $notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "rn";
    // $notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "rn";
    // $notify_message .= sprintf( __('Whois : http://whois.arin.net/rest/ip/%s'), $comment->comment_author_IP ) . "rn";
    $notify_message .= __('Comment: ') . "rn" . $comment->comment_content . "rnrn";
    break;
    }

    $notify_message .= sprintf( __('Approve it: %s'), admin_url("comment.php?action=approve&c=$comment_id") ) . "rn";
    if ( EMPTY_TRASH_DAYS )
    $notify_message .= sprintf( __('Trash it: %s'), admin_url("comment.php?action=trash&c=$comment_id") ) . "rn";
    else
    $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=delete&c=$comment_id") ) . "rn";
    $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=spam&c=$comment_id") ) . "rn";

    $notify_message .= sprintf( _n('Currently %s comment is waiting for approval. Please visit the moderation panel:',
    'Currently %s comments are waiting for approval. Please visit the moderation panel:', $comments_waiting), number_format_i18n($comments_waiting) ) . "rn";
    $notify_message .= admin_url("edit-comments.php?comment_status=moderated") . "rn";

    $subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), $blogname, $post->post_title );
    $message_headers = '';

    /**
    * Filter the list of recipients for comment moderation emails.
    *
    * @since 3.7.0
    *
    * @param array $emails List of email addresses to notify for comment moderation.
    * @param int $comment_id Comment ID.
    */
    $emails = apply_filters( 'comment_moderation_recipients', $emails, $comment_id );

    /**
    * Filter the comment moderation email text.
    *
    * @since 1.5.2
    *
    * @param string $notify_message Text of the comment moderation email.
    * @param int $comment_id Comment ID.
    */
    $notify_message = apply_filters( 'comment_moderation_text', $notify_message, $comment_id );

    /**
    * Filter the comment moderation email subject.
    *
    * @since 1.5.2
    *
    * @param string $subject Subject of the comment moderation email.
    * @param int $comment_id Comment ID.
    */
    $subject = apply_filters( 'comment_moderation_subject', $subject, $comment_id );

    /**
    * Filter the comment moderation email headers.
    *
    * @since 2.8.0
    *
    * @param string $message_headers Headers for the comment moderation email.
    * @param int $comment_id Comment ID.
    */
    $message_headers = apply_filters( 'comment_moderation_headers', $message_headers, $comment_id );

    foreach ( $emails as $email ) {
    @wp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers );
    }

    return true;
    }
    endif;
    ?>

    So – I don’t know – guess the main thing is the two lines in the htaccess for some reason?

    Steve

  • Dimitris
    • Support Star

    Hello Steve

    removed the other two lines suggested above from htaccess.

    also removed some other unused plugins.

    then a post published, and image was able to upload.

    When you made it work like this, was there anything else that wasn’t working? Please advise!

    If so, can you please try to replace

    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]

    with

    RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^[_0-9a-zA-Z-]+/(.*.php)$ $1 [L]

    and give this another try?

    Also, is it possible to create a staging environment so we could better and safer troubleshoot this?

    By that I mean a complete and exact copy of the whole multisite installation into another location/folder in the same server, using a separate database. Let us know if you could build such an environment and we’ll provide a safe way to share some access details with us.

    Thank you,

    Dimitris

  • Nahid
    • Tech Support

    Hey there djsteve !

    Hope you are doing well today!

    Thank you very much for setting up the staging site for our investigation. You can send the credentials privately through our secure contact form: https://premium.wpmudev.org/contact/#i-have-a-different-question

    Send in:

    Subject: “Attn: Nahid Mohit

    – Staging Site URL

    – WordPress Admin Username

    – WordPress Admin Password

    – Login URL

    – FTP/cPanel credentials (host/username/password)

    – Link back to this thread for reference

    – Any other relevant URLs

    We’ll be looking forward to hearing back from you. Thanks!

    Kind regards,

    Nahid

  • djsteve
    • Site Builder, Child of Zeus

    well this got harder..

    so I set it up.. staging.mydomain.com

    but I just now tried to login as admin..

    and it auto pushed me to mydomain.com/wp-signup.php?new=staging

    ( The site you were looking for, http://staging.adultsonlyspace.com/, does not exist, but you can create it now! )

    Yeah, so my site is setup as mu/multisite with subdomains and I guess something is pushing it over.. not sure if this is the htaccess for the MU or if it’s a setting inside the staging sites’ DB that tells it where wp lives.. or what..

    any ideas on what to do?

  • Dimitris
    • Support Star

    Hello djsteve

    Would it be possible to share access to your hosting panel, so we can better check these installations?

    As this is a public forum, you should send us your details through our safe contact form

    https://premium.wpmudev.org/contact/#i-have-a-different-question

    using this template:

    Subject: “Attn: Dimitris

    Staging site:

    – WordPress admin (login URL/username/password)

    – (S)FTP credentials for file access (host/username/password/path of the website in question)

    – server panel (cPanel/Plesk) credentials (login URL/username/password)

    – link back to this thread for reference (e.g. https://premium.wpmudev.org/forums/topic/example-topic)

    – any other relevant urls

    Keep in mind the subject line as ensures that it gets assigned to me.

    Thank you,

    Dimitris

  • Nahid
    • Tech Support

    Hey there djsteve !

    Hope you are doing well today!

    Thank you for sending the credentials to us. In order to take a look at the issue, I tried accessing your staging site. Unfortunately, neither the live nor the staging sites are working at the moment, they are showing an "Error establishing a database connection" error message. Here's a screenshot for reference:

    I tried accessing the database via PHPMYADMIN but it seems the MySQL services are crashing (most likely due to usage of too many resources). Here's another screenshot for reference:

    May we know if you are encountering these issues as well? If so, could you get in touch with your host support and request them to address this issue?

    We'll be looking forward to hearing back from you. Thanks!

    Kind regards,

    Nahid

  • djsteve
    • Site Builder, Child of Zeus

    thanks for the heads up, and sorry about the issue / delay.

    We ran into a full hard disks issue after setting up the staging thing- and as we tried to thin things out, lots of activity kept filling it up. We finally ran into critical disk full the past 48 hours or so. about 12 hours ago we pulled about 300 GB of files, but then it seems we had some failed writes to DBs and such – and so now we are in the process of running DB check/repairs.. I assume this will be done within a couple hours and they will be back online.

    by the way, the staging area will 404 for videos that were added via rtmedia, as we decided that folder was not critical during the copy.. if it’s needed I can move that over as well, since we cleared more room on the server.

  • Nahid
    • Tech Support

    Hey there djsteve !

    Hope you are doing well today!

    We apologize about the delayed response here. Thank you for getting back to us about the updates regarding the server. I tried accessing the staging site today but I got the following error:

    May I know if you are aware of the issue and if it is related to the initial issues with the server?

    We'll be looking forward to hearing back from you. Thanks!

    Kind regards,

    Nahid

  • Nahid
    • Tech Support

    Hey there djsteve !

    Hope you are doing well today!

    Thank you very much for getting back to us with the infinite redirect issue fixed. I was able to replicate the "Gutenberg editor not saving" issue on the staging site. I opened your .htaccess file on the staging site and made this small edit suggested by my colleague Dimitris in his earlier response.

    Afterwards, I tried editing a post again and I was able to update it successfully. Here's a screenshot for reference:

    Could you please log in and check if you can replicate the issue any further? If not, could you please try making the same change in the production site as well?

    Hope this helps. We'll be looking forward to hearing back from you. Thanks!

    Kind regards,

    Nahid

  • djsteve
    • Site Builder, Child of Zeus

    Wow – thanks for the help with this!

    I wonder if this will fix the ‘videos won’t play on ios devices’ problem we;ve had forever.. described here: https://premium.wpmudev.org/forums/topic/video-files-fail-with-ios-ipad-mac-iphone-fix-wp-includesms-filesphpfile2-changes-h/

    I think all of the videos were not moved to the staging site – perhaps we can just upload a new video of something and then check it with an iphone or ipad.

  • Nahid
    • Tech Support

    Hey there djsteve !

    Hope you are doing well today!

    I’m glad that this issue is resolved :heart_eyes:

    I’m sorry to hear about the issue with the videos :disappointed: I took a look at the linked support ticket and found that my colleague Dimitris had requested for a staging site set up.

    Since we are really keen on keeping a ticket specific to one issue only, would you mind adding a video in the staging site and updating the ticket with your results so that the investigation can be resumed?

    Hope this helps. We’ll be looking forward to hearing back from you. Thanks!

    Kind regards,

    Nahid

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.