insideout10 / wordlift-plugin

WordLift brings the power of Artificial Intelligence to beautifully organize content. Attract new readers and get their true attention.
https://wordlift.io
GNU General Public License v2.0
102 stars 42 forks source link

Incompatibility with Yoast SEO #156

Closed ziodave closed 9 years ago

ziodave commented 9 years ago

An issue has been spotted on http://geobuiz.com/ that is using Yoast SEO Premium plugin - it can be seen when sharing this entity page here: http://geobuiz.com/entity/alessandro-nuzzo/ that the attributes (share information and metadata of the page) are derived from the latest blog post (this one http://geobuiz.com/alessandro-nuzzo-from-leica-geosystems-showcases-a-mobile-mapping-device-leica-pegasus-backpack/) rather than being left empty or derived directly from the entity page.

See https://github.com/insideout10/wordlift-plugin/issues/148

ziodave commented 9 years ago

In Yoast's class-metabox.php:22 there's the following code:

add_action( 'wp_insert_post', array( $this, 'save_postdata' ) );

which runs the following code:

        $meta_boxes = apply_filters( 'wpseo_save_metaboxes', array() );
        $meta_boxes = array_merge( $meta_boxes, $this->get_meta_field_defs( 'general', $post->post_type ), $this->get_meta_field_defs( 'advanced' ) );

        foreach ( $meta_boxes as $key => $meta_box ) {
            $data = null;
            if ( 'checkbox' === $meta_box['type'] ) {
                $data = isset( $_POST[ self::$form_prefix . $key ] ) ? 'on' : 'off';
            }
            else {
                if ( isset( $_POST[ self::$form_prefix . $key ] ) ) {
                    $data = $_POST[ self::$form_prefix . $key ];
                }
            }
            if ( isset( $data ) ) {
                self::set_value( $key, $data, $post_id );
            }
        }

which applies the information from the current form to the post we create (via wp_insert_post) in the background.

ziodave commented 9 years ago

Pushed with 3.0.14