automattic / zoninator Goto Github PK
View Code? Open in Web Editor NEWCuration made easy! Create "zones" then add and order your content straight from the WordPress Dashboard.
Home Page: https://wordpress.org/plugins/zoninator/
Curation made easy! Create "zones" then add and order your content straight from the WordPress Dashboard.
Home Page: https://wordpress.org/plugins/zoninator/
We have seen slow queries being generated by Zoninator, in particular a query that looks like this:
SELECT wp_posts.ID FROM wp_posts WHERE ?=? AND ( wp_posts.post_date > ?) AND wp_posts.ID NOT IN (?, ?, ?, ?, ?, ?, ?, ?) AND (((wp_posts.post_title LIKE ?) OR (wp_posts.post_excerpt LIKE ?) OR (wp_posts.post_content LIKE ?))) AND wp_posts.post_type = ? AND ((wp_posts.post_status = ? OR wp_posts.post_status = ?)) ORDER BY wp_posts.post_date DESC LIMIT ?, ?
It is in particular the NOT IN
part that causes issues, as when data grows in wp_posts
, there is more to exclude when processing the query. This can lead the database to overload, causing sites to have performance issues.
Is there any way to rewrite this without the NOT IN
?
This issue originated as a VIP Request.
Because it does, $this->post_types
becomes set without potentially additional post types that just happen to be registered after.
It doesn't look like that class variable is ever used, so it would probably be better to remove it altogether.
Also, the taxonomy should be registered with post types on late init to ensure all post types have been registered.
I'm trying to perform some actions on each query being executed on a page, using the pre_get_posts action. I'm finding that zoninator loops are executing the query twice for each loop when I use z_get_posts_in_zone to get a list of arrays.
The first one is in zoninator.php on line 1012. get_zone_posts() runs get_zone_query() which returns a new WP_Query back to get_zone_posts. https://github.com/Automattic/zoninator/blob/master/zoninator.php#L1056
The second is when get_posts is called on that query on line 1013 here. get_posts() also also creates a new WP_Query as you can see here.
I couldn't find anything to support this being the desired effect, and I can't think of a scenario in this case where running 2 queries would be needed.
Hi,
Is it possible to create a test zone for unit testing?
I have a situation where my right rail template will load only if there is a zone that populates the videos in that right rail. Now, my unit test fails because the right rail is never generated in my test post.
I looked up your code. All the setter methods are private, which makes it really hard to create any test data.
Any thoughts ?
Thanks
How about moving TODO-s here, to issues?
Currently the code to add support to a post_type to Zoninator seems to be as follows:
add_post_type_support( 'video', $GLOBALS[ 'zoninator' ]->zone_taxonomy );
register_taxonomy_for_object_type( $GLOBALS[ 'zoninator' ]->zone_taxonomy, 'video' );
// Clear Zoninator supported post types cache
unset( $GLOBALS[ 'zoninator' ]->post_types );
Would be good to have a simpler API method or function.
Related: #2
Open to a pull request adding Zone management to the Customizer? I started a new Zoninator under this premise, but decided I don't really want to maintain it.
Currently when the zone lock times out the user is forced back to the tab/window where they were locked into a zone.
This is pretty bad UX and it would be nicer if it just silently took them out of the zone.
Reporting in Chrome (latest version) on Windows/Mac
It doesn't display posts for a zone, on the backend below is an error in the query generated by get_zone_query() method:
WordPress database error Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'wordpress.wp_postmeta.meta_value' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by for query SELECT wp_posts.* FROM wp_posts INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) WHERE 1=1 AND ( \n wp_postmeta.meta_key = '_zoninator_order_4942'\n) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'future' OR wp_posts.post_status = 'draft' OR wp_posts.post_status = 'pending' OR wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY wp_postmeta.meta_value+0 ASC made by WP_Query::get_posts, referer: http://localhost/wordpress/wp-admin/admin.php?page=zoninator
Further, executed the select query directly on mysql, got the following response:
Error Code: 1055. Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'wordpress.wp_postmeta.meta_value' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
Checked mysql documentation and got the following from there:
https://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html
Please check the issue.
Thanks.
WordPress 4.4 broke the CSS for the left nav. It reverted to the old tab design in a jumbled list. Will be working on a fix for this later today.
PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Zoninator_ZonePosts_Widget has a deprecated constructor in /tmp/wordpress/src/wp-content/plugins/zoninator/widget.zone-posts.php on line 6
For users who don't have access to modifying their PHP, it would be nice to include an enhanced widget where they can set the layout with template tags and basic HTML.
Example:
<div class="post-thumbnail">%thumbnail%</div>
<h4>%title%</h4>
<p>%excerpt%</p>
Or something similar where you can pass parameters.
It looks like the drag-and-drop is not working on mobile devices. If you touch one of the stories in the zones to change the rank, it will scroll all the way to the bottom making it impossible to move the stories up or around. This was reproduced on iPhone6/iPhone6+ in Safari/Chrome. However, this does work properly on iPad.
Zoninator needs to be patched to deal with potential term splitting issues as of 4.2.
The main issue is that posts are related to zones via meta key, and that meta key is a reference to the zone's term ID. If a zone were to be updated (not its posts, but the zone itself), and that zone were a shared term, it would be split and the post relationships would be broken.
Would be nice to have a better icon then the default wrench.
Automatically create feeds for each zone that return a zone's posts: /zones/my-zone-slug/feed/
Suggested by John Cionci.
Hello,
We noticed that the versioning of your plugin is off at https://wpackagist.org/search?q=zoninator
It's not picking up the 0.7
release and it is still pulling the 0.6
version with the deprecated constructor name in Zoninator_ZonePosts_Widget
.
Is there any way you can push the release to https://wpackagist.org
? Do you have any plans to add the plugin to https://packagist.org/
?
Thank you in advance!
Would like to see a Zone Manager shortcode with the ability to add loops to pages.
For example:
[zonemanager zone="developingnews" showposts="1"]
As of 4.4, WordPress includes WP API infrastructure and provides a framework for creating custom REST endpoints. It is suggested that plugin authors convert their custom AJAX based APIs to use WP API.
The goal is to convert zoninator's existing AJAX endpoints into WP API, along with all the JavaScript client-side changes required.
We have a latest update form Vip to update Zoninator plugin to 0.7.
But we found out that, the version number in https://github.com/Automattic/zoninator/tree/0.7 was not changed.
Can you please change the version number, it's confusing.
Ability to limit the number of posts you can add per zone. Requested by Steve from LocalTV.
The current UI for managing zones was inspired by the Menus UI. Sadly, this doesn't "scale" when you have lots and lots of zones.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.