Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent indexing when blog is deleted or not public #1163

Merged
merged 4 commits into from
Nov 19, 2018
Merged

Prevent indexing when blog is deleted or not public #1163

merged 4 commits into from
Nov 19, 2018

Conversation

allan23
Copy link
Contributor

@allan23 allan23 commented Nov 12, 2018

Add additional hook for when an blog is deleted. Also conditional logic to prevent posts from getting indexed if blog is not indexable.

…ic to prevent posts from getting indexed if blog is not indexable. Fixes #1157.
@oscarssanchez
Copy link
Contributor

oscarssanchez commented Nov 13, 2018

Hi @allan23 ,

I got posts to index without any issues and only sites that were in the public category get their posts indexed.

However, these changes are also breaking creating a new post for me on any site, with this error:

error

These are my test sites:

error_settings

Individual settings for each site:

settings_1

settings_2

settings_3

settings_4

Steps to reproduce:

1.- Edit site settings and set them to deleted/archived/non-public but the main one
2.- Try to create a post on each individual site from the dashboard for any site.

@allan23
Copy link
Contributor Author

allan23 commented Nov 13, 2018

@oscarssanchez thank you for testing. I've made corrections in the latest commit. Can you please retest?

Copy link
Contributor

@oscarssanchez oscarssanchez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @allan23 ,

This is working flawless for me now!

Copy link
Contributor

@tott tott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not addressing the wp_get_sites() portion of the logic which was deprecated around wp 2.6

$sites = wp_get_sites( $args );

We also need to create a follow-up ticket to this to address the edge case of mature blogs as we need to ensure mature content will not be shown by default on a non-mature site.

Overall looks good to me

classes/class-ep-sync-manager.php Outdated Show resolved Hide resolved
classes/class-ep-api.php Outdated Show resolved Hide resolved
@tott tott merged commit 093b9eb into develop Nov 19, 2018
@allan23 allan23 deleted the fix/1157 branch February 13, 2019 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants